/* ══════════════════════════════════════════════════════════
   TicaretOyunu — Genel tema + erişilebilirlik değişkenleri
   Her sayfadaki :root tanımlarını ezer.
   ════════════════════════════════════════════════════════════ */

/* ——— KOYU TEMA (varsayılan) ——— */
:root,
html[data-theme="dark"] {
  --bg:          #0d1117;
  --bg2:         #161b22;
  --bg3:         #21262d;
  --border:      #30363d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --danger:      #da3633;
  --gold:        #d29922;
  --purple:      #8957e5;
  --orange:      #e3612a;
  --teal:        #14b8a6;
  --violet:      #7c3aed;
  --red:         #ef4444;
  --shadow:      0 4px 20px rgba(0,0,0,0.4);
  --focus-ring:  0 0 0 3px rgba(31,111,235,0.35);
  --radius:      10px;
}

/* ——— AÇIK TEMA ——— */
html[data-theme="light"] {
  --bg:          #f6f8fa;
  --bg2:         #ffffff;
  --bg3:         #eaeef2;
  --border:      #d0d7de;
  --text:        #1f2328;
  --text-muted:  #59636e;
  --danger:      #cf222e;
  --gold:        #9a6700;
  --purple:      #8250df;
  --orange:      #bc4c00;
  --teal:        #0d7b74;
  --violet:      #6639ba;
  --red:         #cf222e;
  --shadow:      0 4px 16px rgba(0,0,0,0.08);
  --focus-ring:  0 0 0 3px rgba(9,105,218,0.30);
}

/* ——— SEPİA / SICAK TEMA ——— */
html[data-theme="sepia"] {
  --bg:          #f4ecd8;
  --bg2:         #fbf3e0;
  --bg3:         #e9dcc1;
  --border:      #d6c39b;
  --text:        #3b2e1b;
  --text-muted:  #7a6748;
  --danger:      #a03224;
  --gold:        #a56400;
  --purple:      #6b3fa0;
  --orange:      #a84500;
  --teal:        #0d6d67;
  --violet:      #5a2d91;
  --red:         #a03224;
  --shadow:      0 4px 12px rgba(120,90,40,0.18);
  --focus-ring:  0 0 0 3px rgba(139,69,0,0.35);
}

/* ——— YÜKSEK KONTRAST (AAA) ——— */
html[data-theme="contrast"] {
  --bg:          #000000;
  --bg2:         #0a0a0a;
  --bg3:         #1a1a1a;
  --border:      #ffffff;
  --text:        #ffffff;
  --text-muted:  #e0e0e0;
  --danger:      #ff5555;
  --gold:        #ffd300;
  --purple:      #c78bff;
  --orange:      #ffb347;
  --teal:        #5fe7d9;
  --violet:      #c78bff;
  --red:         #ff5555;
  --shadow:      none;
  --focus-ring:  0 0 0 4px #ffff00;
}
html[data-theme="contrast"] * {
  border-color: #ffffff !important;
}
html[data-theme="contrast"] a,
html[data-theme="contrast"] button {
  text-decoration: underline;
}

/* ——— AKSAN RENGİ (accent ailesi) ——— */
html[data-accent="yesil"] { --accent: #2ea043; --accent2: #1f6feb; }
html[data-accent="mavi"]  { --accent: #1f6feb; --accent2: #2ea043; }
html[data-accent="mor"]   { --accent: #8957e5; --accent2: #e3612a; }
html[data-accent="turuncu"]{--accent: #e3612a; --accent2: #8957e5; }
html[data-accent="kirmizi"]{--accent: #da3633; --accent2: #d29922; }
html[data-accent="cyan"]  { --accent: #14b8a6; --accent2: #7c3aed; }

/* Varsayılan (attribute yoksa): yeşil */
:root:not([data-accent]),
html:not([data-accent]) { --accent: #2ea043; --accent2: #1f6feb; }

/* ——— YAZI BÜYÜKLÜĞÜ (erişilebilirlik) ——— */
html[data-font-size="kucuk"]     { font-size: 14px; }
html[data-font-size="normal"]    { font-size: 16px; }
html[data-font-size="buyuk"]     { font-size: 18px; }
html[data-font-size="cokbuyuk"]  { font-size: 20px; }

/* ——— HAREKET AZALTMA ——— */
html[data-motion="azalt"] *,
html[data-motion="azalt"] *::before,
html[data-motion="azalt"] *::after {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001s !important;
  scroll-behavior: auto !important;
}

/* Sistem düzeyi tercihlere saygı (kullanıcı ayar yapmadıysa) */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="normal"]) *,
  html:not([data-motion="normal"]) *::before,
  html:not([data-motion="normal"]) *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* ——— ODAK GÖRÜNÜRLÜĞÜ (her tema için garanti altına al) ——— */
:focus-visible {
  outline: 3px solid var(--accent2) !important;
  outline-offset: 2px !important;
  box-shadow: var(--focus-ring) !important;
  border-radius: 4px;
}

/* ——— GLOBAL "SKIP TO MAIN" ve SR YARDIMCILARI ——— */
.skip-to-main {
  position: absolute;
  top: -40px; left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 10000;
  text-decoration: none;
  font-weight: 700;
  border-radius: 0 0 6px 0;
}
.skip-to-main:focus {
  top: 0;
  outline: 3px solid #fff;
}

/* Kullanıcının tercih ettiği ağır imleçler için */
html[data-heavy-cursor="true"] {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path fill="%23ffffff" stroke="%23000000" stroke-width="2" d="M2 2 L2 20 L7 15 L10 22 L13 21 L10 14 L17 14 Z"/></svg>') 0 0, auto;
}

/* Açık tema için form/ink kontrolleri */
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #ffffff !important;
  color: #1f2328 !important;
  border-color: #d0d7de !important;
}
html[data-theme="sepia"] input,
html[data-theme="sepia"] textarea,
html[data-theme="sepia"] select {
  background: #fbf3e0 !important;
  color: #3b2e1b !important;
  border-color: #d6c39b !important;
}

/* Yüksek kontrastta body bg'yi zorla */
html[data-theme="contrast"] body { background: #000 !important; color: #fff !important; }
