/* ============================================
   ROAD TO ROCK — Style System
   Aesthetic: Dark venue / vintage concert poster
   ============================================ */

:root {
  --gold: #d4a029;
  --gold-bright: #f0c040;
  --gold-dim: #8b6914;
  --amber: #c47a20;
  --red: #b8342e;
  --red-glow: #e84040;
  --green: #3cb860;
  --bg-deep: #0a0908;
  --bg-card: #141210;
  --bg-elevated: #1c1a16;
  --bg-input: #0e0d0b;
  --text-primary: #e8e0d4;
  --text-secondary: #8a8070;
  --text-muted: #5a5448;
  --border: #2a2620;
  --border-light: #3a352e;
  --font-display: 'Monoton', cursive;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  background: var(--bg-deep);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---- Video Background ---- */
#bgvid {
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 0;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: blur(4px) brightness(0.3);
}

#bgvid.hidden {
  display: none;
}

#gamevid {
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 0;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: blur(4px) brightness(0.3);
  transition: filter 1s ease;
}

#gamevid.hidden {
  display: none;
}

#gamevid.unblurred {
  filter: blur(0px) brightness(0.7);
}

/* ---- Atmospheric Layers ---- */
#noise-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 128px;
  opacity: 0.035;
  mix-blend-mode: overlay;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.6) 100%);
}

/* ---- Screen System ---- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease-out-expo), visibility 0.6s;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   LANDING SCREEN
   ============================================ */
.landing-content {
  text-align: center;
  padding: 2rem;
  max-width: 640px;
  width: 100%;
}

.title-block {
  margin-bottom: 3.5rem;
}

.title-accent {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.2s forwards;
}

.title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 400;
  line-height: 0.95;
  color: var(--gold);
  text-shadow:
    0 0 60px rgba(212, 160, 41, 0.3),
    0 0 120px rgba(212, 160, 41, 0.1);
  opacity: 0;
  animation: titleReveal 1.2s var(--ease-out-expo) 0.1s forwards;
}

.subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-top: 1.2rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.5s forwards;
}

.landing-form {
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.7s forwards;
  padding-bottom: 3rem;
}

.input-group {
  position: relative;
  margin-bottom: 2.5rem;
}

#player-name {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 0;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  text-align: center;
  outline: none;
  transition: border-color 0.3s;
}

#player-name::placeholder {
  color: var(--text-muted);
  letter-spacing: 0.3em;
}

#player-name:focus {
  border-color: var(--gold);
}

.input-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.4s var(--ease-out-expo), left 0.4s var(--ease-out-expo);
}

#player-name:focus ~ .input-line {
  width: 100%;
  left: 0;
}

.difficulty-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.difficulty-buttons {
  display: flex;
  gap: 0.75rem;
}

.diff-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

.diff-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 160, 41, 0.08), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.diff-btn:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.diff-btn:hover::before {
  opacity: 1;
}

.diff-btn:active {
  transform: translateY(0);
}

.diff-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.diff-btn:disabled:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

.diff-btn:disabled:hover::before {
  opacity: 0;
}

.name-required-hint {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--red);
  margin-top: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.name-required-hint.show {
  opacity: 1;
}

.diff-name {
  display: block;
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.35rem;
  position: relative;
}

.diff-desc {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  line-height: 1.4;
  position: relative;
}

.landing-footer {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 1s forwards;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-dim);
}

/* ============================================
   GAME SCREEN
   ============================================ */
#game {
  justify-content: flex-start;
  padding: 0;
}

.game-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 9, 8, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 5;
  flex-shrink: 0;
}

.game-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.player-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.player-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

.player-display-name {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
}

.round-indicator {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-secondary);
}

.round-current {
  color: var(--gold);
  font-weight: 700;
}

.round-sep {
  margin: 0 0.15em;
  color: var(--text-muted);
}

.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 2rem;
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
}

/* Score Panel */
.score-panel {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
}

