/* ═══════════════════════════════════════════════════════════════════════════
   MINAS DE ORO — estilos (mobile primero)
   Caverna oscura, roca, metal dorado y luz ámbar. Todo por código: los únicos
   dibujos son el cofre y la TNT del kit (assets/), usados tal cual.
   ═══════════════════════════════════════════════════════════════════════════ */
@font-face { font-family: 'Lexend'; src: url(/lexend.woff2) format('woff2'); font-weight: 300 800; font-display: swap; }

:root {
  --oro-claro: #fff3bf;
  --oro: #ffd34f;
  --oro-medio: #eaa81b;
  --oro-oscuro: #a8660a;
  --oro-sombra: #5b3404;
  --texto: #f7ead0;
  --texto-suave: #cdbb92;
  --fondo: #0a0704;
  --roca-1: #3b3e45;
  --roca-2: #24262b;
  --roca-3: #16171a;
  --verde-1: #7dffa0;
  --verde-2: #22c454;
  --verde-3: #0b7a2e;
  --rojo-1: #ff6a3d;
  --rojo-2: #d8210f;
  --rojo-3: #5a0a04;
  --azul-demo: #4fc3ff;
  --borde-oro: linear-gradient(135deg, #fff1a6 0%, #c98912 28%, #ffe27a 52%, #8f560a 78%, #f6c64a 100%);
  --barra-h: 64px;
  --gap: 7px;
  --radio: 16px;
  --dur: 1;
  color-scheme: dark;
}
.mov-reducido { --dur: 0; }
@media (prefers-reduced-motion: reduce) { :root { --dur: 0; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--fondo); }
body {
  min-height: 100dvh; font-family: 'Lexend', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--texto);
  background: var(--fondo); touch-action: pan-y; overscroll-behavior-x: none; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #ffe27a; outline-offset: 3px; border-radius: 12px; }
.oculto { display: none !important; }
[hidden] { display: none !important; }

/* ── caverna (fondo fijo) ─────────────────────────────────────────────── */
.caverna {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60% 38% at 50% 34%, rgba(255, 176, 48, .28), transparent 70%),
    radial-gradient(45% 30% at 50% 100%, rgba(255, 150, 30, .18), transparent 70%),
    radial-gradient(120% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, .85) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='4' seed='7'/><feColorMatrix values='0 0 0 0 .16  0 0 0 0 .12  0 0 0 0 .08  0 0 0 1.4 -.35'/></filter><rect width='240' height='240' filter='url(%23f)'/></svg>"),
    linear-gradient(180deg, #120d08 0%, #0b0805 55%, #070503 100%);
  background-size: auto, auto, auto, 240px 240px, auto;
}
.caverna .farol { position: absolute; top: 18%; width: 120px; height: 160px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 190, 70, .45), rgba(255, 140, 20, .12) 60%, transparent); filter: blur(4px); }
.caverna .farol.izq { left: -50px; }
.caverna .farol.der { right: -50px; }
body.res-derrota .caverna { background:
    radial-gradient(70% 45% at 50% 28%, rgba(255, 60, 20, .35), transparent 70%),
    radial-gradient(120% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, .9) 100%),
    linear-gradient(180deg, #1c0604 0%, #0f0402 60%, #070201 100%); }
body.res-victoria .caverna { background:
    radial-gradient(70% 45% at 50% 38%, rgba(255, 196, 60, .45), transparent 70%),
    radial-gradient(120% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, .85) 100%),
    linear-gradient(180deg, #1a1207 0%, #0d0904 60%, #070503 100%); }

/* ── pantallas ───────────────────────────────────────────────────────── */
.pantalla { display: none; min-height: 100dvh; width: 100%;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(var(--barra-h) + 18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.pantalla.on { display: block; animation: aparecer calc(.22s * var(--dur)) ease-out; }
#p-entrada { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lobby, .juego, .resultado, .pagina, .centrado { width: 100%; max-width: 460px; margin: 0 auto; }
.centrado { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 4vh; text-align: center; }

/* ── barra superior ──────────────────────────────────────────────────── */
.barra-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.icono-btn { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
  border: 2px solid transparent; background: linear-gradient(180deg, #2b2620, #120f0b) padding-box, var(--borde-oro) border-box;
  color: var(--oro-claro); box-shadow: 0 4px 10px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08); }
.icono-btn svg { width: 24px; height: 24px; }
.icono-btn:active { transform: scale(.96); }
[data-sonido] .mute { display: none; }
body.mudo [data-sonido] .mute { display: inline; }
body.mudo [data-sonido] .ondas { display: none; }
.pill-juegos { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid rgba(255, 211, 79, .45); background: rgba(20, 14, 8, .7); color: var(--texto); font-size: 14px; font-weight: 500; }
.pill-juegos svg { width: 18px; height: 18px; }

/* ── título del juego (texto real, editable) ─────────────────────────── */
.titulo-juego { margin: 2px 0 0; text-align: center; line-height: .9; font-weight: 800; letter-spacing: .5px; display: flex; flex-direction: column; align-items: center; }
.titulo-juego span { background: linear-gradient(180deg, #fffbe0 0%, #ffe680 22%, #ffc21f 48%, #d98a06 72%, #ffcf4d 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #7a4705) drop-shadow(0 4px 0 #3d2202) drop-shadow(0 10px 14px rgba(0, 0, 0, .65)); }
.titulo-juego .t1 { font-size: clamp(54px, 17vw, 84px); }
.titulo-juego .t2 { font-size: clamp(42px, 13vw, 64px); margin-top: 2px; }
.titulo-juego.chico .t1 { font-size: 46px; } .titulo-juego.chico .t2 { font-size: 34px; }
.titulo-juego.mini { flex-direction: row; gap: 8px; align-items: baseline; white-space: nowrap; }
.titulo-juego.mini .t1, .titulo-juego.mini .t2 { font-size: clamp(22px, 6.6vw, 28px); filter: drop-shadow(0 2px 0 #6a3d04) drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.firma { margin: 6px 0 0; text-align: center; font-size: 12px; letter-spacing: 2px; color: var(--texto-suave); text-transform: uppercase; }
.firma b { color: var(--oro); font-weight: 700; }

/* ── lobby ───────────────────────────────────────────────────────────── */
.lobby { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.heroe { position: relative; width: min(84vw, 360px); aspect-ratio: 1 / .82; margin: 0 auto; }
.heroe .resplandor { position: absolute; inset: 6% 4% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 200, 70, .55), rgba(255, 150, 20, .15) 60%, transparent); filter: blur(8px);
  animation: latido calc(3.2s * var(--dur)) ease-in-out infinite; }
.hero-cofre { display: block; object-fit: contain; }
.heroe .hero-cofre { position: absolute; left: 0; top: 0; width: 86%; height: auto; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .65)); }
.heroe .hero-tnt { position: absolute; right: -2%; bottom: -2%; width: 40%; height: auto; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .7)); transform: rotate(4deg); }
.hero-cofre.chico { width: 150px; height: 150px; }
@keyframes latido { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
.lema { margin: 0; text-align: center; font-size: clamp(15px, 4.4vw, 18px); font-weight: 700; letter-spacing: 1.6px; color: var(--oro-claro); text-shadow: 0 2px 6px rgba(0, 0, 0, .8); line-height: 1.35; }
.fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nota { margin: 0; font-size: 13.5px; color: var(--texto-suave); line-height: 1.45; text-align: center; }
.pie-rg { margin: 6px 0 0; text-align: center; font-size: 12px; color: #9c8a64; }
.aviso-demo { display: inline-block; padding: 7px 14px; border-radius: 999px; background: rgba(79, 195, 255, .12); border: 1px solid rgba(79, 195, 255, .5); color: #bfe8ff; font-size: 13px; font-weight: 600; }

/* ── saldo ───────────────────────────────────────────────────────────── */
.pill-saldo { display: inline-flex; align-items: center; gap: 10px; align-self: center; min-height: 46px; padding: 6px 18px 6px 8px; border-radius: 999px;
  border: 2px solid transparent; background: linear-gradient(180deg, #221c14, #100c08) padding-box, var(--borde-oro) border-box; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); max-width: 100%; }
.pill-saldo svg { width: 30px; height: 30px; flex: none; }
.pill-saldo span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.pill-saldo small { font-size: 11.5px; color: var(--texto-suave); letter-spacing: .5px; }
.pill-saldo b { font-size: 17px; color: var(--oro-claro); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-saldo.demo { background: linear-gradient(180deg, #10202b, #08121a) padding-box, linear-gradient(135deg, #bfe8ff, #2a8fd0, #bfe8ff) border-box; }
.pill-saldo.demo b { color: #d7f1ff; }
.fila-saldo { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 10px; flex-wrap: wrap; }
.chip-demo { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 1px; color: #062033; background: linear-gradient(180deg, #bfe8ff, #4fc3ff); }

/* ── botones ─────────────────────────────────────────────────────────── */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 18px; border-radius: 16px; cursor: pointer;
  font-weight: 700; font-size: 16px; letter-spacing: .3px; text-decoration: none; white-space: nowrap; transition: transform calc(.12s * var(--dur)), filter .15s; user-select: none; -webkit-user-select: none; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn:active:not(:disabled) { transform: translateY(2px) scale(.99); }
.btn:disabled { filter: grayscale(.7) brightness(.6); cursor: not-allowed; }
.btn-oro { border: 2px solid #fff4c4; color: #3a2102; text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
  background: linear-gradient(180deg, #fff6c8 0%, #ffd64f 20%, #f3b11d 52%, #c98408 82%, #e8aa2a 100%);
  box-shadow: 0 0 0 2px #6d4004, 0 5px 0 #4f2d02, 0 12px 24px rgba(255, 166, 0, .28), inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -3px 0 rgba(120, 70, 0, .35); }
.btn-jugar { min-height: 76px; font-size: clamp(34px, 10vw, 44px); font-weight: 800; letter-spacing: 2px; border-radius: 20px; }
.btn-grande { min-height: 64px; font-size: 21px; font-weight: 800; letter-spacing: 1px; width: 100%; }
.btn-verde { border: 2px solid #ffe27a; color: #fff; flex-direction: column; gap: 0; line-height: 1.05; text-shadow: 0 2px 0 rgba(0, 60, 15, .8);
  background: linear-gradient(180deg, #a6ffbb 0%, #39dd68 18%, #18b048 55%, #0a7d2f 88%, #13963d 100%);
  box-shadow: 0 0 0 2px #2f4a05, 0 5px 0 #08461a, 0 12px 26px rgba(40, 220, 100, .28), inset 0 2px 0 rgba(255, 255, 255, .6); }
.btn-verde .lbl { font-size: 16px; letter-spacing: 2px; color: #f3ffe9; }
.btn-verde b { font-size: clamp(24px, 7.4vw, 32px); font-weight: 800; font-variant-numeric: tabular-nums; color: #fffbe0; }
.btn-verde.latir { animation: latirBtn calc(1.6s * var(--dur)) ease-in-out infinite; }
@keyframes latirBtn { 0%, 100% { box-shadow: 0 0 0 2px #2f4a05, 0 5px 0 #08461a, 0 12px 26px rgba(40, 220, 100, .28), inset 0 2px 0 rgba(255, 255, 255, .6); } 50% { box-shadow: 0 0 0 2px #2f4a05, 0 5px 0 #08461a, 0 12px 34px rgba(60, 255, 120, .5), inset 0 2px 0 rgba(255, 255, 255, .6); } }
.btn-metal { border: 2px solid transparent; color: var(--oro-claro); font-weight: 600; font-size: 15px;
  background: linear-gradient(180deg, #2f2a23 0%, #1a1611 55%, #120e0a 100%) padding-box, var(--borde-oro) border-box;
  box-shadow: 0 5px 12px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn-metal.btn-grande { font-size: 19px; font-weight: 800; color: #f2f2f2; background: linear-gradient(180deg, #43464d 0%, #24262b 55%, #15161a 100%) padding-box, linear-gradient(135deg, #e6e6e6, #6b6e75, #f0f0f0, #50535a) border-box; }
.btn-linea { border: 1.5px solid rgba(255, 211, 79, .45); background: rgba(16, 12, 8, .6); color: var(--texto); font-weight: 600; min-height: 48px; }

/* ── juego ───────────────────────────────────────────────────────────── */
.juego { display: flex; flex-direction: column; }
.juego .barra-top { margin-bottom: 6px; }
.tablero-marco { position: relative; align-self: center; width: min(100%, max(250px, calc(100dvh - 372px - env(safe-area-inset-bottom) - env(safe-area-inset-top)))); padding: 9px; border-radius: 20px;
  border: 2px solid transparent; background: linear-gradient(180deg, #17120c, #0c0906) padding-box, var(--borde-oro) border-box;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .65), inset 0 0 22px rgba(0, 0, 0, .8); }
.tablero { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); width: 100%; }
.casilla { position: relative; aspect-ratio: 1; min-width: 0; border-radius: 11px; padding: 0; cursor: pointer; border: 0; overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .14) 0 18%, transparent 18% 100%),
    linear-gradient(315deg, rgba(0, 0, 0, .35) 0 22%, transparent 22% 100%),
    linear-gradient(160deg, var(--roca-1) 0%, var(--roca-2) 55%, var(--roca-3) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .14), inset 0 -3px 0 rgba(0, 0, 0, .5), 0 3px 6px rgba(0, 0, 0, .55);
  transition: transform calc(.12s * var(--dur)), filter .15s; perspective: 400px; }
.casilla::before { content: ''; position: absolute; inset: 18%; border-radius: 30%; background: radial-gradient(closest-side, rgba(255, 255, 255, .05), transparent); clip-path: polygon(20% 0, 80% 10%, 100% 55%, 70% 100%, 15% 85%, 0 35%); }
.casilla:not(:disabled):hover { filter: brightness(1.12); }
.casilla:not(:disabled):active { transform: scale(.95); }
.casilla:disabled { cursor: default; }
.tablero.bloqueado .casilla:not(.oro):not(.mina) { filter: brightness(.82); }
.casilla img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; pointer-events: none; }
.casilla.esperando { animation: esperando calc(.7s * var(--dur)) ease-in-out infinite; }
@keyframes esperando { 0%, 100% { box-shadow: inset 0 0 0 2px rgba(255, 211, 79, .3), 0 3px 6px rgba(0, 0, 0, .55); } 50% { box-shadow: inset 0 0 0 2px rgba(255, 211, 79, .9), 0 0 14px rgba(255, 190, 40, .5); } }
.casilla.oro { background: radial-gradient(closest-side, rgba(255, 210, 80, .55), rgba(140, 80, 10, .35) 70%, rgba(40, 24, 6, .9)) padding-box, var(--borde-oro) border-box; border: 2px solid transparent;
  box-shadow: 0 0 14px rgba(255, 190, 40, .45), inset 0 0 10px rgba(0, 0, 0, .5); }
.casilla.mina { background: radial-gradient(closest-side, rgba(255, 90, 40, .6), rgba(120, 10, 5, .6) 70%, rgba(30, 4, 2, .95)) padding-box, linear-gradient(135deg, #ffb199, #c81a0a, #ff7b5a, #6a0a03) border-box; border: 2px solid transparent; }
.casilla.mina.boom { box-shadow: 0 0 0 2px #ffd0b8, 0 0 22px rgba(255, 60, 20, .85); z-index: 1; }
.casilla.fin { opacity: .55; }
.casilla.fin.oro { filter: saturate(.75); }
.casilla.mia { opacity: 1; }
.casilla.revela { animation: girar calc(.32s * var(--dur)) ease-out; }
.casilla.oro.revela img { animation: brillo calc(.7s * var(--dur)) ease-out; }
@keyframes girar { 0% { transform: rotateY(90deg) scale(.9); } 100% { transform: rotateY(0) scale(1); } }
@keyframes brillo { 0% { transform: scale(.7); filter: brightness(2.2); } 55% { transform: scale(1.08); filter: brightness(1.4); } 100% { transform: scale(1); filter: none; } }
.aviso-red { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 12px; background: rgba(0, 0, 0, .8); border: 1px solid rgba(255, 211, 79, .5); font-weight: 600; font-size: 14px; }

.panel-info, .panel-pre { display: grid; gap: 8px; margin-top: 12px; border-radius: 16px; padding: 10px 8px; border: 2px solid transparent;
  background: linear-gradient(180deg, #1d1812, #0f0c08) padding-box, var(--borde-oro) border-box; box-shadow: 0 8px 18px rgba(0, 0, 0, .5); }
.panel-info { grid-template-columns: 1fr .7fr 1fr; }
.panel-info > div { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.panel-info > div + div { border-left: 1px solid rgba(255, 211, 79, .22); }
.panel-info small, .paso-ctrl small { font-size: 12px; color: var(--texto-suave); letter-spacing: .3px; }
.panel-info b { display: inline-flex; align-items: center; gap: 5px; font-size: clamp(14px, 4.1vw, 18px); color: var(--oro-claro); font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ico-mon { width: 20px; height: 20px; flex: none; }
.ico-mina { width: 18px; height: 18px; flex: none; color: #d9d9d9; }
.linea-info { margin: 8px 0 0; text-align: center; font-size: 13.5px; color: var(--texto-suave); min-height: 20px; line-height: 1.4; }
.linea-info b { color: var(--oro-claro); font-weight: 600; }
.linea-info .neg { color: #ff9b85; }
.linea-info .pos { color: #9ff2b4; }
.panel-pre { grid-template-columns: 1.5fr 1fr; padding: 8px; }
.paso-ctrl { display: flex; flex-direction: column; gap: 4px; align-items: center; min-width: 0; }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 3px; width: 100%; }
.stepper .mas-menos { height: 44px; border-radius: 12px; border: 1.5px solid rgba(255, 211, 79, .5); background: linear-gradient(180deg, #2c261e, #15110c); color: var(--oro-claro); font-size: 24px; font-weight: 600; cursor: pointer; padding: 0; }
.stepper .valor { min-height: 44px; border-radius: 12px; border: 1px dashed rgba(255, 211, 79, .35); background: rgba(0, 0, 0, .3); color: var(--oro-claro); font-weight: 700; font-size: clamp(15px, 4.4vw, 18px); cursor: pointer; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stepper button:disabled { opacity: .45; cursor: not-allowed; }
.accion-principal { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.procesando { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; border-radius: 16px; border: 1.5px solid rgba(255, 211, 79, .5); background: rgba(16, 12, 8, .8); font-weight: 600; }
.girar { width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255, 211, 79, .25); border-top-color: var(--oro); animation: rot calc(1s * var(--dur) + .001s) linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ── resultados ──────────────────────────────────────────────────────── */
.resultado { display: flex; flex-direction: column; align-items: stretch; gap: 11px; text-align: center; position: relative; z-index: 1; }
.titulo-res { margin: 8px 0 0; font-weight: 800; line-height: .95; font-size: clamp(44px, 14vw, 66px); letter-spacing: .5px; }
.titulo-res.oro { background: linear-gradient(180deg, #fffbe0 0%, #ffe680 25%, #ffc21f 55%, #d98a06 80%, #ffcf4d 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #7a4705) drop-shadow(0 6px 0 #3d2202) drop-shadow(0 0 22px rgba(255, 190, 40, .55)); }
.titulo-res.rojo { font-size: clamp(34px, 10.5vw, 50px); background: linear-gradient(180deg, #fff1c9 0%, #ffb35a 30%, #ff5a1f 62%, #b8160a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #5a0c03) drop-shadow(0 6px 0 #2a0501) drop-shadow(0 0 20px rgba(255, 70, 20, .5)); }
.cofre-brillo { position: relative; width: min(74vw, 320px); aspect-ratio: 1; margin: -6px auto -10px; }
.cofre-brillo img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 26px rgba(255, 200, 60, .55)) drop-shadow(0 16px 20px rgba(0, 0, 0, .6));
  animation: cofreFiesta calc(2.4s * var(--dur)) ease-in-out infinite; }
.cofre-brillo .rayos { position: absolute; inset: -12%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 220, 110, .28) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(closest-side, #000 35%, transparent 100%); mask: radial-gradient(closest-side, #000 35%, transparent 100%); animation: rot calc(18s * var(--dur) + .001s) linear infinite; }
@keyframes cofreFiesta { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.tarjeta-res { border-radius: 18px; padding: 14px 12px 16px; border: 2px solid transparent; background: linear-gradient(180deg, #1f1912, #0f0b07) padding-box, var(--borde-oro) border-box; box-shadow: 0 10px 22px rgba(0, 0, 0, .55); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tarjeta-res small { font-size: 15px; color: var(--texto); }
.tarjeta-res .monto { font-size: clamp(34px, 11vw, 48px); font-weight: 800; color: var(--oro); font-variant-numeric: tabular-nums; text-shadow: 0 3px 0 #5b3404, 0 0 18px rgba(255, 190, 40, .35); line-height: 1.1; }
.tarjeta-res p { margin: 2px 0 6px; font-size: 16px; }
.tarjeta-res p b { color: var(--oro-claro); }
.pill-mult { display: inline-block; padding: 6px 18px; border-radius: 12px; font-weight: 800; font-size: 20px; color: var(--oro); border: 2px solid transparent; background: linear-gradient(180deg, #140f09, #0b0805) padding-box, var(--borde-oro) border-box; }
.tarjeta-res.roja { background: linear-gradient(180deg, #3a0905, #1b0402) padding-box, linear-gradient(135deg, #ffb199, #c81a0a, #ff7b5a, #6a0a03) border-box; }
.tarjeta-res.roja { flex-direction: row; justify-content: center; gap: 12px; padding: 10px 12px; flex-wrap: wrap; }
.tarjeta-res.roja .monto { color: #ffd1c2; text-shadow: 0 3px 0 #4a0602; font-size: clamp(24px, 7.6vw, 32px); }
.tnt-derrota { width: min(26vw, 104px); height: auto; margin: -4px auto -8px; object-fit: contain; filter: drop-shadow(0 0 24px rgba(255, 60, 20, .55)); }
.tnt-derrota.sacudir { animation: sacudir calc(.42s * var(--dur)) ease-in-out 1; }
@keyframes sacudir { 0%, 100% { transform: none; } 20% { transform: translate(-6px, 2px) rotate(-4deg); } 40% { transform: translate(6px, -2px) rotate(4deg); } 60% { transform: translate(-4px, 1px) rotate(-2deg); } 80% { transform: translate(3px, 0) rotate(1deg); } }
.tablero.chico { width: min(100%, 340px, max(220px, calc(100dvh - 512px - env(safe-area-inset-bottom)))); margin: 0 auto; --gap: 5px; padding: 7px; border-radius: 16px; border: 2px solid transparent;
  background: linear-gradient(180deg, #2a0805, #120302) padding-box, linear-gradient(135deg, #ffb199, #c81a0a, #ff7b5a, #6a0a03) border-box; }
.tablero.chico .casilla { border-radius: 9px; cursor: default; }
.destello { position: fixed; inset: 0; pointer-events: none; z-index: 5; background: radial-gradient(circle at 50% 40%, rgba(255, 120, 60, .85), rgba(255, 30, 0, .55) 45%, transparent 75%); opacity: 0; }
.destello.on { animation: destello calc(.45s * var(--dur)) ease-out 1; }
@keyframes destello { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.particulas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ── páginas (historial, cómo jugar, ajustes) ────────────────────────── */
.pagina h1 { font-size: 26px; margin: 8px 0 14px; color: var(--oro-claro); }
.tarjeta { border-radius: 16px; padding: 14px 16px; margin: 0 0 12px; background: rgba(20, 15, 9, .86); border: 1px solid rgba(255, 211, 79, .28); box-shadow: 0 8px 18px rgba(0, 0, 0, .4); }
.tarjeta h2 { margin: 0 0 8px; font-size: 17px; color: var(--oro); }
.tarjeta p, .tarjeta li { font-size: 15px; line-height: 1.5; color: var(--texto); }
.tarjeta p { margin: 0 0 8px; }
.tarjeta ol, .tarjeta ul { margin: 0; padding-left: 20px; }
.tarjeta li + li { margin-top: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; color: #e7d7ae; }
.form { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.campo { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--texto-suave); }
.campo input { min-height: 48px; border-radius: 12px; border: 1.5px solid rgba(255, 211, 79, .4); background: rgba(0, 0, 0, .45); color: var(--texto); padding: 0 14px; font: inherit; font-size: 16px; }
.error { color: #ffb3a1; font-size: 14px; min-height: 18px; }
.ajuste { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-size: 15px; }
.ajuste b { color: var(--oro-claro); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.interruptor { width: 56px; height: 32px; border-radius: 999px; border: 1.5px solid rgba(255, 211, 79, .5); background: #2a241c; position: relative; cursor: pointer; padding: 0; flex: none; }
.interruptor::after { content: ''; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: #a99a78; transition: transform calc(.15s * var(--dur)); }
.interruptor[aria-checked="true"] { background: linear-gradient(180deg, #ffd64f, #c98408); }
.interruptor[aria-checked="true"]::after { transform: translateX(24px); background: #fff7d6; }
.tabla-pagos { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; font-size: 14px; font-variant-numeric: tabular-nums; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.tabla-pagos .cab { color: var(--texto-suave); font-size: 12px; }
.tabla-pagos .m { color: var(--oro); font-weight: 700; text-align: right; }
.hist { display: flex; flex-direction: column; gap: 10px; }
.h-item { border-radius: 14px; background: rgba(20, 15, 9, .86); border: 1px solid rgba(255, 211, 79, .25); overflow: hidden; }
.h-cab { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px; width: 100%; text-align: left; background: none; border: 0; cursor: pointer; min-height: 56px; }
.h-cab .t { font-size: 14px; color: var(--texto); }
.h-cab .s { font-size: 12.5px; color: var(--texto-suave); grid-column: 1; }
.h-cab .r { grid-row: 1 / span 2; grid-column: 2; font-weight: 700; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.h-cab .r.pos { color: #9ff2b4; } .h-cab .r.neg { color: #ff9b85; }
.h-det { padding: 0 14px 14px; display: none; }
.h-item.abierto .h-det { display: block; }
.h-det .tablero { width: min(100%, 260px); margin: 4px auto 10px; --gap: 4px; }
.h-det .casilla { border-radius: 7px; cursor: default; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-left: 6px; vertical-align: 1px; }
.badge.demo { background: rgba(79, 195, 255, .18); color: #bfe8ff; border: 1px solid rgba(79, 195, 255, .5); }
.verif { margin-top: 8px; font-size: 14px; font-weight: 600; }
.verif.ok { color: #9ff2b4; } .verif.mal { color: #ff9b85; }

/* ── barra inferior fija (estilo app) ────────────────────────────────── */
.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: linear-gradient(180deg, rgba(22, 16, 10, .96), rgba(10, 7, 4, .98)); border-top: 1px solid rgba(255, 211, 79, .35);
  padding: 4px max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.barra .fila { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.barra button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; background: none; border: 0; cursor: pointer; color: #b6a47c; font-size: 11.5px; font-weight: 500; padding: 0 2px; white-space: nowrap; }
.barra button svg { width: 24px; height: 24px; }
.barra button[aria-current="page"] { color: var(--oro); }
.barra button[aria-current="page"] svg { filter: drop-shadow(0 0 6px rgba(255, 200, 60, .6)); }
body.sin-barra .barra { display: none; }

/* ── hojas inferiores y avisos ───────────────────────────────────────── */
.hoja-fondo { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.hoja { width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #1f1912, #0e0a06); border-top: 2px solid rgba(255, 211, 79, .55); display: flex; flex-direction: column; gap: 10px; max-height: 86dvh; overflow-y: auto; animation: subir calc(.22s * var(--dur)) ease-out; }
@keyframes subir { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.asa { width: 44px; height: 5px; border-radius: 4px; background: rgba(255, 255, 255, .25); align-self: center; }
.hoja h3 { margin: 4px 0 0; text-align: center; color: var(--oro-claro); font-size: 18px; }
.hoja-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.hoja-grid.montos { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.hoja-grid button { min-height: 48px; border-radius: 12px; border: 1.5px solid rgba(255, 211, 79, .4); background: rgba(0, 0, 0, .35); color: var(--texto); font-weight: 700; font-size: 15px; cursor: pointer; font-variant-numeric: tabular-nums; }
.hoja-grid button[aria-pressed="true"] { background: linear-gradient(180deg, #ffd64f, #c98408); color: #3a2102; border-color: #fff1a6; }
.hoja-grid button:disabled { opacity: .35; cursor: not-allowed; }
.item-menu { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 14px; border-radius: 14px; border: 1px solid rgba(255, 211, 79, .25); background: rgba(0, 0, 0, .3); cursor: pointer; font-size: 16px; text-align: left; }
.item-menu svg { width: 22px; height: 22px; color: var(--oro); }
.toast { position: fixed; left: 50%; bottom: calc(var(--barra-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 14px;
  background: rgba(14, 10, 6, .96); border: 1px solid rgba(255, 211, 79, .5); color: var(--texto); font-size: 14.5px; text-align: center; box-shadow: 0 10px 24px rgba(0, 0, 0, .6); }

/* ── pantallas cortas: menos adorno, el tablero y el botón primero ───── */
@media (max-height: 700px) {
  .heroe { width: min(54vw, 212px); }
  .lema { font-size: 14px; letter-spacing: 1.2px; }
  .firma { margin-top: 2px; }
  .titulo-juego .t1 { font-size: clamp(44px, 14vw, 60px); } .titulo-juego .t2 { font-size: clamp(34px, 10.5vw, 46px); }
  .btn-jugar { min-height: 64px; }
  .lobby { gap: 9px; }
  .cofre-brillo { width: min(52vw, 220px); }
  .titulo-res { font-size: clamp(38px, 12vw, 52px); }
  .tnt-derrota { width: min(24vw, 96px); }
  .juego .barra-top { min-height: 48px; margin-bottom: 2px; }
  .fila-saldo { margin-bottom: 6px; }
  .pill-saldo { min-height: 40px; }
}
@media (max-width: 380px) { .stepper { grid-template-columns: 38px minmax(0, 1fr) 38px; } .panel-pre { grid-template-columns: 1.4fr 1fr; padding: 8px 6px; } .panel-info .ico-mon { display: none; } .fila-2 .btn { font-size: 14px; padding: 0 8px; gap: 6px; } .fila-2 .btn svg { width: 19px; height: 19px; } }
@media (max-width: 340px) { :root { --gap: 5px; } .stepper { grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 2px; } .stepper .valor { font-size: 14px; } .btn:not(.btn-jugar):not(.btn-grande) { font-size: 15px; } .titulo-juego.mini .t1, .titulo-juego.mini .t2 { font-size: 20px; } .panel-info b { font-size: 14px; } .barra button { font-size: 10.5px; } }

/* ── escritorio: misma composición, centrada, sin estirar el arte ────── */
@media (min-width: 900px) {
  .juego { max-width: 520px; }
  .tablero-marco { width: min(100%, max(300px, calc(100dvh - 380px)), 500px); }
}

/* juego en pausa (pestaña oculta): se congelan las animaciones */
body.pausa *, body.pausa *::before, body.pausa *::after { animation-play-state: paused !important; }

/* ── Lobby y juego SIN scroll: todo entra en la pantalla (como una app) ── */
button, .casilla { touch-action: manipulation; }
html.fijo, html.fijo body { height: 100%; overflow: hidden; overscroll-behavior: none; }
#p-lobby.on, #p-juego.on { display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  padding-bottom: calc(var(--barra-h) + 6px + env(safe-area-inset-bottom)); }
#p-lobby .lobby, #p-juego .juego { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

/* lobby */
#p-lobby .lobby { gap: clamp(5px, 1.3dvh, 12px); }
#p-lobby .barra-top { min-height: 46px; }
#p-lobby .titulo-juego { margin: 0; }
#p-lobby .titulo-juego .t1 { font-size: clamp(38px, min(17vw, 8.6dvh), 84px); }
#p-lobby .titulo-juego .t2 { font-size: clamp(30px, min(13vw, 6.6dvh), 64px); }
#p-lobby .firma { margin: 2px 0 0; }
.zona-heroe { flex: 1 1 0; min-height: 64px; container-type: size; display: grid; place-items: center; }
.zona-heroe .heroe { width: min(84vw, 360px, calc(100cqh / .82)); margin: 0; }
#p-lobby .lema { font-size: clamp(13px, min(4.4vw, 2.3dvh), 18px); }
#p-lobby .pill-saldo { min-height: 42px; }
#p-lobby .btn-jugar { flex: none; min-height: clamp(54px, 8.6dvh, 76px); font-size: clamp(28px, min(10vw, 5.2dvh), 44px); }
#p-lobby .fila-2 .btn { min-height: clamp(44px, 6.4dvh, 52px); }
#p-lobby .nota:empty { display: none; }
#p-lobby .nota, #p-lobby .pie-rg { margin: 0; }
@media (max-height: 640px) { #p-lobby .firma { display: none; } }
@media (max-height: 560px) { #p-lobby .lema, #p-lobby .nota { display: none; } }

/* juego */
#p-juego .barra-top { min-height: 46px; margin-bottom: 2px; }
#p-juego .fila-saldo { margin: 0 0 4px; }
#p-juego .pill-saldo { min-height: 40px; padding-top: 4px; padding-bottom: 4px; }
.zona-tablero { flex: 1 1 0; min-height: 140px; container-type: size; display: grid; place-items: center; }
.zona-tablero .tablero-marco { width: min(100cqw, 100cqh, 520px); align-self: auto; }
#p-juego .panel-info, #p-juego .panel-pre { margin-top: clamp(6px, 1.2dvh, 12px); }
#p-juego .linea-info { margin-top: 4px; min-height: 18px; font-size: 13px; }
#p-juego .accion-principal { margin-top: clamp(4px, 1dvh, 10px); }
#p-juego .btn-grande { min-height: clamp(52px, 7.6dvh, 64px); }
#p-juego .procesando { min-height: clamp(52px, 7.6dvh, 64px); }
#p-juego .pie-rg { margin: 4px 0 0; }
@media (max-height: 620px) { #p-juego .pie-rg { display: none; } #p-juego .fila-saldo { margin-bottom: 2px; } }

/* ── Marca: logo oficial «Tesoro Yvyvy» (imagen, no se redibuja) ───────── */
.logo-juego { position: relative; margin: 0; display: grid; place-items: center; line-height: 0; }
.logo-juego img { position: relative; display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .6)); }
.logo-juego .resplandor { position: absolute; inset: 8% 10% 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 200, 70, .42), rgba(255, 150, 20, .12) 60%, transparent);
  filter: blur(10px); animation: latido calc(3.2s * var(--dur)) ease-in-out infinite; }
.logo-juego.chico { width: min(78vw, 300px); }
.zona-heroe .logo-juego { width: min(94vw, 440px, calc(100cqh * 1.487)); }
#p-lobby .firma { margin: -2px 0 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMACIONES v2 — «gloria, bonanza y dinero» (15/10/2026)
   Todo es presentación: se dispara DESPUÉS de la respuesta del servidor.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fiebre del oro: el marco brilla más con cada cofre (--calor 0..1) */
.tablero-marco { --calor: 0; transition: box-shadow calc(.5s * var(--dur)) ease;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .65), inset 0 0 22px rgba(0, 0, 0, .8), 0 0 calc(var(--calor) * 38px) rgba(255, 190, 40, calc(var(--calor) * .75)); }
.tablero-marco::after { content: ''; position: absolute; inset: -2px; border-radius: 20px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: conic-gradient(from var(--giro, 0deg), transparent 0 70%, rgba(255, 240, 170, .95) 80%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 3px; }
.tablero-marco.fiebre::after { opacity: 1; animation: mnGiroBorde calc(2.4s * var(--dur) + .001s) linear infinite; }
@property --giro { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes mnGiroBorde { to { --giro: 360deg; } }

/* Cofre nuevo: salto con brillo dorado */
.casilla.oro.revela { animation: girar calc(.32s * var(--dur)) ease-out, cofreSalto calc(.55s * var(--dur)) cubic-bezier(.2, 1.6, .4, 1) .05s; z-index: 2; }
@keyframes cofreSalto { 0% { box-shadow: 0 0 0 0 rgba(255, 220, 120, .9); } 40% { box-shadow: 0 0 0 6px rgba(255, 220, 120, .35), 0 0 30px rgba(255, 200, 60, .9); } 100% { box-shadow: 0 0 14px rgba(255, 190, 40, .45); } }

/* Multiplicador y Cobrar */
#j-mult { display: inline-block; color: var(--oro); text-shadow: 0 0 12px rgba(255, 200, 60, .45); }
.btn-verde { position: relative; overflow: hidden; }
.btn-verde::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 34%; left: -50%; transform: skewX(-20deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: mnBrillo calc(2.6s * var(--dur) + .001s) ease-in-out infinite; }
@keyframes mnBrillo { 0%, 55% { left: -50%; } 100% { left: 130%; } }
.btn-verde.golpe { animation: mnGolpe calc(.42s * var(--dur)) cubic-bezier(.2, 1.6, .4, 1); }
@keyframes mnGolpe { 35% { transform: scale(1.05); filter: brightness(1.25); } }

/* Fin de ronda sobre el tablero: dónde estaban las minas */
.casilla.revela-fin { animation: mnAparece calc(.36s * var(--dur)) cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes mnAparece { 0% { transform: scale(.55) rotate(-6deg); opacity: 0; } 100% { transform: none; } }
.tablero.final-victoria .casilla.mina.fin { opacity: .78; filter: saturate(.85); }
.tablero.final-victoria .casilla.oro.fin, .tablero.final-derrota .casilla.oro.fin { opacity: .42; filter: saturate(.5) brightness(.85); }
.tablero.final-derrota .casilla.mina.fin { opacity: .95; }
.tablero.bloqueado .casilla.ganadora { filter: none; animation: mnGanadora calc(1.2s * var(--dur) + .001s) ease-in-out infinite; z-index: 1; }
@keyframes mnGanadora { 50% { box-shadow: 0 0 0 2px rgba(255, 240, 170, .9), 0 0 26px rgba(255, 200, 60, .9); } }
.sello-tablero { position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%) rotate(-7deg); pointer-events: none; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px 22px 12px; border-radius: 18px; white-space: nowrap;
  animation: mnSello calc(.55s * var(--dur)) cubic-bezier(.2, 1.5, .35, 1) .25s both, mnSelloSale calc(.5s * var(--dur)) ease-in calc(1.55s * var(--dur)) forwards; }
@keyframes mnSelloSale { to { opacity: 0; transform: translate(-50%, -95%) rotate(-7deg) scale(.7); } }
@keyframes mnSello { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(2.6); } 60% { opacity: 1; } 100% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(1); } }
.sello-tablero.oro { border: 3px solid #fff1a6; color: #3a2102;
  background: linear-gradient(180deg, #fff6c8 0%, #ffd64f 30%, #f3b11d 62%, #c98408 100%);
  box-shadow: 0 0 0 3px #6d4004, 0 14px 30px rgba(0, 0, 0, .6), 0 0 50px rgba(255, 190, 40, .75); }
.sello-tablero.oro small { font-size: 13px; font-weight: 800; letter-spacing: 3px; }
.sello-tablero.oro b { font-size: clamp(26px, 8.4vw, 38px); font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.sello-tablero.oro span { margin-top: 2px; padding: 2px 12px; border-radius: 999px; background: #3a2102; color: #ffe27a; font-weight: 800; font-size: 16px; }
.sello-tablero.rojo { border: 3px solid #ffd0b8; color: #fff;
  background: linear-gradient(180deg, #ff9b6a 0%, #ff4a1c 45%, #b8160a 100%); box-shadow: 0 0 0 3px #4a0602, 0 14px 30px rgba(0, 0, 0, .65), 0 0 50px rgba(255, 70, 20, .8); }
.sello-tablero.rojo b { font-size: clamp(34px, 11vw, 52px); font-weight: 900; letter-spacing: 1px; text-shadow: 0 3px 0 #5a0c03; }
.procesando.ok { border-color: #7dffa0; background: linear-gradient(180deg, rgba(20, 90, 40, .85), rgba(8, 40, 18, .9)); color: #eaffef; }
.procesando.ok b { color: #fffbe0; }
.procesando.malo { border-color: rgba(255, 120, 90, .7); background: rgba(40, 8, 4, .85); color: #ffd1c2; }

/* Pantalla de victoria por nivel (0 ganaste · 1 gran botín · 2 mega · 3 legendario) */
#p-victoria .cofre-brillo { width: min(52vw, 210px, max(110px, calc(100dvh - 680px))); margin: -2px auto -8px; }
#p-victoria .cofre-brillo img { animation: cofreFiesta calc(2.4s * var(--dur)) ease-in-out infinite, mnCofreEntra calc(.7s * var(--dur)) cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes mnCofreEntra { 0% { transform: scale(.3) translateY(40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cofre-brillo .rayos.r2 { inset: -30%; opacity: .55; animation-direction: reverse; animation-duration: calc(26s * var(--dur) + .001s); }
#p-victoria .titulo-res { animation: mnTitulo calc(.7s * var(--dur)) cubic-bezier(.18, 1.5, .4, 1) both; }
#p-victoria .titulo-res.largo { font-size: clamp(32px, 10vw, 50px); }
@keyframes mnTitulo { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.12); } 100% { transform: none; } }
#p-victoria .tarjeta-res { animation: mnSube calc(.55s * var(--dur)) cubic-bezier(.2, 1.3, .4, 1) .25s both; }
@keyframes mnSube { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
#p-victoria .tarjeta-res p { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 0; }
#p-victoria .pill-mult { font-size: 17px; padding: 3px 12px; }
#p-victoria[data-nivel="1"] .cofre-brillo img, #p-victoria[data-nivel="2"] .cofre-brillo img, #p-victoria[data-nivel="3"] .cofre-brillo img { filter: drop-shadow(0 0 36px rgba(255, 210, 70, .85)) drop-shadow(0 16px 20px rgba(0, 0, 0, .6)); }
#p-victoria[data-nivel="2"] .rayos, #p-victoria[data-nivel="3"] .rayos { animation-duration: calc(7s * var(--dur) + .001s); background: repeating-conic-gradient(from 0deg, rgba(255, 230, 130, .42) 0 8deg, transparent 8deg 20deg); }
#p-victoria[data-nivel="2"] .titulo-res, #p-victoria[data-nivel="3"] .titulo-res { animation: mnTitulo calc(.7s * var(--dur)) cubic-bezier(.18, 1.5, .4, 1) both, mnLatTitulo calc(1.6s * var(--dur) + .001s) ease-in-out .8s infinite; }
@keyframes mnLatTitulo { 50% { transform: scale(1.05); filter: drop-shadow(0 3px 0 #7a4705) drop-shadow(0 6px 0 #3d2202) drop-shadow(0 0 34px rgba(255, 210, 70, .9)); } }
.v-tablero-caja { display: flex; flex-direction: column; align-items: center; gap: 5px; animation: mnSube calc(.55s * var(--dur)) ease-out .45s both; }
.v-tablero-caja small { font-size: 12px; color: var(--texto-suave); letter-spacing: .4px; }
.tablero.chico.oro { width: min(100%, 236px, max(150px, calc(100dvh - 650px))); --gap: 4px; padding: 6px; border-radius: 14px;
  background: linear-gradient(180deg, #1d150b, #0c0805) padding-box, var(--borde-oro) border-box; }
.tablero.chico.oro .casilla { border-radius: 7px; }
#p-victoria .resultado { gap: 9px; }
#p-victoria #v-otra { animation: mnSube calc(.5s * var(--dur)) ease-out .6s both; }
/* Tablero chico de la victoria: minas bien visibles, tus cofres brillando, el resto apagado */
.tablero.chico.oro .casilla.oro.fin { opacity: .3; filter: saturate(.4); }
.tablero.chico.oro .casilla.mina.fin { opacity: 1; box-shadow: 0 0 10px rgba(255, 70, 20, .55); }
.tablero.chico.oro .casilla.mia { box-shadow: 0 0 10px rgba(255, 200, 60, .65); }
