:root {
  color-scheme: dark;
  --bg: #050817;
  --surface: rgba(20, 27, 60, 0.88);
  --surface-2: rgba(37, 45, 90, 0.72);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f8f9ff;
  --muted: #a9b0ca;
  --blue: #4b73ff;
  --violet: #7b4dff;
  --green: #3ddc97;
  --amber: #ffc65c;
  font-family: "SF Pro Display", "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 5%, rgba(92, 57, 255, 0.45), transparent 34rem),
    radial-gradient(circle at 8% 72%, rgba(37, 94, 255, 0.28), transparent 30rem),
    linear-gradient(150deg, #060919 0%, #11143a 55%, #090d21 100%);
}

a { color: inherit; }

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 64px) clamp(16px, 4vw, 40px) 56px;
}

.page-home-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--text);
  text-decoration: none;
}

.page-home-link img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: 0 8px 20px rgba(31, 92, 255, 0.24);
}

.page-home-link span {
  display: grid;
}

.page-home-link strong {
  font-size: 15px;
  font-weight: 900;
}

.page-home-link small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.shell {
  min-height: 60vh;
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(7, 11, 31, 0.72);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(24px);
}

.hidden { display: none !important; }

.loading,
.error {
  min-height: 48vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  text-align: center;
  color: var(--muted);
}

.error h1 { margin: 0; color: var(--text); font-size: clamp(34px, 6vw, 60px); }
.error p { max-width: 540px; }

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(255,255,255,.15);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hero,
.club,
.section-heading,
.actions {
  display: flex;
  align-items: center;
}

.hero { justify-content: space-between; gap: 20px; }
.club { gap: 16px; min-width: 0; }

.club-logo,
.logo-fallback {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  object-fit: contain;
  border: 3px solid rgba(112, 136, 255, .8);
  box-shadow: 0 10px 26px rgba(0,0,0,.3);
}

