/* =========================================================================
   Chispa · Aula digital de Infantil y Primaria
   Sistema visual: tokens, base, componentes, vistas y motores de actividad
   ========================================================================= */

/* ------------------------------------------------------------------ Tokens */
:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #F3F2EE;
  --surface-3: #E8E6DF;
  --line: rgba(22, 20, 50, .08);
  --line-2: rgba(22, 20, 50, .14);
  --ink: #16142F;
  --ink-2: #4B4968;
  --ink-3: #85839E;
  --brand: #6B5BFF;
  --brand-2: #FF5FA2;
  --brand-3: #FFB547;
  --grad-brand: linear-gradient(120deg, #6B5BFF 0%, #A254F7 45%, #FF5FA2 100%);
  --grad-text: linear-gradient(100deg, #6B5BFF 0%, #D04FD6 45%, #FF7A59 75%, #FFB547 100%);
  --ok: #10B981;
  --ok-ink: #047857;
  --ok-bg: #E7FAF2;
  --bad: #F2545B;
  --bad-bg: #FFEEEF;
  --miss: #FF8A3D;
  --miss-ink: #B4500A;
  --miss-bg: #FFF3E8;
  --gold: #FFC233;
  --focus: #6B5BFF;
  --amb-1: rgba(107, 91, 255, .11);
  --amb-2: rgba(255, 95, 162, .08);
  --amb-3: rgba(255, 181, 71, .10);
  --shadow-1: 0 1px 2px rgba(22, 20, 50, .05), 0 2px 6px rgba(22, 20, 50, .04);
  --shadow-2: 0 2px 4px rgba(22, 20, 50, .04), 0 14px 30px -12px rgba(22, 20, 50, .18);
  --shadow-3: 0 4px 10px rgba(22, 20, 50, .05), 0 30px 64px -20px rgba(22, 20, 50, .28);
  --r-s: 12px;
  --r: 20px;
  --r-l: 28px;
  --r-xl: 36px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --f-display: 'Bricolage Grotesque', ui-rounded, system-ui, sans-serif;
  --f-body: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-emoji: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
  --nav-h: 68px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0C0B1A;
  --surface: #17162D;
  --surface-2: #201F3B;
  --surface-3: #2B2A4A;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);
  --ink: #F3F2FF;
  --ink-2: #BEBCDB;
  --ink-3: #8886A9;
  --ok-ink: #5EEAB5;
  --ok-bg: rgba(16, 185, 129, .15);
  --bad-bg: rgba(242, 84, 91, .16);
  --miss-ink: #FFB37A;
  --miss-bg: rgba(255, 138, 61, .15);
  --focus: #A99DFF;
  --amb-1: rgba(107, 91, 255, .24);
  --amb-2: rgba(255, 95, 162, .12);
  --amb-3: rgba(255, 181, 71, .07);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 14px 30px -12px rgba(0, 0, 0, .55);
  --shadow-3: 0 30px 64px -20px rgba(0, 0, 0, .75);
  color-scheme: dark;
}

/* -------------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
html.big-text { font-size: 115%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(55vw 45vw at -5% -10%, var(--amb-1), transparent 62%),
    radial-gradient(45vw 40vw at 105% 0%, var(--amb-2), transparent 60%),
    radial-gradient(60vw 45vw at 50% 115%, var(--amb-3), transparent 62%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--f-display);
  font-optical-sizing: auto;
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -.022em;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 300; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }
.noscript { padding: 40px; text-align: center; font-size: 1.2rem; }
#view { outline: none; min-height: 60vh; overflow-x: clip; }
.ic { width: 1.2em; height: 1.2em; flex: none; }
.ic.fill { fill: currentColor; stroke: none; }
.emo, .tok-e { font-family: var(--f-emoji); font-weight: 400; letter-spacing: 0; line-height: 1; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: var(--gutter); }
.page { padding-top: clamp(20px, 4vw, 40px); padding-bottom: 40px; }
.muted { color: var(--ink-2); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand);
}
.eyebrow.light { color: rgba(255, 255, 255, .8); }
.display { font-size: clamp(2.7rem, 6.4vw, 5.2rem); font-weight: 800; letter-spacing: -.04em; line-height: .98; }
.h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); letter-spacing: -.03em; }
.h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.lead { font-size: clamp(1.05rem, 1.45vw, 1.24rem); color: var(--ink-2); max-width: 56ch; font-weight: 350; }
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: .04em;
}

/* ----------------------------------------------------------------- Botones */
.btn {
  --b-bg: var(--surface);
  --b-fg: var(--ink);
  --b-bd: var(--line-2);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px;
  padding: .8em 1.35em;
  border-radius: 999px;
  border: 1px solid var(--b-bd);
  background: var(--b-bg);
  color: var(--b-fg);
  font: 600 1rem/1.1 var(--f-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform .3s var(--spring), box-shadow .3s var(--ease), background-color .2s, border-color .2s, color .2s;
  user-select: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px) scale(.97); transition-duration: .08s; }
.btn .ic { width: 1.15em; height: 1.15em; }
.btn-primary {
  --b-bg: var(--grad-brand);
  --b-fg: #fff;
  --b-bd: transparent;
  background-size: 140% 100%;
  box-shadow: 0 10px 26px -10px rgba(122, 84, 255, .75), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 16px 34px -12px rgba(122, 84, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn-dark { --b-bg: var(--ink); --b-fg: var(--bg); --b-bd: transparent; }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; box-shadow: none; }
.btn-ghost:hover { --b-bg: var(--surface); box-shadow: var(--shadow-1); }
.btn-glass { --b-bg: rgba(255, 255, 255, .16); --b-fg: #fff; --b-bd: rgba(255, 255, 255, .28); backdrop-filter: blur(10px); box-shadow: none; }
.btn-glass:hover { --b-bg: rgba(255, 255, 255, .26); }
.btn-danger { --b-bg: var(--bad); --b-fg: #fff; --b-bd: transparent; }
.btn-lg { min-height: 56px; padding: .9em 1.6em; font-size: 1.06rem; }
.btn-xl { min-height: 64px; padding: 1em 2.2em; font-size: 1.2rem; font-family: var(--f-display); font-weight: 700; letter-spacing: -.01em; }
.btn-sm { min-height: 40px; padding: .55em 1em; font-size: .88rem; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform .3s var(--spring), color .2s, background-color .2s;
}
.icon-btn:hover { transform: translateY(-2px); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 38px; height: 38px; }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn.on { color: var(--brand); }

/* ------------------------------------------------------------- Navegación */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 12px; height: var(--nav-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-weight: 800; font-size: 1.42rem; letter-spacing: -.035em;
  text-decoration: none; color: var(--ink);
}
.brand .logo-mark { transition: transform .6s var(--spring); }
.brand:hover .logo-mark { transform: rotate(-12deg) scale(1.08); }
.nav-links { display: flex; gap: 2px; margin-left: 22px; }
.nav-link {
  position: relative;
  padding: .55em 1em;
  border-radius: 999px;
  color: var(--ink-2);
  font-weight: 500; font-size: .96rem;
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.nav-link:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.nav-link.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-1); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; min-width: 230px; padding: 0 8px 0 14px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-3);
  font-size: .92rem; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: border-color .2s, box-shadow .2s;
}
.search-btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line-2)); box-shadow: var(--shadow-2); }
.search-btn span { flex: 1; text-align: left; }
kbd {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 7px;
  border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink-3);
  font: 600 .75rem/1 var(--f-body);
}
.profile-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px 0 4px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: transform .3s var(--spring);
}
.profile-chip:hover { transform: translateY(-2px); }
.avatar {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  font-family: var(--f-emoji); font-size: 1.3rem;
  background: linear-gradient(140deg, #EDE9FF, #FFE4F1);
}
[data-theme="dark"] .avatar { background: linear-gradient(140deg, #2D2870, #5A2150); }
.pc-stars { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .92rem; }
.pc-stars .ic { color: var(--gold); width: 18px; height: 18px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; border-radius: 14px;
  color: var(--ink-3); font-size: .7rem; font-weight: 600; text-decoration: none;
  transition: color .2s, background-color .2s;
}
.tabbar a .ic { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); }

/* -------------------------------------------------------------------- Hero */
.hero { position: relative; padding: clamp(36px, 7vw, 96px) 0 clamp(36px, 5vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.chip-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px; margin-bottom: 22px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); box-shadow: var(--shadow-1);
  font-size: .86rem; font-weight: 500; color: var(--ink-2);
}
.chip-eyebrow .ce-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--grad-brand); color: #fff; }
.chip-eyebrow .ce-ic .ic { width: 15px; height: 15px; }
.hero h1 { margin-bottom: 22px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-stats { display: flex; gap: clamp(20px, 4vw, 44px); margin-top: 40px; padding-top: 28px; border-top: 1px dashed var(--line-2); max-width: 520px; }
.hero-stats b { display: block; font-family: var(--f-display); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.hero-stats span { color: var(--ink-3); font-size: .9rem; }

.hero-art { position: relative; height: 540px; --mx: 0; --my: 0; }
.hero-art .orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; }
.hero-art .o1 { width: 300px; height: 300px; left: 12%; top: 12%; background: #8B7BFF; }
.hero-art .o2 { width: 240px; height: 240px; right: 4%; top: 40%; background: #FF7EB6; }
.hero-art .o3 { width: 200px; height: 200px; left: 30%; bottom: 0; background: #FFC86B; }
[data-theme="dark"] .hero-art .orb { opacity: .35; }
.ha-grid {
  position: absolute; inset: 6% 4%;
  border-radius: 40px;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 16%, transparent) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
  mask-image: radial-gradient(closest-side, #000 30%, transparent);
}
.fc {
  position: absolute;
  transform: translate3d(calc(var(--mx) * var(--d, 10px)), calc(var(--my) * var(--d, 10px)), 0);
  transition: transform .5s var(--ease);
}
.fc-in {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(10px);
  animation: bob 7s ease-in-out infinite;
}
.fc-main { left: 50%; top: 50%; width: min(400px, 88%); margin: -170px 0 0 calc(min(400px, 88%) / -2); }
.fc-main .fc-in { padding: 22px; }
.fc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.fc-tag { --tc: var(--brand); display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, transparent); transition: color .3s, background-color .3s; }
.fc-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fc-step { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.fc-q { min-height: 2.6em; font-family: var(--f-display); font-weight: 750; font-size: 1.6rem; letter-spacing: -.02em; line-height: 1.15; animation: rise .5s var(--ease); }
.fc-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.fc-opt {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 54px; border-radius: 16px; border: 2px solid var(--line-2);
  background: var(--surface); box-shadow: 0 3px 0 var(--line-2);
  font-weight: 700; font-size: 1.02rem; text-align: center; line-height: 1.1; padding: 0 6px;
  animation: rise .5s var(--ease) both;
}
.fc-opt:nth-child(2) { animation-delay: .06s; }
.fc-opt:nth-child(3) { animation-delay: .12s; }
.fc-opt .ic { width: 18px; height: 18px; }
.fc-opt.is-ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok-ink); box-shadow: 0 3px 0 var(--ok); animation: pop .5s var(--spring); }
.fc-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.fc-bar i { display: block; height: 100%; width: 25%; border-radius: inherit; background: var(--grad-brand); transition: width .8s var(--spring); }
.fc-stars { left: 0; bottom: 34px; }
.fc-stars .fc-in { padding: 16px 20px; display: grid; gap: 2px; text-align: center; animation-delay: -2s; }
.fs-stars { display: flex; gap: 2px; justify-content: center; color: var(--gold); }
.fs-stars .ic { width: 28px; height: 28px; filter: drop-shadow(0 4px 8px rgba(255, 176, 32, .45)); }
.fs-stars .ic:nth-child(2) { transform: translateY(-5px) scale(1.15); }
.fc-stars b { font-family: var(--f-display); font-size: 1.15rem; }
.fc-stars .xp { font-size: .8rem; font-weight: 700; color: var(--brand); }
.fc-streak { right: 0; top: 16px; }
.fc-streak .fc-in, .fc-badge .fc-in { display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; animation-delay: -4s; }
.fc-streak .fl { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #fff; background: linear-gradient(140deg, #FFB020, #FF4D6D); }
.fc-streak b, .fc-badge b { display: block; font-family: var(--f-display); font-size: 1.05rem; line-height: 1.1; }
.fc-streak small, .fc-badge small { color: var(--ink-3); font-size: .78rem; }
.fc-badge { right: 4%; bottom: 8px; }
.fc-badge .fc-in { animation-delay: -1s; }
.fc-badge .fc-in > span { font-family: var(--f-emoji); font-size: 1.9rem; }
.sticker {
  position: absolute; font-family: var(--f-emoji); font-size: 2.3rem;
  transform: translate3d(calc(var(--mx) * var(--d, 10px)), calc(var(--my) * var(--d, 10px)), 0);
  transition: transform .5s var(--ease);
  filter: drop-shadow(0 10px 14px rgba(22, 20, 50, .18));
}
.sticker::after { content: none; }
.sticker.s1 { left: 6%; top: 8%; animation: bob 6s ease-in-out infinite; }
.sticker.s2 { right: 14%; top: 4%; display: none; }
.sticker.s3 { left: 4%; top: 48%; animation: bob 8s ease-in-out infinite -3s; font-size: 2rem; }
.sticker.s4 { right: 2%; top: 30%; animation: bob 7s ease-in-out infinite -1s; font-size: 1.9rem; }

/* --------------------------------------------------------------- Secciones */
.section { padding: clamp(40px, 6vw, 88px) 0; }
.section-tight { padding: 8px 0 clamp(24px, 4vw, 48px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: clamp(24px, 3vw, 40px); flex-wrap: wrap; }
.section-head .eyebrow { margin-bottom: 12px; }
.section-head p { max-width: 42ch; }
.stage-label {
  display: flex; align-items: center; gap: 14px;
  margin: 40px 0 18px;
  font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em;
}
.stage-label:first-of-type { margin-top: 0; }
.stage-label small { font-family: var(--f-body); font-weight: 500; font-size: .85rem; color: var(--ink-3); letter-spacing: 0; }
.stage-label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.stage-label .sl-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #fff; }
.reveal { opacity: 0; }
.reveal.in { opacity: 1; animation: rise .9s var(--ease) both; }

/* -------------------------------------------- Reto del día / bienvenida */
.duo { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.daily-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  min-height: 200px; padding: 26px 28px;
  border-radius: var(--r-xl);
  color: #fff; text-decoration: none;
  background: linear-gradient(130deg, #1D1B4F 0%, #3B2A8C 55%, #7A2F8F 100%);
  box-shadow: 0 24px 48px -20px rgba(45, 30, 120, .6);
  transition: transform .45s var(--spring), box-shadow .3s;
}
.daily-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 92% 10%, color-mix(in srgb, var(--c1) 85%, transparent), transparent 38%),
    radial-gradient(circle at 70% 120%, color-mix(in srgb, var(--c2) 70%, transparent), transparent 45%);
  opacity: .9;
}
.daily-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 18px 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000); }
.daily-card:hover { transform: translateY(-5px); box-shadow: 0 32px 60px -22px rgba(45, 30, 120, .7); }
.dc-kicker { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9rem; color: rgba(255, 255, 255, .85); }
.dc-kicker .ic { color: #FFD166; }
.xp2 { margin-left: auto; padding: 5px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: linear-gradient(120deg, #FFD166, #FF9F43); color: #3A1F00; }
.dc-main { display: flex; align-items: center; gap: 18px; }
.dc-e { display: grid; place-items: center; flex: none; width: 84px; height: 84px; border-radius: 26px; font-size: 3rem; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .18); font-family: var(--f-emoji); transition: transform .5s var(--spring); }
.daily-card:hover .dc-e { transform: rotate(-8deg) scale(1.06); }
.dc-main > div { min-width: 0; }
.dc-main h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); overflow-wrap: break-word; }
.dc-main p { color: rgba(255, 255, 255, .75); margin-top: 6px; font-size: .95rem; }
.dc-go { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 10px 18px; border-radius: 999px; background: #fff; color: #23205A; font-weight: 700; font-size: .95rem; transition: gap .3s var(--spring); }
.daily-card:hover .dc-go { gap: 14px; }
.dc-go.done { background: rgba(255, 255, 255, .16); color: #fff; }
.me-card {
  display: flex; flex-direction: column; gap: 18px; justify-content: space-between;
  padding: 26px 28px; border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.me-top { display: flex; align-items: center; gap: 16px; }
.me-top .avatar { width: 60px; height: 60px; font-size: 2rem; border-radius: 20px; }
.me-top h3 { font-size: 1.4rem; }
.me-top p { color: var(--ink-3); font-size: .9rem; margin-top: 2px; }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.me-stat { padding: 12px; border-radius: 16px; background: var(--surface-2); text-align: center; }
.me-stat b { display: flex; align-items: center; justify-content: center; gap: 5px; font-family: var(--f-display); font-size: 1.35rem; line-height: 1.1; }
.me-stat b .ic { width: 18px; height: 18px; }
.me-stat span { font-size: .75rem; color: var(--ink-3); }
.me-continue { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1px dashed var(--line-2); text-decoration: none; transition: background-color .2s, border-color .2s; }
.me-continue:hover { background: var(--surface-2); border-style: solid; }
.me-continue .tok-e { font-size: 1.6rem; }
.me-continue small { display: block; color: var(--ink-3); font-size: .75rem; }
.me-continue b { font-weight: 600; font-size: .95rem; }
.me-continue .ic { margin-left: auto; color: var(--ink-3); }

/* ----------------------------------------------------- Tarjetas de curso */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.level-card {
  --on: #fff;
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 232px; padding: 22px 24px;
  border-radius: var(--r-l);
  color: var(--on); text-decoration: none;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  box-shadow: 0 20px 40px -22px var(--c2), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .55s var(--spring), box-shadow .35s var(--ease);
  animation: rise .7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.level-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .38), transparent 36%),
    radial-gradient(circle at -10% 110%, rgba(0, 0, 0, .16), transparent 50%);
}
.level-card::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .32) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .9s var(--ease);
}
.level-card:hover { transform: translateY(-7px) rotate(-.5deg); box-shadow: 0 30px 56px -24px var(--c2), inset 0 1px 0 rgba(255, 255, 255, .25); }
.level-card:hover::after { transform: translateX(120%); }
.lc-ring { position: absolute; z-index: -1; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .22); }
.lc-ring.r1 { width: 240px; height: 240px; right: -70px; top: -90px; }
.lc-ring.r2 { width: 150px; height: 150px; right: -20px; top: -40px; border-style: dashed; opacity: .7; transition: transform 1.4s var(--ease); }
.level-card:hover .lc-ring.r2 { transform: rotate(90deg); }
.lc-top { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; }
.lc-stage { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .2); backdrop-filter: blur(6px); }
.lc-age { opacity: .85; }
.lc-num { font-family: var(--f-display); font-weight: 800; font-size: clamp(4rem, 7vw, 5.4rem); line-height: .86; letter-spacing: -.06em; margin-top: 12px; text-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.lc-name { font-family: var(--f-display); font-weight: 700; font-size: 1.1rem; margin-top: 4px; opacity: .95; }
.lc-emoji {
  position: absolute; right: 10px; bottom: 34px; z-index: 1;
  font-family: var(--f-emoji); font-size: clamp(4.4rem, 7vw, 5.6rem); line-height: 1;
  transform: rotate(-12deg);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .22));
  transition: transform .6s var(--spring);
}
.level-card:hover .lc-emoji { transform: rotate(4deg) scale(1.12) translateY(-8px); }
.lc-foot { position: relative; z-index: 3; margin-top: 18px; }
.lc-meta { display: flex; justify-content: flex-start; gap: 14px; align-items: center; font-size: .82rem; font-weight: 600; margin-bottom: 8px; }
.lc-meta .ic { width: 15px; height: 15px; }
.lc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lc-progress { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.lc-progress i { display: block; height: 100%; border-radius: inherit; background: var(--on); box-shadow: 0 0 12px rgba(255, 255, 255, .6); }

/* ------------------------------------------------------ Funcionalidades */
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.feat {
  position: relative; overflow: hidden;
  padding: 26px 24px 24px;
  border-radius: var(--r-l);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform .45s var(--spring), box-shadow .3s;
}
.feat:hover { transform: translateY(-5px); box-shadow: var(--shadow-3); }
.feat::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--fc); opacity: .08; transition: transform .6s var(--spring); }
.feat:hover::after { transform: scale(1.5); }
.feat .fi { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; border-radius: 16px; color: #fff; background: var(--fc); box-shadow: 0 10px 22px -10px var(--fc); }
.feat .fi .ic { width: 24px; height: 24px; }
.feat h3 { font-size: 1.2rem; margin-bottom: 8px; }
.feat p { color: var(--ink-2); font-size: .94rem; }

.teacher-band {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 40px;
  color: #fff;
  background: linear-gradient(125deg, #14123A 0%, #2C1F72 55%, #5B1F6E 100%);
  box-shadow: var(--shadow-3);
}
.teacher-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 85% 30%, rgba(255, 95, 162, .45), transparent 40%), radial-gradient(circle at 10% 110%, rgba(107, 91, 255, .6), transparent 45%); }
.teacher-band::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px); background-size: 20px 20px; -webkit-mask-image: linear-gradient(120deg, transparent 30%, #000); mask-image: linear-gradient(120deg, transparent 30%, #000); }
.teacher-band h2 { font-size: clamp(1.8rem, 3.4vw, 2.7rem); margin: 12px 0 14px; }
.teacher-band p { color: rgba(255, 255, 255, .78); max-width: 52ch; }
.tb-list { display: grid; gap: 10px; }
.tb-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(8px); font-weight: 500; }
.tb-item .ic { color: #FFD166; }
.tb-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* ----------------------------------------------------------- Vista curso */
.level-hero {
  --on: #fff;
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: clamp(16px, 3vw, 28px);
  padding: clamp(22px, 4vw, 40px) clamp(22px, 4vw, 44px) clamp(26px, 4vw, 44px);
  border-radius: 40px;
  color: var(--on);
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 30px 60px -30px var(--c2);
}
.level-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 80% 0%, rgba(255, 255, 255, .35), transparent 40%), radial-gradient(circle at 0% 100%, rgba(0, 0, 0, .18), transparent 45%); }
.lh-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lh-ring { position: absolute; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); }
.lh-ring.r1 { width: 520px; height: 520px; right: -140px; top: -260px; }
.lh-ring.r2 { width: 300px; height: 300px; right: 40px; top: -120px; border-style: dashed; animation: spin 60s linear infinite; }
.lh-emoji { position: absolute; right: -6px; bottom: -34px; font-family: var(--f-emoji); font-size: clamp(7rem, 14vw, 11rem); line-height: 1; opacity: .95; transform: rotate(-10deg); filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .25)); animation: bob 8s ease-in-out infinite; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .86rem; font-weight: 500; opacity: .9; }
.crumbs a { text-decoration: none; opacity: .85; }
.crumbs a:hover { opacity: 1; text-decoration: underline; }
.crumbs .ic { width: 14px; height: 14px; opacity: .7; }
.lh-main { display: flex; align-items: flex-end; gap: clamp(16px, 3vw, 36px); margin-top: 22px; flex-wrap: wrap; position: relative; }
.lh-num { font-family: var(--f-display); font-weight: 800; font-size: clamp(5rem, 12vw, 8.5rem); line-height: .8; letter-spacing: -.07em; display: flex; flex-direction: column; text-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.lh-num small { font-size: .17em; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-top: 14px; opacity: .9; }
.lh-copy { flex: 1; min-width: min(260px, 100%); max-width: 600px; padding-bottom: 6px; }
.lh-copy h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -.035em; }
.lh-copy p { margin-top: 8px; opacity: .9; font-size: 1.04rem; max-width: 48ch; }
.lh-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.glass-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px); font-size: .85rem; font-weight: 600; }
.glass-pill .ic { width: 16px; height: 16px; }
.lh-ringbox { position: relative; display: grid; place-items: center; margin-left: auto; margin-right: clamp(0px, 15vw, 200px); }
.ring .ring-bg { fill: none; stroke: rgba(255, 255, 255, .25); }
.ring .ring-fg { fill: none; stroke: var(--on); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease) .2s; filter: drop-shadow(0 0 8px rgba(255, 255, 255, .5)); }
.lh-ringtxt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.lh-ringtxt b { font-family: var(--f-display); font-size: 1.6rem; }
.lh-ringtxt span { font-size: .72rem; opacity: .85; }

