/* MEITCRAFT Admin – dunkles Theme, lokal ausgeliefert (keine externen Ressourcen) */
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Press Start 2P"; src: url("/fonts/pressstart2p-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #050a1f; --bg-2: #081235; --bg-3: #030717; --panel: #0b1a52; --panel-2: #0e2266; --line: #2a4fb0;
  --text: #eaf4ff; --text-2: #b7cdf0; --muted: #8fa9d4;
  --blue: #2f8bff; --cyan: #37e0ff; --ice: #b8f4ff; --deep: #1237c8;
  --amber: #ffb340; --ok: #4dff9a; --danger: #ff5a6e;
  --surface: rgba(11, 26, 82, .55); --surface-2: rgba(14, 34, 102, .6); --border: rgba(55, 224, 255, .18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --pixel: "Press Start 2P", "Courier New", monospace; --mono: ui-monospace, Menlo, Consolas, monospace;
  --nav-w: 210px; --top-h: 56px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: radial-gradient(1200px 600px at 80% -10%, #0c2170 0%, transparent 60%), var(--bg); min-height: 100vh; }
a { color: var(--cyan); }
h1 { font-size: 1.5rem; margin: 0; } h2 { font-size: 1.1rem; margin: 1.4rem 0 .6rem; } h3 { font-size: .95rem; margin: 1.2rem 0 .4rem; color: var(--text-2); }
.muted { color: var(--muted); } .small { font-size: .8rem; } .mono { font-family: var(--mono); } .nowrap { white-space: nowrap; } .wrap { word-break: break-word; max-width: 320px; } .block { display: block; }
.num { text-align: right; font-variant-numeric: tabular-nums; } .ok { color: var(--ok); } .warn { color: var(--amber); } .bad { color: var(--danger); }
.skip { position: absolute; left: -999px; top: 0; background: var(--cyan); color: #00131a; padding: 8px 12px; z-index: 100; } .skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.brand { font-family: var(--pixel); font-size: .8rem; letter-spacing: .04em; color: var(--ice); } .brand span { color: var(--cyan); }
.tag { font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: rgba(3, 7, 23, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: var(--text-2); font-size: .85rem; }
.shell { display: flex; min-height: calc(100vh - var(--top-h)); }
.nav { width: var(--nav-w); flex: none; padding: 14px 10px; border-right: 1px solid var(--border); background: rgba(3, 7, 23, .5); position: sticky; top: var(--top-h); align-self: flex-start; height: calc(100vh - var(--top-h)); }
.nav a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; margin-bottom: 2px; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(55, 224, 255, .18), rgba(47, 139, 255, .08)); color: var(--cyan); box-shadow: inset 3px 0 0 var(--cyan); }
.ico { width: 1.2em; text-align: center; }
main { flex: 1; min-width: 0; padding: 20px clamp(14px, 3vw, 32px) 60px; outline: none; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; } .page-head > :last-child:not(h1) { margin-left: auto; }
.menu-btn { display: none; }

/* Bedienelemente */
.btn { font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 8px 14px; border-radius: 8px; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover:not(:disabled) { border-color: var(--cyan); background: rgba(55, 224, 255, .12); } .btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(100deg, var(--cyan), var(--blue)); color: #00131a; border-color: transparent; } .btn.primary:hover:not(:disabled) { filter: brightness(1.1); background: linear-gradient(100deg, var(--cyan), var(--blue)); }
.btn.danger { border-color: rgba(255, 90, 110, .6); color: #ffc2ca; } .btn.danger:hover:not(:disabled) { background: rgba(255, 90, 110, .18); border-color: var(--danger); }
.btn.ghost { background: transparent; } .btn.small { padding: 5px 10px; font-size: .85rem; } .btn.block { width: 100%; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; color: var(--text); font-size: 1.4rem; cursor: pointer; padding: 4px 8px; border-radius: 6px; } .icon-btn:hover { background: var(--surface); }
input, select, textarea { font: inherit; color: var(--text); background: rgba(3, 7, 23, .75); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(55, 224, 255, .2); }
input[type=checkbox] { width: 16px; height: 16px; padding: 0; accent-color: var(--cyan); }
select option { background: var(--bg-2); }
label { display: flex; flex-direction: column; gap: 4px; color: var(--text-2); font-size: .85rem; } label.check { flex-direction: row; align-items: center; gap: 6px; }
.grow { flex: 1; min-width: 160px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; } .row-actions { display: flex; gap: 8px; }
.form-error { color: #ffc2ca; background: rgba(255, 90, 110, .12); border: 1px solid rgba(255, 90, 110, .4); border-radius: 8px; padding: 8px 10px; margin: 0; }

/* Karten, KPI */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.grid { display: grid; gap: 14px; } .cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } .two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kpis { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 18px; display: flex; flex-direction: column; min-width: 140px; } .kpi strong { font-size: 1.7rem; color: var(--cyan); line-height: 1.2; }
.card.server { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; } .card.server:hover { border-color: var(--cyan); transform: translateY(-2px); }
.card.is-off { opacity: .85; border-style: dashed; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .card-head .sid { margin-left: auto; font-size: .75rem; font-family: var(--mono); }
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; background: var(--danger); box-shadow: 0 0 8px currentColor; color: var(--danger); }
.dot.on { background: var(--ok); color: var(--ok); } .dot.crashed { background: var(--amber); color: var(--amber); } .dot.stopped { background: var(--muted); color: transparent; }
.big { font-size: 2rem; font-weight: 700; color: var(--ice); line-height: 1.1; margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0 0 10px; } .stats div, .kv div { display: flex; flex-direction: column; } .stats dt, .kv dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); } .stats dd, .kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.bar { height: 6px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; margin-top: 4px; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.offline-msg { padding: 10px 0; color: #ffc2ca; }
.badge { font-size: .68rem; border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; color: var(--ice); background: rgba(55, 224, 255, .1); margin-left: 4px; white-space: nowrap; } .badge.op { color: var(--amber); border-color: rgba(255, 179, 64, .5); background: rgba(255, 179, 64, .1); }
.pill { font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; } .pill.ok { color: var(--ok); } .pill.bad { color: var(--danger); }
.chart-card { padding: 10px; } .chart { width: 100%; height: auto; display: block; } .chart .grid { stroke: rgba(255, 255, 255, .08); } .chart .axis { fill: var(--muted); font-size: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .85rem; color: var(--text-2); } .lg { display: inline-flex; align-items: center; gap: 6px; } .sw { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }

/* Tabellen */
.tbl-wrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { position: sticky; top: 0; z-index: 2; background: #0a1747; text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: middle; }
.tbl tbody tr:hover { background: rgba(55, 224, 255, .07); } .tbl.players tbody tr { cursor: pointer; } .tbl tbody tr.sel { background: rgba(55, 224, 255, .15); } .tbl tr.vanished td { opacity: .6; }
.tbl td.empty, .empty { text-align: center; color: var(--muted); padding: 30px; }
.tbl td.name { display: flex; align-items: center; gap: 8px; font-weight: 600; } .tbl td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.th-btn { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; } .th-btn:focus-visible { outline: 2px solid var(--cyan); }
th[aria-sort="ascending"] .arrow::after { content: "▲"; font-size: .6rem; color: var(--cyan); } th[aria-sort="descending"] .arrow::after { content: "▼"; font-size: .6rem; color: var(--cyan); }
.pager { display: flex; gap: 8px; margin-top: 12px; }
.avatar { width: 24px; height: 24px; border-radius: 4px; image-rendering: pixelated; flex: none; background: var(--panel); }
.avatar.fallback { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .75rem; color: #00131a; background: linear-gradient(135deg, var(--ice), var(--blue)); }
.panel-head .avatar { width: 48px; height: 48px; font-size: 1.2rem; }

/* Spieler-Panel */
.split { display: flex; gap: 16px; align-items: flex-start; } .split .tbl-wrap { flex: 1; min-width: 0; }
.panel { width: 340px; flex: none; position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; background: var(--surface-2); border: 1px solid var(--cyan); border-radius: 12px; padding: 16px; }
.panel-close { float: right; } .panel-head { display: flex; gap: 12px; align-items: center; } .panel-head h2 { margin: 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 10px 0; } .btn-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* Logs, Konsole */
.log { background: #02050f; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; height: 55vh; overflow: auto; font: 12px/1.5 var(--mono); margin: 0; white-space: pre-wrap; word-break: break-all; }
.l-err { color: #ff8b9a; } .l-warn { color: var(--amber); }
.console { display: flex; gap: 8px; align-items: center; } .prompt { color: var(--cyan); font-family: var(--mono); } .console-out { margin-top: 8px; font-family: var(--mono); white-space: pre-wrap; }
.secret { font-family: var(--mono); font-size: 1.1rem; background: rgba(3, 7, 23, .8); padding: 6px 10px; border-radius: 6px; letter-spacing: .08em; user-select: all; }

/* Live, Toasts, Dialog */
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); } .live .dot { width: 8px; height: 8px; background: var(--amber); color: var(--amber); }
.live[data-state="live"] .dot { background: var(--ok); color: var(--ok); } .live[data-state="offline"] .dot { background: var(--danger); color: var(--danger); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: #0b1a52; border: 1px solid var(--ok); box-shadow: 0 8px 30px rgba(0, 0, 0, .5); animation: in .2s ease-out; }
.toast.err { border-color: var(--danger); } .toast.warn { border-color: var(--amber); } .toast span { flex: 1; } .toast-x { background: none; border: 0; color: var(--text); font-size: 1.2rem; cursor: pointer; line-height: 1; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
.dialog { background: #0a1747; color: var(--text); border: 1px solid var(--cyan); border-radius: 14px; padding: 20px; width: min(460px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .7); }
.dialog::backdrop { background: rgba(2, 5, 15, .7); backdrop-filter: blur(3px); }
.dlg-form { display: flex; flex-direction: column; gap: 12px; } .dlg-form h2 { margin: 0; } .dlg-body p { margin: 0; color: var(--text-2); } .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* Anmeldung */
.login-body { display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 28px; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.center { text-align: center; } #reg-form { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-top: 18px; } #reg-form > div { display: flex; flex-direction: column; gap: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; margin-top: 18px; } .login-card .brand { font-size: 1.1rem; margin: 10px 0 2px; } .login-card p { margin: 0; }

.step-title { margin: 0; font-size: 1.05rem; } .code-input { text-align: center; font: 700 1.8rem/1.2 var(--mono); letter-spacing: .4em; padding-left: calc(10px + .4em); }


/* Tabs im Spieler-Panel, Inventar */
.panel.wide { width: min(480px, 100%); }
.panel-title { display: flex; gap: 12px; align-items: center; } .panel-title h2 { margin: 0; }
.panel-title .avatar { width: 48px; height: 48px; font-size: 1.2rem; }
.tabs { display: flex; gap: 4px; margin: 12px 0; border-bottom: 1px solid var(--border); }
.tab { font: inherit; font-weight: 600; background: none; border: 0; color: var(--text-2); padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); } .tab[aria-selected="true"] { color: var(--cyan); border-bottom-color: var(--cyan); }
.inv .filters { margin-bottom: 6px; } .inv-meta { margin-bottom: 8px; }
.grid9 { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.hotbar { margin-top: 4px; } .hotbar-label { margin: 8px 0 2px; }
.inv-top { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.armor { display: grid; grid-template-columns: repeat(4, 38px); gap: 3px; } .offhand { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 38px; }
.slot { position: relative; aspect-ratio: 1; min-width: 0; width: 100%; padding: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: 4px; cursor: pointer; color: #fff; font: inherit; }
.armor .slot, .offhand .slot { width: 38px; height: 38px; aspect-ratio: auto; }
.slot.empty { background: rgba(3, 7, 23, .75); border-style: dashed; border-color: rgba(255, 255, 255, .12); cursor: default; }
.slot .ic { display: flex; align-items: center; justify-content: center; height: 100%; font: 700 .72rem/1 var(--mono); text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.slot .qty { position: absolute; right: 2px; bottom: 1px; font: 700 .65rem/1 var(--mono); text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.slot.ench { border-color: #b57cff; box-shadow: 0 0 6px 1px rgba(181, 124, 255, .75), inset 0 0 6px rgba(181, 124, 255, .45); }
.slot.selected { outline: 2px solid var(--amber); outline-offset: 1px; }
.slot.hit { outline: 2px solid var(--cyan); outline-offset: 1px; box-shadow: 0 0 10px var(--cyan); } .slot.dim { opacity: .3; }
.slot:focus-visible { outline: 2px solid var(--cyan); }
.inv-detail { margin-top: 10px; min-height: 64px; background: rgba(3, 7, 23, .6); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.idetail .iname { font-weight: 700; color: var(--ice); } .ilist { margin: 4px 0; padding-left: 18px; color: #d9b8ff; } .ilore { margin: 4px 0; color: var(--text-2); font-size: .85rem; font-style: italic; }
.ibook, .ishulker { margin-top: 6px; } .ipage { margin: 4px 0; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
.mini-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; margin: 6px 0; } .sub-detail { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.perm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; } .perm-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.perm-list .on .perm-mark { color: var(--ok); } .perm-list .off .perm-mark { color: var(--danger); } .perm-list .off { opacity: .65; } .perm-mark { width: 1.2em; font-weight: 700; }
.link-btn { all: unset; color: var(--cyan); cursor: pointer; text-decoration: underline; } .link-btn:focus-visible { outline: 2px solid var(--cyan); }

@media (max-width: 860px) {
  .menu-btn { display: inline-block; } .who, .tag { display: none; }
  .nav { position: fixed; top: var(--top-h); left: 0; bottom: 0; z-index: 25; transform: translateX(-100%); transition: transform .2s; background: #050a22; height: auto; box-shadow: 8px 0 30px rgba(0, 0, 0, .5); } .nav.open { transform: none; }
  .split { flex-direction: column; } .panel { width: 100%; position: static; max-height: none; order: -1; }
  .tbl-wrap { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.qr-wrap { background: #fff; padding: 6px; border-radius: 8px; width: 200px; max-width: 100%; } .qr { display: block; width: 100%; height: auto; }
.recovery { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; } .recovery code { font: 600 1rem var(--mono); background: rgba(3, 7, 23, .8); padding: 4px 8px; border-radius: 6px; display: block; text-align: center; user-select: all; }
