/* =============================================
   RETO 90 DÍAS — Editorial dashboard
   Type: Geist (system display) + Instrument Serif (italic accent)
   Color: warm-tinted near-black, lime primary, coral + cyan accents
   ============================================= */

:root {
  color-scheme: dark;

  /* Palette — warm-neutral */
  --bg:           oklch(0.14 0.012 60);
  --bg-2:         oklch(0.17 0.014 60);
  --surface:      oklch(0.20 0.012 60 / 0.62);
  --surface-2:    oklch(0.23 0.014 60 / 0.78);
  --surface-3:    oklch(0.98 0 0 / 0.045);
  --line:         oklch(0.98 0 0 / 0.10);
  --line-strong:  oklch(0.98 0 0 / 0.18);
  --text:         oklch(0.97 0.005 80);
  --text-soft:    oklch(0.97 0.005 80 / 0.70);
  --text-muted:   oklch(0.97 0.005 80 / 0.48);

  /* Accents — shared chroma/lightness, varying hue */
  --lime:    oklch(0.88 0.20 125);
  --lime-2:  oklch(0.78 0.21 135);
  --coral:   oklch(0.72 0.21 25);
  --coral-2: oklch(0.65 0.24 12);
  --cyan:    oklch(0.80 0.14 215);
  --cyan-2:  oklch(0.72 0.15 245);
  --warn:    oklch(0.78 0.18 65);

  /* Shadows */
  --shadow:        0 30px 80px -20px oklch(0 0 0 / 0.55), 0 4px 20px -4px oklch(0 0 0 / 0.4);
  --shadow-soft:   0 14px 40px -10px oklch(0 0 0 / 0.4);
  --shadow-inset:  inset 0 1px 0 oklch(1 0 0 / 0.06), inset 0 0 0 1px oklch(1 0 0 / 0.025);

  /* Radii */
  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;

  /* Type */
  --display: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --body:    "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  --serif:   "Instrument Serif", Georgia, serif;
  --mono:    "Geist Mono", "SF Mono", ui-monospace, Menlo, monospace;

  /* Easings */
  --ease-out:    cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg:           oklch(0.985 0.005 70);
  --bg-2:         oklch(0.965 0.006 70);
  --surface:      oklch(1 0 0 / 0.72);
  --surface-2:    oklch(1 0 0 / 0.92);
  --surface-3:    oklch(0.12 0.01 70 / 0.045);
  --line:         oklch(0.12 0.01 70 / 0.10);
  --line-strong:  oklch(0.12 0.01 70 / 0.18);
  --text:         oklch(0.16 0.012 70);
  --text-soft:    oklch(0.16 0.012 70 / 0.7);
  --text-muted:   oklch(0.16 0.012 70 / 0.45);

  --lime:    oklch(0.66 0.20 130);
  --lime-2:  oklch(0.58 0.21 140);
  --coral:   oklch(0.62 0.22 25);
  --coral-2: oklch(0.55 0.24 12);
  --cyan:    oklch(0.58 0.16 230);
  --cyan-2:  oklch(0.5 0.18 250);

  --shadow:      0 20px 60px -16px oklch(0.5 0.05 70 / 0.18), 0 4px 16px -4px oklch(0.5 0.05 70 / 0.1);
  --shadow-soft: 0 10px 30px -10px oklch(0.5 0.05 70 / 0.15);
  --shadow-inset: inset 0 1px 0 oklch(1 0 0 / 0.6), inset 0 0 0 1px oklch(0.12 0.01 70 / 0.04);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  font-feature-settings: "ss01", "ss02", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
  border-radius: 8px;
}

em.serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── AMBIENT AURORA + GRAIN ─────────────────── */
.aurora {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.aurora-blob {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.5;
  will-change: transform;
  animation: drift 26s ease-in-out infinite alternate;
}
.a1 { width: 46rem; height: 46rem; left: -14rem; top: -10rem; background: var(--lime); opacity: 0.18; }
.a2 { width: 40rem; height: 40rem; right: -12rem; top: 8rem; background: var(--coral); opacity: 0.20; animation-delay: -8s; }
.a3 { width: 50rem; height: 50rem; left: 30%; top: 50rem; background: var(--cyan); opacity: 0.14; animation-delay: -16s; }
[data-theme="light"] .a1 { opacity: 0.30; }
[data-theme="light"] .a2 { opacity: 0.28; }
[data-theme="light"] .a3 { opacity: 0.22; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(4rem, 2rem, 0) scale(1.08); }
  100% { transform: translate3d(-3rem, 4rem, 0) scale(0.96); }
}

