@font-face {
  font-family: "Achemost";
  src: local("Achemost"), local("Achemost Regular");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #1A1008;
  --ink-2: #4F2E0E;
  --gold: #AF782F;
  --gold-2: #C98E45;
  --text: #fff9f0;
  --muted: #ead7bd;
  --font-title: "Achemost", "Cormorant Garamond", Georgia, serif;
  --font-body: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --danger: #ff8a78;
  --success: #dff5cb;
  --shadow: rgba(0, 0, 0, 0.55);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: #090604; overflow: hidden; }
body { font-family: var(--font-body); color: var(--text); }
button { font: inherit; }
.game {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  background: #080503;
  isolation: isolate;
}
.scene { position: absolute; inset: 0; overflow: hidden; background: #080503; }
.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.015);
  user-select: none;
  pointer-events: none;
  filter: saturate(0.98) contrast(1.04);
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.18) 54%, rgba(0,0,0,0.62) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.28), rgba(0,0,0,0.12) 45%, rgba(0,0,0,0.50));
  z-index: 2;
}
.scene-content { position: absolute; inset: 0; z-index: 5; }
.hud {
  position: absolute;
  top: calc(16px + var(--safe-top));
  left: 18px;
  right: 18px;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  pointer-events: none;
  opacity: 1;
  transition: opacity .25s ease;
}
.hud.is-hidden { opacity: 0; visibility: hidden; }
.hud__left {
  max-width: min(58vw, 860px);
  padding: 12px 16px 14px;
  background: linear-gradient(90deg, rgba(17,11,7,.78), rgba(17,11,7,.42), rgba(17,11,7,0));
  border-left: 2px solid rgba(223,184,107,.8);
  text-shadow: 0 2px 10px #000;
}
.hud__title {
  display: block;
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 800;
  font-size: clamp(18px, 2vw, 29px);
  line-height: 1.05;
}
.hud__objective {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: clamp(12px, 1.1vw, 16px);
  line-height: 1.35;
}
.hud__right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(13, 8, 5, .74);
  border: 1px solid rgba(223,184,107,.28);
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.hud-block { display: grid; gap: 3px; min-width: 76px; }
.hud-label { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.hud-value { color: var(--gold-2); font-family: var(--font-title); font-weight: 800; font-size: 19px; }
.lives { display: flex; gap: 4px; height: 26px; align-items: center; }
.life { width: 16px; height: 30px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255, 193, 83, .35)); transition: opacity .2s ease, filter .2s ease; }
.life.off { opacity: .24; filter: grayscale(1) brightness(.55); }
.hud-btn, .audio-toggle, .btn, .inline-btn {
  border: 1px solid rgba(223,184,107,.65);
  background: linear-gradient(180deg, rgba(65,45,25,.88), rgba(29,18,11,.9));
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .01em;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, filter .16s ease;
}
.hud-btn { height: 40px; padding: 0 16px; }
.hud-btn:hover, .audio-toggle:hover, .btn:hover, .inline-btn:hover { transform: translateY(-1px); border-color: var(--gold-2); filter: brightness(1.12); }
.audio-toggle {
  position: absolute;
  right: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 110;
  padding: 10px 14px;
  background: rgba(16,10,6,.7);
  border-radius: 999px;
  font-size: 13px;
  backdrop-filter: blur(6px);
}
.audio-toggle.is-muted { opacity: .55; }
.toast {
  position: absolute;
  left: 50%;
  top: calc(104px + var(--safe-top));
  transform: translate(-50%, -12px);
  z-index: 120;
  min-width: min(90vw, 460px);
  max-width: min(90vw, 840px);
  padding: 13px 18px;
  text-align: center;
  color: var(--text);
  background: rgba(14, 8, 5, .86);
  border: 1px solid rgba(223,184,107,.35);
  box-shadow: 0 16px 45px rgba(0,0,0,.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  font-size: clamp(13px, 1.3vw, 18px);
  line-height: 1.35;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { color: var(--success); }
.toast.error { color: #ffd2ca; border-color: rgba(255,138,120,.45); }

.boot, .menu, .outcome, .level-intro, .codex-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 58px);
}
.menu { place-items: stretch; padding: clamp(24px, 5vw, 70px); }
.menu-copy {
  align-self: center;
  justify-self: start;
  width: min(720px, 86vw);
  margin-left: min(5vw, 70px);
  text-shadow: 0 4px 22px #000;
}
.kicker {
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .24em;
  font-weight: 900;
  font-size: clamp(11px, 1vw, 14px);
  margin: 0 0 10px;
}
.main-title {
  font-family: var(--font-title);
  font-size: clamp(52px, 8vw, 122px);
  line-height: .88;
  margin: 0 0 20px;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.typewriter {
  white-space: pre-line;
  color: #f4e8d4;
  font-size: clamp(16px, 1.6vw, 24px);
  line-height: 1.55;
  max-width: 710px;
  margin-inline: auto;
}
.menu-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; opacity: 0; transform: translateY(12px); transition: opacity .45s ease, transform .45s ease; }
.menu-actions.ready { opacity: 1; transform: translateY(0); }
.btn {
  min-width: 190px;
  min-height: 52px;
  padding: 14px 22px;
  border-radius: 0;
  font-size: clamp(14px, 1.2vw, 17px);
}
.btn.primary { background: linear-gradient(180deg, rgba(104,73,34,.96), rgba(43,27,14,.96)); }
.btn.ghost { background: rgba(17,10,6,.48); }
.boot-box, .intro-copy, .outcome-copy, .codex-copy {
  width: min(900px, 92vw);
  text-align: center;
  text-shadow: 0 4px 20px #000;
}
.boot-title, .intro-title, .outcome-title, .codex-title {
  font-family: var(--font-title);
  margin: 0 0 18px;
  text-transform: uppercase;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 1;
}
.boot-line {
  width: min(560px, 76vw);
  height: 7px;
  margin: 28px auto 0;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}
.boot-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #8a6233, var(--gold-2)); transition: width .2s ease; }
.level-intro, .codex-overlay { background: rgba(0,0,0,.66); z-index: 140; }
.intro-copy, .codex-copy, .outcome-copy {
  background: linear-gradient(180deg, rgba(18,11,7,.64), rgba(18,11,7,.34));
  border-left: 2px solid rgba(223,184,107,.8);
  border-right: 1px solid rgba(223,184,107,.24);
  padding: clamp(24px, 4vw, 48px);
  backdrop-filter: blur(5px);
}
.intro-body, .outcome-body, .codex-body {
  color: #f2e5d0;
  font-size: clamp(16px, 1.45vw, 23px);
  line-height: 1.55;
  white-space: pre-line;
}
.codex-body { text-align: left; max-height: 48vh; overflow: auto; padding-right: 10px; }
.codex-entry { margin-bottom: 22px; }
.codex-entry strong { display: block; color: var(--gold-2); font-family: var(--font-title); font-size: 20px; margin-bottom: 5px; }

.item, .symbol, .distractor, .timeline-piece {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  z-index: 18;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.48));
  transition: filter .18s ease, opacity .22s ease, transform .18s ease;
}
.item:hover, .symbol:hover, .distractor:hover, .timeline-piece:hover { filter: drop-shadow(0 12px 22px rgba(223,184,107,.42)); }
.item.found, .symbol.placed, .timeline-piece.placed { pointer-events: none; opacity: .92; }
.hit-label {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 24;
  color: #f8e7c6;
  background: rgba(18, 10, 5, .74);
  border: 1px solid rgba(223,184,107,.4);
  padding: 7px 11px;
  font-size: 13px;
  white-space: nowrap;
  animation: floatUp .9s ease forwards;
  pointer-events: none;
}
@keyframes floatUp { to { opacity: 0; transform: translate(-50%, -92%); } }
.flashlight-layer {
  --x: 50%;
  --y: 50%;
  --r: 175px;
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: radial-gradient(circle var(--r) at var(--x) var(--y), rgba(0,0,0,0) 0%, rgba(0,0,0,.1) 38%, rgba(0,0,0,.95) 78%);
  transition: opacity .2s ease;
}
.darkness-extra {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity .3s ease;
}
.shake { animation: shake .22s linear; }
@keyframes shake {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-8px,2px); }
  45% { transform: translate(8px,-2px); }
  70% { transform: translate(-4px,3px); }
}
.error-flash::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 160;
  pointer-events: none;
  background: rgba(185, 25, 14, .24);
  animation: fadeFlash .28s ease forwards;
}
@keyframes fadeFlash { to { opacity: 0; } }
.burst {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 90;
  background: var(--gold-2);
  box-shadow: 0 0 22px var(--gold-2);
  animation: burst .7s ease-out forwards;
}
@keyframes burst {
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); }
}

.symbols-base {
  position: absolute;
  left: 3vw;
  right: 3vw;
  bottom: calc(18px + var(--safe-bottom));
  height: min(21vh, 168px);
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 54px);
  align-items: center;
  background: linear-gradient(90deg, rgba(10,6,4,0), rgba(10,6,4,.62), rgba(10,6,4,0));
  pointer-events: none;
}
.slot {
  width: clamp(116px, 14vw, 185px);
  height: clamp(82px, 11vh, 124px);
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(223,184,107,.42);
  background: rgba(12,7,4,.58);
  pointer-events: auto;
}
.slot::before {
  content: attr(data-label);
  position: absolute;
  bottom: 8px;
  left: 6px;
  right: 6px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
}
.slot img { max-width: 58%; max-height: 65%; opacity: .16; filter: grayscale(1) sepia(.4); pointer-events: none; }
.slot.complete { background: rgba(59, 42, 21, .76); border-color: rgba(243,211,145,.8); }
.slot.complete img { opacity: .05; }

.timeline-slots {
  position: absolute;
  left: 7vw;
  right: 7vw;
  top: 43%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 2vw, 36px);
  z-index: 12;
}
.time-slot {
  min-height: min(16vh, 140px);
  border: 1px solid rgba(223,184,107,.5);
  background: rgba(14,8,5,.62);
  display: grid;
  place-items: center;
  position: relative;
  padding: 14px;
}
.time-slot::before {
  content: attr(data-order);
  position: absolute;
  top: -18px;
  left: 16px;
  color: var(--gold-2);
  font-family: var(--font-title);
  font-size: clamp(28px, 3vw, 48px);
  font-weight: 900;
  text-shadow: 0 2px 18px #000;
}
.time-slot span { color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; text-align: center; }
.time-slot.complete { background: rgba(56, 39, 20, .78); border-color: var(--gold-2); }
.timeline-pieces {
  position: absolute;
  left: 4vw;
  right: 4vw;
  bottom: calc(36px + var(--safe-bottom));
  min-height: min(20vh, 176px);
  z-index: 18;
}
.timeline-piece {
  width: clamp(180px, 20vw, 290px);
  min-height: 82px;
  padding: 16px 18px;
  background:
    linear-gradient(90deg, transparent 0 10px, rgba(130,90,43,.25) 10px 11px, transparent 11px calc(100% - 11px), rgba(130,90,43,.25) calc(100% - 11px) calc(100% - 10px), transparent calc(100% - 10px)),
    linear-gradient(180deg, #f3e3c2, #d1b47d);
  border: 1px solid rgba(93, 58, 26, .78);
  color: #2b1a0d;
  text-align: center;
  font-weight: 900;
  line-height: 1.22;
  box-shadow: inset 0 0 20px rgba(95,58,25,.18), 0 16px 30px rgba(0,0,0,.34);
}
.lightbar {
  position: absolute;
  top: calc(104px + var(--safe-top));
  right: 20px;
  width: min(34vw, 450px);
  z-index: 85;
  display: none;
}
.lightbar.show { display: block; }
.lightbar-label { display: flex; justify-content: space-between; color: var(--gold-2); font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 5px; text-shadow: 0 2px 12px #000; }
.lightbar-track { height: 12px; background: rgba(7,4,2,.72); border: 1px solid rgba(223,184,107,.36); overflow: hidden; }
.lightbar-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #bd522f, #efad53, #fff0a8); transform-origin: left center; }
.help-btn { position: absolute; right: 20px; top: calc(150px + var(--safe-top)); z-index: 86; display: none; }
.help-btn.show { display: inline-block; }

@media (max-width: 850px) {
  .hud { left: 10px; right: 10px; top: 10px; gap: 8px; }
  .hud__left { max-width: 56vw; padding: 9px 10px; }
  .hud__right { gap: 7px; padding: 7px; }
  .hud-block { min-width: auto; }
  .hud-label { font-size: 8px; }
  .hud-value { font-size: 14px; }
  .life { width: 12px; height: 24px; }
  .hud-btn { height: 32px; padding: 0 9px; font-size: 12px; }
  .menu-copy { margin-left: 0; width: 94vw; }
  .main-title { font-size: clamp(42px, 13vw, 80px); }
  .timeline-slots { left: 3vw; right: 3vw; gap: 8px; }
  .timeline-piece { width: 42vw; font-size: 13px; }
  .timeline-pieces { bottom: 18px; }
  .lightbar { top: 88px; right: 10px; width: 42vw; }
  .help-btn { top: 134px; right: 10px; }
}

/* --- Dinámica reforzada: linterna, búsqueda, pistas y cinemática final --- */
.flashlight-control {
  position: absolute;
  left: 22px;
  bottom: calc(22px + var(--safe-bottom));
  z-index: 58;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(18, 10, 6, .76);
  backdrop-filter: blur(7px);
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: 12px;
}
.flashlight-control.is-on { box-shadow: 0 0 24px rgba(243, 211, 145, .24); }
.flashlight-control.is-off { border-color: rgba(255, 138, 120, .72); color: #ffd6cf; }
.flashlight-layer.is-off {
  background: rgba(0,0,0,.985);
}
.hard-hidden {
  opacity: .86;
  transform: translate(-50%, -50%) scale(.92) rotate(-2deg);
  filter: brightness(.72) contrast(1.08) drop-shadow(0 8px 14px rgba(0,0,0,.55));
}
.modern-decoy {
  opacity: .94;
  filter: brightness(.78) saturate(.82) drop-shadow(0 10px 16px rgba(0,0,0,.55));
}
.document-reveal {
  animation: documentFlip .78s cubic-bezier(.2,.9,.25,1.1) forwards;
  filter: drop-shadow(0 0 22px rgba(243,211,145,.95)) drop-shadow(0 16px 24px rgba(0,0,0,.6));
}
@keyframes documentFlip {
  0% { transform: translate(-50%, -50%) rotateY(0deg) scale(.92); }
  45% { transform: translate(-50%, -50%) rotateY(180deg) scale(1.2); }
  100% { transform: translate(-50%, -50%) rotateY(360deg) scale(1.06); }
}
.discovery-overlay {
  position: absolute;
  inset: 0;
  z-index: 145;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 60px);
  background: radial-gradient(circle at center, rgba(0,0,0,.42), rgba(0,0,0,.78));
}
.discovery-card {
  width: min(760px, 92vw);
  padding: clamp(24px, 4vw, 46px);
  background: linear-gradient(180deg, rgba(26,17,11,.9), rgba(11,7,5,.82));
  border: 1px solid rgba(223,184,107,.52);
  border-left: 3px solid rgba(243,211,145,.95);
  box-shadow: 0 25px 80px rgba(0,0,0,.6), inset 0 0 60px rgba(223,184,107,.08);
  text-align: left;
  animation: cardIn .32s ease forwards;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.discovery-title {
  font-family: var(--font-title);
  margin: 0 0 16px;
  color: var(--text);
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.02;
}
.discovery-body {
  color: #f0dfc5;
  font-size: clamp(16px, 1.45vw, 22px);
  line-height: 1.55;
  white-space: pre-line;
}
.symbol-search-mask {
  --x: 50%;
  --y: 50%;
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  background: radial-gradient(circle 210px at var(--x) var(--y), rgba(0,0,0,0) 0%, rgba(0,0,0,.08) 34%, rgba(0,0,0,.68) 78%);
  mix-blend-mode: multiply;
}
.level-two .symbols-base {
  z-index: 36;
  height: min(19vh, 150px);
  background: linear-gradient(90deg, rgba(10,6,4,.08), rgba(10,6,4,.78), rgba(10,6,4,.08));
}
.search-object {
  z-index: 18;
  opacity: .9;
  filter: brightness(.78) drop-shadow(0 12px 18px rgba(0,0,0,.55));
}
.search-object:hover,
.search-object.is-dragging {
  opacity: 1;
  filter: brightness(1.15) drop-shadow(0 0 22px rgba(243,211,145,.42)) drop-shadow(0 16px 20px rgba(0,0,0,.55));
}
.decoy-a { filter: grayscale(.25) sepia(.25) brightness(.72) drop-shadow(0 12px 18px rgba(0,0,0,.55)); }
.decoy-b { filter: hue-rotate(22deg) saturate(.65) brightness(.76) drop-shadow(0 12px 18px rgba(0,0,0,.55)); }
.decoy-c { filter: grayscale(.12) contrast(.9) brightness(.72) drop-shadow(0 12px 18px rgba(0,0,0,.55)); }
.slot {
  border-radius: 18px;
  box-shadow: inset 0 0 28px rgba(0,0,0,.35), 0 8px 28px rgba(0,0,0,.28);
}
.slot.complete {
  animation: slotPulse .42s ease;
}
@keyframes slotPulse {
  0% { transform: scale(.98); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.timeline-piece {
  display: grid;
  gap: 6px;
  align-content: center;
}
.timeline-piece strong {
  display: block;
  font-size: clamp(13px, 1.2vw, 18px);
  line-height: 1.1;
}
.timeline-piece small {
  display: block;
  font-size: clamp(10px, .85vw, 13px);
  line-height: 1.22;
  font-weight: 700;
  opacity: .78;
}
.timeline-piece.is-dragging {
  filter: drop-shadow(0 0 24px rgba(243,211,145,.6)) drop-shadow(0 18px 28px rgba(0,0,0,.5));
}
.cinematic-wrap {
  position: absolute;
  inset: 0;
  z-index: 35;
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
}
.final-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .88;
  animation: cinematicZoom 7s ease forwards;
}
@keyframes cinematicZoom { from { transform: scale(1.04); } to { transform: scale(1.14); } }
.legacy-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255,226,136,.38), rgba(180,96,24,.12) 24%, rgba(0,0,0,.48) 70%);
  animation: glowBreath 2.4s ease-in-out infinite;
}
@keyframes glowBreath { 50% { opacity: .62; transform: scale(1.04); } }
.legacy-star, .final-star {
  color: #fff0a8;
  text-shadow: 0 0 18px rgba(255,240,168,.95), 0 0 44px rgba(223,184,107,.85);
}
.legacy-star {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(82px, 12vw, 180px);
  animation: starRise 2.6s ease forwards;
}
@keyframes starRise {
  0% { opacity: 0; transform: translate(-50%, -25%) scale(.45) rotate(-25deg); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(6deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}
.legacy-message {
  position: absolute;
  left: 50%;
  bottom: 28%;
  transform: translateX(-50%);
  width: min(860px, 92vw);
  text-align: center;
  font-family: var(--font-title);
  font-size: clamp(34px, 6vw, 82px);
  line-height: .96;
  text-transform: uppercase;
  color: #fff7e8;
  text-shadow: 0 4px 30px #000, 0 0 34px rgba(223,184,107,.55);
}
.legacy-message span {
  display: inline-block;
  opacity: 0;
  animation: messageIn 1.2s ease 1.2s forwards;
}
@keyframes messageIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
.cinematic-skip {
  position: absolute;
  right: 26px;
  bottom: calc(26px + var(--safe-bottom));
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}
.cinematic-skip.show {
  opacity: 1;
  pointer-events: auto;
}
.final-outcome {
  text-align: center;
}
.final-star {
  font-size: clamp(54px, 8vw, 110px);
  line-height: .8;
  margin-bottom: 18px;
  animation: starRise 1.2s ease forwards;
}
.legacy-final {
  margin: -4px 0 20px;
  color: var(--gold-2);
  font-family: var(--font-title);
  text-transform: uppercase;
  font-size: clamp(22px, 3vw, 42px);
  line-height: 1;
}

@media (max-width: 850px) {
  .flashlight-control { left: 10px; bottom: 12px; padding: 9px 12px; font-size: 10px; }
  .symbol-search-mask { background: radial-gradient(circle 145px at var(--x) var(--y), rgba(0,0,0,0) 0%, rgba(0,0,0,.1) 34%, rgba(0,0,0,.72) 78%); }
  .level-two .symbols-base { height: 17vh; gap: 7px; bottom: 8px; }
  .slot { width: 22vw; min-width: 72px; }
  .timeline-piece small { display: none; }
  .legacy-message { bottom: 25%; }
}

/* --- Corrección solicitada: Nivel 2 sin linterna, visible y con distractores clickeables --- */
.level2-visibility-layer {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background:
    radial-gradient(circle at 52% 42%, rgba(255,221,150,.12), rgba(0,0,0,0) 42%),
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.18));
}
.level-two .vignette {
  background:
    radial-gradient(circle at 50% 48%, rgba(0,0,0,0) 0%, rgba(0,0,0,.10) 58%, rgba(0,0,0,.38) 100%),
    linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.05) 45%, rgba(0,0,0,.30));
}
.level-two .symbol-search-mask { display: none !important; }
.level-two .search-object {
  opacity: .96;
  filter: brightness(.92) contrast(1.04) drop-shadow(0 10px 14px rgba(0,0,0,.55));
}
.level-two .sacred-object {
  animation: hiddenBreath 2.8s ease-in-out infinite;
}
@keyframes hiddenBreath {
  50% { filter: brightness(1.04) contrast(1.08) drop-shadow(0 0 13px rgba(243,211,145,.20)) drop-shadow(0 10px 14px rgba(0,0,0,.55)); }
}
.level-two .clickable-decoy {
  cursor: pointer;
}
.level-two .clickable-decoy::after { display: none; }
.level-two .symbols-base {
  z-index: 36;
  height: min(20vh, 158px);
  background: linear-gradient(90deg, rgba(10,6,4,.05), rgba(10,6,4,.72), rgba(10,6,4,.05));
}
.level-two .slot {
  width: clamp(126px, 14vw, 190px);
  height: clamp(86px, 12vh, 130px);
  border: 1px solid rgba(223,184,107,.55);
  background: rgba(12,7,4,.50);
}
.level-two .slot img {
  max-width: 64%;
  max-height: 70%;
  opacity: .34;
  filter: grayscale(1) sepia(.45) brightness(1.18) drop-shadow(0 0 12px rgba(243,211,145,.18));
}
.level-two .slot::before {
  color: #f1dfbd;
  text-shadow: 0 2px 10px #000;
}
.level-two .slot.complete::before { color: var(--gold-2); }
.level-two .slot.complete img { opacity: .16; }
.decoy-d { filter: grayscale(.45) sepia(.25) brightness(.82) saturate(.75) drop-shadow(0 10px 14px rgba(0,0,0,.55)); transform: translate(-50%, -50%) scale(.94) rotate(8deg); }
.decoy-e { filter: hue-rotate(-18deg) saturate(.58) brightness(.86) drop-shadow(0 10px 14px rgba(0,0,0,.55)); transform: translate(-50%, -50%) scale(.9); }
.decoy-f { filter: hue-rotate(30deg) saturate(.55) brightness(.82) drop-shadow(0 10px 14px rgba(0,0,0,.55)); transform: translate(-50%, -50%) scale(.85) rotate(-5deg); }
.decoy-g { filter: grayscale(.25) contrast(.85) brightness(.82) drop-shadow(0 10px 14px rgba(0,0,0,.55)); transform: translate(-50%, -50%) scale(.88) rotate(5deg); }
.modern-low { opacity: .72; filter: grayscale(.15) brightness(.75) drop-shadow(0 10px 14px rgba(0,0,0,.55)); }

