/* Gece Köyü ortak stili. Renkler yalnız buradaki değişkenlerden (madde 3): koyu tema (asıl kimlik, gece)
   ve aynı kimliği koruyan açık tema (parşömen). Tema <html data-tema="koyu|acik"> ile seçilir. */
:root,
:root[data-tema="koyu"] {
  color-scheme: dark;
  --night: #0d0d1a; --night2: #1a1a2e; --night3: #16213e;
  --blood: #7a1515; --blood2: #c0392b; --gold: #c9a84c; --gold2: #f0c040;
  --text: #e8e0d0; --muted: #8f8574; --surface: #1e1e2e; --surface2: #252538;
  --green: #2ecc71; --red: #ef6b5e; --blue: #5dade2; --border: #2a2a3f;
  --cizgi-ince: #1d1d2c;
  --yer-tutucu: #9a907e; /* panel zemininde (surface2) 4.5:1 için soluktan bir ton açık */
  --dolgu-yazi: #ffffff;
  --dolgu-kirmizi: #c0392b; --dolgu-kirmizi-ust: #a93226;
  --dugme-ust: rgba(201, 168, 76, .14);
  --secili: rgba(192, 57, 43, .28); --oylu: rgba(192, 57, 43, .16);
  --perde: rgba(0, 0, 0, .9);
  --pencere-perde: rgba(0, 0, 0, .7);
  --ana-zemin-ust: #1a0a28;
  --anahtar-iz: #3a3a4a; --anahtar-top: #9a9aa8; --anahtar-top-acik: #ffffff;
  --sayac-kenar: #4a4a5a;
  --son-soz-1: #3a0808; --son-soz-2: #1a0808; --son-soz-yazi: #ffdddd;
  --isaret-zemin: rgba(240, 192, 64, .3);
  /* rol çipleri: zemin / yazı */
  --cip-vampir-z: #3a0808; --cip-vampir-y: #ff8f8f;
  --cip-koylu-z: #0e2a0e; --cip-koylu-y: #8ade8a;
  --cip-doktor-z: #0e1e38; --cip-doktor-y: #8cc6ff;
  --cip-dedektif-z: #2a2a08; --cip-dedektif-y: #e8e880;
  --cip-avci-z: #22220a; --cip-avci-y: #d6c78a;
  --cip-cadi-z: #280e28; --cip-cadi-y: #e08ee0;
  --cip-joker-z: #222226; --cip-joker-y: #d6d6d6;
  --cip-kahin-z: #0e2838; --cip-kahin-y: #8ad6ec;
  --cip-koruyucu-z: #0e280e; --cip-koruyucu-y: #6ee66e;
  /* faz rozetleri: zemin / yazı */
  --faz-gece-z: #7a1515; --faz-gece-y: #ffc4c4;
  --faz-gunduz-z: #1a3a08; --faz-gunduz-y: #a8e488;
  --faz-sabah-z: #3a2a00; --faz-sabah-y: #f0c040;
  --faz-savunma-z: #0e1e38; --faz-savunma-y: #8cc6ff;
  --faz-oylama-z: #280e40; --faz-oylama-y: #cc9aff;
}
:root[data-tema="acik"] {
  color-scheme: light;
  --night: #f5f0e6; --night2: #ede6d8; --night3: #e6dccb;
  --blood: #8f1d1d; --blood2: #b3261e; --gold: #7d5f12; --gold2: #6e520c;
  --text: #1c1a22; --muted: #5e5547; --surface: #fffdf8; --surface2: #f3ede1;
  --green: #196b36; --red: #b42318; --blue: #1f5f99; --border: #d8cfbd;
  --cizgi-ince: #ebe3d3;
  --yer-tutucu: #5e5547;
  --dolgu-yazi: #ffffff;
  --dolgu-kirmizi: #b3261e; --dolgu-kirmizi-ust: #921f18;
  --dugme-ust: rgba(125, 95, 18, .1);
  --secili: rgba(179, 38, 30, .14); --oylu: rgba(179, 38, 30, .08);
  --perde: rgba(245, 240, 230, .96);
  --pencere-perde: rgba(28, 26, 34, .45);
  --ana-zemin-ust: #ecdff0;
  --anahtar-iz: #cfc6b4; --anahtar-top: #6b6252; --anahtar-top-acik: #ffffff;
  --sayac-kenar: #b9ae98;
  --son-soz-1: #fbe3e3; --son-soz-2: #f8efea; --son-soz-yazi: #5c1010;
  --isaret-zemin: rgba(240, 192, 64, .45);
  --cip-vampir-z: #fbe3e3; --cip-vampir-y: #8f1d1d;
  --cip-koylu-z: #e3f3e3; --cip-koylu-y: #1d5e1d;
  --cip-doktor-z: #e1ecfb; --cip-doktor-y: #1f4f8f;
  --cip-dedektif-z: #f4f1d4; --cip-dedektif-y: #5a500e;
  --cip-avci-z: #f1ead8; --cip-avci-y: #5e4a10;
  --cip-cadi-z: #f3e1f3; --cip-cadi-y: #6e1f6e;
  --cip-joker-z: #ececec; --cip-joker-y: #333333;
  --cip-kahin-z: #dff1f6; --cip-kahin-y: #155566;
  --cip-koruyucu-z: #e0f3e0; --cip-koruyucu-y: #1f6b1f;
  --faz-gece-z: #8f1d1d; --faz-gece-y: #ffffff;
  --faz-gunduz-z: #dcefd0; --faz-gunduz-y: #2a5a10;
  --faz-sabah-z: #f6e7c2; --faz-sabah-y: #6e520c;
  --faz-savunma-z: #e1ecfb; --faz-savunma-y: #1f4f8f;
  --faz-oylama-z: #ece1f8; --faz-oylama-y: #5a2a8f;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--night); color: var(--text); font-family: 'Crimson Text', serif; font-size: 17px; }
h1, h2, h3, .cinzel { font-family: 'Cinzel', serif; letter-spacing: .5px; font-weight: 400; }
/* Cinzel küçük harfi de büyük harf biçiminde çizer, "i" noktasız çıkar. Metni CSS ile büyütüyoruz:
   lang="tr" sayesinde "i" → "İ" olur. */
h1, h2, h3, .cinzel, .dugme, .ust-logo { text-transform: uppercase; }
a { color: var(--gold); text-underline-offset: 2px; }
a:hover { color: var(--gold2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; }

.atla { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--surface); color: var(--text); padding: .6rem 1rem; }
.atla:focus { left: .5rem; top: .5rem; }

/* ── Düğmeler (içerik sayfaları, altbilgi, bant, pencereler) ── */
.dugme {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem; border: 1px solid var(--gold); border-radius: 2px;
  background: transparent; color: var(--gold); font-family: 'Cinzel', serif; font-size: .8rem; letter-spacing: .5px;
  cursor: pointer; text-decoration: none; touch-action: manipulation;
}
.dugme:hover { background: var(--dugme-ust); color: var(--gold); }
.dugme-ana { background: var(--dolgu-kirmizi); border-color: var(--dolgu-kirmizi); color: var(--dolgu-yazi); }
.dugme-ana:hover { background: var(--dolgu-kirmizi-ust); color: var(--dolgu-yazi); }
.dugme:disabled { opacity: .55; cursor: not-allowed; }
.genis { display: flex; width: 100%; max-width: 320px; margin: 2rem auto 0; }
.baglanti-dugme {
  background: none; border: 0; padding: .25rem 0; color: inherit; font: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px; min-height: 44px;
}
.baglanti-dugme:hover { color: var(--gold2); }

/* ── İçerik sayfaları ── */
body.icerik-sayfasi { min-height: 100vh; display: flex; flex-direction: column; }
.ust { display: flex; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.ust-logo { display: inline-flex; align-items: center; gap: .5rem; color: var(--gold); text-decoration: none; font-family: 'Cinzel', serif; letter-spacing: 1px; min-height: 44px; }
.kart { flex: 1 0 auto; width: 100%; max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; line-height: 1.65; }
.kart h1 { font-size: 1.6rem; color: var(--gold); line-height: 1.3; }
.kart h2 { font-size: 1.05rem; color: var(--gold); margin: 2rem 0 .6rem; }
.kart h3 { font-size: .9rem; color: var(--text); margin: 1.1rem 0 .3rem; }
.kart p, .kart ul, .kart ol { margin-bottom: .8rem; }
.kart ul, .kart ol { padding-left: 1.4rem; }
.kart li { margin-bottom: .35rem; }
.soluk { color: var(--muted); }
.baslik-satir { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.roller-liste > div { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.roller-liste > div:last-child { border-bottom: 0; }
.roller-liste dt { font-family: 'Cinzel', serif; text-transform: uppercase; color: var(--gold); font-size: .9rem; }
.roller-liste dd { margin: .2rem 0 0; }
.hata-kart { text-align: center; padding-top: 3rem; }
.hata-kod { font-family: 'Cinzel', serif; font-size: 3rem; color: var(--red); line-height: 1; margin-bottom: .6rem; }

/* ── Arama ── */
.arama-form label { display: block; margin: .8rem 0 .3rem; color: var(--muted); }
.arama-satir { display: flex; gap: .5rem; }
.arama-satir input {
  flex: 1; min-width: 0; min-height: 44px; padding: .55rem .8rem; background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 2px; font: inherit;
}
.arama-satir input:focus { border-color: var(--gold); }
.arama-sonuclar { list-style: none; padding: 0 !important; margin-top: 1rem; }
.arama-sonuclar li { padding: .8rem 0; border-bottom: 1px solid var(--border); }
.arama-sonuclar a { font-family: 'Cinzel', serif; text-transform: uppercase; font-size: .9rem; }
.arama-sonuclar p { margin: .25rem 0 0; color: var(--text); }
mark { background: var(--isaret-zemin); color: inherit; padding: 0 .1em; }

/* ── Paylaş ── */
.paylas-dugme { position: relative; }
.paylas-menu {
  position: absolute; right: 0; top: 100%; z-index: 500; min-width: 210px; margin-top: .3rem;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: .3rem;
}
.go-dugmeler, .home-ic { position: relative; }
.go-dugmeler .paylas-menu, .home-ic .paylas-menu { right: auto; left: 50%; transform: translateX(-50%); text-align: left; }
.go-dugmeler .paylas-menu { top: auto; bottom: 100%; margin: 0 0 .3rem; }
.paylas-oge {
  display: block; width: 100%; padding: .6rem .8rem; min-height: 44px; color: var(--text); background: none; border: 0;
  font: inherit; text-align: left; text-decoration: none; cursor: pointer; border-radius: 2px;
}
.paylas-oge:hover, .paylas-oge:focus-visible { background: var(--surface2); color: var(--text); }

/* ── Altbilgi (madde 1): solda liste, sağda rozet; telefonda alt alta ── */
.altbilgi { border-top: 1px solid var(--border); padding: 1.5rem 1rem 1rem; color: var(--muted); font-size: .95rem; background: var(--night); }
.altbilgi-ust { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; max-width: 960px; margin: 0 auto; }
.liste-form { flex: 1 1 280px; max-width: 420px; }
.liste-form label { display: block; margin-bottom: .3rem; color: var(--text); }
.liste-satir { display: flex; gap: .5rem; align-items: stretch; }
.liste-satir input {
  flex: 1; min-width: 0; min-height: 44px; padding: .4rem .2rem; background: transparent; color: var(--text);
  border: 0; border-bottom: 1px solid var(--muted); border-radius: 0; font: inherit;
}
.liste-satir input:focus { border-bottom-color: var(--gold); }
.liste-satir input::placeholder, .arama-satir input::placeholder, input::placeholder, textarea::placeholder { color: var(--yer-tutucu); opacity: 1; }
.liste-noscript { display: block; margin-top: .4rem; font-size: .85rem; }
.liste-sonuc { margin-top: .4rem; min-height: 1.2em; font-size: .9rem; }
.liste-sonuc[data-durum="tamam"] { color: var(--green); }
.liste-sonuc[data-durum="hata"] { color: var(--red); }
.bot-tuzagi { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.rozet { display: inline-block; line-height: 0; }
.rozet img { height: 28px; width: auto; }
.rozet-koyu { display: none; }
:root[data-tema="koyu"] .rozet-acik { display: none; }
:root[data-tema="koyu"] .rozet-koyu { display: inline; }
.altbilgi-alt {
  display: flex; flex-wrap: wrap; align-items: center; gap: .1rem 1.1rem; max-width: 960px; margin: 1rem auto 0;
  padding-top: .6rem; border-top: 1px solid var(--cizgi-ince); font-size: .9rem;
}
.altbilgi-alt a { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; }
.altbilgi-alt a:hover, .altbilgi-alt .baglanti-dugme:hover { color: var(--text); }
.altbilgi-alt span { display: inline-flex; align-items: center; min-height: 44px; }
.tema-dugme { display: inline-flex; align-items: center; gap: .35rem; }
.tema-simge::before { content: '☀'; }
:root[data-tema="acik"] .tema-simge::before { content: '☾'; }
@media (max-width: 640px) {
  .altbilgi-ust { flex-direction: column; align-items: flex-start; }
  .liste-form { flex: none; max-width: none; width: 100%; }
}

/* ── Pencereler (liste aydınlatma metni, çerez tercihleri) ── */
.pencere {
  width: calc(100% - 2rem); max-width: 34rem; max-height: 85vh; overflow: auto; margin: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 1.25rem;
}
.pencere::backdrop { background: var(--pencere-perde); }
.pencere h2 { font-size: 1rem; color: var(--gold); margin-bottom: .8rem; }
.pencere h3 { font-size: .85rem; margin: .8rem 0 .2rem; }
.pencere p { margin-bottom: .6rem; line-height: 1.55; }
.pencere-metin { max-height: 45vh; overflow: auto; margin-bottom: .6rem; padding-right: .3rem; }
.pencere-dugmeler { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.cerez-grup { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.cerez-anahtar { display: flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; font-family: 'Cinzel', serif; text-transform: uppercase; font-size: .85rem; }
.cerez-anahtar input { width: 20px; height: 20px; accent-color: var(--blood2); }

/* ── Çerez bandı (madde 14): altta, içeriği kapatmaz, üç düğme aynı boyda ── */
.cerez-bant {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; background: var(--surface); color: var(--text);
  border-top: 1px solid var(--gold); padding: .8rem 1rem; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: .6rem 1.2rem; font-size: .95rem;
}
.cerez-bant p { flex: 1 1 320px; max-width: 640px; line-height: 1.45; }
.cerez-dugmeler { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; flex: 0 1 420px; }
.cerez-dugmeler .dugme { width: 100%; padding: .5rem .4rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
