/* ─────────────────────────────────────────────────────────────
   Russell's 31st — Party Quirks
   Enchanted forest / DND adventure aesthetic
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&family=VT323&family=IM+Fell+English:ital@0;1&family=Press+Start+2P&display=swap');

:root {
  /* Forest greens */
  --forest-darkest: #0d1f17;
  --forest-deep:    #142b1f;
  --forest-mid:     #1f3d2c;
  --forest-leaf:    #2d5a3d;
  --forest-moss:    #4a7c59;
  --forest-glow:    #7fb069;

  /* Browns / earth */
  --brown-bark:     #3a2817;
  --brown-wood:     #5c3a1e;
  --brown-leather:  #8b5a2b;
  --brown-tan:      #b8895a;
  --parchment:      #efe1c1;
  --parchment-warm: #d9c89e;
  --parchment-edge: #a08654;

  /* Dark blues — text & UI */
  --ink-dark:       #0e1726;
  --ink:            #1a2540;
  --ink-mid:        #2c3a5c;
  --ink-soft:       #4a5a82;

  /* Accents */
  --gold:           #d4a843;
  --gold-bright:    #f1c84b;
  --ember:          #c4632a;
  --blood:          #7a1f1f;

  --r-sm: 4px;
  --r-md: 8px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'IM Fell English', 'Times New Roman', serif;
  color: var(--ink-dark);
  background: var(--forest-darkest);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ── Forest background ───────────────────────────────── */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(127,176,105,0.15), transparent 60%),
    radial-gradient(ellipse at 20% 0%, rgba(74,124,89,0.12), transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(212,168,67,0.05), transparent 40%),
    linear-gradient(180deg, #0a1812 0%, var(--forest-darkest) 40%, #050d09 100%);
}
.app-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,240,200,0.7), transparent),
    radial-gradient(1px 1px at 78% 32%, rgba(255,240,200,0.5), transparent),
    radial-gradient(1.5px 1.5px at 35% 70%, rgba(212,168,67,0.6), transparent),
    radial-gradient(1px 1px at 62% 85%, rgba(255,240,200,0.4), transparent),
    radial-gradient(1px 1px at 88% 60%, rgba(127,176,105,0.5), transparent),
    radial-gradient(1.5px 1.5px at 45% 12%, rgba(255,240,200,0.6), transparent),
    radial-gradient(1px 1px at 8% 55%, rgba(212,168,67,0.5), transparent),
    radial-gradient(1px 1px at 92% 78%, rgba(255,240,200,0.5), transparent);
  animation: twinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes twinkle {
  0%   { opacity: 0.4; }
  100% { opacity: 1; }
}

/* Drifting fog */
.app-bg::after {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 600px 200px at 30% 40%, rgba(127,176,105,0.06), transparent 70%),
    radial-gradient(ellipse 800px 250px at 70% 70%, rgba(212,168,67,0.04), transparent 70%);
  animation: fog 25s linear infinite;
  pointer-events: none;
}
@keyframes fog {
  0%   { transform: translateX(-5%) translateY(0); }
  50%  { transform: translateX(5%) translateY(-2%); }
  100% { transform: translateX(-5%) translateY(0); }
}

/* ── Fireflies ───────────────────────────────────────── */
.fireflies {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.fireflies span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(241,220,120,0.95), rgba(212,168,67,0.4) 60%, transparent);
  box-shadow: 0 0 8px 2px rgba(241,200,75,0.35);
  opacity: 0;
  left: var(--x);
  top: var(--y);
  animation:
    ff-drift var(--dur) ease-in-out var(--delay) infinite alternate,
    ff-glow calc(var(--dur) / 3.5) ease-in-out var(--delay) infinite;
}
@keyframes ff-drift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(var(--dx), calc(var(--dy) * -0.6)); }
  50%  { transform: translate(calc(var(--dx) * -0.4), var(--dy)); }
  75%  { transform: translate(calc(var(--dx) * 0.7), calc(var(--dy) * 0.3)); }
  100% { transform: translate(calc(var(--dx) * -0.8), calc(var(--dy) * -0.9)); }
}
@keyframes ff-glow {
  0%, 100% { opacity: 0; }
  50%      { opacity: 0.9; }
}