.grain {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.07; mix-blend-mode: overlay;
  pointer-events: none;
}
[data-theme="light"] .grain { opacity: 0.05; mix-blend-mode: multiply; }

/* ── LAYOUT SHELL ───────────────────────────── */
.shell {
  position: relative; z-index: 1;
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 64px;
}

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 14px 18px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-inset), var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.wm-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--lime-2));
  color: #0a0a0a;
  box-shadow: 0 4px 20px -2px var(--lime), inset 0 1px 0 oklch(1 0 0 / 0.4);
}
.wm-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}
.wm-text em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.2em;
  margin-left: -2px;
}

.nav-links {
  display: flex; gap: 4px;
  justify-content: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color .2s var(--ease-out), background .2s var(--ease-out);
}
.nav-links a:hover { color: var(--text); background: var(--surface-3); }
.nav-links a.is-active { color: var(--text); background: var(--surface-3); }

.mobile-bottom-nav {
  display: none;
}

.control-cluster {
  display: flex; align-items: center; gap: 8px;
}
.sync-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 36px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 0.78rem;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.sync-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 var(--lime);
  animation: pulse 2.2s var(--ease-out) infinite;
}
.sync-time { color: var(--text-muted); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(from var(--lime) l c h / 0.5); }
  60%      { box-shadow: 0 0 0 8px oklch(from var(--lime) l c h / 0); }
}

.segmented {
  display: inline-flex; padding: 3px;
  background: var(--surface-3);
  border-radius: 999px;
  position: relative;
}
.segment {
  background: transparent; border: 0;
  padding: 6px 12px; min-width: 36px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-soft);
  border-radius: 999px;
  transition: color .2s var(--ease-out);
}
.segment.is-active {
  color: var(--bg);
  background: var(--text);
}

