/* OV-CSS: OddsVeteran style.css (must be CSS, not JS) */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}



:root{
  color-scheme: dark;
  --bg: #050914;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --muted2: #64748b;
  --placeholder: #6b7280;

  --panel-1: #0b1220;
  --panel-2: #070b16;
  --panel-3: #020617;

  --border: #1f2937;

  --header-bg: rgba(5,9,20,0.90);
  --header-border: #1f2937;

  --input-bg: #0b1220;
  --input-border: #1f2937;

  --card-bg-1: #0b1220;
  --card-bg-2: #070b16;

  --chip-bg: #020617;
  --chip-border: #1f2937;

  --shadow-ring: rgba(34,197,94,0.4);

  --theme-btn-bg: rgba(2,6,23,0.55);
  --theme-btn-border: rgba(148,163,184,0.28);
  --theme-btn-text: #e5e7eb;
}

html[data-theme="light"]{
  color-scheme: light;
  --bg: #f4f7fb;
  --text: #0f172a;
  --muted: #475569;
  --muted2: #64748b;
  --placeholder: #94a3b8;

  --panel-1: #ffffff;
  --panel-2: #f8fafc;
  --panel-3: #eef2ff;

  --border: #e2e8f0;

  --header-bg: rgba(255,255,255,0.86);
  --header-border: #e2e8f0;

  --input-bg: #ffffff;
  --input-border: #cbd5e1;

  --card-bg-1: #ffffff;
  --card-bg-2: #f8fafc;

  --chip-bg: #ffffff;
  --chip-border: #e2e8f0;

  --shadow-ring: rgba(34,197,94,0.30);

  --theme-btn-bg: rgba(15,23,42,0.06);
  --theme-btn-border: rgba(15,23,42,0.14);
  --theme-btn-text: #0f172a;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ================= HEADER ================= */

header {
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(0,0,0,0));
  border-bottom: 1px solid var(--header-border);
}

h1 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

/* ================= INPUTS ================= */

input{
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  /* use theme text color (fix light theme typed text visibility) */
  color: var(--text);
  font-size: 16px;
}

input:focus{
  outline: none;
  border-color: rgba(34,197,94,0.45);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}

input::placeholder {
  color: var(--placeholder);
}

.row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

/* ================= MATCH CARD ================= */

.match-card {
  background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  margin: 12px;
}

.teams {
  font-size: 15px;
  font-weight: 600;
}

.datetime {
  font-size: 12px;
  color: var(--muted);
}

.probs-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.prob {
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 0;
  text-align: center;
  font-weight: 600;
}

