:root {
  color-scheme: dark;
  --bg: #080907;
  --surface: #11150f;
  --surface-2: #161c17;
  --line: #2a352b;
  --line-strong: #45543f;
  --text: #f4f1e8;
  --muted: #aeb6a8;
  --lime: #b8ff5c;
  --mint: #56f2be;
  --gold: #f8cf58;
  --red: #ff5f58;
  --ink: #0b0d0a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(184, 255, 92, 0.09), transparent 32%),
    radial-gradient(circle at 82% 12%, rgba(248, 207, 88, 0.12), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.home-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 24px;
}

.home-nav,
.home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 28px;
  border: 1px solid #202a2f;
  background: rgba(4, 10, 14, 0.9);
}

.home-nav { border-radius: 12px 12px 0 0; }

.brand {
  padding: 0;
  border: 0;
  background: transparent;
  color: #f7f9f6;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.brand span { color: #5ee34b; }
.brand i { margin-left: 2px; color: #5ee34b; font-size: 0.72em; font-style: normal; }
.brand.small { font-size: 1.55rem; }

.home-nav nav { display: flex; align-items: center; gap: clamp(12px, 2.6vw, 34px); }
.home-nav nav button,
.home-nav nav a {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #e7ebea;
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
  text-transform: uppercase;
}
.home-nav nav button:first-child { color: #5ee34b; border-bottom: 2px solid #5ee34b; }

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  min-height: 540px;
  overflow: hidden;
  border: 1px solid #202a2f;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background:
    linear-gradient(90deg, rgba(3, 9, 13, 0.99) 0%, rgba(3, 9, 13, 0.88) 45%, rgba(3, 9, 13, 0.22) 72%),
    radial-gradient(circle at 80% 45%, rgba(76, 216, 66, 0.18), transparent 34%),
    #061018;
}

.hero-copy { position: relative; z-index: 2; align-self: center; padding: clamp(34px, 6vw, 72px); }
.hero-copy h1 { margin: 10px 0 22px; font-size: clamp(3rem, 6vw, 6rem); letter-spacing: -0.055em; line-height: 0.9; }
.hero-copy h1 span { color: #5ee34b; }
.hero-lede { max-width: 430px; color: #d0d8d9; font-size: clamp(1rem, 1.6vw, 1.3rem); line-height: 1.55; }

.hero-primary,
.hero-quick-actions button,
.mode-card button {
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid #3d4b51;
  border-radius: 8px;
  background: #101920;
  color: white;
  font-weight: 900;
}
.hero-primary { min-width: 270px; margin-top: 10px; border-color: #55dc49; background: linear-gradient(180deg, #43c34c, #21963a); font-size: 1.05rem; }
.hero-quick-actions { display: flex; gap: 10px; margin-top: 12px; }
.hero-quick-actions button { min-height: 44px; padding: 0 17px; font-size: 0.78rem; }
.hero-primary:hover, .mode-card button:hover { filter: brightness(1.12); transform: translateY(-1px); }

.hero-visual {
  position: relative;
  display: grid;
  place-content: center;
  min-height: 540px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 68%, rgba(73, 255, 89, 0.2), transparent 26%),
    linear-gradient(180deg, transparent 48%, rgba(0, 22, 20, 0.78));
}
.hero-visual::before { content: ""; position: absolute; inset: 18% 4% -10%; border: 1px solid rgba(121, 255, 127, 0.28); border-radius: 50% 50% 0 0; box-shadow: inset 0 0 80px rgba(52, 211, 77, 0.1); transform: perspective(500px) rotateX(58deg); }
.pitch-lines { position: absolute; inset: 50% 0 0; opacity: 0.35; background: repeating-linear-gradient(90deg, transparent 0 64px, rgba(117,255,125,.18) 65px 66px); transform: perspective(360px) rotateX(58deg); transform-origin: bottom; }
.club-trio { position: relative; z-index: 1; display: flex; align-items: center; gap: clamp(12px, 2vw, 30px); }
.club-trio span { display: grid; width: clamp(76px, 8vw, 112px); aspect-ratio: 1; place-items: center; border: 1px solid #55636a; border-radius: 18px; background: rgba(8, 17, 23, 0.9); color: #f5f7f8; font-size: clamp(1.25rem, 2vw, 2rem); font-weight: 950; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.club-trio b { color: #58df4a; font-size: 1.8rem; }
.hero-visual > strong { position: relative; z-index: 1; margin-top: 36px; color: #5ee34b; font-size: clamp(1.3rem, 2.4vw, 2.3rem); letter-spacing: .12em; text-align: center; }

.home-section { margin-top: 16px; padding: clamp(24px, 4vw, 42px); border: 1px solid #202a2f; border-radius: 12px; background: rgba(5, 12, 17, 0.9); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.4rem); }
.section-heading > p { max-width: 440px; margin: 0; color: #9caaaf; }
.steps-grid, .mode-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps-grid article, .mode-card { padding: 24px; border: 1px solid #273238; border-radius: 9px; background: #091219; }
.steps-grid article > span { display: inline-grid; width: 34px; height: 34px; margin-bottom: 18px; place-items: center; border-radius: 50%; background: #5ee34b; color: #071008; font-weight: 950; }
.steps-grid strong { display: block; margin-bottom: 8px; }
.steps-grid p, .mode-card p { margin: 0; color: #9fadb1; line-height: 1.55; }
.mode-card { display: grid; gap: 12px; }
.mode-card > span { color: #5ee34b; font-size: 2.2rem; }
.mode-card h3 { margin: 0; font-size: 1.45rem; }
.mode-card button { align-self: end; margin-top: 12px; border-color: #48c642; background: rgba(58, 190, 64, 0.14); }
.mode-card.duel > span { color: #ad67ff; }
.mode-card.duel button { border-color: #7f45ca; background: rgba(126, 66, 206, 0.18); }
.mode-card.join > span { color: #f7c531; }
.mode-card.join button { border-color: #c99717; background: rgba(201, 151, 23, 0.16); }
.home-footer { margin-top: 16px; border-radius: 12px; color: #8f9da2; }
.home-footer p { margin: 0; }
.home-footer > strong { color: #5ee34b; }
.game-brand { text-align: left; }

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.control-row button:disabled.is-active {
  opacity: 0.82;
}

.boot {
  display: grid;
  min-height: 100vh;
  place-items: center;
  gap: 16px;
  color: var(--muted);
}

.boot-mark {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--lime);
  font-size: 30px;
  box-shadow: var(--shadow);
}

.error {
  padding: 32px;
  color: var(--red);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  align-items: start;
}

.game-surface,
.tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 21, 15, 0.88);
  box-shadow: var(--shadow);
}

.game-surface {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 32px);
}

.topbar,
.bottom-actions,
.panel-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--mint);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  min-width: min(100%, 330px);
}

.stat-strip span {
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.stat-strip small,
label span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-strip strong {
  align-self: end;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

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

.control-row button,
.room-actions button,
.secondary-action,
.primary-action,
.icon-action {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #171d15;
  color: var(--text);
  font-weight: 800;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.control-row.compact button {
  min-height: 36px;
  font-size: 0.9rem;
}

.control-row button:hover,
.room-actions button:hover,
.secondary-action:hover,
.icon-action:hover {
  transform: translateY(-1px);
  border-color: var(--mint);
}

.control-row button.is-active {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
}

.club-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.club-card {
  display: grid;
  min-height: 188px;
  padding: 18px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(86, 242, 190, 0.12), transparent 48%),
    #111710;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.club-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.club-card.matched {
  border-color: var(--lime);
  background: rgba(184, 255, 92, 0.12);
}

.club-card.missed {
  border-color: rgba(255, 95, 88, 0.45);
}

.club-logo {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #202719;
  color: var(--gold);
  font-weight: 900;
}

.club-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  background: #f8f6ee;
}

.club-card h2 {
  min-height: 2.5em;
  margin: 16px 0 8px;
  font-size: clamp(1.15rem, 2.2vw, 1.85rem);
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.club-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.answer-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: start;
}

.search-shell {
  position: relative;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #090c08;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(86, 242, 190, 0.12);
}

.dropdown {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(430px, 58vh);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0c100b;
  box-shadow: var(--shadow);
}

.suggestion {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.suggestion:last-child {
  border-bottom: 0;
}

.suggestion:hover,
.suggestion.is-active {
  background: rgba(184, 255, 92, 0.1);
}

.suggestion strong,
.suggestion small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion small {
  margin-top: 2px;
  color: var(--muted);
}

.suggestion-ball {
  color: var(--gold);
}

.primary-action {
  min-height: 52px;
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
}

.primary-action:hover {
  transform: translateY(-1px);
}

.secondary-action {
  min-width: 148px;
}

.wide {
  width: 100%;
}

.hint-action {
  min-width: 92px;
}

.hint-panel,
.result-panel {
  min-height: 0;
}

.hint-panel.is-visible {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hint-panel span {
  padding: 8px 10px;
  border: 1px solid rgba(86, 242, 190, 0.38);
  border-radius: 8px;
  background: rgba(86, 242, 190, 0.08);
  color: var(--mint);
  font-weight: 800;
}

.result-panel.is-visible {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10150f;
  animation: pop 260ms ease;
}

.result-panel.points-3 {
  border-color: var(--gold);
  box-shadow: 0 0 34px rgba(248, 207, 88, 0.16);
}

.result-panel.points-2 {
  border-color: var(--mint);
}

.result-panel.points-1 {
  border-color: var(--lime);
}

.result-panel.miss,
.result-panel.expired {
  border-color: rgba(255, 95, 88, 0.5);
}

.result-heading {
  display: grid;
  gap: 3px;
}

.result-heading strong {
  font-size: clamp(1.1rem, 2.4vw, 1.7rem);
}

.result-heading small,
.result-kicker {
  color: var(--muted);
  font-size: 0.82rem;
}

.club-verdicts,
.final-stats,
.score-feed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.club-verdicts span,
.final-stats span,
.score-feed span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.club-verdicts .hit {
  border-color: rgba(184, 255, 92, 0.55);
  color: var(--lime);
}

.club-verdicts .miss {
  border-color: rgba(255, 95, 88, 0.4);
  color: var(--red);
}

.points-burst {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
}

.alternative-answers {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.alternative-answers > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alternative-answers > div span {
  padding: 8px 10px;
  border: 1px solid rgba(248, 207, 88, 0.42);
  border-radius: 8px;
  background: rgba(248, 207, 88, 0.08);
  color: var(--gold);
  font-weight: 800;
}

.side-panel {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 24px;
}

.tool-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.tool-panel h2 {
  margin: 0;
}

.room-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.lobby-status {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid rgba(86, 242, 190, 0.42);
  border-radius: 8px;
  background: rgba(86, 242, 190, 0.08);
}

.lobby-status strong { color: var(--mint); }
.lobby-status span { color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
.room-start { min-height: 52px; background: linear-gradient(180deg, #55d94b, #24983a); color: #071008; }
.room-is-waiting .club-grid,
.room-is-waiting .answer-zone,
.room-is-waiting .hint-panel,
.room-is-waiting .bottom-actions { opacity: 0.34; }

.leaderboard {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.leaderboard li.me {
  border-color: var(--mint);
  color: var(--text);
}

.data-panel strong {
  color: var(--gold);
}

.icon-action {
  width: 42px;
  padding: 0;
  font-size: 1.8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .hero-panel { grid-template-columns: 1fr; }
  .hero-visual { min-height: 340px; }
  .steps-grid, .mode-card-grid { grid-template-columns: 1fr; }
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 660px) {
  .home-shell { width: min(100% - 16px, 1440px); padding-top: 8px; }
  .home-nav { min-height: 62px; padding: 0 16px; }
  .home-nav nav button:not(:first-child), .home-nav nav a { display: none; }
  .hero-panel { min-height: auto; }
  .hero-copy { padding: 36px 22px; }
  .hero-copy h1 { font-size: clamp(3rem, 15vw, 4.7rem); }
  .hero-primary { width: 100%; min-width: 0; }
  .hero-quick-actions { flex-direction: column; }
  .hero-visual { min-height: 280px; }
  .club-trio span { width: 68px; border-radius: 12px; }
  .club-trio b { font-size: 1.15rem; }
  .section-heading, .home-footer { align-items: flex-start; flex-direction: column; }
  .home-section { padding: 22px; }
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .topbar,
  .bottom-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .stat-strip,
  .club-grid,
  .answer-zone {
    grid-template-columns: 1fr;
  }

  .club-card {
    min-height: 142px;
  }

  .secondary-action,
  .primary-action {
    width: 100%;
  }
}
