/* Identidade PlanetSat (azul #00afef, cinza #848688) em linguagem visual estilo Apple:
   tipografia do sistema, muito respiro, superfícies claras, cantos generosos.
   Sempre claro (identidade da marca), mesmo com o sistema em modo escuro.
   Sem estilos inline: o CSP do vhost só aceita style-src 'self'. */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --line: #e3e3e8;
  --track: #e8e8ed;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --brand: #00afef;
  --action: #0077b6;
  --action-hover: #00669c;
  --warn: #a35a00;
  --bad: #c9302c;
  --good: #1a7f37;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --glass: rgba(245, 245, 247, .72);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}


* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.47; }

/* ---------- cabeçalho translúcido ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.top-in {
  max-width: 980px; margin: 0 auto; padding: 8px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: block; height: 52px; width: auto; }
.tag { color: var(--muted); font-size: .85rem; letter-spacing: -.01em; }

main { max-width: 980px; margin: 0 auto; padding: 0 22px 40px; }

/* ---------- título ---------- */
.hero { text-align: center; padding: 56px 0 8px; }
.hero h1 {
  margin: 0; font-size: clamp(2rem, 6.2vw, 3.5rem); font-weight: 700;
  line-height: 1.07; letter-spacing: -.025em;
}
.lead { margin: 16px auto 0; max-width: 34ch; color: var(--muted); font-size: clamp(1.05rem, 2.4vw, 1.3rem); letter-spacing: -.01em; }

/* ---------- anel de progresso ---------- */
.stage { display: flex; flex-direction: column; align-items: center; padding: 40px 0 48px; }
.gauge { position: relative; width: min(300px, 78vw); aspect-ratio: 1; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 9; }
.gauge .track { stroke: var(--track); }
.gauge .fill {
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--p, 0) * 100);
  transition: stroke-dashoffset .25s linear;
}
.readout {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.readout p { margin: 0; }
.phase { color: var(--muted); font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.live {
  font-size: clamp(3rem, 15vw, 4.75rem); font-weight: 600; letter-spacing: -.04em;
  line-height: 1.05; font-variant-numeric: tabular-nums; margin: 2px 0 !important;
}
.unit { color: var(--muted); font-size: 1.05rem; font-weight: 500; min-height: 1.5em; }

button {
  margin-top: 36px;
  background: var(--action); color: #fff; border: 0; border-radius: 980px;
  padding: 14px 34px; font: inherit; font-size: 1.06rem; font-weight: 500; letter-spacing: -.01em;
  cursor: pointer; transition: background-color .2s, transform .1s;
}
button:hover { background: var(--action-hover); }
button:active { transform: scale(.98); }
button:disabled { opacity: .4; cursor: progress; }
button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.error { color: var(--bad); margin: 18px 0 0; text-align: center; }

/* ---------- resultados ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.cards article {
  background: var(--surface); border-radius: 20px; padding: 20px 22px;
  box-shadow: var(--shadow); border: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.cards .wide { grid-column: 1 / -1; }
.cards h2 { margin: 0 0 6px; font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: -.005em; }
.cards p { margin: 0; font-size: 2.1rem; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cards small { font-size: .95rem; color: var(--muted); margin-left: 5px; font-weight: 500; letter-spacing: 0; }
.cards .pair { display: flex; gap: 36px; font-size: 1.5rem; flex-wrap: wrap; }
.cards .pair b { font-weight: 600; }
.cards .hint { font-size: 1rem; font-weight: 500; margin-top: 8px; color: var(--muted); letter-spacing: -.01em; }
.cards .hint:empty { display: none; }
.hint.good { color: var(--good); } .hint.warn { color: var(--warn); } .hint.bad { color: var(--bad); }

/* cartão da fase em andamento */
body[data-phase="down"] article[data-k="down"],
body[data-phase="up"] article[data-k="up"],
body[data-phase="ping"] article[data-k="ping"] { border-color: var(--brand); }

.meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px;
  color: var(--muted); font-size: .9rem;
}
.meta span { background: var(--surface); border-radius: 980px; padding: 6px 14px; box-shadow: var(--shadow); }
.meta b { color: var(--text); font-weight: 600; margin-left: 4px; }

.site {
  text-align: center; color: var(--muted); font-size: .8rem;
  padding: 24px 22px calc(32px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 640px) {
  .hero { padding-top: 36px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cards article { padding: 16px 18px; border-radius: 18px; }
  .cards p { font-size: 1.7rem; }
  .tag { display: none; }
  .brand { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
