/* ============================================================
   Goddi · গদি — Phase 1 styles
   Paper / ink / stamped-woodblock aesthetic
   ============================================================ */

:root {
  --paper:         #f1e9d6;
  --paper-2:       #e6dcc2;
  --paper-3:       #ddd0b0;
  --ink:           #1a1310;
  --ink-soft:      #3d322a;
  --ink-mute:      #6a594b;
  --stamp-red:     #a6291f;
  --sbyc-green:    #1b7849;
  --gold:          #b8934a;

  /* Bangladesh flag — used for accents, hero CTAs, and victory stamp */
  --bd-green:      #006a4e;
  --bd-red:        #f42a41;

  --stat-janata:     #c46830;
  --stat-dol:        #2d4a7a;
  --stat-proshashon: #7a2a26;
  --stat-tohobil:    #9c7a36;

  --party-janata-league:     #006a4e;
  --party-jatiyotabadi-dol:  #cf2b34;
  --party-islami-oikko:      #004d40;
  --party-notun-bangladesh:  #6a1b9a;

  --font-display: "Fraunces", Georgia, serif;
  --font-bn:      "Hind Siliguri", "Noto Sans Bengali", sans-serif;
  --font-en:      "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono:    "Special Elite", "Courier New", monospace;

  --radius-sm: 4px;
  --radius-md: 8px;

  --shadow-paper: 0 2px 8px rgba(26, 19, 16, 0.08), 0 12px 28px rgba(26, 19, 16, 0.12);
  --shadow-card:  0 6px 18px rgba(26, 19, 16, 0.18), 0 24px 60px rgba(26, 19, 16, 0.22);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-en);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(184, 147, 74, 0.10), transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(166, 41, 31, 0.08), transparent 55%),
    radial-gradient(circle at 50% 60%, rgba(0, 106, 78, 0.06), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-lang="bn"] { font-family: var(--font-bn); }

/* Paper grain — SVG noise overlay */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  z-index: 1;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.07  0 0 0 0 0.05  0 0 0 0.16 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

/* ============================================================
   Language visibility
   ============================================================ */
body[data-lang="en"] [data-lang-bn],
body[data-lang="bn"] [data-lang-en] {
  display: none !important;
}

/* ============================================================
   Screens
   ============================================================ */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 2;
  overflow-y: auto;
}

body[data-screen="splash"]   [data-screen-id="splash"],
body[data-screen="name"]     [data-screen-id="name"],
body[data-screen="party"]    [data-screen-id="party"],
body[data-screen="play"]     [data-screen-id="play"],
body[data-screen="gameover"] [data-screen-id="gameover"],
body[data-screen="win"]      [data-screen-id="win"] {
  display: flex;
}

/* ============================================================
   Language toggle
   ============================================================ */
.lang-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 100;
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.lang-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* ============================================================
   Mute toggle — sits just below the language toggle
   ============================================================ */
.mute-toggle {
  position: fixed;
  top: calc(max(16px, env(safe-area-inset-top)) + 44px);
  right: 16px;
  z-index: 100;
  width: 40px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  padding: 0;
}
.mute-toggle:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}
.mute-toggle__icon {
  width: 20px;
  height: 20px;
}
/* Toggle icon visibility based on body[data-muted] */
.mute-toggle__icon--off          { display: none; }
body[data-muted="true"] .mute-toggle__icon--on   { display: none; }
body[data-muted="true"] .mute-toggle__icon--off  { display: block; }
body[data-muted="true"] .mute-toggle             { color: color-mix(in srgb, var(--ink) 60%, transparent); }

/* ============================================================
   SPLASH
   ============================================================ */
