@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
    color-scheme: dark;
    --bg: #0e1211;
    --bg-deep: #0e1211;
    --bg-panel: #151a18;
    --bg-recess: #0a0d0c;
    --bg-input: #0a0d0c;
    --bg-input-focus: #1c2421;
    --bg-hover: #1c2421;
    --ink: #c5cecb;
    --ink-bright: #e8eeec;
    --muted: #7a8884;
    --line: #445652;
    --line-soft: #2f3c38;
    --accent: #5bc8c8;
    --accent-bright: #7adede;
    --accent-dim: rgba(91, 200, 200, 0.22);
    --accent-soft: rgba(91, 200, 200, 0.12);
    --accent-glow: rgba(91, 200, 200, 0.3);
    --sage: #536f62;
    --sage-hot: #648575;
    --mustard: #766839;
    --mustard-text: #c4a35a;
    --danger: #844b4b;
    --danger-hot: #9a5a5a;
    --ok: #536f62;
    --green: #648575;
    --warn: #c4a35a;
    --grey-btn: #1c2421;
    --grey-btn-hover: #24302c;
    --border: var(--line);
    --text: var(--ink);
    --text-muted: var(--muted);
    --text-dim: #5c6a66;
    --radius: 0;
    --radius-sm: 0;
    --font-display: "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", Consolas, monospace;
    --font: var(--font-body);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100vh;
}

body {
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.5;
    background-color: var(--bg);
    background-image:
        linear-gradient(180deg, rgba(67, 86, 82, 0.08), transparent 28%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 3px
        );
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

.container { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
main.container { flex: 1; padding: 1.25rem 0 2rem; }

/* ── Header ──────────────────────────────────────────── */

.site-header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    padding: 0 1.25rem;
    min-height: 52px;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0;
    flex-wrap: nowrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    line-height: 1;
    text-decoration: none;
    color: var(--ink-bright);
}

.brand:hover { color: var(--ink-bright); }

.brand-logo {
    display: block;
    height: 28px !important;
    width: auto !important;
    max-height: 28px !important;
    max-width: 42px !important;
    object-fit: contain;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.brand-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-bright);
    line-height: 1.1;
}

.brand-brackets {
    color: var(--accent);
    font-weight: 700;
}

.brand-plaque {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.12rem 0.45rem;
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-bright);
    background: var(--bg-recess);
    border: 1px solid var(--line);
    width: fit-content;
}

.brand-plaque-rivet {
    width: 5px;
    height: 5px;
    background: var(--accent);
    flex: 0 0 auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.header-api-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--line);
    background: var(--bg-recess);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    user-select: none;
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--muted);
}

.header-api-status .api-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 0;
    background: var(--muted);
    flex-shrink: 0;
}

.header-api-status.online {
    border-color: var(--sage);
    color: var(--accent);
    background: rgba(91, 200, 200, 0.06);
}

.header-api-status.online .api-status-indicator {
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(91, 200, 200, 0.4);
    animation: queue-pulse 1.4s ease infinite;
}

.header-api-status.offline {
    border-color: var(--danger);
    color: #d08080;
    background: rgba(132, 75, 75, 0.12);
}

.header-api-status.offline .api-status-indicator {
    background: var(--danger-hot);
}

@keyframes queue-pulse {
    0% { box-shadow: 0 0 0 0 rgba(91, 200, 200, 0.4); }
    70% { box-shadow: 0 0 0 7px rgba(91, 200, 200, 0); }
    100% { box-shadow: 0 0 0 0 rgba(91, 200, 200, 0); }
}

/* ── Panels ──────────────────────────────────────────── */

.panel {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem;
    margin-bottom: 1rem;
    animation: rise 0.3s ease both;
}

.panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--sage);
    opacity: 0.85;
}

.panel h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-bright);
}

.subtitle { color: var(--muted); font-size: 0.85rem; margin: 0 0 1rem; line-height: 1.55; }

.stat-value {
    margin: 0.25rem 0 0.5rem;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
}

/* ── Buttons ─────────────────────────────────────────── */

.btn, button.btn {
    appearance: none;
    border: 0;
    background: var(--sage);
    color: var(--ink-bright);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: background 0.12s ease;
}