.theme-toggle {
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: var(--surface-3);
  display: grid; place-items: center;
  color: var(--text-soft);
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.theme-toggle:hover { background: var(--line); color: var(--text); }
.theme-toggle .ti { position: absolute; transition: opacity .25s var(--ease-out), transform .35s var(--ease-spring); }
.theme-toggle .ti-sun { opacity: 0; transform: rotate(-90deg) scale(0.6); }
[data-theme="light"] .theme-toggle .ti-moon { opacity: 0; transform: rotate(90deg) scale(0.6); }
[data-theme="light"] .theme-toggle .ti-sun { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle .ti-moon { opacity: 1; }

/* ── KICKER ─────────────────────────────────── */
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}
.kicker-pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}
.pip-coral { background: var(--coral); box-shadow: 0 0 10px var(--coral); }
.pip-cyan  { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.pip-lime  { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.pip-warn  { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

/* ── HERO ───────────────────────────────────── */
.hero {
  padding: clamp(28px, 5vw, 56px) clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background:
    linear-gradient(140deg, oklch(1 0 0 / 0.05), oklch(1 0 0 / 0.005)),
    var(--surface);
  box-shadow: var(--shadow), var(--shadow-inset);
  backdrop-filter: blur(36px) saturate(160%);
  -webkit-backdrop-filter: blur(36px) saturate(160%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: ""; position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, oklch(1 0 0 / 0.12), transparent 35%);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  position: relative;
  z-index: 1;
}

.display {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3rem, 9vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 700;
}
.display .line { display: block; }
.display .line-soft { color: var(--text-muted); font-weight: 600; }
.display em.serif { font-size: 1.05em; margin-right: 0.06em; }

.lede {
  max-width: 540px;
  margin: 22px 0 0;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.5;
  color: var(--text-soft);
  text-wrap: pretty;
}

/* Day strip */
.day-strip {
  margin-top: 36px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-3);
}
.day-strip-meta {
  display: flex; gap: clamp(24px, 5vw, 48px);
  margin-bottom: 56px;
}
.ds-block { display: flex; flex-direction: column; gap: 4px; }
.ds-lbl {
  font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-muted);
}
.ds-val {
  font-family: var(--display);
  font-size: 1.7rem; font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.ds-of {
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-muted);
}
.ds-val-sm { font-size: 1.3rem; }

.day-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.07);
  overflow: visible;
}
[data-theme="light"] .day-track { background: oklch(0.12 0.01 70 / 0.08); }
.day-track-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--lime-2));
  box-shadow: 0 0 18px var(--lime);
  transition: width 1.6s var(--ease-out);
}
.day-track-ticks span {
  position: absolute; top: 50%;
  width: 2px; height: 14px;
  margin-top: -7px;
  background: oklch(1 0 0 / 0.12);
  border-radius: 1px;
}
[data-theme="light"] .day-track-ticks span { background: oklch(0.12 0.01 70 / 0.18); }
.day-track-marker {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg-2), 0 4px 16px oklch(0 0 0 / 0.4);
  opacity: 0; left: 0;
  transition: left 1.6s var(--ease-out), opacity .4s 1.4s var(--ease-out);
}
.dtm-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%);
  padding: 4px 10px;
  font-size: 0.72rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  white-space: nowrap;
}
.dtm-bubble::after {
  content: ""; position: absolute;
  left: 50%; top: 100%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--text);
}
.day-track-labels {
  display: flex; justify-content: space-between;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Hero pulse (ring stack — concentric arcs) */
.hero-pulse {
  display: flex; align-items: center; gap: 28px;
  flex-shrink: 0;
}
.pulse-ring {
  position: relative;
  width: 280px; height: 280px;
}
.pulse-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pr-track {
  fill: none;
  stroke: oklch(1 0 0 / 0.06);
  stroke-width: 13;
}
[data-theme="light"] .pr-track { stroke: oklch(0.12 0.01 70 / 0.08); }
.pr-arc {
  fill: none;
  stroke-width: 13;
  stroke-linecap: round;
  stroke-dasharray: 0 999;
  transition: stroke-dasharray 1.8s var(--ease-out);
  filter: drop-shadow(0 0 6px currentColor);
}
.pr-lime  { stroke: url(#gradLime); color: var(--lime); }
.pr-coral { stroke: url(#gradCoral); color: var(--coral); }
.pr-cyan  { stroke: url(#gradCyan); color: var(--cyan); }

.pulse-center {
  position: absolute; inset: 76px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
}
.pulse-eyebrow {
  font-size: 0.6rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-muted);
  white-space: nowrap;
}
.pulse-num {
  font-family: var(--display);
  font-size: 2.1rem; font-weight: 700;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 2px 0;
}
.pulse-delta {
  font-size: 0.68rem; font-weight: 600;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column;
  align-items: center; gap: 1px;
  line-height: 1.15;
}
.pulse-delta-lbl { color: var(--text-muted); font-weight: 500; font-size: 0.92em; }

.pulse-legend {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 12px;
  min-width: 160px;
}
.pulse-legend li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
}
.pulse-legend i {
  width: 14px; height: 4px;
  border-radius: 999px;
  display: block;
}
.pulse-legend b {
  font-family: var(--display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.pulse-legend span { color: var(--text-soft); }

/* ── METRICS GRID ───────────────────────────── */
.metrics-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.metric-card {
  position: relative;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-inset), var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  overflow: hidden;
  transition: transform .3s var(--ease-out), border-color .3s var(--ease-out);
}
.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}
.metric-card::before {
  content: ""; position: absolute;
  inset: 0 auto auto 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--metric-color, var(--lime)), transparent);
  opacity: 0.8;
}

.metric-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px;
}
.metric-label {
  font-size: 0.68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--text-muted);
}
.metric-spark { width: 40px; height: 18px; opacity: 0.8; }
.metric-spark path { fill: none; stroke: var(--metric-color, var(--lime)); stroke-width: 1.8; stroke-linecap: round; }
.metric-value {
  font-family: var(--display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric-unit {
  font-size: 0.6em;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}
.metric-sub {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--text-soft);
  display: flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}
.metric-sub-delta { color: var(--metric-color, var(--lime)); font-weight: 600; }
.metric-sub-delta.is-neg { color: var(--coral); }

/* ── SECTION HEADS ──────────────────────────── */
.block {
  margin-top: 38px;
  scroll-margin-top: 96px;
}
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px;
  margin-bottom: 18px;
  padding: 0 4px;
}
.h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
}
.h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.hint {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 320px;
  text-align: right;
  text-wrap: pretty;
}

