:root {
  --ink: #120e1d;
  --ink-2: #191330;
  --panel: #241d3c;
  --panel-2: #2f2650;
  --line: rgba(244, 239, 228, 0.13);
  --cream: #f4efe4;
  --muted: #a396c9;
  --amber: #ffb020;
  --pink: #ff3d81;
  --mint: #35e0a1;
  --violet: #7b5cff;

  --display: "Big Shoulders Display", "Haettenschweiler", "Impact", sans-serif;
  --body: "Outfit", "Segoe UI", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "Courier New", monospace;

  --radius: 14px;
  --gutter: clamp(14px, 3vw, 34px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(120% 80% at 12% -10%, #35205c 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, #4a1a44 0%, transparent 50%),
    var(--ink);
  background-attachment: fixed;
  color: var(--cream);
  font-family: var(--body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------- Kopfzeile */

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cream);
}

.brand-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.brand-bars i {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: var(--amber);
  animation: bounce 1.4s ease-in-out infinite;
}

.brand-bars i:nth-child(1) {
  height: 12px;
  background: var(--amber);
}
.brand-bars i:nth-child(2) {
  height: 22px;
  background: var(--pink);
  animation-delay: 0.2s;
}
.brand-bars i:nth-child(3) {
  height: 8px;
  background: var(--mint);
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(0.45);
  }
}

.brand-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(20px, 3.4vw, 28px);
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.chip {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(244, 239, 228, 0.05);
  color: var(--muted);
  white-space: nowrap;
}

.chip-code {
  color: var(--amber);
  border-color: rgba(255, 176, 32, 0.4);
  font-size: 14px;
}

.chip-live {
  color: var(--mint);
  border-color: rgba(53, 224, 161, 0.35);
}

/* ---------------------------------------------------------------- Layout */

.view {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--gutter);
  gap: clamp(16px, 2.5vw, 28px);
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--ink-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 30px);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 0.95;
}

h1 {
  font-size: clamp(36px, 7vw, 76px);
}
h2 {
  font-size: clamp(24px, 3.6vw, 38px);
}
h3 {
  font-size: clamp(17px, 2.2vw, 22px);
  letter-spacing: 0.08em;
  color: var(--muted);
}

p {
  margin: 0;
  color: rgba(244, 239, 228, 0.78);
}

.lede {
  font-size: clamp(16px, 1.7vw, 19px);
  max-width: 62ch;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

/* -------------------------------------------------------------- Elemente */

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: transform 0.14s ease, filter 0.14s ease, background 0.14s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(100deg, var(--amber), var(--pink));
  color: #1a0b16;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--cream);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(244, 239, 228, 0.07);
}

.btn-small {
  padding: 8px 14px;
  min-height: 36px;
  font-size: 14px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

input[type="text"],
input[type="number"],
select {
  font: inherit;
  color: var(--cream);
  background: rgba(18, 14, 29, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  min-height: 46px;
  width: 100%;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
.slot:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field {
  display: flex;
  flex-direction: column;
}

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

/* ------------------------------------------------------------ Startseite */

.hero {
  display: grid;
  gap: clamp(18px, 3vw, 30px);
  align-content: center;
  flex: 1;
}

.hero h1 span {
  display: block;
  color: var(--amber);
}

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

.mode-card {
  text-align: left;
  background: linear-gradient(170deg, var(--panel-2), var(--ink-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.mode-card:hover:not(:disabled) {
  border-color: var(--amber);
  transform: translateY(-2px);
}

.mode-card strong {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mode-card span {
  color: var(--muted);
  font-size: 14px;
}

/* ------------------------------------------------------ Kategorienwahl */

.checks {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 14, 29, 0.5);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  color: var(--cream);
  margin: 0;
  font-size: 15px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.check:has(input:checked) {
  border-color: var(--amber);
  background: rgba(255, 176, 32, 0.09);
}

.check input {
  margin: 3px 0 0;
  accent-color: var(--amber);
  width: 17px;
  height: 17px;
  flex: none;
}

.check small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.check b {
  font-weight: 600;
}

/* ------------------------------------------------------------ Spielerliste */

.players {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.player-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 14, 29, 0.55);
}

.player-tile.is-active {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(255, 176, 32, 0.35), 0 8px 26px -14px var(--amber);
}

.player-tile .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  flex: none;
}

.player-tile .dot.off {
  background: #5c5178;
}

.player-tile .name {
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-tile .count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
}

/* ----------------------------------------------------------- Spielbrett */

.board {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vw, 24px);
  flex: 1;
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.turn-of {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.turn-of .who {
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 50px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--amber);
}

/* Das Mysterienkaertchen: laeuft, aber verraet nichts */
.now-playing {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(123, 92, 255, 0.2), rgba(255, 61, 129, 0.12));
}

.equaliser {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 40px;
  flex: none;
}

.equaliser i {
  width: 5px;
  border-radius: 3px;
  background: var(--amber);
  height: 40%;
  animation: eq 0.9s ease-in-out infinite;
}

.equaliser i:nth-child(2) {
  animation-delay: 0.15s;
  background: var(--pink);
}
.equaliser i:nth-child(3) {
  animation-delay: 0.3s;
  background: var(--mint);
}
.equaliser i:nth-child(4) {
  animation-delay: 0.45s;
  background: var(--violet);
}
.equaliser i:nth-child(5) {
  animation-delay: 0.6s;
}

@keyframes eq {
  0%,
  100% {
    height: 25%;
  }
  50% {
    height: 100%;
  }
}

.now-playing.is-paused .equaliser i {
  animation-play-state: paused;
  height: 30%;
}

.now-playing .label {
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.now-playing .sub {
  font-size: 14px;
  color: var(--muted);
}

/* --------------------------------------------- Signatur: der Zeitstrahl */

.rail-wrap {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: repeating-linear-gradient(
      90deg,
      rgba(244, 239, 228, 0.045) 0 1px,
      transparent 1px 46px
    ),
    rgba(18, 14, 29, 0.55);
  padding: 18px 0;
}

.rail-wrap::before,
.rail-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  pointer-events: none;
  z-index: 2;
}

.rail-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--ink-2), transparent);
  border-radius: var(--radius) 0 0 var(--radius);
}

.rail-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--ink-2), transparent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.rail {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: safe center;
  padding: 6px 26px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-2) transparent;
}

