:root {
    --bg-0: #0c0414;
    --bg-1: #140726;
    --bg-2: #1d0c38;
    --bg-3: #28114d;
    --accent: #8a2be2;
    --accent-2: #b066ff;
    --accent-soft: rgba(176, 102, 255, 0.18);
    --text: #ece6f5;
    --text-dim: #a094b8;
    --border: rgba(176, 102, 255, 0.25);
    --danger: #ff5f8a;
    --ok: #6fe7a8;
    --radius: 14px;
    --shadow: 0 12px 40px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(1200px 800px at 10% -10%, #2a0f55 0%, transparent 60%),
                radial-gradient(900px 700px at 110% 10%, #3a1670 0%, transparent 55%),
                var(--bg-0);
    color: var(--text);
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    line-height: 1.55;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: #d3a9ff; }

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

/* ---------- Header ---------- */
header.site-header {
    background: linear-gradient(180deg, rgba(20,7,38,0.95), rgba(20,7,38,0.7));
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 16px;
    flex-wrap: wrap;
}
.logo {
    display: flex; align-items: center; gap: 12px;
    font-weight: 700; font-size: 20px; color: var(--text);
}
.logo-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #4a0a8a);
    box-shadow: 0 6px 22px rgba(138,43,226,0.5);
    display: grid; place-items: center;
    font-weight: 800; color: white;
    object-fit: cover;
}
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--text-dim);
    font-weight: 500;
    transition: 0.15s;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text);
    background: var(--accent-soft);
}
.nav .discord-btn {
    background: linear-gradient(135deg, var(--accent), #6a14b8);
    color: white !important;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(138,43,226,0.4);
}

/* ---------- Hero ---------- */
.hero {
    padding: 60px 0 32px;
    text-align: center;
}
.hero h1 {
    font-size: clamp(34px, 5vw, 56px);
    margin: 0 0 12px;
    background: linear-gradient(90deg, #fff, #c79bff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p { color: var(--text-dim); max-width: 700px; margin: 0 auto; font-size: 17px; }

/* ---------- Cards / grids ---------- */
.grid {
    display: grid;
    gap: 18px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
    background: linear-gradient(180deg, rgba(40,17,77,0.65), rgba(20,7,38,0.85));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }
.card h2 {
    font-size: 22px;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}
.muted { color: var(--text-dim); font-size: 14px; }

.stat-pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-weight: 600;
    font-size: 13px;
}

.asset-badge {
    display: inline-flex; align-items: baseline; gap: 10px;
    padding: 18px 24px;
    background: linear-gradient(135deg, rgba(138,43,226,0.25), rgba(74,10,138,0.5));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
}
.asset-badge .num {
    font-size: 30px; font-weight: 800;
    background: linear-gradient(90deg, #fff, #c79bff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.online-chart {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.online-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.online-chart h3 {
    margin: 0 0 4px;
    font-size: 17px;
}
.online-chart-frame {
    display: block;
    width: 100%;
    height: 180px;
    margin-top: 12px;
    background: rgba(12,4,20,0.42);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px 6px;
}
.online-chart-frame[hidden] {
    display: none;
}
.online-chart-canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.online-chart-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 12px;
}
.online-chart-empty {
    margin: 10px 0 0;
}

ul.clean { list-style: none; padding: 0; margin: 0; }
ul.clean li {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}
ul.clean li:last-child { border-bottom: none; }

.mode-row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.mode-row .mode-name { font-weight: 700; }
.mode-row .ip { font-family: ui-monospace, "Cascadia Code", monospace; font-size: 13px; color: var(--accent-2); }
.maps { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.maps span {
    background: rgba(176,102,255,0.12);
    border: 1px solid var(--border);
    padding: 3px 9px; border-radius: 8px; font-size: 12px;
    color: var(--text-dim);
}

.admin-card {
    display: flex; gap: 14px; align-items: center;
    padding: 14px;
    background: rgba(20,7,38,0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #4a0a8a);
    display: grid; place-items: center;
    font-weight: 700; color: white; font-size: 18px;
    flex-shrink: 0;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* ---------- Forms ---------- */
form .field {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 14px;
}
label {
    font-size: 13px; color: var(--text-dim); font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
}
input[type=text], input[type=password], input[type=email],
input[type=number], textarea, select {
    background: rgba(12,4,20,0.7);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    transition: 0.15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 110px; }

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #6a14b8);
    color: white;
    border: none;
    padding: 11px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.15s;
    box-shadow: 0 6px 18px rgba(138,43,226,0.35);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(138,43,226,0.55); }
.btn.ghost {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent-2);
    box-shadow: none;
}
.btn.danger {
    background: rgba(255,95,138,0.12);
    border: 1px solid rgba(255,95,138,0.5);
    color: var(--danger);
    box-shadow: none;
}
.btn.small {
    padding: 7px 12px;
    font-size: 13px;
}
.discord-login {
    width: 100%;
    text-align: center;
    background: #5865f2;
    box-shadow: 0 6px 18px rgba(88,101,242,0.35);
}

/* ---------- Flash ---------- */
.flashes { margin: 16px 0; display: flex; flex-direction: column; gap: 8px; }
.flash {
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(40,17,77,0.7);
}
.flash.success { border-color: rgba(111,231,168,0.4); color: var(--ok); }
.flash.error   { border-color: rgba(255,95,138,0.5);  color: var(--danger); }

/* ---------- Tables ---------- */
.stat-table { width: 100%; border-collapse: collapse; }
.stat-table td {
    padding: 10px 6px;
    border-bottom: 1px dashed var(--border);
}
.stat-table td:first-child { color: var(--text-dim); width: 45%; }

/* ---------- FAQ ---------- */
details.faq {
    background: rgba(20,7,38,0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
}
details.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}
details.faq[open] { background: rgba(40,17,77,0.7); }

/* ---------- Admin collapsible entries ---------- */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.admin-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
    background: rgba(20,7,38,0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
}
.admin-collapse summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.admin-entry-body {
    margin-top: 10px;
}
.admin-delete-form {
    margin: 0;
}
.admin-inline-action {
    margin-top: 10px;
}

/* ---------- Footer ---------- */
footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    text-align: center;
    font-size: 14px;
}

.section { margin: 36px 0; }
.section h2.title {
    font-size: 26px;
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 12px;
}
.section h2.title::before {
    content: ""; width: 6px; height: 26px;
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-radius: 3px;
}

.inline-form {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.inline-form input { flex: 1; min-width: 200px; }

@media (max-width: 640px) {
    .nav-links a { padding: 6px 10px; font-size: 14px; }
    .admin-entry {
        grid-template-columns: 1fr;
    }
    .admin-delete-form .btn {
        width: 100%;
    }
}