.prob-high { color: #22c55e; }
.prob-mid  { color: #facc15; }
.prob-low  { color: #ef4444; }

/* ================= SCANNER ================= */

.scanner {
  margin: 40px 12px 16px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--panel-1), var(--bg));
  border: 1px solid var(--border);
}

/* ================= BOOKMAKERS ================= */

.bookmakers {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.bm-btn {
  flex: 1;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.bm-btn img {
  height: clamp(14px, 3.2vw, 22px);
  opacity: 0.7;
}

/* Light theme: bookmaker logos tend to get washed out */
html[data-theme="light"] .bm-btn img{
  opacity: 0.95;
  filter: contrast(1.08) saturate(1.05);
}

.bm-btn.active {
  box-shadow: 0 0 0 2px rgba(34,197,94,0.4);
}

.bm-btn.active img {
  opacity: 1;
}

/* ================= ACTION BUTTONS ================= */

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  flex: 1;
  padding: 14px 10px;
  border-radius: 18px;
  border: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
}

.btn.success {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #052e16;
}

.btn.info {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #e5e7eb;
}

/* ================= VALUE CARDS ================= */

.value-card {
  background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin: 12px;
}

.value-header {
  margin-bottom: 12px;
}

.match {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.match-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.match-line1 {
  font-size: 17px;   /* по-голямо за отборите */
  font-weight: 800;
  line-height: 1.2;
}

.match-line2,
.match-line3 {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.match-line4 {
  margin-top: 2px;
}

.bm-icon {
  height: clamp(14px, 3vw, 20px);
  width: auto;
  opacity: 0.95;
  flex: 0 0 auto;
}

.bm-text {
  font-size: 12px;
  opacity: 0.75;
  white-space: nowrap;
}

/* Selection pill base */
.selection-pill {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 900;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-block;
  letter-spacing: 0.2px;
}

/* Home = зелено */
.selection-pill.home {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  border-color: rgba(34,197,94,0.35);
}

/* Away = синьо */
.selection-pill.away {
  background: rgba(37,99,235,0.15);
  color: #60a5fa;
  border-color: rgba(37,99,235,0.35);
}

/* Draw = жълто */
.selection-pill.draw {
  background: rgba(250,204,21,0.15);
  color: #facc15;
  border-color: rgba(250,204,21,0.35);
}

/* ================= METRICS (labels top, values bottom) ================= */

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 10px 14px;
  margin-top: 6px;
}

.metric-head {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.metric-num {
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.metric-num-value {
  color: #22c55e;
}

/* ================= LANDING ================= */

.landing {
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at top, var(--panel-1), var(--bg) 60%);
  display: flex;
  flex-direction: column;
}

.landing-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  padding: 0;
  margin-bottom: 0;
}

/* ✅ УВЕЛИЧЕНО ЛОГО – БЕЗ МЕСТЕНЕ */

.brand-logo {
  height: 210px; /* desktop */
  width: auto;
  display: block;

  filter:
    brightness(1.2)
    contrast(1.15)
    drop-shadow(0 0 18px rgba(34,197,94,0.35));
}

.tagline {
  margin-top: 6px;
  font-size: 16px;
  color: var(--muted2);
}

.hero-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  max-width: 90vw;
}

.hero-logo {
  width: 50%;
  height: auto;
  margin-bottom: 32px;

  filter:
    brightness(1.25)
    contrast(1.2)
    drop-shadow(0 0 26px rgba(34,197,94,0.4));
}

/* ================= BURGER ================= */

.burger {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;  /* 🔑 */
  align-items: center;      /* 🔑 */
  height: 64px;             /* същата като header-а */
  cursor: pointer;
}

.burger span{
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ================= CENTER CONTENT ================= */

.landing-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.landing-center h1 {
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: 18px;
}

.subtitle {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 36px;
}

/* ================= CTA ================= */

.cta {
  padding: 18px 40px;
  border-radius: 999px;
  border: none;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.6px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

html {
  scroll-behavior: smooth;
}

/* ================= APP HEADER ================= */

.app-header{
  position: sticky;
  top: 0;
  z-index: 20;
  display: block;
  padding: 14px 16px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--header-border);
  max-width: 100vw;
}

.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-row-1 .app-title {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.header-row-2 {
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Prevent any horizontal scroll caused by header buttons */
body { overflow-x: hidden; }

.back-btn{
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
}

.app-title {
  font-size: 16px;
  font-weight: 800;
}

/* ================= MOBILE ONLY ================= */

@media (max-width: 480px) {
  .brand-logo {
    height: 64px; /* mobile – по-голямо, без местене */
  }
}

@media (max-width: 480px) {
  .landing-top {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .landing-top {
    align-items: flex-start;
  }

  .brand {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-logo {
    margin-bottom: 24px;
  }
}

/* SETUP CHIPS */

.setup-bar {
  /* keep it simple; NEW is rendered inside the chips container */
  margin-bottom: 12px;
}

.setup-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Each setup occupies a stable "row" that includes reserved space for ⚙️ */
.setup-chip-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.setup-chip {
  position: relative;

  padding: 8px 14px;
  padding-left: 28px; /* reserve space for the green dot without shifting */

  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;

  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--muted);

  cursor: pointer;
  transition: 0.2s ease;
  transform: none;
}

.setup-chip:active { transform: none; }

.setup-chip:hover {
  border-color: rgba(34,197,94,0.35);
  color: var(--text);
}

.setup-chip::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34,197,94,0.45);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.setup-chip.active {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.45);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}

.setup-chip.active::before {
  opacity: 1;
}

/* NEW button behaves like a chip and always sits after the last setup */
.setup-new {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.2px;

  background: rgba(37,99,235,0.12);
  border: 1px solid rgba(37,99,235,0.35);
  color: #60a5fa;

  cursor: pointer;
  transition: 0.2s ease;
  transform: none;
}

.setup-new:active { transform: none; }

.setup-new:hover {
  background: rgba(37,99,235,0.18);
  border-color: rgba(37,99,235,0.5);
}

.setup-delete {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;

  background: var(--input-bg);
  border: 1px solid var(--border);
  color: #ef4444;

  cursor: pointer;
  transition: 0.2s ease;
}

.setup-delete:hover {
  background: rgba(239,68,68,0.1);
  border-color: #ef4444;
}

/* ⚙️ always takes space; it is only visually hidden when not active */
.setup-gear {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s ease;
  transform: none;
}

.setup-gear:active { transform: none; }

.setup-gear:hover {
  border-color: rgba(34,197,94,0.35);
}

/* hides without affecting layout */
.gear-hidden {
  visibility: hidden;
  pointer-events: none;
}
/* ================= MODAL ================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.hidden {
  display: none;
}

.modal-box {
  width: 90%;
  max-width: 320px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  text-align: center;
}

.modal-text {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.btn-modal {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  font-weight: 800;
  border: none;
  cursor: pointer;
}

.btn-modal.cancel {
  background: #1f2937;
  color: #e5e7eb;
}

html[data-theme="light"] .btn-modal.cancel{
  background: #e2e8f0;
  color: #0f172a;
}

.btn-modal.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-modal.info {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #e5e7eb;
}

.modal-input{
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.modal-input:focus {
  border-color: rgba(34,197,94,0.45);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}

.modal-input::placeholder {
  color: var(--placeholder);
}
/* ================= TOAST ================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 9999;

  min-width: 220px;
  max-width: calc(100% - 24px);
  padding: 12px 14px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(2, 6, 23, 0.92);
  color: #e5e7eb;

  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);

  font-size: 15px;
  text-align: center;
}

/* Light theme: keep toast readable but not overly dark */
html[data-theme="light"] .toast{
  border: 1px solid rgba(15,23,42,0.10);
  background: rgba(15,23,42,0.92);
}

.toast.success {
  border-color: rgba(34,197,94,0.35);
}

.toast.error {
  border-color: rgba(239,68,68,0.35);
}

.toast.hidden {
  display: none;
}
/* ================= SMALLER LOGOUT ================= */

.logout-btn {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

/* StakeFlow quick button (header) */
.stakeflow-btn {
  margin-left: 0;
  padding: 7px 12px;
  border-radius: 14px;
  border: 1px solid var(--theme-btn-border);
  background: var(--theme-btn-bg);
  color: var(--theme-btn-text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .4px;
}
.stakeflow-btn:active { transform: none; }


.stakeflow-btn:hover {
  background: rgba(37,99,235,0.18);
  border-color: rgba(37,99,235,0.5);
}

/* Bet button inside value cards */
.btn.bet {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #e5e7eb;
}

/* StakeFlow stats grid */
.sf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px;
}

.sf-stat {
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  text-align: center;
}

.sf-stat .k {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.sf-stat .v {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.sf-tabs {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.sf-tab {
  flex: 1;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.sf-tab.active {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.45);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}

/* ================= SMALLER ACTION BUTTONS ================= */

.small-btn {
  padding: 10px 8px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
}

/* ================= TELEGRAM BUTTON ================= */

.telegram-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tg-icon {
  height: 14px;
  width: 14px;
  object-fit: contain;
}

/* ================= LOGOUT (small corner style) ================= */

.logout-btn {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
}

/* ================= MEDIUM ACTION BUTTONS ================= */

.medium-btn {
  padding: 12px 10px;
  font-size: 16px;
  border-radius: 16px;
}

/* ================= TELEGRAM BUTTON ================= */

.telegram-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tg-icon {
  height: 16px;
  width: 16px;
  object-fit: contain;
}

/* ================= MODE TOGGLE ================= */

.mode-toggle {
  display: flex;
  gap: 8px;
  margin: 14px 0 10px;
}

.mode-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.mode-btn:hover {
  border-color: rgba(34,197,94,0.4);
  color: var(--text);
}

.mode-btn.active {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: #16a34a;
  color: #052e16;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}







/* ================= HISTORY ================= */

.actions.actions-bottom { margin-top: 10px; }

.btn.dark {
  background: linear-gradient(135deg, #111827, #0b1220);
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,.18);
}

#historyWrap { margin-top: 6px; }

.history-stats {
  margin: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.history-stat {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.15);
  background: rgba(2, 6, 23, 0.35);
}

.history-stat .label { opacity: .75; font-size: 12px; }
.history-stat .value { font-size: 18px; font-weight: 900; margin-top: 4px; }

.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.22);
  font-weight: 800;
  font-size: 12px;
}

.result-pill.win { background: rgba(34,197,94,.12); }
.result-pill.loss { background: rgba(239,68,68,.12); }
.result-pill.pending { background: rgba(59,130,246,.10); }

/* (цялото ти style.css остава същото, добавяме само това в края) */

/* ================= HISTORY CARD FOOTER (Value-like) ================= */

.history-footer{
  margin-top: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.history-profit{
  font-weight: 900;
  opacity: .9;
  font-variant-numeric: tabular-nums;
}





/* ================= LiveScore ================= */

.ls-searchbar{
  position: relative;
  margin-bottom: 12px;
}

.ls-search-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--input-bg);
}

.ls-search-ico{ opacity: .85; }

.ls-search{
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.ls-search::placeholder{ color: var(--muted2); }

.ls-search-results{
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  max-height: 320px;
  overflow: auto;
  z-index: 30;
}

.ls-search-item{
  width: 100%;
  text-align:left;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.ls-search-item:last-child{ border-bottom: 0; }

.ls-search-item .t{ font-weight: 900; }
.ls-search-item .vs{ opacity:.5; font-weight:800; }
.ls-search-item .s{ margin-top: 4px; font-size: 12px; color: var(--muted); }

.ls-search-item:active{ background: rgba(148,163,184,0.06); }

.ls-search-empty{ padding: 12px; color: var(--muted); font-weight:700; }

.ls-topbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}

.ls-days{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.ls-day-btn{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  cursor:pointer;
}

.ls-day-btn.active{
  background: rgba(34,197,94,0.10);
  border-color: rgba(34,197,94,0.45);
  color: #e5e7eb;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.16);
}

.ls-select{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: #e5e7eb;
  font-size: 16px;
  font-weight: 700;
}

.ls-meta{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.ls-group{
  margin: 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
}

.ls-group-head{
  padding: 10px 12px;
  font-weight: 900;
  letter-spacing: .2px;
  color: #e5e7eb;
  background: rgba(2,6,23,0.65);
  border-bottom: 1px solid rgba(31,41,55,0.65);
}

.ls-group-body{
  display:flex;
  flex-direction:column;
}

.ls-item{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(31,41,55,0.55);
  cursor: pointer;
}

.ls-item:last-child{ border-bottom: 0; }

.ls-item:active{ background: rgba(148,163,184,0.06); }

.ls-item-left{ flex:0 0 auto; }
.ls-item-mid{ flex:1; min-width:0; }
.ls-item-right{ flex:0 0 auto; }

.ls-meta-line{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted2);
  font-weight: 700;
}

.ls-section-title{
  margin: 16px 12px 6px;
  font-weight: 900;
  letter-spacing: .6px;
  color: #e5e7eb;
  opacity: .95;
}

.ls-row{
  display:flex;
  gap:12px;
  align-items:center;
}

/* Sofascore-like list */
.ls-group{
  margin: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
}

.ls-group-head{
  padding: 10px 12px;
  font-weight: 900;
  letter-spacing: .2px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(31,41,55,0.7);
  background: rgba(2,6,23,0.65);
}

.ls-item{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid rgba(31,41,55,0.65);
  cursor:pointer;
}

.ls-item:last-child{ border-bottom: 0; }

.ls-item:hover{ background: rgba(148,163,184,0.05); }

.ls-item-left{ flex:0 0 auto; min-width: 74px; }
.ls-item-mid{ flex:1; min-width: 0; }
.ls-item-right{ flex:0 0 auto; }

.ls-meta-line{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-left{ flex:0 0 auto; }
.ls-mid{ flex:1; min-width: 0; }
.ls-right{ flex:0 0 auto; }

.ls-teams{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.ls-team{
  font-weight: 900;
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ls-score{
  font-weight: 900;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.ls-score.muted{
  opacity: .35;
}

.ls-sub{
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.ls-pill{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3px;
  border: 1px solid transparent;
}

.ls-pill.ns{
  background: rgba(148,163,184,0.10);
  color: #cbd5e1;
  border-color: rgba(148,163,184,0.18);
}

.ls-pill.live{
  background: rgba(34,197,94,0.16);
  color: #22c55e;
  border-color: rgba(34,197,94,0.35);
}

.ls-pill.ht{
  background: rgba(250,204,21,0.16);
  color: #facc15;
  border-color: rgba(250,204,21,0.35);
}

.ls-pill.ft{
  background: rgba(37,99,235,0.16);
  color: #60a5fa;
  border-color: rgba(37,99,235,0.35);
}

.ls-pill.pp{
  background: rgba(239,68,68,0.16);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.35);
}

/* Side sheet modal */
.ls-sheet{
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(520px, 100vw);
  max-width: 100vw;
  background: var(--panel-1);
  border-left: 1px solid var(--border);
  box-shadow: -30px 0 80px rgba(0,0,0,0.55);
  z-index: 60;
  display:flex;
  flex-direction:column;
  box-sizing: border-box;
  overflow-x: hidden;
}


.ls-sheet-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.ls-sheet-body{
  padding: 12px 14px 22px;
  overflow:auto;
  overflow-x:hidden;
  box-sizing:border-box;
}


.ls-block{
  background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  margin: 12px 0;
}

.ls-block-title{
  font-weight: 900;
  letter-spacing: .3px;
  margin-bottom: 10px;
}

.ls-big-title{
  font-weight: 900;
  font-size: 16px;
}

.ls-big-score{
  margin-top: 8px;
  font-weight: 900;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.ls-big-sub{
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ls-kv-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ls-kv{
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(2,6,23,0.55);
}

.ls-kv .k{
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: .2px;
}

.ls-kv .v{
  margin-top: 6px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.ls-odds{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ls-odds-row{
  display:grid;
  grid-template-columns: 120px 1fr 1fr 1fr;
  gap: 8px;
  align-items:center;
  font-size: 12px;
}

.ls-odds-row .t{
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .2px;
}

.ls-odds-row .o{
  text-align:left;
  color:#e5e7eb;
  font-weight: 700;
}

.ls-h2h{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.ls-h2h-row{
  border: 1px solid rgba(148,163,184,0.16);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(2,6,23,0.55);
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items:center;
}

.ls-h2h-row .a{ font-weight: 800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ls-h2h-row .b{ font-weight: 800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:right; }
.ls-h2h-row .s{ font-weight: 900; font-variant-numeric: tabular-nums; }
.ls-h2h-row .d{
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 480px) {
  .ls-odds-row{
    grid-template-columns: 92px 1fr 1fr 1fr;
  }
  .ls-kv-grid{
    grid-template-columns: 1fr;
  }
}

/* LiveScore stats row (home - label - away) */
.ls-stat-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,0.45);
  border-radius: 14px;
  margin-top: 10px;
}
.ls-stat-left,.ls-stat-right{
  min-width: 60px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.ls-stat-mid{
  flex:1;
  text-align:center;
  color: var(--muted);
  font-size:12px;
  font-weight:800;
  letter-spacing:.2px;
  text-transform: uppercase;
}

.ls-stat-bar{
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin: 8px 12px 0;
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.16);
}
.ls-stat-bar-home{
  height: 100%;
  background: rgba(34,197,94,0.85);
}
.ls-stat-bar-away{
  height: 100%;
  background: rgba(37,99,235,0.85);
}



/* ================= PARLAYS CARDS ================= */
.parlay-divider{height:1px;background:rgba(148,163,184,.18);margin:10px 0;}
.parlay-card .match-line1{font-size:16px;}


/* ================= THEME TOGGLE ================= */
.theme-toggle-btn{
  appearance:none;
  border: 1px solid var(--theme-btn-border);
  background: var(--theme-btn-bg);
  color: var(--theme-btn-text);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: .2px;
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  user-select:none;
}

.theme-toggle-btn:active{
  transform: translateY(1px);
}

@media (max-width: 420px){
  .theme-toggle-btn{ padding: 10px 10px; }
}

/* ============================================================
   MEGA PREMIUM UI OVERRIDES (keeps original layout + classes)
   Drop-in: appended at the end to override earlier rules.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root{
  /* Geometry */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 22px;
  --r-xl: 26px;

  /* Premium borders */
  --b-soft: rgba(148,163,184,0.14);
  --b-mid:  rgba(148,163,184,0.22);
  --b-strong: rgba(148,163,184,0.30);

  /* Depth */
  --sh-1: 0 10px 28px rgba(0,0,0,0.22);
  --sh-2: 0 18px 60px rgba(0,0,0,0.30);
  --sh-3: 0 26px 90px rgba(0,0,0,0.34);

  /* Brand glow (green) */
  --glow: 0 0 0 1px rgba(34,197,94,0.18), 0 18px 70px rgba(34,197,94,0.12);

  /* Glass */
  --glass-1: rgba(2,6,23,0.70);
  --glass-2: rgba(2,6,23,0.50);

  /* Focus */
  --focus: rgba(34,197,94,0.48);

  /* Motion */
  --ease: cubic-bezier(.2,.9,.2,1);
}

html[data-theme="light"]{
  --b-soft: rgba(15,23,42,0.10);
  --b-mid:  rgba(15,23,42,0.16);
  --b-strong: rgba(15,23,42,0.22);

  --sh-1: 0 10px 26px rgba(2,6,23,0.10);
  --sh-2: 0 18px 58px rgba(2,6,23,0.14);
  --sh-3: 0 26px 86px rgba(2,6,23,0.18);

  --glass-1: rgba(255,255,255,0.78);
  --glass-2: rgba(255,255,255,0.62);

  --focus: rgba(34,197,94,0.40);
}

/* ---------- Premium background + subtle "noise" vibe (no external assets) ---------- */
body{
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(34,197,94,0.20), transparent 55%),
    radial-gradient(900px 540px at 10% 110%, rgba(56,189,248,0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 65%, rgba(168,85,247,0.08), transparent 55%),
    radial-gradient(1200px 700px at 50% 50%, rgba(255,255,255,0.03), transparent 60%),
    var(--bg);
  letter-spacing: -0.12px;
}

/* Optional: gentle film grain (CSS-only) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .08;
  mix-blend-mode: overlay;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.04), rgba(255,255,255,.04) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.04), rgba(0,0,0,.04) 1px, transparent 1px, transparent 4px);
}
html[data-theme="light"] body::before{ opacity: .06; }

/* Keep app content above noise layer */
body > *{ position: relative; z-index: 1; }

/* ---------- Smooth interactions everywhere ---------- */
a, button, input, select, .bm-btn, .setup-chip, .setup-new, .mode-btn, .sf-tab, .theme-toggle-btn{
  transition: transform .16s var(--ease),
              box-shadow .16s var(--ease),
              border-color .16s var(--ease),
              background .16s var(--ease),
              opacity .16s var(--ease),
              filter .16s var(--ease);
}

/* Better keyboard focus */
:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}

/* ---------- Header: true glass + premium separator ---------- */
.app-header,
header{
  background:
    linear-gradient(180deg, var(--glass-1) 0%, rgba(0,0,0,0) 150%);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--b-soft);
  box-shadow: 0 10px 36px rgba(0,0,0,0.14);
}

/* ---------- Cards: layered gradients + hover lift ---------- */
.value-card,
.match-card,
.scanner,
.history-stats,
.ls-group,
.ls-block{
  border-radius: var(--r-xl);
  border: 1px solid var(--b-soft);
  background:
    radial-gradient(900px 260px at 20% 0%, rgba(34,197,94,0.07), transparent 55%),
    radial-gradient(600px 220px at 95% 15%, rgba(56,189,248,0.06), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.00)),
    linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  box-shadow: var(--sh-1);
}

.value-card:hover,
.match-card:hover,
.ls-block:hover{
  transform: translateY(-2px);
  border-color: var(--b-mid);
  box-shadow: var(--sh-2);
}

.value-card:active,
.match-card:active{
  transform: translateY(-1px);
}

/* ---------- Inputs: glassy + inset highlight ---------- */
input, select, .modal-input, .ls-search-wrap{
  border-radius: var(--r-lg);
  border: 1px solid var(--b-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.00)),
    var(--input-bg);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 8px 22px rgba(0,0,0,0.10);
}

input:focus, select:focus, .modal-input:focus{
  border-color: var(--focus);
  box-shadow:
    0 0 0 3px rgba(34,197,94,0.16),
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 12px 30px rgba(0,0,0,0.14);
}

/* ---------- Buttons: premium depth + subtle sheen ---------- */
.btn,
.btn-modal,
.stakeflow-btn,
.logout-btn,
.setup-new,
.setup-chip,
.mode-btn,
.sf-tab,
.bm-btn,
.theme-toggle-btn,
.ls-day-btn{
  border-radius: 999px;
}

.btn{
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0,0,0,0.20);
}

.btn::after{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(600px 140px at 10% 0%, rgba(255,255,255,0.22), transparent 55%);
  opacity:.0;
  transition: opacity .18s var(--ease);
  pointer-events:none;
}

.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 56px rgba(0,0,0,0.26);
}
.btn:hover::after{ opacity:.9; }

.btn:active{
  transform: translateY(-1px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.20);
}

/* Dark utility buttons */
.btn.dark,
.logout-btn{
  border: 1px solid var(--b-soft);
  background: linear-gradient(180deg, rgba(148,163,184,0.12), rgba(148,163,184,0.06));
  box-shadow: 0 10px 26px rgba(0,0,0,0.16);
}

/* Chips / tabs */
.setup-chip,
.sf-tab,
.mode-btn,
.ls-day-btn{
  border: 1px solid var(--b-soft);
  background: rgba(148,163,184,0.08);
}

.setup-chip:hover,
.sf-tab:hover,
.mode-btn:hover,
.ls-day-btn:hover{
  transform: translateY(-1px);
  border-color: var(--b-mid);
  background: rgba(148,163,184,0.10);
}

.setup-chip.active,
.sf-tab.active,
.mode-btn.active,
.ls-day-btn.active,
.bm-btn.active{
  border-color: rgba(34,197,94,0.42);
  box-shadow: var(--glow);
}

/* Bookmaker tiles */
.bm-btn{
  border-radius: var(--r-xl);
  border: 1px solid var(--b-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.00)),
    var(--panel-2);
  box-shadow: 0 10px 28px rgba(0,0,0,0.14);
}
.bm-btn:hover{ transform: translateY(-2px); border-color: var(--b-mid); }

/* ---------- Typography tweaks ---------- */
h1, .app-title, .match-line1{
  letter-spacing: -0.25px;
}

.match-line1{ text-shadow: 0 1px 0 rgba(0,0,0,0.25); }
html[data-theme="light"] .match-line1{ text-shadow: none; }

.metric-num, .sf-stat .v, .history-stat .value, .ls-score, .ls-big-score{
  letter-spacing: -0.25px;
}

/* ---------- Pills: crisp badges ---------- */
.selection-pill,
.result-pill,
.ls-pill{
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  border-color: rgba(148,163,184,0.18) !important;
}

/* ---------- Modal: premium sheet ---------- */
.modal{
  background: rgba(0,0,0,0.64);
  backdrop-filter: blur(12px) saturate(1.15);
}
.modal-box{
  border-radius: var(--r-xl);
  border: 1px solid var(--b-soft);
  background:
    radial-gradient(900px 260px at 20% 0%, rgba(34,197,94,0.09), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.00)),
    var(--panel-1);
  box-shadow: var(--sh-3);
}

/* ---------- LiveScore side sheet: iOS-like ---------- */
.ls-sheet{
  background:
    radial-gradient(900px 280px at 20% 0%, rgba(34,197,94,0.09), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.00)),
    var(--panel-1);
  border-left: 1px solid var(--b-soft);
}
.ls-sheet-head{
  background: var(--glass-1);
  border-bottom: 1px solid var(--b-soft);
}

/* ---------- Scrollbars (subtle, premium) ---------- */
*{ scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.28) transparent; }
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb{
  background: rgba(148,163,184,0.26);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover{ background: rgba(148,163,184,0.36); border: 3px solid transparent; }
*::-webkit-scrollbar-track{ background: transparent; }

/* ---------- Logo glow refinement ---------- */
.brand-logo,
.hero-logo{
  filter:
    brightness(1.25)
    contrast(1.2)
    drop-shadow(0 0 22px rgba(34,197,94,0.32))
    drop-shadow(0 20px 60px rgba(0,0,0,0.28));
}

/* ---------- Reduce motion for accessibility ---------- */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior: auto !important; }
  .value-card:hover, .match-card:hover, .ls-block:hover, .bm-btn:hover, .btn:hover{ transform: none !important; }
}

/* ============================================================
   PATCH: ACTIVE TAB TEXT VISIBILITY + HISTORY WIN/LOSS TINTS
   ============================================================ */

/* ----- Single / Parlays (mode buttons / tabs) ----- */
.mode-btn,
.sf-tab{
  position: relative;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Active state – premium glow, but readable label */
.mode-btn.active,
.sf-tab.active{
  background: linear-gradient(180deg, rgba(34,197,94,0.20), rgba(34,197,94,0.12));
  border-color: rgba(34,197,94,0.55);
  color: #ffffff !important;
  text-shadow: 0 0 6px rgba(34,197,94,0.35);
  box-shadow:
    0 0 0 1px rgba(34,197,94,0.25),
    0 8px 30px rgba(34,197,94,0.18);
}

/* Hover shouldn't reduce contrast */
.mode-btn:hover,
.sf-tab:hover{
  color: #ffffff;
}

/* Light theme: keep contrast with darker text */
html[data-theme="light"] .mode-btn.active,
html[data-theme="light"] .sf-tab.active{
  color: #0b1220 !important;
  text-shadow: none;
  background: linear-gradient(180deg, rgba(34,197,94,0.22), rgba(34,197,94,0.10));
}

/* ----- History results: WIN green tint, LOSS red tint ----- */
/* Add these classes to the result card container:
   .result-win  (for winning)
   .result-loss (for losing)
*/
.result-win{
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(34,197,94,0.18), transparent 60%),
    linear-gradient(180deg, rgba(34,197,94,0.10), rgba(0,0,0,0));
  border: 1px solid rgba(34,197,94,0.35);
  box-shadow: 0 0 25px rgba(34,197,94,0.15);
}

.result-loss{
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(239,68,68,0.18), transparent 60%),
    linear-gradient(180deg, rgba(239,68,68,0.10), rgba(0,0,0,0));
  border: 1px solid rgba(239,68,68,0.35);
  box-shadow: 0 0 25px rgba(239,68,68,0.15);
}

/* Preserve existing card layers underneath (if card already has gradients) */
.result-win.value-card,
.result-win.match-card,
.result-win.ls-block,
.result-win.ls-group{
  background-blend-mode: normal;
}

.result-loss.value-card,
.result-loss.match-card,
.result-loss.ls-block,
.result-loss.ls-group{
  background-blend-mode: normal;
}

/* Light theme variants */
html[data-theme="light"] .result-win{
  background:
    radial-gradient(700px 220px at 0% 0%, rgba(34,197,94,0.20), transparent 62%),
    linear-gradient(180deg, rgba(34,197,94,0.08), rgba(255,255,255,0));
  border-color: rgba(34,197,94,0.28);
  box-shadow: 0 0 22px rgba(34,197,94,0.10);
}

html[data-theme="light"] .result-loss{
  background:
    radial-gradient(700px 220px at 0% 0%, rgba(239,68,68,0.20), transparent 62%),
    linear-gradient(180deg, rgba(239,68,68,0.08), rgba(255,255,255,0));
  border-color: rgba(239,68,68,0.26);
  box-shadow: 0 0 22px rgba(239,68,68,0.10);
}

/* ============================================================
   PATCH v3: History card tint based on existing .result-pill.win/.loss
   Uses :has() so you don't need extra classes.
   ============================================================ */

/* WIN card */
.match-card:has(.result-pill.win),
.ls-block:has(.result-pill.win),
.value-card:has(.result-pill.win){
  background:
    radial-gradient(700px 240px at 0% 0%, rgba(34,197,94,0.18), transparent 62%),
    radial-gradient(520px 220px at 100% 10%, rgba(56,189,248,0.06), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.00)),
    linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  border-color: rgba(34,197,94,0.32);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.12), var(--sh-1);
}

/* LOSS card */
.match-card:has(.result-pill.loss),
.ls-block:has(.result-pill.loss),
.value-card:has(.result-pill.loss){
  background:
    radial-gradient(700px 240px at 0% 0%, rgba(239,68,68,0.18), transparent 62%),
    radial-gradient(520px 220px at 100% 10%, rgba(168,85,247,0.05), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.00)),
    linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  border-color: rgba(239,68,68,0.30);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.10), var(--sh-1);
}