.club-logo.logo-surface-light,
.logo-fallback.logo-surface-light { background: linear-gradient(145deg, #fff, #edf1ff); }
.club-logo.logo-surface-dark,
.logo-fallback.logo-surface-dark { background: linear-gradient(145deg, #080a10, #171923); }

.logo-fallback {
  display: grid;
  place-items: center;
  color: #d8e0ff;
  font-weight: 900;
  letter-spacing: -.04em;
}

.logo-fallback.logo-surface-light { color: #18204c; }

.club-name,
.product-name { margin: 0; }
.club-name { font-size: clamp(20px, 3vw, 30px); font-weight: 900; }
.product-name { margin-top: 3px; color: var(--muted); font-weight: 700; }
.product-name span { color: #83a1ff; }

.state-badge,
.fact,
.count {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 999px;
}

.state-badge {
  padding: 10px 15px;
  font-weight: 900;
  white-space: nowrap;
}

.state-badge.live,
.state-badge.paused { background: rgba(25, 118, 82, .86); }
.state-badge.finished { background: rgba(72, 79, 106, .9); }

.title-block { margin: clamp(34px, 7vw, 72px) 0 28px; }
.title-block h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(42px, 8vw, 78px);
  line-height: .99;
  letter-spacing: -.045em;
}
.location { margin: 18px 0 0; color: var(--muted); font-size: clamp(20px, 3vw, 30px); font-weight: 700; }

.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.fact { padding: 11px 15px; color: #e8ebff; font-weight: 750; }

.callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  margin: 0 0 24px;
  border-radius: 24px;
  border: 1px solid rgba(93, 124, 255, .34);
  background: linear-gradient(135deg, rgba(62, 86, 183, .36), rgba(79, 43, 169, .25));
}
.callout.live { border-color: rgba(61, 220, 151, .45); background: rgba(22, 105, 75, .28); }
.callout.finished { background: rgba(61, 68, 96, .42); }
.callout-icon { color: var(--blue); font-size: 26px; line-height: 1; }
.callout.live .callout-icon { color: var(--green); animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.callout h2 { margin: 0 0 6px; font-size: clamp(21px, 3vw, 27px); }
.callout p { margin: 0; color: #c3c9e0; line-height: 1.45; }

.actions { flex-wrap: wrap; gap: 12px; margin: 0 0 10px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border: 0;
  border-radius: 16px;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: linear-gradient(135deg, var(--blue), var(--violet)); box-shadow: 0 12px 30px rgba(61, 76, 231, .28); }
.button-secondary { border: 1px solid var(--line); background: rgba(255,255,255,.07); }
.share-status { min-height: 20px; margin: 0 0 8px; color: var(--green); font-size: 13px; font-weight: 750; }
.live-promise {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.live-promise strong { color: #dce3ff; }

.columns {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  gap: 18px;
}
.columns:has(#games-panel.hidden) { grid-template-columns: 1fr; }

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
}

.section-heading { justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 2px 0 0; font-size: 27px; }
.eyebrow { margin: 0; color: #7ea0ff; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.count { padding: 8px 12px; color: #d9dfff; font-weight: 800; }

.roster,
.protocol { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.roster li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 0;
  padding: 11px 13px;
  border-radius: 14px;
  background: rgba(255,255,255,.07);
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.roster-index { display: inline-block; width: 24px; color: #829fff; font-variant-numeric: tabular-nums; }
.roster-identity {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.roster-name { overflow-wrap: anywhere; }
.roster-rating {
  color: #8eabff;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.games-nav {
  display: flex;
  gap: 9px;
  margin: -2px 0 20px;
  overflow-x: auto;
  padding: 2px 1px 8px;
  scrollbar-width: thin;
}

.game-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 104px;
  padding: 11px 14px;
  color: #dce2ff;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.game-tab[aria-selected="true"] {
  color: #fff;
  border-color: rgba(102, 132, 255, .8);
  background: linear-gradient(135deg, rgba(75, 115, 255, .72), rgba(123, 77, 255, .62));
  box-shadow: 0 10px 24px rgba(39, 53, 158, .28);
}

.game-tab.live::after,
.game-tab.paused::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, .14);
}

.selected-game {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  background: rgba(4, 8, 27, .38);
}

.selected-game-heading,
.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.selected-game-heading h3 {
  margin: 3px 0 0;
  font-size: 27px;
}

.table-strength {
  display: inline-flex;
  margin-top: 9px;
  padding: 6px 9px;
  border: 1px solid rgba(126, 160, 255, .34);
  border-radius: 999px;
  color: #a9bcff;
  background: rgba(64, 100, 210, .18);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}
.table-strength.strong {
  color: #8ee9d2;
  border-color: rgba(68, 218, 179, .36);
  background: rgba(30, 139, 111, .2);
}
.table-strength.elite {
  color: #ffd58a;
  border-color: rgba(255, 187, 75, .4);
  background: rgba(180, 107, 10, .2);
}

.game-state {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.game-state.finished { color: #aeb6d2; }
.game-state.waiting { color: var(--amber); }
.selected-game-meta { margin: 8px 0 20px; color: var(--muted); line-height: 1.4; }

.game-detail-columns {
  display: grid;
  grid-template-columns: minmax(225px, .92fr) minmax(0, 1.08fr);
  gap: 20px;
}

.subsection-heading { margin-bottom: 12px; }
.subsection-heading h4 { margin: 0; font-size: 16px; }
.subsection-label {
  margin: 0 0 3px;
  color: #7ea0ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.game-roster { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.game-roster li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.055);
  font-size: 14px;
  font-weight: 750;
}
.game-roster-name {
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.game-roster-identity {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.role-badge {
  min-width: 32px;
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  color: #edf0ff;
  background: rgba(125, 136, 173, .2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .01em;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}
.role-don,
.role-mafia {
  color: #fff0f3;
  border-color: rgba(255, 95, 125, .34);
  background: rgba(162, 34, 63, .35);
}
.role-sheriff {
  color: #e8fff6;
  border-color: rgba(61, 220, 151, .38);
  background: rgba(23, 121, 82, .32);
}

.protocol { max-height: 460px; overflow: auto; padding-right: 4px; }
.protocol li {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  line-height: 1.35;
}
.protocol li:last-child { border-bottom: 0; }
.protocol time { color: #8992b1; font-size: 13px; font-variant-numeric: tabular-nums; }
.live-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(61,220,151,.12); }
.live-dot.finished { background: #8a93af; box-shadow: none; }
.empty { color: var(--muted); line-height: 1.5; }

.privacy-note { margin: 16px 0 0; color: #8992ae; font-size: 13px; line-height: 1.4; }

@media (max-width: 760px) {
  .shell { border-radius: 24px; }
  .hero { align-items: flex-start; flex-direction: column; gap: 14px; }
  .club-logo, .logo-fallback { width: 58px; height: 58px; flex-basis: 58px; }
  .state-badge { font-size: 13px; padding: 8px 11px; }
  .columns { grid-template-columns: 1fr; }
  .game-detail-columns { grid-template-columns: 1fr; }
  .roster { grid-template-columns: 1fr; }
  .button { width: 100%; }
}
