/* =====================================================================
   iParkar Live HSE Quiz — styles from the iParkar design system
   (HSE Academy: paper canvas, white hairline cards, Inter + Source Serif 4,
   midnight-and-marigold iP mark, one action-blue button per screen,
   flat fills, no gradients, shadows only on the nav bar).
   Every screen: presenter welcome, lobby, question, reveal, podium and
   the participant phone pages.
   ===================================================================== */

:root {
  /* Brand */
  --midnight: #02093a;
  --marigold: #ffb110;
  --action-blue: #0075de;
  --action-blue-hover: #005fb8;
  --coral: #f64932;
  --vermillion: #e32d14;
  --sky-tint: #e6f3fe;
  --sky-wash: #62aef0;
  --saffron: #e89d01;
  --mocha: #b18164;
  --peach: #f6d5b8;
  /* Surfaces & ink */
  --paper: #f6f5f4;
  --white: #ffffff;
  --ink: #000000;
  --ink-95: rgba(0,0,0,.95);
  --ink-90: rgba(0,0,0,.9);
  --ink-54: rgba(0,0,0,.54);
  --ink-20: rgba(0,0,0,.2);
  --graphite: #615d59;
  --slate: #696969;
  --stone: #757575;
  --hairline: rgba(0,0,0,.08);
  /* Answer colours (A–D): distinct in lightness, paired with shapes */
  --optA: var(--coral);       --onA: var(--ink);
  --optB: var(--action-blue); --onB: var(--white);
  --optC: var(--marigold);    --onC: var(--ink);
  --optD: var(--midnight);    --onD: var(--white);
  /* Type */
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  /* Shape */
  --r-small: 4px;
  --r-button: 8px;
  --r-card: 12px;
  --r-pill: 9999px;
  --shadow-nav: 0 .7px 1.462px 0 rgba(0,0,0,.015), 0 3px 9px 0 rgba(0,0,0,.03);
  --ease: 200ms ease;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--paper); font-feature-settings: "lnum"; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--action-blue); }
.hidden { display: none !important; }
.muted { color: var(--graphite); }
.small { font-size: 14px; }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--midnight); outline-offset: 2px; }

/* ---------- Cards ---------- */
.card, .wcard { background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-card); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 24px; background: var(--white); box-shadow: var(--shadow-nav);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; min-width: 0; }
.brand .logo { width: 36px; height: 36px; display: block; flex: 0 0 auto; }
.wordmark { font-weight: 700; font-size: 17px; letter-spacing: -0.2px; }
.wordmark .product { font-weight: 500; color: var(--ink-95); margin-left: 4px; }
.role { font-size: 12px; font-weight: 500; letter-spacing: .12px; color: var(--graphite); background: var(--paper); padding: 4px 10px; border-radius: var(--r-pill); }
.bar-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Chips, pills, buttons ---------- */
.chip, .pill-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--white); border: 1px solid var(--hairline); color: var(--graphite);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip b, .pill-tag b { color: var(--ink); font-weight: 600; }
.status-pill {
  display: inline-block; padding: 4px 12px; border-radius: var(--r-pill); background: var(--marigold); color: var(--ink);
  font-size: 12px; font-weight: 500; letter-spacing: .12px;
}

.btn, .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-button); padding: 11px 20px;
  font-size: 15px; font-weight: 500; line-height: 1.43; background: var(--action-blue); color: var(--white);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.btn:hover:not(:disabled), .pill.filled:hover:not(:disabled) { background: var(--action-blue-hover); }
.btn:disabled, .pill:disabled { background: transparent; border-color: var(--hairline); color: var(--stone); cursor: not-allowed; }
.btn.ghost, .pill.ghost { background: var(--sky-tint); color: var(--action-blue); }
.btn.ghost:hover, .pill.ghost:hover { background: #d4eafd; }
.pill.outline { background: transparent; color: var(--ink-90); border-color: var(--ink-90); border-radius: var(--r-small); padding: 6px 12px; font-size: 14px; }
.pill.outline:hover { background: var(--paper); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.wide, .pill.wide { width: 100%; }
.pill.filled { padding: 13px 20px; font-size: 16px; }

.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--action-blue); display: inline-block; }
.conn.off { background: var(--coral); }

.wrap { max-width: 1440px; margin: 0 auto; padding: 32px 24px; }

/* =====================================================================
   Presenter — welcome / setup
   ===================================================================== */
