:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #02050a;
  --panel: rgba(12, 18, 31, 0.96);
  --panel-strong: rgba(14, 20, 35, 0.98);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f5f7ff;
  --muted: #9aa8c4;
  --accent: #7ac7ff;
  --accent-2: #7ee2c0;
  --accent-bad: #ff7d7d;
  --shadow: 0 28px 120px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #01040a 0%, #07101d 45%, #02040a 100%);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: clamp(0.9rem, 2vw, 1.5rem);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.027) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 95%);
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}

.aurora-blob--a {
  top: -12%;
  left: -8%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(122, 199, 255, 0.4), transparent 70%);
  animation: drift-a 26s ease-in-out infinite;
}

.aurora-blob--b {
  top: 8%;
  right: -10%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(126, 226, 192, 0.32), transparent 70%);
  animation: drift-b 32s ease-in-out infinite;
}

.aurora-blob--c {
  bottom: -18%;
  left: 30%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(93, 104, 255, 0.22), transparent 70%);
  animation: drift-c 38s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6%, 8%) scale(1.12); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-8%, 6%) scale(1.08); }
}

@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4%, -6%) scale(1.15); }
}

.dashboard-shell {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .aurora-blob {
    animation: none !important;
  }
}

.dashboard-shell {
  width: min(100%, 1220px);
  display: grid;
  gap: 1rem;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-card,
.summary-row > *,
.content-stack > * {
  animation: fade-up 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.summary-row > *:nth-child(1) { animation-delay: 60ms; }
.summary-row > *:nth-child(2) { animation-delay: 120ms; }
.summary-row > *:nth-child(3) { animation-delay: 180ms; }
.content-stack > *:nth-child(1) { animation-delay: 140ms; }
.content-stack > *:nth-child(2) { animation-delay: 200ms; }
.content-stack > *:nth-child(3) { animation-delay: 260ms; }

@media (prefers-reduced-motion: reduce) {
  .hero-card,
  .summary-row > *,
  .content-stack > * {
    animation: none;
  }
}

.hero-card,
.summary-card,
.card {
  background: linear-gradient(145deg, rgba(15, 22, 38, 0.985), rgba(8, 12, 24, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.3fr 0.75fr;
  gap: 1rem;
  padding: clamp(1.2rem, 2.3vw, 1.8rem);
  border-radius: 1.75rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,0.08), transparent 38%, rgba(122, 199, 255, 0.09));
  pointer-events: none;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -10%;
  bottom: -16%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(122, 199, 255, 0.24), transparent 70%);
  pointer-events: none;
}

.hero-copy,
.hero-side {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: grid;
  gap: 0.8rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.hero-status-line {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #b7c5dc;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-dot {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(126, 226, 192, 0.5);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(126, 226, 192, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(126, 226, 192, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 226, 192, 0); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(121, 196, 255, 0.12);
  border: 1px solid rgba(121, 196, 255, 0.18);
}

.hero-badge.subtle {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.hero-badge--brand {
  gap: 0.4rem;
  color: #d7f5d0;
  background: rgba(126, 226, 192, 0.12);
  border-color: rgba(126, 226, 192, 0.2);
}

.block-icon {
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.74rem;
  font-weight: 700;
  color: #91cfef;
}

h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.hero-accent {
  color: #b4ecff;
}

.lead {
  margin: 0;
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.98rem;
}

.hero-side {
  display: grid;
  gap: 0.8rem;
  align-content: start;
}

.player-meta {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
}

.player-label {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #90b8ff;
}

.player-value {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: #f7f9ff;
}

.player-note {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
  max-width: 18rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10rem;
  padding: 0.95rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 180ms ease, filter 180ms ease;
}

.status-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.status-pill[data-state='online'] {
  background: linear-gradient(135deg, #7beac7, #3acc8d);
  color: #041a12;
  box-shadow: 0 12px 28px rgba(58, 204, 141, 0.22), 0 0 0 0 rgba(58, 204, 141, 0.5);
  animation: glow-online 2.6s ease-in-out infinite;
}

.status-pill[data-state='offline'] {
  background: linear-gradient(135deg, #ff9188, #ff5f5f);
  color: #1d0e11;
  box-shadow: 0 12px 28px rgba(255, 95, 95, 0.22);
}

.status-pill[data-state='unknown'] {
  background: linear-gradient(135deg, #8ca1ff, #5d69ff);
  color: #0f1335;
  box-shadow: 0 12px 28px rgba(93, 104, 255, 0.22);
}

@keyframes glow-online {
  0%, 100% { box-shadow: 0 12px 28px rgba(58, 204, 141, 0.22), 0 0 0 0 rgba(58, 204, 141, 0.35); }
  50% { box-shadow: 0 12px 28px rgba(58, 204, 141, 0.3), 0 0 0 6px rgba(58, 204, 141, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .status-pill[data-state='online'] {
    animation: none;
  }
}

.hero-dot[data-state='offline'] {
  background: var(--accent-bad);
  animation: none;
  box-shadow: none;
}

.status-note {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.summary-card {
  display: grid;
  gap: 0.8rem;
  min-height: 8.4rem;
  padding: 1.15rem 1.2rem;
  border-radius: 1.35rem;
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease;
}

.summary-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(122, 199, 255, 0.12), transparent 70%);
  pointer-events: none;
}

.summary-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.summary-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(121, 196, 255, 0.12);
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(255,255,255,0));
  opacity: 0.9;
}

.summary-card:hover,
.outage-item:hover {
  transform: translateY(-2px);
  border-color: rgba(121, 196, 255, 0.24);
}

.summary-label,
.card h2 {
  margin: 0;
  font-size: 0.9rem;
  color: #9fb2e1;
}

.summary-value {
  margin: 0;
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f5f8ff;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.player-value {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.content-stack {
  display: grid;
  gap: 1rem;
}

.card {
  padding: 1.1rem;
  border-radius: 1.35rem;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(121, 196, 255, 0.2);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.section-title h2 {
  margin: 0;
  font-size: 1.03rem;
  letter-spacing: -0.01em;
}

.caption {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.chart-legend {
  display: flex;
  gap: 0.9rem;
  flex-shrink: 0;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 3px;
}

.legend-dot--online {
  background: #6be9c1;
  box-shadow: 0 0 8px rgba(107, 233, 193, 0.5);
}

.legend-dot--offline {
  background: #ff7d7d;
  box-shadow: 0 0 8px rgba(255, 125, 125, 0.5);
}

.chart-container {
  position: relative;
  min-height: 300px;
  border-radius: 1.15rem;
  background: linear-gradient(180deg, rgba(15, 21, 38, 0.95), rgba(7, 11, 24, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.chart-container canvas {
  border-radius: 0.8rem;
}

.chart-container.large {
  min-height: 360px;
}

.chart-tooltip {
  --arrow-shift: 0px;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  pointer-events: none;
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  background: rgba(8, 12, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px)) scale(0.94);
  transition: opacity 120ms ease, transform 120ms ease;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: calc(50% + var(--arrow-shift));
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateX(-50%) rotate(45deg);
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 18px)) scale(1);
}

.chart-tooltip-title {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: #f5f8ff;
}

.chart-tooltip-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.chart-live-marker {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.chart-live-marker-core,
.chart-live-marker-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.chart-live-marker-core {
  width: 8px;
  height: 8px;
  background: #7cdbff;
  box-shadow: 0 0 8px rgba(124, 219, 255, 0.7);
}

.chart-live-marker-ring {
  width: 8px;
  height: 8px;
  border: 1.5px solid #7cdbff;
  animation: live-marker-pulse 2.2s ease-out infinite;
}

.chart-live-marker[data-tone='offline'] .chart-live-marker-core {
  background: #ff7d7d;
  box-shadow: 0 0 8px rgba(255, 125, 125, 0.7);
}

.chart-live-marker[data-tone='offline'] .chart-live-marker-ring {
  border-color: #ff7d7d;
}

@keyframes live-marker-pulse {
  0% {
    width: 8px;
    height: 8px;
    opacity: 0.8;
  }
  100% {
    width: 28px;
    height: 28px;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chart-live-marker-ring {
    animation: none;
    opacity: 0;
  }
}

.outage-list {
  display: grid;
  gap: 0.8rem;
}

.outage-item {
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  transition: transform 180ms ease, border-color 180ms ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.outage-item:hover {
  border-color: rgba(122, 199, 255, 0.26);
}

.outage-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: #eef3ff;
}

.outage-item p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 0.7rem;
  }

  .dashboard-shell {
    gap: 0.8rem;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .summary-card,
  .card {
    border-radius: 1.2rem;
  }

  .chart-container {
    min-height: 240px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.6rem;
  }

  .lead {
    font-size: 0.94rem;
  }

  .status-pill {
    justify-content: center;
    width: 100%;
  }

  .summary-value {
    font-size: 1.9rem;
  }
}