.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  gap: 20px;
  position: relative;
}
/* Bangladesh flag: red disc watermark behind the title */
.splash::before {
  content: "";
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(62vw, 320px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bd-red);
  opacity: 0.14;
  filter: blur(1px);
  z-index: 0;
  pointer-events: none;
}
.splash > * { position: relative; z-index: 1; }
.splash__title { margin: 0; }
/* Flag green accent bar under the title */
.splash__title::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  margin: 18px auto 0;
  background: var(--bd-green);
  opacity: 0.75;
}
.title-bn {
  font-family: var(--font-bn);
  font-size: clamp(80px, 22vw, 140px);
  font-weight: 700;
  margin: 0;
  line-height: 0.9;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.title-en {
  font-family: var(--font-mono);
  font-size: clamp(18px, 4vw, 24px);
  letter-spacing: 0.4em;
  margin: 8px 0 0;
  color: var(--ink-soft);
}
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(16px, 4vw, 20px);
  color: var(--ink-soft);
  max-width: 360px;
  margin: 8px 0;
}
body[data-lang="bn"] .tagline {
  font-family: var(--font-bn);
  font-style: normal;
  font-weight: 500;
}

.footer-watermark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  margin-top: 24px;
}

.corner-stamp {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--stamp-red);
  border: 2px solid var(--stamp-red);
  padding: 4px 10px;
  opacity: 0.55;
  pointer-events: none;
}
.corner-stamp--tl { top: -60px; left: -20px; transform: rotate(-8deg); }
.corner-stamp--br { bottom: -40px; right: -12px; transform: rotate(6deg); }

/* ============================================================
   STEPS (name / party)
   ============================================================ */
.step {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
  margin: 0;
}
.step__title {
  font-family: var(--font-display);
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
body[data-lang="bn"] .step__title { font-family: var(--font-bn); }
.step__hint {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.step__hint--warn { color: var(--stamp-red); }

.input {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  outline: none;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.input:focus {
  box-shadow: 1px 1px 0 var(--stamp-red), inset 0 0 0 1px var(--stamp-red);
  border-color: var(--stamp-red);
}

.error {
  color: var(--stamp-red);
  font-size: 13px;
  margin: -4px 0 0;
}

.row-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: space-between;
}
.row-buttons--stacked {
  flex-direction: column;
  align-items: stretch;
}

/* ============================================================
   Party grid
   ============================================================ */
.party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0;
}
@media (max-width: 360px) {
  .party-grid { grid-template-columns: 1fr; }
}

.party-card {
  text-align: left;
  padding: 14px;
  border: 2px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  border-radius: var(--radius-sm);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  font-family: inherit;
  color: var(--ink);
  position: relative;
  overflow: hidden;
}
.party-card__bar {
  height: 6px;
  margin: -14px -14px 10px;
  background: var(--party-color, var(--ink));
}
.party-card__name {
  font-family: var(--font-bn);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  margin: 0 0 4px;
}
body[data-lang="en"] .party-card__name { font-family: var(--font-display); }
.party-card__tag {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.3;
  min-height: 32px;
}
.party-card__mods {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-soft);
}
.party-card__mod { white-space: nowrap; }
.party-card__mod--pos { color: var(--sbyc-green); }
.party-card__mod--neg { color: var(--stamp-red); }

.party-card[aria-pressed="true"] {
  background: var(--paper-2);
  box-shadow: 1px 1px 0 var(--ink), inset 0 0 0 2px var(--party-color);
  transform: translate(2px, 2px);
}
.party-card:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  min-height: 48px;
  letter-spacing: 0.02em;
}
.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: 1px 1px 0 var(--ink);
}
.btn--primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 var(--bd-red);
}
.btn--primary:active:not(:disabled) {
  box-shadow: 1px 1px 0 var(--bd-red);
}
.btn--ghost {
  background: transparent;
  box-shadow: none;
  border-color: var(--ink-mute);
  color: var(--ink-mute);
}

/* ============================================================
   HUD
   ============================================================ */
.hud {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  max-width: 820px;
  padding: 4px 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  z-index: 5;
}
/* Thin accent bar under the HUD — a faint flag-green ribbon */
.hud::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -6px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0,
    rgba(0, 106, 78, 0.35) 20%,
    rgba(0, 106, 78, 0.35) 80%,
    transparent 100%
  );
}
.hud__left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.hud__sep { opacity: 0.5; }
.rosette {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--party-color, var(--ink));
  box-shadow: 0 0 0 2px var(--paper);
}

