/* songless osu! — stylesheet
   Layout and tokens follow the original songless (fixed sidebar, tall centre card, settings panel),
   rewritten from the spec. Accent colours come from the active tier via [data-difficulty]. */

:root {
  --easy: #22d875;
  --medium: #ffd119;
  --hard: #e17c21;
  --expert: #d74842;
  --impossible: #9a4de0;
  --nightcore: #ff66aa;
  --all: #e3e9e0;
  --accent: var(--easy);
  --accent-rgb: 34, 216, 117;
  --surface: #10140b;
  --surface-soft: #15180f;
  --line: #272b23;
  --muted: #747b73;
  --ink: #101409;
  --page: #050806;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.22, 1.35, 0.36, 1);
  --bar-ease: cubic-bezier(0.4, 0, 0.2, 1);
  color: #dfe4df;
  color-scheme: dark;
  background: var(--page);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
#root {
  min-width: 320px;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background: radial-gradient(circle at 50% 54%, rgba(35, 49, 27, 0.11), transparent 31rem), var(--page);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.72);
  outline-offset: 3px;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 6px;
  z-index: 1;
  color: #4f564e;
  font-size: 9.5px;
  text-align: center;
  pointer-events: none;
}
@media (max-width: 760px), (max-height: 640px) {
  .site-footer {
    display: none; /* phones and short windows: the card needs the room */
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- tier accents ---------- */
.app-shell {
  min-height: 100vh;
}
.app-shell[data-difficulty="easy"] { --accent: var(--easy); --accent-rgb: 34, 216, 117; }
.app-shell[data-difficulty="medium"] { --accent: var(--medium); --accent-rgb: 255, 209, 25; }
.app-shell[data-difficulty="hard"] { --accent: var(--hard); --accent-rgb: 225, 124, 33; }
.app-shell[data-difficulty="expert"] { --accent: var(--expert); --accent-rgb: 215, 72, 66; }
.app-shell[data-difficulty="impossible"] { --accent: var(--impossible); --accent-rgb: 154, 77, 224; }
.app-shell[data-difficulty="nightcore"] { --accent: var(--nightcore); --accent-rgb: 255, 102, 170; }
.app-shell[data-difficulty="all"] { --accent: var(--all); --accent-rgb: 227, 233, 224; }

/* ---------- layout ---------- */
.game-layout {
  position: relative;
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

.game-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 424px;
  min-height: 100dvh;
  padding: 0 32px 48px 33px;
  border: 0;
  border-left: 1px solid rgba(116, 125, 104, 0.13);
  border-right: 1px solid rgba(116, 125, 104, 0.13);
  border-radius: 0;
  transform: translateX(3px);
  background:
    radial-gradient(ellipse at 50% 53%, rgba(8, 12, 8, 0.98) 0%, rgba(13, 17, 9, 0.96) 48%, rgba(var(--accent-rgb), 0.085) 100%),
    var(--surface);
  box-shadow: 0 0 54px rgba(0, 0, 0, 0.18);
  transition: background 0.65s, box-shadow 0.65s;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

.app-shell[data-status="lost"] .game-card {
  background:
    radial-gradient(at 50% 53%, rgba(10, 13, 9, 0.98) 8%, rgba(62, 31, 20, 0.75) 67%, rgba(145, 54, 43, 0.35) 100%),
    #17110d;
  box-shadow: inset 0 0 95px rgba(186, 64, 49, 0.1), 0 0 54px rgba(0, 0, 0, 0.18);
}
.app-shell[data-status="lost"] .game-card::before {
  background: radial-gradient(at 50% 52%, transparent 20%, rgba(220, 63, 54, 0.3) 120%);
  animation: resultWashIn 0.85s var(--ease-out) both;
}
.app-shell[data-status="won"] .game-card {
  background:
    radial-gradient(ellipse at 50% 53%, rgba(8, 13, 8, 0.99) 10%, rgba(var(--accent-rgb), 0.055) 100%),
    var(--surface);
}
.app-shell[data-status="won"] .game-card::before {
  background: radial-gradient(ellipse at 50% 52%, rgba(var(--accent-rgb), 0.08), transparent 66%);
  animation: successWashIn 1.3s var(--ease-out) both;
}

.game-content {
  width: 100%;
  padding-top: clamp(276px, 46.4vh + 6px, 471px);
}

.mode-panel,
.settings-panel {
  position: fixed;
  z-index: 3;
}

.mode-panel {
  top: calc(50% - 137px); /* the original's 50% - 71px, raised for the Nightcore and All maps rows so the actions stay on screen */
  left: calc(50% - 481px);
  width: 112px;
}

.settings-panel {
  top: calc(54.5% + 6px);
  left: calc(50% + 361px);
  transform: translateY(-50%);
  display: grid;
  gap: 28px;
  width: 168px;
}

/* ---------- sidebar ---------- */
.difficulty-list {
  display: grid;
  gap: 8px;
}

.difficulty {
  width: 112px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.016);
  border-radius: 999px;
  background: #171a11;
  color: #8a9189;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.25), inset 0 1px rgba(255, 255, 255, 0.016);
  transition: color 0.22s ease, background 0.22s ease, box-shadow 0.26s ease, transform 0.22s var(--ease-out);
}
.difficulty:hover:not(:disabled) {
  color: #c8cec8;
  background: #1d2116;
  transform: translateY(-1px);
}
.difficulty.active,
.difficulty.active:hover:not(:disabled) {
  color: var(--ink);
  background: var(--accent);
  font-weight: 800;
  box-shadow: 0 0 17px rgba(var(--accent-rgb), 0.32), 0 5px 13px rgba(0, 0, 0, 0.25);
}
.difficulty:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mode-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.mode-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 112px;
  height: 35px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.016);
  border-radius: 999px;
  background: #171a11;
  color: #a4aba3;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.23), inset 0 1px rgba(255, 255, 255, 0.016);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.22s var(--ease-out);
}
.mode-action:hover {
  color: #d7ddd6;
  background: #202418;
  transform: translateY(-1px);
  box-shadow: 0 7px 17px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.024);
}
.mode-action:active {
  transform: translateY(0) scale(0.975);
}
.mode-action.active-filter {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.08);
}
.mode-action:disabled,
.mode-action:disabled:hover {
  color: #a4aba3;
  background: #171a11;
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 13px rgba(0, 0, 0, 0.23), inset 0 1px rgba(255, 255, 255, 0.016);
}

