/*
  FPL Quant - Design Tokens & Styles
  Theme: Dark Navy, Blue and Purple base
  All colours are CSS custom properties defined in :root and body.light.
*/

:root {
  --bg: #080B14;
  --bg-wash-1: rgba(52, 120, 255, 0.18);
  --bg-wash-2: rgba(139, 92, 246, 0.20);
  --surface: #0D1020;
  --surface-2: #111827;
  --surface-3: #1A2034;
  --border: #242B40;
  --border-strong: #333C57;
  --text: #F8FAFC;
  --text-2: #94A3B8;
  --text-3: #64748B;

  --good: #10B981;
  --good-bg: rgba(16, 185, 129, 0.14);
  --warn: #F59E0B;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --bad: #EF4444;
  --bad-bg: rgba(239, 68, 68, 0.14);
  --info: #3478FF;
  --info-bg: rgba(52, 120, 255, 0.14);
  --alt: #8B5CF6;
  --alt-bg: rgba(139, 92, 246, 0.14);

  --pitch: #080E1C;
  --pitch-stripe: rgba(52, 120, 255, 0.025);
  --pitch-line: rgba(52, 120, 255, 0.15);
  --card: #0D1224;
  --card-hover: #141C36;

  --fdr-1: #00D47E;
  --fdr-2: #76D13F;
  --fdr-3: #FFC83D;
  --fdr-4: #FF7A3D;
  --fdr-5: #FF3D57;
  --fdr-text: #07090B;

  --glass-surface: rgba(13, 16, 32, 0.48);
  --glass-bg: rgba(13, 16, 32, 0.48);
  --glass-border: rgba(52, 120, 255, 0.16);
  --glass-blur: blur(20px) saturate(160%);
  --glass-side: rgba(10, 13, 26, 0.70);
  --side-bg: rgba(10, 13, 26, 0.70);
  --card-glass: rgba(8, 12, 24, 0.68);
  --pitch-bg-img: url('assets/pitch.jpg');
  --glass-pitch: rgba(8, 14, 28, 0.85);
  --glass-inner: #111827;
  --th-bg: #0D1020;
  --overlay-bg: rgba(4, 6, 14, 0.80);
  --scrollbar-thumb: rgba(148, 163, 184, 0.22);
  --scrollbar-thumb-hover: rgba(148, 163, 184, 0.45);

  --radius: 10px;
  --radius-glass: 14px;
  --sans: 'Barlow', system-ui, -apple-system, sans-serif;
  --cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;

  --tab-active: #FFFFFF;
  --btn-primary-start: #3478FF;
  --btn-primary-end: #2563EB;
  --btn-primary-text: #FFFFFF;
  --slider-thumb-bg: #FFFFFF;
  --dot-active-bg: #FFFFFF;
  --xp-cyan: #38BDF8;
  --arm-bg: #FFFFFF;
  --arm-text: #080B14;
  --badge-text: #FFFFFF;
  --info-hover: #60A5FA;
}

body.light {
  --bg: #F1F5F9;
  --bg-wash-1: rgba(52, 120, 255, 0.08);
  --bg-wash-2: rgba(139, 92, 246, 0.08);
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --surface-3: #E2E8F0;
  --border: #CBD5E1;
  --border-strong: #94A3B8;
  --text: #000000;
  --text-2: #000000;
  --text-3: #000000;

  --good: #059669;
  --good-bg: rgba(5, 150, 105, 0.10);
  --warn: #D97706;
  --warn-bg: rgba(217, 119, 6, 0.10);
  --bad: #DC2626;
  --bad-bg: rgba(220, 38, 38, 0.10);
  --info: #2563EB;
  --info-bg: rgba(37, 99, 235, 0.10);
  --alt: #7C3AED;
  --alt-bg: rgba(124, 58, 237, 0.10);

  --pitch: #E2E8F0;
  --pitch-stripe: rgba(0, 0, 0, 0.02);
  --pitch-line: rgba(37, 99, 235, 0.15);
  --card: #FFFFFF;
  --card-hover: #F8FAFC;

  --fdr-1: #A8ECC9;
  --fdr-2: #CFE9A8;
  --fdr-3: #FFE3A3;
  --fdr-4: #FFCDAC;
  --fdr-5: #FFB3BD;
  --fdr-text: #000000;

  --glass-surface: rgba(255, 255, 255, 0.65);
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(37, 99, 235, 0.15);
  --glass-blur: blur(20px) saturate(160%);
  --glass-side: rgba(248, 250, 252, 0.80);
  --side-bg: rgba(248, 250, 252, 0.80);
  --card-glass: rgba(255, 255, 255, 0.88);
  --pitch-bg-img: url('assets/pitch-light.jpg');
  --glass-pitch: rgba(226, 232, 240, 0.70);
  --glass-inner: #F1F5F9;
  --th-bg: #F8FAFC;
  --overlay-bg: rgba(15, 23, 42, 0.50);
  --scrollbar-thumb: rgba(100, 116, 139, 0.25);
  --scrollbar-thumb-hover: rgba(100, 116, 139, 0.45);

  --tab-active: #2563EB;
  --btn-primary-start: #2563EB;
  --btn-primary-end: #1D4ED8;
  --btn-primary-text: #FFFFFF;
  --slider-thumb-bg: #FFFFFF;
  --dot-active-bg: #FFFFFF;
  --xp-cyan: #2563EB;
  --arm-bg: #000000;
  --arm-text: #FFFFFF;
  --badge-text: #FFFFFF;
  --info-hover: #1D4ED8;
}

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

/* ---- universal sleek blending scrollbars ---- */
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
*:hover {
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background-color: transparent;
}
::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: transparent;
  border: none;
}
::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-button,
*::-webkit-scrollbar-button {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background-color: transparent;
  border-radius: 99px;
  transition: background-color 0.18s ease;
}

