:root {
  --bg: #0b0710;
  --bg-2: #150d1c;
  --panel: #1b1222;
  --panel-2: #241830;
  --line: #3a2a46;
  --text: #ece2d0;
  --muted: #a99bb3;
  --red: #ff2436;
  --red-dark: #8f0c17;
  --gold: #d6a84c;
  --green: #4fd18b;
  --wood: #3b2013;
  --wood-dark: #1f1009;
  --radius: 14px;
  --font-title: 'Creepster', 'Cinzel', serif;
  --font-head: 'Cinzel', Georgia, serif;
  --font-body: 'Crimson Pro', Georgia, serif;
  --font-note: 'Special Elite', 'Courier New', monospace;
  --font-digits: 'Share Tech Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #24112b 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.5;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
p { margin: 0 0 .8em; }
h2, h3 { font-family: var(--font-head); font-weight: 700; margin: 0 0 .5em; }

.fog {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 25% at 20% 100%, rgba(150, 120, 170, .12), transparent 70%),
    radial-gradient(ellipse 50% 20% at 80% 100%, rgba(150, 120, 170, .10), transparent 70%);
  animation: fog 18s ease-in-out infinite alternate;
}
@keyframes fog { from { transform: translateX(-4%); } to { transform: translateX(4%); } }

#app { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.screen { display: none; animation: fadeIn .5s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Botones ---------- */
.btn {
  border: 1px solid var(--line); background: var(--panel-2);
  padding: 10px 18px; border-radius: 999px; font-family: var(--font-head); font-size: 15px; letter-spacing: .03em;
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:hover { border-color: var(--gold); }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(180deg, #b3121f, var(--red-dark)); border-color: #d22c3a; color: #fff; box-shadow: 0 0 18px rgba(255, 36, 54, .35); }
.btn-primary:hover { border-color: #ff7c86; }
.btn-ghost { background: transparent; }
.btn-big { display: block; margin: 24px auto 0; font-size: 18px; padding: 14px 30px; }
.btn.active { border-color: var(--gold); color: var(--gold); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); font-size: 20px; line-height: 1; }
.link-btn { display: block; margin: 28px auto 0; background: none; border: none; color: var(--muted); font-family: var(--font-note); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; }
.link-btn:hover { color: var(--gold); }

/* ---------- Cabecera ---------- */
#hub { position: relative; z-index: 0; }
.hero { position: relative; z-index: 0; min-height: calc(100svh - 24px); display: flex; flex-direction: column; margin-bottom: 30px; }
.hero-bg { position: absolute; z-index: -1; top: -24px; left: 50%; transform: translateX(-50%); width: 100vw; height: calc(100% + 24px);
  object-fit: cover; object-position: 50% 60%; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(#000 80%, transparent); mask-image: linear-gradient(#000 80%, transparent);
  animation: heroIn 2.5s ease; }
@keyframes heroIn { from { opacity: 0; transform: translateX(-50%) scale(1.06); } }
.hero-bottom { margin-top: auto; }
.hero .countdown-label { margin-bottom: 8px; }
.scroll-hint { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0 auto 22px; width: max-content;
  font-family: var(--font-head); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); text-decoration: none; text-shadow: 0 1px 4px #000; }
.scroll-hint span { font-size: 26px; line-height: .8; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
.hotel-header { text-align: center; margin-bottom: 18px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.eyebrow { font-family: var(--font-head); font-size: 13px; letter-spacing: .25em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.hotel-title {
  font-family: var(--font-title); font-weight: 400; margin: 0;
  font-size: clamp(44px, 11vw, 92px); line-height: .95; letter-spacing: .03em;
  color: #e9dcc4; text-shadow: 0 0 22px rgba(255, 36, 54, .45), 0 4px 0 #3a0a10;
  animation: flicker 7s infinite;
}
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  93% { opacity: .55; } 94% { opacity: 1; } 96% { opacity: .7; } 97% { opacity: 1; }
}

/* ---------- Cuenta atrás ---------- */
.countdown { display: flex; justify-content: center; align-items: flex-start; gap: clamp(4px, 1.5vw, 14px); margin: 22px 0 6px; }
.cd-unit { display: flex; flex-direction: column; align-items: center; }
.cd-num {
  font-family: var(--font-digits); font-size: clamp(46px, 14vw, 120px); line-height: 1;
  color: var(--red); text-shadow: 0 0 10px rgba(255, 36, 54, .9), 0 0 30px rgba(255, 36, 54, .6), 0 0 60px rgba(255, 36, 54, .35);
  background: rgba(14, 0, 3, .9); border: 1px solid #3d0910; border-radius: 10px;
  padding: 6px clamp(4px, 1.5vw, 14px); min-width: 1.4em; text-align: center;
}
.cd-lbl { font-family: var(--font-head); font-size: clamp(10px, 2.6vw, 14px); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.cd-sep { font-family: var(--font-digits); font-size: clamp(36px, 10vw, 90px); color: var(--red); line-height: 1.15; animation: blink 1s steps(1) infinite; text-shadow: 0 0 12px rgba(255, 36, 54, .8); }
@keyframes blink { 50% { opacity: .2; } }
.countdown.ended .cd-num { color: #6b1a22; text-shadow: none; }
.countdown.ended .cd-sep { animation: none; color: #6b1a22; text-shadow: none; }
.countdown-label { text-align: center; color: var(--muted); font-style: italic; margin-bottom: 30px; min-height: 1em; }

/* ---------- Puerta principal (vista previa) ---------- */
.main-door {
  position: relative; display: block; margin: 0 auto 34px; width: min(360px, 86vw); aspect-ratio: 766 / 1041;
  border: none; padding: 0; background: none; container-type: inline-size;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .75)); transition: filter .4s;
}
.main-door:hover, .main-door.ready { filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .75)) drop-shadow(0 0 22px rgba(214, 168, 76, .35)); }
.md-art { position: absolute; inset: 0; }
.md-plate {
  position: absolute; top: 40%; left: 50%; transform: translateX(-50%); z-index: 5;
  font-family: var(--font-head); font-size: 2.9cqw; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; white-space: nowrap;
  background: linear-gradient(160deg, #f6dc8e, #b88a2e 45%, #6e4c12); color: #2a1606; padding: .4em 1em; border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 243, 196, .6); border: 1px solid #3a2706;
}
.md-holes { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); display: flex; gap: 1cqw; z-index: 5; }
.md-hole {
  width: 7.6cqw; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #050201 55%, #1d0f06); border: 1px solid #7a5a22;
  box-shadow: inset 0 3px 8px #000, 0 1px 0 rgba(255, 220, 170, .15); display: grid; place-items: center; overflow: hidden;
}
.md-hole .seal-img { width: 100%; height: 100%; }
.md-hole.filled { border-color: var(--gold); box-shadow: 0 0 12px rgba(214, 168, 76, .7); }
.main-door.opened .gd-leaf.left { transform: rotateY(70deg); }
.main-door.opened .gd-leaf.right { transform: rotateY(-70deg); }
.main-door.opened .gd-opening { background: radial-gradient(ellipse at 50% 65%, #ffe2a8, #c07a28 40%, #2a1306 80%); }
.main-door.opened .md-holes, .main-door.opened .md-plate { opacity: 0; }

/* Gran puerta: arco de piedra encima, dos hojas que giran y la luz del salón detrás */
.gd { position: absolute; inset: 0; display: block; perspective: 1000px; }
.gd-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.gd-opening, .gd-leaf { position: absolute; left: var(--gx); top: var(--gy); width: var(--gw); height: var(--gh); }
.gd-opening { z-index: 1; background: radial-gradient(ellipse at 50% 65%, #2a1709, #050202 70%); transition: background 1.5s;
  -webkit-mask: url(../img/puertas/web/hueco.png) center / 100% 100% no-repeat; mask: url(../img/puertas/web/hueco.png) center / 100% 100% no-repeat; }
.gd-leaf { z-index: 2; width: calc(var(--gw) / 2); transition: transform 2.2s cubic-bezier(.5, 0, .3, 1); }
.gd-leaf.left { transform-origin: left center; }
.gd-leaf.right { left: calc(var(--gx) + var(--gw) / 2); transform-origin: right center; }
.gd-leaf img { display: block; width: 100%; height: 100%; }

/* ---------- Pasillo ---------- */
.hallway {
  position: relative; margin: 0 -16px; padding: 40px 16px 56px;
  background: url(../img/portada/pared.jpg) center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(transparent, #000 12%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(transparent, #000 12%, #000 90%, transparent);
  mask-composite: intersect;
}
.hallway::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(11, 7, 16, .25), rgba(11, 7, 16, .1) 50%, rgba(11, 7, 16, .55)); }
.hallway .corridor { position: relative; }
.hallway .door-name, .hallway .door-status { text-shadow: 0 1px 3px #000, 0 0 10px #000; }
.corridor { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.door { background: none; border: none; padding: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.rd { position: relative; display: block; width: 100%; max-width: 170px; aspect-ratio: 760 / 1267; perspective: 600px; container-type: inline-size; }
.rd-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .65)); }
.rd-opening, .rd-leaf { position: absolute; left: var(--ox); top: var(--oy); width: var(--ow); height: var(--oh); }
.rd-opening { z-index: 1; overflow: hidden; background: #050304; }
.rd-room { position: absolute; inset: 0; background: center / cover no-repeat; filter: brightness(.25) saturate(.7); transition: filter .8s; }
.rd-glow { position: absolute; inset: 0; opacity: 0; transition: opacity .6s;
  background: radial-gradient(ellipse 80% 60% at 60% 72%, rgba(255, 170, 80, .55), rgba(140, 60, 15, .2) 45%, transparent 75%); }
.rd-seal { position: absolute; left: 58%; top: 50%; width: 42%; transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 10px rgba(255, 213, 107, .95)); animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translate(-50%, -60%); } }
.rd-leaf { z-index: 2; transform-origin: left center; transition: transform .9s cubic-bezier(.3, .7, .3, 1), filter .3s; box-shadow: 3px 0 8px rgba(0, 0, 0, .55); }
.rd-leaf img { display: block; width: 100%; height: 100%; }
.rd-plate { position: absolute; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 4.6cqw;
  letter-spacing: .06em; color: #2a1804; text-shadow: 0 1px 0 rgba(255, 230, 160, .45); white-space: nowrap; line-height: 1; }
.rd-plate.long { font-size: 3.2cqw; letter-spacing: .02em; }
.rd-padlock { position: absolute; z-index: 4; pointer-events: none; width: calc(var(--ow) * .2);
  left: calc(var(--ox) + var(--ow) * .74); top: calc(var(--oy) + var(--oh) * .5);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .8)); transform-origin: 50% 0; }
.rd-floorlight { position: absolute; left: 0; right: 0; bottom: -16px; height: 30px; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 100% at 50% 0%, rgba(255, 170, 80, .6), transparent 70%); }

.door-name { font-family: var(--font-head); font-size: 15px; margin-top: 12px; line-height: 1.2; }
.door-status { font-size: 14px; color: var(--muted); margin-top: 4px; min-height: 2.6em; }
.door-status strong { font-family: var(--font-digits); color: var(--red); font-weight: 400; }

.door.locked .rd-leaf { filter: brightness(.6) saturate(.75); }
.door.locked:hover .rd-padlock { animation: rattle .5s; }
@keyframes rattle { 25% { transform: rotate(-8deg); } 75% { transform: rotate(6deg); } }
.door.open .rd-leaf { transform: rotateY(28deg); }
.door.open:hover .rd-leaf { transform: rotateY(48deg); }
.door.open .rd-room { filter: brightness(.55) saturate(.85); }
.door.open .rd-glow, .door.open .rd-floorlight { opacity: 1; animation: candle 2.4s ease-in-out infinite; }
.door.open .door-status { color: var(--gold); }
.door.done .rd-leaf { transform: rotateY(68deg); }
.door.done .rd-room { filter: brightness(.85); }
.door.done .rd-glow { opacity: 1; background: radial-gradient(ellipse 80% 60% at 60% 50%, rgba(255, 220, 130, .45), transparent 75%); }
.door.done .rd-floorlight { opacity: .8; }
.door.done .door-status { color: var(--green); }
@keyframes candle { 0%, 100% { opacity: 1; } 30% { opacity: .75; } 55% { opacity: .95; } 70% { opacity: .7; } }

/* ---------- Inventario ---------- */
.inventory-wrap { margin-top: 34px; text-align: center; }
.inv-title { font-family: var(--font-head); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.inventory { display: flex; justify-content: center; gap: 10px; }
.inv-slot {
  width: 54px; height: 54px; border-radius: 12px; display: grid; place-items: center;
  background: var(--panel); border: 1px dashed var(--line); color: #4d3d58; font-family: var(--font-head); font-size: 22px;
}
.inv-slot.full { border: 1px solid var(--gold); box-shadow: 0 0 14px rgba(214, 168, 76, .35); }
.inv-slot .seal-img { width: 88%; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.seal-img { display: block; user-select: none; -webkit-user-drag: none; }

/* ---------- Pantalla de juego ---------- */
.game-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.back-btn { flex-shrink: 0; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 8px 14px; font-family: var(--font-head); font-size: 14px; }
.back-btn:hover { border-color: var(--gold); }
.game-heading { min-width: 0; }
.game-room { display: block; font-family: var(--font-head); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.game-heading h2 { font-size: clamp(20px, 5vw, 30px); margin: 0; line-height: 1.15; }

.game-intro { max-width: 640px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-align: center; }
.intro-lead { font-style: italic; color: #d9cbb4; font-size: 1.05em; }
.rules { text-align: left; list-style: none; padding: 0; margin: 18px 0 24px; }
.rules li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.rules li:last-child { border-bottom: none; }
blockquote { font-family: var(--font-note); font-size: 16px; color: var(--gold); margin: 14px 0; padding: 12px 16px; border-left: 3px solid var(--gold); background: rgba(214, 168, 76, .07); text-align: left; }
.muted { color: var(--muted); font-size: .92em; }

/* ---------- Objetos ocultos ---------- */
.ho-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ho-timer { font-family: var(--font-digits); font-size: 34px; color: var(--red); text-shadow: 0 0 12px rgba(255, 36, 54, .7); }
.ho-timer.danger { animation: blink .6s steps(1) infinite; }
.ho-count { font-family: var(--font-head); font-size: 18px; color: var(--gold); }
.ho-zoom { display: flex; align-items: center; gap: 6px; }
.ho-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.ho-list li { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 16px; transition: all .3s; }
.ho-list li.done { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; color: var(--muted); border-color: var(--gold); background: rgba(214, 168, 76, .12); }
.ho-list li::before { content: '✓ '; color: transparent; }
.ho-list li.done::before { color: var(--green); }
.ho-scroller {
  height: min(68vh, 640px); overflow: auto; border-radius: var(--radius); border: 2px solid #4a2c16;
  background: #000; box-shadow: inset 0 0 40px #000; touch-action: pan-x pan-y; cursor: grab; overscroll-behavior: contain;
}
.ho-scroller:active { cursor: grabbing; }
.ho-scroller svg { display: block; user-select: none; -webkit-user-select: none; }
.ho-glow { filter: brightness(1.7) saturate(1.2) drop-shadow(0 0 6px #ffd56b); animation: litIn .6s ease; }
.ho-ring { fill: none; stroke: #ffd56b; stroke-width: 3; pointer-events: none; filter: drop-shadow(0 0 6px #ffb000); animation: ringPulse 1.8s ease-in-out infinite; }
@keyframes ringPulse { 50% { stroke-opacity: .35; } }
@keyframes litIn { from { opacity: 0; } }
.ho-miss { fill: none; stroke: #ff2436; stroke-width: 3; stroke-linecap: round; pointer-events: none; animation: missOut .9s ease forwards; }
@keyframes missOut { to { opacity: 0; } }
#ho-hit { cursor: crosshair; }

/* ---------- Cementerio ---------- */
.cem { max-width: 820px; margin: 0 auto; }
.notebook { background: #e8dcc0; color: #2b1d10; border-radius: 6px; padding: 14px 18px; margin: 16px 0; font-family: var(--font-note); font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); transform: rotate(-.4deg);
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(80, 60, 140, .18) 27px 28px); }
.notebook summary { cursor: pointer; font-size: 17px; font-weight: bold; }
.notebook ol { padding-left: 22px; margin: 10px 0 0; }
.notebook li { margin-bottom: 8px; }
.nb-intro { margin: 10px 0 0; font-size: 14px; opacity: .8; }
.cem-status { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.cem-shovels { font-size: 22px; }
.cem-shovels .used { opacity: .2; filter: grayscale(1); }
.graveyard-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); overscroll-behavior-x: contain; }
.graveyard {
  position: relative; min-width: 620px; aspect-ratio: 1312 / 816; overflow: hidden;
  background: #0b0d18 url(../img/cementerio/fondo.jpg) center / cover no-repeat;
}
.graveyard::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 90% 70% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55)); }
.tomb-row { position: absolute; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.tomb-row.back { left: 11%; right: 11%; bottom: 45%; height: 30%; z-index: 1; }
.tomb-row.front { left: 3%; right: 3%; bottom: 2%; height: 44%; z-index: 3; }
.tomb { position: relative; height: 100%; border: none; background: none; padding: 0; display: flex; align-items: flex-end; justify-content: center; }
.tomb .stone-img { transition: transform .25s, filter .25s; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .7)) brightness(.92); }
.tomb-row.back .stone-img { filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .7)) brightness(.78) saturate(.85); }
.tomb:hover .stone-img, .tomb:focus-visible .stone-img { transform: translateY(-4px); filter: drop-shadow(0 0 14px rgba(190, 210, 255, .55)) brightness(1.08); }
.tomb.dug .stone-img { filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .7)) brightness(.55) saturate(.6); }
.tomb-dirt { position: absolute; bottom: -4%; left: 50%; width: 95%; transform: translateX(-50%); pointer-events: none; filter: brightness(.7); z-index: 2; }
.cem-fog { position: absolute; left: -10%; right: -10%; pointer-events: none;
  background: radial-gradient(ellipse 30% 60% at 20% 60%, rgba(200, 210, 235, .28), transparent 70%),
              radial-gradient(ellipse 35% 60% at 70% 50%, rgba(200, 210, 235, .22), transparent 70%);
  animation: fogDrift 14s ease-in-out infinite alternate; }
.cem-fog.mid { bottom: 39%; height: 18%; z-index: 2; }
.cem-fog.front { bottom: -4%; height: 22%; z-index: 4; animation-duration: 18s; animation-direction: alternate-reverse; }
@keyframes fogDrift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
.cem-lantern { position: absolute; left: 1.5%; bottom: 8%; width: 6.5%; z-index: 4; pointer-events: none; }
.cem-lantern img { width: 100%; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .8)); }
.cem-lantern::before { content: ''; position: absolute; left: -150%; right: -150%; top: -60%; bottom: -40%; z-index: -1;
  background: radial-gradient(circle, rgba(255, 170, 70, .35), transparent 60%); animation: candle 2.6s ease-in-out infinite; }
