:root {
  --bg: #0c0d10;
  --surface: #14161b;
  --surface-2: #1c1f26;
  --border: #262a33;
  --border-strong: #353a46;
  --text: #e6e8ee;
  --text-2: #b8bdc8;
  --text-3: #6e7484;
  --accent: #f0b132;
  --accent-2: #ffd877;
  --ok: #3fc472;
  --warn: #f0b132;
  --bad: #e8523c;
  --info: #5aa8ff;
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace,Menlo,Consolas,monospace;
  --display: ui-rounded,'Segoe UI Variable',Inter,system-ui,sans-serif;
}
* { box-sizing: border-box }
html,body { background: var(--bg); color: var(--text); font-family: var(--display); margin: 0; }
a { color: var(--accent-2) }
code { font-family: var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-name { letter-spacing: .04em; font-size: 14px }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffd877, #c98a1f);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 15%, transparent);
}
.hdr-meta { font-family: var(--mono); font-size: 12px; color: var(--text-3) }

/* ── Tab strip ──────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.tab-btn {
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 6px 14px;
  border: none; background: transparent;
  color: var(--text-2);
  border-radius: calc(var(--radius-sm) - 3px);
  cursor: pointer;
  transition: 140ms ease;
  letter-spacing: 0.01em;
}
.tab-btn:hover { color: var(--text); background: color-mix(in oklab, var(--text-2) 8%, transparent) }
.tab-btn.is-active {
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 38%, transparent);
}
.tab-panel { display: none }
.tab-panel.is-active { display: flex }

main {
  max-width: 1280px; margin: 0 auto; padding: 22px 22px 60px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ── Mouse Tracker tab — toolbar + clean play field ─────────── */
.mouse-panel {
  position: relative;
  padding: 0;
  margin: 0;
  max-width: none;
  height: calc(100vh - 60px);  /* full viewport minus page header */
  flex-direction: column;
}
.mouse-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 10px 18px;
  background: color-mix(in oklab, var(--surface) 94%, transparent);
  border-bottom: 1px solid var(--border);
  flex: none;
}
.mouse-toolbar-modes  { display: flex; align-items: center; gap: 6px; }
.mouse-mode-hint      { color: var(--text-3); font-size: 12px; margin-left: 10px; }
.mouse-toolbar-stats  {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  font-family: var(--mono); font-size: 11px;
  justify-content: center;
}
.mouse-toolbar-stats .ms {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mouse-toolbar-stats .ms span { color: var(--text-3); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; }
.mouse-toolbar-stats .ms b    { color: var(--text); font-weight: 600; }
.mouse-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mode-btn.is-active {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 45%, transparent);
}

.mouse-field {
  position: relative;
  flex: 1 1 auto;
  background:
    radial-gradient(circle at 20% 10%, color-mix(in oklab, var(--accent) 5%, transparent), transparent 50%),
    var(--bg);
  cursor: crosshair;
  overflow: hidden;
}
.mouse-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 1;
}
/* ── Click-target layer (overlay on canvas, only in targets mode) ── */
.mouse-targets-layer {
  position: absolute; inset: 0;
  z-index: 2;
  pointer-events: none;     /* container is transparent; individual targets re-enable pointer-events */
}
.mouse-target {
  position: absolute;
  pointer-events: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--accent-2) 90%, transparent), color-mix(in oklab, var(--accent) 50%, transparent));
  border: 2px solid color-mix(in oklab, var(--accent) 70%, transparent);
  box-shadow:
    0 0 0 4px color-mix(in oklab, var(--accent) 8%, transparent),
    0 4px 12px color-mix(in oklab, var(--accent) 20%, transparent);
  transition: transform 100ms ease, opacity 120ms ease;
  cursor: pointer;
  z-index: 3;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700;
  color: color-mix(in oklab, var(--bg) 85%, var(--accent));
  user-select: none;
}
.mouse-target.next {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  animation: target-pulse 1.2s ease-in-out infinite;
}
.mouse-target.hit {
  background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--ok) 90%, transparent), color-mix(in oklab, var(--ok) 50%, transparent));
  border-color: color-mix(in oklab, var(--ok) 70%, transparent);
  transform: scale(0.7);
  opacity: 0.35;
}
@keyframes target-pulse {
  0%, 100% { transform: scale(1.0); box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 14%, transparent); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 10px color-mix(in oklab, var(--accent) 6%, transparent); }
}

