/* site.css - общий стиль лендинга, каталога, инструкции и страниц игр.
   Палитра: OLED-чёрный + зелёный люминофор ВЛИ. */

:root {
  --bg: #050605;
  --bg-soft: #0a0d0b;
  --ink: #e9f2ec;
  --ink-dim: #93a29a;
  --ink-faint: #5a6660;
  --vfd: #7cffb0;
  --vfd-deep: #2fd97c;
  --vfd-dark: #123324;
  --hairline: rgba(124, 255, 176, 0.14);
  --hairline-soft: rgba(255, 255, 255, 0.07);
  --card: rgba(16, 22, 18, 0.72);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

/* фоновые орбы люминофора */
/* фоновые blur-блобы убраны: расхожий приём генеративных лендингов, а их
   гигантские фильтрованные слои ещё и роняли мобильный WebKit при pinch-zoom */
.orbs { display: none; }
/* зерно плёнки */
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

::selection { background: rgba(124, 255, 176, 0.25); }

/* ---------- навигация: парящая пилюля ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: center;
  padding-top: 22px;
  pointer-events: none;
}
.nav-pill {
  pointer-events: auto;
  display: flex; align-items: center; gap: 4px;
  padding: 6px 8px 6px 18px;
  border-radius: 999px;
  background: rgba(9, 13, 11, 0.96);
  border: 1px solid var(--hairline);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 12px; letter-spacing: 0.14em;
  color: var(--vfd);
  text-decoration: none;
  margin-right: 14px;
  white-space: nowrap;
}
.nav-pill a.nav-link {
  font-size: 13.5px; font-weight: 600;
  color: var(--ink-dim);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.4s var(--ease), background 0.4s var(--ease);
  white-space: nowrap;
}
.nav-pill a.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav-pill a.nav-link.active { color: var(--vfd); background: rgba(124, 255, 176, 0.09); }
.nav-tg {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 700;
  letter-spacing: 0.01em;
  color: #06120b; text-decoration: none;
  background: var(--vfd);
  padding: 8px 16px;
  border-radius: 999px;
  margin-left: 8px;
  transition: background 0.25s ease-out, transform 0.25s ease-out;
}
.nav-tg:hover { background: #9df5c1; }
.nav-tg:active { transform: scale(0.98); }
.nav-tg .mini-orb { font-size: 13px; transition: transform 0.25s ease-out; }
.nav-tg:hover .mini-orb { transform: translate(1px, -1px); }

@media (max-width: 860px) {
  .nav-pill { padding-left: 12px; }
  .nav-pill a.nav-link { padding: 8px 9px; font-size: 12.5px; }
  .nav-logo { display: none; }
}

/* ---------- каркас секций ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
section { padding: 110px 0; }
@media (max-width: 768px) { section { padding: 64px 0; } }

/* оверлайн: голый разреженный текст, без пилюли и светящейся точки */
.eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--vfd-deep);
  margin-bottom: 22px;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; }
h1 { font-size: clamp(40px, 7vw, 84px); letter-spacing: -0.01em; }
h2 { font-size: clamp(28px, 4.2vw, 48px); margin-bottom: 22px; }
h3 { font-size: 19px; margin-bottom: 10px; }
.lead { font-size: clamp(17px, 2vw, 21px); color: var(--ink-dim); max-width: 640px; }
p + p { margin-top: 14px; }
.text-dim { color: var(--ink-dim); }
.accent { color: var(--vfd); }

/* ---------- двойная фаска (double-bezel) ---------- */
.bezel {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--hairline-soft);
  border-radius: 2rem;
  padding: 0.45rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.bezel > .bezel-core {
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-radius: calc(2rem - 0.45rem);
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
}
.bezel img { display: block; width: 100%; height: auto; }

