/* «Секреты волшебных слов» — стили сайта.
   Цвета языков: русский — синий, марийский — красный, татарский — зелёный, чувашский — жёлтый. */

@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-400.woff2") format("woff2"); font-weight: 200 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-600.woff2") format("woff2"); font-weight: 501 650; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-700.woff2") format("woff2"); font-weight: 651 750; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-800.woff2") format("woff2"); font-weight: 751 850; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-900.woff2") format("woff2"); font-weight: 851 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("../fonts/Nunito-Italic-var.woff2") format("woff2"); font-weight: 200 1000; font-style: italic; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/Caveat-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("../fonts/PT_Serif-Web-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Serif"; src: url("../fonts/PT_Serif-Web-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #1E2A4A;
  --ink-2: #3D4868;
  --muted: #646E8C;
  --paper: #FFFFFF;
  --canvas: #F7F5F0;
  --line: #E7E3DA;
  --ru: #2E64C8; --ru-ink: #1D4FA6; --ru-tint: #EAF0FC;
  --mar: #D9363E; --mar-ink: #B4232B; --mar-tint: #FDECEC;
  --tat: #2E9B57; --tat-ink: #1D7A43; --tat-tint: #E7F5EC;
  --chv: #F2B11C; --chv-ink: #8A6100; --chv-tint: #FEF4D9;
  --radius: 20px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgba(30, 42, 74, .06), 0 10px 30px rgba(30, 42, 74, .08);
  --shadow-lift: 0 2px 4px rgba(30, 42, 74, .08), 0 18px 40px rgba(30, 42, 74, .14);
  --font: "Nunito", "Segoe UI", Arial, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: lining-nums;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--ru-ink); text-underline-offset: 3px; }
a:hover { color: var(--mar-ink); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 900; letter-spacing: -.01em; }
h1 { font-size: clamp(38px, 6vw, 72px); }
h2 { font-size: clamp(30px, 4vw, 46px); }
h3 { font-size: clamp(21px, 2.2vw, 26px); font-weight: 800; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.hand { font-family: var(--hand); font-weight: 700; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--ru); outline-offset: 3px; border-radius: 6px; }

/* ---------- канва (фон «как ткань для вышивки») */
.canvas { background: var(--canvas) url("../img/dots.svg") repeat 0 0 / 12px 12px; }
.band {
  height: 36px;
  background: url("../img/band-tile.svg") repeat-x center / auto 36px;
}
.band.small { height: 24px; background-size: auto 24px; }

/* ---------- шапка */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 19px; line-height: 1.05; }
.logo img { width: 46px; height: 46px; }
.logo small { display: block; font-weight: 700; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 800; font-size: 16px;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--canvas); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: #fff; }
.nav-toggle { display: none; margin-left: auto; border: 0; background: var(--canvas); border-radius: 12px; width: 46px; height: 46px; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 22px; height: 3px; background: var(--ink); border-radius: 3px; margin: 0 auto; position: relative; content: ""; }
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after { position: absolute; top: 7px; }
@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: #fff; flex-direction: column; padding: 12px 16px 18px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { font-size: 18px; padding: 12px 14px; }
}

/* ---------- кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  font: inherit; font-weight: 900; font-size: 18px; line-height: 1.1;
  padding: 15px 24px; border-radius: 999px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--ink); color: #fff; box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
}
.btn:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0, 0, 0, .18); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.btn.ru { background: var(--ru); } .btn.mar { background: var(--mar); } .btn.tat { background: var(--tat); }
.btn.chv { background: var(--chv); color: var(--ink); } .btn.chv:hover { color: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.ghost:hover { color: var(--ink); background: var(--canvas); }
.btn.small { font-size: 16px; padding: 10px 16px; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- секции */
section { padding: 72px 0; }
section.tight { padding: 48px 0; }
.eyebrow { display: inline-block; font-weight: 900; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.lead { font-size: clamp(19px, 2vw, 22px); color: var(--ink-2); max-width: 760px; }
.section-head { margin-bottom: 36px; }
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } section { padding: 52px 0; } body { font-size: 17px; } }