/* Optional: make WIN/LOSS pill a bit more premium */
.result-pill.win{
  border-color: rgba(34,197,94,0.35);
  box-shadow: 0 0 18px rgba(34,197,94,0.14);
}
.result-pill.loss{
  border-color: rgba(239,68,68,0.35);
  box-shadow: 0 0 18px rgba(239,68,68,0.12);
}

/* Light theme tuning */
html[data-theme="light"] .match-card:has(.result-pill.win),
html[data-theme="light"] .ls-block:has(.result-pill.win),
html[data-theme="light"] .value-card:has(.result-pill.win){
  border-color: rgba(34,197,94,0.26);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.10), var(--sh-1);
}

html[data-theme="light"] .match-card:has(.result-pill.loss),
html[data-theme="light"] .ls-block:has(.result-pill.loss),
html[data-theme="light"] .value-card:has(.result-pill.loss){
  border-color: rgba(239,68,68,0.24);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.08), var(--sh-1);
}

/* If a browser doesn't support :has(), cards will remain neutral (pills still show WIN/LOSS). */

/* ============================================================
   PATCH v4: More subtle WIN / LOSS tint (less aggressive)
   ============================================================ */

/* WIN – softer green */
.match-card:has(.result-pill.win),
.ls-block:has(.result-pill.win),
.value-card:has(.result-pill.win){
  background:
    radial-gradient(800px 260px at 0% 0%, rgba(34,197,94,0.10), transparent 65%),
    linear-gradient(180deg, rgba(34,197,94,0.04), rgba(0,0,0,0)),
    linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  border-color: rgba(34,197,94,0.22);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.08), var(--sh-1);
}

