@font-face {
  font-family: 'Manrope';
  src: local('Manrope');
}

:root {
  --bg: #411217;
  --bg-deep: #2c0c10;
  --gold: #deb273;
  --gold-light: #f4cd96;
  --wine: #833141;
  --wine-light: #56181c;
  --bronze: #8c5a3c;
  --text: #f6e9d8;
  --text-muted: #c9a89a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(circle at 50% -10%, var(--wine-light) 0%, var(--bg) 45%, var(--bg-deep) 100%);
  color: var(--text);
  font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}

.stage {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  padding: 3.2vh 3.2vw;
}

.stage__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3vh;
}

.stage__title {
  font-size: 2.6vw;
  line-height: 1.15;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.01em;
}

.stage__title span {
  color: var(--gold);
}

.scoreboard {
  display: flex;
  align-items: baseline;
  gap: 0.6vw;
}

.scoreboard__number {
  font-size: 4.2vw;
  font-weight: 800;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(244, 205, 150, 0.35);
}

.scoreboard__label {
  font-size: 1.3vw;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.2vw;
}

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(222, 178, 115, 0.18);
  border-radius: 18px;
  padding: 1.8vh 1.4vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(6px);
}

.card__title {
  font-size: 1.35vw;
  font-weight: 700;
  text-align: center;
  margin: 0 0 1.2vh;
  color: var(--gold-light);
}

.card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  width: 100%;
  justify-content: center;
}

.donut {
  width: min(20vw, 32vh);
  height: min(20vw, 32vh);
}

.donut circle {
  transition: stroke-dasharray 0.8s ease, stroke-dashoffset 0.8s ease;
}

.legend {
  list-style: none;
  margin: 1.6vh 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55vh;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.55vw;
  font-size: 0.95vw;
}

.legend .dot {
  width: 0.85vw;
  height: 0.85vw;
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend .label {
  flex: 1;
  color: var(--text);
}

.legend .pct {
  font-weight: 700;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}

.megastat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6vh;
  text-align: center;
}

.megastat__value {
  font-size: 2.9vw;
  font-weight: 800;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(244, 205, 150, 0.3);
  line-height: 1.1;
}

.megastat__label {
  font-size: 1.05vw;
  font-weight: 600;
  color: var(--text-muted);
}

.card__footnote {
  margin: 1.2vh 0 0;
  font-size: 0.8vw;
  color: var(--text-muted);
  text-align: center;
}

.conn-indicator {
  position: fixed;
  bottom: 14px;
  right: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #6b6b6b;
  transition: background 0.3s ease;
}

.conn-indicator.online { background: #4ade80; }
.conn-indicator.offline { background: #ef4444; }

@media (max-width: 1000px) {
  html, body {
    overflow-y: auto;
    height: auto;
    min-height: 100%;
  }

  .stage {
    height: auto;
    min-height: 100vh;
    padding: 24px 16px;
  }

  .stage__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .stage__title {
    font-size: 1.8rem;
  }

  .scoreboard {
    align-self: stretch;
    justify-content: space-between;
  }

  .scoreboard__number {
    font-size: 2.4rem;
  }

  .scoreboard__label {
    font-size: 0.9rem;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 16px;
  }

  .card__title {
    font-size: 1.05rem;
  }

  .donut {
    width: min(60vw, 220px);
    height: min(60vw, 220px);
  }

  .legend li {
    font-size: 0.9rem;
  }

  .legend .dot {
    width: 10px;
    height: 10px;
  }

  .megastat__value {
    font-size: 2.1rem;
  }

  .megastat__label {
    font-size: 0.85rem;
  }

  .card__footnote {
    font-size: 0.75rem;
  }

  .conn-indicator {
    bottom: 10px;
    right: 10px;
  }
}