.filters {
  position: sticky; top: var(--nav-h); z-index: 30;
  display: flex; gap: 8px; overflow-x: auto;
  margin: 18px calc(var(--gutter) * -1) 6px; padding: 12px var(--gutter);
  background: linear-gradient(var(--bg) 75%, transparent);
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.fchip {
  --ac: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2);
  font-weight: 500; font-size: .92rem; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background-color .2s, color .2s, border-color .2s, transform .3s var(--spring);
}
.fchip:hover { transform: translateY(-1px); color: var(--ink); }
.fchip .fdot { width: 9px; height: 9px; border-radius: 50%; background: var(--ac); }
.fchip .count { font-size: .75rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--ink-3); }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fchip[aria-pressed="true"] .count { background: color-mix(in srgb, var(--bg) 18%, transparent); color: var(--bg); }

/* -------------------------------------------------- Tarjetas actividad */
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; margin-top: 10px; }
.act-card {
  --ac: var(--brand);
  position: relative;
  display: flex; flex-direction: column;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  color: inherit; text-decoration: none;
  overflow: hidden;
  transition: transform .45s var(--spring), box-shadow .35s var(--ease), border-color .3s;
  animation: rise .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.act-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-3); border-color: color-mix(in srgb, var(--ac) 35%, transparent); }
