:root{color-scheme:dark;--bg:#111321;--surface:#1c2031;--surface2:#24293c;--text:#f7f7f0;--muted:#a8abb9;--lime:#d6ff59;--coral:#ff907d;--line:#363b4d}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% -25%,#343752 0,transparent 52%),var(--bg);color:var(--text);font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;min-height:100vh}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit}.shell{width:min(100%,520px);min-height:100vh;margin:auto;padding:0 22px;display:flex;flex-direction:column}.topbar{height:76px;display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{text-decoration:none;color:var(--text);font-size:16px;font-weight:900;letter-spacing:-.07em;white-space:nowrap}.brand>span:not(.brand-icon){color:var(--lime)}.brand-icon{font-size:25px;color:var(--lime);margin-right:7px;vertical-align:-2px}.connection{display:flex;align-items:center;gap:7px;color:#b9bdc7;font-size:11px;font-weight:650;white-space:nowrap}.connection i{width:7px;height:7px;border-radius:50%;background:var(--lime)}.connection.offline i{background:#ff987e}.connection.offline{color:#ffb1a0}.welcome{padding:36px 0 10px;flex:1}.hero-mark{width:146px;height:146px;background:var(--lime);color:var(--bg);border-radius:35px;display:grid;grid-template-columns:1fr 1fr;place-items:center;transform:rotate(-7deg);font-size:42px;font-weight:900;box-shadow:12px 12px 0 #343a36;margin:12px 0 54px}.hero-mark span:nth-child(2),.hero-mark span:nth-child(3){opacity:.34}.eyebrow{font-weight:800;font-size:10px;letter-spacing:.18em;color:var(--lime);margin:0 0 12px}.welcome h1{font-size:clamp(43px,12vw,62px);letter-spacing:-.065em;line-height:1.02;margin:0}.welcome h1 em{font-style:normal;color:var(--lime)}.intro{color:var(--muted);font-size:16px;line-height:1.6;max-width:370px;margin:20px 0 28px}.button{border:0;border-radius:14px;padding:16px 19px;font-weight:800;cursor:pointer;min-height:53px}.button.primary{color:#171b17;background:var(--lime);width:100%;display:flex;justify-content:center;align-items:center;gap:12px}.button:disabled{opacity:.52;cursor:default}.button:focus-visible,.cell:focus-visible{outline:3px solid #fff;outline-offset:3px}.note,.privacy-note{font-size:11px;color:var(--muted);text-align:center;line-height:1.5}.note{margin-top:13px}.game{flex:1;padding-top:30px}.game-heading{display:flex;align-items:end;justify-content:space-between;margin-bottom:25px}.game h1{font-size:32px;line-height:1.1;margin:0;letter-spacing:-.05em}.game h1 span{color:var(--lime)}.players{display:flex;align-items:center;gap:8px}.player{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:12px 9px;background:var(--surface);border:1px solid transparent;border-radius:14px}.player.active{border-color:#899c4c}.symbol{font-weight:850;font-size:22px;line-height:1;width:40px;height:40px;display:grid;place-items:center;border-radius:10px;background:#343b33}.symbol.x{color:var(--lime)}.symbol.o{color:var(--coral);background:#3b3036}.player strong,.player small{display:block;white-space:nowrap}.player strong{font-size:12px}.player small{font-size:10px;color:var(--muted);margin-top:4px}.versus{font-size:9px;color:#777e91;font-weight:900}.status{text-align:center;font-weight:750;font-size:14px;min-height:54px;padding:21px 0 15px}.board{display:grid;grid-template:repeat(3,minmax(0,1fr)) / repeat(3,minmax(0,1fr));gap:9px;aspect-ratio:1}.cell{border:0;border-radius:18px;background:var(--surface2);color:var(--lime);font-size:clamp(38px,14vw,70px);font-weight:800;display:grid;place-items:center;cursor:pointer;line-height:1;transition:background .15s,transform .15s}.cell:not(:disabled):active{transform:scale(.96)}.cell:disabled{cursor:default}.cell.o{color:var(--coral)}.cell:not(:disabled):hover{background:#343b4f}.invite-panel{margin-top:23px;padding:17px;background:var(--surface);border-radius:16px;display:flex;gap:12px;align-items:center;justify-content:space-between}.invite-panel[hidden],.end-panel[hidden],.game[hidden],.welcome[hidden],.error[hidden]{display:none}.invite-panel strong{font-size:13px}.invite-panel p{font-size:11px;color:var(--muted);margin:5px 0 0}.button.primary.compact{width:auto;padding:12px;font-size:11px;min-height:40px;white-space:nowrap}.end-panel{margin-top:22px}.privacy-note{margin:20px 0}.error{padding:13px;border-radius:12px;background:#4a292b;color:#ffd4cb;font-size:13px;line-height:1.5;overflow-wrap:anywhere}@media(max-width:350px){.shell{padding:0 15px}.player{gap:6px}.symbol{width:32px;height:32px}.game h1{font-size:28px}.brand{font-size:14px}}

.button.secondary {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.history {
  margin: 16px 0 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
}
.history summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
}
.history summary span {
  float: right;
  color: var(--lime);
  font-weight: 650;
}
.history ul {
  max-height: 12rem;
  margin: 10px 0 14px;
  overflow: auto;
  padding-inline-start: 22px;
}
.history li {
  padding: 4px 0;
}

.game-choices {
  display: grid;
  gap: 14px;
}
.catalogue {
  flex: 0 0 auto;
  padding: clamp(22px, 7vw, 46px) 0 12px;
}
.catalogue .intro {
  margin: 12px 0 26px;
}
.game-choice {
  --accent: var(--lime);
  display: grid;
  width: 100%;
  grid-template-columns: 84px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 14px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  transition: background .15s, border-color .15s;
}
.game-choice-four { --accent: var(--coral); }
.game-choice-race { --accent: #83f4df; }
.game-choice-quiz { --accent: #dcb1ff; }
.game-choice:not(:disabled):is(:hover, :focus-visible) {
  background: var(--surface2);
  border-color: var(--accent);
}
.game-choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.game-choice:disabled { cursor: wait; opacity: .65; }
.game-choice[hidden] { display: none; }
.game-preview {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  gap: 3px;
  align-content: stretch;
  padding: 9px;
  border-radius: 12px;
  background: #101424;
}
.mini-three { grid-template: repeat(3, 1fr) / repeat(3, 1fr); }
.mini-four { grid-template: repeat(4, 1fr) / repeat(4, 1fr); }
.game-preview > span {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border-radius: 4px;
  background: #2d3349;
  font-size: 15px;
  line-height: 1;
  font-weight: 850;
}
.mini-three .mini-x { color: var(--lime); }
.mini-three .mini-o { color: var(--coral); }
.mini-four > span { border-radius: 50%; }
.mini-four .mini-x { background: var(--lime); }
.mini-four .mini-o { background: var(--coral); }
.mini-race { grid-template: repeat(2, 1fr) / repeat(2, 1fr); }
.mini-race > span { color: #83f4df; font-size: 19px; }
.mini-race > span:nth-child(2n) { color: #f7c786; }
.mini-quiz > span { color: #dcb1ff; font-size: 38px; }
.choice-text {
  display: grid;
  gap: 4px;
}
.choice-text strong {
  font-size: clamp(17px, 5vw, 23px);
  line-height: 1.15;
  letter-spacing: -.025em;
}
.choice-text > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.choice-text .choice-score {
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  margin-top: 4px;
}
.choice-arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 20px;
  font-weight: 750;
}
.game .invite-panel {
  margin: 0 0 18px;
}
.invite-panel .button.primary.compact {
  min-height: 44px;
  font-size: 13px;
}
@media (max-width: 370px) {
  .game-choice {
    grid-template-columns: 62px minmax(0, 1fr) 32px;
    gap: 10px;
    padding: 11px;
  }
  .game-preview { padding: 6px; }
  .game-preview > span { font-size: 12px; }
  .mini-race > span { font-size: 16px; }
  .mini-quiz > span { font-size: 29px; }
  .choice-arrow { width: 32px; height: 32px; }
}
.board[hidden],
.column-board[hidden] {
  display: none;
}
.column-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  aspect-ratio: 7 / 6;
}
.column {
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
  padding: 5px 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
}
.column:disabled {
  cursor: default;
}
.column:not(:disabled):hover {
  border-color: var(--lime);
}
.column:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.slot {
  display: grid;
  place-items: center;
  align-self: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg);
  color: var(--bg);
  font-size: clamp(16px, 5vw, 24px);
  font-weight: 800;
  line-height: 1;
}
.slot.x { background: var(--lime); }
.slot.o { background: var(--coral); }

.match-score {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.play-again {
  display: block;
  min-height: 44px;
  padding: 14px 8px;
  color: var(--muted);
  text-align: center;
}
.ad-preview {
  width: min(calc(100% - 36px), 400px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
}
.ad-preview::backdrop {
  background: rgb(7 9 17 / 78%);
}
.ad-preview h2 {
  margin: 0 0 10px;
  font-size: 22px;
}
.ad-preview p {
  margin: 0 0 20px;
  color: var(--muted);
}
.privacy-footer { margin-top: 8px; text-align: center; font-size: 12px; }
.privacy-footer a { display: inline-block; padding: 13px 4px; color: var(--muted); }
.privacy-page { padding-bottom: 26px; }
.privacy-page h1 { margin: 12px 0; font-size: 32px; line-height: 1.12; }
.privacy-page h2 { margin: 18px 0 4px; font-size: 19px; }
.privacy-page p { margin: 8px 0; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.privacy-page a { color: var(--lime); }
.ad-privacy {
  margin: 10px 0 22px;
}
.privacy-manage {
  min-height: 44px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.ad-consent-options {
  margin: 4px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.ad-consent-options h2 {
  margin: 0;
  font-size: 17px;
}
.ad-consent-options p {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.ad-consent-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.players[hidden],
.group-play[hidden],
.group-lobby[hidden],
.group-round[hidden],
#group-start[hidden] {
  display: none;
}
.group-play {
  --group-accent: #83f4df;
  display: grid;
  gap: 14px;
}
.game.is-group { padding-top: 16px; }
.game.is-group .game-heading { margin-bottom: 8px; }
.game.is-group .status { min-height: 40px; padding: 10px 0; }
.group-play.is-quiz { --group-accent: #dcb1ff; }
.group-roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.group-roster li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}
.group-roster li:only-child { grid-column: 1 / -1; }
.group-roster li.is-me { border-color: var(--group-accent); color: var(--text); }
.group-roster strong { color: var(--text); white-space: nowrap; }
.group-roster li.is-winner strong { color: var(--group-accent); }
.group-lobby .note { margin: 0 0 10px; font-size: 13px; }
.group-lobby .button.primary { background: var(--group-accent); }
.group-round {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}
.group-round h2 { margin: 0; font-size: clamp(17px, 4.4vw, 22px); line-height: 1.27; }
.group-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.group-target p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.group-target-cue {
  min-width: 74px;
  padding: 6px 8px;
  border-radius: 12px;
  background: var(--bg);
  text-align: center;
}
.group-target-cue span { display: block; font-size: 30px; line-height: 1; }
.group-target-cue strong { display: block; font-size: 11px; }
.race-actions,
.quiz-options {
  display: grid;
  gap: 8px;
}
.race-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.group-action {
  min-width: 0;
  min-height: 47px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-weight: 675;
}
.group-action:not(:disabled):is(:hover, :focus-visible) { border-color: var(--group-accent); }
.group-action:focus-visible { outline: 2px solid var(--group-accent); outline-offset: 2px; }
.group-action:disabled { cursor: default; }
.race-key { min-height: 54px; white-space: nowrap; font-size: 12px; }
.race-key span { font-size: 21px; margin-right: 3px; vertical-align: -.08em; }
.target-star, .race-star span { color: #f7c786; }
.target-diamond, .race-diamond span { color: #83f4df; }
.target-triangle, .race-triangle span { color: #ff907d; }
.target-circle, .race-circle span { color: #dcb1ff; }
.quiz-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 7px;
  color: var(--group-accent);
  font-size: 12px;
  font-weight: 800;
}
#quiz-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.quiz-options { margin-top: 12px; }
.quiz-answer {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-size: 14px;
}
.quiz-answer.is-selected { border-color: var(--group-accent); }
.quiz-answer.is-correct { border-color: #83f4df; background: #213540; }
.quiz-answer.is-incorrect { border-color: #ff907d; }
.quiz-letter {
  display: inline-grid;
  flex: 0 0 24px;
  place-items: center;
  height: 24px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--group-accent);
  font-size: 12px;
}
.quiz-feedback {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}
