/* =========================================================
   MATEMÁTICAS MÁGICAS 3D · styles.css
   Paleta: morado, naranja, amarillo, verde, celeste y blanco
   ========================================================= */
@font-face {
  font-family: 'Baloo 2';
  src: url('../assets/fonts/Baloo2.woff') format('woff');
  font-weight: 400 800;
  font-display: swap;
}
:root {
  --purple: #7B4DFF;
  --purple-d: #5B32D6;
  --purple-dd: #2B1B5A;
  --orange: #FF8A1F;
  --orange-d: #D9670A;
  --yellow: #FFC93C;
  --yellow-d: #E0A800;
  --green: #2FBF71;
  --green-d: #1E9455;
  --sky: #4FC3F7;
  --sky-d: #1E9AD6;
  --pink: #FF6F91;
  --white: #FFFFFF;
  --ink: #2B1B5A;
  --red: #FF5A5F;
  --radius: 26px;
  --fs: clamp(16px, 1.55vw, 24px);
  --shadow: 0 10px 30px rgba(27, 18, 64, .25);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2B1B5A; }
body { font-family: 'Baloo 2', 'Trebuchet MS', 'Comic Sans MS', system-ui, sans-serif; color: var(--ink); font-size: var(--fs); user-select: none; -webkit-user-select: none; }
button { font-family: inherit; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui > * { pointer-events: none; }
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }
.screen .pe, .screen button, .panel, .modal, .card, #topbar, .chip-btn, .map-wrap { pointer-events: auto; }
.hidden { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  pointer-events: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  border: 0; border-radius: 22px; cursor: pointer;
  font-weight: 800; font-size: 1.05em; letter-spacing: .02em;
  padding: .55em 1.2em; color: #fff;
  background: var(--purple);
  box-shadow: 0 6px 0 var(--purple-d), 0 10px 20px rgba(0,0,0,.2);
  transition: transform .12s, box-shadow .12s, filter .12s;
  text-shadow: 0 2px 0 rgba(0,0,0,.15);
  min-height: 56px;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--purple-d), 0 4px 10px rgba(0,0,0,.2); }
