/* ============ Modo juego (proyector y celular) ============ */
:root { --oA: #8b7cff; --oB: #3fd69b; --oC: #ff6b81; --oD: #ffb067; }

/* ---- opciones con color por letra ---- */
.op-juego { position: relative; display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  border: 0; border-radius: 24px; padding: 16px 18px; background: var(--bg2); color: var(--label); box-shadow: var(--clay);
  font: inherit; font-weight: 600; cursor: pointer; transition: transform .3s, opacity .5s, box-shadow .35s, filter .5s; }
.op-juego .marca { flex: none; width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center;
  font-weight: 800; font-size: 19px; color: #0b0b12; box-shadow: inset 2px 2px 4px rgba(255,255,255,.45), inset -3px -3px 6px rgba(0,0,0,.25); }
.op-juego[data-l="0"] .marca { background: var(--oA); } .op-juego[data-l="1"] .marca { background: var(--oB); }
.op-juego[data-l="2"] .marca { background: var(--oC); } .op-juego[data-l="3"] .marca { background: var(--oD); }
.op-juego[data-l="0"] { --c: var(--oA); } .op-juego[data-l="1"] { --c: var(--oB); }
.op-juego[data-l="2"] { --c: var(--oC); } .op-juego[data-l="3"] { --c: var(--oD); }
.op-juego.elegida { box-shadow: var(--sombra-fuera), inset 0 0 0 3px var(--c), var(--sombra-dentro); }
.op-juego.oculta { opacity: .18; filter: grayscale(1); pointer-events: none; }
.op-juego.apagada { animation: apagar-op .6s ease .15s both; }
@keyframes apagar-op { from { opacity: 1; filter: none; } to { opacity: .32; filter: grayscale(.6); } }
.op-juego.correcta { box-shadow: 0 0 0 3px var(--green), 0 12px 30px rgba(79,224,165,.25), var(--sombra-dentro); }
.op-juego:disabled { cursor: default; }
.op-juego .cuenta { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--label2); }
.op-juego .barra-op { position: absolute; left: 0; bottom: 0; height: 5px; border-radius: 0 0 24px 24px; background: var(--c); width: 0; transition: width 1.3s cubic-bezier(.22,.8,.3,1) .2s; opacity: .8; }

/* ---- ruleta ---- */
.ruleta-caja { position: relative; width: min(78vw, 340px); aspect-ratio: 1; margin: 34px auto 18px; }
.ruleta-caja.grande { width: min(42vh, 420px); }
.ruleta { width: 100%; height: 100%; border-radius: 50%; position: relative; overflow: hidden;
  background: conic-gradient(from -22.5deg, #8b7cff 0 45deg, #3fd69b 0 90deg, #ff6b81 0 135deg, #ffb067 0 180deg,
                                             #8b7cff 0 225deg, #3fd69b 0 270deg, #ff6b81 0 315deg, #ffb067 0 360deg);
  box-shadow: 0 18px 40px rgba(0,0,0,.6), inset 0 0 0 10px rgba(255,255,255,.08), inset 6px 6px 16px rgba(255,255,255,.25), inset -10px -10px 22px rgba(0,0,0,.35);
  transition: transform 6s cubic-bezier(.12, .62, .08, 1); }
.ruleta.lenta { animation: girar-lento 18s linear infinite; }
@keyframes girar-lento { to { transform: rotate(360deg); } }
.ruleta .gajo { position: absolute; left: 50%; top: 0; height: 50%; width: 30%; margin-left: -15%; transform-origin: 50% 100%;
  display: flex; justify-content: center; padding-top: 9%; font-weight: 800; font-size: clamp(11px, 3.4vw, 17px); color: #12121a; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.ruleta-caja.grande .gajo { font-size: clamp(13px, 1.8vh, 20px); }
.ruleta-centro { position: absolute; inset: 38%; border-radius: 50%; background: var(--bg2); box-shadow: var(--clay); display: grid; place-items: center; font-size: 26px; }
.ruleta-puntero { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 0; height: 0;
  border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 28px solid #fff; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); z-index: 2; }

/* ---- comodines (celular) ---- */
.comodines { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.comodin { border: 0; border-radius: 18px; padding: 10px 14px; min-width: 92px; background: var(--bg2); color: var(--label); box-shadow: var(--clay);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .3s, opacity .4s; }
.comodin .ico { font-size: 22px; line-height: 1.1; }
.comodin:disabled { opacity: .35; cursor: default; }
.comodin.pasivo { box-shadow: var(--clay-hundido); }
.comodin-vacio { color: var(--label3); font-size: 14px; text-align: center; padding: 8px; }

/* ---- reloj circular ---- */
.reloj-c { --p: 1; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--blue) calc(var(--p) * 360deg), var(--bg3) 0); box-shadow: var(--clay); transition: background .3s; }
.reloj-c.alerta { background: conic-gradient(var(--red) calc(var(--p) * 360deg), var(--bg3) 0); }
.reloj-c > b { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---- tabla ---- */
.fila-rank { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px;
  background: var(--bg2); box-shadow: var(--clay); margin-bottom: 10px; animation: entrar 1s cubic-bezier(.22,.8,.3,1) both; }
.fila-rank .pos { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; background: var(--bg3); box-shadow: var(--clay-hundido); }
.fila-rank:nth-child(1) .pos { background: linear-gradient(145deg, #ffd76a, #f0a92c); color: #2a1c00; }
.fila-rank:nth-child(2) .pos { background: linear-gradient(145deg, #e9ecf5, #aab0c4); color: #1c1f2b; }
.fila-rank:nth-child(3) .pos { background: linear-gradient(145deg, #f2b183, #c97a45); color: #2a1200; }
.fila-rank .pts { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.fila-rank .mas { display: block; font-size: 13px; color: var(--green); font-weight: 700; }

/* ---- racha 🔥 ---- */
.llama { display: inline-flex; align-items: center; gap: 2px; margin-left: 10px; font-weight: 800; color: #ffb067; font-size: .85em; vertical-align: middle; font-variant-numeric: tabular-nums; }
.llama .fuego { display: inline-block; transform-origin: 50% 90%; animation: flamear 1.4s ease-in-out infinite; will-change: transform; }
.llama[data-n="2"] .fuego { font-size: 1.2em; }
.llama[data-n="3"] .fuego { font-size: 1.4em; filter: drop-shadow(0 0 6px rgba(255, 140, 40, .85)); }
@keyframes flamear { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.14) rotate(4deg); } }
.racha-msj { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 16px; border-radius: 18px; background: var(--bg2); box-shadow: var(--clay); font-weight: 800; font-size: 17px; animation: pop .9s cubic-bezier(.3,1.3,.5,1) .35s both; }
.racha-msj.fuego-on { color: #ffb067; } .racha-msj.apagada { color: var(--label2); } .racha-msj.salvada { color: var(--blue); }
.racha-msj .grande { font-size: 30px; display: inline-block; animation: flamear 1.2s ease-in-out infinite; }
.racha-msj.apagada .grande { animation: humo 1.6s ease forwards; }
@keyframes humo { 0% { transform: none; opacity: 1; filter: none; } 100% { transform: scale(.9); opacity: .4; filter: grayscale(1); } }
.aviso-sonido { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--bg3); box-shadow: var(--clay); border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 15px; cursor: pointer; animation: entrar .8s both; }

/* ---- revelar, sincronizado con el sonido: golpe 0,15 s · destello 0,4 s · se apaga hacia 1,5 s ---- */
.op-juego { overflow: hidden; }
.op-juego.correcta { animation: golpe-op .9s cubic-bezier(.3,1.4,.5,1) .12s both; }
@keyframes golpe-op { 0% { transform: scale(1); } 22% { transform: scale(1.06); } 42% { transform: scale(.99); } 58% { transform: scale(1.03); } 100% { transform: scale(1); } }
.op-juego.correcta::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.5) 48%, transparent 70%); transform: translateX(-130%); animation: barrido .85s ease-out .15s forwards; }
.op-juego.correcta::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(120% 140% at 50% 50%, rgba(94,227,138,.35), transparent 70%); opacity: 0; animation: halo 1.6s ease .12s forwards; }
@keyframes barrido { to { transform: translateX(130%); } }
@keyframes halo { 0% { opacity: 0; } 12% { opacity: 1; } 28% { opacity: .55; } 38% { opacity: 1; } 100% { opacity: .45; } }
.chispa { position: fixed; z-index: 70; pointer-events: none; font-size: 18px; color: #fff3b0; text-shadow: 0 0 8px rgba(255,230,120,.9);
  animation: chispa 1.15s cubic-bezier(.2,.8,.3,1) .15s both; will-change: transform, opacity; }
@keyframes chispa { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(90deg); opacity: 0; } }
.espera-icono.golpe { animation: pop .8s cubic-bezier(.3,1.4,.5,1) .12s both; }
.racha-msj { animation-delay: 1s !important; }

/* ---- cuenta regresiva inicial ---- */
.cuenta-grande { font-size: clamp(96px, 28vw, 220px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  background: linear-gradient(160deg, #e7fffa, var(--blue2)); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 10px 0; }
.cuenta-grande.late { animation: latido-num .9s cubic-bezier(.3,1.4,.5,1); }
@keyframes latido-num { 0% { transform: scale(1.35); opacity: .3; } 60% { transform: scale(.96); opacity: 1; } 100% { transform: scale(1); } }

/* ---- vecinos en la tabla (estudiante) ---- */
.vecinos { max-width: 520px; margin: 18px auto 0; text-align: left; }
.vecinos .fila-rank.yo { box-shadow: var(--sombra-fuera), inset 0 0 0 2px var(--blue), var(--sombra-dentro); }
.vecinos .dif { display: block; font-size: 12px; font-weight: 700; color: var(--label2); }
.vecinos .dif.arriba { color: var(--orange); } .vecinos .dif.abajo { color: var(--green); }

/* ---- podio (estudiante y proyector) ---- */
.podio-m { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 22px auto 8px; max-width: 520px; }
.podio-m > div { flex: 1; text-align: center; min-width: 0; }
.podio-m .nom { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: entrar 1s both; }
.podio-m .pts { font-size: 13px; color: var(--label2); margin-bottom: 6px; animation: entrar 1s both; }
.podio-m .bloque { border-radius: 18px 18px 8px 8px; box-shadow: var(--clay); display: grid; place-items: start center; padding-top: 10px;
  font-size: 30px; font-weight: 800; color: #1b1300; transform-origin: bottom; animation: subir-podio 1.6s cubic-bezier(.22,.8,.3,1) both; }
.podio-m .p1 .bloque { height: 150px; background: linear-gradient(145deg, #ffd76a, #f0a92c); animation-delay: 1.2s; }
.podio-m .p2 .bloque { height: 110px; background: linear-gradient(145deg, #e9ecf5, #aab0c4); animation-delay: .6s; }
.podio-m .p3 .bloque { height: 80px; background: linear-gradient(145deg, #f2b183, #c97a45); animation-delay: 0s; }
.podio-m .p1 .nom, .podio-m .p1 .pts { animation-delay: 2.1s; } .podio-m .p2 .nom, .podio-m .p2 .pts { animation-delay: 1.4s; } .podio-m .p3 .nom, .podio-m .p3 .pts { animation-delay: .8s; }
.podio-m .yo .bloque { outline: 3px solid var(--blue); outline-offset: 3px; }
.podio-m .yo .nom { color: var(--blue); }
@keyframes subir-podio { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.mi-puesto { display: inline-block; margin-top: 16px; padding: 12px 20px; border-radius: 20px; background: var(--bg2); box-shadow: var(--clay); font-weight: 800; font-size: 18px; animation: entrar 1s 2.6s both; }
.btn-musica { width: 38px; height: 38px; border-radius: 13px; border: 0; background: var(--bg2); box-shadow: var(--clay); font-size: 18px; cursor: pointer; margin-right: 8px; color: var(--label); }
.btn-musica.off { opacity: .55; box-shadow: var(--clay-hundido); }

/* ---- código QR ---- */
.qr { background: #fff; border-radius: 22px; padding: 10px; box-shadow: var(--clay); line-height: 0; animation: pop 1s cubic-bezier(.3,1.3,.5,1) both; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-pie { font-size: 14px; color: var(--label2); font-weight: 700; margin-top: 8px; text-align: center; }

/* ---- personajes pixel art (celular) ---- */
.pj-elegir { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 20px; }
.pj-op { background: var(--bg2); box-shadow: var(--clay); border-radius: 20px; padding: 16px 4px 12px; text-align: center; font-size: 12.5px; font-weight: 700; line-height: 1.25;
  cursor: pointer; border: 2px solid transparent; transition: transform .25s cubic-bezier(.3,1.3,.5,1), border-color .25s, box-shadow .25s; -webkit-tap-highlight-color: transparent; color: var(--label); }
.pj-op:active { transform: scale(.95); }
.pj-op.sel { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(127,230,213,.16), var(--clay); }
.pj-op .pj-mini { margin-bottom: 8px; }
.pj-yo { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 4vh 0 2vh; }
.pj-yo .pj-mini { margin: 34px 0 10px; }
.pj-yo .nom-pj { font-weight: 800; font-size: 17px; }
.pj-acc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 360px; margin: 0 auto; }
.pj-acc .btn { margin: 0; }
.ruleta-yo { display: flex; justify-content: center; margin: 26px 0 14px; min-height: 64px; align-items: flex-end; }
.podio-m .pj-pod { display: flex; justify-content: center; margin-bottom: 4px; animation: entrar 1s both; }
.podio-m:has(.pj-pod) { margin-top: 56px; }
.podio-m .p1 .pj-pod { animation-delay: 2.1s; } .podio-m .p2 .pj-pod { animation-delay: 1.4s; } .podio-m .p3 .pj-pod { animation-delay: .8s; }

/* ---- pregunta doble ---- */
.doble-aviso .rayo { font-size: 96px; line-height: 1; filter: drop-shadow(0 0 30px rgba(255,210,63,.7)); animation: rayo 1.2s cubic-bezier(.3,1.4,.5,1) both, flamear 1.4s ease-in-out 1.2s infinite; }
.doble-aviso h1 { color: #ffd23f; text-shadow: 0 0 30px rgba(255,210,63,.35); animation: pop .9s cubic-bezier(.3,1.3,.5,1) .25s both; }
@keyframes rayo { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.25) rotate(8deg); opacity: 1; } 100% { transform: none; } }
.chip-doble { display: inline-block; margin: 0 auto 10px; padding: 7px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; color: #2b1d00;
  background: linear-gradient(145deg, #ffe680, #ffc53d); box-shadow: 0 8px 22px rgba(255,197,61,.3); animation: pop .8s cubic-bezier(.3,1.3,.5,1) both; }
/* ---- reacciones ---- */
.reacciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px auto 0; max-width: 420px; transition: opacity .3s; }
.reacciones.espera { opacity: .45; }
.reac { width: 48px; height: 48px; border: 0; border-radius: 16px; background: var(--bg2); box-shadow: var(--clay); font-size: 24px; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.reac.texto { font-size: 18px; font-weight: 900; color: var(--blue); font-family: inherit; }
.reac.pop { animation: pop .5s cubic-bezier(.3,1.5,.5,1); }
/* ---- personajes en revelar, tabla y medallas ---- */
.pj-revelar { display: flex; justify-content: center; margin: 14px 0 0; min-height: 64px; align-items: flex-end; }
.pj-fila { vertical-align: middle; margin: -8px 8px -6px 0; }
.racha-msj.premio-acc { color: #ffd23f; }
.medalla { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--bg2); box-shadow: var(--clay); border-radius: 20px; padding: 12px 16px; margin: 10px auto 0; max-width: 440px; animation: entrar .9s both; }
.medalla .ico { font-size: 30px; width: 44px; text-align: center; }
.medalla .tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.medalla .tx span { color: var(--label2); font-size: 14px; }
.medalla.mia { border: 2px solid #ffd23f; box-shadow: 0 0 0 4px rgba(255,210,63,.12), var(--clay); }
.medalla.mia .ico { font-size: 38px; }
.grupo-titulo { margin: 26px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--label2); }

/* ---- íconos pixel art de los comodines ---- */
.ico-pix { image-rendering: pixelated; image-rendering: crisp-edges; vertical-align: middle; filter: drop-shadow(0 0 1px rgba(255,255,255,.3)); -webkit-user-drag: none; user-select: none; }
.comodin .ico { display: flex; justify-content: center; margin-bottom: 2px; }
.ruleta .gajo { flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; }
.ruleta .gajo .gajo-ico { filter: none; }
.ico-premio { margin: -4px 6px 0 0; }

/* ---- llama de racha pixel art ---- */
.llama-pix { image-rendering: pixelated; image-rendering: crisp-edges; vertical-align: middle; -webkit-user-drag: none; user-select: none; filter: drop-shadow(0 0 6px rgba(255,140,40,.35)); }
.llama[data-n="3"] .llama-pix, .llama-pix.azul { filter: drop-shadow(0 0 6px rgba(80,150,255,.5)); }
.racha-msj .grande.pix { animation: none !important; display: inline-flex; }
.llama { gap: 4px; }

/* ---- récord personal y último personaje ---- */
.record-chip { display: block; width: fit-content; max-width: 100%; margin: 12px auto 0; padding: 10px 16px; border-radius: 16px; background: var(--bg2); box-shadow: var(--clay);
  font-weight: 800; font-size: 15px; color: var(--label); text-align: center; animation: entrar 1s 2.4s both; }
.record-chip.nuevo { color: #2b1d00; background: linear-gradient(145deg, #ffe680, #ffc53d); box-shadow: 0 10px 26px rgba(255,197,61,.35); animation: entrar 1s 2.4s both, latido 1.6s ease-in-out 3.4s infinite; }
@keyframes latido { 50% { transform: scale(1.05); } }
.pj-op { position: relative; }
.pj-ultimo { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 800; color: #ffd23f; }

/* ---- ruleta: monedas y contador vertical ---- */
.ruleta .gajo.gajo-moneda { padding-top: 7%; }
.premio-txt { font-size: 22px; font-weight: 800; color: var(--green); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 4px; }
.reel { display: inline-block; height: 1.2em; overflow: hidden; vertical-align: bottom; min-width: 3.2ch; text-align: center; border-radius: 8px; }
.reel-col { display: flex; flex-direction: column; transition: transform 2.2s cubic-bezier(.12,.78,.18,1); }
.reel-n { height: 1.2em; line-height: 1.2em; font-variant-numeric: tabular-nums; color: #ffd23f; }
.reel.fin { animation: pop .6s cubic-bezier(.3,1.5,.5,1); }
.premio-mayor { flex-basis: 100%; text-align: center; color: #ffd23f; font-size: 26px; letter-spacing: .04em; text-shadow: 0 0 18px rgba(255,210,63,.6); animation: pop .8s cubic-bezier(.3,1.5,.5,1) both; }
.premio-nota { flex-basis: 100%; text-align: center; font-size: 13px; font-weight: 600; color: var(--label2); margin-top: 4px; }
/* ---- comodín ×1,5 ---- */
.fila-mult { display: flex; align-items: center; justify-content: center; gap: 12px; }
.sello-mult { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 14px; background: linear-gradient(145deg, #fff1a8, #ffc53d);
  color: #2b1d00; font-size: 22px; box-shadow: 0 8px 22px rgba(255,197,61,.35); animation: sello .55s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes sello { 0% { transform: scale(2.4) rotate(-14deg); opacity: 0; } 60% { transform: scale(.9) rotate(4deg); opacity: 1; } 100% { transform: rotate(-4deg); } }
.multiplicado { color: #ffd23f !important; text-shadow: 0 0 22px rgba(255,210,63,.45); }