.rail::-webkit-scrollbar {
  height: 8px;
}
.rail::-webkit-scrollbar-thumb {
  background: var(--panel-2);
  border-radius: 4px;
}

.card {
  flex: none;
  width: clamp(104px, 21vw, 154px);
  border-radius: 12px;
  padding: 14px 12px;
  background: linear-gradient(168deg, var(--panel-2), #1d1733);
  border: 1px solid var(--line);
  border-top: 3px solid var(--violet);
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-snap-align: center;
}

.card-year {
  font-family: var(--mono);
  font-size: clamp(21px, 3.4vw, 28px);
  color: var(--amber);
  line-height: 1;
}

.card-title {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-artist {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card.is-new {
  border-top-color: var(--mint);
  animation: land 0.5s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.card.is-wrong {
  border-top-color: var(--pink);
}

@keyframes land {
  from {
    transform: translateY(-16px) scale(0.9);
    opacity: 0;
  }
}

.slot {
  flex: none;
  width: 46px;
  margin: 0 3px;
  border: 1px dashed rgba(244, 239, 228, 0.22);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: all 0.16s ease;
  padding: 0;
}

.slot[data-live="1"]:hover,
.slot[data-live="1"]:focus-visible {
  border-color: var(--amber);
  border-style: solid;
  background: rgba(255, 176, 32, 0.14);
  color: var(--amber);
  width: 58px;
}

.slot[data-live="0"] {
  opacity: 0.18;
  cursor: default;
  pointer-events: none;
}

.rail.is-placing .slot[data-live="1"] {
  animation: nudge 2.4s ease-in-out infinite;
}

@keyframes nudge {
  0%,
  100% {
    border-color: rgba(244, 239, 228, 0.22);
  }
  50% {
    border-color: rgba(255, 176, 32, 0.55);
  }
}

.rail-empty {
  padding: 20px 26px;
  color: var(--muted);
}

/* -------------------------------------------------------------- Aufdecken */

.reveal {
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  animation: pop 0.35s cubic-bezier(0.2, 1.2, 0.4, 1);
}

.reveal.ok {
  background: linear-gradient(100deg, rgba(53, 224, 161, 0.2), rgba(53, 224, 161, 0.04));
  border-color: rgba(53, 224, 161, 0.5);
}

.reveal.no {
  background: linear-gradient(100deg, rgba(255, 61, 129, 0.2), rgba(255, 61, 129, 0.04));
  border-color: rgba(255, 61, 129, 0.5);
}

@keyframes pop {
  from {
    transform: scale(0.97);
    opacity: 0;
  }
}

.reveal-year {
  font-family: var(--mono);
  font-size: clamp(48px, 11vw, 104px);
  line-height: 0.85;
  color: var(--cream);
  flex: none;
}

.reveal-body {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reveal-verdict {
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 40px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reveal.ok .reveal-verdict {
  color: var(--mint);
}
.reveal.no .reveal-verdict {
  color: var(--pink);
}

.reveal-song {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 600;
}

.reveal-work {
  font-size: 14px;
  color: var(--amber);
}

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

/* ---------------------------------------------------------------- Sonstiges */

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 239, 228, 0.1);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--pink));
  transition: width 0.25s ease;
}

.notice {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 61, 129, 0.45);
  background: rgba(255, 61, 129, 0.1);
  font-size: 14.5px;
}

.notice.info {
  border-color: rgba(123, 92, 255, 0.45);
  background: rgba(123, 92, 255, 0.12);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  background: var(--cream);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 40;
  max-width: min(92vw, 460px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.bad {
  background: var(--pink);
  color: #1a0b16;
}

.scoreline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.podium {
  display: grid;
  gap: 10px;
}

.podium-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 14, 29, 0.5);
}

.podium-row.win {
  border-color: var(--amber);
  background: rgba(255, 176, 32, 0.1);
}

.podium-rank {
  font-family: var(--mono);
  font-size: 20px;
  color: var(--amber);
  width: 34px;
}

.share {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.share code {
  font-family: var(--mono);
  background: rgba(18, 14, 29, 0.7);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.mini-timelines {
  display: grid;
  gap: 12px;
}

.mini {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mini .who {
  width: 120px;
  font-weight: 600;
  font-size: 14px;
}

.mini .years {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.mini .years span {
  font-family: var(--mono);
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(244, 239, 228, 0.07);
  border: 1px solid var(--line);
}

@media (max-width: 760px) {
  .chip-live {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 14px;
  }
  .brand-word {
    font-size: 19px;
  }
  .rail {
    padding-inline: 14px;
  }
  .mini .who {
    width: 100%;
  }
  .reveal-year {
    width: 100%;
  }
}
