@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ---------------------------------------------------------------------------
   Spicy: after Spicy Lyrics.

   The page sits on the last revealed album cover, blown up, blurred and
   drifting. Everything above it is liquid glass: translucent, frosted, with
   a bright hairline bevel. Type is bold white at four opacities, and the
   current line glows the way an active lyric does. No colour accent; colour
   comes from the art.
   --------------------------------------------------------------------------- */
:root {
  color-scheme: dark;
  --text-1: hsla(0, 0%, 100%, 0.92);
  --text-2: hsla(0, 0%, 100%, 0.62);
  --text-3: hsla(0, 0%, 100%, 0.38);
  --text-4: hsla(0, 0%, 100%, 0.2);
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-strong: rgba(255, 255, 255, 0.18);
  --tint: rgba(255, 255, 255, 0.07);
  --tint-hover: rgba(255, 255, 255, 0.13);
  --glass: rgba(14, 12, 20, 0.28);
  --glass-strong: rgba(24, 22, 30, 0.86);
  --glass-blur: blur(22px) saturate(1.7) brightness(1.04);
  --liquid-edge:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.16);
  --liquid-cast: 0 16px 40px -8px rgba(8, 10, 18, 0.55),
    0 4px 12px -2px rgba(8, 10, 18, 0.35);
  --glow: rgba(255, 255, 255, 0.42) 0 0 14px;
  --glow-strong: rgba(255, 255, 255, 0.7) 0 0 18px;
  --good: rgb(140, 225, 170);
  --bad: rgb(255, 130, 120);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  font-family:
    "SF Pro Display",
    -apple-system,
    "Inter",
    system-ui,
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
/* Only the root carries a colour: a body background would paint over the
   fixed backdrop layer behind it. */
html {
  background: #0c0a12;
}
body {
  background: transparent;
  color: var(--text-1);
}
:where(a, button, summary, input, select, label):focus-visible {
  outline: 2px solid var(--text-1);
  outline-offset: 2px;
}
a {
  color: inherit;
}
::selection {
  background: rgba(255, 255, 255, 0.85);
  color: #000;
}

/* ---------------------------------------------------------------------------
   Dynamic background: three oversized copies of the cover, blurred, turning
   slowly in opposite directions. Before the first reveal it uses a warm
   gradient instead, so it never gives an answer away.
   --------------------------------------------------------------------------- */
/* Painted by ambient.js on a ~120px canvas and stretched to fill the
   window: blur, colour and motion happen in the canvas, so the browser only
   composites one plain image. */
.ambient {
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.ambient-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, #0006 100%);
}

/* ---------------------------------------------------------------------------
   Type
   --------------------------------------------------------------------------- */
h1,
h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.eyebrow,
.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.hint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-3);
}
.hint a {
  color: var(--text-2);
}
.muted {
  font-size: 14px;
  color: var(--text-2);
}
.small {
  font-size: 13px;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-2);
}

/* ---------------------------------------------------------------------------
   Glass surfaces
   --------------------------------------------------------------------------- */
/* No backdrop blur on the big surfaces: the backdrop is already blurred,
   and Chrome left stale black tiles where a blurred panel sat over the
   moving background. Pop-ups and dialogs keep theirs. */
.panel,
.topbar,
.lobby-setup {
  background: var(--glass);
  box-shadow: var(--liquid-edge), var(--liquid-cast);
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: inset 0 -1px 0 var(--hairline);
  background: rgba(10, 8, 16, 0.3);
}
.topbar-inner {
  max-width: 1360px;
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-right {
  justify-self: end;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  text-shadow: var(--glow);
}
.brand-disc {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #0d0c10 0 1.5px, #29262f 2px 2.5px);
  box-shadow: 0 0 0 1px var(--hairline-strong);
}
.brand-disc::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: var(--text-1);
}
body.is-playing .brand-disc {
  animation: spin 1.6s linear infinite;
}
.mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
}
.mode-switch::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--text-1);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
  transition: transform 0.4s var(--ease);
}
.mode-switch:has(a:last-child[aria-current])::before {
  transform: translateX(100%);
}
.mode-switch a {
  position: relative;
  z-index: 1;
  padding: 7px 18px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-2);
  transition: color 0.25s ease;
}
.mode-switch a:hover {
  color: var(--text-1);
}
.mode-switch a[aria-current="page"] {
  color: #000;
}
.theme-picker select,
.connection {
  height: 36px;
}