html:hover::-webkit-scrollbar-thumb,
body:hover::-webkit-scrollbar-thumb,
*:hover::-webkit-scrollbar-thumb,
.scroll:hover::-webkit-scrollbar-thumb,
.modal:hover::-webkit-scrollbar-thumb,
.rep-list:hover::-webkit-scrollbar-thumb,
.squad-fx-wrap:hover::-webkit-scrollbar-thumb,
.tablewrap:hover::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
}

::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active,
*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb-hover) !important;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 15% 0%, var(--bg-wash-1), transparent 65%),
    radial-gradient(1000px 700px at 85% 15%, var(--bg-wash-2), transparent 65%),
    radial-gradient(900px 600px at 50% 90%, var(--bg-wash-1), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .18s, color .18s;
  overflow-x: hidden;
}

::selection { background: var(--info-bg); }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.num { font-variant-numeric: tabular-nums; }

/* ---- shell ---- */
.shell { display: flex; min-height: 100vh; position: relative; }

/* ---- sidebar (frosted glass) ---- */
.side {
  width: 270px;
  flex: 0 0 270px;
  padding: 18px 16px 28px;
  border-right: 1px solid var(--glass-border);
  background: var(--side-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 20;
  transition: margin-left .28s cubic-bezier(0.16, 1, 0.3, 1), transform .28s cubic-bezier(0.16, 1, 0.3, 1), opacity .2s ease;
}
.side::-webkit-scrollbar { display: none; }

.shell.side-collapsed .side {
  margin-left: -270px;
  opacity: 0;
  pointer-events: none;
}

/* ---- desktop sidebar expand floating button ---- */
.side-expand-btn {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 28;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  padding: 8px 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  align-items: center;
  gap: 8px;
  transition: all .16s ease;
}
.side-expand-btn:hover {
  border-color: var(--info);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52, 120, 255, 0.25);
}
.side-expand-btn svg {
  color: var(--info);
}
.shell.side-collapsed .side-expand-btn {
  display: inline-flex;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 18px 24px 36px;
  position: relative;
  z-index: 1;
}

/* ---- Premier League Crest removed from background ---- */

/* ---- brand ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-text {
  flex: 1;
  min-width: 0;
}
.side-collapse-btn {
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all .14s ease;
  font-family: var(--sans);
}
.side-collapse-btn:hover {
  border-color: var(--info);
  color: var(--text);
  background: var(--surface-3);
}
.side-collapse-btn svg {
  color: var(--text-2);
  transition: transform .14s;
}
.side-collapse-btn:hover svg {
  color: var(--info);
  transform: scale(1.1);
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(52, 120, 255, 0.18), rgba(139, 92, 246, 0.22));
  border: 1px solid rgba(52, 120, 255, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(52, 120, 255, 0.22);
  flex-shrink: 0;
  overflow: hidden;
}
.brand-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 0 5px rgba(52, 120, 255, 0.45));
}
.brand h1 {
  font-family: var(--cond);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.brand-xi {
  background: linear-gradient(135deg, var(--info) 0%, var(--alt) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.brand p {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 1px;
}

/* ---- sidebar navigation ---- */
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.side-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .14s ease;
  width: 100%;
  text-align: left;
}
.side-tab svg {
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity .14s;
}
.side-tab:hover {
  background: var(--surface-2);
  color: var(--text);
}
.side-tab:hover svg {
  opacity: 1;
}
.side-tab.on {
  background: linear-gradient(90deg, rgba(52, 120, 255, 0.25) 0%, rgba(52, 120, 255, 0.06) 100%);
  color: var(--tab-active);
  font-weight: 600;
  border-left: 3px solid var(--info);
  box-shadow: 0 2px 10px rgba(52, 120, 255, 0.20);
}
.side-tab.on svg {
  color: var(--info);
  opacity: 1;
}

/* ---- status ---- */
.status { display: grid; gap: 5px; margin-bottom: 16px; }
.status-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.dot.ok { background: var(--good); }
.dot.busy { background: var(--warn); animation: pulse 1.1s ease-in-out infinite; }
.dot.err { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---- sidebar groups & controls ---- */
.group { margin-bottom: 15px; }
.group-h {
  font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--text-3);
  letter-spacing: 0.05em; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between;
}
.hint {
  width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: none; color: var(--text-3); font-size: 10px; cursor: pointer; line-height: 1;
  display: grid; place-items: center; transition: all .12s;
}
.hint:hover { color: var(--text); border-color: var(--info); }

.field { margin-bottom: 10px; }
.field-top {
  display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; color: var(--text-2);
}
.field-top span:last-child {
  color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600;
}

input[type=range] {
  width: 100%; height: 4px; appearance: none;
  background: var(--surface-3); border-radius: 99px; outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--slider-thumb-bg); border: 2px solid var(--info);
  cursor: pointer; box-shadow: 0 0 8px rgba(52, 120, 255, 0.5);
  transition: transform .12s, box-shadow .12s;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(52, 120, 255, 0.8);
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--slider-thumb-bg); border: 2px solid var(--info);
  cursor: pointer; box-shadow: 0 0 8px rgba(52, 120, 255, 0.5);
}

.opt { display: flex; flex-direction: column; gap: 6px; }
.opt label {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: all .15s;
}
.opt label:hover {
  border-color: var(--border-strong);
}
.opt label.on {
  background: rgba(52, 120, 255, 0.12);
  border-color: var(--info);
  box-shadow: 0 0 10px rgba(52, 120, 255, 0.20);
}
.opt-dot {
  width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--text-3);
  margin-top: 2px; flex-shrink: 0; display: grid; place-items: center; transition: all .15s;
}
.opt label.on .opt-dot {
  border-color: var(--info);
  background: var(--info);
  box-shadow: 0 0 8px rgba(52, 120, 255, 0.6);
}
.opt label.on .opt-dot::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--dot-active-bg);
}
.opt-t { font-size: 12.5px; font-weight: 600; color: var(--text); }
.opt-s { font-size: 11px; font-weight: 400; color: var(--text-2); display: block; margin-top: 1px; }

