/* The Hillclimb live view: the hillclimb overlay's cards and chart, and its tier rows for the tiers table (hillclimb repo,
   frontend/overlay/index.html), at page size. Tokens and rules as there, scoped under .hillclimb. */
.hillclimb {
  --panel: #070c15;
  --panel-2: #0c1422;
  --line: rgba(80, 110, 150, 0.35);
  --line-soft: rgba(80, 110, 150, 0.18);
  --text: #d8dee6;
  --muted: #8a9bb3;
  --dim: #56677f;
  --accent: #00aaff;
  --t-S: #ff4d6d;
  --t-A: #ffa62b;
  --t-B: #f5dc4f;
  --t-C: #8fdc4a;
  --t-D: #7b8cff;
  --claude: #d97757;
  --gpt: #10a37f;
  --display: "Conthrax-Bold", "Chakra Petch", sans-serif;
  --display-rg: "Conthrax", "Chakra Petch", sans-serif;
  --body: "Chakra Petch", "Segoe UI", sans-serif;
  --mono: "Share Tech Mono", ui-monospace, Menlo, monospace;
  font-family: var(--body);
  color: var(--text);
}
/* ---------- the live view: the overlay's content in the site's HUD look (bench.css .report-tldr) ---------- */
.hillclimb-panel {
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-family: var(--body);
  background: var(--star-panel, rgba(16, 22, 32, 0.82));
  border: 1px solid var(--star-border, var(--line));
  border-radius: 8px;
  overflow: hidden;
}

/* status line: offline or connecting, hidden once the feed is in */
.hillclimb-status[hidden] { display: none; }
.hillclimb-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 24px 0; padding: 10px 14px;
  border: 1px dashed var(--line); border-radius: 8px; font-size: 0.85rem; color: var(--muted); }
.hillclimb-status .badge { white-space: nowrap; font-family: "Conthrax", sans-serif; font-size: 0.65rem; letter-spacing: 1.5px; padding: 4px 8px 3px; border-radius: 2px;
  background: rgba(138,155,179,.14); color: var(--muted); }

/* the two sides: each lab's logo in white over a wash of the side's color, VS between them */
.hillclimb-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 14px; padding: 22px 20px 0; }
.hillclimb-vs { align-self: center; font-family: "Conthrax", sans-serif; font-size: 0.75rem; letter-spacing: 2px; color: var(--muted); }
.hillclimb .card { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 16px; min-width: 0; overflow: hidden;
  background: linear-gradient(90deg, color-mix(in srgb, var(--mc) 22%, transparent), transparent 75%), rgba(5, 8, 14, 0.55);
  border: 1px solid var(--star-border, var(--line)); border-radius: 8px; box-shadow: inset 3px 0 0 var(--mc); }
.hillclimb .card.right { flex-direction: row-reverse; text-align: right; box-shadow: inset -3px 0 0 var(--mc);
  background: linear-gradient(270deg, color-mix(in srgb, var(--mc) 22%, transparent), transparent 75%), rgba(5, 8, 14, 0.55); }