/* ── App container ───────────────────────────────────── */
#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
}

.screen {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ── Headings ────────────────────────────────────────── */
.h-rpg {
  font-family: 'MedievalSharp', 'IM Fell English', serif;
  color: var(--gold-bright);
  text-align: center;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 12px rgba(241,200,75,0.35),
    0 2px 0 #2a1a06,
    0 4px 12px rgba(0,0,0,0.6);
  margin: 0;
}
.h-pixel {
  font-family: 'Press Start 2P', monospace;
  color: var(--gold-bright);
  text-align: center;
  letter-spacing: 0.04em;
  text-shadow:
    2px 2px 0 var(--brown-bark),
    4px 4px 0 rgba(0,0,0,0.6);
  margin: 0;
  line-height: 1.4;
}
.h-quest {
  font-family: 'VT323', monospace;
  color: var(--forest-glow);
  text-align: center;
  font-size: 28px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px rgba(127,176,105,0.5);
  margin: 0;
}

.body-text {
  font-family: 'IM Fell English', serif;
  color: var(--parchment);
  font-size: 21px;
  line-height: 1.5;
  text-align: center;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  font-family: 'MedievalSharp', serif;
  font-size: 18px;
  letter-spacing: 0.04em;
  padding: 14px 28px;
  border: 2px solid var(--gold);
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, var(--brown-leather), var(--brown-wood));
  color: var(--parchment);
  box-shadow:
    inset 0 1px 0 rgba(255,240,200,0.25),
    inset 0 -2px 0 rgba(0,0,0,0.3),
    0 4px 0 var(--brown-bark),
    0 6px 16px rgba(0,0,0,0.5);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  position: relative;
}
.btn:hover  { filter: brightness(1.1); }
.btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255,240,200,0.25),
    inset 0 -2px 0 rgba(0,0,0,0.3),
    0 2px 0 var(--brown-bark),
    0 3px 8px rgba(0,0,0,0.5);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.btn--primary {
  background: linear-gradient(180deg, var(--forest-moss), var(--forest-leaf));
  border-color: var(--gold-bright);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 -2px 0 rgba(0,0,0,0.3),
    0 4px 0 var(--forest-deep),
    0 0 24px rgba(127,176,105,0.4),
    0 6px 18px rgba(0,0,0,0.5);
}
.btn--primary:active { box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 -2px 0 rgba(0,0,0,0.3),
    0 2px 0 var(--forest-deep),
    0 0 18px rgba(127,176,105,0.4),
    0 3px 10px rgba(0,0,0,0.5);
}
.btn--ghost {
  background: transparent;
  border-color: var(--brown-leather);
  color: var(--brown-tan);
  box-shadow: none;
  padding: 12px 20px;
  font-size: 17px;
}
.btn--ghost:hover { color: var(--parchment); border-color: var(--gold); }
.btn--ghost:active { transform: none; box-shadow: none; }
.btn--danger {
  background: linear-gradient(180deg, #a84020, var(--blood));
  border-color: var(--gold);
}

/* ── Inputs ──────────────────────────────────────────── */
.input {
  width: 100%;
  max-width: 380px;
  padding: 14px 18px;
  font-family: 'VT323', monospace;
  font-size: 24px;
  letter-spacing: 0.05em;
  color: var(--ink-dark);
  background: var(--parchment);
  border: 2px solid var(--gold);
  border-radius: var(--r-sm);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.25),
    0 0 0 4px var(--brown-bark),
    0 0 0 5px var(--gold),
    0 8px 24px rgba(0,0,0,0.5);
  outline: none;
  text-align: center;
}
.input:focus {
  background: #fff7e3;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.25),
    0 0 0 4px var(--brown-bark),
    0 0 0 5px var(--gold-bright),
    0 0 24px rgba(241,200,75,0.4),
    0 8px 24px rgba(0,0,0,0.5);
}