.mouse-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 12px; color: var(--text-2);
}
.mouse-toggle input { margin: 0; cursor: pointer; }
.bee-btn {
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.bee-btn:hover { color: var(--text); border-color: var(--accent); }
.bee-btn.ghost { background: transparent; }
.bee-btn.sm { padding: 4px 10px; font-size: 11px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: .01em }
.cat-sub { color: var(--text-3); font-size: 13px; margin: 0 0 14px; line-height: 1.4 }

/* ── Score gauge ───────────────────────────────────────────────── */
.score-card { padding: 24px 28px }
.score-wrap { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center }
.score-ring {
  --val: 0;
  --col: var(--text-3);
  width: 180px; height: 180px;
  border-radius: 50%;
  background:
    conic-gradient(var(--col) calc(var(--val) * 1%), color-mix(in oklab, var(--col) 12%, transparent) 0);
  position: relative;
  transition: --val 700ms ease, background 700ms ease;
}
.score-ring::before {
  content: '';
  position: absolute; inset: 14px;
  background: var(--surface);
  border-radius: 50%;
}
/* Stack the value + label as a flex column centered inside the ring.
   line-height: 1 on the number caused the digits' optical centre to drift
   above the inner circle's geometric centre; explicit centering + a
   small nudge brings the digit body onto the centerline. */
.score-ring .score-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
}
.score-value, .score-label { position: relative; text-align: center; }
.score-value {
  font-family: var(--mono);
  font-size: 52px; font-weight: 700;
  color: var(--text);
  line-height: 0.9;
  /* Most monospace fonts leave ~12% of the line-box below the baseline as
     descender slack. Without compensation the visual middle of "100"
     drifts above geometric centre — pull the glyph down a touch. */
  transform: translateY(2px);
}
.score-label {
  font-size: 10px; letter-spacing: .28em;
  color: var(--text-3); text-transform: uppercase;
  line-height: 1;
}
.score-text h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: .01em; }
.score-text p { margin: 0 0 14px; color: var(--text-2); font-size: 14px; line-height: 1.45 }
.score-bars { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 20px; max-width: 560px; }
.bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.bar span { color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.bar b { font-family: var(--mono); }

/* ── Grid + probe rows ──────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 980px) { .grid { grid-template-columns: 1fr } .score-wrap { grid-template-columns: 1fr } .score-ring { margin: 0 auto } }
.probes { list-style: none; padding: 0; margin: 0; }
.probes li {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: start; gap: 10px;
  padding: 7px 0; border-top: 1px solid var(--border);
  font-size: 13px; line-height: 1.4;
}
.probes li:first-child { border-top: none }
.probes .icn { font-size: 12px; line-height: 1.5; text-align: center }
.probes .icn.ok  { color: var(--ok) }
.probes .icn.warn { color: var(--warn) }
.probes .icn.bad { color: var(--bad) }
.probes .icn.info { color: var(--info) }
.probes .name { color: var(--text-2); }
.probes .val  { font-family: var(--mono); font-size: 12px; color: var(--text-3); text-align: right; word-break: break-all; }
.probes li.is-fail .name { color: var(--text) }
.probes li.is-fail .val  { color: var(--bad) }
.probes .why { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }
.probes li.expand .val { white-space: pre-wrap }

.foot-note p { color: var(--text-2); font-size: 13px; line-height: 1.55; margin: 0 0 10px }
.foot-note .dim { color: var(--text-3); font-size: 12px }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.pill.ok   { color: var(--ok);   border-color: color-mix(in oklab, var(--ok) 50%, var(--border)) }
.pill.warn { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 50%, var(--border)) }
.pill.bad  { color: var(--bad);  border-color: color-mix(in oklab, var(--bad) 50%, var(--border)) }
