/* =====================================================
   FPL Analyzer 25/26  Premier League Design System
   ===================================================== */

/*  PL Colour Tokens  */
:root {
  --pl-purple: #111113;
  --pl-purple2: #18181b;
  --pl-purple3: #0a0a0b;
  --pl-card: #26262a;
  --pl-card2: #18181b;
  --pl-overlay: #111113e0;
  --pl-green: #00ff87;
  --pl-magenta: #5eead4;
  --pl-cyan: #00d4ff;
  --pl-yellow: #fadd00;
  --pl-red: #ff3b5c;
  --pl-orange: #ff7b43;

  --gkp: #f5a623;
  --def: #00e676;
  --mid: #00d4ff;
  --fwd: #ff3b5c;

  --fdr-1: #00e676;
  --fdr-2: #b0e040;
  --fdr-3: #a0a0b0;
  --fdr-4: #ff7b43;
  --fdr-5: #ff3b5c;

  --text-primary: #ffffff;
  --text-secondary: #c0a8c8;
  --text-muted: #7a5a82;

  --border: rgba(255, 255, 255, 0.1);
  --border-bright: rgba(0, 255, 135, 0.35);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glow-green: 0 0 24px rgba(0, 255, 135, 0.25);

  --transition: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-head: 'Premier', 'Space Grotesk', sans-serif;
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-hover: 0 18px 50px rgba(0, 255, 135, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);

  --bg-mesh-1: rgba(94, 234, 212, 0.18);
  --bg-mesh-2: rgba(0, 212, 255, 0.10);
  --bg-mesh-3: #0a0a0b;
  --bg-mesh-4: #18181b;
  --bg-mesh-5: #15001a;
  --bg-mesh-grid: rgba(255, 255, 255, 0.015);
  --header-bg: rgba(10, 10, 11, 0.55);

  --input-bg: rgba(0, 0, 0, 0.3);
  --input-border: rgba(255, 255, 255, 0.12);
  --input-color: #ffffff;

  --nav-bg: rgba(10, 10, 11, 0.9);
  --nav-border: rgba(255, 255, 255, 0.08);
  --nav-btn-text: rgba(255, 255, 255, 0.5);
  --nav-btn-hover: rgba(255, 255, 255, 0.8);
  --nav-btn-hover-bg: rgba(255, 255, 255, 0.05);
  --nav-btn-active: #ffffff;
}

:root.light-mode {
  /* Surfaces — warm off-white, not clinical pure white */
  --pl-purple: #fafaf7;
  --pl-purple2: #f4f1ec;
  --pl-purple3: #ece8e0;
  --pl-card: #ffffff;
  --pl-card2: #faf7f4;
  --pl-overlay: rgba(255, 255, 255, 0.85);

  /* Brand accents — preserved at near-full saturation */
  --pl-green: #00b85e;
  --pl-magenta: #0f766e;
  --pl-cyan: #0095c7;
  --pl-yellow: #e8b800;
  --pl-red: #e8264c;
  --pl-orange: #e06d2e;

  /* Position tokens tuned for white backgrounds */
  --gkp: #e69500;
  --def: #00a85a;
  --mid: #0095c7;
  --fwd: #e8264c;

  --fdr-1: #00a85a;
  --fdr-2: #7fb83a;
  --fdr-3: #8a8a98;
  --fdr-4: #e06d2e;
  --fdr-5: #e8264c;

  /* Warm text hierarchy — replaces flat #000 sledgehammer */
  --text-primary: #0d0a14;
  --text-secondary: #5b525d;
  --text-muted: #8b8190;

  --border: rgba(24, 24, 27, 0.07);
  --border-bright: rgba(0, 184, 94, 0.45);

  /* Refined layered shadows — hairline + ambient lift */
  --shadow: 0 0.5px 0 rgba(24, 24, 27, 0.04), 0 1px 2px rgba(24, 24, 27, 0.05), 0 8px 24px -12px rgba(24, 24, 27, 0.12);
  --shadow-card: 0 0.5px 0 rgba(24, 24, 27, 0.04), 0 1px 2px rgba(24, 24, 27, 0.05), 0 18px 40px -20px rgba(24, 24, 27, 0.16);
  --shadow-hover: 0 1px 2px rgba(24, 24, 27, 0.06), 0 28px 56px -24px rgba(0, 184, 94, 0.28);
  --glow-green: 0 0 24px rgba(0, 184, 94, 0.18);

  /* Softer corners in light = modern feel */
  --radius: 14px;
  --radius-sm: 10px;

  /* Ambient gradient mesh — bumped opacity & warmer base */
  --bg-mesh-1: rgba(94, 234, 212, 0.10);
  --bg-mesh-2: rgba(0, 149, 199, 0.08);
  --bg-mesh-3: #fbfaf6;
  --bg-mesh-4: #f5efe6;
  --bg-mesh-5: #faf6ef;
  --bg-mesh-grid: rgba(24, 24, 27, 0.025);
  --header-bg: rgba(255, 255, 255, 0.62);

  --input-bg: #ffffff;
  --input-border: rgba(24, 24, 27, 0.10);
  --input-color: #0d0a14;

  --nav-bg: rgba(255, 255, 255, 0.88);
  --nav-border: rgba(24, 24, 27, 0.07);
  --nav-btn-text: rgba(24, 24, 27, 0.55);
  --nav-btn-hover: rgba(24, 24, 27, 0.9);
  --nav-btn-hover-bg: rgba(24, 24, 27, 0.04);
  --nav-btn-active: #0d0a14;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--pl-purple3);
  color: var(--text-primary);
  min-height: 100vh;
}

/*  Background  */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 15% 0%, var(--bg-mesh-1) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 30%, var(--bg-mesh-2) 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(0, 255, 135, 0.08) 0%, transparent 60%),
    linear-gradient(170deg, var(--bg-mesh-3) 0%, var(--bg-mesh-4) 50%, var(--bg-mesh-5) 100%);
}

.bg-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 79px, var(--bg-mesh-grid) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, var(--bg-mesh-grid) 80px);
}

/*  Header  */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(0, 255, 135, 0.25);
  padding: 0 2rem;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 50px;
  padding: 6px 0;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 12px rgba(0, 255, 135, 0.4);
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.logo-text span {
  background: linear-gradient(90deg, var(--pl-green), var(--pl-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.season-pill {
  background: linear-gradient(135deg, var(--pl-magenta), #22d3ee);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(94, 234, 212, 0.3);
}

.gw-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.gw-live {
  background: rgba(0, 255, 135, 0.1);
  border-color: rgba(0, 255, 135, 0.3);
  color: var(--pl-green);
}

.gw-upcoming {
  background: rgba(250, 221, 0, 0.15);
  border-color: rgba(250, 221, 0, 0.3);
  color: var(--pl-yellow);
}

.gw-finished {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
}

.gw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pl-green);
  box-shadow: 0 0 8px var(--pl-green);
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.4
  }
}

/*  Nav Tabs (Bottom App Nav)  */
.main-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(10, 10, 11, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.5);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabs-inner {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  height: 72px;
  -webkit-overflow-scrolling: touch;
}

.tabs-inner::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  transition: var(--transition);
  cursor: pointer;
  padding: 8px 12px;
  flex: 0 0 auto;
  min-width: 75px;
}

.tab-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.tab-btn span {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--text-primary);
  position: relative;
}

.tab-btn.active span {
  font-weight: 800;
}

.tab-btn.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--pl-magenta);
  border-radius: 0 0 4px 4px;
}

.tab-btn.active svg {
  transform: translateY(-2px);
  color: var(--text-primary);
}

/*  Hero  */
.hero {
  position: relative;
  z-index: 1;
  background: transparent;
  border-bottom: none;
}

.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 24px 1.25rem 20px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.3);
  color: var(--pl-magenta);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
  backdrop-filter: blur(10px);
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--pl-magenta);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--pl-magenta);
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 18px;
}

.hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--pl-green) 0%, var(--pl-cyan) 50%, var(--pl-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 24px rgba(0, 255, 135, 0.25));
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 28px;
}

.hero-kpis {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  padding-left: 14px;
}

.kpi::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--pl-green);
  border-radius: 2px;
  opacity: 0.55;
}

.kpi-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  background: linear-gradient(180deg, var(--pl-green), #00cc6c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}

.hero-pitch {
  width: 240px;
  height: 320px;
  background: linear-gradient(165deg, rgba(26, 94, 42, 0.85) 0%, rgba(31, 112, 53, 0.7) 50%, rgba(26, 94, 42, 0.85) 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
  animation: floatUp 6s ease-in-out infinite;
}

@keyframes floatUp {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-12px)
  }
}

.hero-pitch::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 29px, rgba(255, 255, 255, 0.04) 30px);
}

.mini-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.mini-p {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.mini-p.gkp {
  background: var(--gkp);
  color: #000;
}

.mini-p.def {
  background: var(--def);
  color: #000;
}

.mini-p.mid {
  background: var(--mid);
  color: #000;
}

.mini-p.fwd {
  background: var(--fwd);
  color: #fff;
}

/*  Section Container  */
.section-wrap {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 1.25rem 80px;
}

/* Page views - only one visible at a time */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

/*  API Key Banner  */
.api-key-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(0, 212, 255, 0.07);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.api-key-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pl-cyan);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

.api-key-input {
  flex: 1;
  min-width: 200px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--input-color);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.api-key-input:focus {
  border-color: var(--pl-cyan);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

.api-key-input::placeholder {
  color: var(--text-muted);
  font-family: inherit;
}

.api-key-link {
  font-size: 0.8rem;
  color: var(--pl-cyan);
  text-decoration: none;
  white-space: nowrap;
}

.api-key-link:hover {
  text-decoration: underline;
}

/*  Upload Zone  */
.upload-zone {
  border: 2px dashed rgba(0, 255, 135, 0.3);
  border-radius: var(--radius);
  background: rgba(0, 255, 135, 0.03);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  margin-bottom: 28px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--pl-green);
  background: rgba(0, 255, 135, 0.07);
  box-shadow: var(--glow-green);
}

.upload-content {
  text-align: center;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(0, 255, 135, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.8rem;
}

.upload-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.upload-link {
  color: var(--pl-green);
  cursor: pointer;
  font-weight: 700;
}

.upload-formats {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.upload-preview {
  width: 100%;
  padding: 16px;
  position: relative;
}

.upload-preview img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 8px;
}

.remove-img {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 59, 92, 0.85);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.remove-img:hover {
  background: var(--pl-red);
}

/*  Divider  */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
}

.divider span {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/*  Slot Grid  */
.slot-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slot-group-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 4px 2px;
}

.player-slot {
  display: grid;
  grid-template-columns: 50px 1fr 36px;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  position: relative;
  transition: var(--transition);
}

.player-slot:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 255, 135, 0.15);
}

.slot-pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 22px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.slot-pos-badge.GKP {
  background: rgba(245, 166, 35, 0.2);
  color: var(--gkp);
}

.slot-pos-badge.DEF {
  background: rgba(0, 230, 118, 0.2);
  color: var(--def);
}

.slot-pos-badge.MID {
  background: rgba(0, 212, 255, 0.2);
  color: var(--mid);
}

.slot-pos-badge.FWD {
  background: rgba(255, 59, 92, 0.2);
  color: var(--fwd);
}

.player-search {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
}

.player-search::placeholder {
  color: var(--text-muted);
}

.slot-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  justify-self: center;
  transition: var(--transition);
}

.slot-indicator.selected {
  background: var(--pl-green);
  box-shadow: 0 0 8px var(--pl-green);
}

/* Autocomplete */
.autocomplete-list {
  position: absolute;
  z-index: 9999;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #18181b;
  border: 1px solid rgba(0, 255, 135, 0.3);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.autocomplete-item {
  padding: 9px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: rgba(0, 255, 135, 0.08);
}

.ac-name {
  flex: 1;
  font-weight: 600;
}

.ac-team {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.ac-price {
  font-size: 0.78rem;
  color: var(--pl-cyan);
  font-weight: 700;
}

.ac-ep {
  font-size: 0.75rem;
  color: var(--pl-green);
  font-weight: 700;
}

/*  Analyze Button  */
.analyze-btn {
  width: 100%;
  margin-top: 28px;
  background: linear-gradient(180deg, #00ff87, #00d971);
  color: #001a0e;
  border: none;
  border-radius: var(--radius);
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), background 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 255, 135, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transform: translateY(0);
}

.analyze-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.analyze-btn:hover::after {
  transform: translateX(100%);
}

.analyze-btn:hover {
  background: linear-gradient(180deg, #00ffa0, #00e07a);
  box-shadow: 0 14px 36px rgba(0, 255, 135, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.analyze-btn:active {
  box-shadow: 0 4px 12px rgba(0, 255, 135, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(0);
}

.analyze-btn:disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.analyze-btn:disabled::after {
  display: none;
}

.spin {
  width: 20px;
  height: 20px;
  animation: spinAnim 0.8s linear infinite;
}

@keyframes spinAnim {
  to {
    transform: rotate(360deg);
  }
}

/*  Loading Overlay  */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(18, 0, 24, 0.94);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-card {
  background: var(--pl-card);
  border: 1px solid rgba(0, 255, 135, 0.25);
  border-radius: 20px;
  padding: 44px 52px;
  width: min(460px, 90vw);
  text-align: center;
  box-shadow: 0 0 60px rgba(0, 255, 135, 0.1);
}

.loading-ball {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 24px;
  background: conic-gradient(var(--pl-green) 0%, var(--pl-cyan) 35%, transparent 55%);
  animation: spinAnim 0.9s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.loading-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.loading-sub {
  color: var(--text-secondary);
  font-size: 0.87rem;
  margin-bottom: 22px;
}

.progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-bottom: 22px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pl-green), var(--pl-cyan));
  border-radius: 2px;
  width: 0;
  transition: width 0.5s ease;
}

.loading-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.l-step {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.l-step.active {
  color: var(--pl-green);
  font-weight: 700;
}

.l-step.done {
  color: var(--text-secondary);
}

/*  Results Sub-Nav  */
.results-subnav {
  display: flex;
  gap: 0;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
  position: relative;
}

.rsnav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--nav-btn-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'Space Grotesk', sans-serif;
  position: relative;
}

.rsnav-icon {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.rsnav-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.rsnav-btn:hover {
  color: var(--nav-btn-hover);
  background: var(--nav-btn-hover-bg);
}

.rsnav-btn.active {
  color: var(--nav-btn-active);
  background: rgba(0, 255, 135, 0.08);
}

.rsnav-btn.active .rsnav-label {
  color: var(--pl-green);
}

.rsnav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 15%;
  right: 15%;
  height: 3px;
  background: var(--pl-green);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 8px var(--pl-green);
}

/*  Results Panels  */
.results-panel {
  display: none;
}

.results-panel.active {
  display: block;
}

.league-panel {
  display: none;
  animation: slideUp 0.3s ease;
}

.league-panel.active {
  display: block;
}

/*  Results  */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.results-title h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.results-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.score-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.score-card {
  background: linear-gradient(145deg, rgba(38, 38, 42, 0.6), rgba(38, 38, 42, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: center;
  min-width: 110px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.score-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 3px;
  background: var(--pl-green);
  opacity: 0.85;
}

.score-card:has(.score-val.mag)::before {
  background: var(--pl-magenta);
}

.score-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 255, 135, 0.25);
  box-shadow: var(--shadow-hover);
}

.score-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--pl-green);
  display: block;
  line-height: 1.05;
}

.score-val.mag {
  color: var(--pl-magenta);
}

.score-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}

/*  Pitch  */
.pitch-view {
  margin-bottom: 32px;
}

.pitch-bg {
  background: linear-gradient(180deg, #145c25 0%, #1a7030 25%, #1d7a35 50%, #1a7030 75%, #145c25 100%);
  border-radius: 16px;
  overflow: hidden;
  padding: 24px 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  min-height: 460px;
}

.pitch-stripes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg,
      rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px,
      transparent 1px, transparent 60px);
}

