@font-face { font-family: 'Nunito'; src: url(fonts/nunito.woff2) format('woff2'); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url(fonts/vazirmatn.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(fonts/jetbrains-mono.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }
#menu, .page { position: fixed; inset: 0; display: none; flex-direction: column; background: #EEF3F9; color: #24324A; z-index: 5; }
#menuTop, .pageTop { display: flex; align-items: center; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 10px; }
#menuTop h1, .pageTop h1 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -.01em; }
#menuBack, .pageBack { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 #C6D2E3; }
#menuBack svg, .pageBack svg { width: 22px; height: 22px; fill: none; stroke: #24324A; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
#menuBody, .pageBody { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 32px; }
#menu .hero { padding: 18px; border-radius: 24px; background: linear-gradient(160deg, #fff 60%, #E4F4E8); box-shadow: 0 5px 0 #C6D2E3; }
#menu .hero h2 { margin: 0 0 12px; font-size: 22px; font-weight: 900; }
#menu .totals { display: flex; gap: 10px; margin-bottom: 14px; }
#menu .totals span { flex: 1; padding: 8px; border-radius: 14px; background: #F1F5FA; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #6B778C; text-transform: uppercase; }
#menu .totals b { display: block; font-size: 24px; letter-spacing: 0; color: #24324A; }
#menuContinue { width: 100%; height: 54px; border: 0; border-radius: 20px; background: #4CC26E; box-shadow: 0 6px 0 #2F9450; color: #fff; font: inherit; font-size: 20px; font-weight: 800; transition: transform .08s, box-shadow .08s; }
#menuContinue:active { transform: translateY(4px); box-shadow: 0 2px 0 #2F9450; }
#menu section { margin-top: 28px; }
#menu section header { display: flex; justify-content: space-between; align-items: baseline; }
#menu section h3 { margin: 0; font-size: 18px; font-weight: 900; }
#menu section header span { font-size: 14px; font-weight: 800; color: #E0900C; }
#menu .blurb { margin: 2px 0 10px; font-size: 14px; font-weight: 600; color: #6B778C; }
#menu .bar { height: 8px; margin-bottom: 12px; border-radius: 4px; background: #D5DFEC; overflow: hidden; }
#menu .bar i { display: block; height: 100%; border-radius: 4px; background: #4CC26E; }
#menu .need { margin: 0 0 10px; padding: 8px 12px; border-radius: 12px; background: #E9EEF5; font-size: 14px; font-weight: 800; color: #6B778C; }
#menu .lvl { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 8px; padding-block: 8px; padding-inline: 8px 12px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #C6D2E3; color: #24324A; font: inherit; text-align: start; transition: transform .08s, box-shadow .08s; }
#menu .lvl:active { transform: translateY(3px); box-shadow: 0 1px 0 #C6D2E3; }
#menu .lvl.done:active { box-shadow: 0 1px 0 #A9D9B7; }
#menu .lvl.done { background: #DDF3E3; box-shadow: 0 4px 0 #A9D9B7; }
#menu .lvl.current { outline: 3px solid #FFC233; background: #FFF8DF; }
#menu .thumb { display: flex; flex: none; align-items: center; justify-content: center; width: 76px; height: 60px; border-radius: 12px; background: var(--bg, #DCE6F2); overflow: hidden; }
#menu .thumb canvas { width: 100%; height: 100%; object-fit: cover; }
#menu .info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#menu .info b { font-size: 16px; font-weight: 800; }
#menu .info small { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #6B778C; }
#menu .info em { display: flex; gap: 2px; }
#menu .info svg { width: 16px; height: 16px; stroke-width: 3.5; stroke-linejoin: round; }
#menu .info svg.on { fill: url(#gold); stroke: #E0900C; }
#menu .info svg.off { fill: rgba(36,50,74,.18); stroke: rgba(36,50,74,.18); }
#menu .gem { color: #E0900C; font-size: 18px; }
#menu .chev { font-size: 28px; color: #A3AEC2; }
#menu .strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; opacity: .55; }
#menu .strip .thumb { position: relative; width: auto; height: 56px; }
#menu .strip .thumb::after { content: '🔒'; position: absolute; inset-inline-end: 2px; bottom: 0; font-size: 12px; }
[dir=rtl] :is(#menuBack, .pageBack, #tipsBack, #undo) svg { transform: scaleX(-1); }
/* Spacing would break joined Arabic letters apart. */
[dir=rtl] * { letter-spacing: 0 !important; }
