@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&display=swap");
:root {
  --bg: #0a0710; --panel: #181022; --panel2: #221731; --border: #3a2b44; --text: #f0e6d2; --muted: #a8998f;
  --accent: #e3b95a; --accent-d: #c9973d; --danger: #e5645b; --warn: #e3b95a; --info: #e6c97f; --ok: #6fd08c;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --serif: "Cinzel", "Trajan Pro", Georgia, serif;
  --radius: 14px; --side: 232px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: radial-gradient(ellipse at 15% -10%, #2b1d2a 0%, transparent 55%), radial-gradient(ellipse at 90% 10%, #1d1233 0%, transparent 50%), var(--bg); background-attachment: fixed; color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { margin-left: auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* Layout */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 4px 8px 16px; }
.brand .logo { width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #2a7bd6); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
.nav a.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.side .spacer { flex: 1; }
.userbox { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.main { padding: 24px 28px 60px; min-width: 0; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px #0008; }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px 14px 50px; }
}

/* Bausteine */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 14px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 13px; font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--text) 30%, var(--border)); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06130c; }
.btn.primary:hover { background: var(--accent-d); }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; border-radius: 6px; }
.btn.ghost { background: transparent; border-color: transparent; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font: inherit; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); padding: 0; }
textarea { font-family: var(--mono); font-size: 13px; width: 100%; }
label.field { display: flex; flex-direction: column; gap: 4px; font-weight: 550; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--border); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.st-running .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.st-starting .dot, .st-stopping .dot, .st-installing .dot { background: var(--warn); animation: pulse 1s infinite; }
.st-error .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: var(--panel2); border: 1px solid var(--border); color: var(--muted); }
.tag.green { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.tag.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 16px 0 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: color-mix(in srgb, var(--panel2) 60%, transparent); }
.tbl-wrap { overflow-x: auto; }
.bar { height: 6px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.bar.warn > i { background: var(--warn); } .bar.bad > i { background: var(--danger); }
.notice { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2); }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); }
.notice.err { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); background: color-mix(in srgb, var(--danger) 10%, var(--panel)); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* Server-Karten */
.srv-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s, transform .15s; }
.srv-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.srv-card .title { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; }
.stat-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* Konsole */
.console { background: #0a0d12; color: #d6dbe6; font-family: var(--mono); font-size: 12.5px; line-height: 1.45; height: 56vh; min-height: 280px; overflow: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; white-space: pre-wrap; word-break: break-word; }
.console .ln.warn { color: #e6c15a; } .console .ln.err { color: #ff7a72; } .console .ln.panel { color: #6fc3ff; }
.cmdbar { display: flex; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); background: #0a0d12; }
.cmdbar span { padding: 8px 4px 8px 12px; color: var(--accent); font-family: var(--mono); }
.cmdbar input { flex: 1; background: transparent; border: none; border-radius: 0; font-family: var(--mono); outline: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.stat b { display: block; font-size: 18px; }
.stat span { color: var(--muted); font-size: 12px; }

/* Dateien */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-family: var(--mono); font-size: 13px; }
.crumbs a { color: var(--info); cursor: pointer; }
.file-name { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.file-name:hover { color: var(--accent); }
.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }
.editor { width: 100%; height: 62vh; resize: vertical; tab-size: 4; white-space: pre; }

/* Plugin-Markt */
.market { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.plugin { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.plugin img, .plugin .ph { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; background: var(--panel2); display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.plugin .info { min-width: 0; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.plugin .info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plugin .desc { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.switch { position: relative; width: 38px; height: 21px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 99px; cursor: pointer; transition: .15s; }
.switch i::before { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::before { transform: translateX(17px); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.sw-tpl { cursor: pointer; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: var(--panel); }
.sw-tpl:hover { border-color: var(--accent); }
.sw-tpl.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); }

/* Modal & Toast */
.overlay { position: fixed; inset: 0; background: #0009; display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; width: min(640px, 100%); max-height: 90vh; overflow: auto; padding: 20px; box-shadow: 0 20px 60px #0008; }
.modal.wide { width: min(900px, 100%); }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; max-width: 380px; box-shadow: 0 8px 30px #0006; }
.toast.err { border-left-color: var(--danger); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(380px, 100%); }
.login .brand { justify-content: center; font-size: 20px; padding-bottom: 20px; }

/* Aktivitaets-Toasts oben rechts */
.atoasts { position: fixed; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 210; max-width: 360px; }
.atoast { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--info); padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 30px #0007; cursor: pointer; animation: slidein .25s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
/* Charts */
canvas.chart { width: 100%; height: 240px; display: block; }
/* Spieler */
.pgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pcard { display: flex; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; transition: border-color .15s, transform .15s; }
.pcard:hover { border-color: var(--accent); transform: translateY(-1px); }
img.face { border-radius: 6px; image-rendering: pixelated; background: var(--bg); flex: none; }
.inv-wrap { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.armor { display: flex; flex-direction: column; gap: 4px; }
.inv { display: grid; grid-template-columns: repeat(9, 52px); gap: 4px; }
.inv.hot { margin-top: 10px; }
.slot { width: 52px; height: 52px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border); position: relative; display: grid; place-items: center; overflow: hidden; }
.slot.full { cursor: pointer; border-color: #fff3; }
.slot.full:hover { outline: 2px solid var(--danger); }
.slot .nm { font-size: 9.5px; line-height: 1.1; text-align: center; padding: 2px; word-break: break-word; color: #fff; text-shadow: 0 1px 2px #000; }
.slot i { position: absolute; right: 3px; bottom: 1px; font: 700 11px var(--mono); color: #fff; text-shadow: 0 1px 2px #000; }
@media (max-width: 640px) { .inv { grid-template-columns: repeat(9, 34px); } .slot { width: 34px; height: 34px; } .slot .nm { display: none; } }

/* Aetheria-Feinschliff */
h1, h2, .brand, .tabs a, .btn.primary { font-family: var(--serif); }
h1 { letter-spacing: .04em; background: linear-gradient(180deg, #f6dd9b, #d4a24a); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { letter-spacing: .03em; font-weight: 600; }
.card, .stat, .modal, .plugin, .sw-tpl { background: linear-gradient(180deg, color-mix(in srgb, var(--panel2) 70%, transparent), var(--panel)); border-color: color-mix(in srgb, var(--accent) 18%, var(--border)); box-shadow: 0 10px 30px #0006; }
.side { background: linear-gradient(180deg, #140d1d, #0e0916); border-right-color: color-mix(in srgb, var(--accent) 22%, var(--border)); }
.brand .logo { background: linear-gradient(135deg, #f6dd9b, #b8862f); color: #1a1006; }
.nav a.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); box-shadow: inset 2px 0 0 var(--accent); }
.btn { border-radius: 99px; background: color-mix(in srgb, var(--panel2) 80%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, #f2d58a, #c18f3f); border-color: #d4a24a; color: #1a1006; letter-spacing: .06em; text-transform: uppercase; font-size: 12.5px; box-shadow: 0 4px 14px #c18f3f40; }
.btn.primary:hover { background: linear-gradient(135deg, #f8e2a6, #cf9c47); }
.btn.sm { border-radius: 99px; }
.tag.green, .st-running .dot { color: var(--ok); }
.tag.green { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.st-running .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.bar > i { background: linear-gradient(90deg, #c18f3f, #f2d58a); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.srv-card:hover, .pcard:hover, .sw-tpl:hover { border-color: var(--accent); }
.switch input:checked + i { background: var(--accent); }
input, select, textarea { border-radius: 10px; background: #0d0814; }
.console, .cmdbar { background: #07050c; }
.console .ln.panel { color: #e6c97f; }
.cmdbar span { color: var(--accent); }
.login { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); }
