/* Creative Connect 2.0 games — shared by the guest page and the host page. */
:root {
  --bg: #F5F4F1; --surface: #FFFFFF; --sunk: #ECEAE6; --ink: #121113; --ink-2: #3A373D; --muted: #75717A;
  --rule: #E2DFDA; --chrome: #121113; --chrome-ink: #FFFFFF;
  --red: #D62828; --red-ink: #C21F1F; --yellow: #FFC300; --purple: #6A2C91; --purple-ink: #6A2C91;
  --sun: #FF4500;
  --found: #FFF3C4; --found-edge: #F2B600; --line: #FFE1E1; --line-edge: #D62828;
  --ok: #1F7A4D;
  --shadow: 0 1px 2px rgba(18,17,19,.05), 0 8px 24px rgba(18,17,19,.06);
  --font: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --r: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111012; --surface: #1C1B1E; --sunk: #242227; --ink: #F4F2F5; --ink-2: #D2CED6; --muted: #9D98A3;
    --rule: #2E2C32; --chrome: #0A0A0B; --red-ink: #FF7A7A; --purple-ink: #C79BEA;
    --found: #3A3110; --found-edge: #C99A00; --line: #3F1A1C; --line-edge: #FF7A7A; --ok: #6FD39F;
    --shadow: 0 1px 2px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; }
html, body { background: var(--bg); margin: 0; }
body { font-family: var(--font); color: var(--ink); font-size: 16px; line-height: 1.45;
       -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--purple-ink); outline-offset: 2px; }

/* ---------- header ---------- */
.top { background: var(--chrome); color: var(--chrome-ink); padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; }
.top-in { max-width: 720px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; display: block; }
.brand small { font-weight: 800; color: var(--sun); }
.top-right { display: flex; align-items: center; gap: 12px; font-size: 13px; white-space: nowrap; }
.host-badge { background: #B98BE0; color: #121113; font-weight: 800; font-size: 11px; letter-spacing: .12em; padding: 4px 8px; border-radius: 6px; }
.linkish { background: none; border: 0; color: inherit; opacity: .7; text-decoration: underline; text-underline-offset: 3px; padding: 0; font-size: 13px; }

main { max-width: 720px; margin: 0 auto; padding: 22px 16px calc(100px + env(safe-area-inset-bottom, 0px)); }

/* ---------- type ---------- */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
h1 { font-weight: 800; font-size: clamp(36px, 10.5vw, 56px); line-height: .95; letter-spacing: -.035em;
     margin: 6px 0 14px; text-wrap: balance; }
h1 .accent { color: var(--red-ink); }
h2 { font-weight: 800; font-size: 20px; letter-spacing: -.02em; margin: 0 0 12px; }
.lede { color: var(--ink-2); margin: 0 0 18px; max-width: 60ch; font-size: 16.5px; }
.lede b { color: var(--ink); }
.note { font-size: 13.5px; color: var(--muted); }
.motto { text-align: center; font-weight: 800; color: var(--purple-ink); font-size: 14px; margin: 28px 0 0; letter-spacing: -.01em; }

/* ---------- tab bar ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--chrome);
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
.tabs-in { max-width: 560px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.tab { position: relative; background: transparent; border: 0; color: #A9A4AF; padding: 9px 4px 8px; border-radius: 12px;
       font-weight: 700; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tab i { display: block; width: 20px; height: 4px; border-radius: 2px; background: currentColor; opacity: .3; }
.tab[aria-selected="true"] { color: #fff; background: #242227; }
.tab[aria-selected="true"] i { opacity: 1; background: var(--tab-accent, var(--yellow)); }
.tab .dot { position: absolute; top: 7px; right: calc(50% - 32px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* ---------- controls ---------- */
.btn { border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 700; background: var(--ink); color: var(--bg); letter-spacing: -.005em; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn.red { background: var(--red); color: #fff; }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.inline-confirm { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-radius: 12px;
                  background: var(--surface); box-shadow: inset 0 0 0 2px var(--red); font-size: 14px; margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.field input { width: 100%; padding: 14px 15px; border-radius: 12px; border: 1.5px solid var(--rule); background: var(--bg);
               font-size: 17px; caret-color: var(--ink); transition: border-color .15s; }
.field input:focus { border-color: var(--purple-ink); outline: none; background: var(--surface); }
.field input.digits { font-variant-numeric: tabular-nums; letter-spacing: .12em; font-weight: 600; }
.warn { color: var(--red-ink); font-size: 14px; font-weight: 600; margin: 0; min-height: 1.2em; }
.panel { background: var(--surface); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }

/* ---------- sign in ---------- */
.signin { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.signin form, .stack { display: flex; flex-direction: column; gap: 16px; }

/* the "not sending you money" popup */
.pop-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px;
            background: rgba(10,10,12,.5); }
.pop { position: relative; overflow: hidden; width: 100%; max-width: 380px; background: var(--surface); border-radius: 24px;
       padding: 26px 22px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); text-align: left; }
.pop .stamp { display: inline-flex; align-items: center; gap: 8px; background: var(--sunk); border-radius: 999px; padding: 6px 12px 6px 8px;
              font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 14px; }
.pop .stamp b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; font-size: 13px; }
.pop h3 { font-size: 27px; line-height: 1.02; letter-spacing: -.03em; font-weight: 800; margin: 0 0 12px; text-wrap: balance; }
.pop p { margin: 0 0 10px; color: var(--ink-2); font-size: 15.5px; }
.pop p.small { font-size: 13.5px; color: var(--muted); }
.pop .btn { margin-top: 8px; }
.pop .timer { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--yellow); width: 100%; transform-origin: left; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes rise { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.pop { animation: rise .3s ease-out both; }

.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
         background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: 14.5px;
         box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100% - 32px); animation: rise .25s ease-out both; }

