:root {
  --paper: #f4ecd8;
  --paper-2: #ebdfc2;
  --card: #fffaf0;
  --ink: #14213d;
  --navy: #1d2f5e;
  --red: #c8102e;
  --red-dark: #9e0c24;
  --gold: #d4a017;
  --muted: #5b6276;
  --line: rgba(20, 33, 61, 0.18);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);

  --font-display: 'Anton', 'Impact', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-type: 'Special Elite', 'Courier New', monospace;

  --text-hero: clamp(2.6rem, 1.2rem + 6vw, 5.5rem);
  --space-section: clamp(2.5rem, 2rem + 3vw, 4.5rem);
  --radius: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 150ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(20, 33, 61, 0.07) 1px, transparent 1.2px);
  background-size: 6px 6px;
  line-height: 1.55;
}
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; line-height: 1.05; text-transform: uppercase; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem); margin-top: var(--space-section); }
h3 { font-size: 1.3rem; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 0.85rem; color: var(--muted); }
.kicker { font-family: var(--font-type); color: var(--red); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 0.6rem; font-size: 0.9rem; }
.label { font-family: var(--font-type); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; margin: 0 0 0.5rem; }
[hidden] { display: none !important; }

/* ---------- Strip, header, nav ---------- */
.satire-strip { background: var(--ink); color: var(--paper); font-size: 0.72rem; letter-spacing: 0.12em; text-align: center; padding: 6px 16px; text-transform: uppercase; }
.strip-short { display: none; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem clamp(16px, 4vw, 48px);
  background: var(--paper);
  border-bottom: 3px double var(--ink);
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.brand-text strong { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; letter-spacing: 0.04em; line-height: 1; }
.brand-text small { font-family: var(--font-type); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.site-nav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.site-nav a {
  font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink); text-decoration: none; padding: 0.45rem 0.7rem; border-radius: var(--radius);
  transition: background var(--fast), color var(--fast);
}
.site-nav a:hover { background: var(--paper-2); }
.site-nav a[aria-current] { background: var(--ink); color: var(--paper); }
.nav-toggle { display: none; background: var(--ink); color: var(--paper); border: 0; font-size: 1.3rem; width: 44px; height: 44px; border-radius: var(--radius); cursor: pointer; }

/* ---------- Ticker ---------- */
.ticker { display: flex; background: var(--red); color: #fff; border-bottom: 3px solid var(--ink); overflow: hidden; }
.ticker-label { background: var(--ink); padding: 0.45rem 0.9rem; font-family: var(--font-display); letter-spacing: 0.08em; flex-shrink: 0; z-index: 1; }
.ticker-track { overflow: hidden; flex: 1; }
.ticker-inner { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker-item { padding: 0.45rem 2rem; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.05em; white-space: nowrap; }
.ticker-item::after { content: '★'; margin-left: 2rem; color: var(--gold); }
.ticker:hover .ticker-inner { animation-play-state: paused; }
.bunting {
  height: 18px; margin-bottom: -18px; position: relative; z-index: 2; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='18'%3E%3Cpath d='M1 0h22L12 16z' fill='%23c8102e' stroke='%2314213d'/%3E%3Cpath d='M25 0h22L36 16z' fill='%23fffaf0' stroke='%2314213d'/%3E%3Cpath d='M49 0h22L60 16z' fill='%231d2f5e' stroke='%2314213d'/%3E%3C/svg%3E") repeat-x top left;
  filter: drop-shadow(0 2px 0 rgba(20, 33, 61, 0.15));
}

/* Bottom tab bar (phones only) */
.tabbar { display: none; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Layout ---------- */
main { max-width: 1180px; margin: 0 auto; padding: clamp(1.5rem, 3vw, 3rem) clamp(16px, 4vw, 48px) 4rem; }
.page-head { max-width: 720px; margin-bottom: 2rem; }
.page-head h1 { font-size: clamp(2.2rem, 1.4rem + 3.5vw, 4rem); }
.page-head p:last-child { font-size: 1.05rem; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: var(--space-section); }
.section-head h2 { margin: 0 0 1rem; }
.link { font-weight: 800; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font: 800 0.95rem var(--font-body); text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.85rem 1.4rem; border-radius: var(--radius); border: 3px solid var(--ink);
  cursor: pointer; text-decoration: none; box-shadow: var(--shadow);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: var(--card); color: var(--ink); }
.btn-block { width: 100%; }
.btn-text { background: none; border: 0; padding: 0.3rem 0; color: var(--red); font: 600 0.9rem var(--font-body); text-decoration: underline; cursor: pointer; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; margin-top: 1.5rem; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero h1 { font-size: var(--text-hero); color: var(--navy); margin-bottom: 0.3em; }
.hero h1::first-line { color: var(--red); }
.lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); max-width: 34ch; }
/* Poster fan */
.hero-art { min-width: 0; }
.fan { position: relative; display: block; height: clamp(250px, 34vw, 430px); container-type: inline-size; }
.fan-card { position: absolute; top: 50%; left: 50%; width: 44%; transition: transform 350ms var(--ease); animation: deal 700ms var(--ease) both; }
.fan-card .poster { font-size: 2.35cqi; box-shadow: 6px 6px 0 var(--ink); }
.fan-front { z-index: 3; transform: translate(-50%, -50%) rotate(-2deg); animation-delay: 300ms; }
.fan-left { z-index: 2; transform: translate(-108%, -46%) rotate(-11deg); animation-delay: 150ms; }
.fan-right { z-index: 1; transform: translate(8%, -46%) rotate(10deg); }
.fan:hover .fan-front { transform: translate(-50%, -55%) rotate(0deg) scale(1.03); }
.fan:hover .fan-left { transform: translate(-118%, -46%) rotate(-15deg); }
.fan:hover .fan-right { transform: translate(18%, -46%) rotate(14deg); }
.fan-crown { position: absolute; top: -0.9em; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: clamp(1.8rem, 5cqi, 3rem); filter: drop-shadow(2px 2px 0 var(--ink)); }
.stamp {
  position: absolute; z-index: 4; right: 2%; bottom: 4%;
  width: clamp(78px, 20cqi, 120px); aspect-ratio: 1; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--red); border: 3px double var(--red); background: rgba(255, 250, 240, 0.92);
  font-family: var(--font-type); font-size: clamp(0.55rem, 1.9cqi, 0.75rem); text-transform: uppercase; line-height: 1.15; text-align: center;
  transform: rotate(-14deg); animation: stampIn 500ms 900ms var(--ease) both;
}
.stamp strong { font-family: var(--font-display); font-weight: 400; font-size: 1.6em; letter-spacing: 0.04em; }
@container (max-width: 460px) {
  .fan-card .poster-slogan, .fan-card .poster-paid { display: none; }
  .fan-card .poster-name { font-size: 1.7em; }
}
@keyframes deal { from { opacity: 0; translate: 0 40px; } }
@keyframes stampIn { from { opacity: 0; scale: 2.2; } }

/* Countdown ribbon */
.poll-strip {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  display: grid; grid-template-columns: auto 1fr; gap: 1rem 2.5rem; align-items: center;
  background: var(--navy); color: var(--paper);
  padding: 1.1rem 1.4rem; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.poll-strip .label { color: var(--gold); }
.poll-strip .small { color: rgba(244, 236, 216, 0.72); margin: 0.5rem 0 0; font-size: 0.78rem; }
.poll-strip .stats { margin: 0; padding: 0 0 0 2rem; border-top: 0; border-left: 1px dashed rgba(212, 160, 23, 0.5); }
.countdown { display: grid; grid-template-columns: repeat(4, minmax(64px, 1fr)); gap: 0.5rem; }
.cd-unit { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(212, 160, 23, 0.4); border-radius: var(--radius); text-align: center; padding: 0.6rem 0.2rem; }
.cd-unit strong { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 1rem + 2vw, 2.4rem); font-weight: 400; color: #fff; }
.cd-unit span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); }
.closed { grid-column: 1 / -1; font-family: var(--font-display); font-size: 2rem; color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 1.2rem; border-top: 1px dashed rgba(212, 160, 23, 0.5); padding-top: 1rem; }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 400; }
.stat span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.8; }

