/* Backgammon Club: estilos de la interfaz (sobre el lienzo 3D). */
:root {
  --bg: #0f2a26; --bg2: #0a1d1a; --panel: #173a34; --panel2: #1f4b43; --line: rgba(190,255,230,.18); --text: #f6fff9; --muted: #a9cbbf;
  --accent: #ffd23f; --accent2: #ff9a3c; --accent-text: #2a1a05; --mint: #47d96b; --mint2: #22a84a; --danger: #ff5a5a; --gem: #4ff0ff;
  --font: 'Fredoka', 'Baloo 2', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --sky1: #2f7a68; --sky2: #0e2b26;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overflow: hidden; }
#app { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, var(--sky1), var(--sky2) 78%); touch-action: none; }
#app::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 5px); }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--accent2); outline-offset: 3px; }
a { color: var(--accent); }

/* ---------- botones ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 52px; padding: .45em 1.3em; border-radius: 18px; font-size: 1.12rem; font-weight: 700; letter-spacing: .02em; color: var(--accent-text); text-decoration: none;
  background: linear-gradient(180deg, #fff1a6, var(--accent) 55%, #f2a922); box-shadow: 0 5px 0 #b77812, 0 10px 22px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.6); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b77812, inset 0 2px 0 rgba(255,255,255,.6); }
.btn svg { width: 1.25em; height: 1.25em; flex: none; }
.btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.btn small { font-size: .62em; font-weight: 600; opacity: .8; letter-spacing: 0; margin-top: .15em; }
.btn.mint { color: #06301a; background: linear-gradient(180deg, #b9ffc9, var(--mint) 55%, var(--mint2)); box-shadow: 0 5px 0 #157233, 0 10px 22px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.6); }
.btn.mint:active { box-shadow: 0 1px 0 #157233, inset 0 2px 0 rgba(255,255,255,.6); }
.btn.ghost { color: var(--text); background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:active { transform: translateY(2px); }
.btn.big { min-height: 64px; font-size: 1.45rem; padding: .4em 1.6em; border-radius: 22px; }
.btn.small { min-height: 40px; font-size: .92rem; padding: .3em .9em; border-radius: 13px; }
.btn[disabled] { filter: grayscale(.7) brightness(.85); pointer-events: none; }
.icon-btn { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: var(--text); background: rgba(10,32,28,.74); box-shadow: inset 0 0 0 2px var(--line), 0 4px 12px rgba(0,0,0,.2); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn:active { transform: scale(.94); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.25); font-weight: 700; }
.pill svg { width: 20px; height: 20px; fill: var(--gem); }

/* ---------- pantallas ---------- */
#screens { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.screen { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; animation: in .25s ease-out both; padding: calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) calc(14px + var(--safe-b)) calc(14px + var(--safe-l)); }
.screen.out { animation: out .2s ease-in both; pointer-events: none; }
@keyframes in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes out { to { opacity: 0; transform: scale(.98); } }
.overlay { justify-content: center; background: rgba(4,16,14,.58); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.card { width: min(420px, 100%); max-height: 100%; overflow: auto; padding: 22px 20px; border-radius: 26px; background: linear-gradient(180deg, var(--panel2), var(--panel)); box-shadow: inset 0 0 0 2px var(--line), 0 20px 50px rgba(0,0,0,.4); text-align: center; display: flex; flex-direction: column; gap: 14px; }
.card h2 { margin: 0; font-size: 1.9rem; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.card .sub { margin: 0; color: var(--muted); font-size: 1rem; }
.card.scroll { max-height: min(86vh, 720px); }

/* portada */
.title-screen { justify-content: space-between; }
.logo { text-align: center; margin-top: 2vh; filter: drop-shadow(0 6px 0 rgba(0,0,0,.15)); }
.logo .h1 { display: flex; flex-direction: column; align-items: center; line-height: .82; font-weight: 700; }
.logo .l1 { font-size: clamp(2.6rem, 12.5vw, 5.4rem); color: #fff4dc; -webkit-text-stroke: 3px #6b2a12; paint-order: stroke fill; text-shadow: 0 6px 0 #6b2a12, 0 10px 20px rgba(0,0,0,.3); letter-spacing: -.01em; transform: rotate(-2deg); }
.logo .l2 { font-size: clamp(2.1rem, 9.5vw, 4rem); color: #ffd23f; -webkit-text-stroke: 3px #8a4a0a; paint-order: stroke fill; text-shadow: 0 5px 0 #8a4a0a; transform: rotate(2deg); margin-top: .05em; padding: 0 .35em; border-radius: 99px; background: #e8574a; box-shadow: 0 6px 0 #9a2a20; }
.logo p { margin: .7em auto 0; display: inline-block; padding: .3em .9em; border-radius: 99px; background: rgba(10,32,28,.72); font-weight: 600; font-size: 1.05rem; }
.title-bottom { display: flex; flex-direction: column; gap: 14px; align-items: stretch; width: min(360px, 100%); margin-bottom: 1vh; }
.title-bottom .btn.big { justify-content: flex-start; }
.portal-link { position: absolute; left: calc(12px + var(--safe-l)); top: calc(12px + var(--safe-t)); display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: 99px; background: rgba(10,32,28,.72); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; }
.portal-link svg { width: 28px; height: 28px; }


/* ---------- marcador de la partida ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.hud-box { position: absolute; pointer-events: none; display: flex; gap: 8px; }
.hud-box > * { pointer-events: auto; }
.pl { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 16px; background: rgba(10,32,28,.78); box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow .2s, transform .2s; min-width: 0; }
.pl.turn { box-shadow: inset 0 0 0 3px var(--accent), 0 0 18px rgba(255,210,63,.45); }
.pl-t { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.pl .nm { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .pp { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pl .msc { margin-left: auto; font-size: 1.35rem; color: var(--accent); min-width: .6em; text-align: right; }
.pl.owner .nm::after { content: ' ×2'; content: ' ◆'; color: var(--accent); }
.chip { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-block; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 2px 4px rgba(0,0,0,.3); }
.chip.c0 { background: radial-gradient(circle at 40% 35%, #fff, #f4e6c6); }
.chip.c1 { background: radial-gradient(circle at 40% 35%, #56607a, #2c3448); }
.minfo { font-size: .78rem; font-weight: 600; color: var(--muted); padding: 2px 8px; border-radius: 99px; background: rgba(10,32,28,.6); white-space: nowrap; }
.minfo:empty { display: none; }
.status { font-weight: 600; font-size: .95rem; padding: 4px 12px; border-radius: 99px; background: rgba(10,32,28,.75); text-align: center; }
.status:empty { display: none; }
.dchips { display: flex; gap: 5px; justify-content: center; }
.dchips:empty { display: none; }
.die { width: 30px; height: 30px; }
.die rect { fill: #fffaf0; stroke: rgba(0,0,0,.25); stroke-width: 1; }
.die g { fill: #2c3448; }
.die.p1 rect { fill: #2c3448; stroke: rgba(255,255,255,.3); } .die.p1 g { fill: #fffaf0; }
.die.used { opacity: .28; transform: scale(.85); }
.acts { display: flex; gap: 8px; align-items: center; }
.act { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 66px; height: 58px; border-radius: 16px; color: var(--text); background: rgba(10,32,28,.8); box-shadow: inset 0 0 0 2px var(--line), 0 4px 10px rgba(0,0,0,.25); font-weight: 600; font-size: .68rem; line-height: 1.05; text-align: center; }
.act svg { width: 24px; height: 24px; }
.act span { max-width: 64px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
.act:active { transform: scale(.94); }
.act[disabled] { opacity: .45; pointer-events: none; }
.act.gold { color: var(--accent-text); background: linear-gradient(180deg, #fff1a6, var(--accent)); box-shadow: 0 4px 0 #b77812; }
.act .bdg { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--mint); color: #06301a; font-style: normal; font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.act.adv .bdg { background: #fff; color: #173a34; padding: 2px; } .act .bdg svg { width: 14px; height: 14px; }
.b-roll { min-width: 128px; }
.b-roll svg { width: 1.5em; height: 1.5em; }
.b-roll:not(.hidden) { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: none; } 8% { transform: translateY(-3px) rotate(-2deg); } 16% { transform: none; } }

/* vertical: marcador arriba y acciones abajo */
body.port .hud-a { left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) 0 calc(8px + var(--safe-l)); align-items: center; flex-wrap: wrap; }
body.port .hud-a .pl { flex: 1 1 0; }
body.port .hud-a .pl1 { order: 2; } body.port .hud-a .pl0 { order: 1; }
body.port .hud-a .minfo { order: 3; position: absolute; left: 50%; transform: translateX(-50%); top: calc(62px + var(--safe-t)); }
body.port .hud-b { left: 0; right: 0; bottom: 0; padding: 0 calc(8px + var(--safe-r)) calc(10px + var(--safe-b)) calc(8px + var(--safe-l)); flex-direction: column; align-items: center; gap: 6px; }
body.port .acts { flex-wrap: nowrap; justify-content: center; }
/* horizontal: columnas a los lados */
body.land .hud-a { left: 0; top: 0; bottom: 0; width: var(--side, 170px); flex-direction: column; padding: calc(10px + var(--safe-t)) 8px calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); }
body.land .hud-a .pl1 { order: 1; } body.land .hud-a .pl0 { order: 3; margin-top: auto; } body.land .hud-a .minfo { order: 2; align-self: flex-start; white-space: normal; }
body.land .hud-a .b-pause { order: 0; }
body.land .hud-b { right: 0; top: 0; bottom: 0; width: var(--side, 170px); flex-direction: column; align-items: stretch; padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) 8px; }
body.land .hud-b .status { order: 1; border-radius: 14px; }
body.land .hud-b .dchips { order: 2; }
body.land .hud-b .acts { order: 3; margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; }
body.land .hud-b .acts .act { width: auto; }
body.land .hud-b .b-roll { grid-column: 1 / -1; min-width: 0; }
body.land .hud-b .b-dbl { grid-column: 1 / -1; height: 48px; flex-direction: row; gap: 6px; font-size: .9rem; }

/* ---------- preparación ---------- */
.field { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.lab { font-weight: 700; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.levels { display: flex; flex-direction: column; gap: 6px; }
.lv { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 2px var(--line); text-align: left; }
.lv b { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); flex: none; }
.lv span { display: flex; flex-direction: column; font-weight: 700; line-height: 1.1; }
.lv small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.lv.on { background: rgba(255,210,63,.16); box-shadow: inset 0 0 0 3px var(--accent); }
.lv.on b { background: var(--accent); color: var(--accent-text); }
.seg { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 6px; }
.seg-b { padding: 10px 4px; border-radius: 12px; font-weight: 700; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 2px var(--line); }
.seg-b.on { background: var(--accent); color: var(--accent-text); box-shadow: none; }
.len-desc { color: var(--muted); font-weight: 600; }
.setup .card { gap: 12px; }
.go-row { display: flex; gap: 10px; } .go-row .b-start { flex: 1; } .go-row .b-back { width: 64px; padding: 0; }

/* ---------- resultados, doblaje y estadísticas ---------- */
.kind { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--muted); } .kind.good { color: #9dffc4; } .kind b { color: var(--accent); }
.mscore { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px; border-radius: 16px; background: rgba(0,0,0,.2); }
.mscore div { display: flex; align-items: center; gap: 6px; font-weight: 600; } .mscore b { font-size: 2rem; color: #fff; } .mscore em { font-style: normal; color: var(--muted); font-size: .8rem; }
.result.won .card h2 { color: var(--accent); }
.cube-big { margin: 0 auto; width: 84px; height: 84px; border-radius: 16px; display: grid; place-items: center; font-size: 2.6rem; font-weight: 700; color: #7a2a1c; background: linear-gradient(160deg, #fffaf0, #f1dcb0); box-shadow: inset 0 0 0 4px #d4a64a, 0 8px 0 #a77a2a; animation: gemin .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes gemin { from { transform: scale(0) rotate(-40deg); } }
.row.two > .btn { flex: 1 1 0; min-width: 0; }
.row.two { flex-wrap: nowrap; }
.stats-t { width: 100%; border-collapse: collapse; font-size: .95rem; }
.stats-t th { font-size: .78rem; color: var(--muted); text-align: right; padding: 4px 6px; } .stats-t th:first-child { text-align: left; }
.stats-t td { padding: 6px; text-align: right; border-top: 1px solid var(--line); } .stats-t td:first-child { text-align: left; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.kpis div { display: flex; flex-direction: column; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.06); } .kpis b { font-size: 1.5rem; color: var(--accent); } .kpis span { font-size: .78rem; color: var(--muted); font-weight: 600; }

/* avisos */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.pop { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: 1.15rem; color: #fff; -webkit-text-stroke: 2px rgba(0,0,0,.5); paint-order: stroke fill; animation: popup 1.05s ease-out forwards; white-space: nowrap; }
.pop.gold { color: var(--accent); font-size: 1.5rem; }
.pop.gem { color: var(--gem); font-size: 1.35rem; }
.pop.lasso { color: #ffe066; font-size: 1.9rem; }
.pop.bad { color: #ff6a6a; }
@keyframes popup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
.banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 700; color: #fff; -webkit-text-stroke: 3px rgba(0,0,0,.45); paint-order: stroke fill; text-align: center; white-space: nowrap; animation: banner 1.7s ease-out forwards; }
.banner.gold { color: var(--accent); } .banner.mint { color: #8affa0; } .banner.red { color: #ff7a7a; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 22% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }
#toasts { position: absolute; left: 0; right: 0; top: calc(92px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 30; }
.toast { padding: 8px 16px; border-radius: 14px; background: rgba(10,32,28,.94); box-shadow: inset 0 0 0 2px var(--line), 0 6px 16px rgba(0,0,0,.3); font-weight: 600; animation: in .25s both; max-width: 90vw; text-align: center; }
.toast.gold { background: linear-gradient(180deg, #fff1a6, var(--accent)); color: var(--accent-text); }
.toast.red { background: #b8302a; }
.toast.out { animation: out .3s both; }

/* ajustes y cómo se juega */
.settings { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.06); font-weight: 600; }
.setting select, .setting input { font-family: inherit; font-size: 1rem; font-weight: 600; padding: 7px 10px; border-radius: 10px; border: 0; background: #0c2420; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); max-width: 55%; }
.tog { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; background: rgba(0,0,0,.3); font-weight: 700; min-width: 74px; }
.tog i { width: 26px; height: 26px; border-radius: 50%; background: #5a6b7d; transition: .2s; }
.tog.on i { background: var(--mint); transform: translateX(2px); }
.links { margin-top: 6px; }
.howto-body { text-align: left; }
.howto-body .t1 { font-size: 1.35rem; font-weight: 700; margin: 0 0 .4em; color: var(--accent); }
.howto-body h2 { font-size: 1.15rem; margin: 1em 0 .3em; }
.howto-body ul { padding-left: 1.2em; margin: .3em 0; }
.howto-body li { margin: .25em 0; line-height: 1.35; }
.howto-body p { line-height: 1.4; }

/* anuncio de prueba */
.dev-ad { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(0,0,0,.75); }
.dev-ad-box { width: min(340px, 90%); padding: 20px; border-radius: 20px; background: #111; color: #fff; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.dev-ad-tag { font-size: .8rem; color: #aaa; }
.dev-ad-art { width: 100%; aspect-ratio: 16/9; border-radius: 12px; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #333 0 12px, #2a2a2a 12px 24px); font-size: 2rem; font-weight: 700; }

/* carga */
#loader { position: absolute; inset: 0; display: grid; place-items: center; z-index: 60; background: var(--bg); transition: opacity .4s; }
#loader.out { opacity: 0; pointer-events: none; }
.loader-ring { width: 64px; height: 64px; border-radius: 50%; border: 8px solid rgba(71,217,107,.25); border-top-color: var(--mint); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; }

/* pantallas bajas (móvil en horizontal) */
@media (max-height: 520px) {
  .logo .l1 { font-size: 3rem; } .logo .l2 { font-size: 1.9rem; } .logo p { display: none; }
  .btn.big { min-height: 52px; font-size: 1.2rem; }
  .card { padding: 14px; gap: 10px; } .card h2 { font-size: 1.5rem; }
  #toasts { top: calc(70px + var(--safe-t)); }
}
@media (max-height: 520px) {
  .settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .setting { padding: 4px 8px; } .settings .links { grid-column: 1 / -1; }
  .card .b-close { position: sticky; bottom: 0; }
  .settings-p .card { width: min(720px, 100%); }
}
@media (prefers-reduced-motion: reduce) { .b-roll:not(.hidden) { animation: none; } }

.title-screen .title-bottom .btn.big { min-height: 60px; font-size: 1.3rem; }
body.land .title-screen { align-items: flex-start; justify-content: center; gap: 4vh; padding-left: calc(4vw + var(--safe-l)); }
body.land .title-screen .logo { text-align: left; margin-top: 0; } body.land .title-screen .logo .h1 { align-items: flex-start; }
body.land .title-screen .title-bottom { width: min(360px, 38vw); }
body.land .title-screen .portal-link { left: auto; right: calc(12px + var(--safe-r)); }
body.land .overlay.setup .card, body.land .overlay.stats-p .card { width: min(560px, 100%); }
@media (max-height: 520px) {
  body.land .title-screen { gap: 10px; }
  .title-screen .title-bottom { gap: 8px; } .title-screen .title-bottom .btn.big { min-height: 48px; font-size: 1.05rem; }
  .logo .l1 { font-size: 2.6rem; } .logo .l2 { font-size: 1.7rem; }
  .act { height: 50px; } .b-roll { min-height: 54px; }
  .pl .nm { font-size: .9rem; } .chip { width: 22px; height: 22px; }
  .setup .levels { display: grid; grid-template-columns: repeat(5, 1fr); } .setup .lv small { display: none; } .setup .lv { flex-direction: column; gap: 3px; padding: 6px 4px; text-align: center; } .setup .lv span { font-size: .85rem; }
  .setup .card { width: min(680px, 100%); gap: 8px; } .setup .len-desc { display: none; } .setup .card h2 { font-size: 1.35rem; } .setup .seg-b { padding: 7px 4px; }
  .setup .b-start { min-height: 50px; }
  .setup .setting { padding: 4px 10px; }
  body.land .hud-b .acts { gap: 6px; }
}
@media (max-width: 380px) { .act { width: 58px; font-size: .62rem; } .b-roll { min-width: 104px; } }
.howto-src { display: none; }

/* fichas.py: ficha del juego bajo la pantalla de juego (visible al desplazarse; al jugar la página vuelve arriba y no se mueve) */
html, body { height: auto !important; min-height: 100%; overflow-x: hidden !important; overflow-y: auto !important; }
html:has(body.playing), body.playing { overflow: hidden !important; }
body:not(.playing) { touch-action: pan-y; }
body:not(.playing) #wrap, body:not(.playing) #app, body:not(.playing) #app canvas, body:not(.playing) #app .screen { touch-action: pan-y !important; }   /* fuera de la partida se puede bajar a la ficha deslizando sobre el juego */
#wrap, #app { position: relative !important; inset: auto !important; width: 100% !important; height: 100vh !important; height: 100dvh !important; }
.game-info { max-width: 860px; margin: 0 auto; padding: 26px 18px 40px; font-family: Fredoka, ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif; color: #f4f0ff; line-height: 1.55; user-select: text; -webkit-user-select: text; }
.game-info .crumbs { font-size: .92rem; color: #b9b0d8; margin-bottom: 10px; } .game-info .crumbs a { color: #b9b0d8; } .game-info .crumbs span { margin: 0 6px; opacity: .6; }
.game-info .howto-src { display: block; } .game-info .howto { background: none; color: inherit; padding: 0; border-radius: 0; box-shadow: none; border: 0; }
.game-info h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.15; margin: 0 0 10px; color: #fff; }
.game-info h2 { font-size: 1.3rem; margin: 26px 0 8px; color: #ffd23f; }
.game-info p, .game-info li { color: #e8e2fa; } .game-info ul { padding-left: 1.2em; } .game-info a { color: #ffd23f; }
.game-info details { margin: 8px 0; padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1.5px rgba(190,160,255,.22); }
.game-info summary { cursor: pointer; font-weight: 600; } .game-info details p { margin: 6px 0 0; }
.game-info .more { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.game-info .more a { display: block; border-radius: 16px; overflow: hidden; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1.5px rgba(190,160,255,.22); text-decoration: none; color: #fff; }
.game-info .more img { display: block; width: 100%; height: auto; aspect-ratio: 40 / 21; object-fit: cover; } .game-info .more b { display: block; padding: 8px 10px 0; } .game-info .more span { display: block; padding: 0 10px 10px; font-size: .88rem; color: #c9c0e6; }
.game-info .foot { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 34px; padding-top: 16px; border-top: 1px solid rgba(190,160,255,.22); font-size: .92rem; } .game-info .foot a { color: #b9b0d8; }
.howto .t1 { font-size: 1.25rem; font-weight: 700; margin: .67em 0; }
