
:root {
  --canvas: #090a0d;
  --surface: #14161b;
  --raised: #191c23;
  --hairline: #23262e;
  --gold: #d8aa55;
  --gold-dim: #8a6c33;
  --gold-wash: rgba(216, 170, 85, 0.1);
  --warm: #f7f2e8;
  --body: #a7adba;
  --muted: #6f7684;
  --ok: #4ba36a;
  --warn: #d9a441;
  --err: #e0574d;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: ui-sans-serif, "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Der Fokusring ist eine der fuenf erlaubten Gold-Stellen - und er ist
   ueberall sichtbar, nicht nur dort, wo es gerade huebsch aussieht. */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

h1 { font-size: 28px; line-height: 1.15; font-weight: 600; color: var(--warm); margin: 0; }
h2 { font-size: 19px; font-weight: 600; color: var(--warm); margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; color: var(--warm); margin: 0 0 6px; }

/* Ziffern duerfen beim Ticken nicht springen. */
.num { font-variant-numeric: tabular-nums; }

/* --- Grundgeruest ------------------------------------------------------- */

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.rail {
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { padding: 22px 20px 18px; border-bottom: 1px solid var(--hairline); }
.brand-name { color: var(--warm); font-weight: 600; font-size: 16px; letter-spacing: 0.01em; }
.brand-mark { color: var(--gold); }

.nav { padding: 14px 10px; flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--body);
  cursor: pointer;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  width: 100%;
  border-left: 2px solid transparent;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.nav-item:hover { background: var(--raised); color: var(--warm); }
/* Ein 2px-Balken, keine gefuellte Pille - Gold bleibt ein Akzent. */
.nav-item[aria-current="page"] {
  color: var(--warm);
  background: var(--raised);
  border-left-color: var(--gold);
}

.rail-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--hairline);
  font-size: 12.5px;
  color: var(--muted);
}

