/* ==========================================================================
   CRAFTLISTE – Design-System
   Basis: Nachthimmel-Dunkelblau. Bedeutungsfarben: Bernstein (Aktion/Featured),
   Gras-Grün (nur Online/Votes), Redstone-Rot (nur Offline/Fehler).
   Signatur: die Strata-Leiste (Himmel → Gras → Erde → Stein).
   Schrift: System-Stack (DSGVO: keine externen Font-CDNs), Monospace für Daten.
   ========================================================================== */

:root {
  --bg:        #0e1220;
  --panel:     #151b2e;
  --panel-2:   #1b2342;
  --line:      #28314f;
  --line-soft: #1f2743;

  --text:  #eaedfb;
  --dim:   #98a2c7;
  --faint: #667099;

  --gras:      #5fc74c;
  --gras-glow: rgba(95, 199, 76, .45);
  --fackel:    #ffb224;
  --fackel-dk: #8a5c00;
  --redstone:  #f0564f;
  --himmel:    #7fb2ff;

  --strata: linear-gradient(180deg,
      #7fb2ff 0 26%, #57b14b 26% 46%, #7a4e2c 46% 76%, #5c6478 76% 100%);

  --sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas,
          "Liberation Mono", monospace;

  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(127, 178, 255, .07), transparent 60%),
    radial-gradient(900px 420px at 5% 0%, rgba(95, 199, 76, .05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2px solid var(--himmel);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* --- Strata-Signatur ------------------------------------------------------ */
.strata-edge { height: 6px; background: var(--strata); }
.strata-chip {
  display: inline-block; width: 14px; height: 11px; border-radius: 2px;
  background: var(--strata); margin-right: 9px; vertical-align: -1px;
}

/* --- Header --------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 18, 32, .88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.site-head .bar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.12rem; letter-spacing: .02em;
  color: var(--text) !important; text-decoration: none !important;
}
.brand .logo {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--strata);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15);
}
.brand small { color: var(--faint); font-weight: 600; font-size: .72rem; letter-spacing: .1em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.site-nav a { color: var(--dim); font-weight: 600; font-size: .92rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--text); }

/* --- Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 9px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line);
  font: 600 .92rem var(--sans); cursor: pointer;
  text-decoration: none !important;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: #222b52; border-color: #34406e; }
.btn:active { transform: translateY(1px); }

.btn-vote {
  background: var(--fackel); color: #211400; border: none;
  font-weight: 800; letter-spacing: .01em;
  box-shadow: 0 3px 0 var(--fackel-dk);
}
.btn-vote:hover { background: #ffc04d; }
.btn-vote:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--fackel-dk); }
.btn-vote[disabled] { opacity: .6; cursor: wait; }

.btn-sm { padding: 6px 12px; font-size: .84rem; border-radius: 8px; }
.btn-block { width: 100%; }

/* --- Hero ----------------------------------------------------------------- */
.hero { padding: 34px 0 10px; }
.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 3.4vw, 2.25rem);
  font-weight: 800; letter-spacing: -.015em; line-height: 1.15;
}
.hero p.sub { margin: 0 0 18px; color: var(--dim); max-width: 62ch; }

.live-stats { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 20px; }
.live-stats .stat b {
  display: block; font: 700 1.25rem var(--mono); color: var(--text);
}
.live-stats .stat span {
  font-size: .78rem; color: var(--faint);
  text-transform: uppercase; letter-spacing: .09em;
}
.live-stats .stat b .dot { color: var(--gras); }

/* --- Suche & Filter ------------------------------------------------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search { flex: 1 1 260px; display: flex; gap: 8px; }
.search input {
  flex: 1; padding: 10px 14px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit;
}
.search input::placeholder { color: var(--faint); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  flex: 0 0 auto; padding: 6px 13px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--dim); font-size: .85rem; font-weight: 600;
  text-decoration: none !important; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: #34406e; }
.chip.active { background: var(--panel-2); color: var(--text); border-color: var(--himmel); }

/* --- Abschnitts-Überschriften --------------------------------------------- */
.sect { margin: 26px 0 12px; }
.sect .eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 2px;
}
.sect h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }

/* --- Featured-Karten ------------------------------------------------------ */
.featured-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.card-featured {
  position: relative;
  background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--fackel);
  border-radius: var(--radius); padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .12s ease;
}
.card-featured:hover { transform: translateY(-2px); }
.card-featured .flag {
  position: absolute; top: -1px; right: 12px;
  background: var(--fackel); color: #211400;
  font-size: .66rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 8px;
  border-radius: 0 0 6px 6px;
}
.card-featured .name { font-weight: 800; font-size: 1.02rem; }
.card-featured .name a { color: var(--text); }
.card-featured .desc {
  color: var(--dim); font-size: .87rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-featured .foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
}

