/* ==========================================================================
   HR DEPARTMENT FOR MAGICAL VILLAINS — APP STYLESHEET
   Aesthetic: Cozy Dark Academia & Holiday Midnight Mediation (Floor XIII)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Variables
   -------------------------------------------------------------------------- */
:root {
  --pine: #1B3B2B;
  --pine-dark: #0e2218;
  --pine-light: #28543e;
  --burgundy: #4A0E17;
  --burgundy-light: #721826;
  --burgundy-dark: #2a050b;
  --espresso: #231709;
  --espresso-dark: #140d05;
  --gold: #D4AF37;
  --gold-light: #efd275;
  --gold-dark: #997a15;
  --parchment: #F5EBE6;
  --parchment-2: #ead8ce;
  --parchment-3: #d5b9aa;
  --ink: #231709;
  --ink-soft: #5c4230;
  --ink-muted: #836754;

  /* Elevation Shadows */
  --shadow-sm: 0 2px 6px rgba(14, 34, 24, 0.4);
  --shadow-md: 0 6px 18px rgba(14, 34, 24, 0.55);
  --shadow-lg: 0 14px 38px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 0 16px rgba(212, 175, 55, 0.35);

  /* Typography */
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-script: 'Caveat', cursive, Georgia;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* --------------------------------------------------------------------------
   2. Reset & Global Layout
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--pine-dark);
  color: var(--parchment);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation;
}

a {
  color: var(--gold-light);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. Ambient Falling Snow Background
   -------------------------------------------------------------------------- */
#snow-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 450; /* over the page and the prologue, under modals and the elevator */
}

#snow-bg canvas {
  display: block;
}

/* Fullscreen Particle FX Canvas */
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* Main App Shell */
#app {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3.5rem;
}

/* --------------------------------------------------------------------------
   4. Responsive Topbar (Floor XIII Navigation & Meters)
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 60px;
  padding: 0.5rem 1.25rem;
  background: rgba(14, 34, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.topbar.topbar-minimal {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}

.topbar-left, .topbar-center, .topbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.topbar-logo-emblem {
  width: 36px;
  height: 36px;
  object-fit: cover;
  display: block;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.45);
  flex-shrink: 0;
}

.brand-badge {
  background: var(--burgundy);
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold);
  letter-spacing: 0.5px;
}

.brand-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--parchment);
  letter-spacing: 0.5px;
}

/* Compact Responsive Meters */
.topbar-meters {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mini-meter {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(27, 59, 43, 0.6);
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.meter-ico {
  font-size: 0.95rem;
  line-height: 1;
}

.meter-track {
  width: 44px;
  height: 6px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.meter-warmth .meter-fill { background: #e07a5f; }
.meter-order .meter-fill { background: #81b29a; }
.meter-spirit .meter-fill { background: #f2cc8f; }

.meter-num {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--parchment);
  min-width: 18px;
  text-align: right;
}

/* Midnight Clock Badge */
.topbar-clock {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--burgundy-dark);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.875rem;
}

/* Topbar Icon Buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: var(--parchment);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  transition: all 0.2s ease;
}

.btn-icon:hover, .btn-icon:focus-visible {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.btn-icon svg.ico {
  width: 20px;
  height: 20px;
}

/* --------------------------------------------------------------------------
   5. Buttons & Global UI Primitives
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.btn svg.ico {
  width: 19px;
  height: 19px;
}

.btn-large {
  padding: 0.95rem 1.85rem;
  font-size: 1.15rem;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-dark));
  color: var(--espresso-dark);
  border: 1px solid var(--gold-light);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

.btn-gold:hover, .btn-gold:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold), var(--shadow-md);
  filter: brightness(1.08);
}

.btn-burgundy {
  background: linear-gradient(135deg, var(--burgundy-light), var(--burgundy), var(--burgundy-dark));
  color: var(--parchment);
  border: 1px solid var(--gold);
}

.btn-burgundy:hover, .btn-burgundy:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.1);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--parchment);
  border: 1px solid rgba(212, 175, 55, 0.35);
}

.btn-ghost:hover, .btn-ghost:focus-visible {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-danger {
  background: #721826;
  color: #fff;
  border: 1px solid #f87171;
  padding: 0.65rem 1.1rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(0.6);
}

.btn-pulse {
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }
  50% { box-shadow: 0 0 24px rgba(212, 175, 55, 0.7); }
}

/* Toast Pill */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--espresso);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: center;
  max-width: 90vw;
}

#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   6. Cinematic Prologue (full-screen art, slow push-in, captions over the picture)
   -------------------------------------------------------------------------- */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 400;
  overflow: hidden;
  background: #0b0704;
  color: var(--parchment);
}

.intro-stage,
.intro-layer {
  position: absolute;
  inset: 0;
}

.intro-layer {
  animation: introLayerIn 1.1s ease-out both;
}

.intro-layer-out {
  animation: introLayerOut 1.1s ease-in forwards;
}

@keyframes introLayerIn { from { opacity: 0; } }
@keyframes introLayerOut { to { opacity: 0; } }

.intro-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  transform-origin: 50% 45%;
  animation: introPushIn 14s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

/* Slowly walking toward the HR office */
@keyframes introPushIn {
  from { transform: scale(1.02); }
  to { transform: scale(1.2); }
}

/* Thin cinema bars */
.intro-letterbox {
  position: absolute;
  left: 0;
  right: 0;
  height: 5vh;
  background: #000;
  z-index: 3;
  animation: introBars 1.2s ease-out both;
}

.intro-letterbox-top { top: 0; }
.intro-letterbox-bottom { bottom: 0; }

@keyframes introBars { from { height: 0; } }

/* Darkens the lower part so captions read on any picture */
.intro-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(0deg, rgba(8, 5, 2, 0.94) 0%, rgba(8, 5, 2, 0.72) 30%, rgba(8, 5, 2, 0.15) 58%, transparent 75%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
}

.intro-skip-btn {
  position: absolute;
  top: calc(5vh + 10px + env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 6;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 235, 230, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: var(--parchment);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.8;
  backdrop-filter: blur(4px);
}

.intro-skip-btn:hover,
.intro-skip-btn:focus-visible {
  opacity: 1;
  border-color: var(--gold);
}

.intro-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(5vh + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left, 0px)) 1.5rem max(20px, env(safe-area-inset-right, 0px));
  text-align: center;
}

.intro-kicker {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.intro-act-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.08;
  color: #fff8ec;
  text-wrap: balance;
  margin: 0;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.8);
}

