:root {
  color-scheme: light;
  --page: #faf9f7;
  --surface: #fffefa;
  --ink: #22221f;
  --muted: #595952;
  --line: #d9d7ce;
  --panel: #efeee8;
  --red: #a7232d;
  --blue: #214cb2;
  --bar-red: #d6323c;
  --bar-blue: #3265df;
  --solid: #272722;
  --solid-ink: #fff;
  --focus: #3565c8;
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #191a1b;
  --surface: #222325;
  --ink: #f3f1ec;
  --muted: #bdbdb5;
  --line: #424346;
  --panel: #28292b;
  --red: #ff8b91;
  --blue: #a2bbff;
  --solid: #eceae3;
  --solid-ink: #22221f;
  --focus: #9fbaff;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.5; }
:lang(ko) body { word-break: keep-all; }
button, select, textarea { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
h1, h2, p { margin: 0; }
.sr-only, .trap { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner, main { max-width: 1120px; margin-inline: auto; padding-inline: 32px; }
.topbar-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; font-size: 16px; font-weight: 800; letter-spacing: .075em; white-space: nowrap; }
.brand img { margin-right: 12px; width: 23px; height: 20px; }
.brand span { margin-inline: .27em; color: var(--muted); }
.settings { display: flex; gap: 8px; align-items: center; font-size: .82rem; }
.settings select, .theme, .subtle-button, #report-reason {
  min-height: 40px; padding: 7px 11px; border: 1px solid var(--line);
  border-radius: 5px; background: var(--surface);
}
.theme:hover, .subtle-button:hover, .settings select:hover { background: var(--panel); }

.round-line { padding-block: 24px 21px; border-bottom: 1px solid var(--line); }
.eyebrow { letter-spacing: .04em; font-size: .82rem; font-weight: 650; }
.round-line .eyebrow { font-size: .9rem; }
.hero { text-align: center; padding: 49px 0 11px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.13; font-weight: 750; letter-spacing: -.054em; text-wrap: balance; }
.hero p { color: var(--muted); font-size: clamp(.95rem, 1.8vw, 1.05rem); margin-top: 13px; text-wrap: pretty; }
.choices {
  max-width: 700px; margin-inline: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(4px, 3vw, 32px); padding-bottom: 10px;
}
.choice {
  min-width: 0; appearance: none; padding: 0 4px 3px; border: 0; background: transparent;
  border-radius: 6px; display: grid; justify-items: center; align-content: start;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.choice:disabled { opacity: 1; }
.machine {
  display: block; width: min(91%, 310px); aspect-ratio: 10 / 7; user-select: none;
  background-repeat: no-repeat; background-size: 100% 600%; background-position: 0 0%;
  transition: background-position 125ms steps(5, end);
}
.red .machine { background-image: url('/switch-red.webp'); }
.blue .machine { background-image: url('/switch-blue.webp'); }
.choice:not(:disabled):active .machine, .choice.is-pressed .machine {
  background-position: 0 100%; transition-duration: 72ms;
}
.choice-label {
  display: block; min-height: 37px; padding: 2px 12px; margin-top: -10px;
  font-family: "Arial Black", system-ui, sans-serif;
  font-weight: 900; font-size: 1.82rem; letter-spacing: .035em;
}
.red .choice-label, .red-ink { color: var(--red); }
.blue .choice-label, .blue-ink { color: var(--blue); }
.rules { display: grid; grid-template-columns: 108px 1fr; gap: 8px 20px; max-width: 765px; margin: 19px auto 32px; padding: 17px 0 0; border-top: 1px solid var(--line); font-size: 1.05rem; }
.rules h2 { font-size: 1.08rem; font-weight: 750; }
.rules ul { list-style: none; padding: 0; margin: 0; color: var(--muted); }
.rules li { display: flex; align-items: baseline; gap: 9px; }
.rule-copy { white-space: pre-line; }
.rules li + li { margin-top: 6px; }
.rules li::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; background: var(--bar-red); border-radius: 50%; }
.rules li + li::before { background: var(--bar-blue); }

.results-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; padding-block: 34px 52px; }
.results { min-width: 0; }
.discussion { min-width: 0; border-left: 1px solid var(--line); padding-left: 36px; }
.section-line, .total-line { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.phase { font-size: .76rem; color: var(--muted); padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; }
#result-heading { margin-top: 18px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.13; letter-spacing: -.048em; text-wrap: balance; }
#verdict { margin-block: 12px 22px; color: var(--muted); }
.vote-card { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 21px; }
.vote-numbers { display: flex; justify-content: space-between; gap: 6px; }
.vote-numbers > div { display: grid; font-weight: 750; }
.vote-numbers > div + div { text-align: right; }
.vote-numbers strong { font-size: clamp(1.6rem, 3.4vw, 2.65rem); line-height: 1.15; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.vote-numbers small { color: var(--muted); font-size: .81rem; font-weight: 500; margin-top: 5px; }
.balance { position: relative; display: flex; height: 12px; background: var(--panel); border-radius: 3px; overflow: hidden; margin: 18px 0 10px; }
#red-bar { background: var(--bar-red); }
#blue-bar { background: var(--bar-blue); }
.balance i { position: absolute; inset: 0 auto 0 50%; width: 2px; background: var(--surface); transform: translateX(-50%); }
.total-line, .my-vote { color: var(--muted); font-size: .88rem; }
.my-vote { margin-top: 15px; }
.discussion h2 { font-size: 1.32rem; letter-spacing: -.028em; }
.discussion .section-line { margin-bottom: 12px; }
.discussion-note { color: var(--muted); font-size: .9rem; margin: 5px 0 14px; }
.composer textarea { display: block; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 10px 12px; resize: vertical; min-height: 70px; }
.composer textarea::placeholder { color: var(--muted); }
.composer-actions, .dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-block: 8px; }
.char-count { margin-right: auto; color: var(--muted); font-size: .78rem; }
.solid-button { border: 1px solid transparent; border-radius: 5px; min-height: 40px; padding: 6px 14px; font-size: .86rem; font-weight: 650; background: var(--solid); color: var(--solid-ink); }
.solid-button:disabled { opacity: .56; }
.text-button { border: 0; padding: 5px 4px; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: .17em; font-size: .83rem; min-height: 32px; }
.text-button:hover, .text-button[aria-pressed="true"] { color: var(--ink); }
.text-button:disabled { text-decoration: none; }
.notice { color: var(--red); margin-block: 8px; font-size: .89rem; }
.notice[data-message="posted"], .notice[data-message="reportDone"], .notice:has([data-message="voting"]) { color: var(--muted); }
.empty { color: var(--muted); padding-block: 18px; border-top: 1px solid var(--line); }
#comments { margin-top: 14px; }
.comment { border-top: 1px solid var(--line); padding-block: 12px 9px; }
.comment-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; font-size: .82rem; }
.comment-meta time { color: var(--muted); font-size: .76rem; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; margin-top: 4px; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; }
.replies { border-left: 1px solid var(--line); margin: 6px 0 5px 8px; padding-left: 12px; }
.reply-slot:not(:empty) { margin-top: 8px; }
dialog { max-width: min(390px, calc(100% - 32px)); width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 22px; }
dialog::backdrop { background: #12121990; }
dialog h2 { font-size: 1.2rem; margin-bottom: 12px; }
dialog label { display: block; margin-bottom: 4px; }
dialog select { width: 100%; }
footer { border-top: 1px solid var(--line); padding-block: 17px 24px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--muted); font-size: .78rem; }
.footer-brand { white-space: nowrap; letter-spacing: .12em; }
footer details { max-width: 580px; }
footer summary { text-align: right; }
footer p { margin-top: 8px; }

@media (max-width: 720px) {
  .topbar-inner, main { padding-inline: 20px; }
  .topbar-inner { min-height: 62px; }
  .hero { padding-block: 36px 15px; }
  .round-line { padding-block: 18px 15px; }
  .results-grid { grid-template-columns: 1fr; gap: 24px; padding-block: 24px 32px; }
  .discussion { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0 0; }
  .text-button { min-height: 40px; }
}
@media (max-width: 460px) {
  .topbar-inner, main { padding-inline: 15px; }
  .brand { font-size: 13px; }
  .brand img { width: 18px; height: 16px; margin-right: 7px; }
  .settings { gap: 5px; font-size: .75rem; }
  .settings select, .theme { min-height: 39px; padding-inline: 6px; }
  .hero { padding-block: 32px 17px; }
  .hero p { margin-top: 11px; }
  .choices { padding-bottom: 4px; }
  .choice-label { margin-top: -5px; font-size: 1.53rem; }
  .rules { grid-template-columns: 1fr; margin-top: 17px; font-size: 1rem; }
  .eyebrow { font-size: .70rem; }
  .vote-card { padding: 15px; }
  textarea, #report-reason { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
