/* =========================================================
   MLBB TR — Tasarım Sistemi
   Palet: Gece laciverti + kraliyet mavisi + efsanevi altın
   ========================================================= */

:root {
  /* Zemin */
  --navy-950: #04060e;
  --navy-900: #060a1a;
  --navy-850: #081029;
  --navy-800: #0b1633;
  --navy-700: #102048;
  --navy-600: #162b60;

  /* Mavi */
  --blue-700: #123a8a;
  --blue-600: #1e6ff2;
  --blue-400: #4f8dff;
  --cyan-400: #35d0ff;
  --cyan-200: #9fe9ff;

  /* Altın */
  --gold-200: #fff6d8;
  --gold-300: #ffe9a8;
  --gold-400: #f5d67a;
  --gold-500: #f5c451;
  --gold-600: #dfa829;
  --gold-700: #b57f0f;

  /* Metin */
  --text: #eaf0ff;
  --text-soft: #b7c4e4;
  --text-dim: #7d8cb3;

  /* Yüzeyler */
  --surface: rgba(10, 18, 44, 0.72);
  --surface-2: rgba(13, 24, 56, 0.86);
  --surface-3: rgba(8, 14, 34, 0.94);
  --line: rgba(120, 160, 255, 0.16);
  --line-gold: rgba(245, 196, 81, 0.32);

  /* Vurgu (profil rengiyle çalışma zamanında değişir) */
  --accent: #f5c451;
  --accent-soft: rgba(245, 196, 81, 0.18);

  /* Efektler */
  --glow-gold: 0 0 24px rgba(245, 196, 81, 0.35), 0 0 60px rgba(245, 196, 81, 0.12);
  --glow-blue: 0 0 24px rgba(53, 208, 255, 0.35), 0 0 70px rgba(30, 111, 242, 0.18);
  --shadow-card: 0 24px 60px -24px rgba(0, 0, 0, 0.85), 0 2px 0 rgba(255, 255, 255, 0.04) inset;

  /* Tipografi */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-ui: 'Rajdhani', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Ölçü */
  --nav-h: 74px;
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1280px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Tema varyantları — profil ayarlarından değişir */
[data-theme='imperial'] {
  --navy-900: #14090b;
  --navy-850: #1c0f0d;
  --navy-800: #26150f;
  --blue-700: #6b3d0c;
  --cyan-400: #ffb45c;
}
[data-theme='abyss'] {
  --navy-900: #07061a;
  --navy-850: #0d0a2a;
  --navy-800: #150f3d;
  --blue-700: #3b1580;
  --cyan-400: #a78bff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/**
 * hidden özelliği her zaman kazansın.
 * Tarayıcının varsayılan [hidden]{display:none} kuralı, yazar stillerindeki
 * display:flex/grid tarafından eziliyor; bu da gizli panellerin ekranda
 * kalmasına yol açıyor.
 */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--gold-700) var(--navy-900);
  /* iOS yatay çevrildiğinde metni kendiliğinden büyütmesin */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--navy-950);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 5.2vw, 4.1rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }

p { margin: 0 0 1rem; color: var(--text-soft); }

a {
  color: var(--gold-400);
  text-decoration: none;
  transition: color 0.25s var(--ease);
}
a:hover { color: var(--gold-200); }

img { max-width: 100%; display: block; }

/* ---------- Erişilebilirlik ---------- */

:focus-visible {
  outline: 3px solid var(--cyan-400);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 12px 22px;
  background: var(--gold-500);
  color: #10131f;
  font-weight: 700;
  border-radius: 0 0 12px 12px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; color: #10131f; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

::selection {
  background: var(--gold-500);
  color: #0a0f1e;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--navy-950); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--gold-700), var(--blue-700));
  border-radius: 10px;
  border: 3px solid var(--navy-950);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--gold-500), var(--blue-600)); }

/* ---------- Yerleşim ---------- */

.container {
  width: min(100% - 2.5rem, var(--maxw));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(4rem, 9vw, 7.5rem) 0;
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  width: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500));
}

/* Dövme altın — metalik bantlar + kayan parlama */
.gold-text {
  position: relative;
  background: linear-gradient(
    100deg,
    #b57f0f 0%, #f5c451 14%, #fff6d8 24%, #f5c451 34%,
    #a9750d 46%, #ffe9a8 58%, #dfa829 70%, #fff6d8 82%, #c98a12 100%
  );
  background-size: 260% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 7s linear infinite;
  filter: drop-shadow(0 0 14px rgba(245, 196, 81, 0.42)) drop-shadow(0 1px 0 rgba(0, 0, 0, 0.55));
}
@keyframes shine { to { background-position: 260% center; } }

/**
 * Metalik başlık — altın degradeye kabartma ve ışık halesi ekler.
 * `background-clip: text` gölge kabul etmediği için hale, alta yerleştirilen
 * bulanık bir kopyayla (::after) veriliyor.
 */