.intro-act-text {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--parchment);
  margin: 0.2rem auto 0;
  max-width: 62ch;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.intro-kicker.intro-in { animation: introRise 0.8s ease-out 0.15s both; }
.intro-act-title.intro-in { animation: introRise 0.9s ease-out 0.3s both; }
.intro-act-text.intro-in .intro-sentence { animation: introRise 0.9s ease-out var(--d) both; }

.intro-sentence {
  display: inline;
}

@keyframes introRise {
  from { opacity: 0; transform: translateY(14px); filter: blur(3px); }
}

.intro-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.intro-step-indicator {
  display: flex;
  gap: 0.5rem;
}

.intro-step-indicator .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.intro-step-indicator .dot.active {
  background: var(--gold);
  width: 26px;
  border-radius: var(--radius-full);
}

/* Double doors (Act 3): the painted doors split down the middle and swing open onto the desk */
.intro-doors-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  perspective: 1400px;
}

.intro-doors-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.door-leaf {
  flex: 1;
  height: 100%;
  background-image: url('../assets/img/ui/intro-3.webp');
  background-size: 200% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  transition: transform 1.25s cubic-bezier(0.25, 1, 0.5, 1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.door-left {
  transform-origin: left center;
  background-position: left center;
}

.door-right {
  transform-origin: right center;
  background-position: right center;
}

.intro-doors-overlay.open .door-left { transform: rotateY(-105deg); }
.intro-doors-overlay.open .door-right { transform: rotateY(105deg); }

.intro-entering .intro-caption,
.intro-entering .intro-skip-btn {
  transition: opacity 0.5s ease;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .intro-bg-img,
  .intro-layer,
  .intro-letterbox,
  .intro-kicker.intro-in,
  .intro-act-title.intro-in,
  .intro-act-text.intro-in .intro-sentence {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   7. Title & Registry Screens
   -------------------------------------------------------------------------- */
.title-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
  padding: 1rem 0;
}

.title-hero-wrap {
  width: 100%;
  max-width: 860px;
  aspect-ratio: 1376 / 768;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  background: #140d06;
  position: relative;
}

.title-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.title-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  background: #1B3B2B;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.72), 0 0 28px rgba(212, 175, 55, 0.45);
  margin-top: -4.2rem;
  margin-bottom: 0.35rem;
  z-index: 6;
  position: relative;
}

.title-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.title-content {
  max-width: 680px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.title-badge {
  background: var(--burgundy);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.title-main {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  line-height: 1.15;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.title-sub {
  font-size: 1.15rem;
  color: var(--parchment-2);
  font-weight: 600;
}

.title-tagline {
  font-size: 0.95rem;
  color: var(--parchment-3);
  font-style: italic;
  max-width: 540px;
}

.title-button-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
}

.title-secondary-row {
  display: flex;
  gap: 0.75rem;
}

.title-lang-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.lang-pill {
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--parchment);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.lang-pill.active {
  background: var(--gold);
  color: var(--espresso);
  border-color: var(--gold-light);
}

/* Registry Screen */
.registry-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
}

.registry-card {
  width: 100%;
  max-width: 580px;
  background: var(--parchment);
  color: var(--ink);
  border: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.registry-badge {
  background: var(--burgundy);
  color: var(--gold-light);
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-full);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
}

.registry-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--burgundy);
  line-height: 1.2;
}

.registry-sub {
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 440px;
}

.registry-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  text-align: left;
  color: var(--ink);
}

.form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--parchment-3);
  background: #fff;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.25);
}

/* --------------------------------------------------------------------------
   8. Desk Hub Screen (10 Folders Grid & Countdown)
   -------------------------------------------------------------------------- */
.desk-screen {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.desk-hero-card {
  background: linear-gradient(135deg, rgba(35, 23, 9, 0.9), rgba(14, 34, 24, 0.95));
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.scene-banner-frame {
  width: 100%;
  aspect-ratio: 1376 / 768;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid rgba(212, 175, 55, 0.65);
  box-shadow: var(--shadow-md);
  background: #140d06;
  position: relative;
}

.scene-banner-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.desk-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.desk-badge {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.desk-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  color: var(--gold-light);
  line-height: 1.2;
}

.desk-sub {
  color: var(--parchment-2);
  font-size: 1rem;
  max-width: 520px;
}

.desk-clock-card {
  background: var(--burgundy-dark);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.4rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.clock-time-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-light);
}

.clock-badge {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--parchment);
}

/* 10 Folders Grid */
.desk-folders-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-heading {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold-light);
}

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

.folder-card {
  position: relative;
  background: linear-gradient(135deg, var(--burgundy), #32070e);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  padding: 1.2rem 1rem 1rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
}

.folder-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 12px rgba(212, 175, 55, 0.3);
  border-color: var(--gold);
}

/* Folder Top Tab */
.folder-tab {
  position: absolute;
  top: -12px;
  left: 14px;
  background: var(--gold);
  color: var(--espresso);
  padding: 0.15rem 0.6rem;
  border-radius: 4px 4px 0 0;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.3);
}

.folder-tab svg.ico {
  width: 12px;
  height: 12px;
}

.folder-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.folder-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.folder-villain-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--parchment);
}

.folder-dept {
  font-size: 0.875rem;
  color: var(--parchment-3);
  line-height: 1.3;
}

.folder-status-row {
  margin-top: 0.6rem;
}

.folder-status-pill {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--parchment-2);
}

