/* =========================================
   THEME (Dark/Light) via [data-theme]
   ========================================= */

/* Default = dark */
html[data-theme="dark"]{
  color-scheme: dark;
}

/* Light Theme Overrides */
html[data-theme="light"]{
  color-scheme: light;

  --dart-green: #1f8a57;
  --dart-red: #c62828;

  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f0f3fa;

  --text: #16181d;
  --muted: #5f6675;
  --dim: #70798c;

  --border: #d9dfeb;
  --border-strong: #c5cede;

  --shadow-sm: 0 4px 12px rgba(27, 39, 64, .08);
  --shadow-md: 0 10px 26px rgba(27, 39, 64, .12);
}

/* ===== Light theme contrast fixes ===== */
html[data-theme="light"] .hero p,
html[data-theme="light"] .sub-hello,
html[data-theme="light"] .quick-sub,
html[data-theme="light"] .mini-row,
html[data-theme="light"] .admin-stat .sub,
html[data-theme="light"] .pm-k,
html[data-theme="light"] .st-sub,
html[data-theme="light"] .dropdown-group-label{
  color:#4b5563 !important;
}

html[data-theme="light"] .card-title,
html[data-theme="light"] .pm-v,
html[data-theme="light"] .mini-row strong,
html[data-theme="light"] .admin-stat .val,
html[data-theme="light"] .playcard .name,
html[data-theme="light"] .playcard .eloK{
  color:#111827 !important;
}

html[data-theme="light"] .playcard .motto,
html[data-theme="light"] .playcard .k,
html[data-theme="light"] .admin-stat .lbl{
  color:#6b7280 !important;
}

html[data-theme="light"] .stats-table th{
  background:#eef2f7 !important;
  color:#4b5563 !important;
  border-bottom:1px solid #d5ddea !important;
}
html[data-theme="light"] .stats-table td{
  color:#1f2937 !important;
  border-bottom:1px solid #e1e7f0 !important;
}
html[data-theme="light"] .stats-table tr:hover td{
  background:#f8fafc !important;
}

html[data-theme="light"] .gtable th{
  background:#f3f6fb !important;
  color:#4b5563 !important;
}
html[data-theme="light"] .gtable td{
  color:#1f2937 !important;
  border-bottom:1px solid #e2e8f0 !important;
}

html[data-theme="light"] .live-banner{
  background: linear-gradient(135deg, #fff1f2, #ffe4e6) !important;
  border-color:#f43f5e !important;
}
html[data-theme="light"] .live-title{
  color:#881337 !important;
}

html[data-theme="light"] .ig-card{
  background: linear-gradient(45deg, rgba(240,148,51,.12), rgba(188,24,136,.10), #ffffff) !important;
}
html[data-theme="light"] .ig-btn{
  background:#111827 !important;
  color:#fff !important;
}

html[data-theme="light"] .potm-side{
  background: rgba(255,255,255,.9) !important;
  color:#111827 !important;
  border-color:#d7deea !important;
}
html[data-theme="light"] .potm-side .t1,
html[data-theme="light"] .potm-side .hint{
  color:#6b7280 !important;
}
html[data-theme="light"] .potm-side .t2{
  color:#111827 !important;
}

/* Links/Button text safety */

html[data-theme="light"] .btn-ghost{ color:#1f2937 !important; }

/* Base */
html[data-theme="light"] body{
  background: var(--bg);
  color: var(--text);
}

/* Global components */
html[data-theme="light"] .card,
html[data-theme="light"] .feature-card,
html[data-theme="light"] .mini-stats,
html[data-theme="light"] .admin-stat,
html[data-theme="light"] .quick-card,
html[data-theme="light"] .playcard{
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

html[data-theme="light"] .form-input{
  background: #fff;
  color: #111827;
  border-color: var(--border-strong);
}
html[data-theme="light"] .form-input::placeholder{
  color: #8a93a8;
}

/* Header / Nav */
html[data-theme="light"] .main-header{
  background: rgba(255,255,255,.92);
  border-bottom-color: #d6dbe8;
  box-shadow: 0 4px 18px rgba(20,30,55,.08);
}
html[data-theme="light"] .header-title{ color: #111827; }
html[data-theme="light"] .header-subtitle{ color: #6b7280; }

html[data-theme="light"] nav a{ color: #4b5563; }
html[data-theme="light"] nav ul:not(.mobile-view) a:hover{
  color: #111827;
  text-shadow: none;
}

/* Dropdown */
html[data-theme="light"] .dropdown-content{
  background: #ffffff;
  border-color: #d9dfeb;
  box-shadow: 0 16px 30px rgba(20,30,55,.12);
}
html[data-theme="light"] .dropdown-content a{
  color: #2f3747;
  border-bottom-color: #edf1f7;
}
html[data-theme="light"] .dropdown-content a:hover{
  background: #f6f8fc;
}
html[data-theme="light"] .dropdown-group-label{
  background: #f2f5fb;
  color: #6c7385;
}

/* Ticker */
html[data-theme="light"] .slim-ticker{
  background: #f8fafd;
  color: #596277;
  border-top: 1px solid #e2e8f3;
}
html[data-theme="light"] .slim-ticker-label{
  background: #ffffff;
  border-right-color: #e2e8f3;
  box-shadow: 2px 0 10px rgba(20,30,55,.06);
}
html[data-theme="light"] .slim-ticker-text{ color: #5b6378; }
html[data-theme="light"] .slim-ticker-text strong{ color: #111827; }

/* Footer */
html[data-theme="light"] .site-footer{
  background:
    radial-gradient(circle at 20% 0%, rgba(31,138,87,.08), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(198,40,40,.07), transparent 45%),
    #eef2f9;
  color: #2f3747;
  border-top-color: #d9dfeb;
}
html[data-theme="light"] .footer-title{ color:#101522; }
html[data-theme="light"] .footer-sub{ color:#5f6675; }
html[data-theme="light"] .footer-links a,
html[data-theme="light"] .footer-social a{ color:#3c4658; }
html[data-theme="light"] .footer-links a:hover,
html[data-theme="light"] .footer-social a:hover{ color:#111827; }
html[data-theme="light"] .footer-bottom{
  color:#5f6675;
  border-top-color:#dbe2ef;
}