.ac-cover {
  position: relative; height: 150px;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 25% 15%, color-mix(in srgb, var(--ac) 26%, transparent), transparent 55%),
    radial-gradient(circle at 90% 100%, color-mix(in srgb, var(--ac) 18%, transparent), transparent 50%),
    color-mix(in srgb, var(--ac) 9%, var(--surface));
  overflow: hidden;
}
.ac-cover::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--ac) 32%, transparent) 1.3px, transparent 1.3px);
  background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(circle at 50% 55%, #000 0, transparent 68%);
  mask-image: radial-gradient(circle at 50% 55%, #000 0, transparent 68%);
  opacity: .8;
}
.ac-emoji { position: relative; font-family: var(--f-emoji); font-size: 4.3rem; line-height: 1; filter: drop-shadow(0 12px 14px rgba(22, 20, 50, .18)); transition: transform .55s var(--spring); }
.act-card:hover .ac-emoji { transform: scale(1.16) rotate(-7deg); }
.ac-type {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px 6px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(8px);
  font-size: .74rem; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-1);
}
.ac-type .ic { width: 14px; height: 14px; color: var(--ac); }
.ac-stars { position: absolute; top: 12px; right: 12px; display: flex; gap: 1px; padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow-1); }
.ac-stars .ic { width: 15px; height: 15px; }
.ic.on { color: var(--gold); }
.ic.off { color: var(--surface-3); }
.ac-body { flex: 1; padding: 18px 20px 6px; }
.ac-area { display: flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: color-mix(in srgb, var(--ac) 82%, var(--ink)); }
[data-theme="dark"] .ac-area { color: color-mix(in srgb, var(--ac) 70%, #fff); }
.ac-area .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ac); }
.ac-body h3 { font-size: 1.22rem; margin: 8px 0 6px; letter-spacing: -.02em; }
.ac-body p { color: var(--ink-2); font-size: .9rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-foot { display: flex; align-items: center; gap: 14px; padding: 14px 20px 18px; color: var(--ink-3); font-size: .8rem; font-weight: 500; }
.ac-foot > span { display: inline-flex; align-items: center; gap: 5px; }
.ac-foot .ic { width: 15px; height: 15px; }
.diff { display: inline-flex; gap: 3px; align-items: flex-end; }
.diff i { display: block; width: 5px; border-radius: 3px; background: var(--surface-3); }
.diff i:nth-child(1) { height: 7px; }
.diff i:nth-child(2) { height: 11px; }
.diff i:nth-child(3) { height: 15px; }
.diff i.on { background: var(--ac); }
.ac-go { margin-left: auto; color: var(--ink); font-weight: 700; font-size: .86rem; transition: gap .3s var(--spring); }
.act-card:hover .ac-go { gap: 10px; color: color-mix(in srgb, var(--ac) 80%, var(--ink)); }

.empty {
  display: grid; place-items: center; gap: 10px; text-align: center;
  padding: 48px 20px; border-radius: var(--r-l);
  border: 2px dashed var(--line-2); color: var(--ink-3);
}
.empty .tok-e { font-size: 3rem; }

.resources { margin-top: 48px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.res-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow-1); transition: transform .35s var(--spring), box-shadow .3s; }
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.res-ic { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 14px; color: #fff; background: var(--rc, var(--brand)); }
.res-card b { display: block; font-weight: 600; }
.res-card small { color: var(--ink-3); font-size: .8rem; }
.res-card > .ic { margin-left: auto; color: var(--ink-3); }

.level-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.ln-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px; border-radius: 24px;
  color: #fff; text-decoration: none;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  transition: transform .4s var(--spring);
}
.ln-card:hover { transform: translateY(-4px); }
.ln-card.next { justify-content: flex-end; text-align: right; }
.ln-card small { display: block; font-size: .75rem; opacity: .85; }
.ln-card b { font-family: var(--f-display); font-size: 1.2rem; }

