/* Whose Turn? (once Kiski Baari?): the games' night stage. Page motion is calm; the spin itself is the show. */
:root {
  --night: #0D0720; --deep: #120A2A; --card: #1C1238; --line: rgba(185, 140, 255, 0.22);
  --ink: #1A1033; --sun: #FFD60A; --gum: #FF3D8B; --mint: #00D6A3; --lilac: #B98CFF; --sky: #5AD8FF;
  --muted: rgba(255, 255, 255, 0.74);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--night); color: #fff; font: 600 16px/1.45 Figtree, system-ui, sans-serif; }
h1 { font-family: 'Bagel Fat One', Figtree, sans-serif; font-weight: 400; margin: 0; line-height: 0.95; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

h2 { font-family: 'Bagel Fat One', Figtree, sans-serif; font-weight: 400; margin: 0; line-height: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { min-height: 46px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--deep); font-weight: 900; transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease; }
.chip[aria-checked='true'] { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.adult { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; color: #fff; font-weight: 800; }
.adult input { width: 24px; height: 24px; accent-color: var(--gum); }
.btn { appearance: none; border: 0; min-height: 56px; padding: 0 28px; border-radius: 999px; background: var(--sun); color: var(--ink); font-weight: 900; font-size: 18px; box-shadow: 0 4px 0 #000; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }
.btn.ghost { background: transparent; color: #fff; border: 2px solid var(--line); box-shadow: none; }
.btn:disabled { opacity: 0.45; }
.rules { color: var(--muted); padding-left: 20px; margin: 18px 0 0; display: grid; gap: 6px; }

/* The play area: the whole screen takes touches. */
#play { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: radial-gradient(circle farthest-corner at 50% 50%, #1A0F3A, #0D0720); }
.bar { position: absolute; z-index: 2; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 12px) 12px 0; transition: opacity 0.4s ease; }
body.busy .bar { opacity: 0; pointer-events: none; }
body.in-app .x { display: none; }
body.in-app .bar { padding-right: 72px; }
.pill { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; min-width: 0; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: rgba(28, 18, 56, 0.85); font-weight: 900; font-size: 16px; max-width: 100%; }
.pill__k { font-family: 'Bagel Fat One', sans-serif; font-weight: 400; color: var(--sun); font-size: 17px; }
#mode-label { overflow: hidden; text-overflow: ellipsis; }
.x { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: rgba(13, 7, 32, 0.6); font-size: 20px; font-weight: 900; color: #fff; text-decoration: none; }
.cue { position: absolute; left: 16px; right: 16px; top: calc(env(safe-area-inset-top) + 84px); text-align: center; pointer-events: none; }
.hint { margin: 0; font-family: 'Bagel Fat One', sans-serif; font-size: clamp(30px, 9vw, 52px); line-height: 1.05; color: #fff; transition: opacity 0.4s ease, color 0.4s ease; }
.sub { margin: 10px 0 0; color: var(--muted); font-size: 17px; transition: opacity 0.4s ease; }

/* The card sheet rises from the bottom. */
.sheet { position: fixed; inset: auto 0 0 0; z-index: 5; display: flex; justify-content: center; padding: 0 12px calc(env(safe-area-inset-bottom) + 12px); animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
/* Never taller than the screen: a long card (a timed dare on a phone held sideways) scrolls inside itself instead of
   running off the top where it can't be reached. */
.sheet__in { max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px); overflow-y: auto; overscroll-behavior: contain; width: 100%; max-width: 560px; background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 22px 20px 20px; box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.5); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.who { margin: 0 0 14px; font-family: 'Bagel Fat One', sans-serif; font-size: clamp(30px, 9vw, 46px); line-height: 1; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.big { min-height: 76px; font-size: 22px; }
.btn.truth { background: var(--sky); }
.btn.dare { background: var(--gum); color: #fff; }
.kind { margin: 0; color: var(--lilac); font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; font-size: 13px; }
.text { margin: 8px 0 18px; font-size: clamp(20px, 5.4vw, 26px); line-height: 1.3; font-weight: 800; }
.link { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--sun); font-weight: 900; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.again { margin-top: 12px; }
.btn.wide { width: 100%; }
.btn.small { min-height: 46px; padding: 0 20px; font-size: 16px; }
.who-sub { margin: -6px 0 14px; color: var(--muted); font-size: 18px; }
.sheet__title { font-size: clamp(28px, 8vw, 38px); color: var(--sun); margin-bottom: 14px; }
.scroll { max-height: calc(100dvh - env(safe-area-inset-top) - 40px); overflow-y: auto; overscroll-behavior: contain; }
.modes { display: grid; gap: 8px; }
.mode { text-align: left; display: grid; gap: 2px; padding: 12px 16px; min-height: 60px; border-radius: 18px; border: 2px solid var(--line); background: var(--deep); transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease; }
.mode b { font-size: 18px; }
.mode span { color: var(--muted); font-weight: 700; font-size: 14px; }
.mode[aria-checked='true'] { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.mode[aria-checked='true'] span { color: rgba(26, 16, 51, 0.75); }
.opt { margin-top: 18px; }
.legend { font-weight: 900; color: var(--lilac); text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; margin: 0 0 8px; }
.note { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.house { margin-top: 12px; border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; }
.house summary { cursor: pointer; font-weight: 900; min-height: 36px; display: flex; align-items: center; gap: 8px; }
.house__form { display: grid; gap: 8px; margin-bottom: 8px; }
.house__form input { min-height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--night); color: #fff; padding: 0 14px; font: 700 16px Figtree, system-ui, sans-serif; }
.house__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.house__list li { display: flex; gap: 8px; align-items: center; background: var(--deep); border-radius: 12px; padding: 8px 8px 8px 12px; font-weight: 700; }
.house__list li span { flex: 1; }
.house__list li b { color: var(--lilac); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.house__list button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
#settings .rules { font-size: 14px; }
#settings-done { margin-top: 18px; }
#list { display: grid; gap: 8px; margin-bottom: 4px; }
#list .row { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 18px; }
#list .dot { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: 0 0 14px currentColor; }
#list .team { font-family: 'Bagel Fat One', sans-serif; font-weight: 400; font-size: 24px; margin: 6px 0 0; }

/* The dare timer: big, clear digits. Calm: only the colour eases in the last 3 seconds, nothing bounces. */
.timer { margin: -4px 0 16px; text-align: center; }
.timer__face { margin: 0; font-family: 'Bagel Fat One', sans-serif; font-size: clamp(72px, 26vw, 120px); line-height: 1; color: #fff; font-variant-numeric: tabular-nums; transition: color 0.4s ease; }
.timer__face:empty { display: none; }
.timer.last .timer__face { color: var(--gum); }
.timer.up .timer__face { color: var(--sun); }
.timer__say { margin: 4px 0 10px; color: var(--muted); font-weight: 900; min-height: 1.45em; }
.timer__say:empty { display: none; }
.timer__go { background: var(--mint); }
.timer.running .timer__go { background: transparent; color: #fff; border: 2px solid var(--line); box-shadow: none; }

/* The night recap. */
.recap { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 10px 0 16px; align-items: baseline; }
.recap dt { color: var(--lilac); font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; }
.recap dd { margin: 0; font-weight: 900; font-size: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.recap dd .none { color: var(--muted); font-weight: 700; font-size: 16px; }
.recap .tag { display: inline-flex; align-items: center; gap: 6px; }
.recap .dot, .recap__table .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.recap__table { display: grid; grid-template-columns: 1fr repeat(4, 3.2em); gap: 6px 4px; margin-bottom: 16px; font-weight: 800; font-size: 15px; }
.recap__table > * { text-align: center; }
.recap__table .h { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; }
.recap__table .left { text-align: left; }
.recap__table .pl { margin: 0; display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; }
.recap__table .live { color: var(--lilac); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
#recap-new { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
