/* Siben & Siben Trivia — styles
   Palette derives from the Siben & Siben Modern theme: cream / gold / ink. */
.st-root {
  --st-cream: #f7f2e8;
  --st-cream-2: #efe7d6;
  --st-ink: #141414;
  --st-ink-2: #3a3a3a;
  --st-gold: #d19e14;
  --st-gold-dark: #a67c0a;
  --st-rule: rgba(20,20,20,.14);
  --st-green: #2f7d4a;
  --st-red: #b8322a;
  --st-radius: 14px;
  --st-display: "Fraunces", Georgia, "Times New Roman", serif;
  --st-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  font-family: var(--st-body);
  color: var(--st-ink);
  background: var(--st-cream);
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  box-sizing: border-box;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.st-root *, .st-root *::before, .st-root *::after { box-sizing: border-box; }
.st-root button { font-family: inherit; }
.st-root [hidden] { display: none !important; }

/* ---------- masthead ---------- */
.st-mast { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--st-rule); margin-bottom: 18px; }
.st-mast img { height: 48px; flex: none; width: auto; max-width: 180px; object-fit: contain; }
.st-mast-text { display: flex; flex-direction: column; }
.st-mast-firm { font-family: var(--st-display); font-size: 17px; font-weight: 600; letter-spacing: .01em; line-height: 1.1; }
.st-mast-sub { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--st-gold-dark); margin-top: 4px; font-weight: 700; }
.st-mast-right { margin-left: auto; font-size: 12px; color: var(--st-ink-2); text-align: right; }

/* ---------- typography ---------- */
.st-h1 { font-family: var(--st-display); font-weight: 600; font-size: clamp(28px, 6vw, 40px); line-height: 1.05; margin: 0 0 8px; letter-spacing: -.01em; }
.st-h1 em { font-style: italic; font-weight: 400; color: var(--st-gold-dark); }
.st-lede { color: var(--st-ink-2); font-size: 15px; margin: 0 0 22px; max-width: 52ch; }
.st-eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--st-gold-dark); font-weight: 700; margin-bottom: 8px; }

/* ---------- buttons ---------- */
.st-btn { appearance: none; border: 1px solid var(--st-ink); background: var(--st-ink); color: var(--st-cream); border-radius: 999px; padding: 13px 22px; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .08s ease, background .15s ease; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; }
.st-btn:hover { background: #000; }
.st-btn:active { transform: translateY(1px); }
.st-btn:focus-visible, .st-choice:focus-visible, .st-input:focus-visible, .st-mode:focus-visible, .st-tab:focus-visible { outline: 3px solid var(--st-gold); outline-offset: 2px; }
.st-btn-gold { background: var(--st-gold); border-color: var(--st-gold); color: var(--st-ink); }
.st-btn-gold:hover { background: #e0ad24; }
.st-btn-ghost { background: transparent; color: var(--st-ink); }
.st-btn-ghost:hover { background: var(--st-cream-2); }
.st-btn-sm { padding: 9px 16px; font-size: 13px; min-height: 38px; }
.st-btn[disabled] { opacity: .45; cursor: not-allowed; }
.st-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.st-row-between { justify-content: space-between; }

/* ---------- mode cards ---------- */
.st-modes { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 26px; }
@media (min-width: 560px) { .st-modes { grid-template-columns: repeat(3, 1fr); } }
.st-mode { text-align: left; background: #fff; border: 1px solid var(--st-rule); border-radius: var(--st-radius); padding: 18px 16px; cursor: pointer; transition: border-color .15s, transform .08s, box-shadow .15s; display: flex; flex-direction: column; gap: 6px; min-height: 130px; }
.st-mode:hover { border-color: var(--st-gold); box-shadow: 0 6px 24px rgba(20,20,20,.06); }
.st-mode:active { transform: translateY(1px); }
.st-mode-title { font-family: var(--st-display); font-size: 20px; font-weight: 600; }
.st-mode-desc { font-size: 13px; color: var(--st-ink-2); }
.st-mode-tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--st-gold-dark); font-weight: 700; }
.st-mode[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- panels / forms ---------- */
.st-panel { background: #fff; border: 1px solid var(--st-rule); border-radius: var(--st-radius); padding: 20px 18px; margin-bottom: 16px; }
.st-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--st-ink-2); margin: 0 0 6px; }
.st-input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--st-rule); border-radius: 10px; background: var(--st-cream); color: var(--st-ink); }
.st-input:focus { border-color: var(--st-gold); background: #fff; }
.st-field { margin-bottom: 14px; }
.st-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.st-chip { border: 1px solid var(--st-rule); background: var(--st-cream); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--st-ink-2); }
.st-chip[aria-pressed="true"] { background: var(--st-ink); color: var(--st-cream); border-color: var(--st-ink); }
.st-chip-gold[aria-pressed="true"] { background: var(--st-gold); color: var(--st-ink); border-color: var(--st-gold); }
.st-help { font-size: 12.5px; color: var(--st-ink-2); margin-top: 8px; }
.st-error { color: var(--st-red); font-size: 13px; margin-top: 8px; font-weight: 600; }

