:root{
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #fafafa;
  --text: #0b0f19;
  --signal: #EE6352;
  --signal_hover: #eb4a35;
  --muted: rgba(11, 15, 25, 0.60);
  --muted2: rgba(11, 15, 25, 0.40);
  --border: rgba(11, 15, 25, 0.10);
  --border2: rgba(11, 15, 25, 0.07);
  --shadow: 0 8px 24px rgba(11,15,25,0.08);
  --shadow2: 0 2px 50px rgba(11,15,25,0.06);
  --radius: 12px;
  --radiusSm: 12px;
  --pad: 40px;
  --padSm: 14px;
}

* { box-sizing: border-box; }

html, body {
  scroll-behavior: auto;
  scroll-behavior: smooth;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  background-repeat: no-repeat;
  background-color: #a5b4bb;
  background-size: 100% 100vh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: all ease-in-out 0.2s;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 80vh;
  pointer-events: none;
  z-index: -1;

  background: linear-gradient(to bottom, #eaf0f2 0%, #a5b4bb 100%);
}

a { 
  color: inherit; text-decoration: none; 
}
a:hover { text-decoration: underline; }

header, main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 22px;
}

header {
  text-align: center;
  padding: 40px 0px;
  position: absolute;
  z-index: 99;
  right: 0;
  left: 0;
  margin: 0 auto;
  align-items: center;
  font-size: 1.5em;
  background: none;
  color: #0b0f19;
  display: flex;
  transition: all ease-in-out 0.3s;
}

footer {
  margin-top: 200px;
  padding: 40px;
  background: rgba(0,0,0,0.15);
  color: #fff;
  text-align: center;
}

h1 {
  font-size: 4em;
  letter-spacing: -0.02em;
  margin: 0;
}

h2 {
  font-size: 2em;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

h3 {
  font-size: 1.5em;
  margin: 0 0 10px;
  font-weight: 650;
}

p, .muted {
  color: var(--muted);
}

li, .muted {
  color: var(--muted);
}

.controls {
  gap: 12px;
  align-items: center;
  margin: 20px auto 0px auto;
  width: 250px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.7);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(8px);
}

label {
  font-size: 12px;
  color: var(--muted);
}

select {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  outline: none;
}

select:focus {
  border-color: rgba(11,15,25,0.22);
  box-shadow: 0 0 0 3px rgba(11,15,25,0.06);
}

.controls select {
  margin-left: 5px;
}

section {
  margin-top: 72px;
  padding: var(--pad);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow2);
}

.hero {
  text-align: center;
  padding: 270px 0px 200px 0px;
}

@media (max-width: 760px) {
  .hero {
    padding: 140px 0px 60px 0px;
  }
  h1 {
    font-size: 3em !important;
  }
  h2 {
        font-size: 1.5em !important;
  }
  #kwLabel {
    font-size: 1.5em !important;
  }
  header {
    font-size: 1.3em !important;
  }
  footer {
    font-size: 0.8em !important;
    margin-top: 100px !important;
  }
}

#kwLabel {
  font-size: 2em;
  margin: 10px 0px;
}

table {
  overflow: hidden;
}

th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 18px;
}

/* Aktiver Sort */
th.sortable[data-active="1"][data-dir="desc"]::after {
  content: "▼";
  opacity: 0.9;
}

th.sortable[data-active="1"][data-dir="asc"]::after {
  content: "▲";
  opacity: 0.9;
}

/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.kpi {
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 14px;
  background: linear-gradient(180deg, #fff 0%, #fcfcfc 100%);
}

.kpiLabel {
  font-size: 12px;
  color: var(--muted);
}

.kpiValue {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

/* Tables */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface);
}

#topTable {
  overflow: auto;
}

#topPosts {
  overflow: auto;
}

#partyTable {
  overflow: auto;
}

thead th {
  text-align: left;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #fff 0%, #fbfbfb 100%);
  z-index: 1;
}

