@font-face {
  font-family: Rubik; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("assets/rubik-cyrillic.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: Rubik; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("assets/rubik-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root { color-scheme: light; font-family: Rubik, "Segoe UI", sans-serif; color: #181521; background: #fff; --purple: #7640d3; --pale: #e9daff; --line: #dfdce6; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button,input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1,h2,h3,p { margin: 0; }
:focus-visible { outline: 3px solid #6333be; outline-offset: 4px; }
.sr-only,.skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; left: 12px; top: 12px; background: white; padding: 12px; }
.shell { width: min(1280px, calc(100% - clamp(32px, 8vw, 128px))); margin-inline: auto; }
header { background: #fff; border-bottom: 1px solid #eeecf2; }
.topbar,nav,.brand,nav a,.filters,.grades,.subject,.catalog-head,.search { display: flex; align-items: center; }
.topbar { min-height: 76px; gap: clamp(24px, 4vw, 68px); }
.brand { white-space: nowrap; gap: 9px; font-size: 1.85rem; font-weight: 820; letter-spacing: -.065em; }
.brand img { width: 35px; height: 35px; }
nav { gap: 8px; }
nav a { gap: 8px; padding: 10px 15px; border-radius: 12px; font-weight: 650; }
nav a:hover,.back:hover { background: #f6f1fe; }
nav a[aria-current="page"] { background: var(--pale); }
nav svg { width: 21px; height: 21px; fill: #effb6e; stroke: #21192c; stroke-width: 2; stroke-linejoin: round; }
.avatar { width: 46px; height: 46px; margin-left: auto; border-radius: 50%; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; }
main { padding-block: 24px 64px; }
.site-footer { border-top: 1px solid var(--line); color: #514b5a; }
.site-footer address { padding-block: 24px; font-size: .9375rem; font-style: normal; line-height: 1.6; }
.site-footer a { color: var(--purple); text-decoration: underline; text-underline-offset: .15em; }
.hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: clamp(208px,17vw,260px); border-radius: 24px; background-color: #e4d1ff; background-image: linear-gradient(#ab83d84a 1px,transparent 1px), linear-gradient(90deg,#ab83d84a 1px,transparent 1px), linear-gradient(110deg,#eee1ff,#ddc5ff); background-size: 24px 24px,24px 24px,100% 100%; }
.hero-copy { padding: 26px clamp(24px,4vw,64px); z-index: 1; }
h1,h2,h3 { letter-spacing: -.045em; }
.hero h1 { font-size: clamp(3.2rem,5.3vw,5rem); font-weight: 840; line-height: .99; }
.hero p { font-size: clamp(1rem,1.5vw,1.3rem); margin-top: 15px; }
.hero-art { position: absolute; right: 5%; inset-block: 0; width: 43%; display: grid; place-items: center; }
.hero-art img { position: relative; z-index: 1; height: 108%; max-width: 88%; object-fit: contain; position: absolute; filter: drop-shadow(0 4px 0 #5f45732e); transform: rotate(2deg); }
.orbit { width: 99%; height: 45%; border: 2px solid #37213e; border-radius: 50%; transform: rotate(-13deg); }
.burst { position: absolute; left: 15%; top: 16%; font-size: 2.4rem; color: #edff59; -webkit-text-stroke: 1px #453341; transform: rotate(12deg); }
.filters { justify-content: space-between; flex-wrap: wrap; gap: 14px 32px; margin-top: 28px; }
.subject,.grades { gap: 14px; font-size: 1rem; font-weight: 650; }
.subject-value { border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px; font-weight: 500; }
#grade-options { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
#grade-options button { background: white; min-width: clamp(38px,3.45vw,52px); min-height: 44px; border: 0; border-right: 1px solid var(--line); font-weight: 580; }
#grade-options button:last-child { border-right: 0; }
#grade-options button:hover { background: #f0e7fc; }
#grade-options button[aria-pressed="true"] { background: var(--purple); color: white; border-color: var(--purple); }
#grade-options button:focus-visible { outline-offset: -4px; outline-color: currentColor; }
.catalog { margin-top: 32px; }
.catalog-head { justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.catalog h2,.subpage h1 { font-size: clamp(2rem,3vw,2.75rem); font-weight: 780; line-height: 1.1; }
.search { width: min(320px,45%); gap: 10px; padding: 0 14px; height: 44px; border: 1px solid #c9c5d1; border-radius: 12px; background: white; }
.search:focus-within { border-color: var(--purple); outline: 2px solid var(--pale); }
.search svg { flex: none; width: 20px; height: 20px; fill: none; stroke: #635d6e; stroke-width: 2; stroke-linecap: round; }
.search input { min-width: 0; flex: 1; background: transparent; border: 0; outline: 0; height: 100%; }
.search input::placeholder { color: #736c7d; }
.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(14px,1.5vw,24px); }
.card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 3px 0 #3125410d; transition: transform .18s ease,box-shadow .18s ease,border-color .18s; }
.card:hover { border-color: #b59ad4; box-shadow: 0 7px 16px #5c368815; }
.art { border-radius: 17px 17px 12px 12px; overflow: hidden; aspect-ratio: 2.36; display: grid; place-items: center; background: var(--tint); }
.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.math-sticker { font-size: clamp(2.25rem,4.5vw,4.4rem); letter-spacing: -.06em; font-weight: 800; color: #3d2959; transform: rotate(-6deg); paint-order: stroke fill; -webkit-text-stroke: 9px white; filter: drop-shadow(1px 3px 0 #55416944); }
.card-copy { display: flex; align-items: start; flex-direction: column; flex: 1; gap: 18px; padding: 19px 20px 20px; }
.card h3 { font-size: clamp(1.3rem,1.75vw,1.75rem); font-weight: 750; line-height: 1.12; overflow-wrap: anywhere; }
.pill,.action { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 13px; background: var(--pale); border-radius: 9px; color: #36204e; font-weight: 650; font-size: .9375rem; }
.pill { margin-top: auto; }
.passed { color: #166629; background: #e7f7e8; }
.action { border: 0; min-height: 44px; }
.action:hover { background: #d9c4fe; }
.empty { padding: 32px; text-align: center; background: #f7f4fc; border-radius: 16px; }
.empty p,.subpage p { margin: 12px 0 20px; line-height: 1.55; }
.back { display: inline-block; padding: 10px 15px; margin-bottom: 20px; background: #f2ecfa; border-radius: 10px; font-weight: 600; }
.subpage { max-width: 840px; margin: 0 auto; }
.book-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px clamp(18px, 4vw, 36px); margin-bottom: 22px; background: #eee2ff; border-radius: 20px; }
.book-intro img { width: clamp(75px, 15vw, 135px); }
.book-intro p { margin: 8px 0 0; }
.book-grade { padding: 0; overflow-wrap: anywhere; }
.book-grade summary { padding: 16px 20px; font-size: 1.125rem; }
.book-topics { padding: 0 16px 16px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.book-topic,.book-number { display: flex; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 550; min-height: 48px; }
.book-topic:hover,.book-number:hover { background: #f4ecff; border-color: #a784d5; }
.book-context { font-weight: 600; color: #64458b; margin: 0 0 8px; }
.book-count { color: #584b68; }
.book-numbers { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; max-width: 560px; }
.book-number { position: relative; justify-content: center; min-height: 58px; font-size: 1.25rem; }
.book-number.done { color: #176032; background: #e7f7e8; border-color: #abd3b1; }
.book-number.done::after { content: '✓'; position: absolute; top: 2px; right: 5px; font-size: .8rem; }
.book-question h3 { font-size: clamp(1.25rem, 2.8vw, 1.65rem); }
.duel-intro { background-color: #e5d4fc; background-image: linear-gradient(#b092ce30 1px, transparent 1px), linear-gradient(90deg, #b092ce30 1px, transparent 1px); background-size: 22px 22px; }
.duel-topic { gap: 10px; cursor: pointer; }
#duel .duel-grade-label { margin: 16px 0 6px; font-weight: 600; }
.duel-grades { display: grid; grid-template-columns: repeat(9, 1fr); max-width: 440px; gap: 2px; margin-bottom: 16px; }
.duel-grades button { justify-content: center; padding-inline: 0; background: #f3eff8; }
.duel-grades button[aria-pressed="true"] { background: var(--purple); color: white; }
.duel-topics { padding: 0; }
.duel-topic input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--purple); }
.duel-topic:has(:checked) { border-color: #a784d5; background: #f5edff; }
.duel-topic:has(:focus-visible) { outline: 3px solid #6333be; outline-offset: 2px; }
.duel-start { position: sticky; bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 3px 12px #39284c18; }
.duel-topic, .duel-topic input { scroll-margin-bottom: 90px; }
.duel-start .action { background: var(--purple); color: white; }
.duel-start .action:disabled { background: #eeeaf3; color: #685d75; cursor: default; }
.duel-score { display: flex; gap: 10px; margin: 18px 0; }
.duel-score span { padding: 9px 18px; border-radius: 12px; background: #e0f6e1; font-size: 1.25rem; font-weight: 700; }
.duel-score span + span { background: #ffead6; }
#duel .choices .action { margin: 0; }
.duel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.duel-award { font-weight: 600; }
@media (max-width: 650px) {
  .topbar { flex-wrap: wrap; padding: 8px 0; }
  .topbar nav { order: 1; width: 100%; }
  .topbar nav a { flex: 1; min-height: 44px; justify-content: center; }
}
@media (max-width: 510px) {
  .book-topics { grid-template-columns: 1fr; }
  .book-numbers { gap: 7px; }
}
.subpage h2 { margin-top: 22px; font-size: 1.6rem; }
.subpage .art { margin: 4px 0 24px; max-height: 240px; background: var(--tint); }
.subpage .art img { object-fit: contain; }
.lesson-body { font-size: 1.125rem; max-width: 720px; }
details { margin: 12px 0; border: 1px solid var(--line); padding: 14px 18px; border-radius: 12px; }
summary { cursor: pointer; color: #6333ad; font-weight: 600; }
.subpage details p { margin-bottom: 0; }
.reward { display: flex; align-items: center; gap: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; margin-top: 24px; }
.reward h2 { margin-top: 0; }
.reward-art { flex: 0 0 34%; background: #e7d8ff; border-radius: 14px; padding: 15px; }
.reward-art img { display: block; width: 100%; }
.award-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); gap: 12px; padding: 0; margin: 12px 0 28px; list-style: none; }
.award { display: flex; flex-direction: column; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.award-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; font-size: 1.65rem; background: #f2eef7; border-radius: 14px; }
.award h3 { font-size: 1.125rem; overflow-wrap: anywhere; }
.award-goal { margin: 4px 0 12px; color: #584b68; }
.award-status { margin-top: auto; padding: 4px 10px; border-radius: 12px; background: #f2eef7; color: #584b68; font-size: .9rem; }
.award.earned { border-color: #b7d6b9; }
.earned .award-icon,.earned .award-status { background: #e7f7e8; color: #176032; }
.appear { animation: appear .2s ease-out; }
.topic-group { grid-column: 1 / -1; margin-top: 12px; font-size: 1.3rem; }
.topic-group:first-child { margin-top: 0; }
.sources { margin-top: 30px; font-size: 1rem; }
.sources p { margin: 14px 0 4px; max-width: 74ch; line-height: 1.55; }
.sources a { color: #6033a7; text-decoration: underline; }
.lesson-picture { white-space: pre-line; text-align: center; margin-top: 14px; padding: 18px; border-radius: 15px; background: #edf8e7; font-size: clamp(1.35rem, 4vw, 2rem); font-weight: 600; line-height: 1.5; }
.lesson-table { border-collapse: collapse; width: 100%; margin-top: 12px; }
.lesson-table caption { padding: 8px; font-weight: 650; }
.lesson-table th,.lesson-table td { text-align: center; border: 1px solid #c8bad8; padding: 9px; }
.lesson-table th { background: #f1e8fc; }
.practice { background: #f6f1fc; padding: clamp(16px,3vw,28px); border-radius: 18px; margin: 24px 0; }
.practice h2 { margin: 0 0 12px; }
.practice h3 { line-height: 1.35; letter-spacing: -.025em; }
.practice .step { color: #604681; font-size: 1rem; margin-bottom: 8px; }
.practice .choices { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0; }
.choices .action { background: white; border: 1px solid #bcaacd; min-width: 56px; justify-content: center; font-size: 1.1rem; }
.choices .action:hover { background: #e9dbfb; }
.choices .action:disabled { opacity: .58; cursor: default; }
.choices .correct:disabled, .choices .incorrect:disabled { opacity: 1; }
.choices .correct:disabled { background: #daf5d9; border-color: #6da977; }
.choices .incorrect:disabled { background: #f5d9da; border-color: #a96d77; }
.practice details { background: white; }
.practice .back { margin: 0 0 0 10px; font-size: 1rem; }
.answer-feedback:empty { margin: 0; }
.number-answer { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.number-answer input { width: 6.5rem; min-height: 46px; border: 1px solid #a895b9; background: white; border-radius: 9px; padding: 8px 12px; font-size: 1.125rem; }
.number-answer input.correct { background: #e1f6de; color: #27542e; opacity: 1; }
.practice .action + .action { margin: 5px 0 5px 7px; }
.worked-example { background: #faf8fd; }
.worked-question { font-weight: 620; }
.worked-steps { margin: 16px 0 24px; padding: 12px 20px 12px 44px; border-radius: 16px; background: #f4effa; line-height: 1.55; }
.worked-steps li { padding: 5px 0 5px 4px; }
.worked-steps li::marker { color: #6232a0; font-weight: 700; }
.lesson-diagram { width: min(100%, 440px); height: auto; display: block; margin: 12px auto; }
.fraction-figure { background: #f6f4fa; border-radius: 14px; padding: 14px 18px; }
.fraction-strip { display: flex; height: 25px; border: 1px solid #624180; margin: 6px 0 12px; }
.fraction-strip span { flex: 1; background: white; }
.fraction-strip span + span { border-left: 1px solid #624180; }
.fraction-strip .shaded { background: #c8a4ef; }
@media (max-width: 440px) {
  .lesson-table th,.lesson-table td { padding: 6px 3px; font-size: .875rem; overflow-wrap: anywhere; }
}
.number-answer input[inputmode="text"] { width: 11rem; max-width: 100%; }
.toy { margin-top: 14px; padding: 18px; border-radius: 15px; background: #fff4cb; }
.toy p { margin: 0 0 12px; }
.star-tray { display: flex; gap: 8px; flex-wrap: wrap; }
.star { width: 48px; height: 48px; background: #fff; border: 2px solid #a97714; border-radius: 13px; color: #81510a; font-size: 1.5rem; font-weight: 750; }
.star:disabled { background: #ffe390; color: #573712; }
.star-tray + .action { margin-top: 12px; }
.ten-slots { width: fit-content; display: grid; grid-template-columns: repeat(5, 28px); gap: 5px; padding: 9px; border: 2px solid #80603b; border-radius: 12px; background: white; }
.ball { height: 28px; border: 1px dashed #785d8b; border-radius: 50%; }
.ball.filled { background: #8462c6; border-style: solid; }
.extra-balls { color: #7750b4; font-size: 1.45rem; margin: 6px 0; }
@keyframes appear { from { opacity: .4; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 860px) {
  .shell { width: calc(100% - 40px); }
  .filters { gap: 12px 18px; }
  .grades,.subject { gap: 9px; }
  .card-copy { padding: 15px; }
}
@media (max-width: 860px) {
  .topbar { min-height: 61px; gap: 8px; }
  .brand { font-size: 1.3rem; gap: 4px; }
  .brand img { width: 24px; height: 24px; }
  nav { gap: 0; }
  nav a { padding: 9px 7px; font-size: .875rem; border-radius: 9px; }
  nav svg { display: none; }
  .avatar { width: 32px; height: 32px; flex: none; }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 28px); }
  main { padding-top: 16px; }
  .hero { min-height: 160px; border-radius: 16px; background-size: 18px 18px,18px 18px,100% 100%; }
  .hero-copy { padding: 18px; width: 65%; }
  .hero h1 { font-size: clamp(2rem,7vw,2.9rem); }
  .hero p { font-size: .9375rem; margin-top: 10px; max-width: 21ch; }
  .hero-art { width: 36%; right: 2%; }
  .hero-art img { width: 103%; height: auto; max-width: none; }
  .burst { font-size: 1.3rem; left: 2%; }
  .filters { margin-top: 17px; align-items: start; flex-direction: column; }
  .subject-value { padding: 7px 12px; }
  .grades { flex-wrap: wrap; width: 100%; }
  #grade-options { flex: 1; }
  #grade-options button { min-width: 0; flex: 1; padding: 0; }
  .catalog { margin-top: 22px; }
  .catalog-head { margin-bottom: 13px; }
  .search { width: 57%; height: 40px; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card-copy { padding: 16px 18px; gap: 12px; }
  .math-sticker { font-size: 3.3rem; }
  .reward { flex-direction: column; align-items: stretch; }
  .reward-art { text-align: center; }
  .reward-art img { max-width: 180px; margin: auto; }
}
@media (max-width: 359px) {
  .brand img { display: none; }
  .hero-copy { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation: none !important; transition: none !important; }
}
