/* ============================================================
   KINGSDRAFT TRANSFERMARKT — DESIGN SYSTEM & STYLES
   Aesthetic: Premium Collectible Dark Carbon + Neon Emerald & Gold
   ============================================================ */

:root {
  /* Stitch Apex Dossier Surface Hierarchy */
  --bg-canvas: #06080d;
  --bg-main: #06080d;
  --bg-card: #0a0d14;
  --bg-card-hover: #0f141f;
  --bg-card-sub: #151c2c;
  --bg-glass: rgba(15, 20, 31, 0.88);

  /* Titanium Hairlines & Specular Light */
  --border: #1a2232;
  --border-light: rgba(163, 178, 207, 0.2);
  --border-glow: rgba(0, 255, 135, 0.35);
  --hairline-titanium: rgba(163, 178, 207, 0.18);
  --hairline-specular: rgba(255, 255, 255, 0.12);

  /* Electroluminescent Accents (Stitch Apex Dossier) */
  --neon-primary: #00ff87;
  --neon-green: #10b981;
  --neon-green-glow: rgba(0, 255, 135, 0.4);
  --neon-green-bg: rgba(0, 255, 135, 0.1);

  --kl-gold: #f59e0b;
  --kl-gold-glow: rgba(245, 158, 11, 0.35);
  --kl-orange: #ff5722;
  --alert-red: #ff385c;
  --telemetry-cyan: #00d2ff;

  --text-main: #f3f4f6;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --red: #ff385c;
  --yellow: #f59e0b;
  --blue: #00d2ff;

  /* Typography Pairing */
  --font-display: 'Barlow Condensed', 'Rajdhani', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-body: 'Inter', -apple-system, sans-serif;

  /* Architectural Shapes (4px precision corners) */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 25px rgba(0, 255, 135, 0.22);
}

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

html, body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 90% 40%, rgba(244, 175, 35, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-green);
}

/* ============================================================
   HEADER & NAVBAR
   ============================================================ */

.market-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}

.market-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.market-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.market-brand-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.brand-white { color: #fff; }
.brand-green { color: var(--neon-green); text-shadow: 0 0 12px var(--neon-green-glow); }
.brand-badge {
  background: var(--neon-green-bg);
  color: var(--neon-green);
  border: 1px solid var(--neon-green);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.market-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}
.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-card-sub);
}
.nav-link.active {
  color: var(--neon-green);
  background: var(--neon-green-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-back-game {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-back-game:hover {
  color: #fff;
  border-color: var(--kl-gold);
}

/* ============================================================
   CONTAINER & LAYOUT
   ============================================================ */

.market-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* ============================================================
   ELEVATED FULL-WIDTH HERO HUD & TELEMETRY DECK (STITCH APEX DOSSIER)
   ============================================================ */

.market-hero-hud {
  width: 100%;
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.05) 0%, rgba(10, 13, 20, 0.98) 55%, rgba(6, 8, 13, 1) 100%);
  border: 1px solid var(--hairline-titanium);
  border-radius: var(--radius-md);
  padding: 28px 34px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 var(--hairline-specular), var(--shadow-md);
  box-sizing: border-box;
}

.hud-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 255, 135, 0.08);
  border: 1px solid rgba(0, 255, 135, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  margin-bottom: 14px;
}

.hud-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-primary);
  box-shadow: 0 0 10px var(--neon-primary);
  animation: hudPulse 2s infinite ease-in-out;
}

@keyframes hudPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.45; }
}

.hud-status-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--neon-primary);
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.hero-title span {
  color: var(--neon-primary);
  text-shadow: 0 0 20px rgba(0, 255, 135, 0.25);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 900px;
  margin-bottom: 20px;
}

/* Quick Scout Pills (Stitch Tactical Chips) */
.hud-scout-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(6, 8, 13, 0.65);
  border: 1px solid var(--hairline-titanium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 20px;
}

.hud-scout-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--kl-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  margin-right: 4px;
}