/* --- Corrección solicitada: Nivel 3 tarjetas compactas y ayuda visible --- */
.level-three .timeline-slots {
  top: 39%;
  left: 6vw;
  right: 6vw;
  gap: clamp(10px, 1.5vw, 24px);
}
.level-three .time-slot {
  min-height: min(13vh, 112px);
  background: rgba(14,8,5,.58);
}
.level-three .timeline-pieces {
  left: 3vw;
  right: 3vw;
  bottom: calc(30px + var(--safe-bottom));
  min-height: min(15vh, 128px);
}
.level-three .timeline-piece {
  width: clamp(150px, 15vw, 214px);
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 10px;
}
.level-three .timeline-piece strong {
  font-size: clamp(11px, .98vw, 15px);
  line-height: 1.08;
}
.level-three .timeline-piece small {
  font-size: clamp(9px, .70vw, 11px);
  line-height: 1.15;
  opacity: .75;
}
.help-zone {
  position: absolute;
  right: 24px;
  top: calc(158px + var(--safe-top));
  z-index: 90;
  display: none;
  width: min(30vw, 360px);
  pointer-events: auto;
}
.help-zone.show {
  display: grid;
  gap: 8px;
}
.help-zone .help-btn {
  position: static;
  display: inline-block;
  width: max-content;
  min-width: 128px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  justify-self: end;
  box-shadow: 0 0 26px rgba(223,184,107,.18);
}
.hint-panel {
  background: rgba(11,7,4,.78);
  border: 1px solid rgba(223,184,107,.38);
  border-left: 3px solid rgba(243,211,145,.85);
  padding: 12px 14px;
  color: #f3e4ca;
  text-shadow: 0 2px 12px #000;
  backdrop-filter: blur(6px);
  box-shadow: 0 16px 34px rgba(0,0,0,.28);
}
.hint-panel strong {
  display: block;
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  margin-bottom: 5px;
}
.hint-panel span {
  display: block;
  font-size: clamp(12px, 1vw, 15px);
  line-height: 1.35;
}
.hint-panel.active { animation: cardIn .28s ease; }
.level-three .help-btn { top: auto; right: auto; }
.level-three .lightbar {
  top: calc(102px + var(--safe-top));
  right: 24px;
  width: min(31vw, 390px);
}

@media (max-width: 850px) {
  .level-two .symbols-base { height: 18vh; gap: 8px; bottom: 8px; }
  .level-two .slot { width: 22vw; min-width: 76px; }
  .level-two .slot img { max-width: 58%; }
  .level-three .timeline-slots { top: 36%; left: 3vw; right: 3vw; }
  .level-three .timeline-piece { width: 39vw; min-height: 56px; padding: 8px 9px; }
  .level-three .timeline-piece small { display: none; }
  .help-zone { right: 10px; top: 122px; width: 46vw; }
  .hint-panel span { font-size: 11px; }
  .level-three .lightbar { top: 82px; right: 10px; width: 48vw; }
}


/* Modo Historia: dinamismo narrativo */
.chapter-map {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(18px, 3vw, 34px);
  padding: clamp(18px, 5vw, 74px);
  background:
    radial-gradient(circle at 50% 42%, rgba(223,184,107,.14), rgba(0,0,0,0) 36%),
    linear-gradient(90deg, rgba(0,0,0,.68), rgba(0,0,0,.15), rgba(0,0,0,.66));
}
.chapter-head { text-align: center; max-width: 920px; text-shadow: 0 5px 28px #000; }
.chapter-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(42px, 6vw, 92px);
  line-height: .92;
  text-transform: uppercase;
}
.chapter-copy {
  margin: 16px auto 0;
  max-width: 720px;
  color: #ecd9b7;
  font-size: clamp(16px, 1.45vw, 22px);
  line-height: 1.45;
}
.chapter-grid {
  width: min(1050px, 94vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 22px);
}
.chapter-card {
  min-height: clamp(188px, 28vh, 300px);
  border: 1px solid rgba(223,184,107,.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(243,211,145,.15), rgba(0,0,0,0) 45%),
    linear-gradient(180deg, rgba(31,20,12,.82), rgba(8,5,3,.72));
  color: var(--text);
  padding: clamp(18px, 2.4vw, 30px);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 0 60px rgba(223,184,107,.04);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  animation: chapterIn .55s ease forwards;
  animation-delay: var(--delay, 0ms);
}
@keyframes chapterIn { to { opacity: 1; transform: translateY(0); } }
.chapter-card::after {
  content: '';
  position: absolute;
  inset: -60%;
  background: conic-gradient(from 90deg, transparent, rgba(243,211,145,.18), transparent 26%);
  animation: relicSweep 5.5s linear infinite;
  opacity: .42;
}
@keyframes relicSweep { to { transform: rotate(360deg); } }
.chapter-card > * { position: relative; z-index: 2; }
.chapter-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(243,211,145,.75);
  color: var(--gold-2);
  font-family: var(--font-title);
  font-weight: 900;
  margin-bottom: 24px;
}
.chapter-card strong {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.05;
}
.chapter-card small {
  display: block;
  margin-top: 10px;
  color: #d8c6a7;
  font-size: clamp(13px, 1.1vw, 16px);
}
.chapter-card em {
  display: inline-block;
  margin-top: 24px;
  color: var(--gold-2);
  font-style: normal;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 12px;
}
.chapter-card.is-sealed {
  filter: grayscale(.85) brightness(.62);
  cursor: not-allowed;
}
.map-archive { margin-top: 2px; }