.score-item {
  text-align: center;
}

.score-value {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--text-primary);
  transition: color 0.3s, transform 0.3s var(--ease-out-back);
}

.score-correct .score-value {
  color: var(--gold);
}

.score-strikes .score-value {
  color: var(--text-secondary);
}

.score-value.bump {
  transform: scale(1.3);
}

.score-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.strike-pips {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--border-light);
  background: transparent;
  transition: all 0.4s var(--ease-out-expo);
}

.pip.active {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(232, 64, 64, 0.5);
}

/* Play Zone */
.play-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.play-zone-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.play-button {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: all 0.4s var(--ease-out-expo);
  position: relative;
}

.play-button::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: border-color 0.4s;
}

.play-button:hover {
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(212, 160, 41, 0.15);
  transform: scale(1.05);
}

.play-button:hover::before {
  border-color: rgba(212, 160, 41, 0.2);
}

.play-button:active {
  transform: scale(0.97);
}

.play-icon,
.pause-icon {
  width: 32px;
  height: 32px;
  color: var(--gold);
  transition: opacity 0.2s;
}

.pause-icon {
  display: none;
}

.play-button.is-playing .play-icon { display: none; }
.play-button.is-playing .pause-icon { display: block; }

.play-button.is-playing {
  border-color: var(--gold);
  animation: pulse-glow 2s ease-in-out infinite;
}

.play-button:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none !important;
  box-shadow: none !important;
}

.play-button:disabled::before {
  border-color: transparent !important;
}

.play-text {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

/* Waveform Visualizer */
.waveform {
  width: 280px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  transition: opacity 0.4s;
}

.waveform.active {
  opacity: 1;
}

.wave-bars {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}

.wave-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--gold-dim);
  height: 4px;
  transition: background 0.3s;
}

.waveform.active .wave-bar {
  background: var(--gold);
  animation: waveAnim 0.8s ease-in-out infinite alternate;
}

/* Answer Zone */
.answer-zone {
  width: 100%;
  text-align: center;
}

.answer-feedback {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 1.5rem;
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.4s var(--ease-out-expo);
}

.answer-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.answer-feedback.correct {
  color: var(--green);
}

.answer-feedback.wrong {
  color: var(--red-glow);
}

.answer-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 60px;
  background: var(--bg-input);
  padding: 0.25rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.answer-input-wrap:focus-within {
  border-color: var(--gold-dim);
  box-shadow: 0 0 30px rgba(212, 160, 41, 0.06);
}

#answer-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.9rem 1.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
  letter-spacing: 0.02em;
}

#answer-input::placeholder {
  color: var(--text-muted);
}

#answer-input:disabled {
  opacity: 0.3;
}

.submit-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: var(--bg-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s var(--ease-out-expo);
}

.submit-button svg {
  width: 18px;
  height: 18px;
}

.submit-button:hover:not(:disabled) {
  background: var(--gold-bright);
  transform: scale(1.08);
}

.submit-button:disabled {
  opacity: 0.2;
  cursor: default;
}

/* Progress Track */
.progress-track {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 20;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width 0.6s var(--ease-out-expo);
}

.progress-markers {
  position: absolute;
  inset: 0;
  display: flex;
}

.progress-marker {
  flex: 1;
  border-right: 1px solid rgba(10, 9, 8, 0.5);
  position: relative;
}

.progress-marker.answered::after {
  content: '';
  position: absolute;
  inset: 0;
  border-right: 1px solid rgba(10, 9, 8, 0.5);
}

.progress-marker.correct-marker::after {
  background: var(--green);
  opacity: 0.4;
}

.progress-marker.wrong-marker::after {
  background: var(--red);
  opacity: 0.4;
}

/* ============================================
   RESULT SCREEN
   ============================================ */
.result-content {
  text-align: center;
  padding: 2rem;
  max-width: 480px;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: scale(0.5);
  animation: popIn 0.6s var(--ease-out-back) 0.2s forwards;
}

