/* Mini Fiesta — estilo Memphis: bordes gruesos, sombras duras, colores pop y figuras geométricas. */
:root {
  --ink: #111;
  --pink: #ff90b3;
  --teal: #2ec4b6;
  --yellow: #ffd23f;
  --lilac: #b388eb;
  --red: #ef476f;
  --blue: #3a86ff;
  --orange: #ff8c42;
  --green: #06d6a0;
  --cream: #fff6d6;
  --paper: #fff;
  --geo: "Outfit", "Futura", "Futura PT", "Century Gothic", "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  --mono: "Space Mono", "Menlo", "Consolas", "DejaVu Sans Mono", monospace;
  --b: 3px solid var(--ink);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--geo);
  font-size: 17px;
  line-height: 1.45;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(17, 17, 17, .06) 1.5px, transparent 1.5px),
    linear-gradient(90deg, rgba(17, 17, 17, .06) 1.5px, transparent 1.5px);
  background-size: 44px 44px;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
svg { display: block; }

/* --------------------------------------------------------------- deco */
.deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.deco svg { position: absolute; opacity: .9; }
.deco .d1 { width: 120px; top: 84px; right: -26px; transform: rotate(-12deg); }
.deco .d2 { width: 74px; bottom: 9%; left: -22px; transform: rotate(18deg); }
.deco .d3 { width: 90px; top: -30px; left: -30px; }
.deco .d4 { width: 70px; bottom: -18px; right: 14%; }
.deco .d5 { width: 64px; top: 42%; right: -20px; opacity: .25; }
.deco .d6 { width: 110px; bottom: 22%; right: -40px; transform: rotate(80deg); }
body[data-phase="play"] .deco, body[data-phase="countdown"] .deco { display: none; }

/* ------------------------------------------------------------ layout */
#main { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 14px 16px calc(28px + var(--safe-b)); }
body[data-phase="play"] #main { padding: 0; max-width: none; }
.screen.enter { animation: enter .45s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(26px) rotate(1deg); } }

#top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: var(--b); }
#top .bar { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
#top .sp { flex: 1; }
#top .prog { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.icon { width: 40px; height: 40px; border: var(--b); background: #fff; font-size: 18px; box-shadow: 3px 3px 0 var(--ink); display: grid; place-items: center; padding: 0; }
.icon:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.banner { position: fixed; top: 0; left: 0; right: 0; z-index: 95; padding: 8px; text-align: center; background: var(--ink); color: var(--yellow); font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .65; } }