/* ---------------------------------------------------------------- Footer */
.footer { margin-top: clamp(40px, 6vw, 80px); padding: 48px 0 28px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; }
.footer-in { display: grid; grid-template-columns: 1.2fr 2fr; gap: 40px; }
.f-brand p { margin-top: 12px; max-width: 34ch; color: var(--ink-3); }
.f-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.f-cols h4 { font-family: var(--f-body); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.f-cols a { display: block; padding: 4px 0; text-decoration: none; color: var(--ink-2); }
.f-cols a:hover { color: var(--ink); }
.f-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); }
.f-bottom span { display: inline-flex; align-items: center; gap: 7px; }

/* ------------------------------------------------------------ Mi progreso */
.prof-hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(18px, 3vw, 32px); align-items: center;
  padding: clamp(22px, 4vw, 40px);
  border-radius: 40px; color: #fff;
  background: linear-gradient(125deg, #1B1846 0%, #3A2A92 50%, #A0307A 100%);
  box-shadow: var(--shadow-3);
}
.prof-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 90% 10%, rgba(255, 181, 71, .5), transparent 35%), radial-gradient(circle at 0% 100%, rgba(107, 91, 255, .7), transparent 45%); }
.avatar-xl {
  display: grid; place-items: center;
  width: clamp(84px, 12vw, 116px); height: clamp(84px, 12vw, 116px);
  border-radius: 34px; border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px);
  font-family: var(--f-emoji); font-size: clamp(2.8rem, 6vw, 3.8rem);
  cursor: pointer; transition: transform .5s var(--spring);
}
.avatar-xl:hover { transform: rotate(-6deg) scale(1.05); }
.ph-copy h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); margin: 6px 0 12px; }
.rank { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rank-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: linear-gradient(120deg, #FFD166, #FF9F43); color: #3A1F00; font-weight: 700; font-size: .88rem; }
.rank-next { font-size: .85rem; opacity: .8; }
.rank-bar { height: 10px; margin-top: 14px; border-radius: 99px; background: rgba(255, 255, 255, .2); overflow: hidden; max-width: 460px; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #FFD166, #FF7EB6); box-shadow: 0 0 14px rgba(255, 209, 102, .7); transition: width 1.2s var(--ease); }
.rank-txt { display: block; margin-top: 8px; opacity: .8; font-size: .82rem; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 20px 0; }
.tile-stat { padding: 20px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.tile-stat .ts-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; background: var(--tc); margin-bottom: 14px; box-shadow: 0 10px 20px -10px var(--tc); }
.tile-stat b { display: block; font-family: var(--f-display); font-size: 2.1rem; line-height: 1; letter-spacing: -.03em; }
.tile-stat span { color: var(--ink-3); font-size: .86rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { padding: clamp(20px, 3vw, 28px); border-radius: 32px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); margin-bottom: 20px; }
.panel > h2 { margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lvl-row { display: grid; grid-template-columns: 44px 1fr 1.1fr auto; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 16px; text-decoration: none; transition: background-color .2s; }
.lvl-row:hover { background: var(--surface-2); }
.lr-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; font-family: var(--f-display); font-weight: 800; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.lr-name { font-weight: 600; font-size: .95rem; line-height: 1.2; }
.lr-name small { display: block; font-weight: 400; color: var(--ink-3); font-size: .78rem; }
.lr-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.lr-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.lr-stars { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .9rem; min-width: 46px; justify-content: flex-end; }
.lr-stars .ic { width: 16px; height: 16px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px 14px; border-radius: 22px; text-align: center; background: var(--surface-2); transition: transform .4s var(--spring); }
.badge:hover { transform: translateY(-4px) rotate(-1deg); }
.badge .b-ic { font-family: var(--f-emoji); font-size: 2.4rem; line-height: 1.1; margin-bottom: 4px; filter: drop-shadow(0 8px 10px rgba(22, 20, 50, .16)); }
.badge b { font-size: .86rem; line-height: 1.2; }
.badge small { font-size: .72rem; color: var(--ink-3); line-height: 1.3; }
.badge.locked .b-ic { filter: grayscale(1); opacity: .35; }
.badge.locked b { color: var(--ink-3); }
.hist { display: grid; gap: 6px; }
.hist a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; text-decoration: none; transition: background-color .2s; }
.hist a:hover { background: var(--surface-2); }
.hist .tok-e { font-size: 1.6rem; width: 40px; text-align: center; }
.hist b { font-weight: 600; font-size: .95rem; }
.hist small { display: block; color: var(--ink-3); font-size: .78rem; }
.hist .h-stars { margin-left: auto; display: flex; }
.hist .h-stars .ic { width: 16px; height: 16px; }
.danger-zone { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 20px; color: var(--ink-3); font-size: .85rem; }

/* --------------------------------------------------------------- Docentes */
.t-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; margin-bottom: 28px; }
.t-hero h1 { margin: 14px 0 18px; }
.t-hero-art { position: relative; display: grid; place-items: center; min-height: 300px; }
.t-board {
  position: relative; width: min(420px, 100%); aspect-ratio: 16 / 10;
  border-radius: 28px; padding: 18px;
  background: linear-gradient(140deg, #1D1B4F, #3B2A8C 60%, #7A2F8F);
  box-shadow: var(--shadow-3);
  color: #fff;
  transform: rotate(-3deg);
  animation: bob 7s ease-in-out infinite;
}
.t-board .tb-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.t-board .tb-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.t-board .tb-q { font-family: var(--f-display); font-size: 1.5rem; font-weight: 750; }
.t-board .tb-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.t-board .tb-opts span { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .12); text-align: center; font-weight: 600; }
.t-board .tb-opts span.ok { background: #10B981; }
.t-board-tag { position: absolute; right: -12px; bottom: -14px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); font-weight: 600; font-size: .85rem; transform: rotate(3deg); }
.t-board-tag .ic { color: var(--brand); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: st; }
.step { position: relative; padding: 24px; border-radius: 26px; background: var(--surface-2); }
.step::before { counter-increment: st; content: counter(st); display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px; border-radius: 12px; background: var(--ink); color: var(--bg); font-family: var(--f-display); font-weight: 800; }
.step h3 { font-size: 1.12rem; margin-bottom: 6px; }
.step p { color: var(--ink-2); font-size: .92rem; }
.cat-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.select, .input {
  min-height: 46px; padding: 0 14px;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  font: 500 .95rem var(--f-body);
}
.select { padding-right: 36px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2385839E' stroke-width='2'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.cat-list { display: grid; }
.cat-row { display: grid; grid-template-columns: 48px minmax(0, 2.2fr) 110px 150px 150px auto; align-items: center; gap: 14px; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); border-radius: 14px; }
.cr-e { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-family: var(--f-emoji); font-size: 1.6rem; background: color-mix(in srgb, var(--ac) 14%, var(--surface)); }
.cr-main b { display: block; font-weight: 600; font-size: .96rem; }
.cr-main small { display: block; color: var(--ink-3); font-size: .8rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-lv { justify-self: start; padding: 4px 10px; border-radius: 999px; color: #fff; font-size: .75rem; font-weight: 700; background: linear-gradient(135deg, var(--c1), var(--c2)); white-space: nowrap; }
.cr-area, .cr-type { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--ink-2); }
.cr-area .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ac); flex: none; }
.cr-type .ic { width: 15px; height: 15px; color: var(--ink-3); }
.cr-actions { display: flex; gap: 6px; }
.cat-count { color: var(--ink-3); font-size: .86rem; }
.code-block { position: relative; margin-top: 14px; border-radius: 20px; background: #12112A; color: #E6E4FF; overflow: auto; }
.code-block pre { margin: 0; padding: 20px 22px; font: 500 .84rem/1.65 ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace; }
.code-block .c-k { color: #FF9FD0; }
.code-block .c-s { color: #9EF0C6; }
.code-block .c-c { color: #8885B5; }
.add-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px; align-items: start; }
.add-grid ol { margin: 0; padding-left: 20px; color: var(--ink-2); display: grid; gap: 10px; }
.add-grid code, .inline-code { padding: 2px 7px; border-radius: 7px; background: var(--surface-2); font: 500 .86em ui-monospace, Consolas, monospace; color: var(--ink); }
.type-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.type-list span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--surface-2); font-size: .8rem; font-weight: 500; }
.type-list .ic { width: 14px; height: 14px; color: var(--brand); }

/* ------------------------------------------------------- Modales y toasts */
.modal-wrap {
  position: fixed; inset: 0; z-index: 180;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(12, 11, 26, .48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .25s var(--ease);
}
.modal-wrap.out { animation: fade .2s var(--ease) reverse forwards; }
.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(22px, 4vw, 32px);
  border-radius: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  animation: modalIn .5s var(--spring);
}
.modal-sm { width: min(420px, 100%); text-align: center; }
.modal-x { position: absolute; top: 14px; right: 14px; box-shadow: none; }
.modal-title { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; margin-bottom: 8px; padding-right: 40px; }
.modal-sm .modal-title { justify-content: center; padding: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.field { display: grid; gap: 8px; margin-top: 20px; font-weight: 600; font-size: .92rem; }
.field input { min-height: 54px; padding: 0 18px; border-radius: 16px; border: 2px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: 500 1.1rem var(--f-body); }
.field input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 18px; }
.av { aspect-ratio: 1; display: grid; place-items: center; border-radius: 16px; border: 2px solid transparent; background: var(--surface-2); font-family: var(--f-emoji); font-size: 1.6rem; cursor: pointer; transition: transform .3s var(--spring), border-color .2s, background-color .2s; }
.av:hover { transform: scale(1.1) rotate(-4deg); }
.av.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); transform: scale(1.08); }
.pf-preview { display: grid; place-items: center; margin-bottom: 14px; }
.pf-preview .avatar-xl { background: var(--grad-brand); border: 0; cursor: default; box-shadow: 0 16px 30px -14px rgba(122, 84, 255, .8); }
.welcome { text-align: center; }
.wl-logo { display: grid; place-items: center; margin: 4px auto 18px; }
.wl-logo .logo-mark { animation: bob 5s ease-in-out infinite; }
.welcome .modal-title { justify-content: center; padding: 0; font-size: 1.7rem; }
.wl-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.wl-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px 18px; border-radius: 24px; border: 2px solid var(--line-2); background: var(--surface); cursor: pointer; text-align: center; transition: transform .4s var(--spring), border-color .2s, box-shadow .3s; }
.wl-choice:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--shadow-2); }
.wl-choice span { font-family: var(--f-emoji); font-size: 2.6rem; line-height: 1.2; }
.wl-choice b { font-size: 1rem; }
.wl-choice small { color: var(--ink-3); font-size: .8rem; }
.wl-skip { margin-top: 14px; }
.set-list { display: grid; margin-top: 10px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row b { display: block; font-weight: 600; }
.set-row small { display: block; color: var(--ink-3); font-size: .82rem; margin-top: 2px; }
.switch { position: relative; flex: none; width: 54px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background-color .25s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .35s var(--spring); }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:focus-visible + i { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-2); flex: none; }
.seg button { padding: 8px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--ink-3); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.modal-search { width: min(660px, 100%); padding: 0; align-self: start; margin-top: 9vh; overflow: hidden; display: flex; flex-direction: column; }
.search-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.search-input > .ic { color: var(--ink-3); width: 22px; height: 22px; }
.search-input input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: 500 1.12rem var(--f-body); outline: none; }
.search-input input::-webkit-search-cancel-button { display: none; }
.search-results { max-height: min(60vh, 520px); overflow: auto; padding: 8px; }
.sr-label { padding: 10px 12px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.sr { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 16px; text-decoration: none; }
.sr.active, .sr:hover { background: var(--surface-2); }
.sr-e { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; font-family: var(--f-emoji); font-size: 1.5rem; background: color-mix(in srgb, var(--ac) 14%, var(--surface)); }
.sr b { display: block; font-weight: 600; font-size: .96rem; }
.sr small { display: block; color: var(--ink-3); font-size: .8rem; }
.sr > .ic { margin-left: auto; color: var(--ink-3); opacity: 0; transition: opacity .2s; }
.sr.active > .ic { opacity: 1; }
.sr-empty { padding: 34px 20px; text-align: center; color: var(--ink-3); }

.toasts { position: fixed; top: 84px; left: 50%; z-index: 220; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 20px 12px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: .95rem; box-shadow: var(--shadow-3); animation: toastIn .55s var(--spring); }
.toast .ic { width: 20px; height: 20px; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast.hint { background: var(--miss-bg); color: var(--miss-ink); border: 1px solid color-mix(in srgb, var(--miss) 40%, transparent); }
.toast.combo { background: linear-gradient(120deg, #FF9F1C, #FF3D71); color: #fff; font-family: var(--f-display); font-size: 1.1rem; letter-spacing: -.01em; }
.toast.badge { background: linear-gradient(120deg, #6B5BFF, #FF5FA2); color: #fff; }
.toast .t-emoji { font-family: var(--f-emoji); font-size: 1.4rem; }
#confetti { position: fixed; inset: 0; z-index: 250; pointer-events: none; }

/* ================================================================= PLAYER */
body.in-player .nav, body.in-player .tabbar, body.in-player .footer { display: none; }
body.in-player { padding-bottom: 0 !important; }
body.embed .nav, body.embed .tabbar, body.embed .footer { display: none; }
body.embed { padding-bottom: 0 !important; }
body.embed::before { opacity: .6; }

.player {
  --c1: #8B7BFF; --c2: #5B3FE0;
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(90vw 55vh at 50% -12%, color-mix(in srgb, var(--c1) 22%, transparent), transparent 70%),
    radial-gradient(40vw 40vh at 100% 100%, color-mix(in srgb, var(--c2) 10%, transparent), transparent 70%);
}
.p-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.p-title { display: none; }
.p-progress { position: relative; flex: 1; height: 16px; border-radius: 99px; background: var(--surface-3); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08); }
[data-theme="dark"] .p-progress { background: var(--surface-2); }
.p-progress i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--c1), var(--c2)); transition: width .7s var(--spring); }
.p-progress i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .45); }
.p-score, .p-combo {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 44px; padding: 0 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2);
  font-family: var(--f-display); font-weight: 800; font-size: 1.1rem;
  box-shadow: var(--shadow-1);
}
.p-score .ic { color: var(--gold); width: 20px; height: 20px; }
.p-combo { color: #fff; border: 0; background: linear-gradient(120deg, #FF9F1C, #FF3D71); }
.p-combo .ic { width: 18px; height: 18px; }
.p-combo[hidden] { display: none; }
.p-stage {
  flex: 1;
  display: flex; flex-direction: column;
  width: 100%; max-width: 980px;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 28px) var(--gutter) 150px;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.p-stage.leaving { opacity: 0; transform: translateY(-10px) scale(.99); }
.q { margin-block: auto; width: 100%; animation: rise .5s var(--ease) both; }
.q-meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.q-meta > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); font-size: .8rem; font-weight: 600; }
.q-meta b { color: var(--ink); }
.q-prompt { text-align: center; color: var(--ink-2); font-weight: 500; margin-bottom: 4px; }
.q-text {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px;
  max-width: 30ch; margin: 0 auto clamp(14px, 2.4vw, 24px);
  text-align: center;
  font-size: clamp(1.45rem, 3.4vw, 2.3rem); font-weight: 750; line-height: 1.18; letter-spacing: -.022em;
}
.q-text.long { max-width: 40ch; font-size: clamp(1.25rem, 2.6vw, 1.8rem); }
.q-text mark { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--c1) 40%, transparent) 55%); color: inherit; padding: 0 .1em; border-radius: 4px; }
.speak-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  border: 0; cursor: pointer;
  color: #fff; background: linear-gradient(140deg, var(--c1), var(--c2));
  box-shadow: 0 8px 18px -8px var(--c2);
  transition: transform .3s var(--spring);
  vertical-align: middle;
}
.speak-btn:hover { transform: scale(1.08); }
.speak-btn:active { transform: scale(.92); }
.speak-btn .ic { width: 22px; height: 22px; }
.speak-btn.talking { animation: talk 1.2s ease-in-out; }
.blank { display: inline-block; min-width: 2.6em; padding: 0 .2em; margin: 0 .12em; border-bottom: 4px solid var(--c2); color: var(--c2); line-height: 1.1; transition: color .3s; }
.blank.in-word { min-width: 1.1em; margin: 0; }
.blank.filled { color: var(--ok-ink); border-color: var(--ok); animation: pop .5s var(--spring); }
.blank.revealed { color: var(--miss-ink); border-color: var(--miss); }

