/* Trivia Party: estilos (DOM + SVG, 2D festivo). */
:root {
  --bg: #241a5e; --bg2: #120f38; --panel: #2c2378; --panel2: #3a2f96; --line: rgba(200,190,255,.2); --text: #fbf9ff; --muted: #b9b2ea;
  --accent: #ffd23f; --accent-text: #2a1a05; --mint: #3fd97b; --mint2: #1fa85a; --pink: #ff4f8b; --pink2: #d0245f; --danger: #ff5a6a;
  --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(--bg2); 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% 90% at 50% 0%, #4a36b8 0%, var(--bg) 45%, var(--bg2) 100%); }
#app::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle at 12% 18%, #ff4f8b 0 3px, transparent 4px), radial-gradient(circle at 82% 12%, #ffd23f 0 3px, transparent 4px), radial-gradient(circle at 68% 78%, #2f86ff 0 3px, transparent 4px), radial-gradient(circle at 22% 84%, #20c27a 0 3px, transparent 4px), radial-gradient(circle at 92% 52%, #a45cff 0 2px, transparent 3px), radial-gradient(circle at 6% 52%, #ff7a2f 0 2px, transparent 3px);
  background-size: 260px 260px; }
.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(--accent); outline-offset: 3px; }
a { color: var(--accent); }
input, select { -webkit-user-select: text; user-select: text; }
.howto-src[hidden] { display: none; }

