/* ============================================================
   NXMZ XPANEL – Stylesheet
   Dunkles Blau-Schwarz, Chrom und elektrisches Blau, kantige
   Formen: aufgegriffen vom Logo.
   ============================================================ */

@font-face {
  font-family: 'Orbitron';
  src: url('/fonts/orbitron.woff2') format('woff2');
  font-weight: 700 900;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('/fonts/rajdhani-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('/fonts/rajdhani-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('/fonts/rajdhani-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Flächen – fast schwarz mit einem Stich ins Blaue */
  --bg:          #05080f;
  --bg-deep:     #02040a;
  --bg-elev:     #0a111f;
  --card:        #0b1322;
  --card-hover:  #101b2e;

  /* Ränder */
  --border:      #17263d;
  --border-lit:  #23456f;
  --border-soft: #111c2e;

  /* Schrift – Chromtöne */
  --text:        #e9f1fb;
  --text-dim:    #93a8c4;
  --text-faint:  #61748f;

  /* Das elektrische Blau aus dem Logo */
  --accent:      #1a9bff;
  --accent-hi:   #5cc2ff;
  --accent-deep: #0a65c4;
  --glow:        rgba(26, 155, 255, .45);
  --glow-soft:   rgba(26, 155, 255, .16);

  --green:       #2fd36b;
  --green-deep:  #178f45;
  --red:         #ff4356;
  --red-deep:    #b81f2e;
  --amber:       #ffb02e;

  --cut:         9px;      /* Anschnitt der Ecken */
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --ui:   'Rajdhani', system-ui, -apple-system, "Segoe UI", sans-serif;
  --brand:'Orbitron', 'Rajdhani', system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* hidden muss immer gewinnen. Sonst überschreibt eine Klasse mit display
   (z.B. .btn) das Attribut, und Elemente bleiben trotz hidden sichtbar. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Sanfter blauer Schein von oben – gibt der Seite Tiefe. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(26, 155, 255, .13), transparent 70%),
    radial-gradient(600px 300px at 100% 100%, rgba(10, 101, 196, .07), transparent 70%);
}
body > * { position: relative; z-index: 1; }

a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  margin: 0 0 .4rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: .01em;
}
h1 { font-size: 1.85rem; text-transform: uppercase; letter-spacing: .035em; }
h2 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: .05em; }
h3 { font-size: 1.05rem; }

/* Chromverlauf für die großen Überschriften, wie im Logo. */
h1 {
  background: linear-gradient(175deg, #ffffff 8%, #cfe0f2 38%, #7e93ae 62%, #e4eefb 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 26px rgba(26, 155, 255, .22);
}

p { margin: 0 0 .7rem; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: .87rem; }
.mono  { font-family: var(--mono); font-size: .9em; }
.nowrap { white-space: nowrap; }

/* ----------------------------------------------------------- Layout */

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .45rem 1.35rem;
  background: linear-gradient(180deg, #0a1322 0%, #070d18 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(26, 155, 255, .14), 0 8px 28px rgba(0, 0, 0, .55);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar .brand { display: flex; align-items: center; }
.topbar .brand:hover { text-decoration: none; }
.topbar .brand img {
  height: 52px;
  width: auto;
  display: block;
  /* Der Logo-Hintergrund ist schwarz: "screen" blendet ihn weg. */
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 10px rgba(26, 155, 255, .35));
  transition: filter .2s;
}
.topbar .brand:hover img { filter: drop-shadow(0 0 16px rgba(26, 155, 255, .6)); }
.topbar .spacer { flex: 1; }

.whoami {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  font-weight: 600;
}
.whoami img {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  border: 1px solid var(--border-lit);
}

.wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 1.9rem 1.25rem 4rem;
}
.wrap.narrow { max-width: 780px; }

body.centered {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.page-head .spacer { flex: 1; }

/* Markenzeichen auf den Einstiegsseiten */
.hero-logo {
  display: block;
  width: min(340px, 78vw);
  height: auto;
  margin: 0 auto 1.1rem;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 28px rgba(26, 155, 255, .4));
}

/* ------------------------------------------------------------ Karten */

.card {
  background: linear-gradient(170deg, #0d1627 0%, #0a1120 100%);
  border: 1px solid var(--border);
  padding: 1.3rem;
  position: relative;
}
/* Dünner Lichtstreifen an der Oberkante. */
.card::before {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(26, 155, 255, .55), transparent);
}
.card.narrow { max-width: 480px; width: 100%; text-align: center; }
.card + .card { margin-top: 1.1rem; }

.card-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--border-soft);
}
.card-head h2 { margin: 0; }
.card-head .spacer { flex: 1; }

.grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

/* ------------------------------------------------------- Server-Karte */

.server-card {
  background: linear-gradient(170deg, #0d1627 0%, #0a1120 100%);
  border: 1px solid var(--border);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  position: relative;
  transition: border-color .18s, transform .18s, box-shadow .18s;
  clip-path: polygon(
    var(--cut) 0, 100% 0,
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%,
    0 100%, 0 var(--cut)
  );
}
.server-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent 80%);
  opacity: .65;
}
.server-card:hover {
  border-color: var(--border-lit);
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(26, 155, 255, .12);
}

