/* Geolite - Ajustes v0.3.2: seis pestanas (General, Pantalla, Sonido, Controles, Accesibilidad, Datos), la pestana Controles (teclas, raton,
   dibujo del mando, sticks) y la ventana del crupier para reasignar. Sin scroll a 1280x720 en 12 idiomas; en movil se apila. */

/* seis pestanas: un poco mas juntas que las cinco de antes */
@media (min-width: 901px) {
  .set-nav { gap: 10px; }
  .set-nav button { padding: 13px 18px; gap: 16px; }
  .set-nav-ic .ic { width: 40px; height: 40px; }
  .set-nav-t b { font-size: 22px; }
  .set-nav-t small { font-size: 13px; }
}

/* piezas comunes */
.rs-c { display: flex; align-items: center; gap: 10px; flex: none; }
.mini-btn { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; padding: 7px 12px; border-radius: 9px; color: var(--brass-lt); box-shadow: inset 0 0 0 1.5px rgba(242, 233, 214, .22); background: rgba(0, 0, 0, .22); transition: background .15s, color .15s, transform .12s; }
.mini-btn:hover { background: #f8b449; color: #16241c; } .mini-btn:active { transform: scale(.96); }
.mini-btn.done { background: rgba(63, 155, 98, .35); color: #d8ffe3; box-shadow: inset 0 0 0 1.5px #5fc283; }
#ctlReset.armed { background: #5a1f14; color: #ffc6b4; box-shadow: inset 0 0 0 1.5px #e0492b; }
.stp.info .stp-b { display: none; }
.stp.info .stp-c { grid-template-columns: minmax(0, 1fr); background: none; box-shadow: none; padding: 0; }
.stp.info .stp-v { text-align: left; }
.set-keys kbd.none { opacity: .45; }

/* ---------- Controles ---------- */
.ctl { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ctl-top { display: flex; align-items: center; gap: 14px; }
.ctl-top .seg { flex: 0 0 auto; min-width: 360px; }
.ctl-use { font-family: var(--mono); font-size: 12px; color: rgba(242, 233, 214, .6); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ctl-use::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(242, 233, 214, .4); }
.ctl-use.pad { color: #8fe0ad; } .ctl-use.pad::before { background: #5fc283; box-shadow: 0 0 8px #5fc283; }
.ctl-sp { flex: 1 1 auto; }
#ctlKb { display: block; }
#ctlMouse { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
#ctlKb.hidden, #ctlMouse.hidden, #ctlPad.hidden { display: none; }
.mouse-card h3 { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.mouse-card h3 em { font-style: normal; font-size: 11px; letter-spacing: .04em; color: rgba(255, 217, 138, .6); text-transform: none; }
.mouse-diag { display: grid; place-items: center; padding: 6px 0; }
.mouse-diag canvas { width: 192px; height: 288px; image-rendering: pixelated; cursor: pointer; }
.mouse-leg { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 6px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: rgba(242, 233, 214, .7); }
.mouse-leg span { display: inline-flex; align-items: center; gap: 7px; } .mouse-leg i { width: 12px; height: 12px; border-radius: 3px; }
.mouse-leg .ml-pk i { background: #f8b449; } .mouse-leg .ml-dg i { background: #49c2bd; }
.mouse-leg b { font-weight: 400; }
.ctl-keys h3, .pad-card h3, #padBtns h3 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ctl-keys h3 em, .pad-card h3 em { font-style: normal; font-size: 11px; letter-spacing: .04em; color: rgba(255, 217, 138, .6); text-transform: none; }
.kb-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 34px; }
.kb-h, .kb-r { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; gap: 6px; align-items: center; }
.kb-h { font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: rgba(242, 233, 214, .42); padding-bottom: 4px; }
.kb-h span + span { text-align: center; }
.kb-r { padding: 3px 0; border-bottom: 1px dashed rgba(242, 233, 214, .08); }
.kb-a { font-family: var(--serif); font-variation-settings: var(--disp); font-weight: 700; font-size: 18px; line-height: 1.05; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kslot { height: 28px; min-width: 0; padding: 0 6px; border-radius: 7px; background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1.5px rgba(242, 233, 214, .14); font-family: var(--mono); font-size: 11px; color: var(--brass-lt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: grid; place-items: center; transition: background .15s, box-shadow .15s; }
button.kslot:hover { background: rgba(248, 180, 73, .16); box-shadow: inset 0 0 0 1.5px #f8b449; }
.kslot.empty { background: transparent; color: rgba(242, 233, 214, .3); box-shadow: inset 0 0 0 1.5px rgba(242, 233, 214, .1); }
.kslot.lock { color: rgba(242, 233, 214, .55); }
.kslot.fx { font-size: 10px; text-transform: uppercase; background: transparent; }
.kslot.flash, .pb-r.flash { animation: kslot-ok .9s ease; }
@keyframes kslot-ok { 0% { background: rgba(95, 194, 131, .55); box-shadow: inset 0 0 0 2px #5fc283; } }
.ctl-mouse .kslot { width: 190px; height: 30px; font-size: 11.5px; flex: none; }
.ctl-mouse .rs-t label { font-size: 20px; }
.ctl-mouse .row-sw { gap: 10px; }
.ctl-mouse .seg { width: 230px; flex: none; }
.ctl-mouse .rs-c .seg { width: 180px; }
.ctl-keys .set-note { font-size: 14px; }

/* mando */
#ctlPad { display: grid; grid-template-columns: 408px minmax(0, 1fr); gap: 14px; align-items: start; }
.ctl-padl, .ctl-padr { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pad-card { padding: 12px 14px 14px; }
.pad-diag { position: relative; width: 372px; height: 276px; margin: 0 auto; }
.pad-diag canvas { position: absolute; inset: 0; width: 372px; height: 276px; image-rendering: pixelated; }
.pad-diag .glp { position: absolute; transform: translate(-50%, -50%); background-size: 100% 100%; image-rendering: pixelated; transition: transform .2s var(--spring), filter .2s; }
.pad-diag .glp.hl { transform: translate(-50%, -50%) scale(1.45); filter: drop-shadow(0 0 6px #f8b449) drop-shadow(0 0 2px #fff); z-index: 2; }
.pad-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.pb-r { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 3px 8px; border-radius: 8px; transition: background .15s; }
.pb-r.hl { background: rgba(248, 180, 73, .14); }
.pb-r .glp { background-size: 100% 100%; image-rendering: pixelated; justify-self: center; }
.pb-a { font-family: var(--serif); font-variation-settings: var(--disp); font-weight: 700; font-size: 18px; line-height: 1.05; min-width: 0; }
.glp { display: inline-block; flex: none; vertical-align: middle; background: no-repeat 0 0 / 100% 100%; image-rendering: pixelated; }
.pb-fx { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(242, 233, 214, .12); }
.pb-fx > em { grid-column: 1 / -1; font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: rgba(242, 233, 214, .42); padding: 0 8px 2px; }
.pb-r.fixed { grid-template-columns: 30px minmax(0, 1fr); }
.pb-r.fixed .pb-a { font-size: 16px; color: rgba(242, 233, 214, .8); }
.pb-r .mini-btn { padding: 5px 9px; font-size: 10.5px; }
#padBtns .set-note { font-size: 14px; }
.pad-dz { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 14px; align-items: center; }
.viz { display: grid; justify-items: center; gap: 4px; }
.viz canvas { width: 112px; height: 112px; border-radius: 10px; image-rendering: pixelated; box-shadow: inset 0 0 0 1.5px rgba(242, 233, 214, .12); }
.viz small { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; color: rgba(242, 233, 214, .55); }
.pad-dzf { min-width: 0; }
.pad-vizn { font-size: 14px; margin-top: 6px; }
.pad-vizn.off { visibility: hidden; height: 0; margin: 0; }
canvas.curve { width: 72px; height: 45px; border-radius: 7px; image-rendering: pixelated; }
.inv-chips { display: flex; align-items: center; gap: 6px; }
.inv-chips span { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; color: rgba(242, 233, 214, .55); margin-left: 6px; }
.chip-t { font-family: var(--mono); font-size: 12px; width: 34px; height: 28px; border-radius: 7px; box-shadow: inset 0 0 0 1.5px rgba(242, 233, 214, .2); color: rgba(242, 233, 214, .7); transition: background .15s; }
.chip-t.on { background: rgba(200, 150, 62, .32); box-shadow: inset 0 0 0 1.5px var(--brass); color: #ffe08a; }
.fader .mini-btn { justify-self: end; }
.fader.pfader:has(.mini-btn) { grid-template-columns: minmax(7em, auto) minmax(0, 1fr) auto auto; grid-template-areas: "l i b o" ". t . ."; }
.fader.pfader .mini-btn { grid-area: b; padding: 4px 9px; font-size: 10.5px; }

/* ---------- Accesibilidad ---------- */
.ts-prev { --ts: 1; margin-top: 12px; display: grid; gap: 10px; }
.ts-plate { background: var(--paper); color: var(--ink); padding: 10px 18px; text-align: center; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); box-shadow: inset 0 0 0 2px var(--ink); }
.ts-plate small { display: block; font-family: var(--mono); font-size: calc(11px * var(--ask-scale, 1)); letter-spacing: .1em; text-transform: uppercase; color: var(--red-deep); }
.ts-plate b { display: block; font-family: var(--serif); font-variation-settings: var(--disp); font-weight: 800; font-size: calc(34px * var(--ask-scale, 1)); line-height: 1; }
.ts-plate i { display: block; font-family: var(--serif); font-size: calc(16px * var(--ask-scale, 1)); color: var(--ink-2); }
.ts-bub { display: flex; align-items: flex-end; gap: 10px; }
.ts-bub .ic { width: 52px; height: 52px; flex: none; image-rendering: pixelated; }
.ts-bub p { margin: 0; background: #fff; color: var(--ink); font-family: var(--serif); font-size: calc(19px * var(--ask-scale, 1)); line-height: 1.1; padding: 8px 12px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .5); }
.cb-sw { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.cb-sw span { height: 28px; border-radius: 6px; display: grid; place-items: center; font-family: var(--mono); font-size: 10px; text-transform: uppercase; color: rgba(0, 0, 0, .7); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .35); }
.cb-sw .r { background: var(--red); } .cb-sw .g { background: var(--green); } .cb-sw .o { background: var(--brass); } .cb-sw .t { background: var(--teal); }

/* ---------- Datos ---------- */
.cloud { display: flex; align-items: center; gap: 14px; }
.cloud .ic { width: 46px; height: 46px; flex: none; image-rendering: pixelated; }
.cloud b { display: block; font-family: var(--serif); font-variation-settings: var(--disp); font-weight: 700; font-size: 21px; }
.cloud small { display: block; font-size: 15px; color: rgba(242, 233, 214, .55); margin-top: 2px; line-height: 1.3; }
#cloudCard[data-st="on"] .cloud b { color: #7fd8d3; } #cloudCard[data-st="off"] .cloud b { color: #ffcf7a; }

/* ---------- ventana de reasignar ---------- */
.rb-ov { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(4, 9, 6, .82); animation: rb-in .2s ease both; }
.rb-ov.hidden { display: none; }
@keyframes rb-in { from { opacity: 0; } }
.rb-box { width: min(680px, 92vw); display: grid; grid-template-columns: 156px minmax(0, 1fr); gap: 22px; align-items: center; padding: 26px 30px; border-radius: 20px; background: linear-gradient(180deg, #17402b, #0f2a1c); box-shadow: inset 0 0 0 3px var(--brass), 0 0 0 6px rgba(0, 0, 0, .4), 0 30px 60px rgba(0, 0, 0, .6); }
.rb-face .ic { width: 156px; height: 156px; image-rendering: pixelated; display: block; }
.rb-say { position: relative; margin: 0; background: #fff; color: var(--ink); font-family: "Jersey 15", var(--serif); font-size: 27px; line-height: 1.05; padding: 12px 16px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .5); }
.rb-say::before { content: ""; position: absolute; left: -12px; bottom: 16px; border: 6px solid transparent; border-right-color: #fff; border-bottom-color: #fff; }
.rb-what { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass-lt); margin: 14px 0 6px; }
.rb-timer { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.rb-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #f8b449, var(--brass-lt)); animation: rb-timer 10s linear forwards; }
.rb-ov.clash .rb-timer { visibility: hidden; }
@keyframes rb-timer { to { width: 0; } }
.rb-zone { margin-top: 12px; height: 64px; border-radius: 12px; border: 2px dashed rgba(255, 224, 138, .5); display: grid; place-items: center; font-family: var(--mono); font-size: 13px; text-transform: uppercase; color: var(--brass-lt); background: rgba(0, 0, 0, .2); }
.rb-zone:hover { background: rgba(248, 180, 73, .12); }
.rb-gls { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.rb-gls button { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1.5px rgba(242, 233, 214, .14); }
.rb-gls button:hover { background: rgba(248, 180, 73, .25); box-shadow: inset 0 0 0 1.5px #f8b449; }
.rb-gls .glp { background-size: 100% 100%; image-rendering: pixelated; }
.rb-acts { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.rb-hint { font-family: var(--mono); font-size: 11px; color: rgba(242, 233, 214, .55); }
.rb-btn { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; padding: 10px 18px; border-radius: 10px; color: var(--paper); background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1.5px rgba(242, 233, 214, .3), 0 3px 0 rgba(0, 0, 0, .4); transition: background .15s, transform .12s; }
.rb-btn:hover { background: rgba(255, 255, 255, .08); } .rb-btn:active { transform: translateY(2px); }
.rb-btn.rb-yes { background: linear-gradient(180deg, var(--brass-lt), var(--brass)); color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.rb-btn.rb-yes:hover { filter: brightness(1.08); }
.rb-ov.clash .rb-hint { visibility: hidden; }
html[data-dev="deck"] .rb-btn { font-size: 16px; }

/* v0.3.172: en la ventana minima (960 x 600) la tabla de teclas se salia por la derecha y ensanchaba todo el panel. Ahora la pestana mide su hueco
   y no su contenido, la barra de arriba se parte en dos lineas si hace falta y, si el hueco no da para dos columnas, todo va en una (se desplaza, como
   el resto de Ajustes cuando no cabe) */
.ctl { container-type: inline-size; } #settings .set-panes { min-width: 0; }
.ctl-top { flex-wrap: wrap; } .ctl-top .seg { min-width: min(360px, 100%); }
@container (max-width: 760px) { .kb-list, .pad-list, #ctlMouse, #ctlPad { grid-template-columns: minmax(0, 1fr); } }

/* movil: todo apilado (se desplaza, como el resto de Ajustes en movil) */
@media (max-width: 900px) {
  #ctlMouse, #ctlPad { grid-template-columns: minmax(0, 1fr); }
  .kb-list, .pad-list { grid-template-columns: minmax(0, 1fr); }
  .ctl-top { flex-wrap: wrap; } .ctl-top .seg { min-width: 0; flex: 1 1 100%; }
  .pad-diag { transform: scale(.8); transform-origin: top center; margin-bottom: -55px; }
  .rb-box { grid-template-columns: 1fr; } .rb-face { display: none; }
}
/* Steam Deck: letra minima (css/deck.css) tambien en lo nuevo */
html[data-dev="deck"] .kslot, html[data-dev="deck"] .kb-h, html[data-dev="deck"] .ctl-use, html[data-dev="deck"] .mini-btn, html[data-dev="deck"] .pb-fx > em,
html[data-dev="deck"] .viz small, html[data-dev="deck"] .inv-chips span, html[data-dev="deck"] .cb-sw span, html[data-dev="deck"] .rb-hint, html[data-dev="deck"] .rb-what,
html[data-dev="deck"] .ctl-keys h3 em, html[data-dev="deck"] .pad-card h3 em, html[data-dev="deck"] .chip-t, html[data-dev="deck"] .ts-plate small { font-size: 16px; }
html[data-dev="deck"] .mouse-leg { font-size: 16px; }

/* Tamano del texto (Accesibilidad): --ts = 1 | 1,15 | 1,3 (js/game.js applyQSize). La placa usa --ask-scale; aqui, lo demas que se lee en partida */
.dealer:not(.big) .dl-bubble { zoom: var(--ts, 1); }
.pk-card { zoom: var(--ts, 1); }
.tt { font-size: calc(15.5px * var(--ts, 1)); max-width: calc(min(300px, calc(86 * var(--vw))) * var(--ts, 1)); }
.tt b { font-size: calc(14px * var(--ts, 1)); } .tt b:only-child { font-size: calc(15.5px * var(--ts, 1)); }

/* los segmentados dentro de una fila necesitan ancho propio (.seg es un contenedor de consultas: sin ancho, se encoge a 0) */
#ctlPad .row-sw > .seg, #ctlPad .rs-c > .seg { width: 270px; flex: none; }
#ctlPad .rs-c > .seg.s3 { width: 300px; }
#ctlPad #padFeel .row-sw > .seg.s3 { width: 300px; }
#padIcons { grid-template-columns: auto minmax(0, 1fr); }
html[data-dev="deck"] .kb-h, html[data-dev="deck"] .kb-r { grid-template-columns: minmax(0, 1fr) 112px 112px; }
.set-card h3:has(> em) { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.set-card h3 > em { font-style: normal; font-size: 11px; letter-spacing: .04em; color: rgba(255, 217, 138, .6); text-transform: none; }
html[data-dev="deck"] .set-card h3 > em { font-size: 16px; }
