:root {
  --bg: #0b0f19;
  --panel: #111826;
  --border: rgba(255, 255, 255, 0.06);
  --text: #d5d9e6;
  --text-soft: #8d96ad;

  --cyan: #00f6ff;
  --cyan-soft: #00d7df;
  --cyan-dark: #007d8e;

  --red: #ff3366;
}

*, *::before, *::after { box-sizing: border-box; }
img, video { max-width: 100%; height: auto; display: block; }

body {
  margin: 0;
  font-family: Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

#bgGrid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

.header {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-badge {
  font-size: 12px;
  color: var(--text-soft);
}

.btn {
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.btn-primary {
  background: var(--cyan);
  color: #001013;
}

.btn-accent {
  background: var(--cyan-soft);
  color: #001013;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.btn-lg {
  padding: 14px 22px;
}

.btn-xl {
  padding: 18px 26px;
  font-size: 18px;
}

.hero {
  max-width: 1280px;
  margin: 20px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns:1fr;
  gap: 16px;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns:1.3fr .7fr;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.chart-flex {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.chart-area {
  flex: 1.8;
  position: relative;
  min-width: 0;
}

canvas {
  width: 100%;
  height: 540px;
  max-height: 680px;
  background: #0f1624;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.chart-info {
  position: absolute;
  top: 20px;
  left: 20px;
}

.info-box {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.info-label {
  font-size: 12px;
  color: var(--text-soft);
}

.info-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--cyan);
}

.earnings-panel {
  flex: 1;
  max-width: 280px;
  background: #141c2c;
  border-radius: 14px;
  border: 1px solid rgba(0, 246, 255, 0.18);
  padding: 14px;
  box-shadow: 0 10px 26px rgba(0, 246, 255, 0.15);
}

.earn-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
  text-align: center;
}

.earn-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 540px;
  overflow: hidden;
}

.earn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(10px);
  animation: earnShow .35s forwards ease-out;
}

.earn-avatar {
  object-fit: cover;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 246, 255, 0.3);
}

.earn-text {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

@keyframes earnShow {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpis {
  margin-top: 16px;
  display: grid;
  grid-template-columns:repeat(3, 1fr);
  gap: 12px;
}

.kpi {
  background: #141c2c;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px;
  text-align: center;
}

.kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--cyan);
}

.pulse {
  animation: pulseKPI 3s ease-in-out infinite;
}

@keyframes pulseKPI {
  0% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
  }
}

@media (max-width: 860px) {
  .chart-flex {
    flex-direction: column;
  }

  .earnings-panel {
    max-width: none;
    width: 100%;
  }

  canvas {
    height: 420px;
  }
}

@media (max-width: 600px) {
  .hero { padding: 0 12px; }

  .header { flex-direction: column; align-items: stretch; }
  .header-cta { width: 100%; }

  .panel { padding: 12px; }
  .btn { padding: 10px 14px; }
  .btn-xl { padding: 14px 18px; font-size: 16px; }

  .kpis { grid-template-columns: repeat(2, 1fr); }
  canvas { height: 360px; }

  .panel-head { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip { max-width: 100%; word-break: break-word; }

  .video-frame { width: 100%; }
  .video-frame video { width: 100%; height: auto; border-radius: 12px; }
}

@media (max-width: 400px) {
  .kpis { grid-template-columns: 1fr; }
  canvas { height: 320px; }
}
