/* Team page: the whole game fits one laptop screen and scales up with it (sizes are rem, see app.css). */
html, body { height: 100%; }
body { display: grid; grid-template-rows: auto auto minmax(0, 1fr); height: 100dvh; overflow: hidden; }

/* ---------- top bar: who / where in the question / time ---------- */
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; border-bottom: 1.5px solid var(--ink); }
.bar .who { display: grid; line-height: 1.1; min-width: 0; }
.bar .who b { font-stretch: 72%; font-weight: 800; font-size: 1.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .who b .sw { width: .7em; height: .7em; }
.bar .who span { font-size: .8125rem; color: var(--ink-3); }
.bar .right { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; }
.bar .rnd { text-align: right; line-height: 1.15; font-size: .875rem; color: var(--ink-3); }
.bar .rnd b { display: block; color: var(--ink); font-stretch: 72%; font-size: 1.0625rem; }
.bar .clock { font-size: 2.6rem; min-width: 4.3ch; text-align: right; }

/* ---------- "what to do now" strip ---------- */
.nowbar { display: flex; align-items: center; gap: .75rem; padding: .55rem 1.5rem; font-weight: 600; font-size: 1.0625rem; background: var(--rule-2); color: var(--ink); }
.nowbar b { font-stretch: 72%; font-weight: 800; }
.nowbar.question { background: var(--red); color: #fff; }
.nowbar.reveal { background: var(--ink); color: #fff; }
.nowbar.finished { background: var(--green-soft); color: var(--green); }

main { min-height: 0; padding: 1.1rem 1.5rem 1.25rem; }
.mult { display: inline-block; margin-left: .4rem; padding: .05rem .6rem; border-radius: 99px; background: var(--red); color: #fff; font-size: .8125rem; font-weight: 800; vertical-align: middle; }

/* ---------- join + waiting ---------- */
.join { height: 100%; display: grid; align-content: center; justify-items: start; gap: 1.6rem; max-width: 36rem; margin: 0 auto; }
.join .logo { font-stretch: 62%; font-weight: 850; font-size: 5.5rem; line-height: .86; }
.join .logo i, .hold h1 i { font-style: normal; color: var(--red); }
.join .lede { font-family: var(--f-brief); font-size: 1.1875rem; line-height: 1.55; color: var(--ink-2); max-width: 44ch; }
.join form { display: flex; gap: .6rem; width: 100%; flex-wrap: wrap; }
.join .joinopt { display: grid; gap: .6rem; width: 100%; }
.join .joinopt h2 { font-size: 1.25rem; }
.join .joinopt form { display: flex; gap: .6rem; width: 100%; flex-wrap: wrap; }
.join .joinor { width: 100%; display: flex; align-items: center; gap: .8rem; color: var(--ink-3); font-size: .875rem; }
.join .joinor::before, .join .joinor::after { content: ''; flex: 1; border-top: 1px solid var(--rule); }
.join .code-input.name-input { letter-spacing: .02em; text-transform: none; font-size: 1.5rem; }
.join .code-input { flex: 1 1 12rem; min-height: 3.5rem; font-stretch: 72%; font-weight: 750; font-size: 1.75rem; letter-spacing: .18em; text-transform: uppercase; text-align: center; border: 2px solid var(--ink); border-radius: var(--r-s); background: var(--sheet); }
.hold { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: center; max-width: 72rem; margin: 0 auto; }
.hold h1 { font-stretch: 62%; font-weight: 850; font-size: 4.5rem; line-height: .88; margin-bottom: 1rem; }
.hold .lede { font-family: var(--f-brief); font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); max-width: 52ch; }
/* How a question runs: a real sequence, so numbered, set as a ruled list rather than a stack of boxes. */
.howto { margin: 0; padding: 0; list-style: none; counter-reset: s; border-top: 2px solid var(--ink); }
.howto li { counter-increment: s; display: grid; grid-template-columns: 3rem minmax(0, 1fr); column-gap: 1rem; align-items: baseline; padding: .85rem 0; border-bottom: 1px solid var(--rule); font-size: 1.125rem; line-height: 1.4; }
.howto li::before { content: counter(s); font-stretch: 62%; font-weight: 850; font-size: 2.4rem; line-height: .8; color: var(--red); }
.howto li > span { min-width: 0; }
.howto b { font-weight: 750; }
@media (max-width: 860px) { .hold { align-content: start; gap: 1.5rem; } }

/* ---------- answering: question + answer tiles | your answer ---------- */
.qdesk { height: 100%; display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(16.5rem, .8fr); gap: 1.5rem; min-height: 0; }
.qmain { display: flex; flex-direction: column; gap: .6rem; min-height: 0; }
.qmain .k { font-size: .875rem; color: var(--ink-3); }
.qmain h1 { font-stretch: 72%; font-weight: 850; font-size: 2.4rem; line-height: 1; }
.qmain .sel { font-family: var(--f-brief); font-style: italic; font-size: 1.25rem; color: var(--red); }
.answers { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: minmax(3.2rem, 1fr); gap: .5rem; margin-top: .3rem; }
.ans { container-type: size; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; text-align: left; padding: .4rem .9rem; border: 1.5px solid var(--ink); border-radius: var(--r-m); background: var(--sheet); cursor: pointer; min-height: 0; overflow: hidden; }
.ans .lt { width: clamp(1.8rem, 52cqh, 2.6rem); height: clamp(1.8rem, 52cqh, 2.6rem); border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--ink); font-stretch: 72%; font-weight: 850; font-size: clamp(.9rem, 28cqh, 1.25rem); }
.ans .tx { font-weight: 650; font-size: clamp(.9375rem, 24cqh, 1.4rem); line-height: 1.15; }
.ans .mk { width: 1.6rem; height: 1.6rem; border-radius: 4px; border: 2px solid var(--ink-3); display: grid; place-items: center; font-weight: 800; }
.ans:hover:not(:disabled):not(.on) { background: color-mix(in srgb, var(--ink) 6%, var(--sheet)); }
.ans.on { background: var(--ink); color: #fff; }
.ans.on .lt { background: #fff; color: var(--ink); border-color: #fff; }
.ans.on .mk { background: var(--red); border-color: var(--red); color: #fff; }
.ans:disabled { cursor: not-allowed; }
.ans.cant { color: var(--ink-3); border-color: var(--rule); }
.ans.cant .lt { border-color: var(--rule); }
.ans:disabled:not(.on):not(.cant) { color: var(--ink-3); border-color: var(--rule); }

.sheet { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: .85rem; padding: 1rem; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: var(--r-m); }
.sheet h2 { font-size: 1.0625rem; }
.count { display: flex; align-items: baseline; gap: .5rem; }
.count b { font-stretch: 62%; font-weight: 850; font-size: 3.5rem; line-height: .85; }
.count span { color: var(--ink-2); }
.lines { min-height: 4rem; overflow: auto; display: grid; align-content: start; gap: .25rem; scrollbar-width: thin; }
.lines .empty { color: var(--ink-3); font-size: .9375rem; padding: .5rem 0; }
.line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .35rem .4rem; border-radius: var(--r-s); background: var(--paper); }
.line .lt { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; font-size: .8125rem; }
.line .nm { font-size: .875rem; font-weight: 600; line-height: 1.2; }
.line .x { border: 0; background: transparent; width: 1.75rem; height: 1.75rem; border-radius: var(--r-s); cursor: pointer; font-size: 1.1rem; color: var(--ink-3); }
.line .x:hover { background: var(--red-soft); color: var(--red); }
.foot { display: grid; gap: .6rem; }
.foot .btn-big { width: 100%; }
.stamp { display: flex; gap: .6rem; align-items: center; padding: .65rem .8rem; border-radius: var(--r-s); background: var(--green-soft); color: var(--green); font-weight: 600; }
.stamp.none { background: var(--rule-2); color: var(--ink-2); }
.strip { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .75rem; }
.foot .note { font-size: .75rem; color: var(--ink-3); }

/* ---------- results ---------- */
.results { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: .8rem; }
.res-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, .9fr); gap: 1.75rem; min-height: 0; }
.res-cols > section { display: flex; flex-direction: column; min-height: 0; }
.res-cols h2 { font-size: 1.125rem; margin-bottom: .4rem; }
.res-cols .note { font-size: .8125rem; color: var(--ink-3); margin-top: .5rem; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: .35rem .7rem; border-radius: var(--r-s); cursor: pointer; font-weight: 600; color: var(--ink-3); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.hero { display: flex; align-items: flex-end; gap: 1.25rem; padding-bottom: .7rem; border-bottom: 1.5px solid var(--ink); margin-bottom: .5rem; }
.hero .big { font-stretch: 62%; font-weight: 850; font-size: 5.5rem; line-height: .8; color: var(--green); }
.hero .big.neg { color: var(--red); }
.hero .meta { display: grid; gap: .1rem; padding-bottom: .3rem; font-size: .9375rem; }
.hero .meta b { font-size: 1.125rem; }
.qsmall { font-size: .9375rem; margin-bottom: .4rem; }

.fill-list { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(2.5rem, 1fr); border-top: 1.5px solid var(--ink); }
.rl { container-type: size; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; border-bottom: 1px solid var(--rule); min-height: 0; padding: 0 .3rem; }
.rl .mk { width: clamp(1.4rem, 56cqh, 2.2rem); height: clamp(1.4rem, 56cqh, 2.2rem); border-radius: 50%; display: grid; place-items: center; background: var(--rule-2); color: var(--ink-3); font-weight: 800; }
.rl.good .mk { background: var(--green); color: #fff; }
.rl.bad .mk { background: var(--red); color: #fff; }
.rl .nm { font-weight: 600; font-size: clamp(.875rem, 24cqh, 1.15rem); line-height: 1.15; }
.rl .nm small { display: block; font-family: var(--f-brief); font-weight: 400; font-size: .8125rem; color: var(--ink-3); }
.rl .p { font-stretch: 62%; font-weight: 850; font-size: clamp(1.3rem, 46cqh, 2.4rem); line-height: 1; min-width: 2ch; text-align: right; color: var(--green); }
.rl .p.zero { color: var(--ink-3); }
.rl .p.neg { color: var(--red); }
.rl.miss { color: var(--ink-3); }
.rl.mine { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.rl .got { display: inline-block; margin-left: .5rem; padding: .05rem .45rem; border-radius: 99px; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 700; vertical-align: middle; }

.board .rowx { container-type: size; display: grid; grid-template-columns: 2.2ch minmax(0, 1fr) auto; gap: .8rem; align-items: center; border-bottom: 1px solid var(--rule); min-height: 0; }
.board .rowx.me { background: color-mix(in srgb, var(--red) 8%, transparent); }
.board .rowx.me .n::after { content: 'You'; margin-left: .5rem; padding: .05rem .45rem; border-radius: 99px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; vertical-align: middle; }
.board .p { font-stretch: 62%; font-weight: 850; font-size: clamp(1.2rem, 40cqh, 2.2rem); color: var(--ink-3); text-align: right; }
.board .n { font-weight: 700; font-size: clamp(1rem, 26cqh, 1.375rem); }
.board .t { text-align: right; font-stretch: 62%; font-weight: 850; font-size: clamp(1.5rem, 50cqh, 3rem); line-height: 1; padding-right: .3rem; }

/* ---------- phones and narrow windows: let the page scroll ---------- */
@media (max-width: 860px), (max-height: 520px) {
  body { height: auto; overflow: auto; display: block; }
  .bar { grid-template-columns: 1fr auto; padding: .6rem 1rem; }
  .bar .steps { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .bar .rnd { display: none; }
  .steps li span:last-child { display: none; }
  .nowbar { padding: .5rem 1rem; font-size: .9375rem; }
  main { padding: 1rem; }
  .qdesk, .res-cols, .hold { grid-template-columns: 1fr; height: auto; }
  .answers { --cols: 1 !important; grid-auto-rows: minmax(3.4rem, auto); }
  .qmain h1 { font-size: 1.9rem; }
  .fill-list { grid-template-rows: none !important; grid-auto-rows: minmax(3rem, auto); }
  .join .logo, .hold h1 { font-size: 3.25rem; }
}