/* ============================================================
   Stats (enriched: seal + bar + ticks + danger zones + label + value + delta)
   ============================================================ */
.stats {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 48px);
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  max-width: 820px;
  padding: 0 14px;
  display: flex;
  gap: 14px;
  z-index: 5;
}
.stat {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stat__seal {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--stat-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stat-color);
  box-shadow: 0 0 0 3px rgba(26, 19, 16, 0.05);
  transition: transform 140ms ease, filter 140ms ease, color 140ms ease;
}
.stat__seal svg {
  width: 18px;
  height: 18px;
  display: block;
}
.stat__bar {
  width: 100%;
  height: 7px;
  background: var(--paper-3);
  border: 1px solid var(--ink);
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}
.stat__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--stat-color);
  transition: width 0.35s ease-out;
  z-index: 2;
}
.stat__tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  background: var(--ink-mute);
  opacity: 0.55;
  z-index: 3;
  pointer-events: none;
}
.stat__danger {
  position: absolute;
  top: 0;
  bottom: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(166, 41, 31, 0.35) 0,
    rgba(166, 41, 31, 0.35) 2px,
    transparent 2px,
    transparent 4px
  );
  z-index: 1;
  pointer-events: none;
}
.stat__danger--low { left: 0; width: 15%; }
.stat__danger--high { right: 0; width: 15%; }
.stat__meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
body[data-lang="bn"] .stat__meta {
  font-family: var(--font-bn);
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
}
.stat__value {
  font-weight: 700;
  color: var(--ink);
  font-size: 12px;
}

/* Delta floater — pops "+15" / "−10" above the affected stat after a commit */
.stat__delta {
  position: absolute;
  left: 50%;
  top: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  pointer-events: none;
  z-index: 6;
  text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 4px var(--paper);
  animation: stat-delta 1000ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.stat__delta--pos { color: var(--bd-green); }
.stat__delta--neg { color: var(--stamp-red); }

@keyframes stat-delta {
  0%   { opacity: 0; transform: translate(-50%, 10px); }
  18%  { opacity: 1; transform: translate(-50%, 0); }
  75%  { opacity: 1; transform: translate(-50%, -18px); }
  100% { opacity: 0; transform: translate(-50%, -30px); }
}

/* ============================================================
   Card stage
   ============================================================ */
.card-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 68vh;
  max-height: 620px;
  margin: auto;
  perspective: 1000px;
  user-select: none;
}

.goddi-card {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  will-change: transform;
  transform-origin: center 120%;
}
.goddi-card.dragging { cursor: grabbing; transition: none !important; }
.goddi-card:not(.dragging) {
  transition: transform 0.32s cubic-bezier(.2,.9,.3,1);
}
.goddi-card--commit-left  { transform: translateX(-140vw) rotate(-30deg) !important; }
.goddi-card--commit-right { transform: translateX(140vw)  rotate(30deg)  !important; }

.goddi-card__portrait {
  flex: 0 0 auto;
  background: linear-gradient(180deg, var(--paper-2), var(--paper));
  padding: 20px 16px 10px;
  text-align: center;
  border-bottom: 1px dashed var(--ink-mute);
}
.goddi-card__portrait svg {
  width: 140px;
  height: 140px;
  display: block;
  margin: 0 auto;
}
.goddi-card__character {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 2px;
}
body[data-lang="bn"] .goddi-card__character { font-family: var(--font-bn); }
.goddi-card__role {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  text-transform: uppercase;
}

.goddi-card__dialog {
  flex: 1 1 auto;
  padding: 20px 22px;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  overflow-y: auto;
  font-family: var(--font-display);
}
body[data-lang="bn"] .goddi-card__dialog {
  font-family: var(--font-bn);
  font-size: 18px;
  line-height: 1.5;
}
.goddi-card__dialog::before {
  content: "“";
  font-size: 48px;
  line-height: 0;
  display: inline-block;
  vertical-align: -20px;
  margin-right: 4px;
  color: var(--stamp-red);
}

