:root {
  color-scheme: light;
  font-family: Manrope, "Segoe UI Variable", system-ui, sans-serif;
  color: #16211d;
  background: #dfe9e3;
  font-synthesis: none;
  --verde: #16211d;
  --claro: #ffffff;
  --linea: rgba(255,255,255,.58);
  --acento: rgba(255,255,255,.62);
  --muted: #526159;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid #318456; outline-offset: 3px; }
[hidden] { display: none !important; }
.topbar {
  max-width: 1660px; margin: auto; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; padding: 14px clamp(15px, 3vw, 52px);
}
.marca { font-size: 2rem; letter-spacing: -.085em; font-weight: 760; text-decoration: none; color: inherit; display: inline-flex; align-items: baseline; }
.marca-punto { width: .22em; height: .22em; margin-inline-start: .16em; border-radius: 50%; background: #418058; }
.navegacion { display: flex; align-items: center; gap: 5px; }
.navegacion a { color: var(--muted); font-size: .92rem; font-weight: 600; text-decoration: none; padding: 8px 14px; border-radius: 50px; }
.navegacion a[aria-current] { color: var(--verde); box-shadow: inset 0 0 0 1px var(--linea); background: var(--claro); }
.navegacion a:hover { background: #f7faf4; }
.operador { color: #496454; font-size: .72rem; font-weight: 700; letter-spacing: .13em; }
.tablero {
  max-width: 1660px; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr) clamp(285px, 24vw, 344px);
  gap: 15px; padding: 0 clamp(15px, 3vw, 52px) 18px; align-items: start;
}
.vitrina { min-width: 0; background: #f7f9f7; color: #1a2825; border-radius: 18px; overflow: hidden; position: relative; isolation: isolate; }
.vitrina canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vitrina :focus-visible { outline-color: #317952; outline-offset: -3px; }
.barra-lateral { min-width: 0; display: grid; gap: 13px; }
.panel { background: var(--claro); border: 1px solid var(--linea); border-radius: 18px; padding: 17px 18px; min-width: 0; box-shadow: 0 5px 22px #1a282506; }
.panel h2 { margin: 0 0 12px; font-size: 1.1rem; font-weight: 720; letter-spacing: -.02em; }
.boton, .direccion, .deck-tecla, .deck-captura {
  min-height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  border: 1px solid var(--linea); border-radius: 9px; padding: 0 .625rem;
  background: var(--claro); color: var(--verde); font-size: .8125rem; font-weight: 600;
}
:is(.boton, .direccion, .deck-tecla, .deck-captura):hover:not(:disabled) { background: #edf3ed; }
.boton-primario, .boton[aria-pressed="true"], .boton[aria-expanded="true"], .deck-tecla[data-activa="true"], .deck-captura:not(:disabled) {
  background: var(--verde); border-color: var(--verde); color: #fff;
}
.boton-primario:hover:not(:disabled), .boton[aria-pressed="true"]:hover, .boton[aria-expanded="true"]:hover, .deck-captura:not(:disabled):hover { background: #285547; }
:is(.boton, .direccion, .deck-tecla, .deck-captura):disabled { opacity: .5; cursor: default; }
.enlace { color: #265e41; font-weight: 700; text-underline-offset: 3px; }
.lab-vitrina { min-height: min(730px, calc(100svh - 98px)); }
.lab-titulo { position: absolute; top: 24px; left: 27px; pointer-events: none; }
.lab-titulo h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -.05em; font-weight: 670; }
.lab-titulo p, .indicacion-canvas { margin: 5px 0 0; color: #526159; font-size: .88rem; }
.indicacion-canvas { position: absolute; bottom: 17px; left: 15px; right: 15px; text-align: center; pointer-events: none; }
.lab-direcciones { display: grid; width: fit-content; margin: 4px auto 16px; gap: 5px; grid-template: repeat(2,46px) / repeat(3,46px); touch-action: none; }
.direccion { font-size: 1.15rem; padding: 0; }
.arriba { grid-area: 1/2; }.izquierda { grid-area: 2/1; }.abajo { grid-area: 2/2; }.derecha { grid-area: 2/3; }
.rango { display: grid; grid-template-columns: 65px 1fr; align-items: center; gap: 8px; margin: 12px 0; font-weight: 620; }
.rango input { min-width: 0; width: 100%; accent-color: #397553; }
.acciones-lab { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ficha-datos { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: .89rem; color: var(--muted); }

.juego .topbar, .juego .tablero { max-width: none; padding-inline: clamp(12px, 1.8vw, 65px); }
.juego .tablero { grid-template-columns: minmax(0, 1fr); position: relative; }
.cabecera-acciones { display: flex; align-items: center; justify-content: end; gap: .375rem; }
.identidad { display: flex; align-items: baseline; gap: .9rem; }
.identidad h1 { margin: 0; color: var(--muted); font-weight: 540; font-size: 1rem; letter-spacing: -.025em; white-space: nowrap; }
.juego .marca { font-size: 2.4rem; line-height: 1; }
.maquina-panel { overflow: hidden; min-width: 0; border: 1px solid var(--linea); background: var(--claro); border-radius: 18px; box-shadow: 0 5px 22px #1a282506; }
.escenario { height: max(490px, calc(100svh - 145px)); border-radius: 0; }
.escenario canvas { cursor: default; }
.marcador { display: flex; position: absolute; top: 1rem; left: 1rem; margin: 0; padding: .6rem 0; gap: 0;
  pointer-events: none; background: #fbfcfae0; backdrop-filter: blur(14px) saturate(1.18); border: 1px solid #ffffffb8;
  border-radius: 12px; box-shadow: 0 5px 19px #132e2b22; }
.marcador div { padding: 0 .75rem; min-width: 4.1rem; }
.marcador div + div { border-left: 1px solid var(--linea); }
.marcador dt { color: var(--muted); font-size: .77rem; line-height: 1.25; }
.marcador dd { font-variant-numeric: tabular-nums; margin: .14rem 0 0; font-size: 1.45rem; line-height: 1.1; font-weight: 710; letter-spacing: -.05em; }
.marcador dd[data-urgente="true"] { color: #a13b2a; }
.ronda-jugador { position: absolute; top: 4.65rem; left: 1rem; margin: 0; padding: .26rem .48rem; max-width: min(21rem, 75%);
  color: var(--verde); background: #fbfcfaeb; border-radius: 7px; font-size: .75rem; font-weight: 620; pointer-events: none; }
.ronda-jugador:empty { display: none; }
.pantalla-completa { position: absolute; top: 1rem; right: 1rem; width: 2.5rem; padding: 0; background: #fbfcfae8; }
.pantalla-completa svg { width: 1.15rem; height: 1.15rem; }
.mensaje-juego { position: absolute; bottom: .8rem; left: 50%; translate: -50%; max-width: calc(100% - 1.8rem); margin: 0; padding: .44rem .75rem;
  border-radius: 8px; background: #fbfcfaed; color: var(--verde); border: 1px solid var(--linea); font-weight: 610; font-size: .86rem; text-align: center; pointer-events: none; }
.mensaje-juego:empty { display: none; }
.resultado { position: absolute; inset: auto auto 2.6rem 50%; translate: -50%; width: min(calc(100% - 2rem), 24rem); text-align: center; background: #fbfcfaf8;
  border: 1px solid var(--linea); border-radius: 16px; box-shadow: 0 16px 42px #173f342f; padding: 1.1rem; }
.resultado h2 { margin: 0; letter-spacing: -.045em; }
.resultado p { margin: .45rem 0 .85rem; color: var(--muted); }
.confirmacion {
  position: absolute; right: 1.2rem; bottom: 1.2rem; max-width: min(24rem, 75%); display: grid; gap: .16rem;
  background: #153d31e6; color: #fff; border: 1px solid #d9fff171; border-radius: 12px; padding: .68rem .88rem;
  box-shadow: 0 7px 28px #003d2b45; backdrop-filter: blur(13px); pointer-events: none;
}
.confirmacion span { font-size: .85rem; color: #effbf1; }
.control-deck {
  display: flex; align-items: center; gap: .65rem; padding: .48rem .75rem; border-top: 1px solid var(--linea); background: var(--claro);
}
.deck-movimiento, .opciones-vista { display: flex; gap: .34rem; align-items: center; }
.deck-movimiento { touch-action: none; }
.opciones-vista { margin-left: auto; }
.deck-tecla { min-width: 2.5rem; padding: 0; font-size: 1.1875rem; }
.deck-captura { white-space: nowrap; }
.deck-captura kbd { margin-left: .2rem; color: #d7ebdc; font-family: inherit; font-size: .67rem; font-weight: 520; }
.deck-captura:disabled kbd { color: var(--muted); }
.opciones-vista .boton, .calidad select { min-height: 2.5rem; font-size: .8125rem; white-space: nowrap; }
.calidad { display: flex; align-items: center; gap: .35rem; margin-left: .16rem; color: var(--muted); font-size: .79rem; }
.opciones-vista select, .partida-panel select, .partida-panel input { border: 1px solid var(--linea); background: #fff; color: #1a2825; border-radius: 8px; padding: .44rem .5rem; }
.panel-cabecera { display: flex; align-items: baseline; justify-content: space-between; gap: .45rem; margin-bottom: .65rem; }
.panel-cabecera h2 { margin: 0; }
.conexion { border-radius: 50px; padding: .2rem .5rem; background: #edf0ec; color: #53665c; font-weight: 680; font-size: .72rem; white-space: nowrap; }
.conexion[data-conectado="true"] { background: #e1eee4; color: var(--verde); }
.muted { color: var(--muted); font-size: .85rem; }
.qr-disposicion { display: flex; align-items: center; gap: .75rem; }
.qr-marco { display: grid; background: white; border-radius: 8px; border: 1px solid var(--linea); padding: .3rem; flex: 0 0 auto; overflow: hidden; }
.qr-marco img { display: block; width: clamp(68px, 7vw, 122px); height: auto; aspect-ratio: 1; }
.codigo-etiqueta { display: block; color: var(--muted); font-size: .76rem; }
.codigo-mando { display: block; color: var(--verde); font-size: clamp(1.3rem, 2.05vw, 2.05rem); letter-spacing: .085em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mando-ayuda { margin: .35rem 0 0; line-height: 1.3; }
.acciones-mando { margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.acciones-mando:has(> :only-child[hidden]), .acciones-mando:not(:has(> :not([hidden]))) { display: none; }
.enlace-boton { border: 0; background: transparent; padding: .15rem 0; text-decoration: underline; text-align: left; font-size: .8rem; }
.partida-panel form { display: grid; gap: .35rem; }
.partida-panel label { margin-top: .1rem; color: var(--muted); font-size: .81rem; font-weight: 610; }
.partida-panel input, .partida-panel select { width: 100%; min-height: 2.25rem; }
.reglas { margin: .25rem 0 .35rem; line-height: 1.3; }
.boton-ancho { width: 100%; }
.ranking-panel p { margin: 0; }
.tabla-marco { overflow-x: auto; max-height: 11.5rem; }
.tabla-marco table { width: 100%; border-collapse: collapse; font-size: .78rem; font-variant-numeric: tabular-nums; table-layout: fixed; }
.tabla-marco th, .tabla-marco td { text-align: right; padding: .3rem .12rem; border-bottom: 1px solid var(--linea); }
.tabla-marco th:first-child, .tabla-marco td:first-child { text-align: left; width: 37%; overflow-wrap: anywhere; }
.tabla-marco th { color: var(--muted); font-weight: 620; }
.controles-evento { position: absolute; top: .65rem; right: max(12px, 2.6vw); width: min(24rem, calc(100% - 36px)); z-index: 20;
  padding: .55rem; border: 1px solid #fff9; border-radius: 18px; background: #eef3eddf;
  box-shadow: 0 18px 52px #122c2947; backdrop-filter: blur(18px) saturate(1.18); max-height: calc(100% - 4.25rem); overflow: auto; }
.controles-evento > .panel { background: #fbfcfaf3; }
.cerrar-panel { justify-self: end; }
@media (min-width: 2200px) {
  :root:has(.juego) { font-size: clamp(19px, .77vw, 31px); }
  .juego .topbar, .juego .tablero { padding-inline: 1.4vw; }
  .juego .topbar { padding-block: .62rem; }
  .escenario { height: calc(100svh - 5.65rem); }
  .juego .panel { padding: .7rem; border-radius: .7rem; }
  .juego .barra-lateral { gap: .6rem; }
  .qr-marco img { width: 4.6rem; }
  .tabla-marco { max-height: 14rem; }
}
@media (max-width: 860px) {
  .tablero { grid-template-columns: 1fr; }
  .barra-lateral { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
  .lab-vitrina { min-height: max(395px, 66svh); }
  .juego .tablero { grid-template-columns: minmax(0, 1fr); }
  .controles-evento { grid-template-columns: minmax(0, 1fr); }
  .escenario { height: clamp(400px, 65svh, 640px); }
  .control-deck { flex-wrap: wrap; }
}
@media (max-width: 515px) {
  .topbar { padding: 9px 12px; gap: 8px; }
  .topbar .operador { display: none; }
  .navegacion a { padding: 7px 9px; font-size: .82rem; }
  .tablero { padding-inline: 9px; }
  .lab-titulo { top: 12px; left: 15px; }
  .vitrina { border-radius: 15px; }
  .escenario { border-radius: 0; }
  .juego .marca { font-size: 1.8rem; }
  .juego .topbar { flex-wrap: wrap; }
  .cabecera-acciones { margin-left: auto; }
  .identidad { display: block; }
  .identidad h1 { font-size: .77rem; }
  .marcador { top: .55rem; left: .55rem; }
  .marcador div { min-width: 3.45rem; padding-inline: .45rem; }
  .marcador dd { font-size: 1.13rem; }
  .ronda-jugador { top: 3.65rem; left: .55rem; }
  .pantalla-completa { top: .55rem; right: .55rem; }
  .deck-captura kbd, .calidad > span { display: none; }
  .control-deck { gap: .5rem; }
  .opciones-vista { margin-left: 0; }
}

/* Sistema visual premium del juego */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.glass,
.juego .marcador,
.juego .control-deck,
.juego .controles-evento {
  background: linear-gradient(135deg, rgba(255,255,255,.58), rgba(255,255,255,.2) 45%, rgba(255,255,255,.18) 65%, rgba(255,255,255,.42));
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 0 0 1px rgba(255,255,255,.55),
    inset 0 0 14px 3px rgba(255,255,255,.35),
    0 18px 44px -18px rgba(20,35,30,.35);
}

.juego {
  min-height: 100svh;
  overflow: hidden;
  color: #16211d;
  background:
    radial-gradient(circle at 84% 7%, rgba(78,138,102,.32), transparent 31%),
    radial-gradient(circle at 9% 88%, rgba(93,185,224,.18), transparent 30%),
    #e7eee9;
}

.juego .topbar {
  position: fixed;
  top: clamp(14px, 1.6vw, 30px);
  left: clamp(16px, 2.1vw, 44px);
  right: clamp(16px, 2.1vw, 44px);
  z-index: 40;
  max-width: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}

.juego .identidad,
.juego .cabecera-acciones {
  pointer-events: auto;
}

.juego .identidad {
  display: none;
}

.juego .marca {
  color: #16211d;
  font-size: clamp(1.65rem, 2.2vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -.07em;
}

.juego .identidad h1 {
  color: rgba(22,33,29,.68);
  font-size: clamp(.72rem, .8vw, 1rem);
  font-weight: 700;
  letter-spacing: .01em;
}

.juego .cabecera-acciones {
  display: flex;
  align-items: center;
  gap: .38rem;
  padding: 6px;
  margin-left: auto;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.6), rgba(255,255,255,.24));
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.94), inset 0 0 0 1px rgba(255,255,255,.48), 0 16px 34px -19px rgba(20,35,30,.42);
}

.boton-icono,
.juego .deck-tecla,
.juego .deck-captura {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.32);
  color: #16211d;
  transition: transform .2s, background-color .2s, box-shadow .2s;
}

.boton-icono svg,
.juego .deck-tecla svg,
.juego .deck-captura svg,
.juego .calidad > svg,
.juego .marcador svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.boton-icono:hover:not(:disabled),
.juego .deck-tecla:hover:not(:disabled),
.juego .deck-captura:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255,255,255,.72);
}

.boton-icono[aria-pressed="true"],
.boton-icono[aria-expanded="true"],
.juego .deck-tecla[data-activa="true"] {
  background: #fff;
  box-shadow: 0 7px 18px -10px rgba(20,35,30,.58);
}

.juego .tablero {
  position: fixed;
  inset: 0;
  display: block;
  max-width: none;
  padding: 0;
}

.juego .maquina-panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #e8efea;
  box-shadow: none;
}

.juego .escenario {
  width: 100%;
  height: 100svh;
  border-radius: 0;
  background: #e8efea;
}

.juego .marcador {
  top: clamp(14px, 1.6vw, 30px);
  left: clamp(16px, 2.1vw, 44px);
  display: flex;
  align-items: center;
  gap: 2px;
  height: 60px;
  padding: 4px 6px;
  border: 0;
  border-radius: 999px;
  pointer-events: none;
}

.juego .marcador div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: .4rem;
  padding: .52rem .68rem;
  border-radius: 999px;
}

.juego .marcador div + div {
  border: 0;
}

.juego .marcador svg {
  width: 17px;
  height: 17px;
  opacity: .68;
}

.juego .marcador dd {
  margin: 0;
  font-size: clamp(1rem, 1.35vw, 1.45rem);
  font-weight: 760;
  letter-spacing: -.04em;
}

.juego .ronda-jugador {
  display: none;
}

.juego .pantalla-completa {
  position: static;
  top: auto;
  right: auto;
  width: 48px;
  height: 48px;
  padding: 0;
}

.juego .mensaje-juego {
  bottom: clamp(86px, 9vh, 112px);
  max-width: min(88vw, 28rem);
  padding: .48rem .8rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  color: #16211d;
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 14px 34px -20px rgba(20,35,30,.55);
  font-size: .78rem;
}

.juego .control-deck {
  position: fixed;
  left: 50%;
  bottom: clamp(14px, 2vw, 28px);
  z-index: 32;
  display: flex;
  align-items: center;
  width: max-content;
  max-width: calc(100vw - 24px);
  gap: .38rem;
  padding: 7px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 999px;
}

.juego .deck-movimiento,
.juego .opciones-vista {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.juego .opciones-vista {
  margin-left: 0;
}

.juego .deck-tecla {
  width: 44px;
  height: 44px;
}

.juego .deck-tecla svg {
  width: 19px;
  height: 19px;
}

.juego .deck-captura {
  width: 54px;
  height: 54px;
  margin-inline: .12rem;
  background: #16211d;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 8px 18px -9px rgba(9,31,23,.8);
}

.juego .deck-captura:not(:disabled) {
  background: #16211d;
  color: #fff;
}

.juego .deck-captura:disabled,
.juego .boton-icono:disabled {
  opacity: .42;
}

.juego .deck-captura svg {
  width: 25px;
  height: 25px;
}

.juego .calidad {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: .25rem;
  margin: 0;
  padding: 0 .38rem 0 .65rem;
  border-radius: 999px;
  color: #16211d;
}

.juego .calidad > svg {
  width: 18px;
  height: 18px;
}

.juego .calidad select {
  min-height: 34px;
  max-width: 8.7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  color: #16211d;
  padding: 0 1.45rem 0 .55rem;
  font-size: .75rem;
  font-weight: 700;
}

.juego .controles-evento {
  position: fixed;
  top: clamp(76px, 7vw, 112px);
  right: clamp(16px, 2.1vw, 44px);
  z-index: 50;
  display: grid;
  width: min(24rem, calc(100vw - 32px));
  max-height: calc(100svh - 9rem);
  gap: 10px;
  padding: 10px;
  overflow: auto;
  border: 0;
  border-radius: 26px;
}

.juego .controles-evento > .panel {
  border: 0;
  border-radius: 20px;
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92);
}

.juego .cerrar-panel {
  justify-self: end;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.56);
}

.juego .panel h2 {
  color: #16211d;
  font-weight: 800;
}

.juego .boton {
  min-height: 2.7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  box-shadow: inset 0 0 0 1px rgba(22,33,29,.08);
  color: #16211d;
}

.juego .boton-primario {
  background: #16211d;
  color: #fff;
}

.juego .partida-panel input,
.juego .partida-panel select {
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 0 0 1px rgba(22,33,29,.1);
}

.juego .resultado {
  bottom: 6.5rem;
  border: 0;
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  backdrop-filter: blur(22px) saturate(1.55);
}

.juego .confirmacion {
  right: clamp(16px, 2.1vw, 44px);
  bottom: clamp(86px, 9vh, 112px);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 18px;
  background: rgba(22,33,29,.82);
}

@media (min-width: 2200px) {
  .juego .boton-icono,
  .juego .pantalla-completa {
    width: 64px;
    height: 64px;
  }

  .juego .deck-tecla {
    width: 58px;
    height: 58px;
  }

  .juego .deck-captura {
    width: 72px;
    height: 72px;
  }

  .juego .cabecera-acciones,
  .juego .marcador {
    height: 76px;
  }

  .juego .control-deck {
    gap: .5rem;
    padding: 10px;
  }
}

@media (max-width: 760px) {
  .juego {
    overflow: auto;
  }

  .juego .topbar {
    top: 12px;
    left: 14px;
    right: 14px;
  }

  .juego .identidad h1 {
    display: none;
  }

  .juego .marca {
    font-size: 1.7rem;
  }

  .juego .cabecera-acciones {
    padding: 4px;
    height: 52px;
  }

  .juego .boton-icono,
  .juego .pantalla-completa {
    width: 44px;
    height: 44px;
  }

  .juego .marcador {
    top: 12px;
    left: 12px;
    height: 52px;
  }

  .juego .marcador div {
    padding: .42rem .48rem;
  }

  .juego .marcador svg {
    display: none;
  }

  .juego .control-deck {
    bottom: 10px;
    gap: .18rem;
    padding: 6px;
  }

  .juego .deck-tecla {
    width: 39px;
    height: 39px;
  }

  .juego .deck-captura {
    width: 48px;
    height: 48px;
  }

  .juego .calidad {
    display: none;
  }

  .juego .controles-evento {
    top: 68px;
    right: 8px;
    width: calc(100vw - 16px);
    max-height: calc(100svh - 78px);
  }
}

/* ===== Botonera inferior: estilo del panel del mando (grafito + turquesa), alto contraste =====
   Antes era cristal claro sobre fondo claro y el botón principal deshabilitado bajaba al 42 % de opacidad:
   quedaba blanco con el icono casi invisible. Ahora la barra es oscura, los iconos blancos y el botón
   principal muestra su texto (Iniciar partida / Capturar) también cuando está en espera. */
.juego .control-deck {
  gap: .4rem;
  padding: 8px;
  background: linear-gradient(180deg, rgba(30, 36, 40, .94), rgba(10, 13, 15, .96));
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 40px -16px rgba(0, 0, 0, .7);
}
.juego .deck-tecla,
.juego .opciones-vista .boton-icono {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 35% 25%, #3a4248 0%, #1b2024 60%, #121518 100%);
  color: #f2f7f5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -2px 0 rgba(0, 0, 0, .5), 0 4px 10px -4px rgba(0, 0, 0, .8);
  opacity: 1;
}
.juego .deck-tecla svg,
.juego .opciones-vista .boton-icono svg { width: 20px; height: 20px; stroke-width: 2.2; }
.juego .deck-tecla:hover:not(:disabled),
.juego .opciones-vista .boton-icono:hover:not(:disabled) { background: radial-gradient(120% 120% at 35% 25%, #4a545b 0%, #242a2f 60%, #16191c 100%); }
.juego .deck-tecla[data-activa="true"],
.juego .deck-tecla:active:not(:disabled) {
  background: radial-gradient(120% 120% at 50% 40%, #1f5f53 0%, #0f2f29 100%);
  color: #6ff5d9;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 0 0 1px rgba(25, 217, 180, .55), 0 0 14px rgba(25, 217, 180, .35);
}
.juego .opciones-vista .boton-icono[aria-pressed="true"] { color: #6ff5d9; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 1px rgba(25, 217, 180, .6); }
.juego .deck-tecla:disabled,
.juego .opciones-vista .boton-icono:disabled { opacity: .55; }

/* Botón principal: el color comunica el estado; el texto queda para lectores de pantalla. */
.juego .deck-captura {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  margin-inline: .2rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #f06461 0%, #cf393d 56%, #a3212a 100%);
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 -2px 0 rgba(0, 0, 0, .22), 0 7px 13px -8px rgba(0, 0, 0, .9);
  opacity: 1;
}
.juego .deck-captura[data-estado="espera"] {
  background: linear-gradient(180deg, #f06461 0%, #cf393d 56%, #a3212a 100%);
  color: #fff;
}
.juego .deck-captura[data-estado="espera"]:not(:disabled):hover {
  background: linear-gradient(180deg, #f77a75 0%, #dc474b 56%, #ad2830 100%);
}
.juego .deck-captura[data-estado="jugando"] {
  background: linear-gradient(180deg, #58d47b 0%, #2da45a 56%, #19733f 100%);
  color: #fff;
}
.juego .deck-captura[data-estado="jugando"]:not(:disabled):hover {
  background: linear-gradient(180deg, #70df8e 0%, #38b565 56%, #1d7c46 100%);
}
.juego .deck-captura:not(:disabled):active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .3), 0 4px 9px -7px rgba(0, 0, 0, .85);
}
.juego .deck-captura svg { width: 26px; height: 26px; stroke-width: 2.4; }
/* Durante una maniobra se bloquea el clic, pero el verde sigue indicando que la partida continúa. */
.juego .deck-captura:disabled {
  opacity: 1;
  cursor: default;
}
.juego .control-deck :focus-visible { outline: 2px solid #3cf0cb; outline-offset: 2px; }
.juego .calidad { background: #1b2024; color: #f2f7f5; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.juego .calidad select { color: #f2f7f5; background: transparent; }
.juego .calidad select option { color: #111; }

@media (max-width: 760px) {
  .juego .deck-tecla, .juego .opciones-vista .boton-icono { width: 40px; height: 40px; }
  .juego .deck-captura { width: 48px; height: 48px; }
}
@media (min-width: 2200px) {
  .juego .deck-tecla, .juego .opciones-vista .boton-icono { width: 60px; height: 60px; }
  .juego .deck-captura { width: 74px; height: 74px; }
  .juego .deck-captura svg { width: 30px; height: 30px; }
}

/* ===== Pantalla de premio ===== */
.premio { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; cursor: pointer; --premio: #1f8a5b; }
.premio[hidden] { display: none; }
.premio-velo { position: absolute; inset: 0;
  background: radial-gradient(70% 60% at 50% 45%, color-mix(in srgb, var(--premio) 55%, #0b1411) 0%, color-mix(in srgb, var(--premio) 22%, #050807) 100%);
  opacity: .9; -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  animation: premio-velo .35s ease-out both; }
.premio-contenido { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  width: min(92vw, 560px); height: min(94vh, 900px); padding: 3vh 0; color: #fff; }
/* Tipografía de palo seco, moderna (nunca cursiva): la misma familia que el resto de la interfaz. */
.premio-felicidades { margin: 0; font-family: inherit; font-weight: 800; font-size: clamp(40px, 7.5vh, 78px); line-height: 1;
  letter-spacing: -.02em; text-shadow: 0 4px 24px rgba(0, 0, 0, .35); animation: premio-texto .5s .25s ease-out both; }
.premio-sub { margin: 1vh 0 0; font-weight: 600; font-size: clamp(15px, 2.4vh, 22px); letter-spacing: .14em; text-transform: uppercase; opacity: .9;
  animation: premio-texto .5s .4s ease-out both; }
.premio-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; margin: 1vh 0;
  filter: drop-shadow(0 24px 36px rgba(0, 0, 0, .45));
  animation: premio-sube .7s .45s cubic-bezier(.2, .9, .25, 1.15) both, premio-flota 3.2s 1.15s ease-in-out infinite; }
.premio-titulo { margin: 0; max-width: 22ch; font-weight: 800; font-size: clamp(24px, 4.4vh, 42px); line-height: 1.15;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .35); animation: premio-texto .5s .8s ease-out both; }
@keyframes premio-velo { from { opacity: 0; } to { opacity: .9; } }
@keyframes premio-texto { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes premio-sube { from { opacity: 0; transform: translateY(32vh) scale(.35) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes premio-flota { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-1.6vh) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .premio * { animation-duration: .01s !important; animation-iteration-count: 1 !important; } }

/* ===== Pantalla de carga (hasta que toda la escena está lista) ===== */
.carga { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: #e4e9e7; color: #2c3a35; font-weight: 600; letter-spacing: .04em; transition: opacity .6s ease; }
.carga p { margin: 0; font-size: 15px; }
.carga.lista { opacity: 0; pointer-events: none; }
.carga-anillo { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(20, 120, 80, .18); border-top-color: #12a45c;
  animation: carga-gira .9s linear infinite; }
@keyframes carga-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .carga-anillo { animation-duration: 2.4s; } }
