/* ==========================================================================
   OrtoQuest · Estilos
   ========================================================================== */
:root {
  --bg: #c8cafb;
  --bg-2: #b4b8f5;
  --primary: #6a3df0;
  --primary-dark: #4b22c4;
  --primary-soft: #ece6ff;
  --ink: #1d1640;
  --muted: #55517e;
  --card: #ffffff;
  --card-soft: #f3f1ff;
  --line: #ddd8f5;
  --ok: #2f9e4f;
  --ok-bg: #dbf7d2;
  --ok-line: #57c26f;
  --ko: #d4621a;
  --ko-bg: #fff1e4;
  --ko-line: #ff9b52;
  --gold: #ffc83d;
  --teal: #2ec4b6;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(60, 40, 140, .12), 0 12px 28px rgba(60, 40, 140, .12);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 12%, rgba(255,255,255,.55) 0 6px, transparent 7px),
    radial-gradient(circle at 92% 22%, rgba(124,77,255,.35) 0 5px, transparent 6px),
    radial-gradient(circle at 85% 70%, rgba(46,196,182,.45) 0 6px, transparent 7px),
    radial-gradient(circle at 12% 80%, rgba(255,107,154,.35) 0 5px, transparent 6px),
    radial-gradient(ellipse at 50% 120%, var(--bg-2), transparent 60%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.4;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

#app {
  max-width: 600px;
  margin: 0 auto;
  padding-block: 12px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- elementos comunes ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin: 14px 0;
}
.card h3 { margin: 0 0 10px; font-size: 1.15rem; }
.card ul { margin: 0; padding-left: 1.2em; }
.card li { margin: 6px 0; }
.center { text-align: center; }
.sub { color: var(--muted); margin: 4px 0 12px; }
.hint { color: var(--muted); font-size: .92rem; margin: 6px 0 10px; }
.fineprint { color: var(--muted); font-size: .85rem; text-align: center; margin: 20px 8px; }
.section-title { font-size: 1.3rem; margin: 22px 4px 10px; }
.tag { display: inline-block; background: var(--ko-bg); color: var(--ko); border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-weight: 700; }
.tag.ok { background: var(--ok-bg); color: var(--ok); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 20px;
  border: 0; border-radius: 999px;
  font-weight: 800; font-size: 1.08rem;
  transition: transform .08s ease, box-shadow .08s ease, background .2s;
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: translateY(3px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; margin: 10px 0; }
.btn-xl { min-height: 64px; font-size: 1.4rem; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 5px 0 var(--primary-dark); }
.btn-primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--primary-dark); }
.btn-ghost { background: #fff; color: var(--primary-dark); box-shadow: 0 4px 0 var(--line); }
.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 5px 0 #1f7a3a; }
.btn-ko { background: #e9711f; color: #fff; box-shadow: 0 5px 0 #b4520f; }
.btn-danger { background: #fff; color: #c0392b; box-shadow: 0 4px 0 #f1c9c4; }
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.85); font-size: 1.4rem; font-weight: 800; color: var(--primary-dark);
  box-shadow: 0 3px 0 rgba(60,40,140,.15);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn.small { width: 40px; height: 40px; font-size: 1.1rem; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; font-weight: 800; background: #fff3e3; box-shadow: 0 3px 0 rgba(60,40,140,.12); white-space: nowrap; }
.pill-lvl { background: #e9fbf8; color: #127a6f; }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 3px solid var(--line); border-radius: 16px; background: #fff;
  font-size: 1.15rem; /* ≥16px evita el zoom en iPhone */
  outline: none;
}
.input:focus { border-color: var(--primary); }
.input.big { font-size: 1.35rem; font-weight: 700; }
textarea.input { resize: none; }
.field-label { display: block; font-weight: 800; margin: 16px 2px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 46px; min-width: 56px; padding: 8px 16px; border-radius: 999px; border: 3px solid var(--line); background: #fff; font-weight: 800; font-size: 1.05rem; }
.chip.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.chev { font-size: 1.8rem; color: var(--primary); margin-left: auto; font-weight: 700; }
.bubble { position: relative; background: #fff; border-radius: 20px; padding: 12px 16px; box-shadow: 0 3px 0 rgba(60,40,140,.08); flex: 1; }
.bubble p { margin: 0; font-weight: 700; font-size: 1.05rem; }
.bubble::before { content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); border: 10px solid transparent; border-right-color: #fff; border-left: 0; }

.topbar { display: grid; grid-template-columns: minmax(48px, auto) 1fr minmax(48px, auto); align-items: center; gap: 8px; margin-bottom: 8px; }
.topbar h1 { margin: 0; text-align: center; font-size: 1.35rem; }

/* ---------- mascota ---------- */
.owl { flex: none; display: block; overflow: visible; }
.owl.bob { animation: bob 3s ease-in-out infinite; }
.owl.jump { animation: jump .6s ease; }
.owl.tilt { animation: tilt .7s ease; }
.owl-eyes { animation: blink 5s infinite; transform-origin: 60px 54px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes jump { 0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-16px) scale(1.06); } 100% { transform: translateY(0) scale(1); } }
@keyframes tilt { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-10deg); } 65% { transform: rotate(8deg); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* ---------- bienvenida ---------- */
.welcome { padding-top: 10px; }
.welcome-hero { text-align: center; margin: 10px 0 20px; }
.welcome-hero .owl { margin: 0 auto; }
.logo { font-size: 3rem; margin: 8px 0 4px; color: #fff; letter-spacing: -.5px; text-shadow: 0 3px 0 var(--primary-dark), 0 6px 14px rgba(60,40,140,.3); }
.tagline { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin: 0 10px; }
.profile-list { display: grid; gap: 10px; }
.profile-pill { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-align: left; }
.profile-pill .avatar { font-size: 2.4rem; width: 58px; height: 58px; display: grid; place-items: center; background: var(--primary-soft); border-radius: 50%; }
.pp-text { display: flex; flex-direction: column; }
.pp-text b { font-size: 1.25rem; }
.pp-text small { color: var(--muted); font-weight: 600; }

/* ---------- perfil ---------- */
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.avatar-opt { height: 62px; font-size: 2rem; border-radius: 18px; border: 3px solid var(--line); background: #fff; }
.avatar-opt.on { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.05); }
.diff-list { display: grid; gap: 8px; }
.diff-opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border: 3px solid var(--line); background: #fff; border-radius: 18px; }
.diff-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.diff-opt b { display: block; font-size: 1.1rem; }
.diff-opt small { color: var(--muted); font-weight: 600; }
.diff-emoji { font-size: 1.8rem; }

/* ---------- inicio ---------- */
.home-head { display: flex; align-items: center; gap: 10px; }
.avatar-btn { width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; background: var(--primary-soft); font-size: 2rem; box-shadow: 0 3px 0 rgba(60,40,140,.15); flex: none; }
.brand { font-size: 1.9rem; font-weight: 900; color: #fff; text-shadow: 0 2px 0 var(--primary-dark), 0 4px 10px rgba(60,40,140,.3); flex: 1; letter-spacing: -.3px; }
.pills { display: flex; gap: 6px; }
.xpbar { position: relative; height: 34px; margin: 16px 0 6px 8px; background: rgba(255,255,255,.6); border-radius: 999px; box-shadow: inset 0 2px 4px rgba(60,40,140,.15); }
.xp-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5b2be0, #7b4ce0 60%, #2ec4b6); transition: width .6s ease; }
.xp-star { position: absolute; left: -10px; top: 50%; transform: translateY(-50%); font-size: 2rem; z-index: 2; filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); }
.xp-text { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); font-size: 1rem; }
.hello { display: flex; align-items: center; gap: 14px; background: var(--card-soft); }
.hello .bubble { box-shadow: none; }
.continue { flex-direction: column; gap: 0; line-height: 1.1; padding: 12px 20px; }
.continue small { font-size: .95rem; font-weight: 700; opacity: .9; margin-top: 4px; }
.goal { text-align: center; font-weight: 800; color: var(--muted); background: rgba(255,255,255,.55); border-radius: 999px; padding: 8px 14px; margin: 6px auto 10px; width: fit-content; max-width: 100%; }
.goal.done { color: var(--ok); background: var(--ok-bg); }
.refuerzo-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; margin: 10px 0; border: 3px solid var(--ko-line); background: var(--ko-bg); border-radius: 20px; box-shadow: 0 4px 0 rgba(212,98,26,.18); }
.refuerzo-card.custom { border-color: var(--teal); background: #e7fbf8; box-shadow: 0 4px 0 rgba(46,196,182,.25); }
.refuerzo-card b { display: block; font-size: 1.1rem; }
.refuerzo-card small { color: var(--muted); font-weight: 600; }
.rc-emoji { font-size: 2rem; }
.worlds { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .worlds { grid-template-columns: 1fr 1fr; } }
.world-card { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 20px; background: #fff; text-align: left; box-shadow: 0 4px 0 color-mix(in srgb, var(--wc) 40%, #ddd), 0 8px 18px rgba(60,40,140,.1); border-left: 8px solid var(--wc); }
.wc-emoji { font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: color-mix(in srgb, var(--wc) 15%, #fff); flex: none; }
.wc-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wc-body b { font-size: 1.08rem; }
.wc-body small { color: var(--muted); font-weight: 700; }
.wc-prog { height: 10px; background: #eee; border-radius: 999px; overflow: hidden; }
.wc-prog span { display: block; height: 100%; background: var(--wc); border-radius: 999px; }
.wc-badge { font-size: 1.6rem; }
.home-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin-top: 22px; }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 0; border-radius: 18px; background: #fff; font-weight: 800; box-shadow: var(--shadow); font-size: .95rem; }
.nav-btn span { font-size: 1.7rem; }

/* ---------- mundo ---------- */
.mascot-tip { display: flex; align-items: center; gap: 12px; background: var(--card-soft); }
.mascot-tip .bubble { box-shadow: none; }
.path { position: relative; padding: 10px 0; }
.node-row { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.node-row.right { flex-direction: row-reverse; text-align: right; }
.node-row.right .node-stars { justify-content: flex-end; }
.node { width: 92px; height: 92px; border-radius: 50%; border: 0; flex: none; font-size: 2.2rem; font-weight: 900; color: #fff; background: var(--wc); box-shadow: 0 7px 0 color-mix(in srgb, var(--wc) 60%, #000), 0 12px 20px rgba(0,0,0,.15); }
.node.done { background: var(--gold); color: #7a5300; box-shadow: 0 7px 0 #c99412, 0 12px 20px rgba(0,0,0,.15); }
.node.current { animation: pulse 1.6s ease-in-out infinite; }
.node.locked { background: #d9d6ec; color: #8f8bab; box-shadow: 0 7px 0 #b9b5d3; font-size: 1.8rem; }
.node:active:not(.locked) { transform: translateY(4px); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.node-info { background: #fff; border-radius: 18px; padding: 10px 14px; box-shadow: 0 4px 0 rgba(60,40,140,.1); flex: 1; display: flex; flex-direction: column; }
.node-info b { font-size: 1.1rem; }
.node-info span { font-weight: 700; color: var(--muted); }
.node-info small { color: var(--muted); }
.go-hint { color: var(--primary) !important; font-weight: 800; }
.node-stars { display: flex; gap: 2px; }
.star { font-size: 1.3rem; color: #d8d4ee; }
.star.on { color: var(--gold); text-shadow: 0 2px 0 #c99412; }
.rules-box summary { font-weight: 800; cursor: pointer; padding: 4px 0; font-size: 1.05rem; }
.rules-box li { margin: 10px 0; }
.rules-box em { display: block; color: var(--muted); }

/* ---------- lección ---------- */
.lesson-top { display: flex; align-items: center; gap: 10px; }
.lprog { flex: 1; height: 20px; background: rgba(255,255,255,.6); border-radius: 999px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(60,40,140,.15); }
.lprog > div { height: 100%; background: linear-gradient(90deg, #5b2be0, #2ec4b6); border-radius: 999px; transition: width .4s ease; }
.ltitle { background: rgba(255,255,255,.75); border-radius: var(--radius) var(--radius) 0 0; padding: 12px 16px 22px; margin-top: 10px; }
.ltitle h2 { margin: 0; font-size: 1.2rem; }
.ltitle p { margin: 4px 0 0; color: var(--muted); font-weight: 700; font-size: .95rem; }
.lmascot { display: flex; align-items: center; gap: 12px; background: var(--card-soft); border: 3px solid #fff; border-radius: var(--radius); padding: 6px 12px; margin: -16px 0 12px; box-shadow: var(--shadow); }
.lmascot .bubble { box-shadow: none; background: transparent; padding: 2px; }
.lmascot .bubble p { font-size: 1rem; }
.lmascot .bubble::before { display: none; }
.qcard { background: #fff; border-radius: var(--radius); padding: 16px 14px; box-shadow: var(--shadow); }
.qcard.locked { pointer-events: none; }
.qcard.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.02); } }
.qtext { margin: 0 0 14px; font-size: 1.25rem; text-align: center; }
.qtext.small { font-size: 1.1rem; color: var(--muted); }
.opts { display: grid; gap: 12px; }
.opts.row { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 10px 18px; border: 3px solid var(--line); border-radius: 999px; background: #fff; font-size: 1.45rem; font-weight: 800; text-align: left; box-shadow: 0 4px 0 var(--line); transition: background .15s, border-color .15s; }
.opts.long .opt { font-size: 1.12rem; border-radius: 22px; line-height: 1.25; }
.opts.row .opt { justify-content: center; padding: 10px 12px; }
.opts.row .opt-ico { display: none; }
.opt-ico { width: 40px; height: 40px; flex: none; border-radius: 10px; border: 2px solid #b9b5d3; display: grid; place-items: center; font-size: 1.1rem; color: #8f8bab; }
.opt.sel { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 4px 0 #b9a6ff; }
.opt.sel .opt-ico { border-color: var(--primary); color: var(--primary); }
.opt.right { border-color: var(--ok-line); background: var(--ok-bg); box-shadow: 0 4px 0 #9fe0a9; }
.opt.right .opt-ico { border-color: var(--ok); color: var(--ok); }
.opt.wrong { border-color: var(--ko-line); background: var(--ko-bg); box-shadow: 0 4px 0 #ffc89e; }
.opt.wrong .opt-ico { border-color: var(--ko); color: var(--ko); }
.sentence { font-size: 1.5rem; font-weight: 800; text-align: center; margin: 6px 0 20px; line-height: 1.7; }
.blank { display: inline-block; min-width: 90px; border-bottom: 4px dashed var(--primary); margin: 0 4px; padding: 0 6px; color: var(--primary-dark); }
.blank.filled { border-bottom-style: solid; background: var(--primary-soft); border-radius: 8px 8px 0 0; }

.tilde-sentence { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; font-size: 1.55rem; font-weight: 800; margin: 8px 0; }
.tw { display: inline-flex; align-items: flex-end; padding: 4px 2px; border-radius: 10px; }
.tw.marked { background: #fff6d6; box-shadow: inset 0 -4px 0 var(--gold); }
.tw.ok { background: var(--ok-bg); }
.tw.ko { background: var(--ko-bg); }
.tv { border: 0; background: var(--primary-soft); color: var(--primary-dark); min-width: 34px; height: 46px; border-radius: 10px; font-size: inherit; font-weight: 900; padding: 0 4px; margin: 0 1px; box-shadow: 0 3px 0 #cfc3ff; }
.tv.acc { background: var(--primary); color: #fff; box-shadow: 0 3px 0 var(--primary-dark); }
.tc { padding: 0 1px; line-height: 46px; }

.fix-sentence { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 16px; }
.ftok { border: 3px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 12px; font-size: 1.3rem; font-weight: 800; min-height: 50px; box-shadow: 0 3px 0 var(--line); }
.ftok.bad { border-color: var(--ko-line); background: var(--ko-bg); }
.ftok.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.order-answer { min-height: 76px; border: 3px dashed var(--line); border-radius: 18px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.order-answer .placeholder { color: #a6a2c4; font-weight: 700; padding: 0 6px; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.wchip { border: 3px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 14px; font-size: 1.25rem; font-weight: 800; min-height: 52px; box-shadow: 0 3px 0 var(--line); }
.order-answer .wchip { border-color: var(--primary); background: var(--primary-soft); }
.wchip.used { opacity: .25; box-shadow: none; }

.dict-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.btn-audio { background: var(--teal); color: #fff; box-shadow: 0 5px 0 #1c8f85; min-height: 64px; font-size: 1.15rem; border-radius: 20px; padding: 8px 10px; min-width: 0; }
.btn-audio span { font-size: 1.5rem; }
.btn-audio.slow { background: #fff; color: #127a6f; box-shadow: 0 5px 0 #bfeee9; border: 3px solid var(--teal); }
.dict-fallback { text-align: center; margin-bottom: 12px; }
.diffbad { background: var(--ko-bg); color: var(--ko); border-radius: 6px; padding: 0 3px; text-decoration: underline wavy var(--ko-line); }

.lactions { margin-top: 14px; text-align: center; }
.lesson.checked { padding-bottom: 360px; }
.lactions .btn-block { margin: 4px 0; }
.skip { background: none; border: 0; color: var(--primary); font-weight: 800; font-size: 1.1rem; padding: 8px 20px; opacity: .85; }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 18px max(18px, env(safe-area-inset-left)) calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; animation: slideup .28s ease; max-height: 75vh; overflow-y: auto; box-shadow: 0 -8px 30px rgba(30,20,80,.25); }
.sheet > * { max-width: 568px; margin-left: auto; margin-right: auto; }
.sheet.ok { background: var(--ok-bg); border-top: 4px solid var(--ok-line); }
.sheet.ko { background: var(--ko-bg); border-top: 4px solid var(--ko-line); }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; }
.sheet.ok .sheet-head { color: #1f7a3a; }
.sheet.ko .sheet-head { color: #a84a0e; }
.sheet-ico { font-size: 2rem; }
.xp-gain { margin-left: auto; background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 1rem; font-weight: 900; color: var(--primary); }
.sheet-answer { margin: 10px 0; }
.sheet-answer small { display: block; color: var(--muted); font-weight: 700; }
.sheet-answer b { font-size: 1.3rem; }
.issues { margin: 6px 0 4px; padding-left: 1.2em; font-weight: 700; }
.issues li { margin: 4px 0; }
.rule { background: #fff; border-radius: 16px; padding: 12px 14px; margin: 10px 0; }
.rule p { margin: 6px 0 0; }
.rule .ex { color: var(--muted); }
.later { font-weight: 700; color: var(--muted); margin: 6px 0; font-size: .95rem; }

/* ---------- resultados ---------- */
.res-hero { text-align: center; }
.res-hero .owl { margin: 0 auto; }
.res-hero h1 { font-size: 2.1rem; margin: 8px 0 4px; color: #fff; text-shadow: 0 3px 0 var(--primary-dark); }
.res-hero p { font-weight: 700; margin: 0 10px; }
.big-stars { margin: 10px 0; }
.big-stars .star { font-size: 3.4rem; display: inline-block; animation: starpop .5s ease backwards; }
.big-stars .star:nth-child(2) { animation-delay: .2s; }
.big-stars .star:nth-child(3) { animation-delay: .4s; }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.stat { background: #fff; border-radius: 18px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.4rem; }
.stat small { color: var(--muted); font-weight: 700; }
.banner { background: #fff; border-radius: 16px; padding: 12px 16px; font-weight: 800; margin: 8px 0; box-shadow: 0 4px 0 rgba(60,40,140,.1); text-align: center; }
.new-badges { background: #fff9e3; border: 3px solid var(--gold); }
.badge-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.badge-row b { display: block; }
.badge-row small { color: var(--muted); }
.remember li { margin: 8px 0; }

/* ---------- insignias ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { background: #fff; border-radius: 20px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow); opacity: .6; display: flex; flex-direction: column; gap: 4px; }
.badge.got { opacity: 1; border: 3px solid var(--gold); }
.badge-emoji { font-size: 2.6rem; }
.badge small { color: var(--muted); font-size: .85rem; }

/* ---------- padres ---------- */
.gate-q { font-size: 2rem; font-weight: 900; margin: 10px 0 14px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: #fff; border-radius: 18px; padding: 12px 8px; text-align: center; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 1.4rem; }
.kpi small { color: var(--muted); font-weight: 700; font-size: .82rem; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal { aspect-ratio: 1; border-radius: 8px; background: #eeebfa; }
.cal.on { background: var(--primary); }
.cal.today { outline: 3px solid var(--gold); }
.barrow { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 44px; align-items: center; gap: 8px; margin: 8px 0; font-weight: 700; font-size: .95rem; }
.bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 14px; background: #eeebfa; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; }
.bv { text-align: right; }
.errlist li { margin: 10px 0; }
.errlist s { color: var(--ko); }
.custom-list { list-style: none; padding: 0 !important; margin-top: 14px !important; }
.custom-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--card-soft); border-radius: 14px; }
.settings-actions { margin-top: 16px; }
.file-btn { cursor: pointer; }

/* ---------- héroes y taller ---------- */
.hx { position: relative; display: inline-block; flex: none; line-height: 0; vertical-align: middle; }
.hx img { position: absolute; left: 50%; bottom: 7%; height: 86%; max-width: 100%; object-fit: contain; transform: translateX(-50%); z-index: 2; -webkit-user-drag: none; user-select: none; }
.hx.bust { overflow: hidden; border-radius: 22%; }
.hx.bust img { height: 180%; max-width: none; top: 4%; bottom: auto; }
.hx-aura { position: absolute; inset: -6% -6% 0; width: 112%; height: 100%; z-index: 0; animation: auraPulse 2.6s ease-in-out infinite; }
@keyframes auraPulse { 50% { transform: scale(1.04); opacity: .85; } }
.hx-ped { position: absolute; left: 8%; bottom: 0; width: 84%; height: auto; z-index: 1; }
.hx-shadow { position: absolute; left: 22%; bottom: 4%; width: 56%; height: 8%; border-radius: 50%; background: rgba(36,26,58,.22); z-index: 1; }
.hx-evo { position: absolute; right: 4%; top: 4%; z-index: 3; font-size: 13px; line-height: 1; padding: 4px 6px; border-radius: 999px; background: #fff; color: #9aa5b4; box-shadow: 0 2px 0 rgba(0,0,0,.15); font-weight: 900; letter-spacing: 1px; }
.hx-evo.s2 { color: #e0a20b; }
.hx-evo.s3 { color: #fff; background: linear-gradient(135deg, #ffcf3d, #ff8a3d); }
.hx.bust .hx-evo { display: none; }
.hx-bust-aura { position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.hx-rays { position: absolute; inset: 0; z-index: 0; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,215,74,.45) 0 10deg, transparent 10deg 30deg); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hx.trying img { animation: pop .35s ease; }
.hx { flex: none; display: block; overflow: visible; }
.hx.bob { animation: bob 3s ease-in-out infinite; }
.hx.jump { animation: jump .7s ease 2; }
.profile-row { display: flex; align-items: center; gap: 8px; }
.profile-row .profile-pill { flex: 1; min-width: 0; }
.profile-pill .avatar { background: none; width: auto; height: auto; }
.del-btn { background: #fff; flex: none; }
.profile-pill .avatar { display: block; border-radius: 18px; overflow: hidden; line-height: 0; border: 3px solid #fff; box-shadow: 0 2px 0 rgba(60,40,140,.15); }
.hero-btn { border-radius: 50%; overflow: hidden; line-height: 0; border: 3px solid #fff !important; box-shadow: 0 3px 0 rgba(60,40,140,.2) !important; }
.shop-stage { display: flex; align-items: center; gap: 10px; background: radial-gradient(circle at 35% 45%, #fff 0, var(--card-soft) 60%); }
.shop-stage .hx { flex: none; }
.hx.trying { filter: drop-shadow(0 0 10px rgba(124,77,255,.45)); }
.shop-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shop-side > b { font-size: 1.4rem; }
.shop-side > small { color: var(--muted); font-weight: 700; }
.try-panel { background: #fff; border-radius: 16px; padding: 10px 12px; margin-top: 6px; box-shadow: 0 3px 0 var(--line); }
.try-panel b { display: block; margin-bottom: 4px; }
.try-panel .btn-block { margin: 6px 0 0; min-height: 48px; font-size: 1rem; }
.why { margin: 4px 0 0; font-weight: 700; color: var(--muted); font-size: .92rem; }
.link-btn.left { margin: 4px 0 0; padding: 6px 0; text-align: left; }
.si-thumb { display: block; width: 92px; height: 92px; border-radius: 14px; background: var(--card-soft); overflow: hidden; line-height: 0; }
.shop-item.sel { border-color: var(--primary); box-shadow: 0 3px 0 #b9a6ff; }
.shop-item.locked .si-thumb { opacity: .85; }
.evo-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.evo { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 16px; background: var(--card-soft); }
.evo:not(.got) .hx { filter: grayscale(.7); opacity: .7; }
.evo b { font-size: .9rem; }
.evo small { color: var(--muted); font-weight: 700; font-size: .75rem; }
.evo .hx { max-width: 100%; height: auto; }
.chest-preview { display: flex; justify-content: center; }
@media (max-width: 420px) { .shop-stage { flex-direction: column; text-align: center; } .shop-side { width: 100%; } .link-btn.left { text-align: center; } }
.link-btn { display: block; margin: 4px auto; background: none; border: 0; color: var(--primary-dark); font-weight: 800; font-size: 1rem; text-decoration: underline; padding: 10px; }
.hero-btn { width: 64px; height: 64px; padding: 0; border: 0; background: none; box-shadow: none; }
.pill-coin { border: 0; background: #fff7d6; color: #7a5300; font-size: 1rem; }
.hero-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-opt .hx { max-width: 100%; height: auto; }
.hero-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 3px solid var(--line); border-radius: 20px; background: #fff; }
.hero-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.hero-opt small, .hero-card small { color: var(--muted); font-weight: 700; }
.hero-res { display: flex; align-items: center; gap: 14px; }
.hr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hr-body small { color: var(--muted); font-weight: 700; }
.mini-bar { height: 12px; background: #eeebfa; border-radius: 999px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: linear-gradient(90deg, #5b2be0, #2ec4b6); border-radius: 999px; }
.lvlup { margin: 4px 0 0; font-weight: 800; color: var(--primary-dark); }
.chest { text-align: center; background: #fff9e3; border: 3px solid var(--gold); }
.chest-ico { font-size: 3rem; animation: jump .8s ease 2; }
.chest h3 { margin: 4px 0; }
.chest-item { font-size: 1.15rem; margin: 6px 0; }
.hero-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.hm-body { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.hm-body h2 { margin: 0; font-size: 1.5rem; }
.hm-body h2 small { font-size: 1rem; color: var(--muted); }
.stage { margin: 0; font-weight: 800; color: var(--primary-dark); }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.hero-card { background: #fff; border-radius: 20px; padding: 12px 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; border: 3px solid transparent; }
.hero-card.active { border-color: var(--primary); }
.hero-card.locked .hx { filter: grayscale(.85) brightness(.9); opacity: .75; }
.btn-sm { min-height: 44px; font-size: .95rem; padding: 6px 12px; margin-top: 4px; }
.shop-preview { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 6px 0 14px; }
.shop-preview > div { display: flex; flex-direction: column; }
.shop-preview b { font-size: 1.4rem; }
.shop-preview small { color: var(--muted); font-weight: 700; }
.shop-preview .link-btn { margin: 0; padding: 6px 0; text-align: left; }
.slot-tabs { justify-content: center; margin-bottom: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 3px solid var(--line); border-radius: 18px; background: #fff; text-align: center; font-size: .92rem; box-shadow: 0 3px 0 var(--line); }
.shop-item.on { border-color: var(--ok-line); background: var(--ok-bg); }
.shop-item.locked { opacity: .7; }
.si-e { font-size: 2.2rem; line-height: 1.1; }
.price { font-weight: 900; color: #7a5300; }
.price.short { color: var(--muted); }
.tag.lock { background: #eeebfa; color: var(--muted); }
.big-emoji { font-size: 3.4rem; }

/* ---------- toasts, modal, confeti ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 60; transition: all .25s ease; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal-wrap { position: fixed; inset: 0; background: rgba(29,22,64,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 26px; padding: 22px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.3); animation: pop .25s ease; }
.modal .owl { margin: 0 auto; }
.modal h3 { margin: 8px 0; font-size: 1.4rem; }
.modal-actions { display: grid; gap: 10px; margin-top: 16px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { top: 110vh; transform: rotate(720deg) translateX(40px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 380px) {
  .brand { font-size: 1.5rem; }
  .opt { font-size: 1.25rem; }
  .tilde-sentence { font-size: 1.5rem; }
  .tv { min-width: 30px; height: 44px; }
  .tc { line-height: 44px; }
  .node { width: 78px; height: 78px; }
}
@media (min-width: 768px) {
  #app { max-width: 680px; }
}
@media (max-width: 430px) {
  .brand { font-size: 1.4rem; min-width: 0; }
  .home-head { gap: 8px; }
  .pills .pill { padding: 6px 9px; font-size: .95rem; }
}

/* ---------- sala de trofeos e insignias ---------- */
.emblem { flex: none; display: block; overflow: visible; }
.emblem.locked { filter: grayscale(1) brightness(.72); opacity: .8; }
.emblem.got { filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.emblem .em-rays { transform-origin: 60px 66px; animation: spin 14s linear infinite; }
.trophy-hall { background: radial-gradient(circle at 50% 0, #3d3392 0, #241d5c 45%, #17123d 100%); border-radius: 26px; padding: 18px 14px 22px; color: #fff; box-shadow: var(--shadow); }
.trophy-count { text-align: center; margin: 0 0 8px; font-weight: 700; color: #d9d4ff; }
.trophy-count b { color: #ffd54a; font-size: 1.4rem; }
.trophy-bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin: 0 8px 6px; }
.trophy-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffcf3d, #ff8a3d); }
.trophy-title { margin: 22px 4px 12px; font-size: 1.15rem; color: #ffd54a; text-transform: uppercase; letter-spacing: .08em; text-align: center; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.trophy { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 14px 8px 12px; border-radius: 20px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.trophy.got { background: linear-gradient(180deg, rgba(255,213,74,.16), rgba(255,255,255,.04)); border-color: rgba(255,213,74,.35); }
.trophy b { font-size: 1rem; line-height: 1.2; }
.trophy small { color: #b9b3e6; font-size: .82rem; }
.trophy:not(.got) b { color: #b9b3e6; }
.tier { display: inline-block; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; padding: 2px 9px; border-radius: 999px; }
.tier.t-bronce { background: #c97a3a; color: #fff; }
.tier.t-plata { background: #b9c3d4; color: #2b3446; }
.tier.t-oro { background: #f0b429; color: #4a2f00; }
.tier.t-leyenda { background: linear-gradient(90deg, #c06cf5, #7c3aed); color: #fff; }
.badge-row .emblem { margin-right: 4px; }
.badge-row > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.wc-badge { line-height: 0; }

/* ---------- instalación (PWA) ---------- */
.nav-btn.install { background: linear-gradient(180deg, #fff, #f1ecff); border: 2px solid var(--primary); }
.ios-steps { text-align: left; margin: 10px 0 0; padding-left: 1.3em; font-size: 1.05rem; line-height: 1.5; }
.ios-steps li { margin: 6px 0; }
.ios-share { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: #e8f0ff; color: #2563eb; font-weight: 900; }
@media (display-mode: standalone) { body { -webkit-user-select: none; user-select: none; } input, textarea { -webkit-user-select: text; user-select: text; } }
