@font-face {
  font-family: 'NetflixSansBold';
  src: url('assets/font/NetflixSans-Bd.ttf') format('truetype');
}


@font-face {
  font-family: 'NetflixSansRegular';
  src: url('assets/font/NetflixSans-Rg.ttf') format('truetype');
}

* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html, body { 
  overflow: hidden; 
  background: #000; 
  font-family: 'NetflixSansBold', sans-serif;
  color: #fff;
  width: 100%;
  height: 100vh;
}

canvas { 
  display: block; 
  position: absolute; 
  top: 0; 
  left: 0; 
}

#header {
  position: absolute;
  top: 20px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 100;
}

#logo {
  height: 40px;
  width: auto;
}

#title {
  display: flex;
  align-items: end;
  font-size: 24px;
  font-weight: 700;
  height: 40px;
  text-transform: uppercase;
  padding-left: 24px;
  border-left: 1px solid rgba(255, 255, 255, 0.6);
}

#titleStack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 0.4rem;
  gap: 1px;
}

#docTitle {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.2;
}

#episodeTitleMask {
  overflow: hidden;
}

#episodeTitle {
  display: inline-block;
  transform: translateX(-110%);
}

#episodeTitle.slide-in {
  animation: episodeTitleSlide 1.5s cubic-bezier(0, 0, 0, 1) forwards;
}

@keyframes episodeTitleSlide {
  from { transform: translateX(-110%); }
  to   { transform: translateX(0); }
}

#timelineWrapper {
  position: absolute;
  top: 125px;
  left: 0;
  right: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  z-index: 50;
  margin: 0 40px 0 40px;
}

#timeline {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 0 20px;
}

#prevPhaseBtn,
#nextPhaseBtn {
  position: absolute;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 24px;
  transition: color 0.2s ease;
  white-space: nowrap;
}

#prevPhaseBtn {
  left: 24px;
}

#nextPhaseBtn {
  right: 24px;
}

#prevPhaseBtn:hover,
#nextPhaseBtn:hover {
  color: rgba(255, 255, 255, 0.9);
}

#prevPhaseBtn.hidden,
#nextPhaseBtn.hidden {
  visibility: hidden;
  pointer-events: none;
}

.year {
  font-size: 16px;
  font-family: 'NetflixSansRegular', sans-serif;
  opacity: 0.4;
  transition: all 0.2s ease;
  cursor: default;
}

.year.active {
  opacity: 1;
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 28px;
}

#content {
  position: absolute;
  bottom: 60px;
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: space-between;
  z-index: 50;
}

#textBlock {
  flex: 1;
  max-width: 600px;
}

#hito {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  text-transform: uppercase;
}

#descripcion {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  max-width: 500px;
}

#dataBlock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 30px;
  min-width: 180px;
}

.metric {
  text-align: right;
  width: 100%;
}

.metric-value {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  display: block;
}

.metric-label {
  font-size: 12px;
  opacity: 0.7;
  text-transform: uppercase;
  white-space: nowrap;
  display: block;
}

/* ── START SCREEN ────────────────────────────────────── */

#startScreen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#startScreen.active {
  opacity: 1;
  pointer-events: all;
}

#startLogo {
  height: 52px;
  width: auto;
}

#startCta {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  animation: startPulse 2.2s ease-in-out infinite;
}

@keyframes startPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ── TUDUM SPLASH ────────────────────────────────────── */

#tudumScreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#tudumScreen.active {
  opacity: 1;
  pointer-events: all;
}

#tudumVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── HOMEPAGE ─────────────────────────────────────────── */

#homepageScreen {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#homepageScreen.active {
  opacity: 1;
  pointer-events: all;
}

#homepageVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#homepageOverlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top,  rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.45) 45%, rgba(0,0,0,0.08) 100%),
    linear-gradient(to right, rgba(0,0,0) 0%, transparent 95%);
}

#homepageHeader {
  position: absolute;
  top: 48px;
  left: 8%;
}

#homepageLogo {
  height: 40px;
  width: auto;
}

#homepageContent {
  position: absolute;
  bottom: 14%;
  left: 8%;
  max-width: 52%;
}

#homepageTags {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 14px;
}

#homepageTitle {
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 50px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.0;
  color: #fff;
  margin-bottom: 18px;
}

#homepageDesc {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 30px;
  max-width: 560px;
}

#homepageBtns {
  display: flex;
  gap: 12px;
  align-items: center;
}

#homepagePlayBtn {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  color: #000;
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 14px;
  padding: 12px 26px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#homepagePlayBtn:hover {
  background: rgba(255, 255, 255, 0.72);
}

