/* Half Past True: Apple-like, light by default, dark when the device asks for it. */
:root {
  --bg: #f5f5f7; --card: #ffffff; --card2: #f2f2f5; --text: #1d1d1f; --muted: #6e6e73; --line: rgba(0,0,0,.08);
  --blue: #0071e3; --blue2: #0077ed; --green: #1f9d55; --red: #e3263b; --gold: #b07d00; --purple: #5e5ce6;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.06); --r: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000; --card: #1c1c1e; --card2: #2c2c2e; --text: #f5f5f7; --muted: #98989d; --line: rgba(255,255,255,.1);
    --blue: #0a84ff; --blue2: #409cff; --green: #30d158; --red: #ff453a; --gold: #ffd60a; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.47 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
body { min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--blue); text-decoration: none; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; border-radius: 10px; z-index: 9; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 18px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; white-space: nowrap; flex: 0 0 auto; color: var(--text); font-weight: 600; font-size: 17px; }
.brand img { border-radius: 7px; } .brand em { font-style: normal; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 7px; }
.pills { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.pill { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill.final { background: linear-gradient(135deg, #ff9f0a, #ff375f); color: #fff; }
main { max-width: 560px; margin: 0 auto; padding: 18px 16px 24px; outline: none; }
.hall-foot { max-width: 560px; margin: 0 auto; padding: 4px 16px calc(36px + env(safe-area-inset-bottom)); text-align: center; }
.back-hall { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); color: var(--text); font-size: 15px; font-weight: 600; }
.back-hall span { font-size: 22px; line-height: 1; color: var(--blue); margin-top: -2px; }
@media (hover: hover) { .back-hall:hover { color: var(--blue); } }
.back-hall:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.tagline { font-size: 15px; font-weight: 600; color: var(--purple); margin: 10px 0 0; letter-spacing: -.01em; }
h1 { font-size: 34px; line-height: 1.12; letter-spacing: -.03em; margin: 14px 0 6px; font-weight: 700; }
h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 700; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 26px 4px 8px; }
p { margin: 6px 0; } .muted { color: var(--muted); } .small { font-size: 14px; } .center { text-align: center; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 18px; }
.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin: 12px 0; }
.card.tight { padding: 14px 16px; }
.btn { appearance: none; border: 0; border-radius: 99px; font: 600 17px/1 var(--font); padding: 15px 22px; background: var(--blue); color: #fff; cursor: pointer; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; transition: transform .08s, background .15s, opacity .15s; }
.btn:hover { background: var(--blue2); } .btn:active { transform: scale(.98); } .btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.ghost { background: var(--card2); color: var(--blue); } .btn.ghost:hover { background: color-mix(in srgb, var(--card2) 85%, var(--blue)); }
.btn.danger { background: var(--card2); color: var(--red); }
.btn.small { font-size: 15px; padding: 10px 16px; min-height: 40px; width: auto; }
.row { display: flex; gap: 10px; flex-wrap: wrap; } .row > .btn { flex: 1 1 140px; }
.stack > * + * { margin-top: 10px; }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 4px 6px; }
input[type=text], select { width: 100%; font: 17px var(--font); color: var(--text); background: var(--card2); border: 1px solid transparent; border-radius: 14px; padding: 13px 14px; outline: none; }
input[type=text]:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
.seg { display: flex; background: var(--card2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--text); font: 600 15px var(--font); padding: 9px 6px; border-radius: 9px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .seg button[aria-pressed=true] { background: #636366; } }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatars button { font-size: 24px; aspect-ratio: 1; border: 0; border-radius: 12px; background: var(--card2); cursor: pointer; padding: 0; }
.avatars button[aria-pressed=true] { outline: 3px solid var(--blue); outline-offset: -3px; background: color-mix(in srgb, var(--blue) 14%, var(--card2)); }
.players { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
.chip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; font-size: 12px; color: var(--muted); }
.chip .av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--card); box-shadow: var(--shadow); position: relative; border: 2px solid var(--c, transparent); }
.chip .nm { font-weight: 600; color: var(--text); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .st { font-size: 11px; } .chip.done .av::after { content: "✓"; position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 700; }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--purple); }
.kicker.final { background: linear-gradient(90deg, #ff9f0a, #ff375f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.question { font-size: 24px; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; margin: 8px 0 4px; }
.blank { display: inline-block; min-width: 80px; border-bottom: 3px solid var(--blue); color: var(--blue); text-align: center; padding: 0 4px; line-height: 1.1; }
.blank.truth { color: var(--green); border-color: var(--green); }
.blank.lie { color: var(--red); border-color: var(--red); text-decoration: line-through; text-decoration-thickness: 2px; }
.locked { text-align: center; padding: 34px 20px; }
.locked .lock { font-size: 44px; } .big { font-size: 56px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.clock { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.clock .big { font-size: 40px; } .clock.low .big { color: var(--red); }
.bar { height: 6px; background: var(--card2); border-radius: 99px; overflow: hidden; margin-top: 10px; } .bar > i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width 1s linear; }
.clock.low .bar > i { background: var(--red); }
.count { text-align: right; font-size: 13px; color: var(--muted); margin: 6px 4px 0; font-variant-numeric: tabular-nums; }
.err { color: var(--red); font-size: 15px; font-weight: 600; margin: 8px 4px 0; min-height: 1px; }
.options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.opt { appearance: none; text-align: left; width: 100%; border: 0; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); padding: 16px 18px; font: 600 19px/1.3 var(--font);
  color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; transition: transform .08s, box-shadow .15s; }
@media (hover: hover) { .opt:hover { box-shadow: 0 0 0 2px var(--blue), var(--shadow); } } .opt:active { transform: scale(.985); }
.opt[aria-pressed=true] { box-shadow: 0 0 0 3px var(--blue), var(--shadow); } .opt .chev { color: var(--muted); font-weight: 400; }
.opt.mine { opacity: .6; cursor: default; }
.waiting { background: var(--card2); border-radius: 16px; padding: 14px 16px; margin-top: 12px; font-size: 15px; }
.waiting .who { font-weight: 600; } .waiting .row { margin-top: 10px; align-items: center; }
.reveal { text-align: center; padding: 26px 20px; }
.reveal .ans { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 10px 0 4px; overflow-wrap: anywhere; }
.reveal .tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 99px; letter-spacing: .02em; }
.tag.lie { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.tag.truth { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.fell { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fell span { background: var(--card2); border-radius: 99px; padding: 4px 10px; font-size: 14px; font-weight: 600; }
.pts { color: var(--green); font-weight: 700; font-size: 17px; margin-top: 12px; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .dots i.on { background: var(--text); }
.board { list-style: none; margin: 0; padding: 0; } .board li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; } .board .rk { width: 22px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; } .board .av { font-size: 24px; }
.board .nm { flex: 1; font-weight: 600; } .board .sc { font-weight: 700; font-variant-numeric: tabular-nums; } .board .gain { color: var(--green); font-size: 13px; font-weight: 700; margin-left: 6px; }
.board li.win .nm::after { content: " 👑"; }
.gamelist .g { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); color: var(--text); margin: 10px 0; }
.gamelist .g .ic { font-size: 28px; } .gamelist .g .tx { flex: 1; min-width: 0; } .gamelist .g b { display: block; font-weight: 600; }
.gamelist .g .sub { font-size: 14px; color: var(--muted); } .gamelist .g .sub.turn { color: var(--blue); font-weight: 600; } .gamelist .g .chev { color: var(--muted); font-size: 22px; }
.invite { word-break: break-all; font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--card2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.howto { counter-reset: s; list-style: none; padding: 0; margin: 8px 0 0; } .howto li { counter-increment: s; display: flex; gap: 12px; padding: 8px 0; font-size: 15px; }
.howto li::before { content: counter(s); flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
details.host summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: 15px; padding: 6px 4px; list-style: none; } details.host summary::-webkit-details-marker { display: none; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: rgba(29,29,31,.92); color: #fff; padding: 11px 18px;
  border-radius: 14px; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; text-align: center; z-index: 20; }
#toast.on { opacity: 1; transform: translateX(-50%); }
.fade { animation: fade .28s ease; } @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } .bar > i { transition: none; } }
.footer { text-align: center; font-size: 13px; color: var(--muted); margin-top: 30px; }

@media (max-width: 420px) { .brand em { display: none; } .top { padding: 10px 14px; } }
