/* ==========================================================
   Tiza — estilos
   Claridad, profundidad suave y movimiento con muelle.
   ========================================================== */

:root {
  --bg: #f6f5f1;
  --grid: rgba(60, 80, 110, .055);
  --ink: #1d1d1f;
  --ink-2: #4b5563;
  --ink-3: #8a8f98;
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .08);
  --sep: rgba(60, 60, 67, .12);
  --card: #ffffff;
  --glass: rgba(255, 255, 255, .72);
  --ok: #34c759;
  --bad: #ff3b30;
  --gold: #ffcc00;

  --acc: #0a84ff;
  --acc-2: #5e5ce6;
  --acc-soft: rgba(10, 132, 255, .12);

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --dock-h: 74px;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 8px rgba(0, 0, 0, .04);
  --sh-2: 0 1px 2px rgba(0, 0, 0, .05), 0 12px 32px rgba(0, 0, 0, .08);
  --sh-3: 0 2px 4px rgba(0, 0, 0, .06), 0 24px 60px rgba(0, 0, 0, .14);

  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Nunito", "Segoe UI", system-ui, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", "Baloo 2", "Nunito", system-ui, sans-serif;
}

body[data-level="primaria"]    { --acc: #0a84ff; --acc-2: #64d2ff; --acc-soft: rgba(10,132,255,.12); }
body[data-level="secundaria"]  { --acc: #28a745; --acc-2: #a3e635; --acc-soft: rgba(52,199,89,.14); }
/* paleta canaria: azul océano + amarillo arena + verde laurisilva */
body[data-level="universidad"] { --acc: #0b78c2; --acc-2: #36b6e8; --acc-soft: rgba(11,120,194,.12); }
:root { --bg: #fbf6ea; --grid: rgba(120, 95, 50, .06); --gold: #f4b400; --mar: #0b78c2; --arena: #f2b33d; --laurisilva: #2d8a4e; --volcan: #9a5b3a; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 500 16px/1.45 var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, .drop:focus-within { outline: 3px solid var(--acc); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-round); font-weight: 800; letter-spacing: -.02em; margin: 0; }

/* garabatos de tiza en el fondo del cuaderno */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.doodle { position: absolute; fill: none; stroke: var(--acc); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: .2; transition: stroke .8s; animation: float 9s ease-in-out infinite; }
.doodle text { fill: var(--acc); stroke: none; font: 700 22px "Baloo 2", var(--font-round); }
.c-teide { stroke: var(--volcan); }
.c-mar { stroke: var(--mar); }
.c-sol { stroke: var(--arena); opacity: .35; }
.c-verde { stroke: var(--laurisilva); }
.d1 { width: 130px; top: 6%; left: 3%; }
.d2 { width: 140px; top: 14%; right: 5%; animation-delay: -2s; }
.d3 { width: 80px; bottom: 22%; left: 6%; animation-delay: -4s; }
.d4 { width: 120px; bottom: 10%; right: 6%; animation-delay: -1s; }
.d5 { width: 56px; top: 46%; right: 3%; animation-delay: -3s; }
.d6 { width: 74px; top: 52%; left: 2%; transform: rotate(8deg); animation-delay: -5s; }
.d7 { width: 90px; top: 30%; left: 12%; animation-delay: -6s; }
.d8 { width: 46px; bottom: 34%; right: 18%; animation-delay: -7s; }
@keyframes float { 50% { translate: 0 -8px; rotate: 3deg; } }
@media (max-width: 760px) { .d2, .d4, .d7 { display: none; } .doodle { opacity: .14; } }

#app {
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(var(--dock-h) + 40px);
  display: grid;
}

/* ---------- pantallas ---------- */
.screen { grid-area: 1 / 1; display: none; flex-direction: column; align-items: center; width: 100%; max-width: 980px; margin: 0 auto; }
.screen.is-active { display: flex; animation: screenIn .5s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px) scale(.985); filter: blur(4px); } }

.large-title { width: 100%; max-width: 760px; margin: 8px 0 22px; }
.large-title.center { text-align: center; }
.large-title h1 { font-size: clamp(30px, 5.5vw, 44px); line-height: 1.08; }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--acc); }
.sub { margin: 8px 0 0; color: var(--ink-2); font-size: 17px; }
.section-label { align-self: stretch; max-width: 760px; width: 100%; margin: 26px auto 10px; font-size: 20px; }

.card { background: var(--card); border-radius: var(--r-xl); box-shadow: var(--sh-2); }