.folder-card.status-active {
  border-color: var(--gold-light);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

.folder-card.status-active .folder-status-pill {
  background: var(--gold);
  color: var(--espresso);
}

.folder-card.folder-locked {
  filter: grayscale(0.7) opacity(0.75);
  cursor: not-allowed;
}

.folder-card.folder-locked .folder-tab {
  background: #555;
  color: #ddd;
}

/* Mini Stamp Badge on Folder */
.stamp-badge-mini {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  border: 1px solid currentColor;
}

.stamp-type-approve {
  color: #86efac;
  background: rgba(40, 84, 62, 0.5);
  border-color: #4ade80;
}

.stamp-type-special {
  color: #efd275;
  background: rgba(153, 122, 21, 0.4);
  border-color: #D4AF37;
}

.stamp-type-deny {
  color: #fca5a5;
  background: rgba(114, 24, 38, 0.5);
  border-color: #ef4444;
}

/* --------------------------------------------------------------------------
   9. Turn Stepper Navigation Bar
   -------------------------------------------------------------------------- */
.turn-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(27, 59, 43, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.6rem;
  margin-bottom: 1.5rem;
  gap: 0.3rem;
  overflow-x: auto;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--parchment-3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.stepper-item .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.stepper-item.active {
  background: var(--gold);
  color: var(--espresso);
}

.stepper-item.active .step-num {
  background: var(--espresso);
  color: var(--gold-light);
}

.stepper-item.completed {
  color: var(--gold-light);
}

.stepper-item.completed .step-num {
  background: var(--pine-light);
  color: #86efac;
}

/* --------------------------------------------------------------------------
   10. Step 0: Dossier & Attached Evidence
   -------------------------------------------------------------------------- */
.case-file-dossier {
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.dossier-header {
  border-bottom: 2px dashed var(--parchment-3);
  padding-bottom: 1rem;
}

.dossier-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.dossier-tag {
  background: var(--burgundy);
  color: var(--gold-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.875rem;
}

.dossier-dept {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.dossier-villain-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  color: var(--burgundy);
}

.dossier-main-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.dossier-portrait-wrap {
  width: min(100%, 340px);
  aspect-ratio: 4 / 3;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: var(--shadow-md);
  background: #140d06;
  position: relative;
}

.dossier-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dossier-complaint-box {
  background: #fff;
  border: 1px solid var(--parchment-3);
  border-left: 4px solid var(--burgundy);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.complaint-kicker {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--burgundy);
  margin-bottom: 0.5rem;
}

.complaint-text {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.6;
}

/* Attached Evidence Cards with CSS Metal Paperclip */
.dossier-evidence-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.evidence-section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--burgundy);
}

.evidence-hint {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.evidence-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
  margin-top: 0.5rem;
}

.evidence-thumb-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--parchment-3);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.evidence-thumb-card:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.evidence-thumb-card:nth-child(even) {
  transform: rotate(1.5deg);
}

.evidence-thumb-card:hover {
  transform: rotate(0) translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

/* Gold Paperclip Top Deco */
.gold-paperclip-top {
  position: absolute;
  top: -12px;
  right: 28px;
  width: 14px;
  height: 36px;
  border: 3px solid var(--gold);
  border-radius: 8px;
  background: transparent;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 5;
}

.evidence-thumb-art {
  width: 100%;
  aspect-ratio: 688 / 768;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #140d06;
  position: relative;
}

.evidence-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.evidence-thumb-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.evidence-thumb-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink);
}

.evidence-status-tag {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--burgundy);
}

.evidence-thumb-card.inspected .evidence-status-tag {
  color: var(--pine);
}

.dossier-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 2px dashed var(--parchment-3);
  padding-top: 1.2rem;
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   11. Step 1: Beverage Cart (Interactive SVG Cup & Brewing)
   -------------------------------------------------------------------------- */
.beverage-cart-view {
  background: linear-gradient(135deg, rgba(35, 23, 9, 0.95), rgba(27, 59, 43, 0.95));
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.cart-header {
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 1rem;
}

.cart-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cart-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--gold-light);
}

.cart-sub {
  color: var(--parchment-2);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

/* Central Cup Stage */
.interactive-cup-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.interactive-cup-wrap {
  width: 220px;
  height: 190px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.6));
}

.interactive-cup-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Steam Wisps Animation */
.steam-wisp {
  opacity: 0.7;
  animation: steamRise 3.2s ease-in-out infinite;
}

.steam-wisp-1 { animation-delay: 0s; }
.steam-wisp-2 { animation-delay: 0.9s; }
.steam-wisp-3 { animation-delay: 1.7s; }

@keyframes steamRise {
  0% { transform: translateY(0) scaleX(1); opacity: 0; }
  40% { opacity: 0.8; }
  100% { transform: translateY(-24px) scaleX(1.4); opacity: 0; }
}

.villain-reaction-bubble {
  max-width: 480px;
  background: var(--parchment);
  color: var(--ink);
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--gold);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
  display: none;
}

.villain-reaction-bubble.hint, .villain-reaction-bubble.success {
  display: block;
  animation: fadeInPop 0.3s ease;
}

.villain-reaction-bubble.success {
  background: #ecfdf5;
  border-color: #34d399;
  color: #064e3b;
  font-weight: 600;
}

@keyframes fadeInPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Selector Grids */
.beverage-selectors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}

.selector-group-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--gold-light);
  margin-bottom: 0.6rem;
}

.options-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  text-align: left;
  transition: all 0.2s ease;
}

.option-card:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold);
  transform: translateX(3px);
}

.option-card.selected {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold-light);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.option-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.option-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--parchment);
}

.option-desc {
  font-size: 0.875rem;
  color: var(--parchment-3);
  line-height: 1.3;
}

.cart-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  padding-top: 1.2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.solved-banner {
  background: rgba(40, 84, 62, 0.6);
  border: 1px solid #4ade80;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
}