.result-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.4s forwards;
}

.result-title.win {
  color: var(--gold);
  text-shadow: 0 0 40px rgba(212, 160, 41, 0.3);
}

.result-title.lose {
  color: var(--red);
  text-shadow: 0 0 40px rgba(184, 52, 46, 0.3);
}

.result-score-display {
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 1rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.6s forwards;
}

.result-score-num {
  color: var(--gold);
}

.result-score-sep {
  color: var(--text-muted);
  margin: 0 0.1em;
}

.result-score-total {
  color: var(--text-secondary);
}

.result-message {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 0.8s forwards;
}

.play-again-button {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-dim);
  border-radius: 60px;
  padding: 1rem 2.5rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-expo);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out-expo) 1s forwards;
}

.play-again-button:hover {
  background: var(--gold);
  color: var(--bg-deep);
  box-shadow: 0 0 30px rgba(212, 160, 41, 0.2);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 160, 41, 0.15);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 160, 41, 0.3);
  }
}

@keyframes waveAnim {
  0% { height: 4px; }
  100% { height: var(--wave-h, 20px); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Disable video backgrounds on mobile for performance */
@media (max-width: 640px) {
  #bgvid,
  #gamevid {
    display: none !important;
  }
}

/* Tablet */
@media (max-width: 768px) {
  .title {
    font-size: clamp(3.5rem, 12vw, 6rem);
  }

  .subtitle {
    font-size: 1rem;
  }

  .landing-content {
    padding: 1.5rem;
  }

  .title-block {
    margin-bottom: 2.5rem;
  }

  .play-button {
    width: 120px;
    height: 120px;
  }

  .score-value {
    font-size: 3rem;
  }

  .score-panel {
    gap: 3.5rem;
  }

  .result-content {
    padding: 1.5rem;
  }

  .result-score-display {
    font-size: 4rem;
  }

  .corner-links {
    bottom: 1rem;
    right: 1rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .title {
    font-size: clamp(3rem, 14vw, 5rem);
  }

  .subtitle {
    font-size: 0.9rem;
    margin-top: 1rem;
  }

  .landing-content {
    padding: 1.25rem;
  }

  .title-block {
    margin-bottom: 2rem;
  }

  .landing-form {
    padding-bottom: 4rem;
  }

  .difficulty-buttons {
    flex-direction: column;
    gap: 0.6rem;
  }

  .diff-btn {
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    min-height: 48px;
  }

  .diff-name {
    margin-bottom: 0;
    font-size: 1.1rem;
  }

  .diff-desc {
    font-size: 0.65rem;
  }

  .landing-footer {
    bottom: 1.25rem;
    font-size: 0.5rem;
    gap: 0.6rem;
  }

  .game-header {
    padding: 1rem 1.25rem;
  }

  .game-logo {
    font-size: 0.85rem;
  }

  .player-tag {
    display: none;
  }

  .game-body {
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .score-panel {
    gap: 3rem;
  }

  .score-value {
    font-size: 2.2rem;
  }

  .play-button {
    width: 100px;
    height: 100px;
  }

  .play-icon,
  .pause-icon {
    width: 26px;
    height: 26px;
  }

  .waveform {
    width: 220px;
  }

  .play-zone-row {
    gap: 1rem;
  }

  #answer-input {
    padding: 0.8rem 1.25rem;
    font-size: 1rem;
  }

  .submit-button {
    width: 48px;
    height: 48px;
  }

  .result-score-display {
    font-size: 3.5rem;
  }

  .result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
  }

  .result-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
    margin-bottom: 1rem;
  }

  .result-message {
    font-size: 0.9rem;
    margin-bottom: 2rem;
  }

  .play-again-button {
    padding: 0.9rem 2rem;
    font-size: 0.7rem;
  }

  .corner-links {
    bottom: 0.75rem;
    right: 0.75rem;
    gap: 0.5rem;
  }

  .corner-link img,
  .corner-link svg {
    width: 24px;
    height: 24px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .title {
    font-size: clamp(2.5rem, 16vw, 4rem);
  }

  .title-accent {
    font-size: 0.6rem;
    letter-spacing: 0.3em;
  }

  .subtitle {
    font-size: 0.8rem;
  }

  .landing-content {
    padding: 1rem;
  }

  .input-group {
    margin-bottom: 2rem;
  }

  #player-name {
    font-size: 0.95rem;
  }

  .difficulty-label {
    font-size: 0.6rem;
  }

  .diff-btn {
    padding: 1rem;
  }

  .diff-name {
    font-size: 1rem;
  }

  .game-body {
    padding: 1rem;
    gap: 1.25rem;
  }

  .score-panel {
    gap: 2rem;
  }

  .score-value {
    font-size: 1.8rem;
  }

  .score-label {
    font-size: 0.6rem;
  }

  .play-button {
    width: 85px;
    height: 85px;
  }

  .play-icon,
  .pause-icon {
    width: 22px;
    height: 22px;
  }

  .play-text {
    font-size: 0.4rem;
  }

  .waveform {
    width: 180px;
  }

  #answer-input {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }

  .result-score-display {
    font-size: 2.8rem;
  }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .landing-content {
    padding: 1rem;
  }

  .title-block {
    margin-bottom: 1.5rem;
  }

  .title {
    font-size: clamp(2rem, 8vh, 3.5rem);
  }

  .subtitle {
    margin-top: 0.5rem;
    font-size: 0.85rem;
  }

  .landing-form {
    padding-bottom: 2.5rem;
  }

  .input-group {
    margin-bottom: 1.5rem;
  }

  .difficulty-buttons {
    flex-direction: row;
    gap: 0.5rem;
  }

  .diff-btn {
    padding: 0.8rem;
  }

  .diff-name {
    font-size: 1rem;
  }

  .diff-desc {
    font-size: 0.6rem;
  }

  .game-body {
    padding: 1rem;
    gap: 1rem;
  }

  .score-value {
    font-size: 2rem;
  }

  .play-button {
    width: 70px;
    height: 70px;
  }

  .play-icon,
  .pause-icon {
    width: 20px;
    height: 20px;
  }

  .play-text {
    display: none;
  }

  .waveform {
    height: 24px;
    width: 180px;
  }

  .result-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }

  .result-title {
    font-size: clamp(1.2rem, 5vh, 2rem);
    margin-bottom: 0.75rem;
  }

  .result-score-display {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
  }

  .result-message {
    margin-bottom: 1rem;
    font-size: 0.85rem;
  }

  .landing-footer {
    bottom: 0.5rem;
  }
}

/* Touch-friendly: ensure minimum tap targets */
@media (hover: none) and (pointer: coarse) {
  .diff-btn {
    min-height: 48px;
  }

  .submit-button {
    width: 48px;
    height: 48px;
  }

  .play-button:hover {
    transform: none;
    box-shadow: none;
  }

  .diff-btn:hover {
    transform: none;
    box-shadow: none;
  }

  .play-button:active {
    transform: scale(0.95);
  }

  .diff-btn:active {
    transform: scale(0.98);
    border-color: var(--gold-dim);
  }

  .corner-link:hover {
    transform: none;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Selection ---- */
::selection {
  background: rgba(212, 160, 41, 0.3);
  color: var(--text-primary);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---- Transition utilities ---- */
.screen-enter {
  animation: fadeUp 0.6s var(--ease-out-expo) forwards;
}

/* ---- Corner Links ---- */
.corner-links {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  z-index: 30;
}

.corner-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.3s ease;
  text-decoration: none;
}

.corner-link:hover {
  color: var(--gold);
  transform: scale(1.15);
}

.corner-link img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.corner-link:hover img {
  opacity: 1;
}
