:root {
  --bg:        #0a0b14;
  --bg-2:      #11131f;
  --surface:   rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border:    rgba(255, 255, 255, 0.09);
  --text:      #e8eaf2;
  --text-dim:  #9aa0b5;
  --text-mute: #626880;
  --accent:    #6c5ce7;
  --accent-2:  #00d2ff;
  --online:    #22d37e;
  --offline:   #ff5470;
  --checking:  #f5b342;
  --radius:    16px;
  --shadow:    0 10px 40px rgba(0, 0, 0, 0.45);
  --grad:      linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 12% -10%, rgba(108, 92, 231, 0.18), transparent 60%),
    radial-gradient(50rem 40rem at 100% 0%, rgba(0, 210, 255, 0.12), transparent 55%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------------- Header ---------------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 11, 20, 0.72);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo .mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.45);
}
.logo span.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.search {
  flex: 1;
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}
.search input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color .2s, background .2s;
}
.search input:focus { border-color: var(--accent); background: var(--surface-2); }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-mute); }
.admin-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-weight: 600; font-size: 0.9rem;
  transition: all .2s;
  white-space: nowrap;
}
.admin-btn:hover { color: var(--text); border-color: var(--accent); background: var(--surface-2); }

/* ---------------- Layout ---------------- */
main { max-width: 1200px; margin: 0 auto; padding: 32px 20px 80px; }

.hero { text-align: center; padding: 24px 0 18px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; }
.hero p { color: var(--text-dim); margin-top: 8px; font-size: 1.05rem; }

.stats {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin: 26px 0 10px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 22px;
  min-width: 130px;
  text-align: center;
}
.stat .num { font-size: 1.6rem; font-weight: 800; }
.stat .num.on { color: var(--online); }
.stat .label { color: var(--text-mute); font-size: 0.82rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

/* ---------------- Category chips ---------------- */
.chips {
  display: flex; gap: 9px; flex-wrap: wrap;
  margin: 28px 0 8px;
  justify-content: center;
}
.chip {
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 0.88rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .18s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(108,92,231,.35); }
.chip .cnt { opacity: .7; font-size: .8rem; }

/* ---------------- Category section ---------------- */
.cat-section { margin-top: 44px; }
.cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cat-head .ic {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--accent-2);
}
.cat-head h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.cat-head .desc { color: var(--text-mute); font-size: .9rem; }

/* ---------------- Link grid & cards ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform .18s, border-color .18s, background .18s;
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0;
  background: var(--grad); opacity: 0; transition: opacity .25s;
  mix-blend-mode: overlay; pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: rgba(108,92,231,.5); background: var(--surface-2); }
.card:hover::after { opacity: .06; }

.card-top { display: flex; align-items: center; gap: 12px; }
.favicon {
  width: 42px; height: 42px; border-radius: 11px;
  background: #fff; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--border);
}
.favicon img { width: 26px; height: 26px; }
.favicon .fallback { font-weight: 800; color: var(--accent); font-size: 1.1rem; }
.card-title { flex: 1; min-width: 0; }
.card-title .name { font-weight: 700; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title .domain { color: var(--text-mute); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card .desc { color: var(--text-dim); font-size: .9rem; margin: 12px 0 14px; flex: 1; }

.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .82rem; font-weight: 600;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border);
}
.status .dot { width: 9px; height: 9px; border-radius: 50%; position: relative; }
.status.online  { color: var(--online); }
.status.online .dot  { background: var(--online); box-shadow: 0 0 0 0 rgba(34,211,126,.7); animation: pulse 2s infinite; }
.status.offline { color: var(--offline); }
.status.offline .dot { background: var(--offline); }
.status.checking { color: var(--checking); }
.status.checking .dot { background: var(--checking); animation: blink 1s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(34,211,126,.6)} 70%{box-shadow:0 0 0 8px rgba(34,211,126,0)} 100%{box-shadow:0 0 0 0 rgba(34,211,126,0)} }
@keyframes blink { 50% { opacity: .35; } }

.visit {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 600; color: var(--accent-2);
}
.card:hover .visit { color: var(--text); }

.foot-right { display: flex; align-items: center; gap: 12px; }
.clicks {
  color: var(--text-mute); font-size: .78rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.clicks i { width: 13px; height: 13px; }

.badge-new {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  background: var(--grad); color: #fff;
  font-size: .62rem; font-weight: 800; letter-spacing: .08em;
  padding: 3px 8px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(108,92,231,.45);
}

/* Sortierleiste */
.sortbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  margin-top: 14px; color: var(--text-dim); font-size: .9rem;
}
.sortbar label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sortbar label i { width: 15px; height: 15px; }
.sortbar select {
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text);
  font-family: inherit; font-size: .9rem; outline: none; cursor: pointer;
}
.sortbar select:focus { border-color: var(--accent); }
/* Aufgeklappte Optionsliste braucht eine SOLIDE Farbe (sonst helle Schrift auf hellem Grund) */
.sortbar select option {
  background-color: #11131f;
  color: #e8eaf2;
}

/* ---------------- Empty / loading ---------------- */
.empty { text-align: center; color: var(--text-mute); padding: 70px 20px; }
.skeleton { animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { 50% { opacity: .4; } }

footer {
  text-align: center; color: var(--text-mute); font-size: .85rem;
  padding: 36px 20px; border-top: 1px solid var(--border); margin-top: 40px;
}
footer a { color: var(--text-dim); }

/* ---------------- Responsive ---------------- */
@media (max-width: 680px) {
  .header-inner { flex-wrap: wrap; }
  .search { order: 3; max-width: none; width: 100%; }
  .grid { grid-template-columns: 1fr; }
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .3s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