.hud-scout-btn {
  background: var(--bg-card);
  border: 1px solid var(--hairline-titanium);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.hud-scout-btn:hover {
  color: #fff;
  border-color: var(--neon-primary);
  transform: translateY(-1px);
}
.hud-scout-btn.active {
  background: var(--neon-green-bg);
  color: var(--neon-primary);
  border-color: var(--neon-primary);
  font-weight: 700;
  box-shadow: 0 0 14px rgba(0, 255, 135, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Global Stats Ticker (Stitch Monospace Telemetry) */
.market-stats-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ticker-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: rgba(6, 8, 13, 0.7);
  border: 1px solid var(--hairline-titanium);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ticker-item:hover {
  border-color: var(--neon-primary);
}
.ticker-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--neon-primary);
  letter-spacing: -0.02em;
}
.ticker-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ============================================================
   CREATOR PARTNER & SPONSOR SHOWCASE BAR
   ============================================================ */

.market-social-bar {
  display: block;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.social-card {
  background: linear-gradient(145deg, rgba(15, 20, 31, 0.95) 0%, rgba(10, 13, 20, 0.98) 100%);
  border: 1px solid var(--hairline-titanium);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: inset 0 1px 0 var(--hairline-specular), 0 8px 24px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  box-sizing: border-box;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
}
.social-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.social-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.social-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.tiktok-icon {
  color: #25f4ee;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 0 6px rgba(37, 244, 238, 0.5));
}

.instagram-icon {
  color: #e1306c;
  display: flex;
  align-items: center;
  filter: drop-shadow(0 0 6px rgba(225, 48, 108, 0.5));
}

/* TikTok Card Specifics */
.social-card-tiktok {
  border-left: 3px solid #25f4ee;
}

.tiktok-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tiktok-profile-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 220px;
}

.tiktok-avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.tiktok-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #25f4ee;
  background: #000;
}
.tiktok-avatar-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid #fe2c55;
  animation: tiktokPulse 2.5s infinite ease-in-out;
  opacity: 0.7;
}
@keyframes tiktokPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 0.2; }
}
.tiktok-verified-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #20d5ec;
  color: #000;
  font-size: 0.65rem;
  font-weight: 900;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #000;
}

.tiktok-text-wrap {
  flex: 1;
  min-width: 0;
}
.tiktok-handle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.tiktok-handle {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}
.badge-partner {
  background: rgba(37, 244, 238, 0.15);
  border: 1px solid rgba(37, 244, 238, 0.4);
  color: #25f4ee;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.tiktok-bio {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.tiktok-stats {
  display: flex;
  gap: 8px;
}
.tiktok-stat-pill {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.tiktok-stat-pill strong {
  color: #fff;
}

.btn-tiktok-cta {
  background: linear-gradient(135deg, #fe2c55 0%, #25f4ee 100%);
  color: #000;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-tiktok-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(254, 44, 85, 0.45);
}
.btn-tiktok-cta .cta-arrow {
  font-size: 1rem;
}

/* Instagram Card Specifics */
.social-card-instagram {
  border-left: 3px solid #e1306c;
}

.btn-refresh-feed {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.btn-refresh-feed:hover {
  background: var(--bg-card-sub);
  color: #fff;
  border-color: var(--neon-green);
}
.btn-refresh-feed.spinning {
  animation: rotateSpin 0.6s linear;
}
@keyframes rotateSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.badge-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-left: 6px;
}
.dot-ping {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: dotPing 1.5s infinite;
}
@keyframes dotPing {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

.ig-feed-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.ig-post-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all 0.25s ease;
}
.ig-post-item:hover {
  border-color: rgba(225, 48, 108, 0.4);
  background: rgba(0, 0, 0, 0.55);
}
.ig-post-item.flash-new {
  animation: flashNeon 2.5s ease-out;
  border-color: var(--neon-green);
}
@keyframes flashNeon {
  0% { background: rgba(16, 185, 129, 0.35); box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
  100% { background: rgba(0, 0, 0, 0.35); box-shadow: none; }
}

.ig-post-thumb-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
}
.ig-post-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ig-post-badge {
  position: absolute;
  top: 1px;
  left: 1px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--neon-green);
  font-size: 0.52rem;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 2px;
}

.ig-post-body {
  flex: 1;
  min-width: 0;
}
.ig-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  font-size: 0.7rem;
}
.ig-post-author {
  color: #e1306c;
  font-weight: 700;
}
.ig-post-time {
  color: var(--text-muted);
}
.ig-post-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.ig-post-caption {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.ig-post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
}
.ig-post-engagement {
  display: flex;
  gap: 10px;
  color: var(--text-muted);
}
.ig-view-btn {
  color: var(--neon-green);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
}
.ig-view-btn:hover {
  text-decoration: underline;
  color: #fff;
}

.ig-feed-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
}
.ig-last-updated {
  color: var(--text-muted);
}
.ig-profile-link {
  color: #e1306c;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
}
.ig-profile-link:hover {
  text-decoration: underline;
  color: #fff;
}

