/* VT323 by Peter Hull — SIL Open Font License 1.1, see fonts/OFL.txt.
   Self-hosted: the page makes zero third-party requests. */
@font-face {
  font-family: 'VT323'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/VT323-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'VT323'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/VT323-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'VT323'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/VT323-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
            --amber:        #c8a84b;
            --amber-bright: #ffcc66;
            --amber-dim:    #6b5a28;
            --green:        #39ff85;
            --green-dim:    #1a7a3d;
            --red:          #cc3300;
            --red-bright:   #ff4400;
            --bg:           #080705;
            --bg2:          #0f0d09;
            --bg3:          #181410;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            background: var(--bg);
            color: var(--amber);
            font-family: 'VT323', 'Courier New', monospace;
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
        }

        /* Scanlines overlay */
        body::after {
            content: '';
            position: fixed;
            inset: 0;
            background: repeating-linear-gradient(
                0deg,
                transparent,
                transparent 2px,
                rgba(0,0,0,0.13) 2px,
                rgba(0,0,0,0.13) 4px
            );
            pointer-events: none;
            z-index: 9999;
        }

        /* CRT vignette */
        body::before {
            content: '';
            position: fixed;
            inset: 0;
            background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.75) 100%);
            pointer-events: none;
            z-index: 9998;
        }

        /* ── Animations ─────────────────────────────────────────── */
        @keyframes flicker {
            0%,94%,100% { opacity:1; }
            95%          { opacity:.6; }
            96%          { opacity:1; }
            97%          { opacity:.3; }
            98%          { opacity:1; }
        }
        @keyframes flicker-fast {
            0%,88%,100% { opacity:1; }
            89% { opacity:.5; }
            90% { opacity:1; }
            91% { opacity:.2; }
            92% { opacity:1; }
        }
        @keyframes pulse-glow {
            0%,100% { text-shadow: 0 0 8px var(--amber); }
            50%      { text-shadow: 0 0 22px var(--amber-bright), 0 0 40px rgba(200,168,75,.6); }
        }
        @keyframes blink {
            0%,49%  { opacity:1; }
            50%,100%{ opacity:0; }
        }
        @keyframes spin-slow {
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
        }

        /* ── Layout ─────────────────────────────────────────────── */
        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 16px 20px;
        }

        /* ── Header ─────────────────────────────────────────────── */
        .header {
            text-align: center;
            padding: 12px 0 10px;
            border-bottom: 2px solid var(--amber-dim);
            margin-bottom: 18px;
        }
        .header-node {
            font-size: 12px;
            letter-spacing: 5px;
            color: var(--amber-dim);
            margin-bottom: 6px;
        }
        .header-title {
            font-size: 58px;
            letter-spacing: 10px;
            color: var(--amber-bright);
            text-shadow: 0 0 24px var(--amber), 0 0 50px rgba(200,168,75,.3);
            animation: flicker 9s infinite;
            line-height: 1;
        }
        .header-sub {
            font-size: 22px;
            letter-spacing: 5px;
            color: var(--amber-dim);
            margin-top: 4px;
        }

        /* ── Main grid ──────────────────────────────────────────── */
        .main {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 18px;
            margin-bottom: 18px;
        }
        @media (max-width: 860px) {
            .main { grid-template-columns: 1fr; }
            .header-title { font-size: 36px; letter-spacing: 5px; }
        }

        /* ── Image panel ────────────────────────────────────────── */
        .image-panel {
            position: relative;
            border: 2px solid var(--amber-dim);
            overflow: hidden;
            background: #000;
            cursor: pointer;
            user-select: none;
        }
        .image-panel img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            filter: sepia(15%) contrast(1.05);
            transition: filter .3s;
        }
        .image-panel:hover img { filter: sepia(15%) contrast(1.12) brightness(1.08); }

        .corner {
            position: absolute;
            width: 16px; height: 16px;
            border-color: var(--amber);
            border-style: solid;
        }
        .corner.tl { top:6px; left:6px;   border-width:2px 0 0 2px; }
        .corner.tr { top:6px; right:6px;  border-width:2px 2px 0 0; }
        .corner.bl { bottom:6px; left:6px;  border-width:0 0 2px 2px; }
        .corner.br { bottom:6px; right:6px; border-width:0 2px 2px 0; }

        .image-caption {
            position: absolute;
            bottom: 0; left: 0; right: 0;
            background: linear-gradient(transparent, rgba(0,0,0,.85));
            padding: 24px 12px 8px;
            font-size: 12px;
            color: var(--amber-dim);
            letter-spacing: 2px;
        }

        /* ── Right panel ────────────────────────────────────────── */
        .right-panel {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        /* ── Generic panel ──────────────────────────────────────── */
        .panel {
            border: 1px solid var(--amber-dim);
            background: var(--bg2);
        }
        .panel-hdr {
            background: var(--amber-dim);
            color: var(--bg);
            padding: 3px 12px;
            font-size: 15px;
            letter-spacing: 3px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .panel-body { padding: 10px 12px; }

        /* ── Counter ────────────────────────────────────────────── */
        .counter-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            text-align: center;
        }
        .counter-unit {
            background: var(--bg3);
            border: 1px solid var(--amber-dim);
            padding: 8px 4px 6px;
        }
        .counter-num {
            font-size: 40px;
            color: var(--amber-bright);
            text-shadow: 0 0 12px var(--amber);
            display: block;
            line-height: 1;
        }
        .counter-lbl {
            font-size: 11px;
            color: var(--amber-dim);
            letter-spacing: 2px;
        }

        /* ── Status list ────────────────────────────────────────── */
        .status-item {
            display: flex;
            justify-content: space-between;
            font-size: 16px;
            padding: 3px 0;
            border-bottom: 1px solid rgba(107,90,40,.25);
        }
        .status-item:last-child { border: none; }
        .s-label { color: var(--amber-dim); }
        .s-ok   { color: #44ff88; }
        .s-warn { color: #ffaa00; animation: pulse-glow 2.5s infinite; }
        .s-crit { color: var(--red-bright); animation: flicker-fast 3.5s infinite; }

        /* ── Progress bar ───────────────────────────────────────── */
        .prog-meta {
            display: flex;
            justify-content: space-between;
            font-size: 14px;
            color: var(--amber-dim);
            margin-bottom: 4px;
        }
        .prog-track {
            height: 18px;
            background: rgba(107,90,40,.25);
            border: 1px solid var(--amber-dim);
            overflow: hidden;
        }
        .prog-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--amber-dim), var(--amber));
            transition: width .6s ease;
            position: relative;
        }
        .prog-fill::after {
            content: '';
            position: absolute;
            inset: 0;
            background: repeating-linear-gradient(
                90deg, transparent, transparent 8px,
                rgba(0,0,0,.2) 8px, rgba(0,0,0,.2) 10px
            );
        }
        .prog-note {
            font-size: 13px;
            color: var(--amber-dim);
            margin-top: 5px;
        }

        /* ── Radio button ───────────────────────────────────────── */
        .radio-btn {
            cursor: pointer;
            font-size: 13px;
            letter-spacing: 2px;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .radio-dot {
            width: 8px; height: 8px;
            border-radius: 50%;
            background: var(--amber-dim);
            display: inline-block;
            flex-shrink: 0;
        }
        .radio-dot.on {
            background: var(--red-bright);
            box-shadow: 0 0 6px var(--red-bright);
            animation: blink 1s infinite;
        }

        /* ── Terminal ───────────────────────────────────────────── */
        .terminal {
            border: 1px solid var(--green-dim);
            background: #020804;
            display: flex;
            flex-direction: column;
            flex: 1;
        }
        .term-hdr {
            background: var(--green-dim);
            color: #020804;
            padding: 3px 12px;
            font-size: 14px;
            letter-spacing: 3px;
            display: flex;
            justify-content: space-between;
        }
        .term-out {
            padding: 10px;
            overflow-y: auto;
            min-height: 220px;
            max-height: 280px;
            font-size: 17px;
            color: var(--green);
            text-shadow: 0 0 6px rgba(57,255,133,.4);
            line-height: 1.4;
        }
        .term-out .l       { }
        .term-out .l-prompt{ color: #44aa66; }
        .term-out .l-res   { color: var(--green); }
        .term-out .l-warn  { color: #ffaa00; }
        .term-out .l-err   { color: var(--red-bright); }
        .term-out .l-dim   { color: #2a6640; }

        .term-input-row {
            display: flex;
            align-items: center;
            padding: 6px 10px;
            border-top: 1px solid var(--green-dim);
            gap: 8px;
        }
        .term-sym {
            color: var(--green);
            font-size: 18px;
            white-space: nowrap;
        }
        .term-input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: var(--green);
            font-family: 'VT323', monospace;
            font-size: 18px;
            caret-color: var(--green);
            text-shadow: 0 0 5px rgba(57,255,133,.5);
        }

        /* ── Footer ─────────────────────────────────────────────── */
        .footer {
            text-align: center;
            padding: 10px;
            border-top: 1px solid var(--amber-dim);
            font-size: 14px;
            color: var(--amber-dim);
            letter-spacing: 2px;
        }

        /* ── Alert flash ────────────────────────────────────────── */
        #alertFlash {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 9997;
            opacity: 0;
            transition: opacity .08s;
        }
        #alertFlash.on { opacity: 1; }

        /* ── Scrollbar ──────────────────────────────────────────── */
        .term-out::-webkit-scrollbar { width: 5px; }
        .term-out::-webkit-scrollbar-track { background: #010302; }
        .term-out::-webkit-scrollbar-thumb { background: var(--green-dim); }

/* moved out of inline style="" attributes so the page needs no
   'unsafe-inline' in style-src */
.prog-fill { width: 94%; }
.cursor    { animation: blink 1s infinite; display: inline-block; }
