/* Страницы для поиска (SEO): /1-klass, /matematika-1-klass и др. Один файл на все страницы - без встроенных стилей,
   чтобы не трогать строгий CSP сайта. Вид как у главной (владелец 18.11: светлые страницы со сплошным текстом
   слепили и не читались): тёмный фон, герои, короткие блоки. Подробный текст для поиска - в свёрнутых <details> */
:root {
  --bg: #0f1830; --band: #131f3b; --card: #17233f; --card2: #24345c; --ink: #e8edfa; --muted: #a9b6d8;
  --line: rgba(255, 255, 255, .12); --yellow: #ffb81c; --gold: #ffd465;
  --sans: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.55 var(--sans); }
a { color: var(--gold); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
h1, h2, h3 { color: #fff; font-weight: 900; }

/* Верх: фон-картинка и герой, как на главной */
.hero { position: relative; background: #0f1830 center / cover no-repeat; padding: 16px 0 0; }
.hero.bg-bear { background-image: url(/img/bg-bear.webp); }
.hero.bg-dragon { background-image: url(/img/bg-dragon.webp); }
.hero.bg-alien { background-image: url(/img/bg-alien.webp); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(180deg, rgba(15, 24, 48, 0), #0f1830); }
.bar { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; }
.logo img { display: block; width: 116px; }
.login { color: #fff; font-weight: 800; text-decoration: none; padding: 8px 16px; border: 2px solid rgba(255, 255, 255, .5); border-radius: 99px; background: rgba(15, 24, 48, .5); }
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 360px; align-items: end; gap: 20px; padding-top: 40px; }
.panel { margin-bottom: 60px; max-width: 640px; padding: 26px 28px; border-radius: 24px; background: rgba(15, 24, 48, .88); border: 2px solid rgba(255, 255, 255, .16); box-shadow: 0 10px 0 rgba(8, 14, 30, .4); }
.crumbs ol { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }
.tag { display: inline-block; padding: 6px 14px; border-radius: 10px; background: var(--card2); color: var(--gold); font-weight: 800; font-size: 14px; }
h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.1; margin: 14px 0 12px; }
.panel p { margin: 0 0 20px; color: #d5ddf2; font-size: 19px; }
.cta { display: inline-block; background: var(--yellow); color: #3b2500; font-weight: 900; font-size: 18px; text-decoration: none; padding: 15px 28px; border-radius: 16px; box-shadow: 0 5px 0 #c47f00; }
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 #c47f00; }
.note { display: block; margin-top: 12px; color: var(--muted); font-size: 15px; font-weight: 700; }
.hero-pic { width: 360px; margin-bottom: 40px; filter: drop-shadow(0 10px 8px rgba(8, 14, 30, .4)); }

/* Разделы */
.sec { padding: 64px 0; }
.band { background: var(--band); }
h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; margin: 0 0 28px; }
.cards { display: grid; gap: 18px; padding-top: 24px; grid-template-columns: repeat(3, 1fr); }
.cards.c4 { grid-template-columns: repeat(4, 1fr); }
.cards.c5 { grid-template-columns: repeat(5, 1fr); }
.pc { display: block; text-align: center; padding: 0 18px 22px; border-radius: 22px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 8px 0 rgba(8, 14, 30, .45); color: var(--ink); text-decoration: none; }
a.pc:hover { border-color: var(--gold); }
.pc img { display: block; width: 140px; height: 140px; margin: -30px auto 4px; }
.pc h3 { font-size: 20px; margin: 0 0 6px; }
a.pc h3 { color: var(--gold); }
.pc p { margin: 0; color: var(--muted); font-size: 16px; }

/* Задание, как на экране ребёнка */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.game { padding: 22px; border-radius: 22px; background: #fdf7ea; color: #1a2238; box-shadow: 0 8px 0 rgba(8, 14, 30, .45); }
.game .q { margin: 0 0 12px; font-weight: 800; font-size: 19px; }
.pics { font-size: 34px; line-height: 1.3; text-align: center; padding: 10px; background: #fff; border-radius: 16px; margin-bottom: 14px; }
.pics span { font-weight: 900; color: #1a2238; letter-spacing: .04em; }
.ans { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 10px; }
.ans.txt { grid-template-columns: 1fr; }
.ans b { text-align: center; padding: 12px 8px; border-radius: 14px; background: #fff; border: 2px solid #e6dcc6; font-size: 24px; }
.ans.txt b { font-size: 18px; padding: 10px 8px; }
.ans b.ok { background: #c8f0c0; border-color: #58b84a; }

.steps3 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps3 li { padding: 22px; border-radius: 22px; background: var(--card); border: 2px solid var(--line); }
.steps3 .n { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--yellow); color: #3b2500; font-weight: 900; font-size: 20px; box-shadow: 0 4px 0 #c47f00; margin-bottom: 12px; }
.steps3 b { color: #fff; font-size: 20px; }
.steps3 p { margin: 4px 0 0; color: var(--muted); }

/* Свёрнутый подробный текст: его читает поиск, родитель открывает по желанию */
details.more { margin-top: 22px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); padding: 14px 20px; }
details.more + details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font-weight: 800; color: var(--gold); }
details.more.big summary { font-size: 21px; color: #fff; }
details.more[open] { color: var(--muted); font-size: 17px; }
details.more p { margin: 12px 0 0; }
details.more h3, details.more b { color: #fff; }
details.more h3 { font-size: 18px; margin: 0 0 6px; }
details.more .card, details.more details, details.more .tips li, details.more .subjects > * { margin: 12px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--card2); }
details.more .card p:first-child, details.more .card h3 + p { margin-top: 0; }
details.more details summary { color: #fff; }
details.more .q-title { display: inline-block; color: var(--gold); font-weight: 800; font-size: 14px; margin-bottom: 6px; }
details.more .say { font-weight: 800; color: #fff; }
details.more .tips { list-style: none; padding: 0; margin: 0; }
details.more ol, details.more ul.topics { padding-left: 22px; }
details.more .subjects > * { display: block; color: var(--muted); text-decoration: none; }
details.more .subjects b, details.more .subjects .n { display: block; }
details.more .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.end { text-align: center; padding: 30px 22px 40px; border-radius: 26px; background: var(--card2); max-width: 760px; }
.end img { width: 150px; margin-top: -80px; }
.end h2 { margin: 0 0 8px; }
.end p { color: #d5ddf2; margin: 0 0 20px; }

/* Другие страницы - ссылки карточками */
.links { padding-top: 0; }
.links h2 { font-size: 24px; margin-bottom: 16px; }
.links .subjects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.links .subjects a { display: block; padding: 16px 20px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); color: var(--muted); text-decoration: none; font-size: 16px; }
.links .subjects a:hover { border-color: var(--gold); }
.links .subjects b { display: block; color: var(--gold); font-size: 19px; }
.links .subjects .n { display: block; }
footer { padding: 26px 22px 40px; color: var(--muted); font-size: 15px; }
footer a { color: var(--muted); }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }

/* Планшет и телефон */
@media (max-width: 980px) {
  .cards.c4, .cards.c5 { grid-template-columns: repeat(2, 1fr); row-gap: 44px; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .hero-in { grid-template-columns: 1fr; padding-top: 24px; }
  .hero-pic { display: none; }
  .panel { margin-bottom: 40px; padding: 22px 18px; }
  .sec { padding: 48px 0; }
  .cards, .two, .steps3, .links .subjects, details.more .grid { grid-template-columns: 1fr; }
  .cards { row-gap: 44px; }
  /* Предметы и помощь героя на телефоне - по две карточки, герои поменьше */
  .cards.c4, .cards.c5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 12px; }
  .cards.c4 .pc, .cards.c5 .pc { padding: 0 8px 16px; }
  .cards.c4 .pc img, .cards.c5 .pc img { width: 96px; height: 96px; margin-top: -24px; }
  .cards.c4 .pc h3, .cards.c5 .pc h3 { font-size: 16px; overflow-wrap: anywhere; }
  .cards.c4 .pc p, .cards.c5 .pc p { font-size: 14px; }
  .cta { display: block; text-align: center; }
}