.goddi-card__choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--ink);
  position: relative;
}
.goddi-card__choice {
  padding: 16px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
  position: relative;
  user-select: none;
}
/* Direction-cue arrows on each side */
.goddi-card__choice::before {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  opacity: 0.55;
}
.goddi-card__choice--left::before  { content: "←"; color: var(--stamp-red); }
.goddi-card__choice--right::before { content: "→"; order: 2; color: var(--bd-green); }
/* Subtle base tint hinting at swipe-side meaning */
.goddi-card__choice--left {
  background: linear-gradient(to right, rgba(166, 41, 31, 0.08), rgba(166, 41, 31, 0.02));
  border-right: 1px dashed var(--ink-mute);
}
.goddi-card__choice--right {
  background: linear-gradient(to left, rgba(0, 106, 78, 0.08), rgba(0, 106, 78, 0.02));
}
/* Drag-active state: tint intensifies + arrow brightens */
.goddi-card__choice--left.active {
  background: rgba(166, 41, 31, 0.18);
  color: var(--stamp-red);
}
.goddi-card__choice--left.active::before { opacity: 1; transform: translateX(-2px); }
.goddi-card__choice--right.active {
  background: rgba(0, 106, 78, 0.18);
  color: var(--bd-green);
}
.goddi-card__choice--right.active::before { opacity: 1; transform: translateX(2px); }

/* Stamp overlays on drag */
.goddi-card__stamp {
  position: absolute;
  top: 40px;
  padding: 8px 16px;
  border: 3px solid var(--stamp-red);
  color: var(--stamp-red);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2em;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  text-transform: uppercase;
}
.goddi-card__stamp--left  { left: 24px;  transform: rotate(-14deg); }
.goddi-card__stamp--right { right: 24px; transform: rotate(14deg); }
.goddi-card[data-drag-dir="left"]  .goddi-card__stamp--left,
.goddi-card[data-drag-dir="right"] .goddi-card__stamp--right {
  opacity: 0.9;
}

.swipe-hint {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--ink-mute);
  opacity: 0.8;
  pointer-events: none;
  z-index: 3;
}
.swipe-hint.hidden { opacity: 0; }
.swipe-hint__arrow {
  display: inline-block;
  margin: 0 10px;
  animation: nudge 1.6s ease-in-out infinite;
}
.swipe-hint__arrow:first-child  { animation-delay: 0s; }
.swipe-hint__arrow:last-child   { animation-delay: 0.4s; }
@keyframes nudge {
  0%, 100% { transform: translateX(0); opacity: 0.4; }
  50%      { transform: translateX(-4px); opacity: 1; }
}

/* ============================================================
   Verdict (game over / win)
   ============================================================ */
.verdict {
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.verdict__stamp {
  align-self: center;
  padding: 10px 26px;
  border: 4px double var(--stamp-red);
  color: var(--stamp-red);
  font-family: var(--font-bn);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.15em;
  transform: rotate(-4deg);
}
.verdict__stamp--win {
  border-color: var(--bd-green);
  color: var(--bd-green);
}
.verdict__headline {
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 52px);
  font-weight: 900;
  margin: 0;
  line-height: 1;
  letter-spacing: -0.01em;
}
body[data-lang="bn"] .verdict__headline { font-family: var(--font-bn); }
.verdict__body {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 440px;
  text-align: left;
}
.verdict__body p {
  margin: 0 0 14px;
}
.verdict__body p:last-child {
  margin-bottom: 0;
  font-style: italic;
  color: var(--ink);
}
.verdict__body p:first-child {
  font-weight: 500;
}
.verdict__stats {
  margin: 12px 0;
  padding: 20px 0;
  border-top: 1px solid var(--ink-mute);
  border-bottom: 1px solid var(--ink-mute);
  width: 100%;
  max-width: 320px;
}
.verdict__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
  margin: 0;
  text-transform: uppercase;
}
.verdict__days {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 72px;
  line-height: 1;
  margin: 4px 0;
  color: var(--ink);
}
body[data-lang="bn"] .verdict__days { font-family: var(--font-bn); }
.verdict__meta-sub {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0;
}
.verdict__final-stats {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  margin-top: 20px;
}
.verdict__final-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-mute);
}
.verdict__final-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