/* ---------------------------------------------------------------------------
   Buttons: pills. Primary is white on black-glass; everything else is tint.
   --------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.2s var(--spring),
    opacity 0.2s ease;
}
.button:not(:disabled):active,
.play-button:not(:disabled):active {
  transform: scale(0.96);
}
.button:disabled,
.play-button:disabled {
  opacity: 0.4;
  cursor: default;
}
.button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.primary {
  background: var(--text-1);
  color: #000;
}
.primary:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.35);
}
.secondary,
.outlined,
.ghost {
  background: var(--tint);
  color: var(--text-1);
  box-shadow: var(--liquid-edge);
}
.secondary:hover:not(:disabled),
.outlined:hover:not(:disabled),
.ghost:hover {
  background: var(--tint-hover);
}
.ghost {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}
.wide {
  width: 100%;
}
.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.text-button:hover:not(:disabled) {
  color: var(--text-1);
  text-shadow: var(--glow);
}
.text-button:disabled {
  opacity: 0.4;
}
.danger {
  color: var(--bad);
}

/* ---------------------------------------------------------------------------
   Fields
   --------------------------------------------------------------------------- */
select,
input[type="number"],
input[type="text"],
.source-button {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-size: 14px;
  color: var(--text-1);
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='none' stroke='%23ffffffa0' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1.5 3.5 5 7l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
select option {
  background: #1c1a22;
  color: #fff;
}
.theme-picker select {
  width: auto;
  border-radius: 999px;
  padding: 0 32px 0 14px;
  font-size: 13px;
  font-weight: 600;
}
select:hover,
input[type="number"]:hover,
input[type="text"]:hover,
.source-button:hover {
  background-color: var(--tint-hover);
}
select:focus,
input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  box-shadow:
    var(--liquid-edge),
    0 0 0 2px rgba(255, 255, 255, 0.35);
}
input::placeholder {
  color: var(--text-3);
}
input[type="checkbox"] {
  accent-color: #fff;
}
input[type="range"] {
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: var(--hairline-strong);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: var(--hairline-strong);
}
input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--text-1);
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  transition: transform 0.2s var(--spring);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.2);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}
.toggle-row input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 12px;
  background: var(--tint-hover);
  box-shadow: var(--liquid-edge);
  cursor: pointer;
  transition: background-color 0.25s ease;
}
.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px #0006;
  transition: transform 0.3s var(--spring);
}
.toggle-row input[type="checkbox"]:checked {
  background: rgba(255, 255, 255, 0.85);
}
.toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(16px);
  background: #111;
}

/* Disclosures */
details {
  border-top: 1px solid var(--hairline);
}
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.3s var(--ease);
}
details[open] > summary::after {
  transform: translateY(1px) rotate(-135deg);
}
summary:hover,
details[open] > summary {
  color: var(--text-1);
}
details > :last-child {
  padding-bottom: 14px;
}
@supports (interpolate-size: allow-keywords) {
  details {
    interpolate-size: allow-keywords;
  }
  details::details-content {
    block-size: 0;
    overflow-y: clip;
    transition:
      block-size 0.3s var(--ease),
      content-visibility 0.3s allow-discrete;
  }
  details[open]::details-content {
    block-size: auto;
  }
}

/* Messages */
.message {
  min-height: 28px;
  padding-top: 10px;
  font-size: 14px;
  color: var(--text-2);
}
.message.error {
  color: var(--bad);
}
.message.success {
  color: var(--good);
  font-weight: 600;
}

/* Popovers */
.suggestions,
.source-dropdown {
  padding: 6px;
  border-radius: 16px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  backdrop-filter: blur(30px) saturate(1.6);
  box-shadow:
    var(--liquid-edge),
    0 24px 60px -10px rgba(0, 0, 0, 0.7);
  max-height: 360px;
  transform-origin: top center;
  animation: pop 0.2s var(--ease) both;
}
.suggestions.above {
  transform-origin: bottom center;
}
.suggestions button {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 14px;
}
.suggestions button strong {
  font-weight: 700;
  color: var(--text-2);
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.suggestions button > span:last-child {
  flex-shrink: 0;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-3);
}
.suggestions .suggestion-title {
  max-width: none;
  gap: 2px;
}
.suggestions button:hover,
.suggestions button[aria-selected="true"] {
  background: var(--tint);
}
.suggestions button:hover strong,
.suggestions button[aria-selected="true"] strong {
  color: #fff;
  text-shadow: var(--glow);
}
.suggestions button.guessed-wrong,
.suggestions button.guessed-wrong:hover {
  background: none;
  cursor: not-allowed;
  opacity: 0.6;
}
.suggestions button.guessed-wrong strong {
  color: var(--text-3);
  text-shadow: none;
  text-decoration: line-through;
}
.suggestions .guess-status {
  font-size: 12px;
  color: var(--bad);
}
.suggestion-status {
  padding: 12px;
  font-size: 13px;
  color: var(--text-3);
}

