:root {
  --night-0: #060920;
  --night-1: #0b1033;
  --night-2: #18194a;
  --night-3: #35215f;
  --ground: #080b24;
  --gold: #e8b85a;
  --gold-soft: #f7dfa4;
  --ink: #f5eedb;
  --muted: #b8b2d8;
  --paper: #fbf4e3;
  --paper-ink: #2b2442;
  --paper-muted: #6d6383;
  --paper-gold: #a8721f;
  --door-1: #1d7a78;
  --door-2: #26458f;
  --door-3: #8f2c3e;
  --door-4: #22704d;
  --radius: 22px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 25%, var(--night-2) 60%, var(--night-3) 100%);
  background-color: var(--night-1);
  overflow-x: hidden;
}

button { font: inherit; color: inherit; }

svg { display: block; }

/* ---------- Gökyüzü ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.sky .stars { position: absolute; left: 0; top: 0; width: 1px; height: 1px; border-radius: 50%; background: transparent; }
.sky .stars.s1 { animation: twinkle 5s ease-in-out infinite; }
.sky .stars.s2 { animation: twinkle 7s ease-in-out -2s infinite; }
.sky .stars.s3 { width: 2px; height: 2px; animation: twinkle 9s ease-in-out -4s infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

header, main, footer { position: relative; z-index: 1; }

/* ---------- Üst bölüm ---------- */
.hero {
  text-align: center;
  padding: 34px 16px 0;
  overflow: hidden;
}

.toolbar {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 8px;
  z-index: 3;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(232, 184, 90, .35);
  background: rgba(10, 14, 45, .55);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.icon-btn:hover { background: rgba(40, 40, 100, .7); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--gold-soft); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.lanterns { position: absolute; inset: 0 0 auto 0; height: 0; pointer-events: none; }
.lantern {
  position: absolute;
  top: -6px;
  width: 44px;
  height: 88px;
  fill: none;
  transform-origin: 50% 0;
  animation: swing 6s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(255, 196, 96, .55));
}
.lantern.l1 { left: 12%; height: 120px; width: 56px; top: 30px; }
.lantern.l2 { left: 20%; top: 52px; animation-duration: 7.5s; animation-delay: -2s; }
.lantern.l3 { right: 13%; height: 104px; width: 50px; top: 74px; animation-duration: 6.8s; animation-delay: -4s; }
@keyframes swing { 0%, 100% { transform: rotate(3deg); } 50% { transform: rotate(-3deg); } }

.moon-wrap { position: absolute; top: 20px; right: 20px; width: 92px; height: 92px; }
.moon { width: 100%; height: 100%; overflow: visible; }

.kicker {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
}

h1 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(40px, 9vw, 72px);
  line-height: 1;
  letter-spacing: .01em;
  background: linear-gradient(180deg, #fff4d2 10%, #e8b85a 70%, #c58f3c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 18px rgba(232, 184, 90, .25));
}

.tagline { margin: 10px 0 0; color: var(--muted); font-size: clamp(15px, 3.6vw, 18px); }

.mosque { width: min(100%, 780px); margin: 8px auto 0; overflow: visible; }
.mosque .building { fill: var(--ground); }
.mosque .building path[d^="M120 2"], .mosque .building path[d^="M680 2"] { stroke: var(--ground); stroke-width: 2; }
.mosque .finial { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; }
.mosque .windows { fill: #ffc766; opacity: .82; }
.mosque .rope { fill: none; stroke: rgba(255, 236, 190, .35); stroke-width: 1.2; }
.mosque #rope-bulbs circle { fill: #fff0bd; }
.mosque #mahya {
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: .06em;
  transition: opacity .6s;
}