/* ---------- кнопки: спокойные плоские пилюли ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15.5px; font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.25s ease-out, border-color 0.25s ease-out, transform 0.25s ease-out;
}
.btn:active { transform: scale(0.98); }
.btn .orb {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: transform 0.25s ease-out;
}
.btn:hover .orb { transform: translateX(2px); }
.btn-solid {
  color: #06120b;
  background: var(--vfd);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.btn-solid:hover { background: #9df5c1; }
.btn-solid .orb { color: #06120b; }
.btn-ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--hairline);
}
.btn-ghost:hover { border-color: rgba(124, 255, 176, 0.5); color: var(--vfd); }
.btn-ghost .orb { color: var(--vfd); font-weight: 800; font-size: 13.5px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- появление при прокрутке: тихое проявление без подскока ---------- */
.reveal { opacity: 0; transition: opacity 0.5s ease-out; }
.reveal.in { opacity: 1; }
.reveal.d1 { transition-delay: 0.06s; }
.reveal.d2 { transition-delay: 0.12s; }
.reveal.d3 { transition-delay: 0.18s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transition: none; }
}

/* ---------- бенто-сетка ---------- */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.bento .cell {
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-radius: 1.6rem;
  padding: 30px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
.cell.glow { border-color: var(--hairline); }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
@media (max-width: 768px) {
  .bento { grid-template-columns: 1fr; }
  .span-4, .span-5, .span-6, .span-7, .span-8, .span-12 { grid-column: span 1; }
}

.stat-num {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.4vw, 44px);
  color: var(--vfd);
  text-shadow: 0 0 22px rgba(124, 255, 176, 0.4);
}
.stat-label { font-size: 13px; color: var(--ink-dim); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }

/* моно-подписи */
.mono { font-family: var(--font-mono); font-size: 13.5px; color: var(--vfd-deep); }

/* ---------- таймлайн ---------- */
.timeline { position: relative; margin-top: 40px; }
.timeline::before {
  content: '';
  position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--vfd-dark) 12%, var(--vfd-dark) 88%, transparent);
}
.t-item { position: relative; padding: 0 0 34px 42px; }
.t-item::before {
  content: '';
  position: absolute; left: 0; top: 7px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--vfd-deep);
  box-shadow: 0 0 12px rgba(47, 217, 124, 0.5);
}
.t-year { font-family: var(--font-display); font-size: 15px; color: var(--vfd); margin-bottom: 4px; }
.t-item p { color: var(--ink-dim); font-size: 15.5px; max-width: 560px; }

/* ---------- футер ---------- */
footer {
  border-top: 1px solid var(--hairline-soft);
  padding: 48px 0 64px;
  margin-top: 40px;
}
.foot-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: center; }
.foot-note { font-size: 13.5px; color: var(--ink-faint); }
footer a { color: var(--ink-dim); text-decoration: none; }
footer a:hover { color: var(--vfd); }