/* --- Server-Liste --------------------------------------------------------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 118px 96px 96px auto;
  gap: 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 12px 14px;
  transition: border-color .15s ease, background .15s ease;
}
.row:hover { border-color: var(--line); background: #171e33; }

.row .rank { font: 800 1.05rem var(--mono); color: var(--faint); text-align: center; }
.row .rank.r1 { color: var(--fackel); }
.row .rank.r2 { color: var(--himmel); }
.row .rank.r3 { color: var(--gras); }

.row .info { min-width: 0; }
.row .info .name {
  font-weight: 800; font-size: 1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .info .name a { color: var(--text); }
.row .info .meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 3px; font-size: .8rem; color: var(--faint);
}
.tagpill {
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 5px; padding: 1px 7px; font-size: .72rem; font-weight: 600; color: var(--dim);
}

.num { font-family: var(--mono); font-weight: 700; }
.row .players, .row .votes { text-align: right; }
.row .players b, .row .votes b { display: block; font: 700 .98rem var(--mono); }
.row .players span, .row .votes span {
  font-size: .68rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em;
}

.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--redstone); vertical-align: 1px;
}
.status-dot.on { background: var(--gras); box-shadow: 0 0 7px var(--gras-glow); }

.spark { display: block; }
.spark polyline { fill: none; stroke: var(--himmel); stroke-width: 1.6; }
.spark polygon { fill: rgba(127, 178, 255, .12); }

/* --- Pagination ----------------------------------------------------------- */
.pager { display: flex; gap: 8px; justify-content: center; margin: 22px 0; }

/* --- Server-Profil -------------------------------------------------------- */
.profile-head { padding: 30px 0 6px; }
.profile-head .topline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile-head h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.01em; }
.badge {
  font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 6px;
  letter-spacing: .05em; text-transform: uppercase;
}
.badge.on  { background: rgba(95, 199, 76, .12); color: var(--gras); border: 1px solid rgba(95, 199, 76, .35); }
.badge.off { background: rgba(240, 86, 79, .1); color: var(--redstone); border: 1px solid rgba(240, 86, 79, .3); }
.badge.founder { background: rgba(255, 178, 36, .1); color: var(--fackel); border: 1px solid rgba(255, 178, 36, .35); }

.iprow { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.ipbox {
  font: 700 .95rem var(--mono);
  background: var(--panel); border: 1px dashed var(--line);
  padding: 8px 13px; border-radius: 8px;
}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }

.panel {
  background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 16px;
}
.panel h3 { margin: 0 0 10px; font-size: .95rem; font-weight: 800; }

.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.statgrid .cell {
  background: var(--panel-2); border-radius: 8px; padding: 10px 12px; text-align: center;
}
.statgrid .cell b { display: block; font: 700 1.1rem var(--mono); }
.statgrid .cell span { font-size: .68rem; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }

.desc-text { color: var(--dim); white-space: pre-line; }

.chart-svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: .78rem; color: var(--faint); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* --- Vote-Box ------------------------------------------------------------- */
.votebox { border: 1px solid var(--line); border-top: 3px solid var(--fackel); }
.votebox label { display: block; font-size: .82rem; font-weight: 700; color: var(--dim); margin: 0 0 5px; }
.votebox input[type=text] {
  width: 100%; padding: 10px 13px; margin-bottom: 10px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font: 700 .95rem var(--mono);
}
.votebox .hint { font-size: .78rem; color: var(--faint); margin-top: 8px; }
.vote-msg { margin-top: 10px; font-size: .88rem; font-weight: 600; display: none; }
.vote-msg.ok { display: block; color: var(--gras); }
.vote-msg.err { display: block; color: var(--redstone); }

/* Honeypot: fuer Menschen unsichtbar, fuer Bots ein normales Feld */
.hp-field { position: absolute !important; left: -9999px; top: -9999px; height: 1px; overflow: hidden; }

/* --- Formulare (Login, Eintragen, Dashboard) ------------------------------ */
.form-card { max-width: 440px; margin: 40px auto; }
.form-wide { max-width: 760px; margin: 30px auto; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .84rem; font-weight: 700; color: var(--dim); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 13px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.field .note { font-size: .76rem; color: var(--faint); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 6px 11px; font-size: .85rem; cursor: pointer;
}

.alert { padding: 11px 14px; border-radius: 9px; font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
.alert.ok  { background: rgba(95, 199, 76, .1); color: var(--gras); border: 1px solid rgba(95, 199, 76, .3); }
.alert.err { background: rgba(240, 86, 79, .1); color: var(--redstone); border: 1px solid rgba(240, 86, 79, .3); }
.alert.info { background: rgba(127, 178, 255, .08); color: var(--himmel); border: 1px solid rgba(127, 178, 255, .25); }

/* --- Dashboard-Tabelle ---------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; }
.chip-status { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.chip-status.active   { color: var(--gras); background: rgba(95, 199, 76, .1); }
.chip-status.pending  { color: var(--fackel); background: rgba(255, 178, 36, .1); }
.chip-status.offline_flagged, .chip-status.suspended { color: var(--redstone); background: rgba(240, 86, 79, .1); }

/* --- Footer --------------------------------------------------------------- */
.site-foot { margin-top: 56px; border-top: 1px solid var(--line-soft); }
.site-foot .inner {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  padding: 22px 0 30px; color: var(--faint); font-size: .85rem;
}
.site-foot a { color: var(--dim); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 900px) {
  .row { grid-template-columns: 38px minmax(0, 1fr) 84px auto; }
  .row .spark-cell, .row .players { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .row { grid-template-columns: 30px minmax(0, 1fr) auto; padding: 11px 12px; }
  .row .votes { display: none; }
  .site-nav a.hide-sm { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .statgrid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* --- Rechtstexte ---------------------------------------------------------- */
.legal h3 { margin: 22px 0 8px; font-size: .95rem; font-weight: 800; color: var(--text); }
.legal h3:first-child { margin-top: 0; }
.legal p { margin: 0 0 10px; }
.legal .highlight-box {
  border: 1px solid var(--fackel); border-radius: 8px;
  padding: 12px 14px; margin: 14px 0;
  background: rgba(255, 178, 36, .06);
}
