.ranks-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.ranks-page-header {
  margin-bottom: 28px;
}

.ranks-page-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.ranks-page-header h1::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: #d32f2f;
  margin-top: 8px;
  border-radius: 2px;
}

.ranks-page-header p {
  color: #888;
  font-size: 0.9rem;
  margin-top: 14px;
}

.ranks-note {
  background: rgba(211, 47, 47, 0.07);
  border-left: 3px solid #d32f2f;
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin-bottom: 40px;
  color: #bbb;
  font-size: 0.9rem;
  line-height: 1.55;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ranks-note i { color: #d32f2f; flex-shrink: 0; margin-top: 2px; }

/* === Abschnitte === */
.ranks-section { margin-bottom: 52px; }

.ranks-section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
}

.ranks-section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  background: #d32f2f;
  margin-top: 8px;
  border-radius: 2px;
}

/* === Logos im Tabellenkopf === */
.cmp-head-row th { vertical-align: bottom; padding-bottom: 14px; }

.cmp-rank-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.cmp-logo-wrap {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: 1px solid #2a2a2a;
  background: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.cmp-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.cmp-logo-wrap i { font-size: 1.2rem; }

.cmp-logo-wrap.no-img img { display: none; }
.cmp-logo-wrap:not(.no-img) i { display: none; }

/* === Shop-Grid === */
.ranks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* === Shop-Karte === */
.rank-card {
  background: #1a1a1a;
  border: 2px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px 20px;
  gap: 10px;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  position: relative;
}

.rank-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rank-color, #444);
}