.action-icon {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35px;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* ---------- in-card tier tabs ---------- */
.difficulty-tabs {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px; /* six tabs (with Nightcore) share the row */
  min-height: 30px;
}
.difficulty-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  height: 32px;
  padding: 0 5px;
  border: 0;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
  opacity: 0.65;
  cursor: pointer;
  transition: opacity 0.22s ease, filter 0.22s ease, transform 0.26s var(--ease-spring), box-shadow 0.22s ease;
}
.difficulty-tabs button:hover:not(:disabled) {
  opacity: 0.9;
  filter: brightness(1.1);
}
.difficulty-tabs button.active {
  opacity: 1;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.06);
}
.difficulty-tabs button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
.difficulty-tabs .easy { color: var(--easy); background: rgba(34, 216, 117, 0.12); }
.difficulty-tabs .medium { color: var(--medium); background: rgba(255, 209, 25, 0.12); }
.difficulty-tabs .hard { color: var(--hard); background: rgba(225, 124, 33, 0.11); }
.difficulty-tabs .expert { color: var(--expert); background: rgba(215, 72, 66, 0.11); }
.difficulty-tabs .impossible { color: var(--impossible); background: rgba(154, 77, 224, 0.11); }
.difficulty-tabs .nightcore { color: var(--nightcore); background: rgba(255, 102, 170, 0.11); }
.difficulty-tabs .all { color: var(--all); background: rgba(227, 233, 224, 0.1); }

/* ---------- round panel ---------- */
.round-panel {
  position: relative;
  animation: roundIn 0.42s var(--ease-out) both;
}

/* stage track: log-weighted segments + two progress layers */
.stage-track {
  position: relative;
  display: flex;
  overflow: hidden;
  width: 100%;
  height: 23px;
  margin-top: 19px;
  border: 1px solid #2b3026;
  border-radius: 999px;
  background: #2a2e26;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.34);
  transition: border-color 0.26s, box-shadow 0.26s;
}
.stage-segment {
  position: relative;
  overflow: hidden;
  flex: 0 1 0;
  min-width: 0;
  opacity: 0;
  background: transparent;
  border-right: 0 solid rgba(9, 12, 8, 0.72);
  transform-origin: 0;
  transition:
    flex-grow 0.78s var(--bar-ease),
    min-width 0.78s var(--bar-ease),
    border-width 0.36s,
    background 0.34s,
    opacity 0.32s;
}
.stage-segment.enabled {
  z-index: 3;
  min-width: 7px;
  opacity: 1;
  border-right-width: 1px;
  animation: stageSegmentEnable 0.62s var(--ease-out) both;
}
.stage-segment.disabled {
  pointer-events: none;
}
.stage-segment.last-enabled {
  border-right-width: 0;
}
.stage-unlocked-progress,
.stage-playback-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}
.stage-unlocked-progress {
  z-index: 1;
  background: rgba(var(--accent-rgb), 0.38);
  transition: width 0.78s var(--bar-ease);
}
.stage-playback-progress {
  z-index: 2;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.14);
}

