/* MCDungeon Adminpanel. Gold auf Anthrazit, wie das Logo. */
:root {
  --gold: #D8B26A;
  --steel: #8A8F98;
  --bg: #14161a;
  --panel: #1c1f25;
  --panel-2: #22262d;
  --line: #2e333c;
  --text: #e7e9ec;
  --muted: #949aa4;
  --ok: #6fbf73;
  --warn: #d9a441;
  --bad: #d96a6a;
  --radius: 10px;
}

* { box-sizing: border-box; }

/*
 * Das hidden-Attribut ist nur "display:none" aus dem Browser-Stylesheet - jede
 * eigene display-Regel schlaegt es. .gate hat display:grid, und damit blieb die
 * Anmeldemaske sichtbar, obwohl das Skript sie laengst ausgeblendet hatte.
 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .9em;
  background: #00000040;
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--gold);
}

/* ---- Anmeldung ---- */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate .card { width: min(380px, 100%); text-align: center; }
.gate h1 {
  margin: 0 0 4px;
  letter-spacing: .18em;
  font-size: 26px;
  background: linear-gradient(90deg, var(--gold), var(--steel));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#code {
  text-align: center;
  letter-spacing: .4em;
  font-size: 26px;
  text-transform: uppercase;
  font-family: ui-monospace, Consolas, monospace;
}

/* ---- Rahmen ---- */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  letter-spacing: .16em;
  background: linear-gradient(90deg, var(--gold), var(--steel));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
}
nav button:hover { background: var(--panel-2); color: var(--text); }
nav button.active { background: var(--panel-2); color: var(--gold); }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 13px; }
.live { color: var(--bad); font-size: 11px; transition: color .3s; }
.live.on { color: var(--ok); }

main { padding: 22px; max-width: 1000px; margin: 0 auto; }
section { display: grid; gap: 16px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h2 { margin: 0 0 6px; font-size: 15px; letter-spacing: .04em; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.muted { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.big { font-size: 24px; margin: 6px 0 2px; color: var(--gold); }
.error { color: var(--bad); font-size: 13px; }
.warn { color: var(--warn); font-size: 12px; }
.saved { color: var(--ok); font-size: 13px; }

label { display: block; margin: 12px 0; font-size: 13px; color: var(--muted); }
input[type=text], input:not([type]), textarea, select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
}
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

.toggle { display: flex; align-items: center; gap: 9px; color: var(--text); }
.toggle input { width: 17px; height: 17px; margin: 0; accent-color: var(--gold); }

button {
  background: var(--gold);
  color: #1a1408;
  border: 0;
  padding: 9px 16px;
  border-radius: 7px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.ghost { background: none; color: var(--muted); border: 1px solid var(--line); font-weight: 400; }
button.ghost:hover { color: var(--text); }

.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.row input, .row select { width: auto; flex: 1; min-width: 150px; margin-top: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

/* ---- Vorschauen ---- */
.motd-preview {
  background: #0b0c0e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23111'/%3E%3C/svg%3E");
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 14px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.5;
  margin: 10px 0;
}

/* Das Buch. Kein Pergament-Kitsch, aber die Proportionen stimmen -
   eine Buchseite ist schmal, und das entscheidet, wo umgebrochen wird. */
.book {
  background: #d8c9a3;
  color: #2a1e0e;
  border-radius: 5px;
  padding: 20px 22px;
  width: 300px;
  max-width: 100%;
  min-height: 200px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.book .page + .page { border-top: 1px dashed #00000033; margin-top: 14px; padding-top: 14px; }

.perms {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
}
.perms span {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 12px;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--muted);
}
details summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 12px; }
