/* Math Brain Boost: main styles. "Aurora glass" theme: frosted glass panels over a deep night gradient with slow-moving
 * colour glows. Mobile first; css/responsive.css adds landscape, desktop and lite mode (lite drops the blur and glows). */
@font-face { font-family: 'Nunito'; src: url('../assets/fonts/Nunito.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: 'Hind Siliguri'; src: url('../assets/fonts/HindSiliguri-500.woff2') format('woff2'); font-weight: 400 600; font-display: swap; unicode-range: U+0964-0965, U+0980-09FF, U+200C-200D, U+25CC; }
@font-face { font-family: 'Hind Siliguri'; src: url('../assets/fonts/HindSiliguri-700.woff2') format('woff2'); font-weight: 700 1000; font-display: swap; unicode-range: U+0964-0965, U+0980-09FF, U+200C-200D, U+25CC; }
:root {
  --bg: #0a0920;
  --ink: #f7f5ff; --muted: rgba(225, 222, 255, .74); --faint: rgba(225, 222, 255, .5); --line: rgba(255, 255, 255, .14);
  --primary: #b9a6ff; --primary-d: #8b5cf6; --accent: #ff9a62; --good: #4ade80; --bad: #fb7185; --gold: #fcd34d;
  --good-bg: rgba(34, 197, 94, .26); --bad-bg: rgba(244, 63, 94, .26);
  --g-primary: linear-gradient(135deg, #a855f7 0%, #7c3aed 45%, #4f46e5 100%);
  --g-daily: linear-gradient(135deg, #fbbf24 0%, #f97316 55%, #f43f5e 100%);
  --g-map: linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);
  --g-tricks: linear-gradient(135deg, #34d399 0%, #0d9488 100%);
  --g-danger: linear-gradient(135deg, #fb7185 0%, #e11d48 100%);
  --g-brand: linear-gradient(100deg, #c4b5fd 0%, #f0abfc 45%, #fdba74 100%);
  --glass: linear-gradient(150deg, rgba(255, 255, 255, .19) 0%, rgba(255, 255, 255, .07) 45%, rgba(255, 255, 255, .03) 100%);
  --glass-solid: rgba(255, 255, 255, .1);
  --glass-strong: linear-gradient(145deg, rgba(255, 255, 255, .22) 0%, rgba(255, 255, 255, .1) 100%);
  --glass-b: rgba(255, 255, 255, .2);
  --blur: blur(18px) saturate(170%);
  --radius: 20px;
  --shadow: 0 10px 30px rgba(3, 2, 20, .38), inset 0 1px 0 rgba(255, 255, 255, .22);
  --shadow-sm: 0 6px 16px rgba(3, 2, 20, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
  --gutter: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg); }
body { font-family: 'Nunito', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg);
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; overflow: hidden; }
/* Aurora background: three soft glows that drift slowly behind the glass. */
body::before, body::after { content: ''; position: fixed; inset: -20%; pointer-events: none; z-index: 0; }
body::before {
  background:
    radial-gradient(40% 34% at 15% 15%, rgba(168, 85, 247, .75), transparent 70%),
    radial-gradient(36% 32% at 88% 34%, rgba(34, 211, 238, .5), transparent 70%),
    radial-gradient(44% 36% at 22% 86%, rgba(236, 72, 153, .5), transparent 70%),
    radial-gradient(36% 30% at 90% 88%, rgba(250, 204, 21, .3), transparent 70%),
    linear-gradient(180deg, #120f35 0%, #0a0920 100%);
  animation: aurora 26s ease-in-out infinite alternate;
}
body::after { /* fine dot grid adds depth to the glass */
  inset: 0; opacity: .35;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%);
}
@keyframes aurora { 0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); } 50% { transform: translate3d(3%, -2%, 0) rotate(6deg) scale(1.06); } 100% { transform: translate3d(-3%, 3%, 0) rotate(-5deg) scale(1.02); } }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
img { display: block; }
[hidden] { display: none !important; }
::selection { background: rgba(168, 85, 247, .5); }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; height: 100vh; height: 100dvh; overflow: hidden; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; padding: max(10px, env(safe-area-inset-top)) var(--gutter) max(12px, env(safe-area-inset-bottom)); }
.screen.active { display: flex; animation: fadein .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes fadein { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }

/* Shared glass surface */
.glass, .rank-card, .lesson, .q-card, .info-row, .pill, .score-pill, .lvl, .world-tab, .trick-card, .set-row, .about, .res-grid div, .res-q, .opt, .btn.soft, .btn.hint, .icon-btn.glass-btn {
  background: var(--glass); border: 1px solid var(--glass-b); border-color: rgba(255, 255, 255, .32) rgba(255, 255, 255, .12) rgba(255, 255, 255, .07) rgba(255, 255, 255, .24);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow);
}

/* Buttons: bright gradient "jelly" buttons with a glossy top edge and a soft coloured glow. */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 18px; font-weight: 900; min-height: 48px; padding: 0 16px; color: #fff;
  background: var(--g-primary); box-shadow: 0 8px 22px -6px rgba(124, 58, 237, .7), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .16);
  transition: transform .1s, box-shadow .2s, filter .2s; text-align: center; line-height: 1.15; overflow: hidden; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.btn::after { content: ''; position: absolute; left: 6%; right: 6%; top: 2px; height: 45%; border-radius: 16px 16px 40% 40%; background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0)); pointer-events: none; }