/* player */
.player-area {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 161px;
}
.play-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 7%, rgba(255, 255, 255, 0.12), transparent 42%), var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -12px 24px rgba(0, 0, 0, 0.043),
    0 11px 30px rgba(0, 0, 0, 0.2),
    0 0 28px rgba(var(--accent-rgb), 0.1);
  cursor: pointer;
  touch-action: manipulation;
  translate: 0 3px;
  transition: transform 0.28s var(--ease-spring), filter 0.22s ease, box-shadow 0.3s ease;
}
.play-button:active {
  transform: translateY(1px) scale(0.965);
  transition-duration: 90ms;
}
.play-button.playing {
  animation: playBreathe 1.05s ease-in-out infinite alternate;
}
.play-button.loading {
  cursor: progress;
  filter: saturate(0.92) brightness(0.98);
}
.play-glyph {
  position: relative;
  z-index: 2;
  width: 45%;
  height: 45%;
  fill: #10140d;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.16));
  transition: transform 0.26s var(--ease-spring), opacity 0.18s ease;
}
.play-glyph.play-icon {
  transform: translate(-4.5%, 4.5%);
}
.play-glyph.loading-icon {
  fill: none;
  color: #10140d;
  filter: none;
  animation: loadingSpin 0.9s linear infinite;
}
@media (hover: hover) and (pointer: fine) {
  .play-button:hover {
    filter: brightness(1.035);
    transform: translateY(-2px) scale(1.025);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      inset 0 -12px 24px rgba(0, 0, 0, 0.035),
      0 16px 35px rgba(0, 0, 0, 0.23),
      0 0 36px rgba(var(--accent-rgb), 0.18);
  }
  .play-button:hover .play-icon {
    transform: translate(-4.5%, 4.5%) scale(1.04);
  }
  .play-button:hover .pause-icon {
    transform: scale(1.04);
  }
  .play-button:active {
    transform: translateY(1px) scale(0.965);
  }
}
.pulse-ring {
  position: absolute;
  inset: -1px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.play-button.playing .pulse-ring {
  animation: pulse 0.9s ease-out infinite;
}

.stage-time {
  position: absolute;
  right: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1px;
  translate: 0 3px;
}
.stage-time span {
  margin-left: 2px;
  font-size: 10px;
  opacity: 0.85;
}
.stage-value {
  display: inline-block;
  animation: stageValueIn 0.33s var(--ease-spring) both;
}

/* guess form */
.guess-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 123px;
  gap: 7px;
  width: 100%;
}
.search-wrap {
  position: relative;
}
.search-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 12px 0 39px;
  border: 1px solid #34382e;
  border-radius: 12px;
  outline: none;
  background: #171b12;
  color: #d7ddd7;
  font-size: 12px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.012);
  transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
}
.search-wrap input::placeholder {
  color: #737a72;
}
.search-wrap input:focus {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.06);
}
.search-wrap.selected input {
  border-color: rgba(var(--accent-rgb), 0.62);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.08);
}
.search-icon {
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 2;
  width: 13px;
  height: 13px;
  border: 2px solid #767d75;
  border-radius: 50%;
  pointer-events: none;
}
.search-icon::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -2px;
  width: 6px;
  height: 2px;
  background: #767d75;
  transform: rotate(45deg);
}

.skip-button,
.guess-button {
  height: 42px;
  padding: 0 17px;
  border: 1px solid #30342b;
  border-radius: 12px;
  background: #171a12;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s var(--ease-out), background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}
.skip-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 123px;
}
.skip-button:hover {
  background: #1d2118;
  border-color: #3a3f34;
}
.guess-button {
  border-color: transparent;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.1);
}
.guess-button:hover {
  filter: brightness(1.06);
}
.skip-button:active,
.guess-button:active {
  transform: scale(0.975);
}
.skip-icon {
  flex: none;
  width: 14px;
  height: 14px;
  overflow: visible;
}
.skip-icon .tri {
  fill: currentColor;
}
.skip-icon .bar {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8px;
  stroke-linecap: round;
}