.pitch-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.pitch-midline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.pitch-players {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pitch-row {
  display: flex;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 12px);
  flex-wrap: wrap;
  min-height: clamp(110px, 15vw, 150px);
  /* Stability fix */
}

/* PL-style player card - Consolidated Tactical Design */
.player-card {
  background: #00754e;
  /* Pitch green */
  border-radius: 4px;
  width: clamp(72px, 10vw, 92px);
  min-height: clamp(94px, 13vw, 120px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  will-change: box-shadow;
  backface-visibility: hidden;
  transform: translateZ(0);
  /* Hardware acceleration */
}

.player-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.pc-remove {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 18px;
  height: 18px;
  background: rgba(24, 24, 27, 0.8);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  z-index: 5;
  cursor: pointer;
  transition: background 0.2s;
}

.pc-remove:hover {
  background: #ff3b5c;
}

.pc-price {
  position: absolute;
  top: 4px;
  right: 6px;
  color: #fff;
  font-weight: 800;
  font-size: clamp(0.7rem, 1vw, 0.85rem);
  z-index: 5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.pc-shirt-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 0 10px;
}

.pc-shirt-img {
  width: 75%;
  height: auto;
  object-fit: contain;
  transform: scale(1.16);
  transform-origin: center;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.player-card-body {
  background: #fff;
  width: 100%;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.pc-name {
  background: #fff;
  color: #111113;
  font-weight: 800;
  font-size: clamp(0.6rem, 1.2vw, 0.78rem);
  padding: 4px 2px;
  text-align: center;
  line-height: 1.2;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-fix {
  background: #f2f2f2;
  color: #00008b;
  font-weight: 800;
  font-size: clamp(0.55rem, 1vw, 0.72rem);
  padding: 4px 2px;
  text-align: center;
  line-height: 1.2;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.pc-meta {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 3px 0;
}

.pc-xp {
  font-size: 0.65rem;
  font-weight: 800;
  color: #00754e;
  background: rgba(0, 117, 78, 0.1);
  padding: 0 5px;
  border-radius: 3px;
}

.pc-fdr {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}

.fdr-1 {
  background: var(--fdr-1);
  color: #000;
}

.fdr-2 {
  background: var(--fdr-2);
  color: #000;
}

.fdr-3 {
  background: var(--fdr-3);
  color: #000;
}

.fdr-4 {
  background: var(--fdr-4);
  color: #000;
}

.fdr-5 {
  background: var(--fdr-5);
  color: #fff;
}

.cap-hint {
  position: absolute;
  top: 25px;
  left: 5px;
  background: #111113;
  color: var(--pl-green);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pl-green);
  z-index: 6;
}

.pc-status {
  position: absolute;
  top: 50px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 6;
}

.pc-status.ok {
  display: none;
}

.pc-status.doubt {
  background: var(--pl-yellow);
  border: 1px solid #000;
  display: block;
}

.pc-status.out {
  background: var(--pl-red);
  border: 1px solid #000;
  display: block;
}

.pc-ep {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--pl-green);
  background: rgba(0, 255, 135, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
  margin: 0 auto 4px;
  display: inline-block;
}

/* V6 Breakdown Popover */
.xpts-popover {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: rgba(24, 24, 27, 0.98);
  border: 1px solid rgba(0, 255, 135, 0.4);
  border-radius: 12px;
  padding: 10px;
  z-index: 100;
  width: 140px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  border-top: 2px solid var(--pl-green);
}

.player-card:hover .xpts-popover {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.pop-hdr {
  font-size: 0.6rem;
  font-weight: 900;
  color: var(--pl-green);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.pop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.pop-item {
  display: flex;
  flex-direction: column;
}

.pop-lbl {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.5rem;
  letter-spacing: 0.3px;
}

.pop-val {
  font-weight: 800;
  color: #fff;
  font-size: 0.75rem;
}

.pop-conf {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.6rem;
  color: var(--pl-cyan);
  font-weight: 800;
}


/*  Gameweek Status View  */
.gw-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.2s;
}

.gw-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.gw-card .gw-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}

.gw-card .gw-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.gw-card .gw-sub {
  font-size: 0.75rem;
  color: var(--pl-cyan);
  margin-top: 4px;
}

.market-list {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 16px;
}

.market-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.market-row:last-child {
  border-bottom: none;
}

.market-name {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.market-club {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.market-amount {
  font-weight: 800;
  font-family: monospace;
  font-size: 0.9rem;
}

.ticker-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  gap: 12px;
  font-size: 0.85rem;
}

.ticker-icon {
  font-size: 1.2rem;
}

.ticker-news {
  flex: 1;
  color: var(--text-muted);
}

.ticker-name {
  color: #fff;
  font-weight: 700;
  min-width: 120px;
}

/*  Panels  */
.panel {
  background: rgba(24, 24, 27, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  /* 3D light edge highlight */
  border-bottom: 2px solid rgba(0, 0, 0, 0.5);
  /* 3D drop shadow edge */
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;

  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel {
  backdrop-filter: blur(8px);
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.panel-hdr h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
}

.ftab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
}

.ftab:hover {
  background: rgba(0, 255, 135, 0.08);
  border-color: rgba(0, 255, 135, 0.2);
  color: var(--pl-green);
}

.ftab.active {
  background: var(--pl-green);
  border-color: var(--pl-green);
  color: #000;
}

.fdr-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.fdr-dot {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
}

.free-badge {
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.25);
  color: var(--pl-cyan);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

/*  Stats Table  */
.tbl-wrap {
  overflow-x: auto;
}

.stats-tbl {
  width: 100%;
  border-collapse: collapse;
}

.stats-tbl th {
  padding: 9px 12px;
  text-align: left;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

.stats-tbl td {
  padding: 11px 12px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.stats-tbl tbody tr {
  transition: var(--transition);
}

.stats-tbl tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 800;
}

.pos-badge.GKP {
  background: rgba(245, 166, 35, 0.15);
  color: var(--gkp);
}

.pos-badge.DEF {
  background: rgba(0, 230, 118, 0.15);
  color: var(--def);
}

.pos-badge.MID {
  background: rgba(0, 212, 255, 0.15);
  color: var(--mid);
}

.pos-badge.FWD {
  background: rgba(255, 59, 92, 0.15);
  color: var(--fwd);
}

.ep-val {
  color: var(--pl-green);
  font-weight: 800;
}

.price-val {
  color: var(--pl-cyan);
  font-weight: 600;
}

.fix-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-chip.ok {
  background: rgba(0, 255, 135, 0.1);
  color: var(--pl-green);
}

.status-chip.doubt {
  background: rgba(250, 221, 0, 0.1);
  color: var(--pl-yellow);
}

.status-chip.out {
  background: rgba(255, 59, 92, 0.1);
  color: var(--pl-red);
}

/*  Fixture Grid  */
.fix-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fix-header-row,
.fix-row {
  display: grid;
  grid-template-columns: 160px repeat(6, 1fr);
  gap: 5px;
  align-items: center;
}

.fix-gw-head {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fix-player-name {
  font-size: 0.82rem;
  font-weight: 700;
}

.fix-cell {
  text-align: center;
  border-radius: 6px;
  padding: 7px 4px;
  font-size: 0.68rem;
  font-weight: 800;
  transition: var(--transition);
}

.fix-cell:hover {
  transform: scale(1.08);
}

.fix-cell span {
  display: block;
  font-size: 0.55rem;
  opacity: 0.7;
  margin-top: 1px;
}

/*  Transfers  */
.transfer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.transfer-card {
  background: rgba(24, 24, 27, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 3px solid rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  gap: 12px;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 15px rgba(0, 0, 0, 0.3);
}

.transfer-card:hover {
  border-color: rgba(0, 255, 135, 0.2);
  transform: translateY(-4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 12px 25px rgba(0, 255, 135, 0.15);
}

.transfer-card.p1 {
  border-left: 3px solid var(--pl-green);
}

.transfer-card.p2 {
  border-left: 3px solid var(--pl-cyan);
}

.transfer-card.p3 {
  border-left: 3px solid var(--pl-magenta);
}

.transfer-card.p4 {
  border-left: 3px solid var(--pl-yellow);
}

.transfer-card.p5 {
  border-left: 3px solid #ff8000;
}

.transfer-card.p6 {
  border-left: 3px solid #00d2ff;
}

.t-out {
  text-align: right;
}

.t-in {
  text-align: left;
}

.t-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.t-name {
  font-size: 0.97rem;
  font-weight: 800;
  margin-bottom: 3px;
}

.t-club {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.t-ep {
  font-size: 0.82rem;
  color: var(--pl-green);
  font-weight: 700;
}

.t-price {
  font-size: 0.8rem;
  color: var(--pl-cyan);
}

.t-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.t-arrow-icon {
  font-size: 1.3rem;
  color: var(--pl-green);
}

.t-gain {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(0, 255, 135, 0.12);
  color: var(--pl-green);
  padding: 2px 8px;
  border-radius: 12px;
}

.t-reason {
  font-size: 0.8rem;
  color: var(--text-secondary);
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-style: italic;
  line-height: 1.4;
}

/*  Chips  */
.chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.chip-card {
  background: rgba(24, 24, 27, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 18px;
  transition: var(--transition);
}

.chip-card:hover {
  border-color: rgba(94, 234, 212, 0.25);
}

.chip-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.chip-name {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.chip-advice {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.chip-status {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chip-status.hold {
  background: rgba(250, 221, 0, 0.1);
  color: var(--pl-yellow);
}

.chip-status.use {
  background: rgba(0, 255, 135, 0.1);
  color: var(--pl-green);
}

.chip-status.save {
  background: rgba(120, 100, 130, 0.1);
  color: var(--text-secondary);
}

/*  Scout View  */
.scout-hero {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.15) 0%, rgba(0, 212, 255, 0.08) 100%);
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/*  Transfers  */
.transfer-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.transfer-card {
  background: rgba(24, 24, 27, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 3px solid rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  gap: 12px;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 15px rgba(0, 0, 0, 0.3);
}

.transfer-card:hover {
  border-color: rgba(0, 255, 135, 0.2);
  transform: translateY(-4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 12px 25px rgba(0, 255, 135, 0.15);
}

.transfer-card.p1 {
  border-left: 3px solid var(--pl-green);
}

.transfer-card.p2 {
  border-left: 3px solid var(--pl-cyan);
}

.transfer-card.p3 {
  border-left: 3px solid var(--pl-magenta);
}

.transfer-card.p4 {
  border-left: 3px solid var(--pl-yellow);
}

.transfer-card.p5 {
  border-left: 3px solid #ff8000;
}

.transfer-card.p6 {
  border-left: 3px solid #00d2ff;
}

.t-out {
  text-align: right;
}

.t-in {
  text-align: left;
}

.t-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.t-name {
  font-size: 0.97rem;
  font-weight: 800;
  margin-bottom: 3px;
}

.t-club {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.t-ep {
  font-size: 0.82rem;
  color: var(--pl-green);
  font-weight: 700;
}

.t-price {
  font-size: 0.8rem;
  color: var(--pl-cyan);
}

.t-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.t-arrow-icon {
  font-size: 1.3rem;
  color: var(--pl-green);
}

.t-gain {
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(0, 255, 135, 0.12);
  color: var(--pl-green);
  padding: 2px 8px;
  border-radius: 12px;
}

.t-reason {
  font-size: 0.8rem;
  color: var(--text-secondary);
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-style: italic;
  line-height: 1.4;
}

/*  Chips  */
.chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.chip-card {
  background: rgba(24, 24, 27, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 18px;
  transition: var(--transition);
}

.chip-card:hover {
  border-color: rgba(94, 234, 212, 0.25);
}

.chip-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.chip-name {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.chip-advice {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.chip-status {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chip-status.hold {
  background: rgba(250, 221, 0, 0.1);
  color: var(--pl-yellow);
}

.chip-status.use {
  background: rgba(0, 255, 135, 0.1);
  color: var(--pl-green);
}

.chip-status.save {
  background: rgba(120, 100, 130, 0.1);
  color: var(--text-secondary);
}

/*  Scout View  */
.scout-hero {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.15) 0%, rgba(0, 212, 255, 0.08) 100%);
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.scout-hero-icon {
  min-width: 44px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(0, 255, 135, 0.24);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pl-green);
  background: rgba(0, 255, 135, 0.06);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Action buttons container */
.chat-action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

/* The send button (rounded square matching pic 2) */
#btnSendChat {
  background: var(--pl-green);
  color: var(--pl-purple3);
  border: none;
  border-radius: 10px; /* rounded square */
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

#btnSendChat:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 255, 135, 0.3);
}

.scout-hero-text h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.scout-hero-text p {
  font-size: 0.87rem;
  color: var(--text-secondary);
}

.scout-section {
  margin-bottom: 20px;
}

.scout-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.scout-section-title h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scout-label-pill {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 9px;
  border-radius: 12px;
}

.scout-label-pill.hot {
  background: rgba(255, 59, 92, 0.2);
  color: var(--pl-red);
}

.scout-label-pill.rise {
  background: rgba(0, 255, 135, 0.15);
  color: var(--pl-green);
}

.scout-label-pill.diff {
  background: rgba(94, 234, 212, 0.15);
  color: var(--pl-magenta);
}

.scout-label-pill.fix {
  background: rgba(0, 212, 255, 0.15);
  color: var(--pl-cyan);
}

.scout-label-pill.cap {
  background: rgba(250, 221, 0, 0.15);
  color: var(--pl-yellow);
}

/* Scout Player Cards  horizontal scroll row */
.scout-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.scout-card {
  background: rgba(24, 24, 27, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
  position: relative;
}

.scout-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.16);
}

.sc-bar {
  height: 3px;
}

.sc-bar.GKP {
  background: var(--gkp);
}

.sc-bar.DEF {
  background: var(--def);
}

.sc-bar.MID {
  background: var(--mid);
}

.sc-bar.FWD {
  background: var(--fwd);
}

.sc-body {
  padding: 13px 14px;
}

.sc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.sc-pos {
  font-size: 0.65rem;
  font-weight: 800;
}

.sc-pos.GKP {
  color: var(--gkp);
}

.sc-pos.DEF {
  color: var(--def);
}

.sc-pos.MID {
  color: var(--mid);
}

.sc-pos.FWD {
  color: var(--fwd);
}

.sc-price {
  font-size: 0.75rem;
  color: var(--pl-cyan);
  font-weight: 700;
}

.sc-name {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 2px;
  line-height: 1.2;
}

.sc-club {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sc-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sc-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 44px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  padding: 5px 7px;
}

.sc-stat-val {
  font-size: 0.88rem;
  font-weight: 800;
}

.sc-stat-val.green {
  color: var(--pl-green);
}

.sc-stat-val.cyan {
  color: var(--pl-cyan);
}

.sc-stat-val.yellow {
  color: var(--pl-yellow);
}

.sc-stat-val.mag {
  color: var(--pl-magenta);
}

.sc-stat-lbl {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.sc-fix-row {
  margin-top: 10px;
  display: flex;
  gap: 4px;
}

.sc-fix-pill {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  flex: 1;
  text-align: center;
}

/* Scout pos filter */
.scout-pos-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pos-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.pos-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pos-filter-btn.active {
  background: var(--pl-green);
  border-color: var(--pl-green);
  color: #000;
}

/*  Reset  */
.reset-area {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.reset-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reset-btn:hover {
  border-color: var(--pl-green);
  color: var(--pl-green);
}

/*  Footer  */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 0, 24, 0.8);
  padding: 20px 2rem;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-logo {
  font-weight: 800;
  color: var(--pl-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/*  Player Card Modal — Tabbed  */
.pm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pm-overlay.show {
  display: flex;
  opacity: 1;
}

.pm-card {
  background: linear-gradient(160deg, #111113 0%, #0f001a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: min(480px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 255, 135, 0.12);
  animation: pmSlideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pmSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s, color 0.2s;
}

.pm-close:hover {
  background: var(--pl-red);
  color: #fff;
  border-color: var(--pl-red);
}

/* Header */
.pm-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 20px 0;
}

.pm-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.2), rgba(0, 212, 255, 0.2));
  border: 2px solid rgba(0, 255, 135, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.pm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pm-avatar-initials {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--pl-green);
  font-family: 'Space Grotesk', sans-serif;
}

.pm-header-info {
  flex: 1;
  min-width: 0;
}

.pm-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pm-pos-badge {
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
}

.pm-pos-badge.GKP {
  background: rgba(245, 166, 35, 0.18);
  color: var(--gkp);
}

.pm-pos-badge.DEF {
  background: rgba(0, 230, 118, 0.18);
  color: var(--def);
}

.pm-pos-badge.MID {
  background: rgba(0, 212, 255, 0.18);
  color: var(--mid);
}

.pm-pos-badge.FWD {
  background: rgba(255, 59, 92, 0.18);
  color: var(--fwd);
}

.pm-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pl-green);
  flex-shrink: 0;
}

.pm-status-dot.doubt {
  background: var(--pl-yellow);
}

.pm-status-dot.injured,
.pm-status-dot.unavailable {
  background: var(--pl-red);
}

.pm-status-dot.suspended {
  background: var(--pl-magenta);
}

.pm-name {
  font-size: 1.35rem;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
  background: transparent;
  line-height: 1.1;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
  padding: 0;
  margin-top: 0;
}

.pm-club-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pm-club-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.pm-price {
  font-size: 0.82rem;
  color: var(--pl-cyan);
  font-weight: 700;
}

/* Tab nav */
.pm-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 20px 0;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 0;
}

.pm-tab {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
  letter-spacing: 0.2px;
  flex: 1;
  text-align: center;
}

.pm-tab:hover {
  color: rgba(255, 255, 255, 0.75);
}

.pm-tab.active {
  color: #fff;
}

.pm-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2.5px;
  background: var(--pl-green);
  border-radius: 2px 2px 0 0;
  transition: left 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(0, 255, 135, 0.5);
}

/* Panels */
.pm-panel {
  display: none;
  padding: 18px 20px 20px;
}

.pm-panel.active {
  display: block;
}

/* Key stats (Profile tab) */
.pm-key-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pm-key-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.pm-key-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
  line-height: 1;
  margin-bottom: 5px;
}

.pm-key-val.green {
  color: var(--pl-green);
}

.pm-key-val.cyan {
  color: var(--pl-cyan);
}

.pm-key-val.mag {
  color: var(--pl-magenta);
}

.pm-key-val.yellow {
  color: var(--pl-yellow);
}

.pm-key-lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

/* News banner */
.pm-news-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--pl-yellow);
  line-height: 1.4;
}

.pm-news-icon {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

/* Section title */
.pm-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 18px 0 10px;
}

/* Fixtures */
.pm-fixtures-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pm-fix-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 9px 12px;
}

.pm-fix-gw {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  width: 30px;
  flex-shrink: 0;
}

.pm-fix-opp {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.pm-fix-ha {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-left: 4px;
}

.pm-fix-fdr {
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.pm-fix-fdr.fdr1,
.pm-fix-fdr.fdr2 {
  background: rgba(0, 255, 135, 0.18);
  color: var(--pl-green);
}

.pm-fix-fdr.fdr3 {
  background: rgba(245, 166, 35, 0.18);
  color: var(--pl-yellow);
}

.pm-fix-fdr.fdr4,
.pm-fix-fdr.fdr5 {
  background: rgba(255, 59, 92, 0.18);
  color: var(--pl-red);
}

/* Breakdown row */
.pm-breakdown-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.pm-bd-stat {
  flex: 1;
  min-width: 56px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}

.pm-bd-val {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--pl-cyan);
  display: block;
}

.pm-bd-lbl {
  font-size: 0.56rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
  display: block;
}

/* Set piece row */
.pm-setpiece-row {
  margin-top: 12px;
  background: rgba(94, 234, 212, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.25);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.8rem;
  color: var(--pl-magenta);
}

.pm-setpiece-label {
  font-weight: 800;
  margin-right: 6px;
}

/* ── MATCHES TAB ── */
.pm-matches-loading,
.pm-career-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 24px 0;
}

.pm-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--pl-green);
  border-radius: 50%;
  animation: pmSpin 0.7s linear infinite;
}

@keyframes pmSpin {
  to {
    transform: rotate(360deg);
  }
}

.pm-match-date-header {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pm-match-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: default;
  transition: background 0.15s;
}

.pm-match-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pm-match-opp {
  flex: 1;
}

.pm-match-opp-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.pm-match-result {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pm-match-result.win {
  color: var(--pl-green);
}

.pm-match-result.draw {
  color: var(--pl-yellow);
}

.pm-match-result.loss {
  color: var(--pl-red);
}

.pm-match-mins {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.pm-match-pts {
  font-size: 0.85rem;
  font-weight: 900;
  width: 36px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pm-match-pts.pts-great {
  background: #00c46f;
  color: #000;
}

.pm-match-pts.pts-good {
  background: #5acd9e;
  color: #000;
}

.pm-match-pts.pts-ok {
  background: rgba(245, 166, 35, 0.8);
  color: #000;
}

.pm-match-pts.pts-poor {
  background: rgba(255, 59, 92, 0.7);
  color: #fff;
}

.pm-match-icons {
  display: flex;
  gap: 3px;
  align-items: center;
}

.pm-match-icon {
  font-size: 0.75rem;
}

/* ── STATS TAB ── */
.pm-stats-hero {
  display: flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 4px;
}

.pm-stats-hero-stat {
  flex: 1;
  text-align: center;
}

.pm-stats-hero-val {
  font-size: 1.6rem;
  font-weight: 900;
  font-family: 'Space Grotesk', sans-serif;
  color: #fff;
  display: block;
}

.pm-stats-hero-val.rating {
  background: var(--pl-green);
  color: #000;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 1.1rem;
  display: inline-block;
}

.pm-stats-hero-lbl {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  display: block;
}

.pm-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.pm-stats-cell {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 11px 8px;
  text-align: center;
}

.pm-stats-cell-val {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  display: block;
  font-family: 'Space Grotesk', sans-serif;
}

.pm-stats-cell-lbl {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 3px;
  display: block;
}

/* ── CAREER TAB ── */
.pm-career-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pm-career-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pm-career-row:last-child {
  border-bottom: none;
}

.pm-career-season-info {
  flex: 1;
}

.pm-career-season {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

.pm-career-club {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.pm-career-stats {
  display: flex;
  gap: 16px;
  align-items: center;
}

.pm-career-stat {
  text-align: center;
}

.pm-career-stat-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  display: block;
}

.pm-career-stat-lbl {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pm-career-pts-badge {
  font-size: 0.82rem;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--pl-green);
  color: #000;
  min-width: 42px;
  text-align: center;
}

.pm-career-pts-badge.med {
  background: var(--pl-yellow);
  color: #000;
}

.pm-career-pts-badge.low {
  background: rgba(255, 59, 92, 0.7);
  color: #fff;
}

/*  Formation Buttons  */
.formation-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 14px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: var(--transition);
}

.formation-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.formation-btn.active {
  background: var(--pl-magenta);
  border-color: var(--pl-magenta);
  color: #fff;
  box-shadow: 0 0 16px rgba(94, 234, 212, 0.3);
}

/*  Scout Skeleton Loader  */
.scout-skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
  height: 160px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0
  }

  100% {
    background-position: -200% 0
  }
}

/*  Responsive  */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-pitch {
    display: none;
  }

  .fix-header-row,
  .fix-row {
    grid-template-columns: 110px repeat(4, 1fr);
  }

  .transfer-card {
    grid-template-columns: 1fr 48px 1fr;
  }

  .scout-cards-row {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 600px) {
  .section-wrap {
    padding: 24px 1rem 130px;
  }

  .hero-inner {
    padding: 32px 1rem;
  }

  .fix-header-row,
  .fix-row {
    grid-template-columns: 90px repeat(3, 1fr);
  }

  .score-cards {
    flex-direction: column;
  }

  .tabs-inner {
    padding: 0 1rem;
  }

  .header {
    padding: 0 0.75rem;
  }

  .logo-text {
    display: none;
  }

  .season-pill {
    display: none;
  }

  .header-nav {
    gap: 8px;
    justify-content: center;
  }

  .auth-btn {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .hide-mobile {
    display: none;
  }

  .scout-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .header-nav {
    gap: 4px;
  }

  .auth-btn {
    padding: 5px 8px;
    letter-spacing: 0;
  }

  .gw-status {
    display: none;
  }

  /* Hide "Finished/LIVE/DL..." keep "GW X" */
  #gwStatusBadge .gw-badge {
    padding: 4px 8px;
  }
}

/* Utility */
.text-g {
  color: var(--pl-green);
}

.text-r {
  color: var(--pl-red);
}

.text-y {
  color: var(--pl-yellow);
}

.text-m {
  color: var(--pl-magenta);
}

/*  Auth UI  */
.auth-btn {
  background: rgba(0, 212, 255, 0.15);
  border: 1px solid rgba(0, 212, 255, 0.4);
  color: var(--pl-cyan);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
}

.auth-btn:hover {
  background: var(--pl-cyan);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.auth-btn.logged-in {
  background: rgba(0, 255, 135, 0.15);
  border-color: rgba(0, 255, 135, 0.4);
  color: var(--pl-green);
}

.auth-btn.logged-in:hover {
  background: var(--pl-red);
  border-color: var(--pl-red);
  color: #fff;
  box-shadow: none;
}

.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(18, 0, 24, 0.94);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.auth-modal.show {
  display: flex;
}

.auth-card {
  background: var(--pl-card);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: var(--radius);
  width: min(400px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  padding: 24px;
  position: relative;
  animation: slideUp 0.3s ease-out forwards;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.auth-header h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.auth-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.auth-close:hover {
  color: #fff;
}

.auth-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--input-color);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.auth-input:focus {
  border-color: var(--pl-cyan);
}

.auth-error {
  color: var(--pl-red);
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 59, 92, 0.15);
  padding: 8px;
  border-radius: 6px;
  text-align: center;
}

.auth-toggle-text {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 10px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.google-btn-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;
}

/* Truly Custom Google Sign In Button */
.custom-google-btn-container {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 9999px;
}

.custom-google-signin-btn {
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  color: #ffffff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  user-select: none;
  position: relative;
  z-index: 1;
}

.custom-google-signin-btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.08) 100%);
  border-color: rgba(0, 255, 135, 0.45);
  box-shadow: 0 8px 25px rgba(0, 255, 135, 0.2), 0 0 15px rgba(0, 255, 135, 0.1);
  transform: translateY(-2px);
  color: #ffffff;
}

.custom-google-signin-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 10px rgba(0, 255, 135, 0.15);
}

.google-g-logo {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.custom-google-signin-btn:hover .google-g-logo {
  transform: scale(1.1) rotate(5deg);
}

#googleNativeBtnContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.001;
  z-index: 10;
  cursor: pointer;
  overflow: hidden;
}

#googleNativeBtnContainer iframe,
#googleNativeBtnContainer div[role="button"] {
  width: 100% !important;
  height: 100% !important;
  cursor: pointer !important;
}

/*  Top Teams UI  */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.rank-badge {
  background: var(--pl-cyan);
  color: #000;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.manager-info {
  display: flex;
  flex-direction: column;
}

.team-name {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.manager-name {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.pts-cell {
  color: var(--pl-cyan);
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

.total-cell {
  font-weight: 800;
  color: #fff;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.meta-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-card-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.captain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.captain-row:last-child {
  border-bottom: none;
}

.template-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-tag {
  background: rgba(0, 255, 135, 0.06);
  border: 1px solid rgba(0, 255, 135, 0.15);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--pl-green);
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-tag strong {
  color: var(--pl-cyan);
}

.chip-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

@keyframes pulse-dot {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.4;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0px);
  }
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--pl-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--pl-green);
  animation: pulse-dot 2s infinite ease-in-out;
}

/*  Landing Page  */
.landing-hero {
  text-align: center;
  padding: 40px 1rem 48px;
  max-width: 800px;
  margin: 0 auto;
}

.landing-labels {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.live-pill {
  background: rgba(0, 255, 135, 0.1);
  border: 1px solid rgba(0, 255, 135, 0.3);
  color: var(--pl-green);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--pl-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--pl-green);
  animation: pulse-dot 2s infinite;
}

.landing-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.5rem, 8vw, 3.8rem);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -2px;
  background: linear-gradient(to bottom, #fff 40%, rgba(255, 255, 255, 0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 500px;
  margin: 0 auto;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .landing-grid {
    grid-template-columns: 1fr;
  }
}

.landing-card {
  background: rgba(24, 24, 27, 0.4);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
}

.landing-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.15);
  background: rgba(24, 24, 27, 0.6);
}

.landing-card:hover .lc-icon {
  opacity: 0.4;
  transform: scale(1.1) rotate(-5deg);
}

.landing-card:focus {
  outline: 2px solid var(--pl-green);
  outline-offset: 2px;
}

.lc-accent {
  height: 4px;
  width: 100%;
}

.lc-icon {
  position: absolute;
  top: 24px;
  right: 24px;
  min-width: 46px;
  min-height: 46px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 0.12;
  user-select: none;
  pointer-events: none;
  transition: all 0.6s ease;
  animation: float 4s infinite ease-in-out;
}

.lc-body {
  padding: 16px;
}

.lc-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.lc-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.lc-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}

.lc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lc-stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--pl-green);
}