.object-discovery {
  position: absolute;
  z-index: 155;
  width: min(390px, 36vw);
  min-width: 290px;
  transform: translate(-50%, -50%);
  padding: clamp(16px, 1.6vw, 24px);
  background:
    radial-gradient(circle at 20% 0%, rgba(243,211,145,.14), rgba(0,0,0,0) 48%),
    linear-gradient(180deg, rgba(30,19,12,.96), rgba(10,6,4,.90));
  border: 1px solid rgba(223,184,107,.62);
  border-left: 3px solid rgba(243,211,145,.95);
  box-shadow: 0 20px 70px rgba(0,0,0,.65), 0 0 38px rgba(223,184,107,.16);
  color: var(--text);
  pointer-events: auto;
  animation: memoryCardIn .25s ease forwards;
}
.object-discovery::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 32px;
  width: 20px;
  height: 20px;
  background: rgba(30,19,12,.96);
  border-left: 1px solid rgba(223,184,107,.62);
  border-bottom: 1px solid rgba(223,184,107,.62);
  transform: rotate(45deg);
}
.object-discovery.closing { animation: memoryCardOut .22s ease forwards; }
@keyframes memoryCardIn { from { opacity: 0; transform: translate(-50%, -43%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes memoryCardOut { to { opacity: 0; transform: translate(-50%, -58%) scale(.96); } }
.object-discovery-title {
  margin: 2px 0 10px;
  font-family: var(--font-title);
  font-size: clamp(22px, 2.3vw, 34px);
  line-height: 1.03;
}
.object-discovery-body {
  color: #f1dfc3;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.5;
}
.mini-btn {
  margin-top: 14px !important;
  min-height: 42px;
  padding: 10px 18px !important;
  font-size: 13px !important;
}
.memory-focus {
  animation: memoryFocus 1.2s ease-in-out infinite;
}
@keyframes memoryFocus {
  50% { filter: brightness(1.42) drop-shadow(0 0 26px rgba(243,211,145,.78)) drop-shadow(0 10px 18px rgba(0,0,0,.6)); }
}

.score-pop {
  position: absolute;
  z-index: 180;
  transform: translate(-50%, -50%);
  color: #ffe9a6;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: clamp(18px, 1.8vw, 28px);
  text-shadow: 0 2px 12px #000;
  pointer-events: none;
  animation: scorePop .9s ease forwards;
}
@keyframes scorePop {
  to { opacity: 0; transform: translate(-50%, -145%) scale(1.15); }
}

.level-one .item.hard-hidden {
  opacity: .86;
  transform-origin: center;
}
.level-one .item.hard-hidden:hover {
  filter: brightness(1.15) drop-shadow(0 0 18px rgba(243,211,145,.3));
}
.level-two .bg {
  filter: brightness(1.16) saturate(1.05) contrast(1.02) !important;
}
.level-two .vignette {
  background:
    radial-gradient(circle at 50% 48%, rgba(0,0,0,0) 0%, rgba(0,0,0,.04) 58%, rgba(0,0,0,.22) 100%),
    linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.02) 45%, rgba(0,0,0,.16)) !important;
}
.level-two .level2-visibility-layer {
  background:
    radial-gradient(circle at 52% 42%, rgba(255,221,150,.11), rgba(0,0,0,0) 42%),
    linear-gradient(180deg, rgba(255,240,190,.04), rgba(0,0,0,.05)) !important;
}
.level-two .slot {
  border-radius: 18px;
  box-shadow: inset 0 0 24px rgba(223,184,107,.08), 0 12px 30px rgba(0,0,0,.28);
}
.level-two .slot img {
  opacity: .24;
  max-width: 64%;
}
.level-two .slot.complete img { opacity: .08; }
.level-two .symbol {
  transform-origin: center;
}
.level-two .symbol.is-dragging {
  filter: brightness(1.22) drop-shadow(0 0 26px rgba(243,211,145,.38)) drop-shadow(0 16px 26px rgba(0,0,0,.55));
}

.timeline-info {
  position: absolute;
  right: clamp(16px, 2.5vw, 40px);
  top: clamp(170px, 21vh, 220px);
  z-index: 42;
  width: min(330px, 30vw);
  min-height: 130px;
  padding: 18px 20px;
  border: 1px solid rgba(223,184,107,.42);
  background: linear-gradient(180deg, rgba(24,15,9,.86), rgba(10,6,4,.76));
  box-shadow: 0 18px 52px rgba(0,0,0,.45);
  opacity: .88;
}
.timeline-info strong {
  display: block;
  color: var(--gold-2);
  font-family: var(--font-title);
  font-size: clamp(19px, 1.6vw, 25px);
  line-height: 1.1;
  margin-bottom: 8px;
}
.timeline-info span {
  display: block;
  color: #ecdcc2;
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.45;
}
.timeline-info.active {
  animation: panelPulse .38s ease;
}
@keyframes panelPulse {
  50% { transform: translateY(-4px); box-shadow: 0 18px 56px rgba(0,0,0,.5), 0 0 28px rgba(223,184,107,.18); }
}
.level-three .timeline-piece {
  width: min(13.2vw, 172px) !important;
  min-height: 78px;
  padding: 12px 12px 10px;
  border-radius: 12px;
}
.level-three .timeline-piece strong {
  font-size: clamp(15px, 1.15vw, 20px);
}
.level-three .timeline-piece small {
  font-size: clamp(10px, .78vw, 13px);
  line-height: 1.25;
}
.level-three .timeline-slots {
  top: 39%;
  gap: clamp(8px, 1.2vw, 18px);
}
.level-three .time-slot {
  min-height: 112px;
}
.help-zone {
  max-width: min(380px, 32vw);
}
.hint-panel strong {
  font-family: var(--font-title);
}
.final-outcome {
  width: min(760px, 84vw);
  padding-block: clamp(32px, 5vw, 58px);
}
.final-star {
  animation: starPulse 1.3s ease-in-out infinite;
}
@keyframes starPulse {
  50% { transform: scale(1.12) rotate(6deg); filter: drop-shadow(0 0 25px rgba(255,235,150,.92)); }
}

@media (max-width: 900px) {
  .chapter-grid { grid-template-columns: 1fr; max-height: 56vh; overflow: auto; }
  .chapter-card { min-height: 140px; }
  .object-discovery { width: min(92vw, 380px); left: 50% !important; top: 46% !important; }
  .timeline-info { display: none; }
  .level-three .timeline-piece { width: min(36vw, 150px) !important; }
}

/* =====================================================
   CORRECCIONES FINALES GAMIFICACIÓN
   - Interfaz más compacta en PC/laptop.
   - Menú de umbrales visible completo en 1366x768.
   - Scrollbar visual oculta sin alterar interacción interna.
   - Activos WebP reducidos para cargar más rápido.
   ===================================================== */
html,
body,
.codex-body,
.chapter-grid {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.codex-body::-webkit-scrollbar,
.chapter-grid::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.bg {
  transform: scale(1.005);
}

.menu {
  padding: clamp(18px, 3.2vw, 46px);
}
.menu-copy {
  width: min(620px, 84vw);
  margin-left: min(4vw, 52px);
}
.main-title {
  font-size: clamp(40px, 6.25vw, 88px);
  line-height: .9;
  margin-bottom: 14px;
}
.typewriter {
  max-width: 620px;
  margin-inline: auto;
  font-size: clamp(14px, 1.15vw, 18px);
  line-height: 1.45;
}
.menu-actions {
  margin-top: 20px;
  gap: 10px;
}
.btn {
  min-width: 160px;
  min-height: 46px;
  padding: 11px 18px;
}

.hud {
  top: calc(12px + var(--safe-top));
  left: 14px;
  right: 14px;
  gap: 12px;
}
.hud__left {
  max-width: min(52vw, 720px);
  padding: 10px 14px 12px;
}
.hud__title {
  font-size: clamp(16px, 1.55vw, 24px);
}
.hud__objective {
  font-size: clamp(11px, .95vw, 14px);
}
.hud__right {
  gap: 9px;
  padding: 8px 10px;
}
.hud-value { font-size: 16px; }
.hud-btn { height: 36px; padding: 0 12px; }
.life { width: 14px; height: 26px; }

.chapter-map {
  align-content: center;
  gap: clamp(12px, 2vw, 22px);
  padding: clamp(16px, 3vw, 44px);
}
.chapter-head {
  max-width: 780px;
}
.chapter-title {
  max-width: 780px;
  font-size: clamp(34px, 4.6vw, 66px);
  line-height: .92;
  letter-spacing: -.01em;
}
.chapter-copy {
  max-width: 660px;
  margin-top: 10px;
  font-size: clamp(14px, 1.05vw, 17px);
  line-height: 1.38;
}
.chapter-grid {
  width: min(980px, 92vw);
  gap: clamp(10px, 1.45vw, 18px);
}
.chapter-card {
  min-height: clamp(150px, 22vh, 210px);
  padding: clamp(14px, 1.8vw, 22px);
}
.chapter-mark {
  width: 38px;
  height: 38px;
  margin-bottom: 15px;
}
.chapter-card strong {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.06;
}
.chapter-card small {
  margin-top: 8px;
  font-size: clamp(12px, .95vw, 14px);
  line-height: 1.3;
}
.chapter-card em {
  margin-top: 16px;
  font-size: 11px;
}
.map-archive {
  margin-top: 0;
  min-height: 42px;
}

.boot-title,
.intro-title,
.outcome-title,
.codex-title {
  font-size: clamp(30px, 4.2vw, 56px);
}
.boot-box,
.intro-copy,
.outcome-copy,
.codex-copy {
  width: min(820px, 90vw);
}
.intro-body,
.outcome-body,
.codex-body {
  font-size: clamp(14px, 1.1vw, 18px);
}

.object-discovery {
  width: min(350px, 32vw);
  min-width: 260px;
  padding: clamp(14px, 1.35vw, 20px);
}
.object-discovery-title,
.discovery-title {
  font-size: clamp(24px, 3vw, 42px);
}
.object-discovery-body,
.discovery-body {
  font-size: clamp(13px, 1.05vw, 16px);
}

.level-two .symbols-base {
  height: min(16vh, 122px);
}
.level-two .slot {
  width: clamp(106px, 11vw, 156px);
  height: clamp(74px, 10vh, 104px);
}
.level-three .timeline-slots {
  top: 37%;
  left: 5vw;
  right: 5vw;
}
.level-three .time-slot {
  min-height: min(12vh, 96px);
}
.level-three .timeline-pieces {
  bottom: calc(22px + var(--safe-bottom));
  min-height: min(13vh, 108px);
}
.level-three .timeline-piece {
  width: min(12vw, 156px) !important;
  min-height: 64px;
  padding: 9px 10px;
}
.level-three .timeline-piece strong {
  font-size: clamp(12px, .95vw, 16px);
}
.level-three .timeline-piece small {
  font-size: clamp(9px, .68vw, 11px);
}
.timeline-info {
  width: min(300px, 27vw);
  top: clamp(142px, 18vh, 188px);
  min-height: 112px;
  padding: 14px 16px;
}
.help-zone {
  top: calc(138px + var(--safe-top));
  max-width: min(330px, 28vw);
}
.level-three .lightbar {
  top: calc(88px + var(--safe-top));
  width: min(29vw, 340px);
}

@media (max-height: 780px) and (min-width: 900px) {
  .chapter-map { gap: 12px; padding: 18px 28px; }
  .chapter-title { font-size: clamp(32px, 4.2vw, 56px); }
  .chapter-copy { font-size: 14px; line-height: 1.32; }
  .chapter-card { min-height: 150px; padding: 14px 18px; }
  .chapter-mark { width: 34px; height: 34px; margin-bottom: 12px; }
  .chapter-card strong { font-size: clamp(19px, 1.85vw, 25px); }
  .chapter-card small { font-size: 12px; }
  .chapter-card em { margin-top: 12px; }
  .map-archive { min-height: 40px; padding-block: 8px; }

  .main-title { font-size: clamp(38px, 5.7vw, 72px); }
  .menu-copy { width: min(560px, 82vw); }
  .typewriter { font-size: 14px; max-width: 560px; }
  .btn { min-height: 42px; }
}

@media (max-width: 900px) {
  .chapter-map { align-content: start; overflow: hidden; }
  .chapter-grid { max-height: 58vh; overflow-y: auto; }
  .chapter-title { font-size: clamp(34px, 10vw, 58px); }
  .chapter-card { min-height: 122px; }
  .menu-copy { margin-left: 0; width: 92vw; }
}

/* =====================================================
   AJUSTES SOLICITADOS - FLUJO AUTOMÁTICO + MOBILE
   ===================================================== */
html,
body,
.game {
  overscroll-behavior: none;
}
body {
  touch-action: none;
}
.menu-actions {
  opacity: 1;
  transform: none;
}
.typewriter,
.intro-body,
.object-discovery-body {
  animation: none !important;
}

/* Menú de niveles retirado del flujo del juego */
.chapter-map-scene .chapter-map {
  display: none !important;
}

/* Cinemática/recompensa automática por nivel */
.reward-cinematic {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(18px, 4vw, 54px);
  background: radial-gradient(circle at 50% 42%, rgba(236, 177, 78, .22), rgba(0,0,0,.52) 56%, rgba(0,0,0,.84) 100%);
}
.reward-glow {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,240,168,.36), rgba(223,184,107,.10) 24%, rgba(0,0,0,0) 58%),
    conic-gradient(from 0deg, rgba(223,184,107,0), rgba(223,184,107,.22), rgba(223,184,107,0), rgba(223,184,107,.18), rgba(223,184,107,0));
  filter: blur(2px);
  animation: rewardGlow 5.2s linear forwards;
}
@keyframes rewardGlow {
  from { transform: scale(1) rotate(0deg); opacity: .8; }
  to { transform: scale(1.12) rotate(18deg); opacity: .42; }
}
.reward-badge {
  position: absolute;
  top: clamp(42px, 10vh, 98px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  text-shadow: 0 5px 26px #000;
  pointer-events: none;
}
.reward-star {
  color: #fff0a8;
  font-size: clamp(76px, 12vw, 172px);
  line-height: .7;
  text-shadow: 0 0 20px rgba(255,240,168,.96), 0 0 52px rgba(223,184,107,.86);
  animation: starRise 1.35s cubic-bezier(.18,.9,.2,1.14) forwards, starPulse 1.6s ease-in-out 1.35s infinite;
}
.reward-fragment {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 7px 16px;
  border: 1px solid rgba(255, 230, 157, .62);
  border-radius: 999px;
  background: rgba(14, 8, 5, .68);
  color: #ffe7a4;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: clamp(11px, 1vw, 14px);
  font-weight: 900;
  backdrop-filter: blur(6px);
}
.reward-card {
  position: relative;
  z-index: 2;
  width: min(760px, 90vw);
  margin-top: clamp(130px, 22vh, 210px);
  padding: clamp(22px, 4vw, 44px);
  text-align: center;
  border: 1px solid rgba(223,184,107,.52);
  border-left: 3px solid rgba(255,230,157,.86);
  border-right: 3px solid rgba(255,230,157,.22);
  background: linear-gradient(180deg, rgba(24,15,9,.88), rgba(9,6,4,.78));
  box-shadow: 0 26px 76px rgba(0,0,0,.55), inset 0 0 58px rgba(223,184,107,.08);
  backdrop-filter: blur(7px);
  animation: rewardCardIn .62s ease .42s both;
}
@keyframes rewardCardIn {
  from { opacity: 0; transform: translateY(22px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.reward-title {
  margin: 0 0 12px;
  font-family: var(--font-title);
  font-size: clamp(30px, 5vw, 66px);
  line-height: .96;
  text-transform: uppercase;
}
.reward-body {
  color: #f2e3c9;
  font-size: clamp(14px, 1.25vw, 18px);
  line-height: 1.48;
  white-space: pre-line;
}
.reward-prize {
  display: inline-grid;
  gap: 4px;
  margin: 18px auto 16px;
  padding: 12px 18px;
  min-width: min(420px, 84vw);
  border-radius: 18px;
  border: 1px solid rgba(255, 230, 157, .42);
  background: radial-gradient(circle at 50% 0%, rgba(255,226,137,.18), rgba(56,35,18,.58));
  box-shadow: inset 0 0 34px rgba(223,184,107,.09);
}
.reward-prize strong {
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
}
.reward-prize span {
  color: #fff3d0;
  font-family: var(--font-title);
  font-size: clamp(18px, 2.1vw, 30px);
  line-height: 1;
}
.reward-progress {
  width: min(460px, 80vw);
  height: 7px;
  margin: 0 auto 10px;
  overflow: hidden;
  border: 1px solid rgba(223,184,107,.38);
  background: rgba(6,4,3,.68);
}
.reward-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #8a6233, #efad53, #fff0a8);
  animation: rewardProgress 5.2s linear forwards;
}
@keyframes rewardProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.reward-next {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .10em;
  font-weight: 800;
}
.reward-skip {
  min-height: 42px;
  min-width: 150px;
  padding-block: 9px;
}

/* Nivel 2: PNG únicos sin bordes y siluetas oscuras legibles */
.level-two .slot {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(221, 176, 102, .20), rgba(15, 9, 5, .62));
  border-color: rgba(245, 211, 145, .62);
  box-shadow: inset 0 0 30px rgba(0,0,0,.18), 0 14px 34px rgba(0,0,0,.34);
}
.level-two .slot img {
  opacity: .48 !important;
  filter: brightness(0) saturate(0) opacity(.82) drop-shadow(0 0 14px rgba(255,225,150,.16)) !important;
  max-width: 70% !important;
  max-height: 72% !important;
}
.level-two .slot.complete img {
  opacity: .09 !important;
}
.level-two .symbol,
.level-two .distractor {
  image-rendering: auto;
  backface-visibility: hidden;
}

/* Mobile: interfaz compacta y elementos jugables con dedo */
@media (max-width: 700px), (pointer: coarse) {
  html, body { height: 100svh; }
  .game { height: 100svh; min-height: 100svh; }
  .bg { transform: scale(1.01); }
  .hud {
    top: calc(6px + var(--safe-top));
    left: 8px;
    right: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .hud__left {
    max-width: none;
    padding: 7px 10px;
    border-left-width: 1px;
    background: linear-gradient(90deg, rgba(17,11,7,.82), rgba(17,11,7,.36));
  }
  .hud__title { font-size: clamp(14px, 4.4vw, 18px); }
  .hud__objective { display: none; }
  .hud__right {
    justify-content: space-between;
    gap: 6px;
    padding: 6px 7px;
    border-radius: 14px;
  }
  .hud-label { font-size: 7px; letter-spacing: .08em; }
  .hud-value { font-size: 13px; }
  .life { width: 11px; height: 21px; }
  .hud-btn { height: 30px; padding: 0 9px; font-size: 11px; }
  .audio-toggle { right: 8px; bottom: calc(8px + var(--safe-bottom)); padding: 7px 10px; font-size: 10px; }
  .toast { top: calc(92px + var(--safe-top)); padding: 10px 12px; font-size: 12px; }

  .menu { padding: 18px; place-items: center; }
  .menu-copy { width: 92vw; margin-left: 0; }
  .main-title { font-size: clamp(38px, 15vw, 68px); }
  .typewriter { font-size: 13px; line-height: 1.42; }
  .menu-actions { gap: 8px; margin-top: 16px; }
  .btn { min-width: 144px; min-height: 42px; padding: 10px 14px; font-size: 13px; }

  .intro-copy,
  .outcome-copy,
  .codex-copy {
    width: min(92vw, 480px);
    padding: 20px 18px;
  }
  .intro-title,
  .outcome-title,
  .codex-title { font-size: clamp(28px, 9vw, 44px); }
  .intro-body,
  .outcome-body,
  .codex-body { font-size: 13px; line-height: 1.42; }

  .flashlight-control { left: 8px; bottom: calc(8px + var(--safe-bottom)); padding: 8px 11px; font-size: 9px; }
  .flashlight-layer { --r: 118px; }
  .level-one .item { width: clamp(42px, 11vw, 66px) !important; }
  .level-one .distractor { width: clamp(42px, 10vw, 64px) !important; }
  .object-discovery {
    width: min(92vw, 360px) !important;
    min-width: 0;
    left: 50% !important;
    top: 50% !important;
    padding: 16px;
  }
  .object-discovery::before { display: none; }

  .level-two .symbols-base {
    left: 2vw;
    right: 2vw;
    bottom: calc(8px + var(--safe-bottom));
    height: 14.5vh;
    gap: 5px;
  }
  .level-two .slot {
    width: 23vw !important;
    min-width: 68px !important;
    height: clamp(70px, 11vh, 88px) !important;
    border-radius: 12px;
  }
  .level-two .slot::before { bottom: 5px; font-size: 8px; letter-spacing: .02em; }
  .level-two .slot img { max-width: 62% !important; max-height: 62% !important; }
  .level-two .symbol,
  .level-two .distractor {
    width: clamp(46px, 13vw, 76px) !important;
  }

  .level-three .lightbar { top: calc(72px + var(--safe-top)); left: 8px; right: auto; width: 46vw; }
  .help-zone { top: calc(72px + var(--safe-top)); right: 8px; width: 46vw; }
  .hint-panel { padding: 8px 9px; }
  .hint-panel strong { font-size: 9px; }
  .hint-panel span { font-size: 10px; line-height: 1.25; }
  .level-three .timeline-slots {
    top: 31%;
    left: 5vw;
    right: 5vw;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 10px;
  }
  .level-three .time-slot {
    min-height: 72px;
    padding: 8px;
  }
  .time-slot::before { top: -14px; left: 8px; font-size: 26px; }
  .time-slot span { font-size: 10px; }
  .level-three .timeline-pieces {
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 32vh;
  }
  .level-three .timeline-piece {
    width: min(38vw, 148px) !important;
    min-height: 58px;
    padding: 8px 9px;
  }
  .level-three .timeline-piece strong { font-size: 12px; }
  .level-three .timeline-piece small { display: none; }
  .timeline-info { display: none; }

  .reward-cinematic { padding: 14px; place-items: end center; }
  .reward-badge { top: calc(42px + var(--safe-top)); }
  .reward-star { font-size: clamp(72px, 26vw, 118px); }
  .reward-card {
    width: 92vw;
    margin-top: 0;
    margin-bottom: calc(18px + var(--safe-bottom));
    padding: 18px 16px;
  }
  .reward-title { font-size: clamp(28px, 9.5vw, 44px); }
  .reward-body { font-size: 12px; line-height: 1.35; }
  .reward-prize { margin: 12px auto; padding: 10px 12px; border-radius: 14px; }
  .reward-prize span { font-size: 18px; }
  .reward-next { font-size: 10px; }
  .legacy-message { bottom: 20%; font-size: clamp(30px, 10vw, 52px); }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hud { flex-direction: row; align-items: flex-start; }
  .hud__left { max-width: 45vw; }
  .hud__objective { display: none; }
  .level-two .symbols-base { height: 18vh; }
  .level-two .slot { height: 66px !important; }
  .level-three .timeline-slots { top: 30%; grid-template-columns: repeat(4, 1fr); }
  .level-three .time-slot { min-height: 62px; }
  .level-three .timeline-piece { width: min(21vw, 132px) !important; min-height: 50px; }
  .reward-card { margin-bottom: 10px; padding: 14px 18px; }
  .reward-badge { top: 18px; }
  .reward-star { font-size: 72px; }
}
.reward-prize::before {
  content: '★';
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: -2px auto 2px;
  border-radius: 50%;
  color: #2b1a0d;
  background: linear-gradient(180deg, #fff0a8, #c98e45);
  box-shadow: 0 0 24px rgba(255,240,168,.48);
  font-weight: 900;
}

/* =====================================================
   AJUSTES EXTRA SOLICITADOS 25/06
   ===================================================== */

/* Nivel 1: ocultar cursor dentro de la escena de linterna */
.level-one,
.level-one .scene-content,
.level-one .item,
.level-one .distractor,
.level-one .flashlight-layer,
.level-one .darkness-extra {
  cursor: none !important;
}
.level-one .flashlight-control,
.level-one .btn,
.level-one .hud-btn,
.level-one .audio-toggle {
  cursor: pointer !important;
}

/* Recompensa entre niveles: más compacta y centrada */
.reward-cinematic {
  place-items: center !important;
  padding: clamp(16px, 2.6vw, 28px) !important;
}
.reward-badge {
  top: clamp(22px, 7vh, 54px) !important;
}
.reward-card {
  width: min(640px, 78vw) !important;
  margin-top: clamp(112px, 15vh, 148px) !important;
  padding: clamp(18px, 2.6vw, 28px) !important;
}
.reward-title {
  font-size: clamp(28px, 4.2vw, 54px) !important;
}
.reward-body {
  font-size: clamp(13px, 1.08vw, 16px) !important;
}
.reward-prize {
  min-width: min(360px, 74vw) !important;
}
@media (max-width: 700px), (pointer: coarse) {
  .reward-cinematic {
    place-items: center !important;
  }
  .reward-card {
    width: min(92vw, 450px) !important;
    margin-top: 94px !important;
    margin-bottom: 0 !important;
  }
}

/* Nivel 2: elementos más visibles, siluetas más oscuras y grandes */
.level-two .search-object {
  opacity: 1 !important;
  filter: brightness(.96) saturate(1.03) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important;
}
.level-two .search-object:hover,
.level-two .search-object.is-dragging {
  filter: brightness(1.12) saturate(1.08) drop-shadow(0 0 28px rgba(243,211,145,.40)) drop-shadow(0 18px 28px rgba(0,0,0,.60)) !important;
}
.level-two .decoy-a { filter: hue-rotate(-8deg) saturate(.92) brightness(.88) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .decoy-b { filter: hue-rotate(18deg) saturate(.84) brightness(.84) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .decoy-c { filter: hue-rotate(36deg) saturate(.78) brightness(.86) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .decoy-d { filter: hue-rotate(52deg) saturate(.82) brightness(.88) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .decoy-e { filter: hue-rotate(74deg) saturate(.80) brightness(.87) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .decoy-f { filter: hue-rotate(98deg) saturate(.84) brightness(.86) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .decoy-g { filter: hue-rotate(126deg) saturate(.76) brightness(.84) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .decoy-h { filter: hue-rotate(146deg) saturate(.85) brightness(.87) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .decoy-i { filter: hue-rotate(176deg) saturate(.82) brightness(.86) drop-shadow(0 18px 26px rgba(0,0,0,.62)) !important; }
.level-two .symbols-base {
  height: min(22vh, 182px) !important;
  gap: clamp(12px, 2.2vw, 34px) !important;
}
.level-two .slot {
  width: clamp(136px, 16.4vw, 220px) !important;
  height: clamp(98px, 13.2vh, 146px) !important;
  border-radius: 20px !important;
  background: linear-gradient(180deg, rgba(225,182,109,.23), rgba(16,10,6,.70)) !important;
  box-shadow: inset 0 0 38px rgba(0,0,0,.28), 0 18px 36px rgba(0,0,0,.40) !important;
}
.level-two .slot::before {
  bottom: 7px !important;
  font-size: 13px !important;
}
.level-two .slot img {
  opacity: .82 !important;
  filter: brightness(0) saturate(0) contrast(1.18) opacity(.95) drop-shadow(0 0 26px rgba(0,0,0,.26)) !important;
  max-width: 84% !important;
  max-height: 82% !important;
}
.level-two .slot.complete img {
  opacity: .12 !important;
}
@media (max-width: 700px), (pointer: coarse) {
  .level-two .symbols-base {
    height: 16vh !important;
    gap: 6px !important;
  }
  .level-two .slot {
    width: 23.5vw !important;
    min-width: 72px !important;
    height: clamp(76px, 12vh, 96px) !important;
  }
  .level-two .slot img {
    max-width: 78% !important;
    max-height: 76% !important;
  }
  .level-two .symbol,
  .level-two .distractor {
    width: clamp(54px, 14vw, 84px) !important;
  }
}

/* Nivel 3: cards más grandes y paneles separados */
.level-three .lightbar {
  top: calc(106px + var(--safe-top)) !important;
  right: 18px !important;
  width: min(25vw, 340px) !important;
}
.level-three .timeline-slots {
  left: 4vw !important;
  right: min(31vw, 410px) !important;
  top: 39% !important;
  gap: clamp(12px, 1.4vw, 20px) !important;
}
.level-three .time-slot {
  min-height: 124px !important;
  padding: 14px 10px !important;
  background: rgba(14,8,5,.68) !important;
}
.level-three .time-slot span {
  font-size: 13px !important;
}
.level-three .timeline-pieces {
  left: 3vw !important;
  right: 3vw !important;
  bottom: calc(28px + var(--safe-bottom)) !important;
  min-height: 22vh !important;
}
.level-three .timeline-piece {
  width: min(16vw, 214px) !important;
  min-height: 104px !important;
  padding: 14px 14px 12px !important;
  border-radius: 14px !important;
}
.level-three .timeline-piece strong {
  font-size: clamp(17px, 1.28vw, 22px) !important;
}
.level-three .timeline-piece small {
  display: block !important;
  font-size: clamp(11px, .92vw, 14px) !important;
  line-height: 1.3 !important;
}
.help-zone {
  top: calc(160px + var(--safe-top)) !important;
  right: 18px !important;
  width: min(25vw, 340px) !important;
  max-width: none !important;
}
.hint-panel,
.timeline-info {
  border-radius: 18px;
  border: 1px solid rgba(223,184,107,.48) !important;
  background: linear-gradient(180deg, rgba(24,15,9,.92), rgba(10,6,4,.82)) !important;
  box-shadow: 0 18px 52px rgba(0,0,0,.46) !important;
}
.hint-panel {
  min-height: 126px;
}
.hint-panel strong,
.timeline-info strong {
  font-size: clamp(20px, 1.55vw, 26px) !important;
}
.hint-panel span,
.timeline-info span {
  font-size: clamp(13px, 1.02vw, 16px) !important;
  line-height: 1.48 !important;
}
.timeline-info {
  right: 18px !important;
  top: calc(318px + var(--safe-top)) !important;
  width: min(25vw, 340px) !important;
  min-height: 200px !important;
}
@media (max-width: 1100px) {
  .level-three .timeline-slots {
    right: min(34vw, 360px) !important;
  }
  .level-three .timeline-piece {
    width: min(18vw, 196px) !important;
  }
}
@media (max-width: 700px), (pointer: coarse) {
  .level-three .lightbar {
    top: calc(72px + var(--safe-top)) !important;
    left: 8px !important;
    right: auto !important;
    width: 44vw !important;
  }
  .help-zone {
    top: calc(72px + var(--safe-top)) !important;
    right: 8px !important;
    width: 44vw !important;
  }
  .hint-panel {
    min-height: 118px;
  }
  .timeline-info {
    display: none !important;
  }
  .level-three .timeline-slots {
    left: 4vw !important;
    right: 4vw !important;
    top: 33% !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px 10px !important;
  }
  .level-three .time-slot {
    min-height: 84px !important;
  }
  .level-three .timeline-pieces {
    min-height: 34vh !important;
  }
  .level-three .timeline-piece {
    width: min(41vw, 176px) !important;
    min-height: 74px !important;
    padding: 10px 10px 9px !important;
  }
  .level-three .timeline-piece strong {
    font-size: 13px !important;
  }
  .level-three .timeline-piece small {
    display: block !important;
    font-size: 10px !important;
  }
}

/* Final del nivel 3: animación + QR + botón YouTube */
.final-portal {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding: clamp(20px, 4vw, 54px);
}
.final-stage,
.final-side-card {
  position: relative;
  border: 1px solid rgba(223,184,107,.5);
  background: linear-gradient(180deg, rgba(18,11,7,.88), rgba(10,6,4,.78));
  box-shadow: 0 26px 70px rgba(0,0,0,.55), inset 0 0 42px rgba(223,184,107,.1);
  backdrop-filter: blur(8px);
  border-radius: 18px;
}
.final-stage {
  min-height: min(68vh, 640px);
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(28px, 4vw, 48px);
}
.final-stage-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, rgba(255,226,136,.28), rgba(176,95,23,.12) 28%, rgba(0,0,0,0) 60%);
  animation: glowBreath 2.6s ease-in-out infinite;
}
.final-stage-ring {
  position: absolute;
  left: 50%;
  top: 40%;
  border-radius: 50%;
  border: 1.5px solid rgba(255,226,136,.25);
  transform: translate(-50%, -50%);
}
.final-stage-ring.ring-a {
  width: clamp(180px, 28vw, 340px);
  height: clamp(180px, 28vw, 340px);
  animation: slowSpin 14s linear infinite;
}
.final-stage-ring.ring-b {
  width: clamp(240px, 36vw, 430px);
  height: clamp(240px, 36vw, 430px);
  animation: slowSpinReverse 18s linear infinite;
}
@keyframes slowSpin { from { transform: translate(-50%, -50%) rotate(0deg);} to { transform: translate(-50%, -50%) rotate(360deg);} }
@keyframes slowSpinReverse { from { transform: translate(-50%, -50%) rotate(360deg);} to { transform: translate(-50%, -50%) rotate(0deg);} }
.final-stage-star {
  position: relative;
  z-index: 2;
  color: #fff0a8;
  font-size: clamp(84px, 12vw, 180px);
  line-height: .8;
  text-shadow: 0 0 20px rgba(255,240,168,.96), 0 0 52px rgba(223,184,107,.86);
  animation: starPulse 1.6s ease-in-out infinite;
}
.final-stage-title {
  position: relative;
  z-index: 2;
  margin: 10px 0 12px;
  font-family: var(--font-title);
  font-size: clamp(38px, 5vw, 74px);
  line-height: .92;
  text-transform: uppercase;
}
.final-stage-copy {
  position: relative;
  z-index: 2;
  max-width: 620px;
  color: #f2e3c9;
  font-size: clamp(15px, 1.25vw, 20px);
  line-height: 1.52;
}
.final-side-card {
  padding: clamp(24px, 3vw, 36px);
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}
.final-side-card .kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
  font-weight: 700;
  color: #d6ad5f;
}
.final-side-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(28px, 3vw, 44px);
  line-height: .98;
  text-transform: uppercase;
}
.final-qr-wrap {
  width: min(220px, 55vw);
  aspect-ratio: 1;
  padding: 14px;
  background: #fff9f0;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 12px 28px rgba(0,0,0,.3), 0 0 40px rgba(223,184,107,.15);
  transition: transform .3s ease, box-shadow .3s ease;
}
.final-qr-wrap:hover {
  transform: scale(1.04);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 16px 36px rgba(0,0,0,.35), 0 0 50px rgba(223,184,107,.25);
}
.final-qr {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.final-side-text {
  margin: 0;
  color: #ead7bd;
  font-size: 14px;
  line-height: 1.45;
  max-width: 280px;
}
.final-go-btn,
.final-restart-btn {
  width: min(280px, 100%);
}
.final-go-btn {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 12px;
  background: linear-gradient(135deg, #d6ad5f, #b07317);
  color: #1a0e05;
  border: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 16px rgba(214,173,95,.35);
}
.final-go-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(214,173,95,.5);
}
.final-restart-btn {
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .03em;
  border-radius: 12px;
  background: transparent;
  color: #d6ad5f;
  border: 1.5px solid rgba(214,173,95,.4);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.final-restart-btn:hover {
  background: rgba(214,173,95,.1);
  border-color: rgba(214,173,95,.7);
}
@media (max-width: 900px) {
  .final-portal {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .final-stage {
    min-height: 44vh;
  }
  .final-side-card {
    padding: 20px;
  }
  .final-qr-wrap {
    width: min(200px, 52vw);
  }
}

/* =====================================================
   AJUSTES EXTRA V3
   ===================================================== */

/* Nivel 2: siluetas dentro del recuadro */
.level-two .slot {
  overflow: hidden !important;
  isolation: isolate;
  padding: 8px 10px 24px !important;
}
.level-two .slot img {
  position: absolute !important;
  left: 50% !important;
  top: 44% !important;
  transform: translate(-50%, -50%) !important;
  width: 72% !important;
  height: 72% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain !important;
  object-position: center center !important;
  filter: brightness(0) saturate(0) contrast(1.12) opacity(.9) !important;
}
.level-two .slot.complete img {
  opacity: .1 !important;
}

/* Nivel 1: indicador de selección */
.select-hint {
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 130;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(243,211,145,.62);
  background: rgba(15, 9, 5, .88);
  color: #fff4d0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
.select-hint.show {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 6px));
}
.select-finger {
  font-size: 16px;
  line-height: 1;
  animation: fingerPulse 1s ease-in-out infinite;
}
@keyframes fingerPulse {
  50% { transform: translateY(-2px) scale(1.12); }
}
@media (max-width: 700px), (pointer: coarse) {
  .select-hint { display: none !important; }
}

/* Nivel 3: lado derecho más sutil */
.level-three .lightbar {
  width: min(22vw, 290px) !important;
}
.help-zone {
  width: min(22vw, 290px) !important;
  top: calc(156px + var(--safe-top)) !important;
}
.help-zone .help-btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}
.hint-panel {
  min-height: 88px !important;
  padding: 12px 14px !important;
  opacity: .82;
}
.hint-panel strong {
  font-size: clamp(16px, 1.24vw, 21px) !important;
  margin-bottom: 4px;
}
.hint-panel span {
  font-size: clamp(12px, .92vw, 14px) !important;
  line-height: 1.36 !important;
}
.timeline-info {
  width: min(22vw, 290px) !important;
  min-height: 116px !important;
  top: calc(274px + var(--safe-top)) !important;
  padding: 14px 16px !important;
  opacity: .7;
}
.timeline-info strong {
  font-size: clamp(16px, 1.18vw, 20px) !important;
  margin-bottom: 5px;
}
.timeline-info span {
  font-size: clamp(12px, .9vw, 14px) !important;
  line-height: 1.38 !important;
}
.level-three .timeline-slots {
  right: min(27vw, 330px) !important;
}
@media (max-width: 700px), (pointer: coarse) {
  .help-zone {
    width: 42vw !important;
    top: calc(72px + var(--safe-top)) !important;
  }
  .hint-panel {
    min-height: 74px !important;
    padding: 10px 11px !important;
  }
}

/* Recompensa de nivel: poco texto, centrada y más pequeña */
.reward-cinematic--compact {
  place-items: center !important;
}
.reward-cinematic--compact .reward-badge {
  top: 24% !important;
}
.reward-card--compact {
  width: min(470px, 64vw) !important;
  margin-top: 110px !important;
  padding: 18px 22px !important;
  text-align: center;
}
.reward-card--compact .kicker {
  margin-bottom: 8px;
}
.reward-card--compact .reward-title {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.3vw, 42px) !important;
}
.reward-card--compact .reward-next {
  margin: 0 0 12px;
  font-size: 11px !important;
}
.reward-card--compact .reward-skip {
  min-width: 132px;
  min-height: 38px;
  padding: 8px 14px;
}
@media (max-width: 700px), (pointer: coarse) {
  .reward-cinematic--compact .reward-badge {
    top: 18% !important;
  }
  .reward-card--compact {
    width: min(88vw, 390px) !important;
    margin-top: 84px !important;
    padding: 16px 18px !important;
  }
}

/* Reintento del mismo nivel */
.retry-outcome {
  width: min(440px, 82vw) !important;
  padding: 24px 22px !important;
  text-align: center;
}

/* =====================================================
   AJUSTES EXTRA V4
   ===================================================== */

/* Eliminar globo de seleccionar anterior */
.select-hint {
  display: none !important;
}

/* Cursor dedito para nivel 1 */
.level-one,
.level-one .scene-content,
.level-one .item,
.level-one .distractor,
.level-one .flashlight-layer,
.level-one .darkness-extra {
  cursor: none !important;
}
.pointer-finger-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 180;
  pointer-events: none;
  transform: translate(-35%, -8%);
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.55));
  user-select: none;
}

/* Nivel 3: paneles derechos bien separados */
.level-three .lightbar {
  top: calc(86px + var(--safe-top)) !important;
  right: 16px !important;
  width: min(21vw, 280px) !important;
}
.level-three .help-zone {
  top: calc(150px + var(--safe-top)) !important;
  right: 16px !important;
  width: min(21vw, 280px) !important;
  max-width: min(21vw, 280px) !important;
}
.level-three .help-zone.show {
  display: grid !important;
  gap: 10px !important;
}
.level-three .help-zone .help-btn {
  justify-self: stretch !important;
  width: 100% !important;
}
.level-three .hint-panel {
  min-height: 80px !important;
  max-height: 88px !important;
  overflow: hidden !important;
}
.level-three .timeline-info {
  right: 16px !important;
  top: calc(292px + var(--safe-top)) !important;
  width: min(21vw, 280px) !important;
  min-height: 96px !important;
  max-height: 108px !important;
  overflow: hidden !important;
}
.level-three .timeline-slots {
  right: min(25vw, 310px) !important;
}
@media (max-width: 700px), (pointer: coarse) {
  .pointer-finger-cursor { display: none !important; }
  .level-three .lightbar {
    top: calc(72px + var(--safe-top)) !important;
    left: 8px !important;
    right: auto !important;
    width: 42vw !important;
  }
  .level-three .help-zone {
    top: calc(72px + var(--safe-top)) !important;
    right: 8px !important;
    width: 42vw !important;
    max-width: 42vw !important;
  }
  .level-three .timeline-info { display: none !important; }
  .level-three .timeline-slots {
    right: 4vw !important;
  }
}

/* Pantalla final ajustada al viewport sin desbordar */
.final-portal {
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  padding: 14px !important;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.8fr) !important;
  gap: 14px !important;
  align-items: stretch !important;
}
.final-stage,
.final-side-card {
  max-height: calc(100vh - 28px) !important;
  overflow: hidden !important;
  border-radius: 18px !important;
}
.final-stage {
  min-height: 0 !important;
  padding: 24px !important;
}
.final-stage-star {
  font-size: clamp(72px, 9vw, 130px) !important;
}
.final-stage-title {
  font-size: clamp(30px, 4.5vw, 58px) !important;
  margin: 8px 0 10px !important;
}
.final-stage-copy {
  font-size: clamp(13px, 1.05vw, 17px) !important;
  line-height: 1.4 !important;
  max-width: 520px !important;
}
.final-side-card {
  padding: 20px !important;
  gap: 12px !important;
  justify-items: center !important;
  align-content: start !important;
}
.final-side-card .kicker {
  font-size: 11px !important;
}
.final-side-title {
  font-size: clamp(24px, 3.2vw, 40px) !important;
}
.final-qr-wrap {
  width: min(190px, 20vw) !important;
  padding: 10px !important;
  border-radius: 16px !important;
}
.final-side-text {
  font-size: 12px !important;
  line-height: 1.35 !important;
}
.final-go-btn,
.final-restart-btn {
  width: min(240px, 100%) !important;
  min-height: 42px !important;
  padding: 10px 14px !important;
}
@media (max-width: 900px) {
  .final-portal {
    grid-template-columns: 1fr !important;
    height: 100svh !important;
    max-height: 100svh !important;
    padding: 10px !important;
    gap: 10px !important;
  }
  .final-stage,
  .final-side-card {
    max-height: none !important;
  }
  .final-stage {
    min-height: 44vh !important;
    padding: 18px !important;
  }
  .final-side-card {
    padding: 16px !important;
  }
  .final-qr-wrap {
    width: min(170px, 46vw) !important;
  }
}


/* === Ajustes solicitados por el usuario === */
.level-one,
.level-one * {
  cursor: none !important;
}
.pointer-finger-cursor {
  width: 42px;
  height: 42px;
  object-fit: contain;
  transform: translate(-35%, -18%) rotate(18deg);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.55)) drop-shadow(0 0 14px rgba(243,211,145,.22));
}
.level-one .modern-decoy {
  opacity: .94;
}
.level-one .distractor[src*="bicicleta"] {
  filter: brightness(.72) saturate(.9) drop-shadow(0 10px 18px rgba(0,0,0,.55));
}
.level-three .time-slot {
  overflow: hidden;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 18px 12px 14px;
}
.level-three .time-slot::before {
  top: -15px;
}
.level-three .time-slot__title {
  display: block;
  color: #f3e4ca;
  font-family: var(--font-title);
  font-size: clamp(15px, 1.15vw, 20px);
  line-height: 1.08;
  text-align: center;
  text-shadow: 0 2px 10px #000;
}
.level-three .time-slot__status {
  display: block;
  color: rgba(243, 228, 202, .78);
  font-size: clamp(10px, .82vw, 12px);
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: center;
}
.level-three .time-slot.complete .time-slot__status {
  color: var(--gold-2);
}
.level-three .timeline-piece {
  width: clamp(180px, 18vw, 248px) !important;
  min-height: 110px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  background: rgba(15,9,6,.82);
  border: 1px solid rgba(223,184,107,.62);
}
.level-three .timeline-piece__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.level-three .timeline-piece__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.18));
  pointer-events: none;
}
.level-three .timeline-piece.placed {
  box-shadow: 0 0 0 1px rgba(243,211,145,.65), 0 16px 30px rgba(0,0,0,.38);
}
.level-three .timeline-info strong,
.level-three .hint-panel strong {
  font-size: clamp(16px, 1.3vw, 22px) !important;
}
@media (max-width: 700px), (pointer: coarse) {
  .pointer-finger-cursor {
    display: none !important;
  }
  .level-three .timeline-piece {
    width: 42vw !important;
    min-height: 92px !important;
  }
  .level-three .time-slot__title {
    font-size: 12px;
  }
  .level-three .time-slot__status {
    font-size: 9px;
  }
}


