/* ─────────────────────────────────────────────────────────────
   Olymp Panel

   Ein Arbeitsplatz, keine Vitrine: dunkel wie das Spiel, dichte
   Tabellen, der Status in Farbe und Form. Gold ist Olymp; Rot heißt
   gebannt oder Verwarnung, Grün online.
   ───────────────────────────────────────────────────────────── */

@font-face {
    font-family: "Exo 2";
    src: url("Fonts/Exo2.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --ground:   #0d0f13;
    --surface:  #14171d;
    --raised:   #1a1e26;
    --line:     #262b35;
    --text:     #e8ebf1;
    --dim:      #9aa3b2;
    --faint:    #636c7b;
    --gold:     #d8b24a;
    --gold-ink: #1b1403;
    --red:      #e5575f;
    --green:    #4cc38a;
    --blue:     #6ea2ff;
    --discord:  #5865f2;
    --font:     "Exo 2", "Segoe UI", system-ui, sans-serif;
    --mono:     "Cascadia Mono", "Consolas", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
}

[hidden] { display: none !important; }

a { color: var(--blue); }

h1, h2, h3 { margin: 0; text-wrap: balance; }

/* ── Anmeldung ────────────────────────────────────────────── */

.gate {
    display: grid;
    min-height: 100%;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 20% 0%, rgba(216, 178, 74, 0.08), transparent 60%),
        var(--ground);
}

.gate-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(380px, 100%);
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.gate-text { margin: 0; color: var(--dim); }
.gate-note { margin: 0; color: var(--red); min-height: 1em; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: var(--gold);
    color: var(--gold-ink);
    font-weight: 800;
}

/* ── Rahmen ───────────────────────────────────────────────── */

.shell {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    min-height: 100%;
}

.side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100vh;
    padding: 20px 14px;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav a {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--dim);
    font-weight: 600;
    text-decoration: none;
}

.nav a:hover { background: var(--raised); color: var(--text); }
.nav a.is-active { background: rgba(216, 178, 74, 0.12); color: var(--gold); }

.me {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 4px 10px;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.me-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--raised); }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-name { overflow: hidden; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.me-group { font-size: 12px; color: var(--gold); text-transform: capitalize; }
.me .link { grid-column: 1 / -1; justify-self: start; }

.main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    padding: 28px 32px 48px;
}

.head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.head h1 { font-size: 24px; font-weight: 800; }
.head p { margin: 4px 0 0; color: var(--dim); }

/* ── Bausteine ────────────────────────────────────────────── */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--gold);
    color: var(--gold-ink);
    font: 700 13px var(--font);
    text-decoration: none;
    cursor: pointer;
}

.button:hover { filter: brightness(1.08); }
.button--ghost { border-color: var(--line); background: transparent; color: var(--text); }
.button--danger { background: var(--red); color: #fff; }
.button--discord { background: var(--discord); color: #fff; padding: 11px 16px; font-size: 14px; }
.button--small { padding: 4px 10px; font-size: 12px; }

.link {
    padding: 0;
    border: none;
    background: none;
    color: var(--dim);
    font: 600 12px var(--font);
    cursor: pointer;
}

.link:hover { color: var(--text); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.input, select.input, textarea.input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--ground);
    color: var(--text);
    font: 14px var(--font);
}

textarea.input { min-height: 90px; resize: vertical; }

.label { display: flex; flex-direction: column; gap: 6px; color: var(--dim); font-size: 12px; font-weight: 600; }

.card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.card h2 { margin-bottom: 12px; font-size: 15px; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--dim); font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; }
.stat-value.is-red { color: var(--red); }

.pill {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--raised);
    color: var(--dim);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.pill--red { background: rgba(229, 87, 95, 0.16); color: var(--red); }
.pill--green { background: rgba(76, 195, 138, 0.16); color: var(--green); }
.pill--gold { background: rgba(216, 178, 74, 0.16); color: var(--gold); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .input { width: auto; min-width: 240px; flex: 1; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }

.tab {
    padding: 8px 14px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--dim);
    font: 700 13px var(--font);
    cursor: pointer;
}

.tab.is-active { border-bottom-color: var(--gold); color: var(--text); }

.empty { padding: 24px; color: var(--faint); text-align: center; }

/* ── Tabellen ─────────────────────────────────────────────── */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
}

tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
td.mono { font-family: var(--mono); font-size: 12px; color: var(--dim); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .button + .button { margin-left: 6px; }
td .sub { display: block; color: var(--faint); font-size: 12px; }

/* ── Konto ────────────────────────────────────────────────── */

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

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.facts dt { color: var(--faint); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.character { display: flex; flex-direction: column; gap: 12px; }
.character-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.character-head h3 { font-size: 16px; }

.notes { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

.note {
    padding: 10px 12px;
    border-left: 3px solid var(--line);
    border-radius: 0 8px 8px 0;
    background: var(--raised);
}

.note--warning { border-left-color: var(--red); }
.note-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; color: var(--faint); font-size: 12px; }

/* ── Konsole ──────────────────────────────────────────────── */

.console {
    height: 60vh;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #090a0d;
    color: #cfd6e2;
    font: 12px/1.5 var(--mono);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.console .l-error { color: #ff8a8f; }
.console .l-warn { color: #f0c46a; }

/* ── Fenster und Meldung ──────────────────────────────────── */

.modal {
    width: min(460px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
}

.modal::backdrop { background: rgba(0, 0, 0, 0.6); }
.modal-form { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.modal-title { font-size: 17px; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-body p { margin: 0; color: var(--dim); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    max-width: min(420px, calc(100% - 40px));
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--green);
    border-radius: 8px;
    background: var(--raised);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.toast.is-error { border-left-color: var(--red); }

@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .main { padding: 20px 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; }
}

/* ── Server: Verläufe ─────────────────────────────────────── */

.hint { margin: 0 0 12px; color: var(--dim); font-size: 13px; max-width: 80ch; }

.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; max-height: 190px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--faint); font: 11px var(--font); font-variant-numeric: tabular-nums; }