.metal-text {
  position: relative;
  display: inline-block;
  background: linear-gradient(
    170deg,
    #ffffff 0%, #ffe9a8 18%, #f5c451 34%, #9a6d0c 50%,
    #f5c451 64%, #fff6d8 78%, #c98a12 100%
  );
  background-size: 100% 260%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: metal-sweep 6s ease-in-out infinite;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6)) drop-shadow(0 0 18px rgba(245, 196, 81, 0.5));
}
@keyframes metal-sweep {
  0%, 100% { background-position: 50% 0%; }
  50% { background-position: 50% 100%; }
}

/* Işıyan başlık halesi — büyük başlıklarda derinlik verir */
.glow-title {
  text-shadow:
    0 0 22px rgba(30, 111, 242, 0.5),
    0 0 60px rgba(53, 208, 255, 0.28),
    0 2px 0 rgba(0, 0, 0, 0.6);
}

.lead {
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: var(--text-soft);
  max-width: 62ch;
}

/* ---------- Panel / Kart ---------- */

.panel {
  position: relative;
  background:
    linear-gradient(160deg, rgba(30, 111, 242, 0.07), transparent 42%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(245, 196, 81, 0.55) 50%, transparent 100%);
  height: 1px;
}

/* Köşe süsleri — premium hissiyat */
.ornate {
  position: relative;
}
.ornate::after {
  content: '';
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border-radius: calc(var(--radius-lg) - 8px);
  background:
    linear-gradient(var(--gold-500), var(--gold-500)) top left / 18px 1px no-repeat,
    linear-gradient(var(--gold-500), var(--gold-500)) top left / 1px 18px no-repeat,
    linear-gradient(var(--gold-500), var(--gold-500)) top right / 18px 1px no-repeat,
    linear-gradient(var(--gold-500), var(--gold-500)) top right / 1px 18px no-repeat,
    linear-gradient(var(--gold-500), var(--gold-500)) bottom left / 18px 1px no-repeat,
    linear-gradient(var(--gold-500), var(--gold-500)) bottom left / 1px 18px no-repeat,
    linear-gradient(var(--gold-500), var(--gold-500)) bottom right / 18px 1px no-repeat,
    linear-gradient(var(--gold-500), var(--gold-500)) bottom right / 1px 18px no-repeat;
  opacity: 0.55;
  transition: opacity 0.4s var(--ease), inset 0.4s var(--ease);
}
.ornate:hover::after { opacity: 1; }

/* ---------- Butonlar ---------- */

