/* ============================================================
   SANSAD — The Mock Parliament
   A cinematic polity simulator for UPSC aspirants
   ============================================================ */

:root {
  --ink: #070b17;
  --ink-2: #0b1226;
  --ink-3: #111c38;
  --panel: rgba(15, 24, 48, 0.72);
  --panel-solid: #0f1830;
  --cream: #f6efe3;
  --text: #eee7da;
  --muted: #9aa5bd;
  --muted-2: #76829b;
  --gold: #e8b667;
  --gold-bright: #f7d59c;
  --gold-deep: #b07a36;
  --saffron: #ff9933;
  --green: #1f9d55;
  --red: #e2576b;
  --blue: #5b8def;
  --line: rgba(232, 182, 103, 0.18);
  --line-soft: rgba(255, 255, 255, 0.07);
  --glass: rgba(255, 255, 255, 0.035);
  --radius: 20px;
  --radius-sm: 13px;
  --display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--ink);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
::selection { background: rgba(232, 182, 103, 0.28); color: #fff; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ------------------------------------------------------------
   Ambient scene
   ------------------------------------------------------------ */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(1200px 800px at 75% -10%, rgba(180, 83, 9, 0.16), transparent 60%),
  radial-gradient(1000px 700px at 10% 15%, rgba(19, 78, 74, 0.16), transparent 60%),
  linear-gradient(180deg, #080d1c 0%, #070b17 45%, #090f1f 100%);
}

.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; animation: drift 22s ease-in-out infinite alternate; }
.orb-1 { width: 46vw; height: 46vw; background: radial-gradient(circle, rgba(232, 182, 103, 0.18), transparent 70%); top: -12vw; right: -8vw; }
.orb-2 { width: 38vw; height: 38vw; background: radial-gradient(circle, rgba(31, 157, 85, 0.12), transparent 70%); bottom: 4%; left: -12vw; animation-delay: -7s; }
.orb-3 { width: 30vw; height: 30vw; background: radial-gradient(circle, rgba(255, 153, 51, 0.1), transparent 70%); top: 45%; left: 45%; animation-delay: -14s; }

@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(3vw, 2vw, 0) scale(1.08); }
}

.grid-lines {
  position: absolute; inset: 0; opacity: 0.16;
  background-image:
    linear-gradient(rgba(232, 182, 103, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 182, 103, 0.07) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(ellipse at 50% 0%, black, transparent 72%);
}

.grain {
  position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------
   Navigation
   ------------------------------------------------------------ */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 26px;
  padding: 14px clamp(18px, 4vw, 64px);
  background: rgba(7, 11, 23, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(232, 182, 103, 0.1);
  transition: padding 0.3s var(--ease);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px; flex: none; display: block;
  color: var(--gold);
  filter: drop-shadow(0 0 12px rgba(232, 182, 103, 0.35));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--display); font-size: 1.45rem; font-weight: 700;
  letter-spacing: 0.22em; color: var(--cream);
}
.brand-text small { font-size: 0.6rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted-2); }

.chakra { animation: chakraSpin 40s linear infinite; transform-origin: 50% 50%; }
@keyframes chakraSpin { to { transform: rotate(360deg); } }

.nav-links { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(255,255,255,0.025); }
.nav-link {
  padding: 8px 18px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); letter-spacing: 0.02em; transition: 0.25s var(--ease);
}
.nav-link:hover { color: var(--cream); }
.nav-link.is-active { background: rgba(232, 182, 103, 0.13); color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(232, 182, 103, 0.18); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.mobile-dock { display: none; }

.xp-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(232, 182, 103, 0.06);
  font-size: 0.72rem; letter-spacing: 0.12em; color: var(--muted);
}
.xp-pill b { font-size: 0.86rem; color: var(--gold-bright); letter-spacing: 0.02em; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-soft); color: var(--muted);
  transition: 0.25s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--gold); border-color: var(--line); background: rgba(232, 182, 103, 0.07); }
.icon-btn .icon-off, .icon-btn .icon-moon { display: none; }
.icon-btn.is-muted .icon-on { display: none; }
.icon-btn.is-muted .icon-off { display: block; }

/* ------------------------------------------------------------
   Shared components
   ------------------------------------------------------------ */
.screen { display: none; min-height: 60vh; }
.screen.is-active { display: block; min-height: calc(100vh - 72px); animation: screenIn 0.5s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; border-radius: 999px; font-weight: 700; font-size: 0.88rem;
  letter-spacing: 0.01em; transition: 0.3s var(--ease); white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; transition: transform 0.3s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-gold {
  background: linear-gradient(135deg, #f7d59c, #e8b667 42%, #c98d3d);
  color: #241505; box-shadow: 0 12px 34px rgba(232, 182, 103, 0.22), inset 0 1px 0 rgba(255,255,255,0.55);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(232, 182, 103, 0.32), inset 0 1px 0 rgba(255,255,255,0.6); }
.btn-ghost { border: 1px solid var(--line); color: var(--gold-bright); background: rgba(232, 182, 103, 0.045); }
.btn-ghost:hover { background: rgba(232, 182, 103, 0.1); border-color: rgba(232, 182, 103, 0.36); transform: translateY(-2px); }
.btn-sm { padding: 9px 18px; font-size: 0.78rem; }
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none !important; box-shadow: none; }

.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 26px; transition: color 0.25s;
}
.back-link svg { width: 15px; height: 15px; }
.back-link:hover { color: var(--gold); }

.kicker { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-bright); padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(232, 182, 103, 0.06);
}
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(232,182,103,.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(232,182,103,.55); } 70% { box-shadow: 0 0 0 8px rgba(232,182,103,0); } 100% { box-shadow: 0 0 0 0 rgba(232,182,103,0); } }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; color: var(--cream); }
h1 em, h2 em, h3 em { font-style: italic; color: var(--gold); }
.section { padding: 82px clamp(18px, 5vw, 76px); max-width: 1420px; margin: 0 auto; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 38px; }
.section-head h2 { font-size: clamp(2rem, 3.4vw, 3.2rem); margin-top: 8px; }
.section-head p { max-width: 400px; color: var(--muted); font-size: 0.9rem; line-height: 1.75; }

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  display: grid; grid-template-columns: 1.02fr 0.98fr; gap: clamp(30px, 5vw, 70px);
  align-items: center;
  padding: clamp(50px, 7vw, 96px) clamp(18px, 5vw, 76px) clamp(40px, 5vw, 60px);
  max-width: 1420px; margin: 0 auto;
  min-height: calc(100vh - 72px);
}
.hero-copy { animation: rise 0.8s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.hero h1 {
  font-size: clamp(3.1rem, 6.4vw, 6.4rem);
  letter-spacing: -0.025em; margin: 22px 0 20px;
  text-wrap: balance;
}
html[lang="en-IN"] .hero h1 { font-size: clamp(2.8rem, 5.4vw, 5.4rem); }
.hero h1 em { position: relative; }
.hero h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.06em; height: 3px;
  background: linear-gradient(90deg, var(--saffron), var(--gold), var(--green));
  border-radius: 2px; opacity: 0.8; transform: scaleX(0); transform-origin: left;
  animation: underline 1.2s 0.5s var(--ease) forwards;
}
@keyframes underline { to { transform: scaleX(1); } }

.lede { max-width: 520px; color: var(--muted); font-size: clamp(0.95rem, 1.3vw, 1.08rem); line-height: 1.8; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero-stats { display: flex; gap: 38px; margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats b { font-family: var(--display); font-size: 1.9rem; color: var(--gold-bright); line-height: 1; }
.hero-stats span { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }

.hero-art { position: relative; display: flex; align-items: center; justify-content: center; }
.art-frame {
  position: relative; width: 100%; max-width: 620px; padding: 18px;
  border-radius: 28px; border: 1px solid rgba(232, 182, 103, 0.18);
  background: linear-gradient(160deg, rgba(232, 182, 103, 0.07), rgba(255,255,255,0.01) 40%, transparent);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: rise 0.9s 0.15s var(--ease) both;
}
.art-frame::before {
  content: ""; position: absolute; inset: 8px; border-radius: 22px;
  border: 1px solid rgba(232, 182, 103, 0.09); pointer-events: none;
}
.parliament-art { width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(0,0,0,0.45)); }
.art-flag { transform-origin: 311px 38px; animation: flagWave 4.6s ease-in-out infinite; will-change: transform; }
@keyframes flagWave {
  0%, 100% { transform: skewY(0deg) scaleX(1) scaleY(1); }
  22% { transform: skewY(1.8deg) scaleX(1.015) scaleY(0.99); }
  48% { transform: skewY(-2.4deg) scaleX(0.985) scaleY(1.02); }
  72% { transform: skewY(1.2deg) scaleX(1.01) scaleY(0.995); }
}
.art-flag-chakra { transform-origin: 342px 70px; animation: chakraSpin 16s linear infinite; }

.art-glow {
  position: absolute; inset: 12% 8%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(232,182,103,.22), transparent 65%);
  filter: blur(40px);
}
.art-ticker {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; margin-top: 10px; border-radius: 12px;
  border: 1px solid var(--line-soft); background: rgba(7, 11, 23, 0.45);
  font-size: 0.58rem; letter-spacing: 0.16em; color: var(--muted); font-weight: 700;
}
.art-ticker span { display: inline-flex; align-items: center; gap: 6px; }
.art-ticker i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot-saffron { background: var(--saffron); }
.dot-gold { background: var(--gold); }
.art-ticker .live { color: #7ee2a8; }
.art-ticker .live i { background: #7ee2a8; box-shadow: 0 0 8px #7ee2a8; animation: pulse 2s infinite; }

/* marquee */
.marquee { overflow: hidden; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,0.012); }
.marquee-track {
  display: flex; align-items: center; gap: 32px; width: max-content;
  padding: 14px 0; animation: marquee 38s linear infinite;
  font-size: 0.64rem; letter-spacing: 0.28em; font-weight: 700; color: var(--muted-2);
}
.marquee-track i { color: rgba(232, 182, 103, 0.4); font-size: 0.5rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------
   Feature cards
   ------------------------------------------------------------ */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature-card {
  position: relative; padding: 26px 24px 24px; border-radius: var(--radius);
  border: 1px solid var(--line-soft); background: linear-gradient(165deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  overflow: hidden; transition: 0.4s var(--ease);
}
.feature-card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px 160px at 20% 0%, rgba(232,182,103,.1), transparent 70%);
  opacity: 0; transition: opacity 0.4s;
}
.feature-card:hover { transform: translateY(-5px); border-color: rgba(232, 182, 103, 0.28); background: linear-gradient(165deg, rgba(232,182,103,.07), rgba(255,255,255,.015)); }
.feature-card:hover::after { opacity: 1; }
.feature-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--gold); background: rgba(232,182,103,.09); border: 1px solid var(--line); margin-bottom: 20px; }
.feature-icon svg { width: 21px; height: 21px; }
.feature-card h3 { font-size: 1.35rem; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.82rem; line-height: 1.7; }
.feature-tag { display: inline-block; margin-top: 18px; font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); opacity: 0.75; }

/* ------------------------------------------------------------
   Scenario cards
   ------------------------------------------------------------ */
.scenario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.scenario-card {
  --accent: #e8b667;
  position: relative; display: flex; flex-direction: column; gap: 0;
  padding: 24px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line-soft);
  background: linear-gradient(170deg, rgba(255,255,255,.04), rgba(255,255,255,.008) 60%);
  transition: 0.4s var(--ease); overflow: hidden;
}
.scenario-card::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.55;
}
.scenario-card::after {
  content: ""; position: absolute; width: 220px; height: 220px; right: -80px; top: -80px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%);
  opacity: 0; transition: opacity 0.4s; pointer-events: none;
}
.scenario-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 38%, transparent); box-shadow: 0 26px 50px rgba(0,0,0,.38); }
.scenario-card:hover::after { opacity: 1; }
.sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.sc-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.sc-icon svg { width: 23px; height: 23px; }
.diff { font-size: 0.56rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--muted); }
.diff.foundation { color: #8fd6a8; border-color: rgba(143, 214, 168, .22); background: rgba(143,214,168,.06); }
.diff.intermediate { color: #f2c66d; border-color: rgba(242, 198, 109, .22); background: rgba(242,198,109,.06); }
.diff.advanced { color: #ef8f9d; border-color: rgba(239, 143, 157, .22); background: rgba(239,143,157,.06); }
.scenario-card h3 { font-size: 1.62rem; margin-bottom: 3px; }
.sc-article { font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); opacity: 0.9; margin-bottom: 12px; }
.sc-summary { color: var(--muted); font-size: 0.81rem; line-height: 1.65; flex: 1; }
.sc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.sc-meta span { font-size: 0.6rem; letter-spacing: 0.06em; padding: 4px 9px; border-radius: 6px; background: rgba(255,255,255,.045); color: var(--muted); border: 1px solid var(--line-soft); }
.sc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.stars-mini { font-size: 0.78rem; letter-spacing: 0.16em; color: var(--gold); }
.stars-mini .off { color: rgba(255,255,255,.14); }
.sc-action { display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.sc-action svg { width: 13px; height: 13px; transition: transform 0.3s var(--ease); }
.scenario-card:hover .sc-action svg { transform: translateX(4px); }

/* ------------------------------------------------------------
   Majority strip
   ------------------------------------------------------------ */
.majority-section { padding-top: 20px; }
.majority-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.majority-card {
  position: relative; padding: 20px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.025);
  transition: 0.35s var(--ease); overflow: hidden;
}
.majority-card:hover { background: rgba(232,182,103,.07); border-color: var(--line); transform: translateY(-4px); }
.mc-num { font-family: var(--display); font-size: 1.9rem; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.mc-name { font-size: 0.78rem; font-weight: 700; color: var(--cream); margin-bottom: 4px; }
.mc-formula { font-size: 0.66rem; color: var(--muted); line-height: 1.5; }
.mc-used { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 0.6rem; color: var(--muted-2); letter-spacing: 0.04em; }
.mc-used b { color: var(--gold); font-weight: 700; }

/* ------------------------------------------------------------
   CTA band
   ------------------------------------------------------------ */
.cta-band {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 40px;
  padding: clamp(40px, 6vw, 70px); border-radius: 28px; overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(700px 300px at 85% 20%, rgba(232,182,103,.14), transparent 60%),
    linear-gradient(120deg, #121a30, #0c1326 60%);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image: radial-gradient(rgba(232,182,103,.16) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: radial-gradient(ellipse at 80% 50%, black, transparent 65%);
}
.cta-band h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); margin: 8px 0 10px; }
.cta-band p { color: var(--muted); max-width: 500px; font-size: 0.9rem; }
.cta-band .btn { position: relative; z-index: 1; flex: none; }
.cta-ornament { position: absolute; right: 26%; top: -50%; width: 300px; height: 300px; border: 1px solid rgba(232,182,103,.12); border-radius: 50%; }
.cta-ornament::before, .cta-ornament::after { content: ""; position: absolute; inset: 28px; border: 1px solid rgba(232,182,103,.09); border-radius: 50%; }
.cta-ornament::after { inset: 70px; }

/* ------------------------------------------------------------
   Page heads / filters / tabs
   ------------------------------------------------------------ */
.page-head { max-width: 1280px; margin: 0 auto; padding: clamp(44px, 6vw, 80px) clamp(18px, 5vw, 60px) 30px; }
.page-head > .back-link { display: flex; width: fit-content; }
.page-head h1 { font-size: clamp(2.6rem, 5vw, 4.8rem); margin: 10px 0 16px; }
.page-lede { max-width: 660px; color: var(--muted); font-size: 0.95rem; line-height: 1.8; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.filter {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line-soft); font-size: 0.74rem; font-weight: 700; color: var(--muted);
  transition: 0.25s var(--ease);
}
.filter .count { font-size: 0.6rem; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.06); }
.filter:hover { color: var(--cream); border-color: var(--line); }
.filter.is-active { color: #241505; background: linear-gradient(135deg, #f2cb8c, #dba45c); border-color: transparent; }
.filter.is-active .count { background: rgba(0,0,0,.14); }

#screen-select .scenario-grid { max-width: 1280px; margin: 0 auto; padding: 10px clamp(18px, 5vw, 60px) 0; }

.score-note {
  display: flex; gap: 20px; max-width: 880px; margin: 48px auto 90px;
  padding: 26px 30px; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(232,182,103,.045);
}
.score-note-icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--gold); }
.score-note-icon svg { width: 20px; height: 20px; }
.score-note h3 { font-size: 1.3rem; margin-bottom: 4px; }
.score-note p { color: var(--muted); font-size: 0.83rem; }
.score-note b { color: var(--gold-bright); }

.tab-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 34px; padding: 5px; border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.02); width: fit-content; max-width: 100%; }
.tab { padding: 9px 16px; border-radius: 9px; font-size: 0.74rem; font-weight: 700; color: var(--muted); transition: 0.25s; }
.tab:hover { color: var(--cream); }
.tab.is-active { background: rgba(232,182,103,.14); color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(232,182,103,.2); }

/* ------------------------------------------------------------
   Game shell
   ------------------------------------------------------------ */
#screen-game { padding: 22px clamp(14px, 4vw, 54px) 70px; max-width: 1440px; margin: 0 auto; }
.game-top { display: flex; align-items: center; gap: 22px; padding: 4px 0 22px; }
.game-top .back-link { margin: 0; flex: none; }
.game-heading { flex: 1; min-width: 0; }
.game-heading span { font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.game-heading h2 { font-size: clamp(1.4rem, 2.4vw, 2rem); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-progress { display: flex; align-items: center; gap: 12px; flex: none; width: 210px; }
.progress-track { flex: 1; height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); transition: width 0.6s var(--ease); }
.game-progress span { font-size: 0.64rem; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }

.game-grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }

/* Chamber */
.chamber-panel {
  position: sticky; top: 86px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(232,182,103,.08), transparent 65%),
    linear-gradient(170deg, #101a31, #0a1122 70%);
  box-shadow: 0 30px 60px rgba(0,0,0,.35);
}
.chamber-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.chamber-badge { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.18em; color: var(--gold-bright); }
.chamber-count { font-size: 0.62rem; color: var(--muted); letter-spacing: .06em; }
.chamber-svg { padding: 6px 10px 0; }
.chamber-svg svg { width: 100%; height: auto; overflow: visible; }