.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 12px; color: var(--text-2);
}
.sw { position: relative; width: 34px; height: 19px; flex: 0 0 auto; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; background: var(--surface-3); border-radius: 19px; transition: .15s; }
.sw i::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: .15s; }
.sw input:checked + i { background: var(--info-bg); }
.sw input:checked + i::after { transform: translateX(15px); background: var(--info); }

button.primary {
  width: 100%; padding: 11px 16px; border-radius: 99px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--btn-primary-start) 0%, var(--btn-primary-end) 100%);
  color: var(--btn-primary-text); font-family: var(--cond); font-size: 15px; font-weight: 700;
  letter-spacing: 0.02em; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(52, 120, 255, 0.35); transition: all .15s ease;
}
button.primary:hover:not(:disabled) {
  filter: brightness(1.12);
  box-shadow: 0 6px 18px rgba(52, 120, 255, 0.50);
  transform: translateY(-1px);
}
button.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.text-in {
  width: 100%; padding: 8px 12px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text); font-family: var(--sans); font-size: 12.5px;
  outline: none; transition: border-color .15s;
}
.text-in:focus {
  border-color: var(--info); box-shadow: 0 0 8px rgba(52, 120, 255, 0.25);
}
button.ghost {
  padding: 8px 12px; border-radius: 8px; background: transparent; cursor: pointer;
  border: 1px solid var(--border-strong); color: var(--text); font-family: var(--sans); font-size: 12px;
  font-weight: 500; transition: all .15s;
}
button.ghost:hover {
  background: var(--surface-2); border-color: var(--info);
}

/* ---- header & gameweek ---- */
.top {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 16px; flex-wrap: wrap; position: relative; z-index: 2;
}
.gw-row {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3cm, 114px);
}
.gw-block { flex: 1; min-width: 180px; }
.gw-header-row {
  display: flex; align-items: center; gap: 10px;
}
.gw-block h2 {
  font-family: var(--cond); font-size: 28px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--text); line-height: 1.1;
}
.gw-block p { font-size: 12px; color: var(--text-2); margin-top: 3px; }

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  padding: 0;
  color: #F59E0B;
}
.theme-toggle-btn:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: var(--info);
  box-shadow: 0 6px 16px rgba(52, 120, 255, 0.35);
}
.theme-toggle-btn .sun-icon { display: block; }
.theme-toggle-btn .moon-icon { display: none; }

body.light .theme-toggle-btn {
  background: var(--card);
  border-color: var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  color: #4F46E5;
}
body.light .theme-toggle-btn:hover {
  border-color: var(--info);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}
body.light .theme-toggle-btn .sun-icon { display: none; }
body.light .theme-toggle-btn .moon-icon { display: block; }

/* ---- metrics cards (frosted glass) ---- */
.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
  z-index: 2;
}
@media (max-width: 1280px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.metric {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 86px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.metric:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 120, 255, 0.20);
}
.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.metric .l {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metric .m-icon {
  color: var(--info);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--info-bg);
  border: 1px solid rgba(52, 120, 255, 0.22);
  flex-shrink: 0;
  opacity: 0.95;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.metric:hover .m-icon {
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(52, 120, 255, 0.35);
}
.metric .m-icon svg {
  width: 22px;
  height: 22px;
}
.metric .v {
  font-family: var(--cond);
  font-size: 25px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.metric .s {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ---- navigation tabs ---- */
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px; flex-wrap: wrap; position: relative; z-index: 2;
}
.tab {
  padding: 8px 14px; background: transparent; border: none; cursor: pointer;
  color: var(--text-2); font-family: var(--cond); font-size: 14.5px; font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .14s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--tab-active); border-bottom-color: var(--info); }

.pane { display: none; }
.pane.on { display: block; }

/* ---- squad layout (pitch on left, upcoming fixtures on right) ---- */
.squad-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.squad-tri {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(480px, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 1180px) {
  .squad-split,
  .squad-tri {
    grid-template-columns: 1fr;
  }
}

.squad-col-pitch {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.squad-col-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ---- pitch (image-backed glowing tactical pitch) ---- */
.pitch {
  background-color: var(--pitch);
  border-radius: var(--radius-glass);
  border: 1px solid var(--glass-border);
  padding: 24px 14px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 16px;
  min-height: 560px;
  position: relative;
  overflow: hidden;
  background-image: var(--pitch-bg-img);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 0 80px rgba(0, 0, 0, 0.55);
}
.pitch::before,
.pitch::after {
  display: none;
}

body.light .pitch {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15), inset 0 0 40px rgba(0, 0, 0, 0.15);
}

.prow {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

/* ---- player cards on pitch ---- */
.pc {
  width: 88px;
  padding: 6px 4px 0 4px;
  text-align: center;
  background: var(--card-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(52, 120, 255, 0.24);
  border-radius: 10px;
  position: relative;
  z-index: 1;
  cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.40);
  display: flex;
  flex-direction: column;
  align-items: center;
}
body.light .pc {
  background: var(--card-glass);
  border-color: rgba(37, 99, 235, 0.20);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
body.light .panel h4,
body.light .squad-bottom-grid .panel h4,
body.light .group-h,
body.light .rot-subhead {
  font-weight: 700;
}
body.light .bench-row {
  opacity: 1;
}
body.light .side-tab svg {
  opacity: 1;
}
.pc:hover {
  border-color: var(--info);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(52, 120, 255, 0.35);
}
.pc.dim { opacity: 0.65; }

.pc svg {
  display: block;
  margin: 0 auto;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}
body.light .pc svg {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}

.pc .nm {
  font-family: var(--cond);
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  width: 100%;
}
.pc .mt {
  font-size: 10px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-top: 1px;
  margin-bottom: 4px;
  width: 100%;
}
.pc .xp {
  width: calc(100% + 8px);
  margin-left: -4px;
  margin-right: -4px;
  background: rgba(52, 120, 255, 0.18);
  color: var(--xp-cyan);
  font-family: var(--cond);
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.2;
  padding: 2px 0;
  border-radius: 0 0 8px 8px;
  border-top: 1px solid rgba(52, 120, 255, 0.25);
}
body.light .pc .xp {
  background: rgba(37, 99, 235, 0.12);
  color: var(--xp-cyan);
  border-top-color: rgba(37, 99, 235, 0.20);
}

.pc .conf {
  position: absolute;
  bottom: 0;
  left: 2px;
  right: 2px;
  height: 2px;
  background: var(--surface-3);
  border-radius: 1px;
  overflow: hidden;
}
.pc .conf i {
  display: block;
  height: 2px;
  border-radius: 1px;
}

.arm {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--arm-bg);
  color: var(--arm-text);
  font-family: var(--cond);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 3;
}
.flag {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  color: var(--bad);
  z-index: 3;
}

/* ---- bench ---- */
.bench-h {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 8px 2px;
}
.bench {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bench-order {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--cond);
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  z-index: 3;
}
.bench-pos {
  position: absolute;
  top: 3px;
  right: 4px;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.04em;
  line-height: 1;
  z-index: 3;
}

/* Sub metrics placed under pitch & bench on mobile, hidden on desktop */
.squad-sub-metrics {
  display: none;
}

/* ---- drag and drop between pitch & bench ---- */
.pc[draggable="true"] {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.pc[draggable="true"]:active {
  cursor: grabbing;
}
.pc.dragging {
  opacity: 0.35;
  cursor: grabbing;
}
.pc.drop-valid {
  border-radius: 8px;
  box-shadow: 0 0 0 1.5px var(--good);
  background: var(--good-bg);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.pc.drop-invalid {
  opacity: 0.22;
  filter: grayscale(80%);
  cursor: not-allowed;
}
.pc.drop-hover {
  box-shadow: 0 0 0 2.5px var(--good), 0 4px 14px var(--good-bg);
  background: var(--good-bg);
  transform: translateY(-2px) scale(1.05);
}

/* ---- manual XI indicator bar ---- */
.manual-xi-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
}
.manual-xi-text {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
}
.manual-xi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
}
.manual-xi-reset {
  background: none;
  border: none;
  color: var(--good);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  padding: 2px 4px;
}
.manual-xi-reset:hover {
  filter: brightness(1.2);
}

/* ---- upcoming fixtures table on right side of pitch (frosted glass) ---- */
.squad-fx-wrap {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-glass);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
}
.squad-fx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.squad-fx-header h3 {
  font-family: var(--cond);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.view-all-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--info);
  text-decoration: none;
  transition: color .12s;
}
.view-all-link:hover {
  text-decoration: underline;
  color: var(--info-hover);
}
.squad-fx-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  max-height: 520px;
}
.squad-fx-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.squad-fx-tbl th {
  text-align: center;
  padding: 7px 4px;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--th-bg);
  z-index: 2;
}
.squad-fx-tbl th:first-child { text-align: left; }
.squad-fx-tbl th:nth-child(2) { text-align: center; }
.squad-fx-tbl td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}
.squad-fx-tbl tr:hover {
  background: var(--surface-2);
}
.squad-fx-name {
  text-align: left !important;
  font-family: var(--cond);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}