.visual { display: flex; justify-content: center; margin: 4px 0 clamp(18px, 3vw, 30px); }
.v-big { display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--f-emoji); font-size: clamp(5rem, 15vw, 8.4rem); line-height: 1; filter: drop-shadow(0 16px 22px rgba(22, 20, 50, .16)); animation: popIn .6s var(--spring) both; }
.v-big small { font-family: var(--f-body); font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.v-text { font-family: var(--f-display); font-weight: 800; font-size: clamp(2.6rem, 9vw, 5rem); letter-spacing: -.03em; line-height: 1.05; text-align: center; padding: .2em .55em; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); animation: popIn .6s var(--spring) both; }
.v-text.sm { font-size: clamp(1.8rem, 6vw, 3rem); }
.v-text sup { font-size: .5em; }
.v-card { max-width: 640px; padding: 22px 26px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-size: 1.15rem; text-align: center; }
.v-count { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 18px; max-width: 560px; padding: 20px 28px; border-radius: 32px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-family: var(--f-emoji); font-size: clamp(2.6rem, 7.5vw, 4rem); line-height: 1; }
.v-count span { animation: popIn .5s var(--spring) both; animation-delay: calc(var(--i) * 70ms); }
.v-sum { display: flex; align-items: center; gap: clamp(10px, 3vw, 24px); flex-wrap: wrap; justify-content: center; }
.v-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 220px; padding: 18px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); font-family: var(--f-emoji); font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1; }
.v-group span { animation: popIn .5s var(--spring) both; animation-delay: calc(var(--i) * 70ms); }
.v-op { font-family: var(--f-display); font-weight: 800; font-size: clamp(2.4rem, 6vw, 3.6rem); color: var(--c2); }
.hole { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -.12em; border-radius: .22em; border: .09em dashed var(--c2); background: color-mix(in srgb, var(--c1) 12%, transparent); }
.clock { width: min(250px, 62vw); height: auto; filter: drop-shadow(0 18px 26px rgba(22, 20, 50, .16)); animation: popIn .6s var(--spring) both; }
.clock .c-face { fill: var(--surface); stroke: var(--c2); stroke-width: 7; }
.clock .c-in { fill: none; stroke: var(--line-2); stroke-width: 1; }
.clock .tk { stroke: var(--ink-3); stroke-width: 1.5; }
.clock .tk5 { stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; }
.clock text { font: 700 15px var(--f-display); fill: var(--ink); text-anchor: middle; }
.clock .c-h { stroke: var(--ink); stroke-width: 8; stroke-linecap: round; }
.clock .c-m { stroke: var(--c2); stroke-width: 5; stroke-linecap: round; }
.clock .c-dot { fill: var(--c2); stroke: var(--surface); stroke-width: 3; }
.frac-svg { width: min(230px, 60vw); height: auto; filter: drop-shadow(0 16px 22px rgba(22, 20, 50, .14)); animation: popIn .6s var(--spring) both; }
.frac-svg.bar { width: min(420px, 86vw); }
.frac-svg .f-on { fill: var(--c2); stroke: var(--surface); stroke-width: 3; }
.frac-svg .f-off { fill: var(--surface); stroke: var(--line-2); stroke-width: 2; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; font-variant-numeric: tabular-nums; font-family: var(--f-display); font-weight: 800; }
.frac > span:first-child { padding: 0 .18em .08em; border-bottom: .09em solid currentColor; }
.frac > span:last-child { padding-top: .08em; }

