/* Sala de juego: tokens, paneles de vidrio, jugadores, acción, dados y reglas. */
:root {
  --perla: #f3f6fb;
  --perla2: #ffffff;
  --tinta: #121a2b;
  --suave: #55607a;
  --linea: #d6deeb;
  --azul: #1c2b4b;
  --cian: #3fa9ff;
  --cian-luz: #9fd6ff;
  --oro: #c9973a;
  --oro-luz: #f2cf86;
  --vidrio: rgb(255 255 255 / .66);
  --vidrio-noche: rgb(16 24 44 / .62);
  --b1: #b5543c; --b2: #6fa35a; --b3: #7b5ea7; --b4: #e07a2f;
  --b5: #d9a92c; --b6: #2f9c95; --b7: #2f5fa7; --b8: #9c2f45;
  --f-ui: "Exo 2", "Arial Narrow", sans-serif;
  --f-texto: "Inter", system-ui, sans-serif;
  --radio: 18px;
  --sombra: 0 24px 60px #1c2b4b26, 0 3px 10px #1c2b4b14;
  --salida: cubic-bezier(.17, .84, .32, 1);
  --rebote: linear(0, 0.214 14.7%, 0.386 23.7%, 0.598 31.9%, 0.999 44.7%, 0.807 52.6%, 0.762 56%, 0.747 59.4%, 0.758 62.4%, 0.793 65.6%, 0.999 77.4%, 0.961 81.2%, 0.949 84.8%, 0.956 88%, 0.993 95.5%, 1);
}
* { box-sizing: border-box; min-width: 0; }
body { margin: 0; background: var(--perla); color: var(--tinta); font: 16px/1.55 var(--f-texto); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--cian); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--f-ui); font-weight: 700; letter-spacing: .02em; line-height: 1.1; margin: 0; }
img { max-inline-size: 100%; }
.envoltura { inline-size: min(1200px, 100% - 2rem); margin-inline: auto; }
.etiqueta { font: 700 .74rem/1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--cian); }

/* Portada */
.portada { position: relative; min-block-size: clamp(340px, 46vw, 520px); display: grid; align-items: end; overflow: clip; background: url("img/sala/ciudad-dia.webp") center 38% / cover no-repeat, #cfe3f7; }
.portada::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #f3f6fb00 30%, #f3f6fbd9 78%, var(--perla)); }
.portada .envoltura { position: relative; z-index: 1; padding-block: 2rem; }
.portada h1 { font-size: clamp(2.1rem, 5.4vw, 3.8rem); font-weight: 800; color: var(--azul); }
.portada p { max-inline-size: 60ch; margin: .6rem 0 0; color: #2c3852; font-size: 1.05rem; }

section.bloque { padding-block: 2.5rem 3.5rem; }
section.bloque > h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); color: var(--azul); }
section.bloque > p { color: var(--suave); margin: .5rem 0 1.6rem; max-inline-size: 66ch; }
.par { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr)); gap: 1.6rem; }
.par.ancha { grid-template-columns: 1fr; }
.propuesta { background: var(--perla2); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1.1rem; display: grid; gap: 1rem; align-content: start; }
.propuesta > header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-inline: .2rem; }
.propuesta h3 { font-size: 1.4rem; color: var(--azul); }
.propuesta .nota { color: var(--suave); font-size: .95rem; margin: 0; padding-inline: .2rem; }