.shake {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}

/* ── Gandalf wrapper + smoke ─────────────────────────── */
.gandalf-stage {
  position: relative;
  width: 240px;
  height: 280px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.gandalf {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.6));
  transform-origin: bottom center;
}
.gandalf.entering { animation: gandalf-rise 1.4s cubic-bezier(.2,.8,.3,1) both; }
.gandalf.leaving  { animation: gandalf-poof 0.9s ease-in both; }
.gandalf.angry    { animation: gandalf-angry 0.6s ease-in-out; }

@keyframes gandalf-rise {
  0%   { opacity: 0; transform: translateY(40px) scale(0.6); filter: blur(12px) drop-shadow(0 8px 16px rgba(0,0,0,0.6)); }
  60%  { opacity: 1; filter: blur(0) drop-shadow(0 8px 16px rgba(0,0,0,0.6)); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0) drop-shadow(0 8px 16px rgba(0,0,0,0.6)); }
}
@keyframes gandalf-poof {
  0%   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-10px) scale(0.7); filter: blur(20px); }
}
@keyframes gandalf-angry {
  0%, 100% { transform: translateX(0) rotate(0); }
  20%      { transform: translateX(-6px) rotate(-2deg); }
  40%      { transform: translateX(6px) rotate(2deg) translateY(-4px); }
  60%      { transform: translateX(-4px) rotate(-1deg); }
  80%      { transform: translateX(4px) rotate(1deg); }
}

/* ── Gandalf living animations ───────────────────────── */
.gandalf svg .g-figure,
.gandalf svg .g-beard,
.gandalf svg .g-hat-tip,
.gandalf svg .g-crystal-glow,
.gandalf svg .g-lids,
.gandalf svg .g-spark {
  transform-box: fill-box;
  transform-origin: center;
}
.gandalf svg .g-figure {
  transform-origin: 50% 100%;
  animation: g-idle 5s ease-in-out infinite;
}
@keyframes g-idle {
  0%, 100% { transform: translateY(0) rotate(0); }
  50%      { transform: translateY(-3px) rotate(0.4deg); }
}
.gandalf svg .g-beard {
  transform-origin: 50% 0%;
  animation: g-beard-sway 6s ease-in-out infinite;
}
@keyframes g-beard-sway {
  0%, 100% { transform: rotate(-0.7deg); }
  50%      { transform: rotate(0.7deg); }
}
.gandalf svg .g-hat-tip {
  transform-origin: 0% 100%;
  animation: g-tip-wobble 4s ease-in-out infinite;
}
@keyframes g-tip-wobble {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(6deg); }
}
.gandalf svg .g-crystal-glow {
  animation: g-crystal-pulse 2.6s ease-in-out infinite;
}
@keyframes g-crystal-pulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.18); }
}
.gandalf svg .g-lids {
  transform-origin: 50% 0%;
  transform: scaleY(0);
  animation: g-blink 4.6s infinite;
}
@keyframes g-blink {
  0%, 93%, 100% { transform: scaleY(0); }
  95.5%, 97.5%  { transform: scaleY(1); }
}
.gandalf svg .g-spark {
  animation: g-twinkle 2.2s ease-in-out infinite;
}
.gandalf svg .g-spark2 { animation-delay: 1.1s; }
@keyframes g-twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.6) rotate(0deg); }
  50%      { opacity: 0.95; transform: scale(1.1) rotate(20deg); }
}
/* angry: crystal flares hard and fast */
.gandalf.angry svg .g-crystal-glow {
  animation: g-crystal-flare 0.3s ease-in-out infinite;
}
@keyframes g-crystal-flare {
  0%, 100% { opacity: 0.8; transform: scale(1.1); }
  50%      { opacity: 1;   transform: scale(1.45); }
}

