:root {
  --bg: #000000;
  --card: #141519;
  --ink: #f3f4f1;
  --soft: rgba(243, 244, 241, 0.55);
  --line: rgba(243, 244, 241, 0.12);
  --bad: #ff6b57;
  --mid: #ffc247;
  --good: #3ddc97;
  --tone: var(--bad);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 8px 12px;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.sp { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); width: min(332px, 100%); padding: 14px 14px 10px; border-radius: 24px; background: linear-gradient(165deg, #1b1c22, var(--card) 60%); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 34px 54px -34px color-mix(in srgb, var(--tone) 30%, transparent); transition: box-shadow 0.4s; }
.sp[data-zone="mid"] { --tone: var(--mid); }
.sp[data-zone="good"] { --tone: var(--good); }
.sp__head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 0 2px; }
.sp__head strong { font-size: 15px; font-weight: 700; white-space: nowrap; }
.sp__verdict { display: block; height: 16px; overflow: hidden; font-size: 12px; line-height: 16px; font-weight: 620; color: var(--tone); text-align: right; white-space: nowrap; transition: color 0.3s; }
.sp__verdict span { display: block; }

/* the half dial: the script turns the needle around the hub */
.sp__dial { position: relative; justify-self: center; width: min(210px, 50vh); margin-top: 4px; }
.sp__dial svg { display: block; width: 100%; height: auto; overflow: visible; }
.sp__zone { fill: none; stroke-width: 9; opacity: 0.28; transition: opacity 0.3s; }
.sp__zone--bad { stroke: var(--bad); }
.sp__zone--mid { stroke: var(--mid); }
.sp__zone--good { stroke: var(--good); }
.sp[data-zone="bad"] .sp__zone--bad, .sp[data-zone="mid"] .sp__zone--mid, .sp[data-zone="good"] .sp__zone--good { opacity: 1; }
.sp__needle { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.sp__hub { fill: var(--card); stroke: var(--ink); stroke-width: 3; }
.sp__score { display: flex; justify-content: center; align-items: baseline; gap: 6px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sp__score b { font-size: clamp(26px, 8vh, 32px); line-height: 1.05; font-weight: 720; font-stretch: 88%; letter-spacing: -0.02em; color: var(--tone); transition: color 0.3s; }
.sp__score span { font-size: 12px; color: var(--soft); }

.sp__subject { display: grid; gap: 4px; margin-top: 6px; padding: 9px 12px; border-radius: 13px; background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 0 0 1px var(--line); }
.sp__cap { font-size: 11px; color: var(--soft); }
.sp__line { font-size: 14.5px; font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp__line mark { display: inline-block; color: inherit; background: none; border-radius: 4px; box-shadow: inset 0 -0.500em 0 color-mix(in srgb, var(--bad) 55%, transparent); transition: box-shadow 0.35s; }
.sp__line mark.is-fixed { box-shadow: inset 0 0 0 transparent; }

.sp__fixes { list-style: none; display: grid; margin-top: 4px; }
.sp__fixes button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; height: clamp(30px, 8.200vh, 36px); padding: 0 6px; border-radius: 10px; text-align: left; font-size: 13px; }
.sp__fixes i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 7px; box-shadow: inset 0 0 0 1.500px rgba(243, 244, 241, 0.4); transition: background-color 0.2s, box-shadow 0.2s; }
.sp__fixes svg { display: block; width: 14px; height: 14px; fill: none; stroke: #0b0b0d; stroke-width: 2.200; stroke-linecap: round; stroke-linejoin: round; }
.sp__fixes path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.sp__fixes span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.sp__fixes b { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--soft); transition: color 0.2s; }
.sp__fixes button[aria-checked="true"] i { background: var(--good); box-shadow: none; }
.sp__fixes button[aria-checked="true"] b { color: var(--good); }
.sp__fixes button:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
@media (hover: hover) { .sp__fixes button:hover { background: rgba(255, 255, 255, 0.05); } }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ghost { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -3px 0 0 -5px; transform-origin: 20% 15%; pointer-events: none; opacity: 0; fill: #ffffff; stroke: #0b0b0d; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); z-index: 6; }

@media (prefers-reduced-motion: reduce) { .sp, .sp__verdict, .sp__score b, .sp__zone, .sp__line mark, .sp__fixes i, .sp__fixes b { transition: none; } }
