/* ═══════════════════════════════════════════════════════════════════════════
   refresh.css — BRIGHT UNIFICATION LAYER
   ---------------------------------------------------------------------------
   Load LAST, after style.css and cards.css:
     <link rel="stylesheet" href="/css/style.css">
     <link rel="stylesheet" href="/css/cards.css">
     <link rel="stylesheet" href="/css/refresh.css">   ← add this line

   PAINT-ONLY. This file changes only color / background / border / box-shadow /
   font / text-shadow. It does NOT touch width, max-width, overflow, position,
   display, flex, grid, or any sizing — so it cannot reintroduce layout or
   overflow problems. Delete the one <link> above to revert completely.

   Unified palette
     ink        #2a1a06   headings / primary text
     ink-hero   #1a0a00   the hero word
     ink-soft   #6b4a20   secondary text
     amber      #c07010   primary accent
     amber-lite #e8a020   button highlight
     amber-deep #8a4a00   button base shadow
     paper-card #fff8f0   cards on bright ground
     line       rgba(180,120,20,.22)
     mint       #1a6630   reserved ONLY for "saved / safe" moments
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. LANDING — sunrise video restored, legibility from soft halo ──────────
   The sunrise mp4 is the intended landing experience. To keep titles legible
   over changing sky tones without the harsh 1px white outline, we use a soft
   dark halo behind the light-on-dark words and a warm amber-tinted overlay
   to knock down the brightest highlights of the video. */

/* Warm-amber cream ground shows behind the video while it loads or where
   letterboxing may occur. */
#screen-landing {
  background: linear-gradient(165deg, #fdf4e3 0%, #f6ead0 55%, #eef3df 100%);
}

/* A darker overlay than the original — enough to lift the title without
   killing the sunrise. Uses ::after on the overlay div, which already exists
   in the DOM, so no HTML changes needed. */
#screen-landing .landing-video-overlay {
  background: linear-gradient(180deg,
    rgba(20,10,0,0.28) 0%,
    rgba(20,10,0,0.10) 45%,
    rgba(30,20,10,0.55) 100%);
}

/* Title colors: keep the ink-hero "Jews" as the dark focal word, and give
   the surrounding lighter words a soft dark halo for legibility. */
#screen-landing .landing-title            { color: #fff8e8; text-shadow: 0 2px 18px rgba(20,10,0,0.85), 0 0 4px rgba(20,10,0,0.6); }
#screen-landing .landing-title-secondary  { color: #f5deb0; text-shadow: 0 2px 14px rgba(20,10,0,0.75); }
#screen-landing .landing-title em         { color: #ffcc55; text-shadow: 0 2px 14px rgba(20,10,0,0.75); font-style: normal; }
/* "Jews" — bright cream on a warm shadow, the eye-catcher on the horizon. */
#screen-landing .landing-title-inverted   { color: #ffe8a0; text-shadow: 0 2px 22px rgba(20,10,0,0.9), 0 0 6px rgba(20,10,0,0.7); }

#screen-landing .privacy-notice {
  color: #f5deb0;
  background: rgba(20,10,0,0.35);
  border-color: rgba(255,220,150,0.28);
  text-shadow: 0 1px 6px rgba(20,10,0,0.7);
  backdrop-filter: blur(2px);
}

/* ── 2. BUTTONS — one amber primary everywhere ───────────────────────────────
   Some buttons were amber, others still gold. Unify the primary action. */
