:root {
  color-scheme: dark;
  --bg: #0c0b18;
  --panel: rgba(25, 23, 44, 0.82);
  --panel-solid: #19172c;
  --ink: #f8f7ff;
  --muted: #b9b5cf;
  --line: rgba(255, 255, 255, 0.14);
  --pink: #ff4fa3;
  --cyan: #6ce5e8;
  --yellow: #ffd166;
  --violet: #9a7dff;
  --green: #78e08f;
  --danger: #ff7d78;
  --radius: 24px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(154, 125, 255, 0.14), transparent 34rem),
    radial-gradient(circle at 86% 65%, rgba(255, 79, 163, 0.12), transparent 28rem),
    var(--bg);
  overflow-x: hidden;
}

button,
input,
select,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(95px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  top: -10rem;
  right: -9rem;
  background: var(--pink);
}

.ambient-two {
  bottom: -14rem;
  left: -9rem;
  background: var(--cyan);
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 1.05rem;
  line-height: 0.84;
  letter-spacing: 0.08em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.brand-mark i {
  display: block;
  width: 21px;
  height: 3px;
  border-radius: 4px;
  background: var(--pink);
}

.brand-mark i:nth-child(2) {
  width: 14px;
  margin-left: 7px;
  background: var(--cyan);
}

.brand-mark i:nth-child(3) {
  width: 17px;
  background: var(--yellow);
}

.main-nav {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(18px);
}

.nav-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.nav-button:hover,
.nav-button.is-active {
  color: var(--bg);
  background: var(--ink);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.view {
  animation: view-in 0.35s ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  max-width: 13ch;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(3.2rem, 8vw, 6.8rem);
  line-height: 0.88;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.lede {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.button {
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 850;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button-primary {
  color: #0e0b17;
  background: linear-gradient(135deg, var(--pink), #ff8fca);
  box-shadow: 0 14px 36px rgba(255, 79, 163, 0.25);
}

.button-spotify {
  color: #07160d;
  background: #1ed760;
  box-shadow: 0 14px 36px rgba(30, 215, 96, 0.18);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  align-items: center;
  gap: clamp(36px, 7vw, 92px);
  min-height: calc(100vh - 190px);
}

.setup-copy {
  position: relative;
}

.setup-copy h1 span {
  display: block;
  color: transparent;
  -webkit-text-stroke: 2px var(--pink);
  text-shadow: 5px 5px 0 rgba(108, 229, 232, 0.24);
}

.setup-copy::after {
  content: "2006 — 2026";
  position: absolute;
  right: 4%;
  bottom: -34px;
  padding: 9px 14px;
  color: #171221;
  background: var(--yellow);
  border-radius: 8px;
  font-weight: 950;
  transform: rotate(-4deg);
  box-shadow: 6px 6px 0 var(--pink);
}

.setup-card,
.game-stage,
.definition-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.setup-card {
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--radius);
}

.setup-card h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.helper-text {
  color: var(--muted);
  line-height: 1.5;
}

.player-fields {
  display: grid;
  gap: 10px;
  margin: 24px 0 14px;
}

.field-row {
  display: flex;
  gap: 8px;
}

.field-row input,
.select-field select {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(9, 8, 20, 0.68);
}

.remove-player {
  width: 50px;
  flex: 0 0 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.select-field {
  display: grid;
  gap: 8px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.game-shell {
  display: grid;
  gap: 22px;
}

.game-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.game-title h1 {
  margin-bottom: 4px;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

.game-title p {
  color: var(--muted);
}

.scoreboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.score-chip {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  font-weight: 800;
}

.score-chip.is-current {
  color: var(--bg);
  border-color: var(--cyan);
  background: var(--cyan);
}

.game-stage {
  padding: clamp(20px, 4vw, 36px);
  border-radius: 28px;
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 0.62fr);
  gap: clamp(26px, 5vw, 56px);
}

.mystery-card {
  min-height: 390px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 22px;
  color: #15101f;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.12)),
    linear-gradient(135deg, var(--pink), var(--violet) 52%, var(--cyan));
  box-shadow: 14px 14px 0 rgba(108, 229, 232, 0.13);
}

.mystery-card::before,
.mystery-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 2px solid rgba(13, 10, 26, 0.18);
}

.mystery-card::before {
  width: 220px;
  height: 220px;
  right: -64px;
  bottom: -52px;
  box-shadow: inset 0 0 0 35px rgba(13, 10, 26, 0.07), inset 0 0 0 70px rgba(13, 10, 26, 0.05);
}

.mystery-card::after {
  width: 26px;
  height: 26px;
  right: 31px;
  bottom: 43px;
  background: var(--yellow);
}

.round-label {
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mystery-symbol {
  position: relative;
  z-index: 1;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(7rem, 15vw, 10rem);
  line-height: 0.8;
}

.mystery-card.is-revealed .mystery-symbol {
  display: none;
}

.revealed-song {
  position: relative;
  z-index: 1;
}

.revealed-song .year {
  display: block;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(4.3rem, 10vw, 7rem);
  line-height: 0.86;
}

.revealed-song h2 {
  margin: 14px 0 8px;
  max-width: 13ch;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1;
}

.revealed-song p {
  font-weight: 750;
}

.listen-actions {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.listen-actions .button {
  width: 100%;
}

.timeline-panel {
  min-width: 0;
}

.turn-kicker {
  color: var(--cyan);
  font-weight: 850;
}

.timeline-panel h2 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
}

.timeline-help {
  color: var(--muted);
  line-height: 1.45;
}

.timeline {
  margin-top: 24px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scrollbar-color: var(--pink) transparent;
}

.timeline-card {
  width: 124px;
  min-width: 124px;
  min-height: 148px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-card .year {
  color: var(--yellow);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.timeline-card strong {
  font-size: 0.86rem;
  line-height: 1.2;
}

.slot-button {
  width: 76px;
  min-width: 76px;
  min-height: 148px;
  padding: 10px 6px;
  border: 2px dashed rgba(108, 229, 232, 0.32);
  border-radius: 16px;
  color: var(--cyan);
  background: rgba(108, 229, 232, 0.04);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.2;
}

.slot-button:hover,
.slot-button.is-selected {
  border-style: solid;
  color: var(--bg);
  background: var(--cyan);
}

.result-banner {
  margin: 22px 0 0;
  padding: 16px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.result-banner.is-correct {
  color: #07170c;
  background: var(--green);
}

.result-banner.is-wrong {
  color: #25100f;
  background: var(--danger);
}

.result-banner strong {
  display: block;
  font-size: 1.1rem;
}

.result-banner p {
  margin: 3px 0 0;
}

.game-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.section-heading {
  margin: 26px 0 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.section-heading h1,
.rules-intro h1 {
  font-size: clamp(3rem, 7vw, 6rem);
}

.card-actions {
  flex: 0 0 auto;
  display: grid;
  gap: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
}

.segmented button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.segmented button.is-active {
  color: var(--bg);
  background: var(--ink);
}

.print-note {
  margin-bottom: 24px;
  padding: 14px 16px;
  border-left: 3px solid var(--yellow);
  color: var(--muted);
  background: rgba(255, 209, 102, 0.06);
  line-height: 1.5;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.print-card {
  aspect-ratio: 58 / 84;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  break-inside: avoid;
  background:
    linear-gradient(155deg, rgba(255,255,255,0.07), transparent 45%),
    #17152a;
}

.print-card::after {
  content: "";
  position: absolute;
  inset: auto -30% -28% 12%;
  height: 48%;
  border: 2px solid rgba(255, 79, 163, 0.32);
  border-radius: 50%;
  transform: rotate(-12deg);
  box-shadow: 0 0 0 16px rgba(154, 125, 255, 0.08), 0 0 0 32px rgba(108, 229, 232, 0.05);
}

.card-number {
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.qr-wrap {
  width: min(82%, 220px);
  margin: 8px auto;
  padding: 10px;
  border-radius: 13px;
  background: white;
  position: relative;
  z-index: 1;
}

.qr-wrap img {
  width: 100%;
  display: block;
}

.card-front-copy {
  position: relative;
  z-index: 1;
}

.card-front-copy strong,
.card-back-copy h2 {
  display: block;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card-front-copy strong {
  font-size: 1.35rem;
}

.card-front-copy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.card-back-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
}

.card-back-copy .year {
  color: var(--yellow);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(3.5rem, 8vw, 5rem);
  line-height: 0.9;
}

.card-back-copy h2 {
  margin: 18px 0 10px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1;
}

.card-back-copy p {
  color: var(--muted);
}

.card-link {
  position: relative;
  z-index: 2;
  color: var(--cyan);
  font-size: 0.8rem;
}

.rules-layout {
  min-height: 65vh;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
  align-items: center;
  gap: clamp(36px, 7vw, 86px);
}

.rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.rules-list li {
  padding: 22px 0;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.rules-list li > span {
  color: var(--pink);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 1.7rem;
}

.rules-list h2 {
  margin-bottom: 5px;
  font-size: 1.15rem;
}

.rules-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.definition-card {
  max-width: 760px;
  padding: 22px 24px;
  border-radius: 18px;
}

.definition-card strong {
  color: var(--yellow);
}

.definition-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.legal-copy {
  max-width: 82ch;
  margin: 28px 0 0;
  color: #8c88a1;
  font-size: 0.78rem;
  line-height: 1.55;
}

.winner-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: #1b182e;
  box-shadow: var(--shadow);
  text-align: center;
}

.winner-dialog::backdrop {
  background: rgba(5, 4, 12, 0.82);
  backdrop-filter: blur(8px);
}

.winner-burst {
  color: var(--yellow);
  font-size: 4rem;
}

.winner-dialog h2 {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 3.2rem;
  line-height: 1;
  text-transform: uppercase;
}

.winner-dialog p {
  color: var(--muted);
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
  }

  .main-nav {
    overflow-x: auto;
    max-width: calc(100vw - 104px);
  }

  .nav-button {
    padding: 0 13px;
    white-space: nowrap;
  }

  main {
    padding-top: 12px;
  }

  .setup-layout,
  .game-stage,
  .rules-layout {
    grid-template-columns: 1fr;
  }

  .setup-layout {
    min-height: 0;
    padding: 30px 0;
  }

  .setup-copy::after {
    right: 2%;
    bottom: -8px;
  }

  .game-toolbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .scoreboard {
    justify-content: flex-start;
  }

  .game-stage {
    padding: 16px;
  }

  .mystery-card {
    min-height: 320px;
  }

  .card-actions {
    width: 100%;
  }

  .card-actions .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .site-header {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .brand {
    font-size: 0;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .main-nav {
    max-width: calc(100vw - 76px);
  }

  main {
    width: min(100% - 20px, 1180px);
  }

  .result-banner,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .game-footer-actions {
    justify-content: stretch;
  }

  .game-footer-actions .button {
    flex: 1;
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .print-card {
    padding: 10px;
    border-radius: 12px;
  }

  .card-front-copy strong {
    font-size: 1rem;
  }

  .card-link {
    display: none;
  }
}

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

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  :root {
    color-scheme: light;
  }

  body {
    background: white;
  }

  .site-header,
  .no-print,
  [data-view-panel="play"],
  [data-view-panel="rules"],
  .section-heading,
  .ambient {
    display: none !important;
  }

  main {
    width: auto;
    margin: 0;
    padding: 0;
  }

  [data-view-panel="cards"] {
    display: block !important;
  }

  .cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 58mm);
    gap: 5mm;
    justify-content: center;
  }

  .print-card {
    width: 58mm;
    height: 84mm;
    aspect-ratio: auto;
    border-radius: 4mm;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .card-link {
    display: none;
  }
}
