:root {
  --bg: #0a0e1a;
  --bg-soft: #111726;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #f3f5fb;
  --text-dim: #9aa4bd;
  --text-faint: #626c86;
  --accent: #6366f1;
  --accent-cyan: #22d3ee;
  --accent-purple: #a855f7;
  --track: rgba(255, 255, 255, 0.07);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --card: rgba(20, 24, 40, 0.03);
  --card-border: rgba(20, 24, 40, 0.08);
  --text: #131a2b;
  --text-dim: #5a6480;
  --text-faint: #98a1b8;
  --track: rgba(20, 24, 40, 0.08);
  --shadow: 0 20px 60px rgba(80, 90, 130, 0.18);
}

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

html, body { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Background orbs */
.bg-orbs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35; }
.orb-1 { width: 460px; height: 460px; background: #22d3ee; top: -140px; left: -120px; }
.orb-2 { width: 520px; height: 520px; background: #a855f7; bottom: -180px; right: -140px; }
.orb-3 { width: 380px; height: 380px; background: #6366f1; top: 40%; left: 55%; opacity: 0.22; }
:root[data-theme="light"] .orb { opacity: 0.22; }

/* Topbar */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
  max-width: 900px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  font-size: 22px;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.6));
}
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.brand-name span {
  background: linear-gradient(120deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.theme-toggle {
  background: var(--card); border: 1px solid var(--card-border);
  color: var(--text); width: 42px; height: 42px; border-radius: 12px;
  font-size: 18px; cursor: pointer; transition: transform 0.2s, background 0.2s;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(-8deg); }

/* App layout */
.app {
  position: relative; z-index: 2;
  flex: 1;
  width: 100%; max-width: 900px; margin: 0 auto;
  padding: 10px 24px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 34px;
}

/* Gauge */
.stage { display: flex; justify-content: center; margin-top: 8px; }
.gauge-wrap { position: relative; width: 340px; height: 340px; }
.gauge { width: 100%; height: 100%; transform: rotate(0deg); }
.gauge-track {
  fill: none; stroke: var(--track); stroke-width: 16; stroke-linecap: round;
}
.gauge-progress {
  fill: none; stroke: url(#arcGrad); stroke-width: 16; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
  transition: stroke-dashoffset 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding-bottom: 6px;
}
.gauge-phase {
  font-size: 12px; letter-spacing: 3px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase;
}
.gauge-value-row { display: flex; align-items: baseline; gap: 6px; }
.gauge-value {
  font-size: 58px; font-weight: 750; letter-spacing: -2px;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.gauge-unit { font-size: 15px; color: var(--text-dim); font-weight: 600; }

.start-btn {
  margin-top: 16px;
  background: linear-gradient(120deg, var(--accent-cyan), var(--accent), var(--accent-purple));
  background-size: 200% 200%;
  border: none; color: #fff; font-weight: 700; letter-spacing: 1px;
  font-size: 13px; padding: 13px 30px; border-radius: 40px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45);
  transition: transform 0.18s, box-shadow 0.18s, opacity 0.2s;
  animation: gradShift 5s ease infinite;
}
@keyframes gradShift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.start-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 14px 38px rgba(99, 102, 241, 0.6); }
.start-btn:active { transform: translateY(0) scale(0.99); }
.start-btn:disabled { opacity: 0; pointer-events: none; }

/* Cards */
.cards {
  width: 100%;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 18px; padding: 18px 16px;
  display: flex; align-items: center; gap: 13px;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.card.active {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.25), 0 12px 30px rgba(99,102,241,0.18);
  transform: translateY(-3px);
}
.card-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px; font-weight: 800;
  background: rgba(255,255,255,0.06);
}
.card-icon.down { color: var(--accent-cyan); background: rgba(34,211,238,0.12); }
.card-icon.up { color: var(--accent-purple); background: rgba(168,85,247,0.12); }
.card-label { font-size: 12px; color: var(--text-dim); font-weight: 600; letter-spacing: 0.4px; }
.card-value { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.card-value small { font-size: 12px; color: var(--text-faint); font-weight: 600; margin-left: 3px; }

/* Meta */
.meta {
  width: 100%;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 16px; padding: 14px 20px;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 18px;
  backdrop-filter: blur(12px);
}
.meta-item { display: flex; align-items: center; gap: 8px; }
.meta-key { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.meta-val { font-size: 13px; color: var(--text); font-weight: 600; }
.meta-sep { width: 1px; height: 16px; background: var(--card-border); }

/* Reklam alanı */
.ad-slot {
  width: 100%;
  min-height: 90px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.ad-label {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-faint); font-weight: 700;
  align-self: flex-start;
}
.ad-slot .adsbygoogle { width: 100%; display: block; }
/* Reklam gelmezse boş kutu görünmesin */
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }

/* Footer */
.footer {
  position: relative; z-index: 2;
  text-align: center; padding: 18px; font-size: 12px; color: var(--text-faint);
}

/* Responsive */
@media (max-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .gauge-wrap { width: 290px; height: 290px; }
  .gauge-value { font-size: 48px; }
  .meta-sep { display: none; }
  .meta { gap: 6px 14px; }
}
@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
}