/* ---------- bingo ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; background: var(--surface); border-radius: 14px; padding: 11px 11px 12px; box-shadow: inset 0 0 0 1px var(--rule);
            font-size: 13.5px; line-height: 1.25; font-weight: 600; color: var(--ink-2); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
                    background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 800; margin-bottom: 8px; }
.steps li:last-child::before { background: var(--red); color: #fff; }
.steps b { color: var(--ink); }
.rule-line { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; }
.rule-line b { color: var(--ink); }
.progress { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.progress .who { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.progress .n { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.progress .n span { color: var(--muted); font-weight: 600; }
.meter { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.meter span { display: block; height: 100%; background: var(--yellow); width: 0; transition: width .35s ease; border-radius: 3px; }
.grid { display: grid; gap: 7px; }
.grid.s4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.s3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sq { background: var(--surface); border: 0; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--rule);
      padding: 9px 8px; min-height: 96px; text-align: left; display: flex; flex-direction: column;
      justify-content: space-between; gap: 6px; font-size: 12.5px; line-height: 1.2; font-weight: 600; color: var(--ink);
      overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; transition: transform .1s; }
.sq:active { transform: scale(.97); }
.s3 .sq { min-height: 116px; font-size: 15px; padding: 11px; }
.sq .who { font-size: 11.5px; font-weight: 800; color: var(--muted); min-height: 1.2em; }
.sq.found { background: var(--found); box-shadow: inset 0 0 0 1.5px var(--found-edge); }
.sq.found .who { color: var(--ink); }
.sq.inline { background: var(--line); box-shadow: inset 0 0 0 2px var(--line-edge); }
/* Narrow phones: sized so the longest word in the pool ("exposure", with its quote marks) fits a
   360px-wide screen without breaking, even where the browser can't hyphenate. */
@media (max-width: 400px) { .grid { gap: 6px; } .s4 .sq { font-size: 12px; padding: 9px 6px; } }
@media (min-width: 560px) { .sq { font-size: 14px; min-height: 108px; padding: 11px; } .s3 .sq { font-size: 17px; min-height: 134px; } }
.banner { border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; background: var(--red); color: #fff; }
.banner strong { font-weight: 800; font-size: 26px; letter-spacing: -.03em; display: block; line-height: 1; margin-bottom: 3px; }
.banner span { font-size: 14.5px; }
.banner.full { background: var(--purple); }
@keyframes pop { 0% { transform: scale(.94); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.banner.pop { animation: pop .45s ease-out; }
.offline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--red-ink); margin-bottom: 10px; }
.offline::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.switch { display: block; margin: 18px auto 0; }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(10,10,12,.5); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 520px; border-radius: 22px 22px 0 0;
         padding: 22px 18px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px;
         animation: rise .22s ease-out both; }
