/* « Seul au monde ? » — night purple, one yellow accent, big tap targets. A step fits a phone with no scrolling (390×760, 375×812). */
:root {
  --bg: #1a1033; --bg2: #2a1b4d; --card: #34245e; --line: rgba(255, 255, 255, 0.14);
  --ink: #ffffff; --muted: #b9acd9; --gold: #ffd23f; --cyan: #5ee7df; --pink: #ff5d8f; --green: #66e08a; --red: #ff6b6b;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; overscroll-behavior: none; }
body { font: 16px/1.35 -apple-system, "SF Pro Rounded", system-ui, sans-serif; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#app { height: 100%; position: relative; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
h1, h2, h3, p, ol, ul { margin: 0; }

.screen { height: 100%; overflow-y: auto; padding: calc(10px + var(--safe-top)) 16px calc(14px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; background: radial-gradient(120% 70% at 50% 0%, #3b2570 0%, var(--bg) 62%); }
.boot { align-items: center; justify-content: center; }
.hint { color: var(--muted); font-size: 0.9rem; text-align: center; }
.notice { background: rgba(255, 107, 107, 0.18); border: 1px solid var(--red); border-radius: 12px; padding: 10px 12px; text-align: center; }
.wait { text-align: center; color: var(--muted); padding: 12px 0; }

.btn { min-height: 52px; border-radius: 16px; padding: 12px 18px; font-weight: 700; font-size: 1.05rem; width: 100%; }
.btn.primary { background: var(--gold); color: #2a1b00; box-shadow: 0 4px 0 #b88f00; }
.btn.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #b88f00; }
.btn.primary:disabled { background: #6f5f93; color: #d8cfee; box-shadow: none; }
.btn.secondary { background: var(--card); border: 1px solid var(--line); }
.btn.link { background: transparent; color: var(--muted); min-height: 44px; }
.btn.joker { background: linear-gradient(135deg, #ff5d8f, #ff9a3c); color: #2a0b12; display: flex; flex-direction: column; gap: 2px; min-height: 58px; box-shadow: 0 4px 0 #a33a50; }
.btn.joker small { font-weight: 600; font-size: 0.74rem; opacity: 0.85; }

.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 40px; }
.bar .logo { font-weight: 800; letter-spacing: 0.02em; }
.bar-end { justify-self: end; display: flex; gap: 8px; align-items: center; }
.close { background: transparent; color: var(--muted); padding: 8px 4px; }
.conn-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.conn-dot.on { background: var(--green); }
.conn-strip { position: fixed; top: var(--safe-top); left: 0; right: 0; z-index: 5; background: var(--red); color: #2a0b0b; text-align: center; padding: 4px; font-size: 0.85rem; font-weight: 700; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(24px + var(--safe-bottom)); z-index: 6; background: #fff; color: #1a1033; border-radius: 14px; padding: 12px 14px; text-align: center; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }

/* home */
.home { justify-content: center; gap: 22px; }
.brand { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.brand-art { font-size: 4.2rem; line-height: 1; }
.brand h1 { font-size: 2.1rem; font-weight: 900; letter-spacing: -0.01em; }
.brand p { color: var(--muted); }
.home-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.field input { font: inherit; font-size: 1.1rem; color: var(--ink); background: var(--bg2); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; user-select: text; -webkit-user-select: text; }
.field input:focus { border-color: var(--gold); }

/* lobby + chips */
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 8px; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.chip.me { border-color: var(--gold); }
.chip.away { opacity: 0.5; }
.chip small { color: var(--muted); font-weight: 600; font-size: 0.72rem; }
.chip small.ok { color: var(--green); }
.chip .av { font-size: 1.25rem; }
.lobby.host { align-items: stretch; }
.qr { align-self: center; background: #fff; border-radius: 18px; padding: 12px; width: min(62vw, 250px); }
.qr svg { width: 100%; height: auto; display: block; }
.lobby-hero { text-align: center; padding-top: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.big-emo { font-size: 3.6rem; }

.robots { display: flex; align-items: center; justify-content: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; font-weight: 700; }
.robots b { min-width: 1.5ch; text-align: center; font-size: 1.2rem; }
.step { width: 44px; height: 44px; border-radius: 50%; background: var(--bg2); border: 2px solid var(--line); font-size: 1.4rem; font-weight: 800; line-height: 1; }
.step:disabled { opacity: 0.35; }

/* briefing */
.briefing h2 { text-align: center; font-size: 1.4rem; }
.rules { padding-left: 22px; display: flex; flex-direction: column; gap: 10px; color: #efe8ff; font-size: 0.98rem; }
.rules b { color: var(--gold); }
.briefing .btn { margin-top: auto; }

/* round header */
.round-head { display: flex; flex-direction: column; gap: 6px; }
.round-line { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.round-no { font-weight: 800; font-size: 1.05rem; }
.round-no small { color: var(--muted); font-weight: 700; }
.badge { font-size: 0.72rem; font-weight: 800; border-radius: 999px; padding: 3px 9px; }
.badge.stake { background: var(--gold); color: #2a1b00; }
.badge.fog { background: rgba(255, 255, 255, 0.18); }
.round-line .conn { margin-left: auto; }
.secs { min-width: 2ch; text-align: right; font-weight: 900; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.timebar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.timebar i { display: block; height: 100%; background: var(--cyan); transform-origin: left; }
.timebar.urgent i { background: var(--red); }
.topline { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); }
.standing { font-weight: 700; color: var(--ink); }
.standing.fogged { color: var(--muted); }

/* choose */
.choose { gap: 8px; }
.question { font-size: 1.35rem; line-height: 1.2; text-align: center; padding: 4px 0; font-weight: 800; }
.question.small { font-size: 1rem; font-weight: 700; color: #efe8ff; }
.joker-banner { text-align: center; font-weight: 700; color: var(--pink); background: rgba(255, 93, 143, 0.14); border-radius: 12px; padding: 6px 10px; font-size: 0.9rem; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choices.n5, .choices.n7, .choices.n9 { }
.choice { background: var(--card); border: 2px solid var(--line); border-radius: 14px; min-height: 52px; padding: 8px 10px; font-weight: 700; font-size: 0.98rem; line-height: 1.15; display: flex; align-items: center; justify-content: center; text-align: center; overflow-wrap: anywhere; }
.choice.picked { border-color: var(--gold); background: #4a3480; box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.35); }
.choice:disabled:not(.picked) { opacity: 0.45; }
.choices.n9 .choice, .choices.n10 .choice { min-height: 46px; font-size: 0.92rem; }
.dock { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.locked { text-align: center; background: rgba(102, 224, 138, 0.14); border: 1px solid var(--green); border-radius: 14px; padding: 12px; }
.joker-on { text-align: center; color: var(--pink); font-size: 0.85rem; font-weight: 700; }

/* reveal */
.reveal { gap: 8px; }
.verdict { text-align: center; font-weight: 900; font-size: 1.5rem; padding: 4px 0; }
.verdict.win { color: var(--gold); }
.verdict.lose { color: var(--red); }
.verdict.zero { color: var(--muted); }
.verdict.fog { font-size: 1rem; color: var(--muted); }
.groups { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.group { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label pts" "who who"; gap: 2px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.group.alone { border-color: var(--gold); }
.group.mine { box-shadow: inset 0 0 0 2px rgba(94, 231, 223, 0.55); }
.g-label { grid-area: label; font-weight: 800; }
.g-points { grid-area: pts; font-weight: 800; color: var(--muted); }
.group.alone .g-points { color: var(--gold); }
.g-who { grid-area: who; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.85rem; color: #e6dcff; }
.g-who .me { color: var(--cyan); font-weight: 700; }
.group.none { opacity: 0.7; }
.board { background: rgba(0, 0, 0, 0.18); border-radius: 14px; padding: 8px 10px; }
.board h3 { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.board ol { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.board li { display: flex; justify-content: space-between; font-size: 0.9rem; }
.board li.me { color: var(--cyan); font-weight: 700; }
.board.foggy { opacity: 0.6; }
.next { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: auto; }
.next b { color: var(--ink); }

/* finished */
.end-title { text-align: center; font-size: 1.45rem; font-weight: 900; padding-top: 6px; }
.podium { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.podium li { display: grid; grid-template-columns: 2.4ch 1fr auto; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; opacity: 0; transform: translateY(14px); animation: rise 0.5s ease forwards; }
.podium li.first { border-color: var(--gold); background: #4a3480; }
.podium li.me .nm { color: var(--cyan); }
.rk { font-size: 1.3rem; text-align: center; }
.nm { font-weight: 700; }
.sc { text-align: right; display: flex; flex-direction: column; line-height: 1.1; }
.sc b { font-size: 1.15rem; }
.sc small { color: var(--muted); font-size: 0.7rem; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { .podium li { animation-duration: 0.01s; animation-delay: 0s !important; } }
@media (max-height: 700px) { .question { font-size: 1.15rem; } .choice { min-height: 44px; } .brand-art { font-size: 3rem; } }