.status {
  margin: 0 -16px;
  padding: 18px 16px 26px;
  background: var(--ground);
}
.status-main {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(26px, 6vw, 36px);
  color: var(--gold-soft);
  line-height: 1.15;
}
.status-main strong { color: #ffd77a; }
.status-sub { margin: 6px auto 0; color: var(--muted); max-width: 520px; font-size: 15px; }
.progress { max-width: 360px; margin: 16px auto 0; }
.progress-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #c58f3c, #ffe08a);
  box-shadow: 0 0 12px rgba(255, 210, 120, .7);
  transition: width .8s cubic-bezier(.3, 1, .4, 1);
}
.progress-text { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Takvim duvarı ---------- */
main { padding: 26px 16px 40px; }

.preview-banner {
  max-width: 860px;
  margin: 0 auto 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(232, 184, 90, .12);
  border: 1px dashed rgba(232, 184, 90, .5);
  color: var(--gold-soft);
  font-size: 14px;
  text-align: center;
}
.preview-banner a { color: #ffd77a; }

.wall {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 26px 26px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 184, 90, .14), transparent 55%),
    linear-gradient(180deg, #151c4c, #10153d);
  border: 1px solid rgba(232, 184, 90, .32);
  box-shadow:
    inset 0 0 0 6px rgba(8, 11, 36, .6),
    inset 0 0 0 7px rgba(232, 184, 90, .22),
    0 30px 80px rgba(0, 0, 0, .45);
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 26px 18px;
}
.grid li { display: flex; }

.door {
  position: relative;
  width: 100%;
  aspect-ratio: 100 / 140;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 520px;
  -webkit-tap-highlight-color: transparent;
}
.door:focus-visible { outline: none; }
.door:focus-visible .door-leaf svg, .door:focus-visible .door-inside { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 6px #fff); }

.door-inside, .door-leaf { position: absolute; inset: 0; width: 100%; height: 100%; }

.door-inside .in-fill { fill: url(#glow-in); }
.door-inside .in-frame { fill: none; stroke: #5a3420; stroke-width: 3; }
.door-inside .in-moon-bg { fill: rgba(40, 20, 30, .35); }
.door-inside .in-moon { fill: #fffbe8; }
.door-inside .in-num { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 22px; fill: #5a2a1f; }
.door-inside .in-done { fill: #2c7d4f; }
.door-inside .in-done-tick { fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }

.door-leaf {
  transform-origin: 5% 50%;
  transition: transform 1s cubic-bezier(.25, 1.25, .45, 1), filter .3s;
  will-change: transform;
}
.door-leaf svg { width: 100%; height: 100%; overflow: visible; }
.door-leaf .leaf-fill { fill: var(--door); }
.door-leaf .leaf-shade { fill: url(#shade); }
.door-leaf .leaf-tile { fill: url(#tile); }
.door-leaf .leaf-line { fill: none; stroke: rgba(247, 223, 164, .45); stroke-width: 1.4; }
.door-leaf .leaf-stroke { fill: none; stroke: url(#gold); stroke-width: 3.2; }
.door-leaf .leaf-knob { fill: url(#gold); }
.door-leaf .num {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(22px, 5.6vw, 40px);
  line-height: 1;
  color: var(--gold-soft);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 0 14px rgba(255, 215, 130, .35);
  pointer-events: none;
}
.door-leaf .lock {
  position: absolute;
  left: 50%;
  bottom: 13%;
  width: 16%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  fill: none;
  stroke: rgba(247, 223, 164, .7);
  stroke-width: 2;
  stroke-linecap: round;
  display: none;
}

.door.v1 { --door: var(--door-1); }
.door.v2 { --door: var(--door-2); }
.door.v3 { --door: var(--door-3); }
.door.v4 { --door: var(--door-4); }

.door.locked { cursor: default; }
.door.locked .door-leaf { filter: saturate(.45) brightness(.62); }
.door.locked .lock { display: block; }

.door:not(.locked):not(.is-open):hover .door-leaf { transform: rotateY(-14deg); }
.door.is-open .door-leaf { transform: rotateY(-74deg); }
.door.is-open .door-leaf .num, .door.is-open .door-leaf .lock { opacity: 0; transition: opacity .3s .15s; }

.door.today .door-leaf { animation: today-glow 2.4s ease-in-out infinite; }
@keyframes today-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 210, 120, .45)); }
  50% { filter: drop-shadow(0 0 18px rgba(255, 210, 120, .95)); }
}
.today-tag {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 3px 9px;
  border-radius: 99px;
  background: linear-gradient(180deg, #ffe7a6, #e8b85a);
  color: #3a250d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.door.special::before {
  content: "★";
  position: absolute;
  right: -2px;
  top: 14%;
  z-index: 2;
  font-size: 14px;
  color: #ffd77a;
  text-shadow: 0 0 8px rgba(255, 215, 120, .9);
  pointer-events: none;
}

.door.shake { animation: shake .45s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-1deg); }
  40% { transform: translateX(5px) rotate(1deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.footnote {
  max-width: 640px;
  margin: 22px auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  opacity: .85;
}

.skyline { text-align: center; padding: 0 16px 36px; color: rgba(184, 178, 216, .6); font-size: 13px; }

/* Kıvılcımlar */
.spark {
  position: fixed;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #ffe7a6;
  box-shadow: 0 0 10px 2px rgba(255, 210, 120, .8);
  pointer-events: none;
  z-index: 50;
}

/* ---------- Kart (dialog) ---------- */
dialog.card {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  overflow: hidden;
}
dialog.card[open] { display: flex; flex-direction: column; animation: pop .45s cubic-bezier(.2, 1.3, .4, 1); }
dialog.card::backdrop { background: rgba(4, 6, 22, .72); backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px 18px 22px;
  background:
    radial-gradient(circle at 15% 0%, rgba(232, 184, 90, .35), transparent 60%),
    linear-gradient(135deg, #142057, #2a1d5c);
  color: var(--ink);
  position: relative;
}
.card-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 10px;
  background: radial-gradient(circle at 6px -2px, transparent 6px, var(--paper) 6.5px) 0 0 / 12px 10px repeat-x;
}
.card-head > div { flex: 1; min-width: 0; }
.card-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  line-height: 1;
  color: var(--gold-soft);
}
.card-kicker { margin: 0 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.card-icon {
  flex: none;
  width: 58px;
  height: 58px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(232, 184, 90, .16);
  border: 1px solid rgba(232, 184, 90, .4);
  fill: none;
  stroke: var(--gold-soft);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card .close { flex: none; align-self: flex-start; }

.badge {
  margin: 14px 22px 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #2a1d5c, #142057);
  color: #ffe08a;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
}

.card-body { padding: 8px 22px 6px; overflow-y: auto; }
.block { padding: 14px 0; }
.block + .block { border-top: 1px dashed rgba(168, 114, 31, .35); }
.block h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--paper-gold);
  font-weight: 900;
}
.block p { margin: 0; line-height: 1.6; font-size: 16px; }
.soz blockquote {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 23px;
  line-height: 1.35;
  color: #231c3c;
}
.soz blockquote::before { content: "“"; color: var(--paper-gold); }
.soz blockquote::after { content: "”"; color: var(--paper-gold); }
.source { margin-top: 8px !important; font-size: 14px !important; color: var(--paper-muted); font-weight: 700; }
.source::before { content: "— "; }

.check { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 2px solid var(--paper-gold);
  display: grid; place-items: center;
  transition: background .2s, transform .2s;
}
.check-box svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5); transition: .25s cubic-bezier(.2, 1.5, .4, 1); }
.check input:checked + .check-box { background: #2c7d4f; border-color: #2c7d4f; }
.check input:checked + .check-box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check-box { outline: 3px solid rgba(44, 125, 79, .4); outline-offset: 2px; }
.check-label { font-weight: 800; font-size: 15px; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px 18px;
  border-top: 1px solid rgba(168, 114, 31, .2);
}
.nav-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(168, 114, 31, .4);
  background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
}
.nav-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--paper-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn:disabled { opacity: .3; cursor: default; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border: 0;
  border-radius: 99px;
  background: linear-gradient(135deg, #1a2a6c, #3a2470);
  color: #fff3cf;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(26, 42, 108, .3);
}
.share-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.settings .card-head h2 { font-size: 30px; }
.muted { color: var(--paper-muted); font-size: 14px !important; }
.segmented { display: flex; gap: 6px; margin-top: 12px; padding: 4px; border-radius: 14px; background: rgba(168, 114, 31, .12); }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 10px 6px; border-radius: 10px; text-align: center; font-size: 14px; font-weight: 800; cursor: pointer; color: var(--paper-muted); }
.segmented input:checked + span { background: #fff; color: var(--paper-ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.segmented input:focus-visible + span { outline: 2px solid var(--paper-gold); }
.ghost-btn { margin-top: 12px; padding: 10px 16px; border-radius: 12px; border: 1px solid #b4433f; background: transparent; color: #a33a36; font-weight: 800; cursor: pointer; }

/* ---------- Bildirim ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translate(-50%, 30px);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(16, 20, 60, .95);
  border: 1px solid rgba(232, 184, 90, .4);
  color: var(--gold-soft);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(5, 1fr); gap: 20px 10px; }
  .wall { padding: 22px 14px 16px; border-radius: 22px; }
  main { padding: 20px 10px 30px; }
  .moon-wrap { width: 64px; height: 64px; top: 16px; right: 14px; }
  .lantern.l1 { left: 30%; top: -4px; height: 62px; width: 30px; }
  .lantern.l2 { display: none; }
  .lantern.l3 { left: auto; right: 30%; top: -4px; height: 52px; width: 26px; }
  .mosque { width: 124%; margin-left: -12%; margin-top: 4px; }
  .hero { padding-top: 70px; }
  .today-tag { font-size: 9px; padding: 2px 6px; top: -9px; }
  .soz blockquote { font-size: 21px; }
  .card-head h2 { font-size: 30px; }
  .card-icon { width: 50px; height: 50px; padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.start-line { margin-top: 10px !important; font-weight: 700; color: var(--paper-ink) !important; }
.segmented label { display: flex; }
.segmented span { flex: 1; display: flex; align-items: center; justify-content: center; line-height: 1.25; }