/* ---------- question screen ---------- */
.st-q-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.st-ring { position: relative; width: 64px; height: 64px; flex: none; }
.st-ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.st-ring circle { fill: none; stroke-width: 5; }
.st-ring .st-ring-bg { stroke: var(--st-cream-2); }
.st-ring .st-ring-fg { stroke: var(--st-gold); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .2s; }
.st-ring.st-ring-warn .st-ring-fg { stroke: var(--st-red); }
.st-ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--st-display); font-weight: 600; font-size: 20px; }
.st-q-meta { display: flex; flex-direction: column; gap: 2px; }
.st-q-cat { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--st-gold-dark); font-weight: 700; }
.st-q-count { font-size: 13px; color: var(--st-ink-2); }
.st-q-score { margin-left: auto; text-align: right; }
.st-q-score b { font-family: var(--st-display); font-size: 22px; font-weight: 600; display: block; line-height: 1; }
.st-q-score span { font-size: 11px; color: var(--st-ink-2); letter-spacing: .1em; text-transform: uppercase; }
.st-q-text { font-family: var(--st-display); font-size: clamp(20px, 4.6vw, 26px); font-weight: 500; line-height: 1.25; margin: 8px 0 18px; min-height: 64px; }
.st-choices { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .st-choices { grid-template-columns: 1fr 1fr; } }
.st-choice { text-align: left; background: #fff; border: 1px solid var(--st-rule); border-radius: 12px; padding: 14px 14px 14px 48px; font-size: 15.5px; font-weight: 600; cursor: pointer; position: relative; min-height: 54px; transition: border-color .12s, background .12s; color: var(--st-ink); }
.st-choice::before { content: attr(data-key); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--st-rule); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--st-ink-2); font-family: var(--st-display); }
.st-choice:hover:not([disabled]) { border-color: var(--st-ink); }
.st-choice[disabled] { cursor: default; }
.st-choice.st-correct { border-color: var(--st-green); background: #edf6ef; }
.st-choice.st-correct::before { background: var(--st-green); border-color: var(--st-green); color: #fff; content: "✓"; }
.st-choice.st-wrong { border-color: var(--st-red); background: #fbeeed; }
.st-choice.st-wrong::before { background: var(--st-red); border-color: var(--st-red); color: #fff; content: "✕"; }
.st-choice.st-dim { opacity: .55; }
.st-feedback { margin-top: 14px; min-height: 24px; font-size: 14px; color: var(--st-ink-2); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-feedback b { color: var(--st-ink); }
.st-live-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.st-live-pill { font-size: 12px; background: var(--st-cream-2); border-radius: 999px; padding: 5px 11px; font-weight: 700; }
.st-live-pill.me { background: var(--st-gold); }

/* ---------- results ---------- */
.st-result { text-align: center; padding: 10px 0 0; }
.st-result-score { font-family: var(--st-display); font-size: clamp(56px, 16vw, 84px); font-weight: 600; line-height: 1; color: var(--st-ink); letter-spacing: -.02em; }
.st-result-sub { font-size: 14px; color: var(--st-ink-2); margin: 6px 0 18px; }
.st-versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 10px 0 16px; }
.st-versus .st-vs-name { font-size: 13px; font-weight: 700; color: var(--st-ink-2); text-transform: uppercase; letter-spacing: .08em; }
.st-versus .st-vs-score { font-family: var(--st-display); font-size: 40px; font-weight: 600; line-height: 1; }
.st-versus .st-vs-mid { font-family: var(--st-display); font-style: italic; color: var(--st-gold-dark); font-size: 18px; }
.st-versus .st-vs-win .st-vs-score { color: var(--st-gold-dark); }
.st-verdict { font-family: var(--st-display); font-size: 22px; font-weight: 600; margin-bottom: 14px; }
.st-share-box { display: flex; gap: 8px; margin-top: 8px; }
.st-share-box .st-input { font-size: 13px; }

/* ---------- leaderboard ---------- */
.st-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--st-rule); margin-bottom: 12px; }
.st-tab { background: none; border: none; padding: 10px 12px; font-size: 13px; font-weight: 700; color: var(--st-ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.st-tab[aria-selected="true"] { color: var(--st-ink); border-bottom-color: var(--st-gold); }
.st-lb { list-style: none; margin: 0; padding: 0; }
.st-lb li { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--st-rule); font-size: 14.5px; }
.st-lb li:last-child { border-bottom: none; }
.st-lb .st-rank { font-family: var(--st-display); font-weight: 600; color: var(--st-ink-2); }
.st-lb li:nth-child(-n+3) .st-rank { color: var(--st-gold-dark); }
.st-lb .st-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-lb .st-name small { display: block; font-weight: 500; color: var(--st-ink-2); font-size: 11.5px; }
.st-lb .st-pts { font-family: var(--st-display); font-weight: 600; font-size: 17px; }
.st-lb .st-me { background: #fbf4dd; border-radius: 8px; }
.st-empty, .st-lb li.st-empty { display: block; color: var(--st-ink-2); font-size: 14px; padding: 12px 4px; grid-template-columns: none; }

/* ---------- room / lobby ---------- */
.st-code { font-family: var(--st-display); font-size: clamp(40px, 12vw, 64px); letter-spacing: .3em; font-weight: 600; text-align: center; margin: 6px 0 2px; padding-left: .3em; }
.st-code-help { text-align: center; font-size: 13px; color: var(--st-ink-2); margin-bottom: 14px; }
.st-players { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; min-height: 36px; }
.st-player { background: var(--st-cream-2); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; }
.st-player.host::after { content: " · host"; font-weight: 500; color: var(--st-ink-2); }
.st-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st-gold); margin-right: 6px; animation: st-pulse 1.2s infinite; vertical-align: middle; }
@keyframes st-pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.st-countdown { font-family: var(--st-display); font-size: 96px; text-align: center; font-weight: 600; line-height: 1; padding: 30px 0; color: var(--st-gold-dark); }

/* ---------- footer ---------- */
.st-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--st-rule); font-size: 12px; color: var(--st-ink-2); display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }
.st-foot a { color: var(--st-ink); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--st-gold); }
.st-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--st-ink); color: var(--st-cream); padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; z-index: 9999; opacity: 0; transition: opacity .2s; pointer-events: none; }
.st-toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .st-root * { transition: none !important; animation: none !important; }
}
