/* Кроссворды онлайн — дизайн-система (токены из ТЗ §04). Mobile-first, без max-width на всю страницу. */
:root {
  --ink: #202240; --muted: #66708d; --surface: #fff; --bg: #f6f7fc; --accent: #7554e8;
  --grad: linear-gradient(120deg, #7252e9, #e04fa0);
  --cell-word: #ddd4ff; --cell-active: #ffca70; --cell-cross: #b7e9e4; --cell-error: #ffe0e4;
  --line: #e5e8f3; --radius: 18px; --shadow: 0 6px 24px rgba(63, 49, 140, .10);
  --pad: clamp(12px, 1.5vw, 32px);
  --bar-h: 60px; --nav-h: 44px; --header-h: calc(var(--bar-h) + var(--nav-h)); --side-w: 250px;
  --ok: #1d7a4b; --err: #c0364f;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; overflow-wrap: anywhere; }
img, svg { max-width: 100%; }
a { color: var(--accent); }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); line-height: 1.2; margin: .2em 0 .4em; }
h2 { font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); line-height: 1.25; margin: 0 0 .6em; }
h3 { font-size: 1.05rem; margin: 0; }
p { margin: 0 0 .9em; }
.muted { color: var(--muted); }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid #1f6feb; outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── Кнопки ── */
.btn-grad, .btn-light, .btn-link { font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; }
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(114, 82, 233, .28); }
.btn-grad:hover { filter: brightness(1.05); }
.btn-grad[disabled], .btn-light[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-light:hover { border-color: var(--accent); }
.btn-light[aria-pressed="true"], .btn-light.is-on { background: var(--cell-word); border-color: var(--accent); }
.btn-link { background: none; color: var(--accent); padding: 0 6px; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1.05rem; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: #eeeaff; }

/* ── Шапка ── */
.site-header { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: var(--bar-h); padding: 6px var(--pad); padding-top: max(6px, env(safe-area-inset-top)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; font-size: 1.05rem; }
.logo-text small { font-weight: 600; color: var(--muted); font-size: .72rem; letter-spacing: .04em; }
.search { position: relative; flex: 1 1 100%; order: 5; display: none; }
.site-header.search-open .search { display: block; }
.search input { width: 100%; height: 46px; border-radius: 999px; border: 1.5px solid var(--line); background: #f3f1fd; padding: 0 52px 0 18px; font: inherit; color: var(--ink); }
.search input:focus { background: #fff; border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(117, 84, 232, .2); }
.search-submit { position: absolute; right: 4px; top: 3px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; cursor: pointer; }
.search-toggle { margin-left: auto; }
.top-links { display: none; gap: 4px; align-items: center; }
.top-links a { padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; }
.top-links a:hover, .top-links a[aria-current] { background: #eeeaff; color: var(--accent); }
/* Верхняя полоса разделов (под поиском) */
.main-nav { order: 9; flex: 1 1 100%; min-width: 0; height: var(--nav-h); margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul { display: flex; align-items: center; gap: 2px; height: 100%; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.main-nav a { display: block; padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.main-nav a:hover { background: #f3f1fd; }
.main-nav a[aria-current] { background: #eeeaff; color: var(--accent); font-weight: 800; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 40; }
.suggest li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.suggest li a small { color: var(--muted); white-space: nowrap; }
.suggest li[aria-selected="true"] a, .suggest li a:hover { background: #eeeaff; }

/* ── Каркас ── */
.shell { display: block; }
.sidebar { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(86vw, 320px); transform: translateX(-102%); transition: transform .22s ease; background: #fff; overflow-y: auto; padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); border-right: 1px solid var(--line); box-shadow: var(--shadow); visibility: hidden; }
.sidebar.is-open { transform: none; visibility: visible; }
.scrim { position: fixed; inset: 0; background: rgba(32, 34, 64, .45); z-index: 45; }
.content-col { min-width: 0; padding: 0 var(--pad); }
main { padding: 18px 0 40px; min-height: 60vh; min-width: 0; }
main:focus { outline: none; }
.site-footer { padding: 22px 0 calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; }
.site-footer p { margin: 0 0 .3em; }
@media (min-width: 1024px) {
  :root { --bar-h: 64px; }
  .site-header { flex-wrap: nowrap; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) auto; padding-top: 6px; padding-bottom: 0; gap: 0 12px; }
  .menu-btn, .search-toggle, .scrim { display: none !important; }
  .logo { grid-column: 1; }
  .search { display: block; grid-column: 2; order: 0; flex: none; width: 100%; max-width: 720px; justify-self: center; }
  .top-links { display: flex; grid-column: 3; padding-bottom: 6px; }
  .logo, .search { margin-bottom: 6px; }
  .main-nav { grid-column: 1 / -1; order: 0; margin: 0 calc(var(--pad) * -1); }
  .side-mobile { display: none; }
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); align-items: start; }
  .sidebar { position: sticky; top: var(--header-h); width: auto; height: calc(100vh - var(--header-h)); transform: none; visibility: visible; box-shadow: none; z-index: 1; }
}
@media (min-width: 1440px) { :root { --side-w: 270px; } }

/* ── Меню ── */
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: .96rem; }
.sidebar a:hover { background: #f3f1fd; }
.sidebar a[aria-current] { background: var(--cell-word); font-weight: 700; color: #3b2aa5; }
.side-top, .side-bottom { margin-bottom: 8px; }
.side-bottom { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.side-sec { margin: 6px 0; }
.side-sec > summary { cursor: pointer; font-weight: 800; padding: 8px 12px; border-radius: 12px; list-style: none; text-transform: uppercase; font-size: .76rem; letter-spacing: .06em; color: var(--muted); }
.side-sec > summary::-webkit-details-marker { display: none; }
.side-sec > summary::after { content: "▾"; float: right; }
.side-sec:not([open]) > summary::after { content: "▸"; }
.side-title { margin: 4px 0 8px; padding: 0 12px; font-weight: 800; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.sidebar .side-title a { display: inline; padding: 0; color: var(--muted); background: none; }
.sidebar .side-title a:hover { background: none; color: var(--accent); }
.side-sub { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 2px solid var(--line); }
.side-sub > summary { cursor: pointer; font-size: .76rem; color: var(--muted); padding: 2px 8px; list-style: none; }
.side-sub > summary::-webkit-details-marker { display: none; }
.side-sub a { padding: 6px 10px; font-size: .92rem; }
.side-group { margin: 8px 12px 2px; font-size: .78rem; color: var(--muted); font-weight: 700; }
.cnt { font-size: .78rem; color: var(--muted); background: #f1effa; border-radius: 999px; padding: 0 8px; min-width: 1.6em; text-align: center; }

/* ── Блоки и сетки ── */
.lead { font-size: 1.08rem; color: #3a3d63; max-width: 70ch; }
.prose { max-width: 75ch; }
.prose h2 { margin-top: 1.2em; }
.prose-p { max-width: 75ch; }
section.block { margin: 28px 0; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 800; color: var(--accent); margin: 0 0 4px; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); min-width: 0; }
.card-thumb { display: grid; place-items: center; background: linear-gradient(180deg, #f5f2ff, #fff); padding: 14px; height: 150px; }
.thumb { max-height: 122px; width: auto; max-width: 100%; border-radius: 6px; box-shadow: 0 2px 10px rgba(63, 49, 140, .15); }
.t-bg { fill: #fff; } .t-dark { fill: #2a2c52; } .t-mark { fill: #ebe6ff; } .t-line { stroke: #c9c3ea; stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 1.08rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-desc { color: var(--muted); font-size: .93rem; margin: 0; flex: 1; }
.card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #3b2aa5; background: var(--cell-word); border-radius: 999px; padding: 2px 10px; }
.badge-new { background: #ffe9b0; color: #7a4b00; }
.badge-state { background: #d6f3e4; color: #145a37; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: .8rem; color: #4a4e75; background: #f3f1fd; border-radius: 999px; padding: 2px 10px; }
.chips a { color: inherit; text-decoration: none; }
.chips-lg li { font-size: .9rem; padding: 4px 12px; }
.card-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.progress-line { height: 6px; border-radius: 6px; background: #ece9fa; overflow: hidden; }
.progress-line span { display: block; height: 100%; background: var(--grad); width: 0; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); }
.tile strong { font-size: 1.05rem; }
.tile span { color: var(--muted); font-size: .9rem; }
.tile em { font-style: normal; color: var(--accent); font-weight: 700; font-size: .88rem; }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pills a { display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; }
.pills a:hover { border-color: var(--accent); }
.hero { display: grid; gap: 22px; padding: clamp(18px, 3vw, 40px); border-radius: 26px; background: linear-gradient(135deg, #efeaff 0%, #fde8f3 100%); }
.hero h1 { margin-top: 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.hero-text { max-width: 760px; }
.hero-stats { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.hero-stats li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.65); border: 1px solid rgba(110,90,200,.18); }
.hero-stats b { font-size: clamp(20px, 3vw, 28px); line-height: 1.1; color: #5b3fd1; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 13px; line-height: 1.25; color: #4a4670; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-stats li { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); } :root:not([data-theme="light"]) .hero-stats b { color: #b9a8ff; } :root:not([data-theme="light"]) .hero-stats span { color: #cfcbe8; } }
:root[data-theme="dark"] .hero-stats li { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.14); } :root[data-theme="dark"] .hero-stats b { color: #b9a8ff; } :root[data-theme="dark"] .hero-stats span { color: #cfcbe8; }
.hero-daily { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(280px, 400px)); align-items: stretch; }
.hero-daily > div { display: flex; flex-direction: column; }
.hero-daily > div > .card { flex: 1; }
.hero-daily .card { max-width: none; }
@media (min-width: 1250px) { .hero { grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr); align-items: center; gap: 36px; } .hero-text { max-width: none; } .hero-daily { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hero-daily .eyebrow { margin: 0 0 6px; }
.crumbs ol { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .88rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 8px; }
.crumbs a { color: var(--muted); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 18px 0; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stats strong { display: block; font-size: 1.9rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.stats span { color: var(--muted); font-size: .9rem; }
.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.filters select, .search-page input, .report textarea, .report select { font: inherit; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); padding: 0 12px; }
.filters-actions { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.result-line { margin: 14px 0; color: #3a3d63; }
.empty { background: #fff; border: 1px dashed #cfc9ee; border-radius: var(--radius); padding: 20px; }
.pager { display: flex; gap: 6px; flex-wrap: wrap; margin: 24px 0; }
.pager a { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pager a[aria-current] { background: var(--grad); color: #fff; border-color: transparent; }
.search-page { display: flex; gap: 8px; margin: 12px 0 18px; max-width: 640px; }
.search-page input { flex: 1; min-width: 0; }
.clue-list { padding-left: 1.8em; margin: 0 0 1em; }
.clue-list li { margin-bottom: .35em; }
.len { color: var(--muted); font-size: .86em; }
.report details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; }
.report summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.report form { display: grid; gap: 10px; max-width: 480px; margin-top: 10px; }
.report label { display: grid; gap: 4px; font-size: .88rem; font-weight: 700; color: var(--muted); }
.report textarea { padding: 10px 12px; }

/* ── Игровая страница ── */
.game-head { display: grid; gap: 10px; margin-bottom: 14px; }
.game { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(10px, 1.6vw, 22px); min-width: 0; }
.game-fallback { color: var(--ink); }
.g-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.g-toolbar .btn-light, .g-toolbar .btn-grad { min-height: 44px; padding: 0 14px; font-size: .94rem; }
.g-toolbar .grow { flex: 1; }
.g-meta { display: flex; gap: 14px; align-items: center; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.g-meta strong { color: var(--ink); }
.g-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .g-layout { grid-template-columns: minmax(0, auto) minmax(260px, 1fr); align-items: start; } }
@media (min-width: 1920px) { .g-layout.has-clues { grid-template-columns: minmax(0, auto) minmax(0, 1fr); } .g-clues-cols { columns: 2; column-gap: 28px; } }
.g-board-wrap { min-width: 0; overflow: auto; max-width: 100%; -webkit-overflow-scrolling: touch; padding: 4px; }
.g-board-wrap.pan { touch-action: pan-x pan-y; }
.g-current { position: sticky; top: calc(var(--header-h) + 4px); z-index: 5; background: #f3f1fd; border: 1px solid #ddd4ff; border-radius: 14px; padding: 10px 14px; margin-bottom: 10px; min-height: 48px; display: flex; gap: 10px; align-items: baseline; }
.g-current b { color: var(--accent); white-space: nowrap; }
.g-clues h3 { margin: 0 0 6px; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.g-clues ol { list-style: none; margin: 0 0 14px; padding: 0; }
.g-clues li button { width: 100%; text-align: left; font: inherit; background: none; border: 0; border-radius: 10px; padding: 7px 10px; cursor: pointer; color: var(--ink); display: flex; gap: 8px; min-height: 36px; }
.g-clues li button:hover { background: #f3f1fd; }
.g-clues li.active button { background: var(--cell-word); }
.g-clues li.done button { color: var(--muted); }
.g-clues li.done .n::after { content: " ✓"; color: var(--ok); }
.g-clues .n { font-weight: 800; min-width: 2ch; color: var(--accent); }
.g-clues-cols { }
.g-status { min-height: 1.6em; margin: 8px 0 0; font-weight: 600; }
.g-status.err { color: var(--err); } .g-status.ok { color: var(--ok); }
.g-keys { color: var(--muted); font-size: .85rem; margin-top: 6px; }
kbd { background: #f1effa; border: 1px solid #ddd8f3; border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; font: inherit; font-size: .85em; }

/* Буквенная сетка (классика и кейворд) */
.board { --cell: 44px; display: grid; width: max-content; gap: 0; grid-auto-rows: var(--cell); align-content: start; align-items: start; border: 2px solid var(--ink); background: var(--ink); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.board .row { display: contents; }
.cell { position: relative; width: var(--cell); height: var(--cell); background: #fff; border: 0; outline: 1px solid #6c6f93; outline-offset: -0.5px; display: grid; place-items: center; font-size: calc(var(--cell) * .56); font-weight: 700; color: var(--ink); cursor: pointer; padding: 0; line-height: 1; }
.cell.block { background: var(--ink); cursor: default; outline: none; margin: 0; }
.cell .num { position: absolute; left: 2px; top: 1px; font-size: max(9px, calc(var(--cell) * .24)); font-weight: 700; color: #4a4e75; line-height: 1; }
.cell .ch { pointer-events: none; }
.cell.in-word { background: var(--cell-word); }
.cell.same { background: var(--cell-cross); }
.cell.active { background: var(--cell-active); }
.cell.given .ch { color: #3b2aa5; }
.cell.err { background: var(--cell-error); box-shadow: inset 0 0 0 3px var(--err); }
.cell.err::after { content: "✕"; position: absolute; right: 3px; bottom: 1px; font-size: calc(var(--cell) * .24); color: var(--err); }
.cell.hinted .ch { color: #8a4b00; }
.cell:focus-visible { z-index: 2; outline: 3px solid #1f6feb; outline-offset: -3px; }
.kw-code { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); margin-top: 6px; }
.kw-code button { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 12px; min-height: 52px; padding: 2px; cursor: pointer; display: grid; place-items: center; line-height: 1.1; color: var(--ink); }
.kw-code button small { font-size: .7rem; color: var(--muted); }
.kw-code button b { font-size: 1.15rem; min-height: 1.3em; }
.kw-code button.sel { background: var(--cell-active); border-color: #e0a73d; }
.kw-code button.is-given { background: var(--cell-word); }
.kw-code button.err { background: var(--cell-error); border-color: var(--err); }
.kw-alpha { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.kw-alpha button { min-width: 38px; min-height: 40px; font: inherit; font-weight: 700; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.kw-alpha button.used { background: #eee; color: #999; }
.osk { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.osk button { min-width: 36px; min-height: 44px; flex: 1 0 36px; max-width: 56px; font: inherit; font-weight: 700; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.ime-input { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; font-size: 16px; pointer-events: none; }

/* Филворд */
.ws-board { --cell: 40px; display: grid; width: max-content; grid-auto-rows: var(--cell); align-content: start; background: #fff; border: 2px solid var(--ink); border-radius: 8px; touch-action: none; user-select: none; -webkit-user-select: none; position: relative; }
.ws-cell { width: var(--cell); height: var(--cell); display: grid; place-items: center; font-weight: 700; font-size: calc(var(--cell) * .5); color: var(--ink); border-radius: 50%; margin: 2px; width: calc(var(--cell) - 4px); height: calc(var(--cell) - 4px); }
.ws-cell.sel { background: var(--cell-active); }
.ws-cell.hint { box-shadow: 0 0 0 3px #1f6feb inset; }
.ws-cell.f1 { background: #ddd4ff; } .ws-cell.f2 { background: #b7e9e4; } .ws-cell.f3 { background: #ffd9b0; } .ws-cell.f4 { background: #ffd0e0; }
.ws-cell.f5 { background: #d2eaa8; } .ws-cell.f6 { background: #cfe0ff; } .ws-cell.f7 { background: #f3e0a0; } .ws-cell.f8 { background: #e6ccf5; }
.ws-cell.f1, .ws-cell.f2, .ws-cell.f3, .ws-cell.f4, .ws-cell.f5, .ws-cell.f6, .ws-cell.f7, .ws-cell.f8 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ws-words { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.ws-words li { padding: 8px 12px; border-radius: 10px; background: #f3f1fd; font-weight: 700; letter-spacing: .04em; }
.ws-words li.found { text-decoration: line-through; color: var(--muted); background: #e6f6ee; }
.ws-words li.found::before { content: "✓ "; color: var(--ok); }
.ws-dirs { color: var(--muted); font-size: .9rem; margin: 0 0 8px; }

/* Нонограмма */
.ng { --cell: 28px; display: grid; width: max-content; align-content: start; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
.ng-corner { background: #f3f1fd; }
.ng-ccol { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; width: var(--cell); padding: 3px 0; background: #f3f1fd; font-size: max(10px, calc(var(--cell) * .42)); font-weight: 700; line-height: 1.2; border-left: 1px solid #d5d0f0; }
.ng-crow { display: flex; justify-content: flex-end; align-items: center; gap: 6px; height: var(--cell); padding: 0 6px; background: #f3f1fd; font-size: max(10px, calc(var(--cell) * .42)); font-weight: 700; border-top: 1px solid #d5d0f0; }
.ng-ccol span, .ng-crow span { transition: color .15s; }
.ng-ccol.ok, .ng-crow.ok { color: #9aa0bd; }
.ng-ccol.bad, .ng-crow.bad { color: var(--err); }
.ng-ccol.ng-g5, .ng-crow.ng-g5 { }
.ng-cell { width: var(--cell); height: var(--cell); border: 0; border-top: 1px solid #c7c9de; border-left: 1px solid #c7c9de; background: #fff; position: relative; padding: 0; display: block; cursor: pointer; }
.ng-cell.r5 { border-right: 0; }
.ng-cell.g-r { border-right: 2px solid var(--ink); }
.ng-cell.g-b { border-bottom: 2px solid var(--ink); }
.ng-cell.filled { background: #2a2c52; }
.ng-cell.cross::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; color: #7a7ea3; font-size: calc(var(--cell) * .8); line-height: 1; font-weight: 700; }
.ng-cell.err { box-shadow: inset 0 0 0 3px var(--err); }
.ng-cell.err.filled { background: #8a2338; }
.ng-cell.hint { box-shadow: inset 0 0 0 3px #1f6feb; }
.ng-cell.hover { background: #eeeaff; }
.ng-cell.filled.hover { background: #3b3e72; }
.tool-group { display: inline-flex; gap: 4px; }

/* Модалка и тосты */
dialog.modal { border: 0; border-radius: 22px; padding: 0; width: min(92vw, 460px); box-shadow: 0 20px 60px rgba(32, 34, 64, .35); color: var(--ink); }
dialog.modal::backdrop { background: rgba(32, 34, 64, .5); }
.modal-in { padding: 24px; }
.modal-in h2 { margin-top: 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.result-stats { display: flex; gap: 20px; margin: 10px 0; }
.result-stats div strong { display: block; font-size: 1.5rem; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 90; max-width: min(92vw, 520px); box-shadow: var(--shadow); }

/* Печать */
.print-controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 14px var(--pad); background: #fff; border-bottom: 1px solid var(--line); }
.print-controls a[aria-current] { font-weight: 800; color: var(--ink); text-decoration: none; }
.print-controls p { flex-basis: 100%; margin: 0; }
.bare { padding: 0; min-height: 0; }
.print-sheet { background: #fff; color: #000; max-width: 210mm; margin: 16px auto; padding: 12mm; box-shadow: var(--shadow); }
.print-sheet h1 { font-size: 20pt; margin: 0 0 2mm; }
.print-sheet header p { margin: 0 0 5mm; color: #333; font-size: 10pt; }
.print-sheet footer { margin-top: 6mm; font-size: 9pt; color: #333; }
.print-svg { display: block; width: 100%; max-width: 170mm; max-height: 190mm; margin: 0 auto 6mm; height: auto; }
.print-clues { columns: 2; column-gap: 8mm; font-size: 10pt; }
.print-clues section { break-inside: avoid-column; margin-bottom: 4mm; }
.print-clues h2 { font-size: 11pt; margin: 0 0 2mm; }
.print-words ul { list-style: none; padding: 0; columns: 3; font-size: 11pt; font-weight: 700; }
.print-code { border-collapse: collapse; margin-top: 4mm; font-size: 10pt; }
.print-code th, .print-code td { border: 1px solid #000; min-width: 8mm; height: 8mm; text-align: center; }
@media print {
  body { background: #fff; }
  .no-print, .site-header, .sidebar, .site-footer, .toast, .g-toolbar, .scrim { display: none !important; }
  .print-sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .content-col { padding: 0; }
  .game, .card { box-shadow: none; border: 0; }
  a { color: inherit; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (max-width: 380px) { .g-toolbar .btn-light, .g-toolbar .btn-grad { padding: 0 10px; font-size: .88rem; } }

/* Пауза */
.g-layout { position: relative; }
.g-layout.is-paused > * { filter: blur(10px); pointer-events: none; user-select: none; }
.g-layout.is-paused::after { content: "Пауза"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; font-weight: 800; color: var(--ink); }
.cell.in-word.active { background: var(--cell-active); }

/* Меню «Ещё» в панели действий */
.g-more { position: relative; }
.g-more > summary { list-style: none; cursor: pointer; }
.g-more > summary::-webkit-details-marker { display: none; }
.g-more[open] > summary { border-color: var(--accent); }
.g-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px; display: grid; gap: 6px; min-width: 210px; box-shadow: var(--shadow); }
.g-more-menu .btn-light { justify-content: flex-start; width: 100%; }
.g-toolbar .grow { flex: 1 1 0; min-width: 0; }

/* ── Сканворд ── */
.sc-board .cell.qcell { background: #eeeaff; cursor: pointer; display: flex; flex-direction: column; align-items: stretch; justify-content: stretch; padding: 0; font-weight: 600; overflow: hidden; }
.sc-board .qcell .q-item { flex: 1 1 0; min-height: 0; display: block; padding: 1px 2px; font-size: max(7px, calc(var(--cell) * .17)); line-height: 1.05; color: #2c2f57; overflow: hidden; text-align: left; hyphens: auto; }
.sc-board .qcell.q2 .q-item + .q-item { border-top: 1px solid #a9a3d6; }
.sc-board .qcell .q-n { font-style: normal; font-weight: 800; color: var(--accent); font-size: max(8px, calc(var(--cell) * .2)); margin-right: 2px; }
.sc-board .qcell .q-t { overflow: hidden; display: inline; word-break: normal; overflow-wrap: break-word; }
.sc-board .qcell .q-item.on { background: var(--cell-active); }
.sc-board .qcell.q-active { background: #e1daff; }
.sc-board.sc-compact .q-t { display: none; }
.sc-board.sc-compact .qcell .q-item { display: grid; place-items: center; }
.sc-board.sc-compact .qcell .q-n { font-size: max(11px, calc(var(--cell) * .34)); }
.sc-arrow { position: absolute; inset: 0; width: 100%; height: 100%; color: #b4234b; pointer-events: none; overflow: visible; }
.sc-board .cell .ch { position: relative; }

/* ── Какуро / судоку ── */
.kk-board .kk-clue { background: #2a2c52; cursor: default; outline-color: #fff; color: #fff; font-weight: 700; }
.kk-board .kk-clue::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1px), #fff calc(50% - 1px), #fff calc(50% + 1px), transparent calc(50% + 1px)); }
.kk-a, .kk-d { position: absolute; font-size: max(10px, calc(var(--cell) * .3)); line-height: 1; }
.kk-a { right: 12%; top: 10%; } .kk-d { left: 12%; bottom: 10%; }
.kk-w { font-size: calc(var(--cell) * .6); }
.kk-w.dup, .sd-c.dup { color: var(--err); }
.kk-w.dup .ch, .sd-c.dup .ch { color: var(--err); }
.kk-w.given .ch, .sd-c.given .ch { color: #3b2aa5; }
.kk-notes { position: absolute; inset: 1px; display: none; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); font-size: max(8px, calc(var(--cell) * .22)); font-weight: 600; color: #54588a; line-height: 1; pointer-events: none; }
.kk-notes.on { display: grid; }
.kk-notes i { font-style: normal; display: grid; place-items: center; }
.kk-notes.n4 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); font-size: max(9px, calc(var(--cell) * .28)); }
.kk-notes.n6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); font-size: max(9px, calc(var(--cell) * .26)); }
.num-pad { max-width: 520px; }
.num-pad button { max-width: none; flex: 1 1 40px; min-height: 48px; font-size: 1.15rem; }
.kk-run { margin-right: 14px; }
.kk-combos h4 { margin: 10px 0 4px; font-size: .9rem; }
.kk-combo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.kk-combo-list li { background: #f3f1fd; border-radius: 8px; padding: 3px 9px; font-weight: 700; letter-spacing: .12em; }
.err-note { color: var(--err); font-weight: 600; }
.hint-note { color: var(--muted); font-size: .85rem; }
.sd-board .sd-c { font-size: calc(var(--cell) * .62); }
.sd-c.bx-r { border-right: 3px solid var(--ink); } .sd-c.bx-b { border-bottom: 3px solid var(--ink); }
.sd-c.in-cage { box-shadow: inset 0 0 0 100px rgba(255, 202, 112, .25); }
.sd-c { --cg: #7a4bd1; }
.sd-board .sd-c.cg-t::before, .sd-board .sd-c.cg-b::before, .sd-board .sd-c.cg-l::before, .sd-board .sd-c.cg-r::before { content: ""; position: absolute; inset: 3px; border: 0 dashed var(--cg); pointer-events: none; }
.sd-board .sd-c.cg-t::before { border-top-width: 2px; } .sd-board .sd-c.cg-b::before { border-bottom-width: 2px; }
.sd-board .sd-c.cg-l::before { border-left-width: 2px; } .sd-board .sd-c.cg-r::before { border-right-width: 2px; }
.cg-sum { position: absolute; left: 4px; top: 2px; font-size: max(8px, calc(var(--cell) * .22)); font-weight: 700; color: #5a2fb0; line-height: 1; background: #fff; padding: 0 1px; z-index: 1; }
.sd-c.mark { box-shadow: inset 0 0 0 3px #1f6feb; }
.sd-c.active .cg-sum, .sd-c.in-word .cg-sum { background: transparent; }

/* ── Цветной нонограмм ── */
.ngc-palette { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.ngc-sw { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.35); margin-right: 6px; vertical-align: -4px; background-color: var(--c); }
.ngc-chip { display: inline-block; min-width: 1.5em; text-align: center; border-radius: 4px; padding: 0 3px; margin: 1px 0; font-weight: 800; line-height: 1.25; background-color: var(--c); border: 1px solid rgba(0,0,0,.3); }
.ng-ccol .ngc-chip { display: block; }
.ng-crow .ngc-chip { display: inline-block; }
.ng-cell.filled { background-color: var(--c, #2a2c52); }
.ng-cell.cur { box-shadow: inset 0 0 0 3px #1f6feb; }
.ng-cell.hover { filter: brightness(.94); }
.ngc .ng-cell.err { box-shadow: inset 0 0 0 3px var(--err); }
.pt-dots { background-image: radial-gradient(rgba(0,0,0,.45) 22%, transparent 24%); background-size: 6px 6px; }
.pt-stripes { background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.35) 0 2px, transparent 2px 5px); }
.pt-cross { background-image: linear-gradient(rgba(0,0,0,.35) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(0,0,0,.35) 1.5px, transparent 1.5px); background-size: 6px 6px; }
.pt-checker { background-image: conic-gradient(rgba(0,0,0,.3) 25%, transparent 25% 50%, rgba(0,0,0,.3) 50% 75%, transparent 75%); background-size: 8px 8px; }
.pt-waves { background-image: repeating-radial-gradient(circle at 0 100%, transparent 0 3px, rgba(0,0,0,.33) 3px 4.5px); background-size: 8px 8px; }
.pt-rings { background-image: radial-gradient(circle, transparent 38%, rgba(0,0,0,.4) 40% 56%, transparent 58%); background-size: 8px 8px; }
.pt-diag { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.35) 0 2px, transparent 2px 6px); }
.pt-solid { background-image: none; }

/* ── Филворд-цепочка ── */
.fw-board .ws-cell { border-radius: 10px; }
.fw-board .ws-cell.cur { box-shadow: 0 0 0 3px #1f6feb inset; }
.fw-words .fw-w { letter-spacing: .08em; }
.fw-words .fw-clue { font-weight: 500; color: var(--muted); font-size: .9rem; }
.fw-board .ws-cell.f1, .fw-board .ws-cell.f2, .fw-board .ws-cell.f3, .fw-board .ws-cell.f4, .fw-board .ws-cell.f5, .fw-board .ws-cell.f6, .fw-board .ws-cell.f7, .fw-board .ws-cell.f8 { text-decoration: none; }

/* ── Классические варианты ── */
.cw-theme { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.cw-theme h3 { margin: 0 0 4px; color: #7a5200; text-transform: none; letter-spacing: 0; font-size: 1rem; }
.cw-theme p { margin: 0 0 4px; }
.star { color: #d08a00; }
.cw-explain { flex-basis: 100%; font-size: .92rem; font-weight: 400; margin-top: 4px; }
.g-current:has(.cw-explain) { flex-wrap: wrap; }

/* ---- word-ladder / anagram-grid ---- */
.wl-wrap { max-width: 760px; }
.wl-list, .ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wl-row { display: grid; grid-template-columns: 2em 1fr; gap: 2px 10px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 2px solid transparent; }
.wl-row.bad { border-color: #c62828; background: #fdecea; }
.wl-row.good { border-color: #2e7d32; }
.wl-no { color: var(--muted, #666); font-weight: 700; text-align: right; }
.wl-field { position: relative; display: inline-block; height: 42px; min-width: 40px; }
.wl-tiles, .ag-cells { display: inline-flex; gap: 4px; }
.wl-tile { position: relative; width: 38px; height: 42px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 8px; background: #fff; font-weight: 700; font-size: 22px; color: var(--ink); }
.wl-fixed .wl-tile { background: #e6e6e6; }
.wl-tile.chg { background: var(--cell-active, #ffe9a8); }
.wl-tile.chg2 { background: #f0f4ff; }
.wl-tile.key { background: #eee; border-width: 3px; }
.wl-tile.hint { box-shadow: 0 0 0 3px #1f6feb inset; }
.ag-kn { position: absolute; top: 0; left: 3px; font-size: 10px; font-weight: 400; }
.wl-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 22px; caret-color: transparent; background: transparent; border: 0; padding: 0; }
.wl-input:focus-visible + *, .wl-field:focus-within .wl-tiles .wl-tile, .wl-field:focus-within .ag-cells .wl-tile { outline: 0; box-shadow: 0 0 0 3px #1f6feb; }
.wl-clue { grid-column: 2; color: var(--ink); }
.ag-info { display: grid; gap: 4px; grid-column: 2; }
.ag-pool { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.ag-letter { width: 26px; height: 28px; font-size: 15px; border-radius: 6px; background: #f3efe6; border-width: 1px; }
.ag-key { font-size: 20px; font-weight: 700; letter-spacing: .15em; margin-top: 12px; }

/* ---- hitori / slitherlink / hashi ---- */
.ht-board { --cell: 48px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.ht-c { width: var(--cell); height: var(--cell); display: grid; place-items: center; border: 1px solid #c9c4d8; font-weight: 700; font-size: calc(var(--cell) * .45); cursor: pointer; position: relative; background: #fff; color: var(--ink); }
.ht-c.shade { background: #26243a; color: #8b88a3; }
.ht-c.keep::after { content: ""; position: absolute; inset: 12%; border: 3px solid #2e7d32; border-radius: 50%; }
.ht-c.bad { box-shadow: inset 0 0 0 3px #c62828; }
.ht-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.ht-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
.sl-wrap, .hs-wrap { display: block; max-width: 100%; }
.sl-svg, .hs-svg { height: auto; display: block; background: #fff; border: 2px solid var(--ink); border-radius: 10px; max-width: 100%; touch-action: manipulation; }
.sl-num { font-size: 0.5px; font-size: .5px; font: 700 0.5px sans-serif; fill: var(--ink); pointer-events: none; }
.sl-num.sat { fill: #2e7d32; } .sl-num.over { fill: #c62828; }
.sl-dot { fill: #46435f; } .sl-dot.used { fill: #1f3fb4; } .sl-dot.bad { fill: #c62828; r: 0.11; }
.sl-line { stroke: transparent; stroke-width: 0.12; stroke-linecap: round; }
.sl-edge.on .sl-line { stroke: #1f3fb4; }
.sl-edge.hint .sl-line { stroke: #f59e0b; }
.sl-edge.hint.on .sl-line { stroke: #f59e0b; }
.sl-x { stroke: #c0bdd0; stroke-width: 0.05; fill: none; display: none; }
.sl-edge.off .sl-x { display: inline; }
.sl-hit { stroke: transparent; stroke-width: 0.5; cursor: pointer; stroke-linecap: round; }
.sl-hit:hover { stroke: rgba(31, 63, 180, .12); }
.hs-grid { fill: #d8d4e6; }
.hs-br { stroke: transparent; stroke-width: 0.07; stroke-linecap: round; }
.hs-br.on { stroke: #46435f; }
.hs-link.hint .hs-br.on { stroke: #f59e0b; }
.hs-hit { stroke: transparent; stroke-width: 0.55; cursor: pointer; }
.hs-hit:hover { stroke: rgba(31, 63, 180, .12); }
.hs-c { fill: #fff; stroke: #26243a; stroke-width: 0.07; }
.hs-isl.ok .hs-c { fill: #d8f2dc; stroke: #2e7d32; }
.hs-isl.over .hs-c { fill: #fdecea; stroke: #c62828; }
.hs-n { font: 700 0.42px sans-serif; fill: var(--ink); pointer-events: none; }

/* ---- рисунки-определения ---- */
.cl-pic { width: 56px; height: 56px; object-fit: contain; vertical-align: middle; background: #fff; border: 1px solid #d9d4ea; border-radius: 10px; padding: 2px; }
.pic-cur { width: 44px; height: 44px; object-fit: contain; vertical-align: middle; background: #fff; border-radius: 8px; border: 1px solid #d9d4ea; }
.pic-li { display: grid; gap: 2px; }
.pic-alt { margin: 0 0 4px 36px; font-size: 13px; color: var(--muted, #666); }
.pic-alt summary { cursor: pointer; display: inline-block; }
.sc-board .qcell .q-item.has-img { position: relative; padding: 0; }
.sc-board .qcell .q-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 3px; box-sizing: border-box; }
.sc-board .qcell .q-item.has-img .q-n { position: absolute; top: 0; left: 1px; z-index: 1; margin: 0; }
.sc-board.sc-compact .q-img { display: block; }
.print-pic { width: 44px; height: 44px; vertical-align: middle; object-fit: contain; }
.print-confirm { max-width: 560px; margin: 24px auto; padding: 20px; background: #fff; border: 2px solid var(--ink); border-radius: 14px; }
.print-badge { display: inline-block; margin: 0 0 6mm; padding: 1mm 4mm; border: 1.5px solid #000; border-radius: 99px; font: 700 10pt Arial, sans-serif; }

/* ---- ежедневные ---- */
.daily-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 18px; }
.daily-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.daily-list li { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; padding: 8px 12px; background: #fff; border-radius: 12px; }
.daily-date { font-weight: 800; min-width: 3.2em; }

/* ---- оценки ---- */
.rate-box { display: grid; gap: 6px; justify-items: center; margin: 10px 0; }
.rate-stars { display: flex; gap: 4px; }
.rate-star { font-size: 28px; line-height: 1; background: none; border: 0; cursor: pointer; color: #c8ccd8; padding: 2px 4px; }
.rate-star.on { color: #f5a623; }
.rate-star:focus-visible { outline: 2px solid #f5a623; outline-offset: 2px; border-radius: 6px; }
.rate-note { min-height: 1.2em; font-size: 14px; color: #5b6275; }

/* ---- админ-панель ---- */
.admin { max-width: 1100px; margin: 0 auto; }
.adm-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; align-items: center; }
.adm-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.adm-stat { background: #fff; border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; text-decoration: none; color: inherit; }
.adm-stat strong { font-size: 26px; }
.adm-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
.adm-table th, .adm-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e8eaf2; vertical-align: top; }
.adm-form { display: grid; gap: 12px; max-width: 420px; }
.adm-err { color: #b3261e; font-weight: 700; }
.adm-pre { background: #fff; padding: 12px; border-radius: 12px; overflow: auto; max-height: 520px; white-space: pre-wrap; }
.adm-dup { background: #fff; padding: 10px 24px; border-radius: 12px; margin-bottom: 10px; }

/* ---- аккаунт ---- */
.account { max-width: none; }
.account > .lead, .account > .notice, .account > .muted, .account > .adm-err { max-width: 760px; }
.account .adm-form { max-width: 420px; }
#acct-ach .ach-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.acct-inline { display: inline; margin: 0; }
.notice { background: #e8f5e9; color: #1b5e20; padding: 8px 12px; border-radius: 10px; }
.adm-form label { display: grid; gap: 4px; font-weight: 600; }
.adm-form input[type="email"], .adm-form input[type="password"], .adm-form input[type="text"] { padding: 10px 12px; border: 1px solid #c8ccd8; border-radius: 10px; font: inherit; }

/* ---- избранное, статистика, достижения ---- */
.fav-btn { background: none; border: 0; cursor: pointer; font-size: 22px; line-height: 1; color: #c0407a; padding: 4px 8px; border-radius: 10px; }
.fav-btn:hover, .fav-btn:focus-visible { background: #fbe4ef; }
.fav-btn-lg { font-size: 15px; background: #fff; border: 1px solid #e3d3dc; }
.card-actions .fav-btn { margin-left: auto; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--grad); }
.stat-ic { font-size: 22px; line-height: 1.2; }
.stat strong { font-size: 1.7rem; line-height: 1.15; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-cap { color: var(--muted); font-size: .88rem; }
.prog-hero { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; justify-content: space-between; padding: 22px 26px; margin: 8px 0 24px; border-radius: 20px; background: var(--grad); color: #fff; box-shadow: var(--shadow); }
.hero-main { display: grid; gap: 2px; }
.hero-badge { justify-self: start; background: rgba(255, 255, 255, .22); border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.hero-num { font-size: 3rem; line-height: 1.05; color: #fff; }
.hero-cap { opacity: .92; font-size: .95rem; }
.hero-side { display: grid; gap: 8px; min-width: min(260px, 100%); flex: 1 1 260px; max-width: 380px; }
.hero-side .progress-line { background: rgba(255, 255, 255, .3); height: 10px; }
.hero-side .progress-line span { background: #fff; }
.ach-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ach { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.ach-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: #efecfb; filter: grayscale(1); opacity: .7; }
.ach-body { display: grid; gap: 4px; min-width: 0; flex: 1; }
.ach-text { color: var(--muted); font-size: .9rem; }
.ach-count { font-size: .8rem; font-weight: 700; color: #5b4fc4; }
.ach .progress-line { height: 6px; margin-top: 2px; }
.ach-on { background: linear-gradient(135deg, #fffaf0, #fff3d6); border-color: #f5c76a; box-shadow: 0 4px 14px rgba(245, 199, 106, .28); }
.ach-on .ach-ic { background: #ffe8a8; filter: none; opacity: 1; }
.ach-ok { color: #8a5a00; }
.ach-new { background: #fff8e1; border-radius: 12px; padding: 8px 12px; margin: 8px 0; text-align: left; }
.ach-new ul { margin: 4px 0 0; padding-left: 18px; }
.metrika-px{position:absolute;left:-9999px}
.sidebar .cnt { white-space: nowrap; flex-shrink: 0; }

/* хаб разделов: крупные карточки с иконкой */
.hub-h { margin: 30px 0 12px; font-size: 1.3rem; display: flex; align-items: center; gap: 10px; }
.hub-h::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, var(--line), transparent); border-radius: 2px; }
.tiles-hub { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.tile-hub { position: relative; flex-direction: row; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #fff 0%, #f4f6ff 100%); border: 1px solid var(--line); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tile-hub::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, #5b7cfa, #9b5cf6); }
.tile-hub:hover, .tile-hub:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(60, 70, 140, .18); border-color: #8ea2ff; }
.tile-hub:focus-visible { outline: 3px solid #8ea2ff; outline-offset: 2px; }
.tile-ico { flex: none; width: 52px; height: 52px; display: grid; place-items: center; font-size: 28px; border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(60, 70, 140, .15); }
.tile-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.tile-body strong { font-size: 1.05rem; line-height: 1.25; }
.tile-count { align-self: flex-start; font-size: .8rem; font-weight: 600; color: #4a5bd0; background: #e8ecff; padding: 2px 10px; border-radius: 999px; }
.tile-go { flex: none; font-size: 1.3rem; color: #8ea2ff; transition: transform .15s ease; }
.tile-hub:hover .tile-go { transform: translateX(4px); color: #5b7cfa; }
@media (prefers-reduced-motion: reduce) { .tile-hub, .tile-go { transition: none; } .tile-hub:hover { transform: none; } }
.tile-hub .tile-body { color: var(--ink); font-size: 1rem; }
.tile-hub .tile-ico { font-size: 28px; color: initial; }
.tile-hub .tile-go { color: #8ea2ff; font-size: 1.3rem; }
.tile-hub:hover .tile-go { color: #5b7cfa; }


/* виды головоломок на главной: цветные карточки с иконкой */
.tiles-types { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.tile-type { --h: 255; position: relative; flex-direction: row; align-items: flex-start; gap: 14px; padding: 18px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, #fff 55%, hsl(var(--h) 90% 96%)); border: 1px solid hsl(var(--h) 40% 90%); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tile-type::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 40) 80% 65%)); }
.tile-type:hover, .tile-type:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 26px hsl(var(--h) 50% 40% / .2); border-color: hsl(var(--h) 70% 70%); }
.tile-type:focus-visible { outline: 3px solid hsl(var(--h) 80% 70%); outline-offset: 2px; }
.tt-0 { --h: 255; } .tt-1 { --h: 205; } .tt-2 { --h: 160; } .tt-3 { --h: 30; } .tt-4 { --h: 340; } .tt-5 { --h: 280; } .tt-6 { --h: 190; } .tt-7 { --h: 95; }
.tt-ico { flex: none; width: 54px; height: 54px; display: grid; place-items: center; font-size: 28px; border-radius: 16px; background: hsl(var(--h) 90% 94%); box-shadow: inset 0 0 0 1px hsl(var(--h) 60% 85%); }
.tt-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; align-self: stretch; }
.tt-body strong { font-size: 1.1rem; line-height: 1.25; color: var(--ink); }
.tt-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.tt-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tt-foot em { font-style: normal; font-weight: 700; font-size: .8rem; color: hsl(var(--h) 55% 38%); background: hsl(var(--h) 90% 93%); padding: 3px 11px; border-radius: 999px; }
.tt-foot i { font-style: normal; font-weight: 600; font-size: .85rem; color: hsl(var(--h) 55% 42%); opacity: 0; transform: translateX(-6px); transition: opacity .15s ease, transform .15s ease; }
.tile-type:hover .tt-foot i, .tile-type:focus-visible .tt-foot i { opacity: 1; transform: none; }
@media (hover: none) { .tt-foot i { opacity: 1; transform: none; } }
@media (max-width: 480px) { .tile-type { padding: 14px; gap: 12px; } .tt-ico { width: 46px; height: 46px; font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { .tile-type, .tt-foot i { transition: none; } .tile-type:hover { transform: none; } }

/* встраивание во фрейм */
body.is-embed { background: #fff; }
.embed-main { padding: 10px var(--pad, 12px) 6px; }
.embed-head h1 { font-size: 1.15rem; margin: 4px 0 8px; }
.embed-foot { margin: 14px 0 6px; padding-top: 8px; border-top: 1px solid var(--line); text-align: center; font-size: .9rem; }
.embed-code { width: 100%; font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #f7f8ff; color: var(--ink); resize: vertical; }
.embed-box details > summary { cursor: pointer; font-weight: 700; }

/* телефоны: подсказка над полем — номер сверху, текст на всю ширину; крупные сетки не ломают раскладку */
@media (max-width: 640px) {
  .g-current { flex-wrap: wrap; gap: 2px 8px; padding: 8px 12px; min-height: 0; font-size: .95rem; line-height: 1.3; }
  .g-current b { flex: 0 0 100%; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
}

/* ── Меню v20: 6 групп видов, аккордеон, «Фильтры» ── */
@media (max-width: 767px) {
  :root { --nav-h: 0px; }
  .main-nav { display: none; }
}
.side-primary { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.side-primary a { font-weight: 700; }
.side-acc { margin: 0 0 4px; border-radius: 12px; }
.side-acc > summary { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: .95rem; list-style: none; }
.side-acc > summary::-webkit-details-marker { display: none; }
.side-acc > summary::after { content: "▸"; margin-left: 4px; color: var(--muted); font-size: .8rem; transition: transform .15s; }
.side-acc[open] > summary::after { transform: rotate(90deg); }
.side-acc > summary:hover { background: #f3f1fd; }
.side-acc > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.side-acc[open] > summary { color: var(--accent); }
.side-acc .acc-t { flex: 1; }
.side-acc > ul { margin: 2px 0 2px 14px; padding-left: 8px; border-left: 2px solid var(--line); }
.side-acc .side-all { display: block; margin: 2px 0 6px 22px; padding: 6px 10px; font-size: .88rem; font-weight: 700; color: var(--accent); }
.type-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.type-jump a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; font-size: .92rem; }
.type-jump a:hover { background: #f3f1fd; border-color: #cfc4ff; }
.type-jump .cnt { color: var(--muted); font-weight: 600; margin-left: 4px; }
.type-group .hub-h small { font-size: .78rem; font-weight: 600; color: var(--muted); }
.type-blurb { margin: -6px 0 12px; }
.more-types { margin-top: 14px; }
.more-types > summary { display: inline-block; cursor: pointer; padding: 9px 16px; border-radius: 999px; background: #eeeaff; color: var(--accent); font-weight: 700; list-style: none; }
.more-types > summary::-webkit-details-marker { display: none; }
.more-types[open] > summary { margin-bottom: 14px; }
.more-types > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.filters-toggle { display: none; }
@media (max-width: 767px) {
  .filters-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: 8px 0; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; }
  .filters.filters-collapsed { display: none; }
  .tiles-hub { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .side-acc > summary::after { transition: none; } }

/* ---- shikaku ---- */
.sk-board { --cell: 44px; position: relative; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: none; }
.sk-c { width: var(--cell); height: var(--cell); box-sizing: border-box; border: 1px solid #d8d3e6; display: grid; place-items: center; font-weight: 800; font-size: calc(var(--cell) * .44); color: var(--ink); position: relative; z-index: 2; }
.sk-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.sk-n { pointer-events: none; }
.sk-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.sk-rect { position: absolute; box-sizing: border-box; border: 3px solid #5b45c9; border-radius: 6px; background: rgba(117, 84, 232, .16); pointer-events: none; }
.sk-prev { z-index: 3; border-style: dashed; background: rgba(31, 111, 235, .14); border-color: #1f6feb; }
.sk-k0 { background: rgba(117, 84, 232, .18); border-color: #5b45c9; } .sk-k1 { background: rgba(224, 79, 160, .16); border-color: #c0357f; }
.sk-k2 { background: rgba(46, 125, 50, .16); border-color: #2e7d32; } .sk-k3 { background: rgba(245, 158, 11, .2); border-color: #b86e00; }
.sk-k4 { background: rgba(14, 165, 233, .18); border-color: #0b7bb0; } .sk-k5 { background: rgba(239, 68, 68, .14); border-color: #b43c3c; }
.sk-rect.bad { border-color: #c62828; background: rgba(198, 40, 40, .2); }

/* ---- akari ---- */
.ak-board { --cell: 46px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.ak-c { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #c9c4d8; background: #fff; cursor: pointer; position: relative; font-weight: 800; font-size: calc(var(--cell) * .5); }
.ak-c.ak-b { background: #26243a; color: #fff; cursor: default; }
.ak-c.ak-b.bad { background: #8e1d1d; }
.ak-c.lit { background: #fff6bf; }
.ak-c.lamp::after { content: ""; position: absolute; inset: 20%; border-radius: 50%; background: #f5b800; box-shadow: 0 0 0 3px #a87900 inset, 0 0 12px 3px rgba(245, 184, 0, .7); }
.ak-c.dot::after { content: ""; position: absolute; left: 42%; top: 42%; width: 16%; height: 16%; border-radius: 50%; background: #6b6880; }
.ak-c.bad { box-shadow: inset 0 0 0 3px #c62828; }
.ak-c.lamp.bad::after { background: #ef5350; }
.ak-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.ak-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }

/* ---- fill-in ---- */
.fillin .cell .num { display: none; }
.fw-cols { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.fw-grp h3 { margin: 0 0 4px; font-size: .86rem; color: var(--muted); }
.fw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; max-width: 360px; }
.fw-list li { padding: 3px 9px; border-radius: 999px; background: #f3f1fd; font-weight: 700; font-size: .92rem; letter-spacing: .03em; }
.fw-list li.fit { background: #fff6bf; box-shadow: inset 0 0 0 2px #f5b800; }
.fw-list li.done { text-decoration: line-through; color: var(--muted); background: #ececf2; box-shadow: none; }

/* ---- guess-word ---- */
.gw-board { --cell: 54px; display: grid; gap: 6px; width: max-content; grid-auto-rows: var(--cell); margin: 0 auto; user-select: none; -webkit-user-select: none; }
.gw-t { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 2px solid #cfc9e4; border-radius: 10px; background: #fff; position: relative; font-weight: 800; font-size: calc(var(--cell) * .5); color: var(--ink); }
.gw-t.fill { border-color: #8d86ad; }
.gw-t.now { border-color: #b4abdf; }
.gw-t .gl { position: absolute; right: 4px; top: 1px; font-size: calc(var(--cell) * .24); line-height: 1.2; font-weight: 700; }
.gw-t.c { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.gw-t.p { background: #f2b300; border-color: #f2b300; color: #231f00; }
.gw-t.a { background: #8c8aa0; border-color: #8c8aa0; color: #fff; }
.gw-kb { margin: 14px auto 0; max-width: 560px; display: grid; gap: 6px; }
.gw-kr { display: flex; justify-content: center; gap: 5px; }
.gw-k { flex: 1 1 0; min-width: 0; max-width: 46px; height: 48px; border: 0; border-radius: 8px; background: #e6e2f7; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; padding: 0; touch-action: manipulation; }
.gw-k.wide { flex: 1.6 1 0; max-width: 72px; font-size: .78rem; }
.gw-k.c { background: #2e7d32; color: #fff; } .gw-k.p { background: #f2b300; color: #231f00; } .gw-k.a { background: #8c8aa0; color: #fff; opacity: .65; }
.gw-k:focus-visible { outline: 3px solid #1f6feb; outline-offset: 1px; }
.gw-hints { min-height: 1.4em; margin: 4px 0 8px; font-size: .92rem; color: var(--muted); text-align: center; }
.gw-hint { display: inline-block; margin: 0 4px; padding: 2px 8px; border-radius: 999px; background: #eeeaff; color: var(--accent); font-weight: 700; }
@media (max-width: 420px) { .gw-k { height: 44px; } .gw-kr { gap: 3px; } }

/* Криптограмма */
.cg-src { margin: 0 0 8px; color: var(--muted); text-align: center; font-size: .92rem; }
.cg-text { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 16px; margin: 6px auto 8px; max-width: 760px; line-height: 1; }
.cg-word { display: inline-flex; align-items: flex-end; gap: 3px; white-space: nowrap; }
.cg-p { font-weight: 800; font-size: 1.3rem; padding-bottom: 6px; }
.cg-c { width: 34px; height: 54px; box-sizing: border-box; border: 2px solid #cfc9e4; border-radius: 8px; background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 2px 0 3px; font: inherit; cursor: pointer; touch-action: manipulation; }
.cg-c .cg-l { font-weight: 800; font-size: 1.35rem; height: 1.6rem; line-height: 1.6rem; }
.cg-c .cg-n { font-size: .72rem; color: var(--muted); border-top: 1px solid #ddd8ef; width: 70%; text-align: center; padding-top: 1px; }
.cg-c.giv { background: #eeeaff; border-color: #b4abdf; }
.cg-c.hint { background: #fff6d6; border-color: #e5c04d; }
.cg-c.sel { border-color: #1f6feb; box-shadow: 0 0 0 3px #bcd5fb; }
.cg-c.bad { background: #fde4e4; border-color: #c0392b; color: #9b1c1c; }
.cg-c:focus-visible { outline: 3px solid #1f6feb; outline-offset: 1px; }
.gw-k.used { opacity: .45; }
@media (max-width: 420px) { .cg-c { width: 29px; height: 50px; } .cg-text { gap: 12px 12px; } }

/* Пчелиный улей */
.wh-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(220px, 1fr); gap: 20px; align-items: start; }
.wh-input { min-height: 2.6rem; display: flex; justify-content: center; align-items: center; gap: 1px; font-size: 1.7rem; font-weight: 800; letter-spacing: .04em; border-bottom: 3px solid #cfc9e4; margin-bottom: 10px; }
.wh-input .ctr { color: #c98600; } .wh-input .bad { color: #b3b0c4; } .wh-input .ph { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.wh-input.shake { animation: whshake .3s; }
@keyframes whshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .wh-input.shake { animation: none; } }
.wh-hive { position: relative; width: 100%; max-width: 320px; margin: 0 auto; }
.wh-k { position: absolute; border: 0; cursor: pointer; background: #e6e2f7; color: var(--ink); font: inherit; font-weight: 800; font-size: 1.5rem; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); touch-action: manipulation; padding: 0; }
.wh-k.ctr { background: #f2b300; color: #231f00; }
.wh-k:hover { filter: brightness(.95); } .wh-k:focus-visible { outline: 3px solid #1f6feb; }
.wh-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.wh-hint { min-height: 1.4em; margin-top: 8px; text-align: center; color: var(--muted); font-size: .92rem; }
.wh-score { margin: 0 0 6px; } .wh-info { color: var(--muted); font-size: .88rem; }
.wh-bar { position: relative; height: 10px; border-radius: 999px; background: #e6e2f7; margin: 6px 0 12px; }
.wh-bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: #7b6fd0; border-radius: 999px; }
.wh-tick { position: absolute; top: -2px; width: 2px; height: 14px; background: #b9b2e6; border-radius: 1px; }
.wh-tick.on { background: #5b4fc4; }
.wh-next { margin: -4px 0 10px; font-size: .88rem; color: var(--muted); }
.wh-goal { position: absolute; z-index: 1; top: -4px; width: 3px; height: 18px; background: #c0392b; border-radius: 2px; }
.wh-found { list-style: none; margin: 0 0 8px; padding: 10px; border: 1px solid #ddd8ef; border-radius: 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; min-height: 3.2rem; max-height: 280px; overflow: auto; background: #fff; }
.wh-found li.pang { font-weight: 800; color: #c98600; }
@media (max-width: 640px) { .wh-layout { grid-template-columns: 1fr; } }

/* «Подборки»: матрица из четырёх рядов (заголовок ряда сверху, плитки в одну линию на широком экране) */
.matrix-row { margin: 0 0 18px; }
.matrix-row .matrix-h { margin: 0 0 10px; font-size: 1.1rem; }
.matrix-row .tiles-hub { grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 10px; }
.matrix-row .tile-hub { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px 12px 18px; }
.matrix-row .tile-ico { width: 40px; height: 40px; font-size: 22px; }
.matrix-row .tile-body strong { display: block; font-size: .98rem; line-height: 1.2; overflow-wrap: anywhere; }
.matrix-row .tile-count { display: block; white-space: nowrap; font-size: .82rem; margin-top: 2px; }
.matrix-row .tile-go { display: none; }
@media (min-width: 1000px) { .matrix-row .tiles-hub { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Такудзу, Футошики, Небоскрёбы */
.nl-board .nl-c { font-size: calc(var(--cell) * .62); }
.nl-takuzu .nl-c { font-size: calc(var(--cell) * .66); }
.nl-c.given { background: #f1effc; }
.nl-c.given .ch { color: #3b2aa5; font-weight: 800; }
.nl-c.dup .ch { color: var(--err); }
.nl-c.mark { box-shadow: inset 0 0 0 3px #1f6feb; }
.nl-c.hinted .ch { color: #1b7a3c; }
.nl-futoshiki { background: #fff; border-color: transparent; }
.nl-futoshiki .nl-c { outline: 2px solid #6c6f93; outline-offset: -1px; }
.nl-sign { display: grid; place-items: center; font-weight: 800; color: var(--ink); font-size: calc(var(--cell) * .4); background: #fff; user-select: none; }
.nl-sign.bad { color: var(--err); }
.nl-skyscrapers { background: #fff; border-color: transparent; }
.nl-skyscrapers .nl-c { outline: 2px solid #6c6f93; outline-offset: -1px; }
.nl-math-cages .nl-c { position: relative; box-shadow: inset 0 0 0 1px #c9c7e2; }
.nl-math-cages .nl-c.cg-t { border-top: 3px solid #1d1b3a; } .nl-math-cages .nl-c.cg-r { border-right: 3px solid #1d1b3a; }
.nl-math-cages .nl-c.cg-b { border-bottom: 3px solid #1d1b3a; } .nl-math-cages .nl-c.cg-l { border-left: 3px solid #1d1b3a; }
.nl-math-cages .nl-c.mark { box-shadow: inset 0 0 0 3px #1f6feb; }
.mc-lab { position: absolute; left: 4px; top: 2px; font-size: calc(var(--cell) * .24); font-weight: 800; line-height: 1; color: #3b2aa5; pointer-events: none; }
.nl-math-cages .kk-notes { padding-top: calc(var(--cell) * .22); }
.nl-edge { display: grid; place-items: center; font-weight: 800; font-size: calc(var(--cell) * .46); background: #fff; color: #3b2aa5; user-select: none; }
.nl-edge.ok { color: #1b7a3c; } .nl-edge.bad { color: var(--err); text-decoration: underline; }

/* Морской бой */
.bs-board { background: #fff; border-color: transparent; }
.bs-corner { background: transparent; }
.bs-head { display: grid; place-items: center; font-weight: 800; font-size: calc(var(--cell) * .5); color: #3b2aa5; user-select: none; }
.bs-head.ok { color: #1b7a3c; } .bs-head.bad { color: var(--err); text-decoration: underline; }
.bs-c { background: #eef5fc; outline: 1px solid #b7cde6; outline-offset: -1px; display: grid; place-items: center; }
.bs-c.active { box-shadow: inset 0 0 0 3px #7c5cff; }
.bs-c.water::after { content: ''; width: 22%; height: 22%; border-radius: 50%; background: #6f95c4; }
.bs-c.ship { background: #1d3557; border-radius: 42%; outline-color: #1d3557; }
.bs-c.ship.given { background: #0f2238; }
.bs-c.ship.s-t { border-top-left-radius: 0; border-top-right-radius: 0; } .bs-c.ship.s-b { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.bs-c.ship.s-l { border-top-left-radius: 0; border-bottom-left-radius: 0; } .bs-c.ship.s-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bs-c.ship.dup { background: var(--err); outline-color: var(--err); }
.bs-c.err { box-shadow: inset 0 0 0 3px var(--err); }
.bs-c.mark { box-shadow: inset 0 0 0 3px #1f6feb; }
.bs-c.hinted.ship { background: #1b7a3c; outline-color: #1b7a3c; }
.bs-pad button { min-width: 6.2em; }
.bs-side { min-width: 150px; }
.bs-side-h { margin: 0 0 8px; font-size: 1rem; }
.bs-fleet { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bs-fleet li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 10px; border: 1px solid var(--line, #d9d6ee); border-radius: 10px; background: #fff; }
.bs-ico { color: #1d3557; letter-spacing: 1px; font-size: 1.05rem; }
.bs-fleet li.done { background: #e6f5ec; border-color: #9ad2b0; } .bs-fleet li.done::after { content: '✓'; color: #1b7a3c; font-weight: 800; }
.bs-fleet li.over { background: #fdeaea; border-color: #e3a1a1; }
.print-fleet { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Соедини пары */
.nlk-board { position: relative; touch-action: none; gap: 0; background: #fff; border-color: #1d1b3a; cursor: crosshair; }
.nlk-board .nlk-c { background: #fff; box-shadow: inset 0 0 0 .5px #cfd3e6; }
.nlk-board .nlk-c.active { box-shadow: inset 0 0 0 3px #1f6feb; }
.nlk-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.nlk-wrong { stroke-dasharray: .25 .15; }

/* Буквенное колесо */
.lw-layout { display: grid; grid-template-columns: auto minmax(240px, 340px); gap: 22px; align-items: start; }
@media (max-width: 760px) { .lw-layout { grid-template-columns: 1fr; } .lw-right { order: -1; } }
.lw-board { border-color: transparent; background: transparent; }
.lw-board .lw-c.off { background: transparent; }
.lw-board .lw-c.on { background: #fff; box-shadow: inset 0 0 0 1.5px #1d1b3a; position: relative; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: calc(var(--cell) * .58); }
.lw-board .lw-c.ok { background: #e3f6e8; }
.lw-board .lw-c.hint { background: #fff4cf; color: #7a5a00; }
.lw-n { position: absolute; top: 1px; left: 3px; font-size: calc(var(--cell) * .27); font-weight: 700; color: #4a4a68; line-height: 1; }
.lw-right { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lw-input { min-height: 46px; display: flex; gap: 4px; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 800; letter-spacing: .04em; }
.lw-input .ph { font-size: 1rem; font-weight: 500; color: #7a7a96; }
.lw-input.shake { animation: lw-shake .3s; }
@keyframes lw-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.lw-wheel { position: relative; width: min(100%, 300px); aspect-ratio: 1; border-radius: 50%; background: #eef0fb; color: #3b4bd1; touch-action: none; user-select: none; -webkit-user-select: none; }
.lw-trace { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lw-k { position: absolute; border-radius: 50%; border: 2px solid #c9ccee; background: #fff; font: 800 1.5rem/1 inherit; color: #1d1b3a; cursor: pointer; padding: 0; touch-action: none; }
.lw-k.sel { background: #3b4bd1; border-color: #3b4bd1; color: #fff; }
.lw-actions { justify-content: center; }
.lw-bonus { font-size: .9rem; color: #4a4a68; text-align: center; }

/* Палатки и деревья, Нурикабэ */
.tt-board, .nk-board { --cell: 46px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.tt-c, .nk-c { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #c9c4d8; background: #fff; cursor: pointer; position: relative; font-weight: 800; font-size: calc(var(--cell) * .55); line-height: 1; }
.tt-c { background: #eaf6e1; }
.tt-c.tt-tree { background: #d6edc3; cursor: default; }
.tt-c.dot::after, .nk-c.dot::after { content: ""; position: absolute; left: 42%; top: 42%; width: 16%; height: 16%; border-radius: 50%; background: #6b6880; }
.tt-c.bad, .nk-c.bad { box-shadow: inset 0 0 0 3px #c62828; }
.tt-c.cur, .nk-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.tt-c.hint, .nk-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
.tt-h { width: var(--cell); height: var(--cell); display: grid; place-items: center; font-weight: 800; font-size: calc(var(--cell) * .5); background: #f3f1fb; color: #3a3856; border: 1px solid #e0dcf0; box-sizing: border-box; }
.tt-h.done { color: #1a7f37; background: #e4f6e9; }
.tt-h.over { color: #b3261e; background: #fdeaea; }
.nk-c { background: #fff; }
.nk-c.nk-n { background: #fff; color: #1d1b3a; cursor: default; }
.nk-c.sea { background: #2d4a8a; }
.nk-c.sea.bad { background: #8e1d1d; box-shadow: none; }
.nk-c.bad-w { background: #fde3e3; }
.nk-c.nk-n.bad { background: #fde3e3; }

/* Хидато / Нумбрикс */
.ch-board { --cell: 48px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.ch-c { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #c9c4d8; background: #fff; cursor: pointer; font-weight: 700; font-size: calc(var(--cell) * .46); line-height: 1; color: #1d4ed8; }
.ch-c.ch-g { background: #eceaf5; color: #1d1b3a; font-weight: 800; cursor: default; }
.ch-c.ch-x { background: #2b2840; cursor: default; }
.ch-c.ch-near { background: #fff4c9; }
.ch-c.ch-g.ch-near { background: #f3e7b0; }
.ch-c.bad { box-shadow: inset 0 0 0 3px #c62828; }
.ch-c.bad-w { background: #fde3e3; }
.ch-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.ch-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
.ch-missing { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; max-width: 460px; align-items: center; min-height: 32px; font-size: .9rem; }
.ch-m { min-width: 34px; min-height: 34px; padding: 0 6px; border: 1px solid #c9c4d8; border-radius: 8px; background: #fff; font-weight: 700; cursor: pointer; }
.ch-m:hover { background: #eef3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ch-c { background: #1f1d33; color: #8ab4ff; border-color: #3d3a5c; } :root:not([data-theme="light"]) .ch-c.ch-g { background: #2c2a47; color: #f1efff; } :root:not([data-theme="light"]) .ch-c.ch-x { background: #0b0a16; } :root:not([data-theme="light"]) .ch-c.ch-near { background: #4a4220; } :root:not([data-theme="light"]) .ch-m { background: #1f1d33; color: #f1efff; border-color: #3d3a5c; } }

/* Масю */
.msy-board { --cell: 48px; position: relative; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: none; cursor: crosshair; }
.msy-c { width: var(--cell); height: var(--cell); box-sizing: border-box; border: 1px solid #e0dcee; }
.msy-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.msy-l { stroke: #1f6feb; stroke-width: .16; stroke-linecap: round; }
.msy-hint { stroke: #f2a900; stroke-width: .24; stroke-linecap: round; opacity: .6; }
.msy-p { stroke: #1d1b3a; stroke-width: .06; }
.msy-b { fill: #1d1b3a; }
.msy-w { fill: #fff; }
.msy-bad { stroke: #c62828; stroke-width: .12; }
.msy-bd { fill: #c62828; }
.msy-cur { fill: none; stroke: #1f6feb; stroke-width: .05; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msy-board { background: #1a1830; } :root:not([data-theme="light"]) .msy-c { border-color: #34305a; } :root:not([data-theme="light"]) .msy-l { stroke: #7fb0ff; } :root:not([data-theme="light"]) .msy-b { fill: #000; stroke: #f1efff; } :root:not([data-theme="light"]) .msy-w { fill: #fff; stroke: #8f8ab8; } }

/* Филломино */
.fl-board { --cell: 48px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.fl-c { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #d5d0e6; border-color: #1d1b3a; background: #fff; cursor: pointer; font-weight: 700; font-size: calc(var(--cell) * .5); line-height: 1; color: #1d4ed8; border-style: solid; }
.fl-c.fl-g { background: #eceaf5; color: #1d1b3a; font-weight: 800; }
.fl-c.fl-ok { background: #e3f6e8; }
.fl-c.fl-g.fl-ok { background: #cdeed6; }
.fl-c.bad { background: #fde3e3; box-shadow: inset 0 0 0 3px #c62828; }
.fl-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.fl-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
.fl-c:not(.fl-n1):not(.fl-n2):not(.fl-n3):not(.fl-n4):not(.fl-n5):not(.fl-n6):not(.fl-n7):not(.fl-n8):not(.fl-n9) { border-color: #d5d0e6; }
.fl-pad { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-width: 460px; }
.fl-k { min-width: 40px; min-height: 40px; border: 1px solid #c9c4d8; border-radius: 10px; background: #fff; font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.fl-k:hover { background: #eef3ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fl-board { background: #1f1d33; } :root:not([data-theme="light"]) .fl-c { background: #1f1d33; color: #8ab4ff; border-color: #f1efff; } :root:not([data-theme="light"]) .fl-c.fl-g { background: #2c2a47; color: #f1efff; } :root:not([data-theme="light"]) .fl-c.fl-ok { background: #1d3a2a; } :root:not([data-theme="light"]) .fl-c.bad { background: #4a1f25; } :root:not([data-theme="light"]) .fl-k { background: #1f1d33; color: #f1efff; border-color: #3d3a5c; } }

/* Звёздная битва */
.sb-board { --cell: 46px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.sb-c { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #1d1b3a; cursor: pointer; position: relative; font-size: calc(var(--cell) * .6); line-height: 1; color: #b8860b; background-color: hsl(var(--rh), 70%, 88%); }
.sb-c.sb-p1 { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.09) 0 2px, transparent 2px 7px); }
.sb-c.sb-p2 { background-image: radial-gradient(rgba(0,0,0,.18) 1.2px, transparent 1.4px); background-size: 7px 7px; }
.sb-c.sb-p3 { background-image: repeating-linear-gradient(0deg, rgba(0,0,0,.09) 0 2px, transparent 2px 7px); }
.sb-c.star { color: #d49a00; text-shadow: 0 0 1px #5a4300; }
.sb-c.dot::after { content: ""; width: 14%; height: 14%; border-radius: 50%; background: #55516f; }
.sb-c.bad { box-shadow: inset 0 0 0 3px #c62828; }
.sb-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.sb-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sb-c { background-color: hsl(var(--rh), 35%, 26%); border-color: #f1efff; } :root:not([data-theme="light"]) .sb-c.dot::after { background: #c5c2e0; } }

/* Доминоса */
.dm-board { --cell: 52px; position: relative; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: none; }
.dm-c { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #e0dcee; position: relative; z-index: 1; font-weight: 800; font-size: calc(var(--cell) * .5); line-height: 1; color: #1d1b3a; cursor: pointer; background: transparent; }
.dm-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.dm-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.dm-d { stroke-width: .05; }
.dm-d.dm-dup { fill: #fde3e3; stroke: #c62828; stroke-width: .08; }
.dm-d.dm-hint { stroke: #1f6feb; stroke-width: .1; }
.dm-sel { fill: rgba(31, 111, 235, .15); stroke: #1f6feb; stroke-width: .06; }
.dm-tray { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; max-width: 460px; }
.dm-chip { padding: 3px 7px; border: 1px solid #c9c4d8; border-radius: 8px; font-size: .85rem; font-weight: 700; color: #6b6880; background: #fff; }
.dm-chip.on { background: #e3f6e8; border-color: #4caf50; color: #1b5e20; }
.dm-chip.dup { background: #fde3e3; border-color: #c62828; color: #8e1d1d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dm-board { background: #1a1830; } :root:not([data-theme="light"]) .dm-c { color: #f1efff; border-color: #34305a; } :root:not([data-theme="light"]) .dm-chip { background: #1f1d33; color: #b9b5d8; border-color: #3d3a5c; } :root:not([data-theme="light"]) .dm-chip.on { background: #1d3a2a; color: #b8f0c8; } :root:not([data-theme="light"]) .dm-chip.dup { background: #4a1f25; color: #ffc9c9; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dm-d { fill-opacity: .35; } }

/* Сапёр (головоломка) */
.mw-board { --cell: 38px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.mw-c { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #b9b4cf; font-weight: 800; font-size: calc(var(--cell) * .55); line-height: 1; cursor: pointer; }
.mw-c.mw-open { background: #fff; cursor: default; }
.mw-c.mw-closed { background: linear-gradient(145deg, #dcd8ee, #bdb8d8); box-shadow: inset 2px 2px 0 #f4f2ff, inset -2px -2px 0 #9a95b8; }
.mw-c.flag { color: #c62828; }
.mw-c.safe::after { content: ""; width: 14%; height: 14%; border-radius: 50%; background: #55516f; }
.mw-n1 { color: #1d4ed8; } .mw-n2 { color: #2e7d32; } .mw-n3 { color: #c62828; } .mw-n4 { color: #4a148c; } .mw-n5 { color: #8e2c1d; } .mw-n6 { color: #00838f; } .mw-n7 { color: #222; } .mw-n8 { color: #666; }
.mw-c.bad { box-shadow: inset 0 0 0 3px #c62828; background: #fde3e3; }
.mw-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.mw-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mw-board { background: #1a1830; } :root:not([data-theme="light"]) .mw-c { border-color: #3d3a5c; } :root:not([data-theme="light"]) .mw-c.mw-open { background: #1a1830; } :root:not([data-theme="light"]) .mw-c.mw-closed { background: linear-gradient(145deg, #3a3760, #2a2748); box-shadow: inset 2px 2px 0 #4d4a7a, inset -2px -2px 0 #1b1932; } :root:not([data-theme="light"]) .mw-c.safe::after { background: #c5c2e0; } :root:not([data-theme="light"]) .mw-n1 { color: #8ab4ff; } :root:not([data-theme="light"]) .mw-n2 { color: #7ed98a; } :root:not([data-theme="light"]) .mw-n3 { color: #ff8a8a; } :root:not([data-theme="light"]) .mw-n4 { color: #c79bff; } :root:not([data-theme="light"]) .mw-n7 { color: #ddd; } :root:not([data-theme="light"]) .mw-c.bad { background: #4a1f25; } }

/* Куродоко */
.ku-board { --cell: 42px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.ku-c { width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #b9b4cf; font-weight: 800; font-size: calc(var(--cell) * .5); line-height: 1; cursor: pointer; background: #fff; color: #1d1b33; }
.ku-c.ku-clue { background: #f1eefc; cursor: default; }
.ku-c.black { background: #1d1b33; }
.ku-c.dot::after { content: ""; width: 16%; height: 16%; border-radius: 50%; background: #55516f; }
.ku-c.bad { box-shadow: inset 0 0 0 3px #c62828; }
.ku-c.black.bad { background: #6b1c24; }
.ku-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.ku-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ku-board { background: #1a1830; } :root:not([data-theme="light"]) .ku-c { background: #1a1830; color: #ece9ff; border-color: #3d3a5c; } :root:not([data-theme="light"]) .ku-c.ku-clue { background: #26234a; } :root:not([data-theme="light"]) .ku-c.black { background: #000; } :root:not([data-theme="light"]) .ku-c.dot::after { background: #c5c2e0; } }

/* Окно «Встроить на сайт» */
.emb-open { margin-left: 8px; }
.embed-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 24px; border: 2px solid var(--accent); border-radius: var(--radius); background: linear-gradient(120deg, rgba(114, 82, 233, .08), rgba(224, 79, 160, .08)); }
.embed-cta h2 { margin: 0 0 4px; }
.embed-cta p { margin: 0; max-width: 60ch; }
dialog.emb-dialog { width: min(94vw, 760px); max-height: 92vh; overflow: auto; background: var(--surface); }
.emb-in { padding: 26px 28px 22px; position: relative; }
.emb-in h2 { margin: 2px 0 6px; font-size: 1.5rem; }
.emb-in h3 { margin: 18px 0 8px; font-size: 1rem; }
.emb-x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer; }
.emb-x:hover, .emb-x:focus-visible { border-color: var(--accent); }
.emb-sizes { border: 0; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.emb-sizes legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.emb-size { position: relative; cursor: pointer; }
.emb-size input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.emb-size span { display: grid; gap: 2px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); }
.emb-size small { color: var(--muted); font-size: .8rem; }
.emb-size input:checked + span { border-color: var(--accent); background: rgba(114, 82, 233, .1); box-shadow: 0 0 0 3px rgba(114, 82, 233, .18); }
.emb-size input:focus-visible + span { outline: 3px solid #1f6feb; outline-offset: 2px; }
.emb-code-row { display: grid; gap: 10px; }
.emb-code-row .embed-code { background: #1d1b33; color: #e8e6ff; border-color: #1d1b33; }
.emb-code-row .btn-grad { justify-self: start; }
.emb-preview { border: 1.5px solid var(--line); border-radius: 14px; overflow: auto; max-height: 340px; background: var(--bg); }
.emb-preview iframe { display: block; width: 100%; border: 0; margin: 0 auto; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .embed-cta { background: rgba(114, 82, 233, .15); } }
.emb-status:empty { display: none; }

/* Хэявакэ */
.hy-board { --cell: 42px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 4px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.hy-c { position: relative; width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #cfcbe3; cursor: pointer; background: #fff; color: #1d1b33; }
.hy-c.bt { border-top: 3px solid var(--ink); } .hy-c.bl { border-left: 3px solid var(--ink); } .hy-c.bb { border-bottom: 3px solid var(--ink); } .hy-c.br { border-right: 3px solid var(--ink); }
.hy-n { position: absolute; top: 1px; left: 3px; font-weight: 800; font-size: calc(var(--cell) * .36); line-height: 1; }
.hy-c.black { background: #1d1b33; color: #fff; }
.hy-c.dot::after { content: ""; width: 16%; height: 16%; border-radius: 50%; background: #55516f; }
.hy-c.bad { background: #fde3e3; }
.hy-c.black.bad { background: #8b1c2b; }
.hy-c.bad .hy-n { color: #c62828; } .hy-c.black.bad .hy-n { color: #fff; }
.hy-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.hy-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hy-board { background: #1a1830; border-color: #cfcbe3; } :root:not([data-theme="light"]) .hy-c { background: #1a1830; color: #ece9ff; border-color: #3d3a5c; } :root:not([data-theme="light"]) .hy-c.bt { border-top-color: #cfcbe3; } :root:not([data-theme="light"]) .hy-c.bl { border-left-color: #cfcbe3; } :root:not([data-theme="light"]) .hy-c.bb { border-bottom-color: #cfcbe3; } :root:not([data-theme="light"]) .hy-c.br { border-right-color: #cfcbe3; } :root:not([data-theme="light"]) .hy-c.black { background: #000; } :root:not([data-theme="light"]) .hy-c.dot::after { background: #c5c2e0; } :root:not([data-theme="light"]) .hy-c.bad { background: #4a1f25; } }

/* LITS */
.li-board { --cell: 42px; display: grid; width: max-content; grid-auto-rows: var(--cell); background: #fff; border: 2px solid var(--ink); border-radius: 4px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.li-c { position: relative; width: var(--cell); height: var(--cell); box-sizing: border-box; display: grid; place-items: center; border: 1px solid #cfcbe3; cursor: pointer; color: #1d1b33; background: #fff; }
.li-c.rt1 { background: #f3f0ff; } .li-c.rt2 { background: #eefaf7; } .li-c.rt3 { background: #fff6e8; }
.li-c.bt { border-top: 3px solid var(--ink); } .li-c.bl { border-left: 3px solid var(--ink); } .li-c.bb { border-bottom: 3px solid var(--ink); } .li-c.br { border-right: 3px solid var(--ink); }
.li-c.black { background: #1d1b33; }
.li-c.dot::after { content: ""; width: 16%; height: 16%; border-radius: 50%; background: #55516f; }
.li-c.black.bad { background: #8b1c2b; }
.li-c.bad:not(.black) { background: #fde3e3; }
.li-c.cur { outline: 3px solid #1f6feb; outline-offset: -3px; }
.li-c.hint { box-shadow: inset 0 0 0 4px #1f6feb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .li-board { background: #1a1830; border-color: #cfcbe3; } :root:not([data-theme="light"]) .li-c { background: #1a1830; border-color: #3d3a5c; } :root:not([data-theme="light"]) .li-c.rt1 { background: #221f40; } :root:not([data-theme="light"]) .li-c.rt2 { background: #182a2e; } :root:not([data-theme="light"]) .li-c.rt3 { background: #2c2530; } :root:not([data-theme="light"]) .li-c.bt { border-top-color: #cfcbe3; } :root:not([data-theme="light"]) .li-c.bl { border-left-color: #cfcbe3; } :root:not([data-theme="light"]) .li-c.bb { border-bottom-color: #cfcbe3; } :root:not([data-theme="light"]) .li-c.br { border-right-color: #cfcbe3; } :root:not([data-theme="light"]) .li-c.black { background: #000; } :root:not([data-theme="light"]) .li-c.dot::after { background: #c5c2e0; } :root:not([data-theme="light"]) .li-c.bad:not(.black) { background: #4a1f25; } }

/* Ядзилин */
.yj-board { --cell: 48px; position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: none; cursor: crosshair; }
.yj-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.yj-cell { fill: #fff; stroke: #cfcbe3; stroke-width: .03; }
.yj-cell.yj-clue { fill: #ebe8fa; }
.yj-cell.yj-black { fill: #1d1b33; }
.yj-cell.yj-bad { fill: #8b1c2b; }
.yj-t { fill: #1d1b33; font-weight: 800; }
.yj-tbad { fill: #c62828; }
.yj-l { stroke: #1f6feb; stroke-width: .16; stroke-linecap: round; }
.yj-hl { stroke: #f59e0b; stroke-width: .2; stroke-linecap: round; }
.yj-hint { fill: none; stroke: #1f6feb; stroke-width: .07; }
.yj-warn { stroke: #c62828; }
.yj-bd { fill: #c62828; }
.yj-cur { fill: none; stroke: #1f6feb; stroke-width: .06; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .yj-board { background: #1a1830; } :root:not([data-theme="light"]) .yj-cell { fill: #1a1830; stroke: #3d3a5c; } :root:not([data-theme="light"]) .yj-cell.yj-clue { fill: #26234a; } :root:not([data-theme="light"]) .yj-cell.yj-black { fill: #000; } :root:not([data-theme="light"]) .yj-t { fill: #ece9ff; } :root:not([data-theme="light"]) .yj-tbad { fill: #ff8a8a; } :root:not([data-theme="light"]) .yj-l { stroke: #7fb0ff; } }
.sk-board { --cell: 48px; position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer; }
.sk-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sk-cell { fill: #fff; stroke: #cfcbe3; stroke-width: .03; }
.sk-cell.sk-black { fill: #1d1b33; }
.sk-t { fill: #fff; font-weight: 800; }
.sk-tok { fill: #8fe0a2; }
.sk-tbad { fill: #ff8a8a; }
.sk-tri { fill: #1d1b33; }
.sk-dot { fill: #8a86ad; }
.sk-hint { fill: none; stroke: #f59e0b; stroke-width: .08; }
.sk-bv { fill: #c62828; }
.sk-cur { fill: none; stroke: #1f6feb; stroke-width: .06; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sk-board { background: #1a1830; } :root:not([data-theme="light"]) .sk-cell { fill: #1a1830; stroke: #3d3a5c; } :root:not([data-theme="light"]) .sk-cell.sk-black { fill: #000; } :root:not([data-theme="light"]) .sk-tri { fill: #000; stroke: #6a66a0; stroke-width: .03; } :root:not([data-theme="light"]) .sk-dot { fill: #8a86ad; } }
.sd-c.rg-t { border-top: 3px solid var(--ink); } .sd-c.rg-b { border-bottom: 3px solid var(--ink); }
.sd-c.rg-l { border-left: 3px solid var(--ink); } .sd-c.rg-r { border-right: 3px solid var(--ink); }
.sd-c.dgc { background-image: linear-gradient(rgba(124, 92, 230, .14), rgba(124, 92, 230, .14)); }
.sd-board { position: relative; }
.lv-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.lv-th { fill: none; stroke: #9d99b8; stroke-opacity: .55; stroke-width: .3; stroke-linecap: round; stroke-linejoin: round; }
.lv-bulb { fill: #9d99b8; fill-opacity: .55; stroke: none; }
.lv-white circle { fill: #fff; stroke: #1d1b33; stroke-width: .035; }
.lv-black circle { fill: #1d1b33; stroke: #1d1b33; stroke-width: .035; }
.lv-x { fill: #fff; font-weight: 800; }
.lv-par { fill: #9d99b8; fill-opacity: .5; stroke: none; }
.lv-arc { fill: none; stroke: #7a7699; stroke-opacity: .7; stroke-width: .05; }
.lv-arl { fill: none; stroke: #7a7699; stroke-opacity: .7; stroke-width: .06; stroke-linecap: round; stroke-linejoin: round; }
.lv-gt { fill: none; stroke: #5a2fb0; stroke-width: .05; stroke-linecap: round; stroke-linejoin: round; }
.lv-sc { fill: #5a2fb0; font-size: .38px; font-weight: 800; }
.sd-board.lv-sand { margin: var(--cell) 0 0 var(--cell); }
.lv-svg.lv-out { inset: auto; left: calc(var(--cell) * -1); top: calc(var(--cell) * -1); width: calc(100% + var(--cell)); height: calc(100% + var(--cell)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lv-th, :root:not([data-theme="light"]) .lv-bulb { stroke: #b9b5e6; fill: #b9b5e6; stroke-opacity: .5; fill-opacity: .5; } :root:not([data-theme="light"]) .lv-white circle { fill: #ece9ff; stroke: #ece9ff; } :root:not([data-theme="light"]) .lv-black circle { fill: #000; stroke: #ece9ff; } }
.sl-board, .ab-board { --cell: 48px; position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 8px; user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer; }
.sl-svg, .ab-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sl-cell { fill: #fff; stroke: #e0ddf0; stroke-width: .03; }
.sl-d { stroke: #1d1b33; stroke-width: .1; stroke-linecap: round; }
.sl-loop { stroke: #c62828; }
.sl-vc { fill: #fff; stroke: #6c6f93; stroke-width: .03; }
.sl-vok { fill: #e8f7ec; stroke: #2e9b57; }
.sl-vbad { fill: #fde4e4; stroke: #c62828; }
.sl-vt { fill: #1d1b33; font-weight: 800; }
.sl-hint, .ab-hint { fill: none; stroke: #f59e0b; stroke-width: .08; }
.sl-cur, .ab-cur { fill: none; stroke: #1f6feb; stroke-width: .06; }
.ab-cell { fill: #fff; stroke: #cfcbe3; stroke-width: .03; }
.ab-water { fill: #8cc8f5; }
.ab-on { fill: #1d1b33; }
.ab-bad { stroke: #c62828; stroke-width: .08; }
.ab-rb { stroke: #1d1b33; stroke-width: .07; stroke-linecap: square; }
.ab-dot { fill: #8a86ad; }
.ab-n { fill: #1d1b33; font-weight: 800; }
.ab-nok { fill: #2e9b57; }
.ab-nbad { fill: #c62828; }
.ab-wl { fill: #8a86ad; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sl-board, :root:not([data-theme="light"]) .ab-board { background: #1a1830; } :root:not([data-theme="light"]) .sl-cell, :root:not([data-theme="light"]) .ab-cell { fill: #1a1830; stroke: #3d3a5c; } :root:not([data-theme="light"]) .sl-d, :root:not([data-theme="light"]) .ab-rb { stroke: #ece9ff; } :root:not([data-theme="light"]) .sl-vc { fill: #26234a; } :root:not([data-theme="light"]) .sl-vt, :root:not([data-theme="light"]) .ab-n { fill: #ece9ff; } :root:not([data-theme="light"]) .ab-on { fill: #ece9ff; } :root:not([data-theme="light"]) .ab-water { fill: #3d7fb8; } }

.sh-board { touch-action: none; }
.sh-clue { fill: #efedf9; }
.sh-n { fill: #1d1b33; font-weight: 800; pointer-events: none; }
.sh-rn { fill: #5a2fb0; }
.sh-inv, .ab-on + .sh-n { fill: #fff; }
.tb-rect { fill-opacity: .45; stroke: #1d1b33; stroke-width: .05; }
.tb-c0 { fill: #8cc8f5; } .tb-c1 { fill: #f7c58b; } .tb-c2 { fill: #b6e3a8; } .tb-c3 { fill: #e7b4ea; } .tb-c4 { fill: #f3e08a; }
.tb-wrong { stroke: #c62828; stroke-width: .09; }
.tb-warn { stroke: #e0a000; stroke-width: .08; stroke-dasharray: .2 .1; }
.tb-sym { fill: #1d1b33; font-weight: 800; pointer-events: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sh-clue { fill: #26233f; } :root:not([data-theme="light"]) .sh-n, :root:not([data-theme="light"]) .tb-sym { fill: #ece9ff; } :root:not([data-theme="light"]) .sh-rn { fill: #c5b3ff; } :root:not([data-theme="light"]) .tb-rect { stroke: #ece9ff; } }

.sd-c.wkc { background-image: linear-gradient(rgba(46, 155, 87, .16), rgba(46, 155, 87, .16)); }
.sd-c.dj::after { content: attr(data-dj); position: absolute; right: 3px; bottom: 1px; font-size: calc(var(--cell) * .2); font-weight: 700; color: #7a7699; line-height: 1; pointer-events: none; }
.sd-c.dj0 { background-image: linear-gradient(rgba(124, 92, 230, .08), rgba(124, 92, 230, .08)); } .sd-c.dj4 { background-image: linear-gradient(rgba(124, 92, 230, .08), rgba(124, 92, 230, .08)); } .sd-c.dj8 { background-image: linear-gradient(rgba(124, 92, 230, .08), rgba(124, 92, 230, .08)); }
.ln-v { fill: #2b4ea2; font-weight: 700; }
.ln-v.ln-g { fill: #1d1b33; font-weight: 800; }
.ln-v.ab-nbad { fill: #c62828; }
.mg-pole { font-weight: 800; fill: #fff; }
.mg-dom { stroke: #1d1b33; stroke-width: .06; fill: none; }
.mg-plus { fill: #d9483b; }
.mg-minus { fill: #2f6fd1; }
.mg-neu { fill: #cfcbe3; }
.mg-unk { fill: #f1effa; }
.mg-dup { stroke: #c62828; stroke-width: .08; fill: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ln-v { fill: #8fb1ff; } :root:not([data-theme="light"]) .ln-v.ln-g { fill: #ece9ff; } :root:not([data-theme="light"]) .mg-unk { fill: #26234a; } :root:not([data-theme="light"]) .mg-neu { fill: #3d3a5c; } :root:not([data-theme="light"]) .mg-dom { stroke: #ece9ff; } }
.qn-0 { fill: #ffd6d6; } .qn-1 { fill: #ffe8b8; } .qn-2 { fill: #fff7b0; } .qn-3 { fill: #d4f5c2; } .qn-4 { fill: #b8ecd8; }
.qn-5 { fill: #bde6ff; } .qn-6 { fill: #c9d4ff; } .qn-7 { fill: #e3ccff; } .qn-8 { fill: #ffc9ec; } .qn-9 { fill: #d9d2c5; }
.qn-q { fill: #1d1b33; }
.cg-bad { fill: none; stroke: #c62828; stroke-width: .08; }
.cg-giv { fill: #efeef9; }
.yy-b { fill: #1d1b33; stroke: #8a86ad; stroke-width: .03; }
.yy-w { fill: #fff; stroke: #1d1b33; stroke-width: .05; }
.yy-gb { fill: #fff; } .yy-gw { fill: #1d1b33; }
.tg-sun { fill: #f59e0b; } .tg-ray { stroke: #f59e0b; stroke-width: .06; stroke-linecap: round; }
.tg-moon { fill: #4f6bd8; }
.tg-sg { fill: #fff; stroke: #8a86ad; stroke-width: .03; } .tg-st { fill: #1d1b33; font-weight: 800; }
.zip-v { fill: #f1effa; }
.zip-line { fill: none; stroke: #7b5cff; stroke-width: .42; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.zip-line.zip-bad { stroke: #c62828; }
.zip-head { fill: #fff; }
.zip-n { fill: #1d1b33; stroke: #fff; stroke-width: .04; } .zip-n.zip-nd { fill: #2e9b57; } .zip-n.zip-nx { fill: #7b5cff; }
.zip-t { fill: #fff; font-weight: 800; }
.lo-on { fill: #ffd24a; } .lo-off { fill: #2a2840; } .lo-glow { fill: #fff3b8; }
.lo-ring { fill: none; stroke: #7b5cff; stroke-width: .07; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qn-q { fill: #1d1b33; } :root:not([data-theme="light"]) .cg-giv { fill: #26234a; } :root:not([data-theme="light"]) .yy-b { fill: #000; stroke: #ece9ff; } :root:not([data-theme="light"]) .yy-w { stroke: #ece9ff; } :root:not([data-theme="light"]) .zip-v { fill: #26234a; } :root:not([data-theme="light"]) .tg-sg { fill: #26234a; } :root:not([data-theme="light"]) .tg-st { fill: #ece9ff; } :root:not([data-theme="light"]) .lo-off { fill: #3d3a5c; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qn-0 { fill: #ffd6d6; } :root:not([data-theme="light"]) .qn-1 { fill: #ffe8b8; } :root:not([data-theme="light"]) .qn-2 { fill: #fff7b0; } :root:not([data-theme="light"]) .qn-3 { fill: #d4f5c2; } :root:not([data-theme="light"]) .qn-4 { fill: #b8ecd8; } :root:not([data-theme="light"]) .qn-5 { fill: #bde6ff; } :root:not([data-theme="light"]) .qn-6 { fill: #c9d4ff; } :root:not([data-theme="light"]) .qn-7 { fill: #e3ccff; } :root:not([data-theme="light"]) .qn-8 { fill: #ffc9ec; } :root:not([data-theme="light"]) .qn-9 { fill: #d9d2c5; } }

/* v36: кроссворды с готовыми клетками, кодворд, кросснамбер */
.board .cell.given{background:#e8edf5;font-weight:700}
.board .cell.given .ch{color:#33415c}
.board .cell .code{position:absolute;right:3px;bottom:1px;font-size:.62rem;line-height:1;color:#6b7a90;pointer-events:none}
.cw-legend{display:flex;flex-wrap:wrap;gap:4px;margin-top:10px;max-width:520px}
.cw-leg{display:inline-flex;flex-direction:column;align-items:center;min-width:30px;border:1px solid #c8d1de;border-radius:6px;padding:2px 4px;background:#fff}
.cw-leg i{font-style:normal;font-size:.68rem;color:#6b7a90}
.cw-leg b{min-height:1.1em;font-size:1rem;color:#1f2d46}
.cw-leg.on{background:#eaf6ee;border-color:#8cc7a0}
:root:not([data-theme="light"]) .board .cell.given{background:#2a3347}
:root:not([data-theme="light"]) .board .cell.given .ch{color:#cdd8ee}
:root:not([data-theme="light"]) .cw-leg{background:#1d2433;border-color:#3a4660}
:root:not([data-theme="light"]) .cw-leg b{color:#e6ecf8}
:root:not([data-theme="light"]) .cw-leg.on{background:#1f3a2c;border-color:#3f7a58}

/* v38: сканворды со словом-ключом и открытыми буквами */
.sc-board .cell { position: relative; }
.sc-board .cell.given { background: var(--given-bg, #e8e2cc); font-weight: 700; }
.sc-key-n { position: absolute; right: 2px; top: 1px; font: 600 9px/1 system-ui, sans-serif; font-style: normal; color: #7a5a00; pointer-events: none; }
.sc-board .cell.keycell { box-shadow: inset 0 0 0 2px #c9a227; }
.sc-keyword { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 10px 0; font-size: 1rem; }
.sc-key-ch { display: inline-flex; width: 1.7em; height: 1.9em; align-items: center; justify-content: center; border: 2px solid #c9a227; border-radius: 4px; font-weight: 700; background: #fffbe8; color: #222; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sc-board .cell.given { background: #3a3626; } :root:not([data-theme="light"]) .sc-key-ch { background: #2c2819; color: #f2ecd0; } }
:root[data-theme="dark"] .sc-board .cell.given { background: #3a3626; }
:root[data-theme="dark"] .sc-key-ch { background: #2c2819; color: #f2ecd0; }

/* v39: варианты японских кроссвордов */
.ng-cell.ng-void { background: #8a8a8a; cursor: not-allowed; pointer-events: none; }
.ng-cell.ng-given { background: #e6e6ea; }
.ng-cell.ng-given.filled { background: #2b2b33; }
.ng-cell.ex-hl { box-shadow: inset 0 0 0 2px #c9731b; background-color: #fff1dd; }
.ng-cell.ex-hl.filled { background-color: #4a3a2a; }
.ng-ccol.ng-hid span, .ng-crow.ng-hid span { opacity: .55; }
.ng-extras { margin: 12px 0; max-width: 560px; }
.ng-extras h3 { margin: 0 0 4px; font-size: 1rem; }
.ng-ex-note, .ng-note { font-size: .85rem; opacity: .8; margin: 2px 0 6px; }
.ng-extras ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ng-ex-item { border: 1px solid #c9b88a; background: #fffbea; border-radius: 6px; padding: 4px 8px; font-size: .95rem; cursor: default; }
.ng-ex-item.ok { background: #e4f4e1; border-color: #7fb77a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ng-cell.ng-void { background: #555; }
  :root:not([data-theme="light"]) .ng-cell.ng-given { background: #34343c; }
  :root:not([data-theme="light"]) .ng-cell.ng-given.filled { background: #cfcfd8; }
  :root:not([data-theme="light"]) .ng-cell.ex-hl { background-color: #4a3a22; }
  :root:not([data-theme="light"]) .ng-ex-item { background: #2c2819; border-color: #6b5f36; color: #f2ecd0; }
  :root:not([data-theme="light"]) .ng-ex-item.ok { background: #1f3a22; border-color: #3f7a45; }
}
:root[data-theme="dark"] .ng-cell.ng-void { background: #555; }
:root[data-theme="dark"] .ng-cell.ng-given { background: #34343c; }
:root[data-theme="dark"] .ng-cell.ng-given.filled { background: #cfcfd8; }
:root[data-theme="dark"] .ng-cell.ex-hl { background-color: #4a3a22; }
:root[data-theme="dark"] .ng-ex-item { background: #2c2819; border-color: #6b5f36; color: #f2ecd0; }
:root[data-theme="dark"] .ng-ex-item.ok { background: #1f3a22; border-color: #3f7a45; }

.ach-cat { margin: 18px 0 8px; font-size: 1.05rem; }
.ach-secret { background: repeating-linear-gradient(135deg, #f4f2fb, #f4f2fb 10px, #efecfb 10px, #efecfb 20px); border-style: dashed; }
.ach-secret .ach-ic { filter: none; opacity: .8; }
.ach-secret-on { background: linear-gradient(135deg, #f3efff, #e6dcff); border-color: #8f7be0; box-shadow: 0 4px 14px rgba(111, 84, 214, .25); }
.ach-secret-on .ach-ic { background: #d9ccff; filter: none; opacity: 1; }
.ach-secret-on .ach-ok { color: #5b3fc4; }
@media (prefers-color-scheme: dark) { .ach-secret { background: repeating-linear-gradient(135deg, #1f1d2b, #1f1d2b 10px, #25223a 10px, #25223a 20px); } .ach-secret-on { background: linear-gradient(135deg, #2a2447, #342b5e); } }
.chip-solves { font-weight: 600; color: #2a7a4b; }
.top-types { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 640px; }
.top-types li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: #f5f2ff; border: 1px solid rgba(110,90,200,.15); }
.top-types .top-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg,#7b4de0,#d9479a); color: #fff; font-weight: 700; font-size: 14px; }
.top-types .top-name { flex: 1; font-weight: 600; }
.top-types .top-count { color: #4a4670; font-size: 14px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .top-types li { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); } :root:not([data-theme="light"]) .top-types .top-count { color: #cfcbe8; } :root:not([data-theme="light"]) .chip-solves { color: #7fd6a2; } }
:root[data-theme="dark"] .top-types li { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); } :root[data-theme="dark"] .top-types .top-count { color: #cfcbe8; } :root[data-theme="dark"] .chip-solves { color: #7fd6a2; }
.admin:has(#gen-form) { max-width: min(1500px, 100%); }
#gen-form { max-width: none; }

#gen-form .adm-table th, #gen-form .adm-table td { white-space: normal; }
#gen-form .adm-table td:nth-child(1) { width: 36px; }
.adm-groups { display: flex; flex-wrap: wrap; gap: 8px 22px; border: 1px solid #c8ccd8; border-radius: 12px; padding: 10px 14px; }
.adm-groups label { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.gen-status { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 14px; padding: 14px 18px; margin: 12px 0 16px; border-radius: 16px; background: linear-gradient(135deg, #efeaff, #fde8f3); }
.gen-status > div { display: grid; gap: 2px; } .gen-k { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #6a64a0; font-weight: 700; }
.gen-panel { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: end; padding: 16px 18px; background: #fff; border-radius: 16px; border: 1px solid #e3e0f5; }
.gen-panel label { display: grid; gap: 4px; font-weight: 600; min-width: 200px; } .gen-panel small { font-weight: 400; color: #6a64a0; }
.gen-panel input[type=number] { padding: 9px 12px; border: 1px solid #c8ccd8; border-radius: 10px; font: inherit; width: 100%; }
.gen-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.adm-groups legend { font-weight: 700; padding: 0 6px; }
.gen-chip { cursor: pointer; } .gen-chip input { position: absolute; opacity: 0; }
.gen-chip span { display: inline-block; padding: 7px 14px; border-radius: 999px; background: #f1eefc; border: 1px solid #d9d3f5; font-weight: 600; }
.gen-chip input:checked + span { background: linear-gradient(135deg, #7b4de0, #d9479a); color: #fff; border-color: transparent; }
.gen-chip input:disabled + span { opacity: .45; cursor: not-allowed; } .gen-chip input:focus-visible + span { outline: 3px solid #7b4de0; outline-offset: 2px; }
.gen-chip small { opacity: .75; }
.gen-sec { margin-top: 22px; } .gen-sec h2 { margin: 0 0 10px; font-size: 20px; } .gen-sec h2 small { font-size: 13px; color: #6a64a0; font-weight: 500; margin-left: 8px; }
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.gen-card { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid #e3e0f5; cursor: pointer; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.gen-card:hover { border-color: #b9a8ff; box-shadow: 0 4px 14px rgba(110,90,200,.12); }
.gen-card:has(input:checked) { border-color: #7b4de0; background: #f6f2ff; box-shadow: 0 0 0 2px rgba(123,77,224,.25); }
.gen-card.gen-off { opacity: .6; cursor: default; background: #f7f7fb; }
.gen-top { display: flex; gap: 8px; align-items: flex-start; } .gen-top b { line-height: 1.25; } .gen-top input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: #7b4de0; }
.gen-lock { font-style: normal; }
.gen-bar { height: 6px; border-radius: 999px; background: #ece9f8; overflow: hidden; } .gen-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7b4de0, #d9479a); }
.gen-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: #55507d; align-items: center; }
.gen-tag { padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.gen-fast { background: #dff5e7; color: #1f6b3d; } .gen-mid { background: #fff0cf; color: #8a5a00; } .gen-slow { background: #fde0e0; color: #9b2c2c; } .gen-none { background: #e8e8f2; color: #666; }
.gen-submit { position: sticky; bottom: 0; padding: 14px 0; margin-top: 18px; background: linear-gradient(to top, var(--bg, #fff) 70%, transparent); display: flex; justify-content: center; }
@media (max-width: 640px) { .gen-status { grid-template-columns: 1fr; } .gen-pick { margin-left: 0; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gen-panel, :root:not([data-theme="light"]) .gen-card { background: #1f1d33; border-color: #3d3a5c; } :root:not([data-theme="light"]) .gen-card:has(input:checked) { background: #2a2650; } :root:not([data-theme="light"]) .gen-status { background: #26234a; } :root:not([data-theme="light"]) .gen-meta, :root:not([data-theme="light"]) .gen-k, :root:not([data-theme="light"]) .gen-panel small { color: #b8b4dc; } :root:not([data-theme="light"]) .gen-chip span { background: #26234a; border-color: #3d3a5c; } :root:not([data-theme="light"]) .gen-card.gen-off { background: #181628; } :root:not([data-theme="light"]) .gen-bar { background: #34305a; } }
.sc-bank { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; padding: 10px 12px; border-radius: 14px; background: #f5f2ff; border: 1px solid rgba(110,90,200,.18); }
.sc-bank b { margin-right: 4px; }
.sc-bank-ch { display: inline-grid; place-items: center; min-width: 30px; height: 34px; padding: 0 4px; border-radius: 9px; background: #fff; border: 2px solid #b9a8ff; font-weight: 800; font-size: 18px; color: #3b2f8f; }
.sc-bank-ch.used { opacity: .35; text-decoration: line-through; background: #ece9f8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sc-bank { background: #1f1d33; border-color: #3d3a5c; } :root:not([data-theme="light"]) .sc-bank-ch { background: #26234a; color: #e5e0ff; border-color: #6a5bc4; } :root:not([data-theme="light"]) .sc-bank-ch.used { background: #181628; } }
:root[data-theme="dark"] .sc-bank { background: #1f1d33; border-color: #3d3a5c; } :root[data-theme="dark"] .sc-bank-ch { background: #26234a; color: #e5e0ff; border-color: #6a5bc4; } :root[data-theme="dark"] .sc-bank-ch.used { background: #181628; }
.sc-board.sc-emoji .qcell .q-item { font-size: calc(var(--cell) * .42); line-height: 1; display: flex; align-items: center; justify-content: center; gap: 2px; }
.sc-board.sc-emoji .qcell.q2 .q-item { font-size: calc(var(--cell) * .3); }
.sc-board.sc-emoji .qcell .q-t { display: inline; text-align: center; }