.solved-badge {
  color: #86efac;
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   12. Step 2: Confession Scene (16:9 & Hidden Truth)
   -------------------------------------------------------------------------- */
.confession-view {
  background: var(--espresso);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.confession-kicker {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.confession-villain {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--gold-light);
}

.confession-scene-box {
  width: 100%;
  aspect-ratio: 1376 / 768;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: var(--shadow-md);
  background: #140d06;
  position: relative;
}

.confession-scene-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.confession-contrast-box {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.crossed-excuse-block {
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid #f87171;
  padding: 0.9rem 1.2rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.block-label {
  font-size: 0.875rem;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

.excuse-strikethrough-line {
  color: var(--parchment-3);
  text-decoration: line-through;
  text-decoration-color: #ef4444;
  font-style: italic;
  font-size: 1.05rem;
}

.hidden-truth-block {
  background: rgba(27, 59, 43, 0.7);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.block-label-gold {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  color: var(--gold-light);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.confession-quote {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #efd275;
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

.confession-narrative-text {
  font-size: 1.05rem;
  color: var(--parchment);
  line-height: 1.6;
}

.confession-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  padding-top: 1.2rem;
}

/* --------------------------------------------------------------------------
   13. Step 3: Rubber Stamp Workshop
   -------------------------------------------------------------------------- */
.stamp-step-view {
  background: linear-gradient(135deg, rgba(35, 23, 9, 0.95), rgba(74, 14, 23, 0.9));
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.stamp-main-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--gold-light);
}

.stamp-main-sub {
  color: var(--parchment-2);
  font-size: 0.95rem;
}

.stamp-paper-surface {
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--parchment-3);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
}

.paper-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--parchment-3);
  padding-bottom: 0.6rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.rubber-stamp-target-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  border: 2px dashed rgba(74, 14, 23, 0.25);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.4);
}

.target-placeholder {
  color: var(--ink-muted);
  font-style: italic;
  font-size: 0.95rem;
}

/* Realistic Slanted Rubber Stamp Impression */
.rubber-stamp-impression {
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: rotate(-3.5deg);
  user-select: none;
}

.stamp-inner-border {
  border: 3px double currentColor;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stamp-kicker {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.stamp-verdict {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.stamp-date-tag {
  font-size: 0.65rem;
  font-weight: 700;
}

.impression-approve {
  color: #1b5e20;
  background: rgba(76, 175, 80, 0.08);
}

.impression-special {
  color: #b78103;
  background: rgba(212, 175, 55, 0.12);
}

.impression-deny {
  color: #721826;
  background: rgba(239, 68, 68, 0.08);
}

.stamp-slam-anim {
  animation: stampSlam 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes stampSlam {
  0% { transform: scale(1.6) rotate(-15deg); opacity: 0; }
  100% { transform: scale(1) rotate(-3.5deg); opacity: 1; }
}

/* Rubber Stamp Buttons */
.rubber-stamps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.rubber-stamp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(212, 175, 55, 0.3);
}

.stamp-btn-handle {
  width: 22px;
  height: 28px;
  background: linear-gradient(to right, #4a2c11, #805022, #4a2c11);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.stamp-btn-head {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.5rem;
  margin-top: -2px;
  border: 1px solid currentColor;
}

.stamp-btn-approve .stamp-btn-head {
  background: #1B3B2B;
  color: #86efac;
}

.stamp-btn-special .stamp-btn-head {
  background: #4A0E17;
  color: #efd275;
}

.stamp-btn-deny .stamp-btn-head {
  background: #3b080e;
  color: #fca5a5;
}

.stamp-btn-icon {
  font-size: 1.3rem;
  font-weight: 900;
}

.stamp-btn-label {
  font-family: var(--font-serif);
  font-size: 1rem;
  margin: 0.2rem 0;
}

.stamp-btn-effect {
  font-size: 0.875rem;
  opacity: 0.85;
}

.rubber-stamp-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.rubber-stamp-btn.selected {
  border-color: var(--gold-light);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.5);
  transform: scale(1.02);
}

.stamp-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  padding-top: 1.2rem;
}

/* --------------------------------------------------------------------------
   14. Step 4: HR Confidential Logbook
   -------------------------------------------------------------------------- */
.logbook-step-view {
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.logbook-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--burgundy);
}

.logbook-sub {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.logbook-mode-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--parchment-3);
  padding-bottom: 0.5rem;
}

.tab-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--burgundy);
  color: var(--gold-light);
}

.logbook-prompt-box {
  background: #fff;
  border: 1px solid var(--parchment-3);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.prompt-badge {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--burgundy);
  letter-spacing: 0.5px;
}

.prompt-body-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.5;
}

.die-roll-btn {
  align-self: flex-start;
  margin-top: 0.4rem;
}

.logbook-mood-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mood-label-kicker {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.mood-chip {
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: #fff;
  border: 1px solid var(--parchment-3);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.2s ease;
}

.mood-chip:hover {
  border-color: var(--gold);
}

.mood-chip.active {
  background: var(--pine);
  color: #fff;
  border-color: var(--pine-light);
}

.logbook-textarea-wrap {
  position: relative;
  width: 100%;
}

.logbook-textarea {
  width: 100%;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--parchment-3);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 140px;
  transition: all 0.2s ease;
}

.logbook-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
}

.logbook-word-count {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 0.875rem;
  color: var(--ink-muted);
  pointer-events: none;
}

.logbook-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 2px dashed var(--parchment-3);
  padding-top: 1.2rem;
}

/* --------------------------------------------------------------------------
   15. Ending Screen (Finale & Upsell Hooks)
   -------------------------------------------------------------------------- */
.ending-screen {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem 0 3rem;
}

.ending-topbar {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ending-kicker-badge {
  background: var(--burgundy);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.ending-screen-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--gold-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.ending-screen-sub {
  color: var(--parchment-2);
  font-size: 1.05rem;
  max-width: 600px;
}

.ending-dual-tabs {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
}

.ending-dual-tabs .tab-pill {
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--parchment);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.ending-dual-tabs .tab-pill.active {
  background: var(--gold);
  color: var(--espresso);
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}

.ending-display-card {
  background: linear-gradient(135deg, rgba(35, 23, 9, 0.95), rgba(74, 14, 23, 0.9));
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  display: flex;
  flex-direction: column;
}

.ending-art-wrap {
  width: 100%;
  aspect-ratio: 1376 / 768;
  background: #140d06;
  position: relative;
  overflow: hidden;
}

.ending-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ending-content-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ending-badge-tag {
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.ending-title-text {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  color: var(--gold-light);
  line-height: 1.2;
}

.ending-rank-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: #86efac;
}

.ending-summary-p {
  font-size: 1.05rem;
  color: var(--parchment);
  line-height: 1.6;
}

.ending-syndicate-letter {
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.letter-crest {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 1.8rem;
}

.letter-header {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--burgundy);
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.letter-body-text {
  font-family: var(--font-script);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}

/* Ending Meters Summary */
.ending-meters-summary {
  background: rgba(27, 59, 43, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.8rem;
}

.summary-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--gold-light);
  margin-bottom: 0.8rem;
}

.meters-chips-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.meter-chip {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.chip-icon {
  font-size: 1.8rem;
}

.chip-label {
  display: block;
  font-size: 0.875rem;
  color: var(--parchment-3);
}

.chip-val {
  font-size: 1.15rem;
  color: var(--gold-light);
}

/* 3 Viral & Funnel Action Buttons */
.ending-actions-block {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: center;
  text-align: center;
}

.actions-block-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold-light);
}

.action-buttons-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  max-width: 580px;
}

.ending-foot-actions {
  margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   16. Modals (Lightbox, Certificate, Bonus Wax Envelope, Settings)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(14, 34, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--pine-dark);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-lg), var(--shadow-gold);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 0.8rem;
}

.modal-heading {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold-light);
}

.modal-subtext {
  font-size: 0.875rem;
  color: var(--parchment-3);
}

.modal-kicker {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.modal-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  border-top: 1px solid rgba(212, 175, 55, 0.3);
  padding-top: 0.8rem;
}

/* 9:16 Certificate Modal */
.cert-modal-card {
  max-width: 520px;
}

