/* QuestHub – Verwaltung (gleiche Farben wie die Startseite, ruhigere Gestaltung) */
:root {
  --night: #0d1016;
  --stone: #181d26;
  --stone-2: #11151c;
  --field: #0f131a;
  --gold: #c9a45c;
  --gold-hi: #f1d58c;
  --gold-pale: #fff1c4;
  --gold-lo: #8c6324;
  --text: #e6dabd;
  --text-dim: #b6aa8c;
  --text-faint: #8a816b;
  --ember: #e0763a;
  --ok: #8fd9a8;
  --bad: #ff9a7a;
  --line: rgba(201, 164, 92, 0.26);
  --f-head: 'Cinzel', 'Trajan Pro', Georgia, 'Times New Roman', serif;
  --f-body: 'EB Garamond', Garamond, Georgia, serif;
  --f-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, #182030, transparent 60%), var(--night);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.5;
}
[hidden] { display: none !important; }
a { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.loading { padding: 40px; text-align: center; color: var(--text-dim); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--gold-hi); word-break: break-all; }

/* Knöpfe */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0.55em 1.4em;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.05em;
  color: var(--gold-hi);
  text-decoration: none;
  background: linear-gradient(180deg, #221c12, #120f0a);
  border: 1px solid var(--gold);
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}
.btn:hover { box-shadow: 0 0 14px rgba(241, 213, 140, 0.3); color: var(--gold-pale); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn--gold { background: linear-gradient(180deg, #7a5822, #3e2b10); border-color: var(--gold-hi); }
.btn--ghost { background: rgba(14, 17, 22, 0.8); border-color: rgba(201, 164, 92, 0.55); }
.btn--danger { color: var(--bad); border-color: rgba(255, 154, 122, 0.5); background: rgba(40, 14, 10, 0.6); }
.btn--danger:hover { box-shadow: 0 0 12px rgba(255, 120, 90, 0.3); color: #ffc2b0; }
.btn--small { min-height: 38px; padding: 0.4em 1em; font-size: 0.82rem; }
.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--field);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn:not(:disabled):hover { border-color: var(--gold-hi); color: var(--gold-hi); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Anmeldung */
.gate { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.gate__box {
  width: min(420px, 100%);
  padding: 36px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--stone), var(--stone-2));
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.gate__sigil { display: block; width: 22px; height: 22px; margin: 0 auto 16px; transform: rotate(45deg); background: linear-gradient(135deg, var(--gold-pale), var(--gold-lo)); box-shadow: 0 0 14px rgba(241, 213, 140, 0.6); }
.gate h1 { margin: 0 0 18px; font-family: var(--f-head); color: var(--gold-hi); font-size: 1.7rem; }
.gate p { color: var(--text-dim); }
.gate__foot { margin: 22px 0 0; font-size: 0.92rem; }
.stack { display: grid; gap: 8px; text-align: left; }
.stack .btn { margin-top: 10px; }
.form-error { min-height: 1.2em; margin: 0; color: var(--bad); font-size: 0.92rem; }

/* Kopf */
.head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 20px 8px;
}
.head__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-head); font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--gold-hi); }
.head__sigil { width: 13px; height: 13px; transform: rotate(45deg); background: linear-gradient(135deg, var(--gold-pale), var(--gold-lo)); }
.head__label { color: var(--text-faint); font-family: var(--f-head); }
.head__actions { display: flex; gap: 8px; margin-left: auto; }

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 4px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 20px 0;
  overflow-x: auto;
  background: linear-gradient(180deg, var(--night) 75%, transparent);
  border-bottom: 1px solid var(--line);
}
.tabs__btn {
  flex: none;
  padding: 10px 16px;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dim);
  background: none;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
}
.tabs__btn:hover { color: var(--gold-hi); }
.tabs__btn[aria-current='page'] { color: var(--gold-hi); background: var(--stone); border-color: var(--line); margin-bottom: -1px; }

.panel { max-width: 1040px; margin: 0 auto; padding: 24px 20px 140px; }
.intro h2 { margin: 0 0 6px; font-family: var(--f-head); color: var(--gold-hi); font-size: 1.5rem; }
.intro p { margin: 0 0 18px; max-width: 75ch; color: var(--text-dim); }