.setup { display: flex; flex-direction: column; min-height: calc(100vh - 64px); }
.welcome-hero { text-align: center; padding: 72px 24px 44px; max-width: 1040px; margin: 0 auto; }
.eyebrow { font-size: 20px; font-weight: 500; line-height: 1; color: var(--graphite); margin-bottom: 20px; }
.welcome-hero h1 { font-size: clamp(48px, 7.4vw, 96px); font-weight: 700; line-height: 1.08; letter-spacing: -0.048em; margin: 0 0 6px; }
/* One highlight pill per hero line: "Live", with the heartbeat trace under it */
.hl {
  position: relative; display: inline-block; background: var(--marigold); color: var(--ink);
  padding: 0 .26em .04em; border-radius: var(--r-pill); line-height: 1.08;
}
.hl .ecg { position: absolute; left: 6%; right: 6%; bottom: -.3em; width: 88%; height: .26em; overflow: visible; }
.hl .ecg path {
  fill: none; stroke: var(--vermillion); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; animation: ecgTrace 2.6s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes ecgTrace { 0% { stroke-dashoffset: 100; opacity: 1; } 55%, 80% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.lead { font-family: var(--serif); font-size: 18px; line-height: 1.56; color: var(--graphite); font-weight: 400; }
.welcome-hero .lead { max-width: 640px; margin: 34px auto 28px; font-size: 20px; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.welcome-body { flex: 1; padding: 8px 24px 80px; }
.setup-grid { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.wcard { padding: 24px; }
.wcard h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; line-height: 1.27; letter-spacing: -0.242px; }
.step-lbl { font-size: 12px; font-weight: 500; letter-spacing: .12px; color: var(--graphite); margin-bottom: 8px; }
.wcard .sub { color: var(--slate); font-size: 14px; }
.wcard .sub b { color: var(--ink); font-weight: 600; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-actions { display: flex; gap: 8px; }

/* Topic tiles */
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.topic {
  position: relative; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-button); cursor: pointer; user-select: none;
  background: var(--white); border: 1px solid var(--hairline); transition: background var(--ease), border-color var(--ease);
}
.topic:hover { background: var(--paper); }
.topic input { position: absolute; opacity: 0; pointer-events: none; }
.topic .tick {
  width: 20px; height: 20px; border-radius: var(--r-small); border: 1.5px solid var(--stone); background: var(--white);
  display: grid; place-items: center; transition: background var(--ease), border-color var(--ease);
}
.topic.on { border-color: var(--midnight); }
.topic.on .tick { background: var(--midnight); border-color: var(--midnight); }
.topic.on .tick::after { content: ""; width: 5px; height: 10px; border: solid var(--marigold); border-width: 0 2.2px 2.2px 0; transform: translateY(-1px) rotate(45deg); }
.topic:has(input:focus-visible), .level:has(input:focus-visible) { outline: 2px solid var(--midnight); outline-offset: 2px; }
.topic .tname { font-weight: 500; font-size: 14px; line-height: 1.35; color: var(--ink-95); }
.topic .tname small { display: block; color: var(--slate); font-weight: 400; font-size: 12px; margin-bottom: 1px; }
.topic .tcount {
  min-width: 32px; text-align: center; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--paper); color: var(--graphite);
}
.topic.on .tcount { background: var(--marigold); color: var(--ink); }
.topic.none { opacity: .5; }

/* Difficulty */
.levels { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.level {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-button); cursor: pointer; background: var(--white);
  border: 1px solid var(--hairline); transition: background var(--ease), border-color var(--ease);
}
.level:hover { background: var(--paper); }
.level input { width: 16px; height: 16px; accent-color: var(--midnight); margin: 0; }
.level b { display: block; font-size: 15px; font-weight: 600; }
.level small { color: var(--slate); font-size: 13px; line-height: 1.35; }
.level em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--graphite); background: var(--paper); padding: 2px 8px; border-radius: var(--r-pill); }
.level:has(input:checked) { border-color: var(--midnight); }
.level:has(input:checked) em { background: var(--marigold); color: var(--ink); }

.pool { font-size: 14px; color: var(--slate); margin: 10px 0 16px; line-height: 1.7; }
.pool b { color: var(--ink); font-weight: 600; }
.pool b.big { font-size: 40px; font-weight: 700; letter-spacing: -1.4px; color: var(--ink); vertical-align: -5px; }
.pool-warn { font-size: 13px; line-height: 1.45; color: var(--ink); background: var(--peach); border-radius: var(--r-button); padding: 10px 12px; margin: -4px 0 16px; }

.welcome-foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px 24px;
  background: var(--midnight); color: var(--white); padding: 28px max(24px, calc((100vw - 1240px) / 2));
}
.foot-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.foot-brand img { display: block; }
.foot-tag { font-family: var(--serif); font-size: 18px; color: var(--marigold); }
.foot-link { justify-self: end; color: var(--white); font-size: 14px; font-weight: 500; text-decoration: none; }
.foot-link:hover { text-decoration: underline; }
.welcome-foot :focus-visible { outline-color: var(--white); }