/* suggestions (opens upward over the play button) */
.suggestions {
  position: absolute;
  right: 0;
  bottom: 49px;
  left: 0;
  z-index: 20;
  max-height: 40vh;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #30352c;
  border-radius: 11px;
  background: #14180f;
  box-shadow: 0 15px 36px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: #30352c transparent;
}
.suggestions::-webkit-scrollbar {
  width: 6px;
}
.suggestions::-webkit-scrollbar-thumb {
  background: #30352c;
  border-radius: 6px;
}
.suggestions::-webkit-scrollbar-track {
  background: transparent;
}
.suggestions button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.suggestions button:hover,
.suggestions button.highlighted {
  background: #202519;
}
.suggestion-text {
  display: grid;
  min-width: 0;
}
.suggestions strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.suggestions small {
  overflow: hidden;
  color: #798078;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  color: #747b73;
  font-size: 10px;
  text-align: center;
  pointer-events: none;
  animation: hintIn 0.4s var(--ease-out) both;
}
@keyframes hintIn {
  from { opacity: 0; transform: translateY(3px); }
}

.audio-error {
  margin: 9px 0 0;
  color: #868d85;
  font-size: 10px;
  text-align: center;
  line-height: 1.45;
}
.error-action {
  margin-left: 6px;
  padding: 2px 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s var(--ease-out);
}
.error-action:hover {
  background: rgba(var(--accent-rgb), 0.2);
}
.error-action:active {
  transform: scale(0.96);
}

.wrong-guesses {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.wrong-guesses span {
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(197, 63, 63, 0.08);
  color: #bd6e69;
  font-size: 9px;
}
.wrong-guesses span.near {
  background: rgba(255, 209, 25, 0.08);
  color: var(--medium);
  cursor: help;
}

/* ---------- settings panel ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0 0 8px;
  color: #72786f;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
  text-transform: uppercase;
}
.label-icon {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15px;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.95;
}
.label-icon.waveform-icon { width: 14px; height: 12px; }
.label-icon.volume-icon { width: 13px; height: 13px; }

.setting-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 23px;
  margin-top: 5px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 999px;
  background: #171a11;
  color: #969d94;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: none;
  transition: color 0.17s ease, background 0.17s ease, border-color 0.17s ease, box-shadow 0.19s ease, transform 0.17s var(--ease-out);
}
.setting-value:not(:disabled):hover {
  color: #c4cbc3;
  background: #202419;
  border-color: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}
.setting-value:not(:disabled):active {
  transform: translateY(0) scale(0.96);
  transition-duration: 70ms;
}
.setting-value:focus-visible {
  outline-offset: 2px;
}
.setting-value:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}
.setting-value.active-setting,
.setting-value.active-setting:not(:disabled):hover {
  color: var(--ink);
  background: var(--accent);
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.13);
}

.stage-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 6px;
  padding: 0 5px;
}
.stage-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 29px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.016);
  border-radius: 999px;
  background: #171a11;
  color: #7b8279;
  font-size: 8px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: color 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.26s ease, transform 0.24s var(--ease-spring), opacity 0.22s ease;
}
.stage-pill:not(:disabled):hover {
  color: #c4cbc3;
  background: #202419;
  transform: translateY(-1px);
}
.stage-pill:not(:disabled):active {
  transform: scale(0.93);
  transition-duration: 80ms;
}
.stage-pill:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}
.stage-pill.enabled,
.stage-pill.enabled:not(:disabled):hover {
  color: #10140d;
  background: var(--accent);
  border-color: transparent;
  font-weight: 800;
}
.stage-pill.enabled.current {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.19), 0 0 16px rgba(var(--accent-rgb), 0.2);
}

.volume-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.volume-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.volume-header .eyebrow {
  margin: 0;
}
.volume-value {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.volume-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 17px;
}
.volume-control input[type="range"] {
  width: 100%;
  height: 12px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.volume-control input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) 0 var(--volume-percent, 20%), #343930 var(--volume-percent, 20%) 100%);
}
.volume-control input[type="range"]::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  margin-top: -3.5px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px rgba(var(--accent-rgb), 0.2);
  appearance: none;
  -webkit-appearance: none;
}
.volume-control input[type="range"]::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 3px;
  background: #343930;
}
.volume-control input[type="range"]::-moz-range-progress {
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.volume-control input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}
.volume-reset {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}
.volume-reset:hover {
  color: var(--accent);
  transform: scale(1.1) rotate(-15deg);
}
.volume-reset:active {
  transform: scale(0.95);
}
.reset-icon {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- empty / loading / error states ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 295px;
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 21px;
}
.empty-state h1 {
  margin: 17px 0 5px;
  font-size: 20px;
}
.empty-state p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

/* ---------- artwork ---------- */
.artwork {
  width: 105px;
  height: 105px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}
.artwork.fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.15), #11160e);
  color: var(--accent);
  font-size: 32px;
}
.artwork.small {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: none;
  background-color: #1b2015;
}
.artwork.small.fallback {
  background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.15), #11160e);
}

