/* ============================================================================
   FOOTDAY.ONLINE V9.0 — Professional Minimalist Football UI/UX
   Inspired by FotMob, Sofascore & Football.com:
   Zero neon glows, crisp carbon surfaces, hairline borders, high-contrast type.
   ============================================================================ */
:root, html[data-theme="dark"] {
  --bg: #0c1017 !important;
  --bg-grad: transparent !important;
  --panel: #141a24 !important;
  --panel2: #1a2230 !important;
  --panel3: #10151e !important;
  --line: rgba(255, 255, 255, 0.08) !important;
  --muted: #8b9bb4 !important;
  --white: #f1f5f9 !important;
  --green: #10b981 !important;
  --red: #ef4444 !important;
  --blue: #3b82f6 !important;
  --amber: #f59e0b !important;
  --header-bg: rgba(12, 16, 23, 0.92) !important;
  --row-hover: #1c2536 !important;
  --row-fin: #141a24 !important;
  --score-bg: #1c2433 !important;
  --logo-text: #f8fafc !important;
}

html[data-theme="light"] {
  --bg: #f3f5f9 !important;
  --bg-grad: transparent !important;
  --panel: #ffffff !important;
  --panel2: #f8fafc !important;
  --panel3: #eef2f6 !important;
  --line: rgba(15, 23, 42, 0.09) !important;
  --muted: #64748b !important;
  --white: #0f172a !important;
  --green: #059669 !important;
  --red: #dc2626 !important;
  --blue: #2563eb !important;
  --amber: #d97706 !important;
  --header-bg: rgba(255, 255, 255, 0.94) !important;
  --row-hover: #f1f5f9 !important;
  --row-fin: #ffffff !important;
  --score-bg: #f1f5f9 !important;
  --logo-text: #0f172a !important;
}

/* Remove old floating bottom-right CONTROL button */
#adminOpenBtn, .admin-fab, .ctrl-fab, [data-admin-fab] { display: none !important; }

body {
  background: var(--bg) !important;
  background-image: none !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  letter-spacing: 0 !important;
}

/* Clean Minimalist Header */
header {
  background: var(--header-bg) !important;
  backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: none !important;
}
.topbar { min-height: 62px !important; }
nav a {
  padding: 7px 13px !important;
  border-radius: 9px !important;
  border-bottom: none !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  letter-spacing: 0.2px !important;
}
nav a.active, nav a:hover {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
}

/* Kill ALL childish neon glows, loud green borders & gradients */
*, *::before, *::after {
  text-shadow: none !important;
}
.hero-slot, .side-card, .league-group, .ls-bar, .ticker-bar, .art-card, .promo, .side-info-card {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.14) !important;
}

/* Clean Flat League Phase / Round Sub-Header (Fixes Screenshot 2 glowing neon pill!) */
.stage-sep, .round-sep, .lg-stage, .stage-head, .stage-divider, .ls-stage {
  background: var(--panel3) !important;
  border: none !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  padding: 7px 16px !important;
  margin: 0 !important;
  box-shadow: none !important;
}
.stage-sep span, .round-sep span, .lg-stage span, .stage-pill, .ls-stage-pill {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.7px !important;
  text-transform: uppercase !important;
  padding: 0 !important;
}
.stage-sep::before, .stage-sep::after, .round-sep::before, .round-sep::after {
  display: none !important;
}

/* Clean Match Rows (Zero neon green open border, refined score box & subtle video icon) */
.litem {
  border-color: var(--line) !important;
  box-shadow: none !important;
  background: transparent !important;
}
.litem.is-open {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  background: var(--panel) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22) !important;
}
.lrow {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.lrow.open {
  background: var(--panel2) !important;
  border-bottom: 1px solid var(--line) !important;
}
.lrow:hover {
  background: var(--row-hover) !important;
}
.lr-sc {
  background: var(--score-bg) !important;
  border: 1px solid var(--line) !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}
.lr-sc.live {
  border-color: rgba(239, 68, 68, 0.45) !important;
  background: rgba(239, 68, 68, 0.10) !important;
}
.vid-pill {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  box-shadow: none !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  font-size: 11px !important;
}
.vid-pill:hover {
  background: #10b981 !important;
  color: #fff !important;
}
.lr-actions { display: inline-flex !important; align-items: center !important; gap: 6px !important; }

/* Subtle Direct Match Page Button */
.fd-match-seo-link {
  display: inline-flex; align-items: center; justify-content: center;
  height: 28px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel2);
  color: var(--muted); font-size: 11.5px; font-weight: 700;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}
.fd-match-seo-link:hover {
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
  background: rgba(16, 185, 129, 0.10);
}