.btn.orange { background: var(--orange); box-shadow: 0 6px 0 var(--orange-d), 0 10px 20px rgba(0,0,0,.2); }
.btn.green { background: var(--green); box-shadow: 0 6px 0 var(--green-d), 0 10px 20px rgba(0,0,0,.2); }
.btn.yellow { background: var(--yellow); color: var(--ink); text-shadow: none; box-shadow: 0 6px 0 var(--yellow-d), 0 10px 20px rgba(0,0,0,.2); }
.btn.sky { background: var(--sky); box-shadow: 0 6px 0 var(--sky-d), 0 10px 20px rgba(0,0,0,.2); }
.btn.white { background: #fff; color: var(--ink); text-shadow: none; box-shadow: 0 6px 0 #C9C2E8, 0 10px 20px rgba(0,0,0,.15); }
.btn.red { background: var(--red); box-shadow: 0 6px 0 #C93D42, 0 10px 20px rgba(0,0,0,.2); }
.btn.big { font-size: 1.6em; padding: .5em 1.6em; border-radius: 30px; min-height: 80px; }
.btn.small { font-size: .85em; padding: .35em .9em; min-height: 44px; border-radius: 16px; }
.btn[disabled] { filter: grayscale(.9) opacity(.6); cursor: not-allowed; transform: none; }

.chip-btn {
  border: 0; border-radius: 999px; padding: .25em .8em; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--ink); font-weight: 800; font-size: .78em;
  box-shadow: 0 3px 0 rgba(43,27,90,.25); min-height: 40px; white-space: nowrap;
}
.chip-btn:hover { background: #fff; }
.chip-btn.off { background: #E6E1F5; color: #8C82B3; }
.chip-btn.on { background: var(--yellow); }

/* ---------- Barra superior ---------- */
#topbar {
  position: absolute; top: 10px; left: 10px; right: 10px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
#topbar .tb-left, #topbar .tb-right { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-stats { display: flex; gap: 8px; }
.stat {
  display: flex; align-items: center; gap: .3em; background: rgba(43,27,90,.82); color: #fff;
  border-radius: 999px; padding: .15em .9em .15em .5em; font-weight: 800; min-height: 40px; border: 3px solid rgba(255,255,255,.35);
}
.stat .ico { font-size: 1.15em; }
.stat.pulse { animation: pulse .5s; }
.stat.lvl b { font-size: .85em; }
.xpbar { display: inline-block; width: 60px; height: 9px; background: rgba(255,255,255,.25); border-radius: 9px; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--yellow); width: 0%; transition: width .4s; }

/* ---------- Paneles ---------- */
.panel {
  background: rgba(255,255,255,.96); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 5px solid #fff; padding: 18px 22px;
}
.title-xl { font-size: clamp(42px, 7vw, 110px); font-weight: 800; line-height: .95; margin: 0; color: #fff;
  text-shadow: 0 6px 0 var(--purple-d), 0 10px 0 rgba(0,0,0,.18); letter-spacing: .01em; }
.title-l { font-size: clamp(28px, 3.4vw, 52px); font-weight: 800; margin: 0; line-height: 1.05; }
.subtle { opacity: .75; }

/* ---------- Pantalla de inicio ---------- */
#scr-start .school {
  position: absolute; top: 3vh; left: 0; right: 0; text-align: center; color: #fff; font-weight: 800;
  text-shadow: 0 3px 0 rgba(43,27,90,.6);
}
#scr-start .school .s1 { font-size: clamp(18px, 2.2vw, 34px); letter-spacing: .06em; }
#scr-start .school .s2 { display: inline-block; margin-top: 6px; font-size: clamp(15px, 1.6vw, 24px); background: var(--orange); padding: 2px 18px; border-radius: 999px; box-shadow: 0 4px 0 var(--orange-d); text-shadow: none; }
#scr-start .center { position: absolute; left: 0; right: 0; top: 19vh; text-align: center; }
#scr-start .slogan { display: inline-block; margin-top: 14px; font-size: clamp(20px, 2.4vw, 38px); font-weight: 800; color: var(--ink); background: var(--yellow); border-radius: 999px; padding: 4px 26px; box-shadow: 0 5px 0 var(--yellow-d); }
#scr-start .play { position: absolute; left: 0; right: 0; bottom: 8vh; text-align: center; }
#scr-start .skip { position: absolute; right: 18px; bottom: 18px; }
#scr-start .bubble { position: absolute; }

/* bocadillo del mago */
.speech {
  position: absolute; background: #fff; border-radius: 22px; padding: 12px 18px; font-weight: 700; color: var(--ink);
  box-shadow: var(--shadow); max-width: min(380px, 40vw); border: 4px solid var(--purple); font-size: .95em; pointer-events: auto;
}
.speech:after { content: ''; position: absolute; left: 30px; bottom: -18px; border: 10px solid transparent; border-top-color: var(--purple); }

/* ---------- Menú principal ---------- */
#scr-menu .menu-title { position: absolute; top: 68px; left: 0; right: 0; text-align: center; color: #fff; }
#scr-menu .menu-title h2 { margin: 0; font-size: clamp(28px, 3.4vw, 54px); text-shadow: 0 5px 0 var(--purple-d); }
#scr-menu .menu-title p { margin: 0; font-weight: 700; font-size: clamp(15px, 1.4vw, 22px); text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.portal-label { pointer-events: auto; cursor: pointer; text-align: center; }
.portal-card { transition: transform .2s; }
.portal-label:hover .portal-card { transform: scale(1.06); }
.portal-card { background: #fff; border-radius: 24px; padding: 8px 18px 10px; box-shadow: var(--shadow); border: 5px solid var(--c); min-width: 210px; }
.portal-card h3 { margin: 0; font-size: clamp(22px, 2.3vw, 38px); color: var(--c); line-height: 1; }
.portal-card p { margin: 2px 0 6px; font-weight: 700; font-size: .9em; }
.portal-card .prog { font-size: .75em; font-weight: 800; background: #F3EFFF; border-radius: 99px; padding: 1px 10px; display: inline-block; }
#scr-menu .menu-bottom { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 0 12px; }
#scr-menu .continue { position: absolute; top: 172px; left: 50%; translate: -50% 0; }

/* ---------- Mapa de aventuras ---------- */
#scr-map { background: linear-gradient(180deg, rgba(43,27,90,.35), rgba(43,27,90,.1) 40%, rgba(43,27,90,.45)); }
.map-wrap { position: absolute; inset: 64px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.map-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.map-head h2 { color: #fff; margin: 0; font-size: clamp(26px, 3vw, 48px); text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.map-worlds { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; min-height: 0; }
.world-card { position: relative; border-radius: 30px; padding: 16px; color: #fff; display: flex; flex-direction: column; box-shadow: var(--shadow); border: 5px solid rgba(255,255,255,.85); overflow: hidden; background: var(--c); }
.world-card:before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 0%, rgba(255,255,255,.35), transparent 50%); pointer-events: none; }
.world-card .wc-top { display: flex; align-items: center; gap: 12px; }
.world-card .wc-ico { font-size: clamp(36px, 4vw, 64px); filter: drop-shadow(0 4px 0 rgba(0,0,0,.2)); }
.world-card h3 { margin: 0; font-size: clamp(20px, 2vw, 32px); line-height: 1; }
.world-card .wc-game { font-weight: 700; opacity: .95; font-size: .85em; }
.world-card .trophy { position: absolute; top: 10px; right: 14px; font-size: 1.8em; }
.path { flex: 1; position: relative; margin-top: 8px; min-height: 260px; }
.path svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.node {
  position: absolute; transform: translate(-50%, -50%); width: clamp(64px, 6.5vw, 96px); height: clamp(64px, 6.5vw, 96px); border-radius: 50%;
  border: 5px solid #fff; background: #fff; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; box-shadow: 0 6px 0 rgba(0,0,0,.2); transition: transform .15s; line-height: 1;
}
.node:hover { transform: translate(-50%, -50%) scale(1.08); }
.node .n { font-size: 1.5em; }
.node .nm { position: absolute; top: 100%; margin-top: 6px; font-size: .62em; background: rgba(43,27,90,.85); color: #fff; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.node .st { font-size: .55em; letter-spacing: -1px; }
.node.locked { background: #CFC9E3; color: #7D74A0; cursor: not-allowed; }
.node.locked .n { font-size: 1.4em; }
.node.done { background: var(--yellow); }
.node.current { animation: glow 1.4s infinite; }

/* ---------- Juego (HUD) ---------- */
.g-top { position: absolute; top: 62px; left: 12px; right: 12px; display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.g-info { background: rgba(43,27,90,.85); color: #fff; border-radius: 22px; padding: 6px 16px; border: 3px solid rgba(255,255,255,.4); }
.g-info .gname { font-weight: 800; font-size: 1.05em; line-height: 1.1; }
.g-info .glevel { font-size: .8em; font-weight: 700; color: var(--yellow); }
.g-prog { display: flex; gap: 6px; margin-top: 4px; }
.g-prog i { width: 34px; height: 12px; border-radius: 8px; background: rgba(255,255,255,.25); display: block; }
.g-prog i.ok { background: var(--green); }
.g-prog i.retry { background: var(--yellow); }
.g-prog i.skip { background: #B9B2D6; }
.g-prog i.now { background: #fff; animation: pulse 1s infinite; }
.g-score { background: rgba(255,255,255,.95); border-radius: 22px; padding: 4px 16px; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.15); text-align: right; }
.g-score .pts { font-size: 1.3em; color: var(--purple); line-height: 1; }
.g-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.question {
  position: absolute; left: 50%; translate: -50% 0; top: 150px; max-width: min(900px, 92vw);
  text-align: center; font-weight: 800; font-size: clamp(22px, 2.4vw, 40px); padding: 10px 26px; line-height: 1.15;
  display: flex; align-items: center; gap: 16px; justify-content: center;
}
.question .qtext { flex: 1; }
.question .qvis svg { height: clamp(70px, 9vw, 120px); width: auto; display: block; }
.op { font-size: 1.3em; color: var(--purple); white-space: nowrap; }
.op .q { display: inline-block; min-width: 1.2em; background: var(--yellow); border-radius: 14px; padding: 0 .2em; color: var(--ink); }
.answer-bar { position: absolute; left: 0; right: 0; bottom: 20px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; padding: 0 10px; }
.answer-bar .btn { min-width: 110px; font-size: 1.7em; }
.hint-bar { position: absolute; left: 50%; translate: -50% 0; bottom: 112px; background: rgba(43,27,90,.88); color: #fff; font-weight: 700; padding: 6px 18px; border-radius: 999px; font-size: .9em; text-align: center; max-width: 92vw; }
.counter-badge { font-size: .9em; font-weight: 800; padding: 2px 12px; border-radius: 999px; color: #fff; background: var(--purple); box-shadow: 0 3px 0 var(--purple-d); white-space: nowrap; }
.counter-badge.full { background: var(--green); box-shadow: 0 3px 0 var(--green-d); }
.timer { width: 220px; height: 16px; border-radius: 10px; background: rgba(255,255,255,.4); overflow: hidden; border: 2px solid #fff; }
.timer i { display: block; height: 100%; background: var(--sky); width: 100%; transition: width .2s linear; }
.palette { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.95); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow); }
.palette .sw { width: 54px; height: 54px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 0 3px #D9D2F2; cursor: pointer; }
.palette .sw.sel { box-shadow: 0 0 0 5px var(--ink); transform: scale(1.08); }
.equation-pop { position: absolute; left: 50%; top: 42%; translate: -50% -50%; font-size: clamp(44px, 7vw, 110px); font-weight: 800; color: #fff; text-shadow: 0 6px 0 var(--purple-d), 0 12px 20px rgba(0,0,0,.3); white-space: nowrap; pointer-events: none; z-index: 40; }

/* ---------- Etiquetas 3D ---------- */
.label3d { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform; }
.label3d.clickable { pointer-events: auto; cursor: pointer; }
.tag { background: #fff; border-radius: 16px; padding: 2px 12px; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.18); border: 3px solid var(--c, var(--purple)); color: var(--ink); white-space: nowrap; font-size: .95em; }
.tag.big { font-size: 1.9em; padding: 0 18px; border-width: 4px; border-radius: 20px; }
.tag.count { font-size: 1.2em; background: var(--purple); color: #fff; border-color: #fff; }
.tag.choice { font-size: 1.8em; padding: 4px 20px; min-width: 80px; text-align: center; background: #fff; transition: transform .15s; }
.tag.choice:hover { transform: scale(1.1); }
.tag.choice svg { height: 84px; width: auto; display: block; }
.tag.choice .txt { font-size: .6em; max-width: 180px; white-space: normal; line-height: 1.05; display: block; }

/* ---------- Fracción ---------- */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; margin: 0 .12em; font-weight: 800; }
.frac .fn { padding: 0 .12em .04em; border-bottom: .09em solid currentColor; }
.frac .fd { padding-top: .04em; }
.frac.color .fn { color: var(--orange); }
.frac.color .fd { color: var(--sky-d); }

/* ---------- Resultados ---------- */
.center-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 70px 14px 14px; }
.results { text-align: center; max-width: 720px; width: 100%; }
.results h2 { margin: 0; font-size: clamp(28px, 3.6vw, 56px); color: var(--purple); line-height: 1; }
.results .stars { font-size: clamp(54px, 7vw, 100px); margin: 6px 0; letter-spacing: 8px; }
.results .stars span { display: inline-block; filter: grayscale(1) opacity(.3); }
.results .stars span.on { filter: none; animation: starPop .6s backwards; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 16px; }
.res-grid div { background: #F3EFFF; border-radius: 18px; padding: 8px; font-weight: 800; }
.res-grid div b { display: block; font-size: 1.7em; color: var(--purple); line-height: 1.1; }
.res-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.unlock-banner { background: var(--green); color: #fff; border-radius: 18px; padding: 6px; font-weight: 800; margin-bottom: 12px; }

/* ---------- Progreso ---------- */
.prog-wrap { position: absolute; inset: 64px 16px 16px; overflow: auto; pointer-events: auto; }
.prog-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.prog-grid .panel h3 { margin: 0 0 8px; font-size: 1.4em; }
.big-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.big-stats div { background: #F3EFFF; border-radius: 18px; padding: 10px; text-align: center; font-weight: 800; }
.big-stats div b { display: block; font-size: 1.9em; color: var(--purple); line-height: 1; }
.bar-row { display: grid; grid-template-columns: 34px 1fr 110px; gap: 10px; align-items: center; margin: 7px 0; font-weight: 700; }
.bar { height: 18px; background: #EEE9FB; border-radius: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c, var(--purple)); border-radius: 10px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.badge { text-align: center; background: #FFF8E1; border: 3px solid var(--yellow); border-radius: 18px; padding: 8px 4px; font-weight: 700; font-size: .78em; line-height: 1.1; }
.badge .bi { font-size: 2.2em; display: block; }
.badge.locked { background: #F1F0F5; border-color: #DDD8EC; filter: grayscale(1); opacity: .6; }

/* ---------- Modales ---------- */
#modal-root { position: absolute; inset: 0; z-index: 60; }
.modal-back { position: absolute; inset: 0; background: rgba(27,18,64,.55); display: flex; align-items: center; justify-content: center; padding: 12px; pointer-events: auto; }
.modal { max-width: 860px; width: 100%; text-align: center; max-height: 96vh; overflow: auto; }
.modal h2 { margin: 0 0 6px; color: var(--purple); font-size: clamp(28px, 3.2vw, 50px); line-height: 1; }
.modal .wiz { font-size: 64px; line-height: 1; }
.modal .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.modal p { margin: 6px 0; font-weight: 700; }

/* ---------- Profesor paso a paso ---------- */
.teacher { max-width: 980px; }
.teacher .t-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.teacher .t-head h2 { font-size: clamp(22px, 2.4vw, 38px); margin: 0; }
.teacher .steps { display: flex; gap: 6px; justify-content: center; }
.teacher .steps i { width: 42px; height: 12px; background: #E6E1F5; border-radius: 8px; }
.teacher .steps i.on { background: var(--green); }
.teacher .stage { background: linear-gradient(#F3FBFF, #EEF9EF); border-radius: 22px; margin: 10px 0; height: clamp(220px, 40vh, 380px); position: relative; overflow: hidden; border: 4px solid #E3F2FF; }
.teacher .stage svg { width: 100%; height: 100%; display: block; }
.teacher .say { display: flex; gap: 12px; align-items: center; text-align: left; background: #F3EFFF; border-radius: 20px; padding: 10px 16px; font-size: clamp(18px, 1.9vw, 28px); font-weight: 800; min-height: 84px; }
.teacher .say .wz { font-size: 2.2em; }
.teacher .eq { font-size: 1.3em; color: var(--purple); }

/* ---------- Exposición ---------- */
.expo-panel { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; width: min(1100px, 96vw); }
.expo-panel .slide-n { display: inline-block; font-weight: 800; background: var(--purple); color: #fff; border-radius: 999px; padding: 0 14px; font-size: .8em; }
.expo-panel h2 { margin: 2px 0; font-size: clamp(26px, 3vw, 48px); color: var(--purple); line-height: 1.05; }
.expo-panel .txt { font-size: clamp(20px, 2.1vw, 34px); font-weight: 700; line-height: 1.2; }
.expo-panel .row { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; }
.expo-big { position: absolute; left: 50%; top: 66px; translate: -50% 0; text-align: center; pointer-events: none; }
.expo-big .eqbig { font-size: clamp(48px, 7vw, 120px); font-weight: 800; color: #fff; text-shadow: 0 6px 0 var(--purple-d), 0 12px 24px rgba(0,0,0,.3); line-height: 1; }
.part-tags { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.part-tags span { background: #fff; border-radius: 14px; padding: 2px 12px; font-weight: 800; font-size: clamp(14px, 1.3vw, 20px); border: 3px solid var(--c); }

/* ---------- Práctica ---------- */
.prac-panel { position: absolute; right: 2vw; top: 70px; width: min(620px, 60vw); text-align: center; }
.prac-panel .pvis { min-height: 150px; display: flex; align-items: center; justify-content: center; }
.prac-panel .pvis svg { max-width: 100%; height: 180px; }
.prac-choose { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 6vw; }
.prac-choose .panel { text-align: center; max-width: 560px; }
.prac-choose .row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Avisos ---------- */
#toast-root { position: absolute; left: 0; right: 0; top: 30%; display: flex; flex-direction: column; align-items: center; z-index: 70; gap: 8px; }
.toast { background: #fff; color: var(--purple); font-weight: 800; padding: 10px 30px; border-radius: 999px; font-size: clamp(24px, 3vw, 46px); box-shadow: var(--shadow); border: 5px solid var(--yellow); animation: toastIn 1.8s forwards; }
.toast.bad { color: var(--orange-d); border-color: var(--orange); }
#fx-layer { position: absolute; inset: 0; z-index: 80; pointer-events: none; }
.fly-coin { position: absolute; font-size: 34px; transition: transform .8s cubic-bezier(.5,-0.3,.6,1), opacity .8s; }

/* ---------- Carga ---------- */
#loading { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #7B4DFF, #2B1B5A); color: #fff; text-align: center; transition: opacity .6s; }
#loading h1 { margin: 6px 0; font-size: clamp(30px, 4vw, 60px); }
#loading p { margin: 0 0 12px; font-weight: 700; }
.load-wand { font-size: 70px; animation: wand 1s infinite alternate; }
.load-bar { width: 280px; height: 16px; border-radius: 10px; background: rgba(255,255,255,.25); overflow: hidden; margin: 0 auto; }
.load-bar i { display: block; height: 100%; width: 40%; background: var(--yellow); border-radius: 10px; animation: loadbar 1.2s infinite; }

/* ---------- Adaptación a pantallas ---------- */
@media (max-width: 1100px) {
  #topbar .chip-btn span { display: none; }
  .map-worlds { grid-template-columns: 1fr; overflow: auto; }
  .path { min-height: 170px; }
  .prog-grid { grid-template-columns: 1fr; }
  .prac-panel { width: 92vw; right: 4vw; }
}
@media (max-height: 700px) {
  .question { top: 128px; }
  .btn.big { min-height: 64px; }
  .teacher .stage { height: 34vh; }
}
@media (max-width: 700px) {
  .tb-stats .lvl { display: none; }
  .res-grid, .big-stats { grid-template-columns: repeat(2, 1fr); }
  .answer-bar .btn { min-width: 80px; font-size: 1.3em; }
}

/* ---------- añadidos: arranque, botón JUGAR y exposición ---------- */
#loading.done { opacity: 0; pointer-events: none; }
.pulse-btn { animation: glow 1.8s ease-in-out infinite; }
#scr-start .play .btn.big { font-size: clamp(26px, 3vw, 46px); padding: 18px 54px; }
.expo-parts { position: absolute; top: 64px; right: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.expo-parts .btn { padding: 6px 14px; font-size: .8em; }
.expo-parts .btn.cur { outline: 4px solid var(--yellow); }
.portal-card { min-width: 0; width: clamp(170px, 17vw, 270px); padding: 8px 12px 10px; }
.portal-card h3 { font-size: clamp(18px, 1.9vw, 32px); }

.expo-panel { padding: 12px 22px; }
.expo-panel h2 { font-size: clamp(22px, 2.4vw, 40px); }
.expo-panel .txt { font-size: clamp(17px, 1.7vw, 28px); }
.expo-panel .row { flex-wrap: nowrap; align-items: center; margin-top: 8px; }
.expo-panel .row .btn { padding: 8px 14px; font-size: clamp(13px, 1.15vw, 18px); white-space: nowrap; }
@media (max-width: 900px) { .expo-panel .row { flex-wrap: wrap; justify-content: center; } }

.voice-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-weight: 800; }
.voice-pick select { font: inherit; font-size: .85em; padding: 6px 10px; border-radius: 14px; border: 3px solid #DDD5F5; max-width: 100%; background: #fff; color: var(--ink); pointer-events: auto; }
