/* Página de juego de inJuegos. Hereda fondo, marca, botones y baldosas de injuegos.com.es/assets/estilo.css */
body { -webkit-tap-highlight-color: transparent; }

.pagina-juego {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px;
  max-width: 1180px; margin: 0 auto; padding: 0 16px; align-items: start;
}

/* marco del juego */
.marco {
  background: #2a1a6e; border-radius: 24px; padding: 12px; box-shadow: 0 16px 40px rgba(29, 17, 66, .35);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.marco:fullscreen { justify-content: center; border-radius: 0; padding: 16px; }
.marco:fullscreen .tablero { max-width: min(100%, calc(100vh - 180px)); }

.hud { display: flex; gap: 8px; width: 100%; max-width: var(--lado); }
.pill { flex: 1; min-width: 0; background: rgba(255, 255, 255, .08); border-radius: 14px; padding: 5px 8px; text-align: center; color: #fff; }
.pill small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #b9b0ec; }
.pill b { font: 700 21px/1.15 var(--titulo); font-variant-numeric: tabular-nums; }
.pill.combo.vivo { background: linear-gradient(150deg, #ff5d6c, #ff9a3d); animation: latido .6s ease; }
.pill.combo.vivo small { color: #fff; }
@keyframes latido { 40% { transform: scale(1.08); } }
.pill.frente b { display: inline-flex; align-items: center; gap: 5px; }
.pill.frente i { display: inline-block; width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }

:root { --lado: min(100%, calc(100vh - 290px)); }
.tablero { position: relative; width: 100%; max-width: var(--lado); aspect-ratio: 1; min-width: 260px; }
canvas { display: block; width: 100%; height: 100%; border-radius: 18px; touch-action: none; }

/* capas sobre el tablero */
.capa {
  position: absolute; inset: 0; border-radius: 18px; overflow: hidden auto; padding: 20px;
  background: rgba(24, 12, 66, .86); backdrop-filter: blur(4px); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; text-align: center; gap: 8px;
}
.capa.oculta, .oculta { display: none; }
.capa h2 { margin: 0; font-size: 30px; }
.capa-inicio { padding: 0; background: #2a1a6e; }
.capa-inicio .portada { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.capa-inicio .abajo {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 18px;
  background: linear-gradient(transparent, rgba(20, 8, 60, .92) 55%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.boton.grande { font-size: 24px; padding: 16px 44px; animation: pulso 1.8s ease-in-out infinite; }
@keyframes pulso { 50% { transform: scale(1.05); } }
.cuenta { font-size: 14px; color: #ddd7ff; margin: 0; max-width: 420px; }
.cuenta a { color: #ffd76a; font-weight: 800; }

.capa-fin { background: radial-gradient(circle at 50% 30%, rgba(108, 76, 245, .92), rgba(24, 12, 66, .95) 70%); }
.gran { font: 700 64px/1 var(--titulo); margin: 0; text-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
.sello {
  background: var(--sol); color: var(--tinta); font: 700 15px var(--titulo); padding: 5px 14px; border-radius: 999px;
  transform: rotate(-4deg); box-shadow: 0 4px 0 #d99a00; animation: pulso 1s ease-in-out infinite;
}
.fichas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fichas span { background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 700; }
.botones { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.confeti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confeti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: caer linear forwards; }
@keyframes caer { to { transform: translateY(110vh) rotate(720deg); } }

.pestanas { display: flex; gap: 6px; margin-bottom: 4px; }
.pestanas button { font: 700 14px var(--titulo); background: rgba(255, 255, 255, .1); color: #ddd7ff; border: 0; padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.pestanas .activa { background: #fff; color: var(--violeta); }
.podio.oscuro { width: 100%; max-width: 340px; flex: none; }
.podio.oscuro li { background: rgba(255, 255, 255, .1); color: #fff; }
.podio.oscuro .pts { color: #ffd76a; }
.podio li.yo { outline: 2px solid var(--menta); }

/* barra bajo el juego */
.barra-juego { display: flex; align-items: center; gap: 12px; width: 100%; background: #fff; border-radius: 16px; padding: 8px 10px; }
.barra-juego .mini { width: 46px; height: 46px; border-radius: 12px; }
.barra-juego .titulo { flex: 1; min-width: 0; }
.barra-juego h1 { margin: 0; font-size: 22px; }
.barra-juego .titulo span { font-size: 13px; color: var(--suave); font-weight: 700; }
.controles { display: flex; gap: 6px; }
.redondo {
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; font-size: 18px;
  background: #f1edff; color: var(--violeta); box-shadow: 0 3px 0 #d9d0ff;
}
.redondo:active { transform: translateY(2px); box-shadow: 0 1px 0 #d9d0ff; }
.redondo.apagado { opacity: .45; }

/* columna lateral */
.lateral { display: flex; flex-direction: column; gap: 16px; }
.lateral .b-ranking { min-height: 300px; }
.b-reglas { padding: 16px; }
.b-reglas h3 { margin: 0 0 8px; font-size: 19px; }
.b-reglas ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #3c3560; }
.b-reglas li { display: flex; gap: 10px; align-items: flex-start; }
.ficha { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px; color: rgba(29, 17, 66, .55); font-size: 13px; background: var(--f); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); }
.ficha.arcoiris { background: conic-gradient(#ff5d6c, #ffc93c, #19c7a0, #3fa9f5, #b57bff, #ff5d6c); color: #fff; }
.teclas { font-size: 12px; color: var(--suave); margin: 10px 0 0; }

/* cruceta táctil */
.pad { display: none; grid-template-columns: repeat(3, 68px); grid-template-rows: repeat(2, 56px); gap: 8px; }
.pad button { font-size: 22px; background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 16px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25); touch-action: manipulation; }
.pad button:active { background: rgba(255, 255, 255, .22); }
.pad [data-dir=arriba] { grid-column: 2; grid-row: 1; }
.pad [data-dir=izquierda] { grid-column: 1; grid-row: 2; }
.pad [data-dir=abajo] { grid-column: 2; grid-row: 2; }
.pad [data-dir=derecha] { grid-column: 3; grid-row: 2; }
.tactil .pad { display: grid; }
.tactil { --lado: min(100%, calc(100vh - 400px)); }

@media (max-width: 900px) {
  .pagina-juego { grid-template-columns: 1fr; }
  .lateral { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .pagina-juego { padding: 0 10px; }
  .cabeza { padding: 10px 16px; }
  .chip-cuenta { display: none; }
  .marco { padding: 8px; border-radius: 20px; gap: 8px; }
  .hud { gap: 5px; }
  .pill { padding: 4px 4px; border-radius: 12px; }
  .pill small { font-size: 9px; letter-spacing: .2px; }
  .pill b { font-size: 18px; }
  .lateral { grid-template-columns: 1fr; }
  .barra-juego h1 { font-size: 19px; }
  .redondo { width: 38px; height: 38px; font-size: 16px; }
  .gran { font-size: 50px; }
  .boton.grande { font-size: 21px; padding: 14px 36px; }
  .tactil { --lado: min(100%, calc(100vh - 360px)); }
}
