:root {
  --bg: #0f1720;
  --panel: rgba(20, 32, 45, 0.86);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #f8f4e9;
  --muted: #b6c4cf;
  --accent: #ff7a3d;
  --accent-soft: #ffb36f;
  --accent-cool: #6cd4c5;
  --danger: #ff5f73;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius: 24px;
  --font-display: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

.brand-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.logo {
  width: 120px;
  height: auto;
}

/* Version mobile */
@media screen and (max-width: 768px) {
  .brand-title {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .brand-title .logo {
    order: 1;
    width: 42px;
  }

  .brand-title h1 {
    order: 2;
    margin: 0;
    font-size: 2rem;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: auto;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 61, 0.24), transparent 28%),
    radial-gradient(circle at top right, rgba(108, 212, 197, 0.12), transparent 32%),
    linear-gradient(160deg, #0b1016 0%, #101923 40%, #131d28 100%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(transparent 0 49%, rgba(255, 255, 255, 0.5) 49% 51%, transparent 51% 100%),
    linear-gradient(90deg, transparent 0 49%, rgba(255, 255, 255, 0.35) 49% 51%, transparent 51% 100%);
  background-size: 8px 8px;
}

.app-shell {
  width: min(1660px, calc(100% - 14px));
  min-height: calc(100vh - 10px);
  margin: 5px auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}

body.session-active {
  overflow: hidden;
}

body.session-active .app-shell {
  height: calc(100dvh - 10px);
  min-height: calc(100dvh - 10px);
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.session-active .game-board {
  height: min(100%, calc(100dvh - 92px));
  min-height: 0;
  align-items: stretch;
}

body.session-active .side-panel,
body.session-active .board-center,
body.session-active .board-panel,
body.session-active .player-column,
body.session-active .player-zone,
body.session-active .player-track-list,
body.session-active .playlist-list,
body.session-active #playlist,
body.session-active #round-content,
body.session-active #search-results {
  min-height: 0;
}

body.session-active .side-panel,
body.session-active .board-center,
body.session-active .board-panel,
body.session-active .player-column,
body.session-active .player-zone {
  height: 100%;
}

body.session-active .board-center {
  grid-template-rows: minmax(0, 0.5fr) minmax(0, 0.92fr) minmax(0, 0.86fr);
}

body.session-active .player-zone,
body.session-active .board-panel {
  overflow: hidden;
}

body.session-active .board-panel .empty-state,
body.session-active .player-zone .empty-state {
  align-content: start;
  padding-top: 6px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: minmax(0, 1.04fr) minmax(340px, 0.96fr);
  align-items: stretch;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 16px;
  align-items: stretch;
  min-height: 145px;
}

.hero-copy {
  display: grid;
  gap: 10px;
  align-content: space-between;
}

.hero-visual {
  display: grid;
  align-items: stretch;
}

.hero-illustration-frame {
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  overflow: hidden;
  min-height: 100%;
  padding: 10px;
}

.hero-illustration {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lobby-card {
  min-height: 0;
  display: grid;
  gap: 12px;
}

.create-card,
.join-card {
  max-height: min(640px, calc(100vh - 190px));
  overflow: auto;
  align-content: start;
}

.lobby-card-copy {
  min-height: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

#create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: start;
}

#create-form label {
  min-width: 0;
}

#create-form label:first-child,
#create-form button {
  grid-column: 1 / -1;
}

#join-form {
  gap: 12px;
}
.lobby-card::-webkit-scrollbar,
.scroll-zone::-webkit-scrollbar {
  width: 8px;
}

.lobby-card::-webkit-scrollbar-thumb,
.scroll-zone::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.96;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 0.98rem;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 56ch;
  line-height: 1.45;
}

.lede.small {
  font-size: 0.92rem;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
}

.hero-pills span,
.badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stack {
  display: grid;
  gap: 12px;
}