.squad-fx-xp {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13px;
  color: var(--good);
  text-align: center;
}
.bench-sep td {
  padding: 10px 4px 6px !important;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: left !important;
}
.bench-sep-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bench-row {
  opacity: 0.70;
}
.bench-row:hover {
  opacity: 1;
}
.squad-fx-tbl .fix {
  display: inline-block;
  border-radius: 4px;
  padding: 4px 6px;
  min-width: 48px;
  text-align: center;
  color: var(--fdr-text);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}
.squad-fx-tbl .fix.blank {
  background: var(--surface-3);
  color: var(--text-3);
}
.squad-fx-tbl .fix-split {
  display: flex;
  gap: 2px;
  justify-content: center;
}
.squad-fx-tbl .fix-split .fix {
  min-width: 24px;
  padding: 3px 2px;
}

/* ---- squad bottom 4 panels grid ---- */
.squad-bottom-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-top: 14px;
}
@media (max-width: 1280px) {
  .squad-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .squad-bottom-grid {
    grid-template-columns: 1fr;
  }
}
.squad-bottom-grid .panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-glass);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: transform .14s ease, border-color .14s ease;
}
.squad-bottom-grid .panel:hover {
  border-color: var(--border-strong);
}
.squad-bottom-grid .panel h3 {
  font-family: var(--cond);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.squad-bottom-grid .panel h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin: 12px 0 6px;
}

/* ---- generic panel & layout (frosted glass) ---- */
.panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-glass);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}
.panel h3 {
  font-family: var(--cond);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.panel h4 {
  font-size: 11px;
  color: var(--text-3);
  margin: 12px 0 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.panel h4:first-child { margin-top: 0; }

.kv {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; font-size: 12.5px; border-bottom: 1px solid var(--border);
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-2); }
.kv .v { font-variant-numeric: tabular-nums; font-weight: 600; }

.bar-row { margin-bottom: 8px; }
.bar-top {
  display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 3px; color: var(--text-2);
}
.bar-top .num { font-weight: 600; color: var(--text); }
.bar {
  height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden;
}
.bar i {
  display: block; height: 5px; border-radius: 99px;
  background: linear-gradient(90deg, var(--info) 0%, var(--alt) 100%);
}

.pill {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  font-size: 10.5px; line-height: 1.5; font-weight: 600;
}
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }

.note { font-size: 11.5px; color: var(--text-3); line-height: 1.55; }