/* ============================================================
   Session 3 polish — stat preview, danger pulse, year transition
   ============================================================ */

/* Stat preview — while the player drags a card, the affected stats glow
   green (positive) or red (negative). No numbers shown; the player reads
   the direction-of-impact only, which keeps the satirical feel and forces
   them to trust their instinct rather than min-max numerically. */

/* The seal itself takes the dominant color treatment + halo + gentle pulse */
.stat--preview-touched .stat__seal {
  transform: scale(1.18);
  animation: stat-preview-pulse 0.95s ease-in-out infinite;
}
.stat--preview-pos .stat__seal {
  color: var(--bd-green);
  border-color: var(--bd-green);
  background: rgba(0, 106, 78, 0.06);
  filter:
    drop-shadow(0 0 4px rgba(0, 106, 78, 0.9))
    drop-shadow(0 0 12px rgba(0, 106, 78, 0.55));
}
.stat--preview-neg .stat__seal {
  color: var(--stamp-red);
  border-color: var(--stamp-red);
  background: rgba(166, 41, 31, 0.06);
  filter:
    drop-shadow(0 0 4px rgba(166, 41, 31, 0.9))
    drop-shadow(0 0 12px rgba(166, 41, 31, 0.55));
}

/* Also tint the bar fill — subtle but reinforces direction */
.stat--preview-pos .stat__fill {
  background: var(--bd-green);
  box-shadow: 0 0 6px rgba(0, 106, 78, 0.45);
}
.stat--preview-neg .stat__fill {
  background: var(--stamp-red);
  box-shadow: 0 0 6px rgba(166, 41, 31, 0.45);
}

@keyframes stat-preview-pulse {
  0%, 100% { transform: scale(1.18); }
  50%      { transform: scale(1.28); }
}

/* Danger-zone pulse — stat ≤20 or ≥80 gets a slow ominous breath on the seal.
   Subtle: only the seal glow pulses, not the whole bar, so it doesn't fight
   for attention with stat-delta floaters. */
.stat--danger .stat__seal {
  animation: stat-danger-pulse 1.8s ease-in-out infinite;
}
@keyframes stat-danger-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(166, 41, 31, 0.0),
                inset 0 0 0 2px currentColor;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(166, 41, 31, 0.12),
                inset 0 0 0 2px var(--stamp-red);
  }
}

/* Year-transition chapter card — full-viewport overlay that interrupts the
   deck at year boundaries. Echoes the splash's stamp aesthetic. */
.year-transition {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 22, 14, 0.55);
  opacity: 0;
  transition: opacity 320ms ease;
  cursor: pointer;
}
.year-transition--shown { opacity: 1; }
.year-transition--leaving { opacity: 0; }

.year-transition__card {
  background: var(--paper);
  border: 3px solid var(--stamp-red);
  border-radius: var(--radius-md);
  padding: 38px 48px 32px;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35),
              inset 0 0 0 1px var(--paper-2);
  transform: scale(0.94) rotate(-1.5deg);
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
}
.year-transition--shown .year-transition__card {
  transform: scale(1) rotate(-1.5deg);
}
.year-transition__card::before,
.year-transition__card::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  height: 1px;
  background: var(--stamp-red);
  opacity: 0.45;
}
.year-transition__card::before { top: 14px; }
.year-transition__card::after  { bottom: 14px; }