/* ---------- Poster ---------- */
.poster {
  --poster-bg: var(--red);
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 7% 7% 6%; text-align: center; color: #fff;
  background-color: var(--poster-bg);
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.2px, transparent 1.4px);
  background-size: 7px 7px;
  border: 4px solid var(--ink); border-radius: var(--radius);
  outline: 3px solid var(--paper); outline-offset: -10px;
}
.poster-top { font-family: var(--font-display); letter-spacing: 0.2em; color: var(--gold); font-size: 0.85em; text-shadow: 1px 1px 0 var(--ink); }
.poster-art { flex: 1; display: grid; place-items: center; width: 100%; min-height: 0; }
.poster-art img { width: 82%; aspect-ratio: 1; object-fit: cover; border: 3px solid var(--paper); border-radius: 50%; }
.poster-emoji { font-size: 4.2em; line-height: 1; filter: drop-shadow(3px 3px 0 rgba(20, 33, 61, 0.55)); }
.poster-name { font-family: var(--font-display); text-transform: uppercase; font-size: 1.45em; line-height: 1; background: var(--paper); color: var(--ink); padding: 0.25em 0.45em; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--ink); max-width: 100%; overflow-wrap: anywhere; }
.poster-slogan { font-family: var(--font-type); font-size: 0.82em; margin-top: 0.7em; line-height: 1.3; text-shadow: 1px 1px 0 rgba(20, 33, 61, 0.6); overflow-wrap: anywhere; }
.poster-paid { font-size: 0.55em; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; margin-top: 0.6em; border: 1px solid rgba(255, 255, 255, 0.6); padding: 0.15em 0.5em; overflow-wrap: anywhere; }
/* Posters scale with the box they sit in, so one design works from phone thumbnails to the big preview. */
.debate-side, .card, .poster-box, #create-preview { container-type: inline-size; }
.poster { font-size: clamp(7px, 5.4cqi, 21px); }
@container (max-width: 170px) {
  .poster-slogan, .poster-paid { display: none; }
  .poster-name { font-size: 1.6em; }
}


