@font-face { font-family: 'Fredoka'; font-weight: 500; src: url(vendor/fonts/fredoka-latin-500-normal.woff2) format('woff2'); font-display: block; }
@font-face { font-family: 'Fredoka'; font-weight: 700; src: url(vendor/fonts/fredoka-latin-700-normal.woff2) format('woff2'); font-display: block; }
@font-face { font-family: 'Lilita One'; font-weight: 400; src: url(vendor/fonts/lilita-one-latin-400-normal.woff2) format('woff2'); font-display: block; }

:root {
  --bg0: #07041f; --bg1: #150a45; --bg2: #2a0f6b;
  --pink: #ff3d9a; --cyan: #2de2e6; --yellow: #ffd23f; --lime: #7cff6b; --violet: #8a5cff; --orange: #ff8a3d;
  --ink: #fff; --dim: #c9c3ff; --panel: rgba(255, 255, 255, .07); --edge: rgba(255, 255, 255, .16);
  --good: #5dff8f; --bad: #ff5a6e;
  --font: 'Fredoka', 'Avenir Next Rounded', 'Avenir Next', ui-rounded, system-ui, sans-serif;
  --display: 'Lilita One', 'Fredoka', system-ui, sans-serif;
  --shake: 8px; --shake-ms: 320ms;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg0); color: var(--ink); font-family: var(--font); font-weight: 500; font-size: 18px; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font-family: var(--font); font-weight: 700; font-size: 18px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-bottom-width: 3px; border-radius: 8px; padding: 0 9px; line-height: 1.5; display: inline-block; min-width: 1.9em; text-align: center; color: #fff; }

#app { position: fixed; inset: 0; background: radial-gradient(120% 90% at 20% 0%, var(--bg2) 0%, var(--bg1) 45%, var(--bg0) 100%); overflow: hidden; }
#app.shaking { animation: shake var(--shake-ms) cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake { 10%, 90% { transform: translate(calc(var(--shake) * -.25), 0); } 20%, 80% { transform: translate(calc(var(--shake) * .5), calc(var(--shake) * -.3)); } 30%, 50%, 70% { transform: translate(calc(var(--shake) * -1), calc(var(--shake) * .4)); } 40%, 60% { transform: translate(var(--shake), calc(var(--shake) * -.4)); } }
#bg, #fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#fx { z-index: 50; }
.aurora { position: absolute; width: 70vw; height: 70vw; border-radius: 50%; pointer-events: none; }
.a1 { background: radial-gradient(closest-side, rgba(255,61,154,.28), rgba(255,61,154,0)); left: -25vw; top: 20vh; animation: drift 18s ease-in-out infinite alternate; }
.a2 { background: radial-gradient(closest-side, rgba(45,226,230,.22), rgba(45,226,230,0)); right: -30vw; top: -35vh; animation: drift 24s ease-in-out infinite alternate-reverse; }
.a3 { background: radial-gradient(closest-side, rgba(138,92,255,.34), rgba(138,92,255,0)); left: 25vw; bottom: -45vw; animation: drift 21s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(8vw, -6vh) scale(1.15); } }
#flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 40; }
#flash.go { animation: flash .5s ease-out; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

