/* Abacus Buddy — one warm, bright look on purpose (kids' toy-shelf feel). */
:root {
  --paper: #FFF6E3; --paper-2: #FFECC7; --card: #FFFFFF;
  --ink: #3A2416; --ink-soft: #7A5B45;
  --wood: #B8732F; --wood-dark: #6B3F1D; --wood-light: #E3A55C;
  --bead-1: #FF6B4A; --bead-1d: #C8412A;   /* ones: coral */
  --bead-10: #3DA5F4; --bead-10d: #1F6FB5; /* tens: sky */
  --bead-100: #2FBF8F; --bead-100d: #1B8563;
  --sun: #FFC53D; --mint: #2FBF8F; --berry: #E5484D; --grape: #8E6CEF;
  --radius: 22px;
  --display: 'Baloo 2', 'Baloo Thambi 2', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper);
  background-image: radial-gradient(circle at 12% 8%, #FFE2A8 0 90px, transparent 91px), radial-gradient(circle at 92% 30%, #FFE9C0 0 60px, transparent 61px);
  background-attachment: fixed;
  color: var(--ink); font: 600 17px/1.45 var(--body);
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
}
#app { overflow-x: clip; max-width: 620px; margin: 0 auto; padding-inline: 16px; padding-block: 0 40px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 4px solid var(--bead-10); outline-offset: 3px; border-radius: 12px; }
[hidden] { display: none !important; }
.display { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
.eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.lead { font-size: 19px; margin: 8px 0; text-wrap: pretty; }
.muted { color: var(--ink-soft); font-size: 15px; margin: 6px 0; }
.tiny { font-size: 12px; margin: 2px 0 10px; }
.center { text-align: center; }

/* top bar */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; align-items: center; gap: 10px; padding-block: 12px; background: linear-gradient(var(--paper) 75%, transparent); }
.brand { font-family: var(--display); font-size: 21px; white-space: nowrap; }
.brand b { color: var(--bead-1d); }
.top-title { flex: 1; margin: 0; font: 800 20px/1.1 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand + .top-title { flex: 1; }
.round { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; background: var(--card); box-shadow: 0 3px 0 #E4CFA8; font-size: 22px; display: grid; place-items: center; }
.round:active { transform: translateY(2px); box-shadow: 0 1px 0 #E4CFA8; }
.round.small { width: 38px; height: 38px; font-size: 17px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; background: var(--card); font-weight: 800; font-size: 15px; white-space: nowrap; box-shadow: 0 2px 0 #E4CFA8; font-variant-numeric: tabular-nums; }
.chip.gold { background: #FFF1C2; color: #8A5A00; }
.chip.fire { background: #FFE0D6; color: #B2361E; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 54px; padding: 10px 18px; border: 0; border-radius: 18px; background: var(--card); box-shadow: 0 5px 0 #E1C79A; font-weight: 800; font-size: 17px; transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #E1C79A; }
.btn.primary { background: var(--mint); color: #fff; box-shadow: 0 5px 0 #1B8563; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.btn.primary:active { box-shadow: 0 2px 0 #1B8563; }
.btn.danger { background: #FFE3E1; color: #A3262A; box-shadow: 0 5px 0 #F0B7B4; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-soft); }
.btn.small { min-height: 42px; font-size: 15px; }
.btn:disabled { opacity: .45; transform: none; }
.btn.wide { width: 100%; }
.btn.pulse { animation: pulse 1.1s ease-in-out infinite; }
.linkish { display: block; margin: 18px auto 0; border: 0; background: none; color: var(--ink-soft); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.row.center { justify-content: center; }
.row .btn { flex: 1 1 0; min-width: 0; padding-inline: 10px; }
.stack { display: grid; gap: 12px; margin-top: 18px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 6px 0 #EFD9B0; margin: 14px 0; }
.card h3 { margin: 0 0 12px; font: 800 20px var(--display); }

/* Babi */
.babi { width: 64px; height: 64px; flex: none; overflow: visible; }
.babi.big { width: 130px; height: 130px; }
.bob { animation: bob 2.6s ease-in-out infinite; }
.talk { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.talk-babi .babi { width: 62px; height: 62px; }
.talk-text { position: relative; flex: 1; margin: 0; padding: 12px 16px; background: var(--card); border-radius: 20px; box-shadow: 0 4px 0 #EFD9B0; font-size: 18px; font-weight: 700; min-height: 52px; display: flex; align-items: center; }
.talk-text::before { content: ''; position: absolute; left: -9px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-right-color: var(--card); border-left: 0; }

/* welcome */
.welcome { padding-top: 18px; }
.hero { display: flex; align-items: center; gap: 14px; margin: 8px 0 6px; }
.hero .display { font-size: clamp(38px, 10vw, 54px); color: var(--wood-dark); }
.form label { display: block; margin: 18px 0 8px; font-weight: 800; }
.form label:first-child { margin-top: 0; }
input:not([type]), input[type=text] { width: 100%; min-height: 56px; padding: 10px 16px; border: 3px solid #EAD5AE; border-radius: 16px; background: #FFFBF2; font-size: 20px; font-weight: 700; }
input:focus { border-color: var(--bead-10); outline: none; }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatar { aspect-ratio: 1; max-width: 100%; border: 3px solid transparent; border-radius: 16px; background: #FFF4DC; font-size: 26px; padding: 0; }
.avatar.on { border-color: var(--sun); background: #FFE7A3; transform: scale(1.06); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { border: 3px solid #EAD5AE; border-radius: 18px; background: #FFFBF2; padding: 12px; text-align: left; min-height: 56px; }
.choice b { display: block; font-size: 17px; }
.choice small { display: block; color: var(--ink-soft); font-size: 13px; line-height: 1.25; margin-top: 2px; }
.choice.on { border-color: var(--mint); background: #E3F8EF; }
.form .btn.primary { margin-top: 22px; }

/* home */
.hello { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }
.hello > div:nth-child(2) { flex: 1; min-width: 0; }
.hello .display { font-size: 34px; overflow-wrap: anywhere; }
.kid-avatar { width: 62px; height: 62px; border-radius: 20px; background: var(--card); display: grid; place-items: center; font-size: 36px; box-shadow: 0 4px 0 #EFD9B0; }
.mission { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 26px; background: linear-gradient(135deg, #FFD35C, #FFB23D); box-shadow: 0 7px 0 #D98A1C; }
.mission b { font: 800 21px/1.15 var(--display); display: block; }
.mission .eyebrow { color: #7A4A00; }
.mission > div:nth-child(2) { flex: 1; }
.mission .go { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 22px; color: var(--mint); box-shadow: 0 3px 0 #D98A1C; }
.mission:active { transform: translateY(3px); box-shadow: 0 4px 0 #D98A1C; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.tile { border-radius: 24px; padding: 16px; min-height: 132px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }
.tile span { font-size: 36px; line-height: 1; margin-bottom: auto; }
.tile b { font: 800 24px/1.1 var(--display); }
.tile small { font-weight: 700; opacity: .92; }
.tile.learn { background: var(--bead-10); box-shadow: 0 7px 0 var(--bead-10d); }
.tile.practice { background: var(--bead-1); box-shadow: 0 7px 0 var(--bead-1d); }
.tile.play { background: var(--grape); box-shadow: 0 7px 0 #6446C4; }
.tile.free { background: var(--mint); box-shadow: 0 7px 0 #1B8563; }
.tile:active { transform: translateY(4px); box-shadow: none; }
.grownups { display: block; text-align: center; padding: 12px; color: var(--ink-soft); font-weight: 700; }

/* ============ THE ABACUS ============ */
.abacus { --bw: 72px; --bh: 34px; --gap: 18px; margin: 6px auto; width: max-content; max-width: 100%; }
.abacus.rods-1 { --bw: 96px; --bh: 42px; --gap: 60px; }
.abacus.rods-3 { --bw: 64px; --bh: 32px; --gap: 10px; }
@media (max-width: 380px) { .abacus { --bw: 62px; --bh: 30px; --gap: 10px; } .abacus.rods-1 { --bw: 86px; --bh: 38px; } .abacus.rods-3 { --bw: 54px; --bh: 27px; --gap: 6px; } }
.ab-readout { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 6px; color: var(--ink-soft); font-weight: 800; }
.ab-readout b { font: 800 34px/1 var(--display); color: var(--ink); min-width: 1.5ch; text-align: center; font-variant-numeric: tabular-nums; }
.ab-frame { position: relative; padding: 14px 18px 10px; border-radius: 26px; background: linear-gradient(160deg, var(--wood-light), var(--wood) 45%, #9A5B22); box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -4px 0 rgba(0,0,0,.18), 0 8px 0 var(--wood-dark), 0 16px 28px rgba(107,63,29,.25); }
.ab-rods { display: flex; gap: var(--gap); padding: 8px 14px; border-radius: 16px; background: linear-gradient(#FFF9EE, #F7E7C8); box-shadow: inset 0 3px 8px rgba(107,63,29,.25); }
.ab-rod { position: relative; width: var(--bw); display: flex; flex-direction: column; align-items: center; --c: var(--bead-1); --cd: var(--bead-1d); border-radius: 14px; transition: background .25s; }
.ab-rod[data-rod="1"] { --c: var(--bead-10); --cd: var(--bead-10d); }
.ab-rod[data-rod="2"] { --c: var(--bead-100); --cd: var(--bead-100d); }
.ab-rod.glow { background: rgba(255,197,61,.35); box-shadow: 0 0 0 4px rgba(255,197,61,.55); }
.ab-digit { font: 800 20px/1 var(--display); color: var(--cd); height: 22px; font-variant-numeric: tabular-nums; }
.ab-stick { position: absolute; top: 26px; bottom: 26px; left: 50%; width: 6px; margin-left: -3px; border-radius: 3px; background: linear-gradient(90deg, #8C5A2E, #D6A36A, #8C5A2E); }
.abacus.nodigits .ab-stick { top: 4px; }
.ab-upper { position: relative; width: 100%; height: calc(var(--bh) * 2); }
.ab-lower { position: relative; width: 100%; height: calc(var(--bh) * 5); }
.ab-beam { position: relative; z-index: 2; width: 100%; height: 14px; }
.ab-rods { position: relative; }
.ab-rods::after { content: ''; position: absolute; z-index: 1; left: 0; right: 0; top: calc(8px + var(--dh) + var(--bh) * 2); height: 14px; background: linear-gradient(#7A461F, #5A3216); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.abacus { --dh: 22px; }
.abacus.nodigits { --dh: 0px; }
.ab-beam i { z-index: 3; position: absolute; left: 50%; top: 4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #FFD98E; }
.ab-label { margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.bead { touch-action: none; user-select: none; -webkit-user-select: none; position: absolute; left: 0; width: 100%; height: var(--bh); padding: 0; border: 0; background: transparent; z-index: 1; transition: transform .22s cubic-bezier(.3,1.4,.5,1); }
.bead::before { content: ''; position: absolute; inset: 2px 0; border-radius: 50% / 50%; background: radial-gradient(ellipse at 50% 28%, rgba(255,255,255,.75) 0 12%, transparent 30%), linear-gradient(var(--c), var(--cd)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18), 0 2px 3px rgba(0,0,0,.2); clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%); border-radius: 40%; }
.bead:not(.on)::before { filter: saturate(.3) brightness(1.18); opacity: .8; }
.bead:active::before { filter: brightness(1.1); }
.bead.upper { top: 0; transform: translateY(0); }
.bead.upper.on { transform: translateY(var(--bh)); }
/* lower bead i: resting at (i+1)*bh, pushed up to i*bh */
.bead.lower { top: 0; transform: translateY(calc((var(--i) + 1) * var(--bh))); }
.bead.lower.on { transform: translateY(calc(var(--i) * var(--bh))); }
.abacus.locked .bead { cursor: default; }
.abacus.shake .ab-frame { animation: shake .4s; }
.abacus.yay .ab-frame { animation: yay .6s; }
.abacus.parts .ab-frame::after { content: 'frame'; position: absolute; right: -6px; top: -12px; background: var(--sun); color: var(--ink); font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.abacus.parts .ab-beam::after { content: '← middle bar'; position: absolute; left: 100%; top: -5px; white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--ink); background: var(--sun); padding: 1px 7px; border-radius: 99px; margin-left: 6px; }
.abacus.parts .ab-upper::after { content: '5 bead'; position: absolute; right: -76px; top: 8px; font-size: 12px; font-weight: 800; background: #fff; padding: 1px 7px; border-radius: 99px; }
.abacus.parts .ab-lower::after { content: '1 beads'; position: absolute; right: -80px; top: 60px; font-size: 12px; font-weight: 800; background: #fff; padding: 1px 7px; border-radius: 99px; }

/* lessons & practice */
.progress { height: 14px; border-radius: 99px; background: #F2DDB5; overflow: hidden; margin: 4px 0 8px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--bead-1)); border-radius: 99px; transition: width .4s; }
.goal { text-align: center; font: 800 24px var(--display); margin: 4px 0; }
.goal b { display: inline-grid; place-items: center; min-width: 54px; height: 54px; padding: 0 10px; border-radius: 16px; background: var(--bead-1); color: #fff; font-size: 34px; margin-left: 6px; }
.equation { text-align: center; font: 800 40px/1 var(--display); margin: 8px 0; font-variant-numeric: tabular-nums; }
.equation.big { font-size: clamp(44px, 13vw, 64px); }
.equation b { color: var(--bead-1); }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.opt { min-height: 72px; border: 0; border-radius: 20px; background: var(--card); box-shadow: 0 5px 0 #E1C79A; font: 800 32px var(--display); }
.opt:active { transform: translateY(3px); box-shadow: 0 2px 0 #E1C79A; }
.opt.right { background: var(--mint); color: #fff; box-shadow: 0 5px 0 #1B8563; opacity: 1; }
.opt.wrong { background: #FFE3E1; color: #A3262A; animation: shake .4s; }
.opt:disabled:not(.right) { opacity: .5; }
.dots { display: flex; justify-content: center; gap: 8px; margin: 6px 0; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: #F0D9AE; transition: transform .2s; }
.dots i.now { transform: scale(1.35); background: #fff; box-shadow: inset 0 0 0 3px var(--sun); }
.dots i.gold { background: var(--sun); box-shadow: none; }
.dots i.ok { background: var(--mint); box-shadow: none; }
.dots i.miss { background: #F4B7AE; box-shadow: none; }
.plan { background: var(--card); border-radius: 18px; padding: 14px 16px 14px 36px; margin: 8px 0; box-shadow: 0 4px 0 #EFD9B0; }
.plan li { margin: 6px 0; }
.plan li.watch { list-style: none; margin-left: -20px; }
.friends { display: grid; gap: 8px; margin: 12px 0; }
.pair { display: grid; grid-template-columns: 1fr auto auto auto 1fr auto; align-items: center; gap: 8px; background: var(--card); border-radius: 16px; padding: 8px 12px; box-shadow: 0 3px 0 #EFD9B0; }
.pair b { font: 800 26px var(--display); }
.pair em { font-style: normal; color: var(--ink-soft); }
.pair strong { font-family: var(--display); color: var(--mint); }
.pair .dots { display: block; text-align: right; color: var(--bead-1); letter-spacing: -2px; font-size: 13px; overflow-wrap: anywhere; margin: 0; }
.pair .dots.b { text-align: left; color: var(--bead-10); }
.quiz p { text-align: center; font: 800 26px var(--display); margin: 14px 0 0; }

/* maps */
.path { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 12px; }
.stone:nth-child(4n+2), .stone:nth-child(4n+3) { margin-left: 28px; }
.stone a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 22px; background: var(--card); box-shadow: 0 5px 0 #EFD9B0; }
.stone-emoji { width: 50px; height: 50px; border-radius: 16px; background: #FFF1D2; display: grid; place-items: center; font-size: 28px; flex: none; }
.stone a > span:nth-child(2) { flex: 1; }
.stone small { display: block; color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.stone b { font: 800 19px/1.15 var(--display); }
.stone-end { font-size: 22px; }
.stone.next a { background: #FFF5CF; box-shadow: 0 5px 0 #F0C24A, 0 0 0 3px var(--sun); }
.stone.done .stone-emoji { background: #DDF6EC; }
.stone.locked a { opacity: .55; box-shadow: none; background: #FBEFD9; }
.levels { display: grid; gap: 10px; margin: 10px 0; }
.level { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: var(--card); box-shadow: 0 5px 0 #EFD9B0; }
.level.current { box-shadow: 0 5px 0 #F0C24A, 0 0 0 3px var(--sun); }
.level.locked { opacity: .55; box-shadow: none; background: #FBEFD9; }
.lv-emoji { font-size: 32px; width: 44px; text-align: center; }
.lv-body { flex: 1; min-width: 0; }
.lv-body small { display: block; color: var(--ink-soft); font-size: 13px; }
.lv-body b { display: block; font: 800 19px/1.15 var(--display); }
.lv-body em { display: block; font-style: normal; font-size: 14px; color: var(--ink-soft); }
.stars { white-space: nowrap; font-size: 20px; letter-spacing: -1px; }
.stars i { font-style: normal; color: #EBD6AC; }
.stars i.on { color: var(--sun); text-shadow: 0 2px 0 #D98A1C; }
.big-stars .stars { font-size: 56px; }
.intro { text-align: center; }
.lv-big { font-size: 64px; line-height: 1; }
.notice { display: flex; align-items: center; gap: 10px; text-align: left; margin: 16px 0; padding: 12px; border-radius: 18px; background: #EAF5FF; }
.notice p { margin: 0; }
.intro .btn + .btn { margin-top: 12px; }
.done-card { text-align: center; padding: 16px 0; }
.done-card .babi { margin: 0 auto 6px; display: block; }
.done-card .display { font-size: 40px; }
.unlock { display: inline-block; padding: 8px 16px; border-radius: 99px; background: #FFF1C2; font-weight: 800; }

/* games */
.games { display: grid; gap: 14px; margin: 12px 0; }
.game { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 14px; padding: 16px 18px; border-radius: 24px; color: #fff; }
.game span { grid-row: 1 / 4; font-size: 46px; align-self: center; }
.game b { font: 800 24px/1.1 var(--display); }
.game small { opacity: .92; font-weight: 700; }
.game em { font-style: normal; font-weight: 800; margin-top: 4px; }
.game.race { background: var(--bead-1); box-shadow: 0 7px 0 var(--bead-1d); }
.game.mystery { background: var(--grape); box-shadow: 0 7px 0 #6446C4; }
.game.match { background: var(--bead-10); box-shadow: 0 7px 0 var(--bead-10d); }
.race-bar { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 6px 0; }
.track { flex: 1; height: 12px; background: #F2DDB5; border-radius: 99px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--bead-1); transition: width 1s linear; }
.memory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
@media (min-width: 520px) { .memory { grid-template-columns: repeat(4, 1fr); } }
.mcard { position: relative; aspect-ratio: 1 / 1.05; max-width: 100%; border: 0; border-radius: 18px; background: var(--grape); box-shadow: 0 5px 0 #6446C4; padding: 0; perspective: 600px; }
.mcard .back, .mcard .face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 18px; backface-visibility: hidden; transition: transform .35s; }
.mcard .back { color: #fff; font: 800 38px var(--display); }
.mcard .face { background: var(--card); transform: rotateY(180deg); }
.mcard .face b { font: 800 40px var(--display); }
.mcard.flip .back { transform: rotateY(180deg); }
.mcard.flip .face { transform: rotateY(0); }
.mcard.matched { box-shadow: 0 5px 0 #1B8563; }
.mcard.matched .face { background: #DDF6EC; }
.mini { display: inline-flex; gap: 6px; padding: 6px 8px; border-radius: 10px; background: #F7E7C8; border: 3px solid var(--wood); }
.mini-rod { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mini-rod i { width: 20px; height: 9px; border-radius: 50%; background: #E8D3AE; }
.mini-rod i.on { background: var(--bead-1); }
.mini-rod:first-child:not(:last-child) i.on { background: var(--bead-10); }
.mini-rod em { width: 26px; height: 3px; background: var(--wood-dark); margin: 1px 0; }

/* grown-ups */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
@media (max-width: 460px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpis div { background: var(--paper); border-radius: 16px; padding: 10px; }
.kpis b { display: block; font: 800 28px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.kpis small { color: var(--ink-soft); font-weight: 700; }
.tip { margin: 12px 0 0; padding: 12px; border-radius: 14px; background: #EAF5FF; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font-weight: 800; color: var(--ink-soft); }
.week i { display: block; aspect-ratio: 1; max-width: 100%; border-radius: 12px; background: #F2DDB5; margin-bottom: 4px; }
.week .on i { background: var(--mint); }
.bar-row { display: grid; grid-template-columns: 9.5em 1fr 3.2em; gap: 10px; align-items: center; font-size: 15px; }
.bar { height: 14px; border-radius: 99px; background: #F2DDB5; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--bead-10); border-radius: 99px; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.lv-table { display: grid; gap: 4px; }
.lv-table div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #EAD5AE; font-size: 15px; }
.lv-table .dim { opacity: .5; }
.mistakes { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mistakes li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 12px; border-radius: 12px; background: var(--paper); }
.mistakes span { color: #A3262A; font-weight: 700; }
.mistakes em { font-style: normal; color: var(--ink-soft); font-size: 13px; margin-left: auto; }
.settings label { display: block; margin: 10px 0 6px; font-weight: 700; }
.switch { display: flex !important; align-items: center; gap: 10px; }
.switch input { width: 24px; height: 24px; accent-color: var(--mint); flex: none; }

/* stickers */
.sticker-link, .new-sticker { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: var(--card); box-shadow: 0 5px 0 #EFD9B0; }
.sticker-link span, .new-sticker span { font-size: 30px; }
.sticker-link b { flex: 1; font: 800 20px var(--display); }
.sticker-link em { font-style: normal; font-weight: 800; color: var(--ink-soft); }
.new-sticker { margin: 16px 0 0; background: #FFF1C2; box-shadow: 0 5px 0 #F0C24A; animation: pulse 1.6s ease-in-out 3; }
.new-sticker b { display: block; font: 800 20px var(--display); }
.new-sticker small { font-weight: 700; color: var(--ink-soft); }
.stickers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.sticker { text-align: center; padding: 12px 6px; border-radius: 18px; background: #FBEFD9; }
.sticker span { display: block; font-size: 40px; line-height: 1.2; filter: grayscale(1); opacity: .5; }
.sticker b { display: block; font: 800 15px/1.15 var(--display); margin-top: 4px; }
.sticker small { display: block; font-size: 12px; color: var(--ink-soft); line-height: 1.2; margin-top: 2px; }
.sticker.got { background: var(--card); box-shadow: 0 4px 0 #F0C24A; }
.sticker.got span { filter: none; opacity: 1; }

/* confetti & motion */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { top: 110%; transform: rotate(720deg) translateX(40px); } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes yay { 40% { transform: scale(1.04) rotate(-1deg); } 70% { transform: scale(.99) rotate(1deg); } }
@keyframes pulse { 50% { transform: scale(1.06); box-shadow: 0 5px 0 #E1C79A, 0 0 0 6px rgba(255,197,61,.6); } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