/* ---------- Loop, formats, phases ---------- */
.loop { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.loop li { padding: 1.2rem 1rem; border-right: 2px dashed var(--line); }
.loop li:last-child { border-right: 0; }
.loop .step { display: block; font-family: var(--font-display); font-size: 2.4rem; color: var(--red); line-height: 1; }
.loop strong { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 1.2rem; }
.loop p { margin: 0.3rem 0 0; font-size: 0.9rem; color: var(--muted); }
.formats { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: auto auto; gap: 1rem; }
.format { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 1.3rem; }
.format:first-child { grid-row: span 2; background: var(--navy); color: var(--paper); display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow-lg); }
.format:first-child h3 { font-size: 2rem; color: var(--gold); }
.format:last-child { grid-column: span 2; background: var(--red); color: #fff; }
.format p { margin: 0; font-size: 0.92rem; }
.format-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.phases { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; counter-reset: phase; }
.phases li { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0.3rem 1rem; align-items: baseline; padding: 0.9rem 1.1rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card); }
.phases strong { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 1.1rem; }
.phases span { color: var(--ink); font-size: 0.92rem; }
/* Every phase stays fully visible; finished ones just get a check mark. */
.phases .done strong::before { content: '✓ '; color: var(--red); }
.phases .current { border: 3px solid var(--ink); background: var(--gold); box-shadow: var(--shadow); }
.phases .current span { color: var(--ink); }