/* Smoke puff */
.smoke {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.smoke .puff {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220,220,220,0.85), rgba(150,150,150,0.5) 50%, transparent 70%);
  transform: translate(-50%, 0) scale(0);
  filter: blur(6px);
}
.smoke.burst .puff {
  animation: puff 1.2s ease-out forwards;
}
.smoke.burst .puff:nth-child(1) { --dx: -60px; --dy: -120px; animation-delay: 0s; }
.smoke.burst .puff:nth-child(2) { --dx:  70px; --dy: -100px; animation-delay: 0.05s; }
.smoke.burst .puff:nth-child(3) { --dx: -20px; --dy: -160px; animation-delay: 0.1s; }
.smoke.burst .puff:nth-child(4) { --dx:  30px; --dy: -140px; animation-delay: 0.15s; }
.smoke.burst .puff:nth-child(5) { --dx: -90px; --dy:  -60px; animation-delay: 0.05s; }
.smoke.burst .puff:nth-child(6) { --dx:  90px; --dy:  -70px; animation-delay: 0.12s; }

@keyframes puff {
  0%   { opacity: 0; transform: translate(-50%, 0) scale(0.2); }
  20%  { opacity: 0.95; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(2.4); }
}

/* ── Speech bubble ───────────────────────────────────── */
.speech {
  font-family: 'MedievalSharp', serif;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink-dark);
  background: linear-gradient(180deg, var(--parchment), var(--parchment-warm));
  padding: 18px 26px;
  border: 2px solid var(--parchment-edge);
  border-radius: var(--r-md);
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.4),
    0 4px 14px rgba(0,0,0,0.5);
  position: relative;
  text-align: center;
  max-width: 480px;
}
.speech::before, .speech::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border: 12px solid transparent;
  border-bottom-color: var(--parchment-edge);
}
.speech::after {
  top: -7px;
  border-bottom-color: var(--parchment);
  border-width: 10px;
}

.speech--shout {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  background: linear-gradient(180deg, #fff0d0, #f8d27a);
  border-color: var(--blood);
  color: var(--blood);
  text-shadow: 1px 1px 0 #fff;
}

/* ── Cinematic intro ─────────────────────────────────── */
.cinematic {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 36px;
  z-index: 50;
  padding: 32px;
}
.cine-line {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: clamp(22px, 4vw, 36px);
  color: rgba(255, 245, 220, 0);
  text-align: center;
  max-width: 720px;
  line-height: 1.5;
  transform: translateY(20px);
  transition: opacity 1.5s ease, transform 1.5s ease, color 1.5s ease;
  text-shadow: 0 0 20px rgba(212,168,67,0.4);
}
.cine-line.show {
  color: rgba(255, 245, 220, 0.92);
  transform: translateY(0);
}

/* ── Selection card (parchment) ──────────────────────── */
.counter {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--gold-bright);
  letter-spacing: 0.1em;
  text-shadow: 2px 2px 0 var(--brown-bark);
}
.card-stack {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 280px;
  perspective: 1200px;
}
.card {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,0.4), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(160,134,84,0.3), transparent 50%),
    linear-gradient(135deg, var(--parchment) 0%, var(--parchment-warm) 100%);
  border: 3px double var(--parchment-edge);
  border-radius: var(--r-md);
  padding: 32px 28px;
  box-shadow:
    inset 0 0 60px rgba(160,134,84,0.25),
    inset 0 2px 0 rgba(255,255,255,0.5),
    0 12px 32px rgba(0,0,0,0.6),
    0 0 0 1px rgba(0,0,0,0.2);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.card::before, .card::after {
  /* worn parchment edges */
  content: "";
  position: absolute;
  pointer-events: none;
}
.card::before {
  inset: 0;
  background:
    radial-gradient(ellipse 50px 30px at 0% 30%, rgba(0,0,0,0.15), transparent 60%),
    radial-gradient(ellipse 60px 40px at 100% 70%, rgba(0,0,0,0.15), transparent 60%),
    radial-gradient(ellipse 40px 30px at 50% 0%, rgba(0,0,0,0.1), transparent 60%);
}
.card-kicker {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--brown-bark);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 14px;
  opacity: 0.7;
}
.card-name {
  font-family: 'MedievalSharp', serif;
  font-size: clamp(28px, 5vw, 40px);
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
.card-desc {
  font-family: 'IM Fell English', serif;
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink-mid);
  font-style: italic;
}
.quirk-card .card-name {
  font-size: clamp(22px, 3.5vw, 28px);
  font-style: italic;
  font-family: 'IM Fell English', serif;
  font-weight: normal;
}

