/* Misión Miami — estilo "Art Deco de Ocean Drive": teal profundo, flamenco, sol. */
@font-face { font-family: "Bungee"; src: url(fonts/bungee.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bricolage.woff2) format("woff2-variations"), url(fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  --ocean: #0B6E78;
  --ocean-deep: #08525A;
  --lagoon: #19B3B1;
  --flamingo: #FF4D8D;
  --flamingo-dark: #D9306F;
  --sun: #FFC93C;
  --coral: #FF7A59;
  --violet: #6C4CF5;
  --ink: #1B1F3B;
  --ink-soft: #4A4F6E;
  --foam: #E8F6F3;
  --paper: #FFFFFF;
  --line: #CDE6E1;
  --ok: #12A36E;
  --display: "Bungee", "Arial Black", sans-serif;
  --text: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --gutter: 16px;
  --shadow: 0 2px 0 rgba(27, 31, 59, .12), 0 10px 24px -14px rgba(11, 110, 120, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--foam);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.5;
  font-optical-sizing: auto;
  min-height: 100dvh;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
a { color: var(--ocean); }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
.stack > * + * { margin-top: 16px; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px;
  background: var(--flamingo); color: #fff;
  font-weight: 800; font-size: 17px; letter-spacing: .01em;
  box-shadow: 0 3px 0 var(--flamingo-dark);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--flamingo-dark); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.ghost:active { box-shadow: inset 0 0 0 2px var(--ink); }
.btn.sun { background: var(--sun); color: var(--ink); box-shadow: 0 3px 0 #D9A41F; }
.btn.ocean { background: var(--ocean); box-shadow: 0 3px 0 var(--ocean-deep); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 15px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 999px; background: var(--foam); color: var(--ink);
  font-weight: 600; font-size: 14px;
}
.icon-btn:hover { background: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }
.link-btn { border: 0; background: none; padding: 6px 0; color: var(--ocean); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Tarjetas y formularios ---------- */
.card { background: var(--paper); border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow); }
.field { display: block; }
.field span { display: block; font-weight: 700; margin-bottom: 6px; }
.field small { display: block; color: var(--ink-soft); margin-top: 6px; font-size: 14px; }
.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff;
}
.input:focus { border-color: var(--ocean); outline: none; }
textarea.input { min-height: 110px; resize: vertical; }
.error { background: #FFE3EC; color: #9B1546; padding: 12px 14px; border-radius: var(--r-sm); font-weight: 600; }

/* ---------- Portada (login / setup) ---------- */
.gate { min-height: 100dvh; background: var(--ocean); color: #fff; display: flex; align-items: center; padding: 32px 0; position: relative; overflow: hidden; }
.gate::before {
  content: ""; position: absolute; left: 50%; bottom: -55vmin; width: 130vmin; height: 130vmin; transform: translateX(-50%);
  background: repeating-conic-gradient(from 0deg, rgba(255,201,60,.16) 0 6deg, transparent 6deg 15deg);
  border-radius: 50%; pointer-events: none;
}
.gate .wrap { position: relative; width: 100%; max-width: 480px; }
.logo { font-family: var(--display); font-size: clamp(44px, 12vw, 72px); line-height: .92; color: var(--sun); text-shadow: 4px 4px 0 var(--flamingo); }
.logo small { display: block; font-family: var(--text); font-weight: 600; font-size: 18px; color: #fff; text-shadow: none; margin-top: 14px; line-height: 1.4; }
.gate .card { color: var(--ink); margin-top: 28px; }

/* ---------- Encabezado del juego ---------- */
.top { background: var(--ocean); color: #fff; padding: 18px 0 26px; position: relative; overflow: hidden; }
.top::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,201,60,.18) 0 7deg, transparent 7deg 16deg);
  pointer-events: none;
}
.top .wrap { position: relative; z-index: 1; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { font-weight: 600; opacity: .9; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 15px; }
.chip svg { width: 16px; height: 16px; }
.chip.hot { background: var(--sun); color: var(--ink); }
.rank { font-family: var(--display); font-size: clamp(30px, 8vw, 46px); line-height: 1; color: var(--sun); margin-top: 18px; text-shadow: 3px 3px 0 var(--flamingo); }
.levelbar { margin-top: 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-weight: 800; }
.bar { height: 14px; background: rgba(255,255,255,.18); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--flamingo)); border-radius: inherit; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.band { font-family: var(--display); font-size: 18px; }

.notice { background: var(--sun); color: var(--ink); border-radius: var(--r-md); padding: 12px 16px; font-weight: 700; margin-top: 16px; }

/* ---------- Tu día ---------- */
.today { margin-top: -14px; position: relative; z-index: 2; }
.today h2 { font-size: 20px; font-weight: 800; }
.steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--foam); }
.step .n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--display); font-size: 15px; }
.step.done .n { background: var(--ok); }
.step b { display: block; }
.step span { font-size: 14px; color: var(--ink-soft); }

