/* Letras alojadas en la propia web (antes venían de Google Fonts) */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("fonts/fredoka-latin.woff2") format("woff2"); }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/lexend-latin.woff2") format("woff2"); }
/* =====================================================================
   Mapedí · Estilo "expedición": papel de mapa, azul marino, mango y teal.
   Las animaciones de Pepín están en pepin.css.
   ===================================================================== */
:root {
  --ink: #1E2A44; --ink-2: #2A3A5E; --muted: #6B7489;
  --paper: #F7F2E8; --card: #FFFFFF; --line: #E9E1D2; --line-d: #D9CFBC;
  --primary: #FF7A45; --primary-d: #E85F2A;
  --green: #12A594; --green-d: #0D8577;       /* teal (nombre heredado) */
  --purple: #7C5CE0; --purple-d: #5E40C0;
  --yellow: #FFC93C; --yellow-d: #E0A812;
  --coral: #E24C7A; --coral-d: #B8325C;
  --blue: #3A7BEA; --blue-d: #2A5FC0;
  --ok-bg: #E3F7EE; --ok-ink: #12805C;
  --ko-bg: #FDE8EE; --ko-ink: #B8325C;
  --cat: var(--green); --cat-d: var(--green-d);
  --radius: 20px;
  --shadow: 0 1px 2px rgba(30,42,68,.06), 0 6px 18px rgba(30,42,68,.08);
  --shadow-lg: 0 10px 30px rgba(30,42,68,.16);
  --font-title: "Fredoka", "Lexend", system-ui, sans-serif;
  --font: "Lexend", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background-color: var(--paper);
  background-image: radial-gradient(rgba(30,42,68,.07) 1px, transparent 1.2px);
  background-size: 22px 22px; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4, .logo, .page-title, .sec-title { font-family: var(--font-title); font-weight: 600; letter-spacing: -.01em; }
b, strong { font-weight: 600; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
img { display: block; max-width: 100%; }
a { color: var(--blue); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }
.center { text-align: center; }

/* ---------- Botones: píldoras con sombra suave ---------- */
.btn {
  --b: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; min-height: 50px; border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--b) 85%, #fff), var(--b));
  color: #fff; font-family: var(--font-title); font-weight: 600; font-size: 17px; letter-spacing: .01em;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--b) 35%, transparent); transition: transform .12s, box-shadow .12s; user-select: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px color-mix(in srgb, var(--b) 40%, transparent); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { background: #E7E1D6; color: #A39C8F; box-shadow: none; transform: none; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-d); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--ink-2); }
.btn.purple { --b: var(--purple); }
.btn.coral { --b: var(--coral); }
.btn.yellow { --b: var(--yellow); color: var(--ink); }
.btn.block { width: 100%; }
.btn.danger { color: var(--coral-d); }
a.btn { text-decoration: none; }
.linkbtn { color: var(--blue); font-weight: 600; text-decoration: underline; }

/* ---------- Bocadillo ---------- */
.bubble { position: relative; background: #fff; border-radius: 18px 18px 18px 6px; padding: 14px 18px; font-weight: 500; font-size: 17px; line-height: 1.4; box-shadow: var(--shadow); animation: pop .35s cubic-bezier(.2,1.5,.4,1); }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(18px); opacity: 0; } }

/* ---------- Tarjetas y elementos comunes ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { font-size: 19px; margin-bottom: 10px; }
.page-title { font-size: 30px; margin-bottom: 16px; }
.sec-title { font-size: 22px; margin: 26px 0 12px; }
.bar { flex: 1; height: 12px; background: #EEE7DA; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--green), #3ED1B9); transition: width .45s cubic-bezier(.3,1.3,.5,1); }
.goal-row { display: flex; align-items: center; gap: 12px; }
.goal-row .bar > i { background: linear-gradient(90deg, var(--primary), var(--yellow)); }
.field { width: 100%; padding: 15px 18px; font-size: 18px; font-weight: 500; border: 2px solid var(--line); border-radius: 16px; background: #fff; outline: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(58,123,234,.15); }

/* ---------- Onboarding ---------- */
.onb { min-height: 100vh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; padding: 20px 16px 28px; }
.onb-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.onb-top .back { width: 42px; height: 42px; border-radius: 50%; font-size: 20px; background: #fff; box-shadow: var(--shadow); }
.onb-top .bar > i { background: linear-gradient(90deg, var(--primary), var(--yellow)); }
.onb-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 22px; }
.onb-head .mono { width: 100px; height: 100px; }
.onb-body { flex: 1; animation: slideIn .35s ease; }
.onb-foot { padding-top: 20px; margin-top: 20px; display: flex; justify-content: flex-end; }
.onb-foot .btn { min-width: 220px; }
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.welcome .mono { width: 230px; height: 230px; }
.logo { font-size: 54px; font-weight: 700; color: var(--ink); line-height: 1; display: flex; align-items: center; }
.logo span { color: var(--primary); }
.logo .logo-pin { font-size: .7em; margin-right: 6px; color: inherit; }
.tagline { font-size: 19px; color: var(--muted); max-width: 420px; }
.welcome .btn { width: 100%; max-width: 360px; }
.opts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 10px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); font-weight: 600; font-size: 16px; text-align: center; border: 2px solid transparent; transition: transform .12s, border-color .12s; }
.opt .em { font-size: 34px; line-height: 1; }
.opt small { font-weight: 400; color: var(--muted); font-size: 13px; }
.opt:hover { transform: translateY(-2px); }
.opt.sel { border-color: var(--primary); background: #FFF3EC; }
.opts.row { grid-template-columns: 1fr; }
.opts.row .opt { flex-direction: row; justify-content: flex-start; padding: 14px 18px; text-align: left; gap: 14px; }
.age-pick { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 0; }
.age-num { font-family: var(--font-title); font-size: 88px; font-weight: 700; color: var(--primary); line-height: 1; }
.age-num small { font-size: 22px; color: var(--muted); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 99px; background: linear-gradient(90deg, var(--primary) var(--p,30%), #EEE7DA var(--p,30%)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); box-shadow: var(--shadow); cursor: grab; }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); cursor: grab; }
.levels { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.lv { aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font-family: var(--font-title); font-weight: 600; font-size: 20px; transition: transform .12s; }
.lv.sel { color: #fff; transform: scale(1.12); box-shadow: none !important; }
.lv-desc { margin-top: 18px; text-align: center; font-weight: 600; font-size: 18px; min-height: 54px; }
.lv-desc .em { font-size: 34px; display: block; }
@media (max-width: 520px) { .levels { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Estructura: menú oscuro, contenido y columna derecha ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr 320px; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .logo { font-size: 34px; color: #fff; padding: 4px 12px 22px; }
.nav-i { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; font-weight: 500; font-size: 16px; color: rgba(255,255,255,.72); text-align: left; transition: background .15s, color .15s; position: relative; }
.nav-i .em { font-size: 24px; width: 30px; text-align: center; }
.nav-i:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-i.on { background: rgba(255,122,69,.2); color: #fff; }
.nav-i.on::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 5px; border-radius: 0 6px 6px 0; background: var(--primary); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.06); }
.side-foot .mono { width: 54px; height: 54px; }
.side-foot small { color: rgba(255,255,255,.7); font-size: 13px; line-height: 1.35; }
.main { padding: 26px 28px 120px; min-width: 0; }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 26px 20px; display: flex; flex-direction: column; gap: 16px; }
.stats { display: flex; gap: 6px; justify-content: space-between; background: #fff; border-radius: 999px; padding: 6px; box-shadow: var(--shadow); }
.stat { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 16px; padding: 6px 10px; border-radius: 999px; }
.stat .em { font-size: 19px; }
.stat.fire { color: #E8590C; } .stat.xp { color: var(--purple); } .stat.lvl { color: var(--blue); }
.stat.off { filter: grayscale(1); opacity: .55; }
.fact-card { background: linear-gradient(135deg, #FFF6D9, #FFEFC7); }
.fact-card p { font-weight: 500; line-height: 1.45; }
.topstats { display: none; margin-bottom: 16px; }
.bottomnav { display: none; }
.greet { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.greet .mono { width: 72px; height: 72px; }

/* ---------- Inicio: cabecera de expedición ---------- */
.hero { position: relative; display: grid; grid-template-columns: 1fr auto 150px; align-items: center; gap: 18px; padding: 24px 26px; border-radius: 26px; color: #fff; overflow: hidden;
  background: radial-gradient(circle at 85% 20%, rgba(255,201,60,.28), transparent 40%), linear-gradient(135deg, #1E2A44, #2C4A6E 60%, #0F8B8D); box-shadow: var(--shadow-lg); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12;
  background-image: repeating-radial-gradient(circle at 15% 130%, transparent 0 18px, #fff 19px 20px); }
.hero-txt { position: relative; z-index: 1; }
.hero small { font-weight: 500; opacity: .85; }
.hero h1 { font-size: 34px; margin: 4px 0; }
.hero p { opacity: .9; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-badges span { background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; }
.hero-goal { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.1); padding: 10px 14px; border-radius: 18px; }
.hero-goal b { font-family: var(--font-title); font-size: 24px; display: block; }
.hero-goal b small { font-size: 14px; opacity: .7; }
.hero-goal span { font-size: 13px; opacity: .85; }
.hero-mono { position: relative; z-index: 1; width: 150px; height: 150px; margin: -10px 0 -24px; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.action { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-align: left; border-top: 5px solid var(--ac); transition: transform .12s, box-shadow .12s; min-width: 0; }
.action:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.action:disabled { opacity: .7; cursor: default; }
.action .em { font-size: 30px; margin-bottom: 4px; }
.action b { font-family: var(--font-title); font-size: 18px; }
.action small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.a-daily { --ac: var(--primary); } .a-mix { --ac: var(--purple); } .a-read { --ac: var(--green); }

/* Territorios (categorías) */
.terr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.terr { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: left; border: 2px solid transparent; transition: transform .12s; }
.terr:hover { transform: translateY(-2px); }
.terr .em { font-size: 26px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--cat) 15%, #fff); margin-bottom: 4px; }
.terr b { font-size: 15px; }
.terr small { color: var(--muted); font-size: 12px; }
.terr-bar { width: 100%; height: 6px; border-radius: 99px; background: #EEE7DA; overflow: hidden; margin-top: 6px; }
.terr-bar i { display: block; height: 100%; background: var(--cat); border-radius: 99px; }
.terr.on { border-color: var(--cat); background: color-mix(in srgb, var(--cat) 7%, #fff); }

/* Mapa de expedición */
.expedition { margin-top: 26px; background: #FBF7EF; border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; }
.exp-head { display: flex; align-items: center; gap: 16px; padding: 20px 22px; color: #fff; background: linear-gradient(135deg, var(--cat), var(--cat-d)); }
.exp-head .em { font-size: 40px; width: 64px; height: 64px; flex-shrink: 0; display: grid; place-items: center; background: rgba(255,255,255,.18); border-radius: 18px; }
.exp-head small { opacity: .9; font-weight: 500; }
.exp-head h2 { font-size: 26px; }
.exp-head p { opacity: .9; font-size: 14px; }
.exp-count { margin-left: auto; text-align: center; background: rgba(255,255,255,.18); padding: 8px 14px; border-radius: 16px; }
.exp-count b { font-family: var(--font-title); font-size: 28px; display: block; line-height: 1; }
.exp-count small { font-size: 12px; }
.trail { position: relative; padding: 34px 18px 36px; display: flex; flex-direction: column; gap: 18px;
  background-image: radial-gradient(color-mix(in srgb, var(--cat) 18%, transparent) 1.2px, transparent 1.4px); background-size: 18px 18px; }
.trail::before { content: ""; position: absolute; left: 50%; top: 20px; bottom: 20px; width: 0; border-left: 4px dashed color-mix(in srgb, var(--cat) 45%, #C9BFAE); transform: translateX(-2px); }
.stop { position: relative; display: grid; grid-template-columns: 1fr 60px 1fr; align-items: center; }
.stop .pin { grid-column: 2; grid-row: 1; justify-self: center; z-index: 1; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink); font-family: var(--font-title); font-weight: 700; font-size: 18px; box-shadow: var(--shadow); border: 3px solid var(--line-d); line-height: 1; }
.stop-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, box-shadow .12s; min-width: 0; grid-row: 1; }
.stop.left .stop-card { grid-column: 1; margin-right: 6px; }
.stop.right .stop-card { grid-column: 3; margin-left: 6px; }
.stop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stop-em { font-size: 28px; width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--cat) 12%, #fff); }
.stop-txt { min-width: 0; display: flex; flex-direction: column; }
.stop-txt small { color: var(--muted); font-size: 12px; }
.stop-txt b { font-size: 16px; }
.stop-stars { color: var(--yellow-d); letter-spacing: 2px; font-size: 14px; }
.go-pill { margin-left: auto; flex-shrink: 0; background: linear-gradient(180deg, #FF9566, var(--primary)); color: #fff; font-family: var(--font-title); font-weight: 600; padding: 8px 14px; border-radius: 999px; box-shadow: 0 4px 12px rgba(255,122,69,.4); white-space: nowrap; }
.stop.done .pin { background: var(--cat); color: #fff; border-color: var(--cat); }
.stop.current .pin { background: var(--primary); color: #fff; border-color: #fff; animation: pinPulse 1.8s ease-in-out infinite; }
.stop.current .stop-card { box-shadow: 0 0 0 3px var(--primary), var(--shadow-lg); }
.stop.locked .stop-card { opacity: .55; filter: grayscale(.6); }
.stop.locked .pin { font-size: 15px; background: #F1ECE2; }
@keyframes pinPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,122,69,.45), var(--shadow); } 50% { box-shadow: 0 0 0 12px rgba(255,122,69,0), var(--shadow); } }
.trail-mono { position: absolute; width: 96px; height: 96px; top: 50%; margin-top: -52px; z-index: 2; }
.stop.left .trail-mono { left: calc(50% + 36px); }
.stop.right .trail-mono { right: calc(50% + 36px); }

/* ---------- Lección ---------- */
.lesson { min-height: 100vh; display: flex; flex-direction: column; }
.l-top { display: flex; align-items: center; gap: 14px; max-width: 900px; width: 100%; margin: 0 auto; padding: 20px 16px; }
.l-top .x { font-size: 20px; width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%; background: #fff; box-shadow: var(--shadow); color: var(--muted); }
.l-top .bar { height: 14px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.l-top .bar > i { background: repeating-linear-gradient(45deg, var(--cat) 0 12px, color-mix(in srgb, var(--cat) 78%, #fff) 12px 24px); }
.l-top .combo { font-weight: 600; color: #E8590C; min-width: 64px; text-align: right; }
.l-body { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 10px 16px 30px; display: flex; flex-direction: column; gap: 20px; }
.q-kind { font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cat-d); display: flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--cat) 13%, #fff); padding: 6px 12px; border-radius: 999px; align-self: flex-start; }
.q-row { display: flex; align-items: flex-end; gap: 12px; }
.q-row .mono { width: 110px; height: 110px; }
.q-text { font-family: var(--font-title); font-size: 25px; font-weight: 600; line-height: 1.3; flex: 1; }
.answers { display: grid; gap: 12px; }
.answers.two { grid-template-columns: 1fr 1fr; }
.ans { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); font-weight: 500; font-size: 18px; text-align: left; min-height: 64px; border: 2px solid transparent; transition: transform .1s, border-color .12s, background .12s; }
.ans .k { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-title); font-weight: 600; font-size: 15px; color: var(--cat-d); background: color-mix(in srgb, var(--cat) 13%, #fff); }
.ans:hover { transform: translateX(3px); border-color: var(--line-d); }
.ans.sel { border-color: var(--blue); background: #EEF4FE; }
.ans.sel .k { background: var(--blue); color: #fff; }
.ans.right { border-color: var(--green); background: var(--ok-bg); color: var(--ok-ink); }
.ans.right .k { background: var(--green); color: #fff; }
.ans.wrong { border-color: var(--coral); background: var(--ko-bg); color: var(--ko-ink); animation: shake .4s; }
.ans.wrong .k { background: var(--coral); color: #fff; }
.ans.big { flex-direction: column; justify-content: center; font-size: 21px; min-height: 120px; text-align: center; }
.ans.big .em { font-size: 44px; }
.answers.locked .ans { pointer-events: none; }
.num-input { font-family: var(--font-title); font-size: 40px; text-align: center; font-weight: 600; padding: 18px; letter-spacing: .05em; }
.timer { height: 8px; background: #EEE7DA; border-radius: 99px; overflow: hidden; }
.timer > i { display: block; height: 100%; background: var(--yellow); width: 100%; border-radius: 99px; }
.seq { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; padding: 10px 0; }
.seq .tile { min-width: 62px; height: 62px; padding: 0 12px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; font-family: var(--font-title); font-size: 26px; font-weight: 600; animation: pop .3s backwards; }
.seq .tile.q { background: var(--cat); color: #fff; }
.factbox { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; background: #fff; border-radius: 24px; box-shadow: var(--shadow); }
.factbox .em { font-size: 78px; animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
.factbox p { font-size: 21px; font-weight: 500; line-height: 1.45; }
/* Pie de la lección: tarjeta flotante */
.l-foot { position: sticky; bottom: 0; padding: 12px 16px 16px; }
.l-foot .in { max-width: 900px; margin: 0 auto; padding: 14px 18px; display: flex; align-items: center; gap: 16px; justify-content: space-between; background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); border-left: 8px solid var(--line-d); }
.l-foot .btn { min-width: 170px; }
.l-foot.ok .in { border-left-color: var(--green); background: linear-gradient(90deg, var(--ok-bg), #fff 60%); }
.l-foot.ko .in { border-left-color: var(--coral); background: linear-gradient(90deg, var(--ko-bg), #fff 60%); }
.fb { display: flex; align-items: flex-start; gap: 14px; flex: 1; animation: slideUp .3s ease; }
.fb .ic { width: 52px; height: 52px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.fb h4 { font-size: 21px; }
.fb p { font-size: 15px; line-height: 1.45; margin-top: 4px; }
.l-foot.ok .fb h4 { color: var(--ok-ink); }
.l-foot.ko .fb h4 { color: var(--ko-ink); }
.fb-btns { display: flex; gap: 10px; flex-shrink: 0; }
.fb-btns .btn { min-width: 140px; }
.lives { font-size: 17px; white-space: nowrap; font-weight: 600; color: var(--coral); }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* ---------- Resultados ---------- */
.result { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 30px 16px; text-align: center; max-width: 560px; margin: 0 auto; }
.result .mono { width: 200px; height: 200px; }
.result h1 { font-size: 34px; color: var(--ink); }
.r-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.r-stat { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 14px 8px; border-top: 5px solid var(--c); animation: pop .4s backwards; }
.r-stat b { display: block; color: var(--muted); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.r-stat span { display: block; font-family: var(--font-title); font-size: 26px; font-weight: 600; margin-top: 4px; }
.badge-new { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 12px 16px; display: flex; gap: 12px; align-items: center; width: 100%; animation: pop .5s .4s backwards; }
.badge-new .em { font-size: 36px; }

/* ---------- Progreso y perfil ---------- */
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { text-align: center; }
.kpi .em { font-size: 28px; }
.kpi b { display: block; font-family: var(--font-title); font-size: 28px; }
.catbar { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-weight: 500; }
.catbar .em { font-size: 22px; width: 28px; }
.catbar .name { width: 150px; flex-shrink: 0; }
.catbar .bar { height: 10px; }
.catbar .pct { width: 48px; text-align: right; color: var(--muted); }
.week { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.week .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: 12px; color: var(--muted); }
.week .col i { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--purple), #A08BF0); border-radius: 10px; min-height: 4px; transition: height .6s cubic-bezier(.3,1.3,.5,1); }
.week .col.today i { background: linear-gradient(180deg, var(--primary), var(--yellow)); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.badge { text-align: center; padding: 14px 8px; border-radius: 18px; background: #FBF7EF; }
.badge .em { font-size: 38px; display: block; }
.badge b { display: block; font-size: 14px; margin-top: 6px; }
.badge small { color: var(--muted); font-size: 12px; }
.badge.off .em { filter: grayscale(1); opacity: .3; }
.badge.off b { color: var(--muted); }
.prof-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.prof-head .mono { width: 110px; height: 110px; }
.prof-head h2 { font-size: 28px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag { background: #F4EEE3; border-radius: 999px; padding: 6px 12px; font-weight: 500; font-size: 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.toggle { display: flex; align-items: center; justify-content: space-between; font-weight: 500; padding: 6px 0; }

/* ---------- Ventanas ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(30,42,68,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .2s; }
.modal { background: #fff; border-radius: 26px; padding: 26px 22px; max-width: 420px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; box-shadow: var(--shadow-lg); animation: pop .3s cubic-bezier(.2,1.5,.4,1); }
.modal .mono { width: 120px; height: 120px; }
.modal h3 { font-size: 23px; }
.modal .btn { width: 100%; }
.modal.wide { max-width: 560px; text-align: left; align-items: stretch; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal.wide:has(.video-modal) { max-width: 760px; }

/* Saber más */
.more { display: flex; flex-direction: column; gap: 14px; }
.more-head { display: flex; align-items: center; gap: 14px; }
.more-head h3 { font-size: 24px; }
.more-q { font-weight: 600; font-size: 18px; line-height: 1.35; }
.more-ans { background: var(--ok-bg); color: var(--ok-ink); font-weight: 500; padding: 10px 14px; border-radius: 14px; }
.more-txt { font-size: 16px; line-height: 1.6; background: #FBF7EF; border-radius: 16px; padding: 14px; }
.more h4 { font-size: 17px; margin-top: 4px; }
.srcs { display: flex; flex-direction: column; gap: 10px; }
.src { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); text-decoration: none; color: var(--ink); transition: box-shadow .12s, transform .1s; }
.src:hover { box-shadow: inset 0 0 0 2px var(--blue); transform: translateX(3px); }
.src .em { font-size: 26px; }
.src b { display: block; font-size: 15px; }
.src small { color: var(--muted); font-size: 13px; }
.src .go { margin-left: auto; font-weight: 600; color: var(--blue); font-size: 18px; }

/* ---------- Mix ---------- */
.mix-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mix-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 6px; padding: 22px 18px; border-radius: 22px; color: #fff; overflow: hidden; box-shadow: var(--shadow-lg); transition: transform .12s; }
.mix-card::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); }
.mix-card:hover { transform: translateY(-3px) rotate(-.5deg); }
.mix-card .em { font-size: 42px; }
.mix-card b { font-family: var(--font-title); font-size: 21px; }
.mix-card small { opacity: .92; }
.mix-card .pill { margin-top: 8px; background: rgba(255,255,255,.22); padding: 4px 12px; border-radius: 999px; font-weight: 500; font-size: 13px; }
.mix-quick { background: linear-gradient(150deg, #12A594, #2BAA63); }
.mix-marathon { background: linear-gradient(150deg, #7C5CE0, #3A7BEA); }
.mix-survival { background: linear-gradient(150deg, #E24C7A, #FF7A45); }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); font-weight: 500; font-size: 15px; white-space: nowrap; transition: background .12s; }
.chip .em { font-size: 18px; }
.chip.on { background: var(--cat); color: #fff; box-shadow: none; }

/* ---------- Aprender ---------- */
.learn-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.lstat { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 12px; text-align: center; }
.lstat .em { font-size: 22px; display: block; }
.lstat b { font-family: var(--font-title); font-size: 22px; display: block; }
.lstat small { color: var(--muted); }
.tabs { display: flex; gap: 6px; background: #fff; border-radius: 999px; padding: 5px; margin-bottom: 12px; box-shadow: var(--shadow); }
.tab { flex: 1; padding: 10px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--muted); transition: background .15s, color .15s; }
.tab.on { background: var(--ink); color: #fff; }
.field.search { font-size: 16px; padding: 12px 18px; margin-bottom: 10px; border-radius: 999px; }
.lgrid, .vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.acard, .vcard { display: flex; flex-direction: column; text-align: left; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); transition: transform .14s, box-shadow .14s; }
.acard:hover, .vcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.acard-top { height: 96px; display: flex; align-items: center; justify-content: center; position: relative; background: linear-gradient(135deg, var(--cat), var(--cat-d)); }
.acard-top::after { content: ""; position: absolute; inset: 0; opacity: .18; background-image: radial-gradient(#fff 1.2px, transparent 1.4px); background-size: 14px 14px; }
.acard-top .em { font-size: 50px; position: relative; z-index: 1; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.done-badge { position: absolute; top: 10px; right: 10px; z-index: 1; background: #fff; color: var(--ok-ink); font-weight: 600; font-size: 12px; padding: 4px 9px; border-radius: 99px; }
.acard-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 5px; }
.acard-body small { color: var(--muted); font-size: 12px; }
.acard-body b { font-family: var(--font-title); font-size: 18px; line-height: 1.25; }
.acard-body p { font-size: 14px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: #222; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.vcard:hover .thumb img { transform: scale(1.05); }
.thumb .play { position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--primary); display: grid; place-items: center; font-size: 20px; padding-left: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.3); transition: transform .15s; }
.vcard:hover .play { transform: scale(1.12); }
.thumb .len { position: absolute; right: 8px; bottom: 8px; background: rgba(30,42,68,.85); color: #fff; font-weight: 500; font-size: 12px; padding: 2px 7px; border-radius: 8px; }
.thumb .seen { position: absolute; left: 8px; top: 8px; background: #fff; color: var(--ok-ink); font-weight: 600; font-size: 12px; padding: 3px 9px; border-radius: 99px; }
.vbody { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.vbody b { font-size: 15px; line-height: 1.3; }
.vbody small { color: var(--muted); font-size: 12px; }
.video-modal { display: flex; flex-direction: column; gap: 10px; }
.vframe { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.back-link { font-weight: 600; color: var(--blue); padding: 8px 0; margin-bottom: 8px; }
.article { background: #fff; border-radius: 26px; padding: 0 0 24px; overflow: hidden; box-shadow: var(--shadow); }
.article > *:not(.a-hero) { margin-left: 26px; margin-right: 26px; }
.a-hero { position: relative; color: #fff; padding: 28px 26px; display: flex; align-items: center; gap: 16px; justify-content: space-between; background: linear-gradient(135deg, var(--cat), var(--cat-d)); overflow: hidden; }
.a-hero::after { content: ""; position: absolute; inset: 0; opacity: .15; background-image: radial-gradient(#fff 1.2px, transparent 1.4px); background-size: 16px 16px; pointer-events: none; }
.a-hero > * { position: relative; z-index: 1; }
.a-hero small { opacity: .92; }
.a-hero h1 { font-size: 32px; line-height: 1.15; margin-top: 4px; }
.a-hero .em { font-size: 72px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.2)); }
.a-intro { font-size: 19px; font-weight: 500; line-height: 1.55; margin-top: 22px; padding-left: 14px; border-left: 4px solid var(--cat); }
.article section h2 { font-size: 22px; margin: 24px 0 6px; color: var(--cat-d); }
.article section p { font-size: 17px; line-height: 1.75; }
.a-facts { background: linear-gradient(135deg, #FFF6D9, #FFEFC7); border-radius: 18px; padding: 16px 18px; margin-top: 24px; }
.a-facts h3 { margin-bottom: 8px; }
.a-facts li { line-height: 1.55; margin: 6px 0 6px 18px; }
.a-sub { font-size: 19px; margin: 26px 0 10px; }
.a-quiz { background: #F2EEFC; border-radius: 20px; padding: 16px; margin-top: 26px; }

/* ---------- Ranking y cuenta ---------- */
.rank-empty { text-align: center; display: flex; flex-direction: column; gap: 10px; padding: 26px 18px; }
.rank-empty h3 { font-size: 22px; }
.rank-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: #fff; font-weight: 500; }
.rank-row.top { background: #FFF6DE; }
.rank-row.me { background: #EEF4FE; box-shadow: inset 0 0 0 2px #B9D0F8; }
.rank-row .pos { width: 30px; text-align: center; font-family: var(--font-title); font-size: 19px; font-weight: 600; color: var(--muted); }
.rank-row .av { font-size: 28px; }
.rank-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .xp { color: var(--purple); font-weight: 600; white-space: nowrap; }
.acc-head { display: flex; align-items: center; gap: 12px; }
.acc-head b { display: block; font-size: 19px; }
.acc-av { font-size: 44px; }
.av-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.av-pick { font-size: 24px; aspect-ratio: 1; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); }
.av-pick.sel { box-shadow: inset 0 0 0 3px var(--primary); background: #FFF3EC; }
.auth { display: flex; flex-direction: column; gap: 8px; }
.auth .lbl { font-weight: 600; margin-top: 6px; }
.auth .lbl small { font-weight: 400; color: var(--muted); }
.auth .field { font-size: 17px; padding: 12px 14px; }
.auth .btn.block { margin-top: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; margin-top: 8px; }
.check input { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; accent-color: var(--primary); }
.consent-box { background: #FFF6D9; border-radius: 14px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }
.auth-msg { font-weight: 500; min-height: 20px; }
.auth-msg.ok { color: var(--ok-ink); }
.auth-msg.ko { color: var(--ko-ink); }

/* ---------- Confeti ---------- */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
#confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Pantallas medianas y móviles ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 230px 1fr; }
  .rail { display: none; }
  .topstats { display: block; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr 120px; }
  .hero-goal { grid-column: 1; grid-row: 2; justify-self: start; }
  .hero-mono { grid-column: 2; grid-row: 1 / span 2; width: 120px; height: 120px; margin: 0; }
  .actions { grid-template-columns: 1fr; gap: 10px; }
  .action { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 12px 16px; border-top: 0; border-left: 5px solid var(--ac); }
  .action .em { grid-row: span 2; margin: 0; }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: 0 16px 120px; }
  .topstats { position: sticky; top: 0; z-index: 10; margin: 0 -16px 14px; padding: 10px 12px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); }
  .bottomnav { display: flex; position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; background: var(--ink); border-radius: 22px; padding: 6px; justify-content: space-around; box-shadow: var(--shadow-lg); }
  .bottomnav .nav-i { flex: 1; min-width: 0; flex-direction: column; gap: 2px; padding: 7px 2px; font-size: 10px; color: rgba(255,255,255,.65); border-radius: 16px; }
  .bottomnav .nav-i .em { font-size: 21px; width: auto; }
  .bottomnav .nav-i.on { background: var(--primary); color: #fff; }
  .bottomnav .nav-i.on::before { display: none; }
  .bottomnav .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .hero { padding: 20px; border-radius: 22px; }
  .hero h1 { font-size: 26px; }
  .hero-mono { width: 96px; height: 96px; }
  .trail { padding: 28px 12px 30px; }
  .trail::before { left: 34px; }
  .stop { grid-template-columns: 46px 1fr; }
  .stop .pin { grid-column: 1; width: 42px; height: 42px; font-size: 16px; }
  .stop.left .stop-card, .stop.right .stop-card { grid-column: 2; margin: 0 0 0 8px; }
  .trail-mono { display: none; }
  .exp-head { flex-wrap: wrap; }
  .exp-head h2 { font-size: 22px; }
  .q-text { font-size: 21px; }
  .q-row .mono { width: 80px; height: 80px; }
  .l-foot { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .l-foot .in { flex-direction: column; align-items: stretch; padding: 14px; }
  .l-foot .btn { width: 100%; min-width: 0; }
  .fb-btns { width: 100%; }
  .fb-btns .btn { flex: 1; min-width: 0; padding: 12px 10px; }
  .answers.two { grid-template-columns: 1fr 1fr; }
  .mix-modes { grid-template-columns: 1fr; }
  .catbar .name { width: 100px; font-size: 14px; }
  .onb-foot .btn { width: 100%; }
  .a-hero h1 { font-size: 24px; }
  .a-hero .em { font-size: 50px; }
  .article > *:not(.a-hero) { margin-left: 16px; margin-right: 16px; }
}
@media (max-width: 420px) {
  .greet .mono { width: 64px !important; height: 64px !important; }
  .greet .bubble { font-size: 15px; padding: 10px 14px; }
  .av-grid { grid-template-columns: repeat(6, 1fr); }
  .terr-grid { grid-template-columns: 1fr 1fr; }
  .hero-badges span { font-size: 12px; padding: 5px 9px; }
}
@media (max-width: 360px) { .bottomnav .lbl { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Tira de niveles ---------- */
.lvl-strip { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 6px; background: #FBF7EF; scrollbar-width: thin; }
.lvl { flex-shrink: 0; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); border: 2px solid transparent; transition: transform .12s; }
.lvl:hover { transform: translateY(-2px); }
.lvl .lvl-em { font-size: 24px; }
.lvl b { font-family: var(--font-title); font-size: 15px; }
.lvl small { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.2; min-height: 26px; }
.lvl i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--cat-d); min-height: 14px; }
.lvl.done { background: color-mix(in srgb, var(--cat) 10%, #fff); }
.lvl.done i { color: var(--yellow-d); }
.lvl.current { border-color: var(--primary); }
.lvl.locked { opacity: .5; filter: grayscale(.8); }
.lvl.sel { box-shadow: 0 0 0 3px var(--cat), var(--shadow-lg); transform: translateY(-2px); }

/* ---------- Navegadores antiguos (iOS 15 o anterior, Chrome < 111): sin color-mix() ---------- */
@supports not (color: color-mix(in srgb, red, blue)) {
  .btn { background: var(--b); box-shadow: 0 6px 16px rgba(30,42,68,.18); }
  .btn:hover { box-shadow: 0 10px 22px rgba(30,42,68,.22); }
  .terr .em, .stop-em, .q-kind, .ans .k { background: #F1ECE2; }
  .terr.on, .lvl.done { background: #FBF7EF; }
  .trail { background-image: radial-gradient(rgba(30,42,68,.1) 1.2px, transparent 1.4px); }
  .trail::before { border-left-color: #C9BFAE; }
  .l-top .bar > i { background: var(--cat); }
  .topstats { background: var(--paper); }
}

/* ---------- Avisar de un error ---------- */
.l-top .report-btn { font-size: 17px; }
.report-link { align-self: center; font-size: 14px; color: var(--muted); }
.report-reasons { display: flex; flex-direction: column; gap: 2px; }
.report-reasons .check { margin-top: 4px; font-size: 15px; }
textarea.field { font-size: 15px; resize: vertical; font-family: var(--font); }

/* ---------- Pie de página ---------- */
.site-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; align-items: center; font-size: 13px; color: var(--muted); }
.site-foot a { color: var(--muted); }
.site-foot span { width: 100%; text-align: center; }
.welcome .site-foot { border: 0; margin-top: 10px; }
