/* ¿Quién soy?: estilos (2D moderno con cartas que se abaten en 3D con CSS). */
:root {
  --bg: #2a1856; --bg2: #1c0f3d; --panel: #3a2475; --panel2: #4b2f92; --line: rgba(220,200,255,.22); --text: #fbf8ff; --muted: #c9bcf0;
  --accent: #ffd23f; --accent2: #ff9a3c; --accent-text: #2a1a05; --mint: #47d96b; --mint2: #22a84a; --pink: #ff6fa8; --pink2: #e0407e; --danger: #ff5a5a;
  --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);
}
* { 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(120% 80% at 50% 0%, #7c58ff 0%, #4a2ba8 45%, #2a1856 100%); touch-action: manipulation; }
#app::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1.5px, transparent 1.6px); background-size: 26px 26px; pointer-events: 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 { 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.2em; 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.pink { color: #fff; background: linear-gradient(180deg, #ffb3d0, var(--pink) 55%, var(--pink2)); box-shadow: 0 5px 0 #a3255a, 0 10px 22px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.5); text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.btn.pink:active { box-shadow: 0 1px 0 #a3255a, inset 0 2px 0 rgba(255,255,255,.5); }
.btn.ghost { color: var(--text); background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:active { transform: translateY(2px); }
.btn.big { min-height: 64px; font-size: 1.4rem; padding: .4em 1.4em; 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; }
.btn .tag { position: absolute; top: -9px; right: -6px; font-style: normal; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--mint); color: #06301a; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.btn .tag.ad { background: var(--accent); color: var(--accent-text); padding: 2px 5px; display: grid; place-items: center; } .btn .tag.ad svg { width: 15px; height: 15px; }
.btn.pulse { animation: pulseb 1.1s ease-in-out infinite; }
@keyframes pulseb { 50% { transform: scale(1.05); } }
.icon-btn { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: var(--text); background: rgba(28,15,61,.6); box-shadow: inset 0 0 0 2px var(--line), 0 4px 12px rgba(0,0,0,.2); flex: none; }
.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; }

/* ---------- 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(20,8,48,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.card { width: min(440px, 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.85rem; 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: 1.02rem; }
.card.scroll { max-height: min(90vh, 760px); }

/* portada */
.title-screen { justify-content: space-evenly; }
.logo { text-align: center; margin-top: 1vh; display: flex; flex-direction: column; align-items: center; }
.fan { position: relative; height: clamp(130px, 30vh, 300px); width: 100%; display: flex; justify-content: center; align-items: flex-end; margin-bottom: -18px; }
.fan-card { position: absolute; bottom: 0; width: clamp(84px, 19vh, 170px); aspect-ratio: .78; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.35), inset 0 0 0 3px #fff; transform-origin: 50% 120%; transform: rotate(calc(var(--i) * 13deg)) translateY(calc(abs(var(--i)) * 8px)); animation: fan 3.2s ease-in-out infinite alternate; animation-delay: calc(var(--i) * .25s); display: flex; flex-direction: column; }
.fan-card svg { display: block; width: 100%; flex: 1; min-height: 0; }
.fan-card b { display: block; font-size: .8rem; color: #2a1856; padding: 2px 0 4px; }
@supports not (transform: translateY(calc(abs(-1) * 1px))) { .fan-card { transform: rotate(calc(var(--i) * 13deg)); } }
@keyframes fan { to { translate: 0 -6px; } }
.logo .h1 { position: relative; font-size: clamp(3rem, 13vw, 5.6rem); font-weight: 700; line-height: 1; color: #ffd23f; -webkit-text-stroke: 3px #7a2f00; paint-order: stroke fill; text-shadow: 0 6px 0 #7a2f00, 0 12px 24px rgba(0,0,0,.35); transform: rotate(-3deg); white-space: nowrap; }
.logo p { margin: .8em auto 0; display: inline-block; padding: .3em .9em; border-radius: 99px; background: rgba(28,15,61,.65); 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(28,15,61,.7); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; z-index: 2; }
.portal-link svg { width: 28px; height: 28px; }

/* niveles */
.levels { gap: 10px; }
.lvl { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 20px; text-align: left; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 2px var(--line); transition: transform .1s, background .15s; }
.lvl:hover { background: rgba(255,255,255,.16); } .lvl:active { transform: scale(.97); }
.lvl .stars { font-size: 1.3rem; color: var(--accent); letter-spacing: -2px; min-width: 3.4em; } .lvl .stars i { font-style: normal; color: rgba(255,255,255,.18); }
.lvl .lt { display: flex; flex-direction: column; gap: 2px; } .lvl b { font-size: 1.3rem; } .lvl small { color: var(--muted); font-size: .9rem; } .lvl em { font-style: normal; font-size: .8rem; color: var(--accent); }
.lvl-easy { box-shadow: inset 0 0 0 2px rgba(71,217,107,.55); } .lvl-medium { box-shadow: inset 0 0 0 2px rgba(255,210,63,.55); } .lvl-hard { box-shadow: inset 0 0 0 2px rgba(255,111,168,.6); }

/* ---------- partida ---------- */
#game { position: absolute; inset: 0; display: flex; flex-direction: column; padding: calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) calc(8px + var(--safe-b)) calc(8px + var(--safe-l)); gap: 8px; z-index: 1; }
.gbar { display: flex; align-items: center; gap: 8px; flex: none; }
.turn { flex: 1; min-width: 0; display: flex; justify-content: center; }
.turn .who { padding: 7px 16px; border-radius: 99px; font-weight: 700; font-size: 1.08rem; background: rgba(28,15,61,.6); box-shadow: inset 0 0 0 2px var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .3s, color .3s; }
.turn.myturn .who { background: var(--accent); color: var(--accent-text); box-shadow: 0 4px 0 #b77812; }
.turn.myturn.p2 .who { background: var(--pink); color: #fff; box-shadow: 0 4px 0 #a3255a; }
.rival { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 16px; background: rgba(28,15,61,.6); box-shadow: inset 0 0 0 2px var(--line); flex: none; }
.rv-ico { display: grid; place-items: center; } .rv-ico svg { width: 26px; height: 26px; color: #b9a8ff; } .rv-ico b { font-size: .78rem; color: var(--pink); white-space: nowrap; }
.rv-t { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.dots { display: grid; grid-template-columns: repeat(8, 5px); gap: 2px; } .dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.18); transition: background .3s; } .dots i.on { background: #ffd23f; }
.gmain { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.board-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#board { display: grid; grid-template-columns: repeat(var(--cols, 4), var(--cw, 80px)); gap: var(--gap, 6px); perspective: 900px; }
.pc { position: relative; width: var(--cw, 80px); aspect-ratio: .78; padding: 0; perspective: 500px; }
.pc-in { position: absolute; inset: 0; transform-origin: 50% 100%; transition: transform .5s cubic-bezier(.45,1.45,.5,1) var(--d, 0ms), filter .4s var(--d, 0ms); transform-style: preserve-3d; }
.pc-face { position: absolute; inset: 0; border-radius: 11%/9%; overflow: hidden; background: #fff; box-shadow: 0 4px 0 #c9b8ef, 0 7px 14px rgba(10,0,40,.35); display: flex; flex-direction: column; border: 3px solid #fff; }
.pc-face svg { display: block; width: 100%; flex: 1; min-height: 0; border-radius: 8% 8% 0 0 / 6% 6% 0 0; }
.pc-face b { display: block; color: #2a1856; font-size: calc(var(--cw, 80px) * .16); line-height: 1.25; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.pc-back { position: absolute; inset: 0; border-radius: 11%/9%; background: repeating-linear-gradient(45deg, #6a48d8 0 8px, #5a3bc4 8px 16px); box-shadow: inset 0 0 0 3px #8f72ff; display: grid; place-items: center; opacity: 0; transition: opacity .25s calc(var(--d, 0ms) + 120ms); }
.pc-back span { font-size: calc(var(--cw, 80px) * .45); font-weight: 700; color: rgba(255,255,255,.55); }
.pc.down .pc-in { transform: rotateX(64deg); filter: brightness(.8); }
.pc.down .pc-back { opacity: .96; }
.pc:active .pc-in { scale: .96; }
#board.guessing .pc:not(.down) .pc-face { box-shadow: 0 0 0 3px var(--pink), 0 4px 0 #a3255a, 0 8px 18px rgba(255,111,168,.45); animation: guesspulse 1s ease-in-out infinite; }
@keyframes guesspulse { 50% { transform: translateY(-3px); } }
.pc.shake .pc-in { animation: shake .4s; }
@keyframes shake { 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }
.pc.glow .pc-face { box-shadow: 0 0 0 4px var(--accent), 0 0 26px 6px rgba(255,210,63,.8); animation: glow .8s ease-in-out infinite alternate; }
@keyframes glow { to { transform: translateY(-4px) scale(1.05); } }
#board.tiny .pc-face b { font-size: calc(var(--cw, 60px) * .17); }

.side { flex: none; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 8px 10px; align-items: center; }
.mine { grid-row: span 2; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mine > span { font-size: .72rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.mine-card { width: 66px; aspect-ratio: .78; border-radius: 10px; overflow: hidden; background: #fff; border: 3px solid var(--accent); box-shadow: 0 4px 12px rgba(0,0,0,.3); display: flex; flex-direction: column; transition: transform .2s; }
.mine-card svg { display: block; width: 100%; flex: 1; min-height: 0; } .mine-card b { color: #2a1856; font-size: .72rem; text-align: center; line-height: 1.3; }
.mine-card.ping { animation: ping .6s; } @keyframes ping { 40% { transform: scale(1.14) rotate(-3deg); } }
.mine-card.caught { border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink), 0 0 24px rgba(255,111,168,.8); animation: ping .6s 2; }
.bubble { min-height: 50px; display: flex; align-items: center; }
.bb { position: relative; width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 8px 12px; border-radius: 16px; background: #fff; color: #2a1856; box-shadow: 0 6px 16px rgba(0,0,0,.25); animation: bbin .3s cubic-bezier(.3,1.5,.5,1) both; }
.bb.ai { background: #e9e2ff; }
.bb.good { background: #dcffe5; } .bb.bad { background: #ffe0e8; }
@keyframes bbin { from { transform: scale(.85); opacity: 0; } }
.bb .lbl { display: flex; align-items: center; gap: 4px; width: 100%; font-size: .75rem; font-weight: 600; color: #7a68b0; } .bb .lbl svg { width: 16px; height: 16px; color: #6a48d8; }
.bb .qq { flex: 1; font-size: 1.02rem; line-height: 1.2; display: flex; align-items: center; gap: 6px; }
.ans { padding: 3px 14px; border-radius: 99px; font-weight: 700; font-size: 1.1rem; animation: ansin .35s cubic-bezier(.3,1.8,.5,1) both; }
.ans.yes { background: var(--mint); color: #06301a; } .ans.no { background: var(--pink2); color: #fff; }
@keyframes ansin { from { transform: scale(0); } }
.dotsl { display: flex; gap: 5px; padding: 4px 0; } .dotsl i { width: 9px; height: 9px; border-radius: 50%; background: #6a48d8; animation: dot 1s infinite; } .dotsl i:nth-child(2) { animation-delay: .15s; } .dotsl i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 30% { transform: translateY(-5px); opacity: .5; } }
.sw { display: inline-block; width: 1em; height: 1em; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); flex: none; font-style: normal; }
.actions { display: flex; gap: 8px; min-height: 52px; }
.actions .btn { flex: 1 1 0; min-width: 0; padding-left: .5em; padding-right: .5em; font-size: 1.02rem; }
.actions .b-hint { flex: .8 1 0; }

/* selector de preguntas */
.qsheet .card { width: min(560px, 100%); gap: 8px; }
.qlist h3 { margin: 10px 0 6px; font-size: .95rem; text-align: left; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 6px; }
.qb { display: flex; align-items: center; gap: 8px; padding: 9px 10px; min-height: 46px; border-radius: 14px; text-align: left; font-size: .98rem; font-weight: 600; background: #fff; color: #2a1856; box-shadow: 0 3px 0 #c9b8ef; transition: transform .08s; }
.qb:active { transform: translateY(2px); box-shadow: 0 1px 0 #c9b8ef; }
.qb > span { flex: 1; line-height: 1.15; } .qb .sw { width: 20px; height: 20px; }
.qb em { font-style: normal; font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; } .qb em.yes { background: var(--mint); color: #06301a; } .qb em.no { background: var(--pink2); color: #fff; }
.qb.done { background: rgba(255,255,255,.55); box-shadow: none; color: rgba(42,24,86,.7); }
.qb.hl { box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(255,210,63,.8); animation: pulseb 1s ease-in-out 3; }
.confirm-p .big-face { width: 130px; margin: 0 auto; border-radius: 16px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 8px 20px rgba(0,0,0,.3); } .confirm-p .big-face svg { display: block; width: 100%; }
.confirm-p .row .btn { flex: 1 1 0; min-width: 0; }

/* 2 jugadores: pasar el móvil */
.pass-screen { justify-content: center; background: radial-gradient(120% 80% at 50% 20%, #ffd23f 0%, #ff9a3c 100%); z-index: 40; }
.pass-screen.p2 { background: radial-gradient(120% 80% at 50% 20%, #ff9cc6 0%, #e0407e 100%); }
.pass-in { width: min(420px, 100%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: #2a1856; }
.pass-screen.p2 .pass-in { color: #fff; }
.pass-in .pt { margin: 0; font-size: 1.3rem; font-weight: 600; } .pass-in .pn { font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 700; line-height: 1; }
.pass-in .pinfo { margin: 0; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.55); color: #2a1856; font-weight: 600; }
.pass-in .ph { margin: 0; opacity: .8; font-weight: 600; }

/* resultado */
.res-cards { display: flex; justify-content: center; gap: 14px; }
.res-card { width: 118px; border-radius: 16px; overflow: hidden; background: #fff; color: #2a1856; box-shadow: 0 8px 20px rgba(0,0,0,.3); display: flex; flex-direction: column; animation: resin .5s cubic-bezier(.3,1.5,.5,1) both; }
.res-card:nth-child(2) { animation-delay: .15s; }
.res-card svg { display: block; width: 100%; } .res-card b { font-size: 1.05rem; } .res-card span { font-size: .78rem; color: #7a68b0; padding: 0 4px 6px; }
@keyframes resin { from { transform: translateY(20px) rotate(-6deg); opacity: 0; } }
.result.won .card h2 { color: var(--accent); }

/* estadísticas */
.stats { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.srow { display: grid; grid-template-columns: 5.5em 3.5em 1fr; align-items: center; gap: 8px; font-weight: 600; }
.sbar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; } .sbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), #b9ffc9); border-radius: 99px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 6px; }
.sgrid div { padding: 10px; border-radius: 14px; background: rgba(255,255,255,.08); text-align: center; display: flex; flex-direction: column; } .sgrid b { font-size: 1.6rem; color: var(--accent); } .sgrid span { font-size: .8rem; color: var(--muted); }

/* avisos */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font-size: clamp(2.2rem, 10vw, 3.8rem); font-weight: 700; color: #fff; -webkit-text-stroke: 3px rgba(42,24,86,.7); paint-order: stroke fill; text-align: center; white-space: nowrap; animation: banner 1.7s ease-out forwards; }
.banner.gold { color: var(--accent); }
@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%); } }
.conf { position: absolute; top: -20px; border-radius: 2px; animation: conf var(--t) cubic-bezier(.3,.6,.6,1) var(--dl) forwards; }
@keyframes conf { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }
#toasts { position: absolute; left: 0; right: 0; top: calc(66px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 45; padding: 0 12px; }
.toast { padding: 9px 16px; border-radius: 14px; background: rgba(28,15,61,.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: min(92vw, 520px); 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, 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,.07); font-weight: 600; }
.setting select { font-family: inherit; font-size: 1rem; font-weight: 600; padding: 7px 10px; border-radius: 10px; border: 0; background: #241250; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); max-width: 58%; }
.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: #6b5d8d; 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; text-shadow: none; }
.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: 80; 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-card { width: 54px; height: 70px; border-radius: 10px; background: #fff; animation: lflip 1s ease-in-out infinite; }
@keyframes lflip { 50% { transform: rotateY(180deg); background: var(--accent); } }
.noscript { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; }

/* ---------- horizontal: panel a la derecha ---------- */
@media (min-aspect-ratio: 5/4) {
  .gmain { flex-direction: row; }
  .side { width: clamp(220px, 27vw, 330px); grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; align-content: start; align-self: stretch; }
  .mine { grid-row: auto; flex-direction: row; justify-content: center; gap: 10px; }
  .mine-card { width: clamp(64px, 9vw, 110px); }
  .mine > span { font-size: .9rem; }
  .actions { flex-direction: column; align-self: end; }
  .actions .btn { flex: none; }
}
@media (min-aspect-ratio: 5/4) and (max-height: 520px) {
  #game { gap: 4px; padding-top: calc(4px + var(--safe-t)); padding-bottom: calc(4px + var(--safe-b)); }
  .gbar .icon-btn { width: 40px; height: 40px; border-radius: 12px; }
  .turn .who { padding: 5px 12px; font-size: .95rem; }
  .side { gap: 5px; }
  .mine-card { width: 46px; } .mine-card b { font-size: .6rem; }
  .bubble { min-height: 0; } .bb { padding: 5px 9px; } .bb .qq { font-size: .9rem; } .bb .lbl { font-size: .68rem; }
  .actions { gap: 6px; min-height: 0; } .actions .btn { min-height: 40px; font-size: .92rem; border-radius: 13px; }
  .btn .tag { top: -6px; }
  #toasts { top: calc(48px + var(--safe-t)); }
}
/* pantallas bajas: portada en dos columnas */
@media (max-height: 520px) {
  .title-screen { flex-direction: row; align-items: center; justify-content: space-around; }
  .fan { height: 110px; } .fan-card { width: 70px; }
  .logo .h1 { font-size: 2.8rem; } .logo p { font-size: .9rem; }
  .btn.big { min-height: 52px; font-size: 1.15rem; }
  .title-bottom { gap: 10px; }
  .card { padding: 14px; gap: 10px; } .card h2 { font-size: 1.45rem; }
  .settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .setting { padding: 4px 8px; } .settings .links { grid-column: 1 / -1; }
  .settings-p .card { width: min(720px, 100%); }
  .res-card { width: 86px; } .confirm-p .big-face { width: 90px; }
}
@media (max-width: 380px) { .actions .btn { font-size: .92rem; } .actions .btn svg { width: 1.05em; } .rv-t { display: none; } }
.over .row .btn, .result .row .btn { flex: 1 1 0; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .fan-card, .btn.pulse, #board.guessing .pc .pc-face, .pc.glow .pc-face { animation: none !important; } .pc-in { transition-duration: .01s; } }

/* ficha de la página (texto rastreable bajo el juego) — la procesa el generador del portal */
.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; }