/* LOSS – softer red */
.match-card:has(.result-pill.loss),
.ls-block:has(.result-pill.loss),
.value-card:has(.result-pill.loss){
  background:
    radial-gradient(800px 260px at 0% 0%, rgba(239,68,68,0.10), transparent 65%),
    linear-gradient(180deg, rgba(239,68,68,0.04), rgba(0,0,0,0)),
    linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
  border-color: rgba(239,68,68,0.20);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.07), var(--sh-1);
}

/* Tone down pill glow slightly */
.result-pill.win{
  box-shadow: 0 0 10px rgba(34,197,94,0.10);
}

.result-pill.loss{
  box-shadow: 0 0 10px rgba(239,68,68,0.10);
}

/* ================= SCROLL FIX ================= */

/* Allow normal vertical scroll everywhere */
html, body {
  height: auto;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  touch-action: auto;
}

/* Prevent horizontal overflow safely */
body {
  overflow-x: hidden;
}

/* Fix for side sheets and modals */
.ls-sheet,
.modal {
  touch-action: auto;
  overscroll-behavior: contain;
}

/* ===================================================== */
/* ================= DESKTOP CONTAINER ================= */
/* ===================================================== */

/* Mobile/Tablet: keep the original vertical flow.
   If app.html contains the desktop shell markup, these rules make it behave
   like the old layout and hide the embedded StakeFlow pane. */