#homepageInfoBtn {
  background: rgba(109, 109, 110, 0.65);
  border: none;
  color: #fff;
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 14px;
  padding: 12px 26px;
  cursor: pointer;
  transition: background 0.2s ease;
}

#homepageInfoBtn:hover {
  background: rgba(109, 109, 110, 0.45);
}

/* ── INTRO SCREEN ────────────────────────────────────── */

#introScreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#introScreen.active {
  opacity: 1;
  pointer-events: all;
}

#introVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#introOverlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top, rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0.08) 100%),
    linear-gradient(to right,
    rgba(0, 0, 0) 0%,
    transparent 95%);
  opacity: 1;
  transition: opacity 0.55s ease;
}

/* Momento 1: overlay sutil, body oculto */
#introScreen.has-video:not(.intro-m2) #introOverlay {
  opacity: 0.45;
}

#introScreen.has-video:not(.intro-m2) #introBody {
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  margin-bottom: 0 !important;
  transform: translateY(12px) !important;
  transition: none !important;
}

#introContent {
  position: absolute;
  bottom: 12%;
  left: 8%;
  max-width: 52%;
}

#introTitle {
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 48px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: 24px;
  color: #fff;
  transform: translateY(0);
  transition: transform .8s ease-in-out;
}

/* Momento 2: título sube, body aparece */
#introScreen.intro-m2 #introTitle {
  transform: translateY(-20px);
}

#introScreen.intro-m2 #introBody {
  max-height: 55vh;
  overflow-y: auto;
  opacity: 1;
  transform: translateY(0);
  transition: max-height .8s ease-in-out,
              opacity .8s ease 300ms, 
              transform .8s ease 50ms;
}

#introBody {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 18px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 36px;
  max-height: 50vh;
  overflow-y: auto;
  transform: translateY(0);
}

#introBody p {
  margin-bottom: 12px;
}

#introBody ul {
  margin: 6px 0 12px 20px;
}

#introBody li {
  margin-bottom: 4px;
}

#introBtn {
  display: inline-block;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  color: #fff;
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 28px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#introBtn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

/* ── LEGEND ──────────────────────────────────────────── */

#legend {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.9;
}

.legend-label {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
  max-width: 200px;
}

/* ── PHASE 4 RIGHT SCRIM ─────────────────────────────── */

#phase4Scrim {
  position: fixed;
  top: 0;
  right: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.72) 100%);
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#phase4Scrim.active {
  opacity: 1;
}

/* ── MUTE BUTTON ─────────────────────────────────────── */

#muteBtn {
  position: fixed;
  top: 22px;
  right: 40px;
  z-index: 5000;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.65);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

#muteBtn:hover {
  color: rgba(255, 255, 255, 1);
}

/* ── FINAL SCREEN ────────────────────────────────────── */

#introScreen.final-mode #introContent {
  left: 50%;
  transform: translateX(-50%);
  max-width: 680px;
  text-align: center;
  bottom: auto;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Área de texto fija para que la nav no salte */
#introScreen.final-mode #introBody {
  min-height: 180px;
  max-height: 40vh;
  overflow: hidden;
  margin-bottom: 0;
  position: relative;
}

#finalSlide {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 20px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.88);
  opacity: 0;
}

#finalSlide p  { margin-bottom: 10px; }
#finalSlide ul { margin: 6px 0 10px 24px; }
#finalSlide li { margin-bottom: 4px; }

/* Créditos — pantalla completa, 3 columnas */
#introScreen.final-mode.credits-mode #introContent {
  left: 0; right: 0; top: 0; bottom: 0;
  max-width: 100%;
  transform: none;
  padding: 60px 60px 48px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#introScreen.final-mode.credits-mode #introTitle {
  display: none;
}

#introScreen.final-mode.credits-mode #introBody {
  flex: 1;
  max-height: none;
  overflow: hidden;
  margin-bottom: 0;
}

#introScreen.final-mode.credits-mode #finalSlide {
  height: 100%;
  opacity: 1 !important;
}

.credits-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 48px;
  height: 100%;
  align-items: start;
}

.credits-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  max-height: calc(100vh - 140px);
}

.credits-col-title {
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 10px !important;
  letter-spacing: 0.14em!important; 
  text-transform: uppercase !important;
  color: rgba(255,255,255,0.35) !important;
  margin-bottom: 20px!important;
}

/* Columna 1 — Autoría */
.credits-author p {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  margin-bottom: 4px;
}

/* Columna 2 — Referencias */
.credits-refs .ref-entry {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,0.65);
  margin-bottom: 10px;
  padding-left: 0;
  text-indent: 0;
}

