/* ============================================================
   МУТАНТЫ · Точка отсчёта — дизайн-система v7
   Тёмная консоль Зоны: графит + кислотный лайм, чистые панели,
   мелкие подписи капсом. По мотивам игрового пространства
   «Ковчег "Рассвет"».
   ============================================================ */
:root {
    --bg: #111111;
    --bg-2: #151515;
    --surface: #19191b;        /* панель */
    --surface-2: #1e1e20;      /* карточка */
    --border: #2b2b2e;
    --border-dim: #232326;
    --text: #f4f4f4;
    --text-dim: #a1a1a9;
    --muted: #84848b;
    --accent: #b7ff2c;         /* кислотный лайм */
    --accent-2: #caff67;       /* лайм при наведении */
    --accent-dim: #55631f;
    --accent-ink: #171c10;     /* текст на лайме */
    --hazard: #e8c33a;
    --danger: #ff6b5e;
    --danger-dim: #4a2a27;
    --warn: #e0b34e;
    --rad: #b7ff2c;
    --glow: 0 0 14px rgba(183, 255, 44, .18);
    --radius: 10px;
    --radius-lg: 14px;
    --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
    --sans: "Rubik", Arial, Helvetica, sans-serif;
    --display: "Oswald", "Rubik", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

/* заголовки — Oswald: узкий плакатный характер для Зоны */
h1, h2, h3,
.page-heading h1,
.panel h2,
.ark-life-title {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: .03em;
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }
main { padding: 0; }

/* CRT-эффект больше не нужен — чистая консоль */
.crt { display: none; }

/* ---------- Кнопки ---------- */
.btn {
    background: transparent;
    color: #b1b1b8;
    border: 1px solid #323234;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 12.5px;
    font-weight: 500;
    font-family: var(--sans);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s, color .15s, border-color .15s, transform .12s;
    touch-action: manipulation;
}
.btn:hover { color: #fff; background: #242426; border-color: #3d3d40; }
.btn:active { transform: translateY(1px); }
.btn.accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}
.btn.accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn.danger { border-color: #5c3430; color: #ff8d84; background: transparent; }
.btn.danger:hover { border-color: var(--danger); color: #ffb3ad; background: #241413; }
.btn.small { padding: 7px 12px; font-size: 11.5px; }
.btn.big { padding: 14px 18px; font-size: 13px; width: 100%; }
.btn.ghost { background: transparent; border-color: #323234; color: #b1b1b8; }

/* ---------- Поля ---------- */
input, textarea, select {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 10px 12px;
    font-size: 13px;
    font-family: var(--sans);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-dim);
    box-shadow: 0 0 0 3px rgba(183, 255, 44, .10);
}
textarea { resize: vertical; }
.error { color: #ff8d84; font-size: 12px; min-height: 1.2em; margin-top: 10px; text-align: center; }

/* ---------- Подписи капсом (eyebrow / labels) ---------- */
.eyebrow {
    color: #8c8c91;
    letter-spacing: 1.8px;
    font-size: 9px;
    text-transform: uppercase;
    margin: 0 0 10px;
}

/* ---------- Панель и заголовок раздела ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-width: 0;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.section-head h2 {
    color: #efeff1;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .2px;
    margin: 0;
}
.section-head .hint { color: var(--muted); font-size: 10px; letter-spacing: .4px; }

.empty {
    color: var(--muted);
    font-size: 12px;
    padding: 18px 14px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
}

/* ---------- общий степпер «− +» (как «Уровень угрозы») ---------- */
.stepper { display: inline-flex; align-items: stretch; }
.stepper input {
    width: 52px; text-align: center;
    -moz-appearance: textfield; appearance: textfield;
    border-radius: 0; border-left: none; border-right: none;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
    min-width: 30px; padding: 4px 10px;
    background: transparent; color: #b1b1b8;
    border: 1px solid #323234; cursor: pointer;
    font-size: 15px; font-weight: 700; line-height: 1;
    user-select: none;
    transition: background .12s, border-color .12s, color .12s;
}
.stepper-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stepper-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper-btn:hover:not(:disabled) { background: #242426; color: #fff; border-color: #3d3d40; }
.stepper-btn:active:not(:disabled) { transform: translateY(1px); }
.stepper-btn:disabled { opacity: .35; pointer-events: none; }

/* нативные стрелки числовых полей прячем — везде свои кнопки −/+ */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- КНИГА И РАЗДАТКИ: просмотрщик PDF ---------- */
.book-wrap { display: flex; gap: 14px; align-items: stretch; min-height: calc(100vh - 160px); }
.book-side { width: 280px; flex: 0 0 280px; overflow-y: auto; padding: 12px; background: var(--surface, #17181a); border: 1px solid var(--border, #2a2a2c); border-radius: 10px; }
.book-side h3 { margin: 2px 0 10px; font-size: 1rem; }
.book-group { margin-bottom: 8px; }
.book-group summary { cursor: pointer; padding: 7px 10px; border-radius: 8px; background: var(--surface2, #1e1f22); color: var(--text, #d6d8cc); font-size: .85rem; font-weight: 600; user-select: none; }
.book-group summary:hover { border-color: #3d3d40; }
.book-doc { display: block; width: 100%; text-align: left; margin-top: 4px; padding: 7px 10px; background: transparent; border: 1px solid transparent; border-radius: 8px; color: #b1b1b8; font-size: .82rem; cursor: pointer; }
.book-doc:hover { background: #242426; color: #fff; }
.book-doc.on { border-color: var(--accent, #9acd32); color: #fff; background: #242426; }
.book-main { flex: 1; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--border, #2a2a2c); border-radius: 10px; background: var(--surface, #17181a); }
.book-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--border, #2a2a2c); }
.book-toolbar .btn { text-decoration: none; }
.book-page { display: inline-flex; align-items: center; gap: 4px; }
.book-page input { width: 56px; text-align: center; background: var(--surface2, #1e1f22); border: 1px solid #323234; border-radius: 6px; color: var(--text, #d6d8cc); padding: 5px 4px; font-size: .85rem; }
.book-page-total { color: #b1b1b8; font-size: .82rem; }
.book-sep { width: 1px; height: 20px; background: #323234; margin: 0 4px; }
.book-zoom-val { min-width: 44px; text-align: center; color: #b1b1b8; font-size: .82rem; }
.book-title-bar { margin-left: auto; color: #b1b1b8; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.book-stage { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 12px; }
.book-stage canvas { background: #fff; border-radius: 4px; box-shadow: 0 2px 14px rgba(0,0,0,.5); }
.book-empty { margin: auto; text-align: center; color: #b1b1b8; font-size: .95rem; line-height: 1.7; }
@media (max-width: 860px) {
    .book-wrap { flex-direction: column; }
    .book-side { width: auto; flex: 0 0 auto; max-height: 220px; }
    .book-main { min-height: 60vh; }
    .book-title-bar { display: none; }
}

/* ---------- ПОЛКИ ДОКУМЕНТОВ (главная, справка) ---------- */
.book-shelf { max-width: 760px; }
.help-books { margin-bottom: 14px; }
.help-books h3 { margin-top: 0; }
.book-reader { position: fixed; inset: 0; z-index: 400; background: rgba(8, 9, 10, .82); display: flex; flex-direction: column; }
.book-reader.hidden { display: none; }
body.br-open { overflow: hidden; }
.br-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 10px 14px; background: #17181a; border-bottom: 1px solid #2a2a2c; }
.br-title { color: #d6d8cc; font-size: .88rem; font-weight: 600; max-width: 30%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-stage { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 14px; }
.br-stage canvas { background: #fff; border-radius: 4px; box-shadow: 0 4px 24px rgba(0,0,0,.6); }
@media (max-width: 700px) { .br-title { display: none; } }