/* ---------- result card ---------- */
.game-content.result-state {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 48px);
  padding-top: 0;
}
.result-state::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(9, 10, 7, 0.56);
  transform: translateX(-50%);
}
.result-state::before {
  content: "";
  position: absolute;
  bottom: 14px;
  left: 50%;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-top: 2px solid #d3d8d2;
  border-left: 2px solid #d3d8d2;
  transform: translateX(-50%) rotate(45deg);
}
.result-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  text-align: center;
  transform: translateY(14px);
}

.result-artwork-wrap {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 142px;
  height: 142px;
  animation: resultArtworkIn 0.72s 0.12s var(--ease-spring) both;
}
.result-art {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 17px;
  background: transparent;
  cursor: pointer;
}
.result-art:focus-visible {
  outline-offset: 4px;
}
.result-art .artwork {
  display: block;
  width: 142px;
  height: 142px;
  border-radius: 17px;
}
.result-art .artwork.fallback {
  display: grid;
}
.result-panel.won .result-art .artwork {
  box-shadow: 0 0 40px rgba(var(--accent-rgb), 0.2), 0 17px 36px rgba(0, 0, 0, 0.34);
}
.art-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(10, 13, 9, 0.78);
  color: #eef1ec;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: transform 0.2s var(--ease-spring), background 0.18s ease, color 0.18s ease;
}
.art-toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.art-toggle svg.toggle-spin {
  fill: none;
  stroke: currentColor;
  stroke-width: 3px;
  animation: loadingSpin 0.9s linear infinite;
}
.result-art:hover .art-toggle {
  color: var(--accent);
  transform: scale(1.08);
}
.result-art:active .art-toggle {
  transform: scale(0.94);
}

.success-ring {
  position: absolute;
  inset: -4px;
  z-index: -1;
  border: 2px solid rgba(var(--accent-rgb), 0.58);
  border-radius: 25px;
  opacity: 0;
  pointer-events: none;
}
.success-ring.one {
  animation: successRing 0.9s 0.12s var(--ease-out) both;
}
.success-ring.two {
  animation: successRing 1.1s 0.26s var(--ease-out) both;
}

.confetti {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: visible;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: var(--c);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 45%, transparent);
  opacity: 0;
  animation: confettiBurst 1.55s var(--d) var(--ease-out) both;
}
.confetti-piece.round {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.result-kicker {
  margin: 19px 0 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: resultCopyIn 0.48s 0.34s var(--ease-out) both;
}
.result-panel.lost .result-kicker {
  color: #d16d67;
}
.result-panel h1 {
  max-width: 100%;
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.7px;
  overflow-wrap: anywhere;
  animation: resultCopyIn 0.52s 0.42s var(--ease-out) both;
}
.result-panel.won h1 {
  margin-top: 15px;
  color: #f4f5f2;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.65px;
  text-transform: uppercase;
  animation: winTitleIn 0.65s 0.43s var(--ease-spring) both;
}
.result-version {
  margin: 5px 0 0;
  color: #7d857b;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  animation: resultCopyIn 0.5s 0.46s var(--ease-out) both;
}
.result-artist {
  max-width: 330px;
  margin: 5px 0 0;
  color: #a5aaa4;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: resultCopyIn 0.52s 0.5s var(--ease-out) both;
}
.result-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 9px;
  margin-top: 7px;
  animation: resultCopyIn 0.5s 0.56s var(--ease-out) both;
}
.result-source-link {
  color: #b8c1ba;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}
.result-source-link:hover {
  color: var(--accent);
  text-decoration: underline;
}
.library-tag {
  padding: 3px 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.09);
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.3px;
}
.result-panel .audio-error {
  max-width: 330px;
}