@media (max-width: 1439px) {
  .desktop-shell{ display:block; max-width:none; margin:0; padding:0; }
  .desk-left{ display:none !important; }
  .desk-col{ border:none; background:transparent; border-radius:0; box-shadow:none; overflow:visible; }
  .desk-col-head{ display:none !important; }
  .desk-col-body{ overflow:visible; padding:0; }
}

@media (min-width: 1440px) {

  /* Desktop layout is controlled by .desktop-shell (app.html).
     Keep the document flow vertical; do NOT make body a row-flex container. */
  body { display: block; }

  /* 3-column shell (StakeFlow | Scanner | Results) */
  .desktop-shell{
    --gap: 16px;
    display: grid;
    grid-template-columns: 360px minmax(520px, 1fr) 420px;
    gap: var(--gap);
    max-width: 1500px;
    margin: 14px auto 18px;
    padding: 0 16px;
  }

  /* Each column is a card with its own scrollable body */
  .desk-col{
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, var(--panel-1), var(--bg));
    min-height: 0; /* allow inner scrolling */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.02);
  }

  .desk-col-head{
    display:flex;
    align-items:center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
  }

  .desk-col-title{
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.4px;
  }

  .desk-col-link{
    font-size: 12px;
    font-weight: 800;
    color: #22c55e;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(34,197,94,0.28);
    background: rgba(34,197,94,0.08);
  }

  .desk-col-body{
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
  }

  /* Make the scanner fit nicely (remove outer margins inside the mid column) */
  .desk-mid .scanner{ margin: 0; }

  /* Iframe fill */
  .desk-iframe{
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 14px;
    background: transparent;
  }

  /* Desktop: shell takes the remaining height; disable page scroll */
  html, body{ height: 100%; overflow: hidden; }
  .desktop-shell{ height: calc(100vh - (var(--header-h, 92px)) - 22px); }

}

