:root {
    --bg: #000000;
    --green: #00ff41;
    --green-dim: #0a5a1e;
    --green-faint: rgba(0, 255, 65, 0.12);
    --green-border: rgba(0, 255, 65, 0.35);
    --red: #ff3b30;
    --red-faint: rgba(255, 59, 48, 0.12);
    --red-border: rgba(255, 59, 48, 0.5);
    --amber: #ffb100;
    --text: #c8ffd0;
    --text-dim: #4f9a5f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

html, body {
    background: transparent;
    color: var(--text);
    font-family: "Courier New", "Consolas", monospace;
    min-height: 100vh;
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.18) 0px,
        rgba(0, 0, 0, 0.18) 1px,
        transparent 1px,
        transparent 3px
    );
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 24px;
    border-bottom: 1px solid var(--green-border);
    background: rgba(0, 0, 0, 0.6);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--green);
    color: var(--green);
    font-weight: bold;
    box-shadow: 0 0 12px var(--green-faint), inset 0 0 12px var(--green-faint);
    text-shadow: 0 0 8px var(--green);
}

.brand-name {
    font-weight: bold;
    letter-spacing: 0.25em;
    color: var(--green);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.7);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

.hero {
    text-align: center;
    padding: 24px 0 32px;
}

.hero h1 {
    font-size: 1.6rem;
    letter-spacing: 0.08em;
    color: var(--text);
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.25);
}

.accent {
    color: var(--green);
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.6);
}

.subtitle {
    margin-top: 10px;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.card {
    border: 1px solid var(--green-border);
    background: rgba(5, 8, 5, 0.75);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 0 16px rgba(0, 255, 65, 0.05);
}

.card.locked {
    border-color: rgba(200, 255, 208, 0.15);
    box-shadow: none;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.card h2 {
    font-size: 1.05rem;
    letter-spacing: 0.15em;
    color: var(--green);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.card-sub {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.6;
}

.card-sub b {
    color: var(--text);
}

.card-meta {
    color: var(--text-dim);
    font-size: 0.8rem;
    line-height: 1.5;
    min-height: 1.2em;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.actions .btn {
    flex: 1;
    min-width: 110px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid currentColor;
    font-size: 0.62rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    color: var(--text-dim);
    white-space: nowrap;
}

.status-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

.status-online {
    color: var(--green);
}

.status-offline {
    color: var(--red);
}

.status-unknown {
    color: var(--amber);
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    background: transparent;
    line-height: 1.2;
    transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-primary {
    color: #000;
    background: var(--green);
    border: 1px solid var(--green);
    text-shadow: none;
}

.btn-primary:not(:disabled):hover {
    box-shadow: 0 0 18px rgba(0, 255, 65, 0.5);
}

.btn-outline {
    color: var(--green);
    border: 1px solid var(--green);
}

.btn-outline:not(:disabled):hover {
    background: var(--green-faint);
    box-shadow: 0 0 14px rgba(0, 255, 65, 0.25);
}

.btn-danger {
    color: var(--red);
    border: 1px solid var(--red-border);
    background: var(--red-faint);
}

.btn-danger:not(:disabled):hover {
    background: rgba(255, 59, 48, 0.25);
    box-shadow: 0 0 16px rgba(255, 59, 48, 0.35);
}

.btn-ghost {
    color: var(--text-dim);
    border: 1px solid rgba(200, 255, 208, 0.2);
}

.btn-ghost:not(:disabled):hover {
    color: var(--text);
    border-color: rgba(200, 255, 208, 0.5);
}

.footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    line-height: 1.8;
}

.footer a {
    color: var(--green);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    width: min(440px, 100%);
    border: 1px solid var(--red-border);
    background: #050805;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 0 30px rgba(255, 59, 48, 0.2);
}

.modal h3 {
    color: var(--red);
    letter-spacing: 0.1em;
}

.modal p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-countdown strong {
    color: var(--red);
}

.modal-error {
    color: var(--red);
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions .btn {
    flex: 1;
}

.auth-area {
    min-width: 260px;
}

.auth-box {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.auth-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    box-sizing: border-box;
    background: #0a0f0a;
    border: 1px solid rgba(200, 255, 208, 0.2);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0 12px;
}

.auth-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 10px var(--green-faint);
}

.auth-eye {
    height: 44px;
    min-width: 44px;
    padding: 0;
}

.auth-error {
    margin-top: 8px;
    color: var(--red);
    font-size: 0.8rem;
}

.hidden {
    display: none !important;
}

@media (max-width: 700px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 16px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .auth-area {
        flex: 1;
        min-width: 0;
    }

    .btn {
        min-height: 48px;
        font-size: 0.82rem;
    }

    .hero h1 {
        font-size: 1.3rem;
    }
}