.btn:active { transform: translateY(2px) scale(.985); filter: brightness(.95); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.big { min-height: 58px; font-size: 1.2rem; width: 100%; border-radius: 20px; }
.btn.mid { min-height: 50px; font-size: 1rem; }
.btn.small { min-height: 40px; font-size: .9rem; padding: 0 12px; }
.btn.primary { background: var(--g-primary); }
.btn.daily { background: var(--g-daily); box-shadow: 0 8px 22px -6px rgba(249, 115, 22, .7), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.btn.map { background: var(--g-map); box-shadow: 0 8px 22px -6px rgba(59, 130, 246, .7), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.btn.tricks { background: var(--g-tricks); box-shadow: 0 8px 22px -6px rgba(16, 185, 129, .65), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .14); }
.btn.danger { background: var(--g-danger); box-shadow: 0 8px 22px -6px rgba(225, 29, 72, .65), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn.soft { color: var(--ink); text-shadow: none; }
.btn.soft::after { display: none; }
.btn.primary.big { animation: glow 3.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 10px 34px -4px rgba(168, 85, 247, .85), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .16); } }
.ic { width: 24px; height: 24px; flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }
.ic-s { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; }
.icon-btn { position: relative; width: 46px; height: 46px; border-radius: 15px; background: var(--glass); border: 1px solid var(--glass-b); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); flex: none; transition: transform .1s; }
.icon-btn img { width: 24px; height: 24px; }
.icon-btn.map-btn { background: var(--g-map); border-color: rgba(255, 255, 255, .3); }
.icon-btn:active { transform: scale(.94); }

/* Language swap (home) and labelled Home button (play) */
.lang-swap, .home-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 13px 0 10px; border-radius: 999px; color: var(--ink); font: inherit; font-weight: 900; font-size: .92rem;
  background: var(--glass); border: 1px solid var(--glass-b); border-color: rgba(255, 255, 255, .34) rgba(255, 255, 255, .12) rgba(255, 255, 255, .07) rgba(255, 255, 255, .24);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .1s; flex: none; white-space: nowrap; }
.lang-swap:active, .home-pill:active { transform: scale(.95); }
.lang-swap { position: absolute; top: max(10px, env(safe-area-inset-top)); right: var(--gutter); z-index: 3; }
.lang-swap .ic-s { width: 18px; height: 18px; vertical-align: 0; }
.home-pill { height: 46px; padding: 0 12px 0 10px; border-radius: 15px; }
.home-pill img { width: 22px; height: 22px; }
html.bn body { line-height: 1.45; }
html.bn .btn, html.bn .opt { letter-spacing: 0; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 8px; }
.topbar h2 { flex: 1; margin: 0; font-size: 1.3rem; font-weight: 1000; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 7px 12px; font-weight: 900; font-size: .9rem; white-space: nowrap; box-shadow: var(--shadow-sm); }
.spacer { width: 46px; }