/* ---------- 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; text-align: left; }
.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; }
.btn.pink { color: #fff; background: linear-gradient(180deg, #ff9cc0, var(--pink) 55%, var(--pink2)); box-shadow: 0 5px 0 #8f1440, 0 10px 22px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.45); }
.btn.pink:active { box-shadow: 0 1px 0 #8f1440; }
.btn.red { color: #fff; background: linear-gradient(180deg, #ff9aa3, var(--danger) 55%, #c9303f); box-shadow: 0 5px 0 #8a1824, 0 10px 22px rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.45); }
.btn.red:active { box-shadow: 0 1px 0 #8a1824; }
.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.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; }
.icon-btn { width: 50px; height: 50px; flex: none; border-radius: 16px; display: grid; place-items: center; color: var(--text); background: rgba(18,15,56,.72); box-shadow: inset 0 0 0 2px var(--line), 0 4px 12px rgba(0,0,0,.2); }
.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; z-index: 10; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; animation: in .25s ease-out both; padding: calc(12px + var(--safe-t)) calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + 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(10,8,34,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 2; }
.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,.45); 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 h3 { margin: 0; font-size: 1.1rem; color: var(--muted); }
.card .sub { margin: 0; color: var(--muted); font-size: 1rem; }
.card.scroll { max-height: min(88vh, 760px); }

/* portada */
.title-screen { justify-content: space-between; overflow: hidden; }
.title-bg { position: absolute; left: 50%; top: 42%; width: min(118vmin, 860px); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: .28; pointer-events: none; animation: spinbg 120s linear infinite; }
.title-bg svg { width: 100%; height: 100%; }
@keyframes spinbg { to { transform: translate(-50%, -50%) rotate(360deg); } }
.logo { position: relative; text-align: center; margin-top: 3vh; filter: drop-shadow(0 6px 0 rgba(0,0,0,.18)); }
.logo .h1 { display: flex; flex-direction: column; align-items: center; line-height: .85; font-weight: 700; }
.logo .l1 { font-size: clamp(3.4rem, 16vw, 6.6rem); -webkit-text-stroke: 4px #fff; paint-order: stroke fill; text-shadow: 0 6px 0 #2a1670, 0 10px 24px rgba(0,0,0,.3); transform: rotate(-3deg); letter-spacing: .01em; }
.logo .l1 i { font-style: normal; display: inline-block; animation: hopl 2.6s ease-in-out infinite; }
.logo .l1 i:nth-child(2) { animation-delay: .1s; } .logo .l1 i:nth-child(3) { animation-delay: .2s; } .logo .l1 i:nth-child(4) { animation-delay: .3s; } .logo .l1 i:nth-child(5) { animation-delay: .4s; } .logo .l1 i:nth-child(6) { animation-delay: .5s; }
@keyframes hopl { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-8px); } }
.logo .l2 { font-size: clamp(2.4rem, 11vw, 4.6rem); color: var(--accent); -webkit-text-stroke: 3px #8a4a0a; paint-order: stroke fill; text-shadow: 0 5px 0 #8a4a0a; transform: rotate(2deg); margin-top: .05em; }
.logo p { margin: .8em auto 0; display: inline-block; padding: .3em .9em; border-radius: 99px; background: rgba(18,15,56,.75); font-weight: 600; font-size: 1.05rem; }
.title-bottom { position: relative; display: flex; flex-direction: column; gap: 14px; align-items: stretch; width: min(380px, 100%); margin-bottom: 1vh; }
.title-bottom .btn.big { justify-content: flex-start; }
.title-bottom small { max-width: 15em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.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(18,15,56,.7); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; z-index: 1; }
.portal-link svg { width: 28px; height: 28px; }

/* preparación */
.setup-screen { padding: 0; }
.bar { width: 100%; display: flex; align-items: center; gap: 12px; padding: calc(10px + var(--safe-t)) calc(14px + var(--safe-r)) 6px calc(14px + var(--safe-l)); }
.bar h2 { flex: 1; margin: 0; font-size: 1.6rem; }
.setup-body { flex: 1; min-height: 0; width: 100%; overflow-y: auto; padding: 6px 14px 12px; display: flex; flex-direction: column; gap: 16px; align-items: center; touch-action: pan-y; }
.setup-col { width: min(560px, 100%); display: flex; flex-direction: column; gap: 8px; }
.setup-col h3 { margin: 4px 0 0; font-size: 1.05rem; color: var(--muted); }
.prow { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 16px; background: rgba(255,255,255,.07); box-shadow: inset 4px 0 0 var(--pc); animation: in .2s both; }
.pcolor { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; }
.pcolor:active { transform: scale(.9); }
.pname { flex: 1; min-width: 0; font: 600 1.05rem var(--font); padding: 9px 10px; border-radius: 11px; border: 0; background: #17124a; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.pbot, .setting select, .setting input { font-family: inherit; font-size: .95rem; font-weight: 600; padding: 8px; border-radius: 11px; border: 0; background: #17124a; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); max-width: 42%; }
.pdel { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,90,106,.2); color: #ffb3bb; }
.pdel svg { width: 20px; height: 20px; }
.pdel[disabled] { opacity: .3; pointer-events: none; }
.b-add { align-self: flex-start; }
.opts .opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.06); font-weight: 600; flex-wrap: wrap; }
.opt > span { display: flex; flex-direction: column; flex: 1 1 10em; min-width: 0; }
.opt .tog { flex: none; }
.opt small { font-size: .78rem; font-weight: 500; color: var(--muted); max-width: 22em; }
.seg { display: flex; background: rgba(0,0,0,.3); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { padding: 7px 11px; border-radius: 10px; font-weight: 600; font-size: .92rem; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-text); }
.setup-go { width: 100%; display: flex; justify-content: center; padding: 8px 14px calc(12px + var(--safe-b)); background: linear-gradient(180deg, transparent, rgba(18,15,56,.8) 40%); }
.setup-go .btn { width: min(380px, 100%); }
.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: #6b6699; transition: .2s; }
.tog.on i { background: var(--mint); transform: translateX(2px); }

