:root {
  --bg: #ffffff;
  --ink: #1d1a18;
  --soft: rgba(29, 26, 24, 0.58);
  --line: rgba(29, 26, 24, 0.1);
  --accent: #b8654a;
  --sand: #f6efe8;
}

*, *::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;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; outline: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.mp { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; width: min(348px, 100%); padding: 16px; border-radius: 26px; background: #ffffff; box-shadow: inset 0 0 0 1.500px var(--line), 0 30px 44px -30px rgba(29, 26, 24, 0.4); }
.mp__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 2px; }
.mp__what { display: grid; gap: 1px; min-width: 0; }
.mp__what strong { font-size: 16px; line-height: 20px; font-weight: 740; letter-spacing: -0.01em; white-space: nowrap; }
.mp__what span { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* four small bars that say the level without a number */
.mp__meter { flex: none; display: flex; align-items: flex-end; gap: 3px; height: 20px; padding: 0 2px; }
.mp__meter i { display: block; width: 5px; border-radius: 2.500px; background: rgba(29, 26, 24, 0.12); transform-origin: 50% 100%; transition: background-color 0.3s ease; }
.mp__meter i:nth-child(1) { height: 8px; }
.mp__meter i:nth-child(2) { height: 12px; }
.mp__meter i:nth-child(3) { height: 16px; }
.mp__meter i:nth-child(4) { height: 20px; }
.mp__meter i.is-on { background: var(--accent); }

/* the soft surface and the stone: everything is drawn by the script from one number, the depth */
.mp__pad { position: relative; border-radius: 18px; background: var(--sand); overflow: hidden; cursor: pointer; touch-action: manipulation; }
.mp__svg { display: block; width: 100%; height: auto; aspect-ratio: 300 / 124; }
.mp__body { fill: color-mix(in srgb, var(--accent) 13%, var(--sand)); }
.mp__skin { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mp__iso { fill: none; stroke: var(--accent); stroke-width: 1.400; stroke-linecap: round; }
.mp__vein { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 0.900; stroke-linecap: round; }
.mp__vein--b { stroke: rgba(255, 255, 255, 0.09); }
.mp__gloss { fill: rgba(255, 255, 255, 0.2); }

/* the four levels, with one pill that slides under the chosen one */
.mp__seg { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); height: 40px; padding: 3px; border-radius: 20px; background: rgba(29, 26, 24, 0.055); }
.mp__thumb { position: absolute; left: 0; top: 3px; height: 34px; width: 25%; border-radius: 17px; background: #ffffff; box-shadow: 0 1px 1px rgba(29, 26, 24, 0.08), 0 6px 12px -6px rgba(29, 26, 24, 0.35); pointer-events: none; }
.mp__opt { position: relative; display: grid; place-items: center; height: 34px; border-radius: 17px; font-size: 13px; font-weight: 640; color: var(--soft); white-space: nowrap; transition: color 0.3s ease, font-weight 0.3s ease; }
.mp__opt span { display: block; }
.mp__opt[aria-checked="true"] { color: var(--ink); font-weight: 740; }
.mp__opt:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
@media (hover: hover) { .mp__opt:hover { color: var(--ink); } }

.mp__info { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; padding: 0 4px; }
.mp__clip { display: block; height: 17px; line-height: 17px; overflow: hidden; white-space: nowrap; font-size: 12.500px; font-weight: 600; color: var(--soft); }
.mp__clip span { display: block; overflow: hidden; text-overflow: ellipsis; }
.mp__clip--tall { height: 22px; line-height: 22px; font-size: 16px; font-weight: 740; letter-spacing: -0.01em; color: var(--ink); }
.mp__note { padding: 10px 4px 0; border-top: 1.500px solid var(--line); font-size: 11.500px; line-height: 15px; font-weight: 600; color: var(--soft); }

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

@media (max-width: 350px) { .mp { padding: 14px 12px; } .mp__opt { font-size: 12.500px; } }
@media (max-height: 400px) { .mp { gap: 10px; } .mp__note { padding-top: 8px; } }
@media (prefers-reduced-motion: reduce) { .mp__meter i, .mp__opt { transition: none; } }