/* Progress */
.audio-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--hairline);
  overflow: hidden;
}
.audio-progress > div {
  width: 0;
  height: 100%;
  border-radius: 4px;
  background: var(--text-1);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* Dialogs */
dialog {
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border: 0;
  border-radius: 26px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  backdrop-filter: blur(40px) saturate(1.6);
  box-shadow:
    var(--liquid-edge),
    0 40px 88px -10px rgba(8, 10, 18, 0.7);
  color: var(--text-1);
}
dialog[open] {
  animation: dialog-in 0.35s var(--spring) both;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade 0.25s ease both;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}
.dialog-heading h2 {
  font-size: 28px;
  text-shadow: var(--glow);
}
.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-size: 20px;
  line-height: 1;
  color: var(--text-2);
  transition: transform 0.3s var(--ease), color 0.2s ease;
}
.icon-button:hover {
  color: var(--text-1);
  transform: rotate(90deg);
}
#playlist-form .field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
#playlist-form .primary {
  margin-top: 12px;
}
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  font-size: 13px;
  color: var(--text-3);
}
.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
#import-dialog .small,
#help-dialog .small {
  margin-top: 12px;
}
#import-dialog label[for="csv-file"] {
  cursor: pointer;
}
/* How to play reads like a lyric sheet: each step lights as it arrives. */
.how-to {
  list-style: none;
  margin: 6px 0 18px;
  padding: 0;
}
.how-to li {
  padding: 8px 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-3);
  animation: line-lit 0.6s var(--ease) both;
}
.how-to li:nth-child(2) {
  animation-delay: 0.12s;
}
.how-to li:nth-child(3) {
  animation-delay: 0.24s;
}
.how-to li:nth-child(4) {
  animation-delay: 0.36s;
}
.how-to li:hover {
  color: var(--text-1);
  text-shadow: var(--glow);
}

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */
.workspace {
  flex: 1;
  width: 100%;
  max-width: 1360px;
  margin: 24px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: stretch;
}
.panel {
  min-width: 0;
  border-radius: 26px;
  animation: rise 0.6s var(--ease) both;
}
.library,
.session {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
}
.library {
  animation-delay: 0.06s;
}
.session {
  animation-delay: 0.12s;
}
.panel-head {
  margin-bottom: 18px;
}
.panel-head h2 {
  margin-top: 4px;
  font-size: 26px;
  text-shadow: var(--glow);
}
.panel-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.panel-section > .label {
  margin-bottom: 10px;
}
.label + select,
.label + .source-picker {
  margin-top: 8px;
}