.credits-refs .ref-entry a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  word-break: break-all;
}

.credits-refs .ref-entry a:hover {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
}

/* Columna 3 — Acciones */
.credits-actions {
  gap: 16px;
}

#creditsRestartBtn {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,0.6);
  color: #fff;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
  margin-bottom: 20px;
}

#creditsRestartBtn:hover {
  background: rgba(255,255,255,0.12);
}

#finalSlide .ref-entry a {
  color: rgba(255,255,255,0.55);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

#finalSlide .ref-entry a:hover {
  color: rgba(255,255,255,0.9);
}

#finalNav {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin-top: 28px;
}

#finalNav button {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.65);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

#finalNav button:hover {
  color: #fff;
}

#finalDots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.final-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.final-dot.active {
  background: rgba(255, 255, 255, 0.90);
  transform: scale(1.35);
}

/* ── GAME CARD ───────────────────────────────────────── */

#finalGameCard {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
}

#finalGameCover {
  width: 90px;
  height: 58px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

#finalGameInfo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#finalGameLabel {
  font-family: 'NetflixSansMedium', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e50914;
}

#finalGameBtn {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 13px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.4);
  border-radius: 4px;
  padding: 7px 16px;
  cursor: not-allowed;
}

/* ── INFO MODAL ──────────────────────────────────────── */

#infoModal {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 24px 20px;
  overflow-y: auto;
}

#infoModal.active {
  opacity: 1;
  pointer-events: all;
}

#infoModalCard {
  background: #141414;
  border-radius: 8px;
  max-width: 860px;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(0,0,0,0.85);
}

#infoModalVideoWrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 44vh;
  overflow: hidden;
  background: #000;
}

#infoModalVid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

#infoModalGrad {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.08) 0%,
    rgba(20,20,20,0.0) 25%,
    rgba(20,20,20,0.75) 75%,
    #141414 100%
  );
}

#infoModalClose {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  background: rgba(20,20,20,0.92);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s ease;
}

#infoModalClose:hover {
  background: rgba(70,70,70,0.95);
}

#infoModalVideoContent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 36px 22px;
}

#infoModalBrand {
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: #E50914;
  margin-bottom: 6px;
  text-transform: uppercase;
}

#infoModalTitle {
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 34px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
  color: #fff;
  margin-bottom: 14px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

#infoModalVideoActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#infoModalPlayBtn {
  background: rgba(255,255,255,0.95);
  border: none;
  color: #000;
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 15px;
  padding: 10px 22px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

#infoModalPlayBtn:hover {
  background: rgba(255,255,255,0.76);
}

#infoModalBody {
  padding: 10px 36px 34px;
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 20px 40px;
}

#infoModalMeta {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.52);
  margin-bottom: 10px;
}

#infoModalRank {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 15px;
  color: #fff;
}

.rank-badge-box {
  background: #E50914;
  color: #fff;
  font-family: 'NetflixSansBold', sans-serif;
  padding: 3px 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 2px;
  line-height: 1;
  padding-top: 6px;
}

.rank-top {
  font-size: 7px;
  letter-spacing: 0.08em;
}

.rank-num {
  font-size: 19px;
  line-height: 1.15;
}

#infoModalDesc {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255,255,255,0.87);
}

#infoModalGenres {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.58);
  line-height: 1.65;
  margin-bottom: 16px;
}

#infoModalGenres strong {
  color: rgba(255,255,255,0.4);
  font-family: 'NetflixSansBold', sans-serif;
}

#infoModalCredits {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.58);
  line-height: 1.75;
}

#infoModalCredits strong {
  color: rgba(255,255,255,0.4);
  font-family: 'NetflixSansBold', sans-serif;
}

#infoModalRefs {
  margin-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 14px;
}

.ref-heading {
  font-family: 'NetflixSansBold', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  margin-bottom: 8px;
}

.ref-entry {
  font-family: 'NetflixSansRegular', sans-serif;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.52);
  margin-bottom: 10px;
  padding-left: 14px;
  text-indent: -14px;
}

