/* School · "Comic quest": inked outlines, hard offset shadows, halftone dots, Lilita One headlines */
.t-school {
  --ink: #1b1b2f; --lemon: #ffd93d; --tomato: #ff5a5f; --teal: #00a6a6; --cobalt: #3d5afe; --mint: #c8f7e8; --paper: #f4f6ff;
  --bg: var(--paper); --surface: #ffffff; --surface-2: #eef1fb; --text: var(--ink); --muted: #4d5170; --line: rgba(27, 27, 47, .22);
  --primary: var(--cobalt); --primary-ink: #fff; --accent: var(--tomato); --accent-ink: #fff; --good: #0f9d6b; --bad: #e23d44;
  --radius: 14px; --radius-sm: 10px; --btn-radius: 12px;
  --font-head: 'Lilita One', 'Lexend', sans-serif;
  --top-bg: rgba(255, 255, 255, .92); --top-border: 3px solid var(--ink);
  --card-border: 3px solid var(--ink); --card-shadow: 5px 5px 0 var(--ink); --card-radius: 16px;
  --stage-bg: #f4f6ff radial-gradient(rgba(27, 27, 47, .07) 1.2px, transparent 1.4px) 0 0 / 14px 14px; --stage-head-bg: var(--lemon);
  --input-border: 2.5px solid var(--ink); --shadow: 4px 4px 0 var(--ink);
  background-image: radial-gradient(rgba(27, 27, 47, .06) 1.2px, transparent 1.4px); background-size: 14px 14px;
}
.t-school h1, .t-school h2, .t-school h3 { font-weight: 400; letter-spacing: .01em; }
.t-school .mu-mark { background: var(--lemon); color: var(--ink); border: 2.5px solid var(--ink); }
.t-school .btn { border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-weight: 700; }
.t-school .btn:hover { filter: none; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.t-school .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.t-school .btn-ghost { background: #fff; }
.t-school .btn-primary { background: var(--cobalt); }
.t-school .btn-accent { background: var(--tomato); }
.t-school .seg { border: 2.5px solid var(--ink); background: #fff; }
.t-school .seg-btn.on { background: var(--ink); color: var(--lemon); }
.t-school .panel { border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); border-radius: 16px; }
.t-school .note { border: 2.5px solid var(--ink); border-left-width: 8px; background: #fffbe0; }
.t-school .mu-stage-head { border-bottom: 3px solid var(--ink); }
.t-school .mu-stage-title { font-family: var(--font-head); font-size: 1.45rem; font-weight: 400; }
.t-school .inp, .t-school .sel { border: 2.5px solid var(--ink); }
.t-school .tbl th, .t-school .tbl td { border-color: rgba(27, 27, 47, .3); }
.t-school .mu-modal { border: 3px solid var(--ink); }

/* hero */
.s-hero { position: relative; background: var(--lemon); border-bottom: 3px solid var(--ink); overflow: hidden; background-image: radial-gradient(rgba(27, 27, 47, .16) 1.6px, transparent 1.8px); background-size: 12px 12px; }
.s-hero-in { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; padding-top: 2.4rem; padding-bottom: 2.6rem; }
.s-burst { position: absolute; left: -60px; top: -40px; width: 420px; height: 420px; background: #fff; clip-path: polygon(50% 0, 58% 30%, 85% 12%, 70% 40%, 100% 45%, 72% 58%, 92% 85%, 60% 72%, 50% 100%, 40% 72%, 8% 85%, 28% 58%, 0 45%, 30% 40%, 15% 12%, 42% 30%); opacity: .55; }
.s-kicker { position: relative; display: inline-block; margin: 0 0 .6rem; background: var(--tomato); color: #fff; font-weight: 700; padding: .25rem .8rem; border: 2.5px solid var(--ink); border-radius: 8px; transform: rotate(-2deg); box-shadow: 3px 3px 0 var(--ink); }
.s-hero h1 { position: relative; font-size: clamp(3rem, 9vw, 5.6rem); margin: 0; line-height: .95; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 6px 6px 0 var(--ink); }
.s-lede { position: relative; font-size: 1.2rem; max-width: 40ch; margin: 1rem 0 1.4rem; font-weight: 500; }
.s-quick { position: relative; }
.s-score { position: relative; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); border-radius: 18px; padding: 1.1rem 1.4rem; min-width: 220px; transform: rotate(2deg); }
.s-score b { font-family: var(--font-head); font-size: 2.6rem; font-weight: 400; display: block; line-height: 1; }
.s-subnav { background: #fff; border-bottom: 3px solid var(--ink); top: 54px; }
.s-subnav button { border: 2px solid var(--ink); font-weight: 600; background: #fff; }
.s-subnav button:hover { background: var(--lemon); }

/* sections & cards */
.t-school .act-section-head h2 { font-size: clamp(1.9rem, 4vw, 2.5rem); }
.t-school .sec-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; background: var(--lemon); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); font-size: 1.6rem; transform: rotate(-4deg); }
.t-school .act-card { padding: 1rem 1.05rem 1.15rem; }
.t-school .act-card:hover { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--ink); }
.t-school .act-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--c, var(--lemon)); border: 2.5px solid var(--ink); font-size: 1.8rem; }
.t-school .act-title { font-family: var(--font-head); font-weight: 400; font-size: 1.3rem; }
.t-school .act-tag { background: var(--tomato); border: 2px solid var(--ink); }

/* shared bits */
.s-big { font-family: var(--font-head); font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; }
.s-out { margin-top: 1rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-row button { min-width: 2.6rem; padding: .35rem .5rem; border: 2px solid var(--ink); border-radius: 10px; background: #fff; font-weight: 700; }
.chip-row button.on { background: var(--ink); color: var(--lemon); }
.typed { max-width: 640px; margin: 0 auto; display: grid; gap: 1rem; text-align: center; }
.typed-q { font-family: var(--font-head); font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.15; }
.typed-row { display: flex; gap: .6rem; justify-content: center; }
.typed-row .inp { max-width: 220px; font-size: 1.6rem; text-align: center; font-weight: 700; }
.typed-fb { min-height: 3em; }

/* tables */
.tt-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .45rem; margin-top: 1rem; }
.tt-line { display: grid; grid-template-columns: auto 1fr; gap: .7rem; align-items: center; background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: .35rem .7rem; font-weight: 600; font-size: 1.12rem; font-variant-numeric: tabular-nums; transition: background .2s; }
.tt-line.hl { background: var(--lemon); }
.tt-bar { height: 10px; border-radius: 5px; background: var(--teal); }
.mgrid { display: grid; gap: 2px; font-variant-numeric: tabular-nums; user-select: none; }
.mgrid > div { display: grid; place-items: center; aspect-ratio: 1; font-size: clamp(.55rem, 1.4vw, .95rem); background: #fff; border-radius: 4px; cursor: pointer; font-weight: 600; }
.mgrid .hd { background: var(--ink); color: var(--lemon); font-weight: 700; }
.mgrid .rowhl, .mgrid .colhl { background: #fff3b0; }
.mgrid .cur { background: var(--tomato); color: #fff; transform: scale(1.15); z-index: 1; }
.mgrid .mark { background: var(--mint); }
.mgrid .hidden-cell { color: transparent; background: #e6e9f5; }

/* column / long methods */
.colm { display: inline-grid; gap: 2px 0; font-family: var(--font-mono); font-size: clamp(1.4rem, 4.2vw, 2.2rem); font-weight: 600; background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); border-radius: 14px; padding: 1rem 1.4rem; }
.colm > span { width: 1.15em; text-align: center; height: 1.35em; line-height: 1.35em; position: relative; }
.colm .carry { font-size: .55em; color: var(--tomato); height: 1.6em; line-height: 2.2em; }
.colm .rule { border-top: 3px solid var(--ink); height: 0; }
.colm .act { background: #fff3b0; border-radius: 6px; }
.colm .faded { color: #b6b9cc; }
.colm .struck { text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: var(--tomato); }
.colm .new { position: absolute; top: -.65em; left: 0; right: 0; font-size: .55em; color: var(--tomato); line-height: 1; }
.colm .res { color: var(--cobalt); }
.colm .q { color: var(--teal); }
.narr { font-size: 1.15rem; min-height: 3.2em; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: .7rem 1rem; }
.ldiv-wrap { display: flex; gap: 0; align-items: flex-start; }

/* BODMAS */
.bod-rule { display: flex; flex-wrap: wrap; gap: .5rem; }
.bod-rule span { flex: 1 1 120px; text-align: center; padding: .7rem .4rem; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); background: #fff; }
.bod-rule b { display: block; font-family: var(--font-head); font-size: 2.2rem; font-weight: 400; line-height: 1; }
.bod-expr { font-family: var(--font-mono); font-size: clamp(1.2rem, 3.6vw, 1.9rem); font-weight: 600; line-height: 1.6; word-break: break-word; }
.bod-expr .hl { background: var(--lemon); outline: 2px solid var(--ink); border-radius: 6px; padding: 0 .15em; }
.bod-steps { display: grid; gap: .5rem; margin-top: .8rem; }
.bod-step { display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .6rem; align-items: center; background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: .4rem .7rem; }
.bod-step .n { font-family: var(--font-head); font-size: 1.4rem; text-align: center; }
.bod-step .why { font-size: .85rem; color: var(--muted); }
.bod-game .opbtn { font: inherit; font-weight: 700; padding: 0 .3em; margin: 0 .1em; border-radius: 8px; border: 2.5px solid var(--ink); background: var(--lemon); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; }
.bod-game .opbtn:hover { background: var(--tomato); color: #fff; }

/* soroban */
.soroban { display: inline-flex; gap: 6px; padding: 14px 18px; background: #6d3b1f; border-radius: 16px; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); position: relative; }
.rod { position: relative; width: 46px; display: grid; grid-template-rows: 70px 10px 148px; }
.rod::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 5px; margin-left: -2.5px; background: linear-gradient(90deg, #ddd, #8d8d8d); }
.beam { grid-row: 2; background: #f3e2c7; margin: 0 -9px; position: relative; z-index: 1; border-radius: 2px; }
.beam.unit::after { content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #6d3b1f; border-radius: 50%; }
.sb { position: absolute; left: 1px; width: 44px; height: 26px; border: 0; padding: 0; z-index: 2; clip-path: polygon(0 50%, 25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%); background: linear-gradient(#c97a3a, #8a4a1d); transition: top .18s ease; }
.sb.on { background: linear-gradient(#ffd27a, #e08a1e); }
.rod-label { text-align: center; font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.sor-num { font-family: var(--font-head); font-size: clamp(2.2rem, 7vw, 3.4rem); }
.flash { font-family: var(--font-head); font-size: clamp(4rem, 16vw, 8rem); text-align: center; min-height: 1.3em; color: var(--cobalt); }

/* vedic, lattice, tricks */
.vd-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 1.2rem; align-items: start; }
.vd-list { display: grid; gap: .4rem; }
.vd-list button { text-align: left; padding: .55rem .7rem; border: 2.5px solid var(--ink); border-radius: 10px; background: #fff; font-weight: 600; }
.vd-list button small { display: block; font-weight: 400; color: var(--muted); font-style: italic; }
.vd-list button.on { background: var(--lemon); box-shadow: 3px 3px 0 var(--ink); }
.vd-steps { font-size: 1.1rem; }
.vd-steps .big-res { font-family: var(--font-head); font-size: 2.6rem; color: var(--cobalt); }
@media (max-width: 760px) { .vd-wrap { grid-template-columns: 1fr; } .vd-list { grid-template-columns: 1fr 1fr; } }
.lattice-svg text { font-family: var(--font-mono); font-weight: 600; }
.div-table td.yes { color: var(--good); font-weight: 700; } .div-table td.no { color: var(--bad); font-weight: 700; }
.fingers { display: flex; gap: 6px; align-items: flex-end; justify-content: center; height: 150px; }
.finger { width: 30px; border-radius: 15px 15px 6px 6px; background: #f6c89f; border: 2.5px solid var(--ink); transition: height .3s; position: relative; }
.finger.down { height: 40px !important; background: var(--tomato); }
.finger small { position: absolute; bottom: -1.6em; left: 0; right: 0; text-align: center; font-size: .8rem; }
.gap-hand { width: 26px; }

/* numbers */
.pv-table { border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; }
.pv-table th { font-size: .72rem; padding: .3rem .25rem; background: var(--ink); color: #fff; border-radius: 6px; font-weight: 600; }
.pv-table th.grp { background: var(--teal); font-size: .8rem; }
.pv-table td { text-align: center; font-family: var(--font-head); font-size: 1.8rem; background: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: .1rem .4rem; cursor: pointer; min-width: 2.2rem; }
.pv-table td.pv-on { background: var(--lemon); }
.sieve { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; max-width: 620px; }
.sieve div { aspect-ratio: 1.3; display: grid; place-items: center; border-radius: 6px; background: #fff; border: 1.5px solid rgba(27, 27, 47, .25); font-weight: 600; font-size: clamp(.7rem, 1.8vw, 1rem); transition: background .2s, color .2s; position: relative; }
.sieve div.x { color: rgba(27, 27, 47, .35); text-decoration: line-through; }
.sieve div.p { background: var(--lemon); border-color: var(--ink); border-width: 2.5px; color: var(--ink); text-decoration: none; }
.sieve div.now { outline: 3px solid var(--tomato); }
.sieve.wide { grid-template-columns: repeat(20, minmax(0, 1fr)); max-width: 980px; }
.venn text { font-family: var(--font-body); }
.money-tray { min-height: 96px; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .6rem; border: 3px dashed var(--ink); border-radius: 14px; background: #fff; }
.coin { width: 58px; height: 58px; border-radius: 50%; border: 2.5px solid var(--ink); display: grid; place-items: center; font-weight: 700; font-size: .95rem; background: radial-gradient(circle at 35% 30%, #fff6c9, #d9b14a); box-shadow: 2px 2px 0 var(--ink); }
.note-cash { min-width: 92px; height: 50px; border-radius: 6px; border: 2.5px solid var(--ink); display: grid; place-items: center; font-weight: 700; box-shadow: 2px 2px 0 var(--ink); padding: 0 .5rem; }
.cash-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.cash-btns button { border: 0; padding: 0; background: none; }

/* fractions & percent */
.frac-big { font-family: var(--font-head); font-size: 3rem; }
.pct-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: min(320px, 100%); aspect-ratio: 1; }
.pct-grid i { background: #fff; border: 1px solid rgba(27, 27, 47, .25); border-radius: 2px; }
.pct-grid i.on { background: var(--teal); border-color: var(--teal); }

/* geometry & algebra */
.geo-svg { width: 100%; max-width: 640px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); touch-action: none; }
.geo-svg text { font-family: var(--font-body); }
.formula { font-size: 1.15rem; background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; padding: .7rem 1rem; }
.formula b { color: var(--cobalt); }
.balance-svg { width: 100%; max-width: 680px; }

/* arcade */
.arena { position: relative; height: min(62vh, 560px); background: radial-gradient(circle at 50% 120%, #2c2f6b, #0f1030 70%); border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; color: #fff; }
.alien { position: absolute; padding: .3rem .6rem; border-radius: 12px; background: #7bff8a; color: var(--ink); font-weight: 700; font-size: 1.2rem; border: 2.5px solid var(--ink); white-space: nowrap; box-shadow: 0 0 14px rgba(123, 255, 138, .55); }
.alien::before { content: '👾'; margin-right: .3rem; }
.alien.boom { animation: boom .35s forwards; }
@keyframes boom { to { transform: scale(1.8); opacity: 0; filter: hue-rotate(160deg); } }
.laser { position: absolute; width: 4px; background: linear-gradient(#fff, #ff4f8a); transform-origin: bottom center; animation: laser .2s forwards; }
@keyframes laser { to { opacity: 0; } }
.cannon { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: 2.4rem; }
.track { display: grid; gap: .6rem; background: #3b3f52; border: 3px solid var(--ink); border-radius: 16px; padding: .8rem; position: relative; }
.lane { position: relative; height: 54px; background: repeating-linear-gradient(90deg, #4a4f66 0 40px, #464a60 40px 80px); border-radius: 10px; border-bottom: 3px dashed rgba(255, 255, 255, .35); }
.lane .car-emoji { position: absolute; top: 4px; font-size: 2.3rem; transition: left .35s ease; transform: scaleX(-1); }
.finish { position: absolute; top: 0; bottom: 0; right: 4%; width: 12px; background: repeating-linear-gradient(#fff 0 8px, #111 8px 16px); }
.tf-card { font-family: var(--font-head); font-size: clamp(2.2rem, 8vw, 4rem); background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); border-radius: 18px; padding: 1.4rem; text-align: center; }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.tf-btns .btn { font-size: 1.6rem; padding: 1rem; }

/* cheat sheet */
.cheat { margin-top: 3rem; }
.cheat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.cheat-grid .panel { font-size: .95rem; }
.cheat-grid .tbl td, .cheat-grid .tbl th { padding: .25rem .4rem; }
@media (max-width: 960px) { .cheat-grid { grid-template-columns: 1fr 1fr; } .s-hero-in { grid-template-columns: 1fr; } .s-score { justify-self: start; transform: none; } }
@media (max-width: 640px) { .cheat-grid { grid-template-columns: 1fr; } }