.result-stamp {
  --stamp-angle: -6deg;
  position: relative;
  margin-top: 18px;
  padding: 5px 13px 6px;
  border: 3px solid var(--accent);
  border-radius: 9px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  transform: rotate(var(--stamp-angle));
  animation: resultStampIn 0.56s 0.69s var(--ease-spring) both;
}
.result-panel.won .result-stamp {
  --stamp-angle: -7deg;
  margin-top: 15px;
  padding: 6px 13px 7px;
  font-size: 14px;
  letter-spacing: 0.65px;
  box-shadow: 0 0 17px rgba(var(--accent-rgb), 0.1);
}
.result-panel.won .result-stamp::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(var(--accent-rgb), 0.65);
  border-radius: 12px;
  opacity: 0;
  animation: stampEcho 0.62s 0.84s var(--ease-out) both;
}
.result-panel.lost .result-stamp {
  border-color: #ed5c62;
  color: #ed5c62;
  box-shadow: 0 0 15px rgba(237, 92, 98, 0.08);
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 17px;
  animation: resultCopyIn 0.46s 0.79s var(--ease-out) both;
}
.result-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 104px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  background: rgba(20, 23, 16, 0.88);
  color: #cbd0ca;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: color 0.18s ease, background 0.18s ease, filter 0.18s ease, transform 0.18s var(--ease-out);
}
.result-action:hover {
  color: #f0f2ee;
  background: #24291c;
  transform: translateY(-1px);
}
.result-action.primary {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: var(--accent);
  color: #11150d;
  box-shadow: 0 7px 19px rgba(var(--accent-rgb), 0.17);
}
.result-action.primary:hover {
  color: #11150d;
  background: var(--accent);
  filter: brightness(1.08);
}
.result-action:active {
  transform: translateY(0) scale(0.97);
}
.result-action .action-icon {
  width: 13px;
  height: 13px;
}

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s;
}
.modal-content {
  position: relative;
  width: 90%;
  max-width: 440px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 32px;
  border: 1px solid #30352c;
  border-radius: 28px;
  background: #14180f;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.3s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: #30352c transparent;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #72786f;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover {
  color: #fff;
}
.modal-content h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 24px;
}
.filter-modal {
  max-width: 520px;
}
.filter-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-right: 28px;
}
.filter-heading > .filter-icon {
  flex: none;
  width: 23px;
  height: 23px;
  color: var(--accent);
}
.filter-heading h2 {
  margin-bottom: 3px;
}
.filter-heading p {
  margin: 0;
  color: #8f968c;
  font-size: 12px;
}
.filter-group {
  margin: 25px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.filter-group legend {
  margin-bottom: 10px;
  padding: 0;
  color: #a9b0a6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.filter-group legend span {
  color: #7d857b;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-options button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #2c3228;
  border-radius: 999px;
  background: #1a1f15;
  color: #9ba197;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.2s var(--ease-out);
}
.filter-options button:hover {
  color: #d7ddd4;
  transform: translateY(-1px);
}
.filter-options button.selected,
.filter-options button.selected:hover {
  border-color: transparent;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.15);
}
.filter-options button small {
  margin-left: 5px;
  opacity: 0.6;
  font-size: 9px;
  font-weight: 650;
}
.filter-footer {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
  margin-top: 28px;
}
.filter-footer button {
  height: 42px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.filter-clear {
  border: 1px solid #30352c;
  background: transparent;
  color: #a0a69d;
}
.filter-done {
  border: 0;
  background: var(--accent);
  color: var(--ink);
}
.filter-clear:disabled,
.filter-done:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- keyframes ---------- */
@keyframes roundIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes stageSegmentEnable {
  0% { filter: brightness(1.8); }
  46% { filter: brightness(1.2); }
  100% { filter: brightness(1); }
}
@keyframes stageValueIn {
  from { opacity: 0; transform: translateY(5px) scale(0.85); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes playBreathe {
  from {
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.18), 0 11px 30px rgba(0, 0, 0, 0.2), 0 0 24px rgba(var(--accent-rgb), 0.1);
  }
  to {
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.18), 0 13px 34px rgba(0, 0, 0, 0.22), 0 0 42px rgba(var(--accent-rgb), 0.25);
  }
}
@keyframes pulse {
  from { opacity: 0.7; transform: scale(1); }
  to { opacity: 0; transform: scale(1.35); }
}
@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}
@keyframes resultWashIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes successWashIn {
  0% { opacity: 0; transform: scale(0.76); }
  52% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0.72; transform: scale(1); }
}
@keyframes resultArtworkIn {
  0% { opacity: 0; filter: blur(8px); transform: translateY(24px) scale(0.78); }
  68% { opacity: 1; filter: blur(0); transform: translateY(-3px) scale(1.025); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}
@keyframes resultCopyIn {
  from { opacity: 0; filter: blur(3px); transform: translateY(15px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes winTitleIn {
  0% { opacity: 0; filter: blur(4px); transform: translateY(18px) scale(0.82); }
  64% { opacity: 1; filter: blur(0); transform: translateY(-2px) scale(1.045); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
}
@keyframes resultStampIn {
  0% { opacity: 0; filter: blur(2px); transform: rotate(calc(var(--stamp-angle) - 7deg)) scale(1.8); }
  54% { opacity: 1; filter: blur(0); transform: rotate(calc(var(--stamp-angle) + 2deg)) scale(0.9); }
  76% { transform: rotate(calc(var(--stamp-angle) - 1deg)) scale(1.06); }
  100% { opacity: 1; filter: blur(0); transform: rotate(var(--stamp-angle)) scale(1); }
}
@keyframes stampEcho {
  from { opacity: 0.8; transform: scale(0.72); }
  to { opacity: 0; transform: scale(1.35); }
}
@keyframes successRing {
  0% { opacity: 0; transform: scale(0.72); }
  24% { opacity: 0.75; }
  100% { opacity: 0; transform: scale(1.52); }
}
@keyframes confettiBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.25) rotate(0deg); }
  10% { opacity: 1; }
  54% {
    opacity: 1;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(var(--r));
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--fall))) scale(0.82) rotate(var(--r));
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- large desktop (>=1600 x >=850) ---------- */
@media (min-width: 1600px) and (min-height: 850px) {
  .game-card {
    width: 610px;
    padding: 0 48px 68px 47px;
    transform: translateX(1px);
  }
  .game-content {
    padding-top: 42.4vh;
  }
  .mode-panel {
    top: calc(50% - 191px);
    left: calc(50% - 695px);
    width: 128px;
  }
  .difficulty {
    width: 128px;
    height: 42px;
    font-size: 13px;
  }
  .mode-actions {
    margin-top: 12px;
  }
  .mode-action {
    gap: 8px;
    width: 128px;
    height: 42px;
    font-size: 13px;
  }
  .action-icon {
    width: 17px;
    height: 17px;
  }
  .difficulty-tabs {
    gap: 8px;
    min-height: 42px;
  }
  .difficulty-tabs button {
    height: 42px;
    padding: 0 8px;
    font-size: 15px;
  }
  .stage-track {
    height: 35px;
    margin-top: 29px;
  }
  .player-area {
    height: 228px;
  }
  .play-button {
    width: 160px;
    height: 160px;
  }
  .stage-time {
    font-size: 17px;
  }
  .stage-time span {
    font-size: 13px;
  }
  .guess-form {
    grid-template-columns: minmax(0, 1fr) 175px;
    gap: 9px;
  }
  .search-wrap input {
    height: 60px;
    padding-left: 48px;
    border-radius: 17px;
    font-size: 16px;
  }
  .search-icon {
    top: 20px;
    left: 18px;
    width: 17px;
    height: 17px;
  }
  .skip-button,
  .guess-button {
    align-self: center;
    min-width: 175px;
    height: 56px;
    border-radius: 15px;
    font-size: 16px;
  }
  .skip-icon {
    width: 16px;
    height: 16px;
  }
  .suggestions {
    bottom: 68px;
    padding: 7px;
    border-radius: 15px;
  }
  .suggestions button {
    gap: 12px;
    padding: 10px;
  }
  .suggestions strong {
    font-size: 15px;
  }
  .suggestions small {
    font-size: 12px;
  }
  .suggestions .artwork.small {
    width: 40px;
    height: 40px;
  }
  .audio-error,
  .error-action {
    font-size: 12px;
  }
  .wrong-guesses span {
    font-size: 11px;
  }
  .settings-panel {
    top: 36.3vh;
    left: calc(50% + 512px);
    gap: 40px;
    width: 240px;
    transform: none;
  }
  .eyebrow {
    gap: 7px;
    margin-bottom: 11px;
    font-size: 11px;
    letter-spacing: 2.3px;
  }
  .label-icon,
  .label-icon.volume-icon {
    width: 16px;
    height: 16px;
  }
  .label-icon.waveform-icon {
    width: 18px;
    height: 16px;
  }
  .setting-value {
    width: 240px;
    height: 35px;
    margin-top: 7px;
    font-size: 12px;
  }
  .stage-pills {
    gap: 8px;
    padding: 0;
  }
  .stage-pill {
    min-width: 50px;
    height: 29px;
    padding: 0 9px;
    font-size: 11px;
  }
  .volume-value {
    font-size: 13px;
  }
  .volume-slider-row {
    height: 23px;
  }
  .volume-control input[type="range"] {
    height: 16px;
  }
  .volume-control input[type="range"]::-webkit-slider-runnable-track {
    height: 5px;
  }
  .volume-control input[type="range"]::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    margin-top: -4.5px;
  }
  .volume-control input[type="range"]::-moz-range-track,
  .volume-control input[type="range"]::-moz-range-progress {
    height: 5px;
  }
  .volume-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
  }
  .game-content.result-state {
    min-height: calc(100dvh - 68px);
  }
  .result-panel {
    transform: translateY(30px);
  }
  .result-artwork-wrap {
    width: 200px;
    height: 200px;
  }
  .result-art,
  .result-art .artwork {
    width: 200px;
    height: 200px;
    border-radius: 22px;
  }
  .art-toggle {
    right: 10px;
    bottom: 10px;
    width: 34px;
    height: 34px;
  }
  .art-toggle svg {
    width: 14px;
    height: 14px;
  }
  .result-kicker {
    font-size: 13px;
  }
  .result-panel h1,
  .result-panel.won h1 {
    font-size: 32px;
  }
  .result-panel.won h1 {
    margin-top: 20px;
  }
  .result-version {
    font-size: 11px;
  }
  .result-artist {
    max-width: 480px;
    font-size: 16px;
  }
  .result-source-link {
    font-size: 13px;
  }
  .library-tag {
    font-size: 11px;
  }
  .result-stamp {
    font-size: 22px;
  }
  .result-panel.won .result-stamp {
    padding: 8px 18px 9px;
    font-size: 19px;
  }
  .result-actions {
    gap: 10px;
    margin-top: 20px;
  }
  .result-action {
    min-width: 124px;
    height: 40px;
    font-size: 13px;
  }
}

