/* ============================================================
   GölgeAğ - Amber CRT Terminal Teması
   Palet: gece mürekkebi + fosfor amber + soğuk cam göbeği
============================================================ */
:root {
  --bg:        #0d1017;
  --bg-soft:   #131824;
  --panel:     #171e2e;
  --panel-hi:  #1d2639;
  --line:      #2a3550;
  --amber:     #ffb454;
  --amber-dim: #b57e3a;
  --cyan:      #59c2ff;
  --text:      #cdd6e4;
  --muted:     #6b7894;
  --danger:    #ff6666;
  --success:   #7fd962;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-disp: 'Oxanium', var(--font-mono);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

/* --- İmza: CRT tarama çizgisi katmanı --- */
.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.13) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
@media (prefers-reduced-motion: no-preference) {
  .crt::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(255,180,84,0.035) 50%, transparent 100%);
    background-size: 100% 220px;
    animation: crt-sweep 9s linear infinite;
  }
  @keyframes crt-sweep { from { background-position-y: -220px; } to { background-position-y: 100vh; } }
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ============ ÜST BAR ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand {
  font-family: var(--font-disp); font-weight: 800; font-size: 20px;
  letter-spacing: 2px; color: var(--text);
  text-shadow: 0 0 14px rgba(255,180,84,0.35);
}
.brand span { color: var(--amber); }
.hud { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hud-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; white-space: nowrap;
}
.hud-item b { color: var(--amber); }
.hud-item.rank { color: var(--cyan); border-color: rgba(89,194,255,0.35); }
.hud-item.logout { color: var(--danger); }

/* ============ NAV ============ */
.mainnav {
  display: flex; gap: 2px; padding: 0 14px;
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.mainnav a {
  padding: 10px 14px; color: var(--muted); font-size: 13px; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.mainnav a:hover { color: var(--text); text-decoration: none; }
.mainnav a.active { color: var(--amber); border-bottom-color: var(--amber); }
.nav-icon { margin-right: 6px; }

/* ============ SÜREÇ ÇUBUĞU ============ */
.process-bar {
  position: sticky; top: 0; z-index: 50;
  background: var(--panel-hi); border-bottom: 1px solid var(--amber-dim);
  padding: 8px 18px;
}
.process-bar.hidden { display: none; }
.process-info { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.process-info #process-timer { color: var(--amber); font-weight: 700; }
.process-track { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.process-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--amber-dim), var(--amber));
  box-shadow: 0 0 10px rgba(255,180,84,0.6);
  transition: width 1s linear;
}

/* ============ İÇERİK ============ */
.container { max-width: 1080px; margin: 0 auto; padding: 22px 16px 90px; }
.page-title {
  font-family: var(--font-disp); font-size: 22px; font-weight: 800;
  color: var(--amber); letter-spacing: 1px; margin-bottom: 6px;
  text-shadow: 0 0 18px rgba(255,180,84,0.25);
}
.page-desc { color: var(--muted); margin-bottom: 20px; font-size: 13px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 16px;
}
.card h2 { font-family: var(--font-disp); font-size: 15px; color: var(--text); margin-bottom: 12px; }
.card h3 { font-family: var(--font-disp); font-size: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.stat-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.stat-row {
  display: flex; justify-content: space-between; font-size: 13px;
  padding: 5px 0; border-bottom: 1px dashed var(--line);
}
.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--muted); }

.accent { color: var(--amber); }
.cyan { color: var(--cyan); }
.warn { color: #e6c07b; }
.danger-text { color: var(--danger); }
.muted { color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); font-style: italic; padding: 10px 0; }

/* ============ BUTONLAR ============ */
.btn {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  background: var(--panel-hi); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 16px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover:not(:disabled) { border-color: var(--amber-dim); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, rgba(255,180,84,0.16), rgba(255,180,84,0.06));
  border-color: var(--amber-dim); color: var(--amber);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 14px rgba(255,180,84,0.25); }
