:root {
  --bg: #0d1013;
  --bg2: #12161b;
  --card: #171c22;
  --card2: #1d232b;
  --line: #262e38;
  --text: #e8edf2;
  --muted: #8b97a5;
  --accent: #84e05a;
  --accent2: #4fa83a;
  --accent-ink: #0d1a07;
  --warn: #f2b84b;
  --danger: #f0605a;
  --info: #5ab4f0;
  --radius: 14px;
  --font: 'Inter', system-ui, sans-serif;
  --head: 'Space Grotesk', 'Inter', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, rgba(132,224,90,.07), transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, rgba(90,180,240,.05), transparent 60%);
  color: var(--text); font: 15px/1.5 var(--font);
}
.hidden { display: none !important; }
h1, h2 { font-family: var(--head); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 17px; }
code { font-family: var(--mono); background: var(--card2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; } .tiny { font-size: 11px; }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .wrap { flex-wrap: wrap; }
.error { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; }
.link { font-size: 13px; }

/* Marke */
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 700; font-size: 19px; }
.brand.big { font-size: 26px; justify-content: center; margin-bottom: 8px; }
.cube { width: 28px; height: 28px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 2 29 9v14L16 30 3 23V9z' fill='%2384e05a'/%3E%3Cpath d='M16 16 29 9v14L16 30z' fill='%234fa83a'/%3E%3Cpath d='M16 16 3 9v14l13 7z' fill='%236bc649'/%3E%3C/svg%3E") center/contain no-repeat; }
.brand.big .cube { width: 40px; height: 40px; }

/* Buttons */
.btn {
  font: 600 14px var(--font); color: var(--text); background: var(--card2); border: 1px solid var(--line);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; transition: .15s; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: #3a4552; background: #232a33; }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(1); }
.btn.primary, .btn.start { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, .btn.start:hover { background: #95ea6c; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: rgba(240,96,90,.12); border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.iconbtn { background: none; border: 0; color: var(--text); cursor: pointer; font-size: 18px; padding: 6px; }

/* Formulare */
input, select, textarea {
  font: 14px var(--font); color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(132,224,90,.15); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span2 { grid-column: span 2; }
.toggles { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 6px 0 14px; }
.switch { flex-direction: row; align-items: center; gap: 10px; cursor: pointer; color: var(--text); font-size: 14px; }
.switch input { display: none; }
.switch span { width: 38px; height: 22px; border-radius: 22px; background: #2b3440; position: relative; transition: .2s; flex: none; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #cfd6de; transition: .2s; }
.switch input:checked + span { background: var(--accent2); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.check { flex-direction: row; align-items: center; gap: 6px; color: var(--muted); }
.check input { width: auto; }
input[type=range] { padding: 0; accent-color: var(--accent); border: 0; background: none; margin: 10px 0; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-card form { text-align: left; display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }

/* Layout */
.app { display: flex; min-height: 100%; }
.sidebar {
  width: 250px; flex: none; background: var(--bg2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 0 8px 22px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar nav a { color: var(--muted); padding: 10px 12px; border-radius: 10px; display: flex; align-items: center; gap: 12px; font-weight: 500; transition: .15s; }
.sidebar nav a:hover { color: var(--text); background: var(--card); }
.sidebar nav a.active { color: var(--text); background: var(--card2); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.main { flex: 1; min-width: 0; padding: 0 28px 40px; }
.scrim { display: none; }

/* Icons (reine CSS-Masken) */
.ico { width: 18px; height: 18px; background: currentColor; flex: none; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; }
.ico-home { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21H3z'/%3E%3Cpath d='M9 21v-7h6v7'/%3E%3C/svg%3E"); }
.ico-term { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='m7 9 3 3-3 3M13 15h4'/%3E%3C/svg%3E"); }
.ico-box { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 2 21 7v10l-9 5-9-5V7z'/%3E%3Cpath d='M3 7l9 5 9-5M12 12v10'/%3E%3C/svg%3E"); }
.ico-sliders { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='10' cy='12' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E"); }
.ico-users { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8' r='4'/%3E%3Cpath d='M2 21c0-4 3-6 7-6s7 2 7 6M16 4a4 4 0 0 1 0 8M22 21c0-3-2-5-4-6'/%3E%3C/svg%3E"); }
.ico-folder { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M3 6a1 1 0 0 1 1-1h5l2 2h9a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E"); }
.ico-shield { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 20 6v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E"); }
.ico-gear { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1'/%3E%3C/svg%3E"); }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line);
  margin-bottom: 26px; position: sticky; top: 0; background: rgba(13,16,19,.88); backdrop-filter: blur(10px); z-index: 5;
}
.menu { display: none; flex-direction: column; gap: 4px; padding: 8px; }
.menu span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; display: block; }
.server-id { flex: 1; min-width: 0; }
.server-title { font-family: var(--head); font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-addr { font-family: var(--mono); color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.copy { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; font-size: 11px; padding: 2px 8px; cursor: pointer; }
.copy:hover { color: var(--text); }
.status-pill { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 30px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status-pill.running .dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(132,224,90,.18); }
.status-pill.starting .dot, .status-pill.stopping .dot, .status-pill.installing .dot { background: var(--warn); animation: pulse 1s infinite; }
.status-pill.stopped .dot { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.power { display: flex; gap: 8px; }

/* Seiten */
.page { display: none; animation: fade .25s; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.page-title { margin-bottom: 6px; }
.lead { margin: 0 0 22px; max-width: 760px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

.hero-card {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 26px; border-radius: 18px; margin-bottom: 20px; border: 1px solid #2c3a26;
  background: linear-gradient(135deg, #1a2617 0%, #151b1f 60%), var(--card);
  position: relative; overflow: hidden;
}
.hero-card::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; opacity: .08;
  background: repeating-linear-gradient(0deg, var(--accent) 0 18px, transparent 18px 22px), repeating-linear-gradient(90deg, var(--accent) 0 18px, transparent 18px 22px);
  background-blend-mode: multiply; transform: rotate(12deg); pointer-events: none;
}
.hero-join { display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.hero-join code { font-size: 20px; padding: 10px 16px; background: rgba(0,0,0,.35); border: 1px solid #2c3a26; color: var(--accent); cursor: pointer; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat b { font-family: var(--head); font-size: 24px; }
.stat b small { font-size: 14px; font-weight: 500; }
.bar { height: 6px; border-radius: 6px; background: #252d36; overflow: hidden; }
.bar.big { height: 10px; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .6s; }
.bar i.warn { background: var(--warn); } .bar i.crit { background: var(--danger); }

.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* Konsole */
.console {
  background: #090b0d; border: 1px solid var(--line); border-radius: 10px; font: 12.5px/1.55 var(--mono);
  padding: 12px 14px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #c6d0da;
}
.console.mini { height: 280px; }
.console.big { height: calc(100vh - 330px); min-height: 320px; }
.console .l-warn { color: var(--warn); } .console .l-err { color: var(--danger); }
.console .l-panel { color: var(--info); } .console .l-input { color: var(--accent); }
.console .l-join { color: #b7f28f; }
.cmd { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.cmd .prompt { font-family: var(--mono); color: var(--accent); font-size: 18px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick button { background: var(--card2); border: 1px solid var(--line); color: var(--muted); border-radius: 20px; padding: 5px 12px; cursor: pointer; font-size: 12.5px; }
.quick button:hover { color: var(--text); border-color: var(--accent2); }

.playerlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.playerlist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg2); border-radius: 8px; }
.playerlist li.muted { background: none; padding-left: 0; }
.head { width: 26px; height: 26px; border-radius: 5px; image-rendering: pixelated; background: var(--card2); }
.facts { margin-top: 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.facts span:nth-child(odd) { color: var(--muted); }

/* Software */
.soft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.soft {
  text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; transition: .15s;
}
.soft:hover { border-color: #3a4552; transform: translateY(-2px); }
.soft.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(132,224,90,.15); }
.soft b { font-family: var(--head); font-size: 18px; }
.soft span:last-child { color: var(--muted); font-size: 13.5px; }
.soft-ico { width: 40px; height: 40px; border-radius: 10px; margin-bottom: 6px; }
.s-vanilla { background: linear-gradient(135deg, #8a5a32 0 50%, #6aa84f 50%); }
.s-paper { background: linear-gradient(135deg, #e8e4d8, #b9b3a2); }
.s-fabric { background: repeating-linear-gradient(45deg, #c9b08a 0 6px, #a88c62 6px 12px); }
.progress { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
#versionSelect { max-width: 320px; }

/* Dateien */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-family: var(--mono); font-size: 13px; }
.crumbs a { color: var(--muted); padding: 3px 6px; border-radius: 6px; }
.crumbs a:hover { color: var(--text); background: var(--card2); }
.filelist { display: flex; flex-direction: column; }
.frow { display: grid; grid-template-columns: 26px 1fr 110px 150px auto; align-items: center; gap: 12px; padding: 9px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--card2); }
.frow .name { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .name:hover { color: var(--accent); }
.frow .meta { color: var(--muted); font-size: 12.5px; }
.frow .acts { display: flex; gap: 4px; justify-content: flex-end; }
.frow .acts button { background: none; border: 1px solid transparent; color: var(--muted); border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 12px; }
.frow .acts button:hover { color: var(--text); border-color: var(--line); }
.frow .acts button.del:hover { color: var(--danger); border-color: var(--danger); }
.fico { width: 20px; height: 20px; }
.fico.dir { color: var(--warn); } .fico.file { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 8px; text-align: center; }
.drop-hint { display: none; }
#dropZone.dragging { border-color: var(--accent); border-style: dashed; }
#dropZone.dragging .drop-hint { display: block; text-align: center; color: var(--accent); padding: 12px; }
.list-card h2 { margin-bottom: 10px; display: flex; justify-content: space-between; }
.tag { display: inline-flex; align-items: center; gap: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px 6px 6px; margin: 0 6px 6px 0; font-size: 13px; }
.tag button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 13px; }
.tag button:hover { color: var(--danger); }
.tag .head { width: 20px; height: 20px; }

/* Modal & Toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { width: 100%; max-width: 900px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
#editor { height: 60vh; font: 13px/1.5 var(--mono); resize: vertical; margin-bottom: 12px; background: #090b0d; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); background: var(--card2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; z-index: 60; transition: .3s; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100% - 32px); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: var(--danger); color: #ffd0cd; }

/* Responsiv */
@media (max-width: 1100px) {
  .stats, .grid4 { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 20; }
  .menu { display: flex; }
  .main { padding: 0 16px 32px; }
  .topbar { flex-wrap: wrap; gap: 10px 12px; }
  .power { width: 100%; }
  .power .btn { flex: 1; }
  .soft-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .frow { grid-template-columns: 22px 1fr auto; }
  .frow .meta { display: none; }
  .console.big { height: 55vh; }
}
@media (max-width: 480px) {
  .stats, .grid4 { grid-template-columns: 1fr; }
  .hero-join code { font-size: 15px; }
}