.lc-stat-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lc-cta {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--pl-green);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.3px;
}

/*  Landing Bar  */
.landing-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(10, 10, 11, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 20px 32px;
  flex-wrap: wrap;
  margin-top: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.lb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 32px;
}

.lb-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.lb-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 800;
}

.lb-sep {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 600px) {
  .lb-sep {
    display: none;
  }

  .lb-item {
    padding: 8px 20px;
  }
}

/*  Elite Comparison Styling  */
#metaAlignmentScore {
  font-weight: 800;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

#metaComparisonContent {
  animation: fadeIn 0.6s ease;
}

.missing-pillar-pill {
  background: rgba(255, 59, 92, 0.1);
  border: 1px solid rgba(255, 59, 92, 0.2);
  color: var(--pl-red);
}

.unique-pill {
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  color: var(--pl-cyan);
}

/*  Toast Notifications  */
.toast-notification {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pl-purple);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2000;
  animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/*  Print Styles  */
@media print {

  .main-tabs,
  .header,
  .hero,
  .auth-modal,
  .loading-overlay,
  .reset-area,
  .analyze-btn-wrap,
  .scout-hero,
  .scout-pos-filter {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .bg-mesh {
    display: none !important;
  }

  .section-wrap {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .panel {
    border: 1px solid #eee !important;
    box-shadow: none !important;
    background: #fff !important;
    margin-bottom: 20px !important;
    page-break-inside: avoid;
  }

  .panel-hdr h3 {
    color: #111113 !important;
  }

  .page-view {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  #viewLanding,
  #viewScout,
  #viewMore {
    display: none !important;
  }

  #viewHome {
    display: block !important;
  }
}

/*  Cookie Consent Center  */
.cookie-banner {
  position: fixed;
  bottom: 100px;
  /* Above the bottom nav bar */
  left: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  background: var(--pl-purple);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(150%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 600px;
  margin: 0 auto;
}

.cookie-banner.active {
  transform: translateY(0);
}

.cookie-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.cookie-icon {
  font-size: 24px;
}

.cookie-text h4 {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.cookie-text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 320px;
}

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 50px;
  cursor: pointer;
  border: none;
  font-weight: 700;
  transition: all 0.2s;
}

@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    bottom: 90px;
    padding: 16px;
    left: 10px;
    right: 10px;
  }

  .cookie-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .cookie-text p {
    max-width: 100%;
  }
}

/*  AI Bonus Styles  */
.ai-bonus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.ai-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ai-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.ai-team {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.ai-team-badge {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.ai-team-name {
  font-weight: 800;
  font-size: 0.9rem;
}

.ai-match-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 12px;
  text-align: center;
  white-space: nowrap;
}

.ai-prediction-body {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
}

.ai-loading {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
}

.ai-bonus-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-b-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 8px;
}

