:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #242824; background: #f5f5f3; font-synthesis: none;
  --muted: #656b65; --line: #d9ddd7; --green: #285c39; --soft-green: #eaf2e7;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; opacity: .55; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #65944d; outline-offset: 4px; }
h1:focus { outline: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: calc(100% - 48px); max-width: 780px; margin-inline: auto; }
.header { display: flex; align-items: center; gap: 22px; min-height: 84px; border-bottom: 1px solid var(--line); }
.brand { font-size: 18px; font-weight: 750; letter-spacing: -.5px; }
.header nav { display: flex; gap: 20px; margin-left: auto; }
.nav-link { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 12px 0; }
.nav-link.active { color: var(--green); box-shadow: 0 2px var(--green); font-weight: 650; }
.help-button { border: 1px solid var(--line); border-radius: 50%; width: 30px; height: 30px; background: transparent; flex-shrink: 0; }
main { min-height: calc(100dvh - 151px); }
.hero { padding: 54px 0 35px; }
h1 { font-size: clamp(30px, 5vw, 42px); letter-spacing: -1.2px; line-height: 1.2; }
.intro { font-size: 17px; line-height: 1.75; max-width: 700px; margin-top: 20px; color: #4e554e; }
.intro + .intro { margin-top: 12px; }
.intro strong { color: #242824; font-weight: 650; }
.hero-meta { color: var(--muted); font-size: 12px; line-height: 1.8; margin-top: 24px; }
.section-heading { margin-bottom: 15px; }
.section-heading h2 { font-size: 18px; font-weight: 650; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mode-card { display: flex; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 22px; text-align: left; }
.mode-card:hover { border-color: #8c9c86; }
.mode-card.selected { background: var(--soft-green); border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.mode-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mode-card h3 { font-size: 20px; font-weight: 650; }
.radio-mark { display: block; width: 17px; height: 17px; border: 1px solid #afb6ab; border-radius: 50%; flex-shrink: 0; }
.selected .radio-mark { border: 5px solid var(--green); }
.mode-card p { font-size: 14px; line-height: 1.7; color: var(--muted); margin-top: 12px; }
.start-row { margin-top: 18px; }
.primary-button { border: 0; border-radius: 7px; background: var(--green); color: #fff; padding: 14px 23px; font-size: 14px; font-weight: 650; min-height: 48px; }
.primary-button:hover { background: #1d482b; }
.start-row .primary-button { width: 100%; }
.text-button { border: 0; background: none; color: var(--green); font-size: 13px; font-weight: 550; padding: 10px 0; }
.text-button:hover { text-decoration: underline; }
.home-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 24px 0 40px; }
.home-bottom p { font-size: 13px; color: var(--muted); }
.footer { border-top: 1px solid var(--line); padding-block: 22px; color: var(--muted); font-size: 12px; }
.game-view { padding-bottom: 28px; }
.game-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 0; }
.mode-pill { background: #e8ece5; border-radius: 5px; font-size: 11px; padding: 7px 11px; }
.score-display { text-align: center; padding: 14px 20px 10px; background: var(--soft-green); border-radius: 10px; max-width: 480px; margin: 0 auto; }
.score-label { display: block; font-size: 11px; letter-spacing: 1.5px; font-weight: 650; color: var(--green); }
.score-number { position: relative; display: inline-block; min-width: 90px; }
#score { display: block; font-size: 68px; line-height: 1.1; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; transform-origin: center 65%; }
.score-burst { position: absolute; top: 15px; left: calc(100% + 12px); font-size: 24px; font-weight: 800; color: #397a27; opacity: 0; pointer-events: none; }
.scored #score { animation: score-pop 460ms ease-out; }
.scored .score-burst { animation: point-rise 720ms ease-out; }
@keyframes score-pop {
  0% { transform: scale(.7); }
  40% { transform: scale(1.25) rotate(-4deg); color: #4b872e; }
  65% { transform: scale(.96) rotate(2deg); }
  82% { transform: scale(1.07); }
  100% { transform: scale(1); }
}
@keyframes point-rise {
  0% { opacity: 0; transform: translateY(12px) scale(.65); }
  20% { opacity: 1; transform: translateY(0) scale(1.15); }
  60% { opacity: 1; transform: translateY(-12px) scale(1); }
  100% { opacity: 0; transform: translateY(-32px) scale(.9); }
}
.game-heading { text-align: center; margin: 24px 0; }
.eyebrow, .card-kicker { color: var(--muted); font-size: 11px; letter-spacing: .8px; }
.game-heading h1 { font-size: 28px; margin: 10px 0; }
.game-heading p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.question-cards { display: flex; gap: 16px; justify-content: center; }
.question-card { display: flex; flex-direction: column; justify-content: space-between; align-items: center; width: 480px; min-width: 0; min-height: 210px; padding: 23px; border: 1px solid #bcc5b7; border-radius: 10px; background: #fff; user-select: none; touch-action: pan-y; overflow-wrap: anywhere; transition: transform .15s, background .15s; }
.question-card .card-kicker { align-self: flex-start; }
.question-name { font-size: 30px; font-weight: 700; text-align: center; line-height: 1.3; }
.card-mark { color: #819379; font-size: 13px; }
.question-cards.pair .question-card { width: 50%; }
.question-cards.pair .question-name { font-size: 26px; }
.question-card.swipe-yes { background: #eaf2e7; transform: translateX(-18px) rotate(-3deg); }
.question-card.swipe-no { background: #f6e7e5; transform: translateX(18px) rotate(3deg); }
.feedback { display: flex; align-items: center; justify-content: center; min-height: 48px; text-align: center; color: var(--green); font-size: 13px; padding: 10px; }
.answer-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 620px; margin-inline: auto; }
.answer { display: flex; align-items: center; gap: 12px; padding: 17px; min-height: 73px; background: #fff; border: 1px solid var(--line); border-radius: 8px; text-align: left; font-size: 14px; }
.answer:hover { border-color: var(--green); }
.answer.yes { background: #eaf2e7; border-color: #bdcfb4; }
.answer.no { background: #f5ecea; border-color: #ddc9c4; }
.answer strong { display: block; font-size: 14px; font-weight: 650; }
.answer small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.answer-arrow { font-size: 22px; }
kbd { margin-left: auto; font-size: 11px; color: var(--muted); border: 1px solid #c6cdc1; border-radius: 4px; padding: 2px 5px; }
.expert-answers .answer { min-height: 60px; }
.game-hint { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.6; margin-top: 18px; }
.leaders-view { padding: 45px 0 35px; }
.leader-heading p { color: var(--muted); line-height: 1.6; font-size: 15px; margin-top: 14px; }
.leader-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 28px 0 16px; }
.segmented { display: flex; gap: 4px; background: #e5e9e1; padding: 4px; border-radius: 7px; }
.segmented button { background: none; border: 0; padding: 10px 22px; border-radius: 5px; font-size: 13px; }
.segmented .active { background: var(--green); color: #fff; }
.small-label { font-size: 11px; color: var(--muted); }
.leader-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.leader-table-head, .leader-row { display: grid; grid-template-columns: 65px 1fr 65px; gap: 14px; padding: 16px 20px; align-items: center; }
.leader-table-head { font-size: 11px; background: #edf0e9; color: var(--muted); }
.leader-row { font-size: 14px; border-top: 1px solid var(--line); }
.leader-row:first-child { background: #f0f6ec; }
.leader-row > span:first-child { color: var(--muted); }
.leader-row > strong { overflow-wrap: anywhere; font-weight: 600; }
.leader-row > strong:last-child, .leader-table-head > span:last-child { text-align: right; }
.leader-empty { text-align: center; padding: 55px 20px; }
.leader-empty h3 { font-size: 20px; margin-bottom: 12px; }
.leader-empty p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.leader-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.leader-footer p { font-size: 12px; color: var(--muted); line-height: 1.6; }
.dialog { border: 1px solid var(--line); border-radius: 12px; background: #f9faf7; color: #242824; padding: 30px; width: calc(100% - 32px); max-width: 500px; max-height: 90dvh; overflow-y: auto; }
.dialog::backdrop { background: #17201788; }
.dialog h2 { font-size: 27px; line-height: 1.3; letter-spacing: -.6px; margin: 12px 0 18px; }
.dialog > p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.close-dialog { position: absolute; right: 14px; top: 10px; border: 0; background: none; padding: 4px 10px; font-size: 26px; }
.rule { margin: 23px 0; }
.rule h3 { font-size: 16px; margin-bottom: 8px; }
.rule p { font-size: 14px; color: var(--muted); line-height: 1.7; }
.rule p + p { margin-top: 10px; }
.full-width { width: 100%; }
.result-dialog { text-align: center; }
.result-score { display: flex; flex-direction: column; gap: 2px; margin: 15px 0 20px; }
.result-score strong { font-size: 60px; line-height: 1.1; color: var(--green); }
.result-score > span { font-size: 11px; color: var(--muted); }
.reveal { margin: 20px 0; padding: 0 14px; border-radius: 6px; background: #eaf0e5; text-align: left; }
.reveal-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; font-size: 13px; }
.reveal-item + .reveal-item { border-top: 1px solid var(--line); }
.reveal-item strong { overflow-wrap: anywhere; min-width: 0; }
.reveal-item span { color: var(--green); font-size: 12px; flex-shrink: 0; }
.reveal-item .unused { color: #8b3b32; }
#score-form { text-align: left; margin-top: 22px; }
#score-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.input-row { display: flex; gap: 8px; }
.input-row input { width: 100%; min-width: 0; background: #fff; border: 1px solid #b9c4b2; border-radius: 7px; padding: 12px; font-size: 14px; }
.input-row button { padding-inline: 16px; }
#save-status { font-size: 13px; color: var(--green); margin-top: 14px; }
.result-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 24px; }
.error-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); border-radius: 8px; background: #6c302b; color: #fff; padding: 15px 20px; font-size: 14px; z-index: 10; }
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .header { min-height: 74px; gap: 14px; flex-wrap: wrap; padding-block: 15px; }
  .brand { font-size: 16px; }
  .header nav { gap: 13px; }
  .nav-link { font-size: 12px; }
  .help-button { width: 27px; height: 27px; }
  .hero { padding: 34px 0 28px; }
  .intro { font-size: 16px; line-height: 1.65; margin-top: 17px; }
  .hero-meta { font-size: 11px; margin-top: 20px; }
  .mode-grid { gap: 10px; }
  .mode-card { padding: 17px 14px; }
  .mode-card h3 { font-size: 18px; }
  .mode-card p { font-size: 12px; }
  .home-bottom { flex-direction: column; gap: 2px; margin-bottom: 28px; text-align: center; }
  .home-bottom p, .home-bottom .text-button { font-size: 12px; }
  main { min-height: calc(100dvh - 141px); }
  .game-toolbar { padding: 12px 0; }
  .game-toolbar .text-button { font-size: 12px; }
  .score-display { padding: 10px 15px 7px; }
  #score { font-size: 60px; }
  .game-heading { margin: 20px 0; }
  .game-heading h1 { font-size: 24px; }
  .game-heading p { font-size: 12px; }
  .question-card { min-height: 200px; padding: 18px; }
  .question-name { font-size: 28px; }
  .question-cards { gap: 10px; }
  .question-cards.pair .question-card { padding: 15px 12px; }
  .question-cards.pair .question-name { font-size: 22px; }
  .answer { gap: 8px; padding: 14px 10px; }
  .answer strong { font-size: 12px; }
  .answer small { font-size: 10px; }
  .expert-answers .answer { font-size: 13px; justify-content: center; }
  kbd { display: none; }
  .game-hint { font-size: 11px; }
  .leader-heading p { font-size: 14px; }
  .leader-table-head, .leader-row { grid-template-columns: 42px 1fr 52px; padding: 14px; gap: 10px; }
  .leader-table-head { font-size: 10px; }
  .leader-footer { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .dialog { padding: 25px 20px; }
  .input-row { flex-wrap: wrap; }
  .input-row button { width: 100%; }
}
@media (max-width: 360px) {
  .header { gap: 10px; }
  .brand { flex: 1; }
  .header nav { order: 3; flex-basis: 100%; margin: 0; }
  .question-cards.pair .question-name { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
