/* =========================================================
   Merchant Ear — тактический тёмный интерфейс
   Токены → база → оболочка → приложение → лендинг → мини-окно
   ========================================================= */

:root {
  /* поверхности */
  --bg: #0b0d0c;
  --bg-grid: rgba(242, 194, 48, 0.035);
  --surface: #111412;
  --surface-2: #171b18;
  --surface-3: #1e231f;
  --surface-hover: #242a25;
  --line: #262c28;
  --line-strong: #39413b;

  /* текст */
  --text: #e9ece8;
  --text-2: #a9b1aa;
  --text-3: #808a82;

  /* смысловые */
  --accent: #f2c230;
  --accent-2: #ffd75e;
  --accent-ink: #1a1400;
  --accent-soft: rgba(242, 194, 48, 0.12);
  --accent-line: rgba(242, 194, 48, 0.4);
  --good: #5bc77a;
  --good-soft: rgba(91, 199, 122, 0.14);
  --bad: #f05b4f;
  --bad-soft: rgba(240, 91, 79, 0.14);
  --info: #5aa9ff;

  /* типографика */
  --font-display: "Russo One", "Exo 2", system-ui, sans-serif;
  --font-body: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* форма и движение */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 140ms;
  --t: 220ms;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1120px;

  color-scheme: dark;
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(242, 194, 48, 0.07), transparent 60%),
    linear-gradient(var(--bg-grid) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px) 0 0 / 40px 40px,
    var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
img { max-width: 100%; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }
[hidden] { display: none !important; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#i-play path, .i.fill { fill: currentColor; stroke: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--text-3); font-weight: 400; }
.hint { font-size: 13px; color: var(--text-3); }
.hint b { color: var(--text-2); font-weight: 600; }
.empty { color: var(--text-2); font-size: 14px; }
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }

.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px; background: var(--accent); color: var(--accent-ink); border-radius: var(--r-sm); font-weight: 700; }
.skip:focus { top: 12px; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 14px; border-radius: var(--r-sm);
  background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text);
  font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover { background: var(--surface-hover); border-color: #4a544c; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 0 var(--accent-line), 0 8px 24px -10px rgba(242, 194, 48, 0.6); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #ff6d61; border-color: #ff6d61; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--surface-2); }
.btn.lg { min-height: 48px; padding: 12px 22px; font-size: 15px; }
.btn.small { min-height: 30px; padding: 5px 10px; font-size: 12.5px; gap: 6px; }
.btn.small .i { width: 14px; height: 14px; }
.btn.wide { width: 100%; }

select {
  appearance: none; min-height: 40px; padding: 8px 34px 8px 12px; border-radius: var(--r-sm);
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b1aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
  border: 1px solid var(--line-strong); color: var(--text); cursor: pointer; width: 100%;
  transition: border-color var(--t-fast) var(--ease);
}
select:hover { border-color: #4a544c; }
option { background: var(--surface-2); color: var(--text); }

input[type=range] { width: 100%; height: 24px; accent-color: var(--accent); cursor: pointer; background: transparent; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 34px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); cursor: pointer; font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--accent-line); background: var(--surface-3); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.zero { opacity: 0.35; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-family: var(--font-mono); white-space: nowrap; }
.badge.warn, .badge.q-low { background: var(--bad-soft); color: #ffb0a9; }
.badge.q-good { background: var(--good-soft); color: #a6f0bb; }
.badge.q-mid { background: var(--accent-soft); color: #ffe28d; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ---------- навигация ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(11, 13, 12, 0.82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); height: 60px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.brand-name { font: 400 18px/1 var(--font-display); letter-spacing: 0.02em; }
.brand-name b { color: var(--accent); font-weight: 400; margin-left: 2px; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }

.status {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; max-width: 46vw;
  font: 500 12.5px/1 var(--font-mono); color: var(--text-2);
  padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status::before { content: ""; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--text-3); }
.status.live { color: var(--good); border-color: rgba(91, 199, 122, 0.45); background: rgba(91, 199, 122, 0.06); }
.status.live::before { background: var(--good); box-shadow: 0 0 0 0 rgba(91, 199, 122, 0.6); animation: ping 1.6s var(--ease) infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(91, 199, 122, 0); } 100% { box-shadow: 0 0 0 0 rgba(91, 199, 122, 0); } }

/* ---------- hero ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: end; padding: 64px 0 40px; }
.hero-copy { display: flex; flex-direction: column; gap: 20px; }
.hero h1 { font: 400 clamp(34px, 5.2vw, 58px)/1.04 var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: clamp(16px, 1.6vw, 18px); color: var(--text-2); max-width: 58ch; text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero-stats { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.hero-stats > div { padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-stats > div:nth-child(2n) { border-right: 0; }
.hero-stats > div:nth-child(n+3) { border-bottom: 0; }
.hero-stats dt { font: 600 11px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.hero-stats dd { margin: 8px 0 0; font: 400 30px/1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.hero-stats dd small { font: 500 14px var(--font-body); color: var(--text-3); }

/* ---------- консоль приложения ---------- */
.console {
  position: relative; margin-bottom: 32px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--accent); pointer-events: none; }
.corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: var(--r-lg); }
.corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-top-right-radius: var(--r-lg); }
.corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-bottom-left-radius: var(--r-lg); }
.corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: var(--r-lg); }