.cem-swipe { display: none; text-align: center; color: var(--muted); font-size: 14px; margin: 6px 0 0; }

/* Lápida con texto grabado (se usa en la escena y en el detalle) */
.stone-img { position: relative; display: block; width: var(--w, 75%); container-type: inline-size; }
.stone-img img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.stone-face { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2em; text-align: center; pointer-events: none; }
.sf-name { font-family: var(--font-head); font-weight: 700; font-size: 10cqw; line-height: 1.05; letter-spacing: .02em; }
.sf-years { font-family: var(--font-head); font-size: 8cqw; letter-spacing: .02em; white-space: nowrap; }
.ink-dark { color: rgba(28, 26, 36, .82); text-shadow: 0 1px 0 rgba(255, 255, 255, .28), 0 -1px 0 rgba(0, 0, 0, .35); }
.ink-light { color: rgba(222, 228, 240, .78); text-shadow: 0 -1px 0 rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .12); }
.cem-lock { margin-top: 16px; text-align: center; background: rgba(60, 10, 20, .6); border: 1px solid var(--red-dark); border-radius: var(--radius); padding: 18px; }
.cem-lock.hidden { display: none; }
.lock-time strong { font-family: var(--font-digits); color: var(--red); font-size: 22px; }
.stone-big { display: flex; justify-content: center; margin: 0 auto 12px; }
.stone-big .stone-img { width: min(230px, 60vw); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .8)); }
.stone-epitaph { font-style: italic; font-size: 17px; }
.cem-box { width: min(280px, 80%); display: block; margin: 0 auto 6px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .8)); animation: pop .5s ease; }