/* ---------- Pases de abordar (temporadas) ---------- */
.seasons { display: grid; gap: 22px; margin: 26px 0; }
.pass {
  position: relative; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow);
  overflow: hidden; --c: var(--flamingo);
}
.pass-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 18px 20px 16px; border-bottom: 2px dashed var(--line); position: relative; }
.pass-head::before, .pass-head::after {
  content: ""; position: absolute; bottom: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--foam);
}
.pass-head::before { left: -11px; }
.pass-head::after { right: -11px; }
.pass-code { font-family: var(--display); font-size: 46px; line-height: .9; color: var(--c); }
.pass-name { font-weight: 800; font-size: 20px; margin-top: 8px; }
.pass-blurb { color: var(--ink-soft); font-size: 15px; margin-top: 4px; max-width: 46ch; }
.pass-meta { text-align: right; font-weight: 700; font-size: 14px; color: var(--ink-soft); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pass-meta .cefr { background: var(--c); color: #fff; border-radius: 999px; padding: 2px 12px; font-family: var(--display); font-size: 14px; }
.pass[data-light] .pass-meta .cefr { color: var(--ink); }
.pass-plane { width: 34px; height: 34px; color: var(--c); }
.pass.locked { filter: grayscale(1); opacity: .62; }
.pass.locked .stamps { pointer-events: none; }

.stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; padding: 20px 14px 18px; }
.stamps.single { grid-template-columns: 1fr; justify-items: center; }
.stamp { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--ink); }
.stamp .seal {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  border: 3px dashed var(--c); color: var(--c); font-family: var(--display); font-size: 22px;
  transform: rotate(-8deg); transition: transform .15s ease;
  background: #fff;
}
.stamp:nth-child(even) .seal { transform: rotate(7deg); }
.stamp:hover .seal { transform: rotate(0) scale(1.06); }
.stamp .t { font-size: 13px; font-weight: 700; line-height: 1.2; max-width: 11ch; }
.stamp .stars { font-size: 12px; letter-spacing: 1px; color: var(--sun); height: 14px; -webkit-text-stroke: .4px #B8860B; }
.stamp.cleared .seal { background: var(--c); color: #fff; border-style: solid; }
.pass[data-light] .stamp.cleared .seal { color: var(--ink); }
.stamp.next .seal { border-style: solid; box-shadow: 0 0 0 0 var(--c); animation: ping 1.8s infinite; }
.stamp.locked { opacity: .45; cursor: not-allowed; }
.stamp.locked .seal { border-color: #9AA3B5; color: #9AA3B5; }
.stamp.locked .seal svg { width: 22px; height: 22px; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 70% { box-shadow: 0 0 0 14px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.extras { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 40px; }
.extra { text-align: left; border: 0; background: var(--paper); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow); color: var(--ink); }
.extra b { display: block; font-size: 18px; }
.extra span { display: block; font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.extra.wide { grid-column: 1 / -1; background: var(--ink); color: #fff; }
.extra.wide span { color: rgba(255,255,255,.75); }
.extra.wide b { color: var(--sun); }

/* ---------- Barra superior de pantallas internas ---------- */
.bar-top { position: sticky; top: 0; z-index: 10; background: var(--paper); box-shadow: 0 1px 0 var(--line); }
.bar-top .wrap { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.bar-top h1 { font-size: 18px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { border: 0; background: var(--foam); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.back svg { width: 20px; height: 20px; }

/* ---------- Briefing ---------- */
.brief { padding-top: 22px; padding-bottom: 40px; }
.postcard { background: var(--paper); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.postcard-top { background: var(--c, var(--ocean)); color: #fff; padding: 22px 20px; position: relative; overflow: hidden; }
.postcard-top::after {
  content: ""; position: absolute; right: -60px; bottom: -110px; width: 240px; height: 240px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.18) 0 7deg, transparent 7deg 16deg);
}
.postcard-top[data-light] { color: var(--ink); }
.postcard-top .place { font-weight: 700; opacity: .9; font-size: 15px; position: relative; }
.postcard-top h2 { font-family: var(--display); font-size: clamp(28px, 7vw, 40px); line-height: 1; margin-top: 8px; position: relative; }
.postcard-body { padding: 20px; }
.who { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--ocean)); color: #fff; font-family: var(--display); font-size: 18px; flex: none; }
.avatar[data-light] { color: var(--ink); }
.avatar { line-height: 1; }
.who b { display: block; font-size: 18px; }
.who > div > span { color: var(--ink-soft); font-size: 15px; }
.section-title { font-weight: 800; font-size: 17px; margin-bottom: 10px; }
.goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.goals li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.goals li i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-top: 2px; display: grid; place-items: center; }
.goals li.ok i { background: var(--ok); border-color: var(--ok); color: #fff; }
.goals li.ok i svg { width: 14px; height: 14px; }
.phrases { display: grid; gap: 10px; }
.phrase { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 12px 14px; background: var(--foam); border-radius: var(--r-sm); }
.phrase b { display: block; font-weight: 700; }
.phrase span { font-size: 14px; color: var(--ink-soft); }
.loading-line { height: 54px; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--foam) 0%, #fff 50%, var(--foam) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Partida ---------- */
.play { display: flex; flex-direction: column; height: 100dvh; }
.play .bar-top { position: static; flex: none; }
.who-mini { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.who-mini .avatar { width: 40px; height: 40px; font-size: 14px; }
.who-mini b { display: block; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-mini > div > span { display: block; font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goalbar { flex: none; background: var(--paper); border-bottom: 1px solid var(--line); }
.goalbar .wrap { padding-top: 8px; padding-bottom: 10px; }
.goalbar summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 8px; }
.goalbar summary::-webkit-details-marker { display: none; }
.goalbar .goals { margin-top: 10px; font-size: 15px; }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 18px; height: 6px; border-radius: 3px; background: var(--line); }
.pips i.ok { background: var(--ok); }

.chat { flex: 1; overflow-y: auto; padding: 18px 0 12px; scroll-behavior: smooth; }
.chat .wrap { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; }
.msg.char { align-self: flex-start; }
.msg.me { align-self: flex-end; }
.bubble { padding: 14px 16px; border-radius: 20px; font-size: 19px; line-height: 1.4; }
.msg.char .bubble { background: var(--paper); border-left: 5px solid var(--c, var(--ocean)); border-top-left-radius: 6px; box-shadow: var(--shadow); }
.msg.me .bubble { background: var(--ink); color: #fff; border-top-right-radius: 6px; }
.msg .es { margin-top: 8px; font-size: 15px; color: var(--ink-soft); font-style: italic; }
.msg.listen .en-text { filter: blur(6px); user-select: none; }
.msg-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.fix { margin-top: 8px; background: #FFF4D1; border-radius: 14px; padding: 10px 12px; font-size: 15px; color: var(--ink); }
.fix b { display: block; font-size: 16px; }
.fix .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.typing { display: inline-flex; gap: 5px; padding: 16px 18px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.goal-pop { align-self: center; background: var(--ok); color: #fff; font-weight: 700; font-size: 14px; border-radius: 999px; padding: 6px 14px; display: inline-flex; align-items: center; gap: 6px; }
.goal-pop svg { width: 16px; height: 16px; }
.done-banner { align-self: stretch; background: var(--sun); border-radius: var(--r-md); padding: 16px; text-align: center; }
.done-banner b { display: block; font-family: var(--display); font-size: 22px; margin-bottom: 10px; }

.dock { flex: none; background: var(--paper); box-shadow: 0 -1px 0 var(--line); padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); }
.dock .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.dock .left { justify-self: start; }
.dock .right { justify-self: end; }
.dock-status { grid-column: 1 / -1; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink-soft); min-height: 20px; }
.mic {
  width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--flamingo); color: #fff;
  display: grid; place-items: center; box-shadow: 0 4px 0 var(--flamingo-dark); position: relative;
  transition: transform .08s ease, background .15s;
}
.mic svg { width: 36px; height: 36px; position: relative; z-index: 1; }
.mic:active { transform: translateY(2px); }
.mic.rec { background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 #D9A41F; }
.mic.rec::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 4px solid var(--sun); opacity: .6; transform: scale(var(--lvl, 1)); transition: transform .08s linear; }
.mic[disabled] { opacity: .45; cursor: not-allowed; }
.typebox { display: grid; grid-template-columns: 1fr auto; gap: 8px; grid-column: 1 / -1; }

/* ---------- Hoja inferior (ayuda / confirmaciones) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(27,31,59,.5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 620px; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom)); max-height: 90dvh; overflow-y: auto; animation: up .2s ease; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: var(--r-lg); } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet h3 { font-size: 21px; font-weight: 800; }
.answer { background: var(--foam); border-radius: var(--r-md); padding: 16px; }
.answer .big { font-size: 22px; font-weight: 800; line-height: 1.3; }

/* ---------- Resultados ---------- */
.results { padding-top: 26px; padding-bottom: 48px; }
.medal { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 26px 20px; text-align: center; position: relative; overflow: hidden; }
.medal::before { content: ""; position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; transform: translate(-50%, -50%); border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,77,141,.10) 0 6deg, transparent 6deg 15deg); }
.medal > * { position: relative; }
.medal h2 { font-family: var(--display); font-size: clamp(28px, 7vw, 40px); color: var(--sun); line-height: 1; }
.big-stars { display: flex; justify-content: center; gap: 10px; margin: 18px 0 8px; }
.big-stars svg { width: 58px; height: 58px; color: rgba(255,255,255,.18); }
.big-stars svg.on { color: var(--sun); animation: stamp .45s cubic-bezier(.2,1.6,.4,1) both; }
.big-stars svg.on:nth-child(2) { animation-delay: .25s; }
.big-stars svg.on:nth-child(3) { animation-delay: .5s; }
@keyframes stamp { from { transform: scale(2.4) rotate(-20deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.xp-pill { display: inline-block; background: var(--flamingo); color: #fff; font-family: var(--display); font-size: 20px; border-radius: 999px; padding: 6px 18px; margin-top: 6px; }
.lvl-card .levelbar { color: var(--ink); }
.lvl-card .bar { background: var(--foam); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li { background: var(--foam); border-radius: var(--r-sm); padding: 12px 14px; }
.said { text-decoration: line-through; text-decoration-color: var(--flamingo); color: var(--ink-soft); }
.better { font-weight: 800; font-size: 18px; }

/* ---------- Revancha ---------- */
.review { padding-top: 22px; padding-bottom: 40px; }
.flash { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 30px 22px; text-align: center; min-height: 260px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.flash .prompt { font-size: clamp(24px, 6vw, 32px); font-weight: 800; line-height: 1.25; }
.flash .heard { font-size: 18px; }
.flash .target { font-size: 22px; font-weight: 800; color: var(--ocean); }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grade { border: 0; border-radius: var(--r-md); padding: 14px 8px; font-weight: 800; color: #fff; min-height: 64px; }
.grade small { display: block; font-weight: 600; font-size: 12px; opacity: .9; }
.grade.bad { background: var(--flamingo); }
.grade.meh { background: var(--sun); color: var(--ink); }
.grade.good { background: var(--ok); }
.grade.suggested { outline: 4px solid var(--ink); outline-offset: 2px; }
.progress-thin { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-thin i { display: block; height: 100%; background: var(--ocean); transition: width .3s; }

/* ---------- Estadísticas ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { background: var(--paper); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow); }
.tile b { display: block; font-family: var(--display); font-size: 28px; line-height: 1.1; color: var(--ocean); }
.tile span { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 120px; }
.days div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.days i { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--lagoon); min-height: 4px; }
.days i.zero { background: var(--line); }
.days small { font-size: 11px; color: var(--ink-soft); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.suggest button:hover { border-color: var(--ocean); }

/* ---------- Toast y carga ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); visibility: hidden; opacity: 0; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; z-index: 100; transition: transform .25s ease; max-width: calc(100% - 32px); text-align: center; }
#toast.show { transform: translate(-50%, 0); visibility: visible; opacity: 1; }
.center-load { min-height: 70dvh; display: grid; place-items: center; text-align: center; padding: 20px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--flamingo); animation: spin .8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 420px) {
  body { font-size: 16px; }
  .stamps { gap: 12px 4px; padding: 18px 8px 16px; }
  .stamp .seal { width: 56px; height: 56px; font-size: 19px; }
  .pass-code { font-size: 38px; }
  .bubble { font-size: 18px; }
  .extras { grid-template-columns: 1fr; }
  .play .bar-top .icon-btn span { display: none; }
  .play .bar-top .btn.small { padding: 0 12px; }
  .who-mini .avatar { width: 34px; height: 34px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =================================================================
   Versión 2: mundo caminable, HUD, historia, tienda, recompensas
   ================================================================= */
body.in-world { overflow: hidden; }
.world { position: fixed; inset: 0; background: #1E8FC0; overflow: hidden; user-select: none; -webkit-user-select: none; }
.stage { position: absolute; inset: 0; }
.world-canvas { display: block; image-rendering: pixelated; touch-action: none; outline: none; cursor: pointer; }

.hud-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px var(--gutter) 0; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-rank { display: flex; align-items: center; gap: 10px; border: 0; background: rgba(27,31,59,.88); color: #fff; padding: 6px 14px 6px 6px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,.25); min-width: 0; }
.hud-band { width: 40px; height: 40px; border-radius: 50%; background: var(--sun); color: var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: 15px; flex: none; }
.hud-rank-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; text-align: left; }
.hud-rank-txt b { font-size: 14px; line-height: 1; white-space: nowrap; }
.hud-bar { width: 110px; height: 7px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; }
.hud-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--flamingo)); }
.hud-right { display: flex; gap: 8px; align-items: center; }
.hud-chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(27,31,59,.88); color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.hud-chip svg { width: 17px; height: 17px; }
.hud-chip.hot { background: var(--sun); color: var(--ink); }
.hud-chip.icon { width: 40px; padding: 0; justify-content: center; font-size: 18px; }
.coin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFF3B0 0 18%, #FFC93C 20% 62%, #D99A12 64%); box-shadow: inset 0 0 0 2px #B9800C; flex: none; }
.coin.big { width: 26px; height: 26px; }

.objective { position: absolute; top: 64px; left: var(--gutter); max-width: min(440px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.95); border-radius: var(--r-md); padding: 10px 10px 10px 14px; box-shadow: 0 4px 0 rgba(27,31,59,.18); border-left: 6px solid var(--sun); }
.obj-txt { display: flex; flex-direction: column; min-width: 0; }
.obj-kicker { font-size: 12px; font-weight: 800; color: var(--flamingo-dark); }
.obj-txt b { font-size: 15px; line-height: 1.25; }
.obj-where { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

.zone-banner { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); pointer-events: none; opacity: 0; text-align: center; }
.zone-banner b { display: block; font-family: var(--display); font-size: clamp(30px, 7vw, 56px); color: var(--sun); text-shadow: 4px 4px 0 var(--flamingo), 0 0 30px rgba(0,0,0,.35); white-space: nowrap; }
.zone-banner.show { animation: zone 2.4s ease forwards; }
@keyframes zone { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.9); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -10px); } }

.hud-action { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); }
.action-btn { min-height: 54px; font-size: 17px; padding: 0 22px; box-shadow: 0 4px 0 var(--flamingo-dark), 0 10px 24px rgba(0,0,0,.25); animation: pop .25s ease; white-space: nowrap; }
.action-btn kbd, .hud-hint kbd { font-family: var(--display); font-size: 12px; background: rgba(255,255,255,.25); border-radius: 6px; padding: 2px 7px; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }

.hud-bottom { position: absolute; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; background: rgba(27,31,59,.9); padding: 6px; border-radius: 22px; box-shadow: 0 4px 0 rgba(0,0,0,.25); max-width: calc(100% - 20px); }
.hud-bottom button { white-space: nowrap; position: relative; border: 0; background: transparent; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; border-radius: 16px; font-size: 12px; font-weight: 700; min-width: 62px; }
.hud-bottom button:hover { background: rgba(255,255,255,.12); }
.hud-bottom .ico { font-size: 22px; line-height: 1; }
.hud-bottom .dot { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--flamingo); font-size: 11px; display: grid; place-items: center; padding: 0 4px; }
.hud-hint { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); color: #fff; font-size: 13px; font-weight: 700; background: rgba(27,31,59,.7); padding: 6px 12px; border-radius: 999px; white-space: nowrap; transition: opacity .4s; pointer-events: none; }
.hud-hint.gone { opacity: 0; }
.hud-action:not(:empty) ~ .hud-hint { opacity: 0; }
@media (max-width: 600px) {
  .hud-bar { width: 70px; }
  .hud-rank-txt b { font-size: 12px; }
  .hud-chip { height: 36px; padding: 0 10px; font-size: 14px; }
  .hud-chip.icon { width: 36px; }
  .hud-band { width: 34px; height: 34px; font-size: 13px; }
  .objective { top: 58px; }
  .hud-bottom button { min-width: 0; padding: 6px 7px; font-size: 11px; }
  .hud-hint { display: none; }
  .hud-action { bottom: 92px; }
}

.fade { position: fixed; inset: 0; background: #1B1F3B; z-index: 80; animation: fadein .35s ease forwards; }
.fade.out { animation: fadeout .4s ease forwards; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }

/* Intro de la historia */
.intro { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: var(--gutter); background: radial-gradient(circle at 50% 120%, var(--flamingo) 0, transparent 55%), linear-gradient(180deg, #0B6E78, #1B1F3B); }
.intro::before { content: ""; position: absolute; left: 50%; bottom: -40vmin; width: 120vmin; height: 120vmin; transform: translateX(-50%); border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,201,60,.14) 0 6deg, transparent 6deg 15deg); }
.intro-card { position: relative; max-width: 520px; text-align: center; color: #fff; animation: pop .3s ease; }
.intro-card h2 { font-family: var(--display); font-size: clamp(34px, 9vw, 58px); color: var(--sun); text-shadow: 4px 4px 0 var(--flamingo); line-height: 1; margin-bottom: 18px; }
.intro-card p { font-size: 20px; line-height: 1.5; margin-bottom: 26px; }
.intro-step { font-weight: 800; opacity: .7; font-size: 14px !important; margin-bottom: 10px !important; }
.link-btn.light { color: #fff; display: block; margin: 14px auto 0; }

/* Menús en hoja */
.menu-list { display: grid; gap: 8px; }
.menu-item { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; border: 0; background: var(--foam); border-radius: var(--r-md); padding: 12px 14px; color: var(--ink); text-decoration: none; font: inherit; }
.menu-item > span { font-size: 24px; width: 32px; text-align: center; flex: none; }
.menu-item b { display: block; }
.menu-item small { display: block; color: var(--ink-soft); font-size: 13px; }
.menu-item:not(.static):not([disabled]):hover { background: var(--line); }
.menu-item[disabled] { opacity: .55; cursor: default; }

/* Ficha de misión */
.msheet-top { margin: -22px calc(-1 * var(--gutter)) 0; padding: 22px var(--gutter) 20px; color: #fff; border-radius: var(--r-lg) var(--r-lg) 0 0; position: relative; overflow: hidden; }
.msheet-top::after { content: ""; position: absolute; right: -60px; bottom: -120px; width: 240px; height: 240px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.18) 0 7deg, transparent 7deg 16deg); }
.msheet-top[data-light] { color: var(--ink); }
.msheet-top h3 { font-family: var(--display); font-size: clamp(28px, 7vw, 38px); font-weight: 400; line-height: 1; margin: 6px 0; position: relative; }
.msheet-season, .msheet-place { font-weight: 700; font-size: 14px; opacity: .92; position: relative; }
.avatar-px { width: 56px; height: 56px; image-rendering: pixelated; background: var(--foam); border-radius: 50%; flex: none; }
.stars-mini { margin-left: auto; color: var(--sun); font-size: 20px; -webkit-text-stroke: .6px #B8860B; }
.prize { display: flex; align-items: center; gap: 14px; background: linear-gradient(90deg, #FFF4D1, #FFE3EC); border-radius: var(--r-md); padding: 12px 14px; }
.prize-ico { font-size: 34px; }
.prize b { display: block; }
.prize small { display: block; color: var(--ink-soft); font-size: 13px; }
.btn.big { min-height: 56px; font-size: 19px; }
.bubble-say { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--paper); border: 2px solid var(--line); border-left: 5px solid var(--lagoon); border-radius: 16px; padding: 12px 14px; font-size: 19px; }
.answer-row { display: flex; align-items: center; gap: 14px; }
.answer-row .mic { width: 64px; height: 64px; }
.ok-line { font-weight: 800; color: var(--ok); }
.reward-box { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 10px 0; }
.reward-box b { font-family: var(--display); font-size: 22px; font-weight: 400; }

/* Calentamiento y repetir frases */
.warm-intro { background: var(--paper); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow); }
.shadow-card { display: grid; gap: 12px; text-align: center; }
.row-center { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.score { display: grid; gap: 4px; justify-items: center; animation: pop .25s ease; }
.score-stars { font-size: 34px; letter-spacing: 4px; color: #D5DCE6; }
.score-stars .on { color: var(--sun); text-shadow: 0 2px 0 #D9A41F; }
.score-3 b { color: var(--ok); }

/* Ideas para responder */
.ideas { align-self: stretch; background: rgba(255,255,255,.7); border: 2px dashed var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.ideas-label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.ideas-label small { font-weight: 600; color: var(--ink-soft); }
.ideas-list { display: grid; gap: 8px; }
.idea { text-align: left; border: 0; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 2px 0 var(--line); }
.idea b { display: block; font-size: 17px; }
.idea small { display: none; color: var(--ink-soft); }
.idea.open small { display: block; }
.combo { display: none; font-weight: 800; font-size: 14px; background: var(--sun); color: var(--ink); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.combo.on { display: inline-block; animation: pop .25s ease; }

/* Recompensas */
.reward-pills { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.money-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--sun); color: var(--ink); }
.popup { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: var(--gutter); background: rgba(27,31,59,.72); }
.popup-card { position: relative; background: var(--paper); border-radius: var(--r-lg); padding: 26px 22px; max-width: 380px; width: 100%; text-align: center; display: grid; gap: 10px; justify-items: center; animation: pop .3s cubic-bezier(.2,1.6,.4,1); overflow: hidden; }
.popup-card h2 { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; }
.popup-kicker { font-weight: 800; font-size: 13px; color: var(--flamingo-dark); }
.item-card::before { content: ""; position: absolute; left: 50%; top: 90px; width: 360px; height: 360px; transform: translate(-50%, -50%); border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255,201,60,.25) 0 8deg, transparent 8deg 18deg); animation: spin 12s linear infinite; z-index: 0; }
.item-card > * { position: relative; z-index: 1; }
.item-big { font-size: 84px; line-height: 1.1; filter: drop-shadow(0 6px 0 rgba(0,0,0,.12)); animation: stamp .5s cubic-bezier(.2,1.6,.4,1) both; }
.chest { border: 0; background: none; font-size: 96px; line-height: 1; cursor: pointer; animation: wiggle 1s ease-in-out infinite; }
.chest.opened { animation: stamp .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.big-money { font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--ok); }
.float-text { position: fixed; z-index: 99; transform: translateX(-50%); font-family: var(--display); font-size: 22px; color: var(--sun); text-shadow: 2px 2px 0 var(--ink); pointer-events: none; animation: floatup 1.3s ease forwards; }
@keyframes floatup { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 50px); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 98; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(var(--r, 360deg)); } }

/* Mi plan */
.plan-hero { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 20px; position: relative; overflow: hidden; }
.plan-hero h2 { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 5vw, 30px); line-height: 1.1; color: var(--sun); margin: 6px 0 14px; }
.plan-hero .popup-kicker { color: #FF8FB8; }
.bar.big { height: 14px; background: rgba(255,255,255,.15); }
.card .bar.big, .passport .bar.big { background: var(--foam); }
.chapter { background: var(--paper); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); border-top: 8px solid var(--c); }
.chapter.locked { opacity: .6; filter: grayscale(.6); }
.chapter-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.chapter-n { font-family: var(--display); color: var(--c); font-size: 15px; }
.chapter-head h2 { font-size: 22px; font-weight: 800; }
.chapter-state { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.chapter-goal { font-weight: 800; margin: 6px 0 2px; }
.items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.item { background: var(--foam); border-radius: 14px; padding: 10px 6px; text-align: center; display: grid; gap: 4px; justify-items: center; }
.item span { font-size: 28px; line-height: 1.1; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #B8C2D0; font-family: var(--display); font-size: 20px; }
.item.got span { font-size: 28px; background: #FFF4D1; box-shadow: 0 0 0 3px var(--sun); }
.item small { font-size: 11px; font-weight: 700; line-height: 1.2; color: var(--ink-soft); }
.item.got small { color: var(--ink); }

/* Pasaporte */
.passport { background: linear-gradient(135deg, #22305A, #1B1F3B); color: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.passport-top { display: flex; justify-content: space-between; padding: 10px 18px; background: rgba(255,255,255,.08); font-family: var(--display); font-size: 12px; color: var(--sun); letter-spacing: .05em; }
.passport-body { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 18px; align-items: center; }
.passport-photo { width: 104px; height: 104px; border-radius: 14px; background: #E8F6F3; display: grid; place-items: center; border: 3px solid var(--sun); }
.passport-photo canvas { width: 96px; height: 96px; image-rendering: pixelated; }
.passport-band { font-family: var(--display); font-size: 54px; line-height: 1; color: var(--sun); text-shadow: 3px 3px 0 var(--flamingo); }
.passport .popup-kicker { color: #FF8FB8; }
.passport .bar.big { margin-top: 10px; background: rgba(255,255,255,.15); }
.ladder { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ladder li { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--foam); opacity: .75; }
.ladder li.past { opacity: 1; }
.ladder li.here { opacity: 1; background: #FFF4D1; box-shadow: inset 0 0 0 3px var(--sun); }
.ladder-band { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-family: var(--display); }
.ladder li.here .ladder-band { background: var(--flamingo); }
.ladder li.past .ladder-band { background: var(--ok); }
.skill-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.skill-list li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--foam); border-radius: 12px; font-weight: 600; color: var(--ink-soft); }
.skill-list li.got { color: var(--ink); background: #E3F8EE; }
.skill-list li span { font-size: 20px; }

/* Tienda */
.shop-hero { display: flex; align-items: center; gap: 18px; background: var(--paper); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.shop-hero canvas { width: 120px; height: 120px; image-rendering: pixelated; background: linear-gradient(180deg, #A7DBFF, #E8F6F3); border-radius: 18px; flex: none; }
.wallet { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 40px; line-height: 1; margin: 4px 0 8px; }
.tabs { display: flex; gap: 8px; }
.tabs a { flex: 1; text-align: center; padding: 12px; border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 800; text-decoration: none; box-shadow: var(--shadow); }
.tabs a.on { background: var(--ink); color: #fff; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-item { background: var(--paper); border-radius: var(--r-md); padding: 14px; display: grid; gap: 8px; justify-items: center; text-align: center; box-shadow: var(--shadow); }
.shop-item.eq { box-shadow: inset 0 0 0 3px var(--ok), var(--shadow); }
.shop-item canvas { width: 72px; height: 72px; image-rendering: pixelated; background: var(--foam); border-radius: 14px; }
.shop-ico { font-size: 44px; }
.shop-item .btn { gap: 6px; }
.tag { font-size: 13px; font-weight: 800; background: var(--foam); padding: 6px 12px; border-radius: 999px; }

.who-mini .avatar-px { width: 40px; height: 40px; }