/* =====================================================================
   Presenter — lobby
   ===================================================================== */
.lobby { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 16px; align-items: start; }
.joinbox { position: relative; padding: 32px 28px; text-align: center; background: var(--midnight); border: 0; color: var(--white); }
.joinbox h2 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.242px; }
.joinbox .muted { color: rgba(255,255,255,.78); font-size: 14px; }
#qr { background: var(--white); border-radius: var(--r-card); padding: 16px; display: inline-block; margin: 18px 0; }
#qr img, #qr svg { display: block; width: min(300px, 66vw); height: auto; image-rendering: pixelated; }
.code { font-size: 54px; font-weight: 700; letter-spacing: 10px; color: var(--marigold); margin: 4px 0; padding-left: 10px; }
.url { font-size: 13px; color: rgba(255,255,255,.78); word-break: break-all; }
.joinbox :focus-visible { outline-color: var(--white); }
.players { padding: 24px; min-height: 420px; }
.players-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.players-head h2 { margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -1.2px; line-height: 1.2; }
.cfgline { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.namegrid { display: flex; flex-wrap: wrap; gap: 8px; }
.name-tag {
  padding: 8px 10px 8px 14px; border-radius: var(--r-button); font-weight: 500; font-size: 16px;
  background: var(--paper); border: 1px solid var(--hairline); animation: pop .2s ease;
}
.name-tag.off { opacity: .45; }
.name-tag button { background: none; border: 0; color: var(--stone); margin-left: 6px; padding: 0 2px; font-size: 13px; }
.name-tag button:hover { color: var(--vermillion); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.empty { color: var(--graphite); font-family: var(--serif); font-size: 18px; padding: 56px 0; text-align: center; }

/* Share button (top-right of the QR card) */
.share-wrap { position: absolute; top: 14px; right: 14px; z-index: 3; text-align: left; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--r-button); font-size: 14px; font-weight: 500; color: var(--white); background: rgba(255,255,255,.08);
  transition: background var(--ease);
}
.share-btn:hover { background: rgba(255,255,255,.18); }
.share-btn svg { margin-top: -2px; }
.share-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px; padding: 6px; display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-card); box-shadow: var(--shadow-nav), 0 12px 28px -12px rgba(0,0,0,.25);
  animation: menuIn .16s ease-out;
}
.share-menu button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: var(--r-button); font-size: 14px; font-weight: 500; color: var(--ink-95); transition: background var(--ease); }
.share-menu button:hover { background: var(--sky-tint); }
.share-menu :focus-visible { outline-color: var(--midnight); }
.share-sep { height: 1px; background: var(--hairline); margin: 4px 8px; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Presenter — question & reveal
   ===================================================================== */
.qlayout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; }
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.qtext {
  font-size: clamp(26px, 2.8vw, 42px); font-weight: 600; line-height: 1.2; letter-spacing: -0.03em;
  margin: 0 0 20px; padding: 28px 32px; background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-card);
}
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opt, .pbtn {
  position: relative; display: flex; align-items: center; gap: 16px; text-align: left; border: 0;
  transition: opacity .25s ease, transform .25s ease, box-shadow .25s ease;
}
.opt { min-height: 108px; padding: 20px 22px; border-radius: var(--r-card); font-size: clamp(18px, 1.6vw, 24px); font-weight: 600; letter-spacing: -0.015em; }
.opt .shape, .pbtn .shape {
  flex: 0 0 auto; display: grid; place-items: center; border-radius: var(--r-button); font-weight: 700; line-height: 1;
  background: rgba(255,255,255,.22);
}
.opt .shape { width: 50px; height: 50px; font-size: 20px; }
.opt .shape small { font-size: 11px; display: block; margin-top: 2px; }
.opt[data-i="0"], .pbtn[data-i="0"] { background: var(--optA); color: var(--onA); }
.opt[data-i="1"], .pbtn[data-i="1"] { background: var(--optB); color: var(--onB); }
.opt[data-i="2"], .pbtn[data-i="2"] { background: var(--optC); color: var(--onC); }
.opt[data-i="3"], .pbtn[data-i="3"] { background: var(--optD); color: var(--onD); }
.opt[data-i="0"] .shape, .opt[data-i="2"] .shape, .pbtn[data-i="0"] .shape, .pbtn[data-i="2"] .shape { background: rgba(0,0,0,.1); }
.opt .count { margin-left: auto; font-weight: 600; font-size: 18px; background: rgba(0,0,0,.14); padding: 3px 12px; border-radius: var(--r-pill); }
.reveal .opt.wrong { opacity: .25; }
.reveal .opt.right { box-shadow: 0 0 0 4px var(--paper), 0 0 0 8px var(--midnight); }
.opt .tick { position: absolute; top: -10px; right: -10px; width: 34px; height: 34px; border-radius: 50%; background: var(--marigold); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 18px; box-shadow: 0 0 0 3px var(--paper); }

