/* Kwistig — phone UI */
body { min-height: 100dvh; }
#app { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }

/* join */
.join { justify-content: center; align-items: center; gap: 1rem; max-width: 460px; width: 100%; margin: 0 auto; }
.logo.big { font-size: 3rem; }
.tag { color: var(--ink-soft); text-align: center; margin: 0 0 .5rem; }
.join form { width: 100%; display: grid; gap: .6rem; }
.join label { font-weight: 700; color: var(--ink-soft); font-size: .9rem; margin-top: .3rem; }
.field.code { font-size: 2.2rem; letter-spacing: .35em; text-align: center; text-transform: uppercase; font-weight: 800; padding: .5em; }
.btn.wide { width: 100%; font-size: 1.2rem; margin-top: .6rem; }
.error { color: var(--bad); font-weight: 700; min-height: 1.2em; margin: .2rem 0 0; text-align: center; }

/* live */
.live { padding-top: max(10px, env(safe-area-inset-top)); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem .2rem .8rem; }
.me { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score { background: var(--surface); padding: .35em .8em; border-radius: 999px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stage { flex: 1; display: flex; flex-direction: column; }
.foot { text-align: center; padding-top: .6rem; }
.conn { font-size: .75rem; color: var(--ink-mute); }
.conn.off { color: var(--bad); font-weight: 700; }

.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .5rem; padding: 1rem 0; }
h1 { font-size: 2rem; line-height: 1.05; margin: .2rem 0; letter-spacing: -0.02em; }
.display { font-family: var(--display); font-weight: 800; font-size: 2.4rem; letter-spacing: -0.02em; }
[data-theme="halloween"] .display { font-weight: 400; letter-spacing: .02em; color: var(--accent); }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 800; color: var(--accent); margin: 0; }
.soft { color: var(--ink-soft); margin: .2rem 0; }
.small { font-size: .9rem; }
.pill { background: var(--surface); padding: .45em 1em; border-radius: 999px; font-weight: 700; margin-top: .6rem; }
.emoji-xl { font-size: 4.5rem; line-height: 1; }
.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* question */
.qhead { display: flex; justify-content: space-between; font-weight: 700; color: var(--ink-soft); font-size: .9rem; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ink); }
.tbar { height: 6px; border-radius: 6px; background: var(--surface); overflow: hidden; margin: .5rem 0 .4rem; }
.tbar i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.qtext { font-size: 1.5rem; line-height: 1.2; margin: .4rem 0; }
.qmini { color: var(--ink-soft); font-weight: 600; margin: .3rem 0 .8rem; font-size: 1rem; line-height: 1.3; }

.answers { flex: 1; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; min-height: 55dvh; }
.answers.tf { grid-template-columns: 1fr; }
.ans {
  background: var(--tile); color: #fff; border-radius: 18px; padding: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .5rem; text-align: center; font-weight: 800; font-size: 1.05rem;
  line-height: 1.15; box-shadow: inset 0 -6px 0 rgba(0,0,0,.22); touch-action: manipulation; user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .06s;
}
.ans .shape { font-size: 2.1rem; color: rgba(255,255,255,.95); filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.ans:active, .ans.picked { transform: scale(.96); }
.answers.tf .ans { font-size: 1.6rem; flex-direction: row; gap: .8rem; }
[data-theme="halloween"] .ans.c2 { color: #1b1206; text-shadow: none; }
[data-theme="halloween"] .ans.c2 .shape { color: #1b1206; }
.ans.c2 { color: #1b1206; text-shadow: none; }
.ans.c2 .shape { color: #1b1206; }

.estimate { display: grid; gap: .8rem; margin-top: 1rem; }
.est-row { display: flex; align-items: center; gap: .6rem; }
.field.est { font-size: 2rem; text-align: center; font-weight: 800; }
.unit { font-weight: 800; font-size: 1.3rem; color: var(--ink-soft); }

/* result */
.result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .3rem; border-radius: 24px; padding: 1.5rem 1rem; margin: .5rem 0; }
.result.good { background: linear-gradient(160deg, color-mix(in srgb, var(--good) 35%, transparent), transparent 70%); }
.result.bad, .result.miss { background: linear-gradient(160deg, color-mix(in srgb, var(--bad) 30%, transparent), transparent 70%); }
.gain { font-size: 3.2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.result.good .gain { color: var(--good); }
.answer { background: var(--surface); padding: .7em 1em; border-radius: 14px; margin: .8rem 0 .4rem; }
.standing { display: flex; gap: 1rem; font-weight: 800; font-size: 1.3rem; margin-top: .4rem; }
.standing span:first-child { color: var(--accent); }
.rank-xl { font-size: 5.5rem; font-weight: 800; line-height: 1; color: var(--accent); letter-spacing: -0.04em; }
.big-score { font-size: 1.6rem; font-weight: 800; margin: 0; }

.field.open-in { font-size: 1.5rem; font-weight: 800; text-align: center; }
