:root {
  --bg: #000000;
  --card: #131516;
  --ink: #f2f5f3;
  --soft: rgba(242, 245, 243, 0.5);
  --line: rgba(255, 255, 255, 0.08);
  --accent: #5ee6a8;
}

*, *::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: 10px 12px;
}
.stage::before { content: ""; position: absolute; left: 50%; top: 50%; width: min(520px, 100%); height: min(400px, 100%); transform: translate(-50%, -50%); background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 11%, transparent), transparent); pointer-events: none; }

.sm { position: relative; width: min(324px, 100%); padding: 14px; border-radius: 24px; background: linear-gradient(180deg, #1a1d1e 0%, var(--card) 45%); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 30px 50px -30px rgba(0, 0, 0, 0.9); }
.sm__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; padding: 0 2px; }
.sm__title { min-width: 0; display: grid; gap: 1px; }
.sm__title b { font-size: 15px; line-height: 20px; font-weight: 700; font-stretch: 104%; letter-spacing: -0.005em; white-space: nowrap; }
.sm__status { display: block; height: 16px; overflow: hidden; font-size: 12px; line-height: 16px; color: var(--soft); }
.sm__status span { display: block; white-space: nowrap; }
/* the magnitude, large on the right */
.sm__mag { flex: none; display: flex; align-items: baseline; gap: 4px; height: 40px; padding: 0 12px; border-radius: 13px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--line); line-height: 40px; transition: background-color 0.4s ease, box-shadow 0.4s ease, color 0.4s ease; }
.sm__mag small { font-size: 11px; font-weight: 700; color: var(--soft); transition: color 0.4s ease; }
.sm__mag strong { font-size: 22px; font-weight: 760; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sm[data-shaking] .sm__mag { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); }
.sm[data-shaking] .sm__mag small { color: var(--accent); }

/* the paper: it moves to the left under the pen */
.sm__plot { position: relative; display: block; height: 124px; margin-top: 12px; border-radius: 16px; background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 0 0 1px var(--line), inset 0 8px 14px -8px rgba(0, 0, 0, 0.8); overflow: hidden; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sm__plot:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.sm__plot svg { position: absolute; left: 0; top: 7px; width: 100%; height: 110px; overflow: visible; }
.sm__grid path { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sm__grid .sm__zero { stroke: rgba(255, 255, 255, 0.12); stroke-dasharray: 2 4; }
.sm__trace { fill: none; stroke: var(--accent); stroke-width: 1.600; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sm__glow { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linejoin: round; opacity: 0.16; vector-effect: non-scaling-stroke; filter: blur(3px); }
.sm__pen { fill: var(--ink); }
.sm__plot::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 44px; z-index: 1; background: linear-gradient(90deg, #0b0c0d, rgba(11, 12, 13, 0)); pointer-events: none; }
.sm__hint { position: absolute; left: 12px; bottom: 8px; z-index: 2; font-size: 11px; line-height: 14px; color: rgba(242, 245, 243, 0.4); pointer-events: none; transition: opacity 0.4s ease; }
.sm[data-shaking] .sm__hint { opacity: 0; }

.sm__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 0 2px; }
.sm__last { min-width: 0; display: grid; gap: 1px; }
.sm__last small { font-size: 10.500px; line-height: 13px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(242, 245, 243, 0.38); }
.sm__event { display: block; height: 18px; overflow: hidden; font-size: 13px; line-height: 18px; font-weight: 560; font-variant-numeric: tabular-nums; }
.sm__event span { display: block; white-space: nowrap; }
/* five steps of strength */
.sm__scale { flex: none; display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.sm__scale i { display: block; width: 6px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); transition: background-color 0.3s ease; }
.sm__scale i:nth-child(1) { height: 8px; } .sm__scale i:nth-child(2) { height: 11px; } .sm__scale i:nth-child(3) { height: 14px; } .sm__scale i:nth-child(4) { height: 18px; } .sm__scale i:nth-child(5) { height: 22px; }
.sm__scale i.on { background: var(--accent); }

.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: #101014; stroke-width: 1.300; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); z-index: 6; }