.timer { position: relative; width: 104px; height: 104px; flex: 0 0 auto; border-radius: 50%; background: var(--white); border: 1px solid var(--hairline); }
.timer svg { transform: rotate(-90deg); display: block; margin: -1px; }
.timer .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 700; letter-spacing: -1px; }
.timer.low .num { color: var(--vermillion); }
.timebar { height: 6px; background: var(--ink-20); border-radius: var(--r-pill); overflow: hidden; }
.timebar > div { height: 100%; background: var(--action-blue); width: 100%; border-radius: inherit; transition: width .2s linear; }
.timebar.low > div { background: var(--vermillion); }

.source { margin-top: 16px; padding: 16px 20px; background: var(--sky-tint); border-radius: var(--r-card); font-size: 16px; line-height: 1.5; color: var(--ink-95); }
.source b { color: var(--ink); font-weight: 700; }

.board { padding: 24px; }
.board h3 { margin: 0 0 2px; font-size: 22px; font-weight: 700; letter-spacing: -0.242px; }
.board .sub { color: var(--slate); font-size: 14px; margin-bottom: 14px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
.row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--r-button); background: var(--paper);
}
.row .rk { font-weight: 600; color: var(--graphite); text-align: center; font-size: 14px; }
.row .nm { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sc { font-weight: 700; }
.row .delta { font-size: 12px; font-weight: 500; margin-left: 6px; color: var(--action-blue); }
.row .delta.zero { color: var(--stone); }
.row.answered .nm::after { content: " ✓"; color: var(--action-blue); }
.row:nth-child(1) { background: var(--marigold); } .row:nth-child(1) .rk, .row:nth-child(1) .delta, .row:nth-child(1) .muted { color: var(--ink); }
.progress-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.progress-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-20); }
.progress-dots i.done { background: var(--midnight); }
.progress-dots i.now { background: var(--marigold); box-shadow: 0 0 0 2px var(--midnight); }