/* Toast Notifications */
.market-social-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--neon-green);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(16, 185, 129, 0.3);
  font-weight: 700;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.market-social-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================================
   SEARCH & FILTERS BAR
   ============================================================ */

.controls-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--neon-green);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.select-filter {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
}
.select-filter:focus {
  border-color: var(--neon-green);
}

/* Competition Pills */
.comp-pills-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.comp-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.comp-pill:hover {
  color: var(--text-main);
  border-color: var(--border-light);
}
.comp-pill.active {
  background: var(--neon-green-bg);
  border-color: var(--neon-green);
  color: var(--neon-green);
  font-weight: 700;
}

/* ============================================================
   DATA TABLES (TRANSFERMARKT STYLE)
   ============================================================ */

.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.table-header-title {
  padding: 18px 22px;
  background: var(--bg-card-sub);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header-title h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-count-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tm-table-container {
  overflow-x: auto;
}

.tm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.tm-table th {
  background: #080b12;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 14px;
  border-bottom: 2px solid var(--hairline-titanium);
  white-space: nowrap;
  user-select: none;
}
.tm-table th.sortable {
  cursor: pointer;
}
.tm-table th.sortable:hover {
  color: var(--neon-primary);
}
.tm-table th.text-center, .tm-table td.text-center { text-align: center; }
.tm-table th.text-right, .tm-table td.text-right { text-align: right; }
.tm-table td.text-center, .tm-table td.text-right {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
}

.tm-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-titanium);
  color: var(--text-secondary);
  white-space: nowrap;
}

.tm-table tbody tr {
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.tm-table tbody tr:hover {
  background: var(--bg-card-hover);
  box-shadow: inset 3px 0 0 var(--neon-primary);
  cursor: pointer;
}
.tm-table tbody tr:hover td {
  color: var(--text-main);
}

/* Special Rows */
.tm-table tfoot tr {
  background: var(--bg-card-sub);
  font-weight: 700;
  border-top: 2px solid var(--neon-primary);
}
.tm-table tfoot td {
  color: var(--text-main);
  padding: 14px;
  font-family: var(--font-mono);
}

/* Player Cell */
.player-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  object-fit: cover;
  flex-shrink: 0;
}
.player-avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--bg-card-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.player-info-cell {
  display: flex;
  flex-direction: column;
}