.hillclimb .lab-logo { flex: none; width: 40px; height: 40px; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--mc) 70%, transparent)); }
.hillclimb .lab-logo i, .hillclimb .lab-logo svg { display: block; width: 100%; height: 100%; fill: #fff; }
.hillclimb .lab-logo i { background: #fff; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.hillclimb .info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hillclimb .mname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "Conthrax", sans-serif; font-weight: 400;
  font-size: 1rem; letter-spacing: 1.5px; color: #fff; line-height: 1.2; text-transform: uppercase; }
.hillclimb .lab { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* the chart, with the clock and its key above it */
.hillclimb-body { padding: 20px 24px 22px; }
.hillclimb-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.hillclimb-clock { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.hillclimb-clock .v { font-family: "Conthrax", sans-serif; font-size: 1rem; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.hillclimb-clock .k { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hillclimb .key { display: flex; gap: 16px; font-family: var(--body); letter-spacing: 0; font-size: 0.8rem; text-transform: none; }
.hillclimb .key span { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.hillclimb .key span::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: var(--mc); }
.hillclimb .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.hillclimb .chart text { font-family: var(--body); font-variant-numeric: tabular-nums; fill: var(--muted); font-size: 11px; }
.hillclimb .pulse { animation: hillclimbPulse 1.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hillclimbPulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }

/* tier rows (the overlay's .tiers), used by the tiers table */
.hillclimb .tiers { display: flex; flex-direction: column; gap: 6px; }
.hillclimb .thead, .hillclimb .trow { display: grid; grid-template-columns: 44px 1fr 62px 62px; }
.hillclimb .thead { font-family: var(--display-rg); font-size: 9px; letter-spacing: 2px; color: var(--muted); padding-bottom: 2px; }
.hillclimb .trow { min-height: 60px; background: rgba(255,255,255,.025); }
.hillclimb .tlab { background: var(--tc); color: #0a0e16; display: grid; place-items: center; font-family: var(--display); font-size: 24px; }
.hillclimb .trow.x .tlab { color: #fff; }
.hillclimb .chips { display: flex; flex-wrap: wrap; align-content: center; align-items: center; gap: 4px; padding: 5px 7px; }
.hillclimb .chip { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 2px; background: rgba(255,255,255,.07); color: var(--text); white-space: nowrap; }

/* the rules table: the same tier rows, with what it takes to clear instead of splits */
.hillclimb .thead.rules, .hillclimb .trow.rules { grid-template-columns: 44px 1fr minmax(120px, 34%); }
.hillclimb .thead.rules span { padding-left: 7px; }
.hillclimb .thead.rules span:nth-child(3) { text-align: left; color: var(--muted); padding-left: 10px; }
.hillclimb .rule { display: flex; align-items: center; padding: 6px 10px; border-left: 1px solid var(--line-soft); font-size: 13px; line-height: 1.35; color: var(--muted); }
.hillclimb .rule b { color: var(--text); font-family: var(--mono); font-weight: normal; }

@media (max-width: 720px) {
  .hillclimb-status { margin: 12px 14px 0; }
  /* the sides stack, each still in its own color; the VS sits between them */
  .hillclimb-top { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 14px 0; }
  .hillclimb-vs { justify-self: center; font-size: 0.65rem; }
  .hillclimb .card, .hillclimb .card.right { flex-direction: row; text-align: left; gap: 14px; padding: 14px 16px; box-shadow: inset 3px 0 0 var(--mc);
    background: linear-gradient(90deg, color-mix(in srgb, var(--mc) 22%, transparent), transparent 75%), rgba(5, 8, 14, 0.55); }
  .hillclimb .lab-logo { width: 34px; height: 34px; }
  .hillclimb .mname { font-size: 0.9rem; }
  .hillclimb-body { padding: 16px 14px 16px; }

  .hillclimb .thead.rules, .hillclimb .trow.rules { grid-template-columns: 36px 1fr 42%; }
  .hillclimb .tlab { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .hillclimb .pulse { animation: none; } }

/* The stream and the live view run wider than the text column. */
.wide { position: relative; left: 50%; transform: translateX(-50%); width: min(1080px, calc(100vw - 32px)); }

/* Bot chips: the human author on hover, keyboard focus, or a tap (hillclimb.js toggles .open). */
.hillclimb button.chip { font: inherit; font-size: 12px; font-weight: 600; border: 0; cursor: help; position: relative; }
.hillclimb .chip.bot::after { position: absolute; z-index: 3; left: 0; bottom: calc(100% + 6px); width: max-content; max-width: min(240px, 60vw);
  padding: 5px 8px; border-radius: 4px; background: #05080e; border: 1px solid var(--line); color: var(--text);
  font-size: 12px; font-weight: 500; line-height: 1.35; white-space: normal; text-align: left; pointer-events: none; }

.hillclimb .chip.bot.flip::after { left: auto; right: 0; }
/* Only an open tooltip exists, so a closed one never widens the page. */
@media (hover: hover) { .hillclimb .chip.bot:hover::after { content: attr(data-author); } }
.hillclimb .chip.bot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hillclimb .chip.bot:focus-visible::after, .hillclimb .chip.bot.open::after { content: attr(data-author); }
.hillclimb .chip.bot:hover, .hillclimb .chip.bot.open { background: rgba(255,255,255,.14); }

/* Map names in the rules: a preview of the map on hover, keyboard focus, or a tap (hillclimb.js toggles .open and keeps it on screen). */
.map-name { position: relative; display: inline; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help;
  text-decoration: underline dotted rgba(138, 155, 179, 0.7); text-underline-offset: 3px; }
.map-name:focus-visible { outline: 2px solid var(--star-accent, #00aaff); outline-offset: 2px; border-radius: 2px; }
.map-pop { display: none; position: absolute; z-index: 5; top: calc(100% + 8px); left: var(--pop-left, 0); width: min(280px, calc(100vw - 32px));
  background: var(--star-panel-solid, #10161f); border: 1px solid var(--star-border, rgba(80, 110, 150, 0.35)); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); overflow: hidden; text-align: left; cursor: default; }
.map-pop img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: contain; background: #0a0e16; border-bottom: 1px solid var(--star-border, rgba(80, 110, 150, 0.35)); }
.map-facts { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; font-size: 0.8rem; line-height: 1.3; color: var(--star-muted, #8a9bb3); }
.map-facts b { font-family: "Conthrax", sans-serif; font-weight: 400; font-size: 0.75rem; letter-spacing: 1.5px; text-transform: uppercase; color: #fff; }
@media (hover: hover) { .map-name:hover .map-pop { display: block; } }
.map-name:focus-visible .map-pop, .map-name.open .map-pop { display: block; }