.year-transition__year {
  font-family: var(--font-mono);
  letter-spacing: 4px;
  font-size: 13px;
  color: var(--stamp-red);
  margin: 0 0 6px;
  text-transform: uppercase;
}
.year-transition__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 44px;
  line-height: 1;
  color: var(--ink);
  margin: 6px 0 10px;
  letter-spacing: 1px;
}
.year-transition__sub {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-muted);
  margin: 0;
  text-transform: uppercase;
}

/* Active-arc stamps in the HUD — small wax-seal badges that accumulate as
   the player's record builds (PA scandal, tower approval, envelope habit,
   vote-buying, defection). Hover/tap to see the label. */
.hud__arcs {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  pointer-events: auto;
}
.hud__arc {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--arc-color, var(--ink));
  color: var(--arc-color, var(--ink));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18),
              inset 0 0 0 1px var(--paper);
  cursor: help;
  user-select: none;
  animation: hud-arc-pop 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes hud-arc-pop {
  0%   { opacity: 0; transform: scale(0.5) rotate(-30deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
/* On very narrow viewports, hide arc stamps so they don't crowd the date */
@media (max-width: 380px) {
  .hud__arcs { display: none; }
}

/* Character intro overlay — appears the first time a named character shows
   up in a run. Portrait, name, role, one-paragraph bio. Tap anywhere to
   dismiss; engine resumes painting the actual card after. */
.char-intro {
  position: fixed;
  inset: 0;
  z-index: 32;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 22, 14, 0.6);
  opacity: 0;
  transition: opacity 240ms ease;
  cursor: pointer;
  padding: 24px;
}
.char-intro--shown   { opacity: 1; }
.char-intro--leaving { opacity: 0; }

.char-intro__card {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 26px 26px 22px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35),
              inset 0 0 0 1px var(--paper-2);
  transform: scale(0.94);
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.char-intro--shown .char-intro__card { transform: scale(1); }

.char-intro__eyebrow {
  font-family: var(--font-mono);
  letter-spacing: 3px;
  font-size: 11px;
  color: var(--stamp-red);
  margin: 0 0 6px;
  text-transform: uppercase;
}

.char-intro__portrait {
  width: 120px;
  height: 120px;
  margin: 0 auto 10px;
}
.char-intro__portrait svg {
  width: 100%;
  height: 100%;
  display: block;
}

.char-intro__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  margin: 4px 0 2px;
  color: var(--ink);
  letter-spacing: 0.5px;
}

.char-intro__role {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin: 0 0 14px;
}

.char-intro__bio {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 18px;
  text-align: left;
}

.char-intro__cta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--stamp-red);
  margin: 0;
  text-transform: uppercase;
  opacity: 0.8;
}

/* ============================================================
   Card stacking + 3D flip — the ghost card behind the active one
   is a 3D flipper with two faces. Its back face (visible by default)
   shows the deck design; its front face is empty until the player
   commits, at which point the next card's content is injected into
   the front face and the flipper rotates Y 180°→0°. Combined with
   the ghost's outer transform animating from offset back to center,
   the visual is: the underlying card rises forward AND flips over
   to reveal the next card. After the flip, JS replaces the flipper
   structure with a clean active card and inserts a new ghost behind.
   ============================================================ */