/* ---- Squad Risk Timeline ---- */
.risk-chart-wrap {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.risk-chart-subtitle {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.risk-gw-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.risk-gw-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 6px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .15s ease;
}
.risk-gw-card:hover {
  border-color: var(--info);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.risk-gw-title {
  font-family: var(--cond);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.risk-bar-track {
  width: 22px;
  height: 54px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  margin-bottom: 6px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}
.risk-bar-track::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
  opacity: 0.6;
  pointer-events: none;
}
.risk-bar-fill {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: height .3s ease;
  position: relative;
  z-index: 1;
}
.risk-gw-pct {
  font-family: var(--cond);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 4px;
}
.risk-gw-pct.low { color: var(--good); }
.risk-gw-pct.med { color: var(--warn); }
.risk-gw-pct.high { color: var(--bad); }

.risk-gw-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.risk-gw-badge.low { background: var(--good-bg); color: var(--good); }
.risk-gw-badge.med { background: var(--warn-bg); color: var(--warn); }
.risk-gw-badge.high { background: var(--bad-bg); color: var(--bad); }

.risk-summary-note {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.4;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--info-bg);
  border-left: 2px solid var(--info);
}

.risk-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--text-3);
  flex-wrap: wrap;
  gap: 6px;
}
.leg-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.leg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.leg-dot.low { background: var(--good); }
.leg-dot.med { background: var(--warn); }
.leg-dot.high { background: var(--bad); }

/* ---- tables & tableswrap (frosted glass) ---- */
.tablewrap {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-glass);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.table-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.table-head h3 { font-family: var(--cond); font-size: 17px; font-weight: 600; color: var(--text); }
.scroll { overflow-x: auto; max-height: 62vh; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; padding: 8px 10px; font-weight: 600; font-size: 11px; color: var(--text-3);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--th-bg);
  cursor: pointer; white-space: nowrap; z-index: 2;
}
th:hover { color: var(--text-2); }
.sp-th {
  user-select: none;
  -webkit-user-select: none;
  transition: color .12s, background .12s;
}
.sp-th:hover {
  color: var(--text);
}
.sp-th.active {
  color: var(--good);
  font-weight: 600;
}
.sp-th .sort-arr {
  font-size: 10px;
  margin-left: 2px;
  color: var(--good);
  display: inline-block;
  vertical-align: middle;
}
td { padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.owned { background: var(--good-bg); }
tbody tr.owned:hover { background: var(--good-bg); filter: brightness(1.20); }
td.name { font-family: var(--cond); font-size: 14px; font-weight: 600; letter-spacing: .01em; color: var(--text); }
.pos-tag { font-size: 10px; color: var(--text-3); font-weight: 600; }

/* ---- fixture ticker tab (10 gameweeks layout) ---- */
.ticker {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2.5px;
  font-size: 11px;
  min-width: 660px;
}
.ticker th {
  background: transparent;
  border: none;
  text-align: center;
  padding: 4px 2px;
  position: static;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
}
.ticker th.team-col {
  text-align: left;
  width: 76px;
  min-width: 76px;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 3;
}

/* Sub metrics placed under pitch & bench on mobile, hidden on desktop */
.squad-sub-metrics {
  display: none;
}
.ticker td {
  padding: 0;
  border: none;
}
.ticker td.team-col {
  font-family: var(--cond);
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px 0 2px;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
}
.fix {
  display: block;
  border-radius: 4px;
  padding: 5px 2px;
  text-align: center;
  color: var(--fdr-text);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 700;
  min-width: 44px;
}
.fix.blank { background: var(--surface-3); color: var(--text-3); }
.fix-split { display: flex; gap: 2px; }
.fix-split .fix { flex: 1; min-width: 22px; padding: 5px 1px; font-size: 9px; }

/* ---- method tab (modern full-width grid) ---- */
.method-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.method-hero {
  padding: 20px 24px;
}
.method-hero h2 {
  font-family: var(--cond);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 4px 0 8px;
}
.method-hero p {
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}
.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}
@media (max-width: 960px) {
  .method-grid {
    grid-template-columns: 1fr;
  }
}
.method-card {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.method-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.method-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.method-badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--border);
}
.method-badge.good {
  background: var(--good-bg);
  color: var(--good);
  border-color: var(--border);
}
.method-card h3 {
  font-family: var(--cond);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.method-card p {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 12px;
}
.method-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.method-card li {
  line-height: 1.6;
}
.method-card li strong {
  color: var(--text);
}
.method-card.method-full {
  grid-column: 1 / -1;
}
.method-limits-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 6px;
}
@media (max-width: 800px) {
  .method-limits-grid {
    grid-template-columns: 1fr;
  }
}
.limit-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.limit-item strong {
  color: var(--text);
}
.limit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--info);
  margin-top: 6px;
  flex-shrink: 0;
}
.callout { background: var(--warn-bg); border: 1px solid var(--warn); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.callout p { color: var(--text); margin: 0; font-size: 13px; }

/* ---- overlays & modals ---- */
.overlay {
  position: fixed; inset: 0; background: var(--overlay-bg);
  display: none; place-items: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(8px);
}
.overlay.on { display: grid; }
.modal {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-glass);
  max-width: 880px; width: 100%; max-height: 88vh; overflow-y: auto; padding: 20px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}
.modal-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 10px; }
.modal h3 { font-family: var(--cond); font-size: 21px; font-weight: 600; color: var(--text); }
.x { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; }
.x:hover { color: var(--text); }

.modal-split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 780px) { .modal-split { grid-template-columns: 1fr; } }

.rep-panel {
  display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}
.rep-panel h3 { font-family: var(--cond); font-size: 17px; font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }

.rep-filter-btns { display: flex; gap: 6px; margin-bottom: 12px; }
.rep-btn {
  flex: 1; padding: 7px 4px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-family: var(--sans);
  font-size: 11px; font-weight: 600; cursor: pointer; text-align: center; transition: all .15s;
}
.rep-btn:hover { border-color: var(--border-strong); color: var(--text); }
.rep-btn.active { background: var(--info); color: var(--badge-text); border-color: var(--info); }

.rep-list { display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow-y: auto; padding-right: 2px; }
.rep-item {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 12px;
  border-radius: 8px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: all .12s;
}
.rep-item:hover { background: var(--surface-3); border-color: var(--border-strong); }
.rep-item.over { border: 1px solid var(--bad); background: var(--bad-bg); }
.rep-item.blocked { opacity: 0.45; cursor: not-allowed; border-color: var(--border); background: var(--surface); }