.btn:hover, button.btn:hover {
    background: var(--sage-hot);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-recess);
    border: 1px solid var(--line);
    color: var(--ink);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--sage-hot);
    color: var(--ink-bright);
}

.btn-steam,
.btn-discord {
    background: var(--mustard);
    border: 0;
    color: var(--ink-bright);
}

.btn-steam:hover,
.btn-discord:hover {
    background: #8a7a42;
    color: #fff;
}

.btn-report:disabled,
.btn-retry:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-ok { color: var(--accent); }
.status-bad { color: #d08080; }
.status-muted { color: var(--muted); }
.status-warn { color: var(--mustard-text); }

/* ── Login / disclaimer ──────────────────────────────── */

.login-shell {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

main.container:has(.login-shell),
main.container:has(.disclaimer-shell) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 1.5rem 1rem 2rem;
}

main.container:has(.login-shell) .login-alert,
main.container:has(.disclaimer-shell) .disclaimer-alert {
    width: 100%;
    max-width: 420px;
    margin-bottom: 0.75rem;
}

main.container:has(.disclaimer-shell) .disclaimer-alert {
    max-width: 560px;
}

.login-hero {
    position: relative;
    margin-bottom: 1rem;
    padding: 1.35rem 1.15rem 1.2rem;
    text-align: center;
    border: 1px solid var(--line);
    background: var(--bg-panel);
    animation: rise 0.35s ease both;
}

.login-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--sage);
    opacity: 0.85;
}

.hero-slashes {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
}

.hero-slashes span {
    width: 18px;
    height: 3px;
    background: var(--sage);
    animation: slash-in 0.3s ease both;
}

.hero-slashes span:nth-child(2) { animation-delay: 0.06s; }
.hero-slashes span:nth-child(3) { animation-delay: 0.12s; }

.login-brand {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-bright);
}

.login-plaque {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.85rem auto 0.65rem;
    padding: 0.4rem 1rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-bright);
    background: var(--bg-recess);
    border: 1px solid var(--line);
}

.login-plaque-rivet {
    width: 6px;
    height: 6px;
    background: var(--accent);
    flex: 0 0 auto;
}

.hero-hazard {
    display: flex;
    justify-content: center;
    margin-top: 0.25rem;
}

.hero-hazard span {
    width: 64px;
    height: 4px;
    background: var(--sage);
}

.login-panel {
    width: 100%;
    margin: 0;
    text-align: center;
}

.login-notice {
    margin: 0 0 1.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.65;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-panel .btn-steam,
.login-panel .btn-discord {
    width: 100%;
    text-align: center;
    padding: 0.7rem 1.1rem;
    font-size: 0.9rem;
}

.disclaimer-shell { max-width: 560px; }
.disclaimer-panel { text-align: left; }

.disclaimer-panel h2 {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--ink-bright);
}

.disclaimer-copy {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.disclaimer-copy p { margin: 0 0 0.85rem; }
.disclaimer-copy p:last-child { margin-bottom: 0; }

.disclaimer-check {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    background: var(--bg-recess);
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--ink);
    cursor: pointer;
}

.disclaimer-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.disclaimer-check span { flex: 1; }

/* ── Forms / tables ──────────────────────────────────── */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    background: var(--bg-input);
    color: var(--ink-bright);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: var(--radius);
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-input-focus);
    box-shadow: inset 0 0 0 1px rgba(91, 200, 200, 0.2);
}

select {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--accent) 50%),
        linear-gradient(135deg, var(--accent) 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 2px),
        calc(100% - 10px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 1.85rem;
}

.dropzone {
    border: 1px solid var(--line);
    background: var(--bg-recess);
    padding: 1.35rem 0.9rem;
    text-align: center;
    color: var(--muted);
    cursor: pointer;
    transition: border-color 0.12s ease, background 0.12s ease;
    border-radius: var(--radius);
}

.dropzone:hover { border-color: var(--sage-hot); background: var(--bg-hover); }