/* Home */
#home { justify-content: space-between; overflow-y: auto; }
.home-top { position: relative; text-align: center; padding-top: 2px; }
.home-top::before { content: ''; position: absolute; left: 50%; top: 6px; width: 150px; height: 150px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 114, 182, .55), rgba(168, 85, 247, .25) 45%, transparent 70%); filter: blur(6px); z-index: -1; }
.mascot { width: 116px; height: 116px; margin: 0 auto -2px; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(236, 72, 153, .45)); }
@keyframes bob { 50% { transform: translateY(-7px) rotate(-2deg); } }
.brand { margin: 0; font-size: 2.3rem; line-height: 1.05; font-weight: 1000; letter-spacing: -.5px; color: #fff; text-shadow: 0 4px 24px rgba(168, 85, 247, .45); }
.brand span, .brand em { font-style: normal; background: var(--g-brand); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.tagline { margin: 6px 0 0; color: var(--muted); font-weight: 700; font-size: .95rem; letter-spacing: .2px; }
.rank-card { border-radius: 22px; padding: 13px 15px; margin: 12px 0; position: relative; overflow: hidden; }
.rank-card::before { content: ''; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, rgba(252, 211, 77, .35), transparent 70%); pointer-events: none; }
.rank-title { font-weight: 1000; font-size: 1.15rem; background: var(--g-brand); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.rank-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: .92rem; }
.rank-stats b { font-size: 1.05rem; }
.rank-stats small { color: var(--muted); font-weight: 700; }
.rank-stats .streak b { color: var(--accent); }
.rank-bar { height: 9px; background: rgba(255, 255, 255, .12); border-radius: 99px; margin-top: 9px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3); }
.rank-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a855f7, #f472b6, #fbbf24); border-radius: 99px; transition: width .8s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 12px rgba(244, 114, 182, .8); }
.rank-next { color: var(--muted); font-size: .8rem; font-weight: 700; margin-top: 5px; }
.home-actions { display: flex; flex-direction: column; gap: 11px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.row2 .btn { padding: 0 8px; font-size: .95rem; }
.credit { text-align: center; color: var(--faint); font-size: .76rem; font-weight: 800; letter-spacing: .6px; margin: 10px 0 0; }
#home-daily small { display: block; font-size: .78rem; font-weight: 700; opacity: .92; }

/* Map */
.world-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 9px; scrollbar-width: none; flex: none; }
.world-tabs::-webkit-scrollbar { display: none; }
.world-tab { flex: none; min-width: 44px; height: 44px; border-radius: 14px; font-weight: 1000; box-shadow: var(--shadow-sm); transition: transform .15s; }
.world-tab.on { background: var(--wc, var(--primary-d)); border-color: rgba(255, 255, 255, .55); color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15), 0 6px 20px -4px var(--wc, var(--primary-d)); transform: translateY(-1px); }
.world-tab.locked { opacity: .45; }
.world-head { position: relative; overflow: hidden; border-radius: 22px; color: #fff; padding: 12px 16px; flex: none; border: 1px solid rgba(255, 255, 255, .3);
  background: linear-gradient(135deg, var(--wc, var(--primary-d)), rgba(20, 16, 60, .55) 140%); box-shadow: 0 12px 30px -10px var(--wc, var(--primary-d)), inset 0 1px 0 rgba(255, 255, 255, .35); }
