:root {
    --bg: #0b0b0f;
    --panel: #15151d;
    --panel-2: #1b1b25;
    --border: #2c2c38;
    --text: #f5f5f7;
    --muted: #9ca3af;
    --primary: #990000;
    --primary-hover: #b30000;
    --accent: #4b4bc8;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: radial-gradient(circle at top, #1a1a25 0, var(--bg) 42%);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.guest-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(21, 21, 29, .94);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 32px;
    box-shadow: 0 30px 90px rgba(0,0,0,.45);
}

.brand {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1px;
}

.brand span { color: var(--primary-hover); }

.subtitle {
    color: var(--muted);
    margin: 8px 0 28px;
}

label {
    display: block;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 8px;
}

input {
    width: 100%;
    background: #09090d;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    padding: 14px;
    outline: none;
    margin-bottom: 18px;
}

input:focus {
    border-color: var(--accent);
}

button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border: 0;
    border-radius: 12px;
    padding: 14px 18px;
    font-weight: 800;
    cursor: pointer;
    width: 100%;
}

button:hover, .btn:hover {
    background: var(--primary-hover);
}

.error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .35);
    color: #fecaca;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #08080c;
    border-right: 1px solid var(--border);
    padding: 24px;
}

.sidebar .brand {
    font-size: 28px;
    margin-bottom: 28px;
}

.nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.nav a:hover {
    background: var(--panel);
    color: var(--text);
}

.main {
    padding: 32px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -1px;
}

.muted { color: var(--muted); }

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.card {
    background: rgba(21, 21, 29, .92);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 16px 50px rgba(0,0,0,.24);
}

.card-title {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.card-value {
    font-size: 28px;
    font-weight: 900;
}

.hero-card {
    margin-top: 18px;
    padding: 28px;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    body {
        background: #0b0b0f;
    }

    .guest-wrap {
        padding: 18px;
        align-items: start;
        padding-top: 56px;
    }

    .login-card {
        max-width: 100%;
        padding: 24px;
        border-radius: 18px;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar .brand {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .nav a {
        white-space: nowrap;
        margin-bottom: 0;
        padding: 10px 12px;
        background: #111118;
    }

    .main {
        padding: 18px;
    }

    .topbar {
        display: block;
        margin-bottom: 18px;
    }

    .topbar .btn {
        margin-top: 14px;
        width: 100% !important;
    }

    h1 {
        font-size: 28px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card {
        padding: 18px;
        border-radius: 16px;
    }

    .hero-card {
        margin-top: 12px;
        padding: 18px;
    }

    input,
    button,
    .btn {
        min-height: 48px;
        font-size: 16px;
    }

    input[type="file"] {
        padding: 18px;
        background: #09090d;
    }

    .card-value {
        font-size: 24px;
    }
}

.screenshot-thumb {
    width: 120px;
    height: 210px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    background: #050508;
}

.screenshot-thumb:hover {
    opacity: .85;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 96vw;
    max-height: 92vh;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: 0 30px 90px rgba(0,0,0,.7);
}

@media (max-width: 700px) {
    .history-row {
        display: block !important;
    }

    .screenshot-thumb {
        width: 100%;
        height: auto;
        max-height: 420px;
        margin-bottom: 16px;
    }
}