/* Sticky 14-day bar & refined date pills */
.ls-bar {
  position: sticky !important;
  top: 62px !important;
  z-index: 35 !important;
  padding: 12px 14px !important;
}
.ds-arrow {
  border: 1px solid var(--line) !important;
  background: var(--panel2) !important;
  color: var(--white) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
.ds-arrow:hover { border-color: #10b981 !important; color: #34d399 !important; }
.dtab.active, .day-btn.active {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #fff !important;
  box-shadow: none !important;
}

/* Clean Ad Slots */
.ad {
  border-radius: 14px !important;
  border: 1px dashed rgba(148, 163, 184, 0.22) !important;
  background: var(--panel) !important;
  box-shadow: none !important;
}
.ad .ad-admin-hint, .ad small[data-admin-hint] { display: none !important; }

/* Archive Date Picker (Crisp calendar icon) */
.fd-arch-bar {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel2);
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.fd-arch-bar input[type="date"] {
  background: transparent; border: none; color: var(--white);
  font-size: 12px; font-weight: 600; outline: none; cursor: pointer;
}
html[data-theme="dark"] .fd-arch-bar input[type="date"] { color-scheme: dark; }
html[data-theme="light"] .fd-arch-bar input[type="date"] { color-scheme: light; }

/* Top-Right Admin Avatar */
.fd-adm-wrap { position: relative; display: inline-flex; align-items: center; }
.fd-adm-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid rgba(52, 211, 153, 0.45);
  background: #10b981; color: #fff; font-weight: 800; font-size: 12px;
  cursor: pointer; display: grid; place-items: center; position: relative;
}
.fd-adm-btn::after {
  content: ""; position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--bg);
}
.fd-adm-dd {
  position: absolute; top: calc(100% + 10px); right: 0; width: 230px;
  background: var(--panel); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px; padding: 8px; z-index: 95;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
.fd-adm-dd[hidden] { display: none; }
.fd-adm-dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.fd-adm-dd-head strong { display: block; font-size: 13px; }
.fd-adm-dd-head span { font-size: 11.5px; color: var(--muted); }
.fd-adm-item {
  width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px;
  border: none; background: transparent; color: var(--white); font-size: 12.5px;
  font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
}
.fd-adm-item:hover { background: var(--row-hover); }

/* Inline Front-End Edit Modal & Buttons */
.fd-inline-btn {
  display: none; padding: 4px 10px; border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.14);
  color: #34d399; font-size: 11.5px; font-weight: 700; cursor: pointer; margin-left: 8px;
}
body.fd-inline-edit .fd-inline-btn { display: inline-flex; align-items: center; gap: 4px; }
.fd-ie-modal {
  position: fixed; inset: 0; z-index: 160;
  background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 18px;
}
.fd-ie-modal[hidden] { display: none; }
.fd-ie-box {
  width: min(760px, 100%); max-height: 90vh; overflow: auto;
  background: var(--panel); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 18px; padding: 22px 24px; color: var(--white);
}
.fd-ie-canvas {
  min-height: 220px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2);
  outline: none; line-height: 1.65; margin: 10px 0 14px;
}