.rep-info { display: flex; flex-direction: column; }
.rep-name { font-family: var(--cond); font-size: 14.5px; font-weight: 600; color: var(--text); }
.rep-sub { font-size: 11.5px; color: var(--text-2); }
.rep-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.rep-xp { font-family: var(--cond); font-size: 14px; font-weight: 600; color: var(--good); }
.rep-tag { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-top: 2px; }
.rep-tag.over { background: var(--bad); color: var(--badge-text); }
.rep-tag.blocked { background: var(--surface-3); color: var(--text-3); }

/* ---- pitch card over-budget state ---- */
.pc.over-budget { border: 2px solid var(--bad) !important; background: var(--bad-bg) !important; }
.pc .over-badge {
  position: absolute; bottom: 3px; left: 4px; right: 4px;
  background: var(--bad); color: var(--badge-text); font-size: 9.5px; font-weight: 700;
  padding: 1px 3px; border-radius: 4px; text-align: center; line-height: 1.2; z-index: 5;
}

/* ---- banner error & fix suggestions ---- */
.banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-size: 13px; display: none; }
.banner.on { display: block; }
.banner.err { background: var(--bad-bg); border: 1px solid var(--bad); color: var(--text); }
.banner.info { background: var(--info-bg); border: 1px solid var(--info); color: var(--text); }
.banner-fix-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.banner-fix-item {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px;
}

.loading {
  position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center;
  z-index: 100; gap: 12px; text-align: center;
}
.loading.gone { display: none; }
.spin {
  width: 32px; height: 32px; border: 3px solid var(--surface-3);
  border-top-color: var(--info); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-wrap { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 200; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 10px 14px; font-size: 12.5px; max-width: 320px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* ---- Gameweek tab analysis styles ---- */
.gw-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 1200px) {
  .gw-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .gw-hero-grid { grid-template-columns: 1fr; }
}

.gw-hero-card {
  min-height: 96px;
}

.gw-notice-bar {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gw-section {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-glass);
  padding: 18px 20px;
}

.match-pred-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.match-cell {
  white-space: nowrap;
}
.match-teams {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.match-teams .team-code {
  font-family: var(--cond);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  color: var(--text);
}
.match-teams .venue-tag {
  font-size: 11.5px;
  color: var(--text-2);
  font-weight: 500;
}
.match-teams .vs-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  margin: 0 2px;
}

.match-prob-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 170px;
}
.match-bar-track {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-3);
}
.match-bar-track .mb-h {
  background: var(--info);
  transition: width .2s ease;
}
.match-bar-track .mb-d {
  background: var(--text-3);
  transition: width .2s ease;
}
.match-bar-track .mb-a {
  background: var(--alt);
  transition: width .2s ease;
}

.match-prob-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.prob-tag.h { color: var(--info); }
.prob-tag.d { color: var(--text-2); }
.prob-tag.a { color: var(--alt); }

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--cond);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.score-pill small {
  font-size: 10.5px;
  color: var(--text-2);
  font-family: var(--sans);
  font-weight: 500;
}