.player-name-link {
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.player-name-link:hover {
  color: var(--neon-green);
}

.player-meta-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Team Cell */
.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.team-badge-sm {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.team-badge-fallback {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-cross {
  background: rgba(244, 175, 35, 0.15);
  color: var(--kl-gold);
  border: 1px solid rgba(244, 175, 35, 0.35);
}

.badge-role {
  background: var(--bg-card-sub);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
}
.badge-role.gk {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}
.badge-role.df {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}
.badge-role.mf {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}
.badge-role.fw {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.4);
}

.badge-category {
  background: rgba(16, 185, 129, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--bg-card-sub);
  border-top: 1px solid var(--border);
}

.pagination-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.pagination-btn:hover:not(:disabled) {
  border-color: var(--neon-green);
  color: var(--neon-green);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   CROSS-LEAGUE JOURNEY EXPLORER
   ============================================================ */

.cross-journey-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.journey-stop {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.journey-arrow {
  color: var(--kl-gold);
  font-size: 0.9rem;
}

/* ============================================================
   TEAMS GRID
   ============================================================ */

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.team-card:hover {
  transform: translateY(-3px);
  border-color: var(--neon-green);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.team-card-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px;
}

.team-card-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.team-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.team-card-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

/* ============================================================
   MODALS (PLAYER PROFILE & TEAM SHEET)
   ============================================================ */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  position: relative;
  overflow: hidden;
}

.modal-header-banner {
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(22, 30, 43, 0.95) 70%, rgba(244, 175, 35, 0.1) 100%);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.modal-close-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.modal-profile-header {
  display: flex;
  align-items: center;
  gap: 22px;
}

.modal-player-photo {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 3px solid var(--neon-green);
  box-shadow: 0 0 20px var(--neon-green-glow);
  background: var(--bg-card-sub);
}

.modal-player-title h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.modal-player-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.modal-player-specs span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-tab-btn:hover {
  color: var(--text-main);
}
.modal-tab-btn.active {
  color: var(--neon-green);
  border-bottom-color: var(--neon-green);
}

/* Metrics Grid inside Modal */
.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.metric-val {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--neon-green);
}
.metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   TRANSFERMARKT REAL PLAYER LINK BADGE
   ============================================================ */

.btn-tm-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #0b223d 0%, #153a63 100%);
  border: 1px solid #1e528a;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(11, 34, 61, 0.4);
  margin-top: 8px;
}
.btn-tm-link:hover {
  background: linear-gradient(135deg, #153a63 0%, #1f5795 100%);
  border-color: #f58220;
  box-shadow: 0 0 20px rgba(245, 130, 32, 0.35);
  transform: translateY(-2px);
  color: #fff;
}
.tm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f58220;
  box-shadow: 0 0 8px #f58220;
}

/* ============================================================
   STAT CATEGORIES ACCORDION / GRIDS
   ============================================================ */

.stat-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-cat-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.stat-cat-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--neon-green);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.stat-cat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.stat-cat-row:last-child {
  border-bottom: none;
}
.stat-cat-label {
  color: var(--text-secondary);
}
.stat-cat-val {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ============================================================
   SPLIT / SEASON SELECTOR PILLS INSIDE MODAL & VIEWS
   ============================================================ */

.split-selector-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.split-pill-btn {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.split-pill-btn:hover {
  color: var(--text-main);
  border-color: var(--neon-green);
}
.split-pill-btn.active {
  background: var(--neon-green-bg);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

/* Roster Group Headers */
.roster-group-header {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--neon-green);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--neon-green);
  margin: 16px 0 8px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .market-header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .market-nav {
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .search-row {
    flex-direction: column;
  }
  .modal-dialog {
    max-height: 95vh;
    padding: 0;
  }
  .modal-profile-header {
    flex-direction: column;
    text-align: center;
  }
  .modal-player-specs {
    justify-content: center;
  }
}

/* ============================================================
   SOFASCORE BADGE & STANDINGS STYLES
   ============================================================ */

.btn-sofascore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #1b2680 0%, #2c3ec4 100%);
  color: #ffffff !important;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(44, 62, 196, 0.4);
  transition: all 0.2s ease;
}
.btn-sofascore:hover {
  background: linear-gradient(135deg, #2433a8 0%, #3d50df 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(44, 62, 196, 0.6);
  border-color: #ffffff;
}

.standings-pos-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.85rem;
}
.pos-semifinal {
  background: rgba(16, 185, 129, 0.2);
  color: var(--neon-green);
  border: 1px solid rgba(16, 185, 129, 0.5);
}
.pos-quarters {
  background: rgba(244, 175, 35, 0.2);
  color: var(--kl-gold);
  border: 1px solid rgba(244, 175, 35, 0.5);
}
.pos-playin {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.5);
}
.pos-out {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.2s;
}
.match-card:hover {
  border-color: var(--border-light);
}
.match-team {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.match-team.away {
  justify-content: flex-end;
}
.match-score-badge {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--bg-card-sub);
  padding: 4px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  min-width: 70px;
  text-align: center;
  color: var(--text-main);
}

/* ============================================================
   SUGGEST PLAYER BUTTON & MODAL
   ============================================================ */

.btn-suggest-player {
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #000;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.5);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  white-space: nowrap;
}

.btn-suggest-player:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  color: #000;
}

.suggest-dialog {
  max-width: 680px;
  width: 95%;
}

.suggest-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-field-full {
  grid-column: 1 / -1;
}

.suggest-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggest-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.suggest-field input,
.suggest-field select,
.suggest-field textarea {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.suggest-field input:focus,
.suggest-field select:focus,
.suggest-field textarea:focus {
  outline: none;
  border-color: var(--neon-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.suggest-notice {
  background: rgba(244, 175, 35, 0.08);
  border: 1px solid rgba(244, 175, 35, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #fbd38d;
  font-size: 0.82rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.btn-submit-suggest {
  width: 100%;
  background: var(--neon-green);
  color: #000;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.btn-submit-suggest:hover {
  background: #34d399;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.btn-submit-suggest:disabled {
  background: #374151;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.suggest-feedback {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: center;
  font-weight: 600;
  display: none;
}

.suggest-feedback.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--neon-green);
  color: var(--neon-green);
}

.suggest-feedback.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--red);
  color: var(--red);
}

@media (max-width: 640px) {
  .suggest-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   ALBO D'ORO & COMPETITIONS PALMARES STYLING
   ============================================================ */

.comp-nav-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.comp-tab-btn {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comp-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--neon-green);
}
.comp-tab-btn.active {
  background: linear-gradient(135deg, rgba(16,185,129,0.18) 0%, rgba(16,185,129,0.05) 100%);
  border-color: var(--neon-green);
  color: var(--neon-green);
  box-shadow: 0 0 16px rgba(16,185,129,0.25);
}

.comp-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px 0;
  margin-bottom: 20px;
}
.comp-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.comp-filter-btn:hover {
  color: var(--text-main);
  border-color: var(--border-light);
}
.comp-filter-btn.active {
  background: var(--neon-green-bg);
  border-color: var(--neon-green);
  color: var(--neon-green);
}