/* Card entry / parchment-rip exit */
.card.enter {
  animation: card-enter 0.55s cubic-bezier(.2,.8,.3,1) both;
}
.card.rip {
  animation: card-rip 0.55s ease-in forwards;
}
@keyframes card-enter {
  0%   { opacity: 0; transform: rotateX(35deg) translateY(44px) rotate(-2deg) scale(0.9); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: rotateX(0) translateY(0) rotate(0) scale(1); }
}
@keyframes card-rip {
  0%   { opacity: 1; transform: rotate(0) translateX(0); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
  40%  { opacity: 1; transform: rotate(-3deg) translateX(-30px) translateY(20px); }
  100% { opacity: 0; transform: rotate(-12deg) translateX(-200px) translateY(80px); clip-path: polygon(0 0, 60% 0, 50% 30%, 70% 60%, 60% 100%, 0 100%); }
}

/* Action row */
.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* ── Bottom info nav ─────────────────────────────────── */
.bottom-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

/* ── Modal ───────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  animation: fade-in 0.3s ease;
}
@keyframes fade-in { from {opacity:0;} to {opacity:1;} }
.modal {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,0.3), transparent 50%),
    linear-gradient(135deg, var(--parchment) 0%, var(--parchment-warm) 100%);
  border: 3px double var(--parchment-edge);
  border-radius: var(--r-md);
  padding: 32px 28px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  position: relative;
  animation: card-enter 0.4s ease both;
}
.modal h2 {
  font-family: 'MedievalSharp', serif;
  color: var(--ink);
  font-size: 32px;
  text-align: center;
  margin: 0 0 6px;
}
.modal .scroll-rule {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--parchment-edge), transparent);
  margin: 12px 0 18px;
}
.modal p, .modal li {
  font-family: 'IM Fell English', serif;
  color: var(--ink-mid);
  font-size: 20px;
  line-height: 1.6;
}
.modal ul { padding-left: 22px; }
.modal li { margin-bottom: 12px; }
.modal-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin: 6px 0;
}
.modal-row .label {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--brown-bark);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  flex-shrink: 0;
  width: 80px;
}
.modal-row .value {
  font-family: 'IM Fell English', serif;
  font-size: 20px;
  color: var(--ink);
}
.modal .close-x {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: var(--ink-mid);
  cursor: pointer;
}
.modal .close-x:hover { color: var(--blood); }

/* ── Reveal screen (final) ───────────────────────────── */
.reveal {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  width: 100%;
  max-width: 560px;
}
.reveal-card {
  overflow: hidden;
  animation: reveal-in 0.7s cubic-bezier(.2,.8,.3,1) both;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,0.3), transparent 50%),
    linear-gradient(135deg, var(--parchment) 0%, var(--parchment-warm) 100%);
  border: 3px double var(--parchment-edge);
  border-radius: var(--r-md);
  padding: 28px 24px;
  width: 100%;
  position: relative;
  box-shadow:
    inset 0 0 60px rgba(160,134,84,0.25),
    0 0 32px rgba(241,200,75,0.2),
    0 12px 32px rgba(0,0,0,0.6);
}
.reveal-kicker {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--brown-bark);
  letter-spacing: 0.18em;
  text-align: center;
  margin-bottom: 6px;
}
.reveal-rule {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--parchment-edge), transparent);
  margin: 8px auto 14px;
  max-width: 80%;
}
.reveal-name {
  font-family: 'MedievalSharp', serif;
  font-size: clamp(28px, 5vw, 38px);
  color: var(--ink);
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.15;
}
.reveal-desc {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--ink-mid);
  font-size: 20px;
  line-height: 1.45;
  text-align: center;
}