.inj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.club-grp-header {
  background: var(--surface-2);
}
.club-grp-header td {
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.club-grp-inner {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.club-grp-title {
  font-family: var(--cond);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}
.club-grp-meta {
  font-size: 10.5px;
  color: var(--text-2);
  font-weight: 500;
}
.inj-news-cell {
  font-size: 11.5px;
  color: var(--text-2);
  max-width: 340px;
  line-height: 1.35;
}

.rotation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
@media (max-width: 900px) {
  .rotation-grid {
    grid-template-columns: 1fr;
  }
}
.rotation-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.rot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.rot-card-title {
  font-family: var(--cond);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rot-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rot-subhead {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.rot-card-body {
  width: 100%;
  overflow-x: auto;
}
.rot-table {
  width: 100%;
  font-size: 12.5px;
  border-collapse: collapse;
}
.rot-table th {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  white-space: nowrap;
}
.rot-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}
.rot-table tr:last-child td {
  border-bottom: none;
}
.rot-table td.name {
  font-weight: 600;
  color: var(--text);
  text-align: left;
}
.rot-table td.pos-cell {
  text-align: center;
  color: var(--text-2);
  font-size: 11.5px;
}
.rot-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.rot-table td.assessment-cell {
  text-align: right;
}
.rot-table .pill {
  font-size: 11px;
  padding: 3px 8px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

/* ---- mobile header bar ---- */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 35;
  margin: -12px -14px 14px -14px;
}
.mobile-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-brand-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.mobile-brand-title {
  font-family: var(--cond);
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.mobile-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 9px;
  padding: 7px 11px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  transition: all .14s ease;
  touch-action: manipulation;
}
.mobile-btn:hover, .mobile-btn:active {
  border-color: var(--info);
  background: var(--surface-3);
  transform: translateY(-1px);
}
.mobile-hamburger {
  padding: 7px 9px;
  color: var(--text);
}
.mobile-hamburger svg {
  display: block;
}
.mobile-controls-btn svg {
  color: var(--info);
}

/* ---- FPL App Style Fixed Bottom Navigation Bar ---- */
.bottom-nav {
  display: none; /* Hidden on desktop (> 960px) */
}

/* ---- "More" Page (FPL App Style) ---- */
.more-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 6px 4px 36px;
}
.more-title-block {
  margin-bottom: 22px;
}
.more-title-block h2 {
  font-family: var(--cond);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 4px;
}
.more-desc {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.4;
}
.more-section {
  margin-bottom: 24px;
}
.more-section-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 8px;
  padding-left: 4px;
}
.more-card-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
}
.more-nav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: var(--sans);
  touch-action: manipulation;
}
.more-nav-card:last-child {
  border-bottom: none;
}
.more-nav-card:hover {
  background: var(--surface-2);
}
.more-nav-card:active {
  background: var(--surface-3);
  transform: scale(0.99);
}
.more-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38BDF8;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.more-nav-card:hover .more-card-icon {
  background: #38BDF8;
  color: #0F172A;
  border-color: #38BDF8;
}
.more-card-body {
  flex: 1;
  min-width: 0;
}
.more-card-title {
  display: block;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.more-card-sub {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-top: 3px;
  line-height: 1.35;
}
.more-card-arrow {
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}
.more-nav-card:hover .more-card-arrow {
  color: var(--text);
  transform: translateX(3px);
}
.more-action-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.more-nav-card:hover .more-action-pill {
  border-color: #38BDF8;
  color: #38BDF8;
}
.more-about-box {
  margin-top: 26px;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.more-about-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.more-about-title {
  font-family: var(--cond);
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}
.more-about-sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 3px;
}

/* ---- side backdrop overlay on mobile ---- */
.side-backdrop {
  display: none;
}

/* ---- responsive breakpoints ---- */
@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .mobile-header { display: flex; }
  .side-expand-btn { display: none !important; }
  .tabs { display: none !important; }

  /* Fixed Bottom Navigation Bar */
  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(14, 18, 30, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
  }
  .bnav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-2);
    cursor: pointer;
    padding: 6px 2px 4px;
    gap: 3px;
    transition: all 0.15s ease;
    touch-action: manipulation;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .bnav-btn:hover {
    color: var(--text);
  }
  .bnav-btn:active {
    transform: scale(0.95);
  }
  .bnav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.15s ease, color 0.15s ease;
  }
  .bnav-icon svg {
    display: block;
    width: 21px;
    height: 21px;
  }
  .bnav-label {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    transition: color 0.15s ease, font-weight 0.15s ease;
  }
  .bnav-btn.on {
    color: #38BDF8;
  }
  .bnav-btn.on .bnav-label {
    font-weight: 700;
    color: #38BDF8;
  }
  .bnav-btn.on::after {
    content: '';
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 2.5px;
    background: #38BDF8;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 1px 8px rgba(56, 189, 248, 0.6);
  }

  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.55);
    border-right: 1px solid var(--glass-border);
    border-bottom: none;
    transition: transform .26s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .side.open {
    transform: translateX(0);
  }
  .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .side-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    padding: 12px 14px 88px !important;
  }
  .pl-crest-bg { display: none; }
  body.drawer-open {
    overflow: hidden;
  }

  /* Hide top squad metrics from all non-squad tabs on mobile */
  body:not([data-active-tab="squad"]) #metrics,
  body[data-active-tab="gw"] #metrics,
  body[data-active-tab="players"] #metrics,
  body[data-active-tab="fixtures"] #metrics,
  body[data-active-tab="more"] #metrics,
  body[data-active-tab="analysis"] #metrics,
  body[data-active-tab="backtest"] #metrics,
  body[data-active-tab="method"] #metrics {
    display: none !important;
  }

  body[data-active-tab="more"] .top {
    display: none !important;
  }

  /* Squad tab on mobile: 2 cards (Squad Value & Predicted points) at top */
  #metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }
  #metrics .metric {
    padding: 10px 12px !important;
    min-height: 72px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    text-align: left !important;
    gap: 2px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22) !important;
  }
  #metrics .metric-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin: 0 !important;
  }
  #metrics .metric .l {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--text-2) !important;
    line-height: 1.2 !important;
  }
  #metrics .metric .v {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: var(--text) !important;
    line-height: 1.15 !important;
    margin: 1px 0 !important;
  }
  #metrics .metric .s {
    font-size: 11px !important;
    color: var(--text-3) !important;
    line-height: 1.2 !important;
  }
  #metrics .metric .m-icon {
    display: none !important;
  }
  /* Hide the other 4 cards from the top on mobile */
  #metrics .metric:nth-child(n+3) {
    display: none !important;
  }

  /* Remaining 4 datapoints pushed below pitch & bench on mobile */
  .squad-sub-metrics {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 14px 0 16px !important;
  }
  .squad-sub-metric {
    padding: 10px 12px !important;
    min-height: 68px !important;
    border-radius: 12px !important;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  }
  .squad-sub-metric .metric-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .squad-sub-metric .l {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: var(--text-2) !important;
  }
  .squad-sub-metric .v {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: var(--text) !important;
  }
  .squad-sub-metric .s {
    font-size: 10.5px !important;
    color: var(--text-3) !important;
  }
  .squad-sub-metric .m-icon {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .squad-sub-metric .m-icon svg {
    width: 16px !important;
    height: 16px !important;
  }

  /* Gameweek hero cards on mobile: only Deadline and Key Player Flags */
  .gw-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }
  .gw-hero-card.gw-card-fixtures,
  .gw-hero-card.gw-card-turnaround {
    display: none !important;
  }
  .gw-hero-card {
    padding: 10px 12px !important;
    min-height: 68px !important;
    border-radius: 12px !important;
  }
  .gw-hero-card .v {
    font-size: 20px !important;
    font-weight: 800 !important;
  }
  .gw-hero-card .l {
    font-size: 10.5px !important;
  }
  .gw-hero-card .s {
    font-size: 10.5px !important;
  }

  /* League-wide Injury & Availability Board: compact team heading */
  .club-grp-header td {
    padding: 5px 8px !important;
  }
  .club-grp-inner {
    display: inline-flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  .club-grp-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
  }
  .club-grp-meta {
    font-size: 10px !important;
    color: var(--text-2) !important;
  }
  .table-head h3 {
    font-size: 15px !important;
  }

  /* Fixture ticker: eliminate detached floating sticky column glitch on mobile */
  .ticker th.team-col,
  .ticker td.team-col {
    position: static !important;
    box-shadow: none !important;
  }
  .ticker {
    min-width: 620px !important;
  }
}

