:root {
  color-scheme: light;
  --ink: #1f2030;
  --muted: #68697a;
  --paper: #fffdf8;
  --panel: #ffffff;
  --line: #e6e1d8;
  --accent: #ee4d2d;
  --accent-dark: #c9341b;
  --gold: #f4b942;
  --lime: #d9ef77;
  --success: #237a57;
  --danger: #b32929;
  --shadow: 0 16px 40px rgba(52, 42, 30, 0.09);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(244, 185, 66, 0.14), transparent 28rem),
    var(--paper);
  font-size: 16px;
  line-height: 1.65;
}

button, input, select, textarea { font: inherit; font-size: 16px; }
button, label { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }

.shell { width: min(100% - 32px, 760px); margin-inline: auto; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 52px 0 56px;
  color: #fff;
  background: var(--ink);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 310px;
  height: 310px;
  right: -115px;
  top: -165px;
  border: 62px solid var(--accent);
  transform: rotate(-12deg);
}

.hero::after {
  width: 170px;
  height: 170px;
  left: -110px;
  bottom: -118px;
  background: var(--gold);
}

.hero__inner { position: relative; z-index: 1; }
.eyebrow, .section-label { margin: 0 0 8px; font-weight: 800; letter-spacing: 0.14em; font-size: 0.76rem; }
.eyebrow { color: var(--gold); }

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; max-width: 700px; font-size: clamp(2.2rem, 8vw, 4.5rem); line-height: 1.08; letter-spacing: -0.045em; }
.hero__lead { max-width: 590px; margin: 22px 0 0; color: #e9e8ed; font-weight: 600; }

.event-meta {
  display: flex;
  align-items: baseline;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.event-meta span { color: var(--gold); font-size: 0.8rem; font-weight: 800; }
.event-meta strong { font-size: 1rem; letter-spacing: 0.02em; }
.event-meta small { color: #b9b9c3; }

.main-stack { display: grid; gap: 20px; padding-block: 32px 72px; }
.panel { border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: var(--shadow); }
.vote-panel, .tally-panel, .result-panel { padding: clamp(22px, 5vw, 38px); }

.status-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #eeeaf0;
  color: #51505b;
  font-weight: 800;
  font-size: 0.85rem;
}

.status-pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status-pill--open { color: #126141; background: #def4e8; }
.status-pill--open::before { box-shadow: 0 0 0 5px rgba(18, 97, 65, 0.1); }
.status-pill--closed { color: #695c52; background: #ede8e2; }
.status-pill--published { color: #8a341e; background: #ffe5d9; }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-label { color: var(--accent); }
h2 { margin: 0; font-size: clamp(1.45rem, 4vw, 2rem); line-height: 1.3; }
h3 { margin: 0; }
.change-note { flex: 0 0 auto; padding: 6px 10px; border: 1px solid #d9d0c5; border-radius: 8px; color: var(--muted); font-size: 0.75rem; font-weight: 700; }

.field-group { margin: 0 0 28px; padding: 0; border: 0; }
.field-group > label, .field-group > legend { display: block; margin-bottom: 6px; padding: 0; font-weight: 800; }
.field-help, .field-note { margin: 0; color: var(--muted); font-size: 0.86rem; }
.field-help { margin-bottom: 10px; }
.field-note { margin-top: 7px; }

input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid #cfc8bd;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}

input:focus-visible, select:focus-visible, button:focus-visible, .choice-card:has(input:focus-visible) {
  outline: 3px solid rgba(238, 77, 45, 0.3);
  outline-offset: 2px;
  border-color: var(--accent);
}

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 11px; }
.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 86px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}
.choice-card:active { transform: scale(0.985); }
.choice-card:has(input:checked) { border-color: var(--accent); background: #fff5f0; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-letter { display: grid; flex: 0 0 42px; height: 42px; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font-size: 1.2rem; font-weight: 900; }
.choice-card:has(input:checked) .choice-letter { background: var(--accent); }
.choice-copy { display: grid; min-width: 0; line-height: 1.35; }
.choice-copy strong { font-size: 1rem; }
.choice-copy small { margin-top: 3px; color: var(--muted); font-size: 0.75rem; }
.choice-check { visibility: hidden; margin-left: auto; color: var(--accent); font-weight: 900; }
.choice-card:has(input:checked) .choice-check { visibility: visible; }

.primary-button {
  width: 100%;
  min-height: 56px;
  padding: 13px 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 0 var(--accent-dark);
  font-weight: 900;
  cursor: pointer;
}
.primary-button:hover { background: #f35a3b; }
.primary-button:active { transform: translateY(4px); box-shadow: 0 4px 0 var(--accent-dark); }
.primary-button:disabled { cursor: wait; opacity: 0.65; }

.form-message { min-height: 1.6em; margin: 15px 0 0; text-align: center; font-weight: 700; }
.form-message--error { color: var(--danger); }
.form-message--success { color: var(--success); }

.current-vote { display: flex; gap: 14px; margin-top: 24px; padding: 18px; border-radius: 14px; background: #ecf7f0; color: #174d39; }
.current-vote__icon { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-weight: 900; }
.current-vote p { margin: 3px 0 0; font-size: 0.9rem; }

.total-count { flex: 0 0 auto; display: grid; text-align: right; line-height: 1.05; }
.total-count strong { font-size: 2rem; }
.total-count span { color: var(--muted); font-size: 0.72rem; }
.tally-list { display: grid; gap: 18px; }
.tally-row__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.tally-row__choice { display: inline-grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: var(--ink); font-weight: 900; }
.tally-row__label { font-weight: 800; }
.tally-row__value { margin-left: auto; font-weight: 800; }
.tally-row__value small { color: var(--muted); font-weight: 600; }
.tally-track { overflow: hidden; height: 10px; border-radius: 99px; background: #edeae5; }
.tally-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width 240ms ease; }

.notice-panel { display: flex; align-items: center; gap: 18px; padding: 24px; }
.notice-panel p { margin: 5px 0 0; color: var(--muted); }
.notice-icon { display: grid; flex: 0 0 48px; height: 48px; place-items: center; border-radius: 50%; color: var(--ink); background: var(--gold); font-size: 1.3rem; font-weight: 900; }

.result-panel { border: 2px solid var(--accent); background: linear-gradient(150deg, #fff 60%, #fff1e8); }
.result-spotlight { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.result-spotlight > div { padding: 20px; border-radius: 14px; background: var(--ink); color: #fff; }
.result-spotlight span { display: block; margin-bottom: 7px; color: #c9c8d0; font-size: 0.8rem; font-weight: 700; }
.result-spotlight strong { display: block; font-size: clamp(1.35rem, 5vw, 2.3rem); line-height: 1.2; }
.result-spotlight strong small { margin-left: 4px; font-size: 0.45em; }
.winner-count { margin: 22px 0; text-align: center; font-size: 1.1rem; }
.winner-count strong { color: var(--accent); font-size: 2rem; }
.winner-box { padding: 18px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.winner-box h3 { font-size: 1rem; }
.winner-list { margin: 12px 0 0; padding: 0; list-style: none; }
.winner-list li { padding: 9px 0; border-top: 1px solid var(--line); font-weight: 700; }
.winner-list li::before { content: "●"; margin-right: 10px; color: var(--accent); font-size: 0.6rem; vertical-align: 0.15em; }

.eligibility-note { padding: 8px 6px; color: var(--muted); }
.eligibility-note h2 { color: var(--ink); font-size: 1.05rem; }
.eligibility-note p { margin: 7px 0; }
.eligibility-note small { display: block; }

footer { padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 0.78rem; }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 760px); }
  .hero { padding: 40px 0 42px; }
  .mobile-break { display: block; }
  .main-stack { padding-top: 24px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 76px; }
  .result-spotlight { grid-template-columns: 1fr; }
  .section-heading { margin-bottom: 22px; }
  .change-note { margin-top: 2px; }
}

@media (min-width: 561px) {
  .mobile-break { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