.card {
  margin-bottom: 18px;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--stone), var(--stone-2));
  border: 1px solid var(--line);
  border-radius: 4px;
}
.card--muted { opacity: 0.7; }
.card h3 { margin: 0; font-family: var(--f-head); font-size: 1.08rem; color: var(--text); }
.card__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.card__head h3 { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.card__foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row-actions { display: flex; gap: 6px; }
.add { margin-bottom: 26px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.span2 { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .label { font-size: 0.88rem; font-weight: 600; color: var(--text-dim); }
.field--check { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.field--check .hint { grid-column: 1 / -1; }
.hint { margin: 0; font-size: 0.85rem; color: var(--text-faint); }
input[type='text'], input[type='url'], input[type='password'], input[type='number'], textarea, select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid rgba(201, 164, 92, 0.3);
  border-radius: 3px;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { border-color: var(--gold-hi); outline: none; box-shadow: 0 0 0 3px rgba(241, 213, 140, 0.15); }
input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--gold); margin: 0; }
.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-top: 12px; }
.inline .field { flex: 1 1 320px; }
.inline .btn { margin-bottom: 26px; }

.status { margin: 12px 0 0; font-size: 0.9rem; color: var(--text-dim); }
.status--ok { color: var(--ok); }
.status--error { color: var(--bad); }
.test-result:empty { display: none; }
.mini-list { margin: 8px 0 0; padding-left: 20px; font-size: 0.9rem; color: var(--text-dim); }
.mini-list span { color: var(--text-faint); }

/* Wappen und Farben */
.app-preview {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--gold-hi);
  box-shadow: 0 0 0 2px var(--gold);
}
.app-preview .emblem { width: 30px; height: 30px; }
.app-preview .e-d { fill: rgba(0, 0, 0, 0.55); }
.app-preview--sport { border-radius: 4px; background: linear-gradient(115deg, #1b212b, #2a1c12) !important; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 36px; height: 36px; border: 2px solid transparent; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.swatch[aria-checked='true'] { border-color: var(--gold-hi); box-shadow: 0 0 0 2px var(--night), 0 0 0 4px var(--gold-hi); }
.swatch--crimson { background: linear-gradient(180deg, #8d1d1d, #3a0909); }
.swatch--royal { background: linear-gradient(180deg, #23458e, #0b1838); }
.swatch--emerald { background: linear-gradient(180deg, #1b6448, #072318); }
.swatch--violet { background: linear-gradient(180deg, #57307f, #1d0c31); }
.swatch--obsidian { background: linear-gradient(180deg, #3a3c46, #0f1014); }
.swatch--amber { background: linear-gradient(180deg, #94621a, #3a2306); }
.emblems { display: flex; flex-wrap: wrap; gap: 8px; }
.emblem-pick {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  color: var(--gold-hi);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}
.emblem-pick .emblem { width: 34px; height: 34px; }
.emblem-pick .e-d { fill: var(--field); }
.emblem-pick[aria-checked='true'] { border-color: var(--gold-hi); background: #2a2010; box-shadow: 0 0 12px rgba(241, 213, 140, 0.25); }
.emblem-pick[aria-checked='true'] .e-d { fill: #2a2010; }

.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.preset {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}
.preset strong { color: var(--gold-hi); }
.preset span { font-size: 0.85rem; color: var(--text-faint); }
.preset:not(:disabled):hover { border-color: var(--gold-hi); }
.preset:disabled { opacity: 0.5; cursor: default; }

.help summary { cursor: pointer; font-weight: 600; color: var(--gold-hi); }
.help ol { margin: 12px 0 0; padding-left: 22px; color: var(--text-dim); }
.help li + li { margin-top: 6px; }

.channels { margin-top: 12px; padding: 12px 14px; background: var(--field); border: 1px solid var(--line); border-radius: 3px; }
.channels__group + .channels__group { margin-top: 10px; }
.channels__cat { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-weight: 700; font-size: 0.85rem; color: var(--text-dim); }
.channels__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; padding-left: 26px; }
.channels__list label { display: flex; align-items: center; gap: 8px; font-size: 0.93rem; min-width: 0; overflow-wrap: anywhere; }

/* Speicherleiste */
.savebar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  width: min(720px, calc(100% - 24px));
  padding: 12px 16px;
  background: rgba(20, 24, 32, 0.97);
  border: 1px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, 160%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.35s;
}
.savebar.is-visible { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.savebar p { flex: 1 1 200px; margin: 0; color: var(--gold-hi); }

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 30;
  max-width: min(560px, calc(100% - 24px));
  padding: 12px 18px;
  transform: translateX(-50%);
  border-radius: 4px;
  background: #1d2a22;
  border: 1px solid var(--ok);
  color: #dff5e6;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.toast--error { background: #2e1712; border-color: var(--bad); color: #ffe0d6; }

@media (max-width: 720px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .head__actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; }
}
