/* AWN Cyclone Model Guidance — broadcast graphic.
   Authored against a fixed 1920x1080 stage. Everything is in px against that
   stage; #stage is scaled to fit whatever it's displayed on, so a 4K monitor,
   a 720p capture and a laptop preview all get identical geometry. */

:root {
  --ocean: #071426;
  --panel-bg: rgba(6, 16, 30, 0.82);
  --panel-edge: rgba(120, 170, 220, 0.28);
  --ink: #eaf2fb;
  --ink-dim: #93a7bd;
  --accent: #ff9f1c;
  --alert: #ff4d4d;
  --awn: #34a0e0;

  /* Broadcast safe area: 5% inset from each edge on a 1920x1080 canvas. */
  --safe-x: 96px;
  --safe-y: 54px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1920px;
  height: 1080px;
  transform-origin: center center;
  background: var(--ocean);
  overflow: hidden;
  color: var(--ink);
}

#map {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
}

/* ---------- shared panel chrome ---------- */

.panel {
  position: absolute;
  background: var(--panel-bg);
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  padding: 18px 24px;
  /* Broadcast legibility: everything sits on a dark plate with a hard edge. */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}

/* ---------- top-left identity ---------- */

#ident {
  left: var(--safe-x);
  top: var(--safe-y);
  min-width: 520px;
  padding: 20px 28px 22px;
}

.brand { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }

.brand-mark {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--awn);
}

.brand-sub {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--ink-dim);
}

#storm-name {
  font-size: 76px;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -1px;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.8);
}

#storm-class {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- top-right vitals ---------- */

#vitals {
  right: var(--safe-x);
  top: var(--safe-y);
  min-width: 340px;
  display: grid;
  gap: 14px;
}

.vital { display: flex; flex-direction: column; gap: 2px; }

.v-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.2px;
  color: var(--ink-dim);
}

.v-value {
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* ---------- bottom-left legend ---------- */

#legend {
  left: var(--safe-x);
  bottom: calc(var(--safe-y) + 78px);
  min-width: 400px;
  max-height: 470px;
  padding: 16px 24px 18px;
}

.legend-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--panel-edge);
}

.legend-group {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #6b8099;
  margin: 12px 0 6px;
}
.legend-group:first-child { margin-top: 0; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 0;
}

.swatch {
  width: 42px;
  height: 5px;
  border-radius: 3px;
  flex: none;
}

/* Dashed legend swatch: repeat the model's colour as segments. The colour comes
   from the inline `color` the renderer sets, so currentColor picks it up. */
.swatch.dashed {
  background: repeating-linear-gradient(
    90deg,
    currentColor 0 8px,
    transparent 8px 13px
  ) !important;
}

.legend-label { font-size: 21px; font-weight: 600; }

/* Marks a model running on an older cycle than the storm's newest. */
.legend-age {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 159, 28, 0.18);
  border: 1px solid rgba(255, 159, 28, 0.55);
  color: #ffc879;
  font-variant-numeric: tabular-nums;
}

/* The AI models get a subtle highlight — they're the point of this graphic. */
.legend-item.ai .legend-label { font-weight: 800; }

.legend-item.ai::after {
  content: "AI";
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(66, 133, 244, 0.22);
  border: 1px solid rgba(120, 170, 255, 0.5);
  color: #9dc2ff;
}

/* ---------- bottom-right cycle ---------- */

#cycle {
  right: var(--safe-x);
  bottom: calc(var(--safe-y) + 78px);
  text-align: right;
  min-width: 260px;
}

.cycle-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.2px;
  color: var(--ink-dim);
}

.cycle-value {
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ---------- footer ---------- */

#footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 78px;
  padding: 0 var(--safe-x);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.45));
  border-top: 2px solid var(--accent);
}

#disclaimer {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #ffd9a0;
}

#attribution {
  font-size: 13px;
  font-weight: 500;
  color: #7e8fa3;
  letter-spacing: 0.3px;
}

/* ---------- pager ---------- */

#pager {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--safe-y) + 90px);
  display: flex;
  gap: 10px;
}

.pip {
  width: 52px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  transition: background 240ms ease;
}
.pip.on { background: var(--accent); }

/* ---------- stale badge ---------- */

#stale {
  position: absolute;
  left: 50%;
  top: var(--safe-y);
  transform: translateX(-50%);
  background: var(--alert);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  padding: 8px 22px;
  border-radius: 6px;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------- quiet state ---------- */

body.quiet #vitals,
body.quiet #legend,
body.quiet #cycle,
body.quiet #pager { display: none; }

body.quiet #storm-name { font-size: 58px; }