.world-head::after { content: ''; position: absolute; right: -20px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .16); }
.world-head b { font-size: 1.18rem; display: block; text-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.world-head span { font-size: .85rem; font-weight: 800; opacity: .95; }
.level-grid { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: minmax(54px, 1fr); gap: 9px; padding: 11px 0; min-height: 0; }
.lvl { position: relative; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 1000; font-size: 1.2rem; min-height: 48px; transition: transform .12s; }
.lvl:active { transform: scale(.95); }
.lvl .st { display: flex; gap: 0; margin-top: 2px; }
.lvl .st img { width: 13px; height: 13px; }
.lvl.locked { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .08); color: var(--faint); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.lvl.locked img.lk { width: 18px; height: 18px; opacity: .4; }
.lvl.current { border: 2px solid var(--wc, var(--primary)); background: linear-gradient(145deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .08)); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, .08), 0 0 26px var(--wc, rgba(168, 85, 247, .7)); } }
.lvl .new { position: absolute; top: -7px; right: -5px; background: var(--g-daily); color: #fff; font-size: .58rem; padding: 2px 6px; border-radius: 8px; letter-spacing: .4px; box-shadow: 0 3px 10px rgba(249, 115, 22, .55); }
.world-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: none; }

/* Intro / lesson */
.intro-world { font-weight: 800; color: var(--muted); text-align: center; margin-bottom: 10px; letter-spacing: .3px; }
.lesson { border-radius: 24px; padding: 18px; position: relative; overflow: hidden; }
.lesson::before { content: ''; position: absolute; left: -40px; top: -50px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(168, 85, 247, .35), transparent 70%); pointer-events: none; }
.lesson .tag { display: inline-block; background: var(--g-daily); color: #fff; font-weight: 1000; font-size: .74rem; border-radius: 9px; padding: 4px 9px; letter-spacing: .8px; box-shadow: 0 4px 14px -2px rgba(249, 115, 22, .6); }
.lesson h3 { margin: 10px 0 6px; font-size: 1.4rem; position: relative; }
.lvl .st-in { display: inline-flex; }
.lesson .tip, .lesson-plain .tip { font-weight: 800; color: var(--primary); margin: 0 0 10px; position: relative; }
.lesson ol, .lesson-plain ol { margin: 0 0 12px; padding-left: 22px; position: relative; }
.lesson li, .lesson-plain li { margin: 4px 0; font-weight: 600; }
.lesson li::marker, .lesson-plain li::marker { color: var(--primary); font-weight: 900; }
.example { position: relative; background: rgba(10, 8, 35, .35); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; padding: 11px 13px; }
.example .eq { font-weight: 1000; font-size: 1.25rem; color: #fff; }
.example .steps { color: var(--muted); font-weight: 700; margin-top: 4px; }
.example .steps div::before { content: '→ '; color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; position: relative; }
.chip { background: rgba(168, 85, 247, .22); border: 1px solid rgba(196, 181, 253, .4); color: #ede9fe; border-radius: 99px; padding: 5px 11px; font-weight: 800; font-size: .85rem; }
.intro-info { margin-top: 12px; display: grid; gap: 9px; }
.info-row { display: flex; justify-content: space-between; align-items: center; border-radius: 16px; padding: 11px 14px; font-weight: 700; box-shadow: var(--shadow-sm); }
.info-row b { font-weight: 1000; }
.stars-row { display: inline-flex; gap: 2px; vertical-align: middle; }
.stars-row img { width: 20px; height: 20px; }
.bottom-actions { flex: none; padding-top: 10px; }
.rules { color: var(--muted); font-size: .88rem; font-weight: 700; line-height: 1.45; }
.rules b { color: var(--ink); }

/* Play */
.play-top { margin-bottom: 4px; }
.play-head { flex: 1; text-align: center; min-width: 0; }
.play-title { font-weight: 1000; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 5px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, .2); transition: transform .2s, background .2s; }
.dots i.now { background: #fff; transform: scale(1.25); box-shadow: 0 0 10px rgba(255, 255, 255, .9); }
.dots i.ok { background: var(--good); box-shadow: 0 0 8px rgba(74, 222, 128, .8); }
.dots i.no { background: var(--bad); box-shadow: 0 0 8px rgba(251, 113, 133, .8); }
.score-pill { border-radius: 16px; padding: 5px 11px; min-width: 66px; text-align: center; line-height: 1.05; box-shadow: var(--shadow-sm); }
.score-pill b { display: block; font-size: 1.18rem; color: var(--gold); text-shadow: 0 0 12px rgba(252, 211, 77, .45); }
.score-pill small { color: var(--muted); font-weight: 800; font-size: .7rem; }
.timer { position: relative; height: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12); border-radius: 99px; overflow: hidden; flex: none; margin: 4px 0 10px; }
.timer i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #22c55e, #a3e635); border-radius: 99px; transform-origin: left; box-shadow: 0 0 14px rgba(163, 230, 53, .65); }
.timer i.warn { background: linear-gradient(90deg, #f59e0b, #fb923c); box-shadow: 0 0 14px rgba(251, 146, 60, .7); }
.timer i.late { background: linear-gradient(90deg, #f43f5e, #fb7185); box-shadow: 0 0 14px rgba(251, 113, 133, .8); }
.timer span { position: absolute; right: 8px; top: -1px; font-size: .7rem; font-weight: 1000; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.play-body { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.q-card { position: relative; border-radius: 26px; padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; min-height: 120px; }
.q-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(80% 60% at 50% 45%, rgba(168, 85, 247, .16), transparent 70%); }
.q-meta { position: relative; display: flex; justify-content: space-between; color: var(--muted); font-weight: 800; font-size: .85rem; }
.streak-tag { color: var(--accent); }
.q-text { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 1000; font-size: clamp(1.45rem, 7.4vw, 2.4rem); line-height: 1.2; padding: 8px 0; word-break: break-word;
  color: #fff; text-shadow: 0 2px 18px rgba(168, 85, 247, .55); letter-spacing: .2px; }
.q-text.long { font-size: clamp(1.1rem, 5.2vw, 1.6rem); }
.q-text.xlong { font-size: clamp(1rem, 4.5vw, 1.35rem); }
.tip-box { position: relative; background: rgba(252, 211, 77, .12); border: 1px dashed rgba(252, 211, 77, .7); border-radius: 16px; padding: 9px 11px; font-weight: 700; font-size: .92rem; color: #fef3c7; }
.tip-box b { color: var(--gold); }
.answers { flex: none; display: flex; flex-direction: column; gap: 10px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { min-height: 64px; border-radius: 20px; color: #fff; font-weight: 1000; font-size: clamp(1.1rem, 5.4vw, 1.45rem); padding: 6px 8px; position: relative; overflow: hidden;
  transition: transform .1s, background .2s, border-color .2s, box-shadow .2s; border-width: 1.5px; }
.opt::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent); pointer-events: none; }
.opt .k { position: absolute; left: 9px; top: 7px; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: .62rem; color: var(--ink); background: rgba(255, 255, 255, .16); font-weight: 1000; }
.opt:active { transform: scale(.97); }
.opt.gone { visibility: hidden; }
.opt.right { background: linear-gradient(145deg, rgba(74, 222, 128, .45), rgba(22, 163, 74, .3)); border-color: #86efac; color: #fff; box-shadow: 0 0 0 1px rgba(134, 239, 172, .4), 0 0 26px rgba(74, 222, 128, .55); animation: ping .5s ease-out; }
.opt.wrong { background: linear-gradient(145deg, rgba(251, 113, 133, .45), rgba(225, 29, 72, .3)); border-color: #fda4af; color: #fff; box-shadow: 0 0 0 1px rgba(253, 164, 175, .4), 0 0 26px rgba(244, 63, 94, .5); animation: shake .35s ease-in-out; }
@keyframes ping { 40% { transform: scale(1.04); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.opt.dim { opacity: .4; }
.options.small .opt { font-size: clamp(.95rem, 4.3vw, 1.15rem); }
.hints { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.hint { color: var(--ink); min-height: 44px; font-size: .95rem; text-shadow: none; box-shadow: var(--shadow-sm); }
.btn.hint::after { display: none; }
.btn.hint small { color: #fda4af; font-weight: 1000; }
.btn.hint.used { opacity: .35; }

/* Feedback (inside the question card, so the coloured answers stay visible) */
.q-card.done { overflow-y: auto; }
.q-card.done .q-text { flex: none; font-size: clamp(1.15rem, 5.5vw, 1.6rem); padding: 4px 0 8px; }
.q-card.done .q-text.long, .q-card.done .q-text.xlong { font-size: clamp(.95rem, 4.2vw, 1.15rem); }
.q-card.done .tip-box { display: none; }
.feedback { position: relative; animation: fadein .25s ease-out; }
.fb-head { font-weight: 1000; font-size: 1.35rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.fb-head.ok { color: var(--good); text-shadow: 0 0 18px rgba(74, 222, 128, .5); }
.fb-head.no { color: var(--bad); text-shadow: 0 0 18px rgba(251, 113, 133, .45); }
.fb-head img { width: 30px; height: 30px; border-radius: 50%; padding: 5px; }
.fb-head.ok img { background: linear-gradient(135deg, #4ade80, #16a34a); box-shadow: 0 0 14px rgba(74, 222, 128, .7); }
.fb-head.no img { background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 0 14px rgba(251, 113, 133, .7); }
.fb-head small { color: var(--muted) !important; text-shadow: none; }
.fb-points { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0 9px; }
.fb-points span { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px; padding: 3px 9px; font-weight: 800; font-size: .85rem; }
.fb-points .plus { background: rgba(74, 222, 128, .18); border-color: rgba(134, 239, 172, .4); color: #bbf7d0; }
.fb-points .minus { background: rgba(251, 113, 133, .18); border-color: rgba(253, 164, 175, .4); color: #fecdd3; }
.fb-trick { background: rgba(10, 8, 35, .38); border: 1px solid rgba(196, 181, 253, .25); border-left: 4px solid #a78bfa; border-radius: 14px; padding: 10px 12px; }
.fb-trick-name { font-weight: 1000; color: var(--primary); font-size: .95rem; }
.fb-trick-name small { color: var(--muted); font-weight: 800; }
.fb-trick-x { font-weight: 700; margin-top: 3px; line-height: 1.4; color: #eeeaff; }

/* Result */
.res-stars { display: flex; justify-content: center; gap: 8px; margin: 6px 0 2px; }
.res-stars img { width: 64px; height: 64px; filter: drop-shadow(0 0 14px rgba(252, 211, 77, .55)); }
.res-stars img[src*="empty"] { filter: none; opacity: .35; }
.res-stars img.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.res-stars img:nth-child(2) { transform: translateY(-12px); width: 76px; height: 76px; }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } }
.res-score { text-align: center; }
.res-score b { font-size: 3.2rem; font-weight: 1000; display: block; line-height: 1.05; background: var(--g-brand); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(244, 114, 182, .4)); }
.res-score small { color: var(--muted); font-weight: 800; }
.res-msg { text-align: center; font-weight: 800; margin: 8px 0 12px; }
.res-msg .best { display: inline-block; background: var(--g-daily); color: #fff; border-radius: 8px; padding: 2px 8px; margin-left: 4px; font-size: .8rem; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.res-grid div { border-radius: 16px; padding: 9px; text-align: center; font-weight: 700; font-size: .8rem; color: var(--muted); box-shadow: var(--shadow-sm); }
.res-grid b { display: block; color: #fff; font-size: 1.2rem; }
.res-tricks { margin-top: 14px; }
.res-tricks h4 { margin: 0 0 7px; }
.res-q { display: flex; gap: 9px; align-items: flex-start; border-radius: 14px; padding: 9px 11px; margin-bottom: 7px; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow-sm); }
.res-q i { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; color: #fff; font-weight: 900; font-size: .8rem; background: linear-gradient(135deg, #4ade80, #16a34a); }
.res-q i.no { background: linear-gradient(135deg, #fb7185, #e11d48); }
.res-q small { display: block; color: var(--muted); }
.res-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 9; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 1.8s ease-in forwards; box-shadow: 0 0 6px currentColor; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .7; } }

/* Tricks */
.tw-head { display: flex; align-items: center; gap: 8px; margin: 14px 0 7px; font-weight: 1000; }
.tw-head i { width: 12px; height: 12px; border-radius: 4px; background: var(--wc); box-shadow: 0 0 10px var(--wc); }
.tw-head small { color: var(--muted); font-weight: 800; }
.trick-card { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; border-radius: 16px; padding: 10px 13px; margin-bottom: 7px; min-height: 54px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--wc); }
.trick-card b { display: block; font-size: 1rem; }
.trick-card small { color: var(--muted); font-weight: 700; display: block; line-height: 1.3; }
.trick-card.locked { opacity: .5; border-left-color: rgba(255, 255, 255, .2); }
.trick-card .lk { width: 20px; height: 20px; opacity: .5; margin-left: auto; flex: none; }

/* Settings */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 16px; padding: 10px 13px; margin-bottom: 9px; font-weight: 800; min-height: 60px; box-shadow: var(--shadow-sm); }
.toggle { width: 58px; height: 34px; border-radius: 99px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .2); position: relative; transition: background .2s; flex: none; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.toggle[aria-checked="true"] { background: linear-gradient(135deg, #4ade80, #16a34a); box-shadow: 0 0 14px rgba(74, 222, 128, .5); }
.toggle[aria-checked="true"] i { left: 27px; }
.seg { display: flex; background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .12); border-radius: 13px; padding: 3px; }
.seg button { min-width: 56px; min-height: 40px; border-radius: 10px; font-weight: 800; font-size: .9rem; color: var(--muted); }
.seg button.on { background: var(--g-primary); color: #fff; box-shadow: 0 4px 14px -3px rgba(124, 58, 237, .8); }
.set-note { color: var(--muted); font-size: .85rem; font-weight: 700; margin: -2px 4px 10px; }
.about { border-radius: 16px; padding: 4px 14px; font-weight: 600; line-height: 1.45; box-shadow: var(--shadow-sm); }
.about h3 { margin: 10px 0 4px; }
.small { font-size: .82rem; color: var(--muted); }

/* Modal: a frosted sheet over a blurred, dimmed screen */
.modal { position: absolute; inset: 0; background: rgba(6, 5, 22, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: flex-end; justify-content: center; z-index: 20; animation: fadein .18s; }
.sheet { position: relative; width: 100%; max-height: 88%; overflow-y: auto; border-radius: 28px 28px 0 0; padding: 20px var(--gutter) max(18px, env(safe-area-inset-bottom)); animation: up .3s cubic-bezier(.2, .8, .2, 1);
  background: linear-gradient(160deg, rgba(58, 44, 130, .82), rgba(20, 16, 58, .9)); border: 1px solid rgba(255, 255, 255, .2); border-bottom: 0; -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .25); }
.sheet::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); margin: -8px auto 10px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet h3 { margin: 4px 56px 8px 0; font-size: 1.4rem; }
.close-btn { position: absolute; right: 14px; top: 14px; }
.modal-actions { display: grid; gap: 10px; margin-top: 14px; }
.modal-actions.two { grid-template-columns: 1fr 1fr; }
.help p { margin: 6px 0; font-weight: 600; line-height: 1.45; }
.help table { width: 100%; border-collapse: collapse; font-weight: 700; font-size: .9rem; }
.help td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.help td:last-child { text-align: right; color: var(--gold); font-weight: 1000; }

.toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: rgba(30, 24, 80, .85); border: 1px solid rgba(255, 255, 255, .22); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  color: #fff; font-weight: 800; padding: 11px 17px; border-radius: 16px; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; max-width: 90%; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.loading { position: absolute; inset: 0; background: rgba(10, 9, 32, .7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; z-index: 40; font-weight: 800; }
.spinner { width: 44px; height: 44px; border: 5px solid rgba(255, 255, 255, .15); border-top-color: #c084fc; border-radius: 50%; animation: spin .8s linear infinite; box-shadow: 0 0 20px rgba(192, 132, 252, .4); }
@keyframes spin { to { transform: rotate(360deg); } }

/* BrainCooker: keep the top bar clear of the platform Home button (set by the BrainCooker SDK). */
.topbar { padding-left: var(--bc-home-inset, 0px); }