.btn {
  --btn-bg: linear-gradient(135deg, var(--gold-500), var(--gold-700));
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.86rem 1.9rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #0a0f1e;
  background: var(--btn-bg);
  border: 1px solid rgba(255, 240, 184, 0.5);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), filter 0.3s var(--ease);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.65) 50%, transparent 80%);
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-gold);
  color: #0a0f1e;
}
.btn:hover::after { transform: translateX(130%); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-ghost {
  --btn-bg: transparent;
  color: var(--gold-300);
  border-color: var(--line-gold);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  color: var(--gold-200);
  background: rgba(245, 196, 81, 0.09);
  box-shadow: 0 0 22px rgba(245, 196, 81, 0.18);
}

.btn-blue {
  --btn-bg: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  color: #eaf3ff;
  border-color: rgba(120, 190, 255, 0.45);
}
.btn-blue:hover { color: #fff; box-shadow: var(--glow-blue); }

.btn-danger {
  --btn-bg: linear-gradient(135deg, #ff5f6d, #8f1424);
  color: #fff;
  border-color: rgba(255, 150, 160, 0.45);
}
.btn-danger:hover { color: #fff; box-shadow: 0 0 24px rgba(255, 95, 109, 0.35); }

.btn-sm { padding: 0.55rem 1.15rem; font-size: 0.86rem; }
.btn-block { width: 100%; }

/* ---------- Rozet / Etiket ---------- */

/* Etiket — köşeli kutu. Dikey dolgu, Türkçe "İ" noktası kenara değmesin diye
   asimetrik (üstte biraz daha fazla). */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
  padding: 0.3rem 0.72rem 0.26rem;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(4, 8, 22, 0.7));
  color: var(--text-soft);
  white-space: nowrap;
}
.tag-gold {
  border-color: var(--line-gold);
  color: var(--gold-300);
  background: linear-gradient(165deg, rgba(245, 196, 81, 0.18), rgba(4, 8, 22, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 240, 184, 0.2);
}
.tag-live {
  border-color: rgba(255, 95, 109, 0.5);
  color: #ff9aa4;
  background: linear-gradient(165deg, rgba(255, 95, 109, 0.2), rgba(4, 8, 22, 0.7));
  text-indent: 0;
}
.tag-live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ff5f6d;
  box-shadow: 0 0 10px #ff5f6d;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.25; transform: scale(0.7); } }

/* ---------- Form ---------- */

.field { margin-bottom: 1.15rem; }

.field label,
.form-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='url'],
input[type='search'],
input[type='number'],
input[type='tel'],
input[type='date'],
input[type='time'],
input[type='datetime-local'],
select,
textarea {
  width: 100%;
  padding: 0.82rem 1rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text);
  background: rgba(4, 8, 22, 0.75);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
input::placeholder, textarea::placeholder { color: #5c6a90; }

input:hover, select:hover, textarea:hover { border-color: rgba(140, 180, 255, 0.3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  background: rgba(6, 12, 30, 0.9);
  box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.16);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--gold-500) 50%), linear-gradient(135deg, var(--gold-500) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 2.6rem; }
select option { background: #0a1230; color: var(--text); }

.field-error {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #ff9aa4;
}
input[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: #ff5f6d; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 8, 22, 0.5);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.checkbox-row:hover { border-color: var(--line-gold); background: rgba(245, 196, 81, 0.05); }
.checkbox-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--gold-500); flex: none; }
.checkbox-row span { font-size: 0.94rem; color: var(--text-soft); }
.checkbox-row strong { display: block; color: var(--text); font-size: 0.98rem; }

/* ---------- Uyarı kutuları ---------- */

.alert {
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border-left: 3px solid;
  font-size: 0.94rem;
  margin-bottom: 1.2rem;
}
.alert-error { background: rgba(255, 95, 109, 0.12); border-color: #ff5f6d; color: #ffd0d4; }
.alert-success { background: rgba(92, 230, 168, 0.12); border-color: #5ce6a8; color: #cdfae6; }
.alert-info { background: rgba(53, 208, 255, 0.1); border-color: var(--cyan-400); color: var(--cyan-200); }

/* ---------- Izgara yardımcıları ---------- */

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- Ortaya çıkış animasyonu ---------- */

.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
  will-change: transform, opacity;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Yüklenme ---------- */

.loader {
  display: grid;
  place-items: center;
  min-height: 45vh;
  gap: 1.2rem;
}
.loader-ring {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(245, 196, 81, 0.15);
  border-top-color: var(--gold-500);
  border-right-color: var(--cyan-400);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader p { font-family: var(--font-ui); letter-spacing: 0.28em; text-transform: uppercase; font-size: 0.8rem; }

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: sweep 1.4s linear infinite;
  border-radius: 10px;
}
@keyframes sweep { to { background-position: -200% 0; } }

/* ---------- Duyarlılık ---------- */

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .container { width: min(100% - 1.6rem, var(--maxw)); }
  .btn { padding: 0.78rem 1.4rem; font-size: 0.92rem; }
}

/* ---------- Mobil: form ve dokunma hedefleri ----------
   iOS Safari, yazı tipi 16px'in altındaki bir alana dokunulduğunda sayfayı
   otomatik yakınlaştırır ve kullanıcı elle geri uzaklaştırmak zorunda kalır.
   Bu yüzden telefonda tüm form alanları en az 16px'tir. */

@media (max-width: 760px), (pointer: coarse) {
  input[type='text'],
  input[type='email'],
  input[type='password'],
  input[type='url'],
  input[type='search'],
  input[type='number'],
  input[type='tel'],
  input[type='date'],
  input[type='time'],
  input[type='datetime-local'],
  select,
  textarea {
    font-size: 16px;
    min-height: 48px;          /* rahat dokunulabilir yükseklik */
    padding: 0.75rem 0.9rem;
  }
  textarea { min-height: 96px; }

  .btn,
  button[type='submit'] {
    min-height: 46px;
  }

  /* Onay kutuları parmakla seçilebilecek büyüklükte */
  input[type='checkbox'],
  input[type='radio'] {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
  }
  .checkbox-row { padding: 0.9rem; }
}

/* Dokunmatik cihazlarda küçük metin bağlantılarına dokunma payı ekle */
@media (hover: none) and (pointer: coarse) {
  .chat-dm,
  .chat-delete,
  .auth-switch a,
  .breadcrumb a {
    display: inline-block;
    padding: 6px 4px;
  }
}

/* Çentikli telefonlarda (iPhone) yatay modda içerik çentiğin altında kalmasın */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-motion) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Kullanıcının profil ayarından gelen "animasyonları azalt" tercihi */
[data-motion='reduced'] .fx-fog,
[data-motion='reduced'] .hero-frame-fog,
[data-motion='reduced'] .cursor-fx { display: none !important; }
[data-motion='reduced'] .fx-aurora,
[data-motion='reduced'] .fx-grid { animation: none !important; }
[data-motion='reduced'] .reveal { opacity: 1; transform: none; transition: none; }

@media print {
  .site-nav, .site-footer, .fx-layer, .cursor-fx { display: none !important; }
  body { background: #fff; color: #000; }
}
