/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Design tokens — dark (default) ────────────────── */
:root {
  --bg:          #0a0a0a;
  --surface:     #1e1e1e;
  --surface-2:   #2a2a2a;
  --border:      #2e2e2e;
  --text:        #f0f0f0;
  --muted:       #888888;
  --accent:      #00ff88;
  --accent-dim:  rgba(0, 255, 136, 0.12);
  --btn-bg:      #1a1a1a;
  --btn-hover:   #222222;
  --btn-border:  #333333;
  --font:        'Space Mono', monospace;
}

/* ─── Design tokens — light ──────────────────────────── */
[data-theme="light"] {
  --bg:          #f4f4f4;
  --surface:     #e2e2e2;
  --surface-2:   #d8d8d8;
  --border:      #d0d0d0;
  --text:        #0a0a0a;
  --muted:       #666666;
  --accent:      #008f4c;   /* darker green for contrast on light bg */
  --accent-dim:  rgba(0, 143, 76, 0.1);
  --btn-bg:      #ebebeb;
  --btn-hover:   #e0e0e0;
  --btn-border:  #cccccc;
}

/* ─── Base ───────────────────────────────────────────── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ─── Scene (full viewport, centered) ───────────────── */
.scene {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

/* ─── Card container ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ─── Top row ────────────────────────────────────────── */
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tracker-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ─── Theme toggle button ────────────────────────────── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 0;
}

.theme-toggle:hover {
  color: var(--text);
  background: var(--surface);
}

/* Show moon in dark, sun in light */
[data-theme="dark"]  .icon-sun  { display: none; }
[data-theme="dark"]  .icon-moon { display: block; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: block; }

/* ─── Live badge ─────────────────────────────────────── */
.live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}

/* Pulsing dot */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6);
  animation: pulse 2s ease-out infinite;
  flex-shrink: 0;
}

[data-theme="light"] .live-dot {
  box-shadow: 0 0 0 0 rgba(0, 143, 76, 0.6);
}

.live-dot.demo {
  background: #e08800;
  box-shadow: 0 0 0 0 rgba(224, 136, 0, 0.6);
  animation: pulse-demo 2s ease-out infinite;
}

.live-text.demo {
  color: #e08800;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 255, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

@keyframes pulse-demo {
  0%   { box-shadow: 0 0 0 0 rgba(224, 136, 0, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(224, 136, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 136, 0, 0); }
}

/* ─── TPV number + percentage row ───────────────────── */
.tpv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  line-height: 1;
}

.tpv-number {
  font-size: clamp(24px, 5vw, 56px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.tpv-number.tick {
  color: var(--accent);
}

.tpv-pct {
  font-size: clamp(20px, 3vw, 32px);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* ─── Progress bar ───────────────────────────────────── */
.bar-track {
  width: 100%;
  height: 20px;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  border-radius: inherit;
}

/* ─── Projection line ────────────────────────────────── */
.projection {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.02em;
  line-height: 1.6;
  min-height: 22px;
}


/* ─── Share row ──────────────────────────────────────── */
.share-row {
  display: flex;
  align-items: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.1s ease;
  text-transform: uppercase;
}

.share-btn:hover {
  background: var(--btn-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.share-btn:active {
  transform: scale(0.97);
}

/* ─── Footer ─────────────────────────────────────────── */
.footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Row 1: copyright */
.footer-copy {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.footer-copy strong {
  font-weight: 700;
}

.footer-credit {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.footer-credit:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Row 2: icons + last updated */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


/* Icon cluster */
.footer-icons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0.55;
  transition: opacity 0.18s ease, color 0.18s ease;
  line-height: 0;
}

.footer-icon-link:hover {
  opacity: 1;
  color: var(--text);
}

.footer-icon-link svg path {
  fill: currentColor;
}

/* ─── Responsive / Mobile ────────────────────────────── */
@media (max-width: 600px) {
  .scene {
    align-items: center;        /* vertically center on mobile too */
    padding: 32px 20px;
  }

  .container {
    gap: 22px;
  }

  .tpv-row {
    gap: 8px;
  }

  .projection {
    font-size: 13px;
  }

  .share-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  /* Footer naturally stacks: copyright row, then icons+timestamp row */
  .footer {
    gap: 8px;
  }
}