/* ---------- Quiz ---------- */
.qz-top { max-width: 700px; margin: 0 auto 18px; }
.qz-progress { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin-bottom: 10px; }
.qz-step { height: 10px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); transition: background .3s; }
.qz-step.done { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 8px rgba(214, 168, 76, .6); }
.qz-step.current { background: rgba(255, 36, 54, .5); border-color: var(--red); }
.qz-meta { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-head); font-size: 16px; }
.qz-lives { font-size: 24px; letter-spacing: 4px; }
.qz-lives .lost { opacity: .18; filter: grayscale(1); transition: opacity .4s; }
.qz-timebar { height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.qz-timebar span { display: block; height: 100%; width: 100%; background: var(--gold); transition: width .1s linear; }
.qz-timebar span.danger { background: var(--red); }
.qz-card { position: relative; max-width: 700px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 20px 22px; text-align: center; }
/* Escena del salón de música */
#game.music-bg::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(8, 4, 12, .6), rgba(8, 4, 12, .86) 75%), url(../img/musica/fondo.jpg) center / cover no-repeat; }
#game.music-bg { position: relative; z-index: 0; }
.music-bg .qz-card, .music-bg .game-intro { background: rgba(20, 12, 24, .82); backdrop-filter: blur(5px); }
.music-bg .qz-meta { text-shadow: 0 1px 4px #000; }
.qz-intro-gramo { display: block; width: 150px; margin: -6px auto 8px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .8)); animation: gramoIdle 4s ease-in-out infinite; }
.qz-stage { position: relative; width: 210px; margin: -6px auto 4px; }
.qz-gramo { display: block; width: 150px; margin: 0 auto; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .8)); animation: gramoIdle 4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes gramoIdle { 50% { transform: rotate(-1.5deg) scale(1.02); } }
.qz-gramo.ok { animation: gramoOk 1.2s ease; }
@keyframes gramoOk { 30% { filter: drop-shadow(0 0 22px #ffd56b) drop-shadow(0 0 40px #ffb000) brightness(1.25); transform: scale(1.06); } }
.qz-gramo.bad { animation: gramoBad .6s ease; }
@keyframes gramoBad { 20%, 60% { transform: translateX(-6px) rotate(-3deg); filter: drop-shadow(0 0 18px #ff2436) brightness(.8); } 40%, 80% { transform: translateX(6px) rotate(3deg); } }
.qz-record { position: absolute; right: -4px; bottom: 6px; width: 64px; height: 64px; display: grid; place-items: center; }
.qz-disc { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 1.8s linear infinite; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .8)); }
.qz-disc.stopped { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
.qz-sing { position: relative; display: flex; flex-direction: column; align-items: center; min-height: 70vh; justify-content: center; }
.qz-violeta { width: min(300px, 60vw); mix-blend-mode: screen; -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); filter: drop-shadow(0 0 30px rgba(170, 210, 255, .6)); opacity: 0; animation: ghostIn 3s ease forwards, floatGhost 4s 3s ease-in-out infinite; }
@keyframes ghostIn { from { opacity: 0; transform: translateY(20px); filter: blur(8px); } to { opacity: .95; transform: none; } }
@keyframes floatGhost { 50% { transform: translateY(-8px); } }
.qz-sing-text { max-width: 520px; text-align: center; font-style: italic; font-size: 1.1em; margin-top: 16px; text-shadow: 0 2px 8px #000; opacity: 0; animation: fadeIn 1.4s 1.2s ease forwards; }
.qz-modal-gramo { width: 110px; display: block; margin: 0 auto 6px; filter: grayscale(.6) brightness(.8) drop-shadow(0 8px 14px rgba(0, 0, 0, .8)); }
@keyframes wobble { 50% { transform: rotate(-6deg) scale(1.05); } }
.qz-question { font-size: clamp(19px, 4.6vw, 25px); margin: 10px 0 20px; line-height: 1.3; }
.qz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qz-opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 18px; transition: all .2s; }
.qz-opt:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-2px); }
.qz-letter { flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #0e0912; font-family: var(--font-head); font-size: 14px; color: var(--gold); }
.qz-opt.correct { background: rgba(79, 209, 139, .2); border-color: var(--green); }
.qz-opt.wrong { background: rgba(255, 36, 54, .2); border-color: var(--red); animation: shake .4s; }
.qz-seconds { position: relative; font-family: var(--font-digits); font-size: 15px; color: #ffe3a0; text-shadow: 0 0 6px #000, 0 0 2px #000; }

/* ---------- Sudoku ---------- */
.sdk-wrap { display: flex; gap: 26px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.sdk-grid {
  display: grid; grid-template-columns: repeat(9, 1fr); width: min(100%, 520px); aspect-ratio: 1;
  border: 3px solid var(--gold); border-radius: 8px; overflow: hidden; background: var(--line); gap: 1px;
}
.sdk-cell {
  position: relative; border: none; padding: 0; background: #17101d; display: grid; place-items: center;
  font-family: var(--font-head); font-size: clamp(18px, 5.4vw, 30px); color: #d8b3ff;
}
.sdk-cell[style*="--c:2"], .sdk-cell[style*="--c:5"] { box-shadow: 2px 0 0 var(--gold); z-index: 1; }
.sdk-cell[style*="--r:2;"], .sdk-cell[style*="--r:5;"] { border-bottom: 2px solid var(--gold); }
.sdk-cell.given { color: var(--text); font-weight: 700; background: #211629; }
.sdk-cell.related { background: #2a1d35; }
.sdk-cell.same { background: #4a2d5c; }
.sdk-cell.selected { background: #6d2a3e; box-shadow: inset 0 0 0 2px var(--red); }
.sdk-cell.conflict .sdk-val { color: var(--red); }
.sdk-cell.error { background: #5c0f1a !important; }
.sdk-notes { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%; padding: 2px; font-family: var(--font-body); font-size: clamp(8px, 2vw, 12px); color: var(--muted); line-height: 1; }
.sdk-notes span { display: grid; place-items: center; }
.sdk-controls { width: min(100%, 300px); }
.sdk-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sdk-num { aspect-ratio: 1.3; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-family: var(--font-head); font-size: 26px; }
.sdk-num:hover { border-color: var(--gold); }
.sdk-num.complete { opacity: .3; }
.sdk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sdk-actions .btn { padding: 10px 8px; font-size: 14px; }

/* ---------- Ahorcado ---------- */
.game-hangman { max-width: 760px; margin: 0 auto; }
.hm-rounds { display: flex; justify-content: center; gap: 10px; margin: 6px 0 14px; }
.hm-rounds span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); border: 1px solid var(--line); color: var(--muted); }
.hm-rounds .current { border-color: var(--red); color: var(--text); }
.hm-rounds .done { background: var(--gold); border-color: var(--gold); color: #1b1222; }
.hm-stage {
  position: relative; width: min(100%, 340px, 46vh); aspect-ratio: 896 / 1200; margin: 0 auto 14px;
  background: url(../img/espejo/espejo.jpg) center / cover; border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .7), 0 0 0 1px var(--line);
}
.hm-stage.shiver { animation: shiver .5s; }
@keyframes shiver { 20% { transform: translateX(-3px); filter: brightness(1.3); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); filter: brightness(.8); } 80% { transform: translateX(1px); } }
.hm-glass { position: absolute; left: 27.3%; top: 19.3%; width: 45.8%; height: 50.5%; clip-path: ellipse(50% 50% at 50% 50%); }
.hm-ghost { position: absolute; left: 0; top: 5%; width: 100%; mix-blend-mode: screen; transition: opacity 1.4s ease, filter 1.4s ease; pointer-events: none; }
.hm-fog { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 70%, rgba(220, 230, 255, .18), transparent 70%); animation: fogBreath 5s ease-in-out infinite; }
@keyframes fogBreath { 50% { opacity: .4; } }
.hm-mirror { display: flex; justify-content: center; padding: 8px 0 4px; }
.hm-word { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.hm-letter { width: clamp(24px, 7vw, 40px); height: clamp(34px, 9vw, 50px); border-bottom: 3px solid #cfd6ea; display: grid; place-items: center; font-family: var(--font-head); font-size: clamp(20px, 6vw, 32px); font-weight: 700; color: #eef1ff; }
.hm-letter.shown { animation: reveal .4s; text-shadow: 0 0 12px rgba(200, 220, 255, .9); }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } }
.hm-errors { text-align: center; margin: 12px 0 6px; font-family: var(--font-head); color: var(--muted); }
.hm-errors strong { color: var(--red); }
.hm-hints { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.hm-hints li { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 17px; }
.hm-hints li.open { border-color: rgba(214, 168, 76, .5); }
.hm-hints li.locked { color: #6f6079; font-style: italic; }
.hm-keys { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.hm-key { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-family: var(--font-head); font-size: clamp(14px, 3.8vw, 20px); font-weight: 700; }
.hm-key:hover:not(:disabled) { border-color: var(--gold); }
.hm-key.hit { background: rgba(79, 209, 139, .25); border-color: var(--green); }
.hm-key.miss { opacity: .25; }

/* ---------- Salón de baile ---------- */
.big-door { position: relative; width: min(520px, 100%); aspect-ratio: 766 / 1041; margin: 10px auto 22px; container-type: inline-size; filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .75)); }
.big-door.opening .gd-leaf.left { transform: rotateY(80deg); }
.big-door.opening .gd-leaf.right { transform: rotateY(-80deg); }
.big-door.opening .gd-opening { background: radial-gradient(ellipse at 50% 65%, #fff0c8, #d08a30 40%, #2a1306 85%); }
.big-door.opening .seal-holes { opacity: 0; transition: opacity .6s; }
.big-door.complete .seal-hole { box-shadow: 0 0 22px rgba(255, 213, 107, .8); }
.seal-holes { position: absolute; left: 28.5%; width: 45%; top: 22%; height: 66%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr 1fr; place-items: center; padding: 30% 0 14%; z-index: 4; }
.seal-hole:nth-child(1) { grid-column: 2; grid-row: 1; }
.seal-hole:nth-child(2) { grid-column: 1; grid-row: 2; }
.seal-hole:nth-child(3) { grid-column: 3; grid-row: 2; }
.seal-hole:nth-child(4) { grid-column: 1; grid-row: 3; transform: translateX(40%); }
.seal-hole:nth-child(5) { grid-column: 3; grid-row: 3; transform: translateX(-40%); }
.seal-hole {
  position: relative; width: 11cqw; aspect-ratio: 1; border-radius: 50%; padding: 0;
  border: 2px solid #6b4a20; background: radial-gradient(circle, #050201 55%, #1d0f06); box-shadow: inset 0 6px 14px #000, 0 0 0 3px rgba(0, 0, 0, .4);
  display: grid; place-items: center;
}
.hole-shape { width: 86%; display: grid; place-items: center; }
.hole-shape .seal-img { width: 100%; filter: grayscale(1) brightness(.85) contrast(1.2); opacity: .32; mix-blend-mode: luminosity; }
.seal-hole.filled { border-color: var(--gold); }
.seal-hole.filled .hole-shape { width: 104%; }
.seal-hole.filled .seal-img { filter: drop-shadow(0 0 10px #ffd56b); opacity: 1; mix-blend-mode: normal; animation: reveal .5s; }
.hole-num { position: absolute; bottom: -2.2em; font-family: var(--font-head); font-size: 2.4cqw; color: var(--gold); text-shadow: 0 1px 3px #000; }
.seal-tray { text-align: center; }
.tray { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; min-height: 10px; }
.tray-seal { width: 70px; height: 70px; border-radius: 50%; border: none; padding: 0; background: none; transition: transform .2s, filter .2s; filter: drop-shadow(0 0 10px rgba(214, 168, 76, .35)); }
.tray-seal .seal-img { width: 100%; }
.tray-seal.selected { transform: translateY(-6px) scale(1.1); filter: drop-shadow(0 0 18px rgba(255, 213, 107, .95)); }

.riddle { max-width: 620px; margin: 0 auto; text-align: center; }
.riddle-text { font-family: var(--font-note); font-size: 19px; color: var(--gold); background: rgba(214, 168, 76, .06); border: 1px solid rgba(214, 168, 76, .35); border-radius: var(--radius); padding: 24px 18px; margin: 18px 0; }
.riddle-form { display: flex; gap: 10px; }
.riddle-form input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: #0e0912; color: var(--text); font: inherit; }
.riddle-form input:focus { outline: none; border-color: var(--gold); }
.riddle-hints { list-style: none; padding: 0; margin: 18px 0 0; color: var(--muted); font-style: italic; }

.finale { max-width: 640px; margin: 0 auto; text-align: center; padding-top: 4vh; }
.finale-title { font-family: var(--font-title); font-weight: 400; font-size: clamp(34px, 8vw, 60px); line-height: 1.05; color: #f3e6c8;
  text-shadow: 0 0 24px rgba(255, 213, 107, .55), 0 4px 0 #3a0a10; margin: 6px 0 26px; opacity: 0; animation: fadeIn 1.6s .3s ease forwards; }
.finale-message { padding: 26px 24px; border-radius: var(--radius); border: 1px solid var(--gold); background: rgba(20, 10, 18, .78); backdrop-filter: blur(4px);
  font-family: var(--font-note); font-size: 20px; box-shadow: 0 0 30px rgba(214, 168, 76, .25); opacity: 0; animation: fadeIn 1.6s 1.6s ease forwards; }

/* Carta final de Eduardo */
.final { max-width: 620px; margin: 0 auto; padding-top: 2vh; }
.final-intro { text-align: center; text-shadow: 0 2px 8px #000; opacity: 0; animation: fadeIn 1.4s .3s ease forwards; }
.final-letter {
  position: relative; margin: 26px auto 10px; padding: 46px 34px 30px; border-radius: 4px; color: #2b1d10;
  background: #ead9b5; font-family: var(--font-note); font-size: 17px; line-height: 1.65;
  box-shadow: inset 0 0 60px rgba(120, 70, 20, .5), 0 24px 60px rgba(0, 0, 0, .85); transform: rotate(-.6deg);
  opacity: 0; animation: letterIn 1.6s 1.4s ease forwards;
}
@keyframes letterIn { from { opacity: 0; transform: translateY(30px) rotate(-3deg) scale(.96); } to { opacity: 1; transform: rotate(-.6deg); } }
.final-wax { position: absolute; top: -34px; left: 50%; width: 72px; transform: translateX(-50%) rotate(8deg); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .6)); }
.final-riddle { margin: 22px 0; padding: 18px 16px; text-align: center; font-size: 18px; font-style: italic; color: #4a1010;
  border-top: 1px solid rgba(74, 16, 16, .3); border-bottom: 1px solid rgba(74, 16, 16, .3); }
.final-sign { text-align: right; margin: 0; }

/* Fondo del salón para el acertijo y el final */
#ballroom.salon-bg::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(8, 4, 12, .55), rgba(8, 4, 12, .82) 70%), url(../img/final/salon.jpg) center / cover no-repeat;
  animation: fadeIn 1.2s ease; }
#ballroom.salon-bg { position: relative; z-index: 0; }
.salon-bg .intro-lead { text-shadow: 0 2px 8px #000; }
.salon-bg .riddle-text { background: rgba(14, 8, 14, .78); backdrop-filter: blur(4px); }
.salon-bg .riddle-form input { background: rgba(14, 9, 18, .9); }
.salon-bg .riddle-hints { color: #d9cbb4; text-shadow: 0 1px 4px #000; }
.finale-message { margin-top: 30px; padding: 24px; border-radius: var(--radius); border: 1px solid var(--gold); background: rgba(214, 168, 76, .08); font-family: var(--font-note); font-size: 20px; box-shadow: 0 0 30px rgba(214, 168, 76, .25); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(4, 2, 6, .82); backdrop-filter: blur(3px); }
.modal.hidden { display: none; }
.modal-card { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px 20px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .8); animation: pop .3s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-icon { font-size: 46px; margin-bottom: 6px; }
.modal-icon.big { font-size: 72px; }
.modal-icon .seal-img { width: 120px; margin: 0 auto; }
.seal-reveal { animation: sealIn 1s ease; filter: drop-shadow(0 0 18px rgba(255, 213, 107, .8)); }
@keyframes sealIn { from { transform: scale(.2) rotate(-180deg); opacity: 0; } }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.fragment { text-align: left; font-family: var(--font-note); font-size: 16px; color: #2b1d10; background: #e8dcc0; border-radius: 6px; padding: 16px 18px; margin: 14px 0; box-shadow: inset 0 0 30px rgba(120, 80, 30, .35); }
.tomb-modal { background: radial-gradient(ellipse at 50% 30%, #1c2236, #0d0f18 70%); }

.note-modal { background: transparent; border: none; box-shadow: none; padding: 8px; width: min(600px, 100%); overflow-x: hidden; }
.note-paper {
  background: #ead9b5; color: #2b1d10; padding: 30px 26px; border-radius: 4px; text-align: left;
  font-family: var(--font-note); font-size: 16px; line-height: 1.6; min-height: 300px; cursor: pointer;
  box-shadow: inset 0 0 60px rgba(120, 70, 20, .5), 0 20px 60px rgba(0, 0, 0, .8); transform: rotate(-.6deg);
}
.note-paper p.sig { text-align: right; }
.note-text.typing p:last-child::after { content: '▍'; animation: blink 1s steps(1) infinite; }
.note-modal .modal-actions { margin-top: 22px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 60; opacity: 0; max-width: calc(100% - 32px);
  background: #241830; border: 1px solid var(--gold); color: var(--text); padding: 10px 18px; border-radius: 999px; font-size: 16px; text-align: center; transition: all .35s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.music-btn { position: fixed; top: 12px; right: 12px; z-index: 45; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(27, 18, 34, .85); backdrop-filter: blur(4px); font-size: 18px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .5); transition: border-color .2s, transform .15s; }
.music-btn:hover { border-color: var(--gold); }
.music-btn:active { transform: scale(.94); }
.admin-panel { position: fixed; left: 10px; bottom: 10px; z-index: 40; display: flex; flex-direction: column; gap: 6px; background: rgba(10, 30, 20, .92); border: 1px solid var(--green); border-radius: 12px; padding: 10px 12px; font-size: 13px; font-family: system-ui, sans-serif; }
.admin-panel[hidden] { display: none; }
.admin-panel.collapsed > :not(strong) { display: none; }
.admin-panel strong { cursor: pointer; }
.admin-panel button { background: #12261c; border: 1px solid #2c6b4a; border-radius: 6px; padding: 4px 8px; font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 17px; }
  #app { padding-top: 18px; }
  .corridor { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
  .door-name { font-size: 13px; }
  .door-status { font-size: 12px; }
  .qz-options { grid-template-columns: 1fr; }
  .cem-swipe { display: block; }
  .game-intro { padding: 20px 16px; }
  .sdk-controls { width: min(100%, 520px); }
  .sdk-pad { grid-template-columns: repeat(9, 1fr); gap: 4px; }
  .sdk-num { aspect-ratio: .8; font-size: 20px; border-radius: 8px; }
  .sdk-actions { grid-template-columns: repeat(2, 1fr); }
  .ho-timer { font-size: 28px; }
  .ho-list li { font-size: 14px; padding: 3px 9px; }
  .inv-slot { width: 46px; height: 46px; }
  .countdown { gap: 3px; }
  .cd-num { font-size: clamp(30px, 10.5vw, 60px); min-width: 1.3em; padding: 6px 3px; border-radius: 8px; }
  .cd-sep { font-size: clamp(24px, 7vw, 48px); line-height: 1.25; }
  .cd-lbl { letter-spacing: .08em; }
}
@media (max-width: 420px) {
  .corridor { grid-template-columns: repeat(2, 1fr); }
  .corridor .door:last-child { grid-column: 1 / -1; }
  .corridor .door:last-child .rd { max-width: 46%; }
  .hm-keys { grid-template-columns: repeat(7, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