/* Library */
.source-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 44px;
  font-weight: 600;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.source-button span {
  font-size: 11px;
  color: var(--text-3);
  transition: transform 0.3s var(--ease);
}
.source-button[aria-expanded="true"] span {
  transform: rotate(180deg);
}
.source-dropdown {
  max-height: 300px;
}
.source-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.source-option:hover {
  background: var(--tint);
  color: var(--text-1);
}
.source-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}
.source-option > span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-option small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
}
.source-detail {
  margin-top: 8px;
}
.field {
  margin-top: 18px;
}
.field .hint {
  margin-top: 6px;
}
.filter-settings {
  margin-top: 18px;
}
.filter-row > div + div {
  margin-top: 14px;
}
.year-fields {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.year-fields input {
  min-width: 0;
  text-align: center;
}
.year-fields span {
  font-size: 13px;
  color: var(--text-3);
}
.decades {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.decades button {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.decades button:hover {
  background: var(--tint-hover);
  color: var(--text-1);
}
.decades button.selected {
  background: var(--text-1);
  color: #000;
}
.filter-actions {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
.pool-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.filter-actions .button {
  width: 100%;
}
.import-actions {
  display: grid;
  gap: 8px;
}
.import-actions .button {
  justify-content: flex-start;
}
.import-actions label {
  cursor: pointer;
}
#library-cache-status {
  margin-top: 10px;
}
.library .panel-section {
  margin-bottom: 20px;
}
.library .manage-sources {
  margin-top: auto;
}
.manage-sources .hint {
  margin-top: 8px;
}
.manage-sources #expand-library {
  width: 100%;
  margin: 12px 0;
}
.playlist-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--text-2);
}
.playlist-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.playlist-row .text-button {
  font-size: 13px;
  color: var(--bad);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Game
   --------------------------------------------------------------------------- */
.game {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 40px 22px;
}
.game-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.round-badge {
  color: var(--text-2);
}
.source-tag {
  text-align: right;
}
/* The headline is set like a lyric caught mid-line: the sung part lit and
   glowing, the rest waiting. While a clip plays the last word fills in. */
.game h1 {
  margin-top: 12px;
  font-size: clamp(42px, 4.4vw, 64px);
  color: var(--text-1);
  text-shadow: var(--glow);
}
.game h1 em {
  font-style: normal;
  color: var(--text-4);
  text-shadow: none;
}
body.is-playing .game h1 em {
  background: linear-gradient(
    90deg,
    #fff calc(var(--progress, 0) * 100%),
    var(--text-4) calc(var(--progress, 0) * 100% + 0.5%)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.instructions {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-2);
}
.record-scene {
  flex: 1;
  min-height: 290px;
  display: grid;
  place-items: center;
  padding: 26px 0 14px;
}
.record-slot {
  position: relative;
  width: 240px;
  height: 240px;
}
.record {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.8),
    0 0 0 1px var(--hairline-strong);
  transition:
    transform 0.6s var(--spring),
    box-shadow 0.6s ease;
}
.record svg {
  display: block;
  width: 100%;
  height: 100%;
}
.record .vinyl {
  fill: #0d0c10;
  stroke: rgba(255, 255, 255, 0.14);
}
.record .groove {
  stroke: #24212a;
}
.record .groove-alt {
  stroke: #1a1820;
}
.record .label-disc {
  fill: rgba(255, 255, 255, 0.92);
}
.record .label-ring {
  stroke: rgba(0, 0, 0, 0.12);
  stroke-width: 1;
}
.record .label-title,
.record .label-text {
  fill: #111;
  font-family: "Inter", sans-serif;
}
.record .label-title {
  font-weight: 800;
  letter-spacing: 0.5px;
}
.record .label-hole {
  fill: #0d0c10;
}
.record.spinning {
  animation: record-spin 2.4s linear infinite;
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(255, 255, 255, 0.12),
    0 0 0 1px var(--hairline-strong);
}
.record-scene.revealed .record {
  transform: scale(1.04);
}
.record-scene.revealed .record.spinning {
  animation-duration: 5s;
}
.record-art {
  position: absolute;
  inset: 21%;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #0d0c10;
  animation: label-in 0.6s var(--spring) both;
}
.record-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.record-spindle {
  position: absolute;
  inset: calc(50% - 5px);
  border-radius: 50%;
  background: #0d0c10;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.listen-caption {
  margin-bottom: 16px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-3);
  animation: fade 0.5s ease both;
}