/* ── PANELS ─────────────────────────────────── */
.panel {
  padding: clamp(20px, 2.5vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-inset), var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
}

/* ── LEADERBOARD ────────────────────────────── */
.lb-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}
.panel-lb { padding: 18px; }

.lb-tableHead {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 70px 80px 90px;
  gap: 14px;
  align-items: center;
  padding: 8px 14px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.lb-tableHead .num { text-align: right; font-family: var(--mono); }

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

.lb-row {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 70px 80px 90px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit; color: inherit;
  transition: background .25s var(--ease-out), border-color .25s var(--ease-out), transform .25s var(--ease-out);
}
.lb-row:hover {
  background: var(--surface-3);
  border-color: var(--line);
  transform: translateX(2px);
}
.lb-row::before {
  content: ""; position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0;
  border-radius: 2px;
  background: var(--row-color, var(--lime));
  transition: height .3s var(--ease-out);
}
.lb-row:hover::before { height: 60%; }

.lb-rank {
  font-family: var(--display);
  font-size: 1.1rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  letter-spacing: -0.04em;
}
.lb-row.lb-top1 .lb-rank { color: var(--lime); }
.lb-row.lb-top2 .lb-rank { color: var(--coral); }
.lb-row.lb-top3 .lb-rank { color: var(--cyan); }

.lb-athlete { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem;
  letter-spacing: -0.02em;
  color: #0a0a0a;
  background: linear-gradient(135deg, var(--av-c1, var(--lime)), var(--av-c2, var(--cyan)));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.4), 0 2px 10px oklch(0 0 0 / 0.3);
}
.lb-name { display: block; font-weight: 600; font-size: 0.95rem; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-meta { display: block; margin-top: 2px; font-size: 0.76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lb-num {
  font-family: var(--mono);
  font-size: 0.88rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}
.lb-score {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Achievements */
.panel-ach {
  display: flex; flex-direction: column;
  padding: 22px;
}
.ach-head { margin-bottom: 18px; }
.ach-list { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ach {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-3);
}
.ach-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #0a0a0a;
  background: var(--ach-bg, var(--lime));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.4);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 400;
}
.ach-body strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.ach-body span {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── HEATMAP ────────────────────────────────── */
.heatmap-scale {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 18px;
  padding: 6px 10px;
  background: var(--surface-3);
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.hs-lbl { font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.hs-cell {
  width: 14px; height: 14px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--lime) calc(var(--v) * 100%), oklch(1 0 0 / 0.08));
  border: 1px solid oklch(1 0 0 / 0.06);
}
[data-theme="light"] .hs-cell {
  background: color-mix(in oklab, var(--lime) calc(var(--v) * 100%), oklch(0.12 0.01 70 / 0.06));
  border-color: oklch(0.12 0.01 70 / 0.06);
}

.heatmap-wrap { overflow-x: auto; }
.heatmap {
  display: grid;
  grid-template-columns: 140px repeat(var(--weeks, 13), minmax(38px, 1fr));
  gap: 6px;
  min-width: 800px;
}
.heat-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: color-mix(in oklab, var(--lime) calc(var(--v) * 100%), oklch(1 0 0 / 0.045));
  border: 1px solid oklch(1 0 0 / 0.04);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  color: oklch(0.12 0 0 / 0.65);
  transition: transform .2s var(--ease-out);
  position: relative;
  cursor: default;
}
[data-theme="light"] .heat-cell { background: color-mix(in oklab, var(--lime) calc(var(--v) * 100%), oklch(0.12 0.01 70 / 0.045)); border-color: oklch(0.12 0.01 70 / 0.04); }
.heat-cell.is-low { color: oklch(0.97 0 0 / 0.4); }
[data-theme="light"] .heat-cell.is-low { color: oklch(0.16 0 0 / 0.4); }
.heat-cell:hover { transform: scale(1.15); z-index: 2; box-shadow: 0 4px 12px oklch(0 0 0 / 0.3); }
.heat-cell.is-future { background: transparent; border: 1px dashed var(--line); color: transparent; }

.heat-name {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 8px;
}
.heat-name .avatar { width: 26px; height: 26px; font-size: 0.7rem; }
.heat-header {
  display: contents;
}
.heat-header > * { display: grid; place-items: center; font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); padding-bottom: 4px; }
.heat-header > .heat-cornercell { justify-self: start; padding-left: 4px; }