.console-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 12px 12px 8px; border-bottom: 1px solid var(--line); }
.console-title { display: flex; align-items: center; gap: 10px; padding-left: 8px; font: 400 17px/1.2 var(--font-display); }
.console-title .i { color: var(--accent); }
.tabs { display: flex; gap: 2px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px;
  background: none; border: 0; border-radius: var(--r-sm); color: var(--text-3); font-weight: 600; font-size: 14px; cursor: pointer;
  position: relative; transition: color var(--t-fast), background var(--t-fast);
}
.tab:hover { color: var(--text); background: var(--surface-3); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; background: var(--accent); border-radius: 2px; }
.tab[aria-selected="true"] .i { color: var(--accent); }
.tab-count { font: 600 11px/1 var(--font-mono); padding: 3px 6px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); }
.console-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-btn .map-dot { display: inline-block; width: 9px; height: 9px; margin: 0 4px 0 6px; border-radius: 50%; background: var(--c); vertical-align: 1px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ---------- окно выбора карты ---------- */
.map-dialog { width: min(560px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); color: var(--text); box-shadow: var(--shadow); }
.map-dialog::backdrop { background: rgba(5, 6, 6, 0.78); backdrop-filter: blur(6px); }
.map-dialog-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.map-dialog-head h2 { flex: 1; font: 400 20px/1.2 var(--font-display); }
.map-dialog-head .icon-only { padding: 5px 7px; }
#mapBack .i { transform: rotate(90deg); }
.map-grid, .mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.map-card, .mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.map-card:hover, .mode-card:hover { border-color: var(--accent); background: var(--surface-3); }
.map-card.on, .mode-card.on { border-color: var(--accent); }
.map-card b, .mode-card b { font-size: 15px; }
.map-dots { display: flex; gap: 5px; }
.map-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.mode-card { border-left: 4px solid var(--c); }
.mode-swatch { width: 22px; height: 22px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.mode-card small { color: var(--text-2); font-size: 12.5px; }
.mode-grid { grid-template-columns: 1fr; }
.mode-card { position: relative; overflow: hidden; }
.mode-card > * { position: relative; }
/* Кадр из игры справа, слева — затемнение под текст. */
.map-card.art, .mode-card.art { background: linear-gradient(90deg, rgba(10, 12, 11, 0.92) 0%, rgba(10, 12, 11, 0.55) 45%, rgba(10, 12, 11, 0.1) 100%), var(--art) center / cover no-repeat; }
.mode-card.art { min-height: 96px; justify-content: center; }
.map-card.art { min-height: 72px; }
.map-card.art:hover, .mode-card.art:hover { background: linear-gradient(90deg, rgba(10, 12, 11, 0.85) 0%, rgba(10, 12, 11, 0.4) 45%, rgba(10, 12, 11, 0) 100%), var(--art) center / cover no-repeat; }
.mode-card.art b, .map-card.art b { font-size: 18px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }

/* осциллограф */
.scope { position: relative; height: 92px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.05)); overflow: hidden; }
.scope canvas { display: block; width: 100%; height: 100%; }
.scope-legend { position: absolute; top: 8px; right: 12px; display: flex; gap: 14px; font: 500 11px/1 var(--font-mono); color: var(--text-3); }
.scope-legend span { display: inline-flex; align-items: center; gap: 6px; }
.scope-legend i { display: inline-block; width: 12px; height: 2px; border-radius: 1px; }
.lg-level { background: var(--good); }
.lg-thr { background: repeating-linear-gradient(90deg, var(--accent) 0 3px, transparent 3px 5px); }
.lg-hit { background: var(--accent); height: 10px !important; width: 2px !important; }
.weather-chip { position: absolute; left: 12px; top: 8px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 4px; background: rgba(0, 0, 0, 0.35); font: 600 11px/1.2 var(--font-mono); color: var(--text-2); cursor: pointer; }
.weather-chip:hover { color: var(--text); border-color: var(--text-3); }
.weather-chip.rain, .weather-chip.wind { color: var(--accent); border-color: var(--accent); }
.scope-idle { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font: 600 12px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }

.panel { padding: 20px; display: flex; flex-direction: column; gap: 16px; animation: fade var(--t) var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.panel-head h2, .set-card h2 { font: 400 18px/1.2 var(--font-display); display: flex; align-items: center; gap: 10px; }
.panel-head .hint { margin-top: 6px; }
.set-card h2 .i { color: var(--accent); }

/* ---------- «Сейчас» ---------- */
.now-card { display: flex; flex-direction: column; gap: 16px; }
.now-state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font: 400 22px/1.2 var(--font-display); }
.now-state small { font: 500 13px var(--font-body); color: var(--text-3); }
.now-state.wait { color: var(--text); }
.now-sound { color: var(--accent); }
.now-label { font: 500 15px var(--font-body); color: var(--text-2); }
.now-state .badge { font-size: 12px; }

.radar { position: relative; width: 14px; height: 14px; flex: none; }
.radar::before, .radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); }
.radar::after { animation: radar 1.6s var(--ease) infinite; opacity: 0.6; }
@keyframes radar { to { transform: scale(2.6); opacity: 0; } }

/* пустое состояние — до начала прослушивания */
.idle { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 8px 0 4px; }
.idle h3 { font: 400 22px/1.2 var(--font-display); }
.idle p { color: var(--text-2); margin-top: 8px; max-width: 60ch; }
.share-guide { grid-column: 1 / -1; margin: 4px 0 0; display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 16px; align-items: center; }
.share-shot { position: relative; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.share-shot img { display: block; width: 100%; height: auto; }
.share-shot .mark { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 14px/1 var(--font-mono); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.55); }
.idle-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 10px; counter-reset: s; }
.idle-steps li { counter-increment: s; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 13.5px; color: var(--text-2); }
.idle-steps li::before { content: "0" counter(s); display: block; font: 600 11px/1 var(--font-mono); color: var(--accent); margin-bottom: 6px; letter-spacing: 0.08em; }
.waiting { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.waiting p { color: var(--text-3); font-size: 14px; }

/* опросник */
.quiz {
  border: 1px solid var(--accent-line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 14px;
  background: linear-gradient(180deg, var(--accent-soft), transparent 140%); animation: flash 1.2s var(--ease);
}
@keyframes flash { from { box-shadow: 0 0 0 3px var(--accent-line); } }
.quiz.done { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-color: var(--line); background: var(--surface); color: var(--text-2); font-size: 14px; animation: none; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.quiz-head b { font: 400 16px var(--font-display); }
.quiz-q { display: flex; flex-direction: column; gap: 8px; font: 600 11.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.quiz-q .chips, .quiz-q .size-row { text-transform: none; letter-spacing: 0; }
.quiz .chip small { color: inherit; opacity: 0.7; font-size: 11px; }

#sizes, .size-row { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
  min-width: 64px; min-height: 72px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text-2);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.size-btn:hover { border-color: var(--accent-line); background: var(--surface-3); }
.size-btn small { font: 600 12px/1 var(--font-mono); }
.size-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.size-btn.zero { opacity: 0.3; }
.size-icon { display: grid; grid-template-columns: repeat(var(--w), 10px); gap: 2px; }
.size-icon i { width: 10px; height: 10px; background: #5d665f; border-radius: 2px; }
.size-btn.on .size-icon i { background: var(--accent); }

/* сводка */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.summary:empty { display: none; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.stat > span { display: block; font: 600 11px/1.3 var(--font-mono); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.stat > span + b { margin-top: 8px; }
.stat b { display: block; font: 600 22px/1.15 var(--font-mono); font-variant-numeric: tabular-nums; margin-top: 8px; }
.stat b + span { margin-top: 4px; text-transform: none; letter-spacing: 0; font: 500 12.5px/1.3 var(--font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b.good { color: var(--good); }
.stat b.bad { color: var(--bad); }

.filter-note { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--text-2); padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px dashed var(--line-strong); }

/* ---------- результаты ---------- */
.results { display: flex; flex-direction: column; gap: 10px; }
.results:empty { display: none; }
.category { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); transition: opacity var(--t); }
.category.unlikely { opacity: 0.55; }
.category-head {
  width: 100%; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 170px; gap: 12px; align-items: center;
  padding: 12px 14px; background: var(--surface-2); border: 0; color: var(--text); cursor: pointer; text-align: left;
  transition: background var(--t-fast);
}
.category-head:hover { background: var(--surface-3); }
.category-arrow { display: grid; place-items: center; color: var(--text-3); transition: transform var(--t) var(--ease); }
.category-arrow .i { width: 18px; height: 18px; }
.category.closed .category-arrow { transform: rotate(-90deg); }
.category-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.category-name small { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); }
.category-price { padding: 3px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font: 600 12.5px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.category-prob { display: flex; flex-direction: column; gap: 5px; }
.category-prob b { text-align: right; font: 600 17px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.bar { display: block; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width var(--t) var(--ease); }
.category-prob .bar i { background: linear-gradient(90deg, #3d9a5a, var(--good)); }
.category-body { display: flex; flex-direction: column; }
.category.closed .category-body { display: none; }
.category-head.static { cursor: default; grid-template-columns: 1fr auto; }
.category-head.static:hover { background: var(--surface-2); }

.item {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 120px 150px; gap: 14px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--line); position: relative;
  transition: background var(--t-fast);
}
.item::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rc, var(--line)); }
.item:hover { background: var(--surface-2); }
.item img { width: 48px; height: 48px; object-fit: contain; border-radius: var(--r-sm); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--rc) 22%, #151816), #0e100f); border: 1px solid var(--line); }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.item .price { text-align: right; font: 600 14px/1.2 var(--font-mono); font-variant-numeric: tabular-nums; }
.item .price small { display: block; font: 500 11.5px var(--font-body); color: var(--text-3); margin-top: 3px; }
.item .prob { display: flex; flex-direction: column; gap: 5px; }
.item .prob b { font: 600 16px/1 var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.item.unlikely { opacity: 0.5; }

/* ---------- библиотека ---------- */
.selftest:empty { display: none; }
.selftest { font-size: 13.5px; color: var(--text-2); padding: 10px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.sounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sound {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; transition: border-color var(--t-fast), background var(--t-fast);
}
.sound:hover { border-color: var(--line-strong); background: var(--surface-2); }
.sound.possible { border-color: rgba(242, 194, 48, 0.25); }
.sound.impossible { opacity: 0.45; }
.sound.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.sound-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.sound-head b { font: 600 14px var(--font-mono); color: var(--accent); }
.sound-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sound-score { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.sound-score i { display: block; height: 100%; background: var(--good); }

/* ---------- настройки ---------- */
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.set-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.field output { font: 600 13px var(--font-mono); color: var(--accent); padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); margin: 0 2px; }
.row { display: flex; gap: 8px; }
.row > select { flex: 1; min-width: 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- секции лендинга ---------- */
.section { padding: 0 0 96px; }
.section-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.section-head h2 { font: 400 clamp(26px, 3.4vw, 38px)/1.1 var(--font-display); text-wrap: balance; }

.steps-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.steps-grid li { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.step-n { font: 400 44px/1 var(--font-display); color: transparent; -webkit-text-stroke: 1px var(--accent-line); }
.steps-grid h3, .feature h3, .callout h3 { font-size: 17px; font-weight: 700; }
.steps-grid p, .feature p, .callout p { color: var(--text-2); font-size: 14.5px; }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; gap: 10px; transition: border-color var(--t), transform var(--t) var(--ease); }
.feature:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.feature > .i { width: 40px; height: 40px; padding: 9px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }

.callout { margin-top: 16px; display: flex; gap: 18px; align-items: flex-start; padding: 24px; border-radius: var(--r-lg); border: 1px solid rgba(91, 199, 122, 0.3); background: linear-gradient(90deg, var(--good-soft), transparent 70%); }
.callout > .i { width: 40px; height: 40px; color: var(--good); }
.callout div { display: flex; flex-direction: column; gap: 6px; }

.faq { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color var(--t); }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; font-weight: 600; font-size: 15.5px; min-height: 52px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { color: var(--text-3); transition: transform var(--t) var(--ease); }
.faq details[open] summary .i { transform: rotate(180deg); color: var(--accent); }
.faq details p { padding: 0 20px 18px; color: var(--text-2); }

.foot { border-top: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 32px var(--gutter) 40px; display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.foot .muted { font-size: 12.5px; }

/* ---------- адаптив ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 44px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links { display: none; }
  .console-bar { padding: 10px; }
  .console-actions { width: 100%; }
  .map-field { flex: 1; }
  .map-field select { min-width: 0; max-width: none; }
}
@media (max-width: 720px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps-grid, .features, .idle-steps { grid-template-columns: 1fr; }
  .idle, .share-guide { grid-template-columns: 1fr; }
  .item { grid-template-columns: 44px minmax(0, 1fr) 84px; gap: 10px; padding: 10px 12px; }
  .item img { width: 44px; height: 44px; }
  .item .price { display: none; }
  .category-head { grid-template-columns: 18px minmax(0, 1fr) 92px; }
  .category-head > span:nth-child(3) { display: none; }
  .scope-legend { display: none; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 8px; }
  .tab[aria-selected="true"]::after { bottom: -11px; }
  .console-actions .btn { flex: 1; }
  .console-actions #pip span { display: none; }
  .console-actions #pip { flex: none; }
  .map-field { flex-basis: 100%; }
  .panel { padding: 16px; }
  .status { max-width: 52vw; }
  .hero-stats dd { font-size: 24px; }
  .callout { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- мини-окно поверх игры ---------- */
body.mini { padding: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); min-height: 0; }
body.mini .now-state { font-size: 16px; gap: 8px; }
body.mini .now-label { font-size: 13px; }
body.mini .idle, body.mini .waiting p { display: none; }
body.mini .mini-cargo { color: var(--text-3); font-size: 12.5px; }
body.mini .mini-cargo b { color: var(--text); font-family: var(--font-mono); }
body.mini .quiz { padding: 10px; gap: 10px; }
body.mini .size-btn { min-width: 52px; min-height: 60px; padding: 6px; }
body.mini .chip { min-height: 30px; padding: 4px 10px; }
body.mini .category-head { padding: 8px 10px; }
body.mini .category-prob b { font-size: 14px; }
.mini-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 48px; gap: 8px; align-items: center; padding: 5px 8px; border-top: 1px solid var(--line); position: relative; }
.mini-item::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px; background: var(--rc); border-radius: 0 3px 3px 0; }
.mini-item img { width: 30px; height: 30px; object-fit: contain; background: #0e100f; border-radius: 4px; }
.mini-item span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item .muted { font-family: var(--font-mono); font-size: 12px; }
.mini-item b { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mini-more { font-size: 11px; color: var(--text-3); padding: 2px 6px; }
.sound-actions .btn { flex: 1 1 auto; }
@media (max-width: 720px) {
  .tab { padding: 8px 6px; font-size: 13.5px; }
  .tab .i, .tab-count { display: none; }
  .status { max-width: 44vw; }
  .hero-cta .btn { flex: 1 1 auto; }
}

/* подсказка: мини-окно не открылось само после выбора окна */
.pip-hint {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px 14px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r);
  color: var(--text-2); font-size: 13.5px; text-align: left; cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.pip-hint:hover { background: rgba(242, 194, 48, 0.2); }
.pip-hint .i { color: var(--accent); width: 20px; height: 20px; }
.pip-hint b { color: var(--text); margin-right: 6px; }
.btn.attention { border-color: var(--accent); color: var(--accent); animation: attn 1.6s var(--ease) infinite; }
@keyframes attn { 50% { box-shadow: 0 0 0 4px var(--accent-soft); } }
@media (prefers-reduced-motion: reduce) { .btn.attention { animation: none; } }