/* Play: a glass pill whose label fills in like a sung line. */
.play-button {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--text-1);
  color: #000;
  font-size: 17px;
  font-weight: 700;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s var(--spring);
}
.play-button:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.35);
}
.play-button:disabled {
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  color: var(--text-2);
  opacity: 1;
}
.play-button #play-icon {
  font-size: 12px;
}
body.is-playing .play-button,
.game.is-revealed .play-button {
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  color: var(--text-1);
}
body.is-playing .play-button:hover:not(:disabled),
.game.is-revealed .play-button:hover:not(:disabled) {
  background: var(--tint-hover);
  box-shadow: var(--liquid-edge);
}
body.is-playing .play-button #play-text {
  background: linear-gradient(
    90deg,
    #fff calc(var(--progress, 0) * 100%),
    var(--text-3) calc(var(--progress, 0) * 100% + 1%)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eq {
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.eq i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom;
  animation: level 0.8s ease-in-out infinite alternate;
}
.eq i:nth-child(2) {
  animation-delay: -0.3s;
}
.eq i:nth-child(3) {
  animation-delay: -0.55s;
}
.eq i:nth-child(4) {
  animation-delay: -0.15s;
}
body.is-playing .eq {
  display: inline-flex;
}
.player .audio-progress {
  margin: 12px 18px 0;
}

/* Clip length: glass segments with a sliding white highlight. */
.clip-control {
  margin-top: 20px;
}
.clip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.clip-head .hint {
  font-size: 12px;
}
.clip-steps {
  --step: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 4px;
  border-radius: 999px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
}
.clip-steps:has([data-stage="1"].active) {
  --step: 1;
}
.clip-steps:has([data-stage="2"].active) {
  --step: 2;
}
.clip-steps:has([data-stage="3"].active) {
  --step: 3;
}
.clip-steps:has([data-stage="4"].active) {
  --step: 4;
}
.clip-steps::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 5);
  border-radius: 999px;
  background: var(--text-1);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  transform: translateX(calc(var(--step) * 100%));
  transition: transform 0.5s var(--spring);
}
.clip-steps button {
  position: relative;
  z-index: 1;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-3);
  transition: color 0.25s ease;
}
.clip-steps button:hover:not(:disabled):not(.active) {
  color: var(--text-1);
}
.clip-steps button.heard {
  color: var(--text-2);
}
.clip-steps button.active {
  color: #000;
}

/* Guess */
#guess-form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.guess-field {
  flex: 1;
  min-width: 0;
}
.guess-wrapper {
  display: flex;
  align-items: center;
  height: 54px;
  padding: 0 6px 0 18px;
  border-radius: 999px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}
.guess-wrapper:focus-within {
  background: var(--tint-hover);
  box-shadow:
    var(--liquid-edge),
    0 0 0 2px rgba(255, 255, 255, 0.3);
}
.guess-wrapper.shake {
  box-shadow:
    var(--liquid-edge),
    0 0 0 2px rgba(255, 130, 120, 0.6);
  animation: shake 0.4s ease;
}
.guess-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.guess-wrapper input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: 17px;
  font-weight: 600;
}
.guess-wrapper input:focus {
  box-shadow: none;
}
.guess-wrapper button {
  flex-shrink: 0;
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--text-1);
  color: #000;
  font-size: 14px;
  font-weight: 700;
}
.guess-wrapper button:disabled {
  opacity: 0.4;
}
.skip {
  height: 54px;
  min-width: 86px;
}
.skip span {
  margin-left: 2px;
}
/* Missed titles stack up like the lines already sung. */
.guess-history {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.guess-history span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-4);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 130, 120, 0.6);
  animation: line-dim 0.6s var(--ease) both;
}

/* Reveal */
.reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  text-align: center;
}
.reveal-info {
  width: 100%;
  min-width: 0;
}
.reveal-info > * {
  animation: line-lit 0.6s var(--ease) both;
}
.reveal-info > :nth-child(2) {
  animation-delay: 0.08s;
}
.reveal-info > :nth-child(3) {
  animation-delay: 0.16s;
}
.reveal-info > :nth-child(n + 4) {
  animation-delay: 0.24s;
}
.result-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.reveal.won .result-label {
  color: var(--good);
  text-shadow: 0 0 12px rgba(140, 225, 170, 0.5);
}
.reveal-info h2 {
  margin-top: 10px;
  font-size: clamp(34px, 3.6vw, 52px);
  text-shadow: var(--glow-strong);
  overflow-wrap: anywhere;
}
.reveal-info p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
#reveal-artist {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-2);
}
#reveal-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
#reveal-links a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-1);
  transition: background-color 0.2s ease;
}
#reveal-links a:hover {
  background: var(--tint-hover);
}
#next-button {
  min-width: 190px;
  height: 48px;
  font-size: 15px;
  animation: rise 0.5s var(--ease) 0.3s both;
}
.game.is-revealed .record-scene {
  min-height: 250px;
}