.b-pts {
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  color: #000;
}

.pts-3 {
  background: var(--pl-magenta);
}

.pts-2 {
  background: var(--pl-cyan);
}

.pts-1 {
  background: var(--pl-yellow);
}

.b-name {
  font-weight: 800;
  font-size: 0.95rem;
}

.ai-b-rationale {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
  border-left: 3px solid var(--pl-cyan);
  padding-left: 12px;
}

/*  AI Squad View Styles  */
.ai-squad-container {
  display: flex;
  margin-top: 16px;
  gap: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
}

.ai-squad-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-squad-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.ai-squad-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 4px 8px;
  border-radius: 4px;
}

.ai-squad-player-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.ai-xbps-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  color: #000;
}

.ai-xbps-badge.high {
  background: var(--pl-green);
}

.ai-xbps-badge.med {
  background: var(--pl-yellow);
}

.ai-xbps-badge.low {
  background: #888;
  color: #fff;
}

/* Cookie Consent Center */
.cookie-overlay {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(200%);
  z-index: 1000;
  width: 90%;
  max-width: 460px;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-overlay.show {
  transform: translateX(-50%) translateY(0);
}

.cookie-card {
  background: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.cookie-card[hidden] {
  display: none !important;
}

.cookie-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.cookie-icon {
  font-size: 2rem;
}

.cookie-card h3 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  color: #fff;
}

.cookie-card p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: 20px;
}

.cookie-actions {
  display: flex;
  gap: 12px;
}

.cookie-btn {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.cookie-btn.primary {
  background: var(--pl-green);
  color: var(--pl-purple);
}

.cookie-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cookie-btn:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

/* Cookie settings tab (opened via "Manage cookies") */
.cookie-settings-card {
  max-width: 460px;
  text-align: left;
}

.cookie-header-settings {
  position: relative;
  justify-content: center;
}

.cookie-back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  line-height: 1;
}

.cookie-back-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cookie-settings-intro {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 16px;
}

.cookie-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 14px;
}

.cookie-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 8px 6px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cookie-tab:hover {
  color: #fff;
}

.cookie-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cookie-tab-panels {
  min-height: 220px;
}

.cookie-tab-panel {
  display: none;
}

.cookie-tab-panel.active {
  display: block;
}

.cookie-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-row:last-of-type {
  border-bottom: none;
}

.cookie-row-text h4 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-row-text p {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.45;
}

.cookie-required {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(0, 255, 135, 0.15);
  color: var(--pl-green);
}

.cookie-detail-list {
  list-style: none;
  padding: 12px 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

.cookie-detail-list code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
  color: #fff;
  font-size: 0.78rem;
}

.cookie-row-note {
  margin-top: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
}

/* Toggle switch */
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.cookie-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: var(--pl-green);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(20px);
}

.cookie-toggle.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cookie-toggle.disabled .cookie-toggle-slider {
  cursor: not-allowed;
}

/* Footer of the settings tab */
.cookie-settings-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-settings-footer-info {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

.cookie-settings-footer-info strong {
  color: #fff;
}

.cookie-settings-actions {
  display: flex;
  gap: 10px;
}

.cookie-settings-actions .cookie-btn {
  flex: 1;
}

.cookie-btn.danger {
  background: rgba(255, 75, 75, 0.15);
  color: #ff8a8a;
  border: 1px solid rgba(255, 75, 75, 0.35);
}

.cookie-btn.danger:hover {
  background: rgba(255, 75, 75, 0.25);
}

/* Light-mode overrides for the new cookie settings tab */
:root.light-mode .cookie-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
}

:root.light-mode .cookie-card h3,
:root.light-mode .cookie-row-text h4,
:root.light-mode .cookie-settings-footer-info strong,
:root.light-mode .cookie-back-btn {
  color: #1d0024;
}

:root.light-mode .cookie-card p,
:root.light-mode .cookie-row-text p,
:root.light-mode .cookie-detail-list,
:root.light-mode .cookie-row-note,
:root.light-mode .cookie-settings-footer-info {
  color: rgba(0, 0, 0, 0.65);
}

:root.light-mode .cookie-tabs {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

:root.light-mode .cookie-tab {
  color: rgba(0, 0, 0, 0.65);
}

:root.light-mode .cookie-tab.active {
  background: rgba(0, 0, 0, 0.08);
  color: #1d0024;
}

:root.light-mode .cookie-toggle-slider {
  background: rgba(0, 0, 0, 0.2);
}

:root.light-mode .cookie-row,
:root.light-mode .cookie-settings-footer {
  border-color: rgba(0, 0, 0, 0.08);
}

:root.light-mode .cookie-detail-list code {
  background: rgba(0, 0, 0, 0.07);
  color: #1d0024;
}

/* Admin Activity Styles */
.admin-row {
  cursor: pointer;
  transition: background 0.2s;
}

.admin-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.activity-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.activity-modal.show {
  display: flex;
}

.activity-card {
  background: var(--pl-card);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  border-radius: 20px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.activity-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-header h3 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  color: var(--pl-green);
}

.activity-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.activity-item {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 12px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 80px;
}

.activity-action {
  font-weight: 700;
  color: var(--pl-green);
}

.activity-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.activity-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

/*  Countdown Styles  */
.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.countdown-val {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1;
  margin-bottom: 4px;
}

.countdown-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.countdown-sep {
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.2);
  padding-bottom: 15px;
}

@media (max-width: 480px) {
  .countdown-val {
    font-size: 1.8rem;
  }

  .countdown-item {
    min-width: 45px;
  }

  .countdown-sep {
    font-size: 1.5rem;
  }
}



/*  Engine Selector (Segmented Control)  */
.engine-selector {
  display: flex;
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: 30px;
  padding: 3px;
  gap: 2px;
}

.engine-option {
  position: relative;
  flex: 1;
}

.engine-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.engine-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 25px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.engine-option input:checked+.engine-label {
  background: var(--pl-green);
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 255, 135, 0.3);
}

.engine-label:hover:not(.engine-option input:checked + .engine-label) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

