/* Layout: light civic interface — white header bar, soft grey page, white cards with hairline borders, green accent.
   Palette follows the agency's public site (brand green #659961, ink #101828, grey ramp). */
:root {
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --line: #e4e7ec;
  --line-2: #d5d7da;
  --ink: #101828;
  --ink-2: #414651;
  --muted: #667085;
  --brand: #659961;
  --brand-600: #54804f;
  --brand-800: #2d4a2a;
  --action: #4a7346;      /* white text 5.5:1 (WCAG AA) */
  --action-hover: #3d6339;
  --good-text: #027a48;
  --brand-50: #eef7ef;
  --brand-100: #dcefd9;
  --good: #039855;
  --good-50: #ecfdf3;
  --bad: #d92d20;
  --bad-50: #fef3f2;
  --warn: #dc6803;
  --warn-50: #fffaeb;
  --t0: #659961;
  --t1: #1f6fa0;
  --t2: #dc6803;
  --t3: #7a5af8;
  --display: "Roboto Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --body: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px -12px rgba(16, 24, 40, .18);
  /* aliases kept for inline styles in markup */
  --stage: var(--surface-2);
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --saffron: var(--brand);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--action); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; gap: 22px; padding-block: 0 28px; }

/* ---------- header ---------- */
.bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--r) var(--r); padding: 12px 16px; box-shadow: var(--shadow);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand img.org-logo { height: 40px; width: auto; display: block; }
.brand .brand-sep { width: 1px; align-self: stretch; background: var(--line); }
.brand .doc { font-family: var(--body); font-weight: 600; font-size: 11px; color: #fff; background: var(--action); border-radius: 6px; padding: 2px 8px; letter-spacing: .06em; }
.brand .logo { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 26px; height: 26px; flex: none; }
.brand .logo i { border-radius: 5px; }
.brand .logo i:nth-child(1) { background: var(--brand); }
.brand .logo i:nth-child(2) { background: var(--brand-100); }
.brand .logo i:nth-child(3) { background: var(--brand-800); }
.brand .logo i:nth-child(4) { background: var(--brand); opacity: .55; }
.bar .spacer { flex: 1; }
.chip { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--brand-800); }
.chip b { color: var(--brand-800); }
.icon-btn { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.lang-sw { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.lang-sw button { border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 5px 10px; min-height: 34px; min-width: 40px; font-weight: 600; font-size: 13px; }
.lang-sw button[aria-pressed="true"] { background: var(--surface); color: var(--brand-800); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }

.org-emblem { height: 44px; width: 44px; flex: none; display: block; }
.org-txt { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.org-txt small { font-family: var(--body); font-weight: 500; font-size: 10.5px; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
.org-txt b { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--brand-800); text-transform: uppercase; letter-spacing: .01em; }
.site-nm { font-family: var(--display); font-weight: 600; color: var(--action); }
@media (max-width: 760px) { .org-txt small { display: none; } .org-txt b { font-size: 14px; } .org-emblem { height: 36px; width: 36px; } .brand .brand-sep, .brand .site-nm { display: none; } }

/* ---------- generic ---------- */
.screen { flex: 1; display: flex; flex-direction: column; gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(18px, 3vw, 30px); box-shadow: var(--shadow); }
.btn {
  border: 1px solid transparent; border-radius: 10px; padding: 13px 24px; font-weight: 600; font-size: 16px;
  background: var(--action); color: #fff; display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--action-hover); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); box-shadow: var(--shadow); }
.btn.ghost:hover { background: var(--surface-2); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.err { color: var(--bad); font-size: 13px; }
.note { color: var(--muted); font-size: 13px; }
.msg { color: var(--muted); padding: 36px 0; text-align: center; }
kbd { font-family: var(--body); font-size: 12px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; background: var(--surface); color: var(--ink-2); }

/* ---------- home ---------- */
.home-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--brand-800) 0%, #3d6339 55%, var(--brand) 100%);
  color: #fff; border-radius: calc(var(--r) + 4px); padding: clamp(26px, 5vw, 52px);
}
.home-hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 320px; height: 320px; border-radius: 50%;
  border: 46px solid rgba(255, 255, 255, .07); pointer-events: none;
}
.home-hero .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-100); margin-bottom: 10px; }
.home-hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 5vw, 50px); line-height: 1.08; margin: 0 0 12px; text-wrap: balance; max-width: 22ch; }
.home-hero p { color: rgba(255, 255, 255, .86); max-width: 62ch; margin: 0; font-size: 17px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.stats div { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); border-radius: 12px; padding: 10px 16px; min-width: 120px; }
.stats b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: rgba(255, 255, 255, .8); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { flex: 1 1 260px; min-width: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 16px; font-size: 16px; box-shadow: var(--shadow); }
.toolbar input[type=search]:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-50); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chips button[aria-pressed="true"] { color: #fff; border-color: var(--action); background: var(--action); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.qcard {
  display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s; position: relative;
}
.qcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: var(--r) var(--r) 0 0; background: var(--brand); opacity: 0; transition: opacity .18s; }
.qcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-100); }
.qcard:hover::before { opacity: 1; }
.qcard h3 { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.25; margin: 0; }
.qcard p { margin: 0; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qcard .meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.qcard .tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--brand-800); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.qcard .go { color: var(--action); font-weight: 700; }
button.qcard { font: inherit; text-align: left; cursor: pointer; width: 100%; }