/* Opciones */
.opts { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 16px); width: 100%; max-width: 780px; margin: 0 auto; }
.opts.is-list { max-width: 640px; }
.opt {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 78px; padding: 14px 18px;
  border-radius: 22px; border: 2px solid var(--line-2);
  background: var(--surface); color: var(--ink);
  font: 600 clamp(1.05rem, 2vw, 1.3rem)/1.25 var(--f-body);
  text-align: center;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--line-2);
  transition: transform .22s var(--spring), border-color .2s, background-color .2s, box-shadow .2s, opacity .2s;
  animation: rise .45s var(--ease) both;
  animation-delay: calc(var(--j, 0) * 50ms);
  user-select: none;
  touch-action: manipulation;
}
.opt:nth-child(1) { --j: 1; } .opt:nth-child(2) { --j: 2; } .opt:nth-child(3) { --j: 3; } .opt:nth-child(4) { --j: 4; } .opt:nth-child(5) { --j: 5; }
.opts.is-list .opt { justify-content: flex-start; text-align: left; padding-left: 52px; }
.opts.is-visual .opt { min-height: clamp(104px, 18vw, 150px); }
.opts.is-visual .tok-e { font-size: clamp(3rem, 9vw, 4.6rem); }
.opt .tok-e { font-size: 1.7em; }
.opt .tok-t { overflow-wrap: anywhere; }
.opt:hover:not(:disabled) { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c2) 55%, var(--line-2)); box-shadow: 0 8px 0 color-mix(in srgb, var(--c2) 40%, var(--line-2)); }
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line-2); transition-duration: .06s; }
.opt:disabled { cursor: default; }
.opt .key { position: absolute; top: 8px; left: 10px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--ink-3); font-size: .7rem; font-weight: 700; font-family: var(--f-body); }
.opts.is-list .opt .key { top: 50%; left: 16px; transform: translateY(-50%); }
.opt.is-ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok-ink); box-shadow: 0 5px 0 var(--ok); animation: pop .55s var(--spring); }
.opt.is-ok .key { border-color: var(--ok); color: var(--ok-ink); }
.opt.is-bad { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 5px 0 var(--bad); animation: shake .45s; opacity: .7; }
.opt.is-reveal { border-color: var(--ok); border-style: dashed; color: var(--ok-ink); animation: pulseOk 1.4s ease-in-out 2; }
.opts .opt:disabled:not(.is-ok):not(.is-bad):not(.is-reveal) { opacity: .5; }
.swatch { width: clamp(58px, 10vw, 84px); height: clamp(58px, 10vw, 84px); border-radius: 50%; background: var(--sw); box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .14), inset 0 6px 10px rgba(255, 255, 255, .35), 0 10px 18px -8px var(--sw); }
.shape { display: block; width: clamp(60px, 10vw, 84px); height: clamp(60px, 10vw, 84px); background: var(--sw); filter: drop-shadow(0 8px 10px rgba(22, 20, 50, .18)); }
.shape-circle { border-radius: 50%; }
.shape-square { border-radius: 10px; }
.shape-triangle { clip-path: polygon(50% 4%, 97% 94%, 3% 94%); }
.shape-rect { width: clamp(84px, 14vw, 116px); height: clamp(52px, 8vw, 70px); border-radius: 10px; }
.shape-oval { width: clamp(84px, 14vw, 116px); height: clamp(56px, 9vw, 74px); border-radius: 50%; }
.shape-star { clip-path: polygon(50% 0%, 61.8% 35%, 98% 35.4%, 68.5% 57.3%, 79.4% 92%, 50% 71%, 20.6% 92%, 31.5% 57.3%, 2% 35.4%, 38.2% 35%); }
.shape-diamond { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.tok-e.is-shadow { filter: brightness(0) opacity(.82); }
[data-theme="dark"] .tok-e.is-shadow { filter: brightness(0) invert(1) opacity(.8); }
.tok-sub { display: block; font-size: .78em; color: var(--ink-3); font-weight: 500; }

/* Hoja de feedback */
.p-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 20px 0 calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -24px 60px -24px rgba(22, 20, 50, .3);
  transform: translateY(115%);
  transition: transform .5s var(--spring);
}
.p-sheet.show { transform: none; }
.p-sheet.ok { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); border-top-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.p-sheet.miss { background: color-mix(in srgb, var(--miss) 9%, var(--surface)); border-top-color: color-mix(in srgb, var(--miss) 35%, transparent); }
.sh-in { display: flex; align-items: center; gap: 18px; max-width: 980px; margin: 0 auto; padding: 0 var(--gutter); }
.sh-icon { display: grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 50%; color: #fff; background: var(--ok); box-shadow: 0 10px 22px -10px var(--ok); }
.p-sheet.miss .sh-icon { background: var(--miss); box-shadow: 0 10px 22px -10px var(--miss); }
.p-sheet.show .sh-icon { animation: pop .6s var(--spring); }
.sh-icon .ic { width: 28px; height: 28px; }
.sh-body { min-width: 0; flex: 1; }
.sh-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--f-display); font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 800; letter-spacing: -.02em; color: var(--ok-ink); line-height: 1.2; }
.p-sheet.miss .sh-title { color: var(--miss-ink); }
.sh-title .swatch { width: 26px; height: 26px; }
.sh-title .shape { width: 28px; height: 28px; }
.sh-title .tok-e { font-size: 1.2em; }
.sh-text { margin-top: 4px; color: var(--ink-2); font-size: .98rem; }
.sh-btn { flex: none; --b-bg: var(--ok); --b-fg: #fff; --b-bd: transparent; box-shadow: 0 5px 0 color-mix(in srgb, var(--ok) 60%, #000); }
.p-sheet.miss .sh-btn { --b-bg: var(--miss); box-shadow: 0 5px 0 color-mix(in srgb, var(--miss) 60%, #000); }
.sh-btn:active { box-shadow: 0 1px 0 color-mix(in srgb, var(--ok) 60%, #000); }
.praise-pop {
  position: fixed; left: 50%; top: 38%; z-index: 45;
  padding: 12px 26px; border-radius: 999px;
  font-family: var(--f-display); font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -.02em;
  color: #fff; background: linear-gradient(120deg, var(--ok), #16C6A0);
  box-shadow: 0 18px 40px -14px rgba(16, 185, 129, .7);
  pointer-events: none;
  animation: praise 1.1s var(--ease) forwards;
}

/* Intro */
.intro { margin-block: auto; max-width: 660px; margin-inline: auto; text-align: center; animation: rise .6s var(--ease) both; }
.intro-cover {
  position: relative;
  display: grid; place-items: center;
  width: 148px; height: 148px; margin: 10px auto 24px;
  border-radius: 46px;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  box-shadow: 0 28px 50px -20px var(--c2), inset 0 2px 0 rgba(255, 255, 255, .3);
  rotate: -5deg;
}
.intro-cover::before { content: ""; position: absolute; inset: -14px; border-radius: 56px; border: 2px dashed color-mix(in srgb, var(--c2) 35%, transparent); animation: spin 30s linear infinite; }
.intro-cover span { font-family: var(--f-emoji); font-size: 5rem; line-height: 1; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .2)); animation: bob 5s ease-in-out infinite; }
.intro-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.intro-kicker .ic { color: var(--c2); width: 18px; height: 18px; }
.intro-title { font-size: clamp(2.1rem, 5.4vw, 3.4rem); letter-spacing: -.035em; margin: 10px 0 12px; }
.intro-desc { color: var(--ink-2); font-size: 1.1rem; max-width: 46ch; margin: 0 auto; }
.intro-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 22px; }
.meta-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.meta-pill .ic { width: 16px; height: 16px; color: var(--c2); }
.howto { display: flex; align-items: center; gap: 14px; text-align: left; max-width: 560px; margin: 0 auto 28px; padding: 14px 14px 14px 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.howto-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 13px; color: #B45309; background: #FFF1D6; }
[data-theme="dark"] .howto-ic { background: rgba(255, 194, 51, .16); color: #FFD166; }
.howto > span:nth-child(2) { flex: 1; font-size: .98rem; color: var(--ink-2); }
.p-start { --b-bg: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 16px 34px -14px var(--c2), inset 0 1px 0 rgba(255, 255, 255, .3); }
.p-start .ic { width: 22px; height: 22px; }
.intro-best { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; color: var(--ink-3); font-size: .9rem; }
.intro-best .ic { width: 18px; height: 18px; }
.teacher { margin-top: 34px; text-align: left; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.teacher summary { display: flex; align-items: center; gap: 10px; padding: 16px 20px; cursor: pointer; list-style: none; font-weight: 600; }
.teacher summary::-webkit-details-marker { display: none; }
.teacher summary .ic:first-child { color: var(--brand); }
.teacher summary .chev { margin-left: auto; color: var(--ink-3); transition: transform .3s var(--ease); }
.teacher[open] summary .chev { transform: rotate(180deg); }
.teacher-body { padding: 0 20px 20px; animation: rise .4s var(--ease); }
.t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 0; }
.t-grid dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.t-grid dd { margin: 2px 0 0; font-size: .94rem; }
.t-grid .full { grid-column: 1 / -1; }
.t-tip { display: flex; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--brand) 8%, var(--surface)); font-size: .92rem; color: var(--ink-2); }
.t-tip .ic { color: var(--brand); margin-top: 2px; }
.t-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Pantalla final */
.end { margin-block: auto; width: 100%; max-width: 580px; margin-inline: auto; text-align: center; }
.end-card { position: relative; overflow: hidden; isolation: isolate; padding: 42px clamp(20px, 4vw, 36px) 30px; border-radius: 40px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: modalIn .7s var(--spring) both; }
.end-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--c1) 30%, transparent), transparent 55%); }
.end-rays { position: absolute; left: 50%; top: 90px; z-index: -1; width: 520px; height: 520px; margin-left: -260px; margin-top: -260px; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--gold) 16%, transparent) 0deg 10deg, transparent 10deg 22deg); -webkit-mask-image: radial-gradient(closest-side, #000, transparent); mask-image: radial-gradient(closest-side, #000, transparent); animation: spin 40s linear infinite; }
.end-stars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin-bottom: 20px; }
.end-star { width: 78px; height: 78px; color: var(--surface-3); transform: scale(0) rotate(-40deg); }
.end-star:nth-child(2) { width: 104px; height: 104px; margin-bottom: 14px; }
.end-star svg { width: 100%; height: 100%; }
.end-star.on { color: var(--gold); filter: drop-shadow(0 10px 18px rgba(255, 176, 32, .55)); }
.end-star.show { animation: starIn .7s var(--spring) forwards; }
.end-title { font-size: clamp(2.2rem, 6vw, 3.2rem); letter-spacing: -.04em; }
.end-sub { color: var(--ink-2); margin: 8px auto 0; max-width: 40ch; }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0 20px; }
.end-stat { padding: 16px 8px; border-radius: 20px; background: var(--surface-2); }
.end-stat b { display: block; font-family: var(--f-display); font-size: 1.7rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.end-stat span { font-size: .78rem; color: var(--ink-3); }
.end-stat.xp b { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-extra { display: grid; gap: 10px; margin-bottom: 22px; }
.end-badge { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; text-align: left; color: #fff; background: linear-gradient(120deg, #6B5BFF, #FF5FA2); animation: rise .6s var(--spring) both; animation-delay: 1.6s; }
.end-badge .tok-e { font-size: 2.2rem; }
.end-badge small { display: block; opacity: .85; font-size: .78rem; }
.end-badge b { font-family: var(--f-display); font-size: 1.1rem; }
.end-badge.rank { background: linear-gradient(120deg, #FFB020, #FF5E7E); }
.end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Relacionar */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 6vw, 64px); width: 100%; max-width: 800px; margin: 0 auto; }
.match-col { display: flex; flex-direction: column; gap: 12px; }
.match-col h4 { text-align: center; font-family: var(--f-body); font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.m-item { --pc: var(--c2); position: relative; min-height: 70px; padding: 10px 16px; font-size: clamp(1rem, 1.9vw, 1.18rem); }
.m-item .tok-e { font-size: 2.1em; }
.m-item.sel { border-color: var(--c2); background: color-mix(in srgb, var(--c1) 12%, var(--surface)); box-shadow: 0 5px 0 var(--c2); transform: translateY(-3px) scale(1.02); }
.m-item.done { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 13%, var(--surface)); box-shadow: 0 5px 0 var(--pc); color: var(--ink); animation: pop .5s var(--spring); }
.m-item.done:disabled { opacity: 1; }
.m-badge { position: absolute; top: -9px; right: -9px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--pc); box-shadow: 0 4px 10px -3px var(--pc); animation: popIn .4s var(--spring); }
.m-badge .ic { width: 16px; height: 16px; }
.m-item.is-bad { animation: shake .45s; border-color: var(--bad); background: var(--bad-bg); }
.hint-pulse { animation: hintPulse 1.1s ease-in-out 3 !important; }

/* Memoria */
.mem { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: clamp(8px, 1.6vw, 16px); width: 100%; max-width: calc(var(--cols, 4) * 150px); margin: 0 auto; perspective: 1200px; }
.mem-card { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform .6s var(--spring); animation: dealIn .5s var(--spring) both; animation-delay: calc(var(--k) * 35ms); }
.mem-card:hover:not(.flipped) { transform: translateY(-4px) rotate(-1.5deg); }
.mem-card.flipped { transform: rotateY(180deg); }
.mem-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: clamp(14px, 2vw, 22px); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mem-front { overflow: hidden; background: linear-gradient(140deg, var(--c1), var(--c2)); box-shadow: 0 5px 0 color-mix(in srgb, var(--c2) 70%, #000), 0 14px 24px -14px var(--c2); }
.mem-front::before { content: ""; position: absolute; inset: 8px; border-radius: inherit; border: 2px dashed rgba(255, 255, 255, .35); }
.mem-front svg { width: 38%; height: 38%; color: rgba(255, 255, 255, .9); }
.mem-back { transform: rotateY(180deg); background: var(--surface); border: 2px solid var(--line-2); box-shadow: 0 5px 0 var(--line-2); padding: 6px; font-weight: 700; font-size: clamp(.85rem, 2.4vw, 1.15rem); line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.mem-back .tok-e { font-size: clamp(2.2rem, 7vw, 3.4rem); }
.mem-card.matched .mem-back { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 5px 0 var(--ok); color: var(--ok-ink); }
.mem-card.matched { animation: matchBump .6s var(--spring); }
.mem-card.matched.flipped { transform: rotateY(180deg); }

/* Clasificar */
.cls { display: flex; flex-direction: column; align-items: center; gap: clamp(16px, 3vw, 28px); }
.cls-deck { position: relative; display: grid; place-items: center; width: 100%; min-height: 190px; }
.cls-deck.has-more::before, .cls-deck.has-more::after { content: ""; position: absolute; width: 230px; height: 150px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.cls-deck.has-more::before { transform: rotate(-6deg) translateY(10px); opacity: .55; }
.cls-deck.has-more::after { transform: rotate(4deg) translateY(6px); opacity: .8; }
.cls-card {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-width: 200px; max-width: min(340px, 90vw); min-height: 150px; padding: 22px 30px;
  border-radius: 28px; border: 2px solid var(--line-2);
  background: var(--surface); box-shadow: var(--shadow-3);
  text-align: center; cursor: grab; user-select: none; touch-action: none;
  animation: dealIn .55s var(--spring) both;
}
.cls-card .tok-e { font-size: clamp(3rem, 9vw, 4.4rem); }
.cls-card .tok-t { font-family: var(--f-display); font-weight: 750; font-size: clamp(1.25rem, 3vw, 1.7rem); letter-spacing: -.01em; line-height: 1.15; }
.cls-card.dragging { cursor: grabbing; z-index: 10; box-shadow: 0 40px 70px -24px rgba(22, 20, 50, .45); transition: none; }
.cls-card.back { transition: transform .45s var(--spring); }
.cls-card.shake { animation: shake .45s; }
.cls-buckets { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 16px); width: 100%; max-width: 940px; }
.bucket {
  --bc: var(--c2);
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 150px; padding: 16px 12px 14px;
  border-radius: 26px; border: 2.5px dashed color-mix(in srgb, var(--bc) 50%, var(--line-2));
  background: color-mix(in srgb, var(--bc) 8%, var(--surface));
  cursor: pointer; font: inherit; color: inherit;
  transition: transform .3s var(--spring), border-color .2s, background-color .2s, box-shadow .2s;
}
.bucket:hover, .bucket.over { border-style: solid; border-color: var(--bc); background: color-mix(in srgb, var(--bc) 16%, var(--surface)); transform: translateY(-3px); box-shadow: 0 14px 28px -16px var(--bc); }
.bucket.over { transform: scale(1.05); }
.b-e { font-family: var(--f-emoji); font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.1; }
.b-t { font-family: var(--f-display); font-weight: 750; font-size: clamp(1rem, 1.8vw, 1.2rem); line-height: 1.15; text-align: center; }
.b-pile { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 4px; min-height: 24px; }
.b-pile > span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--bc) 30%, var(--line)); font-size: .72rem; font-weight: 600; animation: popIn .4s var(--spring); }
.b-pile .tok-e { font-size: 1rem; }
.bucket.is-bad { animation: shake .45s; border-color: var(--bad); background: var(--bad-bg); }
.bucket.is-ok { animation: bump .5s var(--spring); }

/* Secuencias (ordenar / formar palabras) */
.seq { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 3vw, 26px); }
.seq-slots.word { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 1.4vw, 12px); }
.seq-slots.word .slot {
  display: grid; place-items: center;
  width: clamp(54px, 11vw, 78px); height: clamp(64px, 13vw, 92px);
  border-radius: 20px; border: 3px dashed var(--line-2);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-family: var(--f-display); font-weight: 800; font-size: clamp(1.9rem, 5.4vw, 2.8rem);
  transition: border-color .2s, background-color .2s;
}
.seq-slots.word .slot.wide { width: auto; min-width: clamp(84px, 16vw, 120px); padding: 0 14px; }
.seq-slots .slot.next { border-color: var(--c2); animation: breathe 1.6s ease-in-out infinite; }
.seq-slots .slot.filled { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok-ink); animation: pop .5s var(--spring); }
.seq-slots.word.win .slot { animation: wave .7s var(--spring) both; animation-delay: calc(var(--k) * 70ms); }
.seq-slots.list { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 600px; }
.seq-slots.list .slot { display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 8px 16px 8px 10px; border-radius: 20px; border: 2px dashed var(--line-2); background: color-mix(in srgb, var(--surface) 60%, transparent); font-weight: 600; transition: border-color .2s, background-color .2s; }
.slot .n { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); font-family: var(--f-display); font-weight: 800; font-size: .95rem; }
.slot.filled .n { background: var(--ok); color: #fff; }
.slot .s-c { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.slot .s-c .tok-e { font-size: 1.6rem; }
.slot .s-x { margin-left: auto; flex: none; padding: 4px 10px; border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size: .78rem; font-weight: 700; animation: popIn .4s var(--spring); }
.seq-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(8px, 1.4vw, 12px); width: 100%; max-width: 820px; }
.tile { min-height: 62px; padding: 10px 18px; font-size: clamp(1rem, 1.9vw, 1.15rem); }
.tile .tok-e { font-size: 1.7em; }
.tile.letter { width: clamp(56px, 11vw, 76px); height: clamp(64px, 12vw, 84px); padding: 0; font-family: var(--f-display); font-weight: 800; font-size: clamp(1.8rem, 5vw, 2.5rem); }
.tile.syl { min-width: clamp(76px, 14vw, 108px); height: clamp(62px, 11vw, 80px); font-family: var(--f-display); font-weight: 800; font-size: clamp(1.4rem, 4vw, 2rem); }
.tile.used { visibility: hidden; }
.tile.is-bad { animation: shake .45s; border-color: var(--bad); background: var(--bad-bg); }

/* Teclado numérico */
.kp { display: flex; flex-direction: column; align-items: center; gap: clamp(18px, 3vw, 28px); }
.kp-expr { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .25em; font-family: var(--f-display); font-weight: 800; font-size: clamp(2.6rem, 9vw, 4.6rem); letter-spacing: -.03em; line-height: 1.1; animation: popIn .55s var(--spring) both; }
.kp-expr sup { font-size: .52em; }
.kp-eq { color: var(--ink-3); }
.kp-ans { display: inline-grid; place-items: center; min-width: 1.8em; height: 1.28em; padding: 0 .3em; border-radius: .3em; border: .06em solid var(--c2); background: var(--surface); color: var(--c2); box-shadow: 0 .08em 0 var(--c2); transition: border-color .2s, color .2s, background-color .2s; }
.kp-ans.empty::after { content: ""; width: .06em; height: .8em; border-radius: 2px; background: var(--c2); animation: caret 1s steps(1) infinite; }
.kp-ans.is-ok { border-color: var(--ok); color: var(--ok-ink); background: var(--ok-bg); box-shadow: 0 .08em 0 var(--ok); animation: pop .5s var(--spring); }
.kp-ans.is-bad { animation: shake .45s; border-color: var(--bad); color: var(--bad); }
.kp-ans.is-reveal { border-color: var(--miss); color: var(--miss-ink); background: var(--miss-bg); box-shadow: 0 .08em 0 var(--miss); }
.kp-expr .speak-btn { margin-left: .2em; }
.kp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(330px, 100%); }
.kp-key { height: clamp(58px, 9vw, 68px); padding: 0; font-family: var(--f-display); font-size: 1.7rem; font-weight: 800; border-radius: 20px; }
.kp-key.del { color: var(--ink-3); }
.kp-key.go { --j: 0; border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 5px 0 color-mix(in srgb, var(--c2) 65%, #000); }
.kp-key.go:hover:not(:disabled) { border-color: transparent; box-shadow: 0 8px 0 color-mix(in srgb, var(--c2) 65%, #000); }
.kp-key .ic { width: 26px; height: 26px; margin: auto; }
.kp-key.press { transform: translateY(4px); box-shadow: 0 1px 0 var(--line-2); }

.fly-clone { transition: none !important; animation: none !important; }

/* Proyector y pantalla completa */
html.projector { font-size: 122%; }
html.projector .p-stage { max-width: 1240px; }

/* ------------------------------------------------------------ Animaciones */
/* rise y dealIn usan propiedades individuales (translate/scale/rotate) para no bloquear los transform de hover y arrastre */
@keyframes rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: scale(1); } }
@keyframes dealIn { 0% { opacity: 0; translate: 0 24px; scale: .85; rotate: -4deg; } 100% { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; } }
@keyframes shake { 0%, 100% { translate: 0; } 20% { translate: -9px; } 40% { translate: 8px; } 60% { translate: -5px; } 80% { translate: 3px; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes matchBump { 0% { scale: 1; } 40% { scale: 1.1; } 100% { scale: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c2) 40%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--c2) 0%, transparent); } }
@keyframes hintPulse { 0%, 100% { box-shadow: 0 5px 0 var(--line-2), 0 0 0 0 color-mix(in srgb, var(--gold) 70%, transparent); } 50% { box-shadow: 0 5px 0 var(--line-2), 0 0 0 10px color-mix(in srgb, var(--gold) 0%, transparent); border-color: var(--gold); } }
@keyframes pulseOk { 0%, 100% { box-shadow: 0 5px 0 var(--ok), 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 50% { box-shadow: 0 5px 0 var(--ok), 0 0 0 10px color-mix(in srgb, var(--ok) 0%, transparent); } }
@keyframes starIn { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.18) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.95); } }
@keyframes praise { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.7); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 70% { opacity: 1; transform: translate(-50%, -10px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -40px) scale(.95); } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes talk { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c2) 50%, transparent); } 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--c2) 0%, transparent); } }
@keyframes wave { 0% { transform: translateY(0); } 40% { transform: translateY(-14px); } 100% { transform: translateY(0); } }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .26s; }