.btn.danger { border-color: rgba(255,102,102,0.45); color: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.full { width: 100%; display: block; margin-top: 10px; }

/* ============ DONANIM / YAZILIM / GÖREV KARTLARI ============ */
.hw-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.hw-level { color: var(--amber); font-weight: 700; font-size: 13px; }
.hw-desc { color: var(--muted); font-size: 12px; margin-bottom: 10px; min-height: 32px; }
.bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--amber-dim), var(--amber)); }
.bar-fill.danger { background: linear-gradient(90deg, #a33, var(--danger)); }
.ram-meter { margin-bottom: 20px; }

.mission-card.ready { border-color: var(--amber-dim); box-shadow: 0 0 16px rgba(255,180,84,0.12); }
.mission-card.claimed { opacity: 0.55; }
.mission-reward { font-size: 13px; color: var(--cyan); margin: 8px 0 4px; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
}
.badge.ready { color: var(--amber); border-color: var(--amber-dim); }
.badge.done { color: var(--success); border-color: rgba(127,217,98,0.4); }

/* ============ AĞ (HEDEFLER) ============ */
.tier-head {
  font-family: var(--font-disp); font-size: 13px; color: var(--cyan);
  letter-spacing: 1.5px; margin: 22px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.target-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; margin-bottom: 8px;
}
.target-row.scanned { border-left: 3px solid var(--amber); }
.target-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.target-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.target-meta { font-size: 11px; color: var(--muted); }
.target-actions { display: flex; gap: 6px; flex-shrink: 0; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 16px; cursor: pointer;
}
.tab.active { color: var(--amber); border-color: var(--amber-dim); background: var(--panel); }
.tab-panel.hidden { display: none; }

/* ============ BANKA ============ */
.input-row { display: flex; gap: 8px; margin-bottom: 8px; }
.input-row input, .auth-box input {
  flex: 1; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 9px 12px; font-family: var(--font-mono); font-size: 13px;
}
.input-row input:focus, .auth-box input:focus { border-color: var(--amber-dim); outline: none; }

/* ============ SIRALAMA ============ */
.board { list-style: none; }
.board li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.board li:last-child { border-bottom: none; }
.board li b { margin-left: auto; }
.board-pos {
  width: 24px; height: 24px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px;
  font-size: 11px; color: var(--muted);
}
.board li:nth-child(1) .board-pos { color: var(--amber); border-color: var(--amber-dim); }
.board li:nth-child(2) .board-pos { color: var(--cyan); }
.board li:nth-child(3) .board-pos { color: #e6c07b; }

/* ============ KAYITLAR ============ */
.log-list { list-style: none; }
.log-list li {
  padding: 6px 0; border-bottom: 1px dashed var(--line);
  font-size: 12px; word-break: break-word;
}
.log-list li:last-child { border-bottom: none; }
.log-time { color: var(--muted); margin-right: 8px; font-size: 11px; }

/* ============ RANK PROGRESS ============ */
.rank-progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 4px; }

/* ============ AUTH ============ */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-box {
  width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 32px 28px;
  box-shadow: 0 0 60px rgba(255,180,84,0.06);
}
.auth-logo {
  font-family: var(--font-disp); font-size: 30px; font-weight: 800;
  text-align: center; letter-spacing: 3px;
  text-shadow: 0 0 22px rgba(255,180,84,0.4);
}
.auth-logo span { color: var(--amber); }
.auth-sub { text-align: center; color: var(--muted); font-size: 12px; margin: 4px 0 22px; }
.auth-box label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.auth-box input { width: 100%; }
.auth-box .btn { margin-top: 20px; }
.auth-alt { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.alert.error {
  background: rgba(255,102,102,0.1); border: 1px solid rgba(255,102,102,0.4);
  color: var(--danger); border-radius: 6px; padding: 9px 12px; font-size: 12px; margin-bottom: 8px;
}

/* ============ TOAST ============ */
#toast-area {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--panel-hi); border: 1px solid var(--line); border-left: 3px solid var(--cyan);
  border-radius: 8px; padding: 11px 16px; font-size: 13px; max-width: 320px;
  opacity: 0; transform: translateX(20px); transition: all .3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* ============ FOOTER ============ */
.footer { text-align: center; color: var(--muted); font-size: 11px; padding: 20px; }

/* ============================================================
   v2.0 GENİŞLEME BİLEŞENLERİ
============================================================ */

/* --- Isı göstergesi (HUD) --- */
.heat-hud.ok     { color: var(--success); }
.heat-hud.cyan   { color: var(--cyan); }
.heat-hud.warn   { color: #e6c07b; border-color: rgba(230,192,123,0.4); }
.heat-hud.danger { color: var(--danger); border-color: rgba(255,102,102,0.5); animation: heat-pulse 1.4s infinite; }
@keyframes heat-pulse { 0%,100% { box-shadow: 0 0 0 rgba(255,102,102,0); } 50% { box-shadow: 0 0 12px rgba(255,102,102,0.5); } }

/* --- Isı kartı (panel) --- */
.heat-card.danger { border-color: rgba(255,102,102,0.45); }
.heat-card.warn   { border-color: rgba(230,192,123,0.4); }
.heat-gauge { height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); }
.heat-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0%, #e6c07b 45%, var(--danger) 80%);
  transition: width .4s ease;
}
.ok-text { color: var(--success); }
.cyan-text { color: var(--cyan); }

/* --- Günlük ödül afişi --- */
.daily-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-color: var(--amber-dim);
  background: linear-gradient(180deg, rgba(255,180,84,0.1), var(--panel));
}
.daily-banner span { display: block; }

/* --- Yetenek ağacı --- */
.points-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.points-banner .big { font-size: 26px; font-family: var(--font-disp); }
.skill-branch h2 { color: var(--cyan); }
.skill-node {
  background: var(--panel-hi); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
.skill-node.learned { border-color: var(--amber-dim); }
.skill-node.maxed { box-shadow: 0 0 14px rgba(255,180,84,0.15); }

/* --- Kara borsa eşyaları --- */
.item-card { text-align: center; }
.item-icon { font-size: 34px; margin-bottom: 6px; }
.item-card h3 { margin-bottom: 6px; }

/* --- Başarımlar --- */
.ach-card { text-align: center; }
.ach-icon { font-size: 32px; margin-bottom: 6px; }
.ach-card.locked { opacity: 0.5; }
.ach-card.unlocked { border-color: rgba(127,217,98,0.35); }

/* --- Kampanya --- */
.campaign-track { display: flex; flex-direction: column; gap: 0; margin-bottom: 20px; }
.campaign-stage {
  display: flex; gap: 14px; padding: 4px 0 18px; position: relative;
}
.campaign-stage:not(:last-child)::before {
  content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--line);
}
.campaign-stage.done:not(:last-child)::before { background: var(--amber-dim); }
.stage-marker {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 2px solid var(--line);
  font-family: var(--font-disp); font-weight: 800; font-size: 14px; z-index: 1;
}
.campaign-stage.done .stage-marker { border-color: var(--amber); color: var(--amber); }
.campaign-stage.current .stage-marker { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 14px rgba(89,194,255,0.35); }
.stage-body {
  flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
}
.campaign-stage.current .stage-body { border-color: rgba(89,194,255,0.35); }
.campaign-stage.locked .stage-body { opacity: 0.55; }
.stage-body h3 { font-family: var(--font-disp); margin-bottom: 6px; }
.stage-story { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.stage-story.done-text { color: var(--success); }
.stage-goal { font-size: 13px; color: var(--cyan); margin-bottom: 6px; }

/* ============ MOBİL ============ */
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .daily-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .topbar { padding: 8px 12px; }
  .hud { width: 100%; }
  .hud-item { font-size: 11px; padding: 3px 8px; }

  /* Alt tab bar (iOS safe area destekli, yatay kaydırılabilir) */
  .mainnav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    justify-content: flex-start;
    border-top: 1px solid var(--line); border-bottom: none;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--bg-soft);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 5px 10px; font-size: 10px; border-bottom: none; border-top: 2px solid transparent;
    flex-shrink: 0; min-width: 56px;
  }
  .mainnav a.active { border-top-color: var(--amber); border-bottom: none; }
  .nav-icon { margin-right: 0; font-size: 15px; }

  .container { padding-bottom: 110px; }
  .target-row { flex-direction: column; align-items: stretch; }
  .target-actions { justify-content: flex-end; }
  #toast-area { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}