.game-bottom {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.game-bottom .keys {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
}
.game-bottom .keys kbd:nth-of-type(2) {
  margin-left: 10px;
}

/* ---------------------------------------------------------------------------
   Scoreboard
   --------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
}
.stats strong {
  display: inline-block;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: var(--glow);
  transform-origin: left bottom;
}
.stats span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.best-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.best-stat strong {
  display: inline-block;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-1);
}
.bump {
  animation: bump 0.8s var(--spring);
}
.volume-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.volume-label > :last-child {
  font-size: 13px;
  color: var(--text-1);
}
.session .settings {
  margin-top: 20px;
}
#random-start-hint {
  margin-top: 8px;
}
#random-start-hint:empty {
  display: none;
}
.confetti-setting {
  margin-top: 18px;
}
.range-endpoints {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-3);
}
.session .recent {
  margin-top: 0;
}
/* Recently played fades down the list like lyrics already behind you. */
.recent-track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  transition: opacity 0.3s ease;
}
.recent-track:nth-child(2) {
  opacity: 0.78;
}
.recent-track:nth-child(3) {
  opacity: 0.6;
}
.recent-track:nth-child(4) {
  opacity: 0.45;
}
.recent-track:nth-child(5) {
  opacity: 0.32;
}
.recent-track:hover {
  opacity: 1;
}
.recent-track:first-child {
  animation: line-lit 0.6s var(--ease) both;
}
.recent-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--tint);
  font-size: 11px;
  color: var(--text-3);
}
.recent-icon.won {
  color: var(--good);
}
.recent-track > div {
  flex: 1;
  min-width: 0;
}
.recent-track strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-track:first-child strong {
  text-shadow: var(--glow);
}
.recent-track > div > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-track > small {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}

footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px 28px;
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

/* ---------------------------------------------------------------------------
   Lobby
   --------------------------------------------------------------------------- */