#gemma4KeyPanel {
  margin-top: 12px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*  Deep Dive & Premium Elements  */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 212, 255, 0.1);
  border-top: 4px solid var(--pl-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  filter: drop-shadow(0 0 8px var(--pl-cyan));
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* =====================================================
   Light Mode — Component Overrides
   Fixes hardcoded dark-theme rgba(255,255,255,...) values
   that vanish or look wrong on white backgrounds.
   ===================================================== */

/* --- Chips & status badges --- */
:root.light-mode .gw-finished {
  background: rgba(24, 24, 27, 0.05);
  border-color: rgba(24, 24, 27, 0.10);
  color: var(--text-secondary);
}

:root.light-mode .gw-live {
  background: rgba(0, 184, 94, 0.10);
  border-color: rgba(0, 184, 94, 0.30);
  color: var(--pl-green);
}

:root.light-mode .gw-upcoming {
  background: rgba(232, 184, 0, 0.12);
  border-color: rgba(232, 184, 0, 0.35);
  color: #a87f00;
}

/* --- Header bar: refined glass with hairline + ambient lift --- */
:root.light-mode .header {
  border-bottom: none;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 0.5px 0 rgba(24, 24, 27, 0.08), 0 8px 24px -16px rgba(24, 24, 27, 0.12);
}

/* --- Hero pitch (the floating mini-pitch in hero) --- */
:root.light-mode .hero-pitch {
  background: linear-gradient(165deg, #d4f1de 0%, #c2ebd0 50%, #d4f1de 100%);
  border: 1px solid rgba(0, 120, 50, 0.15);
  box-shadow:
    0 1px 3px rgba(24, 24, 27, 0.06),
    0 24px 60px rgba(0, 120, 50, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

:root.light-mode .hero-pitch::before {
  background: repeating-linear-gradient(0deg, transparent, transparent 29px, rgba(0, 80, 30, 0.10) 30px);
}

:root.light-mode .mini-p {
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 6px rgba(24, 24, 27, 0.18);
}

/* --- Tactical pitch (results view) --- */
:root.light-mode .pitch-bg {
  background: linear-gradient(180deg,
      #c8e8d2 0%, #b8e0c4 25%, #c0e6cc 50%, #b8e0c4 75%, #c8e8d2 100%);
  box-shadow:
    0 1px 3px rgba(24, 24, 27, 0.05),
    0 20px 50px rgba(0, 120, 50, 0.15);
}

:root.light-mode .pitch-stripes {
  background: repeating-linear-gradient(180deg,
      rgba(0, 80, 30, 0.06) 0px, rgba(0, 80, 30, 0.06) 1px,
      transparent 1px, transparent 60px);
}

:root.light-mode .pitch-circle {
  border: 1px solid rgba(0, 80, 30, 0.18);
}

:root.light-mode .pitch-midline {
  background: rgba(0, 80, 30, 0.16);
}

/* Player card on pitch: keep PL look (green panel + white name plate) but soften shadow */
:root.light-mode .player-card {
  background: #00a85a;
  box-shadow: 0 2px 6px rgba(0, 80, 30, 0.18), 0 6px 18px rgba(24, 24, 27, 0.10);
}

:root.light-mode .player-card:hover {
  box-shadow: 0 4px 12px rgba(0, 80, 30, 0.25), 0 14px 32px rgba(24, 24, 27, 0.15);
}

:root.light-mode .pc-remove {
  background: rgba(24, 24, 27, 0.7);
}

/* --- Player slots / lineup builder --- */
:root.light-mode .player-slot {
  background: rgba(24, 24, 27, 0.025);
  border: 1px solid rgba(24, 24, 27, 0.07);
}

:root.light-mode .player-slot:hover {
  background: rgba(0, 184, 94, 0.06);
  border-color: rgba(0, 184, 94, 0.30);
}

:root.light-mode .slot-indicator {
  background: rgba(24, 24, 27, 0.10);
}

/* --- Player search input --- */
:root.light-mode .player-search {
  background: #ffffff;
  border: 1px solid var(--input-border);
  box-shadow: inset 0 1px 2px rgba(24, 24, 27, 0.04);
}

:root.light-mode .player-search:focus {
  border-color: rgba(0, 184, 94, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 184, 94, 0.12);
}

/* --- Autocomplete dropdown (was hardcoded purple) --- */
:root.light-mode .autocomplete-list {
  background: #ffffff;
  border: 1px solid rgba(0, 184, 94, 0.30);
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.06), 0 16px 40px rgba(24, 24, 27, 0.14);
}

:root.light-mode .autocomplete-item {
  border-bottom: 1px solid rgba(24, 24, 27, 0.05);
}

:root.light-mode .autocomplete-item:hover {
  background: rgba(0, 184, 94, 0.08);
}

/* --- Dividers (the "OR" lines, etc.) --- */
:root.light-mode .divider::before,
:root.light-mode .divider::after {
  background: rgba(24, 24, 27, 0.10);
}

/* --- KPI cards: subtle colored top stripe for visual rhythm --- */
:root.light-mode .kpi {
  position: relative;
  background: var(--pl-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

:root.light-mode .kpi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pl-green), var(--pl-cyan));
  border-radius: var(--radius) var(--radius) 0 0;
}

/* --- Score cards: stronger elevation in light mode --- */
:root.light-mode .score-card {
  background: var(--pl-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

:root.light-mode .score-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

/* --- Loading overlay (wasn't designed for white) --- */
:root.light-mode .loading-overlay {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

:root.light-mode .loading-card {
  background: var(--pl-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* --- Logo: tone down the green halo on white --- */
:root.light-mode .logo-img {
  box-shadow: 0 2px 8px rgba(0, 184, 94, 0.18), 0 0 0 1px rgba(0, 184, 94, 0.08);
}

/* --- Season pill: refined gradient --- */
:root.light-mode .season-pill {
  background: linear-gradient(135deg, #0f766e 0%, #0f766e 100%);
  box-shadow: 0 2px 8px rgba(94, 234, 212, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* --- Tab buttons / nav --- */
:root.light-mode .tab-btn:hover {
  background: rgba(24, 24, 27, 0.04);
}

:root.light-mode .tab-btn.active::before {
  background: linear-gradient(90deg, var(--pl-green), var(--pl-cyan));
}

/* --- Engine label hover (was rgba(255,255,255,0.05)) --- */
:root.light-mode .engine-label:hover:not(.engine-option input:checked + .engine-label) {
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-primary);
}

/* --- Analyze button: keep punchy green but soften the white inset on light bg --- */
:root.light-mode .analyze-btn {
  box-shadow:
    0 4px 14px rgba(0, 184, 94, 0.32),
    0 12px 28px rgba(0, 184, 94, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

:root.light-mode .analyze-btn:hover {
  box-shadow:
    0 8px 22px rgba(0, 184, 94, 0.40),
    0 18px 40px rgba(0, 184, 94, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

:root.light-mode .analyze-btn:active {
  transform: scale(0.98) translateY(0);
  box-shadow: 0 3px 10px rgba(0, 184, 94, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* --- General insets that go invisible on white: replace with dark insets --- */
:root.light-mode .hero-pitch,
:root.light-mode .score-card,
:root.light-mode .kpi {
  /* inherit shadow-card; removes the dark-theme inset highlight that vanishes */
}

/* --- Body subtle tint so the bg-mesh radial gradients have something to play against --- */
:root.light-mode body {
  background: var(--pl-purple);
}

/* --- Selection color for cohesive accent --- */
:root.light-mode ::selection {
  background: rgba(0, 184, 94, 0.22);
  color: var(--text-primary);
}

/* --- Targeted color overrides for light mode ---
   Replaces the previous "color: #000 !important" sledgehammer.
   Brand gradients on .hero-title em, .kpi-val, .logo-text span, .score-val
   now render correctly because their dark-mode rules already define the
   gradient (no override needed). We only set explicit colors where the
   element sits on a colored fill that would clash with primary text. */

/* Player cards on pitch green keep their PL look */
:root.light-mode .pc-name {
  color: #18181b;
}

:root.light-mode .pc-fix {
  color: #00008b;
}

:root.light-mode .pc-price {
  color: #fff;
}

:root.light-mode .pc-remove {
  color: #fff;
}

/* Analyze button — dark text on green keeps contrast */
:root.light-mode .analyze-btn {
  color: #001a0e;
}

/* Season pill — white text on magenta gradient */
:root.light-mode .season-pill {
  color: #fff;
}

/* Position badges on tinted fills — darken so they read on light */
:root.light-mode .slot-pos-badge.GKP {
  color: #b16f00;
}

:root.light-mode .slot-pos-badge.DEF {
  color: #007a3c;
}

:root.light-mode .slot-pos-badge.MID {
  color: #006891;
}

:root.light-mode .slot-pos-badge.FWD {
  color: #b21d3a;
}


.deep-dive-results {
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-pulse {
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    opacity: 1;
  }
}


@keyframes pulse-admin {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(0, 212, 255, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
  }
}

/* === Accessibility: respect reduced-motion preference === */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* V6.0 xPts Styling */
.sc-stat-val.confidence {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 2px;
}

.scout-card {
  position: relative;
}

.xpts-breakdown-hover {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 8px;
  display: none;
  z-index: 100;
  font-size: 0.7rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scout-card:hover .xpts-breakdown-hover {
  display: block;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}

.breakdown-row span:last-child {
  font-weight: 700;
  color: var(--pl-cyan);
}

/* What If Simulator Styles */
.wi-container {
  display: flex;
  gap: 24px;
  position: relative;
  align-items: flex-start;
  color: var(--text-primary);
}

.page-view#sectionWhatIf.active {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.wi-left {
  flex: 0 0 60%;
  max-width: 60%;
}

.wi-right {
  flex: 0 0 40%;
  max-width: 40%;
  position: sticky;
  top: 70px;
}

.wi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.wi-title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 800;
}

.reset-all-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.reset-all-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.wi-fixture-card {
  background: var(--pl-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
  transition: var(--transition);
}

.wi-fixture-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}

.wi-fixture-teams {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.wi-fixture-owned {
  background: rgba(0, 255, 135, 0.1);
  color: var(--pl-green);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.wi-fixture-body {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: none;
}

.wi-fixture-card.expanded .wi-fixture-body {
  display: block;
}

.wi-fixture-card.expanded .wi-fixture-header svg {
  transform: rotate(180deg);
}

.wi-player-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wi-player-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.wi-player-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wi-player-name {
  font-weight: 800;
  font-size: 1.1rem;
}

.wi-player-pos {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.wi-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.wi-control-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wi-control-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.wi-stepper {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  overflow: hidden;
}

.wi-step-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.wi-step-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.wi-step-val {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.wi-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
}

.impact-card {
  background: var(--pl-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.impact-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 8px;
}

.impact-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.impact-value {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--pl-green);
}

.impact-delta {
  font-weight: 800;
  font-size: 1.2rem;
}

.impact-delta.up {
  color: var(--pl-green);
}

.impact-delta.down {
  color: var(--pl-red);
}

.impact-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.wi-share-btn {
  width: 100%;
  background: var(--pl-cyan);
  color: #000;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-weight: 900;
  font-family: var(--font-head);
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  transition: all 0.2s;
}

.wi-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

@media (max-width: 768px) {
  .wi-container {
    flex-direction: column;
    padding-bottom: 140px;
  }

  .wi-left,
  .wi-right {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .wi-right {
    position: fixed;
    bottom: 72px;
    left: 0;
    right: 0;
    z-index: 850;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    max-width: 100vw;
  }

  .wi-impact-sticky {
    display: flex;
    gap: 12px;
    width: max-content;
  }

  .impact-card {
    margin-bottom: 0;
    min-width: 160px;
    padding: 12px;
  }

  .impact-value {
    font-size: 1.5rem;
  }

  .wi-share-btn {
    padding: 12px;
    margin-top: 0;
    min-width: 140px;
  }
}

.ticking {
  animation: tick 0.2s ease-out;
}

@keyframes tick {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* Deep Research Toggle */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .4s;
  border-radius: 50%;
}

input:checked+.toggle-slider {
  background-color: rgba(0, 255, 135, 0.2);
}

input:checked+.toggle-slider:before {
  transform: translateX(14px);
  background-color: var(--pl-green);
  box-shadow: 0 0 8px var(--pl-green);
}

.chat-msg-research-plan {
  background: rgba(0, 212, 255, 0.03) !important;
  border: 1px dashed rgba(0, 212, 255, 0.2) !important;
  margin: 8px 0;
  padding: 12px !important;
  border-radius: 12px !important;
}

.research-step-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  animation: fadeInStep 0.5s ease forwards;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateX(-5px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--pl-green);
  position: relative;
}

.step-icon::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: var(--pl-green);
}

/* Chat Edit Button */
.chat-edit-btn {
  background: none;
  border: none;
  opacity: 0;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: 10px;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  color: var(--text-muted);
}

.chat-message-row:hover .chat-edit-btn {
  opacity: 0.6;
}

.chat-edit-btn:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.05);
}

.chat-input-pill-container.is-editing .chat-input-pill {
  border-color: var(--pl-cyan);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.chat-input-pill-container.is-editing #chatInput::placeholder {
  color: var(--pl-cyan);
  opacity: 0.7;
}

/* =========================================================
   ChatFPL ChatGPT-like UI
   ========================================================= */

.chatfpl-layout {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--pl-purple3);
  color: var(--text-primary);
  font-family: var(--font-head);
}

.chatfpl-sidebar {
  width: 260px;
  background: var(--pl-purple2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 16px;
  flex-shrink: 0;
  overflow-y: auto;
}

/* The sidebar used to be hidden outright below 768px — a placeholder from
   before it had a mobile form. It is a slide-in drawer now, handled in
   chat-composer.css; `display: none` here silently defeated that, because a
   transform cannot move an element that is not laid out. */

.chatfpl-new-btn {
  background: var(--pl-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.chatfpl-new-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-bright);
}

.chatfpl-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-group {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 12px 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chat-item {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}

.chat-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.chat-item.active {
  background: rgba(0, 255, 135, 0.1);
  color: var(--pl-green);
  font-weight: 600;
}

.chatfpl-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.chatfpl-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chat-msg {
  display: flex;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.chat-msg.user {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pl-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-msg.user .msg-avatar {
  background: var(--pl-green);
  color: #000;
  font-weight: 800;
}

.msg-content {
  background: var(--pl-purple2);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
  max-width: 85%;
}

.chat-msg.user .msg-content {
  background: rgba(0, 255, 135, 0.15);
  border-color: rgba(0, 255, 135, 0.3);
  color: var(--text-primary);
}

.chatfpl-input-zone {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding: 16px 24px;
  background: var(--pl-purple3);
  position: relative;
}

.chatfpl-input-wrapper {
  display: flex;
  background: var(--pl-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 12px 6px 20px;
  align-items: flex-end;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.chatfpl-input-wrapper:focus-within {
  border-color: var(--pl-cyan);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.15);
}

.chatfpl-input-wrapper textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-head);
  font-size: 0.95rem;
  resize: none;
  padding: 10px 0;
  max-height: 150px;
  min-height: 44px;
  outline: none;
}

.chatfpl-input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

#btnChatFplSend {
  background: var(--pl-cyan);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 4px;
  transition: var(--transition);
}

#btnChatFplSend:hover {
  background: var(--pl-green);
  transform: scale(1.05);
}

.chatfpl-disclaimer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Photo upload button inside the input pill */
.chat-upload-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.chat-upload-btn:hover {
  color: var(--pl-cyan);
  background: rgba(0, 212, 255, 0.1);
}

.chat-upload-btn.has-image {
  color: var(--pl-green);
}

/* Image preview strip above the input wrapper */
.chat-image-preview-strip {
  margin: 0 0 10px 0;
  animation: fadeInUp 0.2s ease;
}

.chat-image-preview-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 212, 255, 0.07);
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 14px;
  padding: 6px 10px 6px 8px;
}

.chat-image-preview-inner img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-image-remove-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.chat-image-remove-btn:hover {
  background: rgba(255, 23, 68, 0.2);
  color: #ff1744;
}

/* Image inside chat messages */
.chat-msg-image {
  max-width: 220px;
  max-height: 180px;
  width: auto;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.chat-msg-image:hover {
  transform: scale(1.02);
}

/* FPL Image — animated scan bar for the loading indicator */
.fpl-image-scan-bar {
  height: 3px;
  border-radius: 3px;
  background: rgba(0, 212, 255, 0.15);
  overflow: hidden;
  position: relative;
}

.fpl-image-scan-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--pl-cyan), transparent);
  animation: fplImageScan 1.4s ease-in-out infinite;
}

@keyframes fplImageScan {
  0% {
    left: -40%;
  }

  100% {
    left: 140%;
  }
}

/* Chat Active Layout Lock to keep Header and Bottom tabs perfectly fixed */
body.chat-active-mode {
  overflow: hidden !important;
  position: fixed !important;
  width: 100vw !important;
  height: 100vh !important;
  left: 0 !important;
  top: 0 !important;
}

body.chat-active-mode .footer {
  display: none !important;
}

body.chat-active-mode .header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
}

body.chat-active-mode .main-tabs {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1100 !important;
}

/* Base styles for viewChatfpl when in chat-active-mode */
body.chat-active-mode #viewChatfpl {
  position: fixed !important;
  top: 63px !important;
  bottom: 72px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 50 !important;
  height: auto !important;
  /* let top/bottom stretch it */
}

/* Ensure the layout takes exactly 100% height of viewChatfpl */
body.chat-active-mode .chatfpl-layout {
  height: 100% !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  box-sizing: border-box !important;
}

/* On mobile: hide the header entirely for a full-screen immersive chat */
@media (max-width: 600px) {
  body.chat-active-mode .header {
    display: none !important;
  }

  body.chat-active-mode #viewChatfpl {
    top: 0 !important;
    bottom: calc(72px + env(safe-area-inset-bottom)) !important;
  }

  body.chat-active-mode .chatfpl-layout {
    padding-top: env(safe-area-inset-top) !important;
    padding-bottom: 0 !important;
  }
}

.planner-layout-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.planner-left-column,
.planner-right-column {
  min-width: 0;
  width: 100%;
}

@media (max-width: 1200px) {
  .planner-layout-container {
    grid-template-columns: 1.8fr 1.2fr;
  }
}

@media (max-width: 992px) {
  .planner-layout-container {
    grid-template-columns: 1fr;
  }

  .chatfpl-sidebar-panel {
    height: 480px !important;
  }
}

.chatfpl-sidebar-panel {
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(15, 5, 25, 0.4), rgba(5, 5, 10, 0.2)) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.planner-chat-chips::-webkit-scrollbar {
  display: none;
}

#plannerChatMessages::-webkit-scrollbar {
  width: 5px;
}

#plannerChatMessages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

#plannerChatMessages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

#plannerChatMessages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chatfpl-sidebar-panel .chat-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.chatfpl-sidebar-panel .chat-msg.user {
  flex-direction: row-reverse;
}

.chatfpl-sidebar-panel .chat-msg .msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.chatfpl-sidebar-panel .chat-msg.user .msg-avatar {
  background: var(--pl-green);
  color: #000;
  font-size: 0.75rem;
  font-weight: bold;
}

.chatfpl-sidebar-panel .chat-msg .msg-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  max-width: 85%;
  line-height: 1.4;
  word-break: break-word;
}

.chatfpl-sidebar-panel .chat-msg.user .msg-content {
  background: rgba(0, 255, 135, 0.08);
  border-color: rgba(0, 255, 135, 0.15);
  border-bottom-right-radius: 2px;
}

.chatfpl-sidebar-panel .chat-msg.ai .msg-content {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 2px;
}

/* =========================================================
   Universal Responsive System & Mobile Touch Optimization
   ========================================================= */

/* Template Tracker Layout Styling */
.template-tracker-panel {
  position: relative;
  overflow: hidden;
  background: rgba(17, 17, 17, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  margin-bottom: 20px;
}

.responsive-two-column-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.responsive-flex-card {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Tablets and Landscape Mobile Viewports */
@media (max-width: 992px) {
  .responsive-two-column-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
}

/* Phones and Narrow Devices */
@media (max-width: 768px) {
  .template-tracker-panel {
    padding: 16px;
    border-radius: 12px;
  }

  /* 1. Results Subnav Horizontal Swipe Carousel */
  .results-subnav {
    overflow-x: auto !important;
    white-space: nowrap !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none !important;
    /* Firefox */
  }

  .results-subnav::-webkit-scrollbar {
    display: none !important;
    /* Chrome/Safari */
  }

  .rsnav-btn {
    flex: 0 0 auto !important;
    min-width: 105px !important;
    padding: 8px 10px !important;
  }

  /* 2. Football Pitch Scaling & Prevention of Broken Wrapping Rows */
  .pitch-bg {
    padding: 16px 2px !important;
  }

  .pitch-row {
    flex-wrap: nowrap !important;
    /* Force players to remain side-by-side */
    gap: 2px !important;
  }

  .pitch-players .player-card,
  .bench-area .player-card,
  #futurePitchPlayers .player-card,
  #futureBenchPlayers .player-card,
  .player-card {
    width: clamp(61px, 17vw, 78px) !important;
    min-height: clamp(84px, 20.8vw, 108px) !important;
  }

  .pc-shirt-container {
    padding: 6px 0 1px !important;
  }

  .pc-shirt-img {
    width: 82% !important;
    height: auto !important;
  }

  .pc-remove {
    width: 14px !important;
    height: 14px !important;
    font-size: 8px !important;
    top: 2px !important;
    left: 2px !important;
  }

  .pc-price {
    font-size: 0.58rem !important;
    top: 2px !important;
    right: 2px !important;
  }

  .player-card-body {
    padding: 2px 3px !important;
  }

  .pc-name {
    font-size: 0.61rem !important;
    line-height: 1.1 !important;
    padding: 3px 1px !important;
  }

  .pc-fix {
    font-size: 0.58rem !important;
    padding: 3px 1px !important;
  }

  .pc-stats-row {
    font-size: 0.58rem !important;
    margin-top: 1px !important;
  }

  .pc-meta {
    padding: 2px 0.5px !important;
    gap: 0 !important;
    justify-content: space-evenly !important;
  }

  .pc-xp {
    font-size: 0.58rem !important;
    padding: 0 3px !important;
  }

  .pc-mins {
    font-size: 0.58rem !important;
    padding: 0 3px !important;
  }

  .pc-fdr {
    font-size: 0.56rem !important;
    width: 13px !important;
    height: 13px !important;
    line-height: 13px !important;
  }
}

/* A/D makes the optional position rating distinguishable from official FPL FDR
   without adding a second badge to the very narrow mobile pitch cards. */
.player-card .pc-fdr.is-position-fdr {
  width: 27px;
  min-width: 27px;
  padding-inline: 0;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  font-size: .52rem;
}
.player-card .pc-fdr-short { display: none; }
.player-card .pc-fdr.fdr-empty {
  background: rgba(24, 24, 27, .12);
  color: #333;
}
@media (max-width: 768px) {
  /* Three metrics do not fit side by side in a five-player row at phone widths.
     Keep the slightly wider card, with position FDR fully inside its own line. */
  .player-card.has-position-fdr .pc-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: center;
    row-gap: 2px !important;
  }
  .player-card .pc-fdr.is-position-fdr {
    width: 19px !important;
    min-width: 19px !important;
    height: 13px !important;
    line-height: 13px !important;
    font-size: .52rem !important;
    padding-inline: 0;
  }
  .player-card.has-position-fdr .pc-fdr.is-position-fdr {
    grid-column: 1 / -1;
  }
  .player-card .pc-fdr-long { display: none; }
  .player-card .pc-fdr-short { display: inline; }
}

@media (max-width: 600px) {
  /* Normal's panel padding otherwise squeezes a five-player row below the
     badge's readable width. Let just its pitch use the panel's full width. */
  #normalSquadPitch { margin-inline: -16px; }
}

@media (max-width: 359px) {
  /* Five readable cards cannot fit at this width: keep them full size and
     allow a short horizontal swipe rather than cutting off position FDR. */
  .pitch-bg,
  .bench-view { overflow-x: auto !important; }
  .pitch-players,
  .bench-view .pitch-row { width: max-content; min-width: 100%; }
  .pitch-row .player-card { flex: 0 0 auto; }
}

@media (max-width: 576px) {
  .responsive-flex-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 16px;
  }
}

/* =========================================================
   Grand Master Transfer Planner Mobile Layout Optimization
   ========================================================= */

@media (max-width: 768px) {

  /* 0. Section Wrap generous bottom padding to clear bottom tab bar */
  .section-wrap {
    padding-bottom: 140px !important;
  }

  /* 1. Scout Hero Container Stacking */
  .scout-hero {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
    padding: 16px !important;
  }

  .scout-hero .score-cards {
    margin-left: 0 !important;
    width: 100% !important;
    display: flex !important;
    gap: 12px !important;
    justify-content: space-between !important;
  }

  .scout-hero .score-card {
    flex: 1 !important;
    text-align: center !important;
  }

  /* 2. Convert Desktop Table into Native-Feeling Stack Cards */
  #plannerTable {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
    border-collapse: collapse !important;
  }

  #plannerTable thead {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Hide only the column header text row, but keep the AI Strategy & Draft Scenarios card! */
  #plannerTable thead tr:nth-child(2) {
    display: none !important;
  }

  #plannerTable thead tr:first-child {
    display: block !important;
    width: 100% !important;
    margin-bottom: 12px !important;
  }

  #plannerTable thead tr:first-child th {
    display: block !important;
    width: 100% !important;
    padding: 14px !important;
    background: rgba(0, 255, 135, 0.04) !important;
    border: 1px solid rgba(0, 255, 135, 0.15) !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    text-align: left !important;
  }

  #plannerTable tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    padding: 8px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  #plannerTable tr {
    display: flex !important;
    flex-direction: column !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px !important;
    padding: 14px !important;
    gap: 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #plannerTable td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #plannerTable td:nth-child(1) {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding-bottom: 8px !important;
    margin-bottom: 4px !important;
    width: 100% !important;
  }

  #plannerTable td:nth-child(2) {
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    color: var(--text-primary) !important;
    width: 100% !important;
  }

  #plannerTable td:nth-child(3) {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    border-radius: 8px !important;
    padding: 10px !important;
    font-size: 0.82rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #plannerTable td:nth-child(4) {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
    margin-top: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #plannerTable td:nth-child(4) button {
    flex: 1 1 28% !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  /* 3. Smooth Swipe for Captaincy Cards */
  #plannerCaptaincy {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    overflow-x: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  #plannerCaptaincy::-webkit-scrollbar {
    display: none !important;
  }

  #plannerCaptaincy .cap-card {
    flex: 0 0 140px !important;
    min-width: 140px !important;
    box-sizing: border-box !important;
  }

  /* 4. Strict Horizontal containment to prevent horizontal overflow/cutoff */
  .planner-layout-container,
  .planner-left-column,
  .chatfpl-sidebar-panel,
  .results-panel,
  #plannerTable,
  #plannerTable tr,
  #plannerTable td,
  #plannerTable th {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Make sure td element text is contained */
  #plannerTable td * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Force chat sidebar to sit neatly inside viewport boundaries */
  .chatfpl-sidebar-panel {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

@media (max-width: 992px) {

  .planner-layout-container,
  .planner-left-column,
  .chatfpl-sidebar-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .chatfpl-sidebar-panel {
    margin-top: 24px !important;
    height: 520px !important;
  }
}

/* Missing Meta Pillars and Unique Bets Player Pills */
.missing-pillar-pill,
.unique-bet-pill {
  display: inline-block !important;
  /* Ensure it is ALWAYS visible and never display:none on mobile */
  color: #ffffff !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  box-sizing: border-box !important;
  transition: all 0.25s ease !important;
  cursor: default !important;
}

.missing-pillar-pill {
  background: rgba(255, 59, 92, 0.08) !important;
  border: 1px solid rgba(255, 59, 92, 0.25) !important;
  box-shadow: 0 0 12px rgba(255, 59, 92, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.missing-pillar-pill:hover {
  background: rgba(255, 59, 92, 0.15) !important;
  border-color: rgba(255, 59, 92, 0.4) !important;
  box-shadow: 0 0 16px rgba(255, 59, 92, 0.25) !important;
}

.unique-bet-pill {
  background: rgba(0, 212, 255, 0.08) !important;
  border: 1px solid rgba(0, 212, 255, 0.25) !important;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.unique-bet-pill:hover {
  background: rgba(0, 212, 255, 0.15) !important;
  border-color: rgba(0, 212, 255, 0.4) !important;
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.25) !important;
}

/* Responsive Grid layouts for Deep Meta dashboard sections */
@media (max-width: 992px) {
  .deep-meta-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

@media (max-width: 768px) {
  .gw-dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    padding: 16px !important;
  }

  .gw-dashboard-body-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 16px !important;
  }
}

/* Custom premium scrollbar for Sell Regret list */
#roiRegretList::-webkit-scrollbar {
  width: 6px;
}

#roiRegretList::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
  border-radius: 4px;
}