.seat { transition: fill .25s ease, opacity .25s ease; transform-box: fill-box; transform-origin: center; }
.seat.treasury { fill: #d79a45; }
.seat.opposition { fill: #4f7fd4; }
.seat.other { fill: #6c7894; }
.seat.aye { fill: #2fbf71; }
.seat.no { fill: #e2576b; }
.seat.abstain { fill: #e0b64e; }
.seat.absent { fill: #1b2540; opacity: .5; }
.seat.lit { animation: seatPop .5s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes seatPop {
  0% { transform: scale(.35); opacity: .25; }
  60% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.chamber-label { font-family: var(--body); font-size: 7px; letter-spacing: .18em; fill: #8c97ad; font-weight: 700; }
.chamber-desk { fill: #1b2540; stroke: rgba(232,182,103,.22); stroke-width: 1; }

.chamber-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 4px 20px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.6rem; letter-spacing: .04em; color: var(--muted); }
.legend-item i { width: 7px; height: 7px; border-radius: 50%; }
.legend-item b { color: var(--cream); font-weight: 700; }

.chamber-tally { display: flex; gap: 1px; padding: 0 20px 14px; }
.tally-cell { flex: 1; padding: 10px 8px; text-align: center; background: rgba(255,255,255,.025); border-top: 1px solid var(--line-soft); }
.tally-cell:first-child { border-radius: 10px 0 0 10px; }
.tally-cell:last-child { border-radius: 0 10px 10px 0; }
.tally-cell span { display: block; font-size: 0.54rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.tally-cell b { display: block; font-family: var(--display); font-size: 1.45rem; line-height: 1.2; color: var(--cream); font-variant-numeric: tabular-nums; }
.tally-cell.aye b { color: #5fe0a2; }
.tally-cell.no b { color: #ff8b9b; }
.tally-cell.abstain b { color: #f0cd76; }
.tally-cell.absent b { color: #7d89a3; }

.chamber-foot { display: flex; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line-soft); background: rgba(0,0,0,.18); }
.chamber-foot div { display: flex; flex-direction: column; }
.chamber-foot span { font-size: 0.52rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.chamber-foot b { font-size: 0.72rem; color: var(--gold-bright); font-weight: 700; }

/* Game panel */
.game-panel { min-height: 520px; }
.panel-card {
  padding: clamp(24px, 3.4vw, 40px); border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.01) 55%);
  box-shadow: 0 30px 60px rgba(0,0,0,.28);
  scroll-margin-top: 88px;
  animation: panelIn .45s var(--ease);
}
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.stage-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  font-size: 0.56rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--line); background: rgba(232,182,103,.07);
}
.panel-card h2 { font-size: clamp(1.7rem, 2.7vw, 2.35rem); margin: 16px 0 10px; }
.panel-card .q { color: var(--muted); font-size: 0.9rem; line-height: 1.75; margin-bottom: 26px; }
.panel-card .q strong { color: var(--cream); font-weight: 700; }

/* briefing */
.brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 24px 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft); background: var(--line-soft); }
.brief-grid div { padding: 14px 16px; background: rgba(9, 15, 31, .75); }
.brief-grid span { display: block; font-size: 0.52rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 3px; }
.brief-grid b { font-size: 0.78rem; color: var(--cream); font-weight: 600; }
.brief-note {
  padding: 14px 16px; border-left: 2px solid var(--gold); border-radius: 0 10px 10px 0;
  background: rgba(232,182,103,.06); color: var(--muted); font-size: 0.78rem; line-height: 1.65; margin-bottom: 24px;
}
.brief-note b { color: var(--gold-bright); }

/* options */
.options { display: flex; flex-direction: column; gap: 9px; }
.option {
  display: flex; align-items: flex-start; gap: 13px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.022); transition: 0.22s var(--ease); font-size: 0.82rem; line-height: 1.55;
}
.option:hover:not(.is-locked) { border-color: rgba(232,182,103,.34); background: rgba(232,182,103,.055); transform: translateX(3px); }
.option .letter {
  flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  font-size: 0.64rem; font-weight: 800; color: var(--muted);
  background: rgba(255,255,255,.05); border: 1px solid var(--line-soft); transition: 0.22s;
}
.option:hover:not(.is-locked) .letter { color: var(--gold); border-color: var(--line); }
.option.is-correct { border-color: rgba(47,191,113,.55); background: rgba(47,191,113,.09); }
.option.is-correct .letter { background: rgba(47,191,113,.18); color: #6fe6a7; border-color: transparent; }
.option.is-wrong { border-color: rgba(226,87,107,.55); background: rgba(226,87,107,.08); }
.option.is-wrong .letter { background: rgba(226,87,107,.18); color: #ff9baa; border-color: transparent; }
.option.is-locked { cursor: default; }
.option.is-dim { opacity: .45; }

/* feedback */
.feedback {
  margin-top: 18px; padding: 18px 18px 16px; border-radius: 13px;
  border: 1px solid var(--line-soft); background: rgba(9,15,31,.65);
  animation: panelIn .35s var(--ease);
}
.feedback.good { border-color: rgba(47,191,113,.3); background: rgba(47,191,113,.055); }
.feedback.bad { border-color: rgba(226,87,107,.3); background: rgba(226,87,107,.05); }
.fb-head { display: flex; align-items: center; gap: 9px; font-size: 0.68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.feedback.good .fb-head { color: #6fe6a7; }
.feedback.bad .fb-head { color: #ff9baa; }
.fb-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; border: 1px solid currentColor; }
.feedback p { font-size: 0.79rem; color: var(--muted); line-height: 1.7; }
.feedback p b { color: var(--cream); }
.article-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 4px 10px;
  border-radius: 6px; border: 1px solid var(--line); background: rgba(232,182,103,.06);
  font-size: 0.58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 700;
}
.fb-footer { display: flex; justify-content: flex-end; margin-top: 14px; }

/* vote */
.vote-block { margin-bottom: 22px; }
.vote-block h3 { font-family: var(--body); font-size: 0.66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.vote-block h3 span { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .56rem; background: rgba(232,182,103,.12); color: var(--gold); }
.method-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.method-chip {
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-soft);
  font-size: 0.68rem; font-weight: 600; color: var(--muted); transition: 0.22s;
}
.method-chip:hover { color: var(--cream); border-color: var(--line); }
.method-chip.is-active { border-color: rgba(232,182,103,.45); background: rgba(232,182,103,.12); color: var(--gold-bright); }
.method-note { margin-top: 9px; font-size: 0.68rem; color: var(--muted-2); line-height: 1.6; min-height: 2.2em; }
.method-note b { color: var(--muted); }

.majority-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.majority-opt {
  text-align: left; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--line-soft); background: rgba(255,255,255,.02); transition: .22s var(--ease);
}
.majority-opt:hover { border-color: var(--line); background: rgba(232,182,103,.04); }
.majority-opt.is-active { border-color: rgba(232,182,103,.5); background: rgba(232,182,103,.1); }
.majority-opt b { display: block; font-size: 0.72rem; color: var(--cream); font-weight: 700; margin-bottom: 2px; }
.majority-opt span { display: block; font-size: 0.6rem; color: var(--muted-2); line-height: 1.45; }
.majority-opt em { display: block; margin-top: 5px; font-style: normal; font-size: .58rem; color: var(--gold); font-weight: 700; letter-spacing: .03em; }

.vote-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.vote-hint { font-size: 0.66rem; color: var(--muted-2); max-width: 240px; line-height: 1.55; }

.verdict { margin-top: 20px; padding: 20px; border-radius: 14px; border: 1px solid var(--line-soft); animation: panelIn .4s var(--ease); }
.verdict.pass { border-color: rgba(47,191,113,.35); background: linear-gradient(160deg, rgba(47,191,113,.09), rgba(47,191,113,.02)); }
.verdict.fail { border-color: rgba(226,87,107,.35); background: linear-gradient(160deg, rgba(226,87,107,.08), rgba(226,87,107,.02)); }
.verdict-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.verdict-head h3 { font-family: var(--display); font-size: 1.7rem; color: var(--cream); }
.verdict.pass .verdict-head h3 { color: #7cebb0; }
.verdict.fail .verdict-head h3 { color: #ff9baa; }
.verdict-seal { width: 38px; height: 38px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; font-size: .9rem; }
.verdict.pass .verdict-seal { color: #7cebb0; }
.verdict.fail .verdict-seal { color: #ff9baa; }
.verdict p { font-size: 0.78rem; color: var(--muted); line-height: 1.65; }
.verdict .counts { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; font-size: .72rem; color: var(--muted); }
.verdict .counts b { color: var(--cream); }
.threshold-line { margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: rgba(0,0,0,.22); font-size: .68rem; color: var(--muted); }
.threshold-line b { color: var(--gold-bright); }
.callout { margin-top: 12px; padding: 11px 13px; border-radius: 9px; font-size: .7rem; line-height: 1.6; border-left: 2px solid; }
.callout.good { border-color: #2fbf71; background: rgba(47,191,113,.07); color: #9fe8c1; }
.callout.bad { border-color: #e2576b; background: rgba(226,87,107,.07); color: #ffb7c1; }

/* results */
.results { text-align: center; padding: 10px 0; }
.seal {
  width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  border: 1px solid rgba(232,182,103,.4);
  background: radial-gradient(circle at 35% 25%, rgba(247,213,156,.25), rgba(232,182,103,.06) 60%);
  box-shadow: 0 0 60px rgba(232,182,103,.18), inset 0 0 30px rgba(232,182,103,.1);
}
.seal::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1px dashed rgba(232,182,103,.35); animation: chakraSpin 30s linear infinite; }
.seal span { font-family: var(--display); font-size: 2rem; color: var(--gold-bright); }
.results h2 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: 8px; }
.results .result-sub { color: var(--muted); font-size: .85rem; max-width: 540px; margin: 0 auto 18px; }
.star-row { display: flex; justify-content: center; gap: 8px; margin: 12px 0 24px; }
.star-row i { font-style: normal; font-size: 1.7rem; color: rgba(255,255,255,.13); transition: .3s; }
.star-row i.on { color: var(--gold); text-shadow: 0 0 18px rgba(232,182,103,.5); animation: starPop .5s var(--ease) both; }
.star-row i.on:nth-child(2) { animation-delay: .12s; }
.star-row i.on:nth-child(3) { animation-delay: .24s; }
@keyframes starPop { 0% { transform: scale(.4) rotate(-20deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft); background: var(--line-soft); margin-bottom: 24px; }
.result-stats div { background: rgba(9,15,31,.7); padding: 14px 10px; }
.result-stats span { display: block; font-size: .54rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.result-stats b { display: block; font-family: var(--display); font-size: 1.65rem; color: var(--gold-bright); line-height: 1.3; }
.exam-edge { text-align: left; padding: 20px 22px; border-radius: 13px; border: 1px solid var(--line); background: rgba(232,182,103,.04); margin-bottom: 24px; }
.exam-edge h3 { font-family: var(--body); font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }
.exam-edge li { position: relative; padding-left: 18px; font-size: .76rem; color: var(--muted); line-height: 1.65; margin-bottom: 9px; }
.exam-edge li:last-child { margin-bottom: 0; }
.exam-edge li::before { content: "◆"; position: absolute; left: 0; top: 0; color: var(--gold); font-size: .5rem; }
.exam-edge li b { color: var(--cream); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }

/* ------------------------------------------------------------
   Learn
   ------------------------------------------------------------ */
.learn-body { max-width: 1280px; margin: 0 auto; padding: 20px clamp(18px, 5vw, 60px) 90px; }
.learn-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.learn-intro h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.learn-intro p { max-width: 440px; color: var(--muted); font-size: .85rem; line-height: 1.7; }

.learn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.learn-card {
  padding: 24px; border-radius: var(--radius); border: 1px solid var(--line-soft);
  background: linear-gradient(165deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  transition: .3s var(--ease);
}
.learn-card:hover { border-color: var(--line); transform: translateY(-3px); }
.learn-card.full { grid-column: 1 / -1; }
.lc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lc-head h3 { font-size: 1.5rem; }
.lc-num { font-family: var(--display); font-size: 1.6rem; color: rgba(232,182,103,.55); }
.lc-formula { display: inline-block; padding: 5px 10px; border-radius: 6px; background: rgba(232,182,103,.08); border: 1px solid var(--line); color: var(--gold-bright); font-size: .66rem; font-weight: 700; letter-spacing: .03em; margin-bottom: 12px; }
.learn-card p { color: var(--muted); font-size: .8rem; line-height: 1.7; }
.learn-card .used { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.learn-card .used span { font-size: .55rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); display: block; margin-bottom: 6px; }
.learn-card .used em { font-style: normal; display: inline-block; margin: 0 5px 5px 0; padding: 3px 8px; border-radius: 5px; background: rgba(255,255,255,.045); border: 1px solid var(--line-soft); font-size: .62rem; color: var(--muted); }

/* journey timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 1px; background: linear-gradient(var(--gold), rgba(232,182,103,.1)); }
.tl-item { position: relative; padding: 0 0 24px 0; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -30px; top: 6px; width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--gold); background: var(--ink-2); box-shadow: 0 0 0 4px rgba(7,11,23,.9);
}
.tl-item::after { content: ""; position: absolute; left: -26px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.tl-item h3 { font-size: 1.3rem; margin-bottom: 3px; }
.tl-item .tl-tag { font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.tl-item p { color: var(--muted); font-size: .78rem; line-height: 1.65; margin-top: 5px; }

/* tables */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line-soft); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
thead th {
  text-align: left; padding: 13px 16px; font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); background: rgba(232,182,103,.06); border-bottom: 1px solid var(--line);
  font-weight: 800; white-space: nowrap;
}
tbody td { padding: 14px 16px; font-size: .74rem; color: var(--muted); border-bottom: 1px solid var(--line-soft); vertical-align: top; line-height: 1.6; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.022); }
tbody td:first-child { color: var(--cream); font-weight: 700; }
tbody td b { color: var(--cream); font-weight: 600; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 5px; font-size: .6rem; font-weight: 700; border: 1px solid; white-space: nowrap; }
.pill.gold { color: var(--gold); border-color: var(--line); background: rgba(232,182,103,.07); }
.pill.green { color: #7cebb0; border-color: rgba(124,235,176,.25); background: rgba(124,235,176,.06); }
.pill.red { color: #ff9baa; border-color: rgba(255,155,170,.25); background: rgba(255,155,170,.06); }
.pill.blue { color: #9dbcf5; border-color: rgba(157,188,245,.25); background: rgba(157,188,245,.06); }

/* voting methods */
.method-list { display: grid; gap: 10px; }
.method-item { display: flex; gap: 16px; padding: 18px 20px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.022); }
.method-index { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-size: 1.1rem; color: var(--gold); background: rgba(232,182,103,.09); border: 1px solid var(--line); }
.method-item h3 { font-size: 1.25rem; margin-bottom: 3px; }
.method-item p { color: var(--muted); font-size: .76rem; line-height: 1.65; }
.method-item .when { margin-top: 6px; font-size: .64rem; color: var(--gold); letter-spacing: .04em; }

/* article index */
.article-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.article-item { display: flex; gap: 14px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.02); transition: .25s; }
.article-item:hover { border-color: var(--line); background: rgba(232,182,103,.04); }
.article-no { flex: none; font-family: var(--display); font-size: 1.05rem; color: var(--gold); min-width: 52px; }
.article-item p { font-size: .74rem; color: var(--muted); line-height: 1.55; }
.article-item p b { display: block; color: var(--cream); font-size: .77rem; margin-bottom: 1px; font-weight: 600; }

/* ------------------------------------------------------------
   Footer / toast
   ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--line-soft); background: rgba(5, 8, 17, 0.55); padding: 46px clamp(18px, 5vw, 76px) 24px; }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 40px; max-width: 1280px; margin: 0 auto; padding-bottom: 30px; border-bottom: 1px solid var(--line-soft); }
.footer-brand { display: flex; align-items: center; gap: 12px; flex: none; }
.footer-brand .brand-mark { width: 34px; height: 34px; }
.footer-brand div { display: flex; flex-direction: column; line-height: 1.15; }
.footer-brand strong { font-family: var(--display); letter-spacing: .2em; font-size: 1.15rem; color: var(--cream); }
.footer-brand span { font-size: .54rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }
.footer-top > p { max-width: 480px; color: var(--muted-2); font-size: .72rem; line-height: 1.7; }
.footer-links { display: flex; gap: 18px; flex: none; }
.footer-links button { font-size: .7rem; color: var(--muted); transition: color .2s; }
.footer-links button:hover { color: var(--gold); }
.footer-bottom { display: flex; justify-content: space-between; gap: 30px; max-width: 1280px; margin: 20px auto 0; font-size: .58rem; color: var(--muted-2); line-height: 1.6; }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  padding: 11px 20px; border-radius: 999px; max-width: min(340px, calc(100vw - 32px));
  background: rgba(15, 24, 48, .94); border: 1px solid var(--line);
  color: var(--cream); font-size: .74rem; letter-spacing: .02em;
  opacity: 0; pointer-events: none; transform: translateY(16px); transition: .35s var(--ease);
  box-shadow: 0 18px 40px rgba(0,0,0,.5); backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateY(0); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--ink); color: var(--cream); z-index: 200; padding: 30px; text-align: center; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1180px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .scenario-grid { grid-template-columns: repeat(2, 1fr); }
  .majority-strip { grid-template-columns: repeat(3, 1fr); }
  .game-grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 48px; }
  .hero-art { order: -1; max-width: 520px; margin: 0 auto; }
  .hero h1 { font-size: clamp(3rem, 10vw, 5rem); }
  .hero-stats { margin-top: 34px; }
  .game-grid { grid-template-columns: 1fr; }
  .chamber-panel { position: static; }
  .game-progress { width: 150px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .learn-intro { flex-direction: column; align-items: flex-start; gap: 10px; }
  .learn-grid { grid-template-columns: 1fr; }
  .article-list { grid-template-columns: 1fr; }
  .footer-top { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  body { padding-bottom: 82px; }
  body::after {
    content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 104px;
    background: linear-gradient(to top, var(--ink) 0 60px, transparent 104px);
    pointer-events: none; z-index: 70;
  }
  .nav-links { display: none; }
  .mobile-dock {
    display: flex; position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    width: max-content; max-width: calc(100vw - 24px);
    z-index: 80; padding: 5px; border-radius: 999px;
    background: rgba(9, 15, 31, .94); backdrop-filter: blur(18px);
    border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0,0,0,.55);
  }
  .dock-link { padding: 8px 13px; font-size: 0.68rem; font-weight: 700; color: var(--muted); border-radius: 999px; transition: .25s; white-space: nowrap; }
  .dock-link.is-active { background: rgba(232,182,103,.13); color: var(--gold-bright); }
  .toast { bottom: 84px; }
  .site-nav { padding: 12px 18px; }
  .brand-text small { display: none; }
  .hero-stats { gap: 22px; flex-wrap: wrap; }
  .feature-grid { grid-template-columns: 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
  .majority-strip { grid-template-columns: repeat(2, 1fr); }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .game-top { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; }
  .game-top .back-link { margin: 0; grid-area: 1 / 1; }
  .game-progress { width: 100%; margin-left: 0; grid-area: 1 / 2; }
  .game-heading { order: 0; width: 100%; grid-area: 2 / 1 / 3 / -1; }
  .game-heading h2 { white-space: normal; overflow: visible; font-size: 1.65rem; }
  .panel-card { padding: 22px 18px; }
  .brief-grid { grid-template-columns: 1fr; }
  .majority-grid { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .footer-links { flex-wrap: wrap; max-width: 100%; }
  .footer-links button { font-size: .66rem; }
  .chamber-legend { gap: 6px 12px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.9rem; }
  .hero-cta .btn { width: 100%; }
  .xp-pill { display: none; }
  .filter { padding: 7px 12px; font-size: .68rem; }
  .tab-row { width: 100%; }
  .tab { padding: 8px 12px; font-size: .68rem; }
  .art-ticker { font-size: .5rem; padding: 8px 10px; }
  .art-ticker .live { display: none; }
  .verdict-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .vote-actions { flex-direction: column; align-items: stretch; }
  .vote-hint { max-width: none; }
}

/* ============================================================
   Preferences, language menu and audio panel
   ============================================================ */
.nav-controls { display: flex; align-items: center; gap: 10px; }
.popover-wrap { position: relative; }
.lang-btn {
  width: auto; min-width: 44px; padding: 0 11px; border-radius: 999px;
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em;
}
.lang-btn span { line-height: 1; }

.popover {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 75;
  background: rgba(13, 21, 42, 0.97); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}
.popover.is-open { opacity: 1; visibility: visible; transform: none; }

.lang-menu { min-width: 190px; padding: 6px; }
.lang-option {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  width: 100%; padding: 9px 12px; border-radius: 9px; text-align: left;
  font-size: 0.76rem; color: var(--muted); transition: 0.18s;
}
.lang-option i { font-style: normal; font-size: 0.56rem; letter-spacing: 0.1em; color: var(--muted-2); }
.lang-option:hover { background: rgba(232, 182, 103, 0.08); color: var(--cream); }
.lang-option.is-active { background: rgba(232, 182, 103, 0.14); color: var(--gold-bright); }
.lang-option.is-active i { color: var(--gold); }

.audio-panel { width: 296px; padding: 16px 16px 12px; }
.ap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ap-head strong { font-family: var(--body); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.ap-close {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  color: var(--muted); border: 1px solid var(--line-soft); font-size: 1rem; line-height: 1;
}
.ap-close:hover { color: var(--gold); border-color: var(--line); }
.pref-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 0; font-size: 0.72rem; color: var(--muted); cursor: pointer;
}
.range-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 12px;
  padding: 6px 0 10px; font-size: 0.7rem; color: var(--muted);
}
.range-row input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--gold); height: 18px; cursor: pointer; }
.mini-select {
  background: rgba(255, 255, 255, 0.05); color: var(--text);
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 5px 8px; font-size: 0.66rem;
}
.switch {
  appearance: none; -webkit-appearance: none; width: 38px; height: 21px; flex: none;
  border-radius: 999px; background: rgba(120, 135, 160, 0.28);
  border: 1px solid var(--line-soft); position: relative; cursor: pointer; transition: background 0.25s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #f4eee2; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s var(--ease), background 0.25s;
}
.switch:checked { background: linear-gradient(135deg, #e8b667, #c98d3d); border-color: transparent; }
.switch:checked::after { transform: translateX(17px); background: #2a1a07; }

/* ============================================================
   Extra motion
   ============================================================ */
.dust { position: absolute; inset: -12%; pointer-events: none; }
.dust-a {
  opacity: 0.45; background-size: 118px 118px;
  background-image: radial-gradient(circle, rgba(232, 182, 103, 0.55) 0 1px, transparent 1.6px);
  mask-image: linear-gradient(180deg, transparent, #000 28%, #000 72%, transparent);
  animation: dustFloat 42s ease-in-out infinite;
}
.dust-b {
  opacity: 0.22; background-size: 190px 190px;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0 1px, transparent 1.5px);
  mask-image: linear-gradient(180deg, transparent, #000 35%, #000 70%, transparent);
  animation: dustFloat 64s ease-in-out infinite reverse;
}
@keyframes dustFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-34px, -42px, 0); }
}

.hero-art { transition: transform 0.6s var(--ease); will-change: transform; }

.scenario-card { animation: cardIn 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.option.is-correct { animation: correctGlow 0.65s var(--ease); }
@keyframes correctGlow {
  0% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0.4); }
  100% { box-shadow: 0 0 0 14px rgba(47, 191, 113, 0); }
}

body.is-dividing .chamber-panel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(circle at 50% 58%, rgba(232, 182, 103, 0.28), transparent 62%);
  animation: divisionPulse 1.25s var(--ease) both;
}
@keyframes divisionPulse {
  0% { opacity: 0; transform: scale(0.86); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.08); }
}

.xp-pill.bump { animation: xpBump 0.65s var(--ease); }
@keyframes xpBump { 0% { transform: scale(1); } 40% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(232, 182, 103, 0.12); } 100% { transform: scale(1); } }

.results { position: relative; overflow: hidden; }
.confetti {
  position: absolute; top: -14px; width: 7px; height: 12px; border-radius: 2px;
  pointer-events: none; opacity: 0;
  animation: confettiFall var(--dur, 2.6s) linear forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes confettiFall {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate3d(var(--drift, 20px), 560px, 0) rotate(720deg); opacity: 0; }
}

/* ============================================================
   Day theme
   ============================================================ */

.theme-btn {
  position: relative;
  overflow: hidden;
}
.theme-btn svg {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
.theme-btn .icon-sun { display: block; opacity: 1; transform: translate(0, 0) rotate(0deg); }
.theme-btn .icon-moon { display: block; opacity: 0; transform: translate(0, 26px) rotate(45deg); }

[data-theme="day"] .theme-btn .icon-sun { opacity: 0; transform: translate(0, -26px) rotate(-45deg); }
[data-theme="day"] .theme-btn .icon-moon { opacity: 1; transform: translate(0, 0) rotate(0deg); }

/* Full-screen sunrise / sunset ripple from the theme button */
.theme-ripple {
  position: fixed;
  z-index: 9980;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.02);
  opacity: 0.95;
  animation: themeRipple 1s cubic-bezier(0.16, 0.8, 0.4, 1) forwards;
  will-change: transform, opacity;
}
.theme-ripple.to-day {
  background: radial-gradient(circle, rgba(255, 214, 140, 0.5) 0%, rgba(255, 176, 74, 0.28) 30%, rgba(251, 247, 238, 0.92) 72%, #f5efe3 100%);
}
.theme-ripple.to-night {
  background: radial-gradient(circle, rgba(122, 156, 226, 0.45) 0%, rgba(43, 63, 108, 0.55) 34%, rgba(7, 11, 23, 0.94) 74%, #070b17 100%);
}
@keyframes themeRipple {
  0%   { transform: translate(-50%, -50%) scale(0.02); opacity: 0.95; }
  55%  { opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-ripple { display: none; }
}

/* Global transition for theme switching */
body, .scene, .site-nav, .site-footer, .screen, .hero, .popover, 
.nav-links, .nav-link, .icon-btn, .feature-card, .scenario-card, 
.learn-card, .panel-card, .method-item, .article-item,
.majority-card, .option, .majority-opt, .tally-cell, .tab-row,
.chamber-panel, .cta-band, .history-band, .sim-verdict {
  transition: background 0.6s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, filter 0.4s ease;
}

:root[data-theme="day"] {
  color-scheme: light;
  --ink: #f5efe3;
  --ink-2: #efe6d4;
  --ink-3: #e6dac4;
  --panel: rgba(255, 252, 245, 0.86);
  --panel-solid: #fffaf0;
  --cream: #17213a;
  --text: #26324b;
  --muted: #5c6884;
  --muted-2: #7b869d;
  --gold: #9a6110;
  --gold-bright: #7d4d06;
  --gold-deep: #8a5a17;
  --saffron: #d9771e;
  --green: #177a46;
  --red: #b62b43;
  --blue: #2f5fb3;
  --line: rgba(151, 104, 32, 0.26);
  --line-soft: rgba(22, 32, 58, 0.1);
  --glass: rgba(255, 255, 255, 0.6);
  --shadow: 0 22px 54px rgba(75, 52, 16, 0.14);
}
:root[data-theme="night"] { color-scheme: dark; }

[data-theme="day"] body { background: var(--ink); }
[data-theme="day"] .scene {
  background:
    radial-gradient(1200px 800px at 78% -10%, rgba(255, 169, 64, 0.22), transparent 60%),
    radial-gradient(900px 700px at 5% 10%, rgba(23, 122, 70, 0.1), transparent 60%),
    linear-gradient(180deg, #fbf7ee 0%, #f4ecdd 45%, #efe4d0 100%);
}
[data-theme="day"] .orb { opacity: 0.3; }
[data-theme="day"] .grid-lines {
  opacity: 0.3;
  background-image:
    linear-gradient(rgba(151, 104, 32, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 104, 32, 0.12) 1px, transparent 1px);
}
[data-theme="day"] .grain { opacity: 0.035; }
[data-theme="day"] .dust-b { background-image: radial-gradient(circle, rgba(90, 60, 20, 0.35) 0 1px, transparent 1.5px); }

[data-theme="day"] .site-nav {
  background: rgba(250, 245, 235, 0.82);
  border-bottom-color: rgba(151, 104, 32, 0.16);
}
[data-theme="day"] .nav-links { background: rgba(255, 255, 255, 0.55); }
[data-theme="day"] .nav-link.is-active {
  background: rgba(154, 97, 16, 0.12); color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(154, 97, 16, 0.16);
}
[data-theme="day"] .xp-pill { background: rgba(154, 97, 16, 0.06); }
[data-theme="day"] .icon-btn { background: rgba(255, 255, 255, 0.4); }
[data-theme="day"] .popover {
  background: #fffbf3;
  box-shadow: 0 24px 50px rgba(75, 52, 16, 0.2);
}
[data-theme="day"] .lang-option:hover { background: rgba(154, 97, 16, 0.08); }
[data-theme="day"] .lang-option.is-active { background: rgba(154, 97, 16, 0.12); }
[data-theme="day"] .mini-select { background: #fffdf8; color: var(--text); }
[data-theme="day"] .switch { background: rgba(60, 70, 90, 0.2); }
[data-theme="day"] .switch:checked { background: linear-gradient(135deg, #b07a36, #8a5a17); }
[data-theme="day"] .switch:checked::after { background: #fff8ea; }

[data-theme="day"] .art-frame {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.8), rgba(255, 248, 232, 0.45) 45%, rgba(255, 255, 255, 0.2));
  box-shadow: 0 24px 54px rgba(90, 62, 20, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
[data-theme="day"] .parliament-art { filter: drop-shadow(0 26px 34px rgba(100, 70, 20, 0.26)); }
[data-theme="day"] .art-glow { opacity: 0.45; }
[data-theme="day"] .art-ticker { background: rgba(255, 250, 240, 0.86); }
[data-theme="day"] .marquee { background: rgba(0, 0, 0, 0.018); }

[data-theme="day"] .feature-card,
[data-theme="day"] .scenario-card,
[data-theme="day"] .learn-card,
[data-theme="day"] .panel-card,
[data-theme="day"] .method-item,
[data-theme="day"] .article-item {
  background: linear-gradient(165deg, #fffdf8, #fbf5e9);
  box-shadow: 0 18px 40px rgba(75, 52, 16, 0.08);
}
[data-theme="day"] .feature-card:hover,
[data-theme="day"] .scenario-card:hover {
  background: linear-gradient(165deg, #fffefb, #f7edda);
  box-shadow: 0 24px 46px rgba(75, 52, 16, 0.14);
}
[data-theme="day"] .feature-card p,
[data-theme="day"] .sc-summary,
[data-theme="day"] .learn-card p,
[data-theme="day"] .method-item p,
[data-theme="day"] .article-item p { color: var(--muted); }
[data-theme="day"] .sc-article,
[data-theme="day"] .sc-action { filter: brightness(0.72) saturate(1.15); }
[data-theme="day"] .sc-meta span,
[data-theme="day"] .learn-card .used em,
[data-theme="day"] .option .letter { background: rgba(22, 32, 58, 0.045); }

[data-theme="day"] .majority-card,
[data-theme="day"] .option,
[data-theme="day"] .majority-opt,
[data-theme="day"] .tally-cell,
[data-theme="day"] .tab-row { background: rgba(255, 255, 255, 0.55); }
[data-theme="day"] .majority-card:hover { background: rgba(154, 97, 16, 0.06); }
[data-theme="day"] .tally-cell { border-top-color: var(--line-soft); }
[data-theme="day"] .brief-grid div,
[data-theme="day"] .result-stats div { background: #fffaf1; }
[data-theme="day"] .feedback { background: #fffaf1; }
[data-theme="day"] .feedback.good { background: rgba(23, 122, 70, 0.06); }
[data-theme="day"] .feedback.bad { background: rgba(182, 43, 67, 0.05); }
[data-theme="day"] .feedback.good .fb-head { color: #147a46; }
[data-theme="day"] .feedback.bad .fb-head { color: #b3223c; }
[data-theme="day"] .article-chip,
[data-theme="day"] .stage-chip { background: rgba(154, 97, 16, 0.07); }

[data-theme="day"] .chamber-panel {
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(232, 182, 103, 0.22), transparent 65%),
    linear-gradient(170deg, #fffdf8, #f7efdf 70%);
  box-shadow: 0 24px 50px rgba(75, 52, 16, 0.14);
}
[data-theme="day"] .chamber-foot { background: rgba(151, 104, 32, 0.05); }
[data-theme="day"] .chamber-label { fill: #6b7489; }
[data-theme="day"] .chamber-desk { fill: #e4d7c0; stroke: rgba(154, 97, 16, 0.35); }
[data-theme="day"] .seat.absent { fill: #ddd3c2; opacity: 0.65; }
[data-theme="day"] .tally-cell.aye b { color: #147a46; }
[data-theme="day"] .tally-cell.no b { color: #b3223c; }
[data-theme="day"] .tally-cell.abstain b { color: #8a6400; }
[data-theme="day"] .tally-cell.absent b { color: #6b7488; }

[data-theme="day"] .cta-band {
  background:
    radial-gradient(700px 300px at 85% 20%, rgba(232, 182, 103, 0.3), transparent 60%),
    linear-gradient(120deg, #fff8ea, #f5e8d0 60%);
}
[data-theme="day"] thead th { background: #f7eeda; }
[data-theme="day"] tbody tr:hover { background: #fdf8ee; }
[data-theme="day"] .tl-item::before { box-shadow: 0 0 0 4px rgba(251, 247, 238, 0.95); }
[data-theme="day"] .threshold-line { background: rgba(22, 32, 58, 0.055); }
[data-theme="day"] .verdict.pass .verdict-head h3,
[data-theme="day"] .verdict.pass .verdict-seal { color: #147a46; }
[data-theme="day"] .verdict.fail .verdict-head h3,
[data-theme="day"] .verdict.fail .verdict-seal { color: #b3223c; }
[data-theme="day"] .callout.good { color: #0d5c35; }
[data-theme="day"] .callout.bad { color: #8f1a2e; }
[data-theme="day"] .option.is-correct .letter { color: #0d6b3c; }
[data-theme="day"] .option.is-wrong .letter { color: #a11f35; }
[data-theme="day"] .star-row i { color: rgba(22, 32, 58, 0.15); }
[data-theme="day"] .stars-mini .off { color: rgba(22, 32, 58, 0.16); }
[data-theme="day"] .site-footer { background: rgba(247, 240, 226, 0.82); }
[data-theme="day"] .toast {
  background: rgba(255, 251, 243, 0.97); color: var(--text);
  box-shadow: 0 18px 40px rgba(75, 52, 16, 0.2);
}
[data-theme="day"] .mobile-dock {
  background: rgba(255, 251, 243, 0.96);
  box-shadow: 0 16px 40px rgba(75, 52, 16, 0.22);
}
[data-theme="day"] .noscript { background: var(--ink); color: var(--cream); }
[data-theme="day"] .pill.green { color: #147a46; border-color: rgba(20, 122, 70, 0.3); }
[data-theme="day"] .pill.red { color: #b3223c; border-color: rgba(182, 43, 67, 0.3); }
[data-theme="day"] .pill.blue { color: #2c5aa8; border-color: rgba(44, 90, 168, 0.3); }

/* ============================================================
   Public gallery + chamber walkers
   ============================================================ */
.gallery-band {
  position: relative; overflow: hidden;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(232,182,103,.035), transparent 45%);
}
.gallery-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(760px 320px at 50% 100%, rgba(232,182,103,.13), transparent 72%);
}
.gallery-inner { position: relative; max-width: 1420px; margin: 0 auto; padding: 56px clamp(18px, 5vw, 76px) 40px; }
.gallery-head { align-items: flex-end; margin-bottom: 24px; }
.gallery-head h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
.gallery-head p { max-width: 440px; }
.gallery-stage {
  position: relative; height: 264px; border-radius: 26px; overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(700px 240px at 50% 100%, rgba(232,182,103,.12), transparent 70%),
    linear-gradient(180deg, rgba(12,19,38,.9), rgba(7,11,23,.96));
  box-shadow: inset 0 0 90px rgba(0,0,0,.45), 0 24px 50px rgba(0,0,0,.22);
  mask-image: linear-gradient(180deg, #000 0 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 0 88%, transparent 100%);
}
.gallery-arches {
  position: absolute; inset: 0; opacity: .8;
  background:
    radial-gradient(ellipse 88px 138px at 50% 100%, transparent 61%, rgba(232,182,103,.16) 62% 64%, transparent 65%) 0 0 / 176px 100% repeat-x,
    linear-gradient(180deg, rgba(232,182,103,.07), transparent 62%);
}
.gallery-bunting { position: absolute; top: 0; left: 4%; right: 4%; display: flex; justify-content: space-between; }
.gallery-bunting span {
  width: 15px; height: 12px; display: block; transform-origin: 50% 0;
  background: linear-gradient(90deg, #ff9933 0 33%, #f6efe3 33% 66%, #1f9d55 66%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: buntingSway 5.4s ease-in-out infinite;
}
.gallery-bunting span:nth-child(2n) { animation-delay: -1.4s; }
.gallery-bunting span:nth-child(3n) { animation-delay: -2.7s; }

.gallery-crowd { position: absolute; left: 0; right: 0; bottom: 0; height: 170px; z-index: 2; }
.person {
  position: absolute; bottom: 0; left: var(--x); width: calc(var(--h) * .34); height: var(--h);
  transform-origin: 50% 100%; animation: personSway 6.4s ease-in-out infinite; animation-delay: var(--d);
}
.person::before {
  content: ""; position: absolute; left: 50%; top: 0; width: calc(var(--h) * .26); height: calc(var(--h) * .26);
  border-radius: 50%; transform: translateX(-50%);
  background: #22304f; border: 1px solid rgba(232,182,103,.2);
}
.person::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: calc(var(--h) * .72); height: calc(var(--h) * .76);
  transform: translateX(-50%); border-radius: 44% 44% 14% 14%;
  background: linear-gradient(180deg, #2a385b, #131c33 70%);
  border: 1px solid rgba(255,255,255,.05);
}
.person.is-tall::after { border-radius: 48% 48% 10% 10% / 34% 34% 10% 10%; background: linear-gradient(180deg, #3b2d1d, #1d1610 72%); }
.person:nth-child(3n)::after { background: linear-gradient(180deg, #39405c, #161d31 72%); }
.person:nth-child(4n)::before { background: #3a2d1e; }

.gallery-walkway { position: absolute; left: 0; right: 0; bottom: 22px; height: 1px; z-index: 3; background: linear-gradient(90deg, transparent, rgba(232,182,103,.28), transparent); }
.walker {
  position: absolute; bottom: 0; left: 0; width: 11px; height: 30px; opacity: .72;
  animation: walkAcross 26s linear infinite, walkBob .62s ease-in-out infinite alternate;
  animation-delay: var(--d), 0s;
}
.walker:nth-child(2) { animation-name: walkAcrossBack, walkBob; animation-duration: 32s, .58s; }
.walker::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 8px; height: 8px; border-radius: 50%;
  transform: translateX(-50%); background: #d8c9a9;
}
.walker::after {
  content: ""; position: absolute; left: 50%; top: 8px; width: 9px; height: 21px; border-radius: 5px 5px 2px 2px;
  transform: translateX(-50%); background: linear-gradient(180deg, #cbb98f, #7d6a45);
}

.gallery-flags { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.handflag {
  position: absolute; bottom: 8px; left: var(--x); width: 2px; height: var(--h);
  background: linear-gradient(180deg, #d8b071, #8a5a22);
  transform-origin: 50% 100%; animation: handPoleSway 4.2s ease-in-out infinite; animation-delay: var(--d);
}
.handflag i {
  position: absolute; left: 2px; top: 0; width: 36px; height: 23px; display: block;
  background: linear-gradient(180deg, #ff9933 0 33%, #f8f4ec 33% 66%, #1f9d55 66%);
  clip-path: polygon(0 0, 100% 7%, 96% 50%, 100% 93%, 0 100%);
  transform-origin: 0 50%; animation: handFlagWave 3.2s ease-in-out infinite;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.35));
}
.gallery-dust {
  position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle, rgba(247,213,156,.5) 0 1px, transparent 1.5px);
  background-size: 84px 84px; animation: dustFloat 38s ease-in-out infinite;
  mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.gallery-caption { margin-top: 16px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }

.chamber-walkers { position: absolute; left: 0; right: 0; bottom: 58px; height: 40px; z-index: 1; pointer-events: none; opacity: .5; overflow: hidden; }
.chamber-walkers span {
  position: absolute; bottom: 0; left: 0; width: 10px; height: 30px; opacity: .8;
  animation: chamberPace 19s linear infinite;
}
.chamber-walkers span::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 7px; height: 7px; border-radius: 50%;
  transform: translateX(-50%); background: #d8bd8a;
}
.chamber-walkers span::after {
  content: ""; position: absolute; left: 50%; top: 7px; width: 9px; height: 22px; border-radius: 5px 5px 2px 2px;
  transform: translateX(-50%); background: linear-gradient(180deg, #b89a63, #6d5a38);
}
.chamber-walkers span:nth-child(2) { animation-delay: -6s; animation-duration: 24s; opacity: .5; }
.chamber-walkers span:nth-child(3) { animation-delay: -12s; animation-duration: 29s; opacity: .65; }

@keyframes buntingSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes personSway { 0%, 100% { transform: rotate(-1.2deg) translateY(0); } 50% { transform: rotate(1.4deg) translateY(-2px); } }
@keyframes handPoleSway { 0%, 100% { transform: rotate(-2.6deg); } 50% { transform: rotate(2.8deg); } }
@keyframes handFlagWave { 0%, 100% { transform: skewY(-2deg) scaleX(1); } 50% { transform: skewY(3deg) scaleX(.94); } }
@keyframes walkAcross { from { left: -6%; } to { left: 105%; } }
@keyframes walkAcrossBack { from { left: 105%; } to { left: -6%; } }
@keyframes walkBob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes chamberPace { 0% { left: 8%; transform: scale(.9); } 50% { transform: scale(1.05); } 100% { left: 92%; transform: scale(.9); } }

/* Secret entrance */
.roach-secret {
  position: fixed; left: 16px; bottom: 16px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 10px; border-radius: 999px;
  border: 1px solid rgba(232,182,103,.16); background: rgba(9,15,31,.72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--muted-2); font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  opacity: .62; transition: .3s var(--ease);
}
.roach-secret:hover, .roach-secret:focus-visible { opacity: 1; color: var(--gold-bright); border-color: var(--line); transform: translateY(-2px); }
.roach-secret-bug { font-size: 1.1rem; display: inline-block; animation: roachScuttle 3.6s ease-in-out infinite; filter: saturate(.8); }
.roach-secret-label { display: inline-block; }
.footer-roach { display: inline-flex; align-items: center; gap: 5px; }
.footer-roach span[aria-hidden] { font-size: .9rem; filter: saturate(.7); }
@keyframes roachScuttle {
  0%, 62%, 100% { transform: translateX(0) rotate(0); }
  68% { transform: translateX(-4px) rotate(-6deg); }
  74% { transform: translateX(3px) rotate(5deg); }
  80% { transform: translateX(-2px) rotate(-3deg); }
}

/* ============================================================
   Cockroaches — easter egg game
   ============================================================ */
.roach-screen { padding: 30px clamp(14px, 4vw, 48px) 96px; max-width: 1460px; margin: 0 auto; }
.roach-top { display: flex; align-items: center; gap: 18px 26px; flex-wrap: wrap; }
.roach-heading { flex: 1; min-width: 230px; }
.roach-heading h2 { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.02; letter-spacing: -.01em; }
.roach-heading h2 em { color: var(--gold-bright); font-style: italic; }
.roach-best {
  display: flex; align-items: baseline; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(232,182,103,.06);
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2);
}
.roach-best b { font-family: var(--display); font-size: 1.4rem; letter-spacing: 0; color: var(--gold-bright); line-height: 1; }
.roach-lede { max-width: 760px; margin: 14px 0 0; color: var(--muted); font-size: .87rem; line-height: 1.75; }

.roach-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.rstat {
  position: relative; display: flex; flex-direction: column; gap: 2px; overflow: hidden;
  padding: 10px 14px 12px; border-radius: 14px; border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
}
.rstat > span { font-size: .55rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }
.rstat b { font-family: var(--display); font-size: 1.55rem; line-height: 1.1; color: var(--cream); font-variant-numeric: tabular-nums; }
.rstat-integrity b { color: #7ee2a8; }
.rstat-integrity.is-low b { color: var(--red); }

.rbar { display: block; height: 4px; margin-top: 4px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.08); }
.rbar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); transition: width .24s var(--ease); }
.rbar.danger span { background: linear-gradient(90deg, #1f9d55, #7ee2a8); }
.rstat-integrity.is-low .rbar.danger span { background: linear-gradient(90deg, #b3223c, #e2576b); }

.roach-stage { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 16px; align-items: start; }
.roach-arena {
  position: relative; height: clamp(430px, 62vh, 650px); overflow: hidden; border-radius: 24px;
  border: 1px solid var(--line); touch-action: none; user-select: none; cursor: crosshair;
  background:
    radial-gradient(720px 340px at 50% 108%, rgba(232,182,103,.14), transparent 70%),
    radial-gradient(600px 420px at 50% 20%, rgba(39,58,104,.35), transparent 72%),
    linear-gradient(180deg, #0f1a33, #080d1d 68%, #060a15);
  box-shadow: inset 0 0 110px rgba(0,0,0,.5), 0 30px 60px rgba(0,0,0,.3);
}
.roach-arena::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(90deg, transparent 0 68px, rgba(232,182,103,.06) 68px 69px);
  mask-image: linear-gradient(180deg, #000, transparent 82%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 82%);
}
.roach-arena::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(4,7,14,.66));
}
.roach-backdrop { position: absolute; inset: 0; pointer-events: none; opacity: .5; }
.roach-pillar {
  position: absolute; top: 6%; bottom: 16%; width: 20px; border-radius: 8px 8px 2px 2px;
  background: linear-gradient(90deg, rgba(232,182,103,.16), rgba(232,182,103,.04) 55%, rgba(0,0,0,.15));
  box-shadow: inset 0 0 0 1px rgba(232,182,103,.1);
}
.roach-pillar:nth-child(1) { left: 8%; }
.roach-pillar:nth-child(2) { left: 29%; }
.roach-pillar:nth-child(3) { right: 29%; }
.roach-pillar:nth-child(4) { right: 8%; }

.roach-scroll {
  position: absolute; left: 50%; top: 56%; width: 104px; z-index: 3;
  transform: translate(-50%, -50%); pointer-events: none;
  filter: drop-shadow(0 0 26px rgba(232,182,103,.38));
  animation: scrollHover 5.2s ease-in-out infinite;
}
.roach-scroll svg { width: 100%; height: auto; }
.roach-shield {
  position: absolute; inset: -22px; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(232,182,103,.3);
  background: radial-gradient(circle, rgba(232,182,103,.16), transparent 66%);
  animation: shieldPulse 3.2s ease-in-out infinite;
}
.roach-scroll.is-hit { animation: scrollHit .42s ease; }
.roach-floor { position: absolute; inset: 0; z-index: 4; }
.roach-fx { position: absolute; inset: 0; z-index: 7; pointer-events: none; }

.roach { position: absolute; left: 0; top: 0; width: var(--size, 44px); height: var(--size, 44px); margin-left: calc(var(--size, 44px) / -2); margin-top: calc(var(--size, 44px) / -2); z-index: 2; opacity: 1; will-change: transform; }
.roach-body { position: relative; width: 100%; height: 100%; transform-origin: 50% 60%; filter: drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
.roach svg { width: 100%; height: 100%; overflow: visible; }
.roach-slang {
  position: absolute; left: 50%; top: -10px; transform: translate(-50%, -100%);
  padding: 1px 7px 2px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  border: 1px solid rgba(232,182,103,.28); background: rgba(7,11,23,.88);
  color: var(--gold-bright); font-size: .52rem; font-weight: 800; letter-spacing: .04em;
}
.roach .shell { fill: #4a2a12; stroke: #b07a36; stroke-width: 1.4; }
.roach .shell-hi { fill: #6d3f1b; opacity: .9; }
.roach .body-dark { fill: #2a1608; }
.roach .leg { stroke: #2a1608; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.roach .antenna { stroke: #2a1608; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.roach .eye { fill: #f7d59c; }
.roach .accessory { fill: #0a0f1c; stroke: #e8b667; stroke-width: 1; }
.roach .accessory-glass { fill: #58c7f2; opacity: .55; }
.roach .phone-screen { fill: #7ee2a8; opacity: .8; }

.roach.is-stunned .roach-body { animation: roachStun .36s ease-in-out infinite alternate; filter: drop-shadow(0 0 9px rgba(126,226,168,.9)); }
.roach.is-stunned .shell { stroke: #7ee2a8; }
.roach.is-squashed .roach-body { animation: roachSquash .34s ease-out forwards; }
.roach.is-reformed .roach-body { animation: roachReform .62s ease-out forwards; }
.roach.is-reformed .roach-slang { opacity: 0; }

.spray-ring {
  position: absolute; left: var(--x); top: var(--y); width: 34px; height: 34px; margin: -17px;
  border-radius: 50%; border: 2px solid rgba(126,226,168,.7); pointer-events: none;
  background: radial-gradient(circle, rgba(126,226,168,.22), transparent 68%);
  animation: sprayRing .58s ease-out forwards;
}
.spray-drop {
  position: absolute; left: var(--x); top: var(--y); width: 5px; height: 5px; margin: -2.5px;
  border-radius: 50%; background: #a9f5c8; box-shadow: 0 0 8px rgba(126,226,168,.8); pointer-events: none;
  animation: sprayDrop .5s ease-out forwards;
}
.roach-float {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  color: var(--gold-bright); font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.75), 0 0 18px rgba(247,213,156,.45);
  pointer-events: none; white-space: nowrap; animation: floatUp .85s ease-out forwards;
}
.roach-float.green { color: #8df0b4; }
.roach-float.red { color: #ff9aa8; }

.roach-wave {
  position: absolute; left: 50%; top: 56%; width: 26px; height: 26px; margin: -13px;
  border-radius: 50%; border: 2px solid rgba(247,213,156,.85); opacity: 0; z-index: 8; pointer-events: none;
  box-shadow: 0 0 40px rgba(247,213,156,.5), inset 0 0 30px rgba(247,213,156,.25);
}
.roach-wave.is-active { animation: reformWave .9s ease-out; }
.roach-flash { position: absolute; inset: 0; z-index: 9; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 56%, rgba(226,87,107,.5), transparent 70%); }
.roach-flash.is-active { animation: breachFlash .45s ease-out; }
.roach-arena.is-shaking { animation: arenaShake .4s ease; }
.roach-combo {
  position: absolute; left: 50%; top: 12px; z-index: 8; transform: translateX(-50%);
  padding: 4px 12px; border-radius: 999px; opacity: 0; pointer-events: none;
  border: 1px solid rgba(247,213,156,.3); background: rgba(7,11,23,.72);
  color: var(--gold-bright); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-align: center;
}
.roach-combo.is-showing { animation: comboPop 1.5s var(--ease); }

.roach-overlay {
  position: absolute; inset: 0; z-index: 10; display: none; place-items: center; padding: 18px;
  background: radial-gradient(circle at 50% 42%, rgba(7,11,23,.5), rgba(5,8,16,.9));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.roach-overlay.is-active { display: grid; animation: overlayIn .36s var(--ease); }
.roach-card {
  width: min(470px, 100%); max-height: 100%; overflow: auto; text-align: center;
  padding: 26px 24px 22px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--panel-solid);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
}
.roach-card .kicker { font-size: .58rem; }
.roach-card h3 { margin: 6px 0 8px; font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.05; color: var(--cream); }
.roach-card h3 em { color: var(--gold-bright); font-style: italic; }
.roach-card p { color: var(--muted); font-size: .8rem; line-height: 1.7; }
.roach-rules { display: grid; gap: 6px; margin: 14px 0 18px; text-align: left; }
.roach-rules li { position: relative; padding-left: 17px; font-size: .73rem; line-height: 1.55; color: var(--muted); }
.roach-rules li::before { content: "◆"; position: absolute; left: 0; top: 0; color: var(--gold); font-size: .58rem; }
.roach-rules b { color: var(--cream); }
.roach-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.roach-tiny { margin-top: 12px; font-size: .58rem !important; letter-spacing: .06em; color: var(--muted-2) !important; }
.roach-end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 18px; }
.roach-end-stats div { padding: 9px 6px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); }
.roach-end-stats span { display: block; font-size: .5rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); }
.roach-end-stats b { display: block; margin-top: 2px; font-family: var(--display); font-size: 1.45rem; line-height: 1; color: var(--gold-bright); }
.roach-newbest { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 999px; background: rgba(232,182,103,.14); color: var(--gold-bright); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; }

.roach-side { display: flex; flex-direction: column; gap: 12px; }
.roach-tools { display: grid; gap: 8px; }
.roach-tool {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 11px 12px; border-radius: 14px; border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  color: var(--muted); transition: .25s var(--ease);
}
.roach-tool:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line); color: var(--cream); }
.roach-tool.is-active { border-color: rgba(232,182,103,.48); background: rgba(232,182,103,.1); color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(232,182,103,.14); }
.roach-tool:disabled { opacity: .45; cursor: not-allowed; }
.roach-tool.is-ready { opacity: 1; border-color: rgba(247,213,156,.62); animation: reformReady 1.5s ease-in-out infinite; }
.rt-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.05); font-size: 1rem; }
.roach-tool.is-active .rt-icon { background: rgba(232,182,103,.15); }
.rt-copy { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.rt-copy b { font-size: .76rem; }
.rt-copy i { font-style: normal; font-size: .58rem; color: var(--muted-2); letter-spacing: .02em; }
.roach-reform { border-color: rgba(247,213,156,.22); }
.roach-help { font-size: .66rem; line-height: 1.65; color: var(--muted-2); }
.roach-keys { font-size: .58rem; line-height: 1.55; color: var(--muted-2); opacity: .8; }
.roach-legend { display: grid; gap: 3px; font-size: .62rem; color: var(--muted); }
.roach-legend b { color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.roach-quit { width: 100%; padding: 10px 14px; font-size: .7rem; }

@keyframes scrollHover { 0%, 100% { transform: translate(-50%, -50%) translateY(0); } 50% { transform: translate(-50%, -50%) translateY(-7px); } }
@keyframes shieldPulse { 0%, 100% { transform: scale(.94); opacity: .65; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes scrollHit { 0%, 100% { transform: translate(-50%, -50%); } 25% { transform: translate(calc(-50% - 7px), -50%) rotate(-3deg); } 60% { transform: translate(calc(-50% + 5px), -50%) rotate(2deg); } }
@keyframes roachStun { from { transform: rotate(-7deg) scale(.97); } to { transform: rotate(7deg) scale(1.03); } }
@keyframes roachSquash { 0% { transform: scale(1) rotate(0); opacity: 1; } 40% { transform: scale(1.45, .42) rotate(-4deg); opacity: 1; } 100% { transform: scale(1.7, .12) rotate(-7deg); opacity: 0; } }
@keyframes roachReform { 0% { transform: scale(1); opacity: 1; filter: brightness(1); } 35% { transform: scale(1.25); filter: brightness(2.2) drop-shadow(0 0 16px #f7d59c); } 100% { transform: scale(.2) translateY(-40px) rotate(30deg); opacity: 0; } }
@keyframes sprayRing { from { transform: scale(.4); opacity: .95; } to { transform: scale(6.4); opacity: 0; } }
@keyframes sprayDrop { from { transform: scale(1) translate(0, 0); opacity: 1; } to { transform: scale(.2) translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes floatUp { 0% { transform: translate(-50%, -50%) scale(.75); opacity: 0; } 18% { opacity: 1; } 100% { transform: translate(-50%, -165%) scale(1.05); opacity: 0; } }
@keyframes reformWave { 0% { transform: scale(.25); opacity: 1; } 100% { transform: scale(46); opacity: 0; } }
@keyframes breachFlash { 0% { opacity: 0; } 22% { opacity: 1; } 100% { opacity: 0; } }
@keyframes arenaShake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-5px, 2px); } 40% { transform: translate(4px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, -1px); } }
@keyframes comboPop { 0% { opacity: 0; transform: translate(-50%, -8px) scale(.9); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px) scale(.98); } }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes reformReady { 0%, 100% { box-shadow: 0 0 0 0 rgba(247,213,156,.28); } 50% { box-shadow: 0 0 0 5px rgba(247,213,156,0); } }

@media (max-width: 980px) {
  .roach-stage { grid-template-columns: 1fr; }
  .roach-side { display: grid; grid-template-columns: 1fr; }
  .roach-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .roach-tool { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .rt-icon { width: 26px; height: 26px; }
  .roach-help, .roach-legend { display: none; }
  .roach-keys { display: none; }
  .roach-quit { justify-self: start; width: auto; }
}
@media (max-width: 760px) {
  .roach-screen { padding-top: 20px; }
  .roach-lede { display: none; }
  .roach-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roach-arena { height: clamp(350px, 54vh, 480px); border-radius: 18px; }
  .roach-overlay { padding: 10px; }
  .roach-card { padding: 16px 14px 14px; }
  .roach-card h3 { font-size: 1.7rem; margin: 4px 0 6px; }
  .roach-card p { font-size: .72rem; line-height: 1.5; }
  .roach-rules { margin: 9px 0 12px; gap: 4px; }
  .roach-rules li { font-size: .65rem; line-height: 1.45; }
  .roach-tiny { display: none; }
  .roach-actions .btn { padding: 10px 18px; }
  .roach-end-stats { margin: 11px 0 13px; }
  .roach-scroll { width: 76px; }
  .roach-top { gap: 12px; }
  .roach-heading h2 { font-size: 2rem; }
  .roach-best { padding: 6px 12px; }
  .roach-best b { font-size: 1.15rem; }
  .roach-tools { gap: 6px; }
  .rt-copy i { display: none; }
  .roach-card { padding: 20px 16px 18px; }
  .roach-end-stats { gap: 6px; }
  .roach-secret { bottom: 16px; left: 8px; padding: 7px; }
  .roach-secret-label { display: none; }
  body.is-roaching { padding-bottom: 0; }
  body.is-roaching .mobile-dock { display: none; }
  body.is-roaching::after { display: none; }
  body.is-roaching .roach-secret { opacity: 0; pointer-events: none; }
  .gallery-stage { height: 220px; }
  .gallery-crowd { height: 140px; }
  .gallery-head { align-items: flex-start; }
  .chamber-walkers { display: none; }
}
@media (max-width: 480px) {
  .roach-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roach-reform { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .roach-arena { height: 380px; }
  .roach-legend { display: none; }
  .roach-rules li { font-size: .68rem; }
  .gallery-stage { height: 190px; }
  .gallery-caption { font-size: .58rem; }
}
@media (max-width: 340px) {
  .roach-secret { left: 6px; padding: 3px; }
  .roach-secret-bug { font-size: .95rem; }
}

/* ============================================================
   Speaker's Chair — Three.js game
   ============================================================ */
.speaker-screen { padding: 30px clamp(14px, 4vw, 48px) 96px; max-width: 1460px; margin: 0 auto; }
.speaker-top { display: flex; align-items: center; gap: 18px 26px; flex-wrap: wrap; }
.speaker-heading { flex: 1; min-width: 230px; }
.speaker-heading h2 { font-family: var(--display); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.02; letter-spacing: -.01em; }
.speaker-heading h2 em { color: var(--gold-bright); font-style: italic; }
.speaker-best {
  display: flex; align-items: baseline; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(232,182,103,.06);
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2);
}
.speaker-best b { font-family: var(--display); font-size: 1.4rem; letter-spacing: 0; color: var(--gold-bright); line-height: 1; }
.speaker-lede { max-width: 820px; margin: 14px 0 0; color: var(--muted); font-size: .87rem; line-height: 1.75; }
.speaker-lede b { color: var(--gold-bright); }
.speaker-lede kbd {
  display: inline-block; padding: 1px 7px; border-radius: 6px; font-family: var(--body);
  border: 1px solid var(--line); background: rgba(232,182,103,.1); color: var(--gold-bright);
  font-size: .76em; letter-spacing: .04em;
}

.speaker-hud { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.sstat {
  position: relative; display: flex; flex-direction: column; gap: 2px; overflow: hidden;
  padding: 10px 14px 12px; border-radius: 14px; border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
}
.sstat > span { font-size: .55rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }
.sstat b { font-family: var(--display); font-size: 1.55rem; line-height: 1.1; color: var(--cream); font-variant-numeric: tabular-nums; }
.sstat-suspended b { color: #9dbcf5; }
.sstat-suspended.is-low b { color: var(--red); }

.speaker-stage { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 16px; align-items: start; }
.speaker-arena {
  position: relative; height: clamp(430px, 62vh, 650px); overflow: hidden; border-radius: 24px;
  border: 1px solid var(--line); touch-action: none; user-select: none; cursor: crosshair;
  background:
    radial-gradient(720px 340px at 50% 108%, rgba(232,182,103,.14), transparent 70%),
    radial-gradient(600px 420px at 50% 20%, rgba(39,58,104,.35), transparent 72%),
    linear-gradient(180deg, #0f1a33, #080d1d 68%, #060a15);
  box-shadow: inset 0 0 110px rgba(0,0,0,.5), 0 30px 60px rgba(0,0,0,.3);
}
.speaker-arena.is-shaking { animation: arenaShake .4s ease; }
.speaker-floor { position: absolute; inset: 0; z-index: 1; }
.speaker-fx { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
.speaker-flash { position: absolute; inset: 0; z-index: 9; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 56%, rgba(226,87,107,.5), transparent 70%); }
.speaker-flash.is-active { animation: breachFlash .45s ease-out; }
.speaker-combo {
  position: absolute; left: 50%; top: 12px; z-index: 8; transform: translateX(-50%);
  padding: 4px 12px; border-radius: 999px; opacity: 0; pointer-events: none;
  border: 1px solid rgba(247,213,156,.3); background: rgba(7,11,23,.72);
  color: var(--gold-bright); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-align: center;
}
.speaker-combo.is-showing { animation: comboPop 1.5s var(--ease); }
.speaker-overlay {
  position: absolute; inset: 0; z-index: 10; display: none; place-items: center; padding: 18px;
  background: radial-gradient(circle at 50% 42%, rgba(7,11,23,.5), rgba(5,8,16,.9));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.speaker-overlay.is-active { display: grid; animation: overlayIn .36s var(--ease); }

.speaker-side { display: flex; flex-direction: column; gap: 12px; }
.speaker-tools { display: grid; gap: 8px; }
.speaker-tool {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 11px 12px; border-radius: 14px; border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
  color: var(--muted); transition: .25s var(--ease);
}
.speaker-tool:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--line); color: var(--cream); }
.speaker-tool.is-active { border-color: rgba(232,182,103,.48); background: rgba(232,182,103,.1); color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(232,182,103,.14); }
.speaker-tool:disabled { opacity: .45; cursor: not-allowed; }
.speaker-tool.is-ready { opacity: 1; border-color: rgba(247,213,156,.62); animation: reformReady 1.5s ease-in-out infinite; }
.st-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.05); font-size: 1rem; }
.speaker-tool.is-active .st-icon { background: rgba(232,182,103,.15); }
.st-copy { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.st-copy b { font-size: .76rem; }
.st-copy i { font-style: normal; font-size: .58rem; color: var(--muted-2); letter-spacing: .02em; }
.speaker-adjourn { border-color: rgba(247,213,156,.22); }
.speaker-help { font-size: .66rem; line-height: 1.65; color: var(--muted-2); }
.speaker-keys { font-size: .58rem; line-height: 1.55; color: var(--muted-2); opacity: .8; }
.speaker-legend { display: grid; gap: 3px; font-size: .62rem; color: var(--muted); }
.speaker-legend b { color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.speaker-quit { width: 100%; padding: 10px 14px; font-size: .7rem; }

.speaker-mp-types {
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
}
.speaker-mp-types h4 { font-family: var(--body); font-size: .56rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.mp-type-row { display: flex; align-items: center; gap: 8px; font-size: .64rem; color: var(--muted); padding: 2px 0; }
.mp-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mp-dot.protester { background: #4f7fd4; }
.mp-dot.thrower { background: #e2576b; }
.mp-dot.placard { background: #f2c66d; }
.mp-dot.leader { background: #e8842c; }

@media (max-width: 980px) {
  .speaker-stage { grid-template-columns: 1fr; }
  .speaker-side { display: grid; grid-template-columns: 1fr; }
  .speaker-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .speaker-tool { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .st-icon { width: 26px; height: 26px; }
  .speaker-help, .speaker-legend { display: none; }
  .speaker-quit { justify-self: start; width: auto; }
}
@media (max-width: 760px) {
  .speaker-screen { padding-top: 20px; }
  .speaker-lede { display: none; }
  .speaker-hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .speaker-arena { height: clamp(350px, 54vh, 480px); border-radius: 18px; }
  .speaker-overlay { padding: 10px; }
  .speaker-top { gap: 12px; }
  .speaker-heading h2 { font-size: 2rem; }
  .speaker-best { padding: 6px 12px; }
  .speaker-best b { font-size: 1.15rem; }
  .speaker-tools { gap: 6px; }
  .st-copy i { display: none; }
  .speaker-mp-types { display: none; }
}
@media (max-width: 480px) {
  .speaker-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .speaker-adjourn { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .speaker-arena { height: 380px; }
  .speaker-legend { display: none; }
}

/* Day theme */
[data-theme="day"] .gallery-stage {
  background:
    radial-gradient(700px 240px at 50% 100%, rgba(154,97,16,.14), transparent 70%),
    linear-gradient(180deg, #fdf8ee, #f1e7d4);
  box-shadow: inset 0 0 80px rgba(120,80,20,.12), 0 22px 46px rgba(120,80,20,.12);
}
[data-theme="day"] .gallery-arches { background:
  radial-gradient(ellipse 88px 138px at 50% 100%, transparent 61%, rgba(154,97,16,.2) 62% 64%, transparent 65%) 0 0 / 176px 100% repeat-x,
  linear-gradient(180deg, rgba(154,97,16,.08), transparent 62%); }
[data-theme="day"] .person::before { background: #8f7a58; border-color: rgba(122,77,6,.25); }
[data-theme="day"] .person::after { background: linear-gradient(180deg, #b7a37d, #8a7857 70%); }
[data-theme="day"] .person.is-tall::after { background: linear-gradient(180deg, #a98a58, #7c6034 72%); }
[data-theme="day"] .walker::before { background: #6d5734; }
[data-theme="day"] .walker::after { background: linear-gradient(180deg, #8a744c, #5f4d2d); }
[data-theme="day"] .chamber-walkers span::before { background: #8a734d; }
[data-theme="day"] .chamber-walkers span::after { background: linear-gradient(180deg, #a98e60, #6d5a38); }
[data-theme="day"] .roach-arena {
  background:
    radial-gradient(720px 340px at 50% 108%, rgba(154,97,16,.16), transparent 70%),
    radial-gradient(600px 420px at 50% 20%, rgba(203,177,133,.35), transparent 72%),
    linear-gradient(180deg, #f7efdf, #e9dcc3 68%, #dfd0b2);
  box-shadow: inset 0 0 100px rgba(120,80,20,.14), 0 26px 54px rgba(120,80,20,.16);
}
[data-theme="day"] .roach-arena::before { background: repeating-linear-gradient(90deg, transparent 0 68px, rgba(154,97,16,.1) 68px 69px); }
[data-theme="day"] .roach-arena::after { background: linear-gradient(180deg, transparent, rgba(120,80,20,.1)); }
[data-theme="day"] .roach-pillar { background: linear-gradient(90deg, rgba(154,97,16,.2), rgba(154,97,16,.05) 55%, rgba(0,0,0,.06)); }
[data-theme="day"] .roach-tool, [data-theme="day"] .rstat { background: rgba(255,255,255,.55); }
[data-theme="day"] .rstat-integrity b { color: #147a46; }
[data-theme="day"] .rstat-integrity.is-low b { color: #b3223c; }
[data-theme="day"] .roach-tool.is-active { background: rgba(154,97,16,.1); }
[data-theme="day"] .roach-card { background: #fffaf0; }
[data-theme="day"] .roach-end-stats div { background: #fffaf1; }
[data-theme="day"] .roach-combo { background: rgba(255,250,240,.9); }
[data-theme="day"] .roach-slang { background: rgba(255,250,240,.92); color: var(--gold-bright); }
[data-theme="day"] .roach .shell { fill: #6b3a1a; stroke: #7a4d1c; }
[data-theme="day"] .roach .body-dark { fill: #3a1f0c; }
[data-theme="day"] .roach-secret { background: rgba(255,250,240,.82); }
[data-theme="day"] .footer-roach { color: var(--muted); }

/* ============================================================
   Preference / language responsive
   ============================================================ */
@media (max-width: 1180px) {
  .xp-pill { display: none; }
}
@media (max-width: 760px) {
  .nav-controls { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; }
  .icon-btn svg { width: 16px; height: 16px; }
  .lang-btn { min-width: 40px; padding: 0 8px; font-size: 0.6rem; }
  .audio-panel {
    position: fixed; left: 12px; right: 12px; top: 66px; width: auto;
    max-height: calc(100vh - 92px); overflow: auto;
  }
  .lang-menu { position: fixed; top: 66px; right: 12px; }
  .confetti { display: none; }
}
@media (max-width: 400px) {
  .brand-text strong { font-size: 1.2rem; letter-spacing: 0.16em; }
  .brand-mark { width: 34px; height: 34px; }
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Historical Parliament simulator
   ============================================================ */
[hidden] { display: none !important; }

/* Home teaser ------------------------------------------------- */
.history-teaser { padding-top: 8px; }
.history-band {
  position: relative; overflow: hidden;
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(24px, 4vw, 60px); align-items: center;
  padding: clamp(26px, 4vw, 48px);
  border-radius: var(--radius); border: 1px solid var(--line);
  background:
    radial-gradient(620px 300px at 92% 12%, rgba(232,182,103,.13), transparent 68%),
    linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.008) 58%);
  box-shadow: 0 28px 60px rgba(0,0,0,.26);
}
.history-band::after {
  content: ""; position: absolute; right: -90px; top: -90px; width: 300px; height: 300px;
  border-radius: 50%; border: 1px solid rgba(232,182,103,.13); pointer-events: none;
  box-shadow: 0 0 0 34px rgba(232,182,103,.025), 0 0 0 68px rgba(232,182,103,.018);
}
.history-band-copy { position: relative; z-index: 1; }
.history-band h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.06; margin: 10px 0 14px; }
.history-band h2 em { color: var(--gold-bright); }
.history-band p { max-width: 520px; color: var(--muted); font-size: .9rem; line-height: 1.8; }
.history-band .btn { margin-top: 22px; }
.history-rail { position: relative; z-index: 1; padding: 18px 16px 12px; border-radius: 16px; border: 1px solid var(--line-soft); background: rgba(0,0,0,.16); }
.history-track { display: flex; justify-content: space-between; font-size: .56rem; letter-spacing: .14em; color: var(--muted-2); font-weight: 700; }
.history-bars { display: flex; align-items: flex-end; gap: 5px; height: 132px; margin: 14px 0 12px; padding-bottom: 2px; border-bottom: 1px solid var(--line-soft); }
.history-bars i {
  flex: 1; height: var(--h); min-height: 8px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--gold-bright), rgba(176,122,54,.45));
  box-shadow: 0 0 16px rgba(232,182,103,.14);
  transform-origin: bottom; animation: historyGrow 1.1s var(--ease) both;
}
.history-bars i:nth-child(3n) { animation-delay: .08s; }
.history-bars i:nth-child(3n+1) { animation-delay: .16s; }
.history-bars i:nth-child(3n+2) { animation-delay: .24s; }
.history-rail p { font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); text-align: center; }
@keyframes historyGrow { from { transform: scaleY(.08); opacity: .2; } to { transform: scaleY(1); opacity: 1; } }

/* Simulator shell --------------------------------------------- */
#screen-simulator { max-width: 1440px; margin: 0 auto; padding: 22px clamp(14px, 4vw, 54px) 70px; }
.sim-head { padding: 18px 0 26px; }
.sim-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }
.sim-panel { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sim-controls { padding-top: clamp(22px, 3vw, 32px); }

.sim-block { padding: 18px 0; border-top: 1px solid var(--line-soft); }
.sim-year-block { border-top: 0; padding-top: 14px; }
.sim-label { font-size: .58rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--gold); }
.sim-mini { font-size: .58rem; letter-spacing: .06em; color: var(--muted-2); }
.sim-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sim-hint { color: var(--muted); font-size: .68rem; line-height: 1.65; margin-top: 9px; }
.sim-warning { color: #f0cd76; margin: 0; }
.sim-warning b { color: var(--gold-bright); }

.sim-year-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.sim-year-value { font-family: var(--display); font-size: clamp(2.8rem, 5vw, 3.8rem); line-height: .95; color: var(--gold-bright); font-variant-numeric: tabular-nums; margin-top: 4px; }
.sim-year-nav { display: flex; gap: 6px; }
.sim-year-nav button {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line-soft); border-radius: 50%; color: var(--muted);
  font-size: .82rem; transition: .22s var(--ease);
}
.sim-year-nav button:hover { color: var(--gold-bright); border-color: var(--line); background: rgba(232,182,103,.08); }
#simYear {
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 4px; margin: 20px 0 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
  outline: none; cursor: pointer;
}
#simYear::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff6e4; border: 3px solid var(--gold-deep);
  box-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: grip;
}
#simYear::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff6e4; border: 3px solid var(--gold-deep);
  box-shadow: 0 2px 10px rgba(0,0,0,.35); cursor: grip;
}
.sim-year-scale { display: flex; justify-content: space-between; font-size: .54rem; letter-spacing: .12em; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.sim-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.02); }
.sim-seg button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: 9px; color: var(--muted);
  font-size: .74rem; font-weight: 700; transition: .22s var(--ease);
}
.sim-seg button i { font-style: normal; font-size: .6rem; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted-2); font-variant-numeric: tabular-nums; }
.sim-seg button:hover { color: var(--cream); }
.sim-seg button.is-active { background: rgba(232,182,103,.14); color: var(--gold-bright); box-shadow: inset 0 0 0 1px rgba(232,182,103,.2); }
.sim-seg button.is-active i { background: rgba(0,0,0,.2); color: var(--gold-bright); }

.sim-sides { display: grid; gap: 6px; }
.sim-sides button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.02); transition: .22s var(--ease);
}
.sim-sides button:hover { border-color: var(--line); background: rgba(232,182,103,.04); }
.sim-sides button.is-active { border-color: rgba(232,182,103,.4); background: rgba(232,182,103,.08); }
.sim-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sim-dot.treasury { background: #d79a45; }
.sim-dot.opposition { background: #4f7fd4; }
.sim-dot.other { background: #6c7894; }
.sim-side-copy { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.sim-side-copy b { font-size: .76rem; color: var(--cream); font-weight: 700; }
.sim-side-copy em { font-style: normal; font-size: .56rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.sim-sides button > i { font-style: normal; font-size: .72rem; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.sim-sides button.is-active > i { color: var(--gold-bright); }

.sim-select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--line-soft); background: var(--panel-solid); color: var(--text);
  font-family: var(--body); font-size: .78rem; font-weight: 600; outline: none;
}
.sim-select:focus { border-color: var(--line); box-shadow: 0 0 0 3px rgba(232,182,103,.08); }

.sim-aligns { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-aligns button {
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line-soft);
  font-size: .66rem; font-weight: 700; color: var(--muted); transition: .22s var(--ease);
}
.sim-aligns button:hover { color: var(--cream); border-color: var(--line); }
.sim-aligns button.is-active { background: rgba(232,182,103,.14); color: var(--gold-bright); border-color: rgba(232,182,103,.35); }

.sim-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.sim-actions .btn { width: 100%; justify-content: center; }
.sim-actions .btn[disabled] { opacity: .42; cursor: not-allowed; transform: none; }

/* Verdict ----------------------------------------------------- */
.sim-verdict {
  padding: clamp(22px, 3vw, 34px); border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.01) 55%);
  box-shadow: 0 26px 54px rgba(0,0,0,.24);
  animation: panelIn .45s var(--ease);
}
.sim-verdict.is-pass { border-color: rgba(47,191,113,.35); background: linear-gradient(165deg, rgba(47,191,113,.1), rgba(47,191,113,.018)); }
.sim-verdict.is-fail { border-color: rgba(226,87,107,.35); background: linear-gradient(165deg, rgba(226,87,107,.09), rgba(226,87,107,.018)); }
.sv-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sv-seal { width: 50px; height: 50px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 1px solid currentColor; font-size: 1.15rem; font-weight: 800; }
.is-pass .sv-seal { color: #6fe6a7; box-shadow: 0 0 26px rgba(47,191,113,.22); }
.is-fail .sv-seal { color: #ff9baa; box-shadow: 0 0 26px rgba(226,87,107,.2); }
.sv-kicker { font-size: .56rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); }
.sv-head h2 { font-size: clamp(1.55rem, 2.6vw, 2.15rem); margin: 2px 0 0; }
.is-pass .sv-head h2 { color: #8df0bb; }
.is-fail .sv-head h2 { color: #ffb0bd; }
.sv-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft); background: var(--line-soft); margin-bottom: 16px; }
.sv-counts div { padding: 12px 8px; text-align: center; background: rgba(9,15,31,.68); }
.sv-counts span { display: block; font-size: .52rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted-2); }
.sv-counts b { display: block; font-family: var(--display); font-size: 1.55rem; line-height: 1.25; color: var(--cream); font-variant-numeric: tabular-nums; }
.sv-counts .aye b { color: #5fe0a2; }
.sv-counts .no b { color: #ff8b9b; }
.sv-counts .abstain b { color: #f0cd76; }
.sv-counts .need b { color: var(--gold-bright); }
.sv-rule { font-size: .8rem; line-height: 1.75; color: var(--muted); }
.sv-rule b { color: var(--cream); }
.sv-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.sv-meta span { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.03); font-size: .58rem; letter-spacing: .05em; color: var(--muted); }
.sv-meta span b { color: var(--gold-bright); }
.sv-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.sim-footnotes { max-width: 1280px; margin: 26px auto 0; display: flex; flex-direction: column; gap: 8px; color: var(--muted-2); font-size: .66rem; line-height: 1.7; }
.sim-footnotes a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* Simulator responsive ---------------------------------------- */
@media (max-width: 1180px) {
  .sim-grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
}
@media (max-width: 980px) {
  .sim-grid { grid-template-columns: 1fr; }
  .history-band { grid-template-columns: 1fr; }
  .history-rail { max-width: 560px; }
}
@media (max-width: 760px) {
  .sim-head { padding-top: 14px; }
  .history-band { padding: 22px 18px; }
  .history-bars { height: 96px; }
  .sim-year-value { font-size: 3rem; }
  .sv-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim-aligns button { font-size: .62rem; padding: 7px 10px; }
}
@media (max-width: 480px) {
  .sim-seg { grid-template-columns: 1fr; }
  .sim-year-value { font-size: 2.7rem; }
  .history-bars { gap: 3px; height: 82px; }
  .sv-head { align-items: flex-start; gap: 10px; }
  .sv-seal { width: 42px; height: 42px; }
  .sim-sides button { padding: 9px 10px; }
}

/* Simulator day theme ---------------------------------------- */
[data-theme="day"] .history-band {
  background:
    radial-gradient(620px 300px at 92% 12%, rgba(154,97,16,.14), transparent 68%),
    linear-gradient(160deg, #fffdf8, #f7efdf 70%);
  box-shadow: 0 28px 60px rgba(120,80,20,.14);
}
[data-theme="day"] .history-band::after { border-color: rgba(154,97,16,.16); box-shadow: 0 0 0 34px rgba(154,97,16,.03), 0 0 0 68px rgba(154,97,16,.02); }
[data-theme="day"] .history-rail { background: rgba(255,255,255,.52); }
[data-theme="day"] .history-bars i { background: linear-gradient(180deg, #d9a45b, #b07a36); box-shadow: 0 0 16px rgba(154,97,16,.1); }
[data-theme="day"] .sim-select { background: #fffdf8; color: var(--text); }
[data-theme="day"] .sim-seg { background: rgba(255,255,255,.5); }
[data-theme="day"] .sim-seg button i { background: rgba(154,97,16,.08); }
[data-theme="day"] .sim-seg button.is-active i { background: rgba(255,255,255,.45); }
[data-theme="day"] .sim-sides button { background: rgba(255,255,255,.55); }
[data-theme="day"] .sim-sides button.is-active { background: rgba(154,97,16,.08); border-color: rgba(154,97,16,.3); }
[data-theme="day"] .sim-aligns button.is-active { background: rgba(154,97,16,.1); border-color: rgba(154,97,16,.28); }
[data-theme="day"] .sim-verdict { background: linear-gradient(165deg, #fffdf8, #fbf5e9); }
[data-theme="day"] .sim-verdict.is-pass { background: linear-gradient(165deg, rgba(23,122,70,.08), rgba(23,122,70,.015)); }
[data-theme="day"] .sim-verdict.is-fail { background: linear-gradient(165deg, rgba(182,43,67,.07), rgba(182,43,67,.015)); }
[data-theme="day"] .is-pass .sv-head h2 { color: #147a46; }
[data-theme="day"] .is-fail .sv-head h2 { color: #b3223c; }
[data-theme="day"] .sv-counts div { background: #fffaf1; }
[data-theme="day"] .sv-meta span { background: rgba(255,255,255,.5); }



/* ============================================================
   Emergency — the black day
   Activating the Emergency screen flips the whole interface to
   a blood-red emergency palette, then restores the theme on exit.
   ============================================================ */
:root[data-emergency="true"] {
  color-scheme: dark;
  --ink: #090102;
  --ink-2: #130204;
  --ink-3: #230509;
  --panel: rgba(46, 5, 9, 0.8);
  --panel-solid: #1c0408;
  --cream: #ffe9e7;
  --text: #f7dbd8;
  --muted: #cf9a9a;
  --muted-2: #a76d6d;
  --gold: #ff4d4d;
  --gold-bright: #ff9a9a;
  --gold-deep: #a80000;
  --saffron: #ff5a36;
  --green: #9d2a2a;
  --red: #ff5b5b;
  --blue: #a34a4a;
  --line: rgba(255, 70, 70, 0.26);
  --line-soft: rgba(255, 120, 120, 0.11);
  --glass: rgba(255, 50, 50, 0.05);
  --shadow: 0 24px 60px rgba(90, 0, 0, 0.65);
}

html[data-emergency="true"] body { background: #090102; }
html[data-emergency="true"] .scene {
  background:
    radial-gradient(1200px 800px at 76% -10%, rgba(155, 0, 0, 0.36), transparent 62%),
    radial-gradient(900px 700px at 6% 16%, rgba(92, 0, 0, 0.4), transparent 60%),
    linear-gradient(180deg, #140204 0%, #090102 46%, #1a0306 100%);
}
html[data-emergency="true"] .scene::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 38%, rgba(110, 0, 0, 0.38) 100%);
  animation: emBreathe 7s ease-in-out infinite;
}
@keyframes emBreathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
html[data-emergency="true"] .orb-1 { background: radial-gradient(circle, rgba(255, 40, 40, 0.26), transparent 70%); }
html[data-emergency="true"] .orb-2 { background: radial-gradient(circle, rgba(160, 0, 0, 0.24), transparent 70%); }
html[data-emergency="true"] .orb-3 { background: radial-gradient(circle, rgba(255, 90, 54, 0.16), transparent 70%); }
html[data-emergency="true"] .grid-lines {
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255, 60, 60, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 60, 60, 0.1) 1px, transparent 1px);
}
html[data-emergency="true"] .dust-a,
html[data-emergency="true"] .dust-b { opacity: 0.28; }

html[data-emergency="true"] .site-nav {
  background: rgba(18, 2, 4, 0.88);
  border-bottom-color: rgba(255, 60, 60, 0.24);
}
html[data-emergency="true"] .nav-links { background: rgba(255, 60, 60, 0.055); border-color: rgba(255, 70, 70, 0.16); }
html[data-emergency="true"] .nav-link { color: var(--muted); }
html[data-emergency="true"] .nav-link:hover { color: #ffd2d2; }
html[data-emergency="true"] .nav-link.is-active {
  background: rgba(255, 50, 50, 0.18); color: #ffb8b8;
  box-shadow: inset 0 0 0 1px rgba(255, 90, 90, 0.3);
}
html[data-emergency="true"] .xp-pill { background: rgba(255, 50, 50, 0.08); border-color: rgba(255, 70, 70, 0.22); }
html[data-emergency="true"] .xp-pill b { color: #ffb8b8; }
html[data-emergency="true"] .icon-btn { border-color: rgba(255, 70, 70, 0.16); }
html[data-emergency="true"] .icon-btn:hover { color: #ff9a9a; border-color: rgba(255, 90, 90, 0.4); background: rgba(255, 50, 50, 0.1); }
html[data-emergency="true"] .brand-mark { color: #ff5b5b; filter: drop-shadow(0 0 14px rgba(255, 50, 50, 0.5)); }
html[data-emergency="true"] .popover { background: #1c0408; box-shadow: 0 24px 50px rgba(80, 0, 0, 0.55); }
html[data-emergency="true"] .mobile-dock { background: rgba(20, 2, 4, 0.96); box-shadow: 0 16px 40px rgba(70, 0, 0, 0.6); }
html[data-emergency="true"] .dock-link.is-active { background: rgba(255, 50, 50, 0.18); color: #ffb8b8; }
html[data-emergency="true"] .site-footer { background: rgba(15, 1, 3, 0.92); }
html[data-emergency="true"] .roach-secret {
  background: rgba(30, 3, 6, 0.85); border-color: rgba(255, 70, 70, 0.22);
}
html[data-emergency="true"] .roach-secret:hover,
html[data-emergency="true"] .roach-secret:focus-visible { color: #ff9a9a; border-color: rgba(255, 90, 90, 0.42); }
html[data-emergency="true"] .footer-roach { color: var(--muted); }
html[data-emergency="true"] .toast { background: rgba(30, 3, 6, 0.97); color: #ffe9e7; box-shadow: 0 18px 40px rgba(80, 0, 0, 0.55); }
html[data-emergency="true"] ::selection { background: rgba(255, 50, 50, 0.34); }
html[data-emergency="true"] :focus-visible { outline-color: #ff5b5b; }

/* Common cards and controls, so the palette feels global */
html[data-emergency="true"] .feature-card,
html[data-emergency="true"] .scenario-card,
html[data-emergency="true"] .learn-card,
html[data-emergency="true"] .panel-card,
html[data-emergency="true"] .method-item,
html[data-emergency="true"] .article-item,
html[data-emergency="true"] .majority-card,
html[data-emergency="true"] .option,
html[data-emergency="true"] .majority-opt,
html[data-emergency="true"] .tally-cell,
html[data-emergency="true"] .tab-row,
html[data-emergency="true"] .chamber-panel,
html[data-emergency="true"] .feedback,
html[data-emergency="true"] .brief-grid div,
html[data-emergency="true"] .result-stats div,
html[data-emergency="true"] .sim-verdict,
html[data-emergency="true"] .history-band,
html[data-emergency="true"] .history-rail {
  background: linear-gradient(165deg, rgba(58, 6, 11, 0.72), rgba(20, 2, 4, 0.82));
  border-color: rgba(255, 70, 70, 0.2);
  box-shadow: 0 18px 40px rgba(70, 0, 0, 0.3);
}
html[data-emergency="true"] .feature-card:hover,
html[data-emergency="true"] .scenario-card:hover {
  background: linear-gradient(165deg, rgba(80, 8, 14, 0.8), rgba(28, 3, 6, 0.9));
}
html[data-emergency="true"] .btn-gold {
  background: linear-gradient(135deg, #ff8a8a, #d81f1f 46%, #8f0000);
  color: #fff3f3;
  box-shadow: 0 12px 34px rgba(190, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
html[data-emergency="true"] .cta-band {
  background:
    radial-gradient(700px 300px at 85% 20%, rgba(255, 40, 40, 0.2), transparent 60%),
    linear-gradient(120deg, rgba(70, 4, 10, 0.7), rgba(24, 2, 4, 0.85));
}
html[data-emergency="true"] .gallery-band { border-color: rgba(255, 70, 70, 0.14); }

/* Emergency screen ------------------------------------------- */
#screen-emergency { padding: 22px clamp(14px, 4vw, 54px) 74px; }
.em-wrap { max-width: 1180px; margin: 0 auto; }

.em-alert {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; margin-bottom: 18px;
  border: 1px solid rgba(255, 70, 70, 0.4); border-radius: 12px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 40, 40, 0.1) 0 12px, rgba(0, 0, 0, 0.12) 12px 24px),
    rgba(40, 3, 7, 0.6);
  color: #ffb3b3; font-size: 0.62rem; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.em-alert-dot {
  width: 9px; height: 9px; flex: none; border-radius: 50%;
  background: #ff3b3b; box-shadow: 0 0 0 4px rgba(255, 59, 59, 0.18), 0 0 16px rgba(255, 59, 59, 0.8);
  animation: emPulse 1.8s ease-in-out infinite;
}
@keyframes emPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }

.em-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(24px, 4vw, 54px); align-items: center;
  padding: clamp(28px, 5vw, 62px);
  border: 1px solid rgba(255, 70, 70, 0.3); border-radius: 24px;
  background:
    radial-gradient(700px 380px at 88% 6%, rgba(210, 0, 0, 0.3), transparent 66%),
    linear-gradient(150deg, rgba(58, 4, 9, 0.9), rgba(16, 1, 3, 0.94) 68%);
  box-shadow: 0 30px 80px rgba(70, 0, 0, 0.4), inset 0 1px 0 rgba(255, 120, 120, 0.1);
}
.em-hero::before {
  content: "1975"; position: absolute; right: -22px; bottom: -90px;
  font-family: var(--display); font-size: clamp(13rem, 26vw, 24rem); line-height: 0.7;
  color: rgba(255, 40, 40, 0.055); pointer-events: none; letter-spacing: -0.04em;
}
.em-hero-copy { position: relative; z-index: 1; }
.em-kicker {
  display: inline-block; font-size: 0.62rem; font-weight: 800;
  letter-spacing: 0.22em; text-transform: uppercase; color: #ff8f8f;
}
.em-hero h1 {
  font-family: var(--display); font-size: clamp(3.2rem, 8.4vw, 7.4rem);
  line-height: 0.88; letter-spacing: -0.02em; color: #fff3f1; margin: 12px 0 18px;
}
.em-hero h1 em { color: #ff4d4d; font-style: italic; text-shadow: 0 0 44px rgba(255, 40, 40, 0.35); }
.em-lede { max-width: 640px; color: #d9b3b3; font-size: 0.94rem; line-height: 1.85; }
.em-hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 26px; }
.em-btn {
  border: 1px solid rgba(255, 90, 90, 0.45); color: #ffd2d2;
  background: rgba(255, 50, 50, 0.08); padding: 11px 22px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
}
.em-btn:hover { background: rgba(255, 50, 50, 0.16); transform: translateY(-2px); }
.em-stamp {
  display: inline-block; padding: 7px 14px; border: 2px solid rgba(255, 70, 70, 0.75);
  border-radius: 6px; color: #ff6b6b; font-size: 0.6rem; font-weight: 800;
  letter-spacing: 0.24em; text-transform: uppercase; transform: rotate(-6deg);
  box-shadow: 0 0 22px rgba(255, 40, 40, 0.16) inset;
}

.em-date-card {
  position: relative; z-index: 1; text-align: center;
  padding: 22px 18px; border-radius: 18px;
  border: 1px solid rgba(255, 80, 80, 0.24);
  background: rgba(12, 1, 2, 0.55);
  box-shadow: inset 0 0 50px rgba(160, 0, 0, 0.18);
}
.em-date-label { display: block; font-size: 0.56rem; font-weight: 800; letter-spacing: 0.2em; color: #ff9a9a; text-transform: uppercase; }
.em-date-card b {
  display: block; font-family: var(--display); font-size: clamp(4rem, 9vw, 6.4rem);
  line-height: 0.95; color: #fff0ee; margin: 6px 0 2px; letter-spacing: 0.02em;
}
.em-date-card i { font-style: normal; font-family: var(--display); font-size: 1.5rem; color: #ff6b6b; }

.em-section { margin-top: clamp(42px, 6vw, 74px); }
.em-section-head { margin-bottom: 24px; }
.em-label {
  display: inline-block; font-size: 0.58rem; font-weight: 800;
  letter-spacing: 0.2em; text-transform: uppercase; color: #ff6b6b;
  padding-bottom: 5px; border-bottom: 1px solid rgba(255, 70, 70, 0.3);
}
.em-section-head h2,
.em-lesson h2,
.em-closing h2 {
  font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.04; color: #fff0ee; margin-top: 12px;
}
.em-section-head h2 em,
.em-lesson h2 em,
.em-closing h2 em { color: #ff4d4d; font-style: italic; }

.em-timeline { position: relative; margin-left: 4px; padding-left: 26px; border-left: 1px solid rgba(255, 70, 70, 0.28); }
.em-tl-item { position: relative; padding: 0 0 28px 16px; }
.em-tl-item:last-child { padding-bottom: 0; }
.em-tl-item::before {
  content: ""; position: absolute; left: -33px; top: 5px; width: 11px; height: 11px;
  border-radius: 50%; background: #ff4d4d;
  box-shadow: 0 0 0 4px rgba(255, 60, 60, 0.15), 0 0 20px rgba(255, 40, 40, 0.65);
}
.em-tl-date {
  display: block; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: #ff8f8f; margin-bottom: 4px;
}
.em-tl-item h3 { font-size: 1.06rem; color: #ffe1df; margin-bottom: 4px; }
.em-tl-item p { color: #c79a9a; font-size: 0.84rem; line-height: 1.7; max-width: 720px; }

.em-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.em-card {
  position: relative; display: flex; flex-direction: column;
  padding: 22px 20px 18px; border-radius: 18px;
  border: 1px solid rgba(255, 70, 70, 0.2);
  background: linear-gradient(165deg, rgba(52, 5, 10, 0.62), rgba(16, 1, 3, 0.72));
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.em-card:hover { transform: translateY(-4px); border-color: rgba(255, 90, 90, 0.42); background: linear-gradient(165deg, rgba(72, 7, 13, 0.7), rgba(22, 2, 4, 0.8)); }
.em-num { font-family: var(--display); font-size: 1.7rem; line-height: 1; color: #ff5b5b; opacity: 0.7; }
.em-card h3 { font-size: 1rem; color: #ffe1df; margin: 10px 0 6px; }
.em-card p { color: #c79a9a; font-size: 0.8rem; line-height: 1.65; flex: 1; }
.em-tag {
  align-self: flex-start; margin-top: 14px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(255, 80, 80, 0.28); background: rgba(255, 50, 50, 0.07);
  font-size: 0.54rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #ff9a9a;
}

.em-quote {
  margin: clamp(42px, 6vw, 74px) 0 0; padding: clamp(24px, 4vw, 44px);
  border-left: 3px solid #ff4d4d;
  background: linear-gradient(100deg, rgba(70, 4, 10, 0.45), rgba(20, 2, 4, 0.2));
}
.em-quote p {
  font-family: var(--display); font-size: clamp(1.5rem, 3.4vw, 2.7rem);
  line-height: 1.3; color: #ffe6e4; margin: 12px 0 14px;
}
.em-quote cite { font-style: normal; font-size: 0.64rem; letter-spacing: 0.18em; text-transform: uppercase; color: #ff8f8f; }

.em-lesson {
  margin-top: clamp(42px, 6vw, 74px);
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 54px); align-items: start;
  padding: clamp(24px, 4vw, 44px); border-radius: 22px;
  border: 1px solid rgba(255, 70, 70, 0.22);
  background: linear-gradient(160deg, rgba(44, 4, 9, 0.6), rgba(16, 1, 3, 0.72));
}
.em-lesson-copy p { color: #c79a9a; font-size: 0.86rem; line-height: 1.75; margin-top: 12px; }
.em-list { display: grid; gap: 10px; }
.em-list li {
  position: relative; padding: 11px 14px 11px 40px; border-radius: 12px;
  border: 1px solid rgba(255, 70, 70, 0.16); background: rgba(255, 50, 50, 0.045);
  color: #e8c3c3; font-size: 0.82rem; line-height: 1.55;
}
.em-list li::before {
  content: "§"; position: absolute; left: 14px; top: 10px;
  color: #ff4d4d; font-family: var(--display); font-size: 1.05rem;
}

.em-closing {
  margin-top: clamp(42px, 6vw, 74px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 26px; padding: clamp(26px, 4.4vw, 50px);
  border-radius: 22px; border: 1px solid rgba(255, 80, 80, 0.34);
  background:
    radial-gradient(600px 300px at 92% 14%, rgba(255, 40, 40, 0.2), transparent 64%),
    linear-gradient(135deg, rgba(70, 4, 10, 0.72), rgba(18, 1, 3, 0.86));
  box-shadow: 0 28px 70px rgba(70, 0, 0, 0.4);
}
.em-closing p { max-width: 640px; color: #d9b3b3; font-size: 0.9rem; line-height: 1.8; margin-top: 12px; }
.em-closing-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.em-btn-solid {
  background: linear-gradient(135deg, #ff7b7b, #d21b1b 46%, #8c0000);
  color: #fff4f2; box-shadow: 0 12px 32px rgba(190, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.em-btn-solid:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(190, 0, 0, 0.45); }
.em-btn-ghost { border: 1px solid rgba(255, 90, 90, 0.42); color: #ffc4c4; background: rgba(255, 50, 50, 0.055); }
.em-btn-ghost:hover { background: rgba(255, 50, 50, 0.12); transform: translateY(-2px); }

.em-note { margin-top: 26px; color: #9c6a6a; font-size: 0.66rem; line-height: 1.7; }

/* Emergency responsive ---------------------------------------- */
@media (max-width: 980px) {
  .em-hero { grid-template-columns: 1fr; }
  .em-date-card { max-width: 340px; }
  .em-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .em-lesson { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #screen-emergency { padding-top: 14px; }
  .em-alert { font-size: 0.54rem; letter-spacing: 0.12em; padding: 10px 12px; }
  .em-hero { padding: 24px 18px 28px; border-radius: 18px; }
  .em-hero::before { font-size: 13rem; bottom: -60px; }
  .em-grid { grid-template-columns: 1fr; }
  .em-quote { border-left-width: 2px; }
  .em-closing { padding: 22px 18px; }
  .em-closing-actions { width: 100%; }
  .em-closing-actions .btn { width: 100%; }
}
@media (max-width: 480px) {
  .em-hero h1 { font-size: 3.2rem; }
  .em-date-card b { font-size: 4rem; }
  .em-timeline { padding-left: 20px; }
  .em-tl-item { padding-left: 12px; }
  .em-tl-item::before { left: -27px; }
}

/* ============================================================
   Mobile polish
   ============================================================ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, a, button { -webkit-tap-highlight-color: transparent; }
button, .btn, .option, .dock-link, .icon-btn { touch-action: manipulation; }
img, video, canvas { max-width: 100%; }
table { max-width: 100%; }

@supports (height: 100dvh) {
  body { min-height: 100dvh; }
  .screen.is-active { min-height: calc(100dvh - 72px); }
}

/* Hover lifts cause sticky/jumpy states on touch screens */
@media (hover: none) {
  .feature-card:hover, .scenario-card:hover, .majority-card:hover,
  .learn-card:hover, .btn-gold:hover, .btn-ghost:hover, .em-btn-ghost:hover,
  .roach-tool:hover:not(:disabled) { transform: none; }
  .option:hover:not(.is-locked) { transform: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  .site-nav { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); padding-top: max(12px, env(safe-area-inset-top, 0px)); }
  .mobile-dock { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 32px); }
  .audio-panel { max-height: calc(100dvh - 92px); max-height: calc(100vh - 92px); }
  @supports (height: 100dvh) { .audio-panel { max-height: calc(100dvh - 92px); } }
  .lang-menu { max-height: calc(100vh - 92px); overflow: auto; }
  .icon-btn, .lang-btn { min-width: 40px; min-height: 40px; }
  .dock-link { padding: 11px 14px; }
  .filter, .tab, .footer-links button { min-height: 40px; }
  .option { padding-top: 14px; padding-bottom: 14px; }
  .section, .game-top, .hero { padding-left: 18px; padding-right: 18px; }
  .scroll-x, .table-wrap, .learn-card table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  input, select, textarea { font-size: 16px; }
}

@media (max-width: 380px) {
  .dock-link { padding: 10px 10px; font-size: .64rem; }
  .hero h1 { font-size: 2.5rem; }
  .panel-card { padding: 18px 14px; }
  .game-heading h2 { font-size: 1.4rem; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .hero { min-height: auto; }
  .mobile-dock { bottom: 6px; }
}

/* ============================================================
   Redline Editor (Emergency screen)
   ============================================================ */
.rl-lede { max-width: 760px; color: #d9b3b3; font-size: 0.9rem; line-height: 1.8; margin-top: 14px; }
.rl-how { max-width: 760px; margin-top: 10px; color: #ff9a9a; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; }

.rl-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px;
  padding: 12px 16px; margin-bottom: 14px; border-radius: 14px;
  border: 1px solid rgba(255, 70, 70, 0.3); background: rgba(40, 3, 7, 0.65);
}
.rl-lamp { display: inline-flex; align-items: center; gap: 10px; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.16em; color: #ff9a9a; }
.rl-lamp i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 14px rgba(255, 59, 59, 0.85); animation: emPulse 1.8s ease-in-out infinite; }
.rl-lamp.is-done { color: #f7d59c; }
.rl-lamp.is-done i { background: #e8b667; box-shadow: 0 0 14px rgba(232, 182, 103, 0.8); animation: none; }
.rl-counter { font-size: 0.74rem; color: #e8c3c3; }
.rl-counter b { font-family: var(--display); font-size: 1.5rem; color: #fff0ee; }
.rl-counter span { color: #c79a9a; margin-left: 4px; }
.rl-legend { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.6rem; color: #c79a9a; font-weight: 700; }
.rl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rl-legend i { width: 14px; height: 10px; border-radius: 2px; }
.lg-new { background: #ffd0cf; border-bottom: 2px solid #c4121a; }
.lg-old { background: #f1e5cf; border-bottom: 2px solid #8a7a5a; }
.lg-back { background: #cfeedd; border-bottom: 2px solid #1c7a43; }

.rl-paper {
  padding: clamp(18px, 4vw, 40px); border-radius: 6px;
  background: #f6edd9; color: #2a2118;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 0 90px rgba(120, 80, 20, 0.12);
  font-family: Georgia, "Times New Roman", serif; font-size: 1.02rem; line-height: 1.9;
}
.rl-paper-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  padding-bottom: 12px; margin-bottom: 8px; border-bottom: 2px double #8a7a5a;
  font-family: var(--body); font-size: 0.6rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: #6d5a3a;
}
.rl-clause { padding: 14px 0 12px; border-bottom: 1px dashed rgba(120, 100, 60, 0.35); }
.rl-clause:last-child { border-bottom: 0; }
.rl-clause h4 { font-family: var(--body); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: #8b1a1a; margin-bottom: 4px; }
.rl-text { overflow-wrap: anywhere; }

.rl-chg {
  display: inline; text-align: left; font: inherit; color: inherit; line-height: inherit;
  padding: 2px 3px; margin: 0 1px; border-radius: 3px; cursor: pointer;
  border: 1px dashed transparent; touch-action: manipulation;
  transition: background .2s, box-shadow .2s;
}
.rl-chg.is-block { display: block; width: 100%; margin: 8px 0; padding: 10px 12px; border-radius: 6px; }
.rl-chg:hover:not(:disabled) { border-color: #c4121a; }
.rl-chg:focus-visible { outline: 2px solid #c4121a; outline-offset: 2px; }
.rl-chg.is-active { box-shadow: 0 0 0 3px rgba(196, 18, 26, 0.28); }
.rl-new { text-decoration: none; background: #ffd0cf; color: #a30f16; border-bottom: 2px solid #c4121a; padding: 0 2px; }
.rl-old { color: #a30f16; text-decoration: line-through; text-decoration-color: #c4121a; opacity: .75; margin-right: 4px; }
.is-block .rl-new { display: block; padding: 4px 8px; }
/* marked for reversal: the red edit is struck and the original returns */
.rl-chg.is-struck .rl-new { background: #eadfcd; color: #7d6d52; text-decoration: line-through; text-decoration-color: #7d6d52; border-bottom-color: transparent; opacity: .7; }
.rl-chg.is-struck .rl-old { color: #14673a; background: #cfeedd; text-decoration: none; opacity: 1; border-bottom: 2px solid #1c7a43; padding: 0 2px; }
.rl-chg.is-struck.is-block { background: rgba(28, 122, 67, 0.08); }
.rl-badge { display: inline-block; margin-left: 6px; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; font: 800 .72rem var(--body); color: #fff; vertical-align: middle; }
.rl-chg.is-ok .rl-badge { background: #1c7a43; }
.rl-chg.is-miss .rl-badge { background: #c4121a; }
.rl-chg:disabled { cursor: default; }

.rl-note {
  margin: 8px 0 4px; padding: 12px 14px; border-left: 3px solid #8b1a1a; border-radius: 0 8px 8px 0;
  background: rgba(139, 26, 26, 0.07); font-family: var(--body); font-size: 0.78rem; line-height: 1.65; color: #3a2a20;
  animation: screenIn .35s var(--ease);
}
.rl-note.is-ok { border-left-color: #1c7a43; background: rgba(28, 122, 67, 0.08); }
.rl-note.is-miss { border-left-color: #c4121a; background: rgba(196, 18, 26, 0.08); }
.rl-note-tag { display: block; font-size: 0.56rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #8b1a1a; margin-bottom: 2px; }
.rl-note-what { font-weight: 700; color: #2a2118; }
.rl-note-verdict { margin-top: 6px; }
.rl-note.is-ok .rl-note-verdict b { color: #14673a; }
.rl-note.is-miss .rl-note-verdict b { color: #a30f16; }
.rl-note-why { margin-top: 4px; color: #4a3a2c; }
.rl-note-hint { color: #7a6a58; font-style: italic; }
.rl-note-end { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; background: #2a2118; color: #f6edd9; font-size: 0.56rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }

.rl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.rl-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.rl-actions-hint { font-size: 0.7rem; color: #c79a9a; }

.rl-result {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 3vw, 32px);
  margin-top: 18px; padding: clamp(20px, 4vw, 40px); border-radius: 20px;
  border: 1px solid rgba(232, 182, 103, 0.45);
  background: linear-gradient(150deg, rgba(60, 40, 8, 0.55), rgba(20, 3, 5, 0.9));
  animation: screenIn .5s var(--ease);
}
.rl-result.tier-c, .rl-result.tier-d { border-color: rgba(255, 70, 70, 0.4); background: linear-gradient(150deg, rgba(58, 4, 9, 0.8), rgba(16, 1, 3, 0.94)); }
.rl-stamp {
  align-self: start; padding: 8px 14px; border: 2px solid #e8b667; border-radius: 6px; color: #f7d59c;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.24em; transform: rotate(-6deg);
}
.tier-c .rl-stamp, .tier-d .rl-stamp { border-color: #ff6b6b; color: #ff8f8f; }
.rl-result h3 { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.05; color: #fff0ee; margin: 10px 0 8px; }
.rl-result p { color: #d9b3b3; font-size: 0.86rem; line-height: 1.75; max-width: 680px; }
.rl-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 16px 0; color: #e8c3c3; font-size: 0.74rem; }
.rl-score b { font-family: var(--display); font-size: 3rem; line-height: 1; color: #f7d59c; }
.rl-score em { font-style: normal; color: #c79a9a; margin-left: 8px; }
.rl-takeaway { padding: 12px 14px; margin-bottom: 18px; border-left: 3px solid #e8b667; background: rgba(232, 182, 103, 0.07); color: #e8d3b3; font-size: 0.78rem; line-height: 1.7; max-width: 680px; }

@media (max-width: 760px) {
  .rl-paper { font-size: 0.94rem; line-height: 1.8; border-radius: 4px; }
  .rl-legend { margin-left: 0; width: 100%; }
  .rl-chg { padding: 3px 4px; }
  .rl-actions .btn { width: 100%; justify-content: center; }
  .rl-result { grid-template-columns: 1fr; }
  .rl-stamp { justify-self: start; }
}

/* Home: Cockroaches entrance (visible on every screen size) */
.roach-teaser { padding-top: 0; }
.roach-card-home {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: clamp(16px, 3vw, 34px);
  padding: clamp(22px, 4vw, 38px); border-radius: 22px;
  border: 1px solid rgba(232, 182, 103, 0.22);
  background: radial-gradient(520px 220px at 90% 0%, rgba(232, 182, 103, 0.14), transparent 70%), linear-gradient(150deg, rgba(20, 28, 52, 0.9), rgba(9, 15, 31, 0.92));
}
.rch-bug { font-size: clamp(2.6rem, 7vw, 4rem); line-height: 1; flex: none; animation: roachScuttle 3.6s ease-in-out infinite; }
.rch-copy { flex: 1; min-width: 0; }
.rch-copy h2 { font-size: clamp(1.6rem, 3.2vw, 2.6rem); line-height: 1.1; margin: 8px 0 8px; }
.rch-copy p { color: var(--muted); font-size: 0.88rem; max-width: 560px; }
.roach-card-home .btn { flex: none; }
.speaker-card-home {
  background:
    radial-gradient(520px 220px at 10% 0%, rgba(47, 191, 113, 0.16), transparent 70%),
    radial-gradient(520px 220px at 90% 100%, rgba(91, 141, 239, 0.14), transparent 70%),
    linear-gradient(150deg, rgba(18, 34, 48, 0.92), rgba(9, 15, 31, 0.92));
  border-color: rgba(47, 191, 113, 0.24);
}
.speaker-emblem { animation: none; filter: drop-shadow(0 6px 18px rgba(232, 182, 103, 0.3)); }
[data-theme="day"] .roach-card-home { background: linear-gradient(150deg, #fffdf8, #f7efdf); border-color: rgba(154, 97, 16, 0.25); }
@media (max-width: 760px) {
  .roach-card-home { flex-direction: column; align-items: flex-start; }
  .roach-card-home .btn { width: 100%; justify-content: center; }
}

/* Lok Sabha = green, Rajya Sabha = red (Order Paper, game chamber, history simulator) */
.chamber-panel[data-house="LS"] {
  background:
    radial-gradient(620px 320px at 50% 0%, rgba(47, 191, 113, .20), transparent 66%),
    linear-gradient(170deg, #0f2a22, #09151a 72%);
  border-color: rgba(47, 191, 113, .32);
}
.chamber-panel[data-house="RS"] {
  background:
    radial-gradient(620px 320px at 50% 0%, rgba(226, 87, 107, .22), transparent 66%),
    linear-gradient(170deg, #2e1119, #160a10 72%);
  border-color: rgba(226, 87, 107, .34);
}
.chamber-panel[data-house="LS"] .chamber-badge { color: #7be3a8; }
.chamber-panel[data-house="RS"] .chamber-badge { color: #ff9aa8; }
.chamber-panel[data-house="LS"] .chamber-foot b { color: #7be3a8; }
.chamber-panel[data-house="RS"] .chamber-foot b { color: #ff9aa8; }
.scenario-card[data-house="LS"] {
  background: linear-gradient(160deg, rgba(47, 191, 113, .17), rgba(47, 191, 113, .03) 55%, rgba(255,255,255,.008));
  border-color: rgba(47, 191, 113, .26);
}
.scenario-card[data-house="RS"] {
  background: linear-gradient(160deg, rgba(226, 87, 107, .18), rgba(226, 87, 107, .03) 55%, rgba(255,255,255,.008));
  border-color: rgba(226, 87, 107, .28);
}
[data-theme="day"] .chamber-panel[data-house="LS"] { background: radial-gradient(600px 300px at 50% 0%, rgba(47,191,113,.28), transparent 65%), linear-gradient(170deg, #f4fff8, #e3f4ea 70%); }
[data-theme="day"] .chamber-panel[data-house="RS"] { background: radial-gradient(600px 300px at 50% 0%, rgba(226,87,107,.26), transparent 65%), linear-gradient(170deg, #fff6f7, #f7e2e5 70%); }
[data-theme="day"] .scenario-card[data-house="LS"] { background: linear-gradient(160deg, #e7f7ee, #fbf5e9 70%); }
[data-theme="day"] .scenario-card[data-house="RS"] { background: linear-gradient(160deg, #fbe6e9, #fbf5e9 70%); }

/* Mobile dock must always fit the screen (5 links, long Hindi labels) */
@media (max-width: 760px) {
  .mobile-dock { width: calc(100vw - 24px); max-width: 460px; justify-content: space-between; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .mobile-dock::-webkit-scrollbar { display: none; }
  .dock-link { flex: 1 1 auto; min-width: 0; padding: 10px 6px; font-size: .64rem; text-align: center; }
}
@media (max-width: 380px) { .dock-link { padding: 10px 4px; font-size: .6rem; } }

/* ============================================================
   Chains — the Emergency's visual motif
   ============================================================ */
html[data-emergency="true"] {
  --chain-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='18' viewBox='0 0 40 18' fill='none' stroke='%23a89c9c' stroke-width='2.6'%3E%3Crect x='1.5' y='3' width='19' height='12' rx='6'/%3E%3Crect x='21.5' y='5.5' width='17' height='7' rx='3.5' stroke='%237d7070'/%3E%3C/svg%3E");
  --chain-v: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='40' viewBox='0 0 18 40' fill='none' stroke='%23a89c9c' stroke-width='2.6'%3E%3Crect x='3' y='1.5' width='12' height='19' rx='6'/%3E%3Crect x='5.5' y='21.5' width='7' height='17' rx='3.5' stroke='%237d7070'/%3E%3C/svg%3E");
}

/* Divider: chain + padlock */
.em-chain { display: flex; align-items: center; gap: 0; margin: clamp(34px, 5vw, 60px) 0 0; }
.em-chain .ch {
  flex: 1; height: 18px; background: var(--chain-h, none) repeat-x center / 40px 18px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)) drop-shadow(0 0 6px rgba(255, 40, 40, .18));
  opacity: .85;
}
.em-chain .lock {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; margin: 0 -4px; z-index: 1;
  border-radius: 50%; border: 1px solid rgba(255, 90, 90, .45);
  background: radial-gradient(circle at 40% 30%, #4a0a10, #170204);
  box-shadow: 0 0 22px rgba(255, 40, 40, .28);
}
.em-chain .lock svg { width: 22px; height: 22px; color: #ff8f8f; }
.em-chain .lock { animation: lockSway 5s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes lockSway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

/* Broken chain: two ends, a gap, falling link */
.em-chain.is-broken .ch:first-child { mask-image: linear-gradient(90deg, #000 78%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent); }
.em-chain.is-broken .ch:last-child { mask-image: linear-gradient(270deg, #000 78%, transparent); -webkit-mask-image: linear-gradient(270deg, #000 78%, transparent); }
.em-chain.is-broken .lock { border-color: rgba(232, 182, 103, .6); background: radial-gradient(circle at 40% 30%, #3d2c0c, #150d02); box-shadow: 0 0 26px rgba(232, 182, 103, .35); animation: none; }
.em-chain.is-broken .lock svg { color: #f7d59c; }

/* Hanging chains above the date card */
.em-date-card::before, .em-date-card::after {
  content: ""; position: absolute; top: -46px; width: 18px; height: 54px; z-index: 0;
  background: var(--chain-v, none) repeat-y center top / 18px 40px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7));
  transform-origin: 50% 0; animation: chainHang 6s ease-in-out infinite;
}
.em-date-card::before { left: 22%; }
.em-date-card::after { right: 22%; animation-delay: -3s; }
@keyframes chainHang { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }

/* Timeline: the rail is a chain */
.em-timeline { border-left: 0; position: relative; }
.em-timeline::before {
  content: ""; position: absolute; left: -9px; top: 0; bottom: 0; width: 18px;
  background: var(--chain-v, none) repeat-y center top / 18px 40px; opacity: .8;
  filter: drop-shadow(0 0 5px rgba(255, 40, 40, .25));
}

/* Cards: draped chain across the top */
.em-card { overflow: hidden; }
.em-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: -5px; height: 18px;
  background: var(--chain-h, none) repeat-x center / 40px 18px; opacity: .38; pointer-events: none;
  transition: opacity .3s var(--ease);
}
.em-card:hover::before { opacity: .7; }

/* Quote: chained margin */
.em-quote { position: relative; border-left: 0; padding-left: clamp(40px, 6vw, 64px); }
.em-quote::before {
  content: ""; position: absolute; left: 12px; top: 8px; bottom: 8px; width: 18px;
  background: var(--chain-v, none) repeat-y center top / 18px 40px; opacity: .8;
}

/* Redline Editor: shackle bar over the paper */
.rl-shackle { display: flex; align-items: center; margin: 0 0 -6px; position: relative; z-index: 2; }
.rl-shackle .ch {
  flex: 1; height: 18px; background: var(--chain-h, none) repeat-x center / 40px 18px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); transition: transform .8s var(--ease), opacity .8s;
}
.rl-shackle .lock {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin: 0 -4px; border-radius: 50%;
  border: 1px solid rgba(255, 90, 90, .45); background: radial-gradient(circle at 40% 30%, #4a0a10, #170204);
  color: #ff8f8f; transition: transform .8s var(--ease), color .6s, border-color .6s;
}
.rl-shackle .lock svg { width: 20px; height: 20px; }
.rl-shackle.is-snapped .ch:first-child { transform: translateX(-26px) rotate(-3deg); opacity: .55; }
.rl-shackle.is-snapped .ch:last-child { transform: translateX(26px) rotate(3deg); opacity: .55; }
.rl-shackle.is-snapped .lock { transform: translateY(22px) rotate(24deg); color: #f7d59c; border-color: rgba(232, 182, 103, .6); }
/* each unmarked red change stays chained; striking it frees it */
.rl-chg:not(.is-struck):not(.is-block) { background-image: var(--chain-h, none); background-repeat: repeat-x; background-position: left bottom -5px; background-size: 26px 12px; padding-bottom: 6px; }

@media (max-width: 760px) {
  .em-date-card::before { left: 16%; }
  .em-date-card::after { right: 16%; }
  .em-quote { padding-left: 44px; }
  .em-chain .lock { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .em-chain .lock, .em-date-card::before, .em-date-card::after { animation: none; }
}

/* Padlock hint + break animation */
.em-chain .lock { cursor: pointer; padding: 0; font: inherit; touch-action: manipulation; position: relative; }
.em-chain .lock:hover { box-shadow: 0 0 30px rgba(255, 60, 60, .55); }
.em-chain.is-broken .lock { cursor: default; }
.em-chain .lock[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translate(-50%, 4px); width: max-content; max-width: min(260px, 80vw);
  padding: 8px 12px; border-radius: 10px; text-align: center; white-space: normal;
  background: #1c0408; color: #ffd2d2; border: 1px solid rgba(255, 90, 90, .5);
  font: 700 .66rem/1.4 var(--body); letter-spacing: .02em;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.em-chain.is-broken .lock[data-tip]::after { border-color: rgba(232, 182, 103, .55); color: #f7d59c; }
.em-chain .lock:hover::after, .em-chain .lock:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.em-chain.just-broke .lock { animation: lockBreak 1s var(--ease); }
.em-chain.just-broke .ch:first-child { animation: linkLeft 1s var(--ease); }
.em-chain.just-broke .ch:last-child { animation: linkRight 1s var(--ease); }
@keyframes lockBreak { 0% { transform: scale(1.25) rotate(-12deg); } 30% { transform: scale(1.35) rotate(14deg); } 100% { transform: none; } }
@keyframes linkLeft { 0% { transform: translateX(14px); } 100% { transform: none; } }
@keyframes linkRight { 0% { transform: translateX(-14px); } 100% { transform: none; } }

/* ============================================================
   Speaker game polish
   ============================================================ */
.speaker-stage { position: relative; }
.speaker-pause {
  position: absolute; z-index: 12; top: 12px; left: 12px; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: var(--cream);
  background: rgba(9, 15, 31, .72); border: 1px solid var(--line); backdrop-filter: blur(8px);
  touch-action: manipulation; transition: .25s var(--ease);
}
.speaker-pause[hidden] { display: none; }
.speaker-pause:hover { color: var(--gold-bright); transform: scale(1.06); }
.speaker-pause svg { width: 16px; height: 16px; }
.speaker-arena.is-aiming { cursor: pointer; }
.speaker-arena[data-tool="suspend"].is-aiming { cursor: not-allowed; }
.speaker-arena.is-paused canvas { filter: blur(3px) saturate(.7); }

.sstat { position: relative; transition: border-color .3s, box-shadow .3s, background .3s; }
.sstat.is-danger { border-color: rgba(226, 87, 107, .7); background: rgba(226, 87, 107, .1); animation: sstatPulse 1s ease-in-out infinite; }
.sstat.is-danger b { color: #ff8a9a; }
.sstat.is-ready { border-color: rgba(247, 213, 156, .7); box-shadow: 0 0 0 1px rgba(247, 213, 156, .25), 0 0 22px rgba(232, 182, 103, .25); }
.sstat.is-ready b { color: var(--gold-bright); }
@keyframes sstatPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226, 87, 107, .35); } 50% { box-shadow: 0 0 0 5px rgba(226, 87, 107, 0); } }
/* threshold ticks on the bars: quorum 55/90, order 100/100 */
.sstat-quorum .rbar, .sstat-order .rbar { position: relative; overflow: visible; }
.sstat-quorum .rbar::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: 61.1%; width: 2px; background: #f7d59c; border-radius: 2px; opacity: .85; }

.speaker-overlay .roach-card { max-height: 100%; overflow: auto; }

@media (max-width: 980px) {
  /* keep the Calm / Suspend / Adjourn buttons above the arena so they stay in reach */
  .speaker-stage { display: flex; flex-direction: column; gap: 12px; }
  .speaker-side { display: contents; }
  .speaker-tools { order: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .speaker-arena { order: 2; }
  .speaker-help, .speaker-keys, .speaker-legend, .speaker-mp-types, .speaker-quit { order: 3; }
  .speaker-tool { flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 6px; }
  .speaker-tool .st-copy i { display: none; }
  .speaker-tool .st-copy b { font-size: .64rem; }
  .speaker-pause { top: 66px; }
  .speaker-keys { display: none; }
}
@media (max-width: 760px) {
  .speaker-lede { display: none; }
  .speaker-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
  .sstat-suspended { display: none; }
}

/* ============================================================
   Mobile nav + Speaker game (final pass)
   ============================================================ */
@media (max-width: 760px) {
  /* top bar: never let brand and controls collide */
  .site-nav { gap: 8px; }
  .brand { min-width: 0; gap: 9px; flex: 1 1 auto; }
  .brand-text { min-width: 0; }
  .brand-text strong { font-size: 1.25rem; letter-spacing: .14em; white-space: nowrap; }
  .nav-actions { flex: none; gap: 6px; }

  /* bottom dock: full-width icon bar, six equal slots */
  .mobile-dock {
    left: 10px; right: 10px; width: auto; max-width: none; transform: none;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px;
    padding: 5px; border-radius: 22px; overflow: visible;
  }
  .dock-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 7px 2px 6px; min-width: 0; border-radius: 16px;
    font-size: .56rem; font-weight: 700; letter-spacing: .01em; line-height: 1.1;
  }
  .dock-link svg { width: 20px; height: 20px; flex: none; }
  .dock-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 980px) {
  .speaker-pause { top: 10px; left: 10px; }
  .speaker-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .speaker-adjourn { grid-column: auto; flex-direction: column; align-items: center; }
}
@media (max-width: 760px) {
  .speaker-screen { padding-left: 14px; padding-right: 14px; }
  .speaker-top { gap: 8px 12px; }
  .speaker-heading { min-width: 0; flex: 1 1 140px; }
  .speaker-heading h2 { font-size: 1.7rem; }
  .speaker-hud { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 10px 0; }
  .sstat { padding: 7px 8px; border-radius: 12px; }
  .sstat span { font-size: .48rem; letter-spacing: .1em; }
  .sstat b { font-size: 1.1rem; }
  .speaker-arena { height: clamp(320px, 52dvh, 460px); }
  .speaker-tool { padding: 9px 4px; border-radius: 12px; }
  .speaker-tool .st-icon { width: 28px; height: 28px; font-size: .95rem; }
  .speaker-help { font-size: .64rem; }
  .speaker-overlay .roach-card { padding: 16px 14px; }
  .speaker-overlay .roach-card h3 { font-size: 1.6rem; }
  .speaker-overlay .roach-rules li { font-size: .62rem; }
}
@media (max-width: 380px) {
  .speaker-tool .st-copy b { font-size: .58rem; }
  .brand-text strong { font-size: 1.1rem; letter-spacing: .1em; }
}

/* Speaker overlay must stay scrollable/tappable on touch screens (the arena itself blocks panning) */
.speaker-overlay { touch-action: pan-y; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.speaker-overlay .roach-card { touch-action: pan-y; }
@media (max-width: 760px) {
  .speaker-overlay { align-items: center; padding: 8px; }
  .speaker-overlay .roach-card { max-height: none; padding: 14px 14px 16px; }
  .speaker-overlay .roach-card > p:not(.roach-tiny):not(:first-of-type) { display: none; }
  .speaker-overlay .roach-rules, .speaker-overlay .roach-tiny { display: none; }
  .speaker-overlay .roach-actions { margin-top: 12px; }
  .speaker-overlay .roach-actions .btn { width: 100%; justify-content: center; padding: 14px 18px; }
}

/* Mobile Speaker stage: the arena must fill the width (align-items:start made it collapse to 0px) */
@media (max-width: 980px) {
  .speaker-stage { align-items: stretch; }
  .speaker-arena { width: 100%; }
  .speaker-tools, .speaker-help, .speaker-legend, .speaker-quit { width: 100%; }
}

/* Phones: the intro card leads with its Start button, and the stage scrolls clear of the nav and dock */
.speaker-hud { scroll-margin-top: 72px; }
@media (max-width: 760px) {
  .speaker-overlay .roach-card { display: flex; flex-direction: column; }
  .speaker-overlay .roach-card > p { order: 3; }
  .speaker-overlay .roach-card .roach-actions { order: 2; }
  .speaker-arena { margin-bottom: 4px; }
}