@media (min-width: 560px) { .scrim { align-items: center; } .sheet { border-radius: 22px; } }
.sheet .q { font-size: 24px; font-weight: 800; letter-spacing: -.025em; line-height: 1.08; text-wrap: balance; }
.sheet .q small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* ---------- pitch cards ---------- */
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--sunk); border-radius: 12px; padding: 4px; }
.stepper button { width: 40px; height: 40px; border: 0; border-radius: 9px; background: var(--surface); font-size: 20px; font-weight: 700; }
.stepper output { min-width: 84px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.teams { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.team { background: var(--surface); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); }
.team-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.team-h h3 { font-weight: 800; font-size: 20px; letter-spacing: -.02em; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pc { border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: inset 0 0 0 2px var(--k); background: var(--surface); }
.pc .band { background: var(--k); color: var(--kf); font-weight: 800; font-size: 11.5px; letter-spacing: .14em; padding: 7px 10px;
            display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pc .band button { border: 0; background: rgba(255,255,255,.22); color: inherit; font-weight: 700; font-size: 11.5px; letter-spacing: 0;
                   padding: 3px 8px; border-radius: 6px; }
.pc .band button[disabled] { opacity: .35; cursor: default; }
.pc .txt { font-weight: 800; font-size: 17px; letter-spacing: -.02em; line-height: 1.15; padding: 12px 10px 14px; text-wrap: balance; }
@media (max-width: 440px) {
  .cards { grid-template-columns: 1fr; }
  .pc { flex-direction: row; }
  .pc .band { min-width: 100px; flex-direction: column; align-items: flex-start; justify-content: center; }
  .pc .txt { padding: 11px 12px; display: flex; align-items: center; }
}
.k-format { --k: var(--purple); --kf: #fff; }
.k-setting { --k: var(--yellow); --kf: #121113; }
.k-twist { --k: var(--red); --kf: #fff; }
.k-setting .band button { background: rgba(0,0,0,.12); }
@keyframes deal { from { transform: translateY(8px); opacity: .2; } to { transform: none; opacity: 1; } }
.team.dealt { animation: deal .35s ease-out both; }
.waiting { text-align: center; padding: 40px 18px; border-radius: 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule); }
.waiting strong { display: block; font-weight: 800; font-size: 20px; letter-spacing: -.02em; margin-bottom: 6px; }

/* ---------- host: timer ---------- */
.clock { font-weight: 800; font-size: clamp(72px, 24vw, 128px); line-height: 1; text-align: center; letter-spacing: -.04em;
         font-variant-numeric: tabular-nums; margin: 6px 0 4px; padding: 4px 0; }
.clock.warn-t { color: var(--red-ink); }
.clock.done { color: #fff; background: var(--red); border-radius: 16px; }
.clock-label { text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 14px; min-height: 1.3em; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.presets button { border: 0; border-radius: 12px; padding: 10px 6px; background: var(--sunk); font-weight: 800; font-size: 15px; line-height: 1.2; }
.presets button small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.presets button[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 2px var(--purple-ink); }
.clock-ctl { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; }
.prompt { font-weight: 800; font-size: clamp(23px, 6.4vw, 32px); letter-spacing: -.025em; line-height: 1.12; min-height: 3.6em;
          display: flex; align-items: center; text-wrap: balance; margin: 6px 0 14px; }
.prompt-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.prompt-nav .n { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.reminder { margin-top: 14px; padding: 11px 13px; border-radius: 12px; background: var(--found); font-size: 14px; }

/* ---------- host: board + run sheet ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px; box-shadow: inset 0 0 0 1px var(--rule); }
.stat b { display: block; font-weight: 800; font-size: 28px; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.board li { background: var(--surface); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--rule); }
.board li.won { box-shadow: inset 0 0 0 2px var(--red); }
.board li.full { box-shadow: inset 0 0 0 2px var(--purple-ink); }
.board summary { list-style: none; display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; cursor: pointer; }
.board summary::-webkit-details-marker { display: none; }
.board .rank { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.board .nm { font-weight: 800; }
.board .sub { font-size: 12.5px; color: var(--muted); }
.board .tag { font-weight: 800; font-size: 11px; letter-spacing: .08em; padding: 4px 8px; border-radius: 7px; color: #fff; background: var(--red); white-space: nowrap; }
.board .tag.full { background: var(--purple); }
.board .tag.none { background: transparent; color: var(--muted); font-size: 13.5px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.board .more { padding: 0 12px 12px 48px; font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; }
.runsheet { list-style: none; margin: 0; padding: 0; }
.runsheet li { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--rule); }
.runsheet li:first-child { border-top: 0; }
.runsheet time { font-weight: 800; font-variant-numeric: tabular-nums; }
.runsheet b { display: block; }
.runsheet span { font-size: 13.5px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
