:root {
  --black: #050505;
  --soft-black: #0b0d10;
  --panel: rgba(15, 17, 20, 0.88);
  --panel-2: rgba(255, 255, 255, 0.07);
  --yellow: #fcdc04;
  --red: #d90000;
  --white: #f8fafc;
  --muted: #aab1bf;
  --line: rgba(255, 255, 255, 0.14);
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(252, 220, 4, 0.18), transparent 25%),
    radial-gradient(circle at 84% 30%, rgba(217, 0, 0, 0.19), transparent 28%),
    linear-gradient(135deg, #020202 0%, #080a0e 46%, #161004 100%);
  color: var(--white);
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

/*
  OBS/Cloudflare fit fix:
  The dashboard is designed on a slightly larger internal canvas and scaled
  down to the viewport. This makes the page look like browser zoom at 80%,
  but keeps OBS/browser zoom at the normal 100% setting.
*/
.stage {
  --fit-scale: 0.8;
  position: relative;
  flex: 0 0 auto;
  width: min(125vw, 222.2222vh);
  height: min(70.3125vw, 125vh);
  transform: scale(var(--fit-scale));
  transform-origin: center center;
  padding: 28px 30px 20px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 74%);
  pointer-events: none;
}

.flag-strip {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 10px;
}

.flag-strip span.black { background: #000; }
.flag-strip span.yellow { background: var(--yellow); }
.flag-strip span.red { background: var(--red); }

.hero,
.grid,
.source-panel,
.ticker-wrap {
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 26px;
  min-height: 0;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  color: var(--yellow);
  font-size: clamp(13px, 1vw, 17px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  margin: 0 0 6px;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 4vw, 74px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  text-shadow: 0 10px 32px rgba(0,0,0,.45);
}

.subtitle {
  font-size: clamp(14px, 1.15vw, 20px);
  color: var(--muted);
  margin: 10px 0 0;
  max-width: 800px;
}

.clock-panel {
  min-width: 260px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: var(--shadow);
  text-align: right;
  flex-shrink: 0;
}

.clock {
  font-size: clamp(28px, 2.3vw, 42px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--yellow);
}

.date,
.review {
  font-size: clamp(12px, 0.9vw, 15px);
  color: var(--muted);
  margin-top: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 14px;
  min-height: 0;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03)),
    var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  min-height: 0;
}

.card::after {
  content: "";
  position: absolute;
  right: -96px;
  top: -96px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(252, 220, 4, 0.11);
  filter: blur(2px);
}

.main-card {
  grid-column: 1 / span 2;
  grid-row: 1;
  background:
    linear-gradient(135deg, rgba(252, 220, 4, 0.18), rgba(0, 0, 0, 0.1) 48%, rgba(217, 0, 0, 0.18)),
    var(--panel);
}

.ratio-card {
  grid-column: 3 / span 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr 190px;
  align-items: center;
  gap: 12px;
}

.small-card:nth-of-type(3) { grid-column: 1; grid-row: 2; }
.small-card:nth-of-type(4) { grid-column: 2; grid-row: 2; }
.small-card:nth-of-type(5) { grid-column: 3; grid-row: 2; }
.small-card:nth-of-type(6) { grid-column: 4; grid-row: 2; }

.card-topline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 18px rgba(217,0,0,0.8);
}

.label {
  display: block;
  font-size: clamp(13px, 1vw, 17px);
  letter-spacing: 0.08em;
  color: #dfe5ee;
  text-transform: uppercase;
  font-weight: 850;
}

.value-row {
  margin-top: 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.currency {
  font-size: clamp(20px, 1.7vw, 28px);
  font-weight: 900;
  color: var(--yellow);
}

.big-number {
  font-size: clamp(60px, 6.4vw, 116px);
  line-height: 0.82;
  font-weight: 950;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: visible;
}

.scale {
  font-size: clamp(18px, 1.35vw, 22px);
  font-weight: 900;
  color: var(--yellow);
  letter-spacing: 0.06em;
}

.metric {
  font-size: clamp(32px, 3.2vw, 58px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.06em;
  margin-top: 24px;
  font-variant-numeric: tabular-nums;
}

.unit {
  display: block;
  margin-top: 10px;
  color: var(--yellow);
  font-size: clamp(12px, 0.95vw, 15px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.note {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  color: var(--muted);
  font-size: clamp(11px, 0.9vw, 14px);
  line-height: 1.35;
  margin: 0;
}

.yellow-card {
  background:
    linear-gradient(135deg, rgba(252, 220, 4, 0.9), rgba(252, 220, 4, 0.58)),
    #0a0a0a;
  color: #050505;
}

.yellow-card .label,
.yellow-card .unit,
.yellow-card .note {
  color: #080808;
}

.donut-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
}

.donut {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(var(--red) 0deg, var(--red) 210deg, rgba(255,255,255,0.12) 210deg, rgba(255,255,255,0.12) 360deg);
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 34px rgba(0,0,0,0.28);
}

.donut::before {
  content: "";
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: #0b0d10;
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: clamp(28px, 2.2vw, 36px);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.source-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
}

.source-panel > div {
  border: 1px solid var(--line);
  background: rgba(0,0,0,.38);
  border-radius: 16px;
  padding: 12px 16px;
  font-size: clamp(11px, 0.9vw, 14px);
  line-height: 1.35;
  color: var(--muted);
}

.source-panel strong {
  color: var(--yellow);
  margin-right: 8px;
}

.ticker-wrap {
  height: 52px;
  overflow: hidden;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, #000, #1b1b1b 45%, #000);
  border-top: 4px solid var(--red);
  border-radius: 0 0 18px 18px;
}

.ticker {
  white-space: nowrap;
  display: inline-block;
  min-width: 100%;
  padding-left: 100%;
  font-size: clamp(17px, 1.35vw, 24px);
  font-weight: 900;
  color: var(--yellow);
  animation: ticker-scroll 44s linear infinite;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@media (max-width: 1200px) {
  .stage {
    padding: 22px 22px 14px;
    gap: 10px;
  }

  .hero {
    gap: 18px;
  }

  .grid {
    gap: 10px;
  }

  .card {
    padding: 18px;
    border-radius: 20px;
  }

  .ratio-card {
    grid-template-columns: 1fr 148px;
  }

  .donut {
    width: 144px;
    height: 144px;
  }

  .donut::before {
    width: 92px;
    height: 92px;
  }

  .note {
    left: 18px;
    right: 18px;
    bottom: 14px;
  }

  .clock-panel {
    min-width: 220px;
  }
}

.data-error {
  position: absolute;
  z-index: 10;
  left: 28px;
  right: 28px;
  top: 22px;
  padding: 12px 16px;
  border: 1px solid rgba(217, 0, 0, 0.65);
  border-radius: 14px;
  background: rgba(20, 0, 0, 0.92);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 16px 42px rgba(0,0,0,.45);
}

@supports (height: 100dvh) {
  html,
  body {
    height: 100dvh;
  }
}


/* Fit and readability refinements for long values */
.grid,
.card,
.metric,
.big-number,
.label,
.unit,
.note {
  min-width: 0;
}

.metric {
  white-space: nowrap;
}

#card-3 .metric {
  font-size: clamp(30px, 2.7vw, 52px);
  letter-spacing: -0.045em;
}

#card-3 .label {
  font-size: clamp(12px, 0.88vw, 15px);
  letter-spacing: 0.055em;
}

#card-3 .unit {
  font-size: clamp(11px, 0.82vw, 14px);
}

#card-4 .label,
#card-6 .label {
  font-size: clamp(12px, 0.9vw, 15px);
}
