/* ============================================================
   DEDEKTIF.IO  —  Terminal Teması
   Saf CSS, bağımlılık yok. Renkler ve fontlar buradan yönetilir.
   ============================================================ */

/* ---- 1. Değişkenler ---------------------------------------- */
:root {
  --bg:          #080a09;   /* arka plan — hafif yeşilimsi siyah */
  --bg-soft:     #0c0f0d;
  --green:       #36ff7a;   /* ana yazı — neon değil, dengeli yeşil */
  --green-soft:  #8affb0;   /* dedektif konuşması — yumuşak ton */
  --green-dim:   #2f9e54;   /* ikincil / prompt / kenarlık */
  --green-deep:  #123c22;
  --white:       #f2f5f2;   /* vurgu / açıklama metni */
  --amber:       #ffc04d;   /* linkler */
  --red:         #ff6b6b;   /* hata */
  --cyan:        #54e6ec;   /* başlık / numara / sorular */
  --font: "Fira Code", "Source Code Pro", "Courier New", Courier, monospace;
  --glow: 0 0 1.5px rgba(54, 255, 122, 0.30);   /* ince, keskin parıltı */
}

/* ---- 2. Reset & temel -------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--green);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  text-shadow: var(--glow);
  overflow: hidden;            /* kaydırmayı terminal yönetir */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(0, 255, 65, 0.18);
  overscroll-behavior: none;          /* sayfa zıplaması / pull-to-refresh kapalı */
}

/* ---- 3. CRT / tarama çizgisi efekti ------------------------ */
.crt {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;        /* tıklamalar alttan geçer */
  background:
    radial-gradient(ellipse at center,
      rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%),
    repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.22) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
}

/* ---- 4. Terminal düzeni ------------------------------------ */
.terminal {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;              /* mobil dinamik viewport */
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;        /* kaydırma terminal içinde kalsın */
  -webkit-overflow-scrolling: touch;   /* iOS akıcı kaydırma */
}

/* ---- 5. Çıktı satırları ------------------------------------ */
.line {
  white-space: pre-wrap;       /* boşluk/girintileri korur */
  word-break: break-word;
  min-height: 1.6em;
}
.line.sys   { color: var(--green); }
.line.user  { color: var(--green-dim); }
.line.ask   { color: var(--cyan); font-weight: 600; letter-spacing: 0.3px; }
.line.voice { color: var(--green-soft); }            /* dedektifin konuşması */
.line.ok    { color: var(--green); font-weight: 500; }
.line.warn  { color: var(--amber); }
.line.err   { color: var(--red); }
.line.head  { color: var(--cyan); font-weight: 600; }
.line.dim   { color: var(--green-dim); opacity: 0.9; }
.line.spacer { min-height: 0.8em; }

/* ASCII başlık afişi */
.banner {
  color: var(--green);
  white-space: pre;
  overflow-x: auto;
  line-height: 1.25;
  margin: 4px 0 12px;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.6);
}

/* ---- 6. Hediye kartları ------------------------------------ */
.gift {
  margin: 14px 0;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--green-dim);
}
.gift .g-head { color: var(--green); font-weight: 600; }
.gift .g-num  { color: var(--cyan); }
.gift .g-emoji { text-shadow: none; }
.gift .g-desc {
  display: block;
  color: var(--white);
  margin: 4px 0;
  white-space: pre-wrap;
}
.gift .g-meta { color: var(--green-dim); font-size: 0.92em; }
.gift .g-link { margin-top: 4px; }
.gift .g-link a {
  display: inline-block;
  padding: 6px 6px 6px 0;              /* parmak dostu dokunma alanı */
  touch-action: manipulation;
}

/* ---- 6b. Paylaşım bağlantıları ----------------------------- */
.share-row { margin: 6px 0 2px; }
.share-row .share-link {
  display: inline-block;
  margin: 5px 12px 5px 0;
  padding: 8px 13px;
  color: var(--cyan);
  border: 1px solid var(--green-dim);
  border-radius: 4px;
  text-shadow: none;
  touch-action: manipulation;
}
.share-row .share-link:hover,
.share-row .share-link:focus {
  background: rgba(84, 230, 236, 0.12);
  border-color: var(--cyan);
}

/* ---- 7. İlerleme çubuğu ------------------------------------ */
.progress {
  color: var(--green);
  white-space: pre;
  letter-spacing: 1px;
}

/* ---- 8. Yanıp sönen imleç ---------------------------------- */
.cursor {
  display: inline-block;
  color: var(--green);
  animation: blink 1.05s steps(1, end) infinite;
}
@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ---- 9. Giriş satırı --------------------------------------- */
.input-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 255, 65, 0.18);
}
.input-line[hidden] { display: none; }

.prompt {
  color: var(--green-dim);
  white-space: nowrap;
  flex: 0 0 auto;
}

.cmd-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--green);
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  text-shadow: var(--glow);
  caret-color: var(--green);
  touch-action: manipulation;          /* dokunma gecikmesini kaldır */
}
.cmd-input::placeholder { color: var(--green-deep); }
.cmd-input:disabled { opacity: 0.4; }

/* ---- 10. Linkler & seçim ----------------------------------- */
a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 176, 0, 0.5);
}
a:hover, a:focus {
  background: rgba(255, 176, 0, 0.14);
  border-bottom-style: solid;
}
::selection { background: var(--green); color: var(--bg); text-shadow: none; }

/* ---- 11. Kaydırma çubuğu ----------------------------------- */
.screen::-webkit-scrollbar { width: 8px; }
.screen::-webkit-scrollbar-track { background: var(--bg-soft); }
.screen::-webkit-scrollbar-thumb {
  background: var(--green-deep);
  border-radius: 0;
}
.screen::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }
.screen { scrollbar-width: thin; scrollbar-color: var(--green-deep) var(--bg-soft); }

/* ---- 12. Responsive (mobil uyum) --------------------------- */
@media (max-width: 600px) {
  body { font-size: 14px; }
  .terminal { padding: 10px; }
  .banner { font-size: 11px; }
  /* iOS: 16px altı bir input'a odaklanınca ekranı zoom'lar — engelle */
  .cmd-input { font-size: 16px; }
  /* tarama çizgisi efektini küçük / yüksek-DPI ekranlarda hafiflet */
  .crt { opacity: 0.5; }
  /* daha geniş dokunma alanı */
  .gift .g-link a { padding: 9px 9px 9px 0; }
}
@media (max-width: 380px) {
  body { font-size: 12.5px; }
  .banner { font-size: 9px; }
  .terminal { padding: 8px; }
}
/* Alçak ekran: yatay mod ya da mobil klavye açıkken */
@media (max-height: 520px) {
  .banner { font-size: 9px; margin: 2px 0 6px; }
  .terminal { padding: 8px; }
}

/* ---- 13. Hareket azaltma tercihi --------------------------- */
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; opacity: 1; }
  .screen { scroll-behavior: auto; }
}