/* ---------- каталог игр ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 34px 0 40px; }
.chip {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hairline-soft);
  cursor: pointer;
  transition: all 0.4s var(--ease);
}
.chip:hover { color: var(--ink); transform: translateY(-1px); }
.chip.on { color: #06120b; background: var(--vfd); border-color: transparent; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 22px;
}
.game-card {
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-radius: 1.5rem;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 0.6s var(--ease), border-color 0.6s var(--ease), box-shadow 0.6s var(--ease);
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--hairline);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(124, 255, 176, 0.06);
}
.game-cover { position: relative; aspect-ratio: 1; overflow: hidden; background: #0a120d; }
.game-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 1.2s var(--ease);
}
.game-card:hover .game-cover img { transform: scale(1.045); }
.badge {
  position: absolute; top: 14px; left: 14px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.badge-free { background: rgba(124, 255, 176, 0.92); color: #06120b; box-shadow: 0 0 20px rgba(124, 255, 176, 0.5); }
.badge-paid { background: rgba(8, 12, 10, 0.72); color: var(--ink); border: 1px solid var(--hairline-soft); }
.game-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--vfd-deep); }
.game-title { font-family: var(--font-display); font-size: 17px; }
.game-desc { font-size: 14px; color: var(--ink-dim); line-height: 1.55; flex: 1; }
.game-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.price { font-family: var(--font-display); font-size: 16px; color: var(--ink); }
.price.free { color: var(--vfd); text-shadow: 0 0 16px rgba(124, 255, 176, 0.5); }
.btn-sm {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 800;
  text-decoration: none;
  cursor: pointer; border: none;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.btn-sm:active { transform: scale(0.96); }
.btn-sm.play { color: #06120b; background: var(--vfd); }
.btn-sm.play:hover { background: #9df5c1; }
.btn-sm.buy { color: var(--ink); background: transparent; border: 1px solid var(--hairline); }
.btn-sm.buy:hover { border-color: rgba(124, 255, 176, 0.45); color: var(--vfd); }

/* ---------- инструкция ---------- */
.manual-layout { display: grid; grid-template-columns: 230px 1fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .manual-layout { grid-template-columns: 1fr; } }
.toc {
  position: sticky; top: 110px;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 14px;
}
.toc a {
  color: var(--ink-dim); text-decoration: none;
  padding: 7px 14px; border-radius: 10px;
  transition: all 0.3s var(--ease);
}
.toc a:hover { color: var(--vfd); background: rgba(124, 255, 176, 0.06); }
.manual-body h2 { margin-top: 64px; scroll-margin-top: 110px; }
.manual-body h2:first-child { margin-top: 0; }
.manual-body h3 { margin-top: 30px; color: var(--vfd); font-size: 16px; }
.manual-body p, .manual-body li { color: var(--ink-dim); font-size: 15.5px; }
.manual-body ul, .manual-body ol { padding-left: 22px; margin: 12px 0; }
.manual-body li { margin: 6px 0; }
.manual-body strong { color: var(--ink); }
kbd {
  font-family: var(--font-mono);
  font-size: 13px;
  background: #14201a;
  border: 1px solid var(--hairline);
  border-bottom-width: 2px;
  color: var(--vfd);
  border-radius: 7px;
  padding: 2px 8px;
  white-space: nowrap;
}
.man-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.man-table th, .man-table td {
  border: 1px solid rgba(124, 255, 176, 0.1);
  padding: 8px 12px;
  text-align: left;
  color: var(--ink-dim);
}
.man-table th { color: var(--vfd); font-weight: 700; background: rgba(124, 255, 176, 0.05); }
.table-scroll { overflow-x: auto; border-radius: 12px; }
.code-table { font-family: var(--font-mono); font-size: 12.5px; border-collapse: collapse; }
.code-table th, .code-table td {
  border: 1px solid rgba(124, 255, 176, 0.12);
  padding: 5px 7px;
  text-align: center;
  min-width: 46px;
  color: var(--ink-dim);
  white-space: nowrap;
}
.code-table th { color: var(--vfd); background: rgba(124, 255, 176, 0.06); }
.code-table td.f { color: #ffd27a; }
.code-table td.k { color: #7ec8e8; }
.callout {
  border: 1px solid var(--hairline);
  background: rgba(124, 255, 176, 0.05);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 20px 0;
  font-size: 15px;
  color: var(--ink-dim);
}
.callout strong { color: var(--vfd); }

/* ---------- страница игры ---------- */
.play-layout {
  display: grid;
  grid-template-columns: minmax(380px, 520px) 1fr;
  gap: 34px;
  align-items: start;
}
@media (max-width: 1020px) { .play-layout { grid-template-columns: 1fr; } }
.sim-frame {
  width: 100%;
  aspect-ratio: 0.62;
  min-height: 720px;
  border: none;
  border-radius: 1.4rem;
  background: transparent;
}
/* выбран МК-52: горизонтальный корпус поднимаем наверх на всю ширину,
   панели пульта и инструкций уходят под него; высоту рамке задаёт скрипт */
.play-layout.sim-mk52 { grid-template-columns: 1fr; }
.play-layout.sim-mk52 .sim-frame { aspect-ratio: auto; min-height: 0; }
/* рамки вне страниц игр (главная и т.п.): контейнер расширяется под МК-52 */
.sim-embed-52 { max-width: none !important; width: 100%; }
.panel {
  background: var(--card);
  border: 1px solid var(--hairline-soft);
  border-radius: 1.6rem;
  padding: 26px;
}
.panel + .panel { margin-top: 20px; }
.panel h3 { display: flex; align-items: center; gap: 10px; }
.controls-bar { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.load-status { font-family: var(--font-mono); font-size: 13px; color: var(--vfd-deep); min-height: 18px; }

.dump-table { font-family: var(--font-mono); font-size: 12.5px; border-collapse: collapse; width: 100%; }
.dump-table td, .dump-table th {
  border: 1px solid rgba(124, 255, 176, 0.1);
  padding: 4px 8px; text-align: center; color: var(--ink-dim);
}
.dump-table th { color: var(--vfd); }
.dump-table td.c { color: var(--vfd); font-weight: 700; }

.comic { display: grid; gap: 12px; margin-bottom: 6px; }
.comic img { width: 100%; border-radius: 14px; border: 1px solid var(--hairline-soft); display: block; }

/* поле на «бумаге» */
.paper {
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}
.sea-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  padding: 26px;
}
.sea-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(30, 50, 70, 0.35);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  color: #274257;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.sea-cell:hover { background: rgba(124, 255, 176, 0.35); transform: scale(1.06); }
.sea-cell.shot { background: rgba(30, 50, 70, 0.75); color: #cfe8ff; cursor: default; }
.sea-cell.hit { background: #d43a2e; color: #fff; box-shadow: 0 0 18px rgba(212, 58, 46, 0.7); }

.gauge { margin: 10px 0; }
.gauge-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-dim); margin-bottom: 5px; }
.gauge-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.gauge-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--vfd-deep), var(--vfd)); transition: width 0.5s var(--ease); box-shadow: 0 0 14px rgba(124, 255, 176, 0.5); }

