:root {
  --bg: #f5faf8;
  --bg-2: #edf8f5;
  --panel: #fff;
  --ink: #133c3c;
  --muted: #5a7574;
  --purple: #087f76;
  --purple-dark: #066c65;
  --pink: #e47581;
  --yellow: #f4b34e;
  --cyan: #14b8a6;
  --green: #27a96f;
  --orange: #ff914d;
  --red: #ef5b68;
  --line: #d8e9e6;
  --shadow: 0 14px 32px #194d4615;
  --display: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; height: 100dvh; overflow: hidden; }
body { margin: 0; color: var(--ink); font: 15px Inter, system-ui, sans-serif; background: radial-gradient(circle at 8% 16%, #bdeee12b 0 16%, transparent 31%), radial-gradient(circle at 92% 86%, #e4d5f22d 0 17%, transparent 32%), linear-gradient(145deg, var(--bg), var(--bg-2)); }
button, select { font: inherit; } button { cursor: pointer; } button:disabled { opacity: .45; cursor: not-allowed; } [hidden] { display: none !important; }
h1, h2, h3, .brand, .cta { font-family: var(--display); } :focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; left: 14px; top: 10px; transform: translateY(-150%); padding: 10px 15px; border-radius: 10px; background: #fff; color: var(--ink); font-weight: 800; }
.skip-link:focus { transform: none; }
.shell { width: 100%; max-width: 1460px; height: 100%; margin: auto; padding: 0 clamp(14px, 2.4vw, 36px); display: grid; grid-template-rows: 70px minmax(0, 1fr); }
main, .page { min-height: 0; height: 100%; } footer { display: none; }

/* Cabecera */
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink); }
.brand { display: flex; align-items: center; gap: 11px; }
.brandmark { display: grid; place-items: center; width: 43px; height: 43px; border: 2px solid #8dd7ca; border-radius: 50%; background: #f1fcf9; color: #087f76; font-size: 28px; line-height: 1; font-weight: 900; box-shadow: 0 5px 14px #194d4618; }
.brand strong { display: block; font-size: 18px; letter-spacing: .3px; }.brand small { display: block; margin-top: 3px; color: var(--muted); font: 10px Inter, system-ui; }
.topnav { display: flex; align-items: center; gap: 8px; }.badge { padding: 8px 12px; border-radius: 99px; background: #e0f7f2; color: #08776c; font-size: 11px; font-weight: 800; white-space: nowrap; }
.topnav .badge { border: 1px solid #d5e9e4; background: #e0f7f2; color: #08776c; }.topnav .best-badge { background: #fff2dd; color: #8f550c; }
.ghost { padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; background: #ffffffa8; color: var(--ink); font-weight: 800; }.ghost:hover { background: #e0f7f2; }.ghost.solid { border-color: var(--line); background: #fff; color: var(--ink); }.ghost.solid:hover { background: #eefaf7; border-color: #9dd8ce; }

/* Portada */
#setup { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, .68fr); grid-template-rows: 136px 38px minmax(0, 1fr); gap: 10px 18px; padding-bottom: 16px; }
.hero { position: relative; isolation: isolate; grid-column: 1 / -1; height: 136px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.6fr) .72fr; align-items: center; padding: 17px 34px; border-radius: 24px; color: var(--ink); background: linear-gradient(115deg, #d7f7ef 0%, #e8f8f6 60%, #f4eafb 100%); box-shadow: 0 12px 28px #194d4613; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border: 1px solid #ffffff66; border-radius: 50%; }.hero::before { width: 310px; height: 310px; right: -55px; top: -185px; }.hero::after { width: 190px; height: 190px; right: 170px; bottom: -145px; }
.eyebrow { color: #087f76; font-size: 10px; font-weight: 900; letter-spacing: 1.7px; }.hero .eyebrow { color: #087f76; }.hero .eyebrow span { color: var(--yellow); }
.hero h1 { margin: 3px 0 2px; font-size: clamp(28px, 3vw, 40px); line-height: 1.04; letter-spacing: -1px; }.hero h1 em { color: #0b988c; font-style: normal; }.hero p { margin: 0; color: #456964; font-size: 12px; line-height: 1.4; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }.hero-tags span { padding: 5px 9px; border: 1px solid #ffffffad; border-radius: 99px; background: #ffffffb6; color: var(--ink); font-size: 9px; font-weight: 800; }
.hero-art { position: relative; height: 110px; display: grid; place-items: center; }.hero-circle { position: relative; z-index: 2; width: 100px; height: 100px; padding-bottom: 26px; display: flex; align-items: center; justify-content: center; flex-direction: column; border: 2px solid #ffffff80; border-radius: 28px; transform: rotate(-7deg); background: linear-gradient(145deg, #0b988c, #087f76); color: #fff; box-shadow: 0 14px 28px #087f7638; font: 90px/70px var(--display); }.hero-circle small { position: absolute; bottom: 10px; color: #fff; font-size: 7px; font-weight: 900; letter-spacing: 2px; line-height: 1; }
.float { position: absolute; z-index: 3; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: #fff; color: var(--purple); box-shadow: 0 8px 18px #241d4660; font: 900 21px var(--display); }.f1 { left: 17%; top: 1px; transform: rotate(-12deg); }.f2 { right: 12%; bottom: 1px; color: var(--pink); transform: rotate(10deg); }.f3 { right: 14%; top: 0; color: var(--orange); transform: rotate(8deg); }.spark { position: absolute; color: var(--yellow); font-size: 20px; }.sp1 { left: 28%; bottom: 0; }.sp2 { right: 29%; top: 2px; }
.sectionhead { grid-column: 1; grid-row: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); }.sectionhead h2 { display: inline; margin: 0; font-size: 17px; }.sectionhead span { margin-left: 8px; color: var(--muted); font-size: 10px; }.selection-count { padding: 5px 9px; border: 1px solid #cce8e2; border-radius: 99px; background: #e0f7f2; color: #08776c; font-size: 9px; }

/* Actividades */
.missions { grid-column: 1; grid-row: 3; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 9px; }
.mission { --accent: var(--purple); position: relative; min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 9px; padding: 11px 12px; border: 2px solid transparent; border-radius: 16px; background: #fff; color: var(--ink); text-align: left; box-shadow: 0 8px 22px #07081832; transition: transform .15s, border-color .15s, box-shadow .15s; }
.mission::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent); opacity: .75; }.mission:nth-child(1), .mission:nth-child(2), .mission:nth-child(3), .mission:nth-child(4), .mission:nth-child(5), .mission:nth-child(6) { --accent: #14b8a6; }.mission:nth-child(7) { --accent: #f4b34e; grid-column: span 2; background: linear-gradient(115deg, #0b9189, #087f76); color: #fff; }
.mission:hover { transform: translateY(-2px); box-shadow: 0 12px 25px #194d4620; }.mission.selected { border-color: var(--accent); background-color: #f4fffc; box-shadow: 0 0 0 2px #14b8a626, 0 10px 24px #194d461e; }
.mission .emoji { width: 43px; height: 43px; display: grid; place-items: center; margin: 0; border-radius: 13px; background: #e8f8f4; font-size: 23px; }.mission:nth-child(1) .emoji { background: #e7f5ff; }.mission:nth-child(3) .emoji { background: #fff1e5; }.mission:nth-child(4) .emoji { background: #e9faf2; }.mission:nth-child(5) .emoji { background: #fff0f5; }.mission:nth-child(6) .emoji { background: #e9f9fb; }.mission:nth-child(7) .emoji { background: #ffffff20; }
.mission-copy { min-width: 0; }.mission strong { display: block; padding-right: 12px; font-size: 11px; line-height: 1.25; }.mission p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.25; }.mission:nth-child(7) p { color: #d8f4ef; }
.mission-number { position: absolute; left: 7px; top: 5px; color: #78928f; font-size: 7px; font-weight: 900; letter-spacing: .8px; }.mission:nth-child(7) .mission-number { color: #bfe3dc; }
.mission .tick { position: absolute; z-index: 2; right: 8px; top: 7px; width: 19px; height: 19px; display: grid; place-items: center; border: 2px solid #d9d9e7; border-radius: 50%; background: #fff; color: transparent; font-size: 10px; font-weight: 900; }.mission.selected .tick { border-color: var(--accent); background: var(--accent); color: #fff; }.mission:nth-child(7).selected .tick { color: #352b47; }

/* Configuración */
.settings { grid-column: 2; grid-row: 2 / 4; min-height: 0; height: 100%; margin: 0; padding: 17px; display: flex; flex-direction: column; border: 1px solid #ffffff18; border-radius: 20px; background: #ffffffed; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.settings-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }.settings h2 { margin: 0; font-size: 16px; }.text-button { padding: 0; border: 0; background: none; color: var(--purple-dark); font-size: 9px; font-weight: 900; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 13px 0 10px; }.settings label { color: #56576e; font-size: 9px; font-weight: 900; }.settings select { width: 100%; margin-top: 4px; padding: 9px 8px; border: 1px solid #dedfed; border-radius: 10px; outline-color: var(--purple); background: #f8f8fc; color: var(--ink); font-size: 11px; }
.config-notice { display: flex; align-items: center; gap: 7px; padding: 8px; border-radius: 10px; background: #f0edff; color: #645f80; font-size: 9px; line-height: 1.35; }
.cta { padding: 13px 18px; border: 0; border-radius: 12px; background: linear-gradient(115deg, var(--purple), var(--purple-dark)); color: #fff; font-weight: 900; box-shadow: 0 7px 17px #6045df3e; transition: transform .12s, box-shadow .12s; }.cta:hover { transform: translateY(-1px); box-shadow: 0 10px 22px #6045df50; }.settings > .cta { width: 100%; min-width: 0; margin: auto 0 0; display: flex; align-items: center; justify-content: space-between; font-size: 12px; }.settings > .cta span { color: var(--yellow); font-size: 20px; }

/* Partida */
#play { max-width: 860px; height: 100%; margin: auto; padding: 8px 0 14px; display: flex; flex-direction: column; }.playtop, .progress-info { display: flex; align-items: center; justify-content: space-between; gap: 13px; }.progress-info { color: var(--ink); font-size: 11px; }.progress-info span { color: #087f76; font-weight: 900; }.progress-info .streak { padding: 5px 9px; border-radius: 99px; background: #fff0dc; color: #b65b0c; }
.progress-track { flex: 0 0 auto; height: 9px; margin: 11px 0 13px; overflow: hidden; border-radius: 99px; background: #dfeee9; }.progress-track div { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38c8b3, #087f76); transition: width .3s; }
.play-card { min-height: 0; flex: 1; overflow: hidden; padding: 27px 32px; border: 1px solid #ffffff2b; border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }.question-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.question-meta > span:last-child { color: var(--muted); font-size: 10px; font-weight: 700; }
.play-mission-identity { display: flex; align-items: center; gap: 14px; }
.play-mission-art { width: 104px; height: 88px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 18px; background: radial-gradient(circle, #e1f7f1 0 52%, transparent 74%); }
.play-mission-art img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 6px 7px #194d4620); }
.play-mission-identity .badge { display: inline-block; }
.question-level { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.question-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }.question-heading h2 { margin: 18px 0 5px; font-size: clamp(20px, 3vw, 27px); line-height: 1.25; }.question-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }.listen-button { flex: 0 0 auto; margin-top: 17px; padding: 9px 11px; border: 1px solid #bfe4dd; border-radius: 11px; background: #eefaf7; color: #075f58; font-size: 10px; font-weight: 900; }.listen-button:hover { background: #dbf5ee; }
.wordtext { margin: 18px 0; color: #115d56; text-align: center; font: 900 clamp(30px, 5vw, 43px) var(--display); }.wordbox { margin: 18px 0; padding: 18px 8px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; border-radius: 17px; background: #effaf7; }.letter { min-width: 40px; height: 51px; display: grid; place-items: center; border: 2px solid #d4ebe5; border-radius: 10px; background: #fff; color: var(--ink); font: 900 26px var(--display); }.letter.vowel { border-color: #8ed9cd; color: #0c9d90; }.letter.vowel:hover { background: #c7f4e7; }.letter.chosen { border-color: var(--purple); background: #c5f3df; }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 17px 0; }.opt { position: relative; min-height: 54px; padding: 14px 38px; border: 2px solid #e1eeea; border-radius: 13px; background: #fff; color: var(--ink); font-weight: 900; }.opt .option-key { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: #eff5f3; color: #66807d; font-size: 9px; }.opt:hover:not(:disabled) { border-color: #22b9a9; background: #f2fffa; }.opt.chosen { border-color: var(--purple); background: #e5fbf3; }.opt.correct { border-color: var(--green); background: #ebfbf3; }.opt.wrong { border-color: var(--red); background: #fff0f2; }
.syllables { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 20px 0; }.syllables .opt { min-width: 82px; font-size: 19px; }.hint { display: block; margin-top: 5px; color: var(--muted); text-align: center; font-size: 10px; }.no-tilde { display: block; margin: 0 auto 5px; padding: 11px 20px; border: 2px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-weight: 900; }.no-tilde.chosen { border-color: var(--purple); background: #f0edff; }
.contextline { margin-top: 18px; padding: 20px; border-radius: 15px; background: #f0faf7; text-align: center; font-size: clamp(18px, 3vw, 23px); line-height: 1.65; }.repair-instruction { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 18px 0 4px; padding: 12px; border-radius: 12px; background: #fff6e8; color: #7c5629; font-size: 11px; font-weight: 900; }.repair-instruction span { font-size: 20px; }
#feedback { margin-top: 15px; padding: 13px 15px; border-left: 5px solid var(--green); border-radius: 12px; background: #eafaf2; line-height: 1.5; }#feedback.error { border-left-color: var(--orange); background: #fff6e9; }#feedback strong { display: block; margin-bottom: 3px; }#feedback p { margin: 0; font-size: 12px; }.feedback-extra { display: inline-block; margin-top: 6px; color: #217e59; font-weight: 900; }
.playactions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; }.keyboard-tip { color: #8b8ba0; font-size: 9px; }.keyboard-tip kbd { padding: 1px 4px; border: 1px solid #d1d1dc; border-bottom-width: 2px; border-radius: 4px; background: #fff; font: 9px system-ui; }.playfoot { margin: -3px 0 10px; color: #718784; text-align: center; font-size: 10px; }

/* Resultados */
.finish-card { width: min(800px, 100%); height: calc(100% - 18px); margin: 8px auto 10px; overflow: hidden; padding: 20px 28px; border-radius: 24px; background: #fff; text-align: center; box-shadow: var(--shadow); }.finish-art { margin: 0 auto 4px; font-size: 46px; animation: celebrate .5s ease-out; }.finish-card h1 { margin: 6px 0; font-size: 28px; }.finish-card > p { margin: 4px 0; color: var(--muted); font-size: 12px; }.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 13px 0; }.stat { padding: 11px 5px; border-radius: 13px; background: #edfaf6; }.stat:nth-child(2), .stat:nth-child(3), .stat:nth-child(4) { background: #edfaf6; }.stat strong { display: block; color: #087f76; font: 900 21px var(--display); }.stat small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }.skill-line { margin: 6px 0; text-align: left; font-size: 10px; }.skill-line > div { height: 6px; margin-top: 4px; overflow: hidden; border-radius: 99px; background: #e5efeb; }.skill-line i { display: block; height: 100%; background: linear-gradient(90deg, #14b8a6, #087f76); }.mistake-review { margin-top: 11px; text-align: left; }.mistake-review h3 { margin: 0 0 5px; text-align: center; }.review-item { display: grid; grid-template-columns: 1fr auto; gap: 3px 15px; margin: 4px 0; padding: 7px 10px; border-radius: 10px; background: #fff7ea; font-size: 10px; }.review-item span { color: var(--muted); font-size: 8px; }.review-item strong:last-child { color: #087f76; }.empty-review { padding: 11px; border-radius: 11px; background: #eafaf2; color: #227756; font-weight: 900; }.finish-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }.finish-actions button { padding: 9px 12px; font-size: 10px; }
@keyframes celebrate { 0% { transform: scale(.65) rotate(-10deg); } 70% { transform: scale(1.1) rotate(4deg); } 100% { transform: none; } }

@media (max-height: 760px) {
  .shell { grid-template-rows: 58px minmax(0, 1fr); }.topbar { height: 58px; }.brandmark { width: 36px; height: 36px; font-size: 29px; }.brand small { display: none; }
  #setup { grid-template-rows: 106px 32px minmax(0, 1fr); gap: 7px 15px; padding-bottom: 8px; }.hero { height: 106px; padding: 11px 27px; }.hero h1 { font-size: 28px; }.hero-art { height: 88px; }.hero-circle { transform: scale(.8) rotate(-7deg); }.hero-tags { margin-top: 4px; }.mission { padding: 8px 10px; grid-template-columns: 38px 1fr; }.mission .emoji { width: 37px; height: 37px; font-size: 20px; }.settings { padding: 12px; }.settings-grid { margin: 8px 0; gap: 6px; }.settings select { padding: 6px; }.config-notice { padding: 6px; }.play-card { padding: 18px 25px; }.mistake-review { display: none; }.finish-card { padding: 12px 23px; }.finish-art { font-size: 34px; }.finish-card h1 { font-size: 23px; }.statrow { margin: 7px 0; }
}
@media (max-width: 760px) {
  .shell { padding: 0 9px; grid-template-rows: 55px minmax(0, 1fr); }.topbar { height: 55px; }.topnav .badge { display: none; }.brand small { display: none; }
  #setup { grid-template-columns: 1fr; grid-template-rows: 82px 27px minmax(0, 1fr) 151px; gap: 5px; padding-bottom: 5px; }.hero { grid-column: 1; grid-row: 1; height: 82px; padding: 9px 16px; border-radius: 15px; }.hero h1 { font-size: 21px; }.hero p { font-size: 9px; }.hero-tags, .hero-art { display: none; }.hero .eyebrow { font-size: 7px; }
  .sectionhead { grid-column: 1; grid-row: 2; }.sectionhead h2 { font-size: 13px; }.sectionhead span { display: none; }.selection-count { font-size: 7px; padding: 3px 6px; }.missions { grid-column: 1; grid-row: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 5px; }.mission { padding: 5px 7px; grid-template-columns: 31px minmax(0, 1fr); gap: 6px; border-radius: 10px; }.mission:nth-child(7) { grid-column: span 2; }.mission .emoji { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }.mission strong { font-size: 9px; }.mission p { display: none; }.mission-number { left: 4px; top: 2px; font-size: 5px; }.mission .tick { right: 5px; top: 4px; width: 15px; height: 15px; font-size: 8px; }
  .settings { grid-column: 1; grid-row: 4; height: 151px; padding: 7px 9px; display: grid; grid-template-rows: 18px 70px 40px; grid-template-columns: 1fr; border-radius: 12px; }.settings-header { grid-row: 1; }.settings h2 { font-size: 12px; }.text-button { font-size: 8px; }.settings-grid { grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin: 3px 0; }.settings label { font-size: 7px; }.settings select { padding: 4px 1px; margin-top: 2px; border-radius: 6px; font-size: 8px; }.config-notice { display: none; }.settings > .cta { grid-row: 3; margin: 3px 0 0; padding: 7px 10px; border-radius: 8px; font-size: 10px; }
  .play-card { padding: 14px 12px; }.question-heading h2 { font-size: 18px; }.listen-button span, .keyboard-tip { display: none; }.listen-button { padding: 8px; }.options { grid-template-columns: 1fr; gap: 7px; }.opt { min-height: 45px; padding: 10px 35px; }.finish-card { padding: 11px; }.finish-actions { gap: 4px; }.finish-actions button { padding: 7px; font-size: 9px; }
}
@media (max-width: 420px) {
  .brand strong { font-size: 13px; }.brandmark { width: 32px; height: 32px; font-size: 26px; }.ghost { padding: 7px 9px; }.hero h1 { font-size: 18px; }.hero p { font-size: 8px; }.mission strong { font-size: 8px; }.settings { grid-template-rows: 18px 74px 36px; }.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, 1fr); }.settings select { padding: 2px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { html, body { overflow: visible; background: #fff; }.topbar, footer, .finish-actions, .playtop, .mistake-review { display: none !important; }.finish-card { height: auto; box-shadow: none; }.statrow { grid-template-columns: repeat(4, 1fr); } }

/* Portada amplia; solo la partida queda bloqueada a la pantalla */
html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
html.game-active, body.game-active { height: 100dvh; overflow: hidden; }
.shell { min-height: 100dvh; height: auto; grid-template-rows: 80px auto; }
.topbar { height: 80px; }
main, .page { height: auto; min-height: 0; }

#setup { display: block; padding-bottom: 42px; }
.hero { height: 292px; grid-template-columns: minmax(0, 1.45fr) .7fr; padding: 36px 54px; border-radius: 28px; }
.hero h1 { margin: 9px 0 8px; font-size: clamp(36px, 5vw, 58px); line-height: 1.08; }
.hero p { max-width: 650px; font-size: 15px; line-height: 1.6; }
.hero-tags { margin-top: 18px; gap: 9px; }
.hero-tags span { padding: 7px 12px; font-size: 10px; }
.hero-art { height: 225px; }
.hero-circle { width: 172px; height: 172px; padding-bottom: 44px; border-radius: 42px; font-size: 145px; line-height: 120px; }
.hero-circle small { bottom: 20px; font-size: 11px; }
.float { width: 50px; height: 50px; border-radius: 15px; font-size: 30px; }
.spark { font-size: 34px; }
.sectionhead { margin: 36px 0 17px; }
.sectionhead h2 { font-size: 23px; }
.sectionhead span { font-size: 12px; }
.selection-count { padding: 7px 11px; font-size: 10px; }

.missions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; gap: 13px; }
.mission { min-height: 132px; padding: 20px; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; border-radius: 19px; }
.mission .emoji { width: 56px; height: 56px; border-radius: 16px; font-size: 29px; }
.mission strong { font-size: 14px; line-height: 1.3; }
.mission p { margin-top: 7px; font-size: 11px; line-height: 1.4; }
.mission-number { left: 10px; top: 8px; font-size: 8px; }
.mission .tick { width: 22px; height: 22px; right: 12px; top: 11px; }
.mission:nth-child(7) { grid-column: 1 / -1; min-height: 102px; grid-template-columns: 64px 1fr; }

.settings { width: 100%; height: auto; margin-top: 24px; padding: 24px 26px; display: block; border-color: #cce8e2; border-radius: 22px; background: linear-gradient(120deg, #e6f8f3, #f3fbf9); box-shadow: 0 10px 28px #194d4610; }
.settings h2 { font-size: 20px; }
.text-button { font-size: 11px; }
.settings-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0 14px; }
.settings label { font-size: 11px; }
.settings select { padding: 12px; font-size: 13px; background: #fff; }
.config-notice { max-width: 680px; padding: 10px 12px; font-size: 10px; }
.settings > .cta { width: 320px; margin: 20px 0 0; padding: 15px 18px; font-size: 13px; }

body.game-active .shell { height: 100dvh; min-height: 0; grid-template-rows: 68px minmax(0, 1fr); }
body.game-active .topbar { height: 68px; }
body.game-active main, body.game-active #play { height: 100%; min-height: 0; }
#play { padding: 8px 0 14px; }
.play-card { padding: 22px 12px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.question-heading h2 { font-size: clamp(23px, 3vw, 31px); }
.options { gap: 12px; }
.opt { min-height: 60px; box-shadow: 0 5px 14px #194d460d; }
.wordbox, .contextline, .repair-instruction { box-shadow: inset 0 0 0 1px #d8e9e6; }
#feedback { box-shadow: 0 6px 16px #194d460d; }
.finish-card { height: auto; min-height: calc(100dvh - 100px); overflow: visible; border: 0; background: transparent; box-shadow: none; }

@media (max-width: 820px) {
  .shell { grid-template-rows: 64px auto; padding: 0 13px; }
  .topbar { height: 64px; }
  #setup { display: block; padding-bottom: 28px; }
  .hero { height: 235px; padding: 28px; grid-template-columns: 1fr .48fr; }
  .hero h1 { font-size: 38px; }
  .hero-art { height: 180px; }
  .hero-circle { transform: scale(.75) rotate(-7deg); }
  .missions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission:nth-child(7) { grid-column: 1 / -1; }
  .settings { height: auto; display: block; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
  .hero { height: auto; min-height: 210px; display: block; padding: 25px 22px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 13px; }
  .hero-art { display: none; }
  .sectionhead { margin: 28px 0 14px; }
  .sectionhead h2 { font-size: 19px; }
  .sectionhead span { display: none; }
  .missions { grid-template-columns: 1fr; }
  .mission, .mission:nth-child(7) { grid-column: 1; min-height: 112px; padding: 16px; grid-template-columns: 50px 1fr; }
  .mission .emoji { width: 48px; height: 48px; font-size: 25px; }
  .mission p { display: block; }
  .settings { padding: 19px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings > .cta { width: 100%; }
  body.game-active .shell { grid-template-rows: 56px minmax(0, 1fr); }
  body.game-active .topbar { height: 56px; }
  .play-card { padding: 12px 2px; }
  .question-heading h2 { font-size: 21px; }
  .options { grid-template-columns: 1fr; }
}

/* Ilustraciones de las misiones */
.missions { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mission { min-height: 128px; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 9px 13px 9px 8px; background: linear-gradient(135deg, #ffffff, #f8fdfb); }
.mission::after { height: 5px; }
.mission-visual { width: 76px; height: 106px; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background: radial-gradient(circle, #e6f8f3 0 50%, transparent 72%); }
.mission-visual img { width: 100%; height: 100%; display: block; object-fit: contain; filter: drop-shadow(0 8px 8px #194d4620); transition: transform .18s ease; }
.mission:hover .mission-visual img { transform: scale(1.04); }
.mission strong { padding-right: 15px; font-size: 14px; line-height: 1.25; }
.mission p { margin-top: 6px; font-size: 10px; line-height: 1.4; }
.mission-number { left: 8px; top: 7px; z-index: 2; padding: 2px 4px; border-radius: 6px; background: #ffffffc9; font-size: 7px; }
.mission:nth-child(7) { grid-column: 1 / -1; min-height: 128px; grid-template-columns: 76px minmax(0, 240px); justify-content: center; }
.mission:nth-child(7) .mission-visual { width: 76px; height: 106px; background: radial-gradient(circle, #ffffff29 0 48%, transparent 72%); }
.mission:nth-child(7) strong { font-size: 14px; }
.mission:nth-child(7) p { font-size: 10px; }

@media (max-width: 1120px) {
  .missions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .missions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mission { grid-column: auto; min-height: 145px; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 11px; }
  .mission:nth-child(7) { grid-column: 1 / -1; width: 100%; min-height: 145px; grid-template-columns: 92px minmax(0, 240px); justify-content: center; }
  .mission-visual, .mission:nth-child(7) .mission-visual { width: 92px; height: 122px; }
  .mission strong, .mission:nth-child(7) strong { font-size: 14px; }
  .mission p, .mission:nth-child(7) p { font-size: 10px; }
}

@media (max-width: 620px) {
  .missions { grid-template-columns: 1fr; gap: 11px; }
  .mission { grid-column: 1; width: 100%; min-height: 140px; grid-template-columns: 102px minmax(0, 1fr); gap: 10px; padding: 9px 14px 9px 8px; }
  .mission:nth-child(7) { grid-column: 1; width: 100%; min-height: 140px; grid-template-columns: 102px minmax(0, 230px); justify-content: center; gap: 10px; padding: 9px 14px 9px 8px; }
  .mission-visual, .mission:nth-child(7) .mission-visual { width: 102px; height: 120px; }
  .mission strong, .mission:nth-child(7) strong { font-size: 15px; }
  .mission p, .mission:nth-child(7) p { display: block; margin-top: 5px; font-size: 11px; }
}

@media (max-width: 390px) {
  .mission { grid-template-columns: 88px minmax(0, 1fr); min-height: 132px; }
  .mission:nth-child(7) { grid-template-columns: 88px minmax(0, 200px); min-height: 132px; justify-content: center; }
  .mission-visual, .mission:nth-child(7) .mission-visual { width: 88px; height: 112px; }
  .mission strong, .mission:nth-child(7) strong { font-size: 13px; }
}

@media (max-height: 760px) {
  .play-mission-art { width: 76px; height: 62px; border-radius: 14px; }
  .play-mission-identity { gap: 10px; }
  .question-level { margin-top: 4px; }
}

@media (max-width: 540px) {
  .play-mission-art { width: 64px; height: 58px; border-radius: 12px; }
  .play-mission-identity { gap: 8px; }
  .play-mission-identity .badge { max-width: 215px; overflow: hidden; text-overflow: ellipsis; }
}

/* Portada: composición de palabras */
.hero {
  height: 204px;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr);
  padding: 22px 48px;
  overflow: hidden;
  background:
    radial-gradient(circle at 79% 20%, #ffffff8c 0 5%, transparent 5.4%),
    radial-gradient(circle at 92% 84%, #f3ddff73 0 18%, transparent 18.4%),
    linear-gradient(118deg, #d8f7ef 0%, #e7f8f5 55%, #f4ebfb 100%);
}
.hero::before { width: 260px; height: 260px; right: -65px; top: -150px; }
.hero::after { width: 150px; height: 150px; right: 31%; bottom: -115px; }
.hero h1 { margin: 6px 0 5px; font-size: clamp(36px, 4vw, 51px); }
.hero p { font-size: 14px; }
.hero-tags { margin-top: 12px; }
.hero-art { height: 156px; transform: translateX(-72px); }
.word-cascade { position: relative; width: min(405px, 100%); height: 156px; margin: auto; }
.word-cascade::before {
  content: none;
}
.cascade-label { position: absolute; left: 34px; top: 0; color: #087f76; font-size: 9px; font-weight: 900; letter-spacing: 2px; }
.word-chip {
  position: absolute;
  z-index: 2;
  width: 224px;
  height: 45px;
  padding: 6px 11px 6px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #ffffff;
  border-left: 6px solid var(--yellow);
  border-radius: 15px;
  background: #ffffffed;
  box-shadow: 0 11px 25px #194d4621;
}
.word-chip strong { color: var(--ink); font: 900 22px/1 var(--display); letter-spacing: .2px; }
.word-chip mark { padding: 0; background: none; color: #0b9c90; }
.word-chip small { color: #6e8582; font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.chip-one { left: 27px; top: 22px; transform: rotate(-2deg); }
.chip-two { left: 99px; top: 66px; border-left-color: var(--pink); transform: rotate(1.5deg); }
.chip-three { left: 43px; top: 110px; border-left-color: var(--orange); transform: rotate(-1deg); }
.accent-spark { position: absolute; z-index: 3; color: var(--yellow); font-size: 25px; line-height: 1; }
.accent-one { right: 30px; top: 4px; }
.accent-two { right: 14px; bottom: 10px; font-size: 16px; }

@media (max-width: 920px) {
  .hero { grid-template-columns: minmax(0, 1fr) 330px; padding: 22px 30px; }
  .hero-art { transform: translateX(-24px); }
  .word-cascade { transform: scale(.86); transform-origin: center; }
}

@media (max-width: 720px) {
  .hero { height: auto; min-height: 196px; display: block; padding: 27px 25px; }
  .hero-art { display: none; }
  .hero h1 { font-size: clamp(32px, 9vw, 43px); }
  .hero p { font-size: 13px; }
}

/* Acciones de selección de misiones */
.section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.sectionhead .text-button {
  padding: 8px 13px;
  border: 1px solid #9dd8cd;
  border-radius: 10px;
  background: #fff;
  color: #08776c;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 4px 12px #194d4610;
  transition: background .15s, border-color .15s, transform .15s;
}
.sectionhead .text-button:hover { border-color: #14a995; background: #eafaf6; transform: translateY(-1px); }

@media (max-width: 620px) {
  .sectionhead { align-items: flex-start; }
  .section-actions { gap: 6px; }
  .sectionhead .text-button { padding: 7px 9px; font-size: 9px; }
}

.shell > footer {
  display: block;
  padding: 18px 0 24px;
  color: #69817f;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}
body.game-active .shell { grid-template-rows: 68px minmax(0, 1fr) 24px; }
body.game-active .shell > footer { display: block; padding: 4px 0 7px; font-size: 9px; }
#setup > .settings { margin-top: 8px; }

@media (max-width: 540px) {
  body.game-active .shell { grid-template-rows: 56px minmax(0, 1fr) 22px; }
  body.game-active .shell > footer { padding: 3px 0 5px; font-size: 8px; }
}

/* Configuración más compacta en la portada */
.shell { grid-template-rows: 68px auto; }
.topbar { height: 68px; }
#setup > .settings { margin-top: 0; padding: 17px 22px; }
.settings h2 { font-size: 18px; }
.settings-grid { gap: 12px; margin: 13px 0 10px; }
.settings select { padding: 9px 10px; }
.config-notice { padding: 8px 11px; }
.settings > .cta { width: 300px; margin: 12px auto 0; padding: 13px 17px; font-size: 13px; }

@media (max-width: 820px) {
  .shell { grid-template-rows: 60px auto; }
  .topbar { height: 60px; }
  #setup > .settings { padding: 16px 18px; }
}

@media (max-width: 620px) {
  .shell { grid-template-rows: 56px auto; }
  .topbar { height: 56px; }
  #setup > .settings { padding: 15px; }
  .settings > .cta { width: 100%; }
}

@media (min-width: 921px) {
  .shell { grid-template-rows: 58px auto; }
  .topbar { height: 58px; }
  #setup { padding-top: 32px; padding-bottom: 0; }
  #setup > .settings { padding: 12px 18px; }
  .settings h2 { font-size: 16px; }
  .settings-grid { gap: 10px; margin: 8px 0 7px; }
  .settings select { margin-top: 3px; padding: 7px 9px; }
  .config-notice { padding: 6px 9px; }
  .settings > .cta { width: 290px; margin: 8px auto 0; padding: 12px 16px; font-size: 13px; }
  .sectionhead { margin: 30px 0 9px; }
  .missions { gap: 10px; }
  .mission { min-height: 112px; grid-template-columns: 68px minmax(0, 1fr); }
  .mission-visual { width: 68px; height: 92px; }
  .mission:nth-child(7) { min-height: 112px; grid-template-columns: 68px minmax(0, 240px); }
  .mission:nth-child(7) .mission-visual { width: 68px; height: 92px; }
  .shell > footer { padding: 3px 0 9px; }
}

/* Ajustes de la versión demo */
.demo-badge { background: #fff1c9; color: #8c5b00; letter-spacing: .12em; }
.demo-only { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.demo-only .demo-locked {
  position: relative;
  opacity: .68;
  filter: saturate(.55);
  cursor: not-allowed;
  box-shadow: none;
}
.demo-only .demo-locked:hover { transform: none; box-shadow: none; }
.demo-only .demo-locked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(244, 249, 248, .16);
  pointer-events: none;
}
.lock-label {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 9px;
  padding: 3px 6px;
  border-radius: 99px;
  background: #e9efee;
  color: #627774;
  font-size: 6px;
  font-weight: 950;
  letter-spacing: .08em;
}
.mission.grand-challenge-card {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  min-height: 122px;
  grid-template-columns: 84px minmax(0, 270px);
  justify-content: center;
  border-color: #087c72;
  background: linear-gradient(120deg, #087c72, #0ca293);
  color: #fff;
  cursor: default;
}
.mission.grand-challenge-card:hover { transform: none; box-shadow: 0 10px 24px rgba(4, 91, 83, .18); }
.mission.grand-challenge-card .mission-visual { width: 78px; height: 98px; background: rgba(255,255,255,.16); }
.mission.grand-challenge-card .mission-copy { text-align: left; }
.mission.grand-challenge-card strong { color: #fff; font-size: 17px; }
.mission.grand-challenge-card p { color: #d8fffa; font-size: 11px; }
.mission.grand-challenge-card .mission-number { color: rgba(255,255,255,.65); }
.demo-label { position: absolute; top: 10px; right: 14px; color: #fff1b8; font-size: 7px; font-weight: 950; letter-spacing: .12em; }

@media (min-width: 921px) {
  .settings-grid { grid-template-columns: .8fr .9fr 1.35fr 1.2fr; }
}

@media (max-width: 920px) {
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-only { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mission.grand-challenge-card { grid-column: 1 / -1; }
}

@media (max-width: 540px) {
  .demo-only { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .settings-grid { grid-template-columns: 1fr; }
  .demo-only { grid-template-columns: 1fr; }
  .mission.grand-challenge-card { grid-template-columns: 64px minmax(0, 1fr); padding-top: 22px; }
  .mission.grand-challenge-card .mission-visual { width: 62px; height: 80px; }
  .demo-label { top: 7px; right: 9px; }
}

@media print { body { overflow: visible; }.finish-card { min-height: 0; } }

/* Móvil y dispositivos táctiles: un único desplazamiento vertical en la raíz. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  html,
  html.game-active {
    width: 100%;
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch;
  }

  body,
  body.game-active {
    position: static !important;
    width: 100%;
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
    overscroll-behavior-y: auto;
    touch-action: pan-y;
  }

  .shell,
  body.game-active .shell {
    display: block;
    width: 100%;
    height: auto !important;
    min-height: 100dvh;
    padding-right: max(9px, env(safe-area-inset-right));
    padding-left: max(9px, env(safe-area-inset-left));
  }

  body.game-active .topbar { height: 56px; }
  main,
  .page,
  body.game-active main,
  body.game-active .page,
  body.game-active #play,
  body.game-active #finish {
    height: auto !important;
    min-height: 0;
    overflow: visible !important;
  }

  body.game-active #play {
    display: flex;
    padding: 6px 0 max(24px, env(safe-area-inset-bottom));
  }

  body.game-active .play-card {
    min-height: 0;
    flex: none;
    overflow: visible !important;
    padding-bottom: 20px;
  }

  body.game-active .playactions {
    align-items: stretch;
    flex-direction: column;
  }

  body.game-active .playactions .cta { width: 100%; }
  body.game-active .finish-card {
    min-height: 0;
    margin-bottom: max(24px, env(safe-area-inset-bottom));
    overflow: visible !important;
  }
}

/* Scroll interno fiable cuando Hostinger o WordPress muestran la demo en un iframe. */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  html,
  html.game-active,
  body,
  body.game-active {
    height: 100% !important;
    min-height: 0;
    overflow: hidden !important;
  }

  .shell,
  body.game-active .shell {
    display: block;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scroll-padding-bottom: max(28px, env(safe-area-inset-bottom));
  }

  #setup,
  #play,
  #finish {
    width: 100%;
    overflow: visible !important;
  }

  #setup { padding-bottom: max(42px, env(safe-area-inset-bottom)); }
  .shell > footer,
  body.game-active .shell > footer {
    display: block;
    padding: 8px 0 max(28px, env(safe-area-inset-bottom));
  }

  body.game-active #play {
    min-height: max-content !important;
  }

  body.game-active .play-card {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    contain: none;
  }

  body.game-active #questionBody,
  body.game-active #feedback,
  body.game-active .playactions {
    flex: 0 0 auto;
  }

  body.game-active .playactions {
    margin-bottom: 0;
    padding-bottom: 14px;
  }

  #finish {
    padding: 8px 0 max(36px, env(safe-area-inset-bottom));
  }

  #finish .finish-card {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto;
    padding: 16px 14px 20px;
    overflow: visible !important;
  }

  #finish .finish-actions {
    width: 100%;
    margin: 16px 0 0;
    padding: 0 0 8px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #finish .finish-actions button {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
  }
}