/* StakeFlow embed mode (iframe inside desktop shell) */
html.embed #sfTopHeader{ display:none !important; }
html.embed body{ background: transparent !important; }




/* ================= Value Scanner Search ================= */

.vs-search-card{
  /* Desktop default: sits inside the Value Scanner column */
  margin: 0 0 12px;
}

.vs-searchbar{
  position: relative;
}

.vs-search-wrap{
  position: relative;
  display:block;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02);
}

.vs-search-wrap:focus-within{
  border-color: rgba(34,197,94,0.55);
  box-shadow: 0 0 0 3px var(--shadow-ring);
}

.vs-search-ico{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity:.85;
  pointer-events:none;
  font-size: 16px;
  line-height: 1;
}

.vs-search{
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  padding: 12px 14px 12px 44px; /* leave room for the icon */
  border-radius: 18px;
}

.vs-search:focus{
  outline: none;
  box-shadow: none;
}

.vs-search::placeholder{ color: var(--muted2); font-weight: 700; }

.vs-search-results{
  position:absolute;
  left:0;
  right:0;
  top: calc(100% + 8px);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-1), var(--bg));
  box-shadow: 0 22px 70px rgba(0,0,0,0.55);
  max-height: 320px;
  overflow:auto;
  z-index: 60;
  padding: 8px;
}

