/* Theme variables: the site's own colours (from public/style.css) */
:root {
  --bg: #1b1a1b;
  --surface: #2f2523;
  --surface-alt: #372c29;
  --border: #4a3d3a;
  --text: #ece5e1;
  --muted: #8d807c;
  --accent: #f2ece8;
  --good: #56d364;
  --warn: #d29922;
  --bad: #f85149;
  --purple: #a371f7;
  --radius: 10px;
  --faint: #5f5552;
  /* the site's font everywhere, like its other pages */
  --font-sans: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.page-header {
  margin-bottom: 22px;
}

/* "## replay analyzer" and its line under it, like the other pages' headings */
.page-header h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.page-header h1::before { content: "## "; color: var(--muted); }

.subtitle {
  margin: 0;
  color: var(--text);
  opacity: 0.85;
  font-size: min(15px, max(11px, calc((100vw - 32px) / 32)));
  font-weight: 600;
}

/* buttons, inputs and lists take the page's font too (browsers give them their own) */
button, input, select, textarea { font-family: inherit; }


/* [music] [meow] [surf] … and the footer under them, as on the other pages (public/style.css) */
.site-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin-top: 48px;
  font-size: 14px;
  font-weight: 600;
}
.site-links a { color: var(--muted); text-decoration: none; }
.site-links a::before { content: "["; color: var(--faint); }
.site-links a::after { content: "]"; color: var(--faint); }
.site-links a:hover,
.site-links a:focus-visible { color: var(--text); }
.site-foot { margin: 14px 0 0; text-align: center; font-size: 11px; color: var(--faint); }
.site-foot:empty { display: none; }
.contact-pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.contact-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.contact-pill svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.contact-pill:hover,
.contact-pill:focus-visible,
.contact-pill[data-open] { color: var(--text); background: rgba(255, 255, 255, 0.09); }
.contact-pill[data-copied]::after {
  content: "copied";
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--faint);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.hidden {
  display: none !important;
}

/* Inputs */
.input-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 210px;
}

.field.grow {
  flex: 1 1 360px;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 0.92rem;
  outline: none;
}

input[type="text"]:focus,
select:focus {
  border-color: var(--accent);
}

.drop-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
  flex-wrap: wrap;
}

.drop-zone {
  flex: 1 1 320px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  color: var(--text);
}

.file-hint {
  font-size: 0.8rem;
  color: var(--accent);
  font-family: var(--font-mono);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: #09111a;
}

.btn.secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}

.status-bar {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 0.88rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.status-bar.error {
  border-color: rgba(248, 81, 73, 0.45);
  color: #ffa198;
}

.status-bar.loading {
  border-color: rgba(88, 166, 255, 0.45);
  color: #a5d6ff;
}

/* Summary & Grade */
.summary-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.summary-left h2 {
  margin: 0;
  font-size: 1.45rem;
}

.overall-score {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 2px;
}

.grade-badge {
  width: 66px;
  height: 66px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
  border: 2px solid var(--border);
  background: var(--surface-alt);
}

.grade-splus,
.grade-s { border-color: var(--good); color: var(--good); }
.grade-a { border-color: var(--accent); color: var(--accent); }
.grade-b { border-color: var(--purple); color: var(--purple); }
.grade-c { border-color: var(--warn); color: var(--warn); }
.grade-d { border-color: var(--bad); color: var(--bad); }

.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 14px;
}

.stat-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

/* Pillars */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.pillar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pillar-label {
  font-size: 0.86rem;
  font-weight: 600;
}

.pillar-grade {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

.pillar-bar {
  height: 7px;
  border-radius: 99px;
  background: var(--bg);
  overflow: hidden;
  margin-bottom: 6px;
}

.pillar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.pillar-score {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.chart-card {
  margin-bottom: 0;
}

.chart-card canvas {
  width: 100%;
  height: 240px;
  display: block;
  cursor: pointer;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.card-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.legend {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.dot.blue { background: #58a6ff; } /* matches the "you" line drawn on the charts and ghost canvas */
.dot.green { background: var(--good); }
.dot.red { background: var(--bad); }

/* Coaching */
.coaching-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.coach-card {
  margin-bottom: 0;
}

.coach-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.coach-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coach-item {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.coach-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.coach-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.ts-pill {
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
}

/* Critiques */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  background: var(--surface-alt);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 11px;
  font-size: 0.8rem;
  cursor: pointer;
}

.chip.active {
  background: var(--accent);
  color: #09111a;
  border-color: var(--accent);
  font-weight: 600;
}

.critique-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.critique-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
}

.critique-item.sev-critical { border-left-color: var(--bad); }
.critique-item.sev-moderate { border-left-color: var(--warn); }
.critique-item.sev-minor { border-left-color: var(--purple); }
.critique-item.sev-clean { border-left-color: var(--good); }

.critique-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 74px;
}

.cat-tag {
  font-size: 0.72rem;
  text-transform: lowercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.critique-body {
  flex: 1;
}

.critique-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 3px;
  font-size: 0.92rem;
}

.critique-body p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.impact-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--bad);
  white-space: nowrap;
}

/* Table */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--surface-alt);
}