/* ── CHARTS GRID ────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.chart-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 22px;
  gap: 10px;
}
.chart-head .kicker { grid-column: 1; grid-row: 1; margin-bottom: 6px; }
.chart-head .h3 { grid-column: 1; grid-row: 2; }
.chart-total {
  grid-column: 2; grid-row: 1 / span 2;
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  text-align: right;
  line-height: 1;
}
.chart-total i {
  display: block;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-top: 6px;
}
.chart-list { display: flex; flex-direction: column; gap: 12px; }
.chart-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 14px;
}
.chart-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 8px;
}
.chart-name .avatar { width: 22px; height: 22px; font-size: 0.6rem; }
.track {
  height: 8px;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.05);
  overflow: hidden;
  position: relative;
}
[data-theme="light"] .track { background: oklch(0.12 0.01 70 / 0.05); }
.bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--bar-c1, var(--lime)), var(--bar-c2, var(--lime-2)));
  box-shadow: 0 0 14px oklch(from var(--bar-c1, var(--lime)) l c h / 0.5);
  transition: width 1.4s var(--ease-out);
}
.chart-value {
  font-family: var(--mono);
  font-size: 0.86rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}
.chart-value-meta {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Stacked breakdown for multas */
.stack-row { grid-template-columns: 132px minmax(0, 1fr) 50px; }
.stack-bar {
  height: 8px; border-radius: 999px;
  background: oklch(1 0 0 / 0.05);
  display: flex; overflow: hidden;
}
.stack-seg { height: 100%; transition: width 1.2s var(--ease-out); }
.stack-seg.s-late { background: var(--warn); }
.stack-seg.s-miss { background: var(--coral); }
.stack-seg.s-other { background: var(--cyan); }