.vs-search-item{
  width:100%;
  text-align:left;
  padding: 12px 12px;
  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(2,6,23,0.55);
  color: var(--text);
  border-radius: 14px;
  cursor:pointer;
  margin-bottom: 8px;
}

.vs-search-item:last-child{ margin-bottom: 0; }

.vs-search-item .t{ font-weight: 900; font-size: 13.5px; letter-spacing: .1px; }
.vs-search-item .vs{ opacity:.55; font-weight:900; }
.vs-search-item .s{ margin-top:6px; font-size:12px; color: var(--muted); font-weight: 750; line-height: 1.25; }

.vs-search-item:hover{ background: rgba(148,163,184,0.08); }
.vs-search-item:active{ background: rgba(148,163,184,0.12); }

.vs-search-empty{ padding: 12px; color: var(--muted); font-weight:800; }

/* Mobile/Tablet: match the Value Scanner card width */
@media (max-width: 1199px){
  .vs-search-card{
    margin: 22px 12px 10px;
  }
  .vs-search-card + .scanner{
    margin-top: 12px;
  }
}


/* Popup content */
.pred-meta{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.pred-prob-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}

.pred-prob-head{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .3px;
  opacity: .75;
  text-align:center;
}

.pred-prob-val{
  padding: 12px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.35);
  text-align:center;
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}


