/* LingoVerse — Neon Arcade · screens: map, play stage, exercises, arcade modes, views */

/* ================= MAP ================= */
.jtabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 14px; }
.jtab { position: relative; overflow: hidden; text-align: start; padding: 10px 14px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); box-shadow: 0 5px 0 var(--shadow); }
.jtab b { display: block; font-family: var(--font-d); font-size: 1.02rem; }
.jtab span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.jtab i { position: absolute; inset-inline-start: 0; bottom: 0; height: 5px; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.jtab.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, var(--panel)); box-shadow: 0 5px 0 color-mix(in srgb, var(--acc) 40%, #000), 0 0 20px color-mix(in srgb, var(--acc) calc(var(--glow-a) * 45%), transparent); }
.jtab:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--shadow); }
.map-meta { color: var(--muted); font-weight: 700; font-size: .88rem; margin: 0 0 12px; }
.resume { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 14px; border: 2px dashed var(--amb); background: color-mix(in srgb, var(--amb) 10%, var(--panel)); }
.resume > div { flex: 1; min-width: 160px; display: flex; flex-direction: column; } .resume span { color: var(--muted); font-size: .86rem; }
.resume-ic { color: var(--amb); }
.worlds { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin: 0 auto; }
.world { --wc: hsl(var(--wh) 95% 62%); border-radius: 18px; border: 2px solid color-mix(in srgb, var(--wc) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--wc) 12%, var(--panel)), var(--panel) 60%); box-shadow: 0 6px 0 var(--shadow); overflow: hidden; }
[data-theme="light"] .world { --wc: hsl(var(--wh) 75% 42%); }
.world.locked { filter: saturate(.35); opacity: .88; }
.world.current { border-color: var(--wc); box-shadow: 0 6px 0 var(--shadow), 0 0 26px color-mix(in srgb, var(--wc) calc(var(--glow-a) * 50%), transparent); }
.world-head { width: 100%; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 14px 16px; background: none; border: 0; text-align: start; color: var(--ink); }
.wnum { font-family: var(--font-d); font-weight: 800; font-size: .72rem; letter-spacing: .14em; color: var(--wc); padding: 3px 8px; border: 2px solid var(--wc); border-radius: 6px; white-space: nowrap; }
.wtitle { font-family: var(--font-d); font-weight: 800; font-size: 1.08rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
[dir="rtl"] .wtitle { text-align: end; }
.wprog { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-d); font-weight: 800; color: var(--muted); }
.chev { transition: transform .2s; color: var(--muted); }
.world.exp .chev { transform: rotate(90deg); }
[dir="rtl"] .chev { transform: scaleX(-1); } [dir="rtl"] .world.exp .chev { transform: rotate(90deg); }
.world-body { padding: 4px 12px 20px; }
.locked-body { text-align: center; padding: 10px 12px 6px; color: var(--muted); }
.big-lock { width: 38px; height: 38px; color: var(--dim); }
.medal-sm { display: inline-grid; place-items: center; } .medal-sm .ic { width: 20px; height: 20px; }
.m1 .ic, .medal-sm.m1 { color: #d08a4e; } .medal-sm.m2 { color: #c3cbe0; } .medal-sm.m3 { color: var(--amb); filter: drop-shadow(0 0 5px var(--amb)); }
.tiny-ic .ic { width: 16px; height: 16px; color: var(--amb); }
.track { position: relative; max-width: 520px; margin: 0 auto; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
[dir="rtl"] .trail { transform: scaleX(-1); }
.trail path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.trail-bg { stroke: var(--line); stroke-width: 8; stroke-dasharray: 2 14; }
.trail-fg { stroke: var(--wc); stroke-width: 6; filter: drop-shadow(0 0 6px var(--wc)); }
.node-wrap { position: absolute; inset-inline-start: var(--x); transform: translateX(-50%); width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 1; }
[dir="rtl"] .node-wrap { transform: translateX(50%); }
.node { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; border: 4px solid color-mix(in srgb, var(--wc) 70%, #fff); color: #fff; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--wc) 70%, #fff), var(--wc) 55%, color-mix(in srgb, var(--wc) 55%, #000)); box-shadow: 0 7px 0 color-mix(in srgb, var(--wc) 40%, #000), 0 0 22px color-mix(in srgb, var(--wc) calc(var(--glow-a) * 70%), transparent); transition: transform .1s; }
.node .ic { width: 30px; height: 30px; stroke-width: 2.6; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .4)); }
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 color-mix(in srgb, var(--wc) 40%, #000); }
.node.s-locked { background: var(--panel2); border-color: var(--line); color: var(--dim); box-shadow: 0 7px 0 color-mix(in srgb, var(--line) 70%, #000); }
.node.s-done { --wc: var(--lime); }
[data-theme="light"] .node.s-done { --wc: #3f9a10; }
.node.s-current { animation: nodePulse 1.6s ease-in-out infinite; }
@keyframes nodePulse { 50% { box-shadow: 0 7px 0 color-mix(in srgb, var(--wc) 40%, #000), 0 0 0 10px color-mix(in srgb, var(--wc) 25%, transparent), 0 0 30px var(--wc); } }
.node.n-scene:not(.s-locked) { --wc: var(--mag); }
.node.n-story:not(.s-locked) { --wc: var(--amb); }
.node.n-boss { width: 92px; height: 92px; border-radius: 26px; }
.node.n-boss:not(.s-locked) { --wc: var(--red); }
.node.n-boss.s-done { --wc: var(--amb); }
.node.n-boss .ic { width: 40px; height: 40px; }
.node-l { font-family: var(--font-d); font-weight: 800; font-size: .72rem; letter-spacing: .12em; color: var(--muted); background: var(--bg2); padding: 1px 8px; border-radius: 6px; margin-top: 6px; }
.nstars { display: flex; gap: 1px; } .nstars i .ic { width: 15px; height: 15px; color: var(--dim); fill: currentColor; } .nstars i.on .ic { color: var(--amb); filter: drop-shadow(0 0 3px var(--amb)); }
.nstars.out { font-family: var(--font-d); font-weight: 800; font-size: .6rem; letter-spacing: .12em; color: var(--cy); }
.start-tag { position: absolute; top: -30px; font-family: var(--font-d); font-weight: 800; font-size: .74rem; letter-spacing: .14em; background: var(--acc); color: var(--acc-ink); padding: 2px 10px; border-radius: 8px; animation: bob 1.2s ease-in-out infinite; box-shadow: 0 0 14px var(--acc); }
.start-tag::after { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--acc); }
.gate { position: absolute; inset-inline: 4%; height: 0; border-top: 4px dashed var(--red); z-index: 0; display: flex; justify-content: center; filter: drop-shadow(0 0 6px var(--red)); }
.gate span { margin-top: -13px; background: var(--panel); border: 2px solid var(--red); color: var(--red); font-family: var(--font-d); font-weight: 800; font-size: .66rem; letter-spacing: .12em; padding: 1px 10px; border-radius: 6px; text-transform: uppercase; }
.gate.open { border-top-color: color-mix(in srgb, var(--lime) 50%, transparent); filter: none; }
.gate.open span { border-color: var(--lime); color: var(--lime); }

/* ================= STAGE ================= */
.stage { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow: auto; }
.stage::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(800px 400px at 50% -10%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 70%); }
.in-stage { overflow: hidden; }
.st-wrap { position: relative; max-width: 900px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding: 12px 18px 0; }
.st-wrap.center { justify-content: center; padding-bottom: 24px; }
.st-top { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.st-prog { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.st-prog .track, .stage .track:not(.trail) { flex: 1; height: 16px; border-radius: 8px; background: var(--bg2); border: 2px solid var(--line); overflow: hidden; max-width: none; margin: 0; }
.st-prog .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); box-shadow: 0 0 12px var(--acc); transition: width .4s; }
.st-prog .track.fixing i { background: linear-gradient(90deg, var(--amb), var(--red)); }
.spd-time { font-family: var(--font-d); font-weight: 800; font-size: 1.5rem; min-width: 2ch; text-align: center; color: var(--amb); text-shadow: 0 0 10px var(--amb); }
.st-score { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-d); flex: 1; }
.st-score b { font-size: 1.6rem; color: var(--acc); text-shadow: 0 0 10px var(--acc); } .st-score span { color: var(--muted); font-size: .85rem; font-weight: 700; } .st-score .ic { align-self: center; color: var(--acc); }
.st-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 6px; font-family: var(--font-d); font-weight: 800; color: var(--muted); font-size: .88rem; letter-spacing: .06em; text-transform: uppercase; }
.tag-fix { font-style: normal; background: var(--amb); color: #1f1300; border-radius: 6px; padding: 0 8px; font-size: .72rem; animation: blink 1.4s infinite; }
.boss-hp { flex: 1; min-width: 120px; max-width: 280px; height: 12px; border-radius: 6px; border: 2px solid var(--red); background: var(--bg2); overflow: hidden; margin-inline-start: auto; }
.boss-hp i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--red) 0 8px, color-mix(in srgb, var(--red) 70%, #fff) 8px 10px); transition: width .4s; }
.combo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); font-family: var(--font-d); font-weight: 800; transition: .2s; }
.combo-x { font-size: 1.1rem; min-width: 2ch; color: var(--muted); }
.combo-bar { width: 46px; height: 8px; border-radius: 4px; background: var(--bg2); overflow: hidden; } .combo-bar i { display: block; height: 100%; background: currentColor; transition: width .3s; }
.combo-n { font-size: .8rem; color: var(--muted); }
.combo.m2 { border-color: var(--cy); color: var(--cy); box-shadow: 0 0 12px color-mix(in srgb, var(--cy) 50%, transparent); } .combo.m2 .combo-x { color: var(--cy); }
.combo.m3 { border-color: var(--mag); color: var(--mag); box-shadow: 0 0 16px color-mix(in srgb, var(--mag) 60%, transparent); } .combo.m3 .combo-x { color: var(--mag); }
.combo.m4 { border-color: var(--amb); color: var(--amb); box-shadow: 0 0 22px var(--amb); animation: comboFire .5s infinite alternate; } .combo.m4 .combo-x { color: var(--amb); }
@keyframes comboFire { to { box-shadow: 0 0 34px var(--amb), 0 0 6px var(--red) inset; } }
.hearts { display: inline-flex; gap: 2px; } .hearts span .ic { width: 26px; height: 26px; }
.hearts .on { color: var(--red); } .hearts .on .ic { fill: var(--red); filter: drop-shadow(0 0 5px var(--red)); } .hearts .off { color: var(--dim); opacity: .5; }
.st-body { flex: 1; padding: 8px 0 18px; }
.st-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 2; }
.pws { display: flex; gap: 8px; }
.pw { display: inline-flex; align-items: center; gap: 4px; min-height: 42px; padding: 0 10px; border-radius: 12px; border: 2px solid var(--acc2); background: color-mix(in srgb, var(--acc2) 14%, var(--panel)); color: var(--ink); font-family: var(--font-d); font-weight: 800; box-shadow: 0 4px 0 color-mix(in srgb, var(--acc2) 40%, #000); }
.pw:disabled { opacity: .35; border-color: var(--line); background: var(--panel); box-shadow: 0 4px 0 var(--shadow); cursor: not-allowed; }
.pw:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--acc2) 40%, #000); }
.st-go .btn { min-width: 160px; }
.stage.flash-ok::after, .stage.flash-no::after { content: ''; position: fixed; inset: 0; pointer-events: none; animation: flashA .45s forwards; }
.stage.flash-ok::after { box-shadow: inset 0 0 80px var(--lime); } .stage.flash-no::after { box-shadow: inset 0 0 90px var(--red); }
@keyframes flashA { to { opacity: 0; } }
.stage.slowmo::before { background: radial-gradient(circle, transparent 50%, color-mix(in srgb, var(--cy) 30%, transparent)); }
.stage.paused .inv-sky { filter: grayscale(.8) brightness(.7); }

/* feedback panel */
.fb { position: fixed; left: 0; right: 0; bottom: 0; max-height: 62vh; overflow: auto; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 3px solid; z-index: 3; animation: fbUp .25s cubic-bezier(.2, .9, .3, 1.2); }
.stage:has(.fb:not([hidden])) .st-body { padding-bottom: 260px; }
.stage:has(.fb:not([hidden])) .st-foot { visibility: hidden; }
.in-stage .toasts { top: 64px; }
.fb.good { background: color-mix(in srgb, var(--lime) 14%, var(--bg)); border-color: var(--lime); }
.fb.bad { background: color-mix(in srgb, var(--red) 14%, var(--bg)); border-color: var(--red); }
@keyframes fbUp { from { transform: translateY(60%); opacity: 0; } }
.fb-in { display: flex; gap: 14px; align-items: flex-start; max-width: 860px; margin: 0 auto; }
.fb-txt { flex: 1; min-width: 0; }
.fb-h { font-family: var(--font-d); font-weight: 800; font-size: 1.35rem; margin: 0; letter-spacing: .04em; }
.fb.good .fb-h { color: var(--lime); text-shadow: 0 0 12px color-mix(in srgb, var(--lime) 60%, transparent); } .fb.bad .fb-h { color: var(--red); }
.fb-xp { font-size: .9rem; color: var(--amb); margin-inline-start: 8px; }
.fb-ali-line { margin: 2px 0 6px; font-style: italic; color: var(--muted); font-weight: 700; }
.fb-ans { font-weight: 700; margin: 4px 0; } .fb-ans > span:first-child { color: var(--muted); }
.fb-why p { margin: 3px 0; }
.fb-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.ar { font-family: 'Baloo Bhaijaan 2', var(--font-b); color: color-mix(in srgb, var(--acc2) 70%, var(--ink)); font-weight: 500; font-size: 1.02rem; margin: 4px 0; }
mark { background: color-mix(in srgb, var(--acc) 26%, transparent); color: inherit; border-bottom: 3px solid var(--acc); border-radius: 4px; padding: 0 .12em; }

/* interstitial & results */
.interstitial, .result { text-align: center; max-width: 560px; margin: 0 auto; padding: 18px 8px; }
.interstitial .ali, .result .ali { margin: 0 auto; }
.result-sub { font-size: 1.1rem; font-weight: 700; }
.result-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.result-stats div { min-width: 92px; padding: 10px 12px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--shadow); }
.result-stats b { display: block; font-family: var(--font-d); font-size: 1.6rem; color: var(--acc); line-height: 1.1; }
.result-stats span { font-size: .8rem; color: var(--muted); font-weight: 700; }
.result-btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.stars { display: flex; justify-content: center; gap: 8px; margin: 6px 0; }
.stars span .ic { width: 52px; height: 52px; color: var(--dim); fill: currentColor; }
.stars span.on .ic { color: var(--amb); filter: drop-shadow(0 0 10px var(--amb)); }
.stars span.on { animation: starPop .5s cubic-bezier(.2, .9, .3, 1.6) both; animation-delay: var(--d); }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); } }
.medal { margin: 6px auto; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff8, transparent 60%), currentColor; animation: starPop .6s both; }
.medal .ic { width: 52px; height: 52px; color: #1b1440; }
.medal.m1 { color: #d08a4e; } .medal.m2 { color: #c3cbe0; } .medal.m3 { color: var(--amb); box-shadow: 0 0 40px var(--amb); }
.lvlup { display: flex; gap: 12px; align-items: center; text-align: start; padding: 12px 16px; border-radius: 14px; border: 2px solid var(--amb); background: color-mix(in srgb, var(--amb) 14%, var(--panel)); margin: 10px 0; }
.lvlup .ic { width: 34px; height: 34px; color: var(--amb); fill: var(--amb); } .lvlup div { display: flex; flex-direction: column; } .lvlup span { color: var(--muted); font-size: .9rem; }
.ach-new { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--amb) 18%, var(--panel)); border: 2px solid var(--amb); font-weight: 800; font-size: .88rem; }
.words-done { text-align: start; margin: 10px auto; max-width: 420px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.words-done summary { cursor: pointer; font-weight: 800; }
.words-done ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.words-done li { display: flex; align-items: center; gap: 8px; } .words-done em { color: var(--amb); font-size: .8rem; font-weight: 700; }
.hiscore { list-style: none; padding: 0; margin: 8px auto; max-width: 300px; counter-reset: hs; }
ol.hiscore li { counter-increment: hs; display: flex; justify-content: space-between; gap: 10px; padding: 4px 10px; border-bottom: 1px dashed var(--line); font-family: var(--font-d); }
ol.hiscore li::before { content: counter(hs) '.'; color: var(--muted); width: 2ch; } ol.hiscore li b { color: var(--acc); flex: 1; } ol.hiscore li span { color: var(--muted); font-size: .85rem; }
ol.hiscore.mini { margin: 6px 0; max-width: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.st-learned { background: var(--cy); } .dot.st-mastered { background: var(--lime); box-shadow: 0 0 6px var(--lime); } .dot.st-due { background: var(--amb); } .dot.st-tricky { background: var(--red); } .dot.st-seen { background: var(--muted); }

/* ================= EXERCISES ================= */
.ex-kicker { display: flex; align-items: center; gap: 8px; font-family: var(--font-d); font-weight: 800; letter-spacing: .12em; font-size: .78rem; color: var(--acc); margin: 4px 0 10px; text-transform: uppercase; }
.ex-q { font-family: var(--font-d); font-weight: 800; font-size: clamp(1.3rem, 3vw, 1.9rem); line-height: 1.25; margin: 6px 0 16px; }
.ex-q.sentence { font-family: var(--font-b); font-weight: 700; font-size: clamp(1.2rem, 2.6vw, 1.6rem); line-height: 1.6; }
.ex-q.ar-q { font-family: 'Baloo Bhaijaan 2', var(--font-d); color: color-mix(in srgb, var(--acc2) 60%, var(--ink)); }
.ex-q-sm { font-size: 1.1rem; font-weight: 700; margin: 4px 0 8px; }
.term { font-family: var(--font-d); font-weight: 800; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin: 0; color: var(--ink); text-shadow: 0 0 20px color-mix(in srgb, var(--acc) calc(var(--glow-a) * 70%), transparent); }
.term-sm { font-family: var(--font-d); font-weight: 800; font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.blank { display: inline-block; min-width: 5.5ch; border-bottom: 4px solid var(--acc); margin: 0 .15em; text-align: center; color: var(--acc); }
.blank i { display: inline-block; width: 100%; height: 1em; }
.blank.ok { color: var(--lime); border-color: var(--lime); } .blank.no { color: var(--red); border-color: var(--red); }
.snd { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--acc); background: color-mix(in srgb, var(--acc) 14%, var(--panel)); color: var(--acc); box-shadow: 0 3px 0 color-mix(in srgb, var(--acc) 40%, #000); flex: none; vertical-align: middle; }
.snd:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--acc) 40%, #000); }
.snd.big { width: 50px; height: 50px; } .snd.big .ic { width: 26px; height: 26px; }
.snd.huge { width: 104px; height: 104px; border-width: 4px; box-shadow: 0 7px 0 color-mix(in srgb, var(--acc) 40%, #000), 0 0 30px color-mix(in srgb, var(--acc) calc(var(--glow-a) * 60%), transparent); }
.snd.huge .ic { width: 50px; height: 50px; }
.listen-pad { text-align: center; margin: 8px 0 18px; }
.opts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.opt { display: flex; align-items: center; gap: 12px; text-align: start; min-height: 62px; padding: 12px 16px; border-radius: 16px; border: 3px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 800; font-size: 1.08rem; line-height: 1.3; box-shadow: 0 6px 0 color-mix(in srgb, var(--line) 80%, #000); transition: transform .08s, box-shadow .08s, border-color .15s; }
.opt:hover:not(:disabled) { border-color: var(--acc); }
.opt:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 80%, #000); }
.opt:disabled { cursor: default; }
.opt-t { flex: 1; min-width: 0; }
.opt.right { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 20%, var(--panel)); box-shadow: 0 6px 0 color-mix(in srgb, var(--lime) 40%, #000), 0 0 20px color-mix(in srgb, var(--lime) calc(var(--glow-a) * 70%), transparent); }
.opt.wrong { border-color: var(--red); background: color-mix(in srgb, var(--red) 18%, var(--panel)); animation: shake .4s; }
.opt.gone { opacity: .22; text-decoration: line-through; }
.opt kbd { flex: none; }

/* learn card */
.learn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.learn-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pos { color: var(--acc2); font-weight: 800; margin: 4px 0 10px; font-size: .95rem; }
.ipa { color: var(--muted); font-weight: 600; margin-inline-start: 6px; font-family: 'Segoe UI', system-ui, sans-serif; }
.learn-line { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line); }
.learn-line p { flex: 1; margin: 0; }
.meaning { font-size: 1.12rem; font-weight: 700; }
.example { font-size: 1.05rem; color: var(--ink); }
.chip.save { margin-top: 8px; } .chip.save.on { border-color: var(--amb); color: var(--amb); } .chip.save.on .ic { fill: var(--amb); }

/* tiles */
.clue { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin: 18px 0; }
.slot-word { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
.slot { width: 44px; height: 54px; border-radius: 10px; border: 3px dashed var(--line); background: var(--bg2); font-family: var(--font-d); font-weight: 800; font-size: 1.6rem; color: var(--ink); display: grid; place-items: center; text-transform: lowercase; padding: 0; }
.slot.filled { border-style: solid; border-color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, var(--panel)); }
.slot.space { width: 16px; border: 0; background: none; }
.slot.ok { border-color: var(--lime); color: var(--lime); } .slot.no { border-color: var(--red); color: var(--red); }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0; }
.tile { width: 52px; height: 56px; border-radius: 12px; border: 2px solid color-mix(in srgb, var(--acc2) 70%, #fff); background: linear-gradient(180deg, color-mix(in srgb, var(--acc2) 35%, var(--panel2)), color-mix(in srgb, var(--acc2) 18%, var(--panel))); color: var(--ink); font-family: var(--font-d); font-weight: 800; font-size: 1.6rem; box-shadow: 0 6px 0 color-mix(in srgb, var(--acc2) 40%, #000); padding: 0; }
.tile:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--acc2) 40%, #000); }
.tile:disabled { opacity: .18; box-shadow: none; transform: translateY(5px); }
.build-line { min-height: 70px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-radius: 14px; border: 3px dashed var(--line); background: var(--bg2); margin: 12px 0; }
.build-line.ok { border-color: var(--lime); border-style: solid; } .build-line.no { border-color: var(--red); border-style: solid; }
.build-line .placeholder { color: var(--muted); font-weight: 700; }
.wtile { min-height: 46px; padding: 6px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--panel2); color: var(--ink); font-weight: 800; font-size: 1.05rem; box-shadow: 0 5px 0 color-mix(in srgb, var(--line) 80%, #000); }
.wtile.in { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, var(--panel2)); }
.wtile:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 80%, #000); }
.tiles.words .wtile:disabled { opacity: .18; box-shadow: none; }
.dict-in { width: 100%; padding: 14px 16px; border-radius: 14px; border: 3px solid var(--line); background: var(--bg2); font-size: 1.2rem; font-weight: 700; resize: vertical; min-height: 84px; }
.dict-in:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 18px color-mix(in srgb, var(--acc) calc(var(--glow-a) * 50%), transparent); }
.diff { font-size: 1.15rem; font-weight: 700; line-height: 1.9; }
.diff span { padding: 1px 4px; border-radius: 4px; }
.d-ok { color: var(--lime); } .d-typo { color: var(--amb); text-decoration: underline wavy; } .d-miss { color: var(--red); background: color-mix(in srgb, var(--red) 15%, transparent); text-decoration: underline; } .d-extra { color: var(--muted); text-decoration: line-through; }

/* pairs */
.pairs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; perspective: 900px; }
.card { position: relative; aspect-ratio: 3/3.3; border: 0; padding: 0; background: none; transform-style: preserve-3d; transition: transform .35s; color: var(--ink); }
.card .face { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; border-radius: 14px; backface-visibility: hidden; border: 3px solid var(--line); font-weight: 800; font-size: .92rem; line-height: 1.25; overflow: hidden; }
.card .back { background: repeating-linear-gradient(45deg, var(--panel2) 0 10px, var(--panel) 10px 20px); color: var(--acc2); box-shadow: 0 5px 0 var(--shadow); }
.card .back .ic { width: 34px; height: 34px; }
.card .front { transform: rotateY(180deg); background: var(--panel); }
.card.is-term .front { font-family: var(--font-d); font-size: 1.15rem; color: var(--acc); }
.card.is-mean .front { font-size: .82rem; }
.card.up { transform: rotateY(180deg); }
.card.matched .front { border-color: var(--lime); background: color-mix(in srgb, var(--lime) 16%, var(--panel)); box-shadow: 0 0 14px color-mix(in srgb, var(--lime) 50%, transparent); }
.card:disabled { cursor: default; }
/* match */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mcol { display: flex; flex-direction: column; gap: 10px; }
.mt { min-height: 58px; padding: 8px 12px; border-radius: 14px; border: 3px solid var(--line); background: var(--panel); font-weight: 800; box-shadow: 0 5px 0 color-mix(in srgb, var(--line) 80%, #000); text-align: center; line-height: 1.25; }
.mt.sel { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 18%, var(--panel)); box-shadow: 0 5px 0 color-mix(in srgb, var(--acc) 40%, #000), 0 0 18px color-mix(in srgb, var(--acc) 50%, transparent); }
.mt.matched { border-color: var(--lime); opacity: .55; box-shadow: none; transform: translateY(4px); }
.mt.no { border-color: var(--red); }
/* true/false */
.tf-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 10px; }
.tf-dots i { width: 14px; height: 14px; border-radius: 4px; background: var(--line); }
.tf-dots i.cur { background: var(--acc); box-shadow: 0 0 8px var(--acc); } .tf-dots i.ok { background: var(--lime); } .tf-dots i.no { background: var(--red); }
.tf-card { text-align: center; padding: 20px; border-radius: 18px; border: 3px solid var(--acc2); background: var(--panel); box-shadow: 0 0 26px color-mix(in srgb, var(--acc2) calc(var(--glow-a) * 50%), transparent); }
.tf-eq { font-family: var(--font-d); font-size: 2rem; color: var(--acc2); margin: 0; line-height: 1; }
.timer { height: 10px; border-radius: 5px; background: var(--bg2); overflow: hidden; margin: 14px 0; border: 2px solid var(--line); }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), var(--amb), var(--lime)); animation: timer linear forwards; transform-origin: left; }
[dir="rtl"] .timer i { transform-origin: right; }
@keyframes timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 3px; font-size: .92rem; }
.tf-list li.ok::before { content: '✓ '; color: var(--lime); font-weight: 800; } .tf-list li.no::before { content: '✗ '; color: var(--red); font-weight: 800; }
/* literal */
.lit-card { padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 3px solid var(--amb); margin-bottom: 12px; position: relative; }
.lit-tag { position: absolute; top: -12px; inset-inline-start: 14px; background: var(--amb); color: #1f1300; font-family: var(--font-d); font-weight: 800; font-size: .7rem; letter-spacing: .14em; padding: 1px 10px; border-radius: 6px; }
.lit-card .sentence { margin: 6px 0 0; font-weight: 700; font-size: 1.1rem; }
/* speak */
.speak-card { text-align: center; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mic { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px auto; min-width: 220px; min-height: 64px; border-radius: 999px; border: 3px solid var(--mag); background: color-mix(in srgb, var(--mag) 18%, var(--panel)); color: var(--ink); font-family: var(--font-d); font-weight: 800; font-size: 1.15rem; box-shadow: 0 6px 0 color-mix(in srgb, var(--mag) 40%, #000); }
.mic .ic { width: 28px; height: 28px; }
.mic.live { animation: nodePulse 1s infinite; --wc: var(--mag); }
.heard { text-align: center; font-size: 1.1rem; }

/* ================= ARCADE MODES ================= */
.inv { height: 100vh; padding-bottom: 12px; }
.inv-sky { position: relative; flex: 1; min-height: 260px; margin: 8px 0; border-radius: 18px; overflow: hidden; border: 2px solid var(--line); background: radial-gradient(ellipse at 50% 120%, color-mix(in srgb, var(--acc2) 35%, transparent), transparent 60%), #05031a; }
[data-theme="light"] .inv-sky { background: radial-gradient(ellipse at 50% 120%, color-mix(in srgb, var(--acc2) 25%, transparent), transparent 60%), #1c1450; }
.stars-bg { position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 40% 70%, #fff9, transparent), radial-gradient(1px 1px at 85% 60%, #fff, transparent), radial-gradient(1px 1px at 10% 80%, #fff8, transparent), radial-gradient(1.5px 1.5px at 55% 45%, #fff, transparent); background-size: 220px 220px; animation: starsMove 20s linear infinite; opacity: .8; }
@keyframes starsMove { to { background-position: 0 220px; } }
.invader { position: absolute; top: 12px; inset-inline-start: var(--x, 20%); width: min(62%, 340px); padding: 34px 14px 12px; border-radius: 18px; border: 3px solid var(--mag); background: color-mix(in srgb, var(--mag) 22%, #0b0820); color: #fff; text-align: center; box-shadow: 0 0 28px var(--mag); will-change: transform; }
.invader p { margin: 0; font-weight: 800; font-size: 1.02rem; line-height: 1.3; }
.inv-ufo { position: absolute; top: -18px; left: 50%; width: 70px; height: 34px; margin-left: -35px; border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 50% 30%, var(--lime), color-mix(in srgb, var(--lime) 40%, #000)); box-shadow: 0 0 18px var(--lime); }
.inv-ufo::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 5px; background: repeating-linear-gradient(90deg, #fff 0 5px, transparent 5px 10px); animation: blink .4s infinite; }
.invader.boom { animation: boom .3s forwards; }
@keyframes boom { to { transform: scale(1.4); opacity: 0; filter: brightness(3); } }
.inv-laser { position: absolute; width: 6px; margin-left: -3px; background: linear-gradient(to top, var(--cy), #fff); box-shadow: 0 0 16px var(--cy), 0 0 4px #fff; opacity: 0; border-radius: 3px; }
.inv-laser.on { animation: laser .28s ease-out; }
@keyframes laser { 0% { opacity: 1; transform: scaleY(.1); transform-origin: bottom; } 40% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; } }
.inv-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: repeating-linear-gradient(90deg, var(--cy) 0 16px, transparent 16px 22px); box-shadow: 0 0 14px var(--cy); }
.inv-tip { position: absolute; bottom: 16px; width: 100%; text-align: center; margin: 0; color: #fff8; font-size: .82rem; font-weight: 700; pointer-events: none; }
.inv-guns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gun { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 14px; border-radius: 14px; border: 3px solid var(--cy); background: color-mix(in srgb, var(--cy) 12%, var(--panel)); color: var(--ink); font-family: var(--font-d); font-weight: 800; font-size: 1.1rem; box-shadow: 0 6px 0 color-mix(in srgb, var(--cy) 40%, #000); text-align: start; }
.gun:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 color-mix(in srgb, var(--cy) 40%, #000); }
.gun.no { border-color: var(--red); opacity: .55; }
.inv-tools { display: flex; justify-content: center; gap: 10px; padding-top: 10px; }
.rhythm { padding-bottom: 20px; }
.rh-q { font-family: var(--font-d); font-weight: 800; color: var(--muted); margin: 0; }
.rh-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 0; }
.rh-ring { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; border: 6px solid var(--acc); box-shadow: 0 0 26px var(--acc), inset 0 0 22px color-mix(in srgb, var(--acc) 40%, transparent); font-family: var(--font-d); font-weight: 800; font-size: 2.6rem; color: var(--acc); }
.rh-ring.pulse { animation: ring .45s ease-out; }
@keyframes ring { 0% { transform: scale(1.18); box-shadow: 0 0 60px var(--acc), inset 0 0 40px var(--acc); border-color: #fff; } 100% { transform: scale(1); } }
.rh-lights { display: flex; gap: 12px; } .rh-lights i { width: 18px; height: 18px; border-radius: 4px; background: var(--line); transition: .08s; }
.rh-lights i.on { background: var(--acc2); box-shadow: 0 0 14px var(--acc2); }
.rh-rate { min-height: 1.6em; font-family: var(--font-d); font-weight: 800; font-size: 1.6rem; margin: 0; letter-spacing: .1em; }
.rh-rate.r3 { color: var(--amb); text-shadow: 0 0 16px var(--amb); } .rh-rate.r2 { color: var(--lime); } .rh-rate.r1 { color: var(--cy); } .rh-rate.r0 { color: var(--red); }
.rh-rate.pop { animation: starPop .35s; }
.rh-term { font-family: var(--font-d); font-weight: 800; font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0; text-align: center; }
.rh-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rh-opt { min-height: 90px; font-size: 1rem; }
/* story */
.story-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.story-text { font-size: 1.18rem; line-height: 1.95; background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 18px 22px; box-shadow: 0 6px 0 var(--shadow); }
.story-text p { margin: 0 0 14px; } .story-text p:last-child { margin: 0; }
.sent { border-radius: 6px; transition: background .2s; padding: 2px 0; }
.sent.playing { background: color-mix(in srgb, var(--acc) 22%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
.gl { background: color-mix(in srgb, var(--amb) 18%, transparent); border: 0; border-bottom: 3px solid var(--amb); border-radius: 4px; padding: 0 3px; font-weight: 800; color: inherit; font-size: inherit; line-height: inherit; }
.mini-snd { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--panel2); color: var(--muted); vertical-align: middle; padding: 0; }
.mini-snd .ic { width: 14px; height: 14px; }
.gloss-card { position: sticky; bottom: 90px; display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--panel2); border: 2px solid var(--amb); box-shadow: 0 0 20px color-mix(in srgb, var(--amb) 40%, transparent); }
.gloss-card > div { flex: 1; } .gloss-card p { margin: 2px 0; }
/* scene */
.queue { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.q-lab { font-family: var(--font-d); font-weight: 800; font-size: .8rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.q-people { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; }
.q-people i { width: 12px; height: 20px; border-radius: 6px 6px 3px 3px; background: var(--amb); box-shadow: 0 0 6px color-mix(in srgb, var(--amb) 60%, transparent); }
.hype { flex: 1; height: 14px; border-radius: 7px; background: var(--bg2); overflow: hidden; border: 2px solid var(--line); min-width: 120px; } .hype i { display: block; height: 100%; background: linear-gradient(90deg, var(--mag), var(--amb)); transition: width .4s; }
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bubble { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 18px; background: var(--panel); border: 2px solid var(--line); }
.bubble p { margin: 0; flex: 1; font-weight: 700; font-size: 1.08rem; }
.ali-b { border-color: var(--acc); border-start-start-radius: 4px; }
.bubble.sys { flex-direction: column; gap: 4px; } .bubble.sys.good { border-color: var(--lime); } .bubble.sys.bad { border-color: var(--red); }
.replies { grid-template-columns: 1fr; }
.reply { font-size: 1rem; }

/* onboarding */
.onb { max-width: 760px; }
.onb-body { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px; padding: 20px 0; }
.onb-dots { display: flex; gap: 8px; margin: 0 auto; } .onb-dots i { width: 28px; height: 8px; border-radius: 4px; background: var(--line); } .onb-dots i.on { background: var(--acc); box-shadow: 0 0 10px var(--acc); } .onb-dots i.done { background: color-mix(in srgb, var(--acc) 50%, var(--line)); }
.attract { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.logo-big { font-family: 'Baloo 2', var(--font-d); font-weight: 800; font-size: clamp(2.6rem, 9vw, 4.6rem); letter-spacing: .06em; line-height: 1; color: var(--ink); text-shadow: 0 0 24px var(--acc), 4px 4px 0 var(--acc2); }
.neon-sub { letter-spacing: .5em; color: var(--acc2); font-size: .95rem; }
.onb-p { max-width: 520px; font-size: 1.08rem; font-weight: 700; }
.blink-btn { animation: blink 1.4s infinite; }
.blink-btn:focus-visible, .blink-btn:hover { animation: none; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg2); flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 14px; border: 0; background: none; color: var(--muted); font-weight: 800; }
.seg button.on { background: var(--acc); color: var(--acc-ink); }
.seg.big button { min-height: 50px; padding: 0 22px; font-size: 1.1rem; }
.onb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; width: 100%; }
.onb-cards.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.onb-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 16px; border-radius: 16px; border: 3px solid var(--line); background: var(--panel); color: var(--ink); box-shadow: 0 6px 0 var(--shadow); text-align: center; }
.onb-card b { font-family: var(--font-d); font-size: 1.2rem; } .onb-card span { color: var(--acc); font-weight: 800; } .onb-card small { color: var(--muted); font-weight: 700; }
.onb-card.on { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 16%, var(--panel)); box-shadow: 0 6px 0 color-mix(in srgb, var(--acc) 40%, #000), 0 0 22px color-mix(in srgb, var(--acc) calc(var(--glow-a) * 60%), transparent); }
.onb-preview { padding: 14px 18px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); max-width: 520px; }

/* ================= VIEWS ================= */
.pool-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 700; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.mode { --mc: var(--acc); position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 18px; border: 2px solid color-mix(in srgb, var(--mc) 55%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--mc) 16%, var(--panel)), var(--panel) 65%); box-shadow: 0 6px 0 var(--shadow); }
.mode h3 { font-family: var(--font-d); font-weight: 800; font-size: 1.25rem; margin: 0; }
.mode p { margin: 0; color: var(--muted); font-weight: 600; flex: 1; }
.mode .best { flex: 0; display: flex; align-items: center; gap: 6px; color: var(--ink); } .mode .best .ic { color: var(--amb); }
.mode .btn { align-self: flex-start; margin-top: 8px; }
.mode-ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--mc) 22%, var(--bg2)); color: var(--mc); border: 2px solid var(--mc); box-shadow: 0 0 16px color-mix(in srgb, var(--mc) calc(var(--glow-a) * 60%), transparent); }
.mode-ic .ic { width: 28px; height: 28px; }
.m-inv { --mc: var(--mag); } .m-rh { --mc: var(--cy); } .m-sv { --mc: var(--red); } .m-sp { --mc: var(--amb); } .m-tr { --mc: var(--lime); } .m-spk { --mc: #b48cff; }
.mode.off { opacity: .7; }
.review-card { flex-direction: row; align-items: center; gap: 16px; flex-wrap: wrap; --mc: var(--lime); }
.review-card > div { flex: 1; min-width: 220px; }
.review-card .btn { margin: 0; }
.review-card.hot { border-color: var(--lime); box-shadow: 0 6px 0 var(--shadow), 0 0 24px color-mix(in srgb, var(--lime) calc(var(--glow-a) * 50%), transparent); }
/* quests */
.quest { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.quest:last-of-type { border-bottom: 0; }
.q-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg2); color: var(--acc); border: 2px solid var(--line); flex: none; }
.q-body { flex: 1; min-width: 0; } .q-body p { margin: 0 0 4px; font-weight: 800; }
.qbar { position: relative; height: 16px; border-radius: 8px; background: var(--bg2); border: 2px solid var(--line); overflow: hidden; }
.qbar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: linear-gradient(90deg, var(--acc), var(--lime)); transition: width .5s; }
.qbar span { position: relative; display: block; text-align: center; font-size: .7rem; font-weight: 800; line-height: 12px; text-shadow: 0 0 3px var(--bg); }
.quest.done .q-ic { color: var(--lime); border-color: var(--lime); } .quest.claimed { opacity: .6; }
.q-rw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rw { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.rw .ic { width: 15px; height: 15px; color: var(--amb); }
.q-chest .ic { width: 28px; height: 28px; color: var(--dim); } .q-ok .ic { width: 28px; height: 28px; color: var(--lime); }
.chest-btn { animation: nodePulse 1.4s infinite; --wc: var(--acc); }
.invgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.inv-item { position: relative; padding: 14px; border-radius: 16px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--shadow); }
.inv-item h3 { margin: 6px 0 2px; font-family: var(--font-d); } .inv-item p { margin: 0; color: var(--muted); font-size: .88rem; font-weight: 600; }
.inv-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--acc2) 20%, var(--bg2)); color: var(--acc2); border: 2px solid var(--acc2); }
.inv-n { position: absolute; top: 14px; inset-inline-end: 14px; font-family: var(--font-d); font-size: 1.5rem; color: var(--acc); }
.ltable { list-style: none; padding: 0; margin: 0; }
.ltable li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.ltable li:nth-child(odd) { background: color-mix(in srgb, var(--bg2) 60%, transparent); }
.ltable li.up .lr { color: var(--lime); } .ltable li.down .lr { color: var(--red); }
.ltable li.me { background: color-mix(in srgb, var(--acc) 18%, var(--panel)); border: 2px solid var(--acc); box-shadow: 0 0 14px color-mix(in srgb, var(--acc) calc(var(--glow-a) * 50%), transparent); }
.lr { font-family: var(--font-d); font-weight: 800; width: 2ch; text-align: center; } .ln { flex: 1; font-weight: 800; } .lx { font-family: var(--font-d); }
.bot { font-style: normal; font-size: .62rem; letter-spacing: .1em; padding: 1px 6px; border-radius: 5px; background: var(--bg2); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; }
.league-mini { margin: 0 0 6px; } .league-last { font-weight: 800; color: var(--acc); }
/* words */
.wsearch { position: relative; max-width: 620px; }
.wsearch .ic { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px; color: var(--muted); }
.wsearch input { width: 100%; min-height: 52px; padding: 0 16px 0 46px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); font-size: 1.05rem; font-weight: 700; }
[dir="rtl"] .wsearch input { padding: 0 46px 0 16px; }
.wsearch input:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 16px color-mix(in srgb, var(--acc) calc(var(--glow-a) * 50%), transparent); }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 8px; }
.wcard { position: relative; display: flex; flex-direction: column; text-align: start; padding: 0; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); overflow: hidden; box-shadow: 0 5px 0 var(--shadow); }
.wcard:hover { border-color: var(--acc); }
.wc-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.wc-body b { font-family: var(--font-d); font-size: 1.1rem; }
.wc-pos { color: var(--acc2); font-size: .78rem; font-weight: 800; }
.wc-ar { color: var(--muted); font-size: .88rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wcard > .dot { position: absolute; top: 10px; inset-inline-end: 10px; width: 14px; height: 14px; border: 2px solid var(--panel); }
.wc-saved { position: absolute; top: 8px; inset-inline-start: 8px; color: var(--amb); } .wc-saved .ic { fill: var(--amb); }
.wsheet { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; }
.ws-loc { color: var(--muted); font-size: .88rem; font-weight: 700; }
.ws-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.ws-stats span { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 10px; background: var(--bg2); font-size: .74rem; color: var(--muted); font-weight: 700; text-align: center; }
.ws-stats b { font-family: var(--font-d); font-size: 1.1rem; color: var(--ink); }
/* stats */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px; border-radius: 16px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.kpi .ic { color: var(--acc); } .kpi b { font-family: var(--font-d); font-size: 1.6rem; line-height: 1.1; } .kpi span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.heat-wrap { display: flex; gap: 6px; max-width: 460px; }
.chart { max-height: 220px; }
.heat-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font-size: .62rem; color: var(--muted); font-weight: 700; }
.heat { flex: 1; display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.heat i, .legend i { aspect-ratio: 1; border-radius: 3px; background: var(--bg2); border: 1px solid var(--line); min-width: 8px; }
.h1 { background: color-mix(in srgb, var(--cy) 45%, var(--bg2)) !important; } .h2 { background: color-mix(in srgb, var(--lime) 35%, var(--bg2)) !important; } .h3 { background: color-mix(in srgb, var(--lime) 65%, var(--bg2)) !important; } .h4 { background: var(--lime) !important; box-shadow: 0 0 6px var(--lime); }
.heat i.h-1 { opacity: .25; }
.legend { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--muted); font-weight: 700; margin: 8px 0 0; flex-wrap: wrap; }
.legend i { width: 12px; height: 12px; display: inline-block; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: color-mix(in srgb, var(--acc) 70%, transparent); }
.chart .cum { fill: none; stroke: var(--acc2); stroke-width: 3; filter: drop-shadow(0 0 4px var(--acc2)); }
.chart .cum-dot { fill: var(--acc2); }
.chart .ax { fill: var(--muted); font-size: 10px; font-weight: 700; }
.chart { direction: ltr; }
.bar-key { background: var(--acc) !important; } .cum-key { background: var(--acc2) !important; border-radius: 50% !important; }
.jprog p { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; } .jprog span { color: var(--muted); font-size: .84rem; font-weight: 700; }
.hard { padding-inline-start: 1.2em; margin: 0 0 10px; } .hard li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; } .hard span { color: var(--muted); font-size: .86rem; }
.bests { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.bests div { padding: 8px 10px; border-radius: 10px; background: var(--bg2); } .bests dt { color: var(--muted); font-size: .8rem; font-weight: 700; } .bests dd { margin: 0; font-family: var(--font-d); font-size: 1.25rem; font-weight: 800; }
/* me */
.profile { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; } .profile > div { flex: 1; min-width: 220px; } .profile p { margin: 0; font-weight: 700; }
.swatches, .outfits { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.swatch, .outfit { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg2); color: var(--ink); font-weight: 800; font-size: .84rem; min-width: 104px; }
.swatch i { width: 44px; height: 44px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 16px var(--sw); }
.sw-cyan { --sw: #22e6ff; } .sw-magenta { --sw: #ff3df2; } .sw-lime { --sw: #a6ff3d; } .sw-amber { --sw: #ffc23d; } .sw-frost { --sw: #a8dcff; }
.swatch.on, .outfit.on { border-color: var(--acc); box-shadow: 0 0 16px color-mix(in srgb, var(--acc) calc(var(--glow-a) * 60%), transparent); background: color-mix(in srgb, var(--acc) 14%, var(--bg2)); }
.swatch[aria-disabled="true"], .outfit[aria-disabled="true"] { opacity: .55; }
.swatch em, .outfit em { position: absolute; top: 4px; inset-inline-end: 4px; font-style: normal; font-size: .66rem; display: inline-flex; align-items: center; gap: 2px; background: var(--panel); padding: 0 5px; border-radius: 6px; color: var(--muted); }
.swatch em .ic, .outfit em .ic { width: 11px; height: 11px; }
.outfit .ali { width: 60px; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ach { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); opacity: .55; filter: grayscale(.8); }
.ach.got { opacity: 1; filter: none; border-color: color-mix(in srgb, var(--amb) 60%, var(--line)); box-shadow: 0 0 14px color-mix(in srgb, var(--amb) calc(var(--glow-a) * 30%), transparent); }
.ach-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bg2); color: var(--amb); margin-bottom: 4px; }
.ach b { font-family: var(--font-d); } .ach small { color: var(--muted); font-weight: 600; line-height: 1.3; } .ach em { font-style: normal; font-size: .72rem; color: var(--acc); font-weight: 800; margin-top: 2px; }
.settings { display: flex; flex-direction: column; gap: 4px; }
.set, .tog { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.set > span, .tog > span { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.set small, .tog small { color: var(--muted); font-weight: 600; }
.set input[type="range"] { flex: 1; max-width: 220px; accent-color: var(--acc); }
.tog { cursor: pointer; position: relative; }
.tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tog > i { width: 52px; height: 30px; border-radius: 15px; background: var(--bg2); border: 2px solid var(--line); position: relative; flex: none; transition: .2s; }
.tog > i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: .2s; }
.tog input:checked + i { background: color-mix(in srgb, var(--acc) 30%, var(--bg2)); border-color: var(--acc); }
.tog input:checked + i::after { inset-inline-start: 25px; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.tog input:focus-visible + i { outline: 3px solid var(--acc); outline-offset: 3px; }
.data p { margin: 0 0 12px; }
/* sheets content */
.chest-open, .lvl-sheet, .boss-intro { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.chest { position: relative; width: 120px; height: 100px; margin: 10px auto; }
.chest .box { position: absolute; bottom: 0; left: 10px; right: 10px; height: 56px; background: repeating-linear-gradient(90deg, #a0602a 0 14px, #8a4f20 14px 16px); border: 4px solid #3b2416; border-radius: 6px; }
.chest .lid { position: absolute; top: 14px; left: 6px; right: 6px; height: 36px; background: #b8702f; border: 4px solid #3b2416; border-radius: 16px 16px 4px 4px; transform-origin: 10% 100%; animation: lid .6s .2s cubic-bezier(.2, .9, .3, 1.4) forwards; z-index: 1; }
.chest .glow { position: absolute; left: 50%; top: 40px; width: 10px; height: 10px; border-radius: 50%; background: var(--amb); box-shadow: 0 0 60px 30px var(--amb); opacity: 0; animation: fade .5s .45s reverse forwards; animation-name: glowIn; }
@keyframes glowIn { to { opacity: 1; } }
@keyframes lid { to { transform: rotate(-38deg) translate(-6px, -10px); } }
.loot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; } .loot .rw { font-size: 1rem; padding: 4px 12px; }
.boss-face .ic { width: 64px; height: 64px; color: var(--red); filter: drop-shadow(0 0 14px var(--red)); }
.rules { list-style: none; padding: 0; margin: 6px 0; text-align: start; display: grid; gap: 6px; }
.rules li { display: flex; gap: 10px; align-items: center; font-weight: 700; } .rules .ic { color: var(--acc2); }

/* ================= responsive tweaks ================= */
@media (max-width: 760px) {
  .jtabs { grid-template-columns: 1fr 1fr 1fr; gap: 6px; } .jtab { padding: 8px 8px 12px; } .jtab b { font-size: .86rem; } .jtab span { font-size: .72rem; }
  .world-head { grid-template-columns: auto 1fr auto; gap: 8px; padding: 12px; } .world-head .chev { display: none; } .wtitle { font-size: .98rem; }
  .node { width: 64px; height: 64px; } .node.n-boss { width: 80px; height: 80px; }
  .node-wrap { width: 96px; }
  .learn-grid, .wsheet { grid-template-columns: 1fr; }
  .opt { min-height: 56px; font-size: 1rem; padding: 10px 12px; }
  /* 8 cards: 2 × 4 on phones (3 columns left an orphan row and clipped long meanings) */
  .pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .card { aspect-ratio: 16/8.5; }
  .card .face { font-size: .8rem; padding: 6px 8px; } .card.is-term .front { font-size: 1rem; } .card.is-mean .front { font-size: .76rem; }
  .match { gap: 8px; } .mt { font-size: .88rem; padding: 6px 8px; }
  .st-wrap { padding: 8px 12px 0; } .fb { padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  .fb-in { flex-wrap: wrap; } .fb-ali { display: none; } .fb-btns { flex-direction: row; width: 100%; justify-content: flex-end; }
  .fb-btns .btn { flex: 1; }
  .st-top { gap: 8px; } .combo-bar { display: none; } .hearts span .ic { width: 22px; height: 22px; }
  .st-go .btn { min-width: 0; width: 100%; } .st-go { flex: 1; display: flex; justify-content: flex-end; }
  .slot { width: 36px; height: 46px; font-size: 1.3rem; } .tile { width: 46px; height: 50px; font-size: 1.4rem; }
  .gun { font-size: .98rem; min-height: 54px; padding: 6px 10px; }
  .invader { width: 76%; padding: 30px 10px 10px; } .invader p { font-size: .92rem; }
  .rh-ring { width: 118px; height: 118px; font-size: 2rem; } .rh-opt { min-height: 76px; font-size: .9rem; }
  .story-text { padding: 14px; font-size: 1.06rem; }
  .ws-stats { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr; }
  .bests { grid-template-columns: 1fr 1fr; }
  .review-card { flex-direction: column; align-items: flex-start; }
  .spd-time { font-size: 1.2rem; }
}
@media (max-width: 420px) {
  /* each word's slots shrink to fit one row at 360 px (--n = letters in that word) */
  .slot-word { gap: 3px; } .slot { width: min(36px, calc((100vw - 48px) / var(--n, 9) - 4px)); height: 42px; font-size: 1.1rem; border-width: 2px; }
}
@media (min-width: 1500px) { .worlds { max-width: 860px; } .track { max-width: 600px; } }