.goddi-card--ghost {
  pointer-events: none;
  z-index: 1;
  cursor: default;
  background: transparent;   /* the .card-face elements do the visuals */
  border: none;
  box-shadow: none;
  transform: translateX(14px) rotate(4deg);
  opacity: 0.95;
  animation: ghost-enter 380ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.goddi-card:not(.goddi-card--ghost) {
  z-index: 3;
}
/* Card-enter animation only applies to the FIRST card of a run (first
   render via renderCardInner). Post-flip cards must NOT fade in — the
   flip already revealed the new card, and a fresh fade-in would let
   the ghost behind bleed through during the partial opacity. */
.goddi-card.goddi-card--entering {
  animation: card-enter 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.goddi-card.goddi-card--entering.goddi-card--wiggle {
  animation:
    card-enter 280ms cubic-bezier(0.22, 0.61, 0.36, 1),
    card-wiggle-hint 2.8s ease-in-out 0.7s infinite;
}
/* The wiggle alone (without entering) — for whatever reason — should still loop */
.goddi-card.goddi-card--wiggle:not(.goddi-card--entering) {
  animation: card-wiggle-hint 2.8s ease-in-out 0.7s infinite;
}

/* The flipper container handles 3D rotation */
.card-flipper {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transform: rotateY(180deg);            /* start showing back face */
  -webkit-transform: rotateY(180deg);
  transition: transform 460ms cubic-bezier(0.22, 0.61, 0.36, 1);
  -webkit-transition: -webkit-transform 460ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Each face is a full card surface that hides its back side */
.card-face {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.card-face--back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}
.card-face--front {
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
}

/* Flip trigger — fires when the user commits a swipe. The flipper
   rotates back→front (180°→0°) and simultaneously the outer ghost
   moves from its resting offset to the active center. */
.goddi-card--flipping {
  z-index: 2;
  transform: translateX(0) rotate(0deg);
  opacity: 1;
  transition:
    transform 460ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 280ms ease;
  animation: none;
}
.goddi-card--flipping .card-flipper {
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
}

/* New ghost enters from further behind, settles to resting offset */
@keyframes ghost-enter {
  0%   { transform: translateX(30px) rotate(8deg) scale(0.96); opacity: 0; }
  100% { transform: translateX(14px) rotate(4deg);             opacity: 0.95; }
}
/* New active card after flip — quick fade so any structural swap is invisible */
@keyframes card-enter {
  0%   { opacity: 0; transform: scale(0.985); }
  100% { opacity: 1; transform: scale(1); }
}

.card-back {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.card-back__corner {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  opacity: 0.7;
}
.card-back__corner--tl { top: 14px; left: 18px; }
.card-back__corner--br { bottom: 14px; right: 18px; }
.card-back__seal {
  width: 55%;
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 1px 3px rgba(166, 41, 31, 0.15));
}
.card-back__brand {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.35em;
  color: var(--stamp-red);
  margin: 22px 0 0;
  opacity: 0.8;
}

/* ============================================================
   Wiggle hint — tilts the very first card gently to tell the
   player it's swipeable. Suppressed once the player touches it.
   ============================================================ */
@keyframes card-wiggle-hint {
  0%, 100% { transform: translateX(0)    rotate(0); }
  25%      { transform: translateX(-9px) rotate(-2.5deg); }
  50%      { transform: translateX(0)    rotate(0); }
  75%      { transform: translateX(9px)  rotate(2.5deg); }
}
.goddi-card--wiggle {
  animation: card-wiggle-hint 2.8s ease-in-out infinite;
  animation-delay: 0.7s;
}
/* The moment the player starts dragging, the animation gets out of the way
   — inline transform from swipe.js takes over. .dragging is set by swipe.js. */
.goddi-card.dragging {
  animation: none !important;
}

/* ============================================================
   Brand fade-in — SBYC stamp shown once per session before splash
   ============================================================ */
.brand-fade {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 50% 50%, rgba(184, 147, 74, 0.10), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 440ms ease;
  cursor: pointer;
}
.brand-fade--shown {
  opacity: 1;
  pointer-events: auto;
}
.brand-fade--leaving {
  opacity: 0;
}

.brand-fade__stamp {
  text-align: center;
  transform: scale(0.86) rotate(-2deg);
  transition: transform 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.brand-fade--shown .brand-fade__stamp {
  transform: scale(1) rotate(0deg);
}
.brand-fade__stamp svg,
.brand-fade__stamp .brand-fade__logo {
  display: block;
  margin: 0 auto;
}
.brand-fade__logo {
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 4px 10px rgba(13, 96, 52, 0.15));
}
.brand-fade__text {
  font-family: var(--font-mono);
  letter-spacing: 4px;
  font-size: 13px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  text-transform: uppercase;
}
body[data-lang="bn"] .brand-fade__text {
  font-family: var(--font-bn);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: none;
  font-size: 14px;
}