/* Odds table inside the prediction popup */
.odds-wrap{
  margin-top: 14px;
}

.odds-title{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .3px;
  opacity: .75;
  margin-bottom: 10px;
}

.odds-row{
  display:grid;
  grid-template-columns: 86px repeat(3, minmax(0,1fr));
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.odds-bm{
  display:flex;
  align-items:center;
  gap: 8px;
  min-width: 0;
}

.odds-bm img{
  height: 16px;
  width: auto;
  opacity: .95;
  flex: 0 0 auto;
}

.odds-bm span{
  font-size: 12px;
  font-weight: 900;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.odds-cell{
  padding: 10px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.28);
  text-align:center;
  font-variant-numeric: tabular-nums;
}

.odds-cell .o{
  font-size: 11px;
  font-weight: 900;
  opacity: .75;
}

.odds-cell .v{
  margin-top: 2px;
  font-size: 14px;
  font-weight: 900;
}



/* ================= DESKTOP: StakeFlow EMBED (iframe) =================
   Goal:
   - No inner scrollbar in the StakeFlow iframe
   - No clipping: parent page sets iframe height via postMessage (sfHeight)
*/
html.embed, html.embed body{
  height: auto !important;
  overflow: visible !important;
  background: transparent !important;
}

html.embed #sfTopHeader{
  display: none !important;
}

/* Keep StakeFlow content tight in the embedded column */
html.embed .scanner{
  margin: 12px 12px 16px !important;
}

/* Make sure the embed doesn't force its own full-viewport sizing */
html.embed .app-header{
  position: static !important;
}

.bm-btn img.winbet-logo {
  transform: scale(1.4);
}














/* ================= SORT BAR (Value Bets / Singles) ================= */
.sort-bar{
  margin: 10px 12px 0;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-1), var(--panel-2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sort-label{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--muted);
}

.sort-select{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.sort-select:focus{
  outline: none;
  border-color: rgba(34,197,94,0.45);
  box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}
