:root {
  --ink: #f1eadc;
  --ink-dim: #aaa397;
  --night: #0e0f0f;
  --night-soft: #141514;
  --panel: #191a18;
  --panel-lift: #20211e;
  --line: rgba(232, 217, 187, .14);
  --gold: #c99a52;
  --gold-light: #e2c17f;
  --ember: #a34e40;
  --green: #82a48a;
  --paper: #dfd0ad;
  --paper-ink: #292720;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(163, 78, 64, .1), transparent 32rem),
    linear-gradient(180deg, #121311 0, var(--night) 42rem),
    var(--night);
  font-family: var(--sans);
  line-height: 1.55;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; opacity: .07; z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 99; background: var(--gold); color: #111; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }
.page-shell { width: min(1080px, calc(100% - 2.5rem)); margin-inline: auto; }
.site-header {
  height: 66px; padding: 0 max(1.25rem, calc((100% - 1080px) / 2)); display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); position: relative; z-index: 10; background: rgba(14, 15, 15, .9); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; text-transform: uppercase; letter-spacing: .13em; font-size: .73rem; font-weight: 750; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(201,154,82,.7); border-radius: 50%; color: var(--gold); }
.text-button { border: 0; background: none; padding: .45rem 0; color: var(--ink-dim); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.text-button:hover { color: var(--gold-light); text-decoration-color: currentColor; }
.eyebrow, .form-kicker { margin: 0 0 .65rem; color: var(--gold); text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 800; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.12; font-weight: 500; margin-top: 0; }
h1 { font-size: clamp(2.7rem, 6vw, 4.9rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.025em; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }
em { color: var(--gold-light); font-weight: 400; }
.lede { color: var(--ink-dim); font-size: clamp(1rem, 1.8vw, 1.18rem); max-width: 40rem; }

.gate { min-height: calc(100vh - 140px); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(3rem, 8vw, 7rem); padding-block: 5rem; }
.gate-copy h1 { margin-bottom: 1.6rem; }
.ornament { display: flex; align-items: center; gap: 1rem; color: var(--gold); font: italic .9rem var(--serif); margin-top: 2.5rem; opacity: .7; }
.ornament span { width: 5rem; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.ornament span:last-child { transform: rotate(180deg); }
.parchment { color: var(--paper-ink); background: linear-gradient(145deg, #e5d7b7, var(--paper)); border-radius: 10px; box-shadow: var(--shadow); position: relative; }
.parchment::before { content: ''; position: absolute; inset: 7px; pointer-events: none; border: 1px solid rgba(57, 42, 28, .18); border-radius: 6px; }
.gate-form { padding: clamp(2rem, 5vw, 3.4rem); }
.gate-form h2 { font-size: 2.5rem; margin-bottom: .7rem; }
.gate-form p:not(.form-kicker):not(.fine-print) { color: #645443; }
.seal { position: absolute; right: 2rem; top: -1.45rem; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; color: #ead2a0; font: bold 1rem var(--serif); background: #7e392f; border: 3px double rgba(43, 13, 10, .55); box-shadow: 0 6px 14px #0005; }
label { display: block; font-size: .77rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
label > span { color: var(--ink-dim); font-weight: 500; text-transform: none; letter-spacing: 0; }
input, textarea, select {
  width: 100%; margin-top: .5rem; border: 1px solid var(--line); border-radius: 6px; padding: .85rem 1rem; color: var(--ink); background: rgba(0, 0, 0, .18); outline: 0; transition: border-color .2s, box-shadow .2s;
}
.parchment input { color: var(--paper-ink); border: 0; border-bottom: 1px solid #74634d; background: rgba(255, 255, 255, .12); border-radius: 0; font-family: var(--serif); font-size: 1.15rem; }
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 169, 77, .12); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .8rem; border: 1px solid transparent; border-radius: 5px; padding: .82rem 1.2rem; cursor: pointer; text-decoration: none; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 850; transition: transform .16s, background .16s, color .16s; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: #21160b; background: var(--gold); }
.button-primary:hover { background: var(--gold-light); }
.button:disabled { cursor: wait; opacity: .7; transform: none; }
.gate-form .button { width: 100%; margin-top: 1.5rem; }
.button-secondary { color: #21160b; background: var(--gold); }
.button-ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.button-small { padding: .55rem .75rem; background: var(--gold); color: #21160b; }
.fine-print { text-align: center; color: #6d5b45; font-size: .72rem; margin: 1rem 0 0; }

.flash-stack { position: fixed; top: 88px; right: 1rem; z-index: 30; width: min(430px, calc(100% - 2rem)); display: grid; gap: .6rem; }
.flash { background: #2c241e; border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 1rem 1.2rem; box-shadow: var(--shadow); font-size: .88rem; }
.flash-error { border-left-color: #c95e50; }
.flash-success { border-left-color: var(--green); }
.flash-code { border: 1px solid var(--gold); color: var(--gold-light); }

.campaign-hero { min-height: 310px; display: flex; align-items: center; border-bottom: 1px solid var(--line); padding-block: 4.5rem 3.5rem; }
.campaign-hero > div { max-width: 760px; }
.campaign-hero h1 { margin: 0 0 .45rem; }
.hero-tagline { color: var(--gold-light); font: italic 1.3rem var(--serif); margin: 0 0 1.2rem; }
.hero-premise { max-width: 45rem; color: var(--ink-dim); font-size: 1.04rem; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.4rem; }
.section-heading h2 { margin-bottom: 0; }.section-heading > p { color: var(--ink-dim); max-width: 24rem; text-align: right; }
.council { padding-block: 4rem 7rem; }
.poll-list { display: grid; gap: 1.15rem; }
.poll-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: clamp(1.35rem, 3vw, 2.2rem); box-shadow: 0 10px 30px rgba(0,0,0,.16); }
.poll-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .67rem; font-weight: 750; }
.status-pill { color: var(--ink-dim); border: 1px solid var(--line); border-radius: 99px; padding: .28rem .62rem; background: rgba(255,255,255,.025); }
.status-pill i { display: inline-block; width: 6px; height: 6px; margin-right: .35rem; border-radius: 50%; background: #79aa7d; box-shadow: 0 0 8px #79aa7d; }
.poll-card h3 { margin: 1.1rem 0 .5rem; max-width: 48rem; }.poll-context { color: var(--ink-dim); max-width: 48rem; margin-bottom: 0; }
.ballot { margin-top: 1.5rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .65rem; }
.choice { min-height: 82px; padding: 1rem; display: flex; align-items: flex-start; gap: .8rem; border: 1px solid var(--line); border-radius: 7px; background: rgba(0,0,0,.13); cursor: pointer; text-transform: none; letter-spacing: 0; transition: border-color .16s, background .16s, transform .16s; }
.choice:hover, .choice:has(input:focus-visible) { border-color: rgba(201,154,82,.55); background: rgba(201,154,82,.045); transform: translateY(-1px); }
.choice.chosen, .choice:has(input:checked) { border-color: var(--gold); background: rgba(201,154,82,.105); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-marker { width: 18px; height: 18px; border: 1px solid #827b70; border-radius: 50%; flex: 0 0 auto; margin-top: .15rem; box-shadow: inset 0 0 0 3px var(--panel); }
.choice.multi .choice-marker { border-radius: 2px; }
.choice input:checked + .choice-marker { border: 5px solid var(--gold); background: var(--gold-light); }
.choice strong { display: block; color: var(--ink); font: 600 .97rem/1.4 var(--sans); }.choice small { display: block; color: var(--ink-dim); margin-top: .35rem; font-size: .8rem; line-height: 1.4; }
.ballot-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .6rem; color: var(--ink-dim); font-size: .77rem; }
.ballot.saving { pointer-events: none; }
.results { margin-top: 2rem; display: grid; gap: 1.3rem; }.result-row > div:first-child { display: flex; justify-content: space-between; margin-bottom: .4rem; }.result-row strong { color: var(--ink-dim); font-size: .72rem; }.result-bar { appearance: none; display: block; width: 100%; height: 8px; border: 0; overflow: hidden; background: #100d0b; }.result-bar::-webkit-progress-bar { background: #100d0b; }.result-bar::-webkit-progress-value { background: #635c51; }.result-bar::-moz-progress-bar { background: #635c51; }.my-result .result-bar::-webkit-progress-value { background: var(--gold); }.my-result .result-bar::-moz-progress-bar { background: var(--gold); }.my-result > div:first-child span::after { content: ' · your choice'; color: var(--gold); font-size: .72rem; }
.empty-state { padding: 4rem 2rem; text-align: center; }.empty-state h3 { font-size: 2rem; margin-bottom: .5rem; }.empty-state p { color: #675643; max-width: 33rem; margin: auto; }.empty-icon { font-size: 2.5rem; color: #76572e; }

.centered-page { min-height: calc(100vh - 140px); display: grid; place-items: center; padding-block: 4rem; }.compact-form { width: min(470px, 100%); padding: 3rem; }.compact-form h1 { font-size: 2.8rem; margin-bottom: .5rem; }.compact-form .button { width: 100%; margin-top: 1.5rem; }
.dashboard { padding-block: 4rem 7rem; }.dashboard-title { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 3rem; }.dashboard-title h1 { font-size: clamp(2.7rem, 6vw, 4.8rem); margin: 0; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }.admin-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: clamp(1.25rem, 3vw, 2rem); }.wide-panel { margin-top: 1.1rem; }.panel-heading { display: flex; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 1.3rem; margin-bottom: 1.5rem; }.panel-number { color: var(--gold); font: italic 1.1rem var(--serif); }.panel-heading h2 { font-size: 1.8rem; margin: 0 0 .2rem; }.panel-heading p { color: var(--ink-dim); margin: 0; font-size: .82rem; }.stack-form { display: grid; gap: 1rem; }.stack-form .button { justify-self: start; }.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: .7rem; align-items: end; }.player-list { margin-top: 1.5rem; display: grid; }.player-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .8rem 0; border-top: 1px solid var(--line); }.player-row.inactive { opacity: .45; }.avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--gold); color: var(--gold); border-radius: 50%; font: 1rem var(--serif); }.player-row small { display: block; color: var(--ink-dim); }.muted { color: var(--ink-dim); }.poll-admin-grid { display: grid; grid-template-columns: minmax(280px, .8fr) 1.2fr; gap: 2rem; }.new-poll { padding-right: 2rem; border-right: 1px solid var(--line); }.admin-polls { display: grid; gap: .8rem; align-content: start; }.admin-poll { background: rgba(0,0,0,.14); border: 1px solid var(--line); border-radius: 7px; padding: 1.2rem; }.admin-poll h3 { font-size: 1.3rem; margin: 1rem 0; }.admin-poll ul { list-style: none; margin: 0; padding: 0; }.admin-poll li { display: flex; justify-content: space-between; padding: .42rem 0; color: var(--ink-dim); border-top: 1px solid rgba(255,255,255,.04); font-size: .82rem; }.admin-poll-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; color: var(--ink-dim); font-size: .75rem; }
.toggle-field { display: flex; align-items: center; gap: .7rem; cursor: pointer; }
.toggle-field input { width: auto; margin: 0; accent-color: var(--gold); }
.toggle-field span { color: var(--ink); font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
footer { min-height: 70px; padding: 1.5rem max(1.25rem, calc((100% - 1080px) / 2)); border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #77736b; font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; }.footer-rune { color: var(--gold); }

@media (max-width: 850px) {
  .gate { grid-template-columns: 1fr; gap: 2.5rem; padding-block: 3.5rem; }.gate-copy h1 { font-size: clamp(3.2rem, 14vw, 5rem); }
  .campaign-hero { min-height: auto; }
  .ballot { grid-template-columns: 1fr; }.dashboard-grid, .poll-admin-grid { grid-template-columns: 1fr; }.new-poll { border: 0; padding: 0 0 2rem; border-bottom: 1px solid var(--line); }
  .inline-form { grid-template-columns: 1fr; }.section-heading { align-items: start; flex-direction: column; }.section-heading > p { text-align: left; margin: 0; }.dashboard-title { align-items: start; flex-direction: column; }
}
@media (max-width: 560px) {
  .page-shell { width: min(100% - 1.5rem, 1080px); }.site-header { height: 62px; }.brand { letter-spacing: .08em; }.gate { padding-top: 2.5rem; }.gate-form { padding: 2rem 1.5rem; }
  .campaign-hero { padding-block: 3rem 2.5rem; }.campaign-hero h1 { font-size: 3rem; }.ballot-footer, .admin-poll-footer { align-items: stretch; flex-direction: column; }.ballot-footer .button { width: 100%; }
  .dashboard { padding-top: 2.5rem; }.dashboard-title .button { width: 100%; }.flash-stack { top: 74px; } footer { align-items: center; gap: 1rem; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