.sigil {
  width: 36px; height: 36px;
  margin: 0 auto 8px;
  display: block;
  opacity: 0.6;
}

.reveal-card:nth-child(2) { animation-delay: 0.35s; }
.reveal-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,236,170,0.55) 48%, rgba(255,255,255,0.75) 50%, rgba(255,236,170,0.55) 52%, transparent 70%);
  transform: translateX(-120%);
  animation: gold-shimmer 1.4s ease-out 0.7s both;
  pointer-events: none;
}
.reveal-card:nth-child(2)::after { animation-delay: 1.05s; }
@keyframes reveal-in {
  0%   { opacity: 0; transform: translateY(36px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes gold-shimmer {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

/* ── Lights up reveal (pre-main UI) ──────────────────── */
.lights-up {
  animation: lights-up 1.5s ease both;
}
@keyframes lights-up {
  0%   { background: #000; }
  100% { background: transparent; }
}

/* ── Toast ───────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: linear-gradient(180deg, var(--blood), #4a0f0f);
  color: var(--parchment);
  padding: 12px 22px;
  border: 2px solid var(--gold);
  border-radius: var(--r-sm);
  font-family: 'MedievalSharp', serif;
  font-size: 17px;
  z-index: 200;
  transition: transform 0.4s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Footer footnote ─────────────────────────────────── */
.footnote {
  font-family: 'IM Fell English', serif;
  font-size: 15px;
  color: var(--brown-tan);
  opacity: 0.7;
  text-align: center;
  margin-top: 20px;
  font-style: italic;
}

/* ── Reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .gandalf svg .g-lids { animation: none; transform: scaleY(0); }
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 520px) {
  #app { padding: 16px 12px; }
  .screen { gap: 18px; }
  .gandalf-stage { width: 170px; height: 200px; }
  .speech { font-size: 19px; padding: 14px 18px; max-width: 100%; }
  .h-pixel { font-size: 14px; }
  .body-text { font-size: 19px; }
  .card { padding: 26px 18px; }
  .card-name { font-size: 27px; }
  .card-desc { font-size: 19px; }
  .card-stack { min-height: 230px; }
  .input { font-size: 22px; padding: 13px 14px; max-width: 100%; }
  .btn { padding: 13px 22px; font-size: 17px; }
  .btn--ghost { font-size: 16px; padding: 11px 16px; }
  .actions { gap: 10px; }
  .modal { padding: 26px 18px; max-height: 86dvh; }
  .modal h2 { font-size: 26px; }
  .modal p, .modal li { font-size: 18px; }
  .modal-row { flex-direction: column; gap: 2px; margin: 10px 0; }
  .modal-row .label { width: auto; }
  .modal-row .value { font-size: 19px; }
  .reveal-desc { font-size: 19px; }
  .counter { font-size: 11px; }
  .cine-line { font-size: clamp(20px, 5.5vw, 28px); }
  .footnote { font-size: 14px; }
}

/* very small phones */
@media (max-width: 360px) {
  .gandalf-stage { width: 145px; height: 172px; }
  .speech { font-size: 17px; }
  .card-name { font-size: 24px; }
  .btn { padding: 12px 18px; font-size: 16px; }
}

/* short landscape phones: shrink Gandalf so the form stays on screen */
@media (max-height: 600px) and (orientation: landscape) {
  .gandalf-stage { width: 120px; height: 145px; }
  .screen { gap: 12px; }
}