th, td {
  border-bottom: 1px solid var(--border2);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

tbody tr:hover {
  background: rgba(11,15,25,0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 18px;
}

.sortable:hover {
  color: rgba(11,15,25,0.85);
  text-decoration: none;
}

/* Aktiver Header */
th[data-active="1"] {
  color: #0b0f19;
  font-size: 0.9em;
  background: rgba(11,15,25,0.06);
}

/* Aktive Sort-Spalte im Body */
td.col-active {
  background: rgba(11,15,25,0.035);
}

/* Pfeile nur für aktive Sort-Spalte */
th.sortable[data-active="1"][data-dir="desc"]::after {
  content: "▼";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.75;
}

th.sortable[data-active="1"][data-dir="asc"]::after {
  content: "▲";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  opacity: 0.75;
}

/* kein generisches attr(data-dir) mehr */
th[data-active="1"]::after {
  margin-left: 0;
  color: var(--muted2);
}

/* Movers */
.movers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 760px) {
  .movers-grid { grid-template-columns: 1fr; }
}

.movers-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface2);
}

.movers-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border2);
}

.movers-list li:last-child {
  border-bottom: none;
}

.movers-delta {
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 750;
  min-width: 56px;
  text-align: center;
}

/* Top posts */
.post-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(11,15,25,0.03);
  margin-bottom: 12px;
}

.tab {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 750;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow2);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1100px) {
  .posts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .posts-grid { grid-template-columns: 1fr; }
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow2);
  transition: transform .12s ease, box-shadow .12s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.post-card img {
  width: 100%;
  height: 325px;
  object-fit: cover;
  background: var(--surface2);
}

.thumb-placeholder {
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, rgba(11,15,25,0.06), rgba(11,15,25,0.02));
}

.meta {
  padding: 12px 12px 14px;
  display: grid;
  gap: 8px;
}

.who {
  font-size: 13px;
  line-height: 1.25;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.stats span {
  padding: 4px 8px;
  border: 1px solid var(--border2);
  border-radius: 999px;
  background: rgba(11,15,25,0.02);
}

/* Small helpers */
.muted {
  color: var(--muted);
}

.rank-change {
  font-weight: 600;
  white-space: nowrap;
}

.rank-up {
  color: #1a7f37;
}

.rank-down {
  color: #c62828;
}

.rank-same {
  color: #777;
}

.rank-new {
  color: #555;
  font-style: italic;
}

.section_solo {
  margin-top: 200px;
}

@media (max-width: 760px) {
  .section_solo {
    margin-top: 120px;
  }
}

.back-to-top {
  position: fixed;
  right: 36px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#navlogo {
  width: 42px;
  margin-right: 16px;
}

/* -------------------------
   Navigation
------------------------- */

.site-nav {
  width: 100%;
}

.nav_contents {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
}

.nav-logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

#navlogo {
  width: 42px;
  display: block;
}

.site-nav a {
  color: inherit;
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav .links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.site-nav .links a {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.nav-pro-link {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--signal);
  box-shadow: var(--shadow2);
  font-size: 1em;
  font-weight: 600;
  color: #ffffff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all ease-in-out 0.3s;
}

.nav-pro-link:hover {
  background: var(--signal_hover);
  text-decoration: none !important;
}

/* Burger button */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: rgba(255,255,255,0.7);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #0b0f19;
  border-radius: 999px;
  transition: all ease-in-out 0.2s;
}

/* Mobile nav */
@media (max-width: 760px) {
  header {
    padding: 36px 40px;
    font-size: 1.1em !important;
  }

  .nav_contents {
    max-width: none;
    gap: 16px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav .links {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;

    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;

    padding: 14px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.85);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
  }

  .site-nav .links.is-open {
    display: flex;
  }

  .site-nav .links a,
  .site-nav .links .nav-pro-link {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 16px;
    border-radius: 12px;
    background: transparent;
    box-shadow: none;
  }

  .site-nav .links .nav-pro-link {
    background: var(--surface);
    box-shadow: var(--shadow2);
  }

  .site-nav .links a:hover,
  .site-nav .links .nav-pro-link:hover {
    text-decoration: none;
    background: rgba(11,15,25,0.04);
  }

  .site-nav .links .nav-pro-link:hover {
    background: #d0d0d7;
  }
}

.cta-banner {
  margin: 32px 0;
  padding: 28px;
  background: var(--signal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  text-align: center;
}

.cta-content h3 {
  margin-bottom: 10px;
  color: #ffffff;
  font-size: 20px;
}

.cta-content p {
  margin-bottom: 18px;
  color: #ffffff;
  font-size: 15px;
  line-height: 1.5;
}

.cta-button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radiusSm);
  background: var(--text);
  color: white;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
}

.cta-button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}