.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.connection:empty {
  display: none;
}
.connection::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
.connection[data-state="connecting"]::before {
  animation: blink 1s steps(1) infinite;
}
.connection[data-state="connected"]::before {
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}
.connection[data-state="disconnected"]::before {
  background: var(--bad);
}
.lobby-shell {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 24px auto 32px;
  padding: 0 24px;
}
.lobby-setup {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px 40px;
  border-radius: 28px;
  animation: rise 0.6s var(--ease) both;
}
.lobby-setup h1 {
  margin: 10px 0 12px;
  font-size: clamp(44px, 6.4vw, 76px);
  text-shadow: var(--glow);
}
.lobby-setup > h1 + .muted {
  max-width: 560px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-2);
}
.field-label,
.field > label {
  display: block;
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.lobby-setup > .field-label {
  margin-top: 28px;
}
.lobby-shell input:not([type="checkbox"]):not([type="range"]) {
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  color: var(--text-1);
  font-size: 16px;
  font-weight: 600;
}
.lobby-shell input:not([type="checkbox"]):not([type="range"]):focus {
  outline: none;
  background: var(--tint-hover);
  box-shadow:
    var(--liquid-edge),
    0 0 0 2px rgba(255, 255, 255, 0.3);
}
.lobby-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
  margin: 24px 0 20px;
}
.lobby-entry-grid > section {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: 22px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  animation: rise 0.5s var(--ease) both;
}
.lobby-entry-grid > section + section {
  animation-delay: 0.08s;
}
.lobby-entry-grid h2 {
  font-size: 26px;
  margin-bottom: 4px;
  text-shadow: var(--glow);
}
.lobby-entry-grid .button {
  margin-top: 16px;
}
#room-code {
  text-transform: uppercase;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3em;
}
.lobby-sources {
  margin: 14px 0;
  max-height: 240px;
  overflow-y: auto;
}
.lobby-sources label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.lobby-sources label:hover {
  background: var(--tint);
  color: var(--text-1);
}
.lobby-sources span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.lobby-import {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.lobby-import .button {
  margin-top: 0;
}
.lobby-entry-grid .toggle-row {
  justify-content: flex-start;
  gap: 10px;
}
.lobby-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}
.room-game {
  padding: 28px 32px;
}
.room-sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
}
.room-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.room-heading h1 {
  margin-top: 8px;
  font-size: clamp(36px, 4vw, 56px);
  text-shadow: var(--glow);
}
.room-heading .button {
  flex-shrink: 0;
}
.room-code {
  color: var(--text-1);
  letter-spacing: 0.16em;
}
#room-message {
  margin-top: 10px;
  min-height: 24px;
}
.room-record-wrap {
  display: flex;
  justify-content: center;
  padding: 26px 0;
}
.lobby-record {
  width: 220px;
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  background: repeating-radial-gradient(
    circle,
    #0d0c10 0 4px,
    #24212a 4.5px 5px,
    #0d0c10 5.5px 7px
  );
  box-shadow:
    0 30px 60px -20px rgba(0, 0, 0, 0.8),
    0 0 0 1px var(--hairline-strong);
}
.lobby-record.spinning {
  animation: record-spin 2.4s linear infinite;
}
.lobby-label {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  color: #111;
}
.lobby-label span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  transform: translateY(-16px);
}
.lobby-label img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: label-in 0.6s var(--spring) both;
}
.lobby-spindle {
  position: absolute;
  inset: calc(50% - 5px);
  border-radius: 50%;
  background: #0d0c10;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.room-answer {
  text-align: center;
  margin-bottom: 22px;
}
.room-answer > * {
  animation: line-lit 0.6s var(--ease) both;
}
.room-answer .eyebrow {
  color: var(--good);
}
.room-answer h2 {
  margin: 8px 0 6px;
  font-size: clamp(34px, 3.6vw, 52px);
  text-shadow: var(--glow-strong);
  overflow-wrap: anywhere;
}
.room-answer p {
  margin: 4px 0;
  overflow-wrap: anywhere;
}
#answer-artist {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-2);
}
#answer-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
#answer-links a {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.clip-status {
  margin: 12px 0;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
}
#room-progress {
  height: 100%;
}
.host-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px;
  border-radius: 20px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
}
.host-controls::before {
  content: "Host controls";
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
#host-next {
  margin-left: auto;
}
#room-guess-form {
  margin-top: 16px;
}
.room-guess-row {
  display: flex;
  gap: 8px;
}
#room-submit {
  height: 48px;
}
#guess-feedback {
  min-height: 24px;
  margin: 12px 0;
  font-size: 14px;
  color: var(--text-2);
}
#guess-feedback.correct {
  color: var(--good);
  font-weight: 700;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 0;
}
#play-clip {
  height: 54px;
  min-width: 180px;
  font-size: 16px;
}
#vote-skip {
  width: 100%;
}
.skip-countdown {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--tint);
  box-shadow: var(--liquid-edge);
  font-weight: 700;
}
.room-sidebar h2 {
  margin: 8px 0;
  font-size: 26px;
  text-shadow: var(--glow);
}
#players {
  margin: 16px 0;
}
.room-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.room-player strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}
.room-player small {
  grid-column: 1;
  font-size: 12px;
  color: var(--text-3);
}
.room-player .score {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 26px;
  font-weight: 800;
  text-shadow: var(--glow);
}
.room-volume {
  margin-bottom: 18px;
}
#leave-room {
  width: 100%;
  margin-bottom: 16px;
}
#leave-room:hover {
  color: var(--bad);
}
#lobby-error {
  max-width: 920px;
  margin: 12px auto;
}
#lobby-error:empty {
  display: none;
}

/* ---------------------------------------------------------------------------
   Motion
   --------------------------------------------------------------------------- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes record-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
}
/* A line arriving: dim and soft, then lit. */
@keyframes line-lit {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(8px);
  }
}
@keyframes line-dim {
  from {
    color: var(--text-1);
    text-shadow: var(--glow);
    transform: translateY(6px);
  }
}
@keyframes label-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}
@keyframes level {
  from {
    transform: scaleY(0.25);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}
@keyframes bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.18);
    text-shadow: var(--glow-strong);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 250px minmax(0, 1fr) 250px;
    gap: 14px;
    padding: 0 16px;
  }
  .library,
  .session {
    padding: 20px 18px;
  }
  .game {
    padding: 24px 26px 20px;
  }
  .record-slot {
    width: 210px;
    height: 210px;
  }
  .stats strong {
    font-size: 38px;
  }
  .game-bottom .keys {
    display: none;
  }
}
@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr 1fr;
  }
  .game {
    grid-column: 1 / -1;
    order: -1;
  }
}
@media (max-width: 860px) {
  .lobby-room {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .topbar-inner {
    grid-template-columns: auto 1fr auto;
    height: 58px;
    padding: 0 12px;
    gap: 8px;
  }
  .brand-name,
  .help-text,
  .connection {
    display: none;
  }
  .help-glyph {
    display: inline;
    font-weight: 800;
  }
  .ghost {
    width: 36px;
    padding: 0;
  }
  .mode-switch {
    justify-self: center;
  }
  .mode-switch a {
    padding: 6px 10px;
    font-size: 13px;
  }
  .theme-picker select {
    padding: 0 24px 0 10px;
    font-size: 12px;
    background-position: right 9px center;
  }
  .lobby-shell {
    margin-top: 12px;
    padding: 0 10px;
  }
  .lobby-setup,
  .room-game,
  .room-sidebar {
    padding: 22px 16px;
  }
  .lobby-entry-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .room-heading {
    flex-wrap: wrap;
  }
  .lobby-record {
    width: 190px;
  }
  dialog {
    padding: 22px;
  }
}
@media (max-width: 640px) {
  .workspace {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    padding: 0 10px;
    gap: 10px;
  }
  .panel {
    border-radius: 22px;
  }
  .game {
    padding: 20px 16px 16px;
  }
  .library,
  .session {
    padding: 20px 16px;
  }
  .clip-head .hint {
    display: none;
  }
  .record-scene {
    min-height: 220px;
    padding: 18px 0 8px;
  }
  .record-slot {
    width: 180px;
    height: 180px;
  }
  .skip {
    min-width: 66px;
    padding: 0 14px;
  }
  .guess-wrapper button {
    padding: 0 14px;
  }
  #next-button {
    width: 100%;
  }
}