/* ── TEAM GRID ──────────────────────────────── */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}
.tc {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-inset), var(--shadow-soft);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  padding: 20px;
  cursor: pointer;
  text-align: left;
  font: inherit; color: inherit;
  transition: transform .3s var(--ease-out), border-color .3s var(--ease-out), background .3s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.tc:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.tc::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--av-c1, var(--lime)), var(--av-c2, var(--cyan)));
  opacity: 0.6;
}
.tc-head { display: flex; justify-content: space-between; align-items: flex-start; }
.tc-rank {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.tc .avatar { width: 44px; height: 44px; font-size: 1rem; }
.tc-name {
  margin: 16px 0 2px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-role {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.tc-arc-wrap {
  margin: 18px 0 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}
.tc-arc {
  position: relative;
  width: 62px; height: 62px;
}
.tc-arc svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tc-arc .at { fill: none; stroke: oklch(1 0 0 / 0.08); stroke-width: 5; }
[data-theme="light"] .tc-arc .at { stroke: oklch(0.12 0.01 70 / 0.08); }
.tc-arc .af { fill: none; stroke: var(--av-c1, var(--lime)); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0 999; transition: stroke-dasharray 1.6s var(--ease-out); }
.tc-arc-num {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.tc-arc-meta { display: flex; flex-direction: column; gap: 2px; }
.tc-arc-lbl { font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.tc-arc-val {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.tc-arc-sub { font-size: 0.74rem; color: var(--text-muted); }
.tc-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.tc-mini > div {
  padding: 8px 6px;
  background: var(--surface-3);
  border-radius: 10px;
  text-align: center;
}
.tc-mini strong {
  display: block;
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.tc-mini span {
  display: block;
  margin-top: 2px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* ── FOOTER ─────────────────────────────────── */
.footer {
  margin-top: 56px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-inset);
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px;
}
.footer-line {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-soft);
  max-width: 580px;
}
.footer-mark {
  margin: 0;
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--text-muted);
}
.footer-mark em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.2em;
  color: var(--text);
}

/* ── MODAL ──────────────────────────────────── */
.modal {
  width: min(680px, calc(100% - 32px));
  border: 0; padding: 0;
  background: transparent;
  color: var(--text);
  border-radius: 28px;
}
.modal::backdrop {
  background: oklch(0 0 0 / 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.modal-card {
  padding: 28px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  position: relative;
  max-height: 86vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-soft);
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 400;
  line-height: 1;
}
.modal-close:hover { color: var(--text); border-color: var(--line-strong); }
.modal-hero { display: flex; align-items: center; gap: 16px; padding-right: 48px; margin-bottom: 22px; }
.modal-hero .avatar { width: 56px; height: 56px; font-size: 1.2rem; }
.modal-hero h2 { margin: 0; font-family: var(--display); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.04em; }
.modal-hero p { margin: 2px 0 0; font-size: 0.86rem; color: var(--text-muted); }
.modal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 22px; }
.modal-stat { padding: 14px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-3); }
.modal-stat span { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); font-weight: 600; }
.modal-stat strong { display: block; margin-top: 6px; font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.modal-section { margin-top: 18px; }
.modal-section h3 { margin: 0 0 10px; font-size: 1rem; font-weight: 600; letter-spacing: -0.02em; }
.modal-weeks { display: flex; gap: 4px; flex-wrap: wrap; }
.modal-week { flex: 1 1 38px; aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: 0.66rem; font-weight: 600; color: oklch(0.12 0 0 / 0.7); background: color-mix(in oklab, var(--lime) calc(var(--v) * 100%), oklch(1 0 0 / 0.045)); }
[data-theme="light"] .modal-week { background: color-mix(in oklab, var(--lime) calc(var(--v) * 100%), oklch(0.12 0.01 70 / 0.045)); }
.modal-notes { margin: 0; font-size: 0.88rem; color: var(--text-soft); line-height: 1.5; }

/* ── REVEAL ANIMATION ───────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
[data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 1200px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-pulse { flex-direction: row; justify-content: flex-start; gap: 36px; }
  .lb-grid { grid-template-columns: 1fr; }
  .metrics-grid { grid-template-columns: repeat(4, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-links { display: none; }
  .mobile-bottom-nav {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 94%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(18px) saturate(1.2);
  }
  .mobile-bottom-nav a {
    min-width: 0;
    min-height: 44px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: var(--text-muted);
    font-size: .7rem;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    line-height: 1;
  }
  .mobile-bottom-nav a.is-active,
  .mobile-bottom-nav a:focus-visible {
    color: var(--text);
    background: var(--surface-3);
    outline: none;
  }
}

@media (max-width: 780px) {
  .shell { width: min(1200px, calc(100% - 24px)); padding: 14px 0 104px; }
  .topbar { grid-template-columns: 1fr auto; padding: 10px 12px; gap: 12px; flex-wrap: wrap; }
  .sync-time { display: none; }
  .display { font-size: clamp(2.6rem, 12vw, 4rem); }
  .day-strip-meta { gap: 18px; }
  .ds-val { font-size: 1.4rem; }
  .hero-pulse { width: 100%; flex-direction: column; align-items: center; gap: 18px; }
  .pulse-ring { width: min(190px, 58vw); height: min(190px, 58vw); }
  .pulse-center { inset: 48px; gap: 2px; }
  .pulse-eyebrow { font-size: .52rem; letter-spacing: .1em; }
  .pulse-num { font-size: 1.55rem; letter-spacing: 0; }
  .pulse-delta { font-size: .62rem; line-height: 1; }
  .pulse-delta-lbl { display: none; }
  .pulse-legend { width: min(100%, 320px); min-width: 0; gap: 10px; }
  .pulse-legend li { grid-template-columns: 14px minmax(0, 1fr) auto; font-size: .9rem; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .section-head { flex-direction: column; align-items: flex-start; }
  .hint { text-align: left; }
  .chart-row { grid-template-columns: 100px minmax(0, 1fr) 60px; gap: 10px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .lb-tableHead, .lb-row { grid-template-columns: 28px minmax(0, 1fr) 70px 80px; }
  .lb-tableHead > :nth-child(4), .lb-row > :nth-child(4) { display: none; }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .team-grid { grid-template-columns: 1fr; }
  .lb-tableHead, .lb-row { grid-template-columns: 24px minmax(0, 1fr) 70px; }
  .lb-tableHead > :nth-child(3), .lb-row > :nth-child(3) { display: none; }
  .modal-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation: none !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