.main { min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 32px;
  background: rgba(9, 10, 13, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topbar h1 { flex: 1; }

.content { padding: 28px 32px 64px; max-width: 1180px; }

/* --- Flaechen ------------------------------------------------------------ */

/* Tiefe ohne Schatten: ein Pixel Oberlicht liest wie eine angeschraegte
   Onyx-Platte. Nur Dialoge werfen einen echten Schatten. */
.card {
  background: linear-gradient(180deg, var(--raised), var(--surface));
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; }
.stat-value { font-size: 30px; font-weight: 600; color: var(--warm); line-height: 1.1; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--body);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.online { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.offline { background: var(--err); }

/* --- Knoepfe ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--raised);
  color: var(--warm);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
}
.btn:hover { background: #1f232b; border-color: #2c3038; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #17130a;
  font-weight: 600;
}
.btn-primary:hover { background: #e2b866; border-color: #e2b866; }

.btn-danger { color: var(--err); border-color: #3a2523; }
.btn-danger:hover { background: #241a19; }

.btn-ghost { background: none; border-style: dashed; color: var(--body); }

/* --- Formulare ----------------------------------------------------------- */

.section { padding: 20px 22px; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field > label { display: block; margin-bottom: 6px; color: var(--warm); font-size: 13px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

input[type="text"], input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: #101217;
  color: var(--warm);
  font: inherit;
  transition: border-color 140ms var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #2c3038; }
input:focus, select:focus, textarea:focus { border-color: var(--gold-dim); }
textarea { min-height: 150px; resize: vertical; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.check { display: flex; align-items: center; gap: 9px; color: var(--body); cursor: pointer; }
.check input { width: auto; }

/* Rollen-Chips mit dem Farbpunkt der Discord-Rolle. */
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  font-size: 12.5px;
}
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.chip button:hover { color: var(--err); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }

/* Der Klartext-Satz unter den Bedingungen - die wichtigste Zeile des
   Formulars, weil Fehler hier sonst bis zur Ziehung unsichtbar bleiben. */
.summary {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--gold-wash);
  border: 1px solid rgba(216, 170, 85, 0.22);
  color: var(--warm);
  font-size: 13px;
}

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

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

.gcard { overflow: hidden; display: flex; flex-direction: column; }
.gcard.running { border-left: 2px solid var(--gold); }
.gcard.draft { border-style: dashed; }

.gcard-banner { position: relative; aspect-ratio: 3 / 1; background: #0d0f13; }
.gcard-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gcard-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface), transparent 62%);
}

.gcard-body { padding: 15px 17px; flex: 1; }
.gcard-title { color: var(--warm); font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.gcard-meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.gcard-foot { padding: 11px 17px; border-top: 1px solid var(--hairline); display: flex; gap: 8px; align-items: center; }

.badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid var(--hairline);
  color: var(--muted);
}
.badge.active { color: var(--gold); border-color: var(--gold-dim); }
.badge.ended { color: var(--body); }
.badge.cancelled { color: var(--err); border-color: #3a2523; }

/* Der Countdown-Ring - die vierte erlaubte Gold-Stelle. */
.ring { width: 42px; height: 42px; flex-shrink: 0; }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--hairline); }
.ring .value { stroke: var(--gold); stroke-linecap: round; transition: stroke-dasharray 900ms linear; }

/* --- Vorschau ------------------------------------------------------------ */

.preview-wrap { position: sticky; top: 84px; }
.discord {
  background: #313338;
  border-radius: var(--radius);
  padding: 16px;
  color: #dbdee1;
  font-size: 14px;
}
.discord.mobile { max-width: 360px; }
.discord-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.discord-bot { background: #5865f2; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.discord-embed { border-left: 4px solid var(--gold); background: #2b2d31; border-radius: 4px; padding: 12px 14px; }
.discord-embed h4 { margin: 0 0 6px; color: #fff; font-size: 15px; }
.discord-fields { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.discord-field { min-width: 90px; }
.discord-field .k { color: #b5bac1; font-size: 12px; font-weight: 600; }
.discord-img { margin-top: 10px; border-radius: 4px; max-width: 100%; display: block; }
.discord-btn {
  margin-top: 10px;
  display: inline-block;
  background: #5865f2;
  color: #fff;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
}
.mention { color: #c9cdfb; background: rgba(88, 101, 242, 0.22); border-radius: 3px; padding: 0 2px; }
.spoiler { background: #202225; border-radius: 3px; }
.discord code { background: #1e1f22; padding: 1px 4px; border-radius: 3px; font-size: 12.5px; }
.discord pre { background: #1e1f22; padding: 9px 11px; border-radius: 5px; overflow-x: auto; }
.discord blockquote { border-left: 3px solid #4e5058; margin: 4px 0; padding-left: 10px; }

/* --- Sonstiges ----------------------------------------------------------- */

.empty { padding: 44px 24px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--warm); }

.banner-note {
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  margin-bottom: 16px;
}
.banner-note.warn { border-color: #3d3018; background: #1a1710; color: var(--warm); }
.banner-note.err { border-color: #3a2523; background: #1c1413; color: var(--warm); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 10px; }
td { padding: 9px 10px; border-top: 1px solid var(--hairline); }

dialog {
  background: var(--surface);
  color: var(--body);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 0;
  max-width: 560px;
  width: 92vw;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(4, 5, 7, 0.68); }
.dialog-body { padding: 22px 24px; }
.dialog-foot { padding: 14px 24px; border-top: 1px solid var(--hairline); display: flex; gap: 9px; justify-content: flex-end; }

.toast-region { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 9px; z-index: 50; }
.toast { padding: 11px 15px; border-radius: 9px; border: 1px solid var(--hairline); background: var(--raised); color: var(--warm); box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.toast.err { border-color: #3a2523; }

.pending { position: relative; overflow: hidden; }
.pending::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: shimmer 900ms linear infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.inline { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: start; }

/* --- Anmeldeseite -------------------------------------------------------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card { max-width: 400px; width: 100%; padding: 34px 30px; text-align: center; }
.login-card h1 { margin-bottom: 8px; }
.login-card p { color: var(--body); margin: 0 0 22px; }
.login-error {
  margin-bottom: 18px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid #3a2523;
  background: #1c1413;
  color: var(--warm);
  font-size: 13.5px;
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .nav { flex-direction: row; padding: 8px; }
  .nav-item { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .nav-item[aria-current="page"] { border-left-color: transparent; border-bottom-color: var(--gold); }
  .rail-foot, .brand { border: 0; }
  .two-col { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .content, .topbar { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
