* {
  box-sizing: border-box;
}

body, html {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-main, 'Quicksand', 'Nunito', 'Zen Maru Gothic', sans-serif);
  background: var(--bg-base);
  color: var(--text-primary);
}

#app {
  display: flex;
  width: 100%;
  height: 100%;
  height: 100dvh;
  position: relative;
}

.zone {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.zone:active {
  filter: brightness(0.96);
  transform: scale(0.995);
}

.zone-left {
  background: var(--zone-left-bg);
  border-right: 2px dashed rgba(77, 171, 247, 0.35);
}

.zone-right {
  background: var(--zone-right-bg);
  border-left: 2px dashed rgba(255, 107, 107, 0.35);
}

.side-label {
  font-size: clamp(0.85rem, 2vw, 1.15rem);
  letter-spacing: 1px;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--bg-surface-translucent);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
}

.score-display {
  font-size: clamp(3.5rem, min(14vw, 18vh), 8.5rem);
  font-weight: 900;
  margin: 14px 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  color: var(--text-primary);
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.tap-indicator {
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  background: var(--bg-surface-translucent);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

#center-console {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-surface-translucent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: clamp(24px, 4.5vh, 36px) clamp(20px, 4vw, 36px);
  width: min(90vw, 440px);
  max-width: 440px;
  box-shadow: var(--shadow-float);
  text-align: center;
  z-index: 10;
  pointer-events: auto;
  font-family: var(--font-main);
  color: var(--text-primary);
}

#center-console header h1 {
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

#center-console.is-playing {
  display: none !important;
}

.launcher-link {
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 16px;
  min-height: 52px;
  padding: 8px 20px;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.launcher-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-right: 8px;
  color: var(--accent-blue);
}

.launcher-link:hover,
.launcher-link:focus-visible {
  border-color: var(--accent-blue);
  box-shadow: 0 10px 24px var(--accent-blue-glow);
  outline: none;
  transform: translateY(-3px);
}

.launcher-link:active {
  transform: translateY(1px) scale(0.98);
}

#center-console header p {
  font-size: 0.94rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
  margin-bottom: 20px;
}

.view-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hidden {
  display: none !important;
}

.game-status-msg {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.sub-status-msg {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  min-height: 24px;
  margin-bottom: 12px;
}

.btn {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  min-height: 64px;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 180ms ease;
  font-family: inherit;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-pink) 0%, #FA5252 100%);
  box-shadow: 0 10px 24px var(--accent-pink-glow);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  box-shadow: 0 14px 30px var(--accent-pink-glow);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--accent-mint) 0%, #12B886 100%);
  box-shadow: 0 10px 24px var(--accent-mint-glow);
  color: white;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  box-shadow: 0 14px 30px var(--accent-mint-glow);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border-medium);
  box-shadow: var(--shadow-soft);
  padding: 12px;
  border-radius: var(--radius-full);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--accent-blue);
  box-shadow: 0 10px 24px var(--accent-blue-glow);
}

.btn-title {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.btn-sub {
  font-size: 0.82rem;
  opacity: 0.9;
  font-weight: 700;
  margin-top: 3px;
}

.text-ready {
  color: var(--accent-yellow);
  text-shadow: 0 4px 14px var(--accent-yellow-glow);
}

.text-go {
  color: var(--accent-mint);
  text-shadow: 0 4px 14px var(--accent-mint-glow);
}

.text-error {
  color: var(--accent-pink);
  text-shadow: 0 4px 14px var(--accent-pink-glow);
}

.text-win {
  color: var(--accent-blue);
  text-shadow: 0 4px 14px var(--accent-blue-glow);
}

@media (max-width: 640px) {
  #center-console {
    padding: 24px 20px;
    width: min(92vw, 420px);
  }

  #center-console header h1 {
    font-size: 1.45rem;
  }

  .game-status-msg {
    font-size: 1.5rem;
  }
}

@media (max-height: 600px) {
  .score-display {
    font-size: clamp(2.2rem, 14vh, 4.5rem);
    margin: 4px 0;
  }

  #center-console {
    max-height: calc(100dvh - 12px);
    padding: 16px 20px;
  }
}