/* === Ajuste fino final: nivel 1 y nivel 3 === */
.level-one .item,
.level-one .distractor {
  object-fit: contain;
}
.level-one .distractor {
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.48));
}
.level-one .distractor[src*="tablet"],
.level-one .distractor[src*="linterna"],
.level-one .distractor[src*="paraguas"],
.level-one .distractor[src*="bicicleta"] {
  background: transparent !important;
}
.level-one .pointer-finger-cursor {
  width: 36px !important;
  height: 36px !important;
}

.level-three .timeline-slots {
  top: 40.5% !important;
  left: 2.6vw !important;
  right: min(23vw, 290px) !important;
  gap: 12px !important;
}
.level-three .time-slot {
  min-height: 158px !important;
  padding: 12px 10px 12px !important;
  border-radius: 14px !important;
  background: rgba(14,8,5,.48) !important;
  box-shadow: inset 0 0 18px rgba(0,0,0,.28), 0 8px 18px rgba(0,0,0,.18);
}
.level-three .time-slot::before {
  font-size: clamp(24px, 2.4vw, 38px) !important;
  top: -16px !important;
  left: 12px !important;
}
.level-three .time-slot__title {
  font-size: clamp(13px, .95vw, 17px) !important;
  line-height: 1.1 !important;
  max-width: 90%;
}
.level-three .time-slot__status {
  font-size: clamp(9px, .68vw, 11px) !important;
  line-height: 1.25 !important;
  margin-top: 4px;
}
.level-three .timeline-pieces {
  left: 5vw !important;
  right: 5vw !important;
  bottom: calc(18px + var(--safe-bottom)) !important;
  min-height: 112px !important;
}
.level-three .timeline-piece {
  width: clamp(160px, 13.3vw, 190px) !important;
  min-height: 102px !important;
  max-height: 102px !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 22px rgba(0,0,0,.32);
}
.level-three .timeline-piece__image {
  object-fit: cover !important;
}
.level-three .timeline-piece.placed {
  opacity: .94 !important;
}
.level-three .timeline-piece__overlay {
  background: linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.16)) !important;
}
.level-three .timeline-info {
  top: calc(302px + var(--safe-top)) !important;
  width: min(22vw, 280px) !important;
  min-height: 152px !important;
}
.level-three .hint-panel {
  min-height: 112px !important;
}
.level-three .timeline-info strong,
.level-three .hint-panel strong {
  font-size: clamp(15px, 1.1vw, 19px) !important;
  margin-bottom: 6px !important;
}
.level-three .timeline-info span,
.level-three .hint-panel span {
  font-size: clamp(12px, .92vw, 14px) !important;
  line-height: 1.38 !important;
}

@media (max-width: 1100px) {
  .level-three .timeline-slots {
    right: min(26vw, 290px) !important;
  }
  .level-three .time-slot {
    min-height: 144px !important;
  }
  .level-three .timeline-piece {
    width: clamp(150px, 15vw, 184px) !important;
    min-height: 92px !important;
    max-height: 92px !important;
  }
}

@media (max-width: 700px), (pointer: coarse) {
  .level-three .timeline-slots {
    top: 35% !important;
    left: 3vw !important;
    right: 3vw !important;
    gap: 8px !important;
  }
  .level-three .time-slot {
    min-height: 100px !important;
    padding: 8px 6px !important;
  }
  .level-three .time-slot__title {
    font-size: 10px !important;
  }
  .level-three .time-slot__status {
    font-size: 8px !important;
  }
  .level-three .timeline-pieces {
    left: 4vw !important;
    right: 4vw !important;
    min-height: 180px !important;
  }
  .level-three .timeline-piece {
    width: 38vw !important;
    min-height: 82px !important;
    max-height: 82px !important;
  }
}


/* === v3: separación y responsive final nivel 3 === */
.level-three .timeline-slots {
  top: 40% !important;
  left: 2.2vw !important;
  right: min(23vw, 300px) !important;
  gap: 18px !important;
}
.level-three .time-slot {
  min-height: 150px !important;
  padding: 12px 10px !important;
}
.level-three .time-slot__title {
  font-size: clamp(14px, 1vw, 18px) !important;
  max-width: 88%;
}
.level-three .time-slot__status {
  font-size: clamp(9px, .66vw, 11px) !important;
}
.level-three .timeline-pieces {
  left: 3vw !important;
  right: 3vw !important;
  bottom: calc(16px + var(--safe-bottom)) !important;
  min-height: 132px !important;
}
.level-three .timeline-piece {
  width: clamp(170px, 14.1vw, 202px) !important;
  min-height: 112px !important;
  max-height: 112px !important;
}
.level-three .timeline-piece__image {
  transform: scale(1.04);
}
.level-three .timeline-info {
  width: min(22vw, 285px) !important;
}
.level-three .hint-panel,
.level-three .timeline-info {
  padding: 14px 16px !important;
}

@media (max-width: 1200px) {
  .level-three .timeline-slots {
    gap: 14px !important;
    right: min(24vw, 295px) !important;
  }
  .level-three .time-slot {
    min-height: 142px !important;
  }
  .level-three .timeline-piece {
    width: clamp(160px, 14.8vw, 192px) !important;
    min-height: 102px !important;
    max-height: 102px !important;
  }
}

@media (max-width: 700px), (pointer: coarse) {
  .level-three .lightbar {
    top: calc(72px + var(--safe-top)) !important;
    left: 8px !important;
    width: 44vw !important;
  }
  .level-three .help-zone {
    top: calc(72px + var(--safe-top)) !important;
    right: 8px !important;
    width: 44vw !important;
  }
  .level-three .timeline-slots {
    top: 30% !important;
    left: 3vw !important;
    right: 3vw !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .level-three .time-slot {
    min-height: 96px !important;
    padding: 10px 8px !important;
  }
  .level-three .time-slot::before {
    font-size: 22px !important;
    top: -12px !important;
    left: 10px !important;
  }
  .level-three .time-slot__title {
    font-size: 11px !important;
    line-height: 1.06 !important;
  }
  .level-three .time-slot__status {
    font-size: 8px !important;
    line-height: 1.18 !important;
  }
  .level-three .timeline-pieces {
    left: 4vw !important;
    right: 4vw !important;
    bottom: calc(14px + var(--safe-bottom)) !important;
    min-height: 220px !important;
  }
  .level-three .timeline-piece {
    width: 40vw !important;
    min-height: 90px !important;
    max-height: 90px !important;
  }
  .level-three .timeline-piece__image {
    transform: scale(1.03);
  }
}


/* === v4: sin card de fragmento y cursor normal en nivel 1 === */
.level-one,
.level-one * {
  cursor: auto !important;
}
.level-one .pointer-finger-cursor {
  display: none !important;
}
.level-three .timeline-info {
  display: none !important;
}
.level-three .help-zone {
  top: calc(152px + var(--safe-top)) !important;
  right: 16px !important;
  width: min(22vw, 285px) !important;
}
.level-three .hint-panel {
  min-height: 180px !important;
}
@media (max-width: 700px), (pointer: coarse) {
  .level-three .help-zone {
    top: calc(72px + var(--safe-top)) !important;
    right: 8px !important;
    width: 44vw !important;
  }
  .level-three .hint-panel {
    min-height: 132px !important;
  }
}


/* === v5: imágenes más grandes y panel de pistas más compacto === */
.level-three .timeline-pieces {
  left: 2.5vw !important;
  right: 2.5vw !important;
  bottom: calc(14px + var(--safe-bottom)) !important;
  min-height: 146px !important;
}
.level-three .timeline-piece {
  width: clamp(186px, 15.4vw, 222px) !important;
  min-height: 124px !important;
  max-height: 124px !important;
}
.level-three .timeline-piece__image {
  transform: scale(1.07) !important;
}
.level-three .help-zone {
  top: calc(150px + var(--safe-top)) !important;
  right: 14px !important;
  width: min(18vw, 230px) !important;
}
.level-three .hint-panel {
  min-height: 124px !important;
  padding: 12px 14px !important;
}
.level-three .hint-panel strong {
  font-size: clamp(14px, 1vw, 18px) !important;
}
.level-three .hint-panel span {
  font-size: clamp(11px, .86vw, 13px) !important;
  line-height: 1.3 !important;
}

@media (max-width: 1200px) {
  .level-three .timeline-piece {
    width: clamp(174px, 15.6vw, 208px) !important;
    min-height: 114px !important;
    max-height: 114px !important;
  }
  .level-three .help-zone {
    width: min(19.5vw, 220px) !important;
  }
  .level-three .hint-panel {
    min-height: 116px !important;
  }
}

@media (max-width: 700px), (pointer: coarse) {
  .level-three .help-zone {
    top: calc(72px + var(--safe-top)) !important;
    right: 8px !important;
    width: 42vw !important;
  }
  .level-three .hint-panel {
    min-height: 108px !important;
    padding: 10px 12px !important;
  }
  .level-three .hint-panel strong {
    font-size: 13px !important;
  }
  .level-three .hint-panel span {
    font-size: 10px !important;
    line-height: 1.24 !important;
  }
  .level-three .timeline-pieces {
    left: 3vw !important;
    right: 3vw !important;
    min-height: 236px !important;
  }
  .level-three .timeline-piece {
    width: 42vw !important;
    min-height: 100px !important;
    max-height: 100px !important;
  }
  .level-three .timeline-piece__image {
    transform: scale(1.06) !important;
  }
}


/* === v6: mejor mobile nivel 3 y cierre final === */
@media (max-width: 700px), (pointer: coarse) {
  /* Nivel 3 */
  .level-three .hud {
    left: 8px !important;
    right: 8px !important;
    top: 8px !important;
    gap: 8px !important;
  }
  .level-three .hud__left {
    max-width: 56vw !important;
    padding: 8px 10px !important;
  }
  .level-three .hud-title {
    font-size: 10px !important;
    line-height: 1.08 !important;
  }
  .level-three .hud-subtitle {
    font-size: 7px !important;
    line-height: 1.18 !important;
  }
  .level-three .hud__right {
    padding: 6px !important;
    gap: 5px !important;
  }
  .level-three .hud-btn {
    height: 30px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
  }

  .level-three .lightbar {
    top: calc(72px + var(--safe-top)) !important;
    left: 8px !important;
    width: 46vw !important;
  }
  .level-three .help-zone {
    top: calc(72px + var(--safe-top)) !important;
    right: 8px !important;
    width: 38vw !important;
    gap: 6px !important;
  }
  .level-three .help-zone .help-btn {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 34px !important;
    padding: 7px 8px !important;
    font-size: 11px !important;
  }
  .level-three .hint-panel {
    min-height: 84px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
  }
  .level-three .hint-panel strong {
    font-size: 12px !important;
    margin-bottom: 4px !important;
  }
  .level-three .hint-panel span {
    font-size: 9px !important;
    line-height: 1.2 !important;
  }

  .level-three .timeline-slots {
    top: 28.5% !important;
    left: 3vw !important;
    right: 3vw !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .level-three .time-slot {
    min-height: 108px !important;
    padding: 12px 8px 8px !important;
    border-radius: 12px !important;
  }
  .level-three .time-slot::before {
    font-size: 24px !important;
    top: -13px !important;
    left: 10px !important;
  }
  .level-three .time-slot__title {
    font-size: 10px !important;
    line-height: 1.08 !important;
    max-width: 92% !important;
  }
  .level-three .time-slot__status {
    font-size: 7px !important;
    line-height: 1.15 !important;
    margin-top: 3px !important;
  }

  .level-three .timeline-pieces {
    left: 3vw !important;
    right: 3vw !important;
    bottom: calc(46px + var(--safe-bottom)) !important;
    min-height: 250px !important;
  }
  .level-three .timeline-piece {
    width: 43vw !important;
    min-height: 106px !important;
    max-height: 106px !important;
    border-radius: 12px !important;
  }
  .level-three .timeline-piece__image {
    transform: scale(1.08) !important;
  }
  .level-three .sound-toggle {
    bottom: calc(10px + var(--safe-bottom)) !important;
    right: 10px !important;
    min-height: 30px !important;
    padding: 0 10px !important;
    font-size: 10px !important;
  }

  /* Cierre final */
  .final-portal {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
    align-content: start !important;
    min-height: 100%;
  }
  .final-stage,
  .final-side-card {
    border-radius: 16px !important;
  }
  .final-stage {
    min-height: auto !important;
    padding: 18px 16px !important;
    gap: 6px !important;
  }
  .final-stage-glow,
  .final-stage-ring,
  .final-stage-star,
  .final-stage-copy,
  .final-side-text {
    display: none !important;
  }
  .final-stage-title {
    margin: 0 !important;
    font-size: clamp(24px, 8vw, 34px) !important;
    line-height: .96 !important;
    text-align: center !important;
  }
  .final-side-card {
    padding: 14px 14px 16px !important;
    gap: 10px !important;
  }
  .final-side-card .kicker {
    font-size: 10px !important;
    margin: 0 !important;
  }
  .final-side-title {
    font-size: 22px !important;
    line-height: .95 !important;
  }
  .final-qr-wrap {
    width: min(180px, 52vw) !important;
    padding: 10px !important;
    border-radius: 14px !important;
  }
  .final-go-btn,
  .final-restart-btn {
    width: 100% !important;
    min-height: 38px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
}

/* === Nivel 1 v7: recorrido 3D, linterna anticlick y controles móviles === */
.level-one-3d .bg.level1-bg-soft {
  opacity: .38;
  filter: blur(2px) saturate(.74) brightness(.62) contrast(1.12);
  transform: scale(1.04);
}
.level-one-3d .vignette {
  background:
    radial-gradient(circle at 50% 46%, rgba(0,0,0,.02) 0%, rgba(0,0,0,.28) 54%, rgba(0,0,0,.78) 100%),
    linear-gradient(180deg, rgba(0,0,0,.44), rgba(0,0,0,.08) 45%, rgba(0,0,0,.70));
}
.level1-3d-content {
  z-index: 7;
  cursor: grab;
}
.level1-3d-content:active { cursor: grabbing; }
.l1-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  outline: none;
  background:
    radial-gradient(circle at 50% 32%, rgba(142, 91, 38, .24), transparent 29%),
    linear-gradient(180deg, rgba(21,13,7,.95) 0%, rgba(9,6,4,.88) 48%, rgba(4,3,2,.97) 100%);
}
.l1-room-shell {
  --turn: 0deg;
  --walk-x: 0px;
  --walk-z: 0px;
  position: absolute;
  inset: -7vh -8vw -8vh;
  transform-origin: 50% 62%;
  transform: translate(var(--walk-x), var(--walk-z)) rotateY(var(--turn));
  transition: transform .05s linear;
  pointer-events: none;
  perspective: 760px;
  opacity: .98;
}
.l1-ceiling,
.l1-floor,
.l1-left-wall,
.l1-right-wall,
.l1-far-wall,
.l1-depth {
  position: absolute;
  pointer-events: none;
}
.l1-ceiling {
  left: 0;
  right: 0;
  top: 0;
  height: 45%;
  background:
    repeating-linear-gradient(90deg, rgba(255,225,157,.05) 0 2px, transparent 2px 74px),
    linear-gradient(180deg, rgba(41,24,12,.78), rgba(12,8,5,.12));
  clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
  opacity: .72;
}
.l1-floor {
  left: -12%;
  right: -12%;
  bottom: -2%;
  height: 62%;
  background:
    repeating-linear-gradient(90deg, rgba(223,184,107,.13) 0 1px, transparent 1px 78px),
    repeating-linear-gradient(0deg, rgba(223,184,107,.12) 0 1px, transparent 1px 54px),
    radial-gradient(ellipse at 50% 12%, rgba(192, 133, 63, .28), transparent 35%),
    linear-gradient(180deg, rgba(35,22,12,.22), rgba(9,6,4,.94));
  clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%);
  transform-origin: 50% 100%;
  transform: perspective(720px) rotateX(58deg);
  box-shadow: inset 0 40px 75px rgba(0,0,0,.45);
}
.l1-left-wall {
  left: -3%;
  top: 10%;
  bottom: 2%;
  width: 34%;
  background:
    repeating-linear-gradient(0deg, transparent 0 45px, rgba(223,184,107,.08) 46px 47px),
    linear-gradient(90deg, rgba(16,10,6,.96), rgba(59,34,16,.42), rgba(12,7,4,.05));
  clip-path: polygon(0 0, 100% 24%, 100% 76%, 0 100%);
  opacity: .85;
}
.l1-right-wall {
  right: -3%;
  top: 10%;
  bottom: 2%;
  width: 34%;
  background:
    repeating-linear-gradient(0deg, transparent 0 45px, rgba(223,184,107,.08) 46px 47px),
    linear-gradient(270deg, rgba(16,10,6,.96), rgba(59,34,16,.42), rgba(12,7,4,.05));
  clip-path: polygon(0 24%, 100% 0, 100% 100%, 0 76%);
  opacity: .85;
}
.l1-far-wall {
  left: 31%;
  right: 31%;
  top: 23%;
  height: 38%;
  display: grid;
  place-items: start center;
  padding-top: 34px;
  color: rgba(239,215,167,.28);
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: clamp(20px, 2.4vw, 42px);
  background:
    radial-gradient(circle at 50% 36%, rgba(223,184,107,.16), transparent 42%),
    linear-gradient(180deg, rgba(47,29,14,.66), rgba(13,8,5,.90));
  border: 1px solid rgba(223,184,107,.12);
  box-shadow: inset 0 0 64px rgba(0,0,0,.48), 0 18px 60px rgba(0,0,0,.45);
}
.l1-depth {
  left: 50%;
  top: 58%;
  width: 72vw;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(223,184,107,.22), transparent);
  box-shadow: 0 0 18px rgba(223,184,107,.06);
}
.l1-depth--one { top: 66%; width: 88vw; opacity: .72; }
.l1-depth--two { top: 75%; width: 116vw; opacity: .5; }
.l1-depth--three { top: 84%; width: 140vw; opacity: .34; }
.l1-object-layer {
  position: absolute;
  inset: 0;
  z-index: 34;
  pointer-events: none;
}
.l1-object {
  --scale: 1;
  position: absolute;
  left: 50%;
  top: 60%;
  width: clamp(56px, 7vw, 112px);
  min-height: 42px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff5df;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(var(--scale));
  transform-origin: 50% 90%;
  transition: filter .16s ease, opacity .12s linear;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  filter: brightness(.72) drop-shadow(0 18px 18px rgba(0,0,0,.62));
}
.l1-object img {
  display: block;
  width: 100%;
  max-height: 115px;
  object-fit: contain;
  pointer-events: none;
}
.l1-object span:not(.l1-prop-shape) {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  min-width: max-content;
  max-width: 220px;
  padding: 5px 8px;
  border: 1px solid rgba(223,184,107,.32);
  background: rgba(12, 7, 4, .72);
  color: #f8e6c6;
  text-align: center;
  font-size: 10px;
  line-height: 1.15;
  text-shadow: 0 2px 8px #000;
  opacity: 0;
  pointer-events: none;
}
.l1-object.is-focused {
  filter: brightness(1.22) drop-shadow(0 0 22px rgba(245,205,125,.62)) drop-shadow(0 18px 22px rgba(0,0,0,.58));
}
.l1-object.is-focused span:not(.l1-prop-shape) { opacity: 1; }
.l1-object--target img { filter: sepia(.12) saturate(.82); }
.l1-object--decoy img { filter: grayscale(.08) saturate(.75) brightness(.82); }
.l1-object--prop {
  width: clamp(70px, 8vw, 140px);
  min-height: 96px;
}
.l1-prop-shape {
  display: block;
  width: 90px;
  height: 110px;
  margin: 0 auto;
  border: 1px solid rgba(139,93,45,.52);
  background:
    linear-gradient(90deg, rgba(0,0,0,.18) 0 10%, transparent 10% 90%, rgba(0,0,0,.18) 90%),
    repeating-linear-gradient(0deg, rgba(223,184,107,.14) 0 3px, transparent 3px 25px),
    linear-gradient(180deg, rgba(83,52,27,.92), rgba(31,18,9,.96));
  box-shadow: inset 0 0 22px rgba(0,0,0,.44), 0 14px 22px rgba(0,0,0,.48);
}
.l1-prop-crate .l1-prop-shape {
  height: 74px;
  width: 108px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, rgba(101,63,31,.96), rgba(38,23,12,.96));
}
.l1-prop-candle .l1-prop-shape {
  width: 34px;
  height: 94px;
  border-radius: 18px 18px 5px 5px;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,235,138,.95), rgba(255,180,70,.5) 18%, transparent 33%),
    linear-gradient(180deg, #f4e1bc, #9a6731);
  box-shadow: 0 0 28px rgba(255,199,87,.42), 0 14px 22px rgba(0,0,0,.52);
}
.l1-prop-table .l1-prop-shape {
  width: 136px;
  height: 78px;
  border-radius: 10px 10px 4px 4px;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(0,0,0,.32) 12% 16%, transparent 16% 84%, rgba(0,0,0,.32) 84% 88%, transparent 88%),
    linear-gradient(180deg, rgba(88,52,25,.98), rgba(29,17,9,.96));
}
.l1-object.pulse-prop { animation: l1PulseProp .52s ease; }
@keyframes l1PulseProp { 50% { filter: brightness(1.45) drop-shadow(0 0 18px rgba(223,184,107,.54)); } }
.l1-player-caption {
  position: absolute;
  top: calc(95px + var(--safe-top));
  left: 50%;
  z-index: 70;
  width: min(680px, calc(100vw - 36px));
  transform: translateX(-50%);
  padding: 11px 15px;
  border: 1px solid rgba(223,184,107,.30);
  border-left: 2px solid rgba(223,184,107,.72);
  background: linear-gradient(90deg, rgba(13,8,5,.82), rgba(13,8,5,.56));
  text-align: center;
  box-shadow: 0 12px 34px rgba(0,0,0,.38);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.l1-player-caption strong {
  display: block;
  color: #fff2d4;
  font-family: var(--font-title);
  font-size: clamp(16px, 1.7vw, 26px);
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: .05em;
}
.l1-player-caption span {
  display: block;
  margin-top: 5px;
  color: #edd7b6;
  font-size: clamp(11px, 1vw, 14px);
  line-height: 1.32;
}
.l1-crosshair {
  position: absolute;
  left: 50%;
  top: 57%;
  z-index: 72;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(223,184,107,.30);
  background: rgba(12,7,4,.18);
  color: rgba(255,244,216,.76);
  transform: translate(-50%, -50%);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.l1-crosshair.is-active {
  color: #fff2b4;
  border-color: rgba(243,211,145,.85);
  background: rgba(91,60,25,.38);
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 0 24px rgba(223,184,107,.28);
}
.l1-flashlight {
  z-index: 62;
  --r: 185px;
  mix-blend-mode: normal;
  background:
    radial-gradient(circle var(--r) at var(--x) var(--y), rgba(0,0,0,0) 0%, rgba(0,0,0,.08) 34%, rgba(0,0,0,.70) 67%, rgba(0,0,0,.96) 100%);
}
.l1-flashlight.is-off {
  --r: 0px;
  background: rgba(0,0,0,.965);
}
.l1-darkness-extra { z-index: 61; }
.l1-flashlight-control {
  left: auto;
  right: 24px;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 82;
}
.l1-desktop-tips {
  position: absolute;
  left: 22px;
  bottom: calc(22px + var(--safe-bottom));
  z-index: 82;
  padding: 10px 13px;
  border: 1px solid rgba(223,184,107,.25);
  background: rgba(12,7,4,.62);
  color: #ead7bd;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(6px);
}
.l1-mobile-controls { display: none; }
.l1-mobile-notice {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 190;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,.74);
  backdrop-filter: blur(5px);
}
.l1-mobile-notice.show { display: grid; }
.l1-mobile-notice__card {
  width: min(520px, 92vw);
  padding: 24px;
  border: 1px solid rgba(223,184,107,.46);
  background: linear-gradient(180deg, rgba(22,14,8,.96), rgba(8,5,3,.94));
  text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.l1-mobile-notice__card strong {
  display: block;
  font-family: var(--font-title);
  color: #fff0d2;
  font-size: clamp(27px, 8vw, 44px);
  line-height: .95;
  text-transform: uppercase;
}
.l1-mobile-notice__card p {
  color: #edd9bb;
  line-height: 1.45;
  margin: 12px 0 18px;
}
.l1-mobile-notice__card .btn {
  min-width: 0;
  margin: 5px;
}
@media (pointer: coarse) {
  .level-one-3d .hud {
    top: calc(8px + var(--safe-top));
    left: 8px;
    right: 8px;
  }
  .level-one-3d .hud__left {
    max-width: 46vw;
    padding: 8px 10px;
  }
  .level-one-3d .hud__objective { display: none; }
  .level-one-3d .hud__right {
    padding: 6px;
    gap: 6px;
  }
  .level-one-3d .hud-block:nth-child(2),
  .level-one-3d .hud-block:nth-child(3) { display: none; }
  .l1-player-caption {
    top: calc(58px + var(--safe-top));
    width: min(560px, 64vw);
    padding: 8px 10px;
  }
  .l1-player-caption strong { font-size: clamp(13px, 2.6vw, 18px); }
  .l1-player-caption span { font-size: clamp(9px, 1.8vw, 12px); }
  .l1-desktop-tips,
  .l1-flashlight-control { display: none; }
  .l1-mobile-controls {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 100;
    pointer-events: none;
  }
  .l1-joystick {
    position: absolute;
    left: max(18px, env(safe-area-inset-left));
    bottom: calc(18px + var(--safe-bottom));
    width: 118px;
    height: 118px;
    border-radius: 50%;
    border: 1px solid rgba(223,184,107,.34);
    background: radial-gradient(circle, rgba(223,184,107,.12), rgba(10,6,4,.72));
    box-shadow: inset 0 0 22px rgba(0,0,0,.42), 0 16px 30px rgba(0,0,0,.36);
    pointer-events: auto;
    touch-action: none;
  }
  .l1-joystick span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: -22px 0 0 -22px;
    background: linear-gradient(180deg, rgba(179,124,56,.88), rgba(48,29,14,.96));
    border: 1px solid rgba(255,223,154,.44);
    box-shadow: 0 8px 20px rgba(0,0,0,.46);
  }
  .l1-touch-right {
    position: absolute;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(14px + var(--safe-bottom));
    width: min(30vw, 190px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    pointer-events: auto;
  }
  .l1-look-pad {
    grid-column: 1 / -1;
    height: 84px;
    border-radius: 18px;
    border: 1px solid rgba(223,184,107,.32);
    background: rgba(12,7,4,.62);
    display: grid;
    place-items: center;
    color: #ead7bd;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 900;
    font-size: 11px;
    touch-action: none;
  }
  .l1-touch-btn {
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(223,184,107,.46);
    background: linear-gradient(180deg, rgba(75,48,22,.88), rgba(18,10,5,.92));
    color: #fff4df;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .l1-touch-btn.is-off {
    color: #ffd2ca;
    border-color: rgba(255,138,120,.55);
  }
  .audio-toggle { display: none; }
}
@media (pointer: coarse) and (orientation: landscape) {
  .level-one-3d .hud__title { font-size: clamp(13px, 2.4vw, 18px); }
  .level-one-3d .life { width: 11px; height: 22px; }
  .l1-player-caption { top: calc(54px + var(--safe-top)); }
  .l1-crosshair {
    width: 30px;
    height: 30px;
    font-size: 21px;
  }
  .l1-object img { max-height: 82px; }
  .l1-object span:not(.l1-prop-shape) { font-size: 9px; }
}
@media (max-width: 720px) and (orientation: portrait) {
  .l1-mobile-notice.show { display: grid; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .l1-player-caption {
    top: calc(50px + var(--safe-top));
    padding: 7px 9px;
  }
  .l1-player-caption span { display: none; }
  .l1-joystick { width: 98px; height: 98px; }
  .l1-touch-right { width: min(26vw, 168px); }
  .l1-look-pad { height: 60px; }
  .l1-touch-btn { min-height: 38px; font-size: 10px; }
}

/* ===============================
   NIVEL 1 REAL 3D - THREE.JS
   Reemplaza el pseudo 3D anterior con cámara, paredes, colisiones y linterna real.
================================= */
.level-one-threejs {
  background: #090604;
}
.level1-three-content {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #20130b 0%, #0a0604 58%, #030201 100%);
}
.l1-three-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  outline: none;
  cursor: grab;
  touch-action: none;
  background: #080503;
}
.l1-three-viewport:active,
.l1-three-viewport.is-pointer-locked {
  cursor: none;
}
.l1-canvas-host,
.l1-canvas-host canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.l1-canvas-host::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(circle at 50% 54%, rgba(255,196,118,.06) 0%, rgba(0,0,0,0) 27%, rgba(0,0,0,.28) 74%, rgba(0,0,0,.56) 100%),
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,0) 36%, rgba(0,0,0,.28));
  mix-blend-mode: normal;
}
.l1-three-viewport.light-off .l1-canvas-host::after {
  background:
    radial-gradient(circle at 50% 54%, rgba(255,196,118,.035) 0%, rgba(0,0,0,.10) 30%, rgba(0,0,0,.36) 74%, rgba(0,0,0,.62) 100%),
    linear-gradient(180deg, rgba(0,0,0,.24), rgba(0,0,0,.04) 36%, rgba(0,0,0,.36));
}
.l1-player-caption--three {
  position: absolute;
  top: calc(96px + var(--safe-top));
  left: 50%;
  width: min(720px, 78vw);
  transform: translateX(-50%);
  z-index: 84;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(16,10,6,.88), rgba(38,23,12,.66));
  border: 1px solid rgba(223,184,107,.30);
  border-left: 3px solid rgba(223,184,107,.88);
  box-shadow: 0 14px 36px rgba(0,0,0,.36);
  padding: 12px 16px;
  backdrop-filter: blur(7px);
  text-shadow: 0 2px 10px #000;
}
.l1-player-caption--three strong {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(17px, 1.7vw, 26px);
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff5df;
}
.l1-player-caption--three span {
  display: block;
  margin-top: 6px;
  font-size: clamp(11px, 1.05vw, 15px);
  line-height: 1.35;
  color: #ecd6b6;
}
.l1-crosshair--three {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 88;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255,245,220,.34);
  background: rgba(6,4,3,.18);
  color: rgba(255,245,220,.78);
  font-size: 25px;
  line-height: 1;
  font-weight: 300;
  cursor: pointer;
  pointer-events: auto;
  text-shadow: 0 0 12px rgba(0,0,0,.8);
  box-shadow: 0 0 0 1px rgba(0,0,0,.2), 0 0 20px rgba(255,212,142,.08);
  transition: transform .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, background .16s ease;
}
.l1-crosshair--three.is-near {
  border-color: rgba(223,184,107,.56);
  color: rgba(255,231,181,.94);
}
.l1-crosshair--three.is-active {
  transform: scale(1.12);
  border-color: rgba(255,221,143,.96);
  background: rgba(175,120,47,.18);
  color: #fff4d4;
  box-shadow: 0 0 0 1px rgba(255,213,126,.14), 0 0 26px rgba(255,196,99,.32);
}
.l1-flashlight-control--three {
  position: absolute;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 92;
  min-width: 150px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(93,60,29,.9), rgba(25,14,7,.9));
  box-shadow: 0 14px 30px rgba(0,0,0,.36);
  backdrop-filter: blur(6px);
}
.l1-flashlight-control--three.is-off {
  color: #ffd0c8;
  border-color: rgba(255,138,120,.62);
  background: linear-gradient(180deg, rgba(56,28,22,.9), rgba(14,8,5,.94));
}
.l1-desktop-tips--three {
  position: absolute;
  left: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 86;
  max-width: min(520px, 42vw);
  color: rgba(255,239,210,.78);
  font-size: 12px;
  line-height: 1.35;
  padding: 9px 12px;
  border: 1px solid rgba(223,184,107,.22);
  background: rgba(12,7,4,.62);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.level-one-threejs .object-discovery {
  z-index: 155;
}
.level-one-threejs .hud {
  z-index: 95;
}
.level-one-threejs .toast {
  z-index: 180;
}
.level-one-threejs .level-intro {
  z-index: 160;
}
.level-one-threejs .audio-toggle {
  z-index: 116;
}

@media (pointer: coarse) {
  .level-one-threejs .hud {
    top: calc(8px + var(--safe-top));
    left: 8px;
    right: 8px;
    gap: 8px;
  }
  .level-one-threejs .hud__left {
    max-width: 47vw;
    padding: 8px 10px;
  }
  .level-one-threejs .hud__objective { display: none; }
  .level-one-threejs .hud__right {
    padding: 6px;
    gap: 6px;
  }
  .level-one-threejs .hud-block:nth-child(2),
  .level-one-threejs .hud-block:nth-child(3) { display: none; }
  .level-one-threejs .hud-btn { height: 34px; padding: 0 10px; font-size: 11px; }
  .l1-player-caption--three {
    top: calc(56px + var(--safe-top));
    width: min(580px, 64vw);
    padding: 8px 10px;
  }
  .l1-player-caption--three strong { font-size: clamp(13px, 2.6vw, 18px); }
  .l1-player-caption--three span { font-size: clamp(9px, 1.8vw, 12px); }
  .l1-desktop-tips--three,
  .l1-flashlight-control--three { display: none; }
  .l1-mobile-controls {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 101;
    pointer-events: none;
  }
  .l1-joystick {
    position: absolute;
    left: max(18px, env(safe-area-inset-left));
    bottom: calc(18px + var(--safe-bottom));
    width: 118px;
    height: 118px;
    border-radius: 50%;
    border: 1px solid rgba(223,184,107,.34);
    background: radial-gradient(circle, rgba(223,184,107,.13), rgba(10,6,4,.72));
    box-shadow: inset 0 0 22px rgba(0,0,0,.42), 0 16px 30px rgba(0,0,0,.36);
    pointer-events: auto;
    touch-action: none;
  }
  .l1-joystick span {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin: -22px 0 0 -22px;
    background: linear-gradient(180deg, rgba(179,124,56,.88), rgba(48,29,14,.96));
    border: 1px solid rgba(255,223,154,.44);
    box-shadow: 0 8px 20px rgba(0,0,0,.46);
  }
  .l1-touch-right {
    position: absolute;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(14px + var(--safe-bottom));
    width: min(30vw, 190px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    pointer-events: auto;
  }
  .l1-look-pad {
    grid-column: 1 / -1;
    height: 84px;
    border-radius: 18px;
    border: 1px solid rgba(223,184,107,.32);
    background: rgba(12,7,4,.62);
    display: grid;
    place-items: center;
    color: #ead7bd;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 900;
    font-size: 11px;
    touch-action: none;
    backdrop-filter: blur(5px);
  }
  .l1-touch-btn {
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(223,184,107,.46);
    background: linear-gradient(180deg, rgba(75,48,22,.88), rgba(18,10,5,.92));
    color: #fff4df;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .l1-touch-btn.is-off {
    color: #ffd2ca;
    border-color: rgba(255,138,120,.55);
  }
  .level-one-threejs .audio-toggle { display: none; }
}
@media (pointer: fine) {
  .level-one-threejs .l1-mobile-controls { display: none; }
}
@media (pointer: coarse) and (orientation: landscape) {
  .level-one-threejs .hud__title { font-size: clamp(13px, 2.4vw, 18px); }
  .level-one-threejs .life { width: 11px; height: 22px; }
  .l1-player-caption--three { top: calc(54px + var(--safe-top)); }
  .l1-crosshair--three {
    width: 30px;
    height: 30px;
    font-size: 21px;
  }
}
@media (max-width: 720px) and (orientation: portrait) {
  .l1-mobile-notice.show { display: grid; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .l1-player-caption--three {
    top: calc(50px + var(--safe-top));
    padding: 7px 9px;
  }
  .l1-player-caption--three span { display: none; }
  .l1-joystick { width: 98px; height: 98px; }
  .l1-touch-right { width: min(26vw, 168px); }
  .l1-look-pad { height: 60px; }
  .l1-touch-btn { min-height: 38px; font-size: 10px; }
}

/* ===============================
   NIVEL 1 THREE.JS v9 - ajustes de recorrido, textos y memoria integrada
================================= */
.level-one-threejs-v9 .l1-player-caption--three {
  top: calc(82px + var(--safe-top));
  width: min(560px, 64vw);
  padding: 8px 12px;
  border-left-width: 2px;
  background: linear-gradient(90deg, rgba(12,7,4,.78), rgba(30,18,10,.52));
}
.level-one-threejs-v9 .l1-player-caption--three strong {
  font-size: clamp(13px, 1.22vw, 19px);
  letter-spacing: .05em;
}
.level-one-threejs-v9 .l1-player-caption--three span {
  margin-top: 4px;
  font-size: clamp(10px, .88vw, 12px);
  line-height: 1.28;
}
.level-one-threejs-v9 .l1-crosshair--three {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  font-size: 22px;
}
.level-one-threejs-v9 .l1-flashlight-control--three {
  min-width: 134px;
  height: 38px;
  font-size: 12px;
}
.level-one-threejs-v9 .l1-desktop-tips--three {
  max-width: min(450px, 40vw);
  font-size: 11px;
  padding: 8px 10px;
  opacity: .82;
}
.level-one-threejs-v9 .l1-canvas-host::after {
  background:
    radial-gradient(circle at 50% 53%, rgba(255,187,101,.045) 0%, rgba(0,0,0,0) 21%, rgba(0,0,0,.36) 68%, rgba(0,0,0,.70) 100%),
    linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.04) 38%, rgba(0,0,0,.45));
}
.level-one-threejs-v9 .l1-three-viewport.light-off .l1-canvas-host::after {
  background:
    radial-gradient(circle at 50% 54%, rgba(255,183,86,.025) 0%, rgba(0,0,0,.18) 23%, rgba(0,0,0,.58) 72%, rgba(0,0,0,.82) 100%),
    linear-gradient(180deg, rgba(0,0,0,.42), rgba(0,0,0,.16) 40%, rgba(0,0,0,.62));
}
.l1-memory-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.85);
  z-index: 170;
  width: min(420px, calc(100vw - 40px));
  padding: 24px 28px 26px;
  border: 1px solid rgba(223,184,107,.55);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17,10,5,.96), rgba(7,4,2,.94));
  box-shadow: 0 24px 70px rgba(0,0,0,.7), 0 0 0 1px rgba(223,184,107,.12);
  backdrop-filter: blur(12px);
  color: #fff4df;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .4s cubic-bezier(.22,1,.36,1), transform .4s cubic-bezier(.22,1,.36,1);
}
.l1-memory-panel.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.l1-memory-panel.closing {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.88);
  transition: opacity .35s ease-in, transform .35s ease-in;
}
.l1-memory-panel small {
  display: block;
  color: var(--gold-2);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 10px;
}
.l1-memory-panel strong {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.05;
  color: #fff2d7;
  margin-bottom: 12px;
}
.l1-memory-panel p {
  margin: 0 0 16px;
  color: #ead8be;
  font-size: 14px;
  line-height: 1.5;
}
.l1-memory-panel .inline-btn {
  min-height: 34px;
  padding: 7px 14px;
  font-size: 12px;
}
.level-one-threejs-v9 .level-intro .intro-copy {
  width: min(700px, 90vw);
  padding: clamp(20px, 3vw, 32px);
}
.level-one-threejs-v9 .level-intro .intro-title {
  font-size: clamp(28px, 4vw, 50px);
}
.level-one-threejs-v9 .level-intro .intro-body {
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.5;
}
@media (pointer: coarse) {
  .level-one-threejs-v9 .l1-player-caption--three {
    top: calc(48px + var(--safe-top));
    width: min(460px, 56vw);
    padding: 6px 8px;
  }
  .level-one-threejs-v9 .l1-player-caption--three strong { font-size: clamp(11px, 2vw, 15px); }
  .level-one-threejs-v9 .l1-player-caption--three span { font-size: clamp(8px, 1.45vw, 10px); }
  .l1-memory-panel {
    right: max(12px, env(safe-area-inset-right));
    top: calc(70px + var(--safe-top));
    width: min(280px, 40vw);
    padding: 11px 12px 12px;
  }
  .l1-memory-panel strong { font-size: clamp(16px, 3vw, 22px); }
  .l1-memory-panel p { font-size: 10px; line-height: 1.35; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .level-one-threejs-v9 .l1-player-caption--three {
    top: calc(46px + var(--safe-top));
    width: min(430px, 54vw);
  }
  .level-one-threejs-v9 .l1-player-caption--three span { display: block; max-height: 28px; overflow: hidden; }
  .l1-memory-panel {
    top: calc(58px + var(--safe-top));
    width: min(285px, 36vw);
  }
  .l1-memory-panel p { max-height: 82px; overflow: auto; }
}

/* ===============================
   NIVEL 1 THREE.JS v10 - cuarto de iglesia antigua
================================= */
.level-one-threejs-v10 .l1-desktop-tips--three {
  display: none !important;
}
.level-one-threejs-v10 .l1-player-caption--three {
  top: calc(78px + var(--safe-top));
  width: min(520px, 58vw);
  padding: 7px 11px;
  background: linear-gradient(90deg, rgba(10,6,4,.72), rgba(28,17,9,.46));
  border-left-width: 2px;
}
.level-one-threejs-v10 .l1-player-caption--three strong {
  font-size: clamp(12px, 1.05vw, 17px);
}
.level-one-threejs-v10 .l1-player-caption--three span {
  font-size: clamp(9px, .78vw, 11px);
  line-height: 1.25;
  margin-top: 3px;
}
.level-one-threejs-v10 .l1-memory-panel {
  width: min(292px, calc(100vw - 44px));
  right: 18px;
  top: calc(114px + var(--safe-top));
  padding: 12px 13px 13px;
}
.level-one-threejs-v10 .l1-memory-panel strong {
  font-size: clamp(17px, 1.65vw, 24px);
}
.level-one-threejs-v10 .l1-memory-panel p {
  font-size: 11px;
  line-height: 1.36;
  margin-bottom: 10px;
}
.level-one-threejs-v10 .l1-canvas-host::after {
  background:
    radial-gradient(circle at 50% 52%, rgba(255,188,102,.028) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,.44) 67%, rgba(0,0,0,.78) 100%),
    linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.08) 38%, rgba(0,0,0,.52));
}
.level-one-threejs-v10 .l1-three-viewport.light-off .l1-canvas-host::after {
  background:
    radial-gradient(circle at 50% 53%, rgba(255,184,84,.018) 0%, rgba(0,0,0,.22) 20%, rgba(0,0,0,.64) 70%, rgba(0,0,0,.88) 100%),
    linear-gradient(180deg, rgba(0,0,0,.48), rgba(0,0,0,.20) 40%, rgba(0,0,0,.68));
}
.level-one-threejs-v10 .level-intro .intro-copy {
  width: min(620px, 90vw);
  padding: clamp(18px, 2.4vw, 28px);
}
.level-one-threejs-v10 .level-intro .intro-title {
  font-size: clamp(28px, 3.4vw, 48px);
}
.level-one-threejs-v10 .level-intro .intro-body {
  font-size: clamp(13px, 1.12vw, 16px);
  line-height: 1.5;
}
@media (pointer: coarse) {
  .level-one-threejs-v10 .l1-player-caption--three {
    width: min(520px, 58vw);
    padding: 6px 8px;
  }
  .level-one-threejs-v10 .l1-player-caption--three span {
    display: none;
  }
}

/* ===============================
   NIVEL 1 THREE.JS v11 - sacristía elaborada
================================= */
.level-one-threejs-v11 .l1-desktop-tips,
.level-one-threejs-v11 .l1-desktop-tips--three {
  display: none !important;
}
.level-one-threejs-v11 .l1-player-caption--three {
  top: calc(78px + var(--safe-top));
  width: min(540px, 56vw);
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(10,6,4,.74), rgba(34,18,10,.42));
  border-left: 2px solid rgba(223,184,107,.52);
}
.level-one-threejs-v11 .l1-player-caption--three strong {
  font-size: clamp(16px, 1.45vw, 24px);
}
.level-one-threejs-v11 .l1-player-caption--three span {
  font-size: 13px;
  line-height: 1.35;
}
.level-one-threejs-v11 .l1-flashlight-control--three {
  width: min(660px, 50vw);
  bottom: calc(16px + var(--safe-bottom));
}
.level-one-threejs-v11 .l1-crosshair--three {
  width: 38px;
  height: 38px;
}
.level-one-threejs-v11 .l1-memory-panel {
  width: min(310px, 34vw);
  top: calc(136px + var(--safe-top));
}
@media (max-width: 900px) {
  .level-one-threejs-v11 .l1-player-caption--three {
    width: min(88vw, 520px);
  }
  .level-one-threejs-v11 .l1-memory-panel {
    width: min(86vw, 340px);
    top: calc(126px + var(--safe-top));
  }
}


/* ===============================
   NIVEL 1 THREE.JS v12 - corrección motor / visual
================================= */
.level-one-threejs-v12 .l1-desktop-tips,
.level-one-threejs-v12 .l1-desktop-tips--three {
  display: none !important;
}

.level-one-threejs-v12 .l1-controls-guide {
  display: block;
  width: min(760px, 82vw);
  max-height: min(72vh, 520px);
  object-fit: contain;
  margin: 0 auto;
  filter: drop-shadow(0 18px 34px rgba(0,0,0,.55));
}

.level-one-threejs-v12 .intro-card,
.level-one-threejs-v12 .overlay-card {
  max-width: min(880px, 88vw);
}

.level-one-threejs-v12 .l1-player-caption--three {
  top: calc(82px + var(--safe-top));
  width: min(520px, 52vw);
  padding: 7px 11px;
  background: linear-gradient(90deg, rgba(13,8,5,.58), rgba(34,20,11,.30));
  border: 1px solid rgba(222, 177, 94, .48);
  box-shadow: 0 12px 36px rgba(0,0,0,.28);
  backdrop-filter: blur(4px);
}

.level-one-threejs-v12 .l1-player-caption--three strong {
  font-size: clamp(15px, 1.35vw, 21px);
  letter-spacing: .03em;
}

.level-one-threejs-v12 .l1-player-caption--three span {
  font-size: 12.5px;
  line-height: 1.32;
  opacity: .88;
}

.level-one-threejs-v12 .l1-flashlight-control--three {
  width: min(640px, 49vw);
  height: 38px;
  bottom: calc(14px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(83,50,22,.84), rgba(31,17,8,.92));
}

.level-one-threejs-v12 .l1-crosshair--three {
  width: 36px;
  height: 36px;
  font-size: 23px;
  background: rgba(14, 9, 5, .42);
}

.level-one-threejs-v12 .l1-memory-panel--nonblocking {
  pointer-events: none;
  width: min(320px, 30vw);
  top: calc(118px + var(--safe-top));
  right: max(16px, calc(18px + var(--safe-right)));
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(24,12,6,.84), rgba(10,5,3,.78));
  backdrop-filter: blur(7px);
}

.level-one-threejs-v12 .l1-memory-panel--nonblocking p {
  max-height: 82px;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.35;
}

.level-one-threejs-v12 .l1-memory-hint {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(232, 186, 105, .85);
}

.level-one-threejs-v12 .toast,
.level-one-threejs-v12 .feedback-toast {
  font-size: 12px !important;
  max-width: min(360px, 46vw) !important;
  opacity: .92;
}

@media (max-width: 900px) {
  .level-one-threejs-v12 .l1-player-caption--three {
    width: min(88vw, 520px);
  }
  .level-one-threejs-v12 .l1-memory-panel--nonblocking {
    width: min(84vw, 320px);
  }
  .level-one-threejs-v12 .l1-controls-guide {
    width: min(92vw, 720px);
  }
}


/* ===============================
   NIVEL 1 THREE.JS v13 - texturas aplicadas
================================= */
.level-one-threejs-v13 .l1-controls-guide {
  display: block;
  width: min(860px, 84vw);
  max-height: min(72vh, 560px);
  object-fit: contain;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 20px 42px rgba(0,0,0,.45);
}

.level-one-threejs-v13 .intro-copy {
  max-width: min(940px, 90vw);
}

.level-one-threejs-v13 .l1-player-caption--three {
  top: calc(84px + var(--safe-top));
  width: min(540px, 54vw);
  padding: 7px 11px;
  background: linear-gradient(90deg, rgba(11,7,5,.50), rgba(35,19,9,.26));
  border: 1px solid rgba(214,173,95,.38);
  backdrop-filter: blur(3px);
}

.level-one-threejs-v13 .l1-player-caption--three strong {
  font-size: clamp(15px, 1.2vw, 20px);
}

.level-one-threejs-v13 .l1-player-caption--three span {
  font-size: 12px;
  line-height: 1.3;
  opacity: .84;
}

.level-one-threejs-v13 .l1-memory-panel--nonblocking {
  width: min(320px, 32vw);
  pointer-events: none;
}

@media (max-width: 900px) {
  .level-one-threejs-v13 .l1-controls-guide {
    width: min(94vw, 820px);
  }
  .level-one-threejs-v13 .l1-player-caption--three {
    width: min(88vw, 540px);
  }
}


/* ===============================
   NIVEL 1 THREE.JS v14 - texturas embebidas / carga segura
================================= */
.level-one-threejs-v14 .l1-player-caption--three {
  background: linear-gradient(90deg, rgba(8,5,3,.42), rgba(33,18,9,.22));
  border-color: rgba(221, 177, 96, .34);
  opacity: .92;
}

.level-one-threejs-v14 .l1-controls-guide {
  display: block;
  width: min(860px, 84vw);
  max-height: min(72vh, 560px);
  object-fit: contain;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0,0,0,.48);
}

.level-one-threejs-v14 .l1-flashlight-control--three {
  background: linear-gradient(180deg, rgba(100,64,30,.88), rgba(36,20,10,.94));
}

.level-one-threejs-v14 .l1-memory-panel--nonblocking {
  background: linear-gradient(180deg, rgba(24,12,6,.78), rgba(10,5,3,.68));
}


/* ===============================
   NIVEL 1 THREE.JS v15 - UI compacta y correcciones
================================= */
.level-one-threejs-v15 .l1-controls-guide {
  width: min(640px, 70vw);
  max-height: min(56vh, 380px);
  object-fit: contain;
}
.level-one-threejs-v15 .intro-card,
.level-one-threejs-v15 .overlay-card { max-width: min(760px, 82vw); }
.level-one-threejs-v15 .hud-header,
.level-one-threejs-v15 .hud-topbar { transform: scale(.92); transform-origin: top left; }
.level-one-threejs-v15 .l1-player-caption--three {
  top: calc(78px + var(--safe-top));
  width: min(420px, 42vw);
  padding: 6px 10px;
  background: linear-gradient(90deg, rgba(10,8,6,.34), rgba(28,18,11,.18));
  border: 1px solid rgba(214,173,95,.22);
  backdrop-filter: blur(2px);
}
.level-one-threejs-v15 .l1-player-caption--three strong { font-size: clamp(14px,1.05vw,18px); }
.level-one-threejs-v15 .l1-player-caption--three span { font-size: 11.2px; line-height: 1.22; opacity: .8; }
.level-one-threejs-v15 .l1-flashlight-control--three { width: min(560px, 42vw); height: 34px; bottom: calc(14px + var(--safe-bottom)); font-size: 14px; }
.level-one-threejs-v15 .l1-crosshair--three { width: 34px; height: 34px; font-size: 22px; }
.level-one-threejs-v15 .l1-memory-panel--nonblocking {
  width: min(270px, 24vw); top: calc(108px + var(--safe-top)); padding: 14px 14px 12px;
  background: linear-gradient(180deg, rgba(22,13,8,.72), rgba(10,6,4,.60));
}
.level-one-threejs-v15 .l1-memory-panel--nonblocking strong { font-size: 18px; }
.level-one-threejs-v15 .l1-memory-panel--nonblocking p { font-size: 11.5px; line-height: 1.25; max-height: 64px; }
.level-one-threejs-v15 .toast, .level-one-threejs-v15 .feedback-toast { font-size: 12px !important; max-width: 280px !important; }
.level-one-threejs-v15 .hud-title { font-size: clamp(22px, 2vw, 34px); }
.level-one-threejs-v15 .hud-subtitle { font-size: clamp(12px, .95vw, 15px); max-width: 48vw; }
@media (max-width: 900px) {
  .level-one-threejs-v15 .l1-controls-guide { width: min(90vw, 560px); max-height: 44vh; }
  .level-one-threejs-v15 .l1-player-caption--three { width: min(82vw, 420px); }
  .level-one-threejs-v15 .l1-memory-panel--nonblocking { width: min(78vw, 270px); }
}


/* ===============================
   NIVEL 1 THREE.JS v16 - modelo importado y UI más discreta
================================= */
.level-one-threejs-v16 .hud {
  --hud-scale: .86;
}
.level-one-threejs-v16 .hud__title { font-size: clamp(18px, 1.55vw, 26px) !important; }
.level-one-threejs-v16 .hud__objective { font-size: clamp(11px, .82vw, 13px) !important; max-width: 42vw; opacity: .82; }
.level-one-threejs-v16 .hud__right { gap: 8px !important; padding: 8px 10px !important; }
.level-one-threejs-v16 .hud-block { min-width: 58px !important; }
.level-one-threejs-v16 .hud-label { font-size: 10px !important; letter-spacing: .08em; }
.level-one-threejs-v16 .hud-value { font-size: 13px !important; }
.level-one-threejs-v16 .hud-btn { height: 32px !important; padding: 0 11px !important; font-size: 12px !important; }
.level-one-threejs-v16 .audio-toggle { transform: scale(.88); transform-origin: bottom right; }
.level-one-threejs-v16 .l1-controls-guide {
  width: min(520px, 62vw) !important;
  max-height: min(48vh, 310px) !important;
  object-fit: contain;
}
.level-one-threejs-v16 .intro-title { font-size: clamp(30px, 3.1vw, 48px) !important; }
.level-one-threejs-v16 .intro-copy { max-width: min(680px, 78vw) !important; padding: 22px 28px !important; }
.level-one-threejs-v16 .level-intro .btn { height: 42px !important; padding: 0 18px !important; font-size: 13px !important; }
.level-one-threejs-v16 .l1-player-caption--three {
  top: calc(72px + var(--safe-top)) !important;
  width: min(340px, 34vw) !important;
  padding: 5px 8px !important;
  background: linear-gradient(90deg, rgba(8,6,4,.28), rgba(26,17,10,.14)) !important;
  border-color: rgba(214,173,95,.18) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
}
.level-one-threejs-v16 .l1-player-caption--three strong { font-size: clamp(12px, .95vw, 16px) !important; }
.level-one-threejs-v16 .l1-player-caption--three span { font-size: 10.5px !important; line-height: 1.18 !important; opacity: .74 !important; }
.level-one-threejs-v16 .l1-flashlight-control--three {
  width: min(420px, 36vw) !important;
  height: 31px !important;
  bottom: calc(12px + var(--safe-bottom)) !important;
  font-size: 12px !important;
}
.level-one-threejs-v16 .l1-crosshair--three { width: 32px !important; height: 32px !important; font-size: 20px !important; }
.level-one-threejs-v16 .l1-memory-panel--nonblocking { width: min(250px, 22vw) !important; top: calc(96px + var(--safe-top)) !important; padding: 12px !important; }
.level-one-threejs-v16 .toast, .level-one-threejs-v16 .feedback-toast { font-size: 11.5px !important; max-width: 250px !important; }
@media (max-width: 900px) {
  .level-one-threejs-v16 .hud__objective { display: none !important; }
  .level-one-threejs-v16 .l1-controls-guide { width: min(86vw, 480px) !important; max-height: 42vh !important; }
  .level-one-threejs-v16 .l1-player-caption--three { width: min(78vw, 340px) !important; }
  .level-one-threejs-v16 .l1-flashlight-control--three { width: min(62vw, 400px) !important; }
}


/* ===============================
   NIVEL 1 THREE.JS v17 - texturas canvas y más elementos
================================= */
.level-one-threejs-v17 .hud {
  transform: scale(.88);
  transform-origin: top left;
}
.level-one-threejs-v17 .hud-card,
.level-one-threejs-v17 .level-hud,
.level-one-threejs-v17 .hud-panel {
  font-size: 12px;
}
.level-one-threejs-v17 .l1-controls-guide {
  width: min(560px, 62vw);
  max-height: min(46vh, 320px);
  object-fit: contain;
}
.level-one-threejs-v17 .intro-copy {
  max-width: min(680px, 74vw);
  padding: 28px 34px !important;
}
.level-one-threejs-v17 .intro-title {
  font-size: clamp(28px, 3.4vw, 48px) !important;
  line-height: .95 !important;
}
.level-one-threejs-v17 .intro-body {
  font-size: 14px !important;
  line-height: 1.25 !important;
}
.level-one-threejs-v17 .btn.primary {
  padding: 10px 18px;
  font-size: 14px;
}
.level-one-threejs-v17 .l1-player-caption--three {
  top: calc(90px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(400px, 42vw);
  padding: 16px 22px;
  opacity: .95;
  background: linear-gradient(90deg, rgba(16,10,6,.92), rgba(38,23,12,.80));
  border-color: rgba(214,173,95,.45);
  border-left: 3px solid rgba(223,184,107,.88);
  box-shadow: 0 14px 40px rgba(0,0,0,.50);
  backdrop-filter: blur(10px);
}
.level-one-threejs-v17 .l1-player-caption--three strong {
  font-size: clamp(18px, 1.6vw, 28px);
}
.level-one-threejs-v17 .l1-player-caption--three span {
  font-size: clamp(13px, 1.2vw, 17px);
  line-height: 1.3;
}
.level-one-threejs-v17 .l1-flashlight-control--three {
  width: min(480px, 36vw);
  height: 31px;
  font-size: 12px;
}
.level-one-threejs-v17 .l1-crosshair--three {
  width: 31px;
  height: 31px;
  font-size: 20px;
}
.level-one-threejs-v17 .toast,
.level-one-threejs-v17 .feedback-toast {
  max-width: 260px !important;
  font-size: 11px !important;
}
@media (max-width: 900px) {
  .level-one-threejs-v17 .l1-controls-guide {
    width: min(86vw, 520px);
    max-height: 40vh;
  }
  .level-one-threejs-v17 .l1-player-caption--three {
    width: min(80vw, 380px);
  }
}


/* ===============================
   NIVEL 1 THREE.JS v18 - panel con imagen y transición
================================= */
.level-one-threejs-v17 .l1-memory-panel--nonblocking,
.level-one-threejs-v18 .l1-memory-panel--nonblocking {
  width: min(420px, calc(100vw - 40px));
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.85);
  border-radius: 18px;
}
.level-one-threejs-v17 .l1-memory-panel--nonblocking.show,
.level-one-threejs-v18 .l1-memory-panel--nonblocking.show {
  transform: translate(-50%, -50%) scale(1);
}
.level-one-threejs-v17 .l1-memory-panel--nonblocking.closing,
.level-one-threejs-v18 .l1-memory-panel--nonblocking.closing {
  transform: translate(-50%, -50%) scale(.88);
}
.l1-memory-image-wrap {
  margin: 10px 0 14px;
  display: flex;
  justify-content: center;
}
.l1-memory-image {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 0.78;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(212,166,91,.42);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  background: rgba(255,245,222,.08);
}
.level-complete-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(55,32,15,.28), rgba(4,2,1,.86));
  opacity: 0;
  transition: opacity .35s ease;
}
.level-complete-overlay.show { opacity: 1; }
.level-complete-overlay.closing { opacity: 0; }
.level-complete-card {
  width: min(640px, 82vw);
  padding: 28px 30px 26px;
  border-radius: 22px;
  border: 1px solid rgba(214,173,95,.48);
  background: linear-gradient(180deg, rgba(20,11,6,.92), rgba(9,5,3,.88));
  box-shadow: 0 20px 70px rgba(0,0,0,.46);
  transform: translateY(16px) scale(.96);
  transition: transform .4s ease;
  text-align: center;
}
.level-complete-overlay.show .level-complete-card { transform: translateY(0) scale(1); }
.level-complete-kicker {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #d6ad5f;
  margin-bottom: 10px;
}
.level-complete-card h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
  line-height: .95;
}
.level-complete-card p {
  margin: 14px auto 10px;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255,243,224,.84);
}
.level-complete-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}
.level-complete-badges span {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(214,173,95,.28);
  background: rgba(255,255,255,.04);
  font-size: 12px;
}
.level-complete-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(214,173,95,.18);
  margin: 8px 0 12px;
}
.level-complete-bar span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 2.1s ease;
  background: linear-gradient(90deg, #9c632b, #d6ad5f, #f0d39a);
}
.level-complete-next {
  display: inline-block;
  margin-top: 6px;
  color: #f0d39a;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}


/* ===============================
   v19 - transición pantalla completa entre niveles
================================= */
.fragment-transition {
  position: absolute;
  inset: 0;
  z-index: 120;
  overflow: hidden;
  opacity: 0;
  transition: opacity .36s ease;
}
.fragment-transition.show { opacity: 1; }
.fragment-transition.closing { opacity: 0; }
.fragment-transition__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(.95) brightness(.54);
}
.fragment-transition__shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255,214,138,.08), rgba(0,0,0,0) 28%),
    linear-gradient(180deg, rgba(7,4,2,.28), rgba(6,3,1,.84));
  backdrop-filter: blur(1px);
}
.fragment-transition__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5vh 6vw;
}
.fragment-transition__kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .24em;
  color: #d6ad5f;
  opacity: .92;
  margin-bottom: 12px;
}
.fragment-transition__star-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 8px;
}
.fragment-transition__star-glow {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,211,154,.38), rgba(240,211,154,0) 68%);
  filter: blur(8px);
  opacity: 0;
  transform: scale(.6);
  transition: all .55s ease;
}
.fragment-transition__star {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 130px;
  line-height: 1;
  color: #f0d39a;
  text-shadow: 0 0 18px rgba(240,211,154,.24), 0 0 56px rgba(214,173,95,.24);
  opacity: 0;
  transform: scale(.38) rotate(-16deg);
  transition: all .55s cubic-bezier(.2,.8,.2,1);
}
.fragment-transition.star-on .fragment-transition__star { opacity: 1; transform: scale(1) rotate(0deg); }
.fragment-transition.star-on .fragment-transition__star-glow { opacity: 1; transform: scale(1); }
.fragment-transition__fragment {
  font-size: clamp(18px, 2vw, 28px);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f0d39a;
  margin-bottom: 10px;
}
.fragment-transition h2 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(34px, 5vw, 72px);
  line-height: .93;
  text-wrap: balance;
}
.fragment-transition p {
  margin: 14px auto 18px;
  max-width: min(60ch, 78vw);
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.45;
  color: rgba(255,245,228,.9);
}
.fragment-transition__prize {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(214,173,95,.42);
  background: rgba(15,8,4,.52);
  color: #f0d39a;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.fragment-transition__loading {
  width: min(420px, 70vw);
  height: 8px;
  margin: 18px 0 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(214,173,95,.22);
}
.fragment-transition__loading span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 2.45s ease;
  background: linear-gradient(90deg, #8f5f2a, #d6ad5f, #f0d39a);
}
.fragment-transition__next {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255,243,226,.84);
}
@media (max-width: 900px) {
  .fragment-transition__star-wrap { width: 142px; height: 142px; }
  .fragment-transition__star { font-size: 102px; }
  .fragment-transition__loading { width: 78vw; }
}


/* ===============================
   v20 - card de memoria y refinado visual
================================= */
.level-one-threejs-v20 .l1-memory-panel--nonblocking {
  left: 10px;
  top: calc(96px + var(--safe-top));
  width: min(320px, 25vw);
  padding: 12px 12px 14px;
}
.level-one-threejs-v20 .l1-memory-panel--nonblocking small {
  font-size: 11px;
  letter-spacing: .22em;
}
.level-one-threejs-v20 .l1-memory-image-wrap {
  margin: 8px 0 10px;
}
.level-one-threejs-v20 .l1-memory-image {
  max-width: 100%;
  width: 100%;
  aspect-ratio: 1 / .78;
  object-fit: cover;
}
.level-one-threejs-v20 .l1-memory-panel--nonblocking strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 18px;
  line-height: 1.05;
}
.level-one-threejs-v20 .l1-memory-panel--nonblocking p {
  font-size: 14px;
  line-height: 1.28;
  margin: 0 0 10px;
}
.level-one-threejs-v20 .l1-memory-panel--nonblocking .l1-memory-hint {
  font-size: 11px;
}


/* ===============================
   v21 - fix card sizing + clear center aisle
================================= */
.level-one-threejs-v21 .l1-memory-panel--nonblocking {
  left: 12px !important;
  top: calc(94px + var(--safe-top)) !important;
  width: min(360px, 28vw) !important;
  max-width: min(360px, calc(100vw - 24px));
  padding: 14px 14px 16px !important;
}
.level-one-threejs-v21 .l1-memory-image-wrap {
  margin: 8px 0 12px;
}
.level-one-threejs-v21 .l1-memory-image {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / .78;
  object-fit: cover;
  display: block;
}
.level-one-threejs-v21 .l1-memory-panel--nonblocking strong {
  display: block;
  margin: 6px 0 10px;
  font-size: 20px !important;
  line-height: 1.06 !important;
}
.level-one-threejs-v21 .l1-memory-panel--nonblocking p {
  font-size: 16px !important;
  line-height: 1.28 !important;
  margin: 0 0 12px !important;
  max-height: none !important;
  overflow: visible !important;
}
.level-one-threejs-v21 .l1-memory-panel--nonblocking .l1-memory-hint {
  font-size: 11px;
  letter-spacing: .18em;
}
@media (max-width: 1200px) {
  .level-one-threejs-v21 .l1-memory-panel--nonblocking {
    width: min(340px, 31vw) !important;
  }
  .level-one-threejs-v21 .l1-memory-panel--nonblocking p {
    font-size: 15px !important;
  }
}
@media (max-width: 900px), (pointer: coarse) {
  .level-one-threejs-v21 .l1-memory-panel--nonblocking {
    width: min(320px, 42vw) !important;
    top: calc(72px + var(--safe-top)) !important;
  }
  .level-one-threejs-v21 .l1-memory-panel--nonblocking strong {
    font-size: 18px !important;
  }
  .level-one-threejs-v21 .l1-memory-panel--nonblocking p {
    font-size: 14px !important;
  }
}