@media (max-width: 640px) {
  .top {
    margin-bottom: 14px;
  }
  .gw-row {
    gap: 14px;
    align-items: center;
  }
  .gw-block h2 {
    font-size: 22px;
    font-weight: 800;
  }
  .gw-block p {
    font-size: 12.5px;
  }
  .theme-toggle-btn {
    width: 38px;
    height: 38px;
  }

  /* Mobile Pitch & Tactical Cards */
  .pitch {
    padding: 16px 6px 14px;
    min-height: 480px;
    gap: 12px;
  }
  .prow {
    gap: clamp(3px, 1.4vw, 6px);
    justify-content: center;
    flex-wrap: nowrap;
  }
  .pc {
    width: clamp(58px, 17.5vw, 76px);
    padding: 5px 3px 0 3px;
    border-radius: 9px;
  }
  .pc svg {
    width: clamp(26px, 7.5vw, 34px);
    height: clamp(28px, 8.5vw, 36px);
  }
  .pc .nm {
    font-size: clamp(10.5px, 2.8vw, 12.5px);
    font-weight: 700;
    margin-top: 3px;
  }
  .pc .mt {
    font-size: clamp(9px, 2.3vw, 10.5px);
    font-weight: 600;
    margin-top: 1px;
    margin-bottom: 2px;
  }
  .pc .xp {
    font-size: clamp(11.5px, 3.1vw, 13.5px);
    font-weight: 800;
    padding: 2px 0;
    margin-left: -3px;
    margin-right: -3px;
    width: calc(100% + 6px);
  }
  .pc .arm {
    width: 16px;
    height: 16px;
    font-size: 9.5px;
    top: -3px;
    left: -3px;
  }

  /* FPL App Style 4-Column Bench Tray */
  .bench-h {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin: 16px 2px 8px;
    text-transform: uppercase;
    color: var(--text-2);
  }
  .bench {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.40);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 6px;
    box-sizing: border-box;
  }
  .bench .pc {
    width: 100%;
    min-width: 0;
  }

  /* Metrics cards touch grid */
  .metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .metric {
    padding: 12px 14px;
    min-height: 80px;
    border-radius: 12px;
  }
  .metric .v {
    font-size: 24px;
    font-weight: 800;
  }
  .metric .k {
    font-size: 12px;
    font-weight: 700;
  }
  .metric .m-icon {
    width: 32px;
    height: 32px;
  }
  .metric .m-icon svg {
    width: 20px;
    height: 20px;
  }

  /* Tables readable touch layout */
  .squad-fx-tbl th, .squad-fx-tbl td {
    padding: 9px 7px;
    font-size: 13px;
  }
  .squad-fx-name {
    font-size: 13.5px;
    font-weight: 700;
  }
  .squad-fx-xp {
    font-size: 13.5px;
    font-weight: 700;
  }

  /* Bottom panels 1 column */
  .squad-bottom-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Modal touch responsiveness */
  .modal {
    width: 95vw;
    max-height: 90vh;
    padding: 18px 16px;
  }
}

/* Light mode mobile & More components */
body.light .side-collapse-btn {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #000000;
}
body.light .side-collapse-btn:hover {
  background: #E2E8F0;
  color: #000000;
}
body.light .side-expand-btn {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #000000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
body.light .mobile-header {
  background: rgba(255, 255, 255, 0.92);
  border-color: #CBD5E1;
}
body.light .mobile-brand-title {
  color: #000000;
}
body.light .mobile-btn {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #000000;
}
body.light .mobile-btn:hover, body.light .mobile-btn:active {
  background: #F8FAFC;
  border-color: var(--info);
}
body.light .bottom-nav {
  background: rgba(255, 255, 255, 0.97);
  border-top-color: #CBD5E1;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
}
body.light .bnav-btn {
  color: #000000;
}
body.light .bnav-btn:hover {
  color: #2563EB;
}
body.light .bnav-btn.on {
  color: #2563EB;
}
body.light .bnav-btn.on .bnav-label {
  color: #2563EB;
  font-weight: 800;
}
body.light .bnav-btn.on::after {
  background: #2563EB;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.4);
}
body.light .more-title-block h2 {
  color: #000000;
}
body.light .more-desc {
  color: #000000;
}
body.light .more-section-label {
  color: #000000;
}
body.light .more-card-list {
  background: #FFFFFF;
  border-color: #CBD5E1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
body.light .more-nav-card {
  border-bottom-color: #E2E8F0;
  color: #000000;
}
body.light .more-nav-card:hover {
  background: #F8FAFC;
}
body.light .more-nav-card:active {
  background: #F1F5F9;
}
body.light .more-card-icon {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #2563EB;
}
body.light .more-nav-card:hover .more-card-icon {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
}
body.light .more-card-title {
  color: #000000;
}
body.light .more-card-sub {
  color: #000000;
}
body.light .more-card-arrow {
  color: #000000;
}
body.light .more-action-pill {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #000000;
}
body.light .more-about-box {
  background: #F8FAFC;
  border-color: #CBD5E1;
}
body.light .more-about-title {
  color: #000000;
}
body.light .more-about-sub {
  color: #000000;
}
body.light .bench {
  background: #F1F5F9;
  border-color: #CBD5E1;
}
body.light .bench-h {
  color: #000000;
}
body.light .bench-order {
  background: #E2E8F0;
  color: #000000;
}
body.light .bench-pos {
  color: #000000;
}
body.light .squad-sub-metric,
body.light #metrics .metric,
body.light .metric {
  background: #FFFFFF;
  border-color: #CBD5E1;
}
body.light .squad-sub-metric .l,
body.light .squad-sub-metric .v,
body.light .squad-sub-metric .s,
body.light #metrics .metric .l,
body.light #metrics .metric .v,
body.light #metrics .metric .s,
body.light .metric .l,
body.light .metric .v,
body.light .metric .s {
  color: #000000 !important;
}
body.light .club-grp-title,
body.light .club-grp-meta {
  color: #000000 !important;
}
body.light .ticker th.team-col,
body.light .ticker td.team-col {
  background: #FFFFFF;
  color: #000000;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
}
@media (max-width: 960px) {
  body.light .ticker th.team-col,
  body.light .ticker td.team-col {
    box-shadow: none !important;
  }
}
body.light .ticker th {
  color: #000000;
}