.btn-primary {
  background: linear-gradient(180deg, #e8a020 0%, #c07010 100%);
  color: #fff8e8;
  box-shadow: 0 4px 18px rgba(192,112,16,0.30);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: linear-gradient(180deg, #f5b030 0%, #d08020 100%);
  color: #fff8e8;
  box-shadow: 0 8px 26px rgba(192,112,16,0.40);
}
.btn-secondary {
  color: #a8651a;
  border-color: rgba(180,120,20,0.40);
}
.btn-secondary:hover {
  background: rgba(200,140,0,0.08);
  border-color: #c07010;
}

/* ── 3. ACCENT HARMONIZATION — retire leftover gold (#c9a84c) for amber ──────
   On the bright ground, the old manuscript-gold reads as muddy and low-contrast.
   These swaps are pure color. */
.progress-fill        { background: linear-gradient(90deg, #e8a020, #c07010); }
.tray-count           { background: #c07010; color: #fff8e8; }
.card-tray            { border-top-color: rgba(180,120,20,0.25); }
.end-stage-count      { background: #c07010; color: #fff8e8; }
.end-stage-arrow      { color: #a8651a; }
.end-stage-toggle:hover { background: rgba(192,112,16,0.14); }
.end-share-title      { color: #2a1a06; }

/* No-photo contributor placeholder — keep it on-palette on the bright card */
.screen-end-bright .figure-name-bubble { background: #f3e6c8; color: #a8651a; }
.screen-end-bright .figure-bubble-name { color: #6b4a20; }

/* ── 4. TAROT — tighten the flipped "risk" card to the approved look ──────────
   Front faces already match; this only firms up the accent edges. Card backs,
   sizing, and the 3-D flip are untouched. */
.tarot-front-risk {
  border-top-color: #c0392b;
}
.tarot-condition-name { color: #1a0a00; }
.tarot-target         { color: rgba(0,0,0,0.38); }
/* Saved / safe = the one place mint is allowed */
.tarot-front-safe,
.tarot-card.tarot-resolved .tarot-front-risk { border-top-color: #27ae60; }
.tarot-happy-text { color: #1a6630; }

/* ── 5. STAGE HEADERS — consistent eyebrow + serif title ink ─────────────────*/
.stage-eyebrow { color: #7a4a10; }
.stage-title   { color: #2a1a06; }
.stage-sub     { color: #6b4a20; }

/* ── 6. NEWSPAPER STAGE — width containment, button prominence ────────────────
   Fixes three observed problems:
   1. Article body clipping on the front page and modal (right edge cut off).
      Root cause: percentage widths + fixed padding overflow the flex container
      at some viewports. Enforce box-sizing and set safe max-width behavior.
   2. Blue "Make it Real" button clashes with the amber-primary palette.
      Repaint to amber with a bright halo so it still POPS off the faded article.
   3. Year tabs removed from stage4.js — hide their styles by omission (nothing
      here targets .np-year-tab, so they simply don't render).                  */

.np-wrap,
.np-paper,
.np-article,
.np-article-inner,
.np-modal-inner {
  box-sizing: border-box;
  max-width: 100%;
}

/* Give the paper room on all sides so text never runs to the edge. */
.np-paper { padding: 0 1rem !important; }

/* The article body element itself should never overflow its column. */
.np-article-inner {
  padding: 0.9rem 1rem 1rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Modal: proper interior padding + safe overflow behavior on any viewport. */
.np-modal {
  padding: 1.25rem 0.75rem 3rem;
}
.np-modal-inner {
  padding: 1.8rem 1.6rem 2.2rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.np-modal-columns {
  column-gap: 1.4rem;
}
.np-body {
  hyphens: auto;
  -webkit-hyphens: auto;
}
@media (max-width: 500px) {
  .np-modal-inner { padding: 1.2rem 1rem 1.6rem; }
  .np-modal-headline { font-size: 1.35rem !important; line-height: 1.15; }
}

/* "Make it Real" button — the primary call to action of the stage.
   Redesigned to match the amber palette and stand out clearly against
   the faded newspaper column. Full-width, tall, with a distinct shadow. */
.np-read-more {
  background: linear-gradient(180deg, #e8a020 0%, #c07010 100%) !important;
  color: #fff8e8 !important;
  border: none !important;
  padding: 12px 16px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 800 !important;
  font-style: normal !important;
  font-size: 1rem !important;
  letter-spacing: 0.02em !important;
  border-radius: 4px !important;
  box-shadow: 0 6px 22px rgba(192,112,16,0.45), 0 2px 6px rgba(192,112,16,0.25) !important;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s !important;
  margin-top: 0.9rem;
}
.np-read-more:hover,
.np-read-more:focus-visible {
  background: linear-gradient(180deg, #f5b030 0%, #d08020 100%) !important;
  box-shadow: 0 10px 30px rgba(192,112,16,0.55), 0 3px 8px rgba(192,112,16,0.30) !important;
  transform: translateY(-1px);
}
.np-read-more:active { transform: translateY(0); }

/* Saved state: mint (the "saved / safe" moment). */
.np-read-more-saved,
.np-read-more.np-read-more-saved {
  background: linear-gradient(180deg, #3aaa60 0%, #1a6630 100%) !important;
  box-shadow: 0 4px 14px rgba(26,102,48,0.35) !important;
}

/* The "Save {institution}" button inside the modal gets the same amber pop. */
.np-save-btn {
  background: linear-gradient(180deg, #e8a020 0%, #c07010 100%);
  color: #fff8e8;
  border: none;
  padding: 12px 18px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  border-radius: 4px;
  box-shadow: 0 6px 22px rgba(192,112,16,0.40);
  cursor: pointer;
  margin-top: 0.6rem;
}
.np-save-btn:hover {
  background: linear-gradient(180deg, #f5b030 0%, #d08020 100%);
}
.np-save-btn-saved,
.np-save-btn.np-save-btn-saved {
  background: linear-gradient(180deg, #3aaa60 0%, #1a6630 100%);
  box-shadow: 0 4px 14px rgba(26,102,48,0.35);
}

/* The section tag now doubles as a year marker ("SCIENCE — 2035"). Slight
   emphasis on the year via letterspacing keeps the newspaper feel. */
.np-section-tag { letter-spacing: 0.10em; }

/* The year-marker separator between article groups — a subtle rule with a
   centered year badge — should read as a newspaper section break, not as
   a full-width bar of solid color. */
.np-section-rule .np-section-label {
  background: #fcfaf2;
  padding: 0 0.9rem;
  color: #7a4a10;
  letter-spacing: 0.14em;
  font-weight: 700;
}

/* ── 7. END SCREEN CAROUSEL — "Jews you Used" ────────────────────────────────
   Replaces the stage-grouped expandable list with a single-figure carousel.
   Big card, prominent left/right controls, share button in the header. */

.end-carousel {
  max-width: 620px;
  margin: 0 auto;
  padding: 1rem 0.75rem 0;
  position: relative;
  width: 100%;
}

/* The .end-cards container from style.css is a CSS grid sized for the
   old 160px figure-card layout. When it holds the carousel or the
   shared-view carousel, cancel the grid so the carousel can span the
   available width. */
#end-cards,
#share-view-cards {
  display: block !important;
  max-width: 100% !important;
  width: 100%;
  padding: 0;
}

.end-carousel-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(180,120,20,0.22);
}
.end-carousel-title-wrap {
  min-width: 0;
  flex: 1;
}
.end-carousel-stage {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #a8651a;
  margin-bottom: 0.15rem;
  min-height: 0.9rem;
}
.end-carousel-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.35rem, 4.2vw, 1.8rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #2a1a06;
  margin: 0;
  line-height: 1.1;
}

.end-carousel-share {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(200,140,0,0.10);
  color: #a8651a;
  border: 1px solid rgba(180,120,20,0.30);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  white-space: nowrap;
  flex-shrink: 0;
}
.end-carousel-share:hover {
  background: rgba(200,140,0,0.18);
  border-color: #c07010;
}
.end-carousel-share:active { transform: scale(0.97); }
.end-carousel-share:disabled { opacity: 0.6; cursor: default; }
.end-carousel-share svg { flex-shrink: 0; }

/* Stage-body — the card + arrow rail. */
.end-carousel-stage-body {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}
.end-carousel-card-wrap {
  flex: 1;
  min-width: 0;
  min-height: 380px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.end-carousel-card {
  flex: 1;
  background: #fff8f0;
  border: 1px solid rgba(180,120,20,0.22);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(120,80,20,0.10);
  display: flex;
  flex-direction: column;
  animation: endCardIn 0.28s ease-out;
}
@keyframes endCardIn {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.end-carousel-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f3e6c8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.end-carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.end-carousel-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.end-carousel-image-placeholder .figure-name-bubble {
  background: #e8a020;
  color: #fff8e8;
  border-radius: 999px;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 2rem;
  box-shadow: 0 4px 14px rgba(192,112,16,0.35);
}

.end-carousel-body {
  padding: 1rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.end-carousel-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: #1a0a00;
  line-height: 1.15;
}
.end-carousel-years {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.85rem;
  color: #a07030;
}
.end-carousel-bio {
  font-family: 'Lora', Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #4a3a20;
  margin-top: 0.25rem;
}
.end-carousel-context {
  margin-top: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: rgba(200,140,0,0.09);
  border-left: 3px solid #c07010;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.82rem;
  color: #6b4a20;
  font-style: italic;
  border-radius: 2px;
}

/* Prev / next arrows — big, tappable, aligned to card center. */
.end-carousel-nav {
  align-self: center;
  background: rgba(200,140,0,0.10);
  border: 1px solid rgba(180,120,20,0.30);
  color: #a8651a;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.end-carousel-nav:hover {
  background: rgba(200,140,0,0.20);
  border-color: #c07010;
}
.end-carousel-nav:active { transform: scale(0.94); }
.end-carousel-nav:disabled { opacity: 0.28; cursor: default; }

/* Dots — segmented pill row. */
.end-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 1rem auto 0;
  flex-wrap: wrap;
  max-width: 100%;
}
.end-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: rgba(180,120,20,0.28);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.1s;
}
.end-carousel-dot:hover { background: rgba(180,120,20,0.5); }
.end-carousel-dot.active {
  background: #c07010;
  transform: scale(1.2);
}

.end-carousel-counter {
  text-align: center;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.8rem;
  color: #7a5a30;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* Play Again — sits below the carousel. Bright and prominent, with the
   "each time is different" microcopy as a small subline of the button. */
.end-play-again-wrap {
  display: flex;
  justify-content: center;
  margin: 2rem 0 1rem;
}
.end-play-again {
  padding: 12px 22px;
  font-size: 1.05rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  line-height: 1.15;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 240px;
}
.end-play-again-sub {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.9;
}

/* Narrow screens: arrows side-by-side below the card, image slightly shorter. */
@media (max-width: 480px) {
  .end-carousel-stage-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }
  .end-carousel-card-wrap { min-height: 320px; }
  .end-carousel-image-wrap { aspect-ratio: 5 / 4; }
  .end-carousel-nav {
    height: 44px;
    width: 100%;
    border-radius: 6px;
    font-size: 1.7rem;
  }
  /* Row of two arrows under the card. */
  .end-carousel-stage-body .end-carousel-prev { grid-row: 2; grid-column: 1; }
  .end-carousel-stage-body .end-carousel-next { grid-row: 2; grid-column: 1; }
  .end-carousel-stage-body {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: dense;
  }
  .end-carousel-stage-body .end-carousel-card-wrap { grid-column: 1 / -1; grid-row: 1; }
}

/* ── 8. MUSIC AUDIO TOGGLE ────────────────────────────────────────────────
   Music defaults to OFF. The button in the bottom-right corner is how the
   user opts in. Default (muted) state uses the amber accent to look like
   an inviting call-to-action; active (playing) state fades to a subtler
   chrome so it's not distracting during play. */
.music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(180,120,20,0.30);
  background: rgba(255,248,232,0.92);
  color: #a8651a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(120,80,20,0.20);
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.1s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.music-toggle:hover  { background: rgba(255,248,232,1); border-color: #c07010; }
.music-toggle:active { transform: scale(0.94); }

/* Default (muted) — the inviting tap-me state. Slightly stronger shadow
   and a soft amber pulse so eyes land on it. */
.music-toggle.is-muted {
  background: linear-gradient(180deg, #f5b030 0%, #c07010 100%);
  color: #fff8e8;
  border-color: rgba(180,120,20,0.55);
  box-shadow: 0 6px 22px rgba(192,112,16,0.35);
}
.music-toggle.is-muted:hover {
  background: linear-gradient(180deg, #ffc040 0%, #d08020 100%);
  box-shadow: 0 8px 26px rgba(192,112,16,0.45);
}

/* Icon swap — when muted, show the "muted speaker" icon; when playing,
   show the "speaker with waves" icon. Only one is visible at a time. */
.music-toggle-on  { display: none; }
.music-toggle-off { display: inline; }
.music-toggle.is-muted .music-toggle-on  { display: none; }
.music-toggle.is-muted .music-toggle-off { display: inline; }
.music-toggle:not(.is-muted) .music-toggle-on  { display: inline; }
.music-toggle:not(.is-muted) .music-toggle-off { display: none; }

/* On the landing screen (dark video background) — a translucent-dark
   chip in whichever state, for legibility against the sunrise. */
body:has(#screen-landing.active) .music-toggle:not(.is-muted) {
  background: rgba(20,10,0,0.55);
  color: #ffe8a0;
  border-color: rgba(255,220,150,0.35);
}

/* ── 9. TAROT CARD DEAL-IN ─────────────────────────────────────────────────
   Cards fly in from off-screen, one at a time, coming to rest in their
   final position. The slide + fade + slight rotation reads as "being
   dealt" rather than just "appearing". Duration is short enough not to
   annoy on replay. */
@keyframes tarotDealIn {
  0% {
    opacity: 0;
    transform: translate(0, -180%) rotate(-14deg) scale(0.9);
  }
  70% {
    opacity: 1;
    transform: translate(0, 6%) rotate(2deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}
.tarot-card-wrap.tarot-dealing {
  opacity: 0;             /* hidden until animation fires */
}
.tarot-card-wrap.tarot-dealt {
  animation: tarotDealIn 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

/* ── 10. STAGE 1 CONTINUE: DISABLED + HINT ──────────────────────────────────
   Continue starts visible-but-disabled with a red nudge underneath telling
   the user what to do. Once all cards are flipped and the required Jews
   saved, the button flips to its normal green/amber active state and the
   hint hides. */
.stage1-continue:disabled,
.stage1-continue[disabled] {
  background: #d4c8b0 !important;
  color: #8a7a5a !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  opacity: 1;
}
.stage1-continue:disabled:hover,
.stage1-continue[disabled]:hover {
  background: #d4c8b0 !important;
  transform: none !important;
}
.stage1-continue:disabled .stack-badge,
.stage1-continue[disabled] .stack-badge {
  background: rgba(90,70,40,0.15);
  color: #6a5a3a;
}

.stage1-continue-hint {
  color: #c03020;
  background: rgba(200,50,30,0.08);
  border: 1px solid rgba(200,50,30,0.25);
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.85rem;
  text-align: center;
  margin: 0.5rem auto 0.8rem;
  max-width: 380px;
  line-height: 1.4;
}
.stage1-continue-hint[hidden] { display: none; }