/* ---------- botones ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 13px 26px; min-height: 48px;
  font-weight: 700; font-size: 17px; letter-spacing: -.01em;
  background: var(--fill); color: var(--ink);
  transition: transform .35s var(--spring), background .2s, box-shadow .2s, opacity .2s;
}
.btn:hover { background: rgba(120,120,128,.18); }
.btn:active { transform: scale(.96); transition-duration: .08s; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn-main { background: var(--acc); color: #fff; box-shadow: 0 6px 18px -6px var(--acc); }
.btn-main:hover { background: var(--acc); filter: brightness(1.06); }
.btn-tinted { background: var(--acc-soft); color: var(--acc); }
.btn-tinted:hover { background: var(--acc-soft); filter: brightness(.97); }
.btn-plain { background: transparent; color: var(--acc); }
.btn-small { min-height: 36px; padding: 7px 16px; font-size: 15px; }
.btn-xl { min-height: 58px; padding: 16px 48px; font-size: 20px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.link { background: none; border: 0; padding: 0; color: var(--acc); font-weight: 700; }
.link:hover { text-decoration: underline; }

.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 12px; background: var(--fill); }
.seg { border: 0; background: transparent; border-radius: 9px; padding: 8px 16px; font-weight: 700; font-size: 15px; color: var(--ink-2); transition: background .25s var(--ease), color .2s, box-shadow .25s; white-space: nowrap; }
.seg.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 3px 8px rgba(0,0,0,.06); }
.seg-wide { width: min(420px, 100%); margin-bottom: 18px; }

.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--acc-soft); color: var(--acc); font-weight: 700; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; }

/* ---------- mascota ---------- */
.mascot { width: 100%; height: 100%; overflow: visible; }
.mascot-slot { display: inline-block; }
.mascot-xl { width: 128px; height: 160px; }
.mascot-lg { width: 110px; height: 138px; }
.mascot-md { width: 84px; height: 105px; }
.mascot-sm { width: 52px; height: 65px; }
.m-stick { fill: #fffdf8; stroke: #cfd5dc; stroke-width: 3; }
.m-tip { fill: var(--acc); opacity: .9; transition: fill .6s; }
.m-dust { stroke: #dfe3e8; stroke-width: 3; stroke-linecap: round; }
.m-eyes ellipse { fill: var(--ink); }
.m-shine { fill: #fff; }
.m-cheek { fill: #ffb3b3; opacity: .7; }
.m-mouth { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.m-arm { fill: none; stroke: #cfd5dc; stroke-width: 6; stroke-linecap: round; }
.m-shadow { fill: rgba(0,0,0,.08); }
.m-body { transform-origin: 60px 140px; animation: bob 3s ease-in-out infinite; }
.m-eyes { transform-origin: 60px 72px; animation: blink 5s infinite; }
.m-arm-l { transform-origin: 30px 82px; } .m-arm-r { transform-origin: 90px 82px; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-2deg); } }
@keyframes blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
[data-mood="happy"] .m-arm-r { animation: wave 1.3s ease-in-out infinite; }
@keyframes wave { 50% { transform: rotate(-28deg); } }
[data-mood="busy"] .m-body { animation: scribble .5s ease-in-out infinite; }
[data-mood="busy"] .m-arm-r { animation: wave .35s ease-in-out infinite; }
@keyframes scribble { 50% { transform: rotate(4deg) translateY(-2px); } }
[data-mood="yay"] .m-body { animation: jump .6s var(--spring) 2; }
[data-mood="yay"] .m-arm-l { transform: rotate(40deg); } [data-mood="yay"] .m-arm-r { transform: rotate(-40deg); }
@keyframes jump { 40% { transform: translateY(-20px) rotate(-6deg); } }
[data-mood="oops"] .m-body { animation: wobble .5s ease-in-out 1; }
@keyframes wobble { 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
[data-mood="sad"] .m-body { animation: none; transform: rotate(6deg) translateY(4px); }

/* ---------- avatar ---------- */
.avatar-slot { display: inline-grid; place-items: center; flex: none; }
.avatar-slot svg { width: 100%; height: 100%; overflow: visible; }
.avatar-xxs { width: 26px; height: 40px; }
.avatar-xs { width: 30px; height: 46px; }
.avatar-sm { width: 38px; height: 58px; }
.avatar-md { width: 80px; height: 124px; }
.avatar-hero { width: 104px; height: 162px; }
.avatar-big { width: 168px; height: 262px; }
.avatar-slot .av-body { transform-origin: 60px 150px; }
.avatar-slot .av-head { transform-origin: 60px 80px; }
.avatar-hero .av-head, .avatar-big .av-head { animation: nod 4s ease-in-out infinite; }
@keyframes nod { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-3deg); } 60% { transform: rotate(2deg); } }
.avatar-hero .av-body, .avatar-big .av-body { animation: bob 3.4s ease-in-out infinite .4s; }
.avatar-slot.yay .av-body { animation: jump .6s var(--spring) 2; }
.avatar-slot.sad .av-body { transform: rotate(-6deg) translateY(4px); }

/* ---------- portada ---------- */
#s-start { justify-content: center; min-height: calc(100dvh - var(--dock-h) - 80px); }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.hero-cast { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 4px; }
.logo { font-family: var(--font-round); font-size: clamp(88px, 20vw, 150px); line-height: .9; letter-spacing: -.05em; font-weight: 800; color: var(--ink); }
.logo span { background: linear-gradient(135deg, var(--acc), var(--acc-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin: 4px 0 22px; font-size: clamp(19px, 3vw, 24px); color: var(--ink-2); font-weight: 600; letter-spacing: -.01em; }
.hero-hint { margin: 14px 0 0; color: var(--ink-3); font-size: 14px; }
.legal-link { margin-top: 26px; font-size: 13px; color: var(--ink-3); text-decoration: none; }
.legal-link:hover { text-decoration: underline; }

/* ---------- editor de personaje ---------- */
.avatar-editor { display: grid; grid-template-columns: 280px 1fr; gap: 20px; width: 100%; max-width: 940px; align-items: start; }
.avatar-stage {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 16px 18px;
  border-radius: var(--r-xl); background: radial-gradient(120% 80% at 50% 0%, #ffffff 0%, var(--acc-soft) 60%, #fff 100%); box-shadow: var(--sh-2);
  position: sticky; top: 20px;
}
.podium-wrap { position: relative; width: 100%; display: grid; place-items: center; padding-bottom: 6px; cursor: grab; touch-action: pan-y; user-select: none; }
.podium-wrap:active { cursor: grabbing; }
.podium { position: absolute; bottom: 0; width: 170px; height: 34px; border-radius: 50%; background: radial-gradient(closest-side, #fff, #e6eaf0); box-shadow: inset 0 -4px 8px rgba(0,0,0,.08), 0 6px 14px rgba(0,0,0,.08); z-index: 0; }
.podium-wrap .avatar-slot { position: relative; z-index: 1; transform-style: preserve-3d; }
.avatar-big.spin { animation: spin 1s var(--ease); }
@keyframes spin { 50% { transform: perspective(600px) rotateY(180deg) scale(.96); } to { transform: perspective(600px) rotateY(360deg); } }
.nick-input {
  width: 100%; text-align: center; font: 800 20px var(--font-round); color: var(--ink); padding: 10px 14px;
  border: 0; border-radius: 14px; background: rgba(255,255,255,.8); box-shadow: inset 0 0 0 1px var(--sep);
}
.nick-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--acc), 0 0 0 4px var(--acc-soft); }
.stage-actions { display: flex; gap: 8px; }
.stars-pill { margin: 0; padding: 4px 12px; border-radius: 999px; background: #fff7d1; color: #8a6d00; font-weight: 800; font-size: 14px; }

.avatar-panel { padding: 14px; display: grid; gap: 12px; min-width: 0; }
.av-cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.av-cats::-webkit-scrollbar { display: none; }
.av-cat {
  flex: none; border: 0; border-radius: 16px; padding: 8px 10px 6px; min-width: 66px; background: var(--fill-2);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--ink-2);
  transition: transform .35s var(--spring), background .2s, box-shadow .2s;
}
.av-cat-ico { width: 24px; height: 24px; display: grid; place-items: center; }
.av-cat-ico svg { width: 24px; height: 24px; }
.av-thumb.only { width: 72px; height: 64px; }
.av-cat { min-width: 84px; padding: 10px 12px 8px; font-size: 13px; }
.av-cats { gap: 8px; }
.av-cat:hover { transform: translateY(-2px); }
.av-cat.is-on { background: var(--acc); color: #fff; box-shadow: 0 8px 18px -8px var(--acc); }
.av-rows { display: grid; gap: 14px; }
.av-row-title { margin: 0 0 8px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.av-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.av-opt {
  position: relative; border: 0; border-radius: 18px; padding: 6px 4px 8px; background: var(--fill-2);
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; color: var(--ink-2);
  transition: transform .35s var(--spring), background .2s, box-shadow .2s;
}
.av-thumb { width: 66px; height: 68px; }
.av-opt:hover { transform: translateY(-2px); background: var(--fill); }
.av-opt.is-on { background: #fff; box-shadow: 0 0 0 3px var(--acc), var(--sh-1); color: var(--ink); }
.av-opt.locked .av-thumb { opacity: .45; filter: grayscale(.6); }
.av-opt .lock { position: absolute; top: 4px; right: 4px; font-size: 10px; font-weight: 800; background: #fff7d1; color: #8a6d00; border-radius: 999px; padding: 1px 6px; }
.av-opt-label { line-height: 1.15; text-align: center; }
.av-opt .lock.days { background: #ffe4d6; color: #9a3412; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(0,0,0,.1), 0 2px 6px rgba(0,0,0,.08); transition: transform .35s var(--spring); }
.swatch:hover { transform: scale(1.1); }
.swatch.is-on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--acc); transform: scale(1.05); }
.swatch.locked::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(255,255,255,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 30'%3E%3Crect x='2' y='13' width='22' height='16' rx='4' fill='%23555'/%3E%3Cpath d='M7 13V9a6 6 0 0 1 12 0v4' fill='none' stroke='%23555' stroke-width='3.5'/%3E%3C/svg%3E") center/13px no-repeat; }
.av-slider { display: grid; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.av-slider input { width: 100%; accent-color: var(--acc); height: 28px; }
.av-legend { margin: 0; color: var(--ink-3); font-size: 13px; }

/* ---------- formularios ---------- */
.field { display: grid; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink-2); text-align: left; }
.field input, .duel-name {
  font: 600 17px var(--font); color: var(--ink); padding: 13px 16px; border-radius: 14px;
  border: 0; background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--sep); transition: box-shadow .2s, background .2s;
}
.field input:focus, .duel-name:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--acc), 0 0 0 4px var(--acc-soft); }
.form { width: 100%; display: grid; gap: 14px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); line-height: 1.4; text-align: left; }
.form .check input { width: 20px; height: 20px; accent-color: var(--acc); flex: none; margin-top: 1px; }
.form .check a { color: var(--acc); }
.form .link { justify-self: center; font-size: 15px; }
.form-error { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(255,59,48,.1); color: #c4271d; font-weight: 700; font-size: 14px; }
[data-mode="login"] [data-only="register"], [data-mode="register"] [data-only="login"] { display: none; }

.sheet { width: min(460px, 100%); margin-top: 6px; padding: 26px 24px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.sheet h1 { font-size: 30px; }
.card-sub { margin: 6px 0 18px; color: var(--ink-2); }
.sheet .segmented { margin-bottom: 18px; }

/* código de verificación */
.code-boxes { display: flex; gap: 8px; justify-content: center; }
.code-boxes input {
  width: 46px; height: 58px; text-align: center; font: 800 26px var(--font-round); color: var(--ink);
  border: 0; border-radius: 14px; background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--sep);
}
.code-boxes input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--acc), 0 0 0 4px var(--acc-soft); }
.code-boxes.shake { animation: shake .4s; }
.mail-ico { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 10px; background: linear-gradient(135deg, var(--acc), var(--acc-2)); box-shadow: 0 10px 24px -8px var(--acc); }
.mail-ico svg { width: 36px; height: 36px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.verify-help { margin: 4px 0 0; font-size: 14px; color: var(--ink-3); line-height: 1.8; }

/* ---------- niveles ---------- */
.level-row { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 16px; justify-content: center; width: 100%; }
.level-card {
  --c: #0a84ff;
  border: 0; border-radius: var(--r-xl); padding: 26px 18px 22px; background: var(--card); box-shadow: var(--sh-2);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .45s var(--spring), box-shadow .3s;
}
.level-card[data-level="secundaria"] { --c: #28a745; }
.level-card[data-level="universidad"] { --c: #ff7a00; }
.level-ico { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; margin-bottom: 10px; background: color-mix(in srgb, var(--c) 12%, white); }
.level-card svg { width: 56px; height: 56px; fill: none; stroke: var(--c); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.level-card svg .fill { fill: var(--c); stroke: none; }
.level-card strong { font-family: var(--font-round); font-size: 22px; letter-spacing: -.01em; }
.level-card small { color: var(--ink-3); font-weight: 600; }
.level-card:hover { transform: translateY(-6px); box-shadow: var(--sh-3); }
.level-card:active { transform: scale(.97); }

/* ---------- subir ---------- */
.drop {
  width: min(560px, 100%); cursor: pointer; padding: 44px 24px; border-radius: var(--r-xl);
  background: var(--glass); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 2px dashed rgba(60,60,67,.18); box-shadow: var(--sh-1);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  transition: transform .45s var(--spring), border-color .2s, background .2s, box-shadow .3s;
}
.drop:hover, .drop.is-over { transform: scale(1.015); border-color: var(--acc); box-shadow: var(--sh-2); }
.drop.is-over { background: var(--acc-soft); }
.drop-ico { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, var(--acc), var(--acc-2)); box-shadow: 0 10px 24px -8px var(--acc); margin-bottom: 8px; }
.drop-ico svg { width: 42px; height: 42px; fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.drop strong { font-family: var(--font-round); font-size: 22px; }
.drop span { color: var(--ink-3); font-weight: 600; font-size: 15px; }

.step-label { margin: 0 0 8px; font-weight: 700; color: var(--ink-2); }
.course-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: min(560px, 100%); margin-bottom: 18px; }
.course { border: 0; border-radius: 16px; padding: 14px 8px; background: var(--card); box-shadow: var(--sh-1); font: 800 16px var(--font-round); color: var(--ink-2); transition: transform .35s var(--spring), box-shadow .2s, background .2s, color .2s; }
.course:hover { transform: translateY(-2px); }
.course.is-on { background: var(--acc); color: #fff; box-shadow: 0 8px 18px -8px var(--acc); }
.paste { width: min(560px, 100%); padding: 14px; display: grid; gap: 10px; }
.paste textarea {
  width: 100%; min-height: 220px; resize: vertical; border: 0; border-radius: 16px; padding: 14px 16px;
  font: 500 16px/1.5 var(--font); color: var(--ink); background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--sep);
}
.paste textarea:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--acc); }
.paste-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.paste-foot span { color: var(--ink-3); font-size: 14px; font-weight: 600; }

.balance { margin: 18px 0 0; padding: 7px 16px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(16px); box-shadow: var(--sh-1); font-weight: 600; font-size: 15px; }
.balance b { color: var(--acc); }
.upload-alt { margin-top: 18px; color: var(--ink-3); font-size: 15px; text-align: center; }
.upload-error { margin-top: 14px; padding: 12px 18px; border-radius: 14px; background: rgba(255,59,48,.1); color: #c4271d; font-weight: 700; max-width: 560px; text-align: center; }

/* ---------- cargando ---------- */
#s-loading { justify-content: center; gap: 14px; min-height: calc(100dvh - var(--dock-h) - 80px); }
.board { width: min(460px, 100%); padding: 26px 22px; border-radius: 22px; background: linear-gradient(160deg, #24453a, #1c362d); box-shadow: var(--sh-3), inset 0 0 0 6px rgba(255,255,255,.04); }
.board-text { font-family: var(--font-round); font-size: 24px; font-weight: 700; color: #f4f1e6; text-align: center; min-height: 2.6em; display: grid; place-items: center; }
.dots { display: flex; gap: 8px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--acc); animation: dot 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-8px); opacity: .4; } }

/* ---------- menú ---------- */
.menu-head { width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 4px 0 18px; }
.menu-greet { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-2); }
.menu-head h1 { font-size: clamp(32px, 6vw, 46px); line-height: 1.05; }

.feature {
  width: 100%; max-width: 760px; border: 0; padding: 16px 18px; display: flex; align-items: center; gap: 14px; text-align: left;
  transition: transform .45s var(--spring), box-shadow .3s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.feature:active { transform: scale(.98); }
.feature-ico { width: 62px; height: 62px; border-radius: 18px; flex: none; display: grid; place-items: center; background: radial-gradient(120% 90% at 30% 15%, var(--acc-2), var(--acc)); border: 3px solid #fff; box-shadow: 0 8px 18px -8px var(--acc), 0 0 0 1px rgba(0,0,0,.06); transform: rotate(-4deg); }
.feature-ico svg { width: 78%; height: 78%; filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); }

/* título del tema: etiqueta pegada con cinta */
.tape-title { position: relative; display: inline-block; padding: 8px 20px 10px; background: #fff; border-radius: 6px; transform: rotate(-1.2deg); box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 10px 24px -12px rgba(0,0,0,.25); }
.tape-title::before { content: ""; position: absolute; top: -12px; left: 18px; width: 70px; height: 24px; background: color-mix(in srgb, var(--acc) 35%, #fff6c9); opacity: .85; transform: rotate(-5deg); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.tape-title::after { content: ""; position: absolute; left: 16px; right: 22px; bottom: 2px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c30-4 60-4 90-1s70 3 106-2' fill='none' stroke='%23ffcc00' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat; opacity: .9; }

/* mapa de niveles */
.lv-path { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; max-width: 520px; display: grid; gap: 6px; }
.lv-node { display: flex; align-items: center; gap: 16px; padding: 6px 0; animation: screenIn .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.lv-node:nth-child(even) { flex-direction: row-reverse; text-align: right; }
.lv-node + .lv-node::before { content: ""; position: absolute; }
.lv-btn {
  position: relative; flex: none; width: 82px; height: 82px; border-radius: 50%; border: 4px solid #fff;
  background: radial-gradient(circle at 35% 25%, var(--acc-2), var(--acc)); color: #fff;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--acc) 70%, #000), 0 16px 26px -10px var(--acc);
  transition: transform .35s var(--spring), box-shadow .2s;
}
.lv-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.05); }
.lv-btn:active:not(:disabled) { transform: translateY(6px); box-shadow: 0 2px 0 color-mix(in srgb, var(--acc) 70%, #000); }
.lv-num { font: 800 34px var(--font-round); text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.lv-node.current .lv-btn { animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.08); } }
.lv-node.locked .lv-btn { background: #d9dce1; box-shadow: 0 8px 0 #b9bdc4; cursor: default; }
.lv-node.locked .lv-btn::after { content: ""; position: absolute; inset: 0; margin: auto; width: 26px; height: 30px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 30'%3E%3Crect x='2' y='13' width='22' height='16' rx='4' fill='%23fff'/%3E%3Cpath d='M7 13V9a6 6 0 0 1 12 0v4' fill='none' stroke='%23fff' stroke-width='3.5'/%3E%3C/svg%3E") center/contain no-repeat; }
.lv-info { display: grid; gap: 4px; padding: 10px 16px; border-radius: 16px; background: var(--card); box-shadow: var(--sh-1); }
.lv-info strong { font-family: var(--font-round); font-size: 19px; }
.lv-node.locked .lv-info { opacity: .55; }
.lv-stars { display: flex; gap: 4px; }
.lv-node:nth-child(even) .lv-stars { justify-content: flex-end; }
.lv-stars i { width: 20px; height: 20px; background: #e5e5ea; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.lv-stars i.on { background: linear-gradient(135deg, #ffd60a, #ff9f0a); }
.feature-txt { display: grid; flex: 1; }
.feature-txt strong { font-family: var(--font-round); font-size: 20px; }
.feature-txt small { color: var(--ink-3); font-size: 14px; font-weight: 600; }
.chev { color: #c7c7cc; font-size: 28px; line-height: 1; font-weight: 400; }

.apps { width: 100%; max-width: 760px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 12px; }
.app { position: relative; border: 0; background: none; padding: 4px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* iconos de juegos: pegatinas ilustradas pegadas en el cuaderno */
.app-ico {
  --tilt: -4deg;
  width: 92px; height: 92px; border-radius: 28px; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 30% 15%, var(--g1), var(--g2));
  border: 4px solid #fff;
  box-shadow: 0 2px 0 rgba(0,0,0,.06), 0 14px 26px -12px var(--g2), 0 0 0 1px rgba(0,0,0,.06);
  transform: rotate(var(--tilt));
  transition: transform .55s var(--spring), box-shadow .3s;
  position: relative; overflow: hidden;
}
.app:nth-child(3n+2) .app-ico { --tilt: 3deg; }
.app:nth-child(3n) .app-ico { --tilt: -1deg; }
.app-ico::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.35), rgba(255,255,255,0) 45%); pointer-events: none; }
.app-ico svg { width: 76%; height: 76%; position: relative; z-index: 1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.16)); transition: transform .5s var(--spring); }
.app:hover .app-ico { transform: rotate(0deg) translateY(-6px) scale(1.07); box-shadow: 0 2px 0 rgba(0,0,0,.06), 0 22px 34px -14px var(--g2), 0 0 0 1px rgba(0,0,0,.06); }
.app:hover .app-ico svg { animation: wiggle .6s ease-in-out; }
@keyframes wiggle { 25% { transform: rotate(-8deg) scale(1.06); } 60% { transform: rotate(6deg) scale(1.06); } }
.app:active .app-ico { transform: scale(.92); transition-duration: .1s; }
.app-name { font-size: 14px; font-weight: 700; text-align: center; line-height: 1.2; color: var(--ink); }
.app-best { position: absolute; top: -4px; right: calc(50% - 50px); min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; box-shadow: 0 2px 6px rgba(255,59,48,.4); }
.app-best:empty { display: none; }
.app.is-off { opacity: .4; }
.app.is-off .app-ico { filter: grayscale(.8); }

.list { width: 100%; max-width: 760px; padding: 4px 0; overflow: hidden; }
/* menú compacto: "Te toca" y Resumen lado a lado; extras en una fila */
.menu-top { width: 100%; max-width: 760px; display: grid; gap: 12px; margin-bottom: 18px; }
.menu-top .next-up { margin-bottom: 0; }
@media (min-width: 700px) {
  .menu-top { grid-template-columns: 1fr 1fr; }
  .menu-top .next-up { grid-column: 1 / -1; }
  .menu-top .feature { padding: 12px 14px; }
}
@media (min-width: 700px) {
  #s-menu .menu-head { margin-bottom: 10px; }
  #s-menu .menu-top { margin-bottom: 10px; }
  #s-menu .apps { row-gap: 6px; }
  #s-menu .app-ico { width: 86px; height: 86px; }
  #s-menu .more-row { margin-top: 12px; }
  #s-menu .feature-ico { width: 54px; height: 54px; }
}
.feature-exam .feature-ico { background: radial-gradient(120% 90% at 30% 15%, #ffe08a, #f2b33d); box-shadow: 0 8px 18px -8px #f2b33d, 0 0 0 1px rgba(0,0,0,.06); transform: rotate(3deg); }

/* 9 juegos: 5 columnas en ordenador para que el menú quepa sin bajar */
@media (min-width: 700px) { #s-menu .apps { grid-template-columns: repeat(5, 1fr); } }

/* crucigrama */
.cw-wrap { width: min(920px, calc(100vw - 32px)); display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.cw-grid { --cell: min(36px, calc((min(100vw, 920px) - 32px - 338px - 24px) / var(--cols) - 3px)); }
@media (max-width: 760px) {
  .cw-wrap { grid-template-columns: 1fr; }
  .cw-wrap .cw-side { order: -1; }
  .cw-grid { --cell: min(34px, calc((100vw - 56px) / var(--cols) - 3px)); }
}
.cw-grid { display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-template-rows: repeat(var(--rows), var(--cell)); gap: 3px; justify-content: center; align-content: center; padding: 12px; justify-self: center; border-radius: 20px; background: var(--card); box-shadow: var(--sh-2); }
.cw-cell { position: relative; border-radius: 6px; background: #fff; box-shadow: 0 0 0 2px #2a1450 inset; display: grid; place-items: center; cursor: pointer; transition: background .2s; }
.cw-cell.is-sel { background: #ffe9a3; }
.cw-cell.is-ok { background: #d8f5df; box-shadow: 0 0 0 2px var(--laurisilva) inset; }
.cw-ch { font: 800 calc(var(--cell) * .5) var(--font-round); color: var(--ink); }
.cw-num { position: absolute; top: 1px; left: 3px; font: 800 9px var(--font); font-style: normal; color: var(--ink-3); }
.cw-side { display: grid; gap: 12px; }
.cw-side { min-width: 0; }
.cw-input { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-input .btn { flex: 1; }
.cw-input input { flex: 1 1 100%; min-width: 0; border: 0; border-radius: 14px; padding: 12px 14px; background: var(--card); box-shadow: 0 0 0 2px var(--acc) inset; font: 800 18px var(--font-round); text-transform: uppercase; letter-spacing: .08em; }
.cw-input.shake { animation: shake .4s; }
@keyframes shake { 25% { translate: -6px 0; } 50% { translate: 6px 0; } 75% { translate: -3px 0; } }
.cw-clues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 46vh; overflow: auto; }
.cw-clue { display: flex; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--card); box-shadow: var(--sh-1); cursor: pointer; font-size: 15px; line-height: 1.35; }
.cw-clue b { flex: none; color: var(--acc); font-family: var(--font-round); }
.cw-clue.is-sel { box-shadow: 0 0 0 3px var(--acc) inset; }
.cw-clue.is-ok { opacity: .55; text-decoration: line-through; }

/* esquema visual del resumen */
.sum-seg { width: min(320px, 100%); margin: 0 auto 14px; }
.mm { width: min(960px, 100%); display: grid; justify-items: center; }
.mm-center { position: relative; padding: 14px 26px; border-radius: 999px; background: linear-gradient(135deg, var(--acc), var(--acc-2)); color: #fff; font: 800 22px var(--font-round); text-align: center; box-shadow: 0 12px 26px -12px var(--acc); }
.mm-center::after { content: ""; position: absolute; left: 50%; bottom: -22px; width: 3px; height: 22px; background: #c9bfa8; }
.mm-branches { position: relative; width: 100%; margin-top: 22px; padding-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.mm-branches::before { content: ""; position: absolute; top: 0; left: 8%; right: 8%; height: 3px; border-radius: 3px; background: #c9bfa8; }
.mm-branch { position: relative; border-radius: 20px; background: var(--card); box-shadow: var(--sh-1); padding: 0 0 12px; overflow: visible; animation: screenIn .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.mm-branch::before { content: ""; position: absolute; top: -22px; left: 50%; width: 3px; height: 22px; background: #c9bfa8; }
.mm-title { padding: 12px 14px; border-radius: 20px 20px 0 0; background: var(--c); color: #fff; font: 800 17px var(--font-round); line-height: 1.2; text-align: center; }
.mm-leaves { list-style: none; margin: 10px 12px 0; padding: 0; display: grid; gap: 6px; }
.mm-leaves li { position: relative; padding: 7px 10px 7px 22px; border-radius: 12px; background: color-mix(in srgb, var(--c) 9%, #fff); font-size: 14px; font-weight: 600; line-height: 1.35; }
.mm-leaves li::before { content: ""; position: absolute; left: 9px; top: 13px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
@media (max-width: 700px) { .mm-branches::before, .mm-branch::before { display: none; } }

/* menú: 3 accesos en la fila de abajo */
#s-menu .more-row { grid-template-columns: repeat(3, 1fr); }
#s-menu .more-row .list-row { padding: 8px 12px; gap: 8px; font-size: 15px; white-space: nowrap; border-top: 0; }
#s-menu .more-row .list-row + .list-row { border-left: 1px solid var(--sep); }
.more-row .list-row > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.more-row .row-ico, .more-row .avatar-xs { flex: none; }
.live-ico { font-size: 18px; background: color-mix(in srgb, var(--laurisilva) 15%, #fff); }
.live-badge { background: var(--laurisilva) !important; }
.hero-join { margin-top: 6px; font-weight: 700; }

/* partida en directo */
#s-live-host, #s-live-play { align-items: stretch; }
.live-top { width: 100%; max-width: 1100px; margin: 0 auto 14px; display: flex; align-items: center; gap: 14px; }
.live-top strong { flex: 1; font: 800 20px var(--font-round); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-top span:not(.live-badge) { color: var(--ink-3); font-weight: 700; }
.live-badge { padding: 4px 10px; border-radius: 999px; background: #ff3b30; color: #fff; font: 800 12px var(--font); letter-spacing: .06em; }
.live-body { width: 100%; max-width: 1100px; margin: 0 auto; display: grid; gap: 16px; justify-items: center; }
.live-lobby { display: grid; gap: 18px; justify-items: center; text-align: center; width: 100%; }
.live-how { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink-2); }
.live-code { font: 800 clamp(64px, 12vw, 120px) var(--font-round); letter-spacing: .12em; line-height: 1; padding: 18px 34px; border-radius: 32px; background: #fff; box-shadow: var(--sh-3); color: var(--acc); }
.live-nicks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 900px; min-height: 44px; }
.live-nick { padding: 8px 16px; border-radius: 999px; background: #fff; box-shadow: var(--sh-1); font: 800 18px var(--font-round); animation: pop .4s var(--spring) both; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.live-wait { color: var(--ink-3); font-weight: 700; }
.live-qhead { width: 100%; display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; gap: 16px; }
.live-q { margin: 0; text-align: center; font-size: clamp(24px, 3.4vw, 40px); line-height: 1.2; }
.live-count { width: 82px; height: 82px; border-radius: 50%; display: grid; place-items: center; background: var(--acc); color: #fff; font: 800 34px var(--font-round); box-shadow: 0 10px 22px -10px var(--acc); }
.live-count.hurry { background: #ff3b30; animation: beat .6s ease-in-out infinite; }
.live-ans { white-space: pre-line; text-align: center; font: 800 16px var(--font-round); color: var(--ink-2); }
.live-opts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.live-opt { --oc: var(--mar); position: relative; display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 16px 20px; border: 0; border-radius: 22px; background: var(--oc); color: #fff; text-align: left; font: 800 clamp(18px, 2.2vw, 26px) var(--font-round); box-shadow: 0 6px 0 color-mix(in srgb, var(--oc) 70%, #000); transition: opacity .3s, transform .2s; }
.live-opt b { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.25); }
.live-opt.o1 { --oc: var(--laurisilva); } .live-opt.o2 { --oc: #e0a020; } .live-opt.o3 { --oc: #c2553a; }
button.live-opt:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--oc) 70%, #000); }
.live-opt.is-dim { opacity: .3; }
.live-opt.is-right { outline: 5px solid var(--gold); outline-offset: 3px; }
.live-opt.is-picked { outline: 5px solid var(--ink); outline-offset: 3px; }
.live-n { margin-left: auto; font-style: normal; font: 800 28px var(--font-round); padding: 2px 14px; border-radius: 12px; background: rgba(0,0,0,.18); }
.live-board { max-width: 520px; }
.live-podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin-top: 10px; }
.pod { display: grid; justify-items: center; gap: 6px; width: 170px; }
.pod-name { font: 800 22px var(--font-round); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-score { color: var(--ink-2); font-weight: 800; }
.pod-step { width: 100%; display: grid; place-items: center; border-radius: 18px 18px 0 0; color: #fff; font: 800 48px var(--font-round); animation: rise .8s var(--spring) both; }
.p1 .pod-step { height: 190px; background: linear-gradient(#ffd60a, #f2b33d); }
.p2 .pod-step { height: 140px; background: linear-gradient(#cfd6de, #9aa5b1); animation-delay: .2s; }
.p3 .pod-step { height: 100px; background: linear-gradient(#e7a36d, #b9713e); animation-delay: .4s; }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom; } }
.live-join { text-align: center; }
.live-player { width: min(560px, 100%); margin: 0 auto; display: grid; gap: 14px; justify-items: center; text-align: center; }
.lp-head { width: 100%; display: flex; justify-content: space-between; padding: 10px 16px; border-radius: 16px; background: #fff; box-shadow: var(--sh-1); font-weight: 800; }
.lp-big { margin: 0; font-size: 34px; }
.lp-big.ok { color: var(--laurisilva); } .lp-big.ko { color: #c2553a; }
.lp-sub { margin: 0; color: var(--ink-2); font-weight: 700; font-size: 17px; }
.lp-q { margin: 0; font-size: 22px; line-height: 1.3; }
.lp-count { width: 64px; height: 64px; font-size: 26px; }
.live-player .live-opts { grid-template-columns: 1fr; }
.live-player .live-opt { min-height: 74px; }
@media (max-width: 700px) {
  .live-opts { grid-template-columns: 1fr; }
  .live-qhead { grid-template-columns: 64px 1fr 64px; }
  .live-count { width: 60px; height: 60px; font-size: 24px; }
  .pod { width: 30vw; } .pod-name { font-size: 16px; max-width: 30vw; }
}

/* casilla "Premium · Muy pronto" */
.app-soon .app-ico { border-style: dashed; border-color: #f2b33d; }
.app-soon { gap: 3px; }
.soon-badge { line-height: 1.2; margin-top: 1px; padding: 1px 8px; border-radius: 999px; background: linear-gradient(135deg, #ffd60a, #f2b33d); color: #5b3a00; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.app-soon .app-dots { display: none; }

/* retos entre amigos */
.challenge-card { text-align: center; }
.ch-target { display: grid; gap: 2px; margin: 6px auto 4px; padding: 12px 22px; border-radius: 20px; background: linear-gradient(135deg, #ffb347, #ff5e3a); color: #fff; box-shadow: 0 12px 26px -12px #ff5e3a; }
.ch-target span { font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.ch-target strong { font: 800 40px var(--font-round); line-height: 1; }
.ch-ranking { list-style: none; counter-reset: r; margin: 8px 0; padding: 0; display: grid; gap: 6px; width: 100%; }
.ch-ranking li { counter-increment: r; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; background: var(--fill-2); font-weight: 700; }
.ch-ranking li::before { content: counter(r); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--acc); color: #fff; font-size: 13px; }
.ch-ranking li:first-child::before { background: var(--gold); }
.ch-ranking li span { flex: 1; text-align: left; }
.duel-board { width: 100%; margin: 6px 0 10px; }
.ch-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.ch-side { display: grid; gap: 2px; padding: 12px; border-radius: 18px; background: var(--fill-2); }
.ch-side span { font-weight: 700; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-side strong { font: 800 28px var(--font-round); }
.ch-side.win { background: color-mix(in srgb, var(--gold) 25%, #fff); box-shadow: 0 0 0 3px var(--gold) inset; }
.ch-mid { font: 800 18px var(--font-round); color: var(--bad); }
#btn-challenge { margin-top: 6px; }
.res-nick { width: 100%; margin-top: 8px; }

/* examen tipo autoescuela */
.exam-head { font-variant-numeric: tabular-nums; }
.exam-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; width: min(760px, 100%); margin: 2px 0 12px; }
.exam-dot { width: 28px; height: 28px; border-radius: 8px; border: 0; background: var(--fill); color: var(--ink-3); font-size: 12px; font-weight: 800; padding: 0; }
.exam-dot.is-done { background: var(--acc-soft); color: var(--acc); }
.exam-dot.is-now { background: var(--acc); color: #fff; transform: scale(1.1); }
.option.is-picked { background: var(--acc-soft); box-shadow: 0 0 0 3px var(--acc) inset; color: var(--ink); }
.option.is-picked::before { background: var(--acc); color: #fff; }
.exam-row { flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.exam-row .btn:disabled { opacity: .35; cursor: default; }
.more-row { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; }
.more-row .list-row { padding: 10px 16px; }
.more-row .list-row + .list-row { border-top: 0; border-left: 1px solid var(--sep); }
.list-row { width: 100%; border: 0; background: none; display: flex; align-items: center; gap: 12px; padding: 12px 18px; font-weight: 700; font-size: 17px; text-align: left; }
.list-row + .list-row { border-top: 1px solid var(--sep); }
.list-row > span:nth-child(2) { flex: 1; }
.list-row:hover { background: var(--fill-2); }
.row-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--fill); color: var(--ink-2); font-size: 18px; }

/* ---------- juego ---------- */
.hud { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 10px; }
.hud-title { font-family: var(--font-round); font-weight: 800; font-size: 19px; text-align: center; }
.hud-score { font-family: var(--font-round); font-weight: 800; font-size: 18px; background: var(--glass); backdrop-filter: blur(16px); border-radius: 999px; padding: 6px 16px; box-shadow: var(--sh-1); }
.hud-score.bump { animation: bump .4s var(--spring); }
@keyframes bump { 50% { transform: scale(1.18); color: var(--acc); } }
.timebar { width: 100%; height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; margin-bottom: 22px; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--acc); border-radius: 99px; transform-origin: left; }
.timebar.hurry i { background: var(--bad); }
.timebar.off { visibility: hidden; }

.game-stage { width: 100%; display: flex; flex-direction: column; align-items: center; }
.progress { font-weight: 700; color: var(--ink-3); margin-bottom: 10px; font-size: 14px; text-align: center; }
.hint { color: var(--ink-3); font-weight: 600; margin: 0 0 12px; text-align: center; font-size: 15px; }

.question-card {
  width: 100%; max-width: 760px; padding: 26px 24px; border-radius: var(--r-xl); background: var(--card); box-shadow: var(--sh-2);
  text-align: center; font-family: var(--font-round); font-size: clamp(20px, 3.4vw, 27px); font-weight: 700; line-height: 1.28; letter-spacing: -.01em;
  margin-bottom: 20px;
}

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 760px; }
.option {
  position: relative; text-align: left; padding: 16px 18px 16px 60px; min-height: 68px; border: 0; border-radius: 20px;
  background: var(--card); box-shadow: var(--sh-1); font-weight: 600; font-size: 17px; line-height: 1.3;
  transition: transform .4s var(--spring), box-shadow .2s, background .2s;
}
.option::before {
  content: attr(data-key); position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--acc-soft); color: var(--acc); font-weight: 800; font-size: 15px;
}
.option:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--sh-2); }
.option:active:not(:disabled) { transform: scale(.98); }
.option:disabled { cursor: default; }
.option.is-right { background: #eafaf0; box-shadow: inset 0 0 0 2px var(--ok); animation: pop .45s var(--spring); }
.option.is-right::before { content: "✓"; background: var(--ok); color: #fff; }
.option.is-wrong { background: #fff0ef; box-shadow: inset 0 0 0 2px var(--bad); animation: shake .4s; }
.option.is-wrong::before { content: "✕"; background: var(--bad); color: #fff; }
.option.is-dim { opacity: .45; }
@keyframes pop { 50% { transform: scale(1.03); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.feedback { margin-top: 16px; display: flex; align-items: center; gap: 12px; max-width: 760px; min-height: 66px; }
.feedback p { margin: 0; padding: 12px 16px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(16px); box-shadow: var(--sh-1); font-weight: 600; }

/* chispas al acertar y puntos flotantes */
.spark { position: fixed; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; z-index: 40; animation: spark .7s var(--ease) forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(220deg) scale(.2); opacity: 0; } }
.plus { position: fixed; z-index: 41; pointer-events: none; font: 800 20px var(--font-round); color: var(--acc); animation: plus .9s var(--ease) forwards; }
@keyframes plus { from { transform: translate(-50%, 0) scale(.8); opacity: 0; } 20% { opacity: 1; transform: translate(-50%, -8px) scale(1.1); } to { transform: translate(-50%, -48px); opacity: 0; } }

/* tarjetas */
.flash { width: min(560px, 100%); aspect-ratio: 3 / 2; perspective: 1400px; cursor: pointer; background: none; border: 0; padding: 0; }
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform .7s var(--spring); transform-style: preserve-3d; }
.flash.is-flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--r-xl); display: grid; place-items: center; padding: 28px; text-align: center;
  font-family: var(--font-round); font-weight: 700; font-size: clamp(19px, 3.2vw, 26px); line-height: 1.28; background: var(--card); box-shadow: var(--sh-2);
}
.flash-face small { position: absolute; top: 16px; left: 0; right: 0; font-family: var(--font); font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.flash-back { transform: rotateY(180deg); background: linear-gradient(160deg, #fff, var(--acc-soft)); }
.flash-hint { margin-top: 14px; color: var(--ink-3); font-weight: 600; font-size: 15px; }

/* parejas */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; max-width: 820px; }
.mem { aspect-ratio: 4 / 3; border-radius: 18px; border: 0; padding: 0; perspective: 900px; background: none; }
.mem-inner { position: relative; width: 100%; height: 100%; transition: transform .55s var(--spring); transform-style: preserve-3d; }
.mem.is-open .mem-inner, .mem.is-done .mem-inner { transform: rotateY(180deg); }
.mem-face { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; display: grid; place-items: center; padding: 8px; box-shadow: var(--sh-1); }
.mem-front { background: linear-gradient(145deg, var(--acc), var(--acc-2)); }
.mem-front::after { content: ""; width: 30%; aspect-ratio: 1; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); }
.mem-back { transform: rotateY(180deg); background: #fff; font-weight: 700; font-size: clamp(11px, 1.6vw, 15px); line-height: 1.2; text-align: center; overflow: hidden; }
.mem-back.is-term { font-family: var(--font-round); font-size: clamp(14px, 2.2vw, 20px); color: var(--acc); }
.mem.is-done .mem-back { background: #eafaf0; box-shadow: inset 0 0 0 2px var(--ok); }
.mem.is-miss { animation: shake .4s; }

/* verdad o trola */
.tf-card { min-height: 170px; display: grid; place-items: center; }
.tf-card.slide { animation: slideIn .4s var(--spring); }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px) rotate(2deg); } }
.tf-buttons { display: flex; gap: 22px; justify-content: center; }
.tf-btn {
  width: 128px; height: 128px; border-radius: 50%; border: 0; color: #fff; font-weight: 800; font-size: 18px; line-height: 1;
  display: grid; place-items: center; align-content: center; gap: 4px; box-shadow: var(--sh-2); transition: transform .35s var(--spring);
}
.tf-btn b { font-size: 44px; font-family: var(--font-round); }
.tf-btn small { font-size: 12px; opacity: .85; }
.tf-btn:active { transform: scale(.9); }
.tf-yes { background: linear-gradient(145deg, #4cd964, #28a745); }
.tf-no { background: linear-gradient(145deg, #ff6b5e, #e5352b); }
.flash-msg { height: 32px; margin-top: 14px; font-family: var(--font-round); font-weight: 800; font-size: 22px; }
.flash-msg.ok { color: var(--ok); } .flash-msg.ko { color: var(--bad); }

/* lluvia de conceptos */
.rain-top { width: 100%; max-width: 820px; display: flex; gap: 12px; align-items: stretch; margin-bottom: 12px; }
.rain-def { flex: 1; padding: 16px 18px; border-radius: 20px; background: var(--card); box-shadow: var(--sh-2); font-family: var(--font-round); font-weight: 700; font-size: clamp(17px, 2.6vw, 21px); line-height: 1.3; }
.rain-def.pop { animation: pop .45s var(--spring); }
.rain-lives { display: flex; gap: 6px; align-items: center; padding: 0 14px; border-radius: 20px; background: var(--card); box-shadow: var(--sh-1); }
.rain-lives i { width: 20px; height: 18px; background: #e5e5ea; clip-path: path("M10 18 C10 18 0 11 0 5 A5 5 0 0 1 10 3 A5 5 0 0 1 20 5 C20 11 10 18 10 18 Z"); transition: background .3s; }
.rain-lives i.on { background: var(--bad); }
.rain-sky {
  position: relative; width: 100%; max-width: 820px; height: min(58vh, 520px); border-radius: var(--r-xl); overflow: hidden;
  background: linear-gradient(180deg, #e8f4ff 0%, #f7fbff 70%, #fff 100%); box-shadow: inset 0 0 0 1px var(--sep), var(--sh-1);
}
.rain-sky::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px; background: linear-gradient(180deg, rgba(52,199,89,0), rgba(52,199,89,.18)); }
.rain-sky.hurt { animation: hurt .4s; }
@keyframes hurt { 30% { box-shadow: inset 0 0 0 4px var(--bad); } }
.bubble {
  position: absolute; top: 0; border: 0; border-radius: 999px; padding: 12px 18px; max-width: 200px;
  font-weight: 800; font-size: 15px; color: #1d1d1f; line-height: 1.15;
  background: radial-gradient(circle at 30% 25%, #fff 0 18%, hsl(var(--hue) 90% 86%) 60%, hsl(var(--hue) 75% 74%));
  box-shadow: 0 6px 16px -6px hsl(var(--hue) 60% 40% / .5), inset 0 -3px 6px hsl(var(--hue) 60% 40% / .15);
  will-change: transform; touch-action: manipulation;
}
.bubble:hover { filter: brightness(1.04); }
.bubble.popped { animation: popOut .35s var(--ease) forwards; }
.bubble.nope { animation: shake .35s; }
.bubble.splash { animation: splash .35s ease-out forwards; }
@keyframes popOut { to { scale: 1.6; opacity: 0; } }
@keyframes splash { to { scale: 1.3 .4; opacity: 0; } }

/* completa la frase */
.cloze-card { line-height: 1.6; }
.gap { display: inline-block; min-width: 5ch; padding: 0 10px; margin: 0 4px; border-bottom: 3px solid var(--acc); color: var(--acc); border-radius: 6px 6px 0 0; transition: background .3s; }
.gap.ok { background: #eafaf0; border-color: var(--ok); color: #1f8a3d; animation: pop .45s var(--spring); }
.gap.ko { background: #fff0ef; border-color: var(--bad); color: #c4271d; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 760px; }
.chip-btn {
  border: 0; border-radius: 999px; padding: 12px 22px; background: var(--card); box-shadow: var(--sh-1);
  font-weight: 700; font-size: 17px; transition: transform .35s var(--spring), box-shadow .2s;
}
.chip-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--sh-2); }
.chip-btn.is-right { background: var(--ok); color: #fff; }
.chip-btn.is-wrong { background: var(--bad); color: #fff; animation: shake .4s; }
.chip-btn:disabled:not(.is-right):not(.is-wrong) { opacity: .45; }

/* ordena los pasos */
.order-board { width: 100%; max-width: 820px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.order-slots { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; align-content: start; }
.slot { min-height: 56px; border-radius: 16px; background: var(--fill-2); border: 1.5px dashed rgba(60,60,67,.18); display: flex; }
.slot.filled { border-color: transparent; background: none; }
.slot-empty { margin: auto; color: var(--ink-3); font-weight: 700; font-size: 14px; }
.slot.ok .step { background: #eafaf0; box-shadow: inset 0 0 0 2px var(--ok); }
.slot.ko .step { background: #fff0ef; box-shadow: inset 0 0 0 2px var(--bad); }
.order-tray { display: grid; gap: 8px; align-content: start; }
.step {
  width: 100%; border: 0; border-radius: 16px; padding: 14px 16px; text-align: left; background: var(--card); box-shadow: var(--sh-1);
  font-weight: 600; font-size: 15px; line-height: 1.3; transition: transform .35s var(--spring), box-shadow .2s;
  animation: pop .35s var(--spring);
}
.step:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--sh-2); }
.step.placed { background: linear-gradient(160deg, #fff, var(--acc-soft)); }
.order-solution { max-width: 760px; margin: 16px 0 0; padding: 14px 18px 14px 40px; border-radius: 18px; background: #fff8e1; font-weight: 600; }

/* duelo */
.duel-setup { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; max-width: 680px; }
.duel-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; width: 100%; }
.duel-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 14px; border-radius: var(--r-xl); background: var(--card); box-shadow: var(--sh-2); }
.duel-card > svg, .duel-av { width: 92px; height: 115px; }
.duel-av svg { width: 100%; height: 100%; }
.duel-card strong { font-family: var(--font-round); font-size: 20px; }
.duel-card small { color: var(--ink-3); font-weight: 700; }
.duel-name { width: 100%; text-align: center; }
.vs { font: 800 30px var(--font-round); color: var(--acc); }
.duel-arena { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.duel-side { padding: 16px; border-radius: var(--r-xl); background: var(--card); box-shadow: var(--sh-2); display: flex; flex-direction: column; gap: 12px; transition: box-shadow .3s, transform .4s var(--spring); }
.duel-side.won { box-shadow: 0 0 0 3px var(--ok), var(--sh-3); transform: translateY(-3px); }
.duel-side.lost { opacity: .6; }
.duel-head { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.duel-mini { width: 40px; height: 50px; }
.duel-mini svg { width: 100%; height: 100%; }
.duel-head span { flex: 1; }
.duel-score { font: 800 28px var(--font-round); color: var(--acc); }
.duel-q { font-family: var(--font-round); font-weight: 700; font-size: 18px; line-height: 1.3; min-height: 3.2em; }
.duel-opts { display: grid; gap: 8px; }
.duel-opt { position: relative; border: 0; border-radius: 14px; padding: 12px 14px 12px 46px; text-align: left; background: var(--fill-2); font-weight: 600; font-size: 15px; min-height: 52px; touch-action: manipulation; }
.duel-opt::before { content: attr(data-key); position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #fff; font-weight: 800; font-size: 13px; color: var(--ink-2); }
.duel-opt.is-right { background: #eafaf0; box-shadow: inset 0 0 0 2px var(--ok); }
.duel-opt.is-wrong { background: #fff0ef; box-shadow: inset 0 0 0 2px var(--bad); }

/* resumen */
.sum { width: 100%; max-width: 760px; display: grid; gap: 14px; }
.sum-intro { margin: 0; font-size: 19px; line-height: 1.55; color: var(--ink-2); font-weight: 500; }
.sum-toc { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.sum-chip { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--card); box-shadow: var(--sh-1); font-weight: 700; font-size: 14px; color: var(--ink-2); }
.sum-chip:hover { color: var(--acc); }
.sum-sec { padding: 22px 22px 20px; border-radius: var(--r-xl); background: var(--card); box-shadow: var(--sh-1); animation: screenIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); scroll-margin-top: 20px; }
.sum-sec h2 { display: flex; align-items: center; gap: 12px; font-size: 22px; margin-bottom: 8px; }
.sum-num { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc-2)); }
.sum-sec p { margin: 0 0 10px; font-size: 17px; line-height: 1.6; color: #333; }
.sum-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sum-points li { position: relative; padding: 10px 14px 10px 40px; border-radius: 14px; background: var(--fill-2); font-weight: 600; line-height: 1.4; }
.sum-points li::before { content: ""; position: absolute; left: 16px; top: 17px; width: 9px; height: 9px; border-radius: 50%; background: var(--acc); }
.sum-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.sum-terms details { border-radius: 14px; background: var(--fill-2); padding: 10px 14px; }
.sum-terms summary { cursor: pointer; font-weight: 800; color: var(--acc); list-style: none; }
.sum-terms summary::-webkit-details-marker { display: none; }
.sum-terms details p { margin: 6px 0 0; font-size: 15px; }

/* ---------- resultados ---------- */
.results-card { width: 100%; max-width: 640px; padding: 24px 22px 26px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.results-cast { display: flex; align-items: flex-end; gap: 6px; }
.stars { display: flex; gap: 10px; margin: 6px 0 10px; }
.stars i { width: 44px; height: 44px; background: #e5e5ea; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.stars i.on { background: linear-gradient(135deg, #ffd60a, #ff9f0a); animation: starIn .6s var(--spring) both; }
.stars i.on:nth-child(2) { animation-delay: .18s; } .stars i.on:nth-child(3) { animation-delay: .36s; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.results-card h1 { font-size: 30px; }
.results-score { font-size: 17px; color: var(--ink-2); margin: 6px 0 0; }
.results-score strong { font: 800 30px var(--font-round); color: var(--ink); }
.results-new, .results-stars { margin: 10px 0 0; padding: 4px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.results-new { background: #fff7d1; color: #8a6d00; }
.results-stars { background: var(--acc-soft); color: var(--acc); }
.review { width: 100%; text-align: left; margin-top: 18px; display: grid; gap: 8px; max-height: 40vh; overflow-y: auto; }
.review h2 { font-size: 19px; text-align: center; }
.review-item { padding: 12px 14px; border-radius: 16px; background: var(--fill-2); }
.review-item b { display: block; margin-bottom: 4px; }
.review-item span { color: var(--ink-2); font-size: 15px; }
.review-item .right { color: #1f8a3d; font-weight: 800; }
.results-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 22px; width: 100%; }
.btn-wide { width: min(360px, 100%); min-height: 56px; font-size: 19px; }
.results-links { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.results-links .btn { min-height: 40px; padding: 8px 16px; font-size: 16px; }
/* si no hay siguiente nivel, "Otra vez" pasa a ser el botón principal */
.results-actions.no-next #btn-again { background: var(--acc); color: #fff; box-shadow: 0 6px 18px -6px var(--acc); }

/* tarjeta "Te toca" del menú */
.next-up {
  width: 100%; max-width: 760px; margin-bottom: 12px; border: 0; padding: 14px 16px 14px 14px; border-radius: var(--r-xl);
  display: flex; align-items: center; gap: 14px; text-align: left; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, var(--g1, var(--acc-2)), var(--g2, var(--acc)));
  box-shadow: 0 14px 30px -14px var(--g2, var(--acc)), 0 0 0 1px rgba(0,0,0,.04);
  transition: transform .45s var(--spring), box-shadow .3s;
}
.next-up:hover { transform: translateY(-3px) scale(1.01); }
.next-up:active { transform: scale(.98); }
.next-ico { width: 64px; height: 64px; flex: none; border-radius: 18px; background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.8); display: grid; place-items: center; transform: rotate(-4deg); }
.next-ico svg { width: 80%; height: 80%; filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); }
.next-txt { flex: 1; display: grid; line-height: 1.2; }
.next-txt small { font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.next-txt strong { font: 800 22px var(--font-round); letter-spacing: -.01em; }
.next-txt span { font-weight: 700; font-size: 14px; opacity: .9; }
.next-play { width: 54px; height: 54px; flex: none; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(0,0,0,.15); animation: beat 1.8s ease-in-out infinite; }
.next-play svg { width: 24px; height: 24px; fill: var(--g2, var(--acc)); margin-left: 3px; }

/* puntitos de progreso bajo cada juego */
.app-dots { display: flex; gap: 3px; height: 6px; }
.app-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(60,60,67,.18); }
.app-dots i.on { background: var(--gold); box-shadow: 0 0 0 1px #e0a400 inset; }

/* durante la partida: sin barra inferior, todo el foco en el juego */
body.in-game .dock { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.dock { transition: transform .5s var(--ease), opacity .3s; }
body.in-game #app { padding-bottom: 32px; }
.hud-score { display: flex; align-items: center; gap: 6px; }
.hud-av { width: 22px; height: 30px; margin: -6px 0; }

/* ---------- mochila ---------- */
.profile-head { width: 100%; max-width: 760px; display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.profile-head > div:nth-child(2) { flex: 1; }
.profile-head h1 { font-size: 32px; }
.profile-head p { margin: 2px 0 0; color: var(--ink-3); }
.wallet { width: 100%; max-width: 760px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wallet-item { padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--sh-1); text-align: center; }
.wallet-item strong { display: block; font: 800 34px/1 var(--font-round); color: var(--acc); }
.wallet-item span { font-weight: 700; color: var(--ink-3); font-size: 13px; }
.shop-note { font-weight: 700; min-height: 1.2em; text-align: center; margin: 14px 0 6px; }
.packs { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 6px 0 12px; }
.pack {
  position: relative; width: 200px; padding: 24px 18px 18px; border-radius: var(--r-xl); border: 0; background: var(--card); box-shadow: var(--sh-2);
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .45s var(--spring), box-shadow .3s;
}
.pack:hover { transform: translateY(-5px); box-shadow: var(--sh-3); }
.pack-n { font: 800 52px/1 var(--font-round); background: linear-gradient(135deg, var(--acc), var(--acc-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pack-label { font-weight: 700; color: var(--ink-3); }
.pack-price { font: 800 24px var(--font-round); margin-top: 8px; }
.pack-each { font-size: 13px; color: var(--ink-3); }
.pack-tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, #ffd60a, #ff9f0a); color: #5c3b00; font-weight: 800; font-size: 12px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; box-shadow: var(--sh-1); }
.shop-small { text-align: center; color: var(--ink-3); font-size: 13px; max-width: 520px; }

/* ---------- barra inferior (cristal) ---------- */
.dock {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(720px, calc(100% - 24px)); height: 64px; padding: 0 10px; border-radius: 22px;
  display: flex; align-items: center; justify-content: space-between; z-index: 20;
  background: var(--glass); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.12);
}
.dock-clock { text-align: center; line-height: 1.1; }
.dock-clock span { font: 700 20px var(--font-round); color: var(--ink); letter-spacing: -.01em; }
.dock-clock small { display: block; font-weight: 600; color: var(--ink-3); font-size: 12px; }
.dock-right { display: flex; align-items: center; gap: 8px; }
.round-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--fill); display: grid; place-items: center; transition: transform .35s var(--spring), background .2s; }
.round-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.round-btn:hover { background: rgba(120,120,128,.2); }
.round-btn:active { transform: scale(.9); }
.round-btn.small { width: 40px; height: 40px; background: var(--card); box-shadow: var(--sh-1); }
.round-btn.small svg { width: 18px; height: 18px; }
#btn-sound .ico-off { display: none; }
#btn-sound[aria-pressed="true"] .ico-on { display: none; }
#btn-sound[aria-pressed="true"] .ico-off { display: block; }
.pill-btn { height: 46px; padding: 0 14px 0 8px; border-radius: 999px; border: 0; background: var(--fill); display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; transition: transform .35s var(--spring), background .2s; }
.pill-btn:hover { background: rgba(120,120,128,.2); }
.pill-btn:active { transform: scale(.94); }
.pill-btn .num { background: var(--acc); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 13px; line-height: 22px; }

.toast {
  position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 50;
  padding: 12px 20px; border-radius: 999px; font-weight: 700; color: var(--ink);
  background: var(--glass); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.14);
  animation: toastIn .5s var(--spring);
}
@keyframes toastIn { from { transform: translate(-50%, -30px) scale(.9); opacity: 0; } }

.confetti { position: fixed; top: -12px; width: 9px; height: 13px; border-radius: 3px; pointer-events: none; z-index: 30; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- móvil ---------- */
@media (max-width: 760px) {
  .apps { grid-template-columns: repeat(4, 1fr); gap: 18px 6px; }
  .app-ico { width: 70px; height: 70px; border-radius: 22px; border-width: 3px; }
  .app-name { font-size: 12px; }
  .app-best { right: calc(50% - 40px); }
  .options { grid-template-columns: 1fr; }
  .memory-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .level-row { grid-template-columns: 1fr; max-width: 380px; }
  .level-card { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 14px 18px; text-align: left; }
  .level-ico { width: 60px; height: 60px; border-radius: 18px; margin: 0; }
  .level-card svg { width: 40px; height: 40px; }
  .level-card small { margin-left: auto; text-align: right; }
  .tf-btn { width: 112px; height: 112px; }
  .avatar-editor { grid-template-columns: 1fr; }
  .avatar-stage { position: static; padding: 14px; }
  .avatar-big { width: 120px; height: 187px; }
  .podium { width: 130px; height: 26px; }
  .av-options { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
  .av-thumb { width: 56px; height: 58px; }
  .order-board { grid-template-columns: 1fr; }
  .duel-arena { grid-template-columns: 1fr; }
  .duel-side.p1 { transform: rotate(180deg); } /* cara a cara en el móvil */
  .duel-side.p1.won { transform: rotate(180deg) translateY(3px); }
  .duel-vs { grid-template-columns: 1fr; }
  .profile-head { flex-wrap: wrap; }
  .dock-clock small { display: none; }
  .pill-btn #account-label { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .wallet { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .wallet-item strong { font-size: 26px; }
  .sum-sec { padding: 18px 16px; }
}

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