.stack.compact {
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
button,
select,
summary {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 11px 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(255, 179, 111, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 122, 61, 0.14);
}

button {
  padding: 11px 14px;
  color: #17110c;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: linear-gradient(135deg, #8de3d6, var(--accent-cool));
}

button.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

button.ghost.danger {
  color: #ffd9de;
  border-color: rgba(255, 95, 115, 0.26);
  background: rgba(255, 95, 115, 0.12);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.session-card {
  padding-top: 14px;
  padding-bottom: 14px;
}

.session-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.session-top,
.section-head,
.playlist-row,
.proposal-card,
.result-card,
.track-score-row,
.round-score-card,
.round-score-rail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-head.tight {
  margin-bottom: 8px;
}

.shared-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}

.shared-toggle {
  display: flex;
  gap: 8px;
}

.shared-toggle button.active {
  background: linear-gradient(135deg, #8de3d6, var(--accent-cool));
  color: #10221f;
  border-color: transparent;
}

.shared-count-control {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.shared-count-control input {
  width: 88px;
}

.eligible-entry {
  border-color: rgba(141, 227, 214, 0.26);
}

.game-board {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(900px, 1.95fr) minmax(220px, 0.72fr);
  gap: 14px;
}

.side-panel,
.board-center,
.board-panel {
  min-height: 0;
}

.board-center {
  display: grid;
  grid-template-rows: minmax(200px, 0.8fr) minmax(340px, 1.35fr) minmax(170px, 0.56fr);
  gap: 14px;
}

.board-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.catalog-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.scroll-zone {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.side-panel {
  overflow: hidden;
}

.player-column {
  height: 100%;
  display: grid;
  grid-template-columns: 0.5fr 1.5fr;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.player-column.side-right {
  grid-template-columns: 1.5fr 0.5fr;
}

.player-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.player-title strong,
.player-playlist-head strong,
.playlist-row strong,
.track-score-row strong,
.result-card strong,
.round-score-card strong {
  font-size: 1.02rem;
}

.player-rank {
  margin-top: 4px;
  font-size: 0.76rem;
  color: #fff0d9;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.player-score {
  min-width: 124px;
  padding: 10px 14px 12px;
  border-radius: 18px;
  text-align: right;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.player-score .score-value {
  font-size: 2.15rem;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 800;
}

.player-zone {
  min-height: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.player-zone h3,
.player-zone p,
.manual-box summary {
  margin: 0;
}

.token-reserve {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 12px;
}

.token-pool {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 52px));
  gap: 8px;
  justify-content: start;
}

.token-badge {
  min-width: 0;
  min-height: 132px;
  padding: 12px 10px 10px;
  border-radius: 24px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
}

.token-chip {
  width: 52px;
  min-width: 0;
  padding: 7px 6px;
  border-radius: 16px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  justify-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
}

.token-chip-logo {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(8, 14, 22, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff8ef;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
}

.token-logo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff8ef;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.token-column {
  width: 100%;
  display: grid;
  justify-items: center;
}

.token-column-stack {
  width: 42px;
  min-height: 84px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 16px;
  background: rgba(6, 10, 16, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.token-column-segment {
  width: 100%;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--token-ring), var(--token-core));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 1px 1px rgba(0, 0, 0, 0.2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.token-chip span,
.muted,
.hint,
.track-meta {
  color: var(--muted);
}

.token-chip span,
.track-meta {
  font-size: 0.82rem;
}

.token-chip-count {
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff4e4;
  line-height: 1;
}

.token-badge.empty-stock,
.token-chip.empty-stock {
  opacity: 0.52;
}

.tier-weak {
  --token-core: #8d97a7;
  --token-ring: #dce5ee;
  background: linear-gradient(135deg, rgba(136, 147, 163, 0.28), rgba(86, 95, 110, 0.22));
}

.tier-medium {
  --token-core: #38b3a3;
  --token-ring: #d4fff9;
  background: linear-gradient(135deg, rgba(108, 212, 197, 0.26), rgba(56, 126, 116, 0.22));
}

.tier-strong {
  --token-core: #cc7a33;
  --token-ring: #ffe4bf;
  background: linear-gradient(135deg, rgba(255, 179, 111, 0.32), rgba(172, 94, 35, 0.22));
}

.tier-favorite {
  --token-core: #b33a51;
  --token-ring: #ffd4db;
  background: linear-gradient(135deg, rgba(255, 95, 115, 0.34), rgba(124, 39, 49, 0.2));
}

.player-track-list,
.playlist-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.playlist-row,
.proposal-card,
.result-card,
.track-score-row,
.round-score-card,
.search-result-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-card.compact-result {
  min-height: 0;
  padding: 10px 12px;
  gap: 10px;
  align-items: flex-start;
}

.result-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.result-main .track-meta {
  line-height: 1.25;
}

.result-vote-visual {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.result-vote-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.vote-player-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vote-player-chip.player-one {
  color: #dcfff8;
  background: rgba(108, 212, 197, 0.14);
  border-color: rgba(108, 212, 197, 0.26);
}

.vote-player-chip.player-two {
  color: #fff1dc;
  background: rgba(255, 179, 111, 0.14);
  border-color: rgba(255, 179, 111, 0.26);
}

.result-vote-stack {
  --vote-marker-size: 44px;
  display: grid;
  grid-template-columns: repeat(4, var(--vote-marker-size));
  gap: 10px;
}

.result-vote-marker {
  position: relative;
  width: var(--vote-marker-size);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(8, 14, 22, 0.42);
  border: 2px solid var(--token-ring);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.result-vote-marker.match {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 18px var(--token-ring);
}

.result-vote-half {
  position: absolute;
  left: 4px;
  right: 4px;
  opacity: 0;
}

.result-vote-half.filled {
  opacity: 1;
}

.result-vote-half.top {
  top: 4px;
  height: calc(50% - 3px);
  border-radius: 999px 999px 12px 12px;
}

.result-vote-half.bottom {
  bottom: 4px;
  height: calc(50% - 3px);
  border-radius: 12px 12px 999px 999px;
}

.result-vote-half.player-one {
  background: linear-gradient(180deg, rgba(155, 247, 234, 0.88), rgba(52, 179, 163, 0.92));
}

.result-vote-half.player-two {
  background: linear-gradient(180deg, rgba(255, 222, 176, 0.95), rgba(214, 107, 47, 0.92));
}

.result-vote-core {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(13, 18, 26, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff8ef;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.playlist-row,
.track-score-row,
.result-card,
.search-result-card {
  align-items: start;
}

.result-score {
  min-width: 88px;
  display: grid;
  gap: 4px;
}

.result-score > div:first-child {
  font-size: 1.08rem;
  font-weight: 800;
}

.track-score-points,
.playlist-score,
.result-score,
.round-score-value {
  text-align: right;
  min-width: 80px;
}

.winner {
  color: var(--accent-cool);
}

.round-score-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-summary {
  gap: 8px;
}

.revealed-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.round-score-card {
  align-items: start;
  position: relative;
  overflow: hidden;
}

.round-score-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.round-score-card.best::after {
  background: linear-gradient(90deg, var(--accent-cool), #9bf7ea);
}

.round-score-card.worst::after {
  background: linear-gradient(90deg, rgba(255, 95, 115, 0.9), rgba(255, 179, 111, 0.85));
}

.round-score-card .score-value {
  font-size: 1.5rem;
  font-family: var(--font-display);
  font-weight: 800;
}

.mini-label,
.score-rank {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.phase-revealed {
  color: var(--accent-cool);
}

.phase-voting {
  color: var(--accent-soft);
}

.phase-proposal_selection,
.phase-proposal {
  color: #f4d58d;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

#search-input {
  min-width: 0;
  background: rgba(255, 255, 255, 0.085);
  position: relative;
  z-index: 1;
}

.compact-row {
  margin-bottom: 10px;
}

#search-results {
  min-height: 0;
  gap: 10px;
  padding-top: 4px;
  padding-bottom: 4px;
  align-content: start;
}

.search-result-card {
  display: grid;
  gap: 10px;
}

.artist-top-tracks {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.artist-top-tracks-title {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.artist-top-tracks-list {
  display: grid;
  gap: 8px;
}

.artist-top-track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.artist-top-track-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.artist-top-track-copy strong {
  font-size: 0.92rem;
}

.artist-top-track-actions {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.artist-top-track-actions a {
  padding: 7px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.82rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.artist-top-track-actions audio {
  width: min(240px, 100%);
}

.search-result-head,
.result-actions,
.audio-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.mini-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-actions button,
.mini-actions a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.88rem;
}

.mini-actions a {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.manual-box {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-top: 8px;
}

.manual-box summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  list-style: none;
}

.manual-box summary::-webkit-details-marker {
  display: none;
}

.manual-form {
  margin-top: 10px;
}

.empty-state {
  color: var(--muted);
  align-content: center;
}

audio {
  width: 100%;
}

@media (max-width: 1400px) {
  .app-shell {
    width: min(1460px, calc(100% - 12px));
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
    min-height: 136px;
  }

  .grid.two {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  }

  .create-card,
  .join-card {
    max-height: min(620px, calc(100vh - 175px));
  }
}

@media (max-width: 1180px) {
  #create-form {
    grid-template-columns: 1fr;
  }

  #create-form label:first-child,
  #create-form button {
    grid-column: auto;
  }
  .app-shell {
    min-height: 100vh;
    grid-template-rows: auto auto auto;
  }

  .game-board,
  .grid.two,
  .round-score-rail,
  .revealed-results-grid,
  .board-center {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .create-card,
  .join-card {
    max-height: none;
    overflow: visible;
  }

  .game-board,
  .board-center {
    min-height: auto;
  }

  .board-panel,
  .side-panel,
  .scroll-zone,
  .player-track-list,
  .playlist-list {
    min-height: auto;
    overflow: visible;
  }

  .player-column,
  .player-column.side-right {
    grid-template-columns: 1fr;
  }

  .vote-proposal-grid {
    grid-template-columns: 1fr;
  }

  .token-pool {
    grid-template-columns: repeat(4, minmax(0, 52px));
    justify-content: start;
  }

  .vote-choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-top,
  .section-head,
  .player-header,
  .proposal-card,
  .result-card,
  .track-score-row,
  .round-score-card,
  .search-result-head,
  .result-actions,
  .audio-row {
    flex-direction: column;
    align-items: start;
  }

  .playlist-row {
    align-items: center;
  }

  .player-score,
  .track-score-points,
  .result-score,
  .round-score-value {
    text-align: left;
  }

  .playlist-score {
    text-align: right;
    margin-left: auto;
  }
}


.compact-card {
  padding: 10px 12px;
}

.voting-layout {
  display: grid;
  gap: 10px;
  min-height: 100%;
  align-content: start;
}

.vote-proposal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.voting-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(15, 23, 32, 0), rgba(15, 23, 32, 0.94) 28%);
}

.vote-proposal {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 0;
}

.vote-choice-block {
  display: grid;
  gap: 6px;
}

.vote-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.vote-choice {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 7px 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.vote-choice-logo {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(8, 14, 22, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff8ef;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}

.vote-choice-count {
  display: none;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.vote-choice.selected {
  border-color: rgba(255, 179, 111, 0.62);
  background: linear-gradient(180deg, rgba(255, 150, 71, 0.18), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 0 1px rgba(255, 179, 111, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.vote-choice.selected .vote-choice-count {
  color: rgba(255, 244, 228, 0.92);
}

.vote-choice.depleted:not(.selected),
.vote-choice:disabled:not(.selected) {
  opacity: 0.4;
}






















.mobile-only {
  display: none;
}

.mobile-scoreline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mobile-scoreline div {
  flex: 1;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-scoreline strong {
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mobile-scoreline span {
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 800;
}

.mobile-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mobile-tabs button {
  padding: 10px 8px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 14px;
}

.mobile-tabs button.active {
  background: linear-gradient(135deg, #8de3d6, var(--accent-cool));
  color: #10221f;
  border-color: transparent;
}

.mobile-action-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: grid;
  padding: 8px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(15, 23, 32, 0.72), rgba(15, 23, 32, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.mobile-action-bar button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

button.timer-running {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #fff5ea;
  background: #d46b2f;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.mobile-action-bar button.timer-running::before,
#next-round-button.timer-running::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--timer-progress, 0%);
  background: #a94d1d;
  z-index: -1;
  transition: width 0.2s linear;
}

@media (max-width: 980px) {
  body.session-active {
    overflow: auto;
  }

  body.session-active .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto auto;
    padding-bottom: 96px;
  }

  body.session-active .game-board {
    height: auto;
    min-height: 0;
  }

  body.session-active .board-center,
  body.session-active .board-panel,
  body.session-active .player-column,
  body.session-active .player-zone,
  body.session-active .player-track-list,
  body.session-active .playlist-list,
  body.session-active #playlist,
  body.session-active #round-content,
  body.session-active #search-results {
    height: auto;
    min-height: 0;
  }

  .mobile-only {
    display: block;
  }

  #session-panel {
    position: sticky;
    top: 6px;
    z-index: 20;
    padding: 10px 12px;
    border-radius: 18px;
  }

  #session-panel .session-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
  }

  #session-panel .session-top > div:first-child {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  #session-panel .eyebrow {
    display: none;
  }

  #session-panel h2 {
    margin: 0;
    font-size: 1rem;
  }

  #session-panel .lede.small {
    font-size: 0.78rem;
    line-height: 1.25;
    max-width: none;
  }

  #session-panel .session-actions {
    justify-content: end;
    gap: 8px;
  }

  #session-panel .session-actions button {
    padding: 8px 10px;
    font-size: 0.8rem;
    border-radius: 12px;
    white-space: nowrap;
  }

  .game-board.mobile-layout-active {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .game-board.mobile-layout-active .board-center,
  .game-board.mobile-layout-active .side-panel {
    height: auto;
    min-height: 0;
  }

  .game-board.mobile-layout-active .board-panel,
  .game-board.mobile-layout-active .side-panel,
  .game-board.mobile-layout-active .player-track-list,
  .game-board.mobile-layout-active .playlist-list,
  .game-board.mobile-layout-active .scroll-zone {
    overflow: visible;
  }

  .game-board.mobile-layout-active #mobile-controls {
    order: 0;
    display: grid;
    gap: 10px;
    padding: 0;
  }

  .game-board.mobile-layout-active.mobile-tab-round #player-left-panel,
  .game-board.mobile-layout-active.mobile-tab-round #player-right-panel,
  .game-board.mobile-layout-active.mobile-tab-round .optimal-panel,
  .game-board.mobile-layout-active.mobile-tab-round .catalog-panel {
    display: none;
  }

  .game-board.mobile-layout-active.mobile-tab-shared #player-left-panel,
  .game-board.mobile-layout-active.mobile-tab-shared #player-right-panel,
  .game-board.mobile-layout-active.mobile-tab-shared .round-panel-card,
  .game-board.mobile-layout-active.mobile-tab-shared .catalog-panel {
    display: none;
  }

  .game-board.mobile-layout-active.mobile-tab-catalog #player-left-panel,
  .game-board.mobile-layout-active.mobile-tab-catalog #player-right-panel,
  .game-board.mobile-layout-active.mobile-tab-catalog .round-panel-card,
  .game-board.mobile-layout-active.mobile-tab-catalog .optimal-panel {
    display: none;
  }

  .game-board.mobile-layout-active.mobile-tab-me .board-center {
    display: none;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] {
    order: 1;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] {
    order: 2;
    opacity: 0.88;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .player-header,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .player-header {
    gap: 8px;
    margin-bottom: 2px;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .player-score .score-value,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .player-score .score-value {
    font-size: 1.3rem;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .player-zone,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .player-zone {
    padding: 8px;
    gap: 8px;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .token-reserve,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .token-reserve {
    gap: 6px;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .token-badge,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .token-badge {
    min-height: 88px;
    padding: 7px 5px 5px;
    gap: 5px;
    border-radius: 18px;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .token-logo,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .token-logo {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .token-column-stack,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .token-column-stack {
    width: 28px;
    min-height: 46px;
    gap: 3px;
    padding: 4px 4px;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .track-score-row,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .player-track-list,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="me"] .empty-state,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .track-score-row,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .player-track-list,
  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .empty-state {
    gap: 6px;
    font-size: 0.86rem;
  }

  .game-board.mobile-layout-active.mobile-tab-me [data-mobile-role="opponent"] .player-zone:last-child {
    display: none;
  }

  .game-board.mobile-layout-active .section-head.tight {
    margin-bottom: 10px;
  }

  .game-board.mobile-layout-active .board-panel,
  .game-board.mobile-layout-active .side-panel {
    padding: 14px;
    border-radius: 20px;
  }

  .game-board.mobile-layout-active .proposal-card,
  .game-board.mobile-layout-active .result-card,
  .game-board.mobile-layout-active .track-score-row,
  .game-board.mobile-layout-active .playlist-row,
  .game-board.mobile-layout-active .round-score-card,
  .game-board.mobile-layout-active .search-result-card {
    padding: 10px 12px;
  }

  .game-board.mobile-layout-active .mobile-round-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .game-board.mobile-layout-active .mobile-round-score-card {
    padding: 8px 10px;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  .game-board.mobile-layout-active .mobile-round-score-card .score-value {
    font-size: 1.15rem;
  }

  .game-board.mobile-layout-active .mobile-round-score-card strong {
    font-size: 0.94rem;
  }

  .game-board.mobile-layout-active .mobile-results-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .game-board.mobile-layout-active .playlist-row {
    flex-direction: row;
    align-items: center;
  }

  .game-board.mobile-layout-active .token-pool {
    display: grid;
  }

  .game-board.mobile-layout-active .vote-choice-count {
    display: block;
  }

  .game-board.mobile-layout-active .voting-actions {
    position: static;
    padding-top: 0;
    background: transparent;
  }

  .game-board.mobile-layout-active .playlist-score {
    text-align: right;
    min-width: 58px;
    margin-left: auto;
  }

  .game-board.mobile-layout-active .mobile-result-card {
    padding: 8px 10px;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.035));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .game-board.mobile-layout-active .mobile-result-card .result-main {
    gap: 4px;
    width: 100%;
  }

  .game-board.mobile-layout-active .mobile-result-card .track-meta {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .game-board.mobile-layout-active .mobile-result-card .result-vote-visual {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  .game-board.mobile-layout-active .mobile-result-card .result-vote-legend {
    gap: 6px;
  }

  .game-board.mobile-layout-active .mobile-result-card .result-vote-stack {
    --vote-marker-size: 40px;
    grid-template-columns: repeat(4, var(--vote-marker-size));
    justify-content: start;
    gap: 10px;
  }

  .game-board.mobile-layout-active .mobile-result-card .result-vote-marker {
    border-width: 2px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 8px 16px rgba(0, 0, 0, 0.18);
  }

  .game-board.mobile-layout-active .mobile-result-card .result-vote-marker.match {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 0 18px var(--token-ring), 0 8px 20px rgba(0, 0, 0, 0.22);
  }

  .game-board.mobile-layout-active .mobile-result-card .vote-player-chip {
    font-size: 0.68rem;
    padding: 4px 8px;
  }

  .game-board.mobile-layout-active .mobile-result-card .vote-player-chip.player-one {
    color: #dcfff8;
    background: rgba(108, 212, 197, 0.16);
    border-color: rgba(108, 212, 197, 0.28);
  }

  .game-board.mobile-layout-active .mobile-result-card .vote-player-chip.player-two {
    color: #fff1dc;
    background: rgba(255, 179, 111, 0.16);
    border-color: rgba(255, 179, 111, 0.28);
  }

  .game-board.mobile-layout-active .mobile-result-card .result-score {
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
  }

  .game-board.mobile-layout-active .mobile-result-card .result-score > div:first-child {
    font-size: 1.18rem;
  }

  .game-board.mobile-layout-active .mobile-result-card .result-score .track-meta {
    color: #dfe7ee;
  }

  .game-board.mobile-layout-active .player-column,
  .game-board.mobile-layout-active .player-column.side-right {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .game-board.mobile-layout-active .player-zone {
    padding: 10px;
  }

  .game-board.mobile-layout-active .token-reserve {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .game-board.mobile-layout-active .token-badge {
    min-height: 112px;
    padding: 10px 8px 8px;
    gap: 8px;
  }

  .game-board.mobile-layout-active .token-column-stack {
    min-height: 70px;
  }

  .game-board.mobile-layout-active .search-row {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(20, 32, 45, 0.96);
    padding-bottom: 8px;
  }

  .game-board.mobile-layout-active .manual-box {
    padding-bottom: 12px;
  }

  .game-board.mobile-layout-active #submit-votes-button,
  .game-board.mobile-layout-active #reveal-button,
  .game-board.mobile-layout-active #next-round-button {
    display: none;
  }
}














.shared-head-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
  flex-wrap: wrap;
}

.shared-head-actions > .ghost {
  white-space: nowrap;
}

.export-callout {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 179, 111, 0.28);
  background: linear-gradient(135deg, rgba(255, 122, 61, 0.18), rgba(255, 179, 111, 0.08));
}

.export-callout h3 {
  margin-bottom: 4px;
}

.export-callout button {
  justify-self: start;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

@media (max-width: 980px) {
  .shared-head-actions {
    width: 100%;
    justify-content: space-between;
  }

  .export-callout {
    padding: 14px;
  }

  .export-callout button {
    width: 100%;
    justify-self: stretch;
  }
}


.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.export-actions .ghost {
  min-width: 86px;
}

.export-callout-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.export-callout-actions button {
  min-width: 180px;
}

@media (max-width: 980px) {
  .export-actions,
  .export-callout-actions {
    width: 100%;
  }

  .export-actions .ghost,
  .export-callout-actions button {
    flex: 1 1 100%;
    min-width: 0;
  }
}


@media (min-width: 981px) {
  .token-pool {
    display: none;
  }

  .vote-choice-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .vote-choice {
    min-height: 42px;
    padding: 6px 4px;
  }

  .vote-choice-logo {
    width: 24px;
    height: 24px;
    font-size: 0.82rem;
  }
}