.cert-canvas-wrap {
  width: 100%;
  max-height: 480px;
  display: flex;
  justify-content: center;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gold);
}

.cert-canvas {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
}

.cert-controls {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cert-name-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold);
  background: var(--espresso);
  color: var(--gold-light);
  font-weight: 700;
}

.cert-stamp-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cert-stamp-selector .chip {
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--parchment);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.cert-stamp-selector .chip.active {
  background: var(--gold);
  color: var(--espresso);
}

.cert-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

/* Bonus Wax Envelope Modal (Upsell) */
.bonus-modal-card {
  max-width: 500px;
}

.envelope-container {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.wax-envelope {
  width: 100%;
  max-width: 420px;
  position: relative;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  perspective: 800px;
}

.envelope-front {
  background: linear-gradient(135deg, var(--burgundy), #32070e);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  position: relative;
  z-index: 2;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wax-envelope.open .envelope-front {
  opacity: 0.15;
  transform: translateY(120px) scale(0.9);
  pointer-events: none;
}

.envelope-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.wax-seal-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, #8b1828, #4A0E17 75%, #2a050b);
  border: 3px solid var(--gold);
  box-shadow: 0 4px 12px rgba(0,0,0,0.6), var(--shadow-gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-weight: 800;
  transition: transform 0.2s ease;
}

.wax-seal-btn:hover {
  transform: scale(1.08);
}

.seal-star {
  font-size: 1.2rem;
}

.seal-text {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
}

.tap-hint {
  font-size: 0.875rem;
  color: var(--parchment-2);
  font-style: italic;
}

/* Inside Letter Card that Slides Up */
.envelope-letter {
  display: none;
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  z-index: 5;
  animation: slideLetterUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.wax-envelope.open .envelope-letter {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@keyframes slideLetterUp {
  0% { transform: translateY(60px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.letter-badge {
  background: var(--burgundy);
  color: var(--gold-light);
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-full);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
  align-self: center;
}

.letter-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--burgundy);
}

.letter-body {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.coupon-box {
  background: #fff;
  border: 2px dashed var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.coupon-label {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--burgundy);
  letter-spacing: 1px;
}

.coupon-code-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.coupon-code {
  font-family: monospace;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--espresso);
  background: #fff1c4;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

/* Audio Popover & Settings Modal Content */
.audio-toggles-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.audio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.audio-row-info strong {
  display: block;
  font-size: 0.95rem;
  color: var(--parchment);
}

.audio-row-info .sub {
  font-size: 0.875rem;
  color: var(--parchment-3);
}

.toggle-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
  cursor: pointer;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.settings-section {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.settings-sec-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--gold-light);
}

.settings-lang-pills, .settings-data-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   17. Dossier Print Styles (@media print & Print View)
   -------------------------------------------------------------------------- */
.journal-dossier-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.journal-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ios-tip-box {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  color: var(--gold-light);
}

.dossier-document {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dossier-page {
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  break-inside: avoid;
}

.dossier-cover {
  text-align: center;
  padding: 4rem 2rem;
}

.cover-frame {
  border: 2px double var(--gold);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cover-badge {
  background: var(--burgundy);
  color: var(--gold-light);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 700;
}

.cover-kicker {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--burgundy);
  letter-spacing: 1px;
}

.cover-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  color: var(--burgundy);
  line-height: 1.15;
}

.cover-sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 520px;
}

.cover-divider {
  width: 140px;
  height: 3px;
  background: var(--gold);
  margin: 0.8rem 0;
}

.cover-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 1rem;
}

.meta-meters {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.meta-meters .pill {
  background: #fff;
  border: 1px solid var(--parchment-3);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
}

/* Case Entry Page in Dossier */
.case-entry-page {
  page-break-after: always;
}

.case-entry-header {
  border-bottom: 2px dashed var(--parchment-3);
  padding-bottom: 0.8rem;
}

.entry-num {
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--burgundy);
}

.entry-name {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--burgundy);
}

.entry-dept {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.case-entry-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.4rem;
  align-items: start;
}

.case-entry-stamp-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.stamp-impression {
  padding: 0.6rem 1.2rem;
  border: 3px double currentColor;
  border-radius: 4px;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.1rem;
  text-align: center;
  transform: rotate(-3deg);
}

.stamp-style-approve { color: #1b5e20; }
.stamp-style-special { color: #b78103; }
.stamp-style-deny { color: #721826; }

.stamp-date {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.truth-kicker, .prompt-kicker {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--burgundy);
  margin-bottom: 0.3rem;
}

.truth-text {
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.55;
}

.case-entry-reflection {
  background: #fff;
  border: 1px solid var(--parchment-3);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1.2rem;
}

.prompt-q {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--burgundy);
  margin-bottom: 0.8rem;
}

.reflection-written {
  font-family: var(--font-script);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   16b. Exhibit Lightbox Modal
   -------------------------------------------------------------------------- */
.modal-card.lightbox-card {
  max-width: 820px;
  background: var(--pine-dark);
  border: 2px solid var(--gold);
}

.lightbox-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.lightbox-art-wrap {
  width: 100%;
  aspect-ratio: 1376 / 768;
  max-height: 56vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--gold);
  background: #140d06;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-large-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-details {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: var(--parchment);
}

/* --------------------------------------------------------------------------
   16c. Image Viewer Modal & Zoom Corner Buttons
   -------------------------------------------------------------------------- */
.zoomable-frame {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

.zoom-corner-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(14, 34, 24, 0.88);
  border: 1px solid var(--gold);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), var(--shadow-gold);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  opacity: 0.92;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.zoom-corner-btn:hover, .zoom-corner-btn:focus-visible {
  opacity: 1;
  transform: scale(1.06);
  background: rgba(74, 14, 23, 0.95);
  border-color: var(--gold-light);
  color: #fff;
}

.img-viewer-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 16, 12, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.img-viewer-modal.visible {
  opacity: 1;
}

.img-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(14, 34, 24, 0.92);
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  z-index: 10;
}

.img-viewer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-light);
}

.img-viewer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.viewer-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--parchment);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.viewer-ctrl-btn:hover, .viewer-ctrl-btn:focus-visible {
  background: rgba(212, 175, 55, 0.25);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.viewer-close-btn {
  background: rgba(114, 24, 38, 0.9);
  border-color: #f87171;
  color: #fff;
}

.viewer-close-btn:hover {
  background: #a81c2f;
  border-color: #fff;
  color: #fff;
}

.img-viewer-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
}