/* ---------- mid widths: panels pin to the edges ---------- */
/* Short desktop windows: seven tiers + up to four actions must still fit beside the card. */
@media (min-width: 761px) and (max-height: 820px) {
  .mode-panel {
    top: max(12px, calc(50% - 214px));
  }
  .difficulty-list {
    gap: 5px;
  }
  .difficulty {
    height: 30px;
  }
  .mode-actions {
    gap: 6px;
    margin-top: 14px;
  }
  .mode-action {
    height: 30px;
  }
}

@media (max-width: 1050px) {
  .mode-panel {
    left: 24px;
  }
  .settings-panel {
    right: 24px;
    left: auto;
  }
}

/* ---------- mobile: one locked column ---------- */
@media (max-width: 760px) {
  html,
  body,
  #root,
  .app-shell {
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .game-layout {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    padding: 18px 14px 28px;
  }
  .mode-panel,
  .settings-panel {
    position: static;
    transform: none;
  }
  .mode-panel {
    order: 1;
    width: min(100%, 424px);
  }
  .difficulty-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .difficulty-list::-webkit-scrollbar,
  .mode-actions::-webkit-scrollbar {
    display: none;
  }
  .difficulty {
    flex: 1 0 auto;
    width: auto;
    min-width: 82px;
    height: 34px;
  }
  .mode-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mode-action {
    flex: 1 0 auto;
    width: auto;
    min-width: 96px;
  }
  .game-card {
    order: 2;
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    justify-content: center;
    width: min(100%, 424px);
    min-height: 0;
    padding: 0 25px 34px;
    border: 1px solid rgba(116, 125, 104, 0.13);
    transform: none;
  }
  .game-content {
    padding-top: 0;
  }
  .settings-panel {
    order: 3;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    gap: 12px;
    width: min(100%, 424px);
    padding: 5px 0 0;
  }
  .setting-value {
    width: 100%;
  }
  .stage-pills {
    gap: 4px;
    padding: 0;
  }
  .stage-pill {
    min-width: 26px;
    padding: 0 4px;
  }
  .game-content.result-state {
    height: auto;
    min-height: 0;
  }
  /* the original's decorative chevron lands on the action buttons on phones; hide it there */
  .result-state::before,
  .result-state::after {
    display: none;
  }
  .app-shell[data-status="won"] .game-card,
  .app-shell[data-status="lost"] .game-card {
    padding-top: 34px;
  }
  .result-panel {
    transform: translateY(12px);
  }
  .result-artwork-wrap,
  .result-art,
  .result-art .artwork {
    width: 124px;
    height: 124px;
  }
  .result-kicker {
    margin-top: 14px;
  }
  .result-panel.won h1 {
    margin-top: 12px;
  }
  .result-panel h1 {
    font-size: 24px;
  }
  .result-panel.won h1 {
    font-size: 22px;
  }
  .result-stamp {
    margin-top: 13px;
  }
  .result-actions {
    margin-top: 13px;
  }
}

@media (max-width: 560px) {
  .filter-modal {
    width: calc(100% - 28px);
    max-height: calc(100svh - 28px);
    padding: 26px 22px 22px;
    border-radius: 22px;
  }
  .filter-options {
    gap: 7px;
  }
  .filter-options button {
    min-height: 32px;
    padding: 0 11px;
    font-size: 10.5px;
  }
}

@media (max-width: 430px) {
  .game-layout {
    padding-right: 0;
    padding-left: 0;
  }
  .mode-panel,
  .settings-panel {
    width: calc(100% - 28px);
  }
  .game-card {
    width: 100%;
    border-right: 0;
    border-left: 0;
  }
  .difficulty-tabs {
    gap: 4px;
  }
  .difficulty-tabs button {
    padding-top: 0;
    padding-bottom: 0;
    font-size: 10px;
  }
  .guess-form {
    grid-template-columns: minmax(0, 1fr) 102px;
  }
  .skip-button {
    min-width: 102px;
  }
  .settings-panel {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 12px;
  }
  /* Song start | Stages, then the volume slider across the whole row */
  .volume-control {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
