:root {
  --bg: #08090c;
  --panel: rgba(20, 21, 27, 0.82);
  --panel-strong: rgba(27, 28, 35, 0.94);
  --text: #f6f3ed;
  --muted: #a9a8b1;
  --line: rgba(255, 255, 255, 0.10);
  --accent: #d8b866;
  --accent-soft: rgba(216, 184, 102, 0.16);
  --success: #66d19e;
  --danger: #ff8585;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(
      circle at top left,
      rgba(90, 71, 160, 0.17),
      transparent 32%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(216, 184, 102, 0.10),
      transparent 30%
    ),
    var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.background-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.28;
}

.glow-one {
  top: -160px;
  right: 4%;
  background: #61499b;
}

.glow-two {
  bottom: -230px;
  left: -80px;
  background: #b2914f;
}

.shell {
  position: relative;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.04em;
}

h3 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.subtitle {
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.live-chip {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(102, 209, 158, 0.26);
  border-radius: 999px;
  background: rgba(102, 209, 158, 0.08);
  color: #bcefd5;
  font-size: 13px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px var(--success);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.controls {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr auto;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.controls label span {
  color: var(--muted);
  font-size: 12px;
}

select,
input {
  width: 100%;
  min-height: 47px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 13px;
}

select:focus,
input:focus {
  border-color: rgba(216, 184, 102, 0.7);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button {
  align-self: end;
  min-height: 47px;
  border: 0;
  border-radius: 12px;
  padding: 0 19px;
  cursor: pointer;
  background: var(--accent);
  color: #17140d;
  font-weight: 800;
  transition:
    transform 160ms ease,
    opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  min-height: 210px;
  padding: 32px;
  margin-bottom: 34px;
  background:
    linear-gradient(
      135deg,
      rgba(216, 184, 102, 0.09),
      transparent 48%
    ),
    var(--panel-strong);
}

.hero p {
  margin-bottom: 0;
  color: var(--muted);
}

.platform-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.platform-chip {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #d9d7df;
  font-size: 12px;
  text-transform: capitalize;
}

.section-heading,
.panel-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading {
  margin: 0 2px 18px;
}

.coverage-note,
.directional-label {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  min-height: 144px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.045),
      transparent
    ),
    var(--panel);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin-top: 14px;
  font-size: clamp(28px, 3.2vw, 43px);
  font-weight: 780;
  letter-spacing: -0.045em;
}

.metric-source {
  margin-top: 10px;
  color: #777783;
  font-size: 10px;
}

.two-column {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-bottom: 18px;
}

.two-column > .panel,
.content-panel {
  padding: 24px;
}

.platform-results,
.paid-results {
  display: grid;
  gap: 11px;
  margin-top: 22px;
}

.platform-row {
  display: grid;
  grid-template-columns: 1.1fr repeat(3, 0.75fr);
  gap: 10px;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.platform-name {
  font-weight: 750;
  text-transform: capitalize;
}

.platform-stat {
  text-align: right;
}

.platform-stat strong {
  display: block;
  font-size: 16px;
}

.platform-stat span {
  color: var(--muted);
  font-size: 10px;
}

.paid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.paid-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.paid-card span {
  color: var(--muted);
  font-size: 11px;
}

.paid-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.content-panel {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 22px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #8e8d98;
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

td {
  font-size: 13px;
}

.content-caption {
  max-width: 420px;
  color: #dedce3;
  line-height: 1.45;
}

.content-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.empty-state {
  margin: 0;
  padding: 24px 0;
  color: var(--muted);
  line-height: 1.6;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 180px;
  color: var(--muted);
}

.loader {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.error-box {
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 133, 133, 0.28);
  border-radius: 14px;
  background: rgba(255, 133, 133, 0.07);
  color: #ffc2c2;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 660px) {
  .shell {
    width: min(100% - 24px, 1440px);
    padding-top: 26px;
  }

  .topbar,
  .hero,
  .section-heading,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .platform-chips {
    justify-content: flex-start;
  }

  .platform-row {
    grid-template-columns: 1fr 1fr;
  }
}