.img-viewer-display {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 24px rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  will-change: transform;
  pointer-events: auto;
}

.img-viewer-caption {
  padding: 0.65rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--parchment-2);
  background: rgba(14, 34, 24, 0.92);
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  z-index: 10;
}

/* --------------------------------------------------------------------------
   16d. Beverage Cart Assist & Flow Buttons
   -------------------------------------------------------------------------- */
.step1-continue-btn,
.continue-confession-btn {
  margin-top: 1rem;
  padding: 0.85rem 1.8rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.45), var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.auto-prepare-btn {
  margin-top: 0.75rem;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: var(--radius-full);
  padding: 0.45rem 1rem;
  font-weight: 700;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.auto-prepare-btn:hover {
  background: var(--gold);
  color: var(--espresso);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

/* --------------------------------------------------------------------------
   16e. High Contrast Scoped Rules for Parchment & Light Surfaces (WCAG AAA)
   -------------------------------------------------------------------------- */
.case-file-dossier .btn-ghost,
.logbook-step-view .btn-ghost,
.logbook-prompt-box .btn-ghost,
.registry-card .btn-ghost,
.stamp-paper-surface .btn-ghost,
.ending-syndicate-letter .btn-ghost,
.envelope-letter .btn-ghost,
.coupon-box .btn-ghost,
.dossier-page .btn-ghost,
.lightbox-card .btn-ghost,
.revisit-modal-card .btn-ghost,
.villain-reaction-bubble .btn-ghost,
.journal-dossier-view .btn-ghost {
  background: rgba(74, 14, 23, 0.08);
  color: var(--burgundy);
  border: 1.5px solid rgba(74, 14, 23, 0.55);
  font-weight: 700;
}

.case-file-dossier .btn-ghost:hover,
.logbook-step-view .btn-ghost:hover,
.logbook-prompt-box .btn-ghost:hover,
.registry-card .btn-ghost:hover,
.stamp-paper-surface .btn-ghost:hover,
.ending-syndicate-letter .btn-ghost:hover,
.envelope-letter .btn-ghost:hover,
.coupon-box .btn-ghost:hover,
.dossier-page .btn-ghost:hover,
.lightbox-card .btn-ghost:hover,
.revisit-modal-card .btn-ghost:hover,
.villain-reaction-bubble .btn-ghost:hover,
.journal-dossier-view .btn-ghost:hover {
  background: var(--burgundy);
  color: #ffffff;
  border-color: var(--burgundy);
}

.case-file-dossier .lang-pill,
.registry-card .lang-pill,
.logbook-step-view .lang-pill,
.dossier-page .lang-pill {
  background: rgba(74, 14, 23, 0.08);
  color: var(--burgundy);
  border: 1.5px solid rgba(74, 14, 23, 0.4);
  font-weight: 700;
}

.case-file-dossier .lang-pill.active,
.registry-card .lang-pill.active,
.logbook-step-view .lang-pill.active,
.dossier-page .lang-pill.active {
  background: var(--burgundy);
  color: #ffffff;
  border-color: var(--burgundy);
}

.case-file-dossier .tab-btn,
.logbook-step-view .tab-btn {
  color: #231709;
  background: rgba(74, 14, 23, 0.06);
  border: 1.5px solid rgba(74, 14, 23, 0.25);
  font-weight: 700;
}

.case-file-dossier .tab-btn:hover,
.logbook-step-view .tab-btn:hover {
  background: rgba(74, 14, 23, 0.12);
  color: var(--burgundy);
  border-color: var(--burgundy);
}

.case-file-dossier .tab-btn.active,
.logbook-step-view .tab-btn.active {
  background: var(--burgundy);
  color: #ffffff;
  border-color: var(--burgundy);
}

.logbook-step-view .die-roll-btn {
  background: rgba(74, 14, 23, 0.09);
  color: var(--burgundy);
  border: 1.5px solid rgba(74, 14, 23, 0.45);
  font-weight: 700;
}

.logbook-step-view .die-roll-btn:hover {
  background: var(--burgundy);
  color: #ffffff;
}

.logbook-step-view .mood-chip {
  background: #ffffff;
  color: #231709;
  border: 1.5px solid rgba(74, 14, 23, 0.35);
  font-weight: 700;
}

.logbook-step-view .mood-chip.active {
  background: var(--burgundy);
  color: #ffffff;
  border-color: var(--burgundy);
}

.case-file-dossier .evidence-status-tag {
  color: var(--burgundy);
  font-weight: 800;
}

.case-file-dossier .evidence-thumb-card.inspected .evidence-status-tag {
  color: #14532d;
  font-weight: 800;
}

/* Print Rules */
@media print {
  @page {
    size: letter portrait;
    margin: 15mm;
  }

  body, html {
    background: #fff !important;
    color: #000 !important;
  }

  #snow-bg, #fx, .topbar, .no-print, .btn, .intro-skip-btn, #toast {
    display: none !important;
  }

  #screen {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .dossier-document {
    gap: 0 !important;
  }

  .dossier-page {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 20mm !important;
    page-break-after: always !important;
    break-inside: avoid !important;
  }

  .dossier-cover {
    height: 100vh !important;
  }
}

/* --------------------------------------------------------------------------
   18. Responsive Media Queries (Mobile 360px & Tablet)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  #screen {
    padding: 0.75rem 0.85rem 3rem;
  }

  .topbar {
    padding: 0.4rem 0.75rem;
  }

  .brand-title {
    display: none;
  }

  .dossier-main-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .dossier-portrait-wrap {
    max-width: 260px;
    width: 100%;
    aspect-ratio: 4 / 3;
    margin: 0 auto;
  }

  .beverage-selectors-grid {
    grid-template-columns: 1fr;
  }

  .case-entry-grid {
    grid-template-columns: 1fr;
  }

  .title-main {
    font-size: 2rem;
  }

  .folders-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  /* Two rows on phones: nav + buttons on top, meters + clock below, so settings never leave the screen */
  .topbar {
    flex-wrap: wrap;
    height: auto;
    row-gap: 0.35rem;
    padding: 0.4rem 0.75rem;
  }

  .topbar-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .topbar-meters {
    gap: 0.35rem;
  }

  .topbar-meters .meter-track {
    width: 36px;
  }

  .topbar-meters .meter-num {
    display: none;
  }

  .topbar-clock .clock-text {
    font-size: 0.875rem;
  }

  .dossier-villain-title, .registry-title, .title-main, .ending-screen-title {
    font-size: 1.7rem;
  }

  .folders-grid {
    grid-template-columns: 1fr;
  }

  .rubber-stamps-grid {
    grid-template-columns: 1fr;
  }

  .action-buttons-stack {
    max-width: 100%;
  }
}

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


  .intro-bg-img.ken-burns {
    animation: none !important;
  }

  .btn-pulse {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   Wellness clues (evidence → drink deduction)
   -------------------------------------------------------------------------- */
.evidence-clue-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(212, 175, 55, 0.12);
  border: 1px dashed var(--gold);
}