/* ===============================
   FIX MOBILE NIVEL 1 - iPhone / Android
   - Altura real con visualViewport
   - Joystick izquierdo separado de cámara derecha
   - Cards de memoria más pequeñas solo en mobile
================================= */
@media (pointer: coarse) {
  html,
  body,
  .game {
    width: 100%;
    height: var(--app-height, 100dvh);
    min-height: var(--app-height, 100dvh);
    max-height: var(--app-height, 100dvh);
    overflow: hidden;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  .level-one-threejs,
  .level-one-threejs .scene,
  .level-one-threejs .level1-three-content,
  .level-one-threejs .l1-three-viewport {
    height: var(--app-height, 100dvh);
    min-height: var(--app-height, 100dvh);
    max-height: var(--app-height, 100dvh);
    overflow: hidden;
  }

  .level-one-threejs .l1-three-viewport,
  .level-one-threejs .l1-canvas-host,
  .level-one-threejs .l1-canvas-host canvas,
  .level-one-threejs .l1-mobile-controls,
  .level-one-threejs .l1-joystick,
  .level-one-threejs .l1-look-pad {
    touch-action: none;
  }

  .level-one-threejs .l1-mobile-controls {
    z-index: 145;
    pointer-events: none;
  }

  .level-one-threejs .l1-joystick {
    left: max(10px, env(safe-area-inset-left));
    bottom: calc(10px + var(--safe-bottom));
    width: clamp(84px, 20vw, 112px);
    height: clamp(84px, 20vw, 112px);
    opacity: .9;
  }

  .level-one-threejs .l1-joystick span {
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
  }

  .level-one-threejs .l1-touch-right {
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(10px + var(--safe-bottom));
    width: min(42vw, 245px);
    gap: 7px;
    pointer-events: none;
  }

  .level-one-threejs .l1-look-pad,
  .level-one-threejs .l1-touch-btn {
    pointer-events: auto;
  }

  .level-one-threejs .l1-look-pad {
    height: clamp(54px, 17vh, 86px);
    border-radius: 16px;
    opacity: .78;
    background: rgba(12,7,4,.46);
  }

  .level-one-threejs .l1-look-pad::after {
    content: ' lado derecho';
    opacity: .72;
    font-weight: 800;
    letter-spacing: .06em;
  }

  .level-one-threejs .l1-touch-btn {
    min-height: clamp(36px, 10vh, 46px);
    border-radius: 14px;
    font-size: clamp(9px, 2.5vw, 11px);
    padding: 0 8px;
  }

  .level-one-threejs .l1-player-caption--three {
    top: calc(48px + var(--safe-top));
    width: min(58vw, 330px);
    padding: 5px 8px;
    opacity: .76;
  }

  .level-one-threejs .l1-player-caption--three strong {
    font-size: clamp(10px, 2.5vw, 13px);
  }

  .level-one-threejs .l1-player-caption--three span {
    font-size: clamp(8px, 2vw, 10px);
    line-height: 1.18;
  }

  .level-one-threejs-v21 .l1-memory-panel--nonblocking,
  .level-one-threejs .l1-memory-panel--nonblocking {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(.85) !important;
    width: min(340px, 88vw) !important;
    max-width: min(340px, 88vw) !important;
    padding: 14px 16px !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 50px rgba(0,0,0,.55) !important;
    pointer-events: auto;
  }
  .level-one-threejs-v21 .l1-memory-panel--nonblocking.show,
  .level-one-threejs .l1-memory-panel--nonblocking.show {
    transform: translate(-50%, -50%) scale(1) !important;
  }
  .level-one-threejs-v21 .l1-memory-panel--nonblocking.closing,
  .level-one-threejs .l1-memory-panel--nonblocking.closing {
    transform: translate(-50%, -50%) scale(.88) !important;
  }

  .level-one-threejs .l1-memory-panel--nonblocking small,
  .level-one-threejs-v21 .l1-memory-panel--nonblocking small {
    font-size: 9px !important;
    letter-spacing: .15em !important;
    margin-bottom: 5px !important;
  }

  .level-one-threejs .l1-memory-image-wrap,
  .level-one-threejs-v21 .l1-memory-image-wrap {
    margin: 6px 0 8px !important;
  }

  .level-one-threejs .l1-memory-image,
  .level-one-threejs-v21 .l1-memory-image {
    max-height: 100px !important;
    aspect-ratio: 1.5 / 1 !important;
    border-radius: 10px !important;
  }

  .level-one-threejs .l1-memory-panel--nonblocking strong,
  .level-one-threejs-v21 .l1-memory-panel--nonblocking strong {
    margin: 4px 0 6px !important;
    font-size: clamp(14px, 3.5vw, 18px) !important;
    line-height: 1.05 !important;
  }

  .level-one-threejs .l1-memory-panel--nonblocking p,
  .level-one-threejs-v21 .l1-memory-panel--nonblocking p {
    margin: 0 !important;
    font-size: clamp(7.5px, 2vw, 9px) !important;
    line-height: 1.18 !important;
    max-height: 38px !important;
    overflow: hidden !important;
  }

  .level-one-threejs .l1-memory-hint,
  .level-one-threejs-v21 .l1-memory-hint {
    display: none !important;
  }

  .level-one-threejs .l1-mobile-notice__card {
    width: min(420px, 90vw);
    padding: 18px;
  }

  .level-one-threejs .l1-mobile-notice__card strong {
    font-size: clamp(24px, 7vw, 34px);
  }

  .level-one-threejs .l1-mobile-notice__card p {
    font-size: 12px;
    line-height: 1.35;
  }
}

@media (pointer: coarse) and (orientation: landscape) {
  .level-one-threejs .hud {
    top: calc(5px + var(--safe-top));
    left: calc(7px + env(safe-area-inset-left));
    right: calc(7px + env(safe-area-inset-right));
  }

  .level-one-threejs .hud__left {
    max-width: 38vw;
    padding: 5px 8px;
  }

  .level-one-threejs .hud__right {
    padding: 4px;
    gap: 4px;
  }

  .level-one-threejs .hud-btn {
    height: 28px;
    padding: 0 8px;
    font-size: 9px;
  }

  .level-one-threejs .life {
    width: 9px;
    height: 19px;
  }

  .level-one-threejs .l1-crosshair--three {
    width: 28px;
    height: 28px;
    font-size: 19px;
  }

  .level-one-threejs .l1-mobile-notice.show {
    display: none;
  }
}

@media (pointer: coarse) and (orientation: portrait) {
  .level-one-threejs .l1-mobile-controls {
    display: none;
  }
}

@media (pointer: coarse) and (max-height: 430px) and (orientation: landscape) {
  .level-one-threejs .l1-player-caption--three span {
    display: none;
  }

  .level-one-threejs .l1-joystick {
    width: 82px;
    height: 82px;
  }

  .level-one-threejs .l1-joystick span {
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
  }

  .level-one-threejs .l1-touch-right {
    width: min(40vw, 215px);
  }

  .level-one-threejs .l1-look-pad {
    height: 48px;
    font-size: 9px;
  }

  .level-one-threejs .l1-touch-btn {
    min-height: 32px;
    font-size: 8.5px;
  }

  .level-one-threejs-v21 .l1-memory-panel--nonblocking,
  .level-one-threejs .l1-memory-panel--nonblocking {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(.85) !important;
    width: min(300px, 40vw) !important;
    max-width: min(300px, 40vw) !important;
  }
  .level-one-threejs-v21 .l1-memory-panel--nonblocking.show,
  .level-one-threejs .l1-memory-panel--nonblocking.show {
    transform: translate(-50%, -50%) scale(1) !important;
  }

  .level-one-threejs .l1-memory-image,
  .level-one-threejs-v21 .l1-memory-image {
    max-height: 70px !important;
  }

  .level-one-threejs .l1-memory-panel--nonblocking p,
  .level-one-threejs-v21 .l1-memory-panel--nonblocking p {
    max-height: 52px !important;
  }
}

/* === Nivel 3: fase extra de rompecabezas contra reloj === */
.level-three .timeline-pieces.is-locked {
  opacity: 0;
  transform: translateY(18px) scale(.96);
  pointer-events: none;
  filter: blur(8px);
}
.level-three .timeline-pieces {
  transition: opacity .55s ease, transform .55s ease, filter .55s ease;
}
.puzzle-gate {
  position: absolute;
  z-index: 82;
  left: 3vw;
  right: min(25vw, 310px);
  top: calc(82px + var(--safe-top));
  bottom: calc(28px + var(--safe-bottom));
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(10px, 1.4vw, 18px);
  padding: clamp(12px, 1.7vw, 22px);
  border: 1px solid rgba(223,184,107,.46);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(12,7,4,.86), rgba(31,19,11,.74));
  box-shadow: 0 28px 80px rgba(0,0,0,.48), inset 0 0 64px rgba(223,184,107,.08);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(20px) scale(.985);
  pointer-events: none;
  transition: opacity .45s ease, transform .45s ease;
}
.puzzle-gate.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.puzzle-gate.is-complete {
  opacity: 0;
  transform: translateY(-18px) scale(.97);
  pointer-events: none;
}
.puzzle-gate__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  color: #f6e9d2;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.puzzle-gate__head p {
  margin: 0 0 4px;
  color: var(--gold-2);
  font-size: clamp(10px, .9vw, 13px);
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.puzzle-gate__head h3 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 54px);
  line-height: .92;
}
.puzzle-progress {
  flex: 0 0 auto;
  display: inline-flex;
  min-width: 104px;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid rgba(243,211,145,.42);
  border-radius: 999px;
  background: rgba(8,5,3,.46);
  color: #f3d391;
  font-weight: 900;
}
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
  min-height: 0;
}
.mini-puzzle {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-width: 0;
  padding: clamp(10px, 1.2vw, 16px);
  border: 1px solid rgba(223,184,107,.24);
  border-radius: 20px;
  background: rgba(255,244,216,.065);
  box-shadow: inset 0 0 24px rgba(0,0,0,.24);
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}
.mini-puzzle.solved {
  border-color: rgba(148,255,179,.62);
  background: rgba(112,255,150,.10);
  transform: translateY(-2px);
}
.mini-puzzle.solved::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(92,211,128,.95);
  color: #0d120c;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(92,211,128,.45);
}
.mini-puzzle__caption strong,
.mini-puzzle__caption small {
  display: block;
}
.mini-puzzle__caption strong {
  color: #f6e6c5;
  font-size: clamp(13px, 1vw, 17px);
}
.mini-puzzle__caption small {
  margin-top: 3px;
  color: rgba(246,230,197,.66);
  font-size: clamp(10px, .72vw, 12px);
  line-height: 1.25;
}
.mini-puzzle__board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  min-height: 150px;
  border: 2px solid rgba(243,211,145,.34);
  border-radius: 16px;
  background: rgba(0,0,0,.25);
  box-shadow: 0 20px 44px rgba(0,0,0,.35);
}
.mini-puzzle__tile {
  appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background-color: rgba(30,20,12,.8);
  background-repeat: no-repeat;
  cursor: pointer;
  transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}
.mini-puzzle__tile:hover,
.mini-puzzle__tile.selected {
  position: relative;
  z-index: 2;
  filter: brightness(1.18) saturate(1.08);
  transform: scale(1.025);
  box-shadow: 0 0 0 3px rgba(243,211,145,.72), 0 0 24px rgba(243,211,145,.34);
}
.mini-puzzle__tile.auto-hint {
  position: relative;
  z-index: 2;
  animation: autoHintPulse 1.8s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(255,180,60,.8), 0 0 28px rgba(255,180,60,.45);
}
@keyframes autoHintPulse {
  0%, 100% { filter: brightness(1.1); box-shadow: 0 0 0 3px rgba(255,180,60,.8), 0 0 28px rgba(255,180,60,.45); }
  50% { filter: brightness(1.35); box-shadow: 0 0 0 4px rgba(255,200,80,.9), 0 0 36px rgba(255,200,80,.55); }
}
.mini-puzzle__tile:disabled {
  cursor: default;
  filter: brightness(1.06);
}

@media (max-width: 900px), (pointer: coarse) {
  .puzzle-gate {
    left: 8px !important;
    right: 8px !important;
    top: calc(118px + var(--safe-top)) !important;
    bottom: calc(92px + var(--safe-bottom)) !important;
    border-radius: 20px;
    padding: 10px;
  }
  .puzzle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
  }
  .puzzle-gate__head {
    align-items: start;
  }
  .puzzle-gate__head h3 {
    font-size: clamp(22px, 7vw, 34px);
  }
  .puzzle-progress {
    min-width: 84px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .mini-puzzle {
    gap: 7px;
    padding: 8px;
    border-radius: 16px;
  }
  .mini-puzzle__caption small {
    display: none;
  }
  .mini-puzzle__board {
    min-height: 118px;
    border-radius: 12px;
  }
}


/* === v164: nivel 3, rompecabezas de 4 cuadros y cards cuadradas por encima === */
.level-three .timeline-pieces,
.level-three .timeline-piece,
.level-three .timeline-piece.is-dragging {
  z-index: 220 !important;
}
.level-three .timeline-piece {
  aspect-ratio: 1 / 1 !important;
  width: clamp(142px, 12.2vw, 178px) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 16px !important;
}
.level-three .timeline-piece__image {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  transform: none !important;
}
.level-three .timeline-piece.is-dragging {
  z-index: 9999 !important;
  transform: translate(-50%, -50%) scale(1.04) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,.58), 0 0 0 2px rgba(243,211,145,.72) !important;
}
.level-three .time-slot {
  min-height: clamp(132px, 13vw, 178px) !important;
}
.puzzle-gate {
  z-index: 9998 !important;
  right: min(21vw, 270px) !important;
  overflow: visible !important;
}
.puzzle-grid {
  align-items: start !important;
}
.mini-puzzle {
  grid-template-rows: auto auto !important;
  overflow: visible !important;
  z-index: 9999 !important;
}
.mini-puzzle__board {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
}
.mini-puzzle__tile {
  aspect-ratio: 1 / 1 !important;
  background-size: 200% 200% !important;
}
.mini-puzzle__tile.selected {
  z-index: 10000 !important;
}
@media (max-width: 900px), (pointer: coarse) {
  .puzzle-gate {
    z-index: 9998 !important;
    left: 8px !important;
    right: 8px !important;
    overflow: hidden !important;
  }
  .puzzle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow: auto !important;
  }
  .level-three .timeline-piece {
    width: min(42vw, 168px) !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
  .level-three .time-slot {
    min-height: clamp(104px, 28vw, 138px) !important;
  }
}


/* === v165: nivel 3 rompecabezas 8 piezas y distribución rectangular === */
.level-three .timeline-pieces,
.level-three .timeline-piece,
.level-three .timeline-piece.is-dragging,
.puzzle-gate,
.mini-puzzle,
.mini-puzzle__board,
.mini-puzzle__tile {
  z-index: 50000 !important;
}
.puzzle-gate {
  position: fixed !important;
  left: clamp(12px, 2vw, 28px) !important;
  right: clamp(12px, 2vw, 28px) !important;
  top: calc(84px + var(--safe-top)) !important;
  bottom: calc(18px + var(--safe-bottom)) !important;
  overflow: visible !important;
  z-index: 50000 !important;
}
.puzzle-gate__head h3 {
  font-size: clamp(26px, 3vw, 48px) !important;
  line-height: .94 !important;
}
.puzzle-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: start !important;
  overflow: visible !important;
  gap: clamp(10px, 1.15vw, 18px) !important;
}
.mini-puzzle {
  grid-template-rows: auto auto !important;
  overflow: visible !important;
  padding: clamp(9px, 1vw, 14px) !important;
}
.mini-puzzle__board {
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
}
.mini-puzzle__tile {
  aspect-ratio: auto !important;
  background-size: 400% 200% !important;
  background-repeat: no-repeat !important;
  z-index: 50001 !important;
}
.mini-puzzle__tile.selected {
  z-index: 50002 !important;
}
.level-three .timeline-piece {
  aspect-ratio: 4 / 3 !important;
  width: clamp(176px, 15.6vw, 224px) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 15px !important;
}
.level-three .timeline-piece__image {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 4 / 3 !important;
  object-fit: cover !important;
  transform: none !important;
}
.level-three .timeline-piece.placed {
  aspect-ratio: 4 / 3 !important;
  width: min(15.6vw, 216px) !important;
  height: auto !important;
}
.level-three .time-slot {
  min-height: clamp(128px, 12vw, 174px) !important;
}
@media (max-width: 900px), (pointer: coarse) {
  .puzzle-gate {
    left: 8px !important;
    right: 8px !important;
    top: calc(104px + var(--safe-top)) !important;
    bottom: calc(70px + var(--safe-bottom)) !important;
    overflow: auto !important;
  }
  .puzzle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow: visible !important;
  }
  .mini-puzzle__board {
    aspect-ratio: 4 / 3 !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  }
  .level-three .timeline-piece {
    width: min(44vw, 180px) !important;
    aspect-ratio: 4 / 3 !important;
  }
  .level-three .time-slot {
    min-height: clamp(104px, 26vw, 138px) !important;
  }
}
@media (max-width: 560px) {
  .puzzle-grid {
    grid-template-columns: 1fr !important;
  }
}


/* === Ajuste Julio: barra de luz nivel 1 === */
.l1-lightmeter {
  position: absolute;
  left: 18px;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 94;
  width: min(240px, 26vw);
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(223,184,107,.34);
  background: linear-gradient(180deg, rgba(18,10,6,.88), rgba(43,25,12,.72));
  box-shadow: 0 16px 34px rgba(0,0,0,.34);
  backdrop-filter: blur(8px);
}
.l1-lightmeter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #f3dfb8;
}
.l1-lightmeter__head span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .9;
}
.l1-lightmeter__head strong {
  font-size: 13px;
  color: #fff3d2;
}
.l1-lightmeter__track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,244,220,.10);
  box-shadow: inset 0 0 0 1px rgba(255,234,191,.10);
}
.l1-lightmeter__fill {
  height: 100%;
  border-radius: inherit;
  transform-origin: left center;
  background: linear-gradient(90deg, #ffe8a1 0%, #f3c45e 45%, #cb8e2f 100%);
  box-shadow: 0 0 18px rgba(243,196,94,.42);
  transition: transform .18s linear, background .2s ease, box-shadow .2s ease;
}
.l1-lightmeter.is-low .l1-lightmeter__fill {
  background: linear-gradient(90deg, #ffd59a 0%, #ff9f5c 46%, #e15a38 100%);
  box-shadow: 0 0 16px rgba(255,131,92,.34);
}
.l1-lightmeter.is-empty .l1-lightmeter__fill {
  background: linear-gradient(90deg, #ffb9a2 0%, #ff7e69 45%, #d5403c 100%);
  box-shadow: 0 0 14px rgba(213,64,60,.28);
}
@media (pointer: coarse) {
  .l1-lightmeter {
    left: max(10px, env(safe-area-inset-left));
    bottom: calc(118px + var(--safe-bottom));
    width: min(200px, 48vw);
    padding: 9px 10px;
  }
  .l1-lightmeter__head span { font-size: 10px; }
  .l1-lightmeter__head strong { font-size: 12px; }
}
@media (max-width: 900px) {
  .level-one-threejs-v17 .l1-flashlight-control--three,
  .level-one-threejs-v21 .l1-flashlight-control--three,
  .l1-flashlight-control--three {
    width: min(62vw, 340px);
  }
}

/* === Ajuste Julio: nivel 3, rompecabezas de 6 piezas más grandes === */
.puzzle-gate {
  left: clamp(12px, 2vw, 28px) !important;
  right: clamp(12px, 2vw, 28px) !important;
  top: calc(84px + var(--safe-top)) !important;
  bottom: calc(18px + var(--safe-bottom)) !important;
}
.puzzle-gate__head h3 {
  font-size: clamp(26px, 2.6vw, 42px) !important;
}
.puzzle-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr)) !important;
  gap: clamp(14px, 1.4vw, 22px) !important;
  align-items: stretch !important;
}
.mini-puzzle {
  padding: clamp(12px, 1.25vw, 18px) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(255,244,216,.10), rgba(255,244,216,.05)) !important;
}
.mini-puzzle__caption strong {
  font-size: clamp(15px, 1.1vw, 19px) !important;
}
.mini-puzzle__caption small {
  font-size: clamp(11px, .78vw, 13px) !important;
}
.mini-puzzle__board {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  aspect-ratio: 3 / 2 !important;
  min-height: clamp(230px, 22vw, 320px) !important;
  padding: 16px !important;
  gap: 4px !important;
  overflow: visible !important;
  border-radius: 22px !important;
  background: radial-gradient(circle at center, rgba(255,242,213,.10), rgba(0,0,0,.16)) !important;
}
.mini-puzzle__tile {
  position: relative !important;
  overflow: visible !important;
  aspect-ratio: auto !important;
  background-size: 300% 200% !important;
  background-repeat: no-repeat !important;
  background-color: rgba(44,27,14,.92) !important;
  border: 0 !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,245,220,.16) !important;
  transform-origin: center center !important;
}
.mini-puzzle__tile:hover,
.mini-puzzle__tile.selected {
  transform: scale(1.05) !important;
}
.level-three .timeline-piece {
  width: clamp(198px, 17vw, 248px) !important;
  aspect-ratio: 4 / 3 !important;
}
.level-three .time-slot {
  min-height: clamp(136px, 13vw, 182px) !important;
}
@media (max-width: 900px), (pointer: coarse) {
  .puzzle-gate {
    left: 8px !important;
    right: 8px !important;
    top: calc(104px + var(--safe-top)) !important;
    bottom: calc(70px + var(--safe-bottom)) !important;
    overflow: auto !important;
  }
  .puzzle-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .mini-puzzle__board {
    min-height: min(54vw, 280px) !important;
    padding: 12px !important;
  }
  .level-three .timeline-piece {
    width: min(46vw, 196px) !important;
  }
}


/* === Ajuste Julio v2: nivel 3 más compacto y responsive === */
.puzzle-gate {
  top: calc(90px + var(--safe-top)) !important;
  bottom: calc(16px + var(--safe-bottom)) !important;
  left: clamp(10px, 1.3vw, 18px) !important;
  right: clamp(10px, 1.3vw, 18px) !important;
  padding: clamp(12px, 1vw, 16px) !important;
}
.puzzle-gate__head {
  gap: 10px !important;
  margin-bottom: 10px !important;
}
.puzzle-gate__head h3 {
  font-size: clamp(22px, 2.1vw, 34px) !important;
  line-height: .98 !important;
}
.puzzle-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr)) !important;
  gap: 10px !important;
}
.mini-puzzle {
  padding: 10px !important;
  border-radius: 20px !important;
}
.mini-puzzle__caption {
  margin-bottom: 8px !important;
}
.mini-puzzle__caption strong {
  font-size: 15px !important;
}
.mini-puzzle__caption small {
  font-size: 11px !important;
  line-height: 1.25 !important;
}
.mini-puzzle__board {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  max-width: 560px !important;
  margin-inline: auto !important;
  aspect-ratio: 3 / 2 !important;
  min-height: clamp(150px, 14vw, 220px) !important;
  padding: 8px !important;
  gap: 2px !important;
  border-radius: 18px !important;
}
.mini-puzzle__tile {
  background-size: 300% 200% !important;
  background-position: center !important;
  box-shadow: 0 6px 14px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,245,220,.14) !important;
}
.mini-puzzle__tile:hover,
.mini-puzzle__tile.selected {
  transform: scale(1.03) !important;
}
.level-three .time-slot {
  min-height: clamp(112px, 10vw, 146px) !important;
}
.level-three .timeline-pieces {
  gap: 10px !important;
}
.level-three .timeline-piece {
  width: clamp(150px, 12vw, 190px) !important;
  aspect-ratio: 4 / 3 !important;
}
@media (max-width: 900px) {
  .puzzle-gate {
    top: calc(104px + var(--safe-top)) !important;
    bottom: calc(64px + var(--safe-bottom)) !important;
    overflow: auto !important;
  }
  .puzzle-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .mini-puzzle {
    padding: 10px !important;
  }
  .mini-puzzle__board {
    width: 100% !important;
    max-width: 440px !important;
    min-height: min(44vw, 215px) !important;
    padding: 7px !important;
  }
}
@media (max-width: 640px), (pointer: coarse) {
  .puzzle-gate {
    top: calc(110px + var(--safe-top)) !important;
    bottom: calc(74px + var(--safe-bottom)) !important;
    padding: 10px !important;
  }
  .puzzle-gate__head {
    position: sticky;
    top: 0;
    z-index: 4;
    padding-bottom: 8px;
    background: linear-gradient(180deg, rgba(29,14,6,.95), rgba(29,14,6,.78));
    backdrop-filter: blur(6px);
  }
  .puzzle-gate__head h3 {
    font-size: clamp(20px, 7vw, 28px) !important;
  }
  .mini-puzzle__caption small {
    font-size: 10px !important;
  }
  .mini-puzzle__board {
    max-width: 100% !important;
    min-height: min(52vw, 190px) !important;
    padding: 6px !important;
    gap: 1px !important;
  }
  .level-three .timeline-pieces {
    gap: 8px !important;
  }
  .level-three .timeline-piece {
    width: min(38vw, 150px) !important;
  }
  .level-three .time-slot {
    min-height: 96px !important;
  }
}


/* === Ajuste Julio v3: nivel 3 compacto, sin repetición y visible en viewport === */
.puzzle-gate {
  top: calc(84px + var(--safe-top)) !important;
  bottom: calc(10px + var(--safe-bottom)) !important;
  left: 10px !important;
  right: 10px !important;
  padding: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.puzzle-gate__head {
  flex: 0 0 auto !important;
  margin-bottom: 8px !important;
}
.puzzle-gate__head h3 {
  font-size: clamp(18px, 2.2vw, 28px) !important;
}
.puzzle-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  align-items: stretch !important;
}
.mini-puzzle {
  min-height: 0 !important;
  padding: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}
.mini-puzzle__caption {
  margin-bottom: 6px !important;
}
.mini-puzzle__caption strong {
  font-size: 14px !important;
}
.mini-puzzle__caption small {
  font-size: 10px !important;
  line-height: 1.2 !important;
}
.mini-puzzle__board {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: clamp(148px, 19vh, 190px) !important;
  max-width: 100% !important;
  margin-inline: auto !important;
  padding: 6px !important;
  gap: 2px !important;
  border-radius: 16px !important;
  overflow: visible !important;
}
.mini-puzzle__tile {
  background-repeat: no-repeat !important;
  background-origin: border-box !important;
  background-clip: border-box !important;
  background-color: rgba(44,27,14,.92) !important;
  background-position: var(--piece-bg-pos, center) !important;
  aspect-ratio: auto !important;
  box-shadow: 0 5px 12px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,245,220,.12) !important;
}
.mini-puzzle__tile:hover,
.mini-puzzle__tile.selected {
  transform: scale(1.02) !important;
}
.level-three .timeline-pieces {
  gap: 8px !important;
}
.level-three .timeline-piece {
  width: clamp(126px, 10vw, 160px) !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 3 !important;
}
.level-three .time-slot {
  min-height: clamp(88px, 9vh, 118px) !important;
}
@media (max-width: 900px) {
  .puzzle-gate {
    top: calc(100px + var(--safe-top)) !important;
    bottom: calc(64px + var(--safe-bottom)) !important;
    overflow: auto !important;
  }
  .puzzle-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .mini-puzzle__board {
    height: clamp(130px, 26vh, 180px) !important;
  }
}
@media (max-width: 640px), (pointer: coarse) {
  .puzzle-gate {
    top: calc(106px + var(--safe-top)) !important;
    bottom: calc(72px + var(--safe-bottom)) !important;
    overflow: auto !important;
  }
  .puzzle-gate__head {
    position: sticky !important;
    top: 0 !important;
    z-index: 4 !important;
    background: linear-gradient(180deg, rgba(29,14,6,.96), rgba(29,14,6,.84)) !important;
    padding-bottom: 6px !important;
  }
  .puzzle-gate__head h3 {
    font-size: clamp(17px, 6.2vw, 24px) !important;
  }
  .mini-puzzle {
    padding: 8px !important;
  }
  .mini-puzzle__caption strong {
    font-size: 13px !important;
  }
  .mini-puzzle__caption small {
    font-size: 9.5px !important;
  }
  .mini-puzzle__board {
    height: min(28vh, 156px) !important;
    padding: 5px !important;
    gap: 1px !important;
  }
  .level-three .timeline-piece {
    width: min(34vw, 136px) !important;
  }
  .level-three .time-slot {
    min-height: 82px !important;
  }
}