.ref-entry a {
  color: rgba(255,255,255,0.55);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.ref-entry a:hover {
  color: rgba(255,255,255,0.9);
}

/* ══════════════════════════════════════════════════════
   MOBILE TOP OVERLAY (dark gradient behind nav)
══════════════════════════════════════════════════════ */

#mobileTopOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 270px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.88) 55%, rgba(0,0,0,0));
  z-index: 46;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* ── Mobile overlay ── */
  #mobileTopOverlay { display: block; }

  /* ── Header: logo + episode title stacked ── */
  #header {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  #logo { height: 28px; }
  #title {
    font-size: 14px;
    height: auto;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.25);
    padding-top: 5px;
    width: 100%;
  }
  #docTitle { display: none; }
  #muteBtn { top: 14px; right: 16px; }

  /* ── Timeline: years full-width, then prev+next row ── */
  #timelineWrapper {
    position: fixed;
    top: 110px;
    left: 0;
    right: 0;
    margin: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
  }

  #timeline {
    order: 1;
    flex: 0 0 100%;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
    padding: 2px 0;
  }

  .year { font-size: 14px; padding: 8px 7px; }
  .year.active { font-size: 22px; padding: 8px 7px; }

  #prevPhaseBtn,
  #nextPhaseBtn {
    position: static;
    flex: 1;
    font-size: 12px;
    padding: 8px 10px;
    text-align: center;
  }
  #prevPhaseBtn { order: 2; }
  #nextPhaseBtn { order: 3; }

  /* ── Legend: below buttons ── */
  #legend {
    position: fixed;
    top: 208px;
    left: 16px;
    right: auto;
    bottom: auto;
    transform: none;
  }
  .legend-label { font-size: 10px; max-width: 130px; }

  /* ── Content / Data block ── */
  #content {
    bottom: 16px;
    left: 16px;
    right: 16px;
    flex-direction: column;
    gap: 10px;
  }
  #textBlock { max-width: 100%; }
  #hito { font-size: 16px; margin-bottom: 8px; }
  #descripcion { font-size: 13px; max-width: 100%; }
  #dataBlock {
    flex-direction: row;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 24px;
    min-width: auto;
  }
  .metric { text-align: left; }
  .metric-value { font-size: 26px; }
  .metric-label { font-size: 10px; }

  /* ── Phase 4 scrim ── */
  #phase4Scrim { width: 60%; }

  /* ── Homepage ── */
  #homepageHeader { top: 20px; left: 5%; }
  #homepageLogo { height: 28px; }
  #homepageContent { bottom: 10%; left: 5%; max-width: 90%; }
  #homepageTitle { font-size: 28px; }
  #homepageDesc { font-size: 14px; margin-bottom: 20px; }
  #homepageBtns { flex-direction: column; align-items: flex-start; gap: 10px; }
  #homepagePlayBtn, #homepageInfoBtn {
    font-size: 13px; padding: 10px 20px; width: 100%; text-align: center; box-sizing: border-box;
  }

  /* ── Intro screen ── */
  #introContent { bottom: 8%; left: 5%; max-width: 90%; }
  #introTitle { font-size: 28px; margin-bottom: 14px; }
  #introBody { font-size: 15px; max-height: 38vh; }

  /* ── Final screen ── */
  #introScreen.final-mode #introContent {
    left: 50%;
    max-width: 90%;
    transform: translate(-50%, -50%);
  }
  #finalSlide { font-size: 16px; }

  /* ── Credits — 1 columna en mobile ── */
  #introScreen.final-mode.credits-mode #introContent {
    padding: 56px 20px 24px;
    overflow-y: auto;
    left: 0;
    right: 0;
    transform: none;
  }
  .credits-grid { grid-template-columns: 1fr; gap: 28px; height: auto; }
  .credits-col { max-height: none; overflow-y: visible; }

  /* ── Info Modal ── */
  #infoModalCard { border-radius: 4px; }
  #infoModalVideoWrap { max-height: 40vw; }
  #infoModalVideoContent { padding: 0 16px 14px; }
  #infoModalTitle { font-size: 20px; }
  #infoModalBody { grid-template-columns: 1fr; padding: 10px 16px 20px; gap: 16px; }

  /* ── Start screen ── */
  #startLogo { height: 36px; }
}

@media (max-width: 480px) {
  #mobileTopOverlay { height: 240px; }

  #header { top: 12px; left: 12px; right: 12px; }
  #logo { height: 22px; }
  #muteBtn { top: 10px; right: 12px; }

  #timelineWrapper { top: 90px; }
  .year { font-size: 13px; padding: 7px 5px; }
  .year.active { font-size: 18px; }

  #legend { top: 185px; }

  #content { bottom: 12px; left: 12px; right: 12px; }
  #hito { font-size: 14px; }
  #descripcion { font-size: 12px; }
  .metric-value { font-size: 22px; }

  #homepageTitle { font-size: 22px; }
  #introTitle { font-size: 22px; }

  .credits-grid { gap: 20px; }
  .credits-refs .ref-entry { font-size: 11px; }
}