.clue-tag {
  align-self: flex-start;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: var(--burgundy-dark);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.clue-text {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

.cart-notes-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(14, 34, 24, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.cart-notes-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--gold-light);
  margin: 0;
}

.cart-notes-card .evidence-clue-card {
  margin-top: 0;
}

.clue-locked {
  font-size: 0.95rem;
  font-style: italic;
  opacity: 0.8;
  margin: 0;
}

.stamp-btn-deltas {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

/* Midnight roll call inside the ending letter */
.letter-body-text + .letter-body-text {
  margin-top: 0.75rem;
}

.roll-call {
  margin: 1.25rem 0;
  padding: 1rem 0;
  border-top: 1px dashed rgba(74, 14, 23, 0.35);
  border-bottom: 1px dashed rgba(74, 14, 23, 0.35);
}

.roll-call-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--burgundy);
  margin: 0 0 0.75rem;
}

.roll-call-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.roll-call-item {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.6rem;
  align-items: start;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
}

.roll-call-icon {
  font-size: 1.25rem;
  line-height: 1.3;
}

.roll-call-text {
  min-width: 0;
}

/* Very small phones (320px): tighter meters so the clock stays on screen */
@media (max-width: 360px) {
  .topbar-meters .meter-track {
    width: 22px;
  }

  .topbar-clock .clock-ico {
    display: none;
  }
}

/* The line each villain lets slip on the way out (thread toward Case #11) */
.confession-slip {
  margin-top: 1.25rem;
  padding: 0.9rem 1.1rem;
  border-left: 3px solid var(--gold);
  background: rgba(212, 175, 55, 0.08);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.slip-label {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-light);
  margin: 0 0 0.35rem;
}

.slip-text {
  font-family: var(--font-script);
  font-size: 1.35rem;
  line-height: 1.4;
  margin: 0;
}

/* Case File #11: the player's own folder, set apart in gold */
.folder-card-mediator {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.35), 0 0 24px rgba(212, 175, 55, 0.25);
}

.roll-call-mediator {
  margin-top: 0.4rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(74, 14, 23, 0.35);
  font-weight: 700;
}

/* Master volume slider in the ambience mixer */
.audio-volume-row {
  flex-wrap: wrap;
  gap: 0.6rem;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 200px;
  min-width: 0;
}

.volume-slider {
  flex: 1;
  min-width: 0;
  accent-color: var(--gold);
  height: 28px;
}

.volume-value {
  min-width: 3.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Phase 4 signature moments
   ========================================================================== */

/* --- Elevator arrival --- */
.elevator-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 50% 40%, rgba(27, 59, 43, 0.92), rgba(10, 18, 13, 0.97));
  cursor: pointer;
  animation: elevatorFadeIn 0.25s ease-out;
}

.elevator-overlay.elevator-leaving {
  animation: elevatorFadeOut 0.32s ease-in forwards;
}

.elevator-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  width: min(420px, 100%);
}

.elevator-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1.1rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--gold);
  background: #120b05;
  color: #ffb347;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 179, 71, 0.8);
}

.elevator-arrow {
  font-size: 1rem;
  animation: elevatorBlink 0.5s steps(2) infinite;
}

.elevator-car {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 62vh;
  border: 6px solid var(--gold);
  border-radius: 10px 10px 4px 4px;
  overflow: hidden;
  background: #231709;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.elevator-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.elevator-portrait {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 1.6s ease-out;
}

.elevator-open .elevator-portrait {
  transform: scale(1);
}

.elevator-caption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  background: rgba(14, 34, 24, 0.92);
  border-top: 2px solid var(--gold);
  text-align: center;
}

.elevator-case {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--gold-light);
}

.elevator-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--parchment);
}