/* ---------------------------------------------------------------------------
   Desktop layout: Now Playing. The record holds the left half of the game
   the way the cover does in Spicy Lyrics; the right half reads top to bottom
   like the lyric column. Scoreboard and Library share a rail on the right.
   --------------------------------------------------------------------------- */
@media (min-width: 1000px) {
  .workspace {
    max-width: none;
    margin-top: clamp(14px, 1.6vw, 28px);
    padding: 0 clamp(16px, 2vw, 40px);
    gap: clamp(14px, 1.4vw, 24px);
    grid-template-columns: minmax(0, 1fr) clamp(290px, 22vw, 380px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "game score"
      "game lib";
  }
  .topbar-inner {
    max-width: none;
    padding: 0 clamp(16px, 2vw, 40px);
  }
  .game {
    grid-area: game;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
    grid-template-rows: minmax(0, 1fr) repeat(11, auto) minmax(0, 1fr);
    column-gap: clamp(24px, 3vw, 72px);
    padding: clamp(24px, 2.4vw, 48px);
  }
  .session {
    grid-area: score;
  }
  .library {
    grid-area: lib;
  }
  .game > * {
    grid-column: 2;
  }
  .game > .record-scene {
    grid-column: 1;
    grid-row: 1 / -1;
    padding: 0;
  }
  .game > .game-top {
    grid-row: 2;
  }
  .game > h1 {
    grid-row: 3;
  }
  .game > .instructions {
    grid-row: 4;
  }
  .game > .reveal {
    grid-row: 5;
  }
  .game > .listen-caption {
    grid-row: 6;
  }
  .game > .player {
    grid-row: 7;
  }
  .game > .clip-control {
    grid-row: 8;
  }
  .game > #guess-form {
    grid-row: 9;
  }
  .game > .message {
    grid-row: 10;
  }
  .game > .guess-history {
    grid-row: 11;
  }
  .game > .game-bottom {
    grid-row: 12;
  }
  .game h1 {
    font-size: clamp(44px, 4.4vw, 92px);
  }
  .listen-caption {
    margin: 22px 0 14px;
    text-align: left;
    font-size: clamp(18px, 1.4vw, 24px);
  }
  .reveal {
    align-items: flex-start;
    text-align: left;
    margin: 18px 0 28px;
  }
  #reveal-links {
    justify-content: flex-start;
  }
  .game.is-revealed .record-scene {
    min-height: 0;
  }
  .record-slot {
    width: clamp(220px, 20vw, 420px);
    height: clamp(220px, 20vw, 420px);
  }
  .stats strong {
    font-size: clamp(34px, 2.6vw, 52px);
  }
}
@media (min-width: 1000px) and (min-height: 680px) {
  /* Leaves room for the visualiser ring, which reaches 1.44x the record. */
  .record-slot {
    width: min(64cqmin, 480px);
    height: min(64cqmin, 480px);
  }
}

:root {
  --viz-color: rgba(255, 255, 255, 0.88);
  --viz-glow: rgba(255, 255, 255, 0.7);
}