/* ------------------------------------------------------------- Responsive */
@media (max-width: 1100px) {
  .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-row { grid-template-columns: 48px minmax(0, 1fr) 110px auto; }
  .cat-row .cr-area, .cat-row .cr-type { display: none; }
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { height: 440px; max-width: 560px; width: 100%; margin: 0 auto; }
  .duo, .two-col, .t-hero, .teacher-band, .add-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .footer-in { grid-template-columns: 1fr; }
  .lh-ringbox { margin-right: 0; }
  .t-hero-art { min-height: 240px; }
}
@media (max-width: 860px) {
  :root { --nav-h: 62px; }
  .nav-links { display: none; }
  .tabbar { display: flex; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .search-btn { min-width: 0; width: 44px; padding: 0; justify-content: center; }
  .search-btn span, .search-btn kbd { display: none; }
  .levels { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .toasts { top: 74px; }
}
@media (max-width: 640px) {
  .levels { gap: 12px; }
  .level-card { min-height: 190px; padding: 18px; border-radius: 24px; }
  .lc-num { font-size: 3.6rem; }
  .lc-emoji { font-size: 3.6rem; right: 6px; bottom: 40px; }
  .lc-ring.r1 { width: 180px; height: 180px; }
  .lc-age { display: none; }
  .lc-meta .lm-acts { display: none; }
  .feat-grid { grid-template-columns: 1fr; }
  .hero-art { height: 380px; }
  .fc-main { width: 92%; margin-left: -46%; margin-top: -150px; }
  .fc-q { font-size: 1.3rem; }
  .fc-badge { display: none; }
  .fc-stars { bottom: 10px; }
  .hero-stats { gap: 22px; }
  .acts { grid-template-columns: 1fr; }
  .lh-emoji { font-size: 6.4rem; right: 10px; bottom: -18px; opacity: .5; }
  .lh-ringbox { display: none; }
  .level-nav { grid-template-columns: 1fr; }
  .ln-card.next { justify-content: flex-start; text-align: left; flex-direction: row-reverse; }
  .prof-hero { grid-template-columns: auto 1fr; }
  .prof-hero > .btn { grid-column: 1 / -1; justify-self: start; }
  .lvl-row { grid-template-columns: 40px 1fr auto; }
  .lvl-row .lr-bar { display: none; }
  .avatars { grid-template-columns: repeat(4, 1fr); }
  .wl-choices { grid-template-columns: 1fr; }
  .cat-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .cat-row .cr-lv { display: none; }
  .t-grid { grid-template-columns: 1fr; }
  .f-cols { grid-template-columns: 1fr 1fr; }
  .opts { --cols: var(--cols-sm, 2) !important; }
  .opt { min-height: 66px; border-radius: 18px; }
  .opt .key { display: none; }
  .opts.is-list .opt { padding-left: 18px; }
  .match { gap: 10px; }
  .m-item { padding: 8px 10px; min-height: 62px; font-size: .95rem; }
  .cls-buckets { grid-template-columns: repeat(min(var(--n, 2), 3), minmax(0, 1fr)); }
  .bucket { min-height: 118px; padding: 12px 8px; border-radius: 20px; }
  .sh-in { flex-wrap: wrap; gap: 12px 14px; }
  .sh-icon { width: 46px; height: 46px; }
  .sh-btn { width: 100%; }
  .p-sheet { padding-top: 16px; }
  .p-bar { gap: 8px; }
  .p-bar .p-full { display: none; }
  .p-score, .p-combo { height: 40px; padding: 0 11px; font-size: 1rem; }
  .p-progress { height: 13px; }
  .end-stats { gap: 6px; }
  .end-stat b { font-size: 1.35rem; }
  .end-star { width: 62px; height: 62px; }
  .end-star:nth-child(2) { width: 84px; height: 84px; }
  .q-text { gap: 8px; }
  .speak-btn { width: 40px; height: 40px; }
}
@media (max-width: 420px) {
  .nav-in { gap: 6px; }
  .nav-actions { gap: 6px; }
  .brand { font-size: 1.22rem; gap: 8px; }
  .brand .logo-mark { width: 30px; height: 30px; }
  .nav .icon-btn, .search-btn { width: 40px; height: 40px; }
  .profile-chip { height: 40px; padding: 0 10px 0 3px; gap: 6px; }
  .profile-chip .avatar { width: 32px; height: 32px; font-size: 1.1rem; }
  .tabbar a { font-size: .66rem; white-space: nowrap; }
  .chip-eyebrow { font-size: .8rem; }
  .cta-row .btn { width: 100%; }
  .hero-art { height: 340px; }
  .fc-streak { top: 0; }
  .levels { grid-template-columns: 1fr 1fr; gap: 10px; }
  .level-card { min-height: 170px; padding: 14px; }
  .lc-num { font-size: 3rem; }
  .lc-name { font-size: .92rem; }
  .lc-emoji { font-size: 2.8rem; bottom: 44px; }
  .lc-stage { padding: 4px 9px; }
  .p-score, .p-combo { padding: 0 9px; }
  .mem { gap: 7px; }
  .daily-card, .me-card { padding: 20px; border-radius: 28px; }
  .dc-e { width: 60px; height: 60px; font-size: 2.2rem; border-radius: 18px; }
  .dc-main { gap: 12px; }
  .dc-main h3 { font-size: 1.25rem; }
  .tiles { gap: 10px; }
  .tile-stat { padding: 14px; border-radius: 20px; }
  .tile-stat b { font-size: 1.6rem; }
  .tile-stat .ts-ic { width: 36px; height: 36px; margin-bottom: 10px; }
  .me-stats { gap: 6px; }
  .me-stat { padding: 10px 4px; }
  .kp-pad { gap: 8px; }
}
@media (hover: none) {
  .opt .key { display: none; }
  .opts.is-list .opt { padding-left: 18px; }
}

/* --------------------------------------------------- Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; }
}

/* ------------------------------------------------------------------ Print */
@media print {
  .nav, .tabbar, .footer, .toasts, #confetti, .p-bar, .p-sheet { display: none !important; }
  body::before, body::after { display: none; }
  body { background: #fff; padding: 0; }
}
