/* ============================================================
   CYBER//TYPE — Карта Ковчега и сцены Сезона 1
   js/ark-map.js, js/season-scenes.js. Только SVG и CSS.
   ============================================================ */

/* ---------- Карта ---------- */
.ark-panel {
    margin: 0 0 30px;
    padding: 16px;
    border: 1px solid var(--border);
    background: rgba(18, 18, 26, 0.6);
}
.ark-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: 1px;
    color: #dbe6ff;
}
.ark-map-svg { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; }

.ark-link { stroke: rgba(0, 255, 200, 0.18); stroke-width: 2; stroke-dasharray: 4 6; }
.ark-link.ark-restored { stroke: var(--primary); stroke-dasharray: none; }

.ark-core circle { fill: #0a0a0f; stroke: var(--secondary); stroke-width: 2; }
.ark-core text { fill: var(--secondary); font: 700 10px monospace; letter-spacing: 1px; }
.ark-core-awake circle { animation: ark-core-wake 2.4s ease-in-out infinite; }

.ark-node circle { stroke-width: 2; }
.ark-node text { font-family: monospace; }
.ark-node-index { font-size: 13px; font-weight: 700; }
.ark-node-label { font-size: 11px; letter-spacing: 0.5px; }

.ark-restored circle { fill: rgba(0, 255, 200, 0.18); stroke: var(--primary); filter: drop-shadow(0 0 6px var(--primary)); }
.ark-restored text { fill: var(--primary); }
.ark-open circle { fill: rgba(255, 204, 0, 0.08); stroke: var(--warning); }
.ark-open text { fill: var(--warning); }
.ark-drifting circle { fill: rgba(51, 51, 51, 0.4); stroke: rgba(219, 230, 255, 0.3); }
.ark-drifting text { fill: rgba(219, 230, 255, 0.45); }
.ark-node.ark-drifting { animation: ark-drift 3.2s steps(1) infinite; }
.ark-node.ark-drifting:nth-of-type(2n) { animation-delay: 1.1s; }
/* Восстановлена, но «залатана Суфлёром»: янтарная обводка и редкий сбой */
.ark-restored.ark-patched circle { stroke: var(--warning); stroke-dasharray: 5 3; filter: drop-shadow(0 0 5px var(--warning)); }
.ark-node.ark-patched { animation: ark-drift 6.4s steps(1) infinite; }

@keyframes ark-drift {
    0%, 100% { opacity: 1; transform: translate(0, 0); }
    42% { opacity: 0.35; transform: translate(1px, -1px); }
    46% { opacity: 0.85; transform: translate(-1px, 0); }
}
@keyframes ark-core-wake {
    0%, 100% { filter: drop-shadow(0 0 2px var(--secondary)); }
    50% { filter: drop-shadow(0 0 12px var(--secondary)); }
}

/* ---------- Окно «Система восстановлена» ---------- */
.system-restored-modal { max-width: 460px; max-height: 92vh; overflow-y: auto; }
.system-restored-name { margin: 4px 0 12px; color: var(--primary); letter-spacing: 1px; }
.system-restored-modal .season-scene-svg { max-height: 32vh; }
.system-restored-modal .ark-map-svg { max-width: 220px; max-height: 30vh; margin: 12px auto; }

/* ---------- Сцены ---------- */
.season-scene-svg { display: block; width: 100%; height: auto; border: 1px solid var(--border); }
.scene-bg { fill: #07070c; }
.scene-grid line { stroke: rgba(0, 255, 200, 0.06); stroke-width: 1; }
.scene-status { fill: rgba(219, 230, 255, 0.7); font: 10px monospace; letter-spacing: 1px; }
.scene-status-ok { fill: var(--success); }

/* Пролог: лифт */
.scene-shaft { fill: none; stroke: rgba(219, 230, 255, 0.35); stroke-width: 2; }
.scene-floor { stroke: rgba(219, 230, 255, 0.2); stroke-width: 1; }
.scene-cable { stroke: rgba(219, 230, 255, 0.4); stroke-width: 1; }
.scene-lift-cabin rect { fill: rgba(0, 255, 200, 0.2); stroke: var(--primary); stroke-width: 2; }
.scene-lift-cabin line { stroke: var(--primary); stroke-width: 1; }
.scene-lift-cabin { transform: translateY(-120px); animation: scene-lift-up 3s ease-in-out both; }
.scene-floor-lamp { fill: var(--primary); animation: scene-lamp 0.3s linear both; }
/* Этажи загораются снизу вверх вслед за кабиной (lamp-0 — нижний) */
.scene-floor-lamp-0 { animation-delay: 0.2s; }
.scene-floor-lamp-1 { animation-delay: 0.8s; }
.scene-floor-lamp-2 { animation-delay: 1.4s; }
.scene-floor-lamp-3 { animation-delay: 2s; }
.scene-floor-lamp-4 { animation-delay: 2.6s; }

@keyframes scene-lift-up {
    from { transform: translateY(0); }
    to { transform: translateY(-120px); }
}
@keyframes scene-lamp {
    from { fill: #333; }
    to { fill: var(--primary); }
}

/* Глава 1: зелёная волна. Конечное состояние (без анимации) — все зелёные, машина справа */
.scene-road { stroke: rgba(219, 230, 255, 0.35); stroke-width: 2; }
.scene-road-mark { stroke: rgba(219, 230, 255, 0.15); stroke-width: 2; stroke-dasharray: 12 10; }
.scene-pole { stroke: rgba(219, 230, 255, 0.35); stroke-width: 2; }
.scene-light-box { fill: #0a0a0f; stroke: rgba(219, 230, 255, 0.35); stroke-width: 1; }
.scene-light-red { fill: #331018; animation: scene-red-off 0.3s linear both; }
.scene-light-green { fill: var(--primary); filter: drop-shadow(0 0 4px var(--primary)); animation: scene-green-on 0.3s linear both; }
.scene-light-0 { animation-delay: 0.4s; }
.scene-light-1 { animation-delay: 1.2s; }
.scene-light-2 { animation-delay: 2s; }
.scene-car rect { fill: rgba(0, 255, 200, 0.2); stroke: var(--primary); stroke-width: 2; }
.scene-car circle { fill: var(--primary); }
.scene-car { transform: translateX(310px); animation: scene-car-drive 3s ease-in-out both; }

@keyframes scene-red-off {
    from { fill: var(--secondary); }
    to { fill: #331018; }
}
@keyframes scene-green-on {
    from { fill: #0f2a24; filter: none; }
    to { fill: var(--primary); }
}
@keyframes scene-car-drive {
    from { transform: translateX(0); }
    to { transform: translateX(310px); }
}

/* Глава 2: чистый эфир. Конечное состояние — шума нет, пакеты у правой мачты */
.scene-antenna { fill: rgba(0, 255, 200, 0.2); stroke: var(--primary); stroke-width: 2; }
.scene-link { stroke: rgba(0, 255, 200, 0.5); stroke-width: 2; stroke-dasharray: 6 4; }
.scene-noise { stroke: var(--secondary); stroke-width: 2; opacity: 0; animation: scene-noise-fade 1.6s ease-out both; }
.scene-noise-1 { animation-delay: 0.2s; }
.scene-noise-2 { animation-delay: 0.4s; }
.scene-packet { fill: var(--primary); transform: translateX(206px); animation: scene-packet-run 2.4s ease-in-out both; }
.scene-packet-1 { animation-delay: 0.5s; }
.scene-packet-2 { animation-delay: 1s; }

@keyframes scene-noise-fade {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes scene-packet-run {
    from { transform: translateX(0); }
    to { transform: translateX(206px); }
}

/* Глава 3: город поехал. Конечное состояние — маршрут проложен, остановки горят */
.scene-block { fill: rgba(219, 230, 255, 0.05); stroke: rgba(219, 230, 255, 0.2); stroke-width: 1; }
.scene-route {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-dasharray: 520;
    stroke-dashoffset: 0;
    filter: drop-shadow(0 0 4px var(--primary));
    animation: scene-route-draw 2.6s ease-in-out both;
}
.scene-stop { fill: var(--primary); animation: scene-green-on 0.3s linear both; }
.scene-stop-1 { animation-delay: 0.6s; }
.scene-stop-2 { animation-delay: 1.2s; }
.scene-stop-3 { animation-delay: 1.8s; }
.scene-stop-4 { animation-delay: 2.4s; }

@keyframes scene-route-draw {
    from { stroke-dashoffset: 520; }
    to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .ark-map-svg *, .season-scene-svg * { animation: none !important; }
}
.system-restored-modal .btn + .btn { margin-left: 8px; }