/* Hall of Fame / Palmares Grid */
.palmares-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.hall-of-fame-card {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-card-sub) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.hall-of-fame-card:hover {
  transform: translateY(-3px);
  border-color: var(--kl-gold);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(244, 175, 35, 0.15);
}
.hall-of-fame-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--kl-gold), transparent);
}

.hof-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.hof-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}
.hof-cluster {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.hof-matchup {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
}
.hof-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  max-width: 120px;
}
.hof-team-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}
.hof-team-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.hof-team-role {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 2px;
}
.hof-team-role.winner {
  color: var(--kl-gold);
}
.hof-team-role.runner {
  color: var(--text-secondary);
}

.hof-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hof-vs {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.hof-score {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  line-height: 1.1;
  margin: 2px 0;
}

.hof-details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 12px;
  margin-bottom: 16px;
  flex: 1;
}
.hof-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.hof-detail-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.hof-detail-val {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
}

/* Notice for France Inactive League */
.comp-notice-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #fbbf24;
  font-size: 0.88rem;
  line-height: 1.5;
}
.comp-notice-icon {
  font-size: 1.4rem;
  line-height: 1;
}

/* Palmares strip inside league card */
.comp-palmares-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.comp-palmares-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-sub);
  border: 1px solid rgba(244, 175, 35, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 700;
}
.comp-palmares-tag img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}




/* ============================================================
   KINGS LEAGUE GLOBAL CLUB RANKING (KL-GCC) STYLING
   ============================================================ */

.ranking-view-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.ranking-hero-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(10, 13, 20, 0.95) 50%, rgba(245, 158, 11, 0.06) 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg, 14px);
  padding: 32px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.ranking-hero-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-primary), var(--kl-gold), transparent);
}

.ranking-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ranking-hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.ranking-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 255, 135, 0.12);
  border: 1px solid rgba(0, 255, 135, 0.3);
  color: var(--neon-primary);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ranking-refresh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--kl-gold);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.ranking-btn-algo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 9px 18px;
  border-radius: var(--radius-md, 8px);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.ranking-btn-algo:hover {
  background: rgba(0, 255, 135, 0.15);
  border-color: var(--neon-primary);
  color: var(--neon-primary);
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.25);
  transform: translateY(-2px);
}

.ranking-hero-title {
  font-family: var(--font-display, inherit);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-main);
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}

.ranking-hero-title span {
  background: linear-gradient(90deg, #fff 0%, var(--neon-primary) 60%, var(--kl-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ranking-hero-sub {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 980px;
  margin: 0;
}

/* Controls Toolbar */
.ranking-category-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 15, 24, 0.7);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  width: fit-content;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 6px;
}

.ranking-cat-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ranking-cat-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.ranking-cat-btn.active {
  background: linear-gradient(135deg, var(--neon-primary) 0%, #00d26a 100%);
  color: #000;
  border-color: var(--neon-primary);
  box-shadow: 0 0 18px rgba(0, 255, 135, 0.4);
}

.ranking-controls-deck {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ranking-tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ranking-tab-btn {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ranking-tab-btn:hover {
  color: var(--text-main);
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.05);
}

.ranking-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.2) 0%, rgba(16, 185, 129, 0.3) 100%);
  border-color: var(--neon-primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 255, 135, 0.3);
}

.ranking-filters-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ranking-search-box {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.ranking-search-box input {
  width: 100%;
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md, 8px);
  padding: 10px 16px 10px 38px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.ranking-search-box input:focus {
  border-color: var(--neon-primary);
  box-shadow: 0 0 8px rgba(0, 255, 135, 0.2);
}

.ranking-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.ranking-select {
  background: var(--bg-canvas);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md, 8px);
  padding: 10px 16px;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.ranking-count-badge {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 14px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--border);
  white-space: nowrap;
}

/* Podium Cards Showcase */
.ranking-podium-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ranking-podium-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 20px;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .ranking-podium-grid {
    grid-template-columns: 1fr;
  }
}

.podium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.podium-card:hover {
  transform: translateY(-4px);
}