/* Botones */
.boton { border: 1px solid #ffffff80; border-radius: 999px; padding: .8rem 1.6rem; background: linear-gradient(180deg, #2a4170, var(--azul)); color: #fff; font: 700 .95rem/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 0 0 1px #3fa9ff55, 0 8px 22px #1c2b4b55; transition: box-shadow .25s ease, background-color .25s ease, scale .15s ease; }
.boton:hover { box-shadow: 0 0 0 1px var(--cian), 0 0 22px #3fa9ff88, 0 8px 22px #1c2b4b55; }
.boton:active { scale: .97; }
.boton:disabled { opacity: .55; cursor: progress; box-shadow: none; }
.boton.oro { background: linear-gradient(180deg, #f6d58f, var(--oro)); color: #1b1407; box-shadow: 0 0 0 1px #f2cf8688, 0 8px 22px #8a5f1a55; }
.boton.oro:hover { box-shadow: 0 0 0 1px var(--oro-luz), 0 0 24px #f2cf86aa, 0 8px 22px #8a5f1a55; }

/* Mesa de los dados: recorte de la mesa de la sala */
.mesa { position: relative; block-size: 250px; border-radius: 14px; overflow: clip; perspective: 900px; display: flex; align-items: center; justify-content: center; gap: 2.4rem; background-size: 210% auto; background-repeat: no-repeat; }
.mesa.dia { background-image: url("img/sala/sala-dia.webp"); background-position: 50% 48%; }
.mesa.noche { background-image: url("img/sala/sala-noche.webp"); background-position: 50% 48%; }
.mesa::before { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 60px #0004; pointer-events: none; }
.lanzador { position: relative; z-index: 1; }
.sombra-dado { position: absolute; inset-inline: 2%; inset-block-end: -20px; block-size: 20px; border-radius: 50%; background: radial-gradient(#000a, #0000 70%); filter: blur(1px); }
.noche .sombra-dado { background: radial-gradient(#000d, #0000 70%); }
.dado { --l: 72px; --r: 13%; --hondo: calc(var(--l) / 2 - var(--l) * .04); position: relative; inline-size: var(--l); block-size: var(--l); transform-style: preserve-3d; transform: rotateX(var(--rx, -20deg)) rotateY(var(--ry, 25deg)); }
.cara, .nucleo { position: absolute; inset: 0; }
.cara { border-radius: var(--r); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 16%; place-items: center; backface-visibility: hidden; }
.nucleo { inset: .5px; border-radius: calc(var(--r) * .75); }
.cara .punto { inline-size: 72%; aspect-ratio: 1; border-radius: 50%; }
.f1 { transform: translateZ(calc(var(--l) / 2)); }
.f6 { transform: rotateY(180deg) translateZ(calc(var(--l) / 2)); }
.f2 { transform: rotateY(90deg) translateZ(calc(var(--l) / 2)); }
.f5 { transform: rotateY(-90deg) translateZ(calc(var(--l) / 2)); }
.f3 { transform: rotateX(90deg) translateZ(calc(var(--l) / 2)); }
.f4 { transform: rotateX(-90deg) translateZ(calc(var(--l) / 2)); }
.nucleo.f1 { transform: translateZ(var(--hondo)); }
.nucleo.f6 { transform: rotateY(180deg) translateZ(var(--hondo)); }
.nucleo.f2 { transform: rotateY(90deg) translateZ(var(--hondo)); }
.nucleo.f5 { transform: rotateY(-90deg) translateZ(var(--hondo)); }
.nucleo.f3 { transform: rotateX(90deg) translateZ(var(--hondo)); }
.nucleo.f4 { transform: rotateX(-90deg) translateZ(var(--hondo)); }

.cristal .cara { background: radial-gradient(120% 120% at 30% 25%, #ffffff, #eef6ff 55%, #d6e8fa); box-shadow: inset 0 0 0 1px #c9def3, inset 0 2px 2px #fff, inset -3px -4px 8px #8fb6dc66; }
.cristal .nucleo { background: #c3d9ef; }
.cristal .punto { background: radial-gradient(circle at 50% 30%, #0b3f80, #1c6fd0 55%, #4fa6f0); box-shadow: inset 0 2px 3px #0008, 0 1px 0 #ffffffcc; }
.cristal .f1 .punto { inline-size: 92%; background: radial-gradient(circle at 50% 30%, #0b3f80, #1c6fd0 50%, #6cb8ff); box-shadow: inset 0 3px 4px #0009, 0 1px 0 #fff, 0 0 10px #3fa9ff88; }

.titanio .cara { background: radial-gradient(120% 120% at 30% 25%, #3a5288, #22345c 55%, #141f38); box-shadow: inset 0 0 0 1px #0a1224, inset 0 2px 2px #ffffff2e, inset -3px -4px 8px #0008; }
.titanio .nucleo { background: #101a30; }
.titanio .punto { background: radial-gradient(circle at 50% 30%, #6b4a12, #c9973a 55%, #ffe3a3); box-shadow: inset 0 2px 3px #000a, 0 1px 0 #ffffff33, 0 0 7px #f2cf8666; }
.titanio .f1 { padding: 10%; }
.titanio .f1 svg { grid-area: 1 / 1 / 4 / 4; inline-size: 100%; block-size: 100%; }

.resultado { min-block-size: 1.6em; margin: 0; font: 700 1.15rem/1.4 var(--f-ui); letter-spacing: .03em; text-align: center; color: var(--azul); }
.resultado .par { color: var(--oro); }
.controles { display: flex; justify-content: center; }

/* Paneles de vidrio */
.vidrio { background: var(--vidrio); backdrop-filter: blur(12px) saturate(1.4); border: 1px solid #ffffffb0; box-shadow: 0 10px 30px #0b14282e, inset 0 0 0 1px #9fd6ff33; border-radius: 14px; }
.noche .vidrio { background: var(--vidrio-noche); color: #eef3ff; border-color: #f2cf8655; box-shadow: 0 10px 30px #0008, inset 0 0 0 1px #f2cf8622; }
.jugadores { position: absolute; inset-block-start: 3.5%; inset-inline-start: 2%; z-index: 2; inline-size: 24%; padding: .5em; display: grid; gap: .35em; list-style: none; margin: 0; }
.jugador { display: grid; grid-template-columns: 2.4em 1fr; align-items: center; gap: .5em; padding: .3em .4em; border-radius: 10px; }
.jugador.turno { background: #3fa9ff22; box-shadow: inset 0 0 0 1px #3fa9ff88; }
.noche .jugador.turno { background: #f2cf8622; box-shadow: inset 0 0 0 1px #f2cf8699; }
.jugador img { inline-size: 2.4em; block-size: 2.4em; border-radius: 50%; object-fit: cover; object-position: center 18%; box-shadow: 0 0 0 2px var(--aro); }
.jugador > div { min-inline-size: 0; }
.jugador b { display: flex; align-items: center; min-inline-size: 0; font: 700 1em/1.1 var(--f-ui); }
.jugador b i { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; }
.jugadores:has(li:nth-child(5)) { font-size: .86em; gap: .15em; }
.jugadores:has(li:nth-child(5)) .jugador small { display: none; }
.jugador b em { margin-inline-start: .35em; padding: .1em .45em; border-radius: 999px; background: #1c2b4b14; font: 600 .78em/1.2 var(--f-ui); font-style: normal; color: var(--suave); white-space: nowrap; }
.noche .jugador b em { background: #ffffff1a; color: #dfe6f5; }
.jugador span { font: 600 .9em/1.2 var(--f-ui); color: #2f4f86; font-variant-numeric: tabular-nums; }
.jugador small { display: inline-flex; align-items: center; gap: .2em; margin-inline-start: .5em; font: 600 .85em/1 var(--f-ui); color: var(--suave); }
.jugador small svg { inline-size: 1.1em; block-size: 1.1em; }
.noche .jugador small { color: #c6cfe4; }
.noche .jugador span { color: var(--oro-luz); }
.accion { position: absolute; inset-block-end: 4%; inset-inline-end: 2.5%; z-index: 2; display: grid; justify-items: center; gap: .45em; padding: .6em .8em; inline-size: min(15em, 22%); }
.pantalla:has(.guia) .accion { inset-block-end: 16%; }
.accion small { font: 600 .8em/1.3 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; opacity: .85; text-align: center; text-wrap: balance; }
.accion .boton { padding: .7em 1.2em; font-size: .95em; }

/* A: libro de reglas de vidrio a un lado */
.btn-reglas { position: absolute; inset-block-start: 3.5%; inset-inline-end: 2%; z-index: 3; display: inline-flex; align-items: center; gap: .45em; padding: .55em 1em; color: inherit; font: 700 1em/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; transition: box-shadow .25s ease; }
.btn-reglas:hover { box-shadow: 0 0 0 1px var(--cian), 0 0 18px #3fa9ff88; }
.btn-reglas svg { inline-size: 1.2em; block-size: 1.2em; color: var(--cian); }
.btn-reglas[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--cian); }
dialog.libro { position: absolute; inset: 2% 1.5% 2% auto; margin: 0; inline-size: min(340px, 40%); block-size: auto; max-block-size: none; padding: 0; z-index: 4; overflow: auto; overscroll-behavior: contain; color: var(--tinta); font-size: max(.78rem, 1em); }
dialog.libro[open] { display: flex; flex-direction: column; }
@media (prefers-reduced-motion: no-preference) {
  dialog.libro { transition: translate .35s var(--salida), opacity .35s ease, display .35s allow-discrete; }
  dialog.libro[open] { translate: 0 0; opacity: 1; @starting-style { translate: 24px 0; opacity: 0; } }
}
.libro-cabeza { position: sticky; inset-block-start: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8em 1em; background: linear-gradient(90deg, #1c2b4bf0, #2a4170e6); color: #fff; }
.libro-cabeza h1 { font-size: 1.15em; letter-spacing: .1em; text-transform: uppercase; }
.cerrar { border: 0; background: #ffffff1f; color: #fff; border-radius: 8px; inline-size: 2.2rem; block-size: 2.2rem; display: grid; place-items: center; flex: none; transition: background-color .2s ease; }
.cerrar:hover { background: #ffffff3a; }
.libro-cuerpo { padding: .6em 1em 1.1em; display: grid; gap: .2em; }
.libro details { border-block-end: 1px solid #1c2b4b1f; }
.libro summary { cursor: pointer; padding: .6em 0; font: 700 1em/1.3 var(--f-ui); letter-spacing: .04em; color: var(--azul); }
.libro summary:hover { color: #1765b8; }
.libro details ul { margin: 0 0 .7em; padding-inline-start: 1.1em; font-size: .95em; color: #26324a; }
.libro .ahora { background: linear-gradient(135deg, #e2f2ffee, #fff7e2ee); border: 1px solid #9fd6ff; border-radius: 10px; padding: .7em .8em; font-size: .95em; }
.libro .ahora strong { font-family: var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: #1765b8; }

/* B: guía abajo con cartas */
.guia { position: absolute; inset-inline: 2%; inset-block-end: 3%; z-index: 3; display: grid; gap: .5em; }
.consejo { display: flex; align-items: center; gap: .7em; padding: .5em .6em .5em .7em; }
.consejo .fase { flex: none; font: 700 .85em/1 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; background: linear-gradient(180deg, #f6d58f, var(--oro)); color: #1b1407; border-radius: 6px; padding: .45em .65em; }
.consejo p { margin: 0; flex: 1; }
.consejo button { flex: none; border: 1px solid #f2cf8688; border-radius: 999px; padding: .5em 1em; background: #ffffff14; color: var(--oro-luz); font: 700 .9em/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; transition: background-color .2s ease, box-shadow .2s ease; }
.consejo button:hover { background: #f2cf8626; box-shadow: 0 0 14px #f2cf8666; }
.cartas-reglas { display: flex; gap: .6em; overflow-x: auto; scroll-snap-type: x mandatory; padding: .2em .1em .5em; overscroll-behavior-x: contain; scrollbar-color: #f2cf8699 #0000; }
.cartas-reglas[hidden] { display: none; }
.carta-regla { flex: 0 0 clamp(118px, 22cqi, 180px); scroll-snap-align: start; border-radius: 12px; overflow: clip; background: #101a30ee; color: #eef3ff; border: 1px solid #f2cf8655; box-shadow: 0 8px 20px #0009; font-size: .9em; }
.carta-regla img { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.carta-regla h4 { margin: .5em .65em .2em; font-size: 1.05em; color: var(--oro-luz); letter-spacing: .05em; }
.carta-regla p { margin: 0 .65em .7em; line-height: 1.35; color: #d5ddef; }
.carta-regla.activa { border-color: var(--oro-luz); box-shadow: 0 0 0 2px var(--oro-luz), 0 0 18px #f2cf8677; }

.fases { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .9rem; color: var(--suave); margin-block-end: 1.2rem; }
.fases button { border: 1px solid var(--linea); background: #fff; border-radius: 999px; padding: .4rem .9rem; font: 600 .85rem/1 var(--f-ui); letter-spacing: .06em; transition: background-color .2s ease, border-color .2s ease; }
.fases button:hover { border-color: var(--cian); }
.fases button[aria-pressed="true"] { background: var(--azul); color: #fff; border-color: var(--azul); }

@media (width < 640px) {
  .pantalla { aspect-ratio: 9 / 16; font-size: clamp(.62rem, 3.2cqi, .85rem); }
  .jugadores { inset-inline: 3% 27%; inline-size: auto; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(50% - .2em); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; inset-block-start: 2%; }
  .jugadores li { scroll-snap-align: start; }
  .jugador b { flex-direction: column; align-items: flex-start; gap: .15em; }
  .jugador b em { margin-inline-start: 0; }
  .btn-reglas { inset-block-start: 2%; inset-inline-end: 3%; flex-direction: column; padding: .7em .8em; font-size: .85em; }
  .accion { inset-block-end: 3%; inset-inline: 3%; inline-size: auto; grid-template-columns: 1fr auto; align-items: center; }
  .accion small { text-align: start; }
  .consejo { flex-wrap: wrap; row-gap: .35em; }
  .consejo p { order: 3; flex-basis: 100%; font-size: .95em; line-height: 1.3; }
  .consejo button { margin-inline-start: auto; }
  dialog.libro { inset: 2%; inline-size: auto; }
  .guia { inset-block-end: 2%; }
  .pantalla:has(.guia) .accion { inset-block-end: 3%; }
  .pantalla:has(.guia) .guia { inset-block-end: 12%; }
  .carta-regla { flex-basis: 62cqi; }
  .mesa { gap: 1.4rem; background-size: 330% auto; }
}

footer.pie { padding-block: 2rem 3rem; color: var(--suave); font-size: .9rem; border-block-start: 1px solid var(--linea); }