.mini-grade {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.empty-msg {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 10px 0;
}

@media (max-width: 960px) {
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid, .coaching-grid { grid-template-columns: 1fr; }
  .summary-stats { grid-template-columns: repeat(2, 1fr); width: 100%; }
}

/* Additional dot color */
.dot.yellow { background: #f2cc60; }

/* Visual Replay & Ghost Route Comparator */
.comparator-panel {
  padding: 16px 18px 18px;
}

.comparator-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.view-tabs {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  background: var(--accent);
  color: #09111a;
}

.comparator-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.seg-group {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--surface-alt);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

/* Live Telemetry HUD */
.live-hud {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.hud-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 11px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 108px;
}

.hud-chip.grow {
  flex: 1 1 240px;
}

.hud-label {
  font-size: 0.68rem;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.hud-chip strong {
  font-size: 0.86rem;
  color: var(--text);
}

/* Side-by-Side Embedded Replays */
.sidebyside-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.replay-frame-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.frame-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}

.frame-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.mini-link:hover {
  text-decoration: underline;
}

.iframe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 290px;
  background: #070a0f;
  overflow: hidden;
}

/* A 16:9 picture plus room for the replay's controls under it: two rows when the frame is
   narrow (two replays next to each other), one row when it's wide. */
.replay-frame-card { container-type: inline-size; }
@supports (height: 1cqw) {
  .iframe-wrap { aspect-ratio: auto; height: calc(56.25cqw + 82px); }
  @container (min-width: 720px) {
    .iframe-wrap { height: calc(56.25cqw + 50px); }
  }
  @media (pointer: coarse) {
    .iframe-wrap { height: calc(56.25cqw + 112px); }
  }
}

.iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.iframe-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: var(--bg);
  color: var(--text);
  gap: 6px;
}

.iframe-placeholder p {
  margin: 0;
  font-size: 0.86rem;
}

/* Ghost Route Stage */
.ghost-stage {
  position: relative;
  background: #080c12;
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 14px;
}

.ghost-stage canvas {
  width: 100%;
  height: 390px;
  display: block;
  cursor: grab;
}

.ghost-stage canvas:active {
  cursor: grabbing;
}

.ghost-overlay-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(22, 27, 34, 0.85);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.ghost-overlay-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(22, 27, 34, 0.85);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.mode-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--good);
  background: rgba(86, 211, 100, 0.1);
  border: 1px solid rgba(86, 211, 100, 0.3);
  border-radius: 99px;
  padding: 2px 9px;
}

.mode-badge.split-mode {
  color: var(--warn);
  background: rgba(210, 153, 34, 0.12);
  border-color: rgba(210, 153, 34, 0.35);
}

.small-chip {
  padding: 3px 9px;
  font-size: 0.75rem;
}

/* Playback & Scrubber Bar */
.playback-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.playback-left,
.walkthrough-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.small-btn {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.rate-select {
  padding: 6px 8px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.scrubber-wrap {
  position: relative;
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  height: 28px;
}

.scrubber-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  position: relative;
  z-index: 2;
}

.scrubber-pins {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 3;
}

.scrub-pin {
  position: absolute;
  top: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translateX(-50%);
  border: 1.5px solid #080c12;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.12s ease;
}

.scrub-pin:hover,
.scrub-pin.active {
  transform: translateX(-50%) scale(1.45);
}

.scrub-pin.sev-critical { background: var(--bad); }
.scrub-pin.sev-moderate { background: var(--warn); }
.scrub-pin.sev-minor { background: var(--purple); }

/* Active Mistake Fix Callout */
.active-callout {
  margin-top: 14px;
  background: linear-gradient(180deg, rgba(248, 81, 73, 0.09), rgba(22, 27, 34, 0.95));
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-radius: 9px;
  padding: 14px 16px;
}

.active-callout.sev-moderate {
  background: linear-gradient(180deg, rgba(210, 153, 34, 0.09), rgba(22, 27, 34, 0.95));
  border-color: rgba(210, 153, 34, 0.45);
}

.active-callout.sev-minor {
  background: linear-gradient(180deg, rgba(163, 113, 247, 0.09), rgba(22, 27, 34, 0.95));
  border-color: rgba(163, 113, 247, 0.45);
}

.active-callout.sev-clean {
  background: linear-gradient(180deg, rgba(86, 211, 100, 0.09), rgba(22, 27, 34, 0.95));
  border-color: rgba(86, 211, 100, 0.45);
}

.callout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.callout-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ref-pill {
  color: var(--good);
}

.callout-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.callout-actions .jump-btn {
  margin-top: 0;
}

/* Warnings when the two runs aren't like-for-like (map version, track, splits) */
.compat-notice {
  margin: 0 0 14px;
  padding: 10px 12px 10px 30px;
  border-radius: 7px;
  font-size: 0.86rem;
  color: #f2cc60;
  background: rgba(242, 204, 96, 0.08);
  border: 1px solid rgba(242, 204, 96, 0.35);
}

.compat-notice li + li {
  margin-top: 4px;
}

.direction-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f2cc60;
  background: rgba(242, 204, 96, 0.12);
  border: 1px solid rgba(242, 204, 96, 0.35);
  border-radius: 6px;
  padding: 3px 9px;
}