/* === Ajuste Julio v4: rompecabezas juntos + overlay final === */
.puzzle-gate {
  top: calc(86px + var(--safe-top)) !important;
  bottom: calc(8px + var(--safe-bottom)) !important;
  left: 8px !important;
  right: 8px !important;
  padding: 8px !important;
  overflow: hidden !important;
}
.puzzle-gate__head {
  margin-bottom: 6px !important;
}
.puzzle-gate__head h3 {
  font-size: clamp(16px, 2vw, 24px) !important;
}
.puzzle-grid {
  height: 100% !important;
  align-content: stretch !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: 1fr !important;
  gap: 8px !important;
}
.mini-puzzle {
  position: relative !important;
  min-height: 0 !important;
  padding: 8px 10px !important;
  border-radius: 18px !important;
}
.mini-puzzle__caption {
  margin-bottom: 4px !important;
}
.mini-puzzle__caption strong {
  font-size: 13px !important;
}
.mini-puzzle__caption small {
  font-size: 9.5px !important;
  line-height: 1.15 !important;
}
.mini-puzzle__board {
  --piece-size: clamp(62px, 5vw, 88px);
  position: relative !important;
  width: fit-content !important;
  height: auto !important;
  min-height: 0 !important;
  margin: auto !important;
  padding: 8px !important;
  display: grid !important;
  grid-template-columns: repeat(3, var(--piece-size)) !important;
  grid-template-rows: repeat(2, var(--piece-size)) !important;
  gap: 0 !important;
  justify-content: center !important;
  align-content: center !important;
  background: radial-gradient(circle at center, rgba(255,242,213,.08), rgba(0,0,0,.12)) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}
.mini-puzzle__tile {
  width: var(--piece-size) !important;
  height: var(--piece-size) !important;
  margin: 0 !important;
  display: block !important;
  box-shadow: none !important;
  transition: transform .18s ease, opacity .35s ease, filter .25s ease !important;
}
.mini-puzzle__tile:hover,
.mini-puzzle__tile.selected {
  transform: scale(1.03) !important;
  z-index: 2;
}
.mini-puzzle__preview {
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  transform: scale(.94);
  transition: opacity .45s ease, transform .45s ease;
  pointer-events: none;
  box-shadow: 0 12px 26px rgba(0,0,0,.28);
}
.mini-puzzle__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.mini-puzzle__preview.show {
  opacity: 1;
  transform: scale(1);
}
.mini-puzzle.solved .mini-puzzle__tile {
  opacity: 0;
  transform: scale(.88);
  filter: blur(1px);
}
@media (max-width: 1100px) {
  .mini-puzzle__board {
    --piece-size: clamp(56px, 5.3vw, 78px);
  }
}
@media (max-width: 900px) {
  .puzzle-gate {
    top: calc(100px + var(--safe-top)) !important;
    bottom: calc(64px + var(--safe-bottom)) !important;
    overflow: auto !important;
  }
  .puzzle-grid {
    grid-template-columns: 1fr !important;
    grid-auto-rows: auto !important;
  }
  .mini-puzzle__board {
    --piece-size: clamp(52px, 10vw, 72px);
  }
}
@media (max-width: 640px), (pointer: coarse) {
  .puzzle-gate {
    top: calc(106px + var(--safe-top)) !important;
    bottom: calc(72px + var(--safe-bottom)) !important;
    overflow: auto !important;
  }
  .puzzle-gate__head {
    position: sticky !important;
    top: 0 !important;
    z-index: 4 !important;
  }
  .mini-puzzle {
    padding: 8px !important;
  }
  .mini-puzzle__board {
    --piece-size: clamp(48px, 13vw, 68px);
  }
}

/* === Ajuste FINAL Julio: nivel 3 compacto, sin HUD y piezas grandes === */
.level-three .puzzle-gate {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  padding: max(12px, calc(10px + var(--safe-top))) clamp(12px, 1.6vw, 22px) max(12px, calc(12px + var(--safe-bottom))) !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, rgba(11, 6, 3, 0.992), rgba(21, 12, 7, 0.985)) !important;
  box-shadow: none !important;
  overflow: hidden !important;
  z-index: 999999 !important;
  display: grid !important;
  grid-template-rows: auto 1fr !important;
}
.level-three .puzzle-gate__head {
  min-height: auto !important;
  margin: 0 0 clamp(8px, 1vh, 12px) !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 14px !important;
  text-align: center !important;
}
.level-three .puzzle-gate__head p,
.level-three .puzzle-gate__head small,
.level-three .mini-puzzle__caption small {
  display: none !important;
}
.level-three .puzzle-gate__head h3 {
  margin: 0 !important;
  font-size: clamp(28px, 3.1vw, 46px) !important;
  line-height: 1 !important;
}
.level-three .puzzle-progress {
  margin-left: 0 !important;
  padding: 8px 14px !important;
  white-space: nowrap !important;
}
.level-three .puzzle-grid {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(2, max-content) !important;
  grid-template-rows: repeat(2, max-content) !important;
  justify-content: center !important;
  align-content: center !important;
  place-content: center !important;
  gap: clamp(12px, 1.5vh, 18px) clamp(18px, 2vw, 28px) !important;
  overflow: hidden !important;
}
.level-three .mini-puzzle {
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 12px !important;
  gap: 8px !important;
  display: grid !important;
  grid-template-rows: auto auto !important;
  justify-items: center !important;
  background: linear-gradient(180deg, rgba(255,244,216,.10), rgba(255,244,216,.045)) !important;
  border-radius: 20px !important;
}
.level-three .mini-puzzle__caption {
  width: 100% !important;
  margin: 0 !important;
  text-align: left !important;
}
.level-three .mini-puzzle__caption strong {
  display: block !important;
  font-size: clamp(20px, 1.35vw, 24px) !important;
  line-height: 1 !important;
}
.level-three .mini-puzzle__board {
  --piece-size: clamp(96px, min(10.2vw, 16.5vh), 126px) !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 8px !important;
  margin: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(3, var(--piece-size)) !important;
  grid-template-rows: repeat(2, var(--piece-size)) !important;
  gap: 0 !important;
}
.level-three .mini-puzzle__tile {
  width: var(--piece-size) !important;
  height: var(--piece-size) !important;
  min-width: var(--piece-size) !important;
  min-height: var(--piece-size) !important;
  margin: 0 !important;
}
.level-three .timeline-pieces {
  left: 0 !important;
  right: 0 !important;
  bottom: calc(20px + var(--safe-bottom)) !important;
}
.level-three .timeline-piece {
  width: clamp(170px, 15vw, 230px) !important;
  aspect-ratio: 1.5 / 1 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  background: rgba(31, 18, 10, .96) !important;
  box-shadow: 0 14px 34px rgba(0,0,0,.34), inset 0 0 0 1px rgba(243,211,145,.26) !important;
}
.level-three .timeline-piece__image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
@media (max-width: 980px) {
  .level-three .puzzle-gate {
    overflow: auto !important;
  }
  .level-three .puzzle-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    justify-items: center !important;
    align-content: start !important;
    gap: 12px !important;
    overflow: visible !important;
  }
  .level-three .mini-puzzle {
    width: min(100%, 420px) !important;
  }
  .level-three .mini-puzzle__board {
    --piece-size: clamp(76px, 16vw, 108px) !important;
  }
  .level-three .timeline-piece {
    width: min(38vw, 170px) !important;
  }
}
@media (max-height: 760px) and (min-width: 981px) {
  .level-three .mini-puzzle__board {
    --piece-size: clamp(90px, 14.2vh, 114px) !important;
  }
}

/* === Ajuste solicitado: Nivel 1 con indicaciones claras y actas con mayor lectura === */
.l1-objective-panel {
  position: absolute;
  left: 22px;
  top: calc(122px + var(--safe-top));
  z-index: 91;
  width: min(330px, 34vw);
  padding: 14px 15px 13px;
  border: 1px solid rgba(223,184,107,.42);
  border-left: 3px solid rgba(243,211,145,.9);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17,10,5,.84), rgba(7,4,2,.72));
  box-shadow: 0 18px 44px rgba(0,0,0,.38);
  color: #fff2d7;
  text-shadow: 0 2px 10px #000;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.l1-objective-panel small {
  display: block;
  margin-bottom: 5px;
  color: var(--gold-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.l1-objective-panel > strong {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(18px, 1.35vw, 25px);
  line-height: 1;
  text-transform: uppercase;
}
.l1-objective-panel p {
  margin: 7px 0 9px;
  color: #ead8be;
  font-size: clamp(11px, .92vw, 13px);
  line-height: 1.35;
}
.l1-objective-panel ul {
  list-style: none;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
}
.l1-objective-panel li {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid rgba(243,211,145,.18);
  border-radius: 11px;
  background: rgba(255,244,216,.055);
  color: #f8ead0;
}
.l1-objective-panel li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(223,184,107,.16);
  color: var(--gold-2);
  font-weight: 900;
}
.l1-objective-panel li strong {
  font-size: clamp(11px, .9vw, 13px);
  line-height: 1.15;
}
.l1-objective-panel li.done {
  border-color: rgba(117,211,138,.42);
  background: rgba(117,211,138,.10);
  color: #d8ffd8;
}
.l1-objective-panel li.done span {
  background: rgba(117,211,138,.22);
  color: #9effac;
}
.l1-objective-panel em {
  display: block;
  margin-top: 9px;
  color: rgba(255,239,210,.78);
  font-size: 11px;
}
.l1-objective-panel .l1-objective-body {
  overflow: hidden;
  max-height: 400px;
  transition: max-height .3s ease, opacity .3s ease;
  opacity: 1;
}
.l1-objective-panel.is-collapsed .l1-objective-body {
  max-height: 0;
  opacity: 0;
}
.l1-objective-panel .l1-objective-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(223,184,107,.3);
  border-radius: 8px;
  background: rgba(255,244,216,.08);
  color: var(--gold-2);
  font-size: 13px;
  cursor: pointer;
  pointer-events: auto;
  display: grid;
  place-items: center;
  transition: background .2s ease;
  z-index: 2;
}
.l1-objective-panel .l1-objective-toggle:hover {
  background: rgba(255,244,216,.18);
}
  font-style: normal;
}
.l1-intro-goals {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(230px, .85fr);
  gap: clamp(14px, 2vw, 24px);
  align-items: center;
}
.l1-intro-targets {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid rgba(223,184,107,.32);
  border-radius: 18px;
  background: rgba(10,6,4,.48);
  color: #f5e6ca;
  text-align: left;
}
.l1-intro-targets strong {
  color: var(--gold-2);
  font-family: var(--font-title);
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1;
}
.l1-intro-targets span {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,244,216,.07);
  font-weight: 800;
}
.l1-intro-targets small {
  display: block;
  margin-top: 4px;
  color: #ffd7c8;
  line-height: 1.35;
}
.l1-memory-panel {
  min-height: 190px;
}
.l1-memory-hint {
  display: block;
  color: rgba(255,239,210,.72);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 700;
}
@media (max-width: 900px), (pointer: coarse) {
  .l1-objective-panel {
    top: calc(76px + var(--safe-top));
    left: 10px;
    width: min(260px, 40vw);
    padding: 9px 10px;
    border-radius: 12px;
  }
  .l1-objective-panel p { display: none; }
  .l1-objective-panel ul { gap: 5px; }
  .l1-objective-panel li {
    grid-template-columns: 18px 1fr;
    padding: 5px 6px;
  }
  .l1-objective-panel li span {
    width: 18px;
    height: 18px;
  }
  .l1-objective-panel li strong {
    font-size: 10px;
  }
  .l1-objective-panel em {
    font-size: 9px;
  }
  .l1-intro-goals {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  .l1-objective-panel {
    top: calc(48px + var(--safe-top));
    width: min(240px, 34vw);
    max-height: calc(100vh - 116px);
    overflow: hidden;
  }
  .l1-objective-panel > strong { font-size: 15px; }
  .l1-objective-panel small { font-size: 8px; margin-bottom: 3px; }
  .l1-objective-panel li strong { font-size: 9px; }
  .l1-memory-panel {
    min-height: 150px;
  }
}

/* =============================================
   OVERRIDE FINAL: Panel de memoria centrado + overlay oscuro
   ============================================= */
.level-one-threejs-v21 .l1-memory-panel--nonblocking,
.level-one-threejs-v20 .l1-memory-panel--nonblocking,
.level-one-threejs-v17 .l1-memory-panel--nonblocking,
.level-one-threejs-v18 .l1-memory-panel--nonblocking,
.level-one-threejs .l1-memory-panel--nonblocking {
  left: 50% !important;
  top: 50% !important;
  right: auto !important;
  transform: translate(-50%, -50%) scale(.85) !important;
  width: min(420px, calc(100vw - 40px)) !important;
  max-width: min(420px, calc(100vw - 40px)) !important;
  padding: 24px 28px 26px !important;
  border-radius: 18px !important;
  opacity: 0 !important;
  pointer-events: auto !important;
}
.level-one-threejs-v21 .l1-memory-panel--nonblocking.show,
.level-one-threejs-v20 .l1-memory-panel--nonblocking.show,
.level-one-threejs-v17 .l1-memory-panel--nonblocking.show,
.level-one-threejs-v18 .l1-memory-panel--nonblocking.show,
.level-one-threejs .l1-memory-panel--nonblocking.show {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1) !important;
}
.level-one-threejs-v21 .l1-memory-panel--nonblocking.closing,
.level-one-threejs-v20 .l1-memory-panel--nonblocking.closing,
.level-one-threejs-v17 .l1-memory-panel--nonblocking.closing,
.level-one-threejs-v18 .l1-memory-panel--nonblocking.closing,
.level-one-threejs .l1-memory-panel--nonblocking.closing {
  opacity: 0 !important;
  transform: translate(-50%, -50%) scale(.88) !important;
}

/* Overlay oscuro detrás del panel */
.l1-memory-overlay {
  position: absolute;
  inset: 0;
  z-index: 165;
  background: rgba(0, 0, 0, .75);
  opacity: 0;
  transition: opacity .4s cubic-bezier(.22,1,.36,1);
  pointer-events: auto;
}
.l1-memory-overlay.show { opacity: 1; }
.l1-memory-overlay.closing {
  opacity: 0;
  transition: opacity .35s ease-in;
}

/* Responsive: panel centrado más compacto en móvil */
@media (max-width: 900px), (pointer: coarse) {
  .level-one-threejs-v21 .l1-memory-panel--nonblocking,
  .level-one-threejs-v20 .l1-memory-panel--nonblocking,
  .level-one-threejs-v17 .l1-memory-panel--nonblocking,
  .level-one-threejs-v18 .l1-memory-panel--nonblocking,
  .level-one-threejs .l1-memory-panel--nonblocking {
    width: min(340px, 88vw) !important;
    max-width: min(340px, 88vw) !important;
    padding: 18px 20px !important;
  }
}
@media (pointer: coarse) and (max-height: 430px) and (orientation: landscape) {
  .level-one-threejs-v21 .l1-memory-panel--nonblocking,
  .level-one-threejs-v20 .l1-memory-panel--nonblocking,
  .level-one-threejs-v17 .l1-memory-panel--nonblocking,
  .level-one-threejs-v18 .l1-memory-panel--nonblocking,
  .level-one-threejs .l1-memory-panel--nonblocking {
    width: min(300px, 40vw) !important;
    max-width: min(300px, 40vw) !important;
  }
}

/* =============================================
   OVERRIDE FINAL: Intro nivel 1 pantalla completa
   ============================================= */
.level-one-threejs .level-intro {
  width: 100vw !important;
  height: 100vh !important;
  padding: 0 !important;
  background: rgba(0,0,0,.88) !important;
  overflow-y: auto;
}
.level-one-threejs .level-intro .intro-copy {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  padding: clamp(24px, 4vw, 48px) !important;
  background: linear-gradient(180deg, rgba(18,11,7,.88), rgba(18,11,7,.72)) !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}
.level-one-threejs .level-intro .intro-title {
  font-size: clamp(28px, 4vw, 52px) !important;
  line-height: 1.05 !important;
  margin-bottom: 24px !important;
}
.level-one-threejs .level-intro .intro-body {
  font-size: 15px !important;
  line-height: 1.4 !important;
}
.level-one-threejs .level-intro .l1-intro-goals {
  display: flex !important;
  flex-direction: row !important;
  gap: clamp(16px, 3vw, 32px) !important;
  align-items: stretch !important;
  width: min(960px, 88vw) !important;
}
.level-one-threejs .level-intro .l1-controls-guide {
  width: 55% !important;
  max-width: 520px !important;
  max-height: none !important;
  object-fit: contain !important;
  border-radius: 14px !important;
  border: 1px solid rgba(223,184,107,.25) !important;
}
.level-one-threejs .level-intro .l1-intro-targets {
  width: 45% !important;
  padding: 20px 22px !important;
}
.level-one-threejs .level-intro .l1-intro-targets strong {
  font-size: clamp(18px, 2vw, 28px) !important;
}
.level-one-threejs .level-intro .l1-intro-targets span {
  font-size: clamp(13px, 1.2vw, 16px) !important;
  padding: 9px 12px !important;
}
.level-one-threejs .level-intro .btn.primary {
  margin-top: 28px !important;
  padding: 14px 36px !important;
  font-size: 16px !important;
  border-radius: 14px !important;
}

/* Responsive: apilar vertical en móvil */
@media (max-width: 700px), (pointer: coarse) and (orientation: portrait) {
  .level-one-threejs .level-intro .l1-intro-goals {
    flex-direction: column !important;
    width: 92vw !important;
  }
  .level-one-threejs .level-intro .l1-controls-guide,
  .level-one-threejs .level-intro .l1-intro-targets {
    width: 100% !important;
    max-width: 100% !important;
  }
  .level-one-threejs .level-intro .l1-controls-guide {
    max-height: 40vh !important;
  }
}

/* Landscape en móvil: mantener horizontal */
@media (pointer: coarse) and (max-height: 500px) and (orientation: landscape) {
  .level-one-threejs .level-intro .intro-copy {
    padding: 14px 18px !important;
  }
  .level-one-threejs .level-intro .intro-title {
    font-size: clamp(18px, 3vw, 30px) !important;
    margin-bottom: 10px !important;
  }
  .level-one-threejs .level-intro .l1-intro-goals {
    width: 88vw !important;
  }
  .level-one-threejs .level-intro .l1-controls-guide {
    max-height: 50vh !important;
  }
  .level-one-threejs .level-intro .l1-intro-targets span {
    padding: 5px 8px !important;
    font-size: 11px !important;
  }
}

/* =============================================
   OVERRIDE FINAL: HUD subtitle = título + caption a la derecha
   ============================================= */
.level-one-threejs .hud__objective {
  font-size: clamp(18px, 2vw, 29px) !important;
  font-family: var(--font-title) !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  color: #ecd6b6 !important;
  line-height: 1.1 !important;
  margin-top: 2px !important;
}
.level-one-threejs .l1-player-caption--three {
  left: auto !important;
  right: 20px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: min(420px, 38vw) !important;
  padding: 18px 24px !important;
  opacity: 1 !important;
  background: linear-gradient(90deg, rgba(16,10,6,.94), rgba(38,23,12,.85)) !important;
  border: 1px solid rgba(214,173,95,.40) !important;
  border-left: 3px solid rgba(223,184,107,.88) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.55) !important;
  backdrop-filter: blur(10px) !important;
  border-radius: 16px !important;
}
.level-one-threejs .l1-player-caption--three strong {
  font-size: clamp(20px, 2vw, 30px) !important;
  line-height: 1.05 !important;
}
.level-one-threejs .l1-player-caption--three span {
  font-size: clamp(14px, 1.3vw, 18px) !important;
  line-height: 1.35 !important;
}

/* Responsive caption */
@media (max-width: 900px), (pointer: coarse) {
  .level-one-threejs .l1-player-caption--three {
    right: 10px !important;
    width: min(340px, 52vw) !important;
    top: auto !important;
    bottom: 80px !important;
    transform: none !important;
  }
}
@media (pointer: coarse) and (max-height: 430px) and (orientation: landscape) {
  .level-one-threejs .l1-player-caption--three {
    right: 14px !important;
    width: min(300px, 34vw) !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
  }
}

/* =============================================
   BOTÓN SALIR (X)
   ============================================= */
.exit-game-btn {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 999;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(223,184,107,.35);
  background: rgba(10,6,4,.75);
  color: #d6ad5f;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.exit-game-btn:hover {
  background: rgba(180,96,24,.35);
  border-color: rgba(223,184,107,.7);
  transform: scale(1.1);
}
.exit-game-btn:active {
  transform: scale(.95);
}
@media (pointer: coarse) {
  .exit-game-btn {
    width: 42px;
    height: 42px;
    font-size: 26px;
    top: 10px;
    right: 10px;
  }
}

/* =============================================
   PANTALLA DE INFO DEL NIVEL (antes de transición)
   ============================================= */
.level-info-overlay {
  position: absolute;
  inset: 0;
  z-index: 175;
  overflow: hidden;
  opacity: 0;
  transition: opacity .4s ease;
}
.level-info-overlay.show { opacity: 1; }
.level-info-overlay.closing { opacity: 0; transition: opacity .38s ease; }
.level-info-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.85) brightness(.3);
  transform: scale(1.04);
}
.level-info-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,214,138,.08), transparent 50%),
    linear-gradient(180deg, rgba(6,3,1,.5), rgba(4,2,1,.88));
}
.level-info-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(16px, 3vw, 40px);
  text-align: center;
  background: rgba(0,0,0,.55);
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .45s cubic-bezier(.22,1,.36,1);
  overflow-y: auto;
}
.level-info-overlay.show .level-info-card {
  opacity: 1;
}
.level-info-lock {
  margin: 0 0 clamp(12px, 1.5vw, 20px);
  font-family: var(--font-title);
  font-size: clamp(24px, 3.5vw, 48px);
  line-height: 1.05;
  text-transform: uppercase;
  color: #fff7e8;
  max-width: 700px;
  text-shadow: 0 0 24px rgba(255,226,136,.6);
}
.level-info-fact {
  margin: 0 auto clamp(16px, 2vw, 24px);
  max-width: 50ch;
  font-size: clamp(13px, 1.2vw, 17px);
  line-height: 1.6;
  color: rgba(255,243,224,.9);
  padding: clamp(12px, 1.5vw, 18px) clamp(14px, 1.8vw, 22px);
  border-radius: 12px;
  border: 1px solid rgba(223,184,107,.25);
  background: rgba(255,255,255,.05);
}
.level-info-bar {
  width: min(360px, 60vw);
  height: 5px;
  margin: 0 auto 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(214,173,95,.2);
}
.level-info-bar span {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 13.5s ease;
  background: linear-gradient(90deg, #8f5f2a, #d6ad5f, #f0d39a);
}
.level-info-next {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: rgba(255,243,226,.8);
}