/* ---------- partida de grupo ---------- */
.game-screen { display: grid; grid-template-rows: auto auto auto; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "board" "side"; gap: 8px; align-content: space-evenly; justify-items: stretch; padding: calc(6px + var(--safe-t)) calc(4px + var(--safe-r)) calc(8px + var(--safe-b)) calc(4px + var(--safe-l)); }
.g-top { grid-area: top; display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.players { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.pl { display: flex; align-items: center; gap: 5px; padding: 3px 10px 3px 3px; border-radius: 99px; background: rgba(18,15,56,.7); box-shadow: inset 0 0 0 2px rgba(255,255,255,.08); font-weight: 600; font-size: .95rem; max-width: 9.5em; transition: transform .2s, background .2s; }
.pl .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl.cur { background: color-mix(in srgb, var(--pc) 45%, #1a1450); box-shadow: inset 0 0 0 2px var(--pc), 0 0 14px color-mix(in srgb, var(--pc) 60%, transparent); transform: scale(1.06); }
.pl .botb svg { width: 14px; height: 14px; opacity: .8; display: block; }
.pie { display: block; flex: none; }
.pl .pie { width: 34px; height: 34px; }
.board-wrap { grid-area: board; min-height: 0; min-width: 0; display: grid; place-items: center; container-type: inline-size; }
.board-box { width: min(100cqw, calc(100dvh - 230px)); height: min(100cqw, calc(100dvh - 230px)); }
.board-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.board-svg .tok { transition: none; }
.board-svg.picking .tok { pointer-events: none; }
.board-svg .tok .halo { animation: halo 1.2s ease-in-out infinite; transform-origin: 0 0; }
@keyframes halo { 50% { transform: scale(1.25); opacity: .35; } }
.board-svg .opt { cursor: pointer; }
.board-svg .opt .ping { animation: ping 1.1s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ping { from { transform: scale(1); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.board-svg .flash { fill: none; stroke-width: .02; animation: flash .7s ease-out forwards; transform-box: fill-box; transform-origin: center; }
@keyframes flash { from { transform: scale(.6); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.g-side { grid-area: side; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; min-width: 0; }
.status { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 18px; background: rgba(18,15,56,.72); box-shadow: inset 4px 0 0 var(--pc, transparent), inset 0 0 0 2px var(--line); }
.status.bump { animation: in .25s both; }
.status b { font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status span { color: var(--muted); font-weight: 600; font-size: .98rem; min-height: 1.2em; }
.die-btn { flex: none; width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 2px var(--line); perspective: 420px; }
.die-btn.ready { background: rgba(255,210,63,.22); box-shadow: inset 0 0 0 3px var(--accent), 0 0 24px rgba(255,210,63,.45); animation: ready 1.1s ease-in-out infinite; }
@keyframes ready { 50% { transform: scale(1.07) rotate(-3deg); } }
.die-btn[disabled] { cursor: default; }
.die-btn.land .die3d { animation: land .3s ease-out; }
@keyframes land { 40% { transform: scale(1.15); } }
.die3d { width: 56px; height: 56px; transform-style: preserve-3d; }
.cube { position: relative; width: 56px; height: 56px; transform-style: preserve-3d; transform: rotateX(-22deg) rotateY(28deg); }
.face { position: absolute; inset: 0; border-radius: 12px; background: linear-gradient(145deg, #ffffff, #e6e1ff); box-shadow: inset 0 0 0 2px rgba(80,60,180,.25), inset 0 -4px 8px rgba(80,60,180,.15); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 8px; backface-visibility: hidden; }
.face i { border-radius: 50%; margin: 2px; }
.face i.on { background: radial-gradient(circle at 35% 30%, #6a5cff, #2a1d8f); }
.f1 { transform: translateZ(28px); } .f6 { transform: rotateY(180deg) translateZ(28px); } .f3 { transform: rotateY(90deg) translateZ(28px); }
.f4 { transform: rotateY(-90deg) translateZ(28px); } .f2 { transform: rotateX(90deg) translateZ(28px); } .f5 { transform: rotateX(-90deg) translateZ(28px); }
@media (orientation: landscape) and (min-aspect-ratio: 5/4) {
  .game-screen { grid-template-columns: minmax(0, 1fr) minmax(250px, 32%); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "board top" "board side"; gap: 8px; align-content: stretch; }
  .board-wrap { container-type: size; align-self: stretch; height: calc(100dvh - 14px - var(--safe-t) - var(--safe-b)); }
  .board-box { width: min(100cqw, 100cqh); height: min(100cqw, 100cqh); }
  .g-top { flex-direction: row; }
  .players { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; overflow-y: auto; max-height: 52vh; }
  .pl { max-width: none; font-size: .95rem; } .pl.cur { transform: translateX(-4px); }
  .g-side { flex-direction: column; justify-content: flex-end; align-items: stretch; }
  .g-side .die-btn { align-self: center; width: 104px; height: 104px; }
}

/* pasar el móvil, elegir categoría, final */
.pass-card { gap: 8px; box-shadow: inset 0 0 0 3px var(--pc), 0 20px 50px rgba(0,0,0,.45); }
.pass-pie { display: flex; justify-content: center; animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pop { from { transform: scale(0) rotate(-60deg); } }
.pass-card h2 { font-size: 2.4rem; color: #fff; overflow-wrap: anywhere; }
.pass-card .hint { margin: 0 0 8px; font-weight: 600; color: var(--accent); }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.catb { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 18px; background: var(--cc); box-shadow: 0 5px 0 var(--cd); color: #fff; font-weight: 700; font-size: 1rem; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.catb .cat-ico { width: 38px; height: 38px; }
.catb:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--cd); }
.catb.chosen { animation: bump .45s; box-shadow: 0 0 0 4px #fff, 0 5px 0 var(--cd); }
.catb[disabled]:not(.chosen) { opacity: .45; }
.final-star svg { width: 70px; height: 70px; color: var(--accent); filter: drop-shadow(0 0 16px rgba(255,210,63,.7)); animation: spin3 2s ease-in-out infinite; }
@keyframes spin3 { 50% { transform: rotate(20deg) scale(1.1); } }
.roulette { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.roulette span { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--cc) 30%, #1a1450); color: #fff; transition: transform .08s, background .08s; }
.roulette span.on { background: var(--cc); transform: scale(1.18); box-shadow: 0 0 0 3px #fff; }
.roulette .cat-ico { width: 30px; height: 30px; }
.rname { margin: 0; min-height: 1.4em; font-size: 1.3rem; font-weight: 700; color: var(--accent); }

/* ---------- pregunta ---------- */
.question { padding: calc(6px + var(--safe-t)) calc(6px + var(--safe-r)) calc(6px + var(--safe-b)) calc(6px + var(--safe-l)); }
.qcard { width: min(920px, 100%); height: 100%; max-height: 100%; display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; background: #fbfaff; color: #1d1650; box-shadow: 0 0 0 4px var(--cc), 0 24px 60px rgba(0,0,0,.5); animation: qin .35s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes qin { from { transform: scale(.85) translateY(20px); opacity: 0; } }
.qcard.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.qhead { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: linear-gradient(180deg, var(--cc), var(--cd)); color: #fff; font-size: 1.15rem; flex-wrap: wrap; }
.qhead > .cat-ico { width: 30px; height: 30px; flex: none; }
.qhead b { text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tags i { font-style: normal; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.25); }
.tags i.d1 { background: rgba(63,217,123,.45); } .tags i.d3 { background: rgba(255,90,106,.55); }
.who { margin-left: auto; display: flex; align-items: center; gap: 5px; padding: 2px 10px 2px 2px; border-radius: 99px; background: rgba(0,0,0,.25); font-size: .9rem; }
.who em { font-style: normal; font-weight: 700; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbody { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 14px; justify-content: space-between; }
.qbody .qtext { flex: 1; display: flex; align-items: center; justify-content: center; }
.qbody.swap { animation: qin .35s both; }
.qtext { margin: 0; font-size: clamp(1.7rem, 4.4vw + 1rem, 2.9rem); font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: break-word; -webkit-user-select: text; user-select: text; }
.qtext.long { font-size: clamp(1.5rem, 3.6vw + .9rem, 2.5rem); }
.answers { display: grid; grid-template-columns: 1fr; gap: 9px; }
.ans { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 14px 8px 8px; border-radius: 16px; background: #fff; color: #1d1650; font-size: clamp(1.08rem, 1.2vw + .8rem, 1.4rem); font-weight: 600; text-align: left; box-shadow: inset 0 0 0 2.5px #dcd6ff, 0 4px 0 #cfc8f7; transition: transform .1s, background .2s, opacity .3s; }
.ans b { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--cc); color: #fff; font-size: 1.05rem; }
.ans:active { transform: translateY(3px); box-shadow: inset 0 0 0 2.5px #dcd6ff; }
.ans.right { background: #d8ffe6; box-shadow: inset 0 0 0 3px var(--mint2), 0 4px 0 var(--mint2); animation: bump .4s; }
.ans.right b { background: var(--mint2); }
.ans.wrong { background: #ffe0e3; box-shadow: inset 0 0 0 3px var(--danger), 0 4px 0 #c9303f; }
.ans.wrong b { background: var(--danger); }
.ans.dim { opacity: .45; }
.ans.gone { opacity: .12; transform: scale(.96); pointer-events: none; }
.ans[disabled] { cursor: default; }
@keyframes bump { 40% { transform: scale(1.06); } }
.reveal:empty { display: none; }
.reveal { text-align: center; }
.verdict { display: flex; flex-direction: column; align-items: center; gap: 2px; animation: qin .3s both; }
.verdict b { font-size: 1.6rem; }
.verdict.ok b { color: var(--mint2); } .verdict.ko b { color: #d72f43; }
.verdict span { font-weight: 600; font-size: 1.05rem; }
.think { margin: 0; font-weight: 600; color: #6c63b8; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .4; } }
.read { margin: 0; font-weight: 600; color: #6c63b8; }
.answer-big { padding: 14px; border-radius: 18px; background: #d8ffe6; box-shadow: inset 0 0 0 3px var(--mint2); animation: qin .35s both; }
.answer-big b { font-size: clamp(1.4rem, 2vw + 1rem, 2.1rem); color: #0f5f33; }
.qfoot { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 6px 14px 14px; }
.qfoot:empty { display: none; }
.qfoot .btn.big { width: min(360px, 100%); }
.qfoot .judge { width: 100%; flex-wrap: nowrap; } .qfoot .judge .btn { flex: 1; }
.helps { display: flex; gap: 10px; justify-content: center; }
.helps:empty { display: none; }
.help { display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 9px; border-radius: 99px; background: #eeeaff; color: #3b2f96; font-weight: 700; font-size: .98rem; box-shadow: inset 0 0 0 2px #d5ceff; }
.help svg { width: 20px; height: 20px; }
.help small { display: flex; align-items: center; font-size: .72rem; padding: 2px 7px; border-radius: 99px; background: var(--mint); color: #06301a; }
.help small svg { width: 16px; height: 16px; }
.help[disabled] { opacity: .5; }
.help:active { transform: scale(.95); }
@media (min-width: 640px) { .answers { grid-template-columns: 1fr 1fr; } }
@media (orientation: landscape) and (max-height: 560px) {
  .qbody { padding: 10px 12px 6px; gap: 10px; }
  .qtext { font-size: clamp(1.3rem, 2.4vw + .6rem, 1.9rem); }
  .answers { grid-template-columns: 1fr 1fr; gap: 7px; }
  .ans { min-height: 48px; font-size: 1.1rem; }
  .ans b { width: 32px; height: 32px; }
  .qhead { padding: 6px 12px; font-size: 1rem; }
  .qfoot { padding: 4px 12px 10px; flex-direction: row; justify-content: center; }
  .qfoot .btn.big { min-height: 50px; font-size: 1.15rem; }
}

/* ---------- contrarreloj ---------- */
.ta-screen { padding: 0; }
.ta-top { width: 100%; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) calc(12px + var(--safe-r)) 4px calc(12px + var(--safe-l)); }
.ta-hud { position: relative; flex: 1; display: flex; align-items: center; gap: 12px; }
.ta-bar { position: relative; flex: 1; height: 34px; border-radius: 99px; background: rgba(18,15,56,.75); box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; }
.ta-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 66%; border-radius: 99px; background: linear-gradient(90deg, var(--mint2), var(--mint)); transition: width .25s linear; }
.ta-bar b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.15rem; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.ta-screen.hurry .ta-bar i { background: linear-gradient(90deg, #c9303f, var(--danger)); animation: blink .5s ease-in-out infinite; }
.ta-nums { display: flex; flex-direction: column; align-items: flex-end; min-width: 76px; }
.ta-score { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--accent); }
.ta-score.bump { animation: bump .3s; }
.ta-streak { font-size: .85rem; font-weight: 700; color: #ffb3d0; min-height: 1em; }
.float { position: absolute; right: 70px; top: 6px; font-weight: 700; font-size: 1.3rem; animation: floatup .9s ease-out forwards; pointer-events: none; -webkit-text-stroke: 1.5px rgba(0,0,0,.4); paint-order: stroke fill; }
.float.ok { color: #7dffad; } .float.ko { color: #ff8a95; }
@keyframes floatup { from { opacity: 0; transform: translateY(8px); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-28px); } }
#ta-host { position: relative; flex: 1; width: 100%; min-height: 0; }
#ta-host .question { background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* ---------- final ---------- */
.win .card { width: min(460px, 100%); }
.win-pie { position: relative; display: flex; justify-content: center; animation: pop .6s cubic-bezier(.3,1.6,.5,1) both; }
.win-pie .crown { position: absolute; top: -26px; left: 50%; transform: translateX(-50%) rotate(-8deg); color: var(--accent); filter: drop-shadow(0 3px 0 #8a4a0a); }
.win-pie .crown svg { width: 54px; height: 54px; }
.stand { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.stand li { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 14px; background: rgba(255,255,255,.06); box-shadow: inset 4px 0 0 var(--pc); }
.stand li.win { background: rgba(255,210,63,.18); }
.stand li span { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stand li b { font-size: .95rem; } .stand li small { color: var(--muted); font-weight: 600; min-width: 6.5em; text-align: right; }
.over-score { display: flex; flex-direction: column; gap: 4px; }
.over-score b { font-size: 3.4rem; line-height: 1; color: var(--accent); text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.over-score span { color: var(--muted); font-weight: 600; }
.record .card h2 { color: var(--accent); }
.over .row .btn, .win .row .btn { flex: 1 1 0; min-width: 0; padding-left: .6em; padding-right: .6em; font-size: 1rem; }
.over .row, .win .row { flex-wrap: nowrap; }

/* ---------- 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 { max-width: 55%; }
.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; }

/* ---------- avisos y confeti ---------- */
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
.banner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); max-width: 94vw; font-size: clamp(1.9rem, 8vw, 3.4rem); font-weight: 700; color: #fff; -webkit-text-stroke: 3px rgba(20,12,60,.65); paint-order: stroke fill; text-align: center; animation: banner 1.7s ease-out forwards; line-height: 1.05; }
.banner.gold { color: var(--accent); } .banner.turn { font-size: clamp(1.6rem, 6vw, 2.8rem); }
.banner.wedge { font-size: clamp(2rem, 9vw, 3.8rem); }
@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(124px + var(--safe-t)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 50; }
.toast { padding: 8px 16px; border-radius: 14px; background: rgba(18,15,56,.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; }

/* 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: 90; background: var(--bg2); transition: opacity .4s; }
#loader.out { opacity: 0; pointer-events: none; }
.loader-dot { width: 64px; height: 64px; border-radius: 50%; border: 8px solid rgba(255,210,63,.25); border-top-color: var(--accent); 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: 3.4rem; } .logo .l2 { font-size: 2.3rem; } .logo p { display: none; }
  .title-screen { flex-direction: row; align-items: center; justify-content: space-around; }
  .btn.big { min-height: 52px; font-size: 1.15rem; }
  .title-bottom { gap: 10px; }
  .card { padding: 14px; gap: 10px; } .card h2 { font-size: 1.5rem; }
  .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%); }
  .card .b-close { position: sticky; bottom: 0; }
  .setup-body { flex-direction: row; align-items: flex-start; justify-content: center; }
  .setup-go { padding-top: 4px; }
  .pass-card h2 { font-size: 1.9rem; } .pass-pie svg { width: 64px; height: 64px; }
  .win .card { width: min(720px, 100%); display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 18px; }
  .win .card h2, .win .card .col { grid-column: 1 / -1; } .win .card .col { flex-direction: row; } .win .card .col .btn.big { flex: 1; }
  .win-pie svg { width: 80px; height: 80px; } .win h3 { display: none; }
  .win .card .col > .row { flex: 1; min-width: 0; }
  .cats { grid-template-columns: repeat(3, 1fr); } .catb { padding: 8px; } .catb .cat-ico { width: 28px; height: 28px; }
  #toasts { top: calc(56px + var(--safe-t)); }
  .die-btn { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) { .title-bg, .die-btn.ready, .board-svg .opt .ping, .tok .halo { animation: 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; }