.controls { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* =====================================================================
   Presenter — final / podium
   ===================================================================== */
.final { text-align: center; padding-top: 48px; }
.final h1 { font-size: clamp(40px, 5vw, 72px); font-weight: 500; letter-spacing: -0.028em; line-height: 1.21; margin: 16px 0 6px; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(160px, 260px)); justify-content: center; align-items: end; gap: 12px; margin: 36px auto 28px; }
.step {
  border-radius: var(--r-card) var(--r-card) 0 0; padding: 20px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: rise .7s ease both; color: var(--ink);
}
.step .medal { font-size: 12px; font-weight: 500; letter-spacing: .12px; padding: 4px 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.7); }
.step .who { font-weight: 700; font-size: clamp(18px, 1.8vw, 26px); letter-spacing: -0.3px; word-break: break-word; margin-top: 4px; }
.step .pts { font-size: 14px; }
.step .place { font-size: 72px; font-weight: 700; letter-spacing: -2px; opacity: .22; margin-top: auto; line-height: 1; }
.step.p1 { height: 360px; background: var(--marigold); animation-delay: .9s; }
.step.p2 { height: 300px; background: var(--sky-wash); animation-delay: .5s; }
.step.p3 { height: 260px; background: var(--mocha); animation-delay: .1s; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.fulltable { max-width: 760px; margin: 28px auto 0; padding: 24px; text-align: left; }
.fulltable h3 { margin: 0 0 12px; font-size: 22px; font-weight: 700; letter-spacing: -0.242px; }

/* =====================================================================
   Participant (phone)
   ===================================================================== */
.phone { max-width: 560px; margin: 0 auto; padding: 0 16px 32px; min-height: 100vh; display: flex; flex-direction: column; }
.phone .top {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin: 0 -16px 20px; padding: 12px 16px; background: var(--white); box-shadow: var(--shadow-nav);
}
.phone .brand .logo { width: 30px; height: 30px; }
.phone .wordmark { font-size: 15px; }
.phone h1 { font-size: 34px; font-weight: 700; letter-spacing: -1.1px; line-height: 1.12; margin: 16px 0 6px; }
.phone .lead { margin: 0 0 18px; }
#joinForm { padding: 24px; background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-card); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.field label { font-weight: 500; font-size: 14px; color: var(--ink-95); }
.field input {
  font: inherit; font-size: 18px; padding: 12px 14px; border-radius: var(--r-button); border: 1px solid var(--ink-20); outline: none;
  background: var(--white); color: var(--ink); transition: border-color var(--ease);
}
.field input::placeholder { color: rgba(0,0,0,.4); }
.field input:focus { border-color: var(--midnight); box-shadow: 0 0 0 1px var(--midnight); }
.phone .btn { width: 100%; padding: 13px; font-size: 16px; }
.big-pill { font-size: 14px; padding: 6px 16px; margin-top: 28px; }
.phone .center .lead { margin: 4px auto 18px; max-width: 420px; }
.pq { font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -0.4px; margin: 14px 0 14px; padding: 18px 20px; background: var(--white); border: 1px solid var(--hairline); border-radius: var(--r-card); }
.pbtns { display: grid; gap: 8px; }
.pbtn { width: 100%; min-height: 68px; padding: 12px 14px; border-radius: var(--r-card); font-weight: 600; font-size: 17px; letter-spacing: -0.2px; }
.pbtn .shape { width: 40px; height: 40px; }
.pbtns.locked .pbtn { opacity: .3; }
.pbtns.locked .pbtn.mine { opacity: 1; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--midnight); }
.pbtns.revealed .pbtn.right { opacity: 1; box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--marigold); }
.result { border-radius: var(--r-card); padding: 16px; text-align: center; margin: 14px 0 10px; font-size: 18px; font-weight: 600; background: var(--white); border: 1px solid var(--hairline); }
.result .rp { display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: .12px; padding: 3px 10px; border-radius: var(--r-pill); margin-right: 10px; vertical-align: 2px; }
.result.ok { background: var(--sky-tint); border-color: transparent; }
.result.ok .rp { background: var(--action-blue); color: var(--white); }
.result.no { background: var(--peach); border-color: transparent; }
.result.no .rp { background: var(--ink); color: var(--white); }
.result.none { color: var(--graphite); font-weight: 500; }
.pref { margin: 0 0 10px; padding: 14px 16px; border-radius: var(--r-card); font-size: 15px; line-height: 1.5; color: var(--graphite); background: var(--white); border: 1px solid var(--hairline); }
.pref .lbl { display: inline-block; font-size: 12px; font-weight: 500; letter-spacing: .12px; color: var(--ink); background: var(--marigold); padding: 2px 10px; border-radius: var(--r-pill); margin-bottom: 8px; }
.pref b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.stat { display: flex; justify-content: space-around; gap: 8px; margin: 14px 0; }
.stat div { flex: 1; text-align: center; padding: 14px 8px; border-radius: var(--r-card); background: var(--white); border: 1px solid var(--hairline); color: var(--slate); font-size: 13px; }
.stat b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.8px; color: var(--ink); }
.foot { margin-top: auto; padding-top: 24px; text-align: center; font-size: 13px; color: var(--graphite); }
.foot-mini { text-align: center; font-size: 12px; color: var(--graphite); padding-top: 6px; }
.foot-mini a { color: var(--graphite); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 20; max-width: 92vw;
  padding: 12px 18px; border-radius: var(--r-button); color: var(--white); font-size: 14px; background: var(--midnight);
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1000px) {
  .lobby, .qlayout, .setup-grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .options { grid-template-columns: 1fr; }
  .podium { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .step.p1 { height: 280px; } .step.p2 { height: 235px; } .step.p3 { height: 200px; }
  .step .place { font-size: 44px; }
  .welcome-foot { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .foot-link { justify-self: center; }
}
@media (max-width: 600px) {
  .wrap { padding: 16px; }
  .topbar { padding: 0 16px; height: 56px; }
  .brand .logo { width: 30px; height: 30px; }
  .wordmark { font-size: 15px; }
  .role, #fsBtn, #roomChip { display: none !important; }
  .welcome-hero { padding: 40px 16px 28px; }
  .eyebrow { font-size: 16px; margin-bottom: 14px; }
  .welcome-hero .lead { font-size: 17px; margin: 28px auto 22px; }
  .welcome-body { padding: 4px 16px 48px; }
  .wcard { padding: 18px; }
  .topics { grid-template-columns: 1fr; }
  .code { font-size: 40px; letter-spacing: 6px; }
  .joinbox { padding-top: 60px; }
  .players-head h2 { font-size: 28px; letter-spacing: -.6px; }
  .qtext { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hl .ecg path { stroke-dashoffset: 0; }
}