#roiRegretList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  transition: background 0.3s;
}

#roiRegretList::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.2);
}

#rsBtnTransferRoi.active {
  background: rgba(0, 229, 255, 0.08) !important;
}

#rsBtnTransferRoi.active .rsnav-label {
  color: var(--pl-cyan) !important;
}

#rsBtnTransferRoi.active::after {
  background: var(--pl-cyan) !important;
  box-shadow: 0 0 8px var(--pl-cyan) !important;
}

/* Rival Spy Mode styles */
.spy-card-neutral {
  opacity: 0.55;
  filter: grayscale(100%);
  background: #373737 !important;
  box-shadow: none !important;
}

.spy-card-neutral:hover {
  opacity: 0.8;
  filter: grayscale(30%);
}

.spy-card-your-diff {
  background: #00754e !important;
  border: 1px solid var(--pl-green) !important;
  box-shadow: 0 0 12px rgba(0, 255, 135, 0.4) !important;
}

.spy-card-rival-diff {
  background: #701a23 !important;
  border: 1px solid var(--pl-red) !important;
  box-shadow: 0 0 12px rgba(255, 59, 92, 0.4) !important;
}

/* Specific styling for rsBtnLeagueMultiRival magenta active color */
#rsBtnLeagueMultiRival.active {
  background: rgba(94, 234, 212, 0.08) !important;
}

#rsBtnLeagueMultiRival.active .rsnav-label {
  color: var(--pl-magenta) !important;
}

#rsBtnLeagueMultiRival.active::after {
  background: var(--pl-magenta) !important;
  box-shadow: 0 0 8px var(--pl-magenta) !important;
}

/* =====================================================
   Light Mode — Modern & Clean Redesign 2025
   ===================================================== */

/* ── Additional surface tokens for light mode ── */
:root.light-mode {
  --surface-0: #fafaf7;
  --surface-1: #ffffff;
  --surface-2: #f5f3ef;
  --surface-3: #eeebe5;
  --border-subtle: rgba(24, 24, 27, 0.06);
  --border-medium: rgba(24, 24, 27, 0.10);
  --shadow-xs: 0 1px 2px rgba(24, 24, 27, 0.05);
  --shadow-sm: 0 1px 3px rgba(24, 24, 27, 0.05), 0 6px 20px -6px rgba(24, 24, 27, 0.09);
  --shadow-md: 0 2px 6px rgba(24, 24, 27, 0.06), 0 14px 32px -10px rgba(24, 24, 27, 0.12);
  --shadow-green: 0 2px 8px rgba(24, 24, 27, 0.06), 0 16px 36px -10px rgba(0, 184, 94, 0.18);
  --transition-snap: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Remove gradient text — solid accent only ── */
:root.light-mode .hero-title em {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: var(--pl-green);
  background-clip: initial;
  color: var(--pl-green);
  filter: none;
}

:root.light-mode .kpi-val {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--pl-green);
}

:root.light-mode .logo-text span {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--pl-green);
}

/* ── Remove decorative accent stripes ── */
:root.light-mode .score-card::before {
  display: none;
}

:root.light-mode .kpi::before {
  display: none;
}

:root.light-mode .kpi {
  padding: 16px 18px;
}

/* Remove side-stripe borders from transfer priority ranks */
:root.light-mode .transfer-card.p1,
:root.light-mode .transfer-card.p2,
:root.light-mode .transfer-card.p3,
:root.light-mode .transfer-card.p4,
:root.light-mode .transfer-card.p5,
:root.light-mode .transfer-card.p6 {
  border-left: 1px solid var(--border-subtle);
}

/* ── Panel — clean white card ── */
:root.light-mode .panel {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(24, 24, 27, 0.055);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-snap), box-shadow var(--transition-snap);
}

:root.light-mode .panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-green);
}

/* ── Score cards — elevated white ── */
:root.light-mode .score-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
}

:root.light-mode .score-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 184, 94, 0.22);
  box-shadow: var(--shadow-green);
}

/* ── Transfer cards — clean white with refined hover ── */
:root.light-mode .transfer-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-bottom: 1px solid rgba(24, 24, 27, 0.055);
  box-shadow: var(--shadow-sm);
}

:root.light-mode .transfer-card:hover {
  border-color: rgba(0, 184, 94, 0.22);
  transform: translateY(-3px);
  box-shadow: var(--shadow-green);
}

:root.light-mode .t-reason {
  border-top-color: var(--border-subtle);
}

/* ── GW cards ── */
:root.light-mode .gw-card {
  background: var(--surface-1);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

:root.light-mode .gw-card:hover {
  border-color: rgba(0, 184, 94, 0.20);
  box-shadow: var(--shadow-md);
}

:root.light-mode .gw-card .gw-val {
  color: var(--text-primary);
}

/* ── Market list ── */
:root.light-mode .market-list {
  background: var(--surface-2);
  border-radius: 12px;
}

:root.light-mode .market-row {
  border-bottom-color: var(--border-subtle);
}

:root.light-mode .market-name {
  color: var(--text-primary);
}

/* ── Ticker rows ── */
:root.light-mode .ticker-row {
  background: var(--surface-2);
}

:root.light-mode .ticker-name {
  color: var(--text-primary);
}

/* ── Filter tabs ── */
:root.light-mode .ftab {
  background: var(--surface-2);
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

:root.light-mode .ftab:hover {
  background: rgba(0, 184, 94, 0.07);
  border-color: rgba(0, 184, 94, 0.22);
  color: var(--pl-green);
}

/* ── Stats table ── */
:root.light-mode .stats-tbl th {
  border-bottom-color: var(--border-medium);
}

:root.light-mode .stats-tbl td {
  border-bottom-color: var(--border-subtle);
}

:root.light-mode .stats-tbl tbody tr:hover {
  background: rgba(24, 24, 27, 0.02);
}

/* ── Bottom nav — uses token already, just reinforce ── */
:root.light-mode .main-tabs {
  background: var(--nav-bg);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-top-color: var(--nav-border);
  box-shadow: 0 -1px 0 rgba(24, 24, 27, 0.05), 0 -8px 28px rgba(24, 24, 27, 0.06);
}

/* ── Upload zone ── */
:root.light-mode .upload-zone {
  border-color: rgba(0, 184, 94, 0.28);
  background: rgba(0, 184, 94, 0.02);
}

:root.light-mode .upload-zone:hover,
:root.light-mode .upload-zone.drag-over {
  border-color: var(--pl-green);
  background: rgba(0, 184, 94, 0.05);
  box-shadow: 0 0 0 4px rgba(0, 184, 94, 0.07), 0 8px 28px rgba(0, 184, 94, 0.10);
}

/* ── Results subnav active state ── */
:root.light-mode .rsnav-btn.active {
  background: rgba(0, 184, 94, 0.07);
}

:root.light-mode .rsnav-btn.active::after {
  box-shadow: none;
}

/* ── What If stepper ── */
:root.light-mode .wi-step-btn:hover {
  background: rgba(24, 24, 27, 0.05);
}

/* ── Progress bar track ── */
:root.light-mode .progress-bar {
  background: var(--border-medium);
}

/* ── Reset button ── */
:root.light-mode .reset-all-btn {
  background: var(--surface-2);
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

:root.light-mode .reset-all-btn:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

/* ── What If player row dividers ── */
:root.light-mode .wi-player-row {
  border-bottom-color: var(--border-subtle);
}

/* ── What If fixture header inset ── */
:root.light-mode .wi-fixture-header {
  background: rgba(24, 24, 27, 0.015);
}

/* ── Scrollbar: light-mode track/thumb ── */
:root.light-mode #roiRegretList::-webkit-scrollbar-track {
  background: var(--surface-2);
}

:root.light-mode #roiRegretList::-webkit-scrollbar-thumb {
  background: rgba(24, 24, 27, 0.12);
}

:root.light-mode #roiRegretList::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 184, 94, 0.35);
}

/* ── Hero eyebrow pill ── */
:root.light-mode .hero-eyebrow {
  background: rgba(94, 234, 212, 0.06);
  border-color: rgba(94, 234, 212, 0.20);
}

/* ── Hero sub (description text) ── */
:root.light-mode .hero-sub {
  color: var(--text-secondary);
}

/* ── Score-val in light: use token color, no gradient ── */
:root.light-mode .score-val {
  color: var(--pl-green);
}

:root.light-mode .score-val.mag {
  color: var(--pl-magenta);
}

/* ── Position badges — properly tinted in light ── */
:root.light-mode .pos-badge.GKP {
  background: rgba(230, 149, 0, 0.10);
}

:root.light-mode .pos-badge.DEF {
  background: rgba(0, 168, 90, 0.10);
}

:root.light-mode .pos-badge.MID {
  background: rgba(0, 149, 199, 0.10);
}

:root.light-mode .pos-badge.FWD {
  background: rgba(232, 38, 76, 0.10);
}

/* ── Popover dark card: keep dark in light mode (intentional) ── */
:root.light-mode .xpts-popover {
  background: rgba(17, 17, 19, 0.96);
  border-color: rgba(0, 184, 94, 0.35);
}

/* ── Spy mode: keep dark game-state cards as-is ── */

/* ── Tab active indicator: solid color, no gradient ── */
:root.light-mode .tab-btn.active::before {
  background: var(--pl-green);
}

/* ── Micro-interaction: card focus ring for keyboard nav ── */
:root.light-mode .score-card:focus-visible,
:root.light-mode .transfer-card:focus-visible,
:root.light-mode .panel:focus-visible {
  outline: 2px solid var(--pl-green);
  outline-offset: 2px;
}

/* ── api-key banner: light-adapted ── */
:root.light-mode .api-key-banner {
  background: rgba(0, 149, 199, 0.05);
  border-color: rgba(0, 149, 199, 0.18);
}

/* ── Free badge ── */
:root.light-mode .free-badge {
  background: rgba(0, 149, 199, 0.08);
  border-color: rgba(0, 149, 199, 0.22);
}

/* ── Loading overlay — crisp white backdrop ── */
:root.light-mode .loading-overlay {
  background: rgba(250, 250, 247, 0.90);
}

/* ── Gw-badge "finished" chip ── */
:root.light-mode .gw-finished {
  background: var(--surface-2);
  border-color: var(--border-medium);
}

/* =============================================================
   Light Mode v2 — Modern, Slick & Interactive
   12 targeted improvements. Dark mode is untouched.
   ============================================================= */

/* ── 01: Remove top-stripe anti-pattern on score cards ─────── */
:root.light-mode .score-card::before {
  display: none;
}

:root.light-mode .score-card {
  background: #ffffff;
  border: 0.5px solid rgba(24, 24, 27, 0.07);
  box-shadow:
    0 0.5px 0 rgba(24, 24, 27, 0.04),
    0 1px 3px rgba(24, 24, 27, 0.05),
    0 6px 18px -8px rgba(24, 24, 27, 0.10);
  transition:
    transform 180ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .score-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 3px rgba(24, 24, 27, 0.05),
    0 8px 24px -6px rgba(0, 184, 94, 0.18),
    0 16px 40px -12px rgba(24, 24, 27, 0.10);
}

:root.light-mode .score-card:active {
  transform: scale(0.97) translateY(0);
  box-shadow:
    0 0.5px 0 rgba(24, 24, 27, 0.04),
    0 2px 6px rgba(24, 24, 27, 0.06);
  transition-duration: 80ms;
}

/* ── 01b: KPI cards — background tint instead of stripe ────── */
:root.light-mode .kpi::before {
  display: none;
}

:root.light-mode .kpi {
  background: rgba(0, 184, 94, 0.04);
  border: 0.5px solid rgba(0, 184, 94, 0.14);
  box-shadow:
    0 0.5px 0 rgba(24, 24, 27, 0.03),
    0 1px 3px rgba(24, 24, 27, 0.04),
    0 4px 12px -6px rgba(0, 184, 94, 0.12);
}

/* ── 02: Fix all gradient text — solid colors in light mode ── */
:root.light-mode .hero-title em {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--pl-green);
  color: var(--pl-green);
  filter: none;
  text-shadow: 0 2px 16px rgba(0, 184, 94, 0.20);
}

:root.light-mode .logo-text span {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--pl-green);
  color: var(--pl-green);
}

:root.light-mode .kpi-val {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--pl-green);
  color: var(--pl-green);
  filter: none;
}

/* ── 03: Active press feedback — scale(0.97) everywhere ────── */
:root.light-mode .analyze-btn {
  transition:
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 150ms cubic-bezier(0.23, 1, 0.32, 1),
    background 100ms ease;
}

:root.light-mode .analyze-btn:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

