@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700;800;900&display=swap');

:root {
  font-family: 'Heebo', Arial, sans-serif;
  color: #174d47;
  background: #f5f3e9;
  font-synthesis: none;
  --green: #174d47;
  --muted: #67756a;
  --orange: #d77750;
  --border: #d3d9ca;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 6px;
}
.site-header { padding: 25px clamp(24px, 5vw, 80px); }
.brand { font-size: 22px; font-weight: 800; text-decoration: none; letter-spacing: -.7px; }
.brand > span { color: var(--orange); }
main { padding: 24px clamp(24px, 6vw, 96px) 64px; }
main:focus { outline: none; }
#app { max-width: 1080px; margin-inline: auto; }
.screen {
  min-height: calc(100svh - 170px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  animation: appear .25s ease-out;
}
.step-label { color: var(--muted); font-size: 18px; margin-bottom: 24px; }
h1, h2 { font-weight: 800; line-height: 1.2; letter-spacing: -2px; margin: 0 0 30px; text-wrap: balance; }
h1 { font-size: clamp(64px, 8vw, 112px); }
h2 { font-size: clamp(42px, 5.5vw, 76px); }
p { margin: 0 0 28px; }
.description { font-size: clamp(21px, 2.3vw, 30px); line-height: 1.7; color: var(--muted); }
.primary {
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fffef9;
  min-height: 64px;
  padding: 14px 32px;
  font-size: clamp(22px, 2.1vw, 28px);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
}
.primary:hover { background: #24665b; }
.primary:disabled { background: #e0e4d8; color: #899182; }
.actions { display: flex; align-items: center; gap: 30px; margin-top: 20px; flex-wrap: wrap; }
.back, .text-button { background: none; border: 0; color: var(--muted); padding: 14px 0; font-size: 20px; }
.text-button { text-decoration: underline; text-underline-offset: 5px; margin-top: 12px; }
.choice { display: flex; align-items: center; gap: 22px; cursor: pointer; padding-block: 24px; width: 100%; }
.choice:has(input:disabled) { opacity: .35; cursor: default; }
.choice input:disabled { cursor: default; }
.choice input { appearance: none; width: 32px; height: 32px; border: 2px solid #8d9c89; border-radius: 6px; flex-shrink: 0; margin: 0; cursor: pointer; }
.choice input:checked { background: var(--green); border-color: var(--green); }
.choice input:checked::after { content: '✓'; display: block; color: white; text-align: center; font: 24px/28px Arial, sans-serif; }
.choice-copy { display: flex; flex-direction: column; gap: 8px; }
.choice-copy strong { font-size: clamp(23px, 2.7vw, 36px); font-weight: 600; line-height: 1.5; }
.topic-count { white-space: nowrap; font-size: .65em; font-weight: 500; color: var(--muted); }
.score-group { width: 100%; margin-top: 28px; }
.score-group h3 { font-size: 28px; margin: 0 0 12px; }
.score-group .score-table { margin-top: 16px; }
.result-status { font-size: 24px; font-weight: 600; }
.burden-group { width: 100%; border: 0; padding: 0; margin: 24px 0 0; }
.burden-group legend { font-size: 24px; font-weight: 600; margin-bottom: 12px; }
.burden-group .choice + .choice { margin-top: 12px; }
.choice-copy small { font-size: clamp(18px, 1.8vw, 23px); color: var(--muted); line-height: 1.6; }
.authority { border: 2px solid #b7c9b8; border-radius: 12px; background: #eaf0e2; padding: 24px; margin-bottom: 12px; }
.authority:has(input:checked) { border-color: var(--green); }
.choice-copy .authority-joke { color: var(--green); font-weight: 600; }
.todo { color: var(--muted); font-size: 21px; border-inline-start: 3px solid var(--orange); padding: 12px 20px; margin-bottom: 24px; line-height: 1.7; }
.todo-label { direction: ltr; display: inline-block; font: 16px/1.5 monospace; color: #9a5a38; }
.selection-note { min-height: 32px; margin: 16px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.party-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; width: 100%; }
.ballot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 140px; padding: 14px 10px; text-align: center; background: #fffef9; border: 2px solid var(--border); border-radius: 5px; cursor: pointer; }
.ballot:hover { border-color: #6d8d7b; }
.ballot:has(input:checked) { border-color: var(--green); background: #e9f0e1; }
.ballot:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 4px; }
.ballot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ballot-letter { font: 800 43px/1.2 Arial, sans-serif; }
.ballot-name { font-size: 16px; line-height: 1.5; margin-top: 12px; }
.source-note { font-size: 15px; line-height: 1.8; color: var(--muted); margin-top: 28px; }
.source-note summary { cursor: pointer; }
.source-note p { margin-top: 12px; }
.dilemma-options { display: grid; gap: 16px; width: 100%; }
.dilemma-option { border: 2px solid var(--border); border-radius: 10px; background: #fffef9; padding: 18px 24px; }
.dilemma-option:has(input:checked) { border-color: var(--green); background: #eaf0e2; }
.dilemma-option input { border-radius: 50%; }
.dilemma-option .choice-copy strong { font-size: clamp(24px, 2.5vw, 32px); }
.dilemma-details { width: 100%; margin-top: 24px; font-size: 21px; line-height: 1.8; color: var(--muted); }
.dilemma-details summary { cursor: pointer; width: fit-content; color: var(--green); text-decoration: underline; text-underline-offset: 5px; }
.dilemma-details summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 6px; }
.dilemma-background { max-width: 900px; padding-top: 12px; }
.dilemma-background h3 { color: var(--green); font-size: 27px; margin: 16px 0; }
.blank-note, .score-context, .score-method { font-size: 21px; line-height: 1.8; color: var(--muted); }
.score-context { max-width: 850px; }
.score-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-bottom: 24px; font-size: clamp(20px, 2.5vw, 28px); }
/* One fixed score column for every group, so it does not shift between groups or when details open. */
.score-table thead th:last-child { width: 5rem; }
.score-table th { text-align: start; font-weight: 500; }
.score-table th, .score-table td { padding: 18px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.score-table td { text-align: end; white-space: nowrap; }
.score-table thead { color: var(--muted); font-size: 18px; }
.score-table th strong { font-weight: 600; }
.score-table tbody[data-tied] tr:not(:last-child) > th { border-bottom-style: dashed; }
.score-table tbody[data-tied] td { border-inline-start: 3px solid var(--border); }
.score-pin { position: sticky; top: 12px; }
.score-shared { display: block; font-size: 16px; font-weight: 400; color: var(--muted); margin-top: 4px; }
.score-coverage { display: block; font-size: 16px; font-weight: 400; color: var(--muted); margin-top: 6px; }
.score-table details { font-size: 18px; line-height: 1.8; font-weight: 400; margin-top: 6px; }
.score-table details p { max-width: 760px; margin-block: 12px; }
.score-table summary, .score-method summary { cursor: pointer; width: fit-content; text-decoration: underline; text-underline-offset: 4px; }
.score-table summary:focus-visible, .score-method summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 5px; }
.score { font-size: 30px; font-weight: 700; }
.score-positive { color: var(--green); }
.score-negative { color: #925134; }
.score-method { margin-bottom: 24px; }
.score-method p { margin-top: 16px; }
.answer-options { display: flex; flex-direction: column; gap: 18px; width: min(100%, 650px); }
.answer { display: block; width: 100%; border: 2px solid var(--border); border-radius: 10px; background: #fffef9; padding: 20px 30px; text-align: start; font-size: clamp(28px, 3vw, 40px); line-height: 1.5; }
.answer:hover { border-color: var(--green); }
.cutscene-option { cursor: default; }
.cutscene-option:disabled { color: var(--green); opacity: 1; }
.cutscene-option.is-playing { border-color: transparent; background: transparent; }
.is-playing #sure-label { display: inline-block; animation: never-mind 1s ease both; }
.loading-ballot { display: grid; place-items: center; width: 80px; height: 100px; border: 2px solid var(--green); font-size: 46px; margin-bottom: 48px; background: #fffef9; animation: thinking 1.5s ease-in-out infinite; }
.robot-thanks h2 { animation: acknowledgement 1s ease both; }
.result-ballot { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 180px; min-height: 190px; padding: 22px; border: 2px solid var(--border); background: #fffef9; margin-bottom: 30px; transform: rotate(-3deg); text-align: center; }
.result-ballot strong { font: 800 64px/1.3 Arial, sans-serif; }
.result-ballot span { font-size: 22px; line-height: 1.5; margin-top: 12px; }
.reason { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.7; margin-bottom: 30px; }
.reason strong { display: block; font-size: 18px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; right: 20px; z-index: 10; background: var(--green); color: white; padding: 12px; }
.skip-link:focus { top: 12px; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes acknowledgement { 0% { opacity: 0; transform: translateY(10px); } 20%, 80% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes never-mind { 0% { opacity: 0; transform: translateY(12px) rotate(0); } 25%, 65% { opacity: 1; transform: translateY(0) rotate(-4deg); } 100% { opacity: 0; transform: translateY(-16px) rotate(-6deg); } }
@keyframes thinking { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(4deg) translateY(-8px); } }
@media (max-width: 900px) { .party-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .site-header { padding: 20px 24px; }
  .brand { font-size: 19px; }
  main { padding: 24px 24px 40px; }
  .screen { min-height: calc(100svh - 135px); }
  h1, h2 { letter-spacing: -1.3px; margin-bottom: 24px; }
  h1 { font-size: clamp(54px, 12vw, 72px); }
  .step-label { font-size: 16px; margin-bottom: 22px; }
  .choice { gap: 16px; }
  .choice input { width: 28px; height: 28px; }
  .choice input:checked::after { font-size: 21px; line-height: 24px; }
  .actions { gap: 22px; width: 100%; }
  .primary { max-width: 100%; padding: 16px 22px; gap: 20px; }
  .party-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .ballot { min-height: 122px; padding: 12px 5px; }
  .ballot-letter { font-size: 36px; }
  .ballot-name { font-size: 14px; }
  .answer { padding: 18px 24px; }
  .dilemma-option { padding: 16px; }
  .dilemma-details { font-size: 19px; }
  .todo { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.burden-meter { width: 100%; padding: 20px clamp(16px, 3vw, 28px); border: 2px solid var(--border); border-radius: 12px; background: #fffef9; }
.burden-meter h3 { font-size: clamp(23px, 3vw, 30px); margin: 0 0 16px; }
.burden-scale { display: flex; justify-content: space-between; direction: ltr; font-size: 17px; margin-bottom: 8px; }
.burden-track { height: 22px; direction: ltr; background: #e0e4d8; border-radius: 12px; overflow: hidden; }
.burden-fill { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .65s ease; }
.burden-meter.is-rising .burden-fill { background: #b6603e; }
.burden-scenes { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; opacity: 0; font-size: clamp(18px, 2.2vw, 25px); font-weight: 600; }
.burden-meter:is(.is-entering, .is-rising, .is-falling) .burden-scenes { opacity: 1; animation: burden-scene 3s ease both; }
.burden-meter.is-rising .burden-track { animation: burden-nudge .45s ease; }
.burden-disclaimer { margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
@keyframes burden-scene { 0% { opacity: 0; transform: translateY(6px); } 15%, 80% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-4px); } }
@keyframes burden-nudge { 25% { transform: translateX(3px); } 75% { transform: translateX(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .burden-meter *, .burden-meter { animation: none !important; transition: none !important; }
}

.burden-screen { justify-content: flex-start; }
.burden-screen h2 { font-size: clamp(38px, 5vw, 60px); margin-bottom: 16px; }
.burden-screen .step-label { margin-bottom: 14px; }
.service-group { width: 100%; min-width: 0; border: 0; padding: 0; margin: 0; }
.service-options, .burden-options { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.burden-screen .burden-choice { width: auto; min-height: 44px; padding: 8px 0; gap: 10px; margin: 0; }
.burden-screen .burden-choice + .burden-choice { margin: 0; }
.burden-screen .burden-choice input { width: 25px; height: 25px; }
.burden-screen .burden-choice input:checked::after { font: 20px/21px Arial, sans-serif; }
.burden-screen .burden-choice strong { font-size: clamp(20px, 2.3vw, 27px); line-height: 1.4; }
.burden-subtitle { font-size: clamp(25px, 3vw, 32px); margin: 22px 0 0; }
.burden-screen .burden-group { margin: 18px 0 0; min-width: 0; }
.burden-screen .burden-group legend { font-size: clamp(21px, 2.2vw, 26px); margin-bottom: 6px; }
.burden-screen .selection-note { margin: 4px 0; font-size: 16px; min-height: 0; }
.burden-screen .burden-meter { margin-top: 22px; padding: 0; border: 0; border-radius: 0; background: none; }
.burden-screen .burden-meter h3 { font-size: 23px; margin-bottom: 10px; }
.burden-screen .burden-scenes { flex-direction: row; flex-wrap: wrap; gap: 0 14px; margin-top: 6px; font-size: 18px; }
.burden-screen .burden-disclaimer { font-size: 14px; margin-top: 4px; }
.burden-screen .dilemma-details { margin-top: 12px; font-size: 18px; }
@media (max-width: 520px) {
  .service-options, .burden-options { gap: 2px 18px; }
  .burden-screen .burden-choice { gap: 8px; }
}

#burden-meter-slot { width: 100%; }
.no-army-warning { font-size: clamp(22px, 2.5vw, 30px); color: #935035; line-height: 1.6; margin: 20px 0; }

.coalition-next { margin-top: 24px; }
.actions .coalition-next { margin-top: 0; }
.coalitions-screen { justify-content: flex-start; }
.coalition-ranking { list-style: none; width: 100%; padding: 0; margin: 0 0 20px; }
.coalition-ranking > li { padding: 16px 0; border-bottom: 1px solid var(--border); }
.coalition-score-heading { display: flex; justify-content: space-between; gap: 20px; font-size: clamp(24px, 3vw, 36px); }

.coalition-score-group { width: 100%; }
.coalition-score-group > h3 { font-size: 23px; margin: 16px 0 0; }
[data-coalition-group="negative"] .coalition-score-heading > bdi { color: #935035; }

.coalition-punchline { font-size: clamp(24px, 3vw, 36px); line-height: 1.5; text-wrap: balance; }
.coalition-question { font-size: clamp(24px, 3vw, 36px); line-height: 1.5; margin-bottom: 12px; }
.coalition-matrix { width: 100%; min-width: 0; margin: 8px 0 28px; }
.coalition-matrix figcaption { font-size: 18px; margin-bottom: 10px; }
.coalition-matrix-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 5px; }
.coalition-matrix table { border-collapse: separate; border-spacing: 3px; font-size: 13px; font-variant-numeric: tabular-nums; }
.coalition-matrix th { font-weight: 600; padding: 4px; white-space: nowrap; }
.coalition-matrix td { min-width: 35px; height: 30px; text-align: center; border-radius: 3px; }
.coalition-matrix abbr { text-decoration: none; }
.coalition-matrix .matrix-positive { background: #edf4eb; color: #092b24; }
.coalition-matrix .matrix-positive[data-band="1"] { background: #d4e5d5; }
.coalition-matrix .matrix-positive[data-band="2"] { background: #a7c9b1; }
.coalition-matrix .matrix-positive[data-band="3"] { background: #6d9e88; }
.coalition-matrix .matrix-positive[data-band="4"] { background: #174d47; color: #fff; }
.coalition-matrix .matrix-blocked { background: #f1d5ca; color: #78371e; }
.coalition-matrix .matrix-unknown { background: #e8e8df; color: #62665e; }
.matrix-legend, .matrix-key { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 8px 0 0; }
.matrix-key { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.coalition-matrix-scroll:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.about-content { max-width: 800px; margin-inline: auto; font-size: clamp(20px, 2.2vw, 25px); line-height: 1.8; }
.about-content h1 { font-size: clamp(42px, 6vw, 64px); }
.about-content h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.4; letter-spacing: -.7px; margin: 36px 0 18px; }
.about-content a, .about-link a { text-underline-offset: 4px; }