.dropzone.dragover {
    border-color: var(--accent);
    background: rgba(91, 200, 200, 0.08);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

table.data-table th,
table.data-table td {
    border-bottom: 1px solid var(--line-soft);
    padding: 0.55rem 0.4rem;
    text-align: left;
}

table.data-table th {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: var(--bg-panel);
    padding: 0.75rem 1.25rem;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    height: 18px;
    width: auto;
    display: block;
    object-fit: contain;
    opacity: 0.85;
}

.footer-zoom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.72rem;
}

.footer-zoom input[type="range"] {
    width: 100px;
    accent-color: var(--accent);
}

.job-actions-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.job-actions-inner .subtitle { margin: 0; }

.alert {
    border: 1px solid var(--line);
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    background: var(--bg-recess);
}

.alert-error { border-color: var(--danger); color: #d08080; }
.alert-success { border-color: var(--sage); color: var(--accent); }

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 0;
    border: 1px solid var(--line);
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.upload-progress { margin-top: 1rem; display: none; }
.upload-progress.active { display: block; }

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--bg-recess);
    border: 1px solid var(--line);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.15s ease;
}

.progress-label {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sysconfig-form label.subtitle {
    display: block;
    margin-top: 0.85rem;
    margin-bottom: 0.25rem;
}

.sysconfig-form input[type="text"],
.sysconfig-form input[type="url"],
.sysconfig-form input[type="password"],
.sysconfig-form input[type="number"],
.sysconfig-form select {
    margin-bottom: 0.25rem;
}

.sysconfig-section {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slash-in {
    from { opacity: 0; transform: scaleX(0.2); }
    to { opacity: 1; transform: scaleX(1); }
}

@media (max-width: 640px) {
    .brand-lockup { display: none; }
    .header-actions { gap: 0.35rem; }
    .btn, button.btn { padding: 0.45rem 0.65rem; font-size: 0.7rem; }
}

/* ── Floating processing queue ───────────────────────── */

.queue-status {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    width: min(280px, calc(100vw - 2rem));
    padding: 0.8rem 0.9rem 0.9rem;
    border: 1px solid var(--line);
    background: rgba(21, 26, 24, 0.97);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    font-size: 0.88rem;
    animation: rise 0.3s ease both;
}

.queue-status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
}

.queue-status-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-bright);
    line-height: 1;
    font-weight: 700;
}

.queue-dot {
    width: 8px;
    height: 8px;
    border-radius: 0;
    background: var(--muted);
    flex-shrink: 0;
}

.queue-dot.busy {
    background: var(--accent);
    animation: queue-pulse 1.4s ease infinite;
}

.queue-dot.idle { background: var(--sage); }

.queue-status-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.3rem;
    margin: 0 0 0.5rem;
}

.queue-status-stats > div {
    text-align: center;
    background: var(--bg-recess);
    border: 1px solid var(--line-soft);
    padding: 0.35rem 0.2rem;
}

.queue-status-stats dt {
    margin: 0;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.queue-status-stats dd {
    margin: 0.15rem 0 0;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    line-height: 1;
    color: var(--ink-bright);
    font-weight: 600;
}

.queue-current {
    margin: 0 0 0.45rem;
    font-size: 0.82rem;
    color: var(--ink);
    line-height: 1.3;
}

.queue-current.muted { color: var(--muted); }

.queue-progress { margin: 0 0 0.55rem; }
.queue-progress.hidden,
.queue-mine.hidden,
.hidden { display: none; }

.queue-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
    color: var(--ink);
}

.queue-progress-track {
    height: 6px;
    border: 1px solid var(--line);
    background: var(--bg-recess);
    overflow: hidden;
}

.queue-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.35s ease;
}

.queue-mine {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.queue-mine-pos {
    margin: 0 0 0.2rem;
    font-size: 0.85rem;
}

.queue-mine-pos strong {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1rem;
}

.queue-mine-status {
    margin: 0 0 0.35rem;
    color: var(--ink);
    line-height: 1.35;
    font-size: 0.82rem;
}

.queue-warn {
    margin: 0;
    color: var(--mustard-text);
    font-size: 0.72rem;
    line-height: 1.35;
}

@media (max-width: 640px) {
    .queue-status {
        right: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
    main.container { padding-bottom: 12rem; }
}