/* --------------------------------------------------------- tipografía */
.title { margin: 6px 0 0; font-weight: 900; text-transform: uppercase; line-height: .86; letter-spacing: -.01em; font-size: clamp(60px, 21vw, 118px); transform: rotate(-4deg); }
.title .word { display: block; white-space: nowrap; }
.title i { display: inline-block; font-style: normal; -webkit-text-stroke: .045em var(--ink); paint-order: stroke fill; animation: letter .6s cubic-bezier(.3, 1.8, .5, 1) both; }
.title .w1 i { color: var(--pink); text-shadow: .05em .05em 0 var(--teal), .1em .1em 0 var(--ink); }
.title .w2 { margin-left: .35em; }
.title .w2 i { color: var(--yellow); text-shadow: .05em .05em 0 var(--red), .1em .1em 0 var(--ink); }
.title .w1 i:nth-child(2n) { transform: translateY(.04em) rotate(4deg); }
.title .w2 i:nth-child(2n+1) { transform: translateY(-.03em) rotate(-4deg); }
.title i:nth-child(1) { animation-delay: .02s; } .title i:nth-child(2) { animation-delay: .07s; } .title i:nth-child(3) { animation-delay: .12s; }
.title i:nth-child(4) { animation-delay: .17s; } .title i:nth-child(5) { animation-delay: .22s; } .title i:nth-child(6) { animation-delay: .27s; }
@keyframes letter { from { opacity: 0; transform: translateY(.4em) scale(.6) rotate(-20deg); } }
.ribbon { display: inline-block; margin: 26px 0 6px 8px; padding: 8px 14px; background: var(--ink); color: var(--yellow); transform: rotate(2.5deg); font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; box-shadow: 6px 6px 0 var(--lilac); }
.ribbon b { color: var(--pink); }
.kicker { display: inline-block; margin: 6px 0 10px; padding: 4px 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; background: var(--ink); color: #fff; }
h2 { margin: 0; font-weight: 900; font-size: 28px; line-height: 1; text-transform: uppercase; letter-spacing: -.005em; }
h3 { margin: 0 0 12px; font-weight: 900; font-size: 24px; text-transform: uppercase; }
.fine { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: #444; }
.center { text-align: center; }
.small { font-size: 14px; margin: 0 0 6px; }
.big { font-size: 20px; font-weight: 800; }
.warn { margin: 10px 0 0; padding: 10px 12px; background: var(--cream); border: 2px dashed var(--ink); font-size: 14px; }
.sechead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; flex-wrap: wrap; }
.sechead h2.pick { text-shadow: .11em .11em 0 var(--yellow); }
.sub { margin-top: 26px; font-size: 18px; }

/* ----------------------------------------------------------- botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border: var(--b); border-radius: 0; background: var(--pink); color: var(--ink); font-weight: 800; font-size: 16px; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; box-shadow: 5px 5px 0 var(--ink); transition: transform .12s ease, box-shadow .12s ease, background-color .2s ease; user-select: none; }
.btn:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .5; box-shadow: 2px 2px 0 var(--ink); cursor: default; }
.btn.y { background: var(--yellow); } .btn.t { background: var(--teal); } .btn.l { background: var(--lilac); }
.btn.w { background: #fff; } .btn.r { background: var(--red); color: #fff; }
.btn.big { padding: 16px 20px; font-size: 19px; box-shadow: 7px 7px 0 var(--ink); }
.btn.wide { width: 100%; }
.btn.grow { flex: 1; }
.btn.sq { width: 48px; height: 48px; padding: 0; font-size: 24px; }
.link { display: block; margin: 12px auto 0; padding: 6px; background: none; border: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; text-decoration: underline; text-underline-offset: 3px; }
.chip { padding: 6px 10px; border: var(--b); background: #fff; font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; box-shadow: 3px 3px 0 var(--ink); }
.chip.code { background: var(--yellow); }
.chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.tight { gap: 8px; }
.stack { display: grid; gap: 12px; }
.actions { display: grid; gap: 12px; margin-top: 20px; }
.foot { display: grid; gap: 10px; margin-top: 22px; }

/* ------------------------------------------------------------ tarjetas */
.card { position: relative; margin: 18px 0; padding: 18px; background: #fff; border: var(--b); box-shadow: 8px 8px 0 var(--sh, var(--ink)); }
.tilt-l { transform: rotate(-1deg); } .tilt-r { transform: rotate(1deg); }
.tape { position: absolute; left: 50%; top: -15px; width: 104px; height: 26px; margin-left: -52px; background: rgba(255, 210, 63, .88); border: 2px solid var(--ink); transform: rotate(-5deg); }
.lbl { display: block; margin: 14px 0 6px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.input { width: 100%; padding: 12px 14px; border: var(--b); background: #fff; font-size: 18px; font-weight: 700; outline: none; border-radius: 0; box-shadow: inset 4px 4px 0 rgba(17, 17, 17, .07); }
.input:focus { background: var(--cream); }
.codein { text-align: center; font-family: var(--mono); font-size: 32px; letter-spacing: .35em; text-transform: uppercase; }
.roominfo p { margin: 0 0 4px; }
.codechip { display: inline-block; padding: 0 6px; background: var(--yellow); border: 2px solid var(--ink); font-family: var(--mono); }
.home .hero { padding: 18px 4px 4px; }

/* ----------------------------------------------------------- avatares */
.av { display: inline-block; width: 40px; height: 40px; flex: none; }
.av svg { width: 100%; height: 100%; overflow: visible; }
.avgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.avbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 4px; border: var(--b); background: #fff; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), background-color .15s; }
.avbtn .av { width: 100%; height: auto; aspect-ratio: 1; max-width: 62px; }
.avbtn small { font-family: var(--mono); font-size: 10px; letter-spacing: .02em; text-transform: uppercase; }
.avbtn.sel { background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px) rotate(-3deg); }
.avbtn.sel .av { animation: wiggle .5s ease; }
.avbtn.busy { opacity: .35; filter: grayscale(1); }
@keyframes wiggle { 30% { transform: rotate(-12deg) scale(1.12); } 60% { transform: rotate(8deg); } }

/* --------------------------------------------------------------- lobby */
.roomcode { text-align: center; margin-top: 6px; }
.roomcode .letters { display: flex; justify-content: center; gap: 10px; }
.roomcode .letters i { display: grid; place-items: center; width: 64px; height: 76px; font-style: normal; font-weight: 900; font-size: 46px; border: var(--b); box-shadow: 5px 5px 0 var(--ink); background: var(--yellow); animation: letter .55s cubic-bezier(.3, 1.7, .5, 1) both; animation-delay: calc(var(--d) * 80ms); }
.roomcode .letters i:nth-child(2) { background: var(--pink); transform: rotate(4deg); }
.roomcode .letters i:nth-child(3) { background: var(--teal); transform: rotate(-3deg); }
.roomcode .letters i:nth-child(4) { background: var(--lilac); transform: rotate(3deg); }
.share { display: flex; gap: 14px; align-items: center; }
.qr { flex: none; width: 128px; height: 128px; padding: 4px; border: var(--b); background: #fff; }
.qr svg { width: 100%; height: 100%; }
.sharebody { min-width: 0; flex: 1; }
.link { word-break: break-all; }
code.link { display: block; margin: 0 0 10px; padding: 6px 8px; background: var(--cream); border: 2px dashed var(--ink); font-family: var(--mono); font-size: 12px; text-decoration: none; }
@media (max-width: 380px) { .share { flex-direction: column; align-items: stretch; } .qr { margin: 0 auto; } }
.count { font-family: var(--mono); font-weight: 700; padding: 2px 8px; border: 2px solid var(--ink); background: #fff; }
.players { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.player { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; border: var(--b); background: #fff; box-shadow: 4px 4px 0 var(--ink); animation: enter .4s cubic-bezier(.3, 1.5, .5, 1) both; }
.player .av { width: 46px; height: 46px; }
.player .nm { font-weight: 800; font-size: 16px; line-height: 1.1; word-break: break-word; flex: 1; min-width: 60px; }
.player.me { background: var(--cream); }
.player.off { opacity: .55; }
.badge { padding: 1px 6px; border: 2px solid var(--ink); background: #fff; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.badge.crown { position: absolute; top: -12px; left: -8px; border: 0; background: none; font-size: 20px; transform: rotate(-18deg); }
.badge.edit { background: var(--yellow); }
.badge.offline { background: var(--ink); color: #fff; }
.kick { position: absolute; top: -10px; right: -10px; width: 28px; height: 28px; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: #fff; font-weight: 900; font-size: 13px; line-height: 1; }
.waiting { margin: 8px 0 0; text-align: center; font-size: 16px; }
.dots { display: inline-block; animation: blink 1s infinite; }

/* --------------------------------------------------------------- setup */
.gamelist { display: grid; gap: 12px; }
.gamecard { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; border: var(--b); background: #fff; box-shadow: 2px 2px 0 var(--ink); opacity: .6; transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), box-shadow .15s, opacity .15s; }
.gamecard.on { opacity: 1; box-shadow: 6px 6px 0 var(--tint); transform: translate(-2px, -2px); }
.gamecard:disabled { cursor: default; color: var(--ink); }
.gamecard .gtxt { flex: 1; display: flex; flex-direction: column; }
.gamecard .gtxt b { font-size: 17px; line-height: 1.15; }
.gamecard .gtxt small { font-size: 13px; color: #444; }
.gamecard .check { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: var(--b); background: #fff; font-weight: 900; }
.gamecard.on .check { background: var(--ink); color: var(--yellow); }
.gtile { display: inline-grid; place-items: center; width: 52px; height: 52px; flex: none; font-size: 28px; line-height: 1; background: var(--tint, var(--yellow)); border: var(--b); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-4deg); }
.gtile.sm { width: 32px; height: 32px; font-size: 17px; box-shadow: 2px 2px 0 var(--ink); border-width: 2px; }
.gtile.xl { width: 84px; height: 84px; font-size: 46px; box-shadow: 5px 5px 0 var(--ink); }
.roundsbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.roundsbox div:first-child { display: flex; flex-direction: column; }
.roundsbox small { font-size: 13px; color: #444; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .rounds { min-width: 34px; text-align: center; font-size: 30px; font-weight: 900; }
.stepper.ro .btn { display: none; }
.summary { margin: 0; padding: 10px 12px; text-align: center; font-family: var(--mono); font-size: 13px; background: var(--ink); color: var(--yellow); }

/* -------------------------------------------------------- explicación */
.briefcard { padding: 0; overflow: hidden; }
.briefhead { display: flex; align-items: center; gap: 16px; padding: 18px; background: var(--tint); border-bottom: var(--b); }
.briefhead > div { min-width: 0; }
.briefhead h2 { font-size: clamp(22px, 7vw, 30px); overflow-wrap: anywhere; }
.briefhead h2.long { font-size: clamp(18px, 5.6vw, 30px); }
.briefhead p { margin: 4px 0 0; font-weight: 700; }
.how { margin: 0; padding: 16px 18px 6px; list-style: none; counter-reset: how; }
.how li { position: relative; padding: 0 0 12px 40px; counter-increment: how; }
.how li::before { content: counter(how); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font-weight: 900; font-size: 14px; }
.how li:nth-child(2)::before { background: var(--pink); } .how li:nth-child(3)::before { background: var(--teal); } .how li:nth-child(4)::before { background: var(--lilac); }
.memnote { margin: 0 18px 18px; padding: 8px 10px; border: 2px dashed var(--ink); background: var(--cream); font-size: 14px; }
.confirms { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0; }
.confirms .cf { position: relative; display: flex; flex-direction: column; align-items: center; width: 64px; opacity: .45; transition: opacity .2s, transform .3s cubic-bezier(.3, 1.8, .5, 1); }
.confirms .cf.ok { opacity: 1; transform: translateY(-4px); }
.confirms .cf.off { filter: grayscale(1); }
.confirms .av { width: 44px; height: 44px; }
.confirms small { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.tick { position: absolute; top: -4px; right: 4px; display: grid; place-items: center; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 50%; background: var(--green); font-style: normal; font-weight: 900; font-size: 11px; }
.lastcall { margin: 0 0 14px; padding: 12px; text-align: center; background: var(--red); color: #fff; border: var(--b); box-shadow: 5px 5px 0 var(--ink); font-weight: 800; font-size: 18px; animation: pulse 1s infinite; }
.lastcall b { display: inline-block; min-width: 1.4em; font-size: 28px; }
@keyframes pulse { 50% { transform: scale(1.03); } }

/* --------------------------------------------------- cuenta regresiva */
.countdown { min-height: calc(100dvh - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.cdgame { display: flex; align-items: center; gap: 10px; font-size: 22px; text-transform: uppercase; }
.cdnum { display: grid; place-items: center; width: min(62vw, 300px); aspect-ratio: 1; font-weight: 900; font-size: min(46vw, 220px); line-height: 1; background: var(--bg, var(--yellow)); border: 5px solid var(--ink); box-shadow: 14px 14px 0 var(--ink); transform: rotate(-5deg); -webkit-text-stroke: 4px var(--ink); color: #fff; text-shadow: 8px 8px 0 var(--ink); }
.cdnum.pop { animation: cdpop .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes cdpop { from { transform: scale(.4) rotate(-40deg); } }
.cdhint { margin: 0; font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; }

/* --------------------------------------------------------------- juego */
.play { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.gamebar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-bottom: var(--b); height: 58px; }
.gname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gname b { font-size: 14px; line-height: 1.05; text-transform: uppercase; max-width: 96px; }
.pstrip { flex: 1; display: flex; justify-content: center; gap: 3px; padding: 6px 5px; overflow: hidden; }
.pa { position: relative; opacity: .45; transition: opacity .2s; }
.pa.done { opacity: 1; }
.pa .av { width: 28px; height: 28px; }
.pa .tick { top: -5px; right: -4px; width: 13px; height: 13px; border-width: 1.5px; font-size: 8px; }
.pa .lv { position: absolute; bottom: -4px; right: -4px; min-width: 12px; padding: 0 2px; border: 1.5px solid var(--ink); background: var(--yellow); font-style: normal; font-weight: 900; font-size: 8px; line-height: 10px; text-align: center; }
.timer { min-width: 58px; padding: 4px 8px; text-align: center; font-family: var(--mono); font-weight: 700; font-size: 22px; border: var(--b); background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.timer:empty { visibility: hidden; }
.timer.hurry { background: var(--red); color: #fff; animation: pulse .5s infinite; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 14px 16px calc(18px + var(--safe-b)); }
.stage > div { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ghint { margin: 0; text-align: center; font-weight: 800; font-size: 19px; }
.spectate { margin-top: 18vh; text-align: center; }
.doneover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(255, 255, 255, .82); text-align: center; z-index: 3; }
.doneover b { font-size: 26px; font-weight: 900; }

/* igualar color */
.fullcolor { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(40px + var(--safe-b)); animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; } }
.fc-label { display: flex; flex-direction: column; align-items: center; padding: 10px 18px; background: #fff; border: var(--b); box-shadow: 6px 6px 0 var(--ink); transform: rotate(-2deg); }
.fc-label b { font-size: 20px; }
.fc-label small { font-family: var(--mono); font-size: 11px; text-transform: uppercase; }
.swatchwrap { position: relative; width: min(72vw, 32dvh, 300px); aspect-ratio: 1; }
.swatch { width: 100%; height: 100%; border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); }
.srow { width: 100%; display: grid; gap: 4px; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 38px; margin: 0; border: var(--b); background: #ddd; outline: none; touch-action: pan-y; }
.range.hue { background: linear-gradient(90deg, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00) !important; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 46px; border: var(--b); background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.range::-moz-range-thumb { width: 26px; height: 42px; border: var(--b); border-radius: 0; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.range:disabled { opacity: .6; }

/* pulsa rápido */
.stage > .g-react { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; text-align: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; transition: background-color .05s; }
.g-react.red { background: var(--red); background-image: repeating-linear-gradient(45deg, rgba(0, 0, 0, .08) 0 18px, transparent 18px 36px); }
.g-react.green { background: var(--green); }
.g-react.done { background: var(--teal); }
.g-react.early { background: var(--ink); background-image: repeating-linear-gradient(45deg, var(--yellow) 0 22px, var(--ink) 22px 44px); }
.rbig { padding: 10px 20px; font-size: clamp(44px, 15vw, 90px); font-weight: 900; line-height: 1; background: #fff; border: 4px solid var(--ink); box-shadow: 9px 9px 0 var(--ink); transform: rotate(-3deg); }
.green .rbig { transform: scale(1.1) rotate(2deg); background: var(--yellow); }
.rsmall { padding: 6px 12px; background: #fff; border: 2px solid var(--ink); font-weight: 800; }
.rsmall:empty { display: none; }

/* detén el tiempo */
.target { display: flex; flex-direction: column; align-items: center; padding: 10px 26px; background: var(--yellow); border: var(--b); box-shadow: 6px 6px 0 var(--ink); transform: rotate(-2deg); }
.target small { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.target b { font-size: 40px; font-weight: 900; line-height: 1; }
.watch { margin-top: 10px; font-family: var(--mono); font-weight: 700; font-size: clamp(56px, 20vw, 110px); line-height: 1; letter-spacing: -.04em; transition: filter .4s, opacity .4s; }
.watch.gone { filter: blur(6px); opacity: .25; }
.watch.final { color: var(--red); animation: cdpop .45s cubic-bezier(.3, 1.8, .5, 1); }
.wmsg { margin: 0; min-height: 1.4em; font-weight: 800; font-size: 18px; text-align: center; }
.stopbtn { margin-top: 10px; width: min(62vw, 34dvh, 260px); aspect-ratio: 1; border: 5px solid var(--ink); border-radius: 50%; background: var(--red); color: #fff; font-weight: 900; font-size: clamp(26px, 8vw, 38px); letter-spacing: .04em; text-shadow: 3px 3px 0 var(--ink); box-shadow: 10px 10px 0 var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; }
.stopbtn:active:not(:disabled) { transform: translate(7px, 7px); box-shadow: 3px 3px 0 var(--ink); }
.stopbtn:disabled { background: #bbb; }

/* corta por la mitad */
.cutwhat { margin: 0; font-size: 17px; text-align: center; }
.cutwrap { position: relative; width: min(92vw, 52dvh, 480px); aspect-ratio: 1; }
.cutsvg { width: 100%; height: 100%; border: var(--b); background-color: var(--cream); box-shadow: 8px 8px 0 var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; }
.cut-ext { stroke: var(--ink); stroke-width: 4; stroke-dasharray: 18 14; opacity: .55; }
.cut-seg { stroke: var(--red); stroke-width: 9; stroke-linecap: round; }
.cut-h { fill: #fff; stroke: var(--ink); stroke-width: 7; }
.cut-line.bad .cut-seg { stroke: #999; }
.pieces .piece { transition: transform .8s cubic-bezier(.3, 1.6, .5, 1); }
.pieces.apart .piece { transform: translate(var(--tx), var(--ty)); }
.pct { font-family: var(--geo); font-size: 70px; font-weight: 900; text-anchor: middle; dominant-baseline: middle; fill: var(--ink); stroke: #fff; stroke-width: 14px; paint-order: stroke; }
.verdict { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%) rotate(-2deg); display: flex; flex-direction: column; align-items: center; padding: 8px 16px; white-space: nowrap; background: var(--yellow); border: var(--b); box-shadow: 5px 5px 0 var(--ink); animation: cdpop .5s cubic-bezier(.3, 1.8, .5, 1); }
.verdict b { font-size: 20px; font-weight: 900; }
.verdict span { font-family: var(--mono); font-size: 13px; }
.g-cut .row { width: 100%; margin-top: 6px; }

/* replica el dibujo / círculo */
.paper { position: relative; display: block; width: min(90vw, 50dvh, 460px); aspect-ratio: 1; background: #fff; border: var(--b); box-shadow: 8px 8px 0 var(--ink); }
.paper.show { animation: fadein .2s ease; }
.refsvg, .paper > svg { width: 100%; height: 100%; }
.drawcv { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; transition: opacity .4s; }
.drawcv.fade { opacity: 0; }
.g-draw .row { width: 100%; justify-content: center; }
.g-draw .row .btn.w { padding: 12px 12px; font-size: 14px; }
.paper.round { border-radius: 0; }
.cdot { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ink); pointer-events: none; }
.cscore { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-3deg); display: flex; flex-direction: column; align-items: center; padding: 10px 18px; background: var(--yellow); border: var(--b); box-shadow: 6px 6px 0 var(--ink); pointer-events: none; animation: cdpop .5s cubic-bezier(.3, 1.8, .5, 1); }
.cscore b { font-size: 46px; font-weight: 900; line-height: 1; }

/* recuerda el patrón */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: min(84vw, calc((100dvh - 250px) * 2 / 3), 380px); }
.ptile { aspect-ratio: 1; padding: 0; border: 4px solid var(--ink); background: var(--c); box-shadow: 6px 6px 0 var(--ink); display: grid; place-items: center; transition: transform .12s ease, filter .12s ease, box-shadow .12s ease; user-select: none; -webkit-user-select: none; touch-action: none; }
.tshape { width: 46%; height: 46%; }
.pgrid.watching .ptile, .pgrid.locked .ptile { cursor: default; }
.pgrid.watching .ptile { filter: saturate(.15) brightness(.72); }
.ptile.lit, .pgrid.watching .ptile.lit { filter: brightness(1.12) saturate(1.3); transform: translate(-4px, -4px) scale(1.06); box-shadow: 12px 12px 0 var(--ink), inset 0 0 0 8px #fff; transition-duration: .05s; }
.pgrid.locked .ptile { opacity: .7; }
.pdots { display: flex; gap: 6px; }
.pdots i { width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; }
.pdots i.on { background: var(--ink); }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px) rotate(-1deg); } 40%, 80% { transform: translateX(10px) rotate(1deg); } }

/* ojo de lince */
.owrap { position: relative; }
.ogrid { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 6px; width: min(92vw, 60dvh, 480px); padding: 8px; background: #fff; border: var(--b); box-shadow: 8px 8px 0 var(--ink); }
.ogrid.pop { animation: cdpop .35s cubic-bezier(.3, 1.6, .5, 1); }
.otile { aspect-ratio: 1; padding: 0; border: 2px solid var(--ink); touch-action: none; }
.otile:active { transform: scale(.93); }
.ogrid.locked { opacity: .5; pointer-events: none; }
.freeze { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 900; background: rgba(160, 231, 255, .78); border: var(--b); }

/* territorio */
.tlegend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tl { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; border: 2px solid var(--ink); background: var(--c); transition: transform .2s; }
.tl .av { width: 26px; height: 26px; }
.tl b { font-size: 16px; min-width: 1.2em; }
.tl.me { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.twrap { position: relative; }
.tgrid { display: grid; grid-template-columns: repeat(var(--n, 8), 1fr); gap: 3px; width: min(94vw, calc(100dvh - 240px), 480px); padding: 6px; background: #fff; border: var(--b); box-shadow: 8px 8px 0 var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; transition: box-shadow .2s; }
.tgrid.armed { box-shadow: 8px 8px 0 var(--ink), 0 0 0 5px var(--yellow); }
.tgrid.over { opacity: .6; pointer-events: none; }
.tcell { position: relative; aspect-ratio: 1; padding: 0; border: 2px solid rgba(17, 17, 17, .15); background: #f4f1ea; touch-action: none; }
.tcell.own { border-color: var(--ink); }
.tcell.mine { box-shadow: inset 0 0 0 2px #fff; }
.tcell.hit { animation: tcell .18s ease; }
@keyframes tcell { 50% { transform: scale(.82); } }
.tcell.pu::after { content: attr(data-icon); position: absolute; inset: -5px; z-index: 2; display: grid; place-items: center; font-size: 15px; background: var(--yellow); border: 2px solid var(--ink); border-radius: 50%; animation: pupulse .45s ease-in-out infinite alternate; }
.tcell.grab::after { background: #fff; opacity: .6; animation: none; }
@keyframes pupulse { to { transform: scale(1.18) rotate(12deg); } }
.tgrid.mini { width: 110px; gap: 1px; padding: 3px; border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
.tgrid.mini .tcell { border-width: 1px; }
.tstatus.hot { padding: 4px 10px; background: var(--yellow); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }

/* impostor exprés */
.wordcard { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; padding: 12px; text-align: center; background: var(--lilac); border: var(--b); box-shadow: 6px 6px 0 var(--ink); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; cursor: pointer; }
.wordcard small { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.wword { font-weight: 900; font-size: clamp(32px, 11vw, 54px); line-height: 1.05; text-transform: uppercase; transition: filter .2s; word-break: break-word; }
.wordcard .peek { display: none; font-size: 13px; font-weight: 700; }
.wordcard.hide .wword { filter: blur(14px); }
.wordcard.hide .peek { display: block; }
.wbody { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wform { width: 100%; display: grid; gap: 10px; }
.input.clue { font-size: 24px; text-align: center; }
.werr { margin: 0; min-height: 1.3em; text-align: center; font-weight: 800; color: var(--red); }
.wdone { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; background: var(--cream); border: 3px dashed var(--ink); }
.wdone b { font-size: 20px; }
.cluelist { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.clue { padding: 12px 16px; border: var(--b); background: #fff; font-weight: 800; font-size: 20px; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s cubic-bezier(.3, 1.6, .5, 1); }
.clue.sel { background: var(--yellow); transform: translate(-2px, -2px) rotate(-2deg); box-shadow: 6px 6px 0 var(--ink); }
.clue.mine { opacity: .45; }
.clue:disabled { cursor: default; color: var(--ink); }
.clue small { font-weight: 500; font-size: 13px; }
.reveal { margin: 0 0 14px; padding: 14px; background: #fff; border: var(--b); box-shadow: 7px 7px 0 var(--red); }
.reveal.caught { box-shadow: 7px 7px 0 var(--teal); }
.revtop { display: flex; align-items: center; gap: 12px; }
.revtop .av { width: 58px; height: 58px; }
.revtop small { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.revtop b { font-size: 28px; font-weight: 900; line-height: 1; }
.revwords { margin: 10px 0 4px; }
.revverdict { margin: 0 0 10px; font-size: 22px; font-weight: 900; }
.revclues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.revclues li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 2px solid var(--ink); }
.revclues li.imp { background: #ffd6e2; }
.revclues span { flex: 1; font-size: 14px; }
.revclues i { font-style: normal; font-family: var(--mono); font-size: 12px; }
.minp { margin-left: 6px; padding: 0 5px; font-style: normal; font-family: var(--mono); font-size: 10px; font-weight: 700; vertical-align: 2px; background: var(--yellow); border: 1.5px solid var(--ink); }

/* detén el tiempo: últimos instantes de la cuenta regresiva */
.watch.last { color: var(--red); }

/* impostor: el rol solo se nota con la palabra visible */
.wordcard.imp:not(.hide) { background: var(--red); color: #fff; }
.wordcard.hide small { filter: blur(6px); }

/* selección: juegos no disponibles */
.gamecard.na { opacity: .35; }
.minp.sens { background: #a0e7ff; }

/* en partes iguales */
.splitwrap { position: relative; width: min(96vw, 520px); }
.splitsvg { display: block; width: 100%; aspect-ratio: 1000 / 400; background: #fff; border: var(--b); box-shadow: 8px 8px 0 var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
.split-line { stroke: var(--ink); stroke-width: 6; stroke-dasharray: 16 12; }
.split-knob { fill: var(--yellow); stroke: var(--ink); stroke-width: 5; }
.split-g.active .split-knob { fill: var(--pink); }
.split-verdict { bottom: -22px; }
.pct.pct-sm { font-size: 46px; stroke-width: 10px; }
.thumb.wide { width: 70px; height: 28px; }

/* trivia */
.g-trivia { gap: 12px; }
.tq-head { margin: 0; }
.tq-cat { padding: 2px 10px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; border: 2px solid var(--ink); background: var(--cream); }
.tq-q { text-align: center; font-size: clamp(20px, 6vw, 28px); text-transform: none; line-height: 1.2; }
.tq-q.pop { animation: cdpop .4s cubic-bezier(.3, 1.6, .5, 1); }
.tq-opts { width: 100%; display: grid; gap: 10px; }
.tq-opt { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; text-align: left; font-size: 17px; font-weight: 800; border: var(--b); background: #fff; box-shadow: 4px 4px 0 var(--ink); transition: transform .12s ease, opacity .2s; }
.tq-opt:disabled { color: var(--ink); cursor: default; }
.tq-letter { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 2px solid var(--ink); background: var(--c); }
.tq-opt.chosen { background: var(--c); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.tq-opt.right { background: var(--green); }
.tq-opt.right::after { content: '✓'; position: absolute; right: 12px; font-size: 24px; }
.tq-opt.wrong { background: var(--red); color: #fff; }
.tq-opt.dim { opacity: .45; }
.tq-who { display: flex; gap: 2px; margin-left: auto; padding-right: 22px; }
.tq-who .av { width: 22px; height: 22px; }
.tq-answers { margin: 0 0 14px; padding: 10px 10px 10px 30px; display: grid; gap: 6px; background: var(--cream); border: 2px dashed var(--ink); font-size: 14px; }
.tq-answers b { display: block; }

/* flappy y apila: lienzo a pantalla completa bajo la barra */
.stage > .g-flappy, .stage > .g-stack { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; max-width: none; width: auto; z-index: 30; }
.flappy-wrap, .stack-wrap { position: relative; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.flappy-cv, .stack-cv { display: block; width: 100%; height: 100%; }
.flappy-hud { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); padding: 2px 18px; font-size: 40px; font-weight: 900; background: #fff; border: var(--b); box-shadow: 4px 4px 0 var(--ink); pointer-events: none; }
.flappy-msg { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%) rotate(-2deg); display: flex; flex-direction: column; align-items: center; padding: 12px 20px; text-align: center; background: var(--yellow); border: var(--b); box-shadow: 6px 6px 0 var(--ink); pointer-events: none; }
.flappy-msg b { font-size: 24px; }
.g-flappy .flappy-msg { top: 22%; }   /* arriba de los pajaritos, que arrancan a media pantalla */

/* cornhole */
/* el carril de pasto ocupa toda la pantalla; turno, viento y fuerza van encima */
.stage > .g-cornhole { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: block; }
.chwrap { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.chsvg { display: block; width: 100%; height: 100%; background: #8ac926; }
.ch-turn { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2; width: max-content; max-width: calc(100% - 24px); padding: 4px 12px; background: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); pointer-events: none; }
.ch-turn.hot { background: var(--yellow); }
.ch-info { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.ch-start { stroke: var(--ink); stroke-width: 8; stroke-dasharray: 14 10; }
.ch-start.mine { animation: pupulse .5s ease-in-out infinite alternate; transform-origin: center; transform-box: fill-box; }
.ch-aim { stroke: #fff; stroke-width: 10; stroke-dasharray: 20 16; stroke-linecap: round; }
.ch-trail { fill: none; stroke: #fff; stroke-width: 11; stroke-dasharray: 1 26; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.ch-power { position: absolute; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 2; display: grid; gap: 4px; padding: 8px 10px; background: #fff; border: var(--b); box-shadow: 4px 4px 0 var(--ink); pointer-events: none; }
.ch-bartxt { font-family: var(--mono); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.ch-bar { position: relative; height: 22px; border: var(--b); background: #fff; overflow: hidden; }
.ch-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--orange); transition: width .1s; }
.ch-ideal { position: absolute; top: 0; bottom: 0; background: rgba(6, 214, 160, .7); border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.ch-mark { position: absolute; top: -2px; bottom: -2px; width: 5px; margin-left: -2px; background: var(--ink); }
.chmini { width: 120px; height: auto; background: #8ac926; border: 2px solid var(--ink); }
.ch-windtag { position: absolute; top: 56px; left: 10px; z-index: 2; padding: 3px 10px; font-family: var(--mono); font-size: 13px; font-weight: 700; background: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); pointer-events: none; }
.ch-bagnum { font-family: var(--geo); font-size: 30px; font-weight: 900; fill: #111; text-anchor: middle; }
.ch-zone { font-family: var(--geo); font-size: 64px; font-weight: 900; fill: #fff; opacity: .85; text-anchor: middle; letter-spacing: .08em; }
.ch-mark-txt { font-family: var(--mono); font-size: 44px; font-weight: 700; fill: #fff; opacity: .9; }
.flappy-banner { position: absolute; top: 90px; left: 50%; transform: translateX(-50%) scale(0); padding: 6px 16px; font-size: 26px; font-weight: 900; background: var(--red); color: #fff; border: var(--b); box-shadow: 4px 4px 0 var(--ink); pointer-events: none; white-space: nowrap; }
.flappy-banner.show { animation: banner 1.6s ease forwards; }
@keyframes banner { 15% { transform: translateX(-50%) scale(1.15) rotate(-3deg); } 30%, 80% { transform: translateX(-50%) scale(1) rotate(-3deg); } 100% { transform: translateX(-50%) scale(0); } }

/* tetris */
.stage > .g-tetris { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: flex; flex-direction: column; gap: 6px; padding: 6px 8px calc(8px + var(--safe-b)); background: #fff; user-select: none; -webkit-user-select: none; touch-action: none; }
.tt-opps { display: flex; gap: 6px; overflow-x: auto; min-height: 0; flex: none; }
.tt-opps:empty { display: none; }
.tt-oppbox { display: flex; flex-direction: column; align-items: center; flex: none; }
.tt-opp { width: 30px; height: 60px; border: 2px solid var(--c, var(--ink)); }
.tt-oppbox small { max-width: 44px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 800; }
.tt-oppbox.out { opacity: .45; }
.tt-oppbox.out small::after { content: ' 💀'; }
.tt-main { flex: 1; min-height: 0; display: flex; gap: 8px; justify-content: center; overflow: hidden; }
.tt-wrap { position: relative; flex: 1; min-width: 0; min-height: 0; max-width: 300px; display: flex; align-items: flex-start; justify-content: flex-end; overflow: hidden; }
.tt-board { display: block; border: var(--b); box-shadow: 5px 5px 0 var(--ink); background: var(--cream); }
.tt-side { width: 76px; flex: none; display: flex; flex-direction: column; gap: 3px; }
.tt-side small { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.tt-mini { width: 76px; height: 50px; border: 2px solid var(--ink); background: var(--cream); }
.tt-next { width: 76px; height: 132px; border: 2px solid var(--ink); background: var(--cream); }
.tt-stats { display: grid; margin-top: 4px; }
.tt-stats b { font-size: 18px; font-weight: 900; line-height: 1.1; }
.tt-controls { flex: none; align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; max-width: 480px; margin: 0 auto; padding: 0 clamp(10px, 5vw, 28px); }
.tt-dpad { display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 42px); gap: 3px; }
.tt-btn { display: grid; place-items: center; padding: 0; font-size: 24px; font-weight: 900; border: var(--b); background: #fff; box-shadow: 3px 3px 0 var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
.tt-btn.on { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); background: var(--yellow); }
.tt-btn.up { grid-column: 2; grid-row: 1; }
.tt-btn.left { grid-column: 1; grid-row: 2; }
.tt-btn.right { grid-column: 3; grid-row: 2; }
.tt-btn.down { grid-column: 2; grid-row: 3; }
.tt-acts { position: relative; flex: none; width: 124px; height: 124px; }
.tt-btn.rot { position: absolute; top: 0; left: 0; width: 72px; height: 72px; border-radius: 50%; font-size: 34px; background: var(--pink); }
.tt-btn.locked { background: #ccc; }
.tt-btn.rot.locked { font-size: 28px; }
.tt-btn.hold.locked { font-size: 20px; }
.tt-btn.hold { position: absolute; right: 0; bottom: 0; width: 54px; height: 54px; border-radius: 50%; font-size: 24px; background: var(--teal); }
.tt-atk { display: grid; gap: 4px; margin-top: 6px; min-height: 0; }
.tt-side .tt-atkinfo { font-family: var(--geo); font-size: 11px; font-weight: 800; letter-spacing: 0; line-height: 1.15; }
.tt-side .tt-atkinfo.hot { padding: 2px 4px; background: var(--yellow); border: 2px solid var(--ink); }
.tt-atklist { display: flex; flex-wrap: wrap; gap: 4px; max-height: 120px; overflow-y: auto; }
.tt-target { width: 34px; height: 34px; padding: 2px; border: 2px solid var(--ink); background: #fff; opacity: .3; transition: opacity .2s; touch-action: none; }
.tt-target svg { display: block; width: 100%; height: 100%; }
.tt-target.ready { opacity: 1; background: var(--c); box-shadow: 2px 2px 0 var(--ink); animation: pupulse .5s ease-in-out infinite alternate; }
.tt-target.out { opacity: .15; filter: grayscale(1); animation: none; }
.tt-alert { position: absolute; top: 12px; left: 50%; z-index: 4; width: max-content; max-width: 94%; padding: 6px 12px; font-size: 15px; font-weight: 900; line-height: 1.2; text-align: center; background: var(--yellow); border: var(--b); box-shadow: 4px 4px 0 var(--ink); transform: translateX(-50%); pointer-events: none; }
.tt-alert.bad { background: var(--red); color: #fff; }
.tt-alert.show { animation: ttalert .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes ttalert { from { transform: translateX(-50%) scale(.4) rotate(-6deg); } }
.tt-fast { position: absolute; right: 8px; bottom: 8px; z-index: 3; font-size: 30px; pointer-events: none; animation: pupulse .3s ease-in-out infinite alternate; }
.g-tetris .flappy-msg { top: 40%; }

/* --- Francotirador --- */
.stage > .g-sniper { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: block; background: #111; }
.sn-wrap { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.sn-cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.sn-hud { position: absolute; top: 8px; left: 8px; right: 8px; display: grid; gap: 6px; pointer-events: none; }
.sn-chips { display: flex; gap: 6px; }
.sn-chip { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3px 4px; background: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--yellow); }
.sn-chip small { font: 700 8px/1.2 var(--mono); letter-spacing: .08em; }
.sn-chip b { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 900; white-space: nowrap; }
.sn-chip.k { flex: .8 1 0; font: 700 11px/1.1 var(--mono); text-align: center; background: var(--yellow); box-shadow: 3px 3px 0 #fff; }
.sn-arrow { display: block; width: 18px; height: 10px; }
.sn-arrow svg { display: block; width: 100%; height: 100%; }
.sn-arrow.none { width: auto; height: auto; }
.sn-time { height: 8px; background: rgba(255, 255, 255, .2); border: 2px solid #fff; }
.sn-time i { display: block; height: 100%; background: var(--teal); transform-origin: left; }
.sn-time.hurry i { background: var(--red); }
.sn-ctrl { position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
.sn-btn { height: 70px; padding: 0; color: var(--ink); font-weight: 900; font-size: 18px; letter-spacing: .06em; border: var(--b); box-shadow: 4px 4px 0 rgba(255, 255, 255, .35); touch-action: none; user-select: none; -webkit-user-select: none; }
.sn-btn.breath { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; background: var(--teal); }
.sn-btn.breath.on { background: var(--yellow); transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(255, 255, 255, .35); }
.sn-btn.breath.tired { background: #bbb; }
.sn-breath { display: block; width: 70%; height: 9px; background: #fff; border: 2px solid var(--ink); }
.sn-breath i { display: block; height: 100%; background: var(--ink); transform-origin: left; }
.sn-btn.fire { font-size: 22px; color: #fff; background: var(--red); }
.sn-btn.fire:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 rgba(255, 255, 255, .35); }
.sn-btn:disabled { opacity: .45; }
.g-sniper .sn-msg { top: auto; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) rotate(-2deg); }
.sn-hint { position: absolute; top: 96px; left: 50%; padding: 6px 12px; font-size: 14px; font-weight: 800; white-space: nowrap; background: var(--yellow); border: 2px solid var(--ink); transform: translateX(-50%); pointer-events: none; }
.sn-rtarget { display: block; width: 150px; height: 150px; }

/* --- Infla el globo --- */
.stage > .g-balloon { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 12px calc(12px + var(--safe-b)); background: var(--cream) radial-gradient(rgba(17, 17, 17, .08) 1.5px, transparent 1.7px) 0 0 / 16px 16px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.bl-hud { flex: none; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.bl-k { padding: 4px 8px; font: 700 12px/1.2 var(--mono); background: var(--yellow); border: 2px solid var(--ink); }
.g-balloon .bl-time { background: #fff; border-color: var(--ink); }
.bl-stage { position: relative; flex: 1; min-height: 0; touch-action: none; }
.bl-svg { display: block; width: 100%; height: 100%; }
.bl-tag { font: 700 13px var(--mono); fill: var(--ink); }
.g-balloon .bl-msg { top: 30%; }
.bl-tie { flex: none; width: 100%; }
.bl-boom.go { transform-box: view-box; transform-origin: 150px 200px; animation: blboom .5s ease-out forwards; }
@keyframes blboom { from { transform: scale(.3); } to { transform: scale(1.5); opacity: 0; } }

/* --- Laberinto de canica --- */
.stage > .g-maze { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 8px calc(8px + var(--safe-b)); background: #3a2a1c; user-select: none; -webkit-user-select: none; touch-action: none; }
.mz-hud { flex: none; display: flex; align-items: center; gap: 8px; }
.mz-chip { padding: 3px 10px; font: 700 13px/1.3 var(--mono); background: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--yellow); }
.mz-chip.t { min-width: 76px; text-align: center; background: var(--yellow); box-shadow: 2px 2px 0 #fff; }
.mz-level { margin-left: auto; padding: 4px 10px; font-size: 13px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.mz-stage { position: relative; flex: 1; min-height: 0; }
.mz-cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.g-maze .flappy-msg { top: 42%; }

/* --- Choque de gemas (usa el mismo armado que Tetris) --- */
.pz-board { display: block; border: var(--b); box-shadow: 5px 5px 0 var(--ink); background: var(--cream); }
.pz-next { width: 76px; height: 150px; border: 2px solid var(--ink); background: var(--cream); }
.pz-acts { position: relative; flex: none; width: 116px; height: 124px; }
.tt-btn.rl, .tt-btn.rr { position: absolute; width: 64px; height: 64px; border-radius: 50%; font-size: 30px; }
.tt-btn.rl { left: 0; bottom: 0; background: var(--teal); }
.tt-btn.rr { top: 0; right: 0; background: var(--pink); }
.pz-in { position: absolute; top: 6px; left: 6px; z-index: 3; padding: 2px 8px; font-size: 13px; font-weight: 900; color: #fff; white-space: nowrap; background: var(--red); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); pointer-events: none; }
.pz-chain { position: absolute; top: 38%; left: 50%; z-index: 3; padding: 4px 12px; font-size: 22px; font-weight: 900; background: var(--yellow); border: var(--b); box-shadow: 4px 4px 0 var(--ink); transform: translate(-50%, -50%) rotate(-4deg); pointer-events: none; }
.g-puzzle .tt-alert { top: 44px; }

/* --- Basta --- */
.stage > .g-basta { align-items: stretch; gap: 12px; }
.bt-tile { display: grid; place-items: center; flex: none; width: 64px; height: 64px; font-size: 44px; font-weight: 900; line-height: 1; background: var(--yellow); border: var(--b); box-shadow: 4px 4px 0 var(--ink); }
.bt-tile.huge { width: 150px; height: 150px; margin: 10px auto; font-size: 110px; box-shadow: 8px 8px 0 var(--ink); transform: rotate(-3deg); }
.bt-tile.huge.pop { background: var(--pink); animation: btpop .45s cubic-bezier(.3, 1.8, .5, 1); }
.bt-tile.mini { display: inline-grid; width: 26px; height: 26px; margin: 0 2px; font-size: 16px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); vertical-align: middle; }
@keyframes btpop { from { transform: scale(.4) rotate(-20deg); } }
.bt-roulette { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 6vh; text-align: center; }
.bt-past { margin: 4px 0 0; font-weight: 700; }
.bt-head { display: flex; align-items: center; gap: 14px; }
.bt-title { display: block; font-size: 24px; font-weight: 900; line-height: 1.1; }
.bt-head .kicker { margin: 0 0 2px; }
.bt-left { font: 700 12px var(--mono); }
.bt-banner { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; padding: 10px 14px; color: #fff; background: var(--red); border: var(--b); box-shadow: 4px 4px 0 var(--ink); animation: btshake .5s ease-in-out infinite alternate; }
.bt-banner b { font-size: 22px; }
@keyframes btshake { to { transform: rotate(-1deg) scale(1.02); } }
.bt-form { display: grid; gap: 10px; }
.bt-row { display: grid; gap: 3px; }
.bt-cat { font: 700 11px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.bt-field { position: relative; display: block; }
.bt-in { padding-right: 40px; scroll-margin: 70px 0 24px; }
.bt-row.ok .bt-in { background: #e3fbef; border-color: #1a8f5a; }
.bt-row.bad .bt-in { background: #ffe7ec; }
.bt-mark { position: absolute; top: 50%; right: 12px; font-style: normal; font-size: 20px; font-weight: 900; transform: translateY(-50%); pointer-events: none; }
.bt-row.ok .bt-mark { color: #1a8f5a; }
.bt-row.bad .bt-mark { color: var(--red); }
.bt-foot { position: sticky; bottom: 0; z-index: 5; padding: 10px 0 calc(6px + var(--safe-b)); background: linear-gradient(transparent, var(--cream) 30%); }
.g-basta.typing .bt-foot { position: static; }
.btn.bt-basta { color: #fff; background: var(--red); font-size: 22px; letter-spacing: .08em; }
.btn.bt-basta:disabled { font-size: 15px; color: var(--ink); background: #fff; }
.bt-time { height: 10px; background: #fff; border: 2px solid var(--ink); }
.bt-time i { display: block; height: 100%; background: var(--teal); transform-origin: left; }
.bt-time.hurry i { background: var(--red); }
.bt-answers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bt-ans { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 12px 16px; font-size: 20px; font-weight: 800; color: var(--ink); background: #c9f7d8; border: var(--b); box-shadow: 4px 4px 0 var(--ink); transition: transform .15s cubic-bezier(.3, 1.6, .5, 1), background-color .15s; }
.bt-ans:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.bt-ans.no { color: #fff; background: var(--red); }
.bt-ans.no .t { text-decoration: line-through; text-decoration-thickness: 3px; }
.bt-ans.auto { opacity: .75; }
.bt-ans:disabled { cursor: default; }
.bt-ans .n, .bt-ans .me { padding: 1px 6px; font: 700 12px var(--mono); font-style: normal; color: var(--ink); background: #fff; border: 2px solid var(--ink); }
.bt-ans .me { background: var(--yellow); }
.bt-ans .why { position: absolute; left: 6px; bottom: -18px; font-size: 11px; font-weight: 700; color: var(--red); white-space: nowrap; }
.bt-ans.auto { margin-bottom: 14px; }
.bt-ans.bt-v .bt-pts { margin-left: 4px; padding: 0 6px; font-size: 18px; color: var(--ink); background: #fff; border: 2px solid var(--ink); }
.bt-ans.bt-v.yes { animation: btpop .35s cubic-bezier(.3, 1.8, .5, 1); }
.bt-score { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bt-score li { display: grid; grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 8px 12px; background: #fff; border: var(--b); box-shadow: 4px 4px 0 var(--c); }
.bt-score li.me { background: var(--cream); }
.bt-score .av { grid-row: span 2; width: 40px; height: 40px; }
.bt-score .av svg { display: block; width: 100%; height: 100%; }
.bt-score .plus { grid-row: span 2; font-size: 24px; }
.bt-score small { font: 700 11px var(--mono); }

/* --- Batalla naval --- */
.stage > .g-bs { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 10px calc(10px + var(--safe-b)); background: #dff1ff radial-gradient(rgba(58, 134, 255, .2) 1.5px, transparent 1.7px) 0 0 / 14px 14px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.bs-status { flex: none; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 5px 10px; font-size: 14px; line-height: 1.25; text-align: center; background: #fff; border: var(--b); box-shadow: 3px 3px 0 var(--ink); }
.bs-status b { font-weight: 900; }
.bs-streak { font-style: normal; font-weight: 900; color: var(--red); white-space: nowrap; }
.bs-wrap { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.bs-board { display: grid; grid-template-columns: repeat(var(--cols, 2), auto); gap: var(--gap, 8px); padding: 10px 6px 6px 10px; }
.bs-sec { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(5, var(--cell, 28px)); grid-template-rows: repeat(5, var(--cell, 28px)); background: var(--ct); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--c); touch-action: manipulation; }
.bs-sec.off { width: calc(var(--cell, 28px) * 5 + 6px); height: calc(var(--cell, 28px) * 5 + 6px); background: repeating-linear-gradient(45deg, #d6d6d6 0 6px, #efefef 6px 12px); border: 3px dashed #9a9a9a; box-shadow: none; }
.bs-sec.dead { filter: grayscale(.9); opacity: .55; }
.bs-sec.dead::before { content: '💀'; position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; font-size: calc(var(--cell, 28px) * 2); pointer-events: none; }
.bs-sec.aimable { cursor: crosshair; }
.bs-sec.aimable .bs-cell:not(.h):not(.m) { background: rgba(255, 255, 255, .25); }
.bs-cell { position: relative; box-shadow: inset 0 0 0 .5px rgba(17, 17, 17, .28); }
.bs-cell.m { background: rgba(255, 255, 255, .7) !important; }
.bs-cell.m::after { content: ''; position: absolute; inset: 0; z-index: 2; width: 34%; height: 34%; margin: auto; background: #fff; border: 2px solid var(--ink); border-radius: 50%; }
.bs-cell.h { background: #ffd9e1 !important; }
/* acierto: X roja con contorno (vector, simétrica) */
.bs-cell.h::after { content: ''; position: absolute; inset: 0; z-index: 2; background: center / 78% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M22 22L78 78M78 22L22 78' fill='none' stroke='%23111' stroke-width='26' stroke-linecap='round'/%3E%3Cpath d='M22 22L78 78M78 22L22 78' fill='none' stroke='%23ef476f' stroke-width='14' stroke-linecap='round'/%3E%3C/svg%3E"); }
/* mira: casilla elegida (aún sin disparar) y disparo ya mandado */
.bs-cell.pend { background: var(--yellow) !important; box-shadow: inset 0 0 0 3px var(--ink); }
.bs-cell.pend::after, .bs-cell.aim::after { content: ''; position: absolute; inset: 0; z-index: 2; background: center / 86% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23111' stroke-width='9' stroke-linecap='round'%3E%3Ccircle cx='50' cy='50' r='27'/%3E%3Cpath d='M50 7v17M50 76v17M7 50h17M76 50h17'/%3E%3C/g%3E%3Ccircle cx='50' cy='50' r='7' fill='%23111'/%3E%3C/svg%3E"); }
.bs-cell.pend::after { animation: bsaim .55s ease-in-out infinite alternate; }
.bs-cell.aim { background: #fff !important; box-shadow: inset 0 0 0 2px var(--ink); }
.bs-cell.aim::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23111' stroke-width='9' stroke-linecap='round'%3E%3Ccircle cx='50' cy='50' r='27'/%3E%3Cpath d='M50 7v17M50 76v17M7 50h17M76 50h17'/%3E%3C/g%3E%3Ccircle cx='50' cy='50' r='12' fill='%23ef476f' stroke='%23111' stroke-width='5'/%3E%3C/svg%3E"); }
@keyframes bsaim { from { transform: scale(.82); } }
.bs-cell[data-n]::before { content: attr(data-n); position: absolute; right: 2px; bottom: 1px; z-index: 3; font: 700 max(9px, calc(var(--cell, 28px) * .32))/1 var(--mono); color: var(--ink); }
.bs-cell.fresh { box-shadow: inset 0 0 0 3px var(--sc, var(--ink)); }
.bs-cell.anim::after { animation: bsboom .55s cubic-bezier(.3, 1.6, .5, 1) both; }
.bs-cell.h.anim { animation: bsflash .6s ease-out; }
@keyframes bsboom { from { transform: scale(2.6); opacity: 0; } }
@keyframes bsflash { 0% { background: #fff; } 40% { background: var(--yellow); } }
.bs-ships { display: contents; }
/* barcos vistos desde arriba (SVG): casco, cubierta, puente del color del jugador */
.bs-ship { position: relative; z-index: 1; display: block; margin: 1px; pointer-events: none; }
.bs-ship svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bs-ship .hull { fill: #4f5d75; stroke: var(--ink); stroke-width: 6; stroke-linejoin: round; }
.bs-ship .deck { fill: #c5cedb; }
.bs-ship .seam { fill: none; stroke: #4f5d75; stroke-width: 3; stroke-dasharray: 10 8; opacity: .5; }
.bs-ship .cab { fill: var(--c, var(--yellow)); stroke: var(--ink); stroke-width: 5; }
.bs-ship .win { fill: var(--ink); }
.bs-ship .gun { fill: #4f5d75; stroke: var(--ink); stroke-width: 5; }
.bs-ship .funnel { fill: #2b2d42; stroke: var(--ink); stroke-width: 4; }
.bs-ship .barrel { fill: var(--ink); }
.bs-ship .glow { display: none; fill: none; stroke: var(--yellow); stroke-width: 20; stroke-linejoin: round; }
.bs-ship.sel .glow { display: inline; animation: bsglow .5s ease-in-out infinite alternate; }
.bs-ship.sel svg { filter: drop-shadow(3px 3px 0 var(--ink)); }
.bs-ship.sunk svg { filter: grayscale(1) brightness(.72); }
@keyframes bsglow { from { stroke-width: 12; } }
.bs-av { position: absolute; left: -15px; top: -15px; z-index: 3; width: max(22px, calc(var(--cell, 28px) * .8)); height: max(22px, calc(var(--cell, 28px) * .8)); padding: 1px; background: var(--c); border: 2px solid var(--ink); border-radius: 50%; pointer-events: none; }
.bs-av svg, .bs-fav svg { display: block; width: 100%; height: 100%; }
.bs-you { position: absolute; top: -11px; right: -6px; z-index: 3; padding: 1px 5px; font: 700 10px/1.3 var(--mono); color: #fff; background: var(--ink); pointer-events: none; }
.bs-sec.big { box-shadow: 7px 7px 0 var(--c); }
.bs-sec.big.locked { opacity: .65; }
.bs-sec.big .bs-ship { margin: 4px; }
.bs-feed { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; min-height: 26px; font-size: 13px; font-weight: 700; }
.bs-feed:empty { display: none; }
.bs-ev { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; background: #fff; border: 2px solid var(--ink); }
.bs-ev.sunk { background: var(--yellow); }
.bs-ev.out { color: #fff; background: var(--ink); }
.bs-fav { display: inline-block; flex: none; width: 20px; height: 20px; background: var(--c); border: 1.5px solid var(--ink); border-radius: 50%; }
.bs-bottom { flex: none; display: flex; flex-direction: column; gap: 8px; }
.bs-bottom .btn { width: 100%; }
.btn.bs-fire.todo:disabled { opacity: 1; color: #fff; background: var(--red); box-shadow: 5px 5px 0 var(--ink); }
.bs-placebar { display: grid; gap: 10px; }
.bs-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bs-tool { padding: 10px 12px; font-size: 15px; background: #fff; box-shadow: 4px 4px 0 var(--ink); }
.bs-rhead { flex-direction: column; gap: 8px; }
.bs-board.mini { padding: 4px; }
.bs-board.mini .bs-sec { border-width: 2px; box-shadow: 2px 2px 0 var(--c); }
.bs-board.mini .bs-sec.off { width: calc(var(--cell) * 5 + 4px); height: calc(var(--cell) * 5 + 4px); border-width: 2px; }
.bs-board.mini .bs-ship { margin: 0; }
.bs-board.mini .bs-cell.m::after { border-width: 1px; }
.bs-board.mini .bs-sec.dead::before { font-size: calc(var(--cell) * 2.4); }

/* ángulo */
.angsvg { width: min(60vw, 240px); height: auto; }
.angpad { width: 100%; min-height: 30dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 4px solid var(--ink); background: var(--pink); box-shadow: 8px 8px 0 var(--ink); font-size: 16px; touch-action: none; user-select: none; -webkit-user-select: none; }
.angpad b { font-size: 34px; font-weight: 900; }
.angpad:disabled { background: #ddd; color: var(--ink); }

/* ----------------------------------------------------------- resultados */
.rtitle { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 30px; }
.rhead { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 14px; padding: 10px; font-weight: 700; background: var(--cream); border: 2px dashed var(--ink); }
.rhead.seq { flex-direction: column; gap: 6px; }
.bigswatch { width: 64px; height: 64px; border: var(--b); box-shadow: 4px 4px 0 var(--ink); }
.bigtarget { padding: 4px 12px; font-size: 28px; font-weight: 900; background: var(--yellow); border: var(--b); }
.seqdots { display: flex; gap: 4px; }
.seqdots i { width: 20px; height: 20px; border: 2px solid var(--ink); }
.paper.mini { width: 74px; box-shadow: 3px 3px 0 var(--ink); }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border: var(--b); box-shadow: 4px 4px 0 var(--ink); animation: rowin .5s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(var(--i) * 90ms); }
@keyframes rowin { from { opacity: 0; transform: translateX(40px) rotate(2deg); } }
.rrow.me { background: var(--cream); }
.rrow.invalid { opacity: .6; }
.rank { width: 30px; flex: none; text-align: center; font-weight: 900; font-size: 22px; }
.rrow .av { width: 38px; height: 38px; }
.rbody { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.rbody .nm { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbody .val { font-family: var(--mono); font-weight: 700; font-size: 16px; }
.rbody .note { font-size: 12px; color: #444; }
.pts { flex: none; padding: 4px 8px; font-weight: 900; font-size: 17px; background: var(--teal); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.pts.zero { background: #ddd; }
.thumb { width: 52px; height: 52px; flex: none; border: 2px solid var(--ink); background: #fff; }
.thumbwrap { width: 52px; flex: none; border-width: 2px; box-shadow: none; }
.thumbwrap .thumb { border: 0; width: 100%; height: 100%; }
.pair { display: flex; flex: none; border: 2px solid var(--ink); }
.pair i { width: 24px; height: 44px; }
.standings { display: grid; gap: 8px; }
.sbar { display: flex; align-items: center; gap: 8px; }
.sbar .av { width: 30px; height: 30px; }
.sbar .track { flex: 1; height: 20px; border: var(--b); background: #fff; overflow: hidden; }
.sbar .track i { display: block; height: 100%; background: var(--c); border-right: var(--b); transition: width 1.2s cubic-bezier(.3, 1.2, .5, 1); }
.sbar b { min-width: 34px; text-align: right; font-weight: 900; }
.sbar.me b { background: var(--yellow); padding: 0 4px; }
.timebar { height: 8px; margin-top: 18px; border: 2px solid var(--ink); background: #fff; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--ink); }

/* --------------------------------------------------------------- final */
.wintitle { display: flex; flex-direction: column; align-items: center; margin: 14px 0 22px; text-align: center; }
.wintitle .k { padding: 4px 10px; font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; background: var(--ink); color: #fff; }
.wintitle .w { margin-top: 10px; font-weight: 900; font-size: clamp(40px, 13vw, 72px); line-height: .95; text-transform: uppercase; color: var(--yellow); -webkit-text-stroke: .04em var(--ink); paint-order: stroke fill; text-shadow: .06em .06em 0 var(--ink); transform: rotate(-3deg); word-break: break-word; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 10px 0 24px; }
.pod { flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pod .av { width: 64px; height: 64px; }
.pod.p1 .av { width: 88px; height: 88px; }
.pod b { margin-top: 4px; font-size: 15px; line-height: 1.1; word-break: break-word; }
.pod small { font-family: var(--mono); font-size: 12px; }
.pod .block { width: 100%; margin-top: 6px; display: grid; place-items: center; font-weight: 900; font-size: 34px; border: var(--b); box-shadow: 5px 5px 0 var(--ink); }
.pod.p1 .block { height: 140px; background: var(--yellow); }
.pod.p2 .block { height: 100px; background: var(--pink); }
.pod.p3 .block { height: 70px; background: var(--teal); }
.bounce { animation: bounce 1.2s ease-in-out infinite; }
.pod.p2 .bounce { animation-delay: .2s; } .pod.p3 .bounce { animation-delay: .4s; }
@keyframes bounce { 50% { transform: translateY(-10px) rotate(-5deg); } }
.finaltable, .scorelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.finaltable li, .scorelist li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: var(--b); background: #fff; }
.finaltable li.me, .scorelist li.me { background: var(--cream); }
.finaltable .pos, .scorelist .pos { width: 24px; font-weight: 900; text-align: center; }
.finaltable .nm, .scorelist .nm { flex: 1; font-weight: 800; }
.finaltable .av, .scorelist .av { width: 34px; height: 34px; }

/* ------------------------------------------------------ hojas / modales */
.sheet-back { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(17, 17, 17, .45); opacity: 0; transition: opacity .2s; }
.sheet-back.on { opacity: 1; }
.sheet { width: 100%; max-width: 560px; max-height: 90dvh; overflow-y: auto; padding: 20px 18px calc(22px + var(--safe-b)); background: #fff; border: var(--b); border-bottom: 0; transform: translateY(100%); transition: transform .3s cubic-bezier(.3, 1.3, .5, 1); }
.sheet-back.on .sheet { transform: none; }
.dialog .row { margin-top: 18px; }
.dialog .row .btn { flex: 1; }
.dialog p { margin: 0 0 6px; }
.scorelist { margin-bottom: 18px; }
.plist { margin-bottom: 10px; }
.plist li.off .av { filter: grayscale(1); opacity: .6; }
.plist .nm { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.plist .nm small { font: 700 11px var(--mono); color: #777; }
.btn.mini { flex: none; padding: 6px 10px; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }
.btn.mini:disabled { opacity: .35; box-shadow: none; }

/* ---------------------------------------------------------------- toast */
.toast { position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); z-index: 99; max-width: min(92vw, 520px); padding: 12px 16px; background: var(--yellow); border: var(--b); box-shadow: 6px 6px 0 var(--ink); font-weight: 800; font-size: 16px; text-align: center; transform: translate(-50%, 180%) rotate(-2deg); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.toast.on { transform: translate(-50%, 0) rotate(-2deg); }
.toast.bad { background: var(--red); color: #fff; }

/* -------------------------------------------------------------- confeti */
.confetti-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.confetti-layer i { position: absolute; top: -30px; width: 12px; height: 12px; background: var(--c); border: 2px solid var(--ink); animation: fall linear forwards; }
.confetti-layer .cf1 { border-radius: 50%; }
.confetti-layer .cf2 { width: 16px; height: 6px; }
.confetti-layer .cf3 { width: 0; height: 0; background: none; border: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 14px solid var(--c); }
@keyframes fall { to { transform: translate(var(--dx), 112vh) rotate(var(--r)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; }
}

/* ---------- Adivina el dibujo ---------- */
.stage > .g-guess { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 12px calc(8px + var(--safe-b)); overflow: hidden; background: var(--cream) radial-gradient(rgba(17, 17, 17, .08) 1.5px, transparent 1.7px) 0 0 / 16px 16px; }
.g-guess > * { flex: none; }
.gu-top { width: 100%; max-width: 520px; display: flex; align-items: center; gap: 8px; font: 700 12px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.gu-top .av { width: 26px; height: 26px; }
.gu-top .who { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gu-top .sp { flex: 1; }
.gu-top .me { flex: none; padding: 2px 8px; background: var(--yellow); border: 2px solid var(--ink); }
.gu-word { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-height: 40px; max-width: 520px; }
.gu-word i { display: inline-grid; place-items: end center; width: 20px; height: 30px; font-style: normal; font-weight: 900; font-size: 20px; line-height: 1; text-transform: uppercase; border-bottom: 4px solid var(--ink); }
.gu-word i.gap { width: 10px; border: 0; }
.gu-word i.hint { color: var(--red); }
.gu-word small { margin-left: 6px; font: 700 12px var(--mono); }
.gu-word .lbl { font: 700 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.gu-word .w { padding: 2px 12px; font-size: 24px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; background: var(--yellow); border: var(--b); box-shadow: 4px 4px 0 var(--ink); transform: rotate(-1.5deg); }
.gu-form { width: 100%; max-width: 520px; display: flex; gap: 8px; }
.gu-form .input { flex: 1; min-width: 0; height: 46px; padding: 8px 12px; font-size: 18px; }
.gu-form .btn { height: 46px; padding: 0 14px; font-size: 14px; box-shadow: 4px 4px 0 var(--ink); }
.gu-form .btn:disabled, .gu-form .input:disabled { opacity: .5; }
.gu-status { width: 100%; max-width: 520px; height: 46px; margin: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; background: #c9f7d8; border: var(--b); }
.gu-paper { position: relative; background: #fff; border: var(--b); box-shadow: 6px 6px 0 var(--ink); }
.gu-cv { display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.g-guess.drawer .gu-cv { cursor: crosshair; }
.gu-over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px; text-align: center; background: rgba(255, 246, 214, .95); animation: fadein .2s ease; overflow: auto; }
.gu-over[hidden] { display: none; }
.gu-over small { font: 700 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.gu-over .big { padding: 4px 16px; font-size: clamp(24px, 8vw, 36px); font-weight: 900; text-transform: uppercase; background: var(--yellow); border: var(--b); box-shadow: 5px 5px 0 var(--ink); transform: rotate(-2deg); overflow-wrap: anywhere; }
.gu-over .av { width: 54px; height: 54px; }
.gu-got { width: 100%; max-width: 280px; margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.gu-got li { display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: #fff; border: 2px solid var(--ink); font-weight: 700; }
.gu-got li span { flex: 1; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gu-got li em { font: 700 11px var(--mono); font-style: normal; color: #555; }
.gu-got li.drawer { background: var(--cream); }
.gu-near { position: absolute; left: 50%; top: 10px; z-index: 2; padding: 6px 12px; font-weight: 800; white-space: nowrap; background: #ffe7b3; border: var(--b); box-shadow: 3px 3px 0 var(--ink); transform: translateX(-50%); animation: gunear .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes gunear { from { transform: translateX(-50%) scale(.5); } }
.gu-near[hidden] { display: none; }
.gu-tools { width: 100%; max-width: 520px; display: grid; gap: 8px; }
.gu-tools[hidden] { display: none; }
.gu-colors { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.gu-sw { width: 28px; height: 28px; padding: 0; font-size: 14px; line-height: 1; background: var(--c); border: 2px solid var(--ink); border-radius: 50%; transition: transform .12s ease; }
.gu-sw.sel { transform: scale(1.12); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.gu-row { display: flex; justify-content: center; gap: 8px; }
.gu-size, .gu-act { display: grid; place-items: center; width: 44px; height: 40px; padding: 0; font-size: 18px; font-weight: 900; background: #fff; border: var(--b); box-shadow: 3px 3px 0 var(--ink); }
.gu-act.wide { width: auto; padding: 0 12px; font-size: 13px; text-transform: uppercase; }
.gu-size i { display: block; border-radius: 50%; background: var(--ink); }
.gu-size.sel { background: var(--yellow); }
.gu-size:active, .gu-act:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.gu-feed { flex: 1 1 auto; width: 100%; max-width: 520px; min-height: 0; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; overflow: hidden; font-size: 14px; }
.gu-feed li { align-self: flex-start; max-width: 100%; padding: 2px 8px; background: #fff; border: 2px solid var(--ink); overflow-wrap: anywhere; }
.gu-feed li b { margin-right: 4px; }
.gu-feed li.ok { background: #c9f7d8; font-weight: 700; }
.gu-feed li.near { background: #ffe7b3; }
.gu-gallery { flex-wrap: wrap; align-items: flex-start; }
.gu-thumb { margin: 0; display: grid; gap: 4px; justify-items: center; }
.gu-thumb canvas { display: block; background: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.gu-thumb figcaption { display: flex; align-items: center; gap: 4px; max-width: 110px; font-size: 12px; }
.gu-thumb figcaption .av { width: 18px; height: 18px; }
.gu-thumb figcaption b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-transform: uppercase; }
.gu-thumb figcaption small { font: 700 10px var(--mono); }

/* ---------- Chat ---------- */
.chatbtn { position: relative; }
.chat-dot { position: absolute; top: -5px; right: -5px; width: 13px; height: 13px; background: var(--red); border: 2px solid var(--ink); border-radius: 50%; animation: dotpop .35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes dotpop { from { transform: scale(0); } }
@media (max-width: 420px) {
  #top .bar { gap: 6px; padding: 8px 10px; }
  #top .icon { width: 36px; height: 36px; font-size: 16px; }
  #top .prog .pl { display: none; }
}
.chatbox h3 { margin-bottom: 10px; }
.chatlist { display: flex; flex-direction: column; gap: 4px; height: min(52dvh, 420px); overflow-y: auto; padding: 10px; margin-bottom: 12px; background: var(--cream) radial-gradient(rgba(17, 17, 17, .07) 1.5px, transparent 1.7px) 0 0 / 16px 16px; border: var(--b); overscroll-behavior: contain; }
.chatlist .fine { margin: auto; }
.cmsg { display: flex; align-items: flex-end; gap: 6px; max-width: 86%; }
.cmsg.first { margin-top: 6px; }
.cmsg .av { width: 28px; height: 28px; }
.cmsg .cbody { display: grid; gap: 1px; padding: 6px 10px; background: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); overflow-wrap: anywhere; }
.cmsg .cbody b { font-size: 12px; }
.cmsg.mine { align-self: flex-end; }
.cmsg.mine .cbody { background: var(--yellow); }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { flex: 1; min-width: 0; }
.chat-form .btn { padding: 10px 14px; }

/* ---------- Piso de lava ---------- */
.stage > .g-lava { position: fixed; left: 0; right: 0; top: 58px; bottom: 0; z-index: 30; max-width: none; width: auto; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 8px calc(8px + var(--safe-b)); background: #3a1208; user-select: none; -webkit-user-select: none; touch-action: none; }
.lv-stage { position: relative; flex: 1; min-height: 0; }
.lv-cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.lv-hp { flex: 1; height: 16px; background: #fff; border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--yellow); overflow: hidden; }
.lv-hp i { display: block; height: 100%; background: var(--green); transition: width .15s linear; }
.lv-hp.low i { background: var(--red); animation: lvblink .3s steps(2) infinite; }
@keyframes lvblink { 50% { opacity: .4; } }
.lv-warn { position: absolute; left: 50%; top: 10px; z-index: 2; padding: 6px 14px; font-weight: 900; font-size: 18px; color: #fff; background: var(--red); border: var(--b); box-shadow: 4px 4px 0 var(--ink); transform: translateX(-50%) rotate(-2deg); pointer-events: none; animation: lvblink .4s steps(2) infinite; }
.g-lava .flappy-msg { top: 40%; }

/* ---------- Desempaña el cristal ---------- */
.stage > .g-fog { align-items: center; gap: 10px; }
.fg-top { width: 100%; display: flex; align-items: center; gap: 8px; font: 700 12px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.fg-top .sp { flex: 1; }
.fg-top .me { padding: 2px 8px; background: var(--yellow); border: 2px solid var(--ink); }
.fg-glass { position: relative; flex: none; overflow: hidden; background: #fff radial-gradient(rgba(17, 17, 17, .06) 1.5px, transparent 1.7px) 0 0 / 14px 14px; border: var(--b); box-shadow: 6px 6px 0 var(--ink); }
.fg-item { position: absolute; left: 50%; top: 50%; line-height: 1; white-space: nowrap; user-select: none; -webkit-user-select: none; filter: brightness(0); }   /* solo la forma */
.fg-item.shown { filter: none; transition: filter .5s ease .2s; }
.fg-item.code { font-family: var(--mono); font-weight: 700; letter-spacing: .08em; color: var(--ink); }
.fg-fog { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; transition: opacity .6s ease; }
.fg-fog.gone { opacity: 0; pointer-events: none; }
.fg-hint { margin: 0; }
.fg-opts { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fg-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px; padding: 8px 4px; background: #fff; border: var(--b); box-shadow: 4px 4px 0 var(--ink); transition: transform .12s ease, background-color .2s; }
.fg-opt b { font-size: 40px; line-height: 1.1; }
.fg-opt.code b { font: 700 22px var(--mono); letter-spacing: .06em; }
.fg-opt small { font-size: 12px; font-weight: 700; text-align: center; }
.fg-opt:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.fg-opt:disabled { cursor: default; color: var(--ink); }
.fg-opt.sel { background: var(--cream); transform: translate(-2px, -2px) rotate(-1.5deg); box-shadow: 6px 6px 0 var(--ink); }
.fg-opt.ok { background: #c9f7d8; }
.fg-opt.bad { background: #ffd9e1; }
.fg-status { display: grid; gap: 4px; justify-items: center; min-height: 26px; }
.fg-row { padding: 2px 10px; font-weight: 700; background: #fff; border: 2px solid var(--ink); }
.fg-row.dim { font: 700 12px var(--mono); background: transparent; border: 0; }
.fg-res { flex-wrap: wrap; }
.fg-chip { display: grid; justify-items: center; gap: 2px; padding: 4px 8px; background: #fff; border: 2px solid var(--ink); }
.fg-chip b { font-size: 28px; line-height: 1.1; }
.fg-chip.code b { font: 700 16px var(--mono); }
.fg-chip small { font-size: 11px; }
.lv-out { position: absolute; left: 50%; top: 8px; z-index: 2; padding: 4px 12px; font-weight: 800; font-size: 14px; white-space: nowrap; background: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translateX(-50%); pointer-events: none; }

/* ---------- Edecán y trofeo del podio ---------- */
.pod .tslot { height: 92px; display: flex; align-items: flex-end; justify-content: center; }
.trophy-landed { display: block; width: 62px; height: 90px; filter: drop-shadow(3px 3px 0 rgba(17, 17, 17, .25)); animation: tland .45s cubic-bezier(.3, 1.8, .5, 1), bounce 1.2s ease-in-out .45s infinite; }
@keyframes tland { from { transform: translateY(-14px) scale(1.25, .8); } }
.edecan-layer { position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: none; }
.edecan-svg { position: absolute; left: 0; top: 0; overflow: visible; will-change: transform; }
.trophy-fly { position: absolute; left: 0; top: 0; will-change: transform; }