/* === V9.1: Zero-Jump Standings Modal & Flat Clean League Headers === */
.tables-dialog {
  height: min(82vh, 720px) !important;
  max-height: 82vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--panel) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 18px !important;
}
.tables-body {
  flex: 1 1 auto !important;
  min-height: 440px !important;
  overflow-y: auto !important;
}
.lg-head {
  background: var(--panel2) !important;
  border-bottom: 1px solid var(--line) !important;
  color: var(--white) !important;
}
.lg-head b {
  color: var(--white) !important;
  font-weight: 800 !important;
}
.fd-comp-toggle-btn {
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.fd-comp-toggle-btn:hover { color: var(--white); border-color: #10b981; }

/* === V9.2: Complete Removal of Neon LEAGUE-PHASE Pill & Loud Open Row === */
.lg-subgrp-head {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  background: var(--panel3) !important;
  border: none !important;
  border-bottom: 1px solid var(--line) !important;
  padding: 7px 16px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.subgrp-line, .subgrp-diamond { display: none !important; }
.subgrp-pill {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.7px !important;
  text-transform: uppercase !important;
}
.subgrp-pill b {
  color: var(--muted) !important;
  font-weight: 700 !important;
}
.lrow-wrap {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
}
.lrow-wrap.is-open {
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}
.lrow.open {
  background: var(--panel2) !important;
  border-left: 3px solid #10b981 !important;
}

/* === V9.4: Restore League Header Hover Highlight (Screenshot 5) === */
.lg-head { transition: background 0.15s ease, color 0.15s ease !important; }
.lg-head:hover { background: var(--row-hover) !important; }
.lg-head:hover b { color: #34d399 !important; }
.lg-head:hover small, .lg-head:hover .lg-cnt { color: var(--white) !important; }

/* === V9.4: Sofascore-Style Featured Match Prediction Slider === */
.fd-pred-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.fd-pred-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.fd-pred-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}
.fd-pred-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fd-pred-arr {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel2);
  color: var(--white); cursor: pointer; font-weight: 800;
  display: grid; place-items: center;
}
.fd-pred-arr:hover { border-color: #10b981; color: #34d399; }
.fd-pred-dots { display: inline-flex; gap: 5px; margin: 0 4px; }
.fd-pred-dot {
  width: 7px; height: 7px; border-radius: 99px;
  background: rgba(148, 163, 184, 0.35); border: none; padding: 0; cursor: pointer;
  transition: all 0.2s;
}
.fd-pred-dot.on { width: 18px; background: #10b981; }

.fd-pred-board {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 6px 16px;
  text-align: center;
}
.fd-pred-tm {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.fd-pred-tm img { width: 48px; height: 48px; object-fit: contain; }
.fd-pred-tm strong { font-size: 15px; font-weight: 800; color: var(--white); }
.fd-pred-mid strong { display: block; font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }
.fd-pred-mid span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.fd-pred-mid .live-tag {
  display: inline-block; padding: 3px 10px; border-radius: 99px;
  background: rgba(239, 68, 68, 0.15); color: #f43f5e; font-weight: 800; font-size: 11.5px; margin-top: 5px;
}

.fd-poll-box {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.fd-poll-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 9px;
}
.fd-poll-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fd-vote-btn {
  position: relative;
  overflow: hidden;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.15s, background 0.15s;
}
.fd-vote-btn:hover:not(:disabled) { border-color: #10b981; background: rgba(16, 185, 129, 0.10); }
.fd-vote-btn.picked { border-color: #10b981; background: rgba(16, 185, 129, 0.16); color: #34d399; }
.fd-vote-btn:disabled { cursor: default; }
.fd-vote-bar {
  display: flex;
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  gap: 2px;
  margin-top: 9px;
  background: var(--panel3);
}
.fd-vb-h { background: #10b981; }
.fd-vb-d { background: #64748b; }
.fd-vb-a { background: #3b82f6; }

.fd-poll-locked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
}
.fd-poll-locked b { color: var(--white); }

/* === V9.5: Exact Sofascore Prediction Pills (Crest-only before vote, Crest + % after vote) === */
.fd-pred-wrap {
  margin-top: 4px;
  padding-top: 6px;
  border-top: none;
}
.fd-sofa-poll {
  background: var(--panel3);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.fd-sofa-poll-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.fd-sofa-poll-head strong { display: block; font-size: 16px; font-weight: 800; color: var(--white); }
.fd-sofa-poll-head small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.fd-sofa-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.fd-sofa-btn {
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(129, 140, 248, 0.35);
  background: var(--panel);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.16s ease;
}
.fd-sofa-btn.voted-mode { justify-content: space-between; }
.fd-sofa-btn img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.fd-sofa-btn:hover:not(:disabled) {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.14);
}
.fd-sofa-btn.picked {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
}
.fd-sofa-btn.unpicked {
  border-color: var(--line);
  background: var(--panel2);
  color: var(--white);
}
.fd-sofa-btn:disabled { cursor: default; }

/* === V9.5: Word-Style Text Wrapping (Обтекание текстом) in Live Articles === */
.art-reader-body::after, .art-body::after { content: ""; display: table; clear: both; }
.fd-media-wrap { max-width: 100%; border-radius: 12px; }
.fd-media-wrap img, .fd-media-wrap video { width: 100%; height: auto; display: block; border-radius: 10px; }
.fd-media-wrap.wrap-left { float: left; margin: 6px 22px 14px 0 !important; }
.fd-media-wrap.wrap-right { float: right; margin: 6px 0 14px 22px !important; }
.fd-media-wrap.wrap-center { float: none; display: block; margin: 16px auto !important; clear: both; }
@media (max-width: 640px) {
  .fd-media-wrap.wrap-left, .fd-media-wrap.wrap-right {
    float: none !important;
    width: 100% !important;
    margin: 14px auto !important;
  }
}

/* === V9.6: Permanently Replace Old Hero Panel with Sofascore Prediction Slider === */
#mainScoreboard .slot-top,
#mainScoreboard #featuredMatch,
#mainScoreboard #heroDetail {
  display: none !important;
}
.fd-pred-lg {
  font-size: 18px !important;
  font-weight: 800 !important;
  letter-spacing: -0.2px;
  gap: 10px !important;
}
.fd-pred-lg-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  padding: 2px;
  flex: none;
}
.fd-pred-mid .ft-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  font-weight: 800;
  font-size: 11.5px;
  margin-top: 5px;
}