.elevator-door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 14px),
    linear-gradient(180deg, #b8912b, #8a6a1c 55%, #6e5414);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}

.elevator-door-left { left: 0; border-right: 2px solid #4a3a0e; }
.elevator-door-right { right: 0; border-left: 2px solid #4a3a0e; }
.elevator-open .elevator-door-left { transform: translateX(-102%); }
.elevator-open .elevator-door-right { transform: translateX(102%); }

.elevator-skip {
  font-size: 0.95rem;
  color: var(--parchment);
  opacity: 0.75;
  margin: 0;
}

@keyframes elevatorFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes elevatorFadeOut { to { opacity: 0; } }
@keyframes elevatorBlink { 50% { opacity: 0.2; } }

/* --- Pour ritual & steam spirit --- */
.interactive-cup-wrap {
  position: relative;
}

.pour-stream {
  position: absolute;
  left: 50%;
  top: -60px;
  width: 9px;
  height: 0;
  margin-left: -4px;
  border-radius: 5px;
  background: linear-gradient(180deg, transparent, var(--pour) 30%);
  animation: pourStream 0.6s ease-in-out forwards;
  pointer-events: none;
}

@keyframes pourStream {
  0% { height: 0; opacity: 1; }
  45% { height: 105px; opacity: 1; }
  100% { height: 105px; top: 45px; opacity: 0; }
}

.cup-pouring {
  animation: cupWobble 0.6s ease-in-out;
}

@keyframes cupWobble {
  25% { transform: rotate(-2deg); }
  60% { transform: rotate(1.5deg); }
}

.steam-spirit {
  position: absolute;
  left: 50%;
  top: 0;
  font-size: 4.5rem;
  line-height: 1;
  pointer-events: none;
  filter: blur(1.5px) grayscale(0.6) brightness(1.8);
  opacity: 0;
  transform: translate(-50%, 10px) scale(0.6);
  animation: steamSpirit 2.5s ease-out forwards;
}

@keyframes steamSpirit {
  20% { opacity: 0.85; }
  70% { opacity: 0.6; filter: blur(2.5px) grayscale(0.6) brightness(1.9); }
  100% { opacity: 0; transform: translate(-50%, -120px) scale(1.25); filter: blur(6px) grayscale(0.6) brightness(2); }
}

/* --- Stamp slam --- */
.screen-shake {
  animation: screenShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes screenShake {
  15% { transform: translate(-5px, 3px); }
  30% { transform: translate(5px, -3px); }
  45% { transform: translate(-3px, 2px); }
  60% { transform: translate(3px, -1px); }
  80% { transform: translate(-1px, 1px); }
}

.rubber-stamp-target-area {
  position: relative;
}

.ink-splat {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50% 45% 55% 40%;
  transform: translate(var(--x), var(--y));
  opacity: 0.7;
  pointer-events: none;
}

.ink-approve { background: #1b5e20; }
.ink-special { background: #b78103; }
.ink-deny { background: #721826; }

.ink-fresh {
  animation: inkFly 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}

@keyframes inkFly {
  from { transform: translate(0, 0) scale(0.2); opacity: 1; }
}

/* --- Postcards --- */
.postcard-backdrop {
  align-items: center;
}

.postcard {
  position: relative;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem 1.4rem 1.3rem;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(74, 14, 23, 0.08) 31px 32px),
    var(--parchment);
  color: var(--ink);
  border-radius: 6px;
  border: 1px solid rgba(74, 14, 23, 0.25);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  transform: rotate(-2deg);
  animation: postcardIn 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

@keyframes postcardIn {
  from { transform: translateY(-60vh) rotate(-14deg); opacity: 0; }
}

.postcard-stamp-corner {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 3.2rem;
  height: 3.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 2px dashed var(--burgundy);
  background: rgba(212, 175, 55, 0.25);
  transform: rotate(4deg);
}

.postcard-kicker {
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--burgundy);
  padding-right: 4rem;
}

.postcard-from {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin: 0;
  padding-right: 4rem;
}

.postcard-text {
  font-family: var(--font-script);
  font-size: 1.55rem;
  line-height: 1.35;
  margin: 0;
}

.postcard-close {
  align-self: flex-end;
}

/* --- Midnight party scene --- */
.party-scene {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(14, 34, 24, 0.6);
}

.party-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-light);
  margin: 0;
  text-align: center;
}

.party-zones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.party-zone {
  padding: 1rem;
  border-radius: var(--radius-md);
  min-width: 0;
}

.party-zone-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--parchment);
  margin: 0 0 0.8rem;
}

.party-zone-special {
  background:
    radial-gradient(circle at 20% 0%, rgba(239, 210, 117, 0.35), transparent 55%),
    radial-gradient(circle at 85% 10%, rgba(224, 122, 95, 0.3), transparent 50%),
    rgba(74, 14, 23, 0.55);
  border: 1px solid var(--gold);
  animation: partyLights 4s ease-in-out infinite alternate;
}

@keyframes partyLights {
  to { filter: hue-rotate(-12deg) brightness(1.08); }
}

.party-zone-approve {
  background: rgba(27, 59, 43, 0.75);
  border: 1px solid rgba(129, 178, 154, 0.5);
}

.party-zone-deny {
  background: rgba(35, 23, 9, 0.75);
  border: 1px solid rgba(181, 200, 220, 0.4);
}

.party-guests {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 0.75rem;
}

.party-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  min-width: 0;
}

.party-guest-frame {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #231709;
  flex-shrink: 0;
}

.party-guest-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.party-zone-special .party-guest-frame {
  animation: partyBob 0.9s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.23s);
  box-shadow: 0 0 14px rgba(239, 210, 117, 0.6);
}

@keyframes partyBob {
  to { transform: translateY(-6px) rotate(3deg); }
}

.party-zone-approve .party-guest-frame {
  filter: saturate(0.85);
}

.party-zone-deny .party-guest-frame {
  border-radius: 8px;
  border-color: rgba(181, 200, 220, 0.8);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25);
  filter: saturate(0.6) brightness(0.9);
}

.party-guest-name {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--parchment);
  overflow-wrap: anywhere;
}

.party-guest-you .party-guest-frame {
  border-width: 3px;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.45);
}

.party-guest-you .party-guest-name {
  color: var(--gold-light);
}

@media (prefers-reduced-motion: reduce) {
  .party-zone-special,
  .party-zone-special .party-guest-frame,
  .postcard {
    animation: none !important;
  }
}

/* Meters are a button that explains them */
button.topbar-meters {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button.topbar-meters:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-full);
}

.meters-help-intro {
  font-size: 1rem;
  line-height: 1.55;
  margin: 0 0 1rem;
}

.meters-help-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.meters-help-row {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.6rem;
  align-items: start;
}

.meters-help-ico {
  font-size: 1.5rem;
  line-height: 1.2;
}

.meters-help-row p {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  line-height: 1.5;
}

/* Cart guidance */
.cart-howto {
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
}

.try-again-nudge {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold-light);
  text-align: center;
  margin: 0;
}

/* Locked steps stay tappable (they explain what unlocks them) */
.stepper-item.locked {
  cursor: help;
}

/* --- The reflection die: a real 3D cube that tumbles and lands on 1-6 --- */
.die-tray {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(74, 14, 23, 0.08);
  border: 1px dashed rgba(74, 14, 23, 0.3);
  flex-wrap: wrap;
}

.die-scene {
  width: 64px;
  height: 64px;
  perspective: 420px;
  flex-shrink: 0;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
}

.die-scene:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
  border-radius: 10px;
}

.die-cube {
  position: relative;
  width: 64px;
  height: 64px;
  transform-style: preserve-3d;
  transition: transform 1.25s cubic-bezier(0.2, 0.8, 0.25, 1.05);
}

.die-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 9px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fffaf0, #efe2c8);
  border: 2px solid #b8912b;
  box-shadow: inset 0 0 10px rgba(122, 90, 30, 0.25);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.die-pip {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9a2234, #4a0e17);
  align-self: center;
  justify-self: center;
}

.die-face-1 { transform: translateZ(32px); }
.die-face-6 { transform: rotateY(180deg) translateZ(32px); }
.die-face-3 { transform: rotateY(90deg) translateZ(32px); }
.die-face-4 { transform: rotateY(-90deg) translateZ(32px); }
.die-face-2 { transform: rotateX(90deg) translateZ(32px); }
.die-face-5 { transform: rotateX(-90deg) translateZ(32px); }

.die-rolling .die-cube {
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.35));
}

.die-copy {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 200px;
  min-width: 0;
}

.die-copy strong {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--burgundy);
}

.die-copy span {
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: 0.85;
}

.die-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--burgundy);
  color: var(--gold-light);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
  .die-cube { transition: none; }
}