.server-card .title {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: .02em;
  color: var(--text);
  text-transform: uppercase;
}
.server-card a.title:hover { text-decoration: none; color: #fff; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem .9rem;
  font-size: .92rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ------------------------------------------------------------- Status */

.dot {
  width: 9px; height: 9px;
  flex: none;
  background: var(--text-faint);
  transform: rotate(45deg);           /* Raute statt Kreis */
}
.dot.online   { background: var(--green); box-shadow: 0 0 10px rgba(47, 211, 107, .8); }
.dot.starting,
.dot.stopping,
.dot.installing { background: var(--amber); animation: pulse 1.3s ease-in-out infinite; }
.dot.crashed  { background: var(--red); box-shadow: 0 0 10px rgba(255, 67, 86, .8); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .1rem .55rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: #101c2f;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge.green { background: rgba(47, 211, 107, .12); color: #5de591; border-color: rgba(47, 211, 107, .4); }
.badge.red   { background: rgba(255, 67, 86, .12); color: #ff7b89; border-color: rgba(255, 67, 86, .4); }
.badge.amber { background: rgba(255, 176, 46, .12); color: #ffc769; border-color: rgba(255, 176, 46, .4); }
.badge.blue  { background: rgba(26, 155, 255, .14); color: var(--accent-hi); border-color: rgba(26, 155, 255, .45); }

/* ------------------------------------------------------------ Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .48rem 1.1rem;
  border: 1px solid var(--border-lit);
  background: linear-gradient(180deg, #16233a 0%, #0e1829 100%);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .14s, border-color .14s, box-shadow .14s, opacity .14s;
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #1d2e4b 0%, #142036 100%);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--glow-soft);
  text-decoration: none;
}
.btn:disabled { opacity: .38; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-color: var(--accent-hi);
  color: #021326;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 100%);
  box-shadow: 0 0 22px var(--glow);
}

.btn.success {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-deep) 100%);
  border-color: #56e894;
  color: #02160a;
}
.btn.success:hover:not(:disabled) { box-shadow: 0 0 22px rgba(47, 211, 107, .45); }

.btn.danger {
  background: linear-gradient(180deg, #2a1119 0%, #1c0b10 100%);
  border-color: var(--red-deep);
  color: #ff8793;
}
.btn.danger:hover:not(:disabled) {
  border-color: var(--red);
  box-shadow: 0 0 18px rgba(255, 67, 86, .3);
}

.btn.small { padding: .26rem .66rem; font-size: .82rem; clip-path: none; }
.btn.block { width: 100%; }

.btn-row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }

.btn-discord {
  background: linear-gradient(180deg, #5865f2 0%, #3c45b5 100%);
  border-color: #7b86ff;
  color: #fff;
  padding: .72rem 1.4rem;
  font-size: 1rem;
}
.btn-discord:hover:not(:disabled) {
  background: linear-gradient(180deg, #6b77ff 0%, #4a54cc 100%);
  box-shadow: 0 0 24px rgba(88, 101, 242, .5);
}

/* ----------------------------------------------------------- Formular */

label {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .3rem;
}
.field { margin-bottom: 1.05rem; }
.field .hint { font-size: .85rem; color: var(--text-faint); margin-top: .3rem; font-weight: 500; }

input[type=text], input[type=number], input[type=search], select, textarea {
  width: 100%;
  padding: .5rem .7rem;
  border: 1px solid var(--border);
  background: #070d18;
  color: var(--text);
  font: inherit;
  font-size: .97rem;
  font-weight: 600;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px var(--glow-soft);
}
input:disabled, select:disabled { opacity: .45; cursor: not-allowed; }
textarea { resize: vertical; min-height: 80px; font-family: var(--mono); font-size: .88rem; }
::placeholder { color: var(--text-faint); font-weight: 500; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-weight: 500;
  font-size: .95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  cursor: pointer;
}
.check input { margin-top: .3rem; flex: none; width: auto; accent-color: var(--accent); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------- Konsole */

.console {
  background: #03060c;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-deep);
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.55;
  padding: .8rem .95rem;
  height: clamp(300px, 54vh, 640px);
  overflow-y: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  scrollbar-width: thin;
  scrollbar-color: var(--border-lit) transparent;
}
.console .l { display: block; color: #b8c8dd; }
.console .l.err    { color: #ff8894; }
.console .l.system { color: var(--accent-hi); font-style: italic; }
.console .l.input  { color: #5de591; font-weight: 600; }
.console .l .warn  { color: var(--amber); }

.console::-webkit-scrollbar { width: 9px; }
.console::-webkit-scrollbar-track { background: transparent; }
.console::-webkit-scrollbar-thumb { background: var(--border-lit); }

.console-bar { display: flex; gap: .55rem; margin-top: .65rem; }
.console-bar input { font-family: var(--mono); font-size: .88rem; font-weight: 500; }

/* ------------------------------------------------------------ Tabelle */

table { width: 100%; border-collapse: collapse; font-size: .96rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border-soft); }
th {
  color: var(--accent-hi);
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  border-bottom-color: var(--border);
}
tr:last-child td { border-bottom: none; }
td.right, th.right { text-align: right; }

.user-cell { display: flex; align-items: center; gap: .55rem; }
.user-cell img {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--border);
  border: 1px solid var(--border-lit);
}

/* ------------------------------------------------------------- Tabs */

.tabs {
  display: flex;
  gap: .2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: .6rem 1.1rem;
  border: none;
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .14s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent-hi);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 14px var(--glow);
}

.panel { display: none; }
.panel.active { display: block; }

/* ------------------------------------------------------------ Hinweise */

.note {
  padding: .7rem .95rem;
  font-size: .94rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-lit);
  background: #0a1322;
  margin-bottom: 1rem;
}
.note.warn  { background: rgba(255, 176, 46, .07); border-color: rgba(255, 176, 46, .3);
              border-left-color: var(--amber); color: #ffd79a; }
.note.error { background: rgba(255, 67, 86, .07); border-color: rgba(255, 67, 86, .3);
              border-left-color: var(--red); color: #ffa3ac; }
.note.ok    { background: rgba(47, 211, 107, .07); border-color: rgba(47, 211, 107, .3);
              border-left-color: var(--green); color: #9ceebb; }

.empty {
  text-align: center;
  padding: 3.2rem 1.25rem;
  color: var(--text-dim);
  border: 1px dashed var(--border-lit);
  background: rgba(10, 17, 32, .5);
}

/* ------------------------------------------------------------- Modal */

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(2, 5, 12, .8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 50;
  backdrop-filter: blur(3px);
}
.modal-bg.open { display: flex; }
.modal {
  background: linear-gradient(170deg, #0e1829 0%, #0a1120 100%);
  border: 1px solid var(--border-lit);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .75), 0 0 60px rgba(26, 155, 255, .1);
  padding: 1.5rem;
  width: min(580px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.modal h2 { color: var(--accent-hi); }

/* ------------------------------------------------------------- Toast */

#toasts {
  position: fixed;
  bottom: 1.1rem;
  right: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 100;
  max-width: min(420px, calc(100vw - 2.2rem));
}
.toast {
  background: linear-gradient(170deg, #12203a 0%, #0b1322 100%);
  border: 1px solid var(--border-lit);
  border-left: 3px solid var(--accent);
  padding: .65rem .9rem;
  font-size: .93rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
  animation: slide-in .2s ease-out;
}
.toast.error { border-left-color: var(--red); }
.toast.ok    { border-left-color: var(--green); }

@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }

/* -------------------------------------------------------------- Liste */

.list-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .62rem .3rem;
  border-bottom: 1px solid var(--border-soft);
}
.list-row:last-child { border-bottom: none; }
.list-row .spacer { flex: 1; }
.list-row .name { font-weight: 600; }
.list-row.disabled .name { color: var(--text-faint); text-decoration: line-through; }

/* ----------------------------------------------------------- Dropzone */

.dropzone {
  border: 2px dashed var(--border-lit);
  padding: 2.1rem 1.25rem;
  text-align: center;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  background: rgba(7, 13, 24, .6);
  transition: border-color .15s, background .15s, color .15s;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent);
  background: rgba(26, 155, 255, .07);
  color: var(--text);
  box-shadow: inset 0 0 40px var(--glow-soft);
}

/* ------------------------------------------------------ Serveradresse
   Das, was die Spieler in Minecraft unter "Server hinzufügen" eintragen.
   Ein Klick darauf legt die Adresse in die Zwischenablage. */

.address {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .7rem;
  background: rgba(26, 155, 255, .07);
  border: 1px solid rgba(26, 155, 255, .3);
  border-left: 3px solid var(--accent);
  cursor: pointer;
  user-select: none;
  transition: background .14s, border-color .14s, box-shadow .14s;
}
.address:hover {
  background: rgba(26, 155, 255, .14);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--glow-soft);
}
.address .label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.address .value {
  font-size: .97rem;
  font-weight: 600;
  color: var(--accent-hi);
  letter-spacing: .01em;
}
.address .copy-hint {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity .14s;
}
.address:hover .copy-hint { opacity: 1; }

@media (max-width: 480px) {
  .address { width: 100%; }
  .address .copy-hint { display: none; }
}

/* -------------------------------------------------------------- Kopie */

.copy-field { display: flex; gap: .4rem; align-items: stretch; }
.copy-field input { font-family: var(--mono); font-size: .84rem; font-weight: 500; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-lit);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- Mobil */

@media (max-width: 640px) {
  .wrap { padding: 1.25rem 1rem 3rem; }
  h1 { font-size: 1.45rem; }
  .topbar { padding: .5rem .9rem; gap: .6rem; }
  .topbar .brand img { height: 38px; }
  .whoami span:not(.badge) { display: none; }
  .grid { grid-template-columns: 1fr; }
}

.console .l.warn { color: var(--amber); }
.linkfetch { margin-bottom: 1.2rem; }