canvas.game-canvas { width: 100%; border-radius: 16px; display: block; background: #04070a; border: 1px solid var(--hairline-soft); }

/* монета */
.coin-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 18px 0; perspective: 900px; }
.coin { width: 190px; height: 190px; position: relative; transform-style: preserve-3d; transition: transform 1.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.coin-face {
  position: absolute; inset: 0; border-radius: 50%;
  background-size: cover; background-position: center;
  backface-visibility: hidden;
  border: 3px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.coin-face.tails { transform: rotateY(180deg); }

/* кости */
.dice-stage { display: flex; gap: 26px; justify-content: center; padding: 26px 0; }
.die {
  width: 110px; height: 110px;
  border-radius: 20px;
  background: linear-gradient(145deg, #fdfdf6, #d9d7c8);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), inset 0 2px 3px rgba(255, 255, 255, 0.9);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 16px;
  transition: transform 0.7s var(--ease);
}
.die.rolling { animation: dieroll 0.55s var(--ease); }
@keyframes dieroll {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(180deg) scale(0.82); }
  100% { transform: rotate(360deg) scale(1); }
}
.pip { border-radius: 50%; background: #17211b; margin: 14%; opacity: 0; }
.pip.on { opacity: 1; }

/* спички */
.matches { display: flex; flex-wrap: wrap; gap: 9px; padding: 18px 6px; justify-content: center; }
.match { width: 12px; height: 84px; position: relative; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.match::before { content: ''; position: absolute; inset: 12px 4px 0; background: #caa86a; border-radius: 3px; }
.match::after { content: ''; position: absolute; top: 0; left: 1px; width: 10px; height: 15px; background: #7a2f1e; border-radius: 45%; }
.match.gone { opacity: 0.12; transform: translateY(8px) rotate(8deg); }

/* шкала 1..100 */
.numline { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; padding: 22px; }
.num-cell {
  aspect-ratio: 1.15;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 700;
  color: #4d4534;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(90, 80, 50, 0.2);
  transition: all 0.35s var(--ease);
}
.num-cell.out { opacity: 0.22; }
.num-cell.tried { background: #3d4a42; color: #cfe8d8; }
.num-cell.win { background: var(--vfd); color: #06120b; box-shadow: 0 0 18px rgba(124, 255, 176, 0.8); }

.log-list { font-family: var(--font-mono); font-size: 13px; color: var(--ink-dim); margin-top: 12px; display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }

/* заголовок страницы игры */
.play-head { padding: 130px 0 34px; }
.play-head .lead { max-width: 760px; }

/* лайтбокс иллюстраций */
.zoom-im { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  /* без backdrop-blur: полноэкранный фильтр ронял мобильный WebKit при pinch-zoom фото */
  background: rgba(3, 6, 4, 0.96);
  display: flex; align-items: center; justify-content: center;
  padding: 4vh 4vw;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.lightbox.open { opacity: 1; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 16px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8), 0 0 60px rgba(124, 255, 176, 0.12);
  transform: scale(0.92);
  transition: transform 0.45s var(--ease);
}
.lightbox.open img { transform: scale(1); }
.lightbox .lb-hint {
  position: absolute; bottom: 20px; left: 0; right: 0;
  text-align: center; font-size: 13px; color: var(--ink-dim);
}

/* листинг для ручного ввода */
.listing-keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.listing-keys kbd { font-size: 12.5px; }
.listing-keys .sep { color: var(--ink-faint); align-self: center; font-size: 11px; }

input.angle-input, input.cell-input {
  background: #0d1512;
  border: 1px solid var(--hairline);
  color: var(--vfd);
  font-family: var(--font-mono);
  font-size: 16px;
  border-radius: 12px;
  padding: 10px 14px;
  width: 110px;
  outline: none;
}

/* ===================== МОБИЛЬНАЯ АДАПТАЦИЯ =====================
   Все правила действуют только на узких экранах (max-width),
   десктопная вёрстка не меняется ни на пиксель. */

/* тач-устройства: без полноэкранного зерна - fixed-слой с SVG-шумом
   утяжелял композитинг и участвовал в крахах WebKit при pinch-zoom */
@media (pointer: coarse) {
  .grain { display: none; }
}

@media (max-width: 860px) {
  /* пилюля навигации: все девять пунктов доступны горизонтальной прокруткой */
  .nav { justify-content: flex-start; padding: 10px 10px 0; }
  .nav-pill {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-pill::-webkit-scrollbar { display: none; }
  .nav-pill a.nav-link, .nav-tg { flex-shrink: 0; }
  .nav-tg { margin-right: 2px; }
}

@media (max-width: 768px) {
  /* страницы не должны скроллиться вбок из-за глубоких сеток */
  html, body { overflow-x: clip; }

  /* крупные заголовки не упираются в край экрана */
  h1 { font-size: clamp(30px, 9.4vw, 44px) !important; }
  h2 { font-size: clamp(24px, 6.8vw, 34px); }

  /* шапки: меньше пустоты под фиксированной пилюлей (перебиваем инлайн-паддинги) */
  header { padding: 112px 0 8px !important; }
  .play-head { padding: 104px 0 22px !important; }

  /* рамка симулятора: высоту держит aspect-ratio или скрипт, а не жёсткие 720px */
  .sim-frame { min-height: 0; }

  /* секции с инлайн-сеткой (листинги, сканы) складываются в одну колонку */
  .play-layout[style] { grid-template-columns: 1fr !important; }

  /* панели и ячейки: компактнее поля */
  .panel { padding: 20px 16px; }
  .cell { padding: 22px 18px; }
  .callout { padding: 14px 16px; }

  /* игровые поля: меньше внутренние поля, чтобы клетки были крупнее */
  .sea-grid, .numline { padding: 12px; }

  /* кнопки занимают всю ширину ряда - удобнее попадать пальцем */
  .btn { width: 100%; justify-content: space-between; }
  .controls-bar .btn { width: 100%; }

  /* grid-колонки не растягиваются под широкий контент - таблицы скроллятся внутри */
  .manual-layout > *, .play-layout > *, .games-grid > *, .bento > * { min-width: 0; }

  /* моно-таблицы прокручиваются в собственной рамке */
  .table-scroll { max-width: 100%; }
  .dump-table { font-size: 11.5px; }

  footer { padding: 36px 0 44px; }
  .foot-grid { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
  /* оглавление инструкции: горизонтальная лента вместо колонки */
  .toc {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding-bottom: 8px;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc a { white-space: nowrap; flex-shrink: 0; }
}
