/* Tema "isla": mar de fondo, tarjetas color arena, botones de colores. */
:root {
  --mar1: #39a7d6;
  --mar2: #1c6aa6;
  --mar3: #134c80;
  --arena: #fff8ea;
  --arena2: #f6ead2;
  --borde: #e2d2b2;
  --texto: #2d2a32;
  --tenue: #857a6a;
  --claro: #ffffff;
  --acento: #ffb52e;
  --acento2: #ff8a1f;
  --acento-txt: #3a2400;
  --peligro: #e5484d;
  --bien: #2fb36d;
  --azul: #2f8fdc;
  --morado: #8a5cf6;
  --radio: 18px;
  --sombra: 0 6px 18px #0b2a4a33, 0 2px 4px #0b2a4a22;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--texto); }
body {
  min-height: 100dvh; overscroll-behavior: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Cpath d='M0 30 Q15 20 30 30 T60 30 T90 30 T120 30' fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='3'/%3E%3C/svg%3E"),
    linear-gradient(170deg, var(--mar1), var(--mar2) 45%, var(--mar3));
  background-attachment: fixed;
}
h1, h2, h3 { margin: 0 0 .5rem; }
h3 { font-size: 1.02rem; color: #c2410c; letter-spacing: .01em; }
p { margin: .4rem 0; }
a { color: inherit; }
hr { border: 0; border-top: 2px dashed var(--borde); margin: 1rem 0; }
.tenue { color: var(--tenue); }
.centro { text-align: center; }
.aviso { color: #8a4b00; background: #ffe7b8; border-radius: 12px; padding: .45rem .7rem; }
.bien { color: var(--bien); font-weight: 700; }
small { font-size: .8em; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 46px; padding: .5rem .95rem; border-radius: 14px;
  border: 2px solid var(--borde); background: var(--claro); color: var(--texto);
  font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; text-align: center;
  box-shadow: 0 3px 0 var(--borde);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--borde); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primario { background: linear-gradient(180deg, #ffc94d, var(--acento)); color: var(--acento-txt); border-color: #e59a12; box-shadow: 0 3px 0 #d0850a; }
.btn.verde { background: linear-gradient(180deg, #4fd28c, var(--bien)); color: #fff; border-color: #22955a; box-shadow: 0 3px 0 #1d7d4c; }
.btn.azul { background: linear-gradient(180deg, #5ab0f0, var(--azul)); color: #fff; border-color: #1f74ba; box-shadow: 0 3px 0 #1a62a0; }
.btn.morado { background: linear-gradient(180deg, #a585ff, var(--morado)); color: #fff; border-color: #6d3fe0; box-shadow: 0 3px 0 #5b33c2; }
.btn.peligro { background: #fff0f0; border-color: #f2a8aa; color: #b4232a; box-shadow: 0 3px 0 #f2a8aa; }
.btn.grande { min-height: 58px; font-size: 1.15rem; width: 100%; }
.btn.chico { min-height: 38px; padding: .3rem .7rem; font-size: .9rem; border-radius: 12px; }
.btn.mini { min-height: 36px; min-width: 36px; padding: 0; border-radius: 50%; font-size: 1.25rem; }
.btn.activo { outline: 3px solid var(--acento2); outline-offset: 2px; }
.fila-botones { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.fila-botones.centro { justify-content: center; }
.botones { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }
.botones .btn { flex: 1; }
.lista-acciones { display: flex; flex-direction: column; gap: .55rem; }

/* ---------- Inicio ---------- */
.inicio { max-width: 460px; margin: 0 auto; padding: 2rem 1.2rem; display: flex; flex-direction: column; gap: 1rem; color: #fff; }
.inicio .tenue { color: #d8ecf8; }
.logo { text-align: center; margin-bottom: 1rem; }
.logo svg { filter: drop-shadow(0 8px 14px #0005); animation: flotar 3s ease-in-out infinite; }
.logo h1 { font-size: 2.3rem; margin-top: .6rem; text-shadow: 0 3px 0 #0b3a63; }
@keyframes flotar { 50% { transform: translateY(-6px) rotate(-3deg) } }
.inicio .tarjeta { color: var(--texto); }
.cargando, .esperando { text-align: center; padding: 2rem; color: #fff; font-weight: 700; }
.esperando { color: var(--texto); background: var(--arena); border-radius: 14px; padding: 1rem; box-shadow: var(--sombra); }
.sin-conexion { position: fixed; top: 0; left: 0; right: 0; background: var(--peligro); color: #fff; text-align: center; padding: .3rem; z-index: 70; font-size: .85rem; font-weight: 700; }

/* ---------- Formularios ---------- */
.campo { display: block; margin: .9rem 0 .35rem; color: var(--tenue); font-size: .92rem; font-weight: 700; }
.campo input, input.codigo-input {
  display: block; width: 100%; margin-top: .3rem; padding: .75rem .85rem; border-radius: 12px;
  border: 2px solid var(--borde); background: #fff; color: var(--texto); font: inherit; font-size: 1.1rem;
}
.campo input:focus, input.codigo-input:focus { outline: none; border-color: var(--acento); }
input.codigo-input { text-transform: uppercase; letter-spacing: .4em; font-size: 1.7rem; text-align: center; font-weight: 900; }
.colores { display: flex; flex-wrap: wrap; gap: .6rem; }
.color { width: 48px; height: 48px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px #0004; color: #000; font-weight: 900; font-size: 1.1rem; cursor: pointer; }
.color.activo { outline: 4px solid var(--acento2); outline-offset: 2px; transform: scale(1.08); }
.color:disabled { opacity: .3; }
.interruptor { display: flex; gap: .7rem; align-items: flex-start; margin: .5rem 0; padding: .5rem 0; cursor: pointer; }
.interruptor input { width: 26px; height: 26px; margin-top: .1rem; accent-color: var(--acento2); flex-shrink: 0; }
.regla { border-bottom: 2px dashed #00000010; }
.fila-pasos { display: flex; align-items: center; justify-content: center; gap: .8rem; margin: .5rem 0; flex-wrap: wrap; }
.numero-grande { font-size: 1.9rem; min-width: 2.4ch; text-align: center; color: #c2410c; }
.rejilla-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.rejilla-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; }
.rejilla-dado { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.btn.terreno { flex-direction: column; gap: 0; border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, #fff); box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 60%, #000); padding: .4rem .2rem; font-size: .8rem; }
.btn.terreno .ico { font-size: 1.6rem; }
.btn.num { font-size: 1.4rem; min-height: 54px; }
.btn.num.rojo { color: #d6282e; }
.btn.num.siete { background: #ffe4e4; border-color: #f2a8aa; color: #b4232a; box-shadow: 0 3px 0 #f2a8aa; }

/* ---------- Modales y avisos ---------- */
.fondo-modal { position: fixed; inset: 0; background: #0b2a4a66; backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; z-index: 40; animation: aparecer .15s; }
.modal { background: var(--arena); width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px #0005; animation: subir .22s cubic-bezier(.2, 1.3, .5, 1); border-top: 5px solid var(--acento); }
@media (min-width: 700px) { .fondo-modal { align-items: center; } .modal { border-radius: 24px; } }
.modal-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.modal-cab h2 { font-size: 1.3rem; margin: 0; }
.x { background: #0000000d; border: 0; color: var(--tenue); font-size: 1.2rem; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; }
.texto-modal { font-size: 1.08rem; }
@keyframes aparecer { from { opacity: 0 } }
@keyframes subir { from { transform: translateY(50px); opacity: 0 } }
.toasts { position: fixed; top: .6rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .4rem; z-index: 80; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #fff; color: var(--texto); border: 2px solid var(--borde); padding: .7rem .95rem; border-radius: 16px; font-weight: 800; animation: rebote .35s cubic-bezier(.2, 1.4, .5, 1); box-shadow: var(--sombra); }
.toast.error { border-color: #f2a8aa; background: #fff2f2; }
.toast.bien { border-color: var(--bien); background: #eafff2; font-size: 1.25rem; }
.toast.turno { background: linear-gradient(180deg, #ffc94d, var(--acento)); border-color: #e59a12; color: var(--acento-txt); font-size: 1.25rem; text-align: center; }
@keyframes rebote { from { transform: translateY(-30px) scale(.8); opacity: 0 } }
.qr { background: #fff; border-radius: 14px; padding: 6px; box-shadow: var(--sombra); }
.enlace { word-break: break-all; color: var(--tenue); font-size: .9rem; }
.codigo-grande { font-size: 3rem; font-weight: 900; letter-spacing: .25em; color: #c2410c; }

/* ---------- Piezas ---------- */
.punto { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #0003; vertical-align: middle; flex-shrink: 0; }
.punto.grande { width: 20px; height: 20px; }
.recursos { display: inline-flex; flex-wrap: wrap; gap: .25rem; vertical-align: middle; }
.chip-rec { background: color-mix(in srgb, var(--c) 22%, #fff); border: 2px solid var(--c); border-radius: 9px; padding: 0 .35rem; font-weight: 800; white-space: nowrap; }
.etiqueta { font-size: .72rem; background: #0000000f; padding: .12rem .5rem; border-radius: 99px; color: var(--tenue); font-weight: 700; }
.etiqueta.equipo { background: #ede5ff; color: #6d3fe0; }
.nombre-chip { display: inline-flex; align-items: center; gap: .3rem; margin-right: .5rem; }
.insignia { background: var(--acento); color: var(--acento-txt); border-radius: 8px; padding: 0 .35rem; font-weight: 900; }

/* ---------- Pantallas de teléfono ---------- */
.pantalla { max-width: 760px; margin: 0 auto; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.pantalla.con-dado { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
.lobby { padding-bottom: 120px !important; }
.barra { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .65rem 1rem; background: var(--arena); position: sticky; top: 0; z-index: 10; box-shadow: 0 3px 12px #0b2a4a33; border-bottom: 5px solid var(--color-yo, var(--acento)); }
.barra .codigo { font-size: 1.5rem; font-weight: 900; letter-spacing: .15em; color: #c2410c; }
.yo { display: flex; align-items: center; gap: .45rem; min-width: 0; font-size: 1.05rem; }
.pts-grande { font-size: 1.45rem; font-weight: 900; background: #fff; border: 2px solid var(--borde); border-radius: 99px; padding: .05rem .7rem; }
.pts-grande small { color: var(--tenue); font-weight: 700; font-size: .8rem; }
.tarjeta { background: var(--arena); border-radius: var(--radio); padding: .9rem 1rem; margin: .75rem; box-shadow: var(--sombra); }
.tarjeta-cab { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.tarjeta-cab h3 { margin: 0; }
.jugadores { list-style: none; padding: 0; margin: 0; counter-reset: j; }
.jugadores li { display: flex; align-items: center; gap: .55rem; padding: .5rem 0; border-bottom: 2px dashed #0000000d; counter-increment: j; }
.jugadores li::before { content: counter(j); color: #fff; background: var(--tenue); border-radius: 50%; width: 1.5em; height: 1.5em; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 900; }
.jugadores .nombre { flex: 1; font-weight: 800; }
.en-linea { width: 10px; height: 10px; border-radius: 50%; background: #c8bfae; }
.en-linea.si { background: var(--bien); box-shadow: 0 0 6px var(--bien); }
.pie-fijo { position: fixed; bottom: 0; left: 0; right: 0; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: linear-gradient(transparent, #134c80cc 35%); z-index: 9; }
.pie-fijo > * { max-width: 520px; margin: 0 auto; }
.como { background: var(--morado); color: #fff; padding: .4rem 1rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 700; }

.estado { margin: .75rem; padding: .8rem 1rem; border-radius: var(--radio); background: var(--arena); box-shadow: var(--sombra); }
.estado.mio { background: linear-gradient(135deg, #fff3c4, #ffe08a); box-shadow: 0 0 0 3px var(--acento), var(--sombra); }
.estado-fila { display: flex; align-items: center; gap: .8rem; }
.estado-titulo { font-size: 1.12rem; font-weight: 900; flex: 1; }
.estado .fila-botones .btn { flex: 1 1 auto; }

.ofertas { margin: 0 .75rem; display: flex; flex-direction: column; gap: .5rem; }
.oferta { background: #eafff2; border: 2px solid var(--bien); border-radius: var(--radio); padding: .7rem .9rem; box-shadow: var(--sombra); }
.oferta.mia { background: #eef4ff; border-color: var(--azul); }

/* Cartas de recursos: dibujo grande sobre el color del terreno. */
.mano { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; margin: .75rem; }
.carta {
  min-width: 0; position: relative; aspect-ratio: 5/7; border-radius: 14px; border: 3px solid #fff;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 70%);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 55%, #000), var(--sombra);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden;
  transition: transform .2s;
}
.carta::before { content: ''; position: absolute; inset: 5px; border: 2px dashed #ffffff66; border-radius: 9px; }
.carta.cero { filter: grayscale(.75) brightness(1.1); opacity: .55; box-shadow: none; }
.carta-ico { font-size: clamp(1.4rem, 7vw, 2.3rem); filter: drop-shadow(0 3px 2px #0004); }
.carta-n { position: absolute; top: 4px; right: 6px; background: #fff; color: var(--texto); border-radius: 99px; min-width: 1.6em; padding: 0 .3em; font-size: clamp(1rem, 4.5vw, 1.4rem); font-weight: 900; box-shadow: 0 2px 4px #0003; }
.carta-nom { font-size: .7rem; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #0008; margin-top: .2rem; }
.sube { animation: sube .6s cubic-bezier(.2, 1.5, .5, 1); }
@keyframes sube { 30% { transform: translateY(-14px) scale(1.08) rotate(-3deg) } }
.carta-des { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 2px dashed #0000000d; }
.carta-des .ico { font-size: 1.9rem; background: #fff; border-radius: 12px; width: 50px; height: 50px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px #0002; }
.carta-des-txt { flex: 1; }
.btn.opcion { justify-content: flex-start; text-align: left; min-height: 66px; }
.opcion-ico { font-size: 1.9rem; }
.opcion-txt { display: flex; flex-direction: column; gap: .15rem; }
.opcion-txt small { color: var(--tenue); font-weight: 600; }
.pestanas { display: flex; gap: .3rem; margin-bottom: .6rem; background: #0000000a; padding: 4px; border-radius: 14px; }
.pestanas button { flex: 1; padding: .6rem; border-radius: 11px; border: 0; background: transparent; color: var(--tenue); font: inherit; font-weight: 800; }
.pestanas button.activa { background: #fff; color: var(--texto); box-shadow: 0 2px 6px #0002; }

.pasos { display: flex; flex-direction: column; gap: .35rem; margin: .5rem 0; }
.pasos-titulo { font-weight: 900; color: #c2410c; }
.paso { display: flex; align-items: center; gap: .6rem; background: color-mix(in srgb, var(--c) 18%, #fff); border: 2px solid color-mix(in srgb, var(--c) 45%, #fff); border-radius: 12px; padding: .25rem .4rem; }
.paso-val { flex: 1; display: flex; align-items: center; gap: .5rem; }
.paso-val .ico { font-size: 1.45rem; }
.paso-val b { font-size: 1.35rem; }

.nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--arena); box-shadow: 0 -3px 14px #0b2a4a33; padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.nav button { flex: 1; background: none; border: 0; color: var(--tenue); padding: .45rem 0 .5rem; display: flex; flex-direction: column; align-items: center; font: inherit; font-weight: 800; cursor: pointer; position: relative; }
.nav button span { font-size: 1.4rem; transition: transform .2s; }
.nav button.activa { color: #c2410c; }
.nav button.activa span { transform: translateY(-3px) scale(1.15); }
.nav button.activa::after { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 4px; border-radius: 0 0 4px 4px; background: var(--acento2); }

/* Botón flotante para tirar el dado: se ve en cualquier pestaña. */
.tirar-flotante {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 25;
  width: min(92vw, 480px); min-height: 70px; border-radius: 22px; border: 3px solid #fff;
  background: linear-gradient(180deg, #ffd25e, #ff9f1c); color: var(--acento-txt);
  font: inherit; font-size: 1.45rem; font-weight: 900; cursor: pointer;
  box-shadow: 0 6px 0 #c9740a, 0 12px 30px #0006; display: flex; align-items: center; justify-content: center; gap: .6rem;
  animation: llamar 1.4s ease-in-out infinite;
}
.tirar-flotante .dado-ico { font-size: 2.1rem; animation: girar 1.4s ease-in-out infinite; display: inline-block; }
@keyframes llamar { 50% { transform: translateX(-50%) scale(1.04); box-shadow: 0 6px 0 #c9740a, 0 0 0 10px #ffb52e44, 0 12px 30px #0006 } }
@keyframes girar { 50% { transform: rotate(18deg) } }

/* ---------- Mapa ---------- */
.pestana-mapa { padding: .25rem .4rem; }
.mapa { width: 100%; height: auto; display: block; max-height: 64dvh; touch-action: manipulation; user-select: none; filter: drop-shadow(0 8px 16px #0b2a4a55); }
.mapa text { pointer-events: none; font-family: system-ui, sans-serif; }
.objetivo { cursor: pointer; }
.pulso { animation: pulso 1s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes pulso { from { transform: scale(.8); opacity: .75 } to { transform: scale(1.15); opacity: 1 } }
.pulso-borde { animation: borde 1s linear infinite; }
@keyframes borde { to { stroke-dashoffset: -48 } }
.borde-brilla { animation: brillo 1.2s ease-in-out infinite alternate; }
@keyframes brillo { from { opacity: .35 } to { opacity: 1 } }

/* Franja de rivales (arriba del mapa) y mi mano chica (abajo). */
.rivales { display: flex; gap: .4rem; overflow-x: auto; padding: .4rem .5rem; scrollbar-width: none; }
.rivales::-webkit-scrollbar { display: none; }
.rival { flex-shrink: 0; background: var(--arena); border-radius: 14px; padding: .3rem .55rem; display: flex; flex-direction: column; gap: .1rem; box-shadow: 0 2px 8px #0b2a4a33; border-top: 4px solid var(--c); font-size: .85rem; min-width: 92px; }
.rival.activo { box-shadow: 0 0 0 3px var(--acento), 0 2px 8px #0b2a4a33; }
.rival.yo { background: #fff; }
.rival-nom { font-weight: 900; display: flex; align-items: center; gap: .3rem; white-space: nowrap; }
.rival-datos { display: flex; gap: .45rem; color: var(--tenue); font-weight: 800; white-space: nowrap; }
.rival-datos b { color: var(--texto); }
.mano-mini { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; margin: .4rem .5rem; }
.mini-carta { border-radius: 12px; border: 2px solid #fff; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 55%, #fff), var(--c)); display: flex; align-items: center; justify-content: center; gap: .2rem; padding: .35rem .1rem; box-shadow: 0 3px 0 color-mix(in srgb, var(--c) 55%, #000); font-weight: 900; font-size: 1.15rem; color: #fff; text-shadow: 0 1px 2px #0009; }
.mini-carta.cero { filter: grayscale(.8); opacity: .5; box-shadow: none; }
.mini-carta .ico { font-size: 1.2rem; }

/* ---------- Partida ---------- */
.tabla-jug { display: flex; flex-direction: column; gap: .4rem; }
.fila-jug { padding: .5rem .65rem; border-radius: 14px; background: #fff; border-left: 6px solid var(--c, transparent); box-shadow: 0 2px 6px #0000000f; }
.fila-jug.activo { box-shadow: 0 0 0 3px var(--acento), 0 2px 6px #0000001a; }
.fila-jug.ganador { background: #fff3c4; }
.fila-nombre { font-weight: 900; display: flex; flex-wrap: wrap; align-items: center; }
.fila-datos { display: flex; flex-wrap: wrap; gap: .75rem; color: var(--tenue); margin-top: .2rem; font-weight: 700; }
.fila-datos .pts { color: var(--texto); font-weight: 900; }
.histo { display: flex; align-items: flex-end; height: 120px; gap: 4px; margin: .4rem 0; }
.histo-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.histo-barra { width: 100%; border-radius: 6px 6px 0 0; min-height: 3px; transition: height .3s; }
.histo-n { font-size: .75rem; color: var(--tenue); font-weight: 700; }
.histo-num { font-size: .85rem; font-weight: 900; }
.bitacora { list-style: none; padding: 0; margin: 0; max-height: 50vh; overflow-y: auto; }
.bitacora li { padding: .4rem 0; border-bottom: 2px dashed #0000000b; font-size: .93rem; }
.bitacora li.separador { color: #c2410c; font-weight: 900; }
.stats { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stats th, .stats td { padding: .4rem; text-align: center; border-bottom: 2px dashed #0000000f; }
.stats td:first-child { text-align: left; font-weight: 900; }
.stats tr.ganador td { color: #c2410c; }

/* ---------- Dados ---------- */
.dados { display: flex; align-items: center; gap: .35rem; animation: rodar .45s ease-out; }
.dados.vacio { color: var(--tenue); }
.dado { width: 36px; height: 36px; background: #fff; border-radius: 9px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 5px; box-shadow: inset 0 -3px 0 #e7dcc8, 0 3px 6px #0003; }
.dado span { display: block; margin: auto; width: 6px; height: 6px; }
.dado span.pip { background: #2d2a32; border-radius: 50%; }
.dado-total { font-size: 1.6rem; font-weight: 900; background: #fff; border: 3px solid var(--acento); border-radius: 12px; min-width: 46px; text-align: center; padding: 0 .3rem; }
.dados.siete .dado-total { border-color: var(--peligro); color: var(--peligro); }
@keyframes rodar { 0% { transform: rotate(-25deg) scale(.6); opacity: 0 } 70% { transform: rotate(6deg) scale(1.1) } 100% { transform: none; opacity: 1 } }

/* Animación grande de la tirada (teléfonos y TV). */
.lanzamiento { position: fixed; inset: 0; z-index: 75; display: flex; align-items: center; justify-content: center; background: #0b2a4a88; backdrop-filter: blur(3px); animation: aparecer .2s; }
.lanzamiento.fuera { animation: desaparecer .4s forwards; }
@keyframes desaparecer { to { opacity: 0 } }
.lanz-caja { background: var(--arena); border-radius: 28px; padding: 1.4rem 2rem; text-align: center; box-shadow: 0 20px 60px #0007; border: 5px solid var(--acento); max-width: 90vw; }
.lanz-caja.siete { border-color: var(--peligro); }
.lanz-quien { font-weight: 900; font-size: 1.15rem; color: var(--tenue); }
.lanz-dados { display: flex; gap: 1rem; justify-content: center; margin: .8rem 0; }
.lanz-dados .dado { width: 78px; height: 78px; padding: 10px; border-radius: 18px; animation: lanzar .9s cubic-bezier(.2, 1.2, .4, 1); }
.lanz-dados .dado:nth-child(2) { animation-duration: 1.05s; }
.lanz-dados .dado span { width: 13px; height: 13px; }
@keyframes lanzar { 0% { transform: translate(-120px, -160px) rotate(-540deg) scale(.4) } 70% { transform: translate(0, 8px) rotate(15deg) scale(1.05) } }
.lanz-total { font-size: 4.5rem; font-weight: 900; line-height: 1; color: #c2410c; animation: rebote .5s .6s both cubic-bezier(.2, 1.6, .5, 1); }
.lanz-caja.siete .lanz-total { color: var(--peligro); }
.lanz-extra { margin-top: .5rem; font-weight: 800; font-size: 1.05rem; animation: aparecer .3s .9s both; }

/* Confeti al ganar. */
.confeti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confeti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: caer linear forwards; }
@keyframes caer { to { transform: translateY(110vh) rotate(720deg) } }

/* ---------- Tablero (TV / tableta) ---------- */
body.modo-tablero { overflow: hidden; }
.tablero { display: flex; height: 100dvh; width: 100vw; }
.tablero-mapa { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 1.5vh 1vw; }
.tablero-mapa .mapa { max-height: 97dvh; height: 100%; width: 100%; }
.tablero-lado { width: min(34vw, 560px); background: var(--arena); box-shadow: -6px 0 24px #0b2a4a55; padding: 2.2vh 1.4vw; display: flex; flex-direction: column; gap: 1.6vh; overflow: hidden; font-size: clamp(14px, 1.45vw, 26px); }
.titulo-tablero { font-size: 2.2em; color: #c2410c; }
.unete { display: flex; align-items: center; gap: 1rem; }
.lista-lobby { list-style: none; padding: 0; margin: 0; font-size: 1.3em; display: flex; flex-direction: column; gap: .4em; font-weight: 800; }
.lista-lobby li { display: flex; align-items: center; gap: .5em; }
.turno-grande { display: flex; align-items: center; gap: 1vw; background: #fff; border-radius: 18px; padding: 1.4vh 1vw; box-shadow: 0 0 0 3px var(--acento), 0 4px 10px #0001; }
.turno-texto { font-size: 1.2em; font-weight: 900; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dados.grande .dado { width: 3.2vw; height: 3.2vw; min-width: 40px; min-height: 40px; padding: .45vw; border-radius: 12px; }
.dados.grande .dado span { width: .6vw; height: .6vw; min-width: 7px; min-height: 7px; }
.dados.grande .dado-total { font-size: 2.4em; min-width: 2em; }
.tabla-jug.grande .fila-jug { padding: 1vh .8vw; }
.tabla-jug.grande .fila-nombre { font-size: 1.15em; }
.tabla-jug.grande .fila-datos { font-size: .95em; }
.tabla-jug.grande .pts { font-size: 1.3em; }
.bitacora-tablero { flex: 1; overflow: hidden; }
.bitacora-tablero .bitacora { max-height: none; }
.bitacora-tablero li { font-size: .82em; }
.info-pie { color: var(--tenue); font-size: .8em; font-weight: 700; }
.fin h2 { font-size: 2em; color: #c2410c; }
.pantalla-completa { position: fixed; bottom: 10px; right: 10px; opacity: .7; }
.modo-tablero .lanz-caja { transform: scale(1.6); }
@media (orientation: portrait) {
  .tablero { flex-direction: column; }
  .tablero-lado { width: 100%; font-size: 15px; max-height: 45dvh; overflow-y: auto; }
}

/* ---------- Reloj de turno ---------- */
.reloj { font-weight: 900; font-variant-numeric: tabular-nums; background: #fff; border: 3px solid var(--borde); border-radius: 12px; padding: .15rem .55rem; white-space: nowrap; }
.reloj.bajo { border-color: var(--acento2); color: #c2410c; animation: latido 1s infinite; }
.reloj.agotado { border-color: var(--peligro); background: var(--peligro); color: #fff; animation: latido .6s infinite; }
.reloj.pausa { opacity: .6; animation: none; }
.reloj.grande { font-size: 2.4em; text-align: center; padding: .4vh 1vw; border-radius: 18px; }
@keyframes latido { 50% { transform: scale(1.06) } }
.orden-mesa { display: flex; flex-direction: column; gap: .45rem; }
.orden-mesa .btn { justify-content: flex-start; }
.orden-mesa .num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; background: var(--acento); color: var(--acento-txt); align-items: center; justify-content: center; font-weight: 900; }
.linea-banco { text-align: center; color: #fff; font-weight: 800; text-shadow: 0 1px 3px #0b2a4a; margin: .2rem .75rem; }

/* ---------- Piezas y cartas de desarrollo ilustradas ---------- */
.pieza { display: block; filter: drop-shadow(0 2px 2px #0002); }
.piezas-fila { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-top: .5rem; }
.piezas-fila:has(.chica) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pieza-tile { background: #fff; border-radius: 16px; padding: .5rem .3rem .55rem; display: flex; flex-direction: column; align-items: center; box-shadow: 0 3px 0 var(--borde); border: 2px solid var(--borde); }
.pieza-tile b { font-size: 1.6rem; line-height: 1.1; }
.pieza-tile small { color: var(--tenue); font-weight: 700; text-align: center; line-height: 1.15; }
.pieza-tile.chica { flex-direction: row; gap: .5rem; justify-content: center; padding: .45rem; }
.pieza-tile.chica small { text-align: left; }
.ico-grande { font-size: 1.7rem; }
.opcion-ico { width: 54px; display: inline-flex; justify-content: center; }

.fila-cartas-dev { display: flex; gap: .6rem; overflow-x: auto; padding: .4rem .1rem .7rem; }
.carta-dev {
  position: relative; flex-shrink: 0; width: 92px; aspect-ratio: 5/7; border-radius: 14px; border: 3px solid #fff; cursor: pointer;
  background: repeating-conic-gradient(from 0deg at 50% 38%, #ffffff22 0 10deg, transparent 10deg 20deg), radial-gradient(circle at 50% 38%, var(--c1), var(--c2) 75%);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c2) 70%, #000), var(--sombra);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 .25rem .45rem; font: inherit; color: #fff;
  transition: transform .15s;
}
.carta-dev:active { transform: translateY(3px) scale(.98); }
.carta-dev::before { content: ''; position: absolute; inset: 4px; border: 2px dashed #ffffff66; border-radius: 9px; pointer-events: none; }
.carta-dev.apagada { filter: saturate(.55) brightness(.92); }
.carta-dev-escena { position: absolute; top: 14%; left: 0; right: 0; height: 46%; }
.carta-dev-escena .principal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 2.4rem; filter: drop-shadow(0 3px 3px #0005); }
.carta-dev-escena .segundo { position: absolute; right: 12%; bottom: -4%; font-size: 1.15rem; filter: drop-shadow(0 2px 2px #0005); }
.carta-dev-nom { position: relative; font-size: .7rem; font-weight: 900; line-height: 1.1; text-align: center; text-shadow: 0 1px 2px #0009; background: #0003; border-radius: 8px; padding: .15rem .3rem; }
.carta-dev-n { position: absolute; top: -8px; right: -8px; background: #fff; color: var(--texto); border-radius: 99px; min-width: 1.9em; padding: .05rem .35rem; font-weight: 900; box-shadow: 0 2px 5px #0004; z-index: 1; }
.carta-dev-aviso { position: absolute; top: 6px; left: 6px; font-size: .6rem; font-weight: 900; background: #fff; color: var(--texto); border-radius: 99px; padding: .05rem .35rem; }
.carta-dev.grande { width: 150px; margin: .3rem auto .6rem; cursor: default; }
.carta-dev.grande .principal { font-size: 4rem; }
.carta-dev.grande .segundo { font-size: 1.8rem; }
.carta-dev.grande .carta-dev-nom { font-size: 1rem; }
.dorso-carta { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 3px solid #fff; background: repeating-linear-gradient(45deg, #c2410c 0 6px, #ea580c 6px 12px); box-shadow: 0 2px 5px #0004; }
.dorso-carta span { background: #fff; color: #c2410c; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; }
