* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  height: 100svh;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  background:
    radial-gradient(1200px 640px at 18% 8%, #ffd08a 0%, transparent 48%),
    radial-gradient(900px 520px at 86% 18%, #7ad8ff 0%, transparent 46%),
    radial-gradient(700px 480px at 50% 100%, #ffe08a 0%, transparent 50%),
    radial-gradient(900px 520px at 50% -10%, #ffc0e0 0%, #fff4dc 42%, #c8ecff 100%);
  font-family: "Kanit", "Segoe UI", sans-serif;
  color: "#3a2418";
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#lobby-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#lobby-fg {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#lobby-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 52% at 50% 48%, rgba(255, 246, 234, 0.12) 0%, rgba(255, 232, 200, 0.18) 100%);
}

#wrap {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#game {
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 0;
}

#game canvas {
  display: block;
  touch-action: none;
}

html[data-control="pc"] #game {
  border-radius: 16px;
  box-shadow:
    0 0 0 1px rgba(255, 196, 120, 0.35),
    0 0 0 8px rgba(18, 10, 20, 0.9),
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(255, 110, 40, 0.16);
}

#hint {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #b9a8c8;
  opacity: 0.85;
}

#vol-dock {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 246, 234, 0.88);
  border: 1px solid rgba(255, 138, 58, 0.45);
  box-shadow: 0 8px 28px rgba(196, 90, 22, 0.16);
  backdrop-filter: blur(8px);
  color: #3a2418;
  font-size: 13px;
  font-weight: 700;
}

#lang-dock {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 40;
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 246, 234, 0.88);
  border: 1px solid rgba(255, 138, 58, 0.45);
  box-shadow: 0 8px 28px rgba(196, 90, 22, 0.16);
  backdrop-filter: blur(8px);
}

#lang-dock button {
  min-width: 52px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #7a4a30;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

#lang-dock button.on {
  background: #ff6a22;
  color: #fff6ea;
}

#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#auth-overlay:not([hidden]) {
  pointer-events: auto;
}

#auth-overlay[hidden] {
  display: none;
}

.auth-card {
  margin-top: 220px;
  width: min(380px, 90vw);
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: rgba(12, 8, 18, 0.92);
  border: 1px solid rgba(255, 196, 120, 0.4);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  text-align: center;
}

#auth-msg {
  min-height: 24px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #cbb8e8;
}

#google-btn {
  display: flex;
  justify-content: center;
}

.auth-note {
  margin-top: 12px;
  font-size: 12px;
  color: #8e82a8;
}

#auth-name-input {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 196, 120, 0.35);
  background: #1a1220;
  color: #fff6ea;
  font-family: inherit;
  font-size: 16px;
}

#auth-name-form button {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 999px;
  background: #ff6a22;
  color: #fff6ea;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

#vol-dock {
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
}

#lang-dock {
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
}

#touch-pad {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

#stick-base,
#hit-pad {
  pointer-events: auto;
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

#stick-base {
  left: max(14px, env(safe-area-inset-left));
  width: 138px;
  height: 138px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 246, 234, 0.08), rgba(12, 8, 18, 0.42));
  border: 2px solid rgba(255, 196, 120, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(255, 224, 138, 0.08);
}

#stick-base.on {
  border-color: rgba(255, 106, 34, 0.85);
}

#stick-knob {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 32% 28%, #fff6ea, #ffb14a 42%, #ff6a22);
  box-shadow: 0 6px 16px rgba(255, 106, 34, 0.35);
  pointer-events: none;
}

#hit-pad {
  right: max(14px, env(safe-area-inset-right));
  width: 118px;
  height: 118px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 246, 234, 0.1), rgba(12, 8, 18, 0.45));
  border: 2px solid rgba(200, 255, 58, 0.45);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  color: #fff6ea;
  font-family: inherit;
  cursor: pointer;
}

#hit-pad .hit-core {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 32% 28%, #f8ffd0, #c8ff3a 55%, #7dff6a);
  box-shadow: 0 0 18px rgba(200, 255, 58, 0.35);
}

#hit-pad.on {
  transform: scale(0.94);
  border-color: #c8ff3a;
}

.pad-lab {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff6ea;
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}

#hit-pad .pad-lab {
  bottom: 10px;
}

#rotate-hint {
  position: fixed;
  left: 50%;
  top: max(58px, env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 30;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(12, 8, 18, 0.82);
  border: 1px solid rgba(255, 196, 120, 0.4);
  color: #ffe8c8;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  max-width: 86vw;
}

@media (max-width: 420px) {
  #stick-base { width: 118px; height: 118px; }
  #hit-pad { width: 100px; height: 100px; }
  #stick-knob { width: 50px; height: 50px; }
}