/* ---------- Debate ---------- */
.page-head-compact { margin-bottom: 1.2rem; }
.page-head-compact h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-bottom: 0.25em; }
.page-head-compact p:last-child { font-size: 0.98rem; margin: 0; }
.debate { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(0.8rem, 3vw, 2.5rem); align-items: center; max-width: 880px; margin: 0 auto; }
/* Keep both posters and the buttons on one laptop screen. */
.debate-side .poster { width: min(100%, max(200px, calc((100dvh - 430px) * 0.75))); margin-inline: auto; }
.debate-side { position: relative; background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 0.9rem; cursor: pointer; text-align: center; font: inherit; color: inherit; box-shadow: var(--shadow); transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), opacity 200ms; }
.debate-side:hover { transform: translate(-3px, -3px) rotate(-0.6deg); box-shadow: var(--shadow-lg); }
.debate-side:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.debate-party { display: block; margin-top: 0.7rem; font-family: var(--font-type); font-size: 0.85rem; color: var(--muted); }
.debate-pick { display: inline-block; margin-top: 0.5rem; font-weight: 800; text-transform: uppercase; font-size: 0.85rem; color: var(--red); letter-spacing: 0.04em; }
.debate.decided .debate-side:not(.won) { opacity: 0.35; transform: scale(0.96); }
.debate-side.won { transform: scale(1.03) rotate(-1deg); border-color: var(--gold); box-shadow: 8px 8px 0 var(--gold); }
.debate-side.won::after { content: 'WINNER'; position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-12deg); font-family: var(--font-display); font-size: 2.6rem; color: var(--red); background: var(--paper); border: 4px solid var(--red); padding: 0 0.5rem; }
.vs { font-family: var(--font-display); font-size: clamp(2rem, 1rem + 4vw, 4rem); color: var(--red); text-shadow: 3px 3px 0 var(--ink); }
.debate-meta { display: flex; justify-content: center; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- Gallery ---------- */
.toolbar { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.toolbar input, .toolbar select { font: 600 1rem var(--font-body); padding: 0.7rem 0.9rem; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.toolbar input { min-width: min(320px, 100%); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.4rem; }
.card { position: relative; text-decoration: none; color: var(--ink); background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: 0.7rem; box-shadow: var(--shadow); transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.card:hover { transform: translate(-3px, -3px) rotate(-0.5deg); box-shadow: var(--shadow-lg); }
.card-rank { position: absolute; top: -12px; right: -8px; z-index: 2; background: var(--ink); color: var(--paper); font-family: var(--font-display); padding: 0.05rem 0.55rem; border-radius: var(--radius); }
.card-body { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; font-size: 0.8rem; }
.card-party { font-weight: 800; }
.card-creator { color: var(--muted); }
.empty { padding: 2rem; text-align: center; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: rgba(255, 250, 240, 0.6); }

/* ---------- Create ---------- */
.create-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.create-form { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 2rem); box-shadow: var(--shadow-lg); }
.field { margin: 0 0 1.2rem; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.field input:not([type='checkbox']):not([type='radio']), .field textarea { width: 100%; font: 1rem var(--font-body); padding: 0.7rem 0.85rem; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; color: var(--ink); }
.field input:focus, .field textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.field textarea { resize: vertical; }
.req { color: var(--red); }
.hint, .counter { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.emoji-picker, .color-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.swatch { position: relative; cursor: pointer; margin: 0 !important; }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.emoji-swatch span { display: grid; place-items: center; width: 44px; height: 44px; font-size: 1.5rem; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; transition: transform var(--fast); }
.emoji-swatch input:checked + span { border: 3px solid var(--ink); background: var(--gold); transform: scale(1.08); }
.color-dot { display: block; width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--paper); box-shadow: 0 0 0 2px var(--line); }
.swatch input:checked + .color-dot { box-shadow: 0 0 0 3px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.checks label { display: flex; justify-content: flex-start; gap: 0.6rem; align-items: flex-start; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.92rem; margin-bottom: 0.5rem; }
.checks input { margin-top: 0.25rem; accent-color: var(--red); width: 18px; height: 18px; flex-shrink: 0; }
.form-error { color: var(--red); font-weight: 800; min-height: 1.4em; margin: 0 0 0.8rem; }
.create-preview { position: sticky; top: 100px; max-width: 380px; width: 100%; justify-self: center; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.board { width: 100%; border-collapse: collapse; min-width: 520px; }
.board th { background: var(--ink); color: var(--paper); text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 0.75rem 1rem; }
.board td { padding: 0.75rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.board tr.top { background: rgba(212, 160, 23, 0.14); }
.board tr.total td { font-weight: 800; background: var(--paper-2); }
.rank-cell { font-family: var(--font-display); font-size: 1.4rem; color: var(--red); width: 60px; }
.board-name { display: flex; gap: 0.7rem; align-items: center; text-decoration: none; color: var(--ink); }
.board-name strong { display: block; }
.board-name small { color: var(--muted); }
.board-name:hover strong { color: var(--red); }
.board-avatar { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; font-size: 1.3rem; border-radius: 50%; background: var(--poster-bg); border: 2px solid var(--ink); }
.bar { display: inline-block; min-width: 110px; padding: 0.15rem 0.5rem; font-weight: 800; font-size: 0.85rem; background: linear-gradient(90deg, rgba(200, 16, 46, 0.25) var(--w), transparent var(--w)); border: 1px solid var(--line); border-radius: 3px; }
.note { margin-top: 1rem; }

/* ---------- Rewards ---------- */
.filing { background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); font-family: var(--font-type); box-shadow: var(--shadow); max-width: 760px; }
.filing-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 1.1rem; border-bottom: 1px dashed var(--line); }
.filing-row:last-child { border-bottom: 0; }
.filing-row span { color: var(--muted); }
.filing-row strong { font-weight: 400; text-align: right; }
.tag { display: inline-block; vertical-align: middle; font-family: var(--font-body); font-size: 0.75rem; background: var(--gold); color: var(--ink); padding: 0.2rem 0.6rem; border-radius: 99px; letter-spacing: 0.04em; }
.disclaimer { margin-top: var(--space-section); background: #fff4d6; border: 3px solid var(--gold); border-left-width: 10px; border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.disclaimer strong { text-transform: uppercase; letter-spacing: 0.08em; }
.disclaimer p { margin: 0.4rem 0 0; }

/* ---------- Constitution ---------- */
.articles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; background: var(--card); border: 3px double var(--ink); border-width: 6px; padding: clamp(1rem, 3vw, 2rem); border-radius: var(--radius); }
.articles article { padding: 1rem; border-bottom: 1px dashed var(--line); }
.articles h3 { color: var(--navy); }
.articles p { margin: 0; font-family: var(--font-type); font-size: 0.95rem; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 33, 61, 0.7); animation: fade 200ms ease; }
.modal-card { position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-width: 860px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; padding: clamp(1.2rem, 3vw, 2rem); animation: pop 250ms var(--ease); }
.modal-close { position: absolute; top: 8px; right: 10px; z-index: 2; width: 40px; height: 40px; font-size: 1.8rem; line-height: 1; background: var(--ink); color: var(--paper); border: 0; border-radius: var(--radius); cursor: pointer; }
.candidate { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 1.8rem; align-items: start; }
.candidate h2 { font-size: clamp(2rem, 1.4rem + 2vw, 3rem); margin-top: 0; }
.candidate-slogan { font-family: var(--font-type); font-size: 1.15rem; color: var(--red); }
.candidate-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1rem 0; }
.candidate-stats .stat { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); padding: 0.6rem; text-align: center; }
.sticker-wrap { text-align: center; padding: 1rem 0; }
.sticker-wrap h2 { margin-top: 1.2rem; }
.sticker { width: 200px; height: 200px; margin: 0 auto; border-radius: 50%; background: var(--red); color: #fff; border: 6px solid var(--paper); box-shadow: 0 0 0 4px var(--ink), var(--shadow-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-8deg); animation: stamp 400ms var(--ease); }
.sticker-top, .sticker-bottom { font-family: var(--font-display); letter-spacing: 0.1em; }
.sticker-top { font-size: 2rem; }
.sticker-crown { font-size: 3rem; line-height: 1.1; }
.sticker-bottom { font-size: 1.1rem; color: var(--gold); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-30deg) scale(1.6); } }

/* ---------- Toast & footer ---------- */
.toast { pointer-events: none; position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 140%); opacity: 0; background: var(--ink); color: var(--paper); padding: 0.85rem 1.3rem; border-radius: var(--radius); border: 2px solid var(--gold); font-weight: 600; max-width: calc(100vw - 32px); transition: transform 300ms var(--ease), opacity 300ms; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.site-footer { border-top: 3px double var(--ink); padding: 2rem clamp(16px, 4vw, 48px); text-align: center; font-size: 0.9rem; max-width: 900px; margin: 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .site-header {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}


  .brand {
    flex: 1;
    min-width: 0;
  }

  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    position: relative;
    z-index: 32;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--paper);
    border-bottom: 3px solid var(--ink);
    padding: 0.5rem 16px 1rem;
    z-index: 31;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.75rem;
  }
  .hero, .create-layout { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 520px; width: 100%; margin: 0 auto; }
  .fan { height: clamp(210px, 58vw, 320px); }
  .poll-strip { grid-template-columns: 1fr; }
  .poll-strip .stats { padding: 0.9rem 0 0; border-left: 0; border-top: 1px dashed rgba(212, 160, 23, 0.5); }
  .loop { grid-template-columns: 1fr; }
  .loop li { border-right: 0; border-bottom: 2px dashed var(--line); }
  .formats { grid-template-columns: 1fr 1fr; }
  .format:first-child { grid-row: auto; grid-column: span 2; }
  .create-preview { position: static; max-width: 320px; }
  .articles { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --space-section: 2.4rem; --shadow-lg: 5px 5px 0 var(--ink); }
  .strip-long { display: none; }
  .strip-short { display: inline; }
  .satire-strip { font-size: 0.66rem; letter-spacing: 0.08em; padding: 5px 12px; }
  .site-header { padding: 0.55rem 16px; }
  .brand-logo {
  width: 52px;
  height: 52px;
}
  .brand-text strong { font-size: 1.4rem; }
  .brand-text small { display: none; }
  .ticker-label { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
  .ticker-item { font-size: 0.78rem; padding: 0.4rem 1.2rem; }
  main { padding-top: 1.2rem; }
  .page-head { margin-bottom: 1.3rem; }

  /* Hero */
  .hero { gap: 0.6rem; }
  .hero-art { overflow-x: clip; padding-top: 14px; }
  .fan { height: 230px; }
  .fan-card { width: 35%; }
  .fan-card .poster { font-size: 1.9cqi; box-shadow: 4px 4px 0 var(--ink); }
  .stamp { width: 74px; right: 4%; bottom: 0; font-size: 0.5rem; }
  .hero h1 { font-size: clamp(2.6rem, 13vw, 3.4rem); }
  .lead { font-size: 1rem; margin: 0; }
  .cta-row { margin-top: 1.1rem; }
  .cta-row .btn { flex: 1 1 140px; padding: 0.8rem 0.7rem; font-size: 0.85rem; white-space: nowrap; }
  .poll-strip { padding: 0.9rem 1rem; }
  .countdown { gap: 0.35rem; grid-template-columns: repeat(4, 1fr); }
  .cd-unit { padding: 0.4rem 0.1rem; }
  .cd-unit strong { font-size: 1.5rem; }
  .stat strong { font-size: 1.25rem; }

  /* Bottom tab bar */
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    background: var(--ink); border-top: 3px solid var(--gold);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: rgba(244, 236, 216, 0.65); text-decoration: none; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current] { color: var(--gold); }
  .tabbar .tab-vote { color: #fff; }
  .tabbar .tab-vote svg { width: 54px; height: 54px; padding: 13px; margin-top: -26px; background: var(--red); border: 3px solid var(--paper); border-radius: 50%; box-shadow: 0 0 0 3px var(--ink), 3px 4px 0 3px rgba(0, 0, 0, 0.35); transition: transform var(--fast) var(--ease); }
  .tabbar .tab-vote:active svg { transform: scale(0.92); }
  .tabbar .tab-vote[aria-current] svg { background: var(--gold); color: var(--ink); }


  /* Steps as compact rows */
  .loop li { display: grid; grid-template-columns: 2.6rem 1fr; column-gap: 0.6rem; padding: 0.85rem 1rem; }
  .loop .step { grid-row: span 2; font-size: 2rem; }
  .loop p { margin: 0; }

  .formats { grid-template-columns: 1fr; }
  .format:first-child, .format:last-child { grid-column: auto; }
  .format:first-child h3 { font-size: 1.6rem; }
  .phases li { padding: 0.75rem 0.9rem; }
  .phases li { grid-template-columns: minmax(0, 1fr); }

  /* Vote: both candidates on one screen */
  .debate { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .debate-side { padding: 0.45rem; box-shadow: 3px 3px 0 var(--ink); }
  .debate-side .poster { width: 100%; }
  .debate-party { font-size: 0.72rem; margin-top: 0.4rem; }
  .debate-pick { font-size: 0.72rem; margin-top: 0.2rem; }
  .debate-side.won::after { font-size: 1.4rem; border-width: 3px; }
  .vs { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 3; font-size: 2rem; background: var(--paper); border: 3px solid var(--ink); border-radius: 50%; width: 3.2rem; height: 3.2rem; display: grid; place-items: center; text-shadow: none; }

  /* Gallery: two columns */
  .toolbar label { flex: 1 1 100%; }
  .toolbar input, .toolbar select { width: 100%; min-width: 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
  .card { padding: 0.45rem; box-shadow: 3px 3px 0 var(--ink); }
  .card-body { flex-direction: column; gap: 0; font-size: 0.72rem; }

  /* Tables fit the screen */
  .board { min-width: 0; font-size: 0.88rem; }
  .board th, .board td { padding: 0.6rem 0.5rem; overflow-wrap: anywhere; }
  .hide-sm { display: none; }
  .rank-cell { width: 36px; font-size: 1.15rem; }
  .board-avatar { width: 32px; height: 32px; font-size: 1rem; }
  .bar { min-width: 56px; }

  .create-form { padding: 1rem; }
  .create-preview { max-width: 190px; }
  .create-preview .label { text-align: center; }
  .filing-row { flex-direction: column; gap: 0.2rem; }
  .filing-row strong { text-align: left; }

  /* Modal becomes a bottom sheet */
  .modal { align-items: end; padding: 0; }
  .modal-card { border-radius: 14px 14px 0 0; border-bottom: 0; max-height: 92dvh; padding: 1.2rem 16px calc(1.2rem + env(safe-area-inset-bottom)); }
  .candidate { grid-template-columns: 1fr; gap: 1rem; }
  .candidate .poster-box { max-width: 220px; margin: 0 auto; width: 100%; }
  .candidate .cta-row .btn { flex: 1 1 140px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* Touch screens: no sticky hover lift after a tap. */
@media (hover: none) {
  .btn:hover, .card:hover, .debate-side:not(.won):hover { transform: none; }
  .btn:hover { box-shadow: var(--shadow); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .ticker-inner { animation: none; }
}

/* ---------- Reward eligibility ---------- */
.eligibility { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.elig-rules { margin: 0; padding: 1.1rem 1.3rem 1.1rem 2.4rem; background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.elig-rules li { margin: 0.35rem 0; font-size: 0.95rem; }
.elig-rules li::marker { color: var(--red); }
.elig-check { background: var(--navy); color: var(--paper); padding: 1.1rem 1.2rem; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.elig-check label { display: block; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.82rem; color: var(--gold); margin-bottom: 0.5rem; }
.elig-row { display: flex; gap: 0.5rem; }
.elig-row input { flex: 1; min-width: 0; font: 1rem var(--font-body); padding: 0.7rem 0.8rem; border: 2px solid var(--ink); border-radius: var(--radius); }
.elig-row .btn { padding: 0.7rem 1rem; box-shadow: 3px 3px 0 #000; }
.elig-check .small { color: rgba(244, 236, 216, 0.7); margin: 0.5rem 0 0; }
.elig-result { min-height: 1.4em; margin: 0.7rem 0 0; font-weight: 600; font-size: 0.92rem; }
.elig-result.is-eligible { color: #8be04e; }
.elig-result.is-ineligible, .elig-result.is-invalid, .elig-result.is-error { color: #ff8a8a; }
.elig-result.is-not-launched { color: var(--gold); }
.field-note { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--muted); }
.pin-note { margin: 0.6rem 0; padding: 0.6rem 0.8rem; background: #fff4d6; border: 2px solid var(--gold); border-left-width: 6px; border-radius: var(--radius); font-size: 0.88rem; }
@media (max-width: 760px) {
  .eligibility { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Token holder badges ---------- */
.holder-badge { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.15rem 0.55rem; border-radius: 99px; border: 1.5px solid currentColor; font-weight: 800; font-size: 0.78rem; line-height: 1.3; white-space: nowrap; vertical-align: middle; }
.holder-badge.is-compact { font-size: 0.68rem; padding: 0.05rem 0.4rem; }
.holder-badge.is-eligible { color: #1f7a45; background: #e3f6e9; }
.holder-badge.is-ineligible { color: var(--red); background: #fde6ea; }
.holder-badge.is-no-wallet { color: #6b7080; background: #eef0f4; }
.holder-badge.is-not-launched { color: #8a6100; background: #fff4d6; }
.holder-badge.is-loading, .holder-badge.is-error { color: #6b7080; background: #f4f4f4; }
.holder-legend { line-height: 2; }
.holder-line { margin: 0.4rem 0; font-size: 0.9rem; font-weight: 600; }
.res-name-row { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.res-name-row .res-name { min-width: 0; }
.res-name-row .holder-badge { flex-shrink: 0; font-size: 0.6rem; padding: 0 0.35rem; }
.res-detail .stat-row .holder-badge { justify-self: end; }
@media (max-width: 640px) {
  .board th, .board .num-cell { overflow-wrap: normal; white-space: nowrap; }
  .board-name strong { font-size: 0.85rem; }
}

/* ---------- Reward pool calculator ---------- */
.pool-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.pool-line input { width: 9rem; font: 700 1rem var(--font-body); padding: 0.35rem 0.55rem; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; }
.cap-note { color: var(--red); font-weight: 700; }
.board tr.rollover td { background: #fff4d6; font-style: italic; }

/* ---------- After filing: success panel + your candidacies ---------- */
.filed-panel { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.4rem; align-items: start; margin-bottom: 1.6rem; padding: 1.3rem; background: #fff4d6; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.filed-panel h2 { margin: 0 0 0.6rem; font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.2rem); }
.filed-steps { margin: 0 0 0.4rem; padding-left: 1.2rem; }
.filed-steps li { margin: 0.25rem 0; }
.filed-panel .cta-row { margin-top: 0.8rem; }
.post-link-form { margin-top: 1rem; }
.post-link-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.post-link-row input { flex: 1 1 260px; min-width: 0; font: 1rem var(--font-body); padding: 0.7rem 0.85rem; border: 2px solid var(--ink); border-radius: var(--radius); background: #fff; }
.link-msg { min-height: 1.3em; margin: 0.4rem 0 0; font-weight: 700; font-size: 0.88rem; }
.link-msg.is-ok { color: #1f7a45; }
.link-msg.is-error { color: var(--red); }
.my-candidacies { margin-top: var(--space-section); }
#my-list { display: grid; gap: 1rem; }
.my-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1rem; background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); container-type: inline-size; }
.my-item h3 { margin: 0 0 0.2rem; }
.my-item .cta-row { margin-top: 0.5rem; }
.my-poster, .filed-poster { container-type: inline-size; }
@media (max-width: 640px) {
  .filed-panel { grid-template-columns: 1fr; padding: 1rem; }
  .filed-poster { max-width: 200px; margin: 0 auto; width: 100%; }
  .my-item { grid-template-columns: 84px minmax(0, 1fr); padding: 0.8rem; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-text strong {
  font-size: 24px;
  font-weight: 800;
  color: #14213d;
}

.brand-text small {
  font-size: 10px;
  letter-spacing: 1px;
  color: #14213d;
}