/* HUD */
#hud { position: absolute; top: 0; left: 0; right: 0; height: 72px; display: flex; align-items: center; gap: 22px; padding: 0 28px; z-index: 5; }
.brand { font-family: var(--display); font-size: 30px; letter-spacing: 1px; cursor: default; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.brand b { color: var(--pink); font-weight: 400; margin-left: 6px; }
.rank { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 18px 6px 6px; }
.rank-badge { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 22px; background: linear-gradient(135deg, var(--yellow), var(--orange)); color: #3a1b00; box-shadow: 0 0 0 3px rgba(255,210,63,.3); }
.rank-name { font-weight: 700; line-height: 1; font-size: 18px; margin-bottom: 5px; }
.xpbar { width: 150px; height: 9px; border-radius: 9px; background: rgba(255,255,255,.15); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--lime)); border-radius: 9px; transition: width .8s cubic-bezier(.2,.9,.2,1); }
.xp-text { color: var(--dim); font-size: 18px; white-space: nowrap; }
.ready, .rank-name, .chip { white-space: nowrap; }
.ready { display: flex; align-items: baseline; gap: 10px; color: var(--dim); }
.ready b { font-family: var(--display); font-size: 30px; color: var(--lime); font-weight: 400; }
.toggles { margin-left: auto; display: flex; gap: 10px; }
.chip { background: var(--panel); border: 1px solid var(--edge); border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: 18px; display: inline-flex; align-items: center; gap: 8px; transition: transform .12s, background .2s; }
.chip:hover { transform: translateY(-2px); background: rgba(255,255,255,.14); }
.chip[aria-pressed="false"] { text-decoration: line-through; background: rgba(0,0,0,.35); color: #e6e2ff; }
.chip .ico { color: var(--cyan); }
.chip.danger { border-color: rgba(255,90,110,.5); }

#stage { position: absolute; inset: 72px 0 0 0; }
.screen { position: absolute; inset: 0; padding: 8px 36px 28px; display: none; }
.screen.active { display: block; animation: screenIn .5s cubic-bezier(.2,.9,.2,1) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

/* Map card */
.mapcard { position: relative; border-radius: 28px; overflow: hidden; border: 1px solid var(--edge); background: linear-gradient(160deg, rgba(60,40,170,.45), rgba(12,8,60,.7)); box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04); }
.mapcard canvas { position: absolute; inset: 0; display: block; }
.map-badge { position: absolute; left: 18px; top: 16px; font-family: var(--display); font-size: 26px; background: rgba(8,4,40,.7); border: 1px solid var(--edge); padding: 4px 18px; border-radius: 999px; letter-spacing: .5px; }
.map-badge:empty { display: none; }
.map-badge.stamp { color: var(--yellow); animation: stampIn .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stampIn { from { transform: scale(2) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 160px; color: #fff; text-shadow: 0 8px 0 rgba(255,61,154,.7), 0 0 60px rgba(255,255,255,.5); pointer-events: none; }
.countdown.pop { animation: cpop .8s ease-out both; }
@keyframes cpop { from { transform: scale(2.4); opacity: 0; } 30% { opacity: 1; } to { transform: scale(.9); opacity: 0; } }

/* MENU */
#s-menu { display: none; }
#s-menu.active { display: grid; grid-template-columns: minmax(520px, 6fr) 5fr; gap: 38px; }
.logo { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(56px, min(9vw, 11vh), 112px); line-height: .86; letter-spacing: 2px; transform: rotate(-2deg); transform-origin: left; }
.logo span { display: block; background: linear-gradient(180deg, #fff 20%, #ffd9ec 55%, var(--pink) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 rgba(120,20,90,.9)) drop-shadow(0 0 28px rgba(255,61,154,.5)); }
.logo .l2 { background: linear-gradient(180deg, #fff 10%, #b9f8ff 50%, var(--cyan) 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 6px 0 rgba(10,80,130,.9)) drop-shadow(0 0 28px rgba(45,226,230,.5)); margin-left: 40px; }
.tag { font-size: 22px; color: var(--dim); margin: 14px 0 14px; }
#menu-list { display: grid; gap: 10px; max-width: 640px; }
.mode { display: flex; align-items: center; gap: 18px; text-align: left; padding: clamp(5px, 1.1vh, 11px) 20px; border-radius: 20px; border: 1px solid rgba(255,255,255,.2); border-bottom: 5px solid rgba(0,0,0,.35); background: linear-gradient(100deg, var(--c1), var(--c2)); transition: transform .14s cubic-bezier(.3,1.6,.5,1), filter .2s; position: relative; }
.mode kbd { font-size: 24px; min-width: 2.2em; background: rgba(0,0,0,.28); border-color: rgba(255,255,255,.3); }
.mode .mt { font-family: var(--display); font-size: 28px; letter-spacing: .5px; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.mode small { display: block; font-family: var(--font); font-weight: 500; font-size: 18px; opacity: .92; letter-spacing: 0; text-shadow: none; margin-top: 2px; }
.mode.sel, .mode:hover { transform: translateX(12px) scale(1.02); filter: brightness(1.15) saturate(1.1); }
.mode.sel::after { content: '▶'; position: absolute; right: 18px; font-size: 22px; animation: nudge .7s ease-in-out infinite alternate; }
@keyframes nudge { to { transform: translateX(6px); } }
.m-learn { --c1: #076173; --c2: #1d3fa6; }
.m-practice { --c1: #c0176b; --c2: #bf3d0e; }
.m-blitz { --c1: #9c5400; --c2: #b3262f; }
.m-test { --c1: #6334d6; --c2: #b8206e; }
.m-pass { --c1: #0e7a4a; --c2: #0b7478; }
.menu-foot { margin-top: 14px; color: var(--dim); }
.menu-right { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.menu-right .mapcard { flex: 1; min-height: 260px; }
.plan { background: var(--panel); border: 1px solid var(--edge); border-radius: 22px; padding: 14px 22px; font-size: 20px; line-height: 1.35; }
.plan b { color: var(--yellow); }

/* PLAY */
.play-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 28px; height: 100%; }
.play-grid .mapcard { height: 100%; }
.qcard { display: flex; flex-direction: column; gap: clamp(10px, 1.9vh, 20px); padding: 20px 28px 18px; border-radius: 28px; background: linear-gradient(170deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); border: 1px solid var(--edge); box-shadow: 0 30px 60px rgba(0,0,0,.35); min-height: 0; transition: box-shadow .3s, border-color .3s; }
.qcard.good { border-color: var(--good); box-shadow: 0 0 0 3px rgba(93,255,143,.3), 0 0 70px rgba(93,255,143,.35); }
.qcard.bad { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255,90,110,.3), 0 0 70px rgba(255,90,110,.3); }
.q-top { display: flex; align-items: center; gap: 14px; }
.pill { font-family: var(--display); font-size: 20px; padding: 3px 16px; border-radius: 999px; background: #c0176b; letter-spacing: 1px; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.dots { display: flex; gap: 5px; flex: 1; flex-wrap: wrap; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.18); transition: background .3s, transform .3s; }
.dots i.now { background: var(--yellow); transform: scale(1.35); box-shadow: 0 0 12px var(--yellow); }
.dots i.ok { background: var(--good); } .dots i.no { background: var(--bad); } .dots i.done { background: var(--cyan); }
.q-count { color: #e2deff; font-weight: 700; }
.country { display: flex; align-items: center; gap: 18px; }
.flag { font-size: clamp(64px, 10vh, 96px); line-height: 1; filter: drop-shadow(0 8px 14px rgba(0,0,0,.45)); animation: flagIn .6s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes flagIn { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.names { min-width: 0; }
.es { font-family: var(--display); font-size: clamp(40px, min(4.8vw, 8vh), 72px); line-height: 1; text-shadow: 0 4px 0 rgba(0,0,0,.35); overflow-wrap: anywhere; }
.en { color: var(--dim); font-size: 22px; margin-top: 3px; }
.prompt { font-size: 22px; font-weight: 700; color: var(--yellow); }
.reveal { background: rgba(0,0,0,.22); border: 1px solid var(--edge); border-radius: 20px; padding: 12px 16px; }
.reveal[hidden] { display: none; }
@keyframes letterIn { from { transform: translateY(-22px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.story { font-size: 22px; line-height: 1.3; color: #fff; }
.story em { font-style: normal; color: var(--yellow); font-weight: 700; }
.inputwrap { position: relative; }
#answer { width: 100%; font-family: var(--font); font-weight: 700; font-size: clamp(36px, 6vh, 54px); padding: 8px 24px; border-radius: 20px; border: 4px solid rgba(255,255,255,.35); background: rgba(8,4,40,.65); color: #fff; outline: none; caret-color: var(--yellow); letter-spacing: 1px; transition: border-color .2s, box-shadow .2s, transform .1s; }
#answer::placeholder { color: rgba(255,255,255,.62); font-weight: 500; font-size: 24px; }
#answer:focus { border-color: var(--cyan); box-shadow: 0 0 0 6px rgba(45,226,230,.2), 0 0 40px rgba(45,226,230,.35); }
#answer.pop { animation: keypop .12s ease-out; }
@keyframes keypop { 0% { transform: scale(1); } 40% { transform: scale(1.012) translateY(-1px); } 100% { transform: scale(1); } }
#answer.pre-ok { color: var(--good); } #answer.pre-bad { color: var(--bad); }
#answer.jiggle { animation: jig .35s; }
@keyframes jig { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.feedback { min-height: 40px; flex: 1; font-size: 20px; line-height: 1.3; overflow: hidden; }
.fb-title { font-family: var(--display); font-size: 30px; letter-spacing: .5px; margin-bottom: 2px; }
.fb-title.good { color: var(--good); } .fb-title.bad { color: var(--bad); } .fb-title.near { color: var(--yellow); } .fb-title.neutral { color: var(--cyan); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 3px 0; }
.row .lbl { width: 108px; font-size: 18px; color: var(--dim); }
.tile { display: inline-grid; place-items: center; min-width: 30px; height: 40px; padding: 0 3px; border-radius: 8px; font-weight: 700; font-size: 24px; background: rgba(255,255,255,.12); }
.tile.sp { background: none; min-width: 14px; }
.tile.ok { background: rgba(93,255,143,.2); color: var(--good); }
.tile.bad { background: #b3122b; color: #fff; }
.tile.fix { background: var(--yellow); color: #2a1a00; animation: fixpulse .9s ease-in-out infinite alternate; }
@keyframes fixpulse { to { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(255,210,63,.5); } }
.tip { margin-top: 4px; color: #fff; }
.tip div { margin: 1px 0; }
.meters { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.meters.hide { visibility: hidden; }
.score span, .combo small { display: block; font-size: 18px; color: #e2deff; font-weight: 700; letter-spacing: 1px; }
.score b { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; color: var(--yellow); text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.fuel { height: 20px; border-radius: 12px; background: rgba(255,255,255,.14); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.fuel i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--lime), var(--yellow) 60%, var(--orange)); border-radius: 12px; transition: background .3s; }
.fuel i.low { background: linear-gradient(90deg, var(--orange), var(--pink)); }
.fuel-lbl { display: flex; justify-content: space-between; margin-top: 2px; font-weight: 700; color: #e2deff; }
.combo { text-align: center; min-width: 92px; }
.combo span { font-family: var(--display); font-size: 40px; line-height: 1; color: var(--cyan); display: block; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.combo.hot span { color: var(--orange); animation: hot .5s ease-in-out infinite alternate; }
@keyframes hot { to { transform: scale(1.18) rotate(-4deg); } }
.keyhints { color: var(--dim); font-size: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.keyhints kbd { margin-left: 6px; }
.float { background: rgba(8,4,40,.85); border-radius: 999px; padding: 0 18px; position: fixed; z-index: 60; transform: translate(-50%, -50%); font-family: var(--display); font-size: 44px; color: var(--yellow); text-shadow: 0 4px 0 rgba(0,0,0,.45), 0 0 18px rgba(255,210,63,.6); pointer-events: none; animation: floatUp 1.3s cubic-bezier(.2,.8,.3,1) both; white-space: nowrap; }
.float.combo { color: var(--pink); font-size: 56px; } .float.bad { color: var(--bad); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -80%) scale(1.25); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
.banner { position: absolute; left: 50%; top: 42%; z-index: 45; transform: translate(-50%, -50%); font-family: var(--display); font-size: 72px; white-space: nowrap; pointer-events: none; opacity: 0; text-shadow: 0 6px 0 rgba(0,0,0,.4), 0 0 40px rgba(255,61,154,.8); }
.banner.go { animation: banner 1.6s cubic-bezier(.2,1.2,.3,1) both; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-6deg); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(2deg); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70%) scale(1.05); } }

/* RESULTS */
.results { max-width: 1060px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; overflow: auto; padding: 4px 6px 10px; }
.res-title { font-family: var(--display); font-size: 36px; color: var(--dim); letter-spacing: 1px; margin-top: 4px; }
.res-big { font-family: var(--display); font-size: clamp(90px, 14vh, 150px); line-height: .95; background: linear-gradient(180deg, #fff, var(--yellow) 60%, var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 0 rgba(0,0,0,.35)); animation: bigIn .8s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes bigIn { from { transform: scale(.2) rotate(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }
.res-sub { font-size: 24px; font-weight: 700; }
.res-stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.stat { background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; padding: 8px 20px; min-width: 150px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--cyan); }
.stat span { color: var(--dim); }
.stat.new b { color: var(--yellow); }
.misses { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.miss { background: rgba(255,90,110,.12); border: 1px solid rgba(255,90,110,.45); border-radius: 18px; padding: 8px 16px; display: flex; gap: 12px; align-items: center; }
.miss .f { font-size: 38px; }
.miss .c { font-family: var(--display); font-size: 28px; line-height: 1.05; color: var(--yellow); }
.miss .w { color: var(--dim); font-size: 18px; }
.miss .w s { color: #ffa3b0; text-decoration-thickness: 2px; }
.good-note { color: var(--good); font-size: 24px; font-weight: 700; }
.res-badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.badge-pop { background: linear-gradient(120deg, #5b2fd0, #b8206e); border-radius: 999px; padding: 6px 20px; font-weight: 700; animation: bigIn .6s cubic-bezier(.2,1.6,.4,1) both; box-shadow: 0 5px 0 rgba(0,0,0,.3); }
.res-actions { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 4px; font-size: 20px; }
.res-actions span { display: flex; align-items: center; gap: 8px; }

/* PASSPORT */
.pass-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 28px; height: 100%; }
.pass-left { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.pass-left .mapcard { flex: 1; min-height: 0; }
.h2 { font-family: var(--display); font-weight: 400; font-size: 34px; margin: 0; }
.h2.small { font-size: 26px; } .h2 small { font-family: var(--font); font-size: 18px; color: var(--dim); font-weight: 500; margin-left: 10px; }
.hangar { display: flex; gap: 8px; flex-wrap: wrap; }
.ship { width: 112px; padding: 6px 4px; text-align: center; border-radius: 16px; background: var(--panel); border: 2px solid var(--edge); position: relative; }
.ship.sel { border-color: var(--yellow); background: rgba(255,210,63,.14); }
.ship.locked { border-style: dashed; background: rgba(0,0,0,.3); }
.ship.locked svg { opacity: .45; }
.ship svg { width: 62px; height: 30px; display: block; margin: 0 auto 2px; }
.ship b { font-size: 18px; display: block; line-height: 1.1; }
.ship small { color: var(--dim); font-size: 18px; line-height: 1; }
.ship kbd { position: absolute; top: -9px; left: -4px; min-width: 1.5em; padding: 0 5px; background: #2a1a6e; border-color: #fff; color: #fff; }
.stars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cardlet { background: rgba(8,4,40,.5); border: 1px solid var(--edge); border-radius: 16px; padding: 6px 12px 7px; display: flex; gap: 10px; align-items: center; }
.cardlet .f { font-size: 32px; }
.cardlet .n { font-weight: 700; line-height: 1.05; font-size: 18px; }
.cardlet .cap { color: var(--dim); font-size: 18px; line-height: 1.05; }
.cardlet .st { color: var(--yellow); letter-spacing: 1px; font-size: 18px; line-height: 1; }
.cardlet .st i { font-style: normal; color: #cfc9ff; }
.cardlet.m4 { background: rgba(93,255,143,.12); border-color: rgba(93,255,143,.5); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bdg { border-radius: 999px; padding: 3px 14px; background: rgba(0,0,0,.3); color: #ddd8ff; border: 1px dashed rgba(255,255,255,.4); }
.bdg.on { color: #fff; background: linear-gradient(120deg, #5b2fd0, #b8206e); border: 1px solid transparent; }
.pass-foot { margin-top: 14px; display: flex; align-items: center; }

/* overlays */
.overlay { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(5,2,30,.7); }
.overlay[hidden] { display: none; }
.dialog { background: linear-gradient(160deg, #2a1480, #14093f); border: 2px solid var(--edge); border-radius: 28px; padding: 22px 46px; text-align: center; font-size: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: bigIn .4s cubic-bezier(.2,1.6,.4,1) both; }
.dialog h2 { font-family: var(--display); font-weight: 400; font-size: 52px; margin: 0 0 6px; }
.dialog p { margin: 10px 0; }

@media (max-width: 1100px) { #hud { gap: 12px; padding: 0 16px; } .ready span { display: none; } .xpbar { width: 90px; } .screen { padding: 8px 18px 20px; } }
@media (max-height: 760px) {
  .flag { font-size: 64px; } #answer { font-size: 38px; padding: 4px 22px; } .mode { padding: 8px 18px; } .mode .mt { font-size: 25px; } .logo { font-size: 78px; }
  .tag { margin: 10px 0; } .qcard { gap: 8px; padding: 14px 24px 12px; } .big-cap { font-size: 38px; } .tile { height: 32px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .aurora { animation: none; } }

.row.big .tile { min-width: 40px; height: 54px; font-size: 34px; border-radius: 10px; }
.row.big .tile.ok { background: rgba(93,255,143,.18); }
.after-cap { font-family: var(--display); font-size: clamp(40px, 6vh, 56px); line-height: 1.05; color: #fff; letter-spacing: 1px; margin: 4px 0 2px; text-shadow: 0 4px 0 rgba(0,0,0,.35); }
.after-cap small { display: block; font-family: var(--font); font-size: 20px; color: var(--yellow); letter-spacing: 0; text-shadow: none; }
.cram { max-width: 1240px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; gap: 10px; }
.cram-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; flex: 1; min-height: 0; align-content: start; }
.cram .cc { background: rgba(255,255,255,.09); border: 1px solid var(--edge); border-radius: 16px; padding: 4px 14px; display: flex; align-items: center; gap: 12px; }
.cram .cc .f { font-size: 34px; }
.cram .cc .cn { color: #e2deff; font-size: 18px; line-height: 1.05; }
.cram .cc .ct { font-family: var(--display); font-size: 28px; line-height: 1.05; color: #fff; }
.cram .cc .cm { color: #ffe27a; font-size: 18px; line-height: 1.05; }

/* ===== lesson channels ===== */
.lesson { flex: 4; min-height: 0; background: rgba(0,0,0,.28); border: 1px solid var(--edge); border-radius: 20px; padding: 10px 16px 12px; display: flex; flex-direction: column; overflow: hidden; }
.lesson[hidden] { display: none; }
.qcard:has(#lesson:not([hidden])) .flag { font-size: 56px; }
.qcard:has(#lesson:not([hidden])) .es { font-size: clamp(32px, 5vh, 46px); }
.qcard:has(#lesson:not([hidden])) .prompt { font-size: 20px; }
.ls-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.ls-chan { font-family: var(--display); font-size: 22px; background: #5b2fd0; border-radius: 999px; padding: 2px 16px; letter-spacing: 1px; }
.ls-step, .ls-skip { color: #e2deff; font-size: 18px; }
.ls-skip { margin-left: auto; }
.ls-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 0; }
.story-line { font-size: clamp(24px, 3.6vh, 32px); line-height: 1.4; text-align: center; }
.sw { opacity: 0; transition: opacity .15s; }
.sw.in { opacity: 1; }
.sw.k-country { color: #ffe27a; text-decoration: underline; text-underline-offset: 5px; font-weight: 700; }
.sw.k-chunk { color: var(--c); font-weight: 700; border-bottom: 4px solid var(--c); }
.sw.k-trap { color: #2a1a00; background: #ffd23f; font-weight: 700; border-radius: 6px; padding: 0 5px; border-bottom: 4px solid var(--c); }
.tray { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 4px; min-height: 60px; }
.tw { display: flex; gap: 8px; transition: gap .3s; }
.tray.closed .tw { gap: 0; }
.ltile { background: #120838; color: var(--c); border: 3px solid var(--c); border-radius: 12px; font-family: var(--display); font-size: clamp(30px, 4.6vh, 40px); line-height: 1.15; padding: 0 12px; min-width: 46px; text-align: center; transition: border-radius .3s; }
.tray.closed .ltile { border-radius: 0; }
.tray.closed .ltile:first-child { border-radius: 12px 0 0 12px; }
.tray.closed .ltile:last-child { border-radius: 0 12px 12px 0; }
.tray.flash { animation: trayflash .7s ease-out; }
@keyframes trayflash { 0% { filter: brightness(2.2) drop-shadow(0 0 20px #fff); transform: scale(1.06); } 100% { filter: none; transform: none; } }
.ltile.slot { background: rgba(255,255,255,.1); border-style: dashed; border-color: #cfc9ff; color: transparent; min-width: 58px; min-height: 56px; }
.ltile.slot.filled { color: var(--c); border-style: solid; border-color: var(--c); background: #120838; animation: letterIn .35s cubic-bezier(.2,1.6,.4,1); }
.true-chip { margin: 4px auto 0; background: rgba(40,120,70,.45); border: 1px solid #5dff8f; border-radius: 14px; padding: 4px 16px; font-size: 20px; text-align: center; max-width: 95%; }
.true-chip[hidden] { display: none; }
.true-chip b { color: #8dff9b; margin-right: 8px; }
.rb-msg { text-align: center; font-weight: 700; color: #ffd23f; font-size: 22px; }
.pool { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rb { position: relative; background: #120838; color: var(--c); border: 3px solid var(--c); border-radius: 14px; font-family: var(--display); font-size: 30px; padding: 4px 16px 4px 46px; }
.rb kbd { position: absolute; left: 7px; top: 50%; transform: translateY(-50%); font-size: 18px; min-width: 1.6em; padding: 0 6px; }
.rb:disabled { background: transparent; border-style: dashed; color: #cfc9ff; border-color: #8f86ff; cursor: default; }
.shk { animation: shk .3s; }
@keyframes shk { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pic { position: relative; padding: 24px 4px 4px; min-height: 120px; }
.backdrop { position: absolute; inset: 0; display: flex; justify-content: space-around; align-items: center; font-size: clamp(80px, 16vh, 140px); opacity: 0; transition: opacity .4s; pointer-events: none; }
.pic.show-backdrop .backdrop { opacity: .24; filter: brightness(.55); }
.pic-word { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 .4em; font-family: var(--display); font-size: clamp(54px, 11vh, 100px); line-height: 1.1; padding-top: .55em; }
.pic[data-size="m"] .pic-word { font-size: clamp(44px, 8.5vh, 74px); }
.pic.hidewords .pic-word { display: none; }
.pwd { display: flex; align-items: flex-end; }
.pl { color: var(--c); display: inline-block; transition: transform .3s, opacity .3s; text-shadow: 0 4px 0 rgba(0,0,0,.4); }
.pic.dim-others .pl { opacity: .62; }
.pic.dim-others .ag.on .pl { opacity: 1; transform: scale(1.22); }
.ag { position: relative; display: inline-flex; align-items: flex-end; border-radius: 10px; transition: background .3s; }
.ag.on { background: rgba(8,4,40,.6); border-bottom: 5px solid #ffd23f; padding: 0 4px; }
.art { position: absolute; left: 0; right: 0; bottom: 100%; text-align: center; font-size: .7em; line-height: 1; opacity: 0; transform: scale(0); }
.art.below { bottom: auto; top: 100%; }
.ag.on .art { opacity: 1; transform: none; animation: artpop .35s cubic-bezier(.2,1.6,.4,1) both, var(--mo, none) var(--md, 1s) .35s var(--mi, infinite) both; }
@keyframes artpop { from { transform: scale(0); } to { transform: scale(1); } }
.ag[data-motion="wobble"] { --mo: m-wobble; --md: .8s; } .ag[data-motion="bounce"] { --mo: m-bounce; --md: .6s; } .ag[data-motion="pulse"] { --mo: m-pulse; --md: .9s; }
.ag[data-motion="spin"] { --mo: m-spin; --md: 1.2s; } .ag[data-motion="shake"] { --mo: m-shake; --md: .12s; } .ag[data-motion="slide"] { --mo: m-slide; --md: 1s; }
.ag[data-motion="drop"] { --mo: m-drop; --md: .5s; --mi: 1; } .ag[data-motion="pop"] { --mo: m-pop; --md: .35s; --mi: 1; } .ag[data-motion="drip"] { --mo: m-drip; --md: 1.4s; }
.ag[data-motion="float"] { --mo: m-float; --md: 2s; } .ag[data-motion="squash"] { --mo: m-squash; --md: .25s; --mi: 1; } .ag[data-motion="swing"] { --mo: m-swing; --md: .7s; }
.ag[data-motion="swing"] .art { transform-origin: top center; }
.ag[data-motion="topple"].on .pl { animation: m-topple .9s infinite; animation-delay: calc(var(--n) * 80ms); transform-origin: bottom right; }
.ag[data-motion="wave"].on .pl { animation: m-wave .8s ease-in-out infinite; animation-delay: calc(var(--n) * 100ms); }
.ag[data-motion="slide"].on .pl { transform: skewX(-8deg) scale(1.22); }
@keyframes m-wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes m-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes m-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes m-spin { to { transform: rotate(360deg); } }
@keyframes m-shake { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@keyframes m-slide { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
@keyframes m-drop { from { transform: translateY(-150px); } 70% { transform: translateY(0) scaleY(.8); } to { transform: none; } }
@keyframes m-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes m-drip { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.6) translateY(8px); } }
@keyframes m-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes m-squash { to { transform: scaleY(.6); } }
@keyframes m-swing { 0%, 100% { transform: rotate(-25deg); } 50% { transform: rotate(25deg); } }
@keyframes m-topple { 0%, 40% { transform: rotate(0); } 60% { transform: rotate(80deg); } 100% { transform: rotate(0); } }
@keyframes m-wave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hole { color: transparent !important; background: rgba(255,255,255,.12); border: 3px dashed #ffd23f; border-radius: 8px; min-width: .62em; height: 1.02em; }
.hole.cur { border-color: #fff; animation: curblink .9s infinite; }
@keyframes curblink { 50% { background: rgba(255,210,63,.4); } }
.pl.filled { animation: letterIn .35s cubic-bezier(.2,1.6,.4,1); }
.pic-cap { text-align: center; font-size: 24px; font-weight: 700; color: #ffe27a; margin-top: 14px; }
.pic-cap[hidden] { display: none; }
.pic.flash .pic-word { animation: trayflash .7s ease-out; }
.pic.static { padding-top: 6px; }
.chant-msg { text-align: center; font-size: 22px; font-weight: 700; color: #ffd23f; min-height: 30px; }
.call-row, .resp-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ctile { background: #1c1060; border: 2px solid #9a92ff; border-radius: 10px; padding: 0 14px; font-size: 24px; font-weight: 700; transition: transform .1s, background .1s; }
.ctile.lit { background: #2de2e6; color: #04283a; transform: scale(1.15); }
.rtile { display: flex; flex-direction: column; align-items: center; background: #120838; border: 3px solid var(--c); border-radius: 14px; padding: 2px 14px 4px; min-width: 74px; transition: transform .1s, background .1s; }
.rtile b { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vh, 42px); color: var(--c); line-height: 1.1; }
.rtile small { font-size: 18px; color: #fff; line-height: 1.1; }
.rtile.lit { background: var(--c); } .rtile.lit b, .rtile.lit small { color: #120838; }
.rtile.hop { transform: translateY(-10px); }
.resp-row.ghost .rtile b, .resp-row.ghost .rtile small { visibility: hidden; }
.shared { margin: auto; text-align: center; max-width: 760px; }
.shared-t { font-family: var(--display); font-size: 34px; color: #ffd23f; margin-bottom: 8px; }
.shared-l { font-size: 24px; line-height: 1.35; margin-bottom: 12px; }
.shared-k { font-size: 20px; color: #e2deff; }
.story .sc { color: var(--c); font-weight: 700; }
.qcard:has(#lesson:not([hidden])) .feedback { flex: 0 0 auto; min-height: 0; }
.qcard:has(#lesson:not([hidden])) .keyhints { display: none; }
.qcard:has(#lesson:not([hidden])) { gap: 8px; }
.pic-word { row-gap: .55em; }
.ag { margin: 0 5px; }
.reveal { max-height: 36vh; overflow: hidden; padding: 4px 10px; }
.reveal .pic { padding-top: 14px; min-height: 90px; }
.reveal .pic-word { font-size: clamp(34px, 5.4vh, 56px); }
.reveal .pic[data-size="m"] .pic-word { font-size: clamp(30px, 4.6vh, 46px); }
.reveal .backdrop { font-size: 64px; }
.reveal .pic-cap { font-size: 20px; }

.qcard.fixing .meters, .qcard.fixing .keyhints { display: none !important; }
.dots { gap: 4px; } .dots i { width: 11px; height: 11px; }
.row.big .lbl { width: 100%; }
.row.big .tile { min-width: 34px; height: 46px; font-size: 28px; }
.ls-body { justify-content: flex-start; overflow: hidden; }
.qcard:has(#lesson:not([hidden])) .prompt { display: none; }
.qcard:has(#lesson:not([hidden])) .country .en { display: none; }
.qcard:has(#lesson:not([hidden])) .meters { display: none !important; }
@media (max-height: 820px) {
  .story-line { font-size: clamp(20px, 3.1vh, 28px); line-height: 1.3; }
  .ltile { font-size: clamp(24px, 4vh, 34px); min-width: 40px; }
  .ltile.slot { min-width: 48px; min-height: 46px; }
  .rb { font-size: 26px; padding: 2px 12px 2px 42px; }
  .pic-word { font-size: clamp(46px, 9vh, 80px); }
  .qcard:has(#lesson:not([hidden])) .flag { font-size: 44px; }
  .qcard:has(#lesson:not([hidden])) .es { font-size: 34px; }
  .reveal { max-height: 24vh; }
  .reveal .pic-word { font-size: clamp(28px, 4.4vh, 44px); }
  .row.big .tile { height: 40px; font-size: 24px; min-width: 30px; }
}

.lesson .pic-word { font-size: clamp(56px, 13vh, 110px); }
.lesson .pic[data-size="m"] .pic-word { font-size: clamp(44px, 9.5vh, 84px); }

.fb-long .tile, .fb-long .row.big .tile { min-width: 24px; height: 31px; font-size: 19px; padding: 0 1px; border-radius: 6px; }
.fb-long .row .lbl, .fb-long .row.big .lbl { width: 88px; }
.fb-long .fb-title { font-size: 26px; }

.rtile { min-width: 96px; }
.rtile b { font-size: clamp(36px, 7vh, 60px); }
.rtile small { font-size: 20px; }
.ctile { font-size: 26px; padding: 2px 16px; }
.resp-row { gap: 14px; margin-top: 6px; } .call-row { margin-top: 10px; }
.chant-msg { font-size: 24px; margin-bottom: 6px; }
.cram-grid { grid-auto-rows: 1fr; align-content: stretch; }
.cram .cc .ct { font-size: clamp(26px, 4vh, 36px); }
.cram .cc .f { font-size: 40px; }
.cram .cc { padding: 4px 16px; }
/* Hint blanks: letters he still has to come up with. */
.pl.blank { color: transparent; min-width: .58em; height: 1.02em; margin: 0 .04em; border-bottom: 5px solid rgba(255,255,255,.7); border-radius: 2px; text-shadow: none; }
/* Cram sheet: cards keep their natural height and the sheet scrolls, so the key bar never sits on top of the last row. */
#s-cram .cram { height: 100%; overflow-y: auto; }
#s-cram .cram-grid { flex: 1 0 auto; grid-auto-rows: minmax(min-content, 1fr); }
#s-cram .res-actions { flex-shrink: 0; position: sticky; bottom: 0; z-index: 2; margin-top: 0; padding: 22px 0 8px; background: linear-gradient(rgba(16,8,48,0), rgba(16,8,48,.96) 40%); }
/* Tap targets for iPad: key labels act like the key. */
[data-key] { cursor: pointer; }
@media (max-height: 860px) {
  #s-cram .res-title { font-size: 30px; margin: 0; }
  #s-cram .cram { gap: 6px; }
  #s-cram .cram-grid { gap: 6px 12px; }
  #s-cram .cram .cc { padding: 2px 14px; }
  #s-cram .cram .cc .f { font-size: 30px; }
  #s-cram .cram .cc .cn, #s-cram .cram .cc .cm { font-size: 15px; }
  #s-cram .cram .cc .ct { font-size: clamp(20px, 3.3vh, 28px); }
  #s-cram .res-actions { padding-top: 8px; }
}
/* Capital names scale with width too, so long ones ("Ciudad de Guatemala") never wrap to two lines. */
#s-cram .cram .cc .ct { font-size: clamp(20px, min(3.3vh, 2.2vw), 34px); white-space: nowrap; }
#s-cram .cram .cc .f { font-size: clamp(26px, 4vh, 40px); }
@media (max-height: 680px) { #s-cram .cram .cc .cn, #s-cram .cram .cc .cm { font-size: 13px; } #s-cram .res-title { font-size: 24px; } }

/* ================= iPad / iPhone ================= */
/* The app fills the visible area (main.js sets --vvh/--vvt from visualViewport), so when the on-screen
   keyboard opens everything reflows above it instead of hiding behind it. */
:root { --hud: 72px; }
#app { inset: auto 0 auto 0; top: var(--vvt, 0px); height: var(--vvh, 100vh); }
#hud { top: env(safe-area-inset-top); height: var(--hud); padding-left: max(28px, env(safe-area-inset-left)); padding-right: max(28px, env(safe-area-inset-right)); }
#stage { top: calc(var(--hud) + env(safe-area-inset-top)); left: env(safe-area-inset-left); right: env(safe-area-inset-right); bottom: env(safe-area-inset-bottom); inset-block-end: env(safe-area-inset-bottom); }
.kb-open #stage { bottom: 0; }
.touch-only { display: none; }
.touch .touch-only { display: inline; }
.touch .kb-only { display: none !important; }
.touch body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
.touch #answer { -webkit-user-select: text; user-select: text; }
/* Key labels become buttons */
.touch [data-key] { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.3); border-bottom-width: 3px; border-radius: 999px; padding: 8px 20px; font-weight: 700; color: #fff; }
.touch [data-key]:active { transform: translateY(2px); background: rgba(255,255,255,.24); }
.touch [data-key] kbd, .touch .chip kbd, .touch .mode kbd, .touch .rb kbd { display: none; }
.touch .rb { padding-left: 16px; }
.touch .hint-btn { background: linear-gradient(120deg, #6334d6, #b8206e); border-color: rgba(255,255,255,.4); text-transform: capitalize; font-size: 20px; padding: 8px 24px; }
.touch .hint-btn::before { content: '💡'; }
.touch .keyhints { justify-content: center; }
.touch .cram-link { margin-top: 4px; }
.touch .mode.sel, .touch .mode:hover { transform: none; filter: none; }
.touch .mode.sel::after { content: none; }
.touch .mode:active { transform: scale(.98); filter: brightness(1.15); }
.touch .h2 small { display: none; }
.touch .dialog p[data-key], .touch .dialog p > [data-key] { margin: 6px 4px; }
/* Keyboard open: tighten the question card so the answer box and feedback fit above the keyboard */
.kb-open .qcard { gap: 6px; padding: 10px 18px; overflow-y: auto; }
.kb-open .flag { font-size: 40px; }
.kb-open .es { font-size: clamp(28px, 4.2vw, 40px); }
.kb-open .en { display: none; }
.kb-open .prompt { font-size: 17px; }
.kb-open .meters { gap: 10px; }
.kb-open .score b, .kb-open .combo span { font-size: 26px; }
.kb-open .score span, .kb-open .combo small { font-size: 13px; }
.kb-open .fuel { height: 12px; }
.kb-open .fuel-lbl { font-size: 14px; }
.kb-open #answer { font-size: 30px; padding: 4px 16px; border-width: 3px; }
.kb-open .feedback { flex: 0 0 auto; overflow: visible; }
.kb-open .reveal { max-height: none; }
.kb-open .reveal .pic-word { font-size: 30px; }
.kb-open .reveal .backdrop { font-size: 44px; }
.kb-open .lesson { flex: 0 0 auto; overflow: visible; }
.kb-open .touch .hint-btn, .touch.kb-open .hint-btn { padding: 4px 18px; font-size: 17px; }

/* iPad portrait and small laptops: menu stacks */
@media (max-width: 900px) {
  #s-menu.active { grid-template-columns: 1fr; overflow-y: auto; align-content: start; gap: 18px; }
  .menu-right .mapcard { flex: none; height: 260px; min-height: 0; }
  #menu-list { max-width: none; }
}

/* Phones */
@media (max-width: 760px) {
  :root { --hud: 54px; }
  #hud { gap: 8px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .brand { font-size: 19px; letter-spacing: 0; }
  .brand b { margin-left: 3px; }
  .rank { padding: 3px; gap: 0; }
  .rank-info, .xp-text { display: none; }
  .rank-badge { width: 32px; height: 32px; font-size: 18px; }
  .ready b { font-size: 22px; }
  .toggles { gap: 6px; }
  .chip { font-size: 0; gap: 0; padding: 6px 10px; }
  .chip .ico { font-size: 20px; }
  #btn-menu::before { content: '☰'; font-size: 20px; }
  .screen { padding: 4px 10px 10px; }
  /* menu */
  .logo { font-size: clamp(46px, 15vw, 70px); }
  .logo .l2 { margin-left: 24px; }
  .tag { font-size: 17px; margin: 10px 0; }
  .mode { gap: 12px; padding: 9px 16px; border-radius: 16px; }
  .mode .mt { font-size: 23px; }
  .mode small { font-size: 15px; }
  .menu-right .mapcard { height: 200px; }
  .plan { font-size: 17px; padding: 12px 16px; }
  .menu-foot { margin-top: 10px; }
  /* play: one column, small map strip on top (hidden while typing) */
  .play-grid { grid-template-columns: 1fr; grid-template-rows: 130px minmax(0, 1fr); gap: 8px; }
  .kb-open .play-grid { grid-template-rows: 0 minmax(0, 1fr); gap: 0; }
  .play-grid .mapcard { border-radius: 18px; }
  .map-badge { font-size: 17px; left: 10px; top: 8px; padding: 2px 12px; }
  .qcard { gap: 8px; padding: 12px 14px; border-radius: 20px; overflow-y: auto; }
  .q-top { gap: 8px; }
  .pill { font-size: 15px; padding: 2px 10px; }
  .q-count { font-size: 15px; }
  .dots i { width: 8px; height: 8px; }
  .country { gap: 10px; }
  .flag { font-size: 44px; }
  .es { font-size: clamp(26px, 8.5vw, 40px); overflow-wrap: normal; }
  .en { font-size: 16px; }
  .prompt { font-size: 17px; }
  .meters { gap: 10px; }
  .score b, .combo span { font-size: 26px; }
  .score span, .combo small { font-size: 13px; }
  .combo { min-width: 64px; }
  .fuel { height: 12px; }
  .fuel-lbl { font-size: 14px; }
  #answer { font-size: 28px; padding: 6px 14px; border-radius: 14px; border-width: 3px; }
  #answer::placeholder { font-size: 18px; }
  .feedback { font-size: 16px; flex: 0 0 auto; overflow: visible; }
  .fb-title { font-size: 22px; }
  .after-cap { font-size: clamp(26px, 8vw, 38px); }
  .after-cap small { font-size: 15px; }
  .story { font-size: 17px; }
  .tile, .row.big .tile, .fb-long .tile { min-width: 20px; height: 30px; font-size: 18px; padding: 0 2px; border-radius: 6px; }
  .tile.sp { min-width: 8px; }
  .row .lbl, .fb-long .row .lbl { width: 64px; font-size: 14px; }
  .reveal { padding: 4px 6px; border-radius: 14px; max-height: none; }
  .reveal .pic-word, .reveal .pic[data-size="m"] .pic-word { font-size: clamp(22px, 7vw, 32px); }
  .reveal .backdrop { font-size: 40px; }
  .reveal .pic-cap { font-size: 16px; }
  /* lesson channels */
  .lesson { padding: 8px 10px; border-radius: 14px; flex: 0 0 auto; overflow: visible; }
  .ls-chan { font-size: 15px; padding: 1px 10px; }
  .ls-step { display: none; }
  .ls-skip { font-size: 15px; }
  .story-line { font-size: 18px; line-height: 1.35; }
  .tray { gap: 12px; min-height: 0; }
  .tw { gap: 4px; }
  .ltile { font-size: 24px; min-width: 32px; padding: 0 6px; border-radius: 8px; border-width: 2px; }
  .ltile.slot { min-width: 34px; min-height: 36px; }
  .rb { font-size: 22px; padding: 2px 12px; border-radius: 10px; }
  .pool { gap: 8px; }
  .lesson .pic-word { font-size: clamp(32px, 10.5vw, 56px); }
  .lesson .pic[data-size="m"] .pic-word { font-size: clamp(26px, 8vw, 44px); }
  .pic-cap { font-size: 17px; }
  .backdrop { font-size: 70px; }
  .rtile { min-width: 58px; padding: 2px 8px; }
  .rtile b { font-size: 28px; }
  .rtile small { font-size: 14px; }
  .ctile { font-size: 17px; padding: 1px 10px; }
  .chant-msg, .rb-msg { font-size: 17px; }
  .true-chip { font-size: 15px; }
  .shared-t { font-size: 24px; } .shared-l { font-size: 18px; } .shared-k { font-size: 15px; }
  /* results */
  .res-title { font-size: 26px; }
  .res-big { font-size: clamp(64px, 22vw, 110px); }
  .res-sub, .good-note { font-size: 18px; }
  .stat { min-width: 120px; padding: 6px 12px; }
  .stat b { font-size: 26px; }
  .misses { grid-template-columns: 1fr; }
  .miss .c { font-size: 22px; }
  .res-actions { gap: 10px; font-size: 17px; }
  /* cram */
  #s-cram .cram-grid { grid-template-columns: 1fr; }
  #s-cram .res-title { font-size: 24px; }
  /* passport */
  #s-passport { overflow-y: auto; }
  .pass-grid { grid-template-columns: 1fr; height: auto; gap: 14px; }
  .pass-left .mapcard { flex: none; height: 200px; }
  .h2 { font-size: 26px; } .h2.small { font-size: 20px; }
  .ship { width: 88px; }
  .stars-grid { grid-template-columns: 1fr 1fr; }
  .cardlet .f { font-size: 26px; }
  .cardlet .n, .cardlet .cap, .cardlet .st { font-size: 15px; }
  /* overlays and effects */
  .dialog { padding: 18px 20px; font-size: 18px; margin: 0 12px; border-radius: 22px; }
  .dialog h2 { font-size: 36px; }
  .banner { font-size: 40px; }
  .float { font-size: 30px; } .float.combo { font-size: 36px; }
  .countdown { font-size: 110px; }
}
/* When the card scrolls (phone, keyboard open), its parts keep their natural height instead of being squeezed. */
.kb-open .qcard > *, .kb-open .lesson > * { flex-shrink: 0; }
@media (max-width: 760px) { .qcard > *, .lesson > * { flex-shrink: 0; } }
/* iPad portrait: top bar too narrow for the full chips */
@media (max-width: 1000px) {
  .xp-text { display: none; }
  .chip { font-size: 0; gap: 0; padding: 7px 12px; }
  .chip .ico { font-size: 20px; }
  #btn-menu::before { content: '☰'; font-size: 20px; }
  #btn-menu kbd { display: none; }
}