.rank-card:hover {
  transform: translateY(-6px);
  border-color: var(--rank-color, #d32f2f);
  box-shadow: 0 10px 28px var(--rank-glow, rgba(0,0,0,0.4));
}

/* === Rang-Farben === */
.rank-spieler { --rank-color: #777;     --rank-glow: rgba(119,119,119,0.2); }
.rank-bronze  { --rank-color: #cd7f32; --rank-glow: rgba(205,127,50,0.25); }
.rank-silber  { --rank-color: #a8a9ad; --rank-glow: rgba(168,169,173,0.2); }
.rank-emerald { --rank-color: #50c878; --rank-glow: rgba(80,200,120,0.25); }
.rank-gold    { --rank-color: #f5c518; --rank-glow: rgba(245,197,24,0.25); }
.rank-rubin   { --rank-color: #c0392b; --rank-glow: rgba(192,57,43,0.25); }
.rank-platin  { --rank-color: #8badc0; --rank-glow: rgba(139,173,192,0.25); }
.rank-schoki  { --rank-color: #7c3aed; --rank-glow: rgba(124,58,237,0.3); border-color: rgba(124,58,237,0.25); }

/* Logo */
.rank-logo-wrap {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  border: 2px solid #2a2a2a;
  background: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color 0.28s ease;
}

.rank-card:hover .rank-logo-wrap { border-color: #3a3a3a; }

.rank-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.rank-logo-wrap .rank-icon {
  font-size: 2.2rem;
  color: var(--rank-color, #555);
}

.rank-logo-wrap.no-img img { display: none; }
.rank-logo-wrap:not(.no-img) .rank-icon { display: none; }

/* Name */
.rank-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rank-color, #fff);
  text-align: center;
}

/* Preis */
.rank-price-main {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}

.rank-price-free {
  font-size: 1.05rem;
  font-weight: 600;
  color: #4caf50;
  text-align: center;
}

/* Laufzeit-Badges */
.rank-duration {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 0.78rem;
  font-weight: 600;
}

.rank-duration.lifetime {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.35);
  color: #4caf50;
}

.rank-duration.timed {
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid rgba(100, 116, 139, 0.35);
  color: #94a3b8;
}

.rank-crate-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: #f59e0b;
  font-weight: 500;
}

/* Trennlinie */
.rank-divider {
  width: 100%;
  height: 1px;
  background: #2a2a2a;
}

/* Teaser-Features */
.rank-teaser {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-teaser li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: #999;
}

.rank-teaser li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rank-color, #555);
  flex-shrink: 0;
}

/* Mehr-erfahren-Button */
.rank-btn {
  display: block;
  width: 100%;
  margin-top: auto;
  padding: 10px 0;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid var(--rank-color, #d32f2f);
  background: transparent;
  color: var(--rank-color, #d32f2f);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.rank-btn:hover {
  background: var(--rank-color, #d32f2f);
  color: #fff;
}

/* ===================== */
/* === VERGLEICHSTABELLE === */
/* ===================== */

.cmp-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 2px solid #2a2a2a;
}

.cmp-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

/* Header */
.cmp-table thead tr {
  background: #141414;
  border-bottom: 2px solid #2a2a2a;
}

.cmp-table thead th {
  padding: 14px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.cmp-table thead th.cmp-feature-col {
  text-align: left;
  padding-left: 18px;
  color: #555;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 180px;
}

.cmp-rank {
  display: inline-block;
  font-weight: 700;
}

/* Preis-Zeile */
.cmp-price-row td {
  background: #141414 !important;
  border-bottom: 2px solid #2a2a2a !important;
  font-size: 0.85rem;
  font-weight: 600;
  color: #aaa;
}

.cmp-price-row td:first-child {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #555;
  font-weight: 600;
}

/* Rang-Farben im Header */
.rank-spieler-c { color: #777; }
.rank-bronze-c  { color: #cd7f32; }
.rank-silber-c  { color: #a8a9ad; }
.rank-emerald-c { color: #50c878; }
.rank-gold-c    { color: #f5c518; }
.rank-rubin-c   { color: #c0392b; }
.rank-platin-c  { color: #8badc0; }
.rank-schoki-c  { color: #7c3aed; }

/* Body */
.cmp-table tbody td {
  padding: 10px 10px;
  text-align: center;
  border-bottom: 1px solid #1f1f1f;
  font-size: 0.88rem;
  color: #aaa;
}

.cmp-table tbody td:first-child {
  text-align: left;
  padding-left: 18px;
  color: #bbb;
}

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

.cmp-table tbody tr:not(.cmp-group):hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Kategorie-Zeilen */
.cmp-group td {
  background: #111 !important;
  color: #555;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 18px !important;
  text-align: left !important;
}

.cmp-group td i {
  margin-right: 6px;
  color: #d32f2f;
  font-size: 0.7rem;
}

/* Dauer-Zeile */
.cmp-duration-row td {
  background: #111 !important;
  border-bottom: 1px solid #1e1e1e !important;
  font-size: 0.8rem;
  font-weight: 600;
}

.cmp-duration-row td:first-child {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #555;
  font-weight: 600;
}

.cmp-duration {
  color: #555;
  text-align: center;
  white-space: nowrap;
}

.cmp-duration.lifetime {
  color: #4caf50;
}

.cmp-duration.timed {
  color: #94a3b8;
}

.cmp-duration.standard {
  color: #d32f2f;
}

.cmp-duration i {
  font-size: 0.75rem;
  margin-right: 3px;
}

/* Haken / X */
.cmp-yes { color: #4caf50; font-size: 0.9rem; }
.cmp-no  { color: #2e2e2e; font-size: 0.85rem; }

/* ===================== */
/* === MODAL === */
/* ===================== */
.rank-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.rank-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.rank-modal {
  background: #1a1a1a;
  border: 2px solid #2a2a2a;
  border-radius: 10px;
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}

.rank-modal-overlay.open .rank-modal {
  transform: translateY(0) scale(1);
}

/* farbiger Top-Balken per JS gesetzt */
.rank-modal-bar {
  height: 3px;
  border-radius: 10px 10px 0 0;
}

.rank-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #666;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  z-index: 1;
}

.rank-modal-close:hover { color: #fff; }

.rank-modal-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #242424;
}

.rank-modal-logo {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 2px solid #2a2a2a;
  background: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.rank-modal-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.rank-modal-logo .rank-icon {
  font-size: 2rem;
}

.rank-modal-logo.no-img img { display: none; }
.rank-modal-logo:not(.no-img) .rank-icon { display: none; }

.rank-modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rank-modal-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.rank-modal-prefix {
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: #555;
}

.rank-modal-prefix span { font-weight: 600; }

.rank-modal-body { padding: 20px 24px 24px; }

.rank-modal-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.rank-modal-price-main {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.rank-modal-price-coins {
  font-size: 0.9rem;
  color: #666;
}

.rank-modal-price-free {
  font-size: 1.3rem;
  font-weight: 600;
  color: #4caf50;
}

.rank-modal-price-crate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.88rem;
  color: #f59e0b;
  font-weight: 500;
}

/* Info-Blöcke im Modal (Beschreibung / Verwendung / Rückerstattung) */
.rank-modal-info-block {
  border: 1px solid #252525;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.rank-modal-info-block.warning {
  border-color: rgba(211, 47, 47, 0.3);
  background: rgba(211, 47, 47, 0.05);
}

.rank-modal-info-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rank-modal-info-block.warning .rank-modal-info-label {
  color: #d32f2f;
}

.rank-modal-info-text {
  font-size: 0.88rem;
  color: #aaa;
  line-height: 1.6;
  margin: 0;
}

.rank-modal-info-text strong { color: #ddd; }
.rank-modal-info-text a { color: #888; text-decoration: underline; }
.rank-modal-info-text a:hover { color: #bbb; }

.rank-modal-section-label {
  font-size: 0.72rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.rank-modal-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.rank-modal-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: #bbb;
  line-height: 1.4;
}

.rank-modal-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot-color, #d32f2f);
  flex-shrink: 0;
  margin-top: 5px;
}

.rank-modal-crates {
  background: #141414;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rank-modal-crate-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: #aaa;
}

.rank-modal-crate-item i { font-size: 0.8rem; width: 16px; text-align: center; }
.rank-modal-crate-item i.fa-box      { color: #f59e0b; }
.rank-modal-crate-item i.fa-box-open { color: #7c3aed; }
.rank-modal-crate-item i.fa-gem      { color: #06b6d4; }

/* === Responsive === */
@media (max-width: 900px) {
  .ranks-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .ranks-grid { grid-template-columns: 1fr; }
  .ranks-page { padding-top: 24px; }
}

/* === Light Mode === */
html[data-wiki-theme="light"] .ranks-note {
  background: rgba(211,47,47,0.06);
  color: #555;
}

html[data-wiki-theme="light"] .cmp-wrap {
  border-color: #e0e0e0;
}

html[data-wiki-theme="light"] .cmp-table thead th {
  background: #f5f5f5;
  color: #333;
  border-bottom-color: #ddd;
  border-right-color: #e5e5e5;
}

html[data-wiki-theme="light"] .cmp-feature-col {
  background: #f5f5f5;
  color: #555;
}

html[data-wiki-theme="light"] .cmp-rank-head .cmp-rank {
  color: inherit;
}

html[data-wiki-theme="light"] body .cmp-price-row td {
  background: #f4f4f4 !important;
  color: #444 !important;
  border-bottom-color: #e0e0e0 !important;
}
html[data-wiki-theme="light"] body .cmp-price-row td:first-child { color: #999 !important; }
html[data-wiki-theme="light"] body .cmp-price.free { color: #555 !important; }
html[data-wiki-theme="light"] body .cmp-price.crate { color: #777 !important; }

html[data-wiki-theme="light"] body .cmp-group td {
  background: #e8e8e8 !important;
  color: #777 !important;
}
html[data-wiki-theme="light"] body .cmp-group td i { color: #d32f2f !important; }

html[data-wiki-theme="light"] body .cmp-duration-row td {
  background: #f4f4f4 !important;
  border-bottom-color: #e5e5e5 !important;
}
html[data-wiki-theme="light"] body .cmp-duration-row td:first-child { color: #aaa !important; }

html[data-wiki-theme="light"] body .cmp-table tbody td {
  color: #555 !important;
  border-bottom-color: #eee !important;
  background: #fff !important;
}
html[data-wiki-theme="light"] body .cmp-table tbody td:first-child { color: #333 !important; }

html[data-wiki-theme="light"] body .cmp-table tbody tr:not(.cmp-group):hover td {
  background: #f9f9f9 !important;
}

html[data-wiki-theme="light"] body .cmp-table thead th {
  background: #f0f0f0 !important;
  color: #333 !important;
  border-bottom-color: #ddd !important;
  border-right-color: #e5e5e5 !important;
}

html[data-wiki-theme="light"] body .cmp-no { color: #ccc !important; }

html[data-wiki-theme="light"] body .cmp-logo-wrap {
  background: #e8e8e8 !important;
  border-color: #d5d5d5 !important;
}

html[data-wiki-theme="light"] body .cmp-wrap { border-color: #ddd !important; }
