/* src/games/trivia/client/theme.css */
:root {
  color-scheme: dark;
  --ground: #141021;
  --surface: #1e1830;
  --raised: #291f42;
  --hairline: #392f52;
  --text: #f5f2fb;
  --muted: #a79fbd;
  --brand: #ff3d81;
  --brand-ink: #ffffff;
  --opt-a: #17c0c9;
  --opt-b: #3e7bfa;
  --opt-c: #9b6bf5;
  --opt-d: #f9a63a;
  --correct: #37d67a;
  --wrong: #ff5470;
  --font-sans:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    system-ui,
    sans-serif;
  --font-mono:
    ui-monospace,
    "SF Mono",
    "Cascadia Mono",
    Menlo,
    monospace;
  --r: 16px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ground: #eeecf5;
    --surface: #ffffff;
    --raised: #f4f2fb;
    --hairline: #e2ddee;
    --text: #1a1526;
    --muted: #6a6383;
    --brand: #df1d6e;
    --opt-a: #0e97a0;
    --opt-b: #2f63e0;
    --opt-c: #7c52e0;
    --opt-d: #cd7c15;
    --correct: #159a56;
    --wrong: #df1d48;
    --shadow: 0 16px 40px -22px rgba(31, 20, 45, 0.35);
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --ground: #141021;
  --surface: #1e1830;
  --raised: #291f42;
  --hairline: #392f52;
  --text: #f5f2fb;
  --muted: #a79fbd;
  --brand: #ff3d81;
  --opt-a: #17c0c9;
  --opt-b: #3e7bfa;
  --opt-c: #9b6bf5;
  --opt-d: #f9a63a;
  --correct: #37d67a;
  --wrong: #ff5470;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
}
:root[data-theme=light] {
  color-scheme: light;
  --ground: #eeecf5;
  --surface: #ffffff;
  --raised: #f4f2fb;
  --hairline: #e2ddee;
  --text: #1a1526;
  --muted: #6a6383;
  --brand: #df1d6e;
  --opt-a: #0e97a0;
  --opt-b: #2f63e0;
  --opt-c: #7c52e0;
  --opt-d: #cd7c15;
  --correct: #159a56;
  --wrong: #df1d48;
  --shadow: 0 16px 40px -22px rgba(31, 20, 45, 0.35);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* src/games/trivia/client/player.css */
.player {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(
      180deg,
      var(--surface),
      var(--ground) 60%);
  color: var(--text);
}
.p-banner {
  background: color-mix(in srgb, var(--opt-d) 18%, var(--surface));
  color: var(--opt-d);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
  padding: 7px;
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}
.p-banner .d {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--opt-d);
}
.player.reconnecting .p-body {
  opacity: 0.5;
}
.p-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}
.wm {
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -0.02em;
  font-size: 15px;
  text-align: center;
}
.wm span {
  color: var(--muted);
  font-weight: 700;
}
.hero {
  text-align: center;
  margin-top: 6px;
}
.hero .big {
  font-weight: 900;
  font-size: 30px;
  letter-spacing: -0.03em;
  margin: 4px 0 2px;
}
.hero .sub {
  color: var(--muted);
  font-size: 13px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.input {
  background: var(--raised);
  border: 1.5px solid var(--hairline);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  width: 100%;
}
.input::placeholder {
  color: var(--muted);
}
.input.code {
  font-family: var(--font-mono);
  font-size: 28px;
  letter-spacing: 0.3em;
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}
.input.bad {
  border-color: var(--wrong);
}
.err {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: color-mix(in srgb, var(--wrong) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--wrong) 45%, transparent);
  color: var(--wrong);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.err b {
  color: var(--text);
}
.cta {
  margin-top: auto;
  background: var(--brand);
  color: var(--brand-ink);
  border: none;
  border-radius: 13px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.cta:disabled {
  background: var(--raised);
  color: var(--muted);
  cursor: default;
}
.cta.ghost {
  background: var(--raised);
  color: var(--muted);
}
.cta:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}
.center .lg {
  font-size: 20px;
  font-weight: 800;
}
.center .mt {
  color: var(--muted);
  font-size: 13px;
}
.pulse {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--hairline);
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.rh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.rh .sec {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rh .sec.low {
  color: var(--wrong);
}
.tbar {
  height: 6px;
  border-radius: 999px;
  background: var(--hairline);
  overflow: hidden;
}
.tbar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--brand);
  border-radius: 999px;
}
.pq {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 2px 0;
}
.opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt {
  --c: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  background: color-mix(in srgb, var(--c) 13%, var(--surface));
  border: 2px solid color-mix(in srgb, var(--c) 40%, transparent);
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  min-height: 58px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.15s, opacity 0.15s;
}
.opt .ltr {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--c);
  color: #0d0a16;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
}
.opt.a {
  --c: var(--opt-a);
}
.opt.b {
  --c: var(--opt-b);
}
.opt.c {
  --c: var(--opt-c);
}
.opt.d {
  --c: var(--opt-d);
}
.opt.sel {
  border-color: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 30%, transparent);
  transform: translateY(-1px);
}
.opt.sel .pick {
  margin-left: auto;
  color: var(--c);
  font-weight: 900;
}
.opt.dim {
  opacity: 0.4;
}
.opt:disabled {
  cursor: default;
}
.opt:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}
.locked {
  background: color-mix(in srgb, var(--correct) 15%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--correct) 45%, transparent);
  color: var(--text);
  border-radius: 12px;
  padding: 13px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}
.locked b {
  color: var(--correct);
}
.locked.neutral {
  background: var(--raised);
  border-color: var(--hairline);
}
.locked.neutral b {
  color: var(--text);
}
.verdict {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}
.badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
}
.badge.ok {
  background: color-mix(in srgb, var(--correct) 22%, transparent);
  color: var(--correct);
  border: 2px solid var(--correct);
}
.badge.no {
  background: color-mix(in srgb, var(--wrong) 20%, transparent);
  color: var(--wrong);
  border: 2px solid var(--wrong);
}
.badge.trophy {
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--brand);
  border: 2px solid var(--brand);
  font-size: 34px;
}
.verdict .big {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.verdict .pts {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
}
.verdict .pts b {
  color: var(--text);
}
.answer {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.answer .ltr {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: #0d0a16;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  flex: none;
}
.answer .ltr.a {
  background: var(--opt-a);
}
.answer .ltr.b {
  background: var(--opt-b);
}
.answer .ltr.c {
  background: var(--opt-c);
}
.answer .ltr.d {
  background: var(--opt-d);
}
.answer b {
  color: var(--text);
}
.rankline {
  font-size: 14px;
  color: var(--muted);
}
.rankline b {
  color: var(--text);
}
.foot {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.closed-msg {
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}
.closed-msg b {
  color: var(--text);
}