.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px;
  border: 1px solid rgba(30, 42, 74, .06); position: relative;
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
a.card { text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; display: block; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); color: inherit; }

/* ---------- главный экран */
.hero { padding: 48px 0 0; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; align-items: center; }
.hero .wrap.plain { display: block; }
.hero h1 { margin-bottom: .25em; }
.hero h1 .w { display: inline-block; }
.hero .lead { margin-bottom: 26px; }
.hero-art { position: relative; min-height: 440px; }
.hero-art .kb { position: absolute; width: 300px; left: 50%; top: 52%; transform: translate(-50%, -50%); filter: drop-shadow(0 18px 24px rgba(30, 42, 74, .18)); animation: bob 4s ease-in-out infinite; }
.bubble {
  position: absolute; font-weight: 900; font-size: clamp(20px, 2.4vw, 30px); padding: 10px 18px; border-radius: 18px;
  background: #fff; box-shadow: var(--shadow); white-space: nowrap; animation: float 6s ease-in-out infinite;
}
.bubble small { display: block; font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.bubble.ru { color: var(--ru-ink); left: 0; top: 10%; }
.bubble.mar { color: var(--mar-ink); right: 2%; top: 4%; animation-delay: -1.5s; }
.bubble.tat { color: var(--tat-ink); left: 2%; bottom: 14%; animation-delay: -3s; }
.bubble.chv { color: var(--chv-ink); right: 0; bottom: 20%; animation-delay: -4.5s; }
.bubble::after { content: ""; position: absolute; width: 14px; height: 14px; background: #fff; bottom: -6px; left: 28px; transform: rotate(45deg); border-radius: 3px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bob { 0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); } 50% { transform: translate(-50%, -54%) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .bubble, .hero-art .kb { animation: none; } }
@media (max-width: 920px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { min-height: 340px; }
  .hero-art .kb { width: 210px; }
}
@media (max-width: 480px) { .bubble { font-size: 19px; padding: 8px 12px; } .hero-art { min-height: 300px; } }

.audience { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 40px; }
.audience a { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); font-weight: 800; line-height: 1.25; }
.audience a:hover { box-shadow: var(--shadow-lift); color: var(--ink); }
.audience a b { display: block; font-size: 20px; font-weight: 900; }
.audience a span { font-size: 15.5px; color: var(--muted); font-weight: 700; }
.audience .ic { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; }
.audience .ic img { width: 38px; }
@media (max-width: 820px) { .audience { grid-template-columns: 1fr; } }

/* ---------- языки */
.lang-card { border-radius: var(--radius); padding: 24px; position: relative; overflow: hidden; }
.lang-card .motif { width: 74px; height: auto; margin-bottom: 14px; }
.lang-card h3 { margin-bottom: 2px; }
.lang-card .self { font-weight: 800; font-size: 17px; opacity: .85; margin-bottom: 12px; }
.lang-card p { font-size: 16px; margin: 0; }
.lang-ru { background: var(--ru-tint); color: var(--ru-ink); }
.lang-mar { background: var(--mar-tint); color: var(--mar-ink); }
.lang-tat { background: var(--tat-tint); color: var(--tat-ink); }
.lang-chv { background: var(--chv-tint); color: var(--chv-ink); }
.lang-card p { color: var(--ink-2); }

.c-ru { color: var(--ru-ink); } .c-mar { color: var(--mar-ink); } .c-tat { color: var(--tat-ink); } .c-chv { color: var(--chv-ink); }
.bg-ru { background: var(--ru); } .bg-mar { background: var(--mar); } .bg-tat { background: var(--tat); } .bg-chv { background: var(--chv); }
.tag { display: inline-block; font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; color: #fff; }
.tag.chv, .tag.bg-chv { color: var(--ink); }

/* ---------- секреты */
.secrets { counter-reset: s; }
.secret {
  perspective: 1000px; min-height: 210px; cursor: pointer; border: 0; padding: 0; background: none; text-align: left; font: inherit; color: inherit;
}
.secret { display: block; width: 100%; }
.secret .inner { display: block; position: relative; width: 100%; height: 100%; min-height: 210px; transition: transform .6s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.secret.open .inner { transform: rotateY(180deg); }
.secret .face { position: absolute; inset: 0; border-radius: var(--radius); padding: 22px; backface-visibility: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.secret .front { background: var(--ink); color: #fff; justify-content: space-between; overflow: hidden; }
.secret .front::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 150px; height: 150px; background: url("../img/motif-chv.svg") center / contain no-repeat; opacity: .2; }
.secret .front b { font-size: 15px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.secret .front .num { font-size: 72px; font-weight: 900; line-height: 1; }
.secret .front .hint { font-family: var(--hand); font-size: 22px; line-height: 1.1; opacity: .9; position: relative; z-index: 1; }
.secret .back { background: #fff; transform: rotateY(180deg); border: 3px solid var(--ink); }
.secret .back b { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.secret .back p { font-size: 20px; font-weight: 800; line-height: 1.3; margin: 8px 0 0; }
.secret .back small { margin-top: auto; color: var(--muted); font-size: 14.5px; line-height: 1.35; }
.secret.s1 .back { border-color: var(--ru); } .secret.s2 .back { border-color: var(--mar); }
.secret.s3 .back { border-color: var(--tat); } .secret.s4 .back { border-color: var(--chv); }
.secret.s5 .back { border-color: var(--ru); } .secret.s6 .back { border-color: var(--mar); } .secret.s7 .back { border-color: var(--tat); }

/* ---------- план мероприятия (таймлайн) */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; background: #fff; border-radius: 16px; padding: 14px 18px; box-shadow: var(--shadow); }
.timeline .n { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; font-size: 20px; color: #fff; background: var(--ink); }
.timeline b { display: block; font-size: 18.5px; }
.timeline span { color: var(--muted); font-size: 15.5px; }
.timeline .t { font-weight: 900; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 48px 1fr; } .timeline .t { grid-column: 2; } }

/* ---------- словарик */
.word-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.word-table th { text-align: left; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 14px; }
.word-table td { background: #fff; padding: 14px; vertical-align: top; box-shadow: 0 1px 0 var(--line); }
.word-table td:first-child { border-radius: 14px 0 0 14px; font-weight: 900; }
.word-table td:last-child { border-radius: 0 14px 14px 0; }
.word { font-weight: 900; font-size: 22px; line-height: 1.2; }
.read { display: block; font-size: 14.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.play {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; vertical-align: middle;
  background: var(--canvas); color: var(--ink); margin-left: 6px;
}
.play:hover { background: var(--ink); color: #fff; }
.play svg { width: 16px; height: 16px; }
.word-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wcard { border-radius: 18px; padding: 18px; background: #fff; box-shadow: var(--shadow); border-top: 0; position: relative; }
.wcard .lang { font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 860px) { .word-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.fact { display: flex; gap: 16px; align-items: flex-start; }
.fact img { width: 64px; flex: none; }
.note-hand { font-family: var(--hand); font-size: 26px; line-height: 1.2; color: var(--mar-ink); }

/* ---------- скачивания */
.dl { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; }
.dl .file { width: 64px; height: 76px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #fff; position: relative; }
.dl .file::after { content: ""; position: absolute; top: 0; right: 0; width: 18px; height: 18px; background: linear-gradient(225deg, #fff 50%, rgba(0, 0, 0, .18) 50%); border-radius: 0 12px 0 6px; }
.dl h3 { font-size: 20px; margin-bottom: 4px; }
.dl p { font-size: 15.5px; color: var(--muted); margin: 0; }
.dl .meta { font-size: 13.5px; font-weight: 800; color: var(--muted); margin-top: 6px; }
.f-pdf { background: var(--mar); } .f-pptx { background: #D9632E; } .f-docx { background: var(--ru); } .f-zip { background: var(--ink); } .f-mp4 { background: #7A4FC9; } .f-png { background: var(--tat); }
@media (max-width: 640px) { .dl { grid-template-columns: 52px 1fr; } .dl .btn { grid-column: 1 / -1; } .dl .file { width: 52px; height: 62px; } }

/* ---------- сценарий / текст */
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.4em; }
.prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.2em 0; padding: 14px 20px; border-radius: 14px; background: var(--canvas); font-family: var(--serif); font-size: 19px; }
.prose blockquote cite { display: block; font-family: var(--font); font-style: normal; font-size: 15px; color: var(--muted); margin-top: 6px; }
.speech { margin: .6em 0; padding: 12px 16px; border-radius: 14px; background: #fff; box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line); }
.speech .who { font-weight: 900; font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 2px; }
.speech.kids { background: var(--chv-tint); box-shadow: none; }
.speech.kids .who { color: var(--chv-ink); }
.stage { font-style: italic; color: var(--ink-2); margin: .6em 0; }
.stage::before { content: "▸ "; color: var(--muted); font-style: normal; }
.block-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-top: 2em; padding-top: 1.2em; border-top: 2px dashed var(--line); }
.block-head .time { font-weight: 900; color: #fff; background: var(--ink); border-radius: 999px; padding: 3px 12px; font-size: 15px; }
.block-head .slides { font-weight: 800; font-size: 14px; color: var(--muted); }
.secret-inline { display: flex; gap: 14px; align-items: center; margin: 1em 0; padding: 14px 18px; border-radius: 16px; background: var(--ink); color: #fff; }
.secret-inline b { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; display: block; }
.secret-inline p { margin: 0; font-weight: 800; font-size: 19px; line-height: 1.3; }
.secret-inline img { width: 44px; flex: none; }
.words-inline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: .8em 0; }
.words-inline div { border-radius: 14px; padding: 10px 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.words-inline small { display: block; font-size: 12.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.words-inline b { font-size: 20px; }
.words-inline i { display: block; font-style: normal; font-size: 14px; color: var(--muted); }
@media (max-width: 700px) { .words-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.toc a { text-decoration: none; font-weight: 800; font-size: 15px; padding: 7px 12px; border-radius: 999px; background: var(--canvas); color: var(--ink); }
.toc a:hover { background: var(--ink); color: #fff; }
table.simple { border-collapse: collapse; width: 100%; font-size: 16px; margin: 1em 0; }
table.simple th, table.simple td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
table.simple th { font-size: 13.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.check { list-style: none; padding: 0 !important; }
.check li { padding-left: 34px; position: relative; }
.check li::before { content: ""; position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 7px; border: 2.5px solid var(--tat); }
.biblio { padding-left: 1.6em; }
.biblio li { margin-bottom: .6em; font-size: 16.5px; overflow-wrap: anywhere; }
.placeholder { background: repeating-linear-gradient(-45deg, var(--chv-tint), var(--chv-tint) 10px, #fff 10px, #fff 20px); border: 2px dashed var(--chv); border-radius: 14px; padding: 14px 18px; color: var(--chv-ink); font-weight: 800; }

/* ---------- подвал */
.site-footer { background: var(--ink); color: #D6DBEA; padding: 0 0 36px; margin-top: 40px; font-size: 15.5px; }
.site-footer .band { margin-bottom: 36px; filter: saturate(1.1); background-color: #fff; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h4 { color: #fff; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .fine { margin-top: 26px; font-size: 13.5px; color: #A9B1C9; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } }

/* ---------- печать */
@media print {
  .site-header, .site-footer, .no-print, .nav-toggle { display: none !important; }
  body { font-size: 12pt; }
  section { padding: 12pt 0; }
  .card, .speech, .wcard { box-shadow: none; border: 1px solid #ccc; }
  a { color: inherit; text-decoration: none; }
  .block-head { break-after: avoid; }
}

/* ---------- игротека */
.games-head { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: center; }
.uzor-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-align: center; }
.uzor-box img { width: 100%; }
.uzor-box p { margin: 10px 0 0; font-weight: 800; font-size: 16px; color: var(--muted); }
@media (max-width: 760px) { .games-head { grid-template-columns: 1fr; } .uzor-box { max-width: 300px; } }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .game-grid { grid-template-columns: 1fr; } }
.game-card { text-align: left; font: inherit; color: var(--ink); background: #fff; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; position: relative; transition: transform .15s, box-shadow .15s; }
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.game-card .gi { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; padding: 0; }
.game-card .gi img { width: 44px; }
.game-card b { font-size: 21px; font-weight: 900; }
.game-card span { color: var(--muted); font-size: 16px; line-height: 1.4; }
.game-card .gdone { display: none; font-style: normal; font-weight: 900; font-size: 14px; color: var(--tat-ink); }
.game-card.done .gdone { display: block; }
.game-card.done::after { content: "✓"; position: absolute; top: 16px; right: 18px; width: 34px; height: 34px; border-radius: 50%; background: var(--tat); color: #fff; display: grid; place-items: center; font-weight: 900; }
.game-frame { background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: 22px; min-height: 460px; }
.game-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.game-top h2 { margin: 0; font-size: 28px; }
.game-sub { margin-left: auto; font-weight: 900; color: var(--muted); font-size: 16px; }
.center { text-align: center; justify-content: center; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { font: inherit; font-weight: 800; border: 0; border-radius: 999px; padding: 9px 16px; background: var(--canvas); cursor: pointer; color: var(--ink); }
.tab.on { background: var(--ink); color: #fff; }
.flip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .flip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.flip, .mcard { font: inherit; border: 0; padding: 0; background: none; cursor: pointer; perspective: 900px; height: 230px; text-align: left; color: inherit; }
.flip .in, .mcard .in { position: relative; display: block; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.flip.open .in, .mcard.open .in { transform: rotateY(180deg); }
.flip .f, .mcard .f { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.flip .a { background: var(--ct); color: var(--ci); }
.flip .a small, .flip .b small { font-weight: 900; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.flip .a > b { font-size: clamp(24px, 2.6vw, 34px); font-weight: 900; margin-top: auto; overflow-wrap: anywhere; }
.flip .a i { font-style: normal; font-size: 13.5px; opacity: .7; }
.flip .b { background: var(--c); color: #fff; transform: rotateY(180deg); }
.L-chv.flip .b { color: var(--ink); }
.flip .b > b { font-size: 28px; font-weight: 900; overflow-wrap: anywhere; }
.flip .rd { font-weight: 800; font-size: 17px; }
.flip .rd .st { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.flip .mn { font-size: 15.5px; opacity: .92; margin-top: auto; }
.flip.seen .a::after { content: "✓"; position: absolute; right: 14px; top: 12px; font-weight: 900; }
.flip-cell { position: relative; }
.flip-cell > .flip { display: block; width: 100%; }
.flip-cell > .play { position: absolute; right: 12px; bottom: 12px; margin: 0; opacity: 0; visibility: hidden; transition: opacity .25s .25s, visibility 0s .25s; }
.flip.open + .play { opacity: 1; visibility: visible; transition-delay: .25s, 0s; }
.flip.has-audio .mn { padding-right: 40px; }
.catch-stage, .guess-stage, .quiz-stage { text-align: center; padding: 10px 0 20px; }
.catch-word { font-size: clamp(44px, 8vw, 96px); font-weight: 900; line-height: 1.05; margin: 26px auto 14px; padding: 26px 20px; border-radius: 28px; background: var(--canvas); max-width: 760px; overflow-wrap: anywhere; }
.catch-word.pop { animation: pop .3s ease; }
.catch-word.good { background: var(--tat-tint); color: var(--tat-ink); }
.catch-word.bad { background: var(--mar-tint); color: var(--mar-ink); animation: shake .4s; }
@keyframes pop { from { transform: scale(.86); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.catch-hint { color: var(--muted); font-weight: 700; margin-bottom: 18px; }
.btn.big { font-size: 24px; padding: 20px 34px; }
.btn.clap { background: var(--mar); min-width: 240px; }
.btn.clap:disabled { opacity: .45; cursor: not-allowed; }
.lang-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 900px; margin: 0 auto; }
@media (max-width: 680px) { .lang-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lang-btn { font: inherit; font-weight: 900; font-size: 19px; border: 4px solid var(--c); background: #fff; color: var(--ci); border-radius: 20px; padding: 14px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lang-btn img { width: 46px; }
.lang-btn:hover { background: var(--ct); }
.lang-btn.ok { background: var(--c); color: #fff; }
.L-chv.lang-btn.ok { color: var(--ink); }
.lang-btn.no { opacity: .45; }
.guess-note { min-height: 56px; margin-top: 18px; font-weight: 800; font-size: 18px; }
.chip-pool { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; min-height: 60px; margin: 10px 0 20px; }
.chip { font: inherit; font-weight: 900; font-size: 20px; border: 0; border-radius: 14px; padding: 10px 16px; background: var(--canvas); color: var(--ink); cursor: pointer; box-shadow: 0 2px 0 rgba(30, 42, 74, .1); }
.chip.picked { background: var(--ink); color: #fff; transform: translateY(-3px); }
.chip.placed { cursor: default; background: #fff; pointer-events: none; }
.chip.shake { animation: shake .4s; background: var(--mar-tint); }
.bins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 680px) { .bins { grid-template-columns: 1fr; } }
.bin { border: 3px dashed var(--line); border-radius: 20px; padding: 14px; min-height: 170px; cursor: pointer; background: #fff; }
.bin:hover { border-color: var(--ink-2); }
.bin h3 { font-size: 20px; text-align: center; margin-bottom: 10px; }
.bin-in { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.memo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 860px; margin: 0 auto; }
@media (max-width: 680px) { .memo { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mcard { height: 130px; } }
/* на телефоне слова в карточках должны помещаться целиком: перевёртыши — в одну колонку, «Найди пару» — в две */
@media (max-width: 560px) {
  .game-frame { padding: 16px 14px; }
  .flip-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .flip { height: 172px; }
  .memo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .memo .mcard { height: 112px; }
  .mcard .f { padding: 10px; }
}
.mcard { height: 150px; }
.mcard .a { background: var(--ink); display: grid; place-items: center; }
.mcard .a img { width: 70%; max-width: 96px; }
.mcard .b { background: var(--ct); color: var(--ci); transform: rotateY(180deg); justify-content: center; align-items: center; text-align: center; }
.mcard .b > b { max-width: 100%; font-size: clamp(17px, 2vw, 22px); font-weight: 900; overflow-wrap: anywhere; }
.mcard .b small { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.mcard.done .b { background: var(--c); color: #fff; }
.L-chv.mcard.done .b { color: var(--ink); }
.mcard.done .b small { color: inherit; opacity: .85; }
.quiz-stage h3 { font-size: clamp(22px, 3vw, 32px); max-width: 780px; margin: 10px auto 20px; }
.qopts { display: grid; gap: 10px; max-width: 640px; margin: 0 auto; }
.qo { font: inherit; font-weight: 800; font-size: 19px; text-align: left; border: 0; border-radius: 16px; padding: 14px 16px; background: var(--canvas); cursor: pointer; display: flex; gap: 14px; align-items: center; color: var(--ink); }
.qo b { width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.qo:hover { background: var(--line); }
.qo.ok { background: var(--tat); color: #fff; }
.qo.no { background: var(--mar-tint); color: var(--mar-ink); }
.modal { position: fixed; inset: 0; background: rgba(15, 22, 41, .6); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-box { background: #fff; border-radius: 28px; padding: 26px; max-width: 520px; width: 100%; text-align: center; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); max-height: 92vh; overflow: auto; }
.modal-box .kbw { width: 120px; margin-top: -10px; }
.modal-box h2 { margin: 6px 0; }
.modal-box .secret-inline { text-align: left; }
.modal-box .uzor-m { width: 200px; margin: 8px auto; display: block; }
.name-in { font: inherit; font-size: 22px; font-weight: 800; width: 100%; padding: 14px 16px; border-radius: 14px; border: 3px solid var(--line); margin: 10px 0 18px; }
.name-in:focus { border-color: var(--ru); outline: none; }
.diploma-wrap { position: fixed; inset: 0; z-index: 120; background: rgba(15, 22, 41, .75); overflow: auto; padding: 20px; }
.diploma { position: relative; width: min(1000px, 100%); aspect-ratio: 297 / 210; margin: 0 auto 16px; background: #fff url("../img/dots.svg") repeat 0 0 / 12px 12px; border-radius: 12px; overflow: hidden; text-align: center; padding: 4% 8% 5%; color: var(--ink); container-type: inline-size; }
.diploma .band-d { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 6%; object-fit: cover; object-position: left; }
.diploma .dk { font-size: 4cqw; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 4%; }
.diploma .dt { font-size: 6.4cqw; font-weight: 900; color: var(--mar); line-height: 1.05; }
.diploma .dn { font-family: var(--hand); font-size: 7cqw; margin: 2% 0 1%; border-bottom: 2px solid var(--line); display: inline-block; padding: 0 4%; min-width: 50%; }
.diploma .dx { font-size: 2.1cqw; font-weight: 700; color: var(--ink-2); max-width: 80%; margin: 1% auto 0; line-height: 1.35; }
.diploma .dw { display: flex; gap: 2.4cqw; justify-content: center; font-size: 3.4cqw; font-weight: 900; margin-top: 3%; }
.diploma .dd { position: absolute; left: 0; right: 0; bottom: 5%; font-size: 1.7cqw; font-weight: 800; color: var(--muted); }
.diploma .kb-d { position: absolute; left: 4%; bottom: 6%; width: 15%; }
.diploma .uz-d { position: absolute; right: 4%; bottom: 6%; width: 15%; }
@media print {
  body.print-diploma > *:not(.diploma-wrap) { display: none !important; }
  body.print-diploma .diploma-wrap { position: static; background: none; padding: 0; }
  body.print-diploma .diploma { width: 100%; border-radius: 0; box-shadow: none; }
  @page { size: A4 landscape; margin: 0; }
}

/* переменные цвета языка (как в слайдах) */
.L-ru { --c: var(--ru); --ci: var(--ru-ink); --ct: var(--ru-tint); }
.L-mar { --c: var(--mar); --ci: var(--mar-ink); --ct: var(--mar-tint); }
.L-tat { --c: var(--tat); --ci: var(--tat-ink); --ct: var(--tat-tint); }
.L-chv { --c: var(--chv); --ci: var(--chv-ink); --ct: var(--chv-tint); }
.st { color: var(--mar-ink); font-weight: 900; }

.kit-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; align-items: end; }
.kit-gallery figure { margin: 0; text-align: center; }
.kit-gallery figure.wide { grid-column: span 2; }
.kit-gallery img { width: 100%; border-radius: 6px; box-shadow: var(--shadow); background: #fff; }
.kit-gallery figcaption { font-weight: 800; font-size: 15px; color: var(--ink-2); margin-top: 8px; }
@media (max-width: 760px) { .kit-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
table.simple th, table.simple td { overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 480px) { table.simple th { letter-spacing: 0; font-size: 12px; } table.simple th, table.simple td { padding: 8px 6px; } }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.stats div { display: flex; gap: 12px; align-items: center; padding: 4px 6px; }
.stats b { font-size: 44px; font-weight: 900; line-height: 1; color: var(--mar); }
.stats div:nth-child(2) b { color: var(--ru); } .stats div:nth-child(3) b { color: var(--tat); } .stats div:nth-child(4) b { color: var(--chv-ink); }
.stats span { font-size: 15px; font-weight: 800; color: var(--ink-2); line-height: 1.3; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