.active-callout h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.callout-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.callout-col {
  background: rgba(13, 17, 23, 0.7);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 10px 12px;
}

.callout-col p {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--text);
}

.col-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.05em;
}

.bad-label { color: var(--bad); }
.good-label { color: var(--good); }

/* Upgraded Mistake Cards */
.critique-item {
  transition: border-color 0.15s ease, background 0.15s ease;
}

.critique-item:hover {
  background: #222933;
}

.critique-item.active-mistake {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.critique-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.critique-subbox {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.critique-subbox .sub-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.critique-subbox p {
  margin: 0;
  font-size: 0.83rem;
  color: var(--text);
}

.jump-btn {
  margin-top: 4px;
  background: rgba(88, 166, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.35);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.jump-btn:hover {
  background: var(--accent);
  color: #09111a;
}

@media (max-width: 960px) {
  .sidebyside-stage { grid-template-columns: 1fr; }
  .callout-columns, .critique-two-col { grid-template-columns: 1fr; }
  .ghost-stage canvas { height: 320px; }
}

/* Back link to /surf (standalone page only) */
.back-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--faint);
  text-decoration: none;
}
.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
}

/* ?embed=1: the analyzer inside /surf's momentum mod section. The page's own heading and
   back link are dropped (the surf page has its own), and the frame sits flush with the page. */
.embed .container {
  padding: 0;
  max-width: none;
}
.embed .page-header,
.embed .back-link,
.embed .site-links {
  display: none;
}
/* …and the box that asks for a run looks like /surf's other boxes (its font, inputs and
   buttons): it sits inside /surf's tools box, so it has no panel of its own */
.embed,
.embed body { background: transparent; }
.embed .input-panel {
  padding: 0;
  border: 0;
  background: none;
  font-family: "JetBrains Mono", var(--font-mono);
}
.embed .input-panel label { font-size: 11px; font-weight: 600; text-transform: lowercase; }
.embed .input-panel input[type="text"],
.embed .input-panel select {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 13px;
}
.embed .input-panel select option,
.embed .input-panel select optgroup { background: #1b1a1b; }
.embed .input-panel input[type="text"]::placeholder { color: #5f5552; }
.embed .input-panel input[type="text"]:focus,
.embed .input-panel select:focus { border-color: rgba(232, 137, 216, 0.6); background-color: rgba(255, 255, 255, 0.06); }
.embed .input-panel .drop-zone {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;  text-transform: lowercase;
}
.embed .input-panel .drop-zone:hover,
.embed .input-panel .drop-zone.dragover { border-color: rgba(232, 137, 216, 0.6); }
.embed .input-panel .btn {
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: lowercase;
}
.embed .input-panel .btn.primary { background: rgba(232, 137, 216, 0.22); color: var(--text); }
.embed .input-panel .btn.secondary { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.embed .input-panel .btn.primary:hover:not(:disabled),
.embed .input-panel .btn.primary:focus-visible { background: rgba(232, 137, 216, 0.36); outline: none; }
.embed .input-panel .btn.secondary:hover:not(:disabled),
.embed .input-panel .btn.secondary:focus-visible { background: rgba(255, 255, 255, 0.1); outline: none; }
.embed .status-bar { font-family: "JetBrains Mono", var(--font-mono); font-size: 12px; }

.board-panel h3 { margin: 0 0 4px; }
.board-panel h4 { margin: 14px 0 6px; font-size: 0.9rem; }
.board-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.board-table th, .board-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.board-table th { color: var(--muted); font-size: 0.75rem; text-transform: lowercase; letter-spacing: 0.04em; }

/* Stage table: route vs the reference */
.route-len { white-space: nowrap; }
.route-off { display: block; margin-top: 2px; white-space: nowrap; }
.route-worst {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}
.route-worst:hover,
.route-worst:focus-visible { text-decoration: underline; }

/* Mistakes list: the note about the small ones left out */
.small-note { margin-top: 10px; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Keyboard shortcuts, under the playback bar (not on touch screens) */
.shortcut-hint { margin: 8px 2px 0; }
/* (inside /surf the music belongs to the page around it, which keeps space for itself) */
.embed .shortcut-hint .music-key { display: none; }
.shortcut-hint kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}
@media (hover: none) {
  .shortcut-hint { display: none; }
}

/* labels, buttons and headings written by the analyzer's scripts in Title Case: lowercase like the
   rest of the site (only these, so player names and grades keep their letters; last in the file so it wins) */
label, th, h3, h4, .btn, .chip, .seg-btn, .tab-btn, .leg-item, .stat-label, .hud-label, .pillar-label,
.col-label, .sub-label, .mode-badge, .cat-tag, .mini-link, .jump-btn, .direction-badge, .critique-title,
#ghost-hint, #hud-guidance, .coach-card h3 {
  text-transform: lowercase;
}