.podium-card.first {
  order: 2;
  border-color: rgba(245, 158, 11, 0.6);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, var(--bg-card) 60%);
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.2);
  padding: 32px 24px 28px;
}

.podium-card.second {
  order: 1;
  border-color: rgba(163, 178, 207, 0.45);
  background: linear-gradient(180deg, rgba(163, 178, 207, 0.08) 0%, var(--bg-card) 60%);
}

.podium-card.third {
  order: 3;
  border-color: rgba(205, 127, 50, 0.45);
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.08) 0%, var(--bg-card) 60%);
}

@media (max-width: 900px) {
  .podium-card.first { order: 1; }
  .podium-card.second { order: 2; }
  .podium-card.third { order: 3; }
}

.podium-rank-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 0.85rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.podium-card.first .podium-rank-badge {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.podium-card.second .podium-rank-badge {
  background: rgba(163, 178, 207, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(163, 178, 207, 0.4);
}

.podium-card.third .podium-rank-badge {
  background: rgba(205, 127, 50, 0.2);
  color: #f6ad55;
  border: 1px solid rgba(205, 127, 50, 0.4);
}

.podium-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 12px 0 10px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.6));
}

.podium-card.first .podium-logo {
  width: 90px;
  height: 90px;
}

.podium-name {
  font-family: var(--font-display, inherit);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 4px;
}

.podium-president {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.podium-league {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #bbb;
  background: var(--bg-card-sub);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.podium-pts {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--neon-primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.podium-card.first .podium-pts {
  font-size: 2.2rem;
  color: #fbbf24;
  text-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
}

.podium-pts-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 14px;
}

.podium-meta-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.podium-pill {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.podium-btn-detail {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md, 8px);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.podium-btn-detail:hover {
  background: rgba(0, 255, 135, 0.15);
  border-color: var(--neon-primary);
  color: var(--neon-primary);
}

/* Global Ranking Table */
.ranking-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.ranking-table-scroll {
  overflow-x: auto;
  width: 100%;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.ranking-table th {
  background: var(--bg-card-sub);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ranking-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  color: var(--text-main);
}

.ranking-table tr.ranking-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.ranking-table tr.ranking-row:hover {
  background: rgba(0, 255, 135, 0.04);
}

.ranking-pos-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.95rem;
}

.pos-tier-badge {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 900;
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
}

.tier-diamond .pos-tier-badge {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.6);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.tier-platinum .pos-tier-badge {
  background: rgba(163, 178, 207, 0.2);
  border-color: rgba(163, 178, 207, 0.6);
  color: #f1f5f9;
}

.tier-gold .pos-tier-badge {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
}

.tier-silver .pos-tier-badge {
  background: rgba(156, 163, 175, 0.15);
  border-color: rgba(156, 163, 175, 0.4);
  color: #9ca3af;
}

/* Trend Pill */
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.trend-up {
  background: rgba(0, 255, 135, 0.15);
  color: var(--neon-primary);
  border: 1px solid rgba(0, 255, 135, 0.3);
}

.trend-down {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.trend-same {
  color: var(--text-muted);
}

.trend-new {
  background: rgba(245, 158, 11, 0.15);
  color: var(--kl-gold);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Club Cell */
.ranking-club-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ranking-club-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.ranking-club-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ranking-club-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
}

.ranking-club-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ranking-points-badge {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--neon-primary);
  letter-spacing: -0.3px;
}

.ranking-action-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ranking-action-btn:hover {
  background: rgba(0, 255, 135, 0.15);
  border-color: var(--neon-primary);
  color: var(--neon-primary);
}

/* Modal Algoritmo Trasparente */
.algo-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.algo-card {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 10px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.algo-card-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.algo-card-pts {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--neon-primary);
  background: rgba(0, 255, 135, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

.algo-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.algo-formula-box {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.08) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px dashed var(--neon-primary);
  border-radius: var(--radius-md, 10px);
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}

.algo-formula-text {
  font-family: monospace, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

/* Modal Scheda Club */
.club-modal-header-deck {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.club-modal-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.club-modal-info h2 {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0 0 4px;
  color: var(--text-main);
}

.club-modal-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.club-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.club-stat-box {
  background: var(--bg-card-sub);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding: 14px;
  text-align: center;
}

.club-stat-box .val {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-main);
}

.club-stat-box .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 4px;
}

.club-trophies-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.club-trophy-badge {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 6px 12px;
  border-radius: var(--radius-md, 8px);
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