:root.light-mode .tab-btn {
  transition:
    color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .tab-btn:active {
  transform: scale(0.92);
}

:root.light-mode .rsnav-btn {
  transition:
    color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .rsnav-btn:active {
  transform: scale(0.95);
}

:root.light-mode .player-slot:active {
  transform: scale(0.99);
  background: rgba(0, 184, 94, 0.04);
}

:root.light-mode .wi-step-btn {
  transition: background 120ms ease, transform 100ms ease;
}

:root.light-mode .wi-step-btn:active {
  transform: scale(0.88);
  background: rgba(24, 24, 27, 0.08);
}

/* ── 04: Faster, more specific hover transitions ────────────── */
:root.light-mode {
  --transition: 0.18s cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-crisp: cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .player-slot {
  transition:
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    border-color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 150ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .player-slot:hover {
  box-shadow: 0 0 0 3px rgba(0, 184, 94, 0.08);
}

/* ── 05: Fix toggle slider visibility on white ──────────────── */
:root.light-mode .toggle-slider {
  background: rgba(24, 24, 27, 0.12);
  border: 0.5px solid rgba(24, 24, 27, 0.16);
}

:root.light-mode .toggle-slider:before {
  background: rgba(24, 24, 27, 0.38);
}

:root.light-mode input:checked+.toggle-slider {
  background: rgba(0, 184, 94, 0.22);
  border-color: rgba(0, 184, 94, 0.38);
}

:root.light-mode input:checked+.toggle-slider:before {
  background: var(--pl-green);
  box-shadow: 0 1px 4px rgba(0, 184, 94, 0.42);
}

/* ── 06: Richer ambient background mesh ─────────────────────── */
:root.light-mode .bg-mesh {
  background:
    radial-gradient(ellipse 65% 55% at 8% 0%, rgba(94, 234, 212, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 55% 50% at 94% 25%, rgba(0, 149, 199, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 50% 98%, rgba(0, 184, 94, 0.07) 0%, transparent 55%),
    linear-gradient(168deg, #fafaf7 0%, #f6f1e8 45%, #faf6f0 100%);
}

:root.light-mode .bg-mesh::after {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(24, 24, 27, 0.020) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(24, 24, 27, 0.020) 80px);
}

/* ── 07: Easing curves are already in --04 above ────────────── */

/* ── 08: Stagger entrance for score cards ───────────────────── */
@media (prefers-reduced-motion: no-preference) {
  :root.light-mode .score-cards .score-card {
    animation: lm-card-enter 320ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }

  :root.light-mode .score-cards .score-card:nth-child(1) {
    animation-delay: 0ms;
  }

  :root.light-mode .score-cards .score-card:nth-child(2) {
    animation-delay: 40ms;
  }

  :root.light-mode .score-cards .score-card:nth-child(3) {
    animation-delay: 80ms;
  }

  :root.light-mode .score-cards .score-card:nth-child(4) {
    animation-delay: 120ms;
  }

  :root.light-mode .score-cards .score-card:nth-child(5) {
    animation-delay: 160ms;
  }

  @keyframes lm-card-enter {
    from {
      opacity: 0;
      transform: translateY(7px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Panel views fade+slide in when shown */
  :root.light-mode .page-view.active {
    animation: lm-panel-enter 260ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }

  :root.light-mode .results-panel.active,
  :root.light-mode .league-panel.active {
    animation: lm-panel-enter 240ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }

  @keyframes lm-panel-enter {
    from {
      opacity: 0;
      transform: translateY(8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Autocomplete dropdown slides in from top */
  :root.light-mode .autocomplete-list {
    animation: lm-dropdown-enter 160ms cubic-bezier(0.23, 1, 0.32, 1) both;
    transform-origin: top center;
  }

  @keyframes lm-dropdown-enter {
    from {
      opacity: 0;
      transform: scaleY(0.90) translateY(-4px);
    }

    to {
      opacity: 1;
      transform: scaleY(1) translateY(0);
    }
  }
}

/* ── 09: Chat interface — proper light mode treatment ───────── */
:root.light-mode .chatfpl-sidebar {
  background: #f5f1ea;
  border-right-color: rgba(24, 24, 27, 0.07);
}

:root.light-mode .chatfpl-new-btn {
  background: #ffffff;
  border-color: rgba(24, 24, 27, 0.09);
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.05);
  transition:
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    border-color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .chatfpl-new-btn:hover {
  background: #faf8f4;
  border-color: rgba(0, 184, 94, 0.30);
  box-shadow: 0 2px 8px rgba(0, 184, 94, 0.10);
}

:root.light-mode .chat-item:hover {
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-primary);
}

:root.light-mode .chat-item.active {
  background: rgba(0, 184, 94, 0.08);
  color: #006b35;
}

:root.light-mode .msg-content {
  background: #ffffff;
  border-color: rgba(24, 24, 27, 0.07);
  box-shadow:
    0 1px 3px rgba(24, 24, 27, 0.04),
    0 4px 12px -4px rgba(24, 24, 27, 0.06);
}

:root.light-mode .chat-msg.user .msg-content {
  background: rgba(0, 184, 94, 0.07);
  border-color: rgba(0, 184, 94, 0.20);
}

:root.light-mode .chatfpl-input-zone {
  background: transparent;
}

:root.light-mode .chatfpl-input-wrapper {
  background: #ffffff;
  border-color: rgba(24, 24, 27, 0.10);
  box-shadow:
    0 1px 3px rgba(24, 24, 27, 0.05),
    0 4px 12px -4px rgba(24, 24, 27, 0.06);
  transition:
    border-color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .chatfpl-input-wrapper:focus-within {
  border-color: rgba(0, 184, 94, 0.45);
  box-shadow:
    0 0 0 3px rgba(0, 184, 94, 0.10),
    0 4px 12px -4px rgba(24, 24, 27, 0.06);
}

/* ── 10: Upload zone — glow ring on hover/drag ───────────────── */
:root.light-mode .upload-zone {
  transition:
    border-color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .upload-zone:hover,
:root.light-mode .upload-zone.drag-over {
  border-color: var(--pl-green);
  background: rgba(0, 184, 94, 0.04);
  box-shadow:
    0 0 0 3px rgba(0, 184, 94, 0.08),
    0 8px 28px rgba(0, 184, 94, 0.10);
}

/* ── 11: Bottom nav — crisper glass with upward shadow ───────── */
:root.light-mode .main-tabs {
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-top: 0.5px solid rgba(24, 24, 27, 0.06);
  box-shadow:
    0 -1px 0 rgba(24, 24, 27, 0.04),
    0 -4px 20px rgba(24, 24, 27, 0.06),
    0 -12px 40px -8px rgba(24, 24, 27, 0.04);
}

:root.light-mode .tab-btn.active {
  color: #005c33;
}

:root.light-mode .tab-btn.active::before {
  background: var(--pl-green);
  box-shadow: none;
}

/* ── 12: @starting-style entry for deep-dive results ─────────── */
@supports (selector(:has(*))) {
  @media (prefers-reduced-motion: no-preference) {
    :root.light-mode .deep-dive-results {
      opacity: 1;
      transform: translateY(0);
      transition:
        opacity 300ms cubic-bezier(0.23, 1, 0.32, 1),
        transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
    }

    @starting-style {
      :root.light-mode .deep-dive-results {
        opacity: 0;
        transform: translateY(10px);
      }
    }
  }
}

/* ── Bonus: wi-share button active state ─────────────────────── */
:root.light-mode .wi-share-btn {
  transition:
    transform 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .wi-share-btn:active {
  transform: scale(0.97);
}

/* ── Bonus: Improved focus rings for keyboard nav ────────────── */
:root.light-mode *:focus-visible {
  outline: 2px solid var(--pl-green);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Bonus: Chatbot send button ──────────────────────────────── */
:root.light-mode #btnChatFplSend {
  transition:
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1),
    background 150ms ease,
    box-shadow 150ms ease;
}

:root.light-mode #btnChatFplSend:active {
  transform: scale(0.90);
}

/* =============================================================
   Light Mode v2 — Modern, Slick & Interactive
   12 targeted improvements. Dark mode is untouched.
   ============================================================= */

/* ── 01: Remove top-stripe anti-pattern on score cards ─────── */
:root.light-mode .score-card::before {
  display: none;
}

:root.light-mode .score-card {
  background: #ffffff;
  border: 0.5px solid rgba(24, 24, 27, 0.07);
  box-shadow:
    0 0.5px 0 rgba(24, 24, 27, 0.04),
    0 1px 3px rgba(24, 24, 27, 0.05),
    0 6px 18px -8px rgba(24, 24, 27, 0.10);
  transition:
    transform 180ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .score-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 3px rgba(24, 24, 27, 0.05),
    0 8px 24px -6px rgba(0, 184, 94, 0.18),
    0 16px 40px -12px rgba(24, 24, 27, 0.10);
}

:root.light-mode .score-card:active {
  transform: scale(0.97) translateY(0);
  box-shadow:
    0 0.5px 0 rgba(24, 24, 27, 0.04),
    0 2px 6px rgba(24, 24, 27, 0.06);
  transition-duration: 80ms;
}

/* ── 01b: KPI cards — background tint instead of stripe ────── */
:root.light-mode .kpi::before {
  display: none;
}

:root.light-mode .kpi {
  background: rgba(0, 184, 94, 0.04);
  border: 0.5px solid rgba(0, 184, 94, 0.14);
  box-shadow:
    0 0.5px 0 rgba(24, 24, 27, 0.03),
    0 1px 3px rgba(24, 24, 27, 0.04),
    0 4px 12px -6px rgba(0, 184, 94, 0.12);
}

/* ── 02: Fix all gradient text — solid colors in light mode ── */
:root.light-mode .hero-title em {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--pl-green);
  color: var(--pl-green);
  filter: none;
  text-shadow: 0 2px 16px rgba(0, 184, 94, 0.20);
}

:root.light-mode .logo-text span {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--pl-green);
  color: var(--pl-green);
}

:root.light-mode .kpi-val {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: var(--pl-green);
  color: var(--pl-green);
  filter: none;
}

/* ── 03: Active press feedback — scale(0.97) everywhere ────── */
:root.light-mode .analyze-btn {
  transition:
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 150ms cubic-bezier(0.23, 1, 0.32, 1),
    background 100ms ease;
}

:root.light-mode .analyze-btn:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

:root.light-mode .tab-btn {
  transition:
    color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .tab-btn:active {
  transform: scale(0.92);
}

:root.light-mode .rsnav-btn {
  transition:
    color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .rsnav-btn:active {
  transform: scale(0.95);
}

:root.light-mode .player-slot:active {
  transform: scale(0.99);
  background: rgba(0, 184, 94, 0.04);
}

:root.light-mode .wi-step-btn {
  transition: background 120ms ease, transform 100ms ease;
}

:root.light-mode .wi-step-btn:active {
  transform: scale(0.88);
  background: rgba(24, 24, 27, 0.08);
}

/* ── 04: Faster, more specific hover transitions ────────────── */
:root.light-mode {
  --transition: 0.18s cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-crisp: cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .player-slot {
  transition:
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    border-color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 150ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .player-slot:hover {
  box-shadow: 0 0 0 3px rgba(0, 184, 94, 0.08);
}

/* ── 05: Fix toggle slider visibility on white ──────────────── */
:root.light-mode .toggle-slider {
  background: rgba(24, 24, 27, 0.12);
  border: 0.5px solid rgba(24, 24, 27, 0.16);
}

:root.light-mode .toggle-slider:before {
  background: rgba(24, 24, 27, 0.38);
}

:root.light-mode input:checked+.toggle-slider {
  background: rgba(0, 184, 94, 0.22);
  border-color: rgba(0, 184, 94, 0.38);
}

:root.light-mode input:checked+.toggle-slider:before {
  background: var(--pl-green);
  box-shadow: 0 1px 4px rgba(0, 184, 94, 0.42);
}

/* ── 06: Richer ambient background mesh ─────────────────────── */
:root.light-mode .bg-mesh {
  background:
    radial-gradient(ellipse 65% 55% at 8% 0%, rgba(94, 234, 212, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 55% 50% at 94% 25%, rgba(0, 149, 199, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 50% 98%, rgba(0, 184, 94, 0.07) 0%, transparent 55%),
    linear-gradient(168deg, #fafaf7 0%, #f6f1e8 45%, #faf6f0 100%);
}

:root.light-mode .bg-mesh::after {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(24, 24, 27, 0.020) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(24, 24, 27, 0.020) 80px);
}

/* ── 08: Stagger entrance for score cards ───────────────────── */
@media (prefers-reduced-motion: no-preference) {
  :root.light-mode .score-cards .score-card {
    animation: lm-card-enter 320ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }

  :root.light-mode .score-cards .score-card:nth-child(1) {
    animation-delay: 0ms;
  }

  :root.light-mode .score-cards .score-card:nth-child(2) {
    animation-delay: 40ms;
  }

  :root.light-mode .score-cards .score-card:nth-child(3) {
    animation-delay: 80ms;
  }

  :root.light-mode .score-cards .score-card:nth-child(4) {
    animation-delay: 120ms;
  }

  :root.light-mode .score-cards .score-card:nth-child(5) {
    animation-delay: 160ms;
  }

  @keyframes lm-card-enter {
    from {
      opacity: 0;
      transform: translateY(7px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  :root.light-mode .page-view.active {
    animation: lm-panel-enter 260ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }

  :root.light-mode .results-panel.active,
  :root.light-mode .league-panel.active {
    animation: lm-panel-enter 240ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }

  @keyframes lm-panel-enter {
    from {
      opacity: 0;
      transform: translateY(8px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  :root.light-mode .autocomplete-list {
    animation: lm-dropdown-enter 160ms cubic-bezier(0.23, 1, 0.32, 1) both;
    transform-origin: top center;
  }

  @keyframes lm-dropdown-enter {
    from {
      opacity: 0;
      transform: scaleY(0.90) translateY(-4px);
    }

    to {
      opacity: 1;
      transform: scaleY(1) translateY(0);
    }
  }
}

/* ── 09: Chat interface — proper light mode treatment ───────── */
:root.light-mode .chatfpl-sidebar {
  background: #f5f1ea;
  border-right-color: rgba(24, 24, 27, 0.07);
}

:root.light-mode .chatfpl-new-btn {
  background: #ffffff;
  border-color: rgba(24, 24, 27, 0.09);
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.05);
  transition:
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    border-color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 150ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .chatfpl-new-btn:hover {
  background: #faf8f4;
  border-color: rgba(0, 184, 94, 0.30);
  box-shadow: 0 2px 8px rgba(0, 184, 94, 0.10);
}

:root.light-mode .chat-item:hover {
  background: rgba(24, 24, 27, 0.04);
  color: var(--text-primary);
}

:root.light-mode .chat-item.active {
  background: rgba(0, 184, 94, 0.08);
  color: #006b35;
}

:root.light-mode .msg-content {
  background: #ffffff;
  border-color: rgba(24, 24, 27, 0.07);
  box-shadow:
    0 1px 3px rgba(24, 24, 27, 0.04),
    0 4px 12px -4px rgba(24, 24, 27, 0.06);
}

:root.light-mode .chat-msg.user .msg-content {
  background: rgba(0, 184, 94, 0.07);
  border-color: rgba(0, 184, 94, 0.20);
}

:root.light-mode .chatfpl-input-zone {
  background: transparent;
}

:root.light-mode .chatfpl-input-wrapper {
  background: #ffffff;
  border-color: rgba(24, 24, 27, 0.10);
  box-shadow:
    0 1px 3px rgba(24, 24, 27, 0.05),
    0 4px 12px -4px rgba(24, 24, 27, 0.06);
  transition:
    border-color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .chatfpl-input-wrapper:focus-within {
  border-color: rgba(0, 184, 94, 0.45);
  box-shadow:
    0 0 0 3px rgba(0, 184, 94, 0.10),
    0 4px 12px -4px rgba(24, 24, 27, 0.06);
}

/* ── 10: Upload zone — glow ring on hover/drag ───────────────── */
:root.light-mode .upload-zone {
  transition:
    border-color 150ms cubic-bezier(0.23, 1, 0.32, 1),
    background 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .upload-zone:hover,
:root.light-mode .upload-zone.drag-over {
  border-color: var(--pl-green);
  background: rgba(0, 184, 94, 0.04);
  box-shadow:
    0 0 0 3px rgba(0, 184, 94, 0.08),
    0 8px 28px rgba(0, 184, 94, 0.10);
}

/* ── 11: Bottom nav — crisper glass with upward shadow ───────── */
:root.light-mode .main-tabs {
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-top: 0.5px solid rgba(24, 24, 27, 0.06);
  box-shadow:
    0 -1px 0 rgba(24, 24, 27, 0.04),
    0 -4px 20px rgba(24, 24, 27, 0.06),
    0 -12px 40px -8px rgba(24, 24, 27, 0.04);
}

:root.light-mode .tab-btn.active {
  color: #005c33;
}

:root.light-mode .tab-btn.active::before {
  background: var(--pl-green);
  box-shadow: none;
}

/* ── 12: @starting-style entry for deep-dive results ─────────── */
@supports (selector(:has(*))) {
  @media (prefers-reduced-motion: no-preference) {
    :root.light-mode .deep-dive-results {
      opacity: 1;
      transform: translateY(0);
      transition:
        opacity 300ms cubic-bezier(0.23, 1, 0.32, 1),
        transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
    }

    @starting-style {
      :root.light-mode .deep-dive-results {
        opacity: 0;
        transform: translateY(10px);
      }
    }
  }
}

/* ── Bonus: wi-share button active state ─────────────────────── */
:root.light-mode .wi-share-btn {
  transition:
    transform 150ms cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

:root.light-mode .wi-share-btn:active {
  transform: scale(0.97);
}

/* ── Bonus: Improved focus rings for keyboard nav ────────────── */
:root.light-mode *:focus-visible {
  outline: 2px solid var(--pl-green);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Bonus: Chat send button press feedback ──────────────────── */
:root.light-mode #btnChatFplSend {
  transition:
    transform 120ms cubic-bezier(0.23, 1, 0.32, 1),
    background 150ms ease,
    box-shadow 150ms ease;
}

:root.light-mode #btnChatFplSend:active {
  transform: scale(0.90);
}

/* ========================================================
   FPL ANALYZER — SIMPLIFIED MODE STYLES
   ======================================================== */

/* App Mode Toggle Styles */
.mode-toggle-container {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-right: 8px;
  position: relative;
  flex-wrap: wrap;
  justify-content: center;
}

.mode-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mode-toggle-btn:hover {
  color: var(--text-primary);
}

.mode-toggle-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Switch states in simple mode */
body.simple-mode .mode-toggle-container {
  background: rgba(0, 255, 135, 0.05);
  border-color: rgba(0, 255, 135, 0.15);
}

body.simple-mode #btnModeSimple.active {
  background: var(--pl-green);
  color: #000 !important;
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.3);
}

body.simple-mode #btnModePro {
  color: var(--text-muted);
}

/* Strategy Mode Styles */
#btnStrat_safe.active {
  background: var(--pl-green) !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.4) !important;
}

#btnStrat_balanced.active {
  background: var(--pl-purple) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(24, 24, 27, 0.4) !important;
}

#btnStrat_aggressive.active {
  background: var(--pl-red) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(255, 59, 92, 0.4) !important;
}

#btnStrat_minileague.active {
  background: var(--pl-cyan) !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(0, 255, 240, 0.4) !important;
}

.strategy-risk-block {
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.strategy-risk-block.worst-case {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ff8b8b;
}

.strategy-risk-block.best-case {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

.strategy-risk-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* Simple Mode ACCENTS & SHIFTS */
body.simple-mode {
  --bg-mesh-1: radial-gradient(circle at 10% 20%, rgba(0, 255, 135, 0.08) 0%, transparent 40%);
  --bg-mesh-2: radial-gradient(circle at 90% 80%, rgba(24, 24, 27, 0.25) 0%, transparent 50%);
}

body.simple-mode .pro-nav-tabs {
  display: none !important;
}

body.simple-mode .main-tabs {
  background: rgba(18, 5, 24, 0.95) !important;
  border-top: 1px solid rgba(0, 255, 135, 0.15) !important;
}

:root.light-mode body.simple-mode .main-tabs {
  background: rgba(255, 255, 255, 0.95) !important;
  border-top: 1px solid rgba(0, 143, 76, 0.15) !important;
}

body.simple-mode .simple-nav-tabs {
  display: flex !important;
  background: transparent !important;
  border-top: none !important;
}

body.simple-mode.chat-active-mode .simple-nav-tabs {
  display: none !important;
}

body.simple-mode .simple-nav-tabs .tab-btn {
  min-width: 70px;
  height: 58px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

body.simple-mode .simple-nav-tabs .tab-btn.active {
  color: var(--pl-green);
}

body.simple-mode .simple-nav-tabs .tab-btn.active::before {
  background: var(--pl-green);
  box-shadow: 0 0 12px var(--pl-green);
}

/* Simple Mode Cards */
.simple-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.simple-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 255, 135, 0.05);
  border-color: rgba(0, 255, 135, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.simple-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.simple-card-icon {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.simple-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pl-green);
  box-shadow: 0 0 0 4px rgba(0, 255, 135, 0.12);
  animation: status-pulse 2s infinite ease-in-out;
}

.mature-icon-label {
  width: fit-content;
  margin: 0 auto 16px;
  padding: 7px 11px;
  border: 1px solid rgba(0, 255, 135, 0.3);
  border-radius: 999px;
  color: var(--pl-green);
  background: rgba(0, 255, 135, 0.06);
  font: 900 0.68rem/1 'Space Grotesk', sans-serif;
  letter-spacing: 0.1em;
}

@keyframes status-pulse {

  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.simple-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.simple-badge.green {
  background: rgba(0, 255, 135, 0.1);
  color: var(--pl-green);
  border-color: rgba(0, 255, 135, 0.2);
}

.simple-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 4px 0 0 0;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
}

.simple-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
  flex: 1;
}

.simple-card-cta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pl-green);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Full Screen Simplified Panels */
.simple-full-panel {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-bottom: 20px;
}

.simple-player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.simple-player-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.simple-player-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Mode select modal cards */
.mode-select-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  background: rgba(255, 255, 255, 0.04) !important;
}

/* Light mode overrides for simple mode */
:root.light-mode body.simple-mode {
  --bg-mesh-1: radial-gradient(circle at 10% 20%, rgba(0, 255, 135, 0.15) 0%, transparent 40%);
  --bg-mesh-2: radial-gradient(circle at 90% 80%, rgba(200, 240, 220, 0.3) 0%, transparent 50%);
}

:root.light-mode .simple-card {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.06);
}

:root.light-mode .simple-card-title {
  color: #18181b;
}

:root.light-mode .simple-card:hover {
  background: rgba(0, 255, 135, 0.03);
  border-color: var(--pl-green);
}

:root.light-mode .simple-card-cta {
  color: #008f4c;
}

:root.light-mode .simple-full-panel {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.05);
}

:root.light-mode .simple-player-row {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.04);
}

:root.light-mode .simple-player-name {
  color: #18181b;
}

/* Editable Projections UI */
.switch-pill {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.switch-pill input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-pill {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .4s;
  border-radius: 20px;
}

.slider-pill:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider-pill {
  background-color: var(--pl-green);
}

input:checked+.slider-pill:before {
  transform: translateX(20px);
  background-color: #000;
}

.override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--pl-green);
}

.override-row.warning {
  border-left-color: #ffcc00;
}

.edit-proj-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  transition: transform 0.2s;
  opacity: 0.7;
}

.edit-proj-btn:hover {
  transform: scale(1.2);
  opacity: 1;
}

/* Editable Projections Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(18, 0, 24, 0.94);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-overlay .modal {
  background: linear-gradient(160deg, #111113 0%, #0f001a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: min(450px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 255, 135, 0.12);
  animation: pmSlideUp 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Strategy Mode Button Styling */
.strategy-toggle-container {
  display: inline-flex;
  gap: 3px;
  background: rgba(18, 0, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 3px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.strategy-toggle-container .mode-toggle-btn {
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active State Custom Themes */
.strategy-toggle-container #btnStrat_safe.active {
  background: rgba(45, 212, 191, 0.15) !important;
  color: #2dd4bf !important;
  border-color: rgba(45, 212, 191, 0.3) !important;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.25);
}

.strategy-toggle-container #btnStrat_balanced.active {
  background: rgba(129, 140, 248, 0.15) !important;
  color: #818cf8 !important;
  border-color: rgba(129, 140, 248, 0.3) !important;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.25);
}

.strategy-toggle-container #btnStrat_aggressive.active {
  background: rgba(244, 63, 94, 0.18) !important;
  color: #f43f5e !important;
  border-color: rgba(244, 63, 94, 0.3) !important;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.25);
}

.strategy-toggle-container #btnStrat_minileague.active {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #06b6d4 !important;
  border-color: rgba(6, 182, 212, 0.3) !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}


/* Multi-GW Solver Transparency CSS Styles */

/* Assumptions Panel Styles */
.assumptions-card {
  background: linear-gradient(135deg, rgba(17, 17, 19, 0.45), rgba(10, 5, 20, 0.3));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.assumptions-header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: background 0.2s ease;
}

.assumptions-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.assumptions-header .arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.8rem;
  color: var(--pl-green);
}

.assumptions-card.expanded .arrow {
  transform: rotate(180deg);
}

.assumptions-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
  padding: 0 16px;
}

.assumptions-card.expanded .assumptions-body {
  max-height: 380px;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.assumptions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.assumption-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assumption-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.assumption-value {
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Badges for Margin Tiers */
.margin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.margin-badge-clear {
  background: rgba(0, 230, 118, 0.1);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.25);
}

.margin-badge-marginal {
  background: rgba(255, 179, 0, 0.1);
  color: #ffb300;
  border: 1px solid rgba(255, 179, 0, 0.25);
}

.margin-badge-coinflip {
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Pathways Comparison Styles */
.pathway-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-top: 16px;
}

.pathways-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.pathway-item {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pathway-item:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.08);
}

.pathway-item.recommended {
  background: rgba(0, 230, 118, 0.03);
  border-color: rgba(0, 230, 118, 0.15);
}

.pathway-item.recommended:hover {
  border-color: rgba(0, 230, 118, 0.3);
}

.pathway-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.pathway-meta {
  display: flex;
  gap: 16px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pathway-desc {
  font-size: 0.75rem;
  color: #ccc;
  margin-top: 8px;
  line-height: 1.35;
}

/* Sensitivity Analysis Styles */
.sensitivity-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-top: 16px;
}

.sensitivity-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.75rem;
}

.sensitivity-table th,
.sensitivity-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sensitivity-table th {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.65rem;
}

.sensitivity-row:hover {
  background: rgba(255, 255, 255, 0.01);
}

/* Why Not Dialog styles */
.why-not-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: #ddd;
  line-height: 1.4;
  animation: pmFadeIn 0.2s ease-out;
}

@keyframes pmFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   Normal Mode Mobile Layout Containment & Responsive Grid
   ========================================================= */
.normal-two-col {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.chips-grid {
  grid-template-columns: 1fr 1fr;
}

/* Global Mobile Containment Overrides for Normal Mode */
#viewNormalDashboard {
  width: 100% !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
  padding: 0 4px !important;
}

/* Ensure all panel cards are contained and shrink properly on mobile viewports */
.panel {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Ensure responsive tables inside panels wrap correctly and scroll horizontally */
.panel div[style*="overflow-x:auto"],
.panel div[style*="overflow-x: auto"] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Prevent grid cells from expanding wider than viewport */
#viewNormalDashboard>div[style*="display:grid"],
#viewNormalDashboard>div[style*="display: grid"] {
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 600px) {

  /* Prevent horizontal cutoff on mobile */
  .panel {
    padding: 16px !important;
  }

  .normal-two-col {
    grid-template-columns: 1fr !important;
  }

  .chips-grid {
    grid-template-columns: 1fr !important;
  }

  /* Responsive treatment for watchlist banner */
  div[style*="rgba(0, 255, 135, 0.15)"] {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 480px) {

  /* Vertically stack Transfer Scout dropdown & price slider filters */
  #transferScoutNormalSection div[style*="display:flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #transferScoutNormalSection div[style*="display:flex"]>div {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  /* Stack decision buttons vertically for full-width tap target */
  .panel div[style*="justify-content:space-between"][style*="flex-wrap:wrap"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  .panel div[style*="justify-content:space-between"][style*="flex-wrap:wrap"]>button {
    width: 100% !important;
    text-align: center !important;
  }

  /* Stack scout hero layout */
  .scout-hero {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 12px !important;
  }

  .scout-hero-icon {
    margin-right: 0 !important;
  }
}

/* ─── Independence disclaimer ─────────────────────────────────────────────
   Club, competition and player names appear all over the app for
   identification. This states plainly, on every page, that the site has no
   relationship with the rights holders. Quiet by design — it is a standing
   legal statement, not a message competing for attention. */
.footer-disclaimer {
  max-width: 780px;
  margin: 14px auto 0;
  padding: 0 20px;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--text-muted, rgba(255, 255, 255, 0.45));
}

:root.light-mode .footer-disclaimer { color: rgba(24, 24, 27, 0.55); }

/* ── Mini-league panels: no blur on boxes that grow with the league ───────
   .panel carries backdrop-filter: blur(8px). Everywhere else a panel is a
   card; in the mini-league view its height scales with the number of
   managers — measured at 2,880px for the league table and up to 8,570px for
   the taller panels. Those 22 boxes were 27.8 of the page's 29.6 megapixels
   of blurred surface, i.e. 94% of it.

   Chrome rasterizes in tiles and re-reads the backdrop for every tile of a
   blurred element. At that surface area it stops rasterizing the later
   tiles, so the panel background and the cell text never paint while
   elements carrying their own background — the Spy buttons — still do. That
   is the reported symptom exactly: past the first few rows the table kept
   only its ACTION column and the card's background stopped.

   Nothing is lost visually. What sits behind these panels is a flat body
   colour, so rgba(24, 24, 27, 0.5) over rgb(10, 10, 11) composites to exactly
   rgb(24, 24, 27); light mode already paints .panel opaque via a
   higher-specificity rule, which keeps its own background here.  */
:root { --league-panel-bg: rgb(24, 24, 27); }

.league-panel .panel {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: var(--league-panel-bg);
}

/* ── "Where do I find my league ID?" hint under the mini-league input ─────
   The ID is never shown as a labelled field anywhere in FPL — it only
   appears inside the URL of the league's standings page — so the hint shows
   the address with the number picked out rather than just naming it.
   Colours come from the input tokens so the example reads correctly in both
   themes; a hard-coded translucent white is invisible on the light surface. */
.league-id-hint {
  margin: -8px 0 0;
  padding: 0 20px 20px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.league-id-hint strong {
  display: block;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 2px;
}

.league-id-hint a {
  color: var(--pl-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.league-id-hint-url {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 0.78rem;
  /* Long enough to wrap awkwardly on a phone; break inside the URL instead
     of letting it push the panel wider than the screen. */
  overflow-wrap: anywhere;
}

.league-id-hint-num {
  color: var(--pl-green);
  font-weight: 800;
}


/* Predicted BPS shown next to each player in the expected-bonus lineups. The
   number is the model's output; the badge beside it is only the top-three
   outcome derived from it. Tabular figures so the column stays aligned. */
.ai-xbps-value {
  min-width: 34px;
  text-align: right;
  margin-left: auto;
  padding-right: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* ─── Logos link home ───────────────────────────────────────────────────
   Both brand marks are anchors so the browser's own link behaviour works
   (keyboard focus, middle-click, open in new tab). They must not pick up
   link colouring or underlines, and the default focus ring already comes
   from the global :focus-visible rule, so nothing is removed here. */
.logo,
.tactical-nav-brand {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.logo:hover .logo-text,
.tactical-nav-brand:hover strong {
  /* A small, quiet acknowledgement that it is clickable at all — the mark
     itself stays put, since it sits in fixed chrome. */
  opacity: 0.85;
}

@media (prefers-reduced-motion: no-preference) {
  .logo,
  .tactical-nav-brand {
    transition: opacity 0.16s ease;
  }
}

/* The research path, shown as a quiet footnote on the answer rather than as
   separate messages interrupting the conversation ahead of it. */
.research-trail {
  display: block;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.85;
}