/* ---------- quiz start ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: stretch; }
.hero .card:first-child { display: flex; flex-direction: column; background: linear-gradient(180deg, var(--brand-50), var(--surface) 60%); }
.hero h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 42px); line-height: 1.1; margin: 12px 0 14px; text-wrap: balance; color: var(--brand-800); }
.desc-long, .hero p { color: var(--ink-2); margin: 0 0 18px; max-width: 60ch; }
.facts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.facts span { font-size: 13px; border: 1px solid var(--brand-100); background: var(--surface); border-radius: 8px; padding: 6px 10px; color: var(--brand-800); font-weight: 500; }
.shapes { display: flex; gap: 6px; }
.shapes i { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 700; color: #fff; }
.settings { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
#playerName { width: 100%; background: var(--surface) !important; border: 1px solid var(--line-2) !important; border-radius: 10px; padding: 12px 14px; font-size: 16px; }
#playerName:focus { border-color: var(--brand) !important; outline: none; box-shadow: 0 0 0 4px var(--brand-50); }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--brand-800); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.teams { display: flex; flex-direction: column; gap: 8px; }
.team-row { display: flex; gap: 8px; align-items: center; }
.team-row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.team-row input { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; }
.team-row button { background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; width: 40px; height: 40px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.start-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.keys { font-size: 13px; color: var(--muted); }

/* ---------- question ---------- */
.qtop { display: flex; align-items: center; gap: 16px; }
.progress { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--brand); width: 0; transition: width .4s ease; border-radius: 99px; }
.qnum { font-family: var(--display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--brand-800); }
.timer { position: relative; width: 64px; height: 64px; flex: none; background: var(--surface); border-radius: 50%; box-shadow: var(--shadow); }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 6; }
.timer .track { stroke: var(--line); }
.timer .arc { stroke: var(--brand); stroke-linecap: round; transition: stroke .3s; }
.timer.low .arc { stroke: var(--bad); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--ink); }
.timer.low span { color: var(--bad); }
.qcard-q { border-left: 5px solid var(--brand); }
.qcard-q h2 { color: var(--ink); font-family: var(--display) !important; font-weight: 700 !important; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  --c: var(--t0); position: relative; display: flex; align-items: flex-start; gap: 14px; text-align: left;
  border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px 18px 16px 16px; background: var(--surface);
  color: var(--ink); font-size: 16.5px; line-height: 1.4; min-height: 84px; box-shadow: var(--shadow);
  transition: transform .12s, border-color .15s, box-shadow .15s, background .15s;
}
.tile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--c); box-shadow: var(--shadow-lg); }
.tile:active:not(:disabled) { transform: translateY(0); }
.tile:disabled { cursor: default; }
.tile .lt { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--c); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; }
.tile .tx { min-width: 0; padding-top: 7px; }
.tile .mark { position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; border-radius: 50%; display: none; place-items: center; font-weight: 800; font-size: 16px; border: 3px solid var(--bg); color: #fff; }
.tile[data-i="1"] { --c: var(--t1); }
.tile[data-i="2"] { --c: var(--t2); }
.tile[data-i="3"] { --c: var(--t3); }
.tiles.revealed .tile { opacity: .5; }
.tiles.revealed .tile.correct { opacity: 1; border-color: var(--good); background: var(--good-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.tiles.revealed .tile.correct .lt { background: var(--good); }
.tiles.revealed .tile.correct .mark { display: grid; background: var(--good); }
.tiles.revealed .tile.wrong { opacity: 1; border-color: var(--bad); background: var(--bad-50); }
.tiles.revealed .tile.wrong .lt { background: var(--bad); }
.tiles.revealed .tile.wrong .mark { display: grid; background: var(--bad); }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hint { background: var(--warn-50); border: 1px solid #fedf89; border-radius: 12px; padding: 12px 16px; color: #93370d; }
.feedback { display: grid; grid-template-columns: 1fr auto; gap: 16px 20px; align-items: center; border-left: 5px solid var(--good); }
.feedback.bad { border-left-color: var(--bad); }
.feedback .verdict { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 0 0 6px; }
.feedback.good .verdict { color: var(--good-text); }
.feedback.bad .verdict { color: var(--bad); }
.feedback p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.feedback .pts { font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--brand-600); font-variant-numeric: tabular-nums; }
.teampick { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.teampick .row { display: flex; gap: 8px; flex-wrap: wrap; }
.tchip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.tchip .dot { width: 10px; height: 10px; border-radius: 50%; }
.tchip[aria-pressed="true"] { background: var(--good-50); border-color: var(--good); }
.tchip[aria-pressed="true"]::after { content: "✓"; color: var(--good); }
.next-row { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

/* ---------- results ---------- */
.result { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
.big { font-family: var(--display); font-weight: 700; font-size: clamp(52px, 9vw, 92px); line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; margin: 8px 0; }
.result h2 { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3vw, 30px); margin: 6px 0 8px; text-wrap: balance; }
.result .sub { color: var(--muted); margin: 0 0 18px; }
.board { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.board li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.board .pl { font-family: var(--display); font-weight: 700; color: var(--muted); }
.board li:first-child { border-color: var(--brand); background: var(--brand-50); }
.board li:first-child .pl { color: var(--brand-800); }
.board .sc { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }
.review { display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow: auto; padding-right: 4px; }
.review .it { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.review .it .q { font-weight: 600; margin-bottom: 6px; }
.review .it .a { color: var(--good-text); font-size: 14px; }
.review .it .y { color: var(--bad); font-size: 14px; }
.review .ok { color: var(--muted); }
.end-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.certbox { margin-top: 6px; padding: 16px; border: 1px solid var(--brand-100); border-radius: 12px; background: var(--brand-50); }
.rankline { font-weight: 600; color: var(--brand-800); }

/* ---------- leaderboard ---------- */
.lbhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lbhead h2 { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3.4vw, 34px); margin: 0; color: var(--brand-800); }
.lbhead .spacer { flex: 1; }
.lbmode { font-size: 13px; color: var(--muted); }
.lb { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lb li { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.lb li.me { border-color: var(--brand); background: var(--brand-50); }
.lb .pl { font-family: var(--display); font-weight: 700; color: var(--muted); text-align: center; font-size: 18px; }
.lb .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb .nm small { color: #fff; background: var(--action); border-radius: 6px; padding: 1px 7px; font-size: 11px; font-weight: 600; margin-left: 8px; }
.lb .sc { text-align: right; font-family: var(--display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.lb .sc small { display: block; font-family: var(--body); font-weight: 500; font-size: 12px; color: var(--muted); }
.lb .cbtn { border: 1px solid var(--brand); background: var(--surface); color: var(--brand-600); border-radius: 9px; padding: 6px 10px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.lb .cbtn:hover { background: var(--brand-50); }
.lb .cbtn.ph { visibility: hidden; }

/* ---------- certificate modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(16, 24, 40, .6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); overflow: auto; }
.mbox { background: var(--surface); border-radius: 16px; padding: 18px; width: min(520px, 100%); display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); }
.mbox img { width: 100%; height: auto; border-radius: 10px; display: block; background: var(--surface-2); aspect-ratio: 4 / 5; border: 1px solid var(--line); }
.mrow { display: flex; gap: 8px; flex-wrap: wrap; }
.mrow .btn { padding: 11px 16px; font-size: 15px; flex: 1 1 auto; }
.toast { font-size: 13px; color: var(--brand-800); min-height: 18px; }

/* ---------- footer ---------- */
footer { color: var(--muted); font-size: 13px; text-align: center; padding-top: 8px; }
.org-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.org-footer img { height: 34px; width: auto; }

/* ---------- admin ---------- */
.admin-scope .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-scope .spacer { flex: 1; }
.admin-scope input[type=text], .admin-scope input[type=email], .admin-scope input[type=password], .admin-scope input[type=number], .admin-scope textarea, .admin-scope select {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 15px; }
.admin-scope textarea { resize: vertical; min-height: 64px; font-family: var(--body); }
.admin-scope .field { gap: 6px; }
.admin-scope .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-scope .btn { padding: 10px 16px; font-size: 15px; }
.admin-scope h2 { color: var(--brand-800); }
.qlist-row { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.qlist-row h4 { margin: 0 0 4px; font-size: 16px; }
.qlist-row .sub { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.badge.pub { background: var(--good-50); color: var(--good-text); } .badge.dr { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.qe { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.qe .head { display: flex; align-items: center; gap: 8px; }
.qe .head b { font-family: var(--display); font-size: 15px; color: var(--brand-800); }
.qe .opt { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center; }
.qe .opt input[type=radio] { accent-color: var(--good); width: 18px; height: 18px; }
.qe .mini { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 4px 9px; color: var(--muted); font-size: 13px; }
.status { min-height: 20px; font-size: 14px; color: var(--brand-800); }
.status.bad { color: var(--bad); } .status.ok { color: var(--good-text); }
.note-box { font-size: 13px; color: var(--ink-2); border: 1px solid #fedf89; background: var(--warn-50); border-radius: 10px; padding: 10px 14px; }

/* ---------- responsive / motion ---------- */
@media (max-width: 760px) {
  .hero, .result { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .feedback { grid-template-columns: 1fr; }
  .timer { width: 54px; height: 54px; }
  .admin-scope .grid2 { grid-template-columns: 1fr; }
  .qlist-row { grid-template-columns: 1fr; }
  .lb li { grid-template-columns: 34px 1fr auto; }
  .lb .cbtn { grid-column: 2 / -1; justify-self: start; }
  .lb .cbtn.ph { display: none; }
  .bar { border-radius: 0 0 12px 12px; padding: 10px 12px; position: static; }
  #fsBtn { display: none; }
  .brand img.org-logo { height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@keyframes pop { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
.pop { animation: pop .22s ease-out; }

/* =================== v3: season, prizes, polish =================== */
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html { scroll-padding-top: 96px; }
.topnav { display: flex; gap: 2px; margin-left: 10px; }
.topnav button { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.topnav button:hover { background: var(--brand-50); color: var(--brand-800); }

/* hero */
.home-hero { padding: clamp(24px, 4.5vw, 48px); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn svg { width: 18px; height: 18px; }
.btn.light { background: #fff; color: var(--brand-800); }
.btn.light:hover { background: var(--brand-50); }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn.outline-light:hover { background: rgba(255,255,255,.1); }
.hero-season { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 16px; padding: 20px; backdrop-filter: blur(4px); }
.hs-label { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-100); }
.hs-title { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 4px 0 12px; }
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cd div { background: rgba(0,0,0,.18); border-radius: 10px; padding: 10px 4px; text-align: center; }
.cd b { display: block; font-family: var(--display); font-size: clamp(22px, 3vw, 30px); line-height: 1; font-variant-numeric: tabular-nums; }
.cd span { font-size: 11.5px; color: rgba(255,255,255,.78); }
.hs-tiers { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.hero-season .tier { background: rgba(255,255,255,.92); }

/* sections */
.sec { display: flex; flex-direction: column; gap: 18px; padding-top: 8px; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3.4vw, 36px); margin: 0; color: var(--brand-800); line-height: 1.1; }
.sec-head p { margin: 6px 0 0; color: var(--muted); max-width: 64ch; }
.eyebrow-dark { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.sub-h { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--brand-800); margin: 8px 0 0; }
.sort select { background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; font-size: 15px; box-shadow: var(--shadow); }
.seg-sm { display: inline-grid; grid-template-columns: auto auto; }
.seg-sm button { padding: 8px 14px; }

/* quiz cards v3 */
.qc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qcard .new { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: #b54708; border-radius: 6px; padding: 2px 8px; }
.qc-date { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.qc-facts { display: inline-flex; gap: 12px; flex-wrap: wrap; }
.qc-facts span { display: inline-flex; align-items: center; gap: 5px; }
.qcard .go { display: inline-flex; align-items: center; gap: 4px; }

/* season board */
.board-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.board-main { padding: clamp(16px, 2.6vw, 26px); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; padding: 8px 0 18px; border-bottom: 1px solid var(--line); }
.pod { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; min-width: 0; }
.pod-av { position: relative; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 22px; color: #fff; background: var(--brand); box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--brand-100); }
.pod-1 .pod-av { width: 80px; height: 80px; font-size: 26px; background: var(--brand-800); box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px #e8c766; }
.pod-3 .pod-av { background: #8bb586; }
.crown { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); color: #c9a227; font-size: 26px; }
.crown svg { fill: #f2d26b; width: 28px; height: 28px; }
.pod-name { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-pts { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.pod-pts span { font-family: var(--body); font-size: 12px; font-weight: 500; color: var(--muted); }
.pod-step { width: 100%; border-radius: 12px 12px 0 0; background: linear-gradient(180deg, var(--brand-100), var(--brand-50)); display: grid; place-items: center; color: var(--brand-800); font-family: var(--display); font-size: 26px; height: 56px; margin-top: 4px; }
.pod-1 .pod-step { height: 92px; background: linear-gradient(180deg, #c0e0bb, var(--brand-50)); }
.pod-2 .pod-step { height: 70px; }
.pod.is-me .pod-name { color: var(--brand-600); }
.empty-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); padding: 24px 0; }
.empty-state svg { width: 36px; height: 36px; color: var(--brand-100); }
.sboard { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; }
.sboard li { display: grid; grid-template-columns: 30px 38px minmax(0, 1fr) auto 70px; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.sboard li:last-child { border-bottom: 0; }
.sboard li.me { background: var(--brand-50); border-radius: 10px; }
.sboard .pl { font-family: var(--display); font-weight: 700; color: var(--muted); text-align: center; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand-800); display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 1px solid var(--brand-100); }
.av.big { width: 48px; height: 48px; font-size: 16px; }
.av svg { width: 22px; height: 22px; }
.sboard .nm { display: flex; flex-direction: column; min-width: 0; }
.sboard .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sboard .nm small { color: var(--muted); font-size: 12px; }
.sboard .sc { text-align: right; font-family: var(--display); font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.you { display: inline-block; margin-left: 6px; color: #fff; background: var(--action); border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 600; vertical-align: middle; }
.sb-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.tier { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px 3px 6px; white-space: nowrap; }
.tier svg { width: 14px; height: 14px; }
.tier-bronze { color: #8a4b1c; background: #fbeee3; }
.tier-silver { color: #4b5565; background: #eef0f3; }
.tier-gold { color: #7a5b00; background: #fdf3cf; }
.tier-none { color: var(--muted); background: var(--surface-2); padding-left: 9px; }
.tier-pending { opacity: .6; }

/* my card */
.mycard { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 96px; }
.my-head { display: flex; gap: 12px; align-items: center; }
.my-head b { font-size: 17px; }
.my-total { font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.my-total span { font-family: var(--body); font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.my-meta { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.bar-track { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar-track div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #8bb586); transition: width .6s ease; }
.bar-track.sm { height: 6px; }
.my-next { margin: 0; font-weight: 600; color: var(--brand-800); font-size: 14px; }
.note.warn { color: #93370d; background: var(--warn-50); border-radius: 8px; padding: 8px 10px; margin: 0; }

/* prizes */
.prize-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 24px; align-items: center; background: linear-gradient(120deg, #24401f, var(--brand-800) 45%, #4c7a47); color: #fff; border-radius: calc(var(--r) + 4px); padding: clamp(22px, 4vw, 40px); position: relative; overflow: hidden; }
.prize-hero::before { content: ""; position: absolute; left: -80px; bottom: -120px; width: 300px; height: 300px; border-radius: 50%; border: 40px solid rgba(255,255,255,.06); }
.prize-hero > * { position: relative; }
.prize-hero .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-100); }
.prize-hero h2 { font-family: var(--display); font-weight: 700; font-size: clamp(28px, 4vw, 42px); margin: 8px 0 10px; line-height: 1.08; }
.prize-hero p { margin: 0; color: rgba(255,255,255,.86); max-width: 58ch; }
.prize-cd { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 18px; }
.tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tier-card { --tc: var(--brand); --tc-bg: var(--brand-50); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; }
.tier-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.tier-card::after { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--tc); }
.tc-bronze { --tc: #c27c4a; --tc-bg: #fbeee3; }
.tc-silver { --tc: #8a94a6; --tc-bg: #eef0f3; }
.tc-gold { --tc: #d4a514; --tc-bg: #fdf3cf; }
.tc-top { --tc: var(--brand-800); --tc-bg: var(--brand-50); background: linear-gradient(180deg, var(--brand-50), var(--surface)); }
.tc-medal { width: 52px; height: 52px; border-radius: 14px; background: var(--tc-bg); color: var(--tc); display: grid; place-items: center; }
.tc-medal svg { width: 30px; height: 30px; }
.tc-name { font-family: var(--display); font-weight: 700; font-size: 22px; }
.tc-min { font-size: 13px; color: var(--muted); font-weight: 600; }
.tc-prize { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; color: var(--ink); background: var(--tc-bg); border-radius: 10px; padding: 10px 12px; margin-top: 4px; }
.tc-prize svg { width: 18px; height: 18px; color: var(--tc); margin-top: 2px; }
.tc-state { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.tc-state.ok { color: var(--good-text); font-weight: 600; }
.tier-card.got { border-color: var(--tc); }
.top-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.top-list li { display: flex; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.top-list b { color: var(--brand-800); white-space: nowrap; }
.top-list span { text-align: right; font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: s; }
.steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); position: relative; }
.st-n { width: 34px; height: 34px; border-radius: 50%; background: var(--action); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 700; flex: none; }
.steps b { display: block; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
.rules { display: flex; flex-direction: column; gap: 10px; }
.rules details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .15s, background .15s; }
.rules details[open] { border-color: var(--brand-100); background: var(--brand-50); }
.rules summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-weight: 600; }
.rules summary::-webkit-details-marker { display: none; }
.r-n { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-50); color: var(--brand-800); display: grid; place-items: center; font-family: var(--display); font-weight: 700; flex: none; border: 1px solid var(--brand-100); }
.chev { margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.rules details[open] .chev { transform: rotate(225deg); }
.rules details p { margin: 0; padding: 0 16px 16px 56px; color: var(--ink-2); }
.rules-note { margin: 4px 0 0; }

/* quiz extras */
.streak { font-weight: 700; font-size: 14px; color: #b54708; background: var(--warn-50); border: 1px solid #fedf89; border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.seasonline { margin-top: 4px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; }

@media (max-width: 980px) {
  .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-grid { grid-template-columns: 1fr; }
  .mycard { position: static; }
  .topnav { display: none; }
}
@media (max-width: 760px) {
  .hero-grid, .prize-hero { grid-template-columns: 1fr; }
  .tiers, .steps { grid-template-columns: 1fr; }
  .sboard li { grid-template-columns: 26px 34px minmax(0, 1fr) 62px; }
  .sboard li .tier { display: none; }
  .podium { gap: 6px; }
  .pod-av { width: 52px; height: 52px; font-size: 18px; }
  .pod-1 .pod-av { width: 64px; height: 64px; }
  .pod .tier { display: none; }
  .rules details p { padding-left: 16px; }
  .qc-date { margin-left: 0; }
}

/* =================== v4: UX redesign components =================== */
:root { --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --ease: cubic-bezier(.2,.7,.2,1); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--action); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .15s; }
.skip:focus { top: 12px; }
.btn-lg { min-height: 52px; padding: 14px 28px; font-size: 17px; width: 100%; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #b42318; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.topnav button[aria-current="true"] { color: var(--brand-800); background: var(--brand-50); box-shadow: inset 0 -2px 0 var(--brand); }

/* toast */
.toaster { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast-i { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14.5px; animation: toastIn .25s var(--ease); pointer-events: auto; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* start screen */
.start-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.start-info { display: flex; flex-direction: column; gap: 6px; background: linear-gradient(180deg, var(--brand-50), var(--surface) 55%); }
.start-info h1 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 40px); line-height: 1.1; margin: 10px 0 8px; text-wrap: balance; color: var(--brand-800); }
.how { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.how .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-50); color: var(--action); display: grid; place-items: center; flex: none; }
.how .ic svg { width: 18px; height: 18px; }
.how b { display: block; font-size: 15px; }
.how span { color: var(--muted); font-size: 14px; }
.start-form { position: sticky; top: 96px; }
.form-h { font-family: var(--display); font-weight: 700; font-size: 24px; margin: 0; color: var(--brand-800); }
.more { border-top: 1px solid var(--line); padding-top: 12px; }
.more summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); min-height: 40px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.more[open] summary::after { transform: rotate(225deg); }
.more .settings-in { display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.prev-best { display: flex; gap: 10px; align-items: center; background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--brand-800); }
.prev-best:empty { display: none; }

/* question screen */
.icon-round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; color: var(--ink-2); flex: none; box-shadow: var(--shadow); }
.icon-round:hover { background: var(--surface-2); }
.icon-round svg { width: 20px; height: 20px; }
.tile .key { position: absolute; right: 12px; bottom: 10px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
@media (hover: none) { .tile .key { display: none; } }
body.sheet-open .wrap { padding-bottom: 260px; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -12px 32px -16px rgba(16,24,40,.25); padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); animation: sheetIn .28s var(--ease); }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
.sheet.good { background: var(--good-50); border-top-color: #abefc6; }
.sheet.bad { background: var(--bad-50); border-top-color: #fecdca; }
.sheet-in { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px 18px; align-items: center; }
.fb-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--good); }
.sheet.bad .fb-ic { background: var(--bad); }
.fb-ic svg { width: 26px; height: 26px; stroke-width: 3; }
.sheet .verdict { font-family: var(--display); font-weight: 700; font-size: 22px; margin: 0 0 2px; }
.sheet.good .verdict { color: var(--good-text); }
.sheet.bad .verdict { color: #b42318; }
.sheet p { margin: 0; color: var(--ink-2); max-height: 30vh; overflow: auto; }
.sheet .pts { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--good-text); }
.sheet .next-row { grid-column: auto; }
.sheet .next-row .btn { width: auto; min-width: 200px; }
.sheet .teampick { grid-column: 1 / -1; order: 5; }
/* the old in-flow feedback card rules must not apply to the sheet */
.sheet.feedback { border-left: 0; display: block; }

/* result dashboard */
.res-hero { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: center; }
.res-ring { position: relative; width: 200px; height: 200px; justify-self: center; }
.res-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); stroke-width: 14; }
.res-ring .tr { stroke: var(--line); fill: none; }
.res-ring .ar { stroke: var(--brand); fill: none; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.res-ring .in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.res-ring .in b { font-family: var(--display); font-size: 44px; line-height: 1; color: var(--brand-800); }
.res-ring .in span { color: var(--muted); font-size: 13px; }
.res-ring .trophy { color: #c9a227; }
.res-ring .trophy svg { width: 96px; height: 96px; transform: none; stroke-width: 1.6; fill: #fdf3cf; }
.res-main .big { font-size: clamp(40px, 6vw, 60px); margin: 2px 0; }
.res-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 4px; }
.res-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.res-stats b { display: block; font-family: var(--display); font-size: 24px; color: var(--ink); font-variant-numeric: tabular-nums; }
.res-stats span { font-size: 12.5px; color: var(--muted); }
.res-stats:empty { display: none; }
.result-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.rev-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.review .it { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; }
.review .it .st { grid-row: 1 / span 3; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--good); }
.review .it .st.x { background: var(--bad); }
.review .it .st svg { width: 16px; height: 16px; stroke-width: 3; }
.review .it .e { color: var(--muted); font-size: 13.5px; }
.review { max-height: none; }

/* home: hero personalization + card status */
.hello-av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18); font-weight: 700; margin-right: 8px; vertical-align: middle; font-size: 14px; }
.qc-status { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.qc-status.done { color: var(--good-text); font-weight: 600; }
.qc-status .bar-track { height: 6px; }
.qcard.is-done { border-color: #c0e0bb; }
.chips .sep { width: 1px; background: var(--line-2); margin: 4px 4px; }

/* skeletons */
.sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.qcard.skel { pointer-events: none; }
.qcard.skel .sk.l1 { height: 14px; width: 40%; } .qcard.skel .sk.l2 { height: 22px; width: 85%; } .qcard.skel .sk.l3 { height: 14px; width: 100%; } .qcard.skel .sk.l4 { height: 14px; width: 70%; }

/* mobile tab bar (thumb zone) */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
  .tabbar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; font-size: 12px; font-weight: 600; color: var(--muted); border-radius: 10px; }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button[aria-current="true"] { color: var(--action); background: var(--brand-50); }
  body.has-tabbar .wrap { padding-bottom: 96px; }
  body[data-view="quiz"] .tabbar, body[data-view="admin"] .tabbar { display: none; }
  .start-grid, .res-hero { grid-template-columns: 1fr; }
  .start-form { position: static; }
  .res-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .res-ring { width: 160px; height: 160px; }
  .sheet-in { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sheet .next-row { grid-column: 1 / -1; }
  .sheet .next-row .btn { width: 100%; }
  .fb-ic { width: 40px; height: 40px; }
  .qtop { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }

#quizView:has(#qScreen:not([hidden])) #toHome { display: none; }
.qcard .go svg { width: 16px; height: 16px; }
.sheet.bad .pts { color: #b42318; }
@media (max-width: 760px) {
  .bar { flex-wrap: nowrap; gap: 8px; }
  .bar .brand { flex: 1 1 auto; min-width: 0; }
  .org-txt { min-width: 0; }
  .org-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: 13px; }
  .bar .spacer { display: none; }
  .lang-sw button { min-width: 32px; padding: 4px 6px; font-size: 12px; }
  #scoreChip, #lbTop { display: none !important; }
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stats div { min-width: 0; padding: 10px 12px; }
  .stats b { font-size: 22px; }
  .stats span { font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; }
  #brandBtn #siteName { font-size: 16px; }
}

/* =================== background: girih-inspired lattice + soft light =================== */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(900px 600px at 0% 0%, rgba(101,153,97,.16), transparent 60%),
    radial-gradient(800px 600px at 100% 100%, rgba(220,229,86,.14), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(35,127,183,.06), transparent 60%),
    url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2296%22%20height%3D%2296%22%20viewBox%3D%220%200%2096%2096%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23659961%22%20stroke-width%3D%221.1%22%20opacity%3D%22.14%22%3E%3Crect%20x%3D%2234%22%20y%3D%2234%22%20width%3D%2228%22%20height%3D%2228%22/%3E%3Crect%20x%3D%2234%22%20y%3D%2234%22%20width%3D%2228%22%20height%3D%2228%22%20transform%3D%22rotate%2845%2048%2048%29%22/%3E%3Ccircle%20cx%3D%2248%22%20cy%3D%2248%22%20r%3D%225%22/%3E%3Cpath%20d%3D%22M0%2048h14M82%2048h14M48%200v14M48%2082v14%22/%3E%3Crect%20x%3D%22-14%22%20y%3D%22-14%22%20width%3D%2228%22%20height%3D%2228%22%20transform%3D%22rotate%2845%200%200%29%22/%3E%3Crect%20x%3D%2282%22%20y%3D%22-14%22%20width%3D%2228%22%20height%3D%2228%22%20transform%3D%22rotate%2845%2096%200%29%22/%3E%3Crect%20x%3D%22-14%22%20y%3D%2282%22%20width%3D%2228%22%20height%3D%2228%22%20transform%3D%22rotate%2845%200%2096%29%22/%3E%3Crect%20x%3D%2282%22%20y%3D%2282%22%20width%3D%2228%22%20height%3D%2228%22%20transform%3D%22rotate%2845%2096%2096%29%22/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, auto, auto, 96px 96px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.75) 55%, rgba(0,0,0,.35) 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.75) 55%, rgba(0,0,0,.35) 100%);
}
body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none; width: 520px; height: 520px; border-radius: 50%;
  right: -180px; top: 30%; border: 70px solid rgba(101,153,97,.05);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-60px, 80px); } }
@media (max-width: 760px) { body::after { width: 300px; height: 300px; border-width: 44px; right: -140px; } }
