/* ── Reset & base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0d0d;
  --surface: #181818;
  --border: #2a2a2a;
  --text: #f0f0f0;
  --text-muted: #888;
  --accent: #ff4d6d;
  --accent-2: #ff8fa3;
  --accept-color: #4ade80;
  --reject-color: #ff4d6d;
  --font: 'DM Sans', system-ui, sans-serif;
  --radius: 12px;
  --max-w: 640px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100dvh;
  line-height: 1.5;
}

.page-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-footer {
  margin-top: auto;
  padding: 1rem;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.5;
}

/* ── Game screen ── */
.game-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  position: relative;
}

.game-header {
  padding: 1.25rem 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  text-decoration: none;
}

/* ── Chain history ── */
.chain-history {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  max-height: 35dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.chain-item {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  animation: slide-in 0.25s ease;
}

.chain-item--accepted {
  background: color-mix(in srgb, var(--accept-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accept-color) 30%, transparent);
  color: var(--accept-color);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Prompt ── */
.prompt-area {
  margin-bottom: 1rem;
}

.prompt-text {
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.subject {
  color: var(--accent);
}

/* ── Verdict ── */
.verdict-area {
  min-height: 2.5rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1rem;
  transition: color 0.2s;
  position: relative;
}

.verdict-area--accept { color: var(--accept-color); }
.verdict-area--reject { color: var(--reject-color); }
.verdict-area--error  { color: var(--reject-color); }

/* ── Input row ── */
.input-form {
  margin-top: auto;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

.answer-input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.answer-input:focus {
  border-color: var(--accent);
}

.answer-input::placeholder {
  color: var(--text-muted);
}

.answer-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.submit-btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.submit-btn:hover { opacity: 0.9; }
.submit-btn:active { transform: scale(0.97); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.4rem;
}

/* ── Soulmate overlay ── */
.soulmate-overlay {
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.soulmate-overlay[hidden] {
  display: none;
}

.soulmate-card {
  max-width: var(--max-w);
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.soulmate-emoji {
  font-size: clamp(4rem, 20vw, 7rem);
  line-height: 1;
  animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

.soulmate-proclamation {
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  font-weight: 600;
  line-height: 1.4;
  max-width: 480px;
}

.soulmate-score {
  font-size: 1rem;
  color: var(--text-muted);
}

.soulmate-score strong {
  color: var(--accent-2);
  font-size: 1.2rem;
}

/* ── Name form ── */
.name-form-wrap {
  width: 100%;
  max-width: 400px;
}

.name-prompt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.name-form .input-row {
  width: 100%;
}

/* ── Play again ── */
.play-again-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.play-again-link:hover {
  color: var(--text);
}

/* ── Mobile tweaks ── */
@media (max-width: 480px) {
  .game-screen {
    padding-bottom: 1.5rem;
  }

  .input-row {
    flex-direction: column;
  }

  .submit-btn {
    width: 100%;
    padding: 0.85rem;
  }

  .chain-history {
    max-height: 25dvh;
  }
}

/* ══════════════════════════════════════════
   CHARACTER PICKER
   ══════════════════════════════════════════ */

.character-picker {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.picker-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.picker-title {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 700;
  margin: 0.5rem 0 0.4rem;
}

.picker-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-style: italic;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.character-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1.5px solid;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.character-card:hover  { transform: translateY(-2px); opacity: 0.9; }
.character-card:active { transform: scale(0.98); }

.character-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.character-card__role {
  font-size: 0.78rem;
  line-height: 1.3;
  opacity: 0.75;
}

/* Per-character card colours in the picker */
.character-card--bureau     { background: #0e1a0e; border-color: #4a7040; color: #b8ccb0; }
.character-card--drop       { background: #f2ede0; border-color: #1a1a1a; color: #1a1a1a; }
.character-card--oracle     { background: #0a0720; border-color: #7a6020; color: #e8d07a; }
.character-card--algorithm  { background: #000;    border-color: #00aa30; color: #00ff41; font-family: 'Courier New', monospace; }
.character-card--patriarchy { background: #f4e8d0; border-color: #7a1818; color: #2a1810; }
.character-card--maga       { background: #0a0a1a; border-color: #cc1122; color: #ffffff; }
.character-card--karen      { background: #f0ece4; border-color: #c06010; color: #222; }
.character-card--toddler    { background: #fffdf5; border-color: #e81010; color: #222; font-family: 'Comic Sans MS', cursive; }
.character-card--roman      { background: #f8f4ec; border-color: #c05828; color: #2c1808; }

/* ── Judge name badge in game header ── */
.judge-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ══════════════════════════════════════════
   CHARACTER THEMES  (data-character on <body>)
   ══════════════════════════════════════════ */

/* ── 1. The Bureau ── */
[data-character="bureau"] {
  --bg: #0e1a0e;
  --surface: #162216;
  --border: #2a3d2a;
  --text: #b8ccb0;
  --text-muted: #6a8a62;
  --accent: #5a8a52;
  --accent-2: #7aaa72;
  --accept-color: #5a8a52;
  --reject-color: #8a5252;
  --font: Georgia, 'Times New Roman', serif;
}

/* ── 2. The Drop ── */
[data-character="drop"] {
  --bg: #f2ede0;
  --surface: #e8e2d4;
  --border: #c8c2b4;
  --text: #111111;
  --text-muted: #7a7060;
  --accent: #111111;
  --accent-2: #555040;
  --accept-color: #2a5a1a;
  --reject-color: #6a1a1a;
  --font: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
}

[data-character="drop"] .prompt-text,
[data-character="drop"] .site-name,
[data-character="drop"] .judge-name {
  font-family: 'Bebas Neue', 'Arial Narrow', Impact, sans-serif;
  letter-spacing: 0.04em;
}

[data-character="drop"] .verdict-area,
[data-character="drop"] .answer-input,
[data-character="drop"] .submit-btn,
[data-character="drop"] .chain-item,
[data-character="drop"] .soulmate-proclamation {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

[data-character="drop"] .answer-input {
  background: var(--surface);
  color: var(--text);
}

[data-character="drop"] .answer-input::placeholder {
  color: var(--text-muted);
}

/* ── 3. The Oracle ── */
[data-character="oracle"] {
  --bg: #0a0720;
  --surface: #12102a;
  --border: #2a2050;
  --text: #e8d07a;
  --text-muted: #907840;
  --accent: #d4aa40;
  --accent-2: #e8cc70;
  --accept-color: #d4aa40;
  --reject-color: #c04040;
  --font: Georgia, 'Times New Roman', serif;
}

/* ── 4. The Algorithm ── */
[data-character="algorithm"] {
  --bg: #000000;
  --surface: #050805;
  --border: #0a280a;
  --text: #00ff41;
  --text-muted: #007820;
  --accent: #00ff41;
  --accent-2: #40ff80;
  --accept-color: #00ff41;
  --reject-color: #ff4100;
  --font: 'Courier New', Courier, monospace;
}

/* ── 5. The Patriarchy ── */
[data-character="patriarchy"] {
  --bg: #f4e8d0;
  --surface: #ece0c8;
  --border: #c8b898;
  --text: #2a1810;
  --text-muted: #7a5838;
  --accent: #7a1818;
  --accent-2: #aa3838;
  --accept-color: #2a5010;
  --reject-color: #7a1818;
  --font: 'Times New Roman', Times, serif;
}

[data-character="patriarchy"] .answer-input {
  background: var(--surface);
  color: var(--text);
}

[data-character="patriarchy"] .answer-input::placeholder {
  color: var(--text-muted);
}

/* ── 6. MAGA ── */
[data-character="maga"] {
  --bg: #0a0a1a;
  --surface: #10102a;
  --border: #201040;
  --text: #ffffff;
  --text-muted: #9090cc;
  --accent: #cc1122;
  --accent-2: #ee3344;
  --accept-color: #22aa22;
  --reject-color: #cc1122;
  --font: Impact, 'Arial Black', 'Arial Narrow', sans-serif;
}

[data-character="maga"] .prompt-text {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ── 7. Karen ── */
[data-character="karen"] {
  --bg: #f0ece4;
  --surface: #e8e4dc;
  --border: #c8c0b0;
  --text: #222222;
  --text-muted: #7a6a5a;
  --accent: #c06010;
  --accent-2: #e08030;
  --accept-color: #2a6a2a;
  --reject-color: #aa2010;
  --font: Arial, Helvetica, sans-serif;
}

[data-character="karen"] .answer-input {
  background: var(--surface);
  color: var(--text);
}

[data-character="karen"] .answer-input::placeholder {
  color: var(--text-muted);
}

/* ── 8. The Toddler ── */
[data-character="toddler"] {
  --bg: #fffdf5;
  --surface: #fffae8;
  --border: #f0d840;
  --text: #222222;
  --text-muted: #888888;
  --accent: #e81010;
  --accent-2: #1088e8;
  --accept-color: #1088e8;
  --reject-color: #e81010;
  --font: 'Comic Sans MS', 'Chalkboard SE', cursive;
}

[data-character="toddler"] .answer-input {
  background: var(--surface);
  color: var(--text);
}

[data-character="toddler"] .answer-input::placeholder {
  color: var(--text-muted);
}

/* ── 9. The Roman Citizen ── */
[data-character="roman"] {
  --bg: #f8f4ec;
  --surface: #f0eadc;
  --border: #d8cbb8;
  --text: #2c1808;
  --text-muted: #7a5838;
  --accent: #c05828;
  --accent-2: #e07848;
  --accept-color: #4a7828;
  --reject-color: #c05828;
  --font: Georgia, 'Times New Roman', serif;
}

[data-character="roman"] .answer-input {
  background: var(--surface);
  color: var(--text);
}

[data-character="roman"] .answer-input::placeholder {
  color: var(--text-muted);
}

/* ── Light-theme shared fixes ──
   For themes with light backgrounds, ensure readable inputs & overlays */
[data-character="drop"] .soulmate-overlay,
[data-character="patriarchy"] .soulmate-overlay,
[data-character="karen"] .soulmate-overlay,
[data-character="toddler"] .soulmate-overlay,
[data-character="roman"] .soulmate-overlay {
  background: var(--bg);
}

[data-character="drop"] .chain-item--accepted,
[data-character="patriarchy"] .chain-item--accepted,
[data-character="karen"] .chain-item--accepted,
[data-character="toddler"] .chain-item--accepted,
[data-character="roman"] .chain-item--accepted {
  color: var(--accept-color);
}

/* ── Mobile: single-column character grid ── */
@media (max-width: 480px) {
  .character-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════
   DECORATIVE TREATMENTS — PER CHARACTER
   ══════════════════════════════════════════ */

/* ─── THE BUREAU: Document aesthetics ─── */

/* "CERTIFIED" diagonal watermark */
[data-character="bureau"] .game-screen::before {
  content: "CERTIFIED";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 900;
  font-family: Georgia, serif;
  color: var(--text);
  opacity: 0.022;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.25em;
  user-select: none;
  z-index: 0;
}

/* Double-border on active verdict */
[data-character="bureau"] .verdict-area--accept,
[data-character="bureau"] .verdict-area--reject {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--text-muted);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--text-muted);
  border-radius: 2px;
  opacity: 0.9;
}

/* Case number — injected via JS as .bureau-case-no */
.bureau-case-no {
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.55;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── THE DROP: Editorial aesthetics ─── */

/* Paper grain via SVG feTurbulence as fixed overlay */
[data-character="drop"] .game-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

/* Thin horizontal rules flanking question text */
[data-character="drop"] .prompt-area::before,
[data-character="drop"] .prompt-area::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--text);
  opacity: 0.18;
}
[data-character="drop"] .prompt-area::before { margin-bottom: 0.75rem; }
[data-character="drop"] .prompt-area::after  { margin-top: 0.75rem; }

/* Letter-spacing entrance on verdict — one-shot */
@keyframes drop-verdict-in {
  from { letter-spacing: 0.14em; opacity: 0; }
  to   { letter-spacing: normal;  opacity: 1; }
}
[data-character="drop"] .verdict-area--accept,
[data-character="drop"] .verdict-area--reject {
  animation: drop-verdict-in 0.45s ease forwards;
}

/* ─── THE ORACLE: Mystical aesthetics ─── */

/* Radial vignette on edges */
[data-character="oracle"] .page-wrap::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 38%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Concentric pulse circles — injected as .oracle-circles SVG by JS */
.oracle-circles {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.oracle-circles circle {
  fill: none;
  stroke: #d4aa40;
  stroke-width: 1;
  opacity: 0;
  transform-origin: 50% 50%;
  transform-box: fill-box;
}
@keyframes oracle-ring-pulse {
  0%   { transform: scale(0.85); opacity: 0; }
  30%  { opacity: 0.18; }
  100% { transform: scale(1.15); opacity: 0; }
}
.oracle-circles circle:nth-child(1) { animation: oracle-ring-pulse 3.5s ease-in-out infinite; }
.oracle-circles circle:nth-child(2) { animation: oracle-ring-pulse 3.5s ease-in-out 1.2s infinite; }

/* Decorative arc dots — injected by JS as .oracle-dots-svg */
.oracle-dots-svg { display: block; pointer-events: none; }

/* ─── THE ALGORITHM: Terminal aesthetics ─── */

/* Scanline texture directly on verdict area background */
[data-character="algorithm"] .verdict-area--accept,
[data-character="algorithm"] .verdict-area--reject {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 3px,
    rgba(0, 255, 65, 0.025) 3px,
    rgba(0, 255, 65, 0.025) 4px
  );
  padding: 0.4rem 0;
}

/* Flicker on verdict appear — one-shot */
@keyframes algo-flicker {
  0%   { opacity: 1; }
  8%   { opacity: 0; }
  16%  { opacity: 1; }
  22%  { opacity: 0.6; }
  28%  { opacity: 1; }
}
[data-character="algorithm"] .verdict-area--accept,
[data-character="algorithm"] .verdict-area--reject {
  animation: algo-flicker 0.35s ease forwards;
}

/* Blinking underscore cursor after current subject */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
[data-character="algorithm"] .subject::after {
  content: "_";
  animation: cursor-blink 1s step-end infinite;
  margin-left: 2px;
  font-weight: 400;
}

/* ─── THE PATRIARCHY: Corporate memo aesthetics ─── */

/* Letterhead double-line at page top */
[data-character="patriarchy"] .game-screen::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  pointer-events: none;
  z-index: 10;
  opacity: 0.7;
}

/* "MEMO" ghost text behind verdict */
[data-character="patriarchy"] .verdict-area--accept::before,
[data-character="patriarchy"] .verdict-area--reject::before {
  content: "MEMO";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg);
  font-size: 2.8rem;
  font-weight: 900;
  font-family: 'Times New Roman', serif;
  color: var(--accent);
  opacity: 0.06;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.3em;
  user-select: none;
  z-index: 0;
}

/* cc: HR label — injected by JS as .patriarchy-cc */
.patriarchy-cc {
  position: fixed;
  bottom: 1rem;
  right: 1.25rem;
  font-size: 0.6rem;
  font-family: 'Times New Roman', serif;
  color: var(--text-muted);
  opacity: 0.3;
  pointer-events: none;
  user-select: none;
}

/* ─── MAGA: Rally aesthetics ─── */

/* "OFFICIAL RESULT" micro-label before verdict text */
[data-character="maga"] .verdict-area--accept::before,
[data-character="maga"] .verdict-area--reject::before {
  content: "OFFICIAL RESULT";
  display: block;
  font-size: 0.52rem;
  font-family: Impact, 'Arial Black', sans-serif;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 0.3rem;
  opacity: 0.65;
}

/* Star accent footer after verdict text */
[data-character="maga"] .verdict-area--accept::after,
[data-character="maga"] .verdict-area--reject::after {
  content: "★  ★  ★";
  display: block;
  font-size: 0.45rem;
  color: var(--accent);
  text-align: center;
  margin-top: 0.35rem;
  opacity: 0.45;
  letter-spacing: 0.4em;
}

/* Scale-up entrance — one-shot */
@keyframes maga-verdict-in {
  from { transform: scale(1.1); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
[data-character="maga"] .verdict-area--accept,
[data-character="maga"] .verdict-area--reject {
  animation: maga-verdict-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Thin red border around active verdict */
[data-character="maga"] .verdict-area--accept,
[data-character="maga"] .verdict-area--reject {
  border: 1px solid rgba(204, 17, 34, 0.35);
  padding: 0.45rem 0.6rem;
  border-radius: 2px;
}

/* ─── KAREN: Complaint form aesthetics ─── */

/* Faint ruled lines across the game area */
[data-character="karen"] .game-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 27px,
    rgba(0,0,0,0.055) 27px,
    rgba(0,0,0,0.055) 28px
  );
  pointer-events: none;
  z-index: 0;
}

/* Complaint number — injected by JS as .karen-complaint-no */
.karen-complaint-no {
  font-size: 0.62rem;
  font-family: Arial, sans-serif;
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
  white-space: nowrap;
}

/* Shake animation for rejection — applied by JS */
@keyframes karen-shake {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-7px); }
  30%  { transform: translateX(7px); }
  45%  { transform: translateX(-4px); }
  60%  { transform: translateX(4px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
.karen-shake {
  animation: karen-shake 0.42s ease forwards;
}

/* ─── THE TODDLER: Crayon aesthetics ─── */

/* Pastel blob — top-left corner */
[data-character="toddler"] .game-screen::before {
  content: "";
  position: fixed;
  top: -8%;
  left: -12%;
  width: 45%;
  height: 45%;
  background: radial-gradient(ellipse, rgba(255,170,80,0.13) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}

/* Pastel blob — bottom-right corner */
[data-character="toddler"] .game-screen::after {
  content: "";
  position: fixed;
  bottom: -12%;
  right: -12%;
  width: 55%;
  height: 55%;
  background: radial-gradient(ellipse, rgba(80,160,255,0.12) 0%, transparent 68%);
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}

/* Third blob — top-right, injected inline by JS to avoid ::before/::after limit */

/* Wobbly underline SVG — injected by JS as .toddler-underline */
.toddler-underline {
  display: block;
  width: 100%;
  overflow: visible;
  pointer-events: none;
  margin-top: -0.25rem;
  margin-bottom: 0.4rem;
}

/* ─── THE ROMAN CITIZEN: Classical aesthetics ─── */

/* Column lines SVG — injected by JS as .roman-columns */
.roman-columns {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Greek key border on active verdict — top and bottom rules */
[data-character="roman"] .verdict-area--accept,
[data-character="roman"] .verdict-area--reject {
  border-top: 2px solid rgba(192, 88, 40, 0.35);
  border-bottom: 2px solid rgba(192, 88, 40, 0.35);
  padding: 0.5rem 0;
}
[data-character="roman"] .verdict-area--accept::before,
[data-character="roman"] .verdict-area--reject::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  right: 0;
  height: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='3'%3E%3Cpath d='M0,3 V0 H8 V3 H5 V1 H3 V3' fill='%23c05828' opacity='0.4'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  pointer-events: none;
}
[data-character="roman"] .verdict-area--accept::after,
[data-character="roman"] .verdict-area--reject::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='3'%3E%3Cpath d='M0,3 V0 H8 V3 H5 V1 H3 V3' fill='%23c05828' opacity='0.4'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  pointer-events: none;
}

/* Letter reveal — JS controls text insertion; no extra CSS needed */

/* ══════════════════════════════════════════
   CHARACTERS 10-12: PICKER CARD COLOURS
   ══════════════════════════════════════════ */

.character-card--jesus     { background: #fdf6e3; border-color: #c8a84b; color: #3d2b1f; font-family: 'EB Garamond', Georgia, serif; }
.character-card--principal { background: #f5f0e8; border-color: #8b6914; color: #2c2c2c; }
.character-card--nun       { background: #ffffff; border-color: #1a1a1a; color: #1a1a1a; font-family: 'Courier New', monospace; }

/* ══════════════════════════════════════════
   CHARACTER THEMES
   ══════════════════════════════════════════ */

/* ── 10. Jesus ── */
[data-character="jesus"] {
  --bg: #fdf6e3;
  --surface: #f0e6c8;
  --border: #d4b870;
  --text: #3d2b1f;
  --text-muted: #8a6a40;
  --accent: #c8a84b;
  --accent-2: #e0c870;
  --accept-color: #8a6a20;
  --reject-color: #6a2a10;
  --font: 'EB Garamond', Georgia, serif;
}

[data-character="jesus"] .answer-input {
  background: var(--surface);
  color: var(--text);
}
[data-character="jesus"] .answer-input::placeholder { color: var(--text-muted); }

/* ── 11. The Principal ── */
[data-character="principal"] {
  --bg: #f5f0e8;
  --surface: #e8e0d0;
  --border: #c8b080;
  --text: #2c2c2c;
  --text-muted: #7a6a40;
  --accent: #8b6914;
  --accent-2: #b08828;
  --accept-color: #3a6a1a;
  --reject-color: #6a1a1a;
  --font: Georgia, 'Times New Roman', serif;
}

[data-character="principal"] .answer-input {
  background: var(--surface);
  color: var(--text);
}
[data-character="principal"] .answer-input::placeholder { color: var(--text-muted); }

/* ── 12. The Nun ── */
[data-character="nun"] {
  --bg: #ffffff;
  --surface: #f5f5f5;
  --border: #d0d0d0;
  --text: #1a1a1a;
  --text-muted: #666666;
  --accent: #1a1a1a;
  --accent-2: #444444;
  --accept-color: #007700;
  --reject-color: #cc0000;
  --font: 'DM Sans', system-ui, sans-serif;
}

[data-character="nun"] .answer-input {
  background: var(--surface);
  color: var(--text);
}
[data-character="nun"] .answer-input::placeholder { color: var(--text-muted); }

/* Light-theme shared overlay fix */
[data-character="jesus"] .soulmate-overlay,
[data-character="principal"] .soulmate-overlay,
[data-character="nun"] .soulmate-overlay {
  background: var(--bg);
}

/* ══════════════════════════════════════════
   DECORATIVE TREATMENTS — CHARACTERS 10-12
   ══════════════════════════════════════════ */

/* ─── JESUS: Illuminated gospel aesthetics ─── */

/* Manuscript corner flourishes — top-left and bottom-right */
[data-character="jesus"] .game-screen::before {
  content: "✦\A✦  ✦";
  position: fixed;
  top: 44px;
  left: 44px;
  color: var(--accent);
  opacity: 0.28;
  font-size: 0.85rem;
  pointer-events: none;
  white-space: pre;
  line-height: 1.6;
  user-select: none;
  z-index: 0;
}
[data-character="jesus"] .game-screen::after {
  content: "✦  ✦\A    ✦";
  position: fixed;
  bottom: 44px;
  right: 44px;
  color: var(--accent);
  opacity: 0.28;
  font-size: 0.85rem;
  pointer-events: none;
  white-space: pre;
  line-height: 1.6;
  user-select: none;
  z-index: 0;
  text-align: right;
}

/* Verdict box: warm cream bg, left gold border, slightly larger italic */
[data-character="jesus"] .verdict-area--accept,
[data-character="jesus"] .verdict-area--reject {
  background: rgba(240, 230, 200, 0.45);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0.75rem;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.05rem;
}

/* Halo SVG — injected by JS behind emoji on soulmate reveal */
.jesus-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

/* Gentle fade-in for verdict */
@keyframes jesus-verdict-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
[data-character="jesus"] .verdict-area--accept,
[data-character="jesus"] .verdict-area--reject {
  animation: jesus-verdict-in 0.5s ease forwards;
}

/* ─── THE PRINCIPAL: Institutional memo aesthetics ─── */

/* Motto header band */
[data-character="principal"] .game-screen::before {
  content: "· RESPECT · RESPONSIBILITY · RESULTS · RESPECT · RESPONSIBILITY · RESULTS · RESPECT · RESPONSIBILITY · RESULTS ·";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  font-size: 0.48rem;
  font-family: Georgia, serif;
  font-weight: bold;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.5;
  text-align: center;
  padding: 0.35rem 1rem;
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  overflow: hidden;
}

/* Laminate / printed-notice effect on verdict box */
[data-character="principal"] .verdict-area--accept,
[data-character="principal"] .verdict-area--reject {
  background: rgba(255, 252, 220, 0.65);
  border: 1px solid #8b6914;
  padding: 0.5rem 0.75rem;
  border-radius: 1px;
  box-shadow: inset 0 0 0 2px rgba(139, 105, 20, 0.08);
}

/* Clipboard SVG — injected by JS */
.principal-clipboard {
  opacity: 0.45;
  pointer-events: none;
}

/* ─── THE NUN: Graded-paper aesthetics ─── */

/* Ruled lines in the verdict area */
[data-character="nun"] .verdict-area--accept,
[data-character="nun"] .verdict-area--reject {
  background: repeating-linear-gradient(
    transparent 0px,
    transparent 27px,
    #d0d0d0 27px,
    #d0d0d0 28px
  );
  padding: 0.4rem 0.5rem 0.5rem;
  min-height: 62px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  font-style: normal;
}

/* Reject verdict in red ink */
[data-character="nun"] .verdict-area--reject {
  color: #cc0000;
}

/* Accept verdict: red ✓ prefix */
[data-character="nun"] .verdict-area--accept::before {
  content: "✓ ";
  color: #cc0000;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

/* Cross SVG — injected by JS */
.nun-cross {
  opacity: 0.7;
  pointer-events: none;
}
