@font-face{font-family:'Unbounded';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/unbounded-cyrillic-500-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/unbounded-latin-500-normal.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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/unbounded-cyrillic-700-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/unbounded-latin-700-normal.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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:800;font-display:swap;src:url(fonts/unbounded-cyrillic-800-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Unbounded';font-style:normal;font-weight:800;font-display:swap;src:url(fonts/unbounded-latin-800-normal.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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/golos-text-cyrillic-400-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/golos-text-latin-400-normal.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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/golos-text-cyrillic-500-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/golos-text-latin-500-normal.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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/golos-text-cyrillic-700-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Golos Text';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/golos-text-latin-700-normal.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+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* Раскладка: одна колонка, как полоса с кроссвордом в журнале. Чёрно-белые клетки
   задают весь язык страницы: название, поля ввода и игра собраны из одних и тех же клеток,
   а жёлтый маркер отмечает то, что найдено. */
:root {
  --bg: #f2f3ef;
  --surface: #ffffff;
  --ink: #131517;
  --muted: #5a6068;
  --rule: #cdd1ca;
  --mark: #ffe45c;        /* маркер-выделитель */
  --mark-ink: #131517;
  --btn: #131517;
  --btn-ink: #ffffff;
  --good: #2f9e55;        /* буква на месте */
  --warn: #d9a100;        /* буква есть, место другое */
  --none: #7b838b;        /* буквы нет */
  --state-ink: #ffffff;
  --font-display: 'Unbounded', 'Arial Black', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Golos Text', 'Segoe UI', system-ui, sans-serif;
  --cell: 52px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111315; --surface: #1b1e21; --ink: #f1f2ee; --muted: #a3a9b0; --rule: #363b40;
    --mark: #ffe45c; --mark-ink: #131517; --btn: #f1f2ee; --btn-ink: #131517;
    --good: #3aa862; --warn: #c99700; --none: #5d646b; --state-ink: #ffffff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111315; --surface: #1b1e21; --ink: #f1f2ee; --muted: #a3a9b0; --rule: #363b40;
  --mark: #ffe45c; --mark-ink: #131517; --btn: #f1f2ee; --btn-ink: #131517;
  --good: #3aa862; --warn: #c99700; --none: #5d646b; --state-ink: #ffffff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--font-body); }
.page { max-width: 880px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); padding-block: 20px 48px; }
main { display: flex; flex-direction: column; gap: 32px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
a { color: var(--ink); text-decoration-color: var(--warn); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { background: var(--mark); color: var(--mark-ink); text-decoration-color: transparent; }
:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }

/* шапка: название набрано клетками кроссворда */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-bottom: 36px; }
.brand { display: inline-flex; text-decoration: none; }
.brand:hover { background: none; color: var(--ink); }
.brand span {
  display: grid; place-items: center; width: 30px; height: 30px; margin-left: -2px;
  border: 2px solid var(--ink); background: var(--surface);
  font: 700 .82rem var(--font-display); text-transform: uppercase;
}
.brand span:first-child { margin-left: 0; background: var(--mark); color: var(--mark-ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a { padding: 7px 12px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .95rem; white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--btn); color: var(--btn-ink); }

.intro { display: flex; flex-direction: column; gap: 12px; }
.intro h1 { font-weight: 800; font-size: clamp(1.55rem, 1rem + 2.7vw, 2.6rem); line-height: 1.12; letter-spacing: -.02em; }
.intro p { margin: 0; max-width: 62ch; font-size: 1.06rem; color: var(--muted); }

/* инструмент */
.tool { background: var(--surface); border: 2px solid var(--ink); padding: clamp(16px, 3vw, 28px); }
.panel { display: flex; flex-direction: column; gap: 18px; }
.label { display: flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hint { margin: 0; font-size: .92rem; color: var(--muted); }
.hint b { color: var(--ink); font-weight: 700; }
.seg { display: inline-flex; align-self: flex-start; border: 2px solid var(--ink); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 14px; font-weight: 500; font-size: .95rem; }
.seg input:checked + span { background: var(--btn); color: var(--btn-ink); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--warn); outline-offset: 2px; }
#mask-len, #mask-any { display: flex; flex-direction: column; gap: 14px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 36px; height: 36px; border: 2px solid var(--ink); background: var(--surface); cursor: pointer;
  font: 700 1.2rem/1 var(--font-body); display: grid; place-items: center; padding: 0;
}
.stepper button:hover { background: var(--mark); color: var(--mark-ink); }
.stepper output { min-width: 2ch; text-align: center; font: 700 1.25rem var(--font-display); font-variant-numeric: tabular-nums; }
.cells { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, var(--cell))); }
.cell {
  width: 100%; aspect-ratio: 1; min-width: 0; margin: 0; padding: 0; border: 2px solid var(--ink); border-radius: 0;
  background: var(--surface); text-align: center; text-transform: uppercase; caret-color: var(--warn);
  font: 700 clamp(.8rem, 4.2cqw, 1.45rem) var(--font-display);
}
.cells { container-type: inline-size; max-width: calc(var(--n, 5) * var(--cell)); }
.cells .cell + .cell { border-left-width: 0; }
.cell:focus { outline: none; background: var(--mark); color: var(--mark-ink); }
.cell.filled { background: var(--mark); color: var(--mark-ink); }
.cells.good .cell.filled { background: var(--good); color: var(--state-ink); }
.cells.warn .cell.filled { background: var(--warn); color: var(--state-ink); }
.cells.warn .cell { font-size: clamp(.7rem, 3.4cqw, 1.05rem); letter-spacing: .02em; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 12px; }
.field input, .field select {
  width: 100%; min-width: 0; border: 2px solid var(--ink); border-radius: 0; background: var(--surface);
  padding: 9px 12px; font-size: 1.05rem;
}
.field.inline select { width: auto; }
.field input.big { font: 700 1.3rem var(--font-display); text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; }
.field input::placeholder { color: var(--muted); opacity: .55; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.more summary { cursor: pointer; font-weight: 500; }
.more[open] summary { margin-bottom: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.five-row { display: flex; flex-direction: column; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.none { background: var(--none); }
.link { align-self: flex-start; border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--warn); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.btn { border: 2px solid var(--btn); background: var(--btn); color: var(--btn-ink); padding: 10px 18px; cursor: pointer; font-weight: 700; border-radius: 0; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 6px 12px; font-size: .92rem; }
.btn:hover { background: var(--mark); border-color: var(--ink); color: var(--mark-ink); }
.btn[aria-pressed="true"] { background: var(--mark); color: var(--mark-ink); border-color: var(--ink); }

/* результаты */
.results { display: flex; flex-direction: column; gap: 18px; }
.results:empty { display: none; }
.count { margin: 0; font: 700 1.15rem var(--font-display); }
.count small { display: block; margin-top: 4px; font: 400 .95rem var(--font-body); color: var(--muted); }
.group { display: flex; flex-direction: column; gap: 10px; }
.group h2, .group h3 { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.words { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.words li { background: var(--surface); border: 1px solid var(--rule); padding: 4px 10px; font-size: 1.02rem; }
.words li:nth-child(-n+3) { border-color: var(--ink); }
.note { margin: 0; color: var(--muted); font-size: .95rem; }
.empty { margin: 0; padding: 22px; border: 2px dashed var(--rule); color: var(--muted); text-align: center; }

/* игра */
.game { align-items: center; }
.game-head { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.game-title { margin: 0; font: 700 1rem var(--font-display); }
.game-actions { display: flex; gap: 6px; }
.board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 6px; width: min(100%, 320px); }
.board .r { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tile {
  aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--rule); background: var(--surface);
  font: 700 clamp(1.2rem, 6vw, 1.7rem) var(--font-display); text-transform: uppercase;
}
.tile.typed { border-color: var(--ink); }
.tile.g { background: var(--good); border-color: var(--good); color: var(--state-ink); }
.tile.y { background: var(--warn); border-color: var(--warn); color: var(--state-ink); }
.tile.x { background: var(--none); border-color: var(--none); color: var(--state-ink); }
.tile.flip { animation: flip .45s ease both; animation-delay: calc(var(--i) * 110ms); }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.r.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.game-msg { margin: 0; min-height: 1.6em; text-align: center; font-weight: 500; }
.game-end { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.game-end textarea { width: min(100%, 320px); border: 2px solid var(--ink); background: var(--surface); padding: 10px; resize: none; font-size: 1rem; line-height: 1.3; }
.keys { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 560px; }
.keys .kr { display: flex; justify-content: center; gap: 4px; }
.key {
  flex: 1 1 0; min-width: 0; max-width: 44px; height: 48px; padding: 0; border: 0; border-radius: 4px; cursor: pointer;
  background: var(--rule); color: var(--ink); font: 700 clamp(.78rem, 3.4vw, 1rem) var(--font-body); text-transform: uppercase;
}
.key.wide { flex: 1.7 1 0; max-width: 74px; font-size: 1.1rem; }
.key.g { background: var(--good); color: var(--state-ink); } .key.y { background: var(--warn); color: var(--state-ink); } .key.x { background: var(--none); color: var(--state-ink); opacity: .55; }
.game-stats { margin: 0; color: var(--muted); font-size: .95rem; text-align: center; }

/* тексты и каталог */
.extra { display: flex; flex-direction: column; gap: 28px; }
.extra:empty { display: none; }
.extra section { display: flex; flex-direction: column; gap: 12px; }
.extra h2, .catalog h2 { font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; }
.extra p, .extra ul, .extra ol { margin: 0; max-width: 65ch; }
.extra ul, .extra ol { padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-width: none !important; }
.chips a { display: block; padding: 5px 11px; border: 2px solid var(--ink); background: var(--surface); text-decoration: none; font-weight: 500; }
.chips a[aria-current="page"] { background: var(--btn); color: var(--btn-ink); }
.chips.letters a { min-width: 2.4em; text-align: center; text-transform: uppercase; font-family: var(--font-display); font-size: .85rem; }
.bars { display: flex; flex-direction: column; gap: 6px; max-width: 560px; font-variant-numeric: tabular-nums; }
.br { display: grid; grid-template-columns: 2.4ch minmax(0, 1fr) 6.5ch; gap: 12px; align-items: center; }
.br i { display: block; height: 14px; background: var(--ink); min-width: 2px; }
.br.peak i { background: var(--warn); }
.br .bn { color: var(--muted); font-size: .92rem; text-align: right; white-space: nowrap; }
.catalog { display: flex; flex-direction: column; gap: 18px; border-top: 2px solid var(--ink); padding-top: 24px; }
.catalog section { display: flex; flex-direction: column; gap: 10px; }
.catalog h2 { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ad:empty { display: none; }
.ad { border: 2px dashed var(--rule); padding: 20px 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.foot { margin-top: 36px; color: var(--muted); font-size: .92rem; }
.foot p { margin: 0; }
.foot a { color: inherit; margin-left: 10px; }
.doc { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 2px solid var(--ink); padding: clamp(18px, 4vw, 36px); }
.doc h1 { font-weight: 800; font-size: clamp(1.4rem, 1rem + 2vw, 2rem); line-height: 1.15; letter-spacing: -.02em; }
.doc h2 { font-weight: 700; font-size: 1.05rem; margin-top: 10px; }
.doc p { margin: 0; max-width: 65ch; }
.doc-date { color: var(--muted); font-size: .92rem; }
.mail { font-weight: 700; user-select: all; }
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); z-index: 10; max-width: 620px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; background: var(--surface); border: 2px solid var(--ink); padding: 14px 16px;
}
.cookie p { margin: 0; flex: 1 1 260px; font-size: .93rem; line-height: 1.4; }

@media (max-width: 520px) {
  :root { --cell: 44px; }
  .top { margin-bottom: 26px; }
  .brand span { width: 26px; height: 26px; font-size: .72rem; }
  .tabs { gap: 2px; }
  .tabs a { padding: 6px 8px; font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) { .tile.flip, .r.shake { animation: none; } }
