:root {
  --bg: #ffffff;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.58);
  --line: rgba(23, 23, 26, 0.1);
  --mark: #d9432f;
  --fade: 0.34;
}

*, *::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; }

.wm { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; width: min(348px, 100%); padding: 18px 16px 16px; border-radius: 26px; background: #ffffff; box-shadow: inset 0 0 0 1.500px var(--line), 0 30px 44px -30px rgba(23, 23, 26, 0.4); }
.wm__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 2px; }
.wm__head strong { font-size: 16px; line-height: 20px; font-weight: 740; letter-spacing: -0.01em; }
.wm__where { display: block; height: 16px; overflow: hidden; font-size: 12.500px; line-height: 16px; font-weight: 660; color: var(--soft); white-space: nowrap; }
.wm__where span { display: block; }

.wm__view { padding: 12px; border-radius: 16px; background: rgba(23, 23, 26, 0.055); }
.wm__page { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 7px; height: 132px; padding: 14px 16px; border-radius: 6px; background: #ffffff; box-shadow: 0 1px 0 rgba(23, 23, 26, 0.06), 0 10px 16px -10px rgba(23, 23, 26, 0.35); overflow: hidden; }
.wm__l { display: block; height: 5px; border-radius: 2.500px; background: rgba(23, 23, 26, 0.13); }
.wm__l--title { width: 46%; height: 8px; border-radius: 4px; margin-bottom: 3px; background: rgba(23, 23, 26, 0.3); }
.wm__l--short { width: 62%; }
.wm__cols { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 12px; margin-top: 4px; }
.wm__fig { display: flex; align-items: flex-end; gap: 5px; height: 41px; padding: 6px; border-radius: 5px; background: rgba(23, 23, 26, 0.06); }
.wm__fig i { flex: 1; border-radius: 2px; background: rgba(23, 23, 26, 0.2); }
.wm__fig i:nth-child(1) { height: 45%; } .wm__fig i:nth-child(2) { height: 80%; } .wm__fig i:nth-child(3) { height: 60%; } .wm__fig i:nth-child(4) { height: 100%; }
.wm__txt { display: grid; align-content: start; gap: 7px; }
/* the mark is placed by the script: its middle sits on the chosen anchor */
.wm__mark { position: absolute; left: 0; top: 0; padding: 1px 0; font-size: 11px; line-height: 13px; font-weight: 800; font-stretch: 88%; letter-spacing: 0.1em; color: var(--mark); opacity: var(--fade); white-space: nowrap; pointer-events: none; will-change: transform; }
.wm__clip { display: block; overflow: hidden; }
.wm__clip span { display: block; }

.wm__set { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: stretch; }
.wm__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; height: 96px; padding: 4px; border-radius: 14px; background: rgba(23, 23, 26, 0.06); }
.wm__cell { position: relative; display: grid; place-items: center; border-radius: 9px; transition: background-color 0.25s; }
.wm__cell i { display: block; width: 10px; height: 4px; border-radius: 2px; background: rgba(23, 23, 26, 0.26); transition: background-color 0.25s; }
.wm__cell[aria-pressed="true"] { background: var(--ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 6px 8px -6px rgba(23, 23, 26, 0.7); }
.wm__cell[aria-pressed="true"] i { background: #ffffff; }
.wm__cell:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); z-index: 1; }

.wm__words { position: relative; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); height: 96px; padding: 3px; border-radius: 14px; background: rgba(23, 23, 26, 0.06); }
.wm__pick { position: absolute; left: 3px; right: 3px; top: 3px; height: calc((100% - 6px) / 3); border-radius: 11px; background: #ffffff; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 4px 8px -4px rgba(23, 23, 26, 0.35), 0 0 0 1px rgba(23, 23, 26, 0.05); }
.wm__word { position: relative; display: grid; place-items: center; border-radius: 11px; font-size: 12.500px; font-weight: 680; color: var(--soft); white-space: nowrap; transition: color 0.25s; }
.wm__word[aria-pressed="true"] { color: var(--ink); }
.wm__word:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }

.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 (hover: hover) { .wm__cell[aria-pressed="false"]:hover { background: rgba(23, 23, 26, 0.08); } .wm__word:hover { color: var(--ink); } }
@media (max-width: 350px) { .wm { padding: 16px 13px 14px; } .wm__view { padding: 10px; } }
@media (prefers-reduced-motion: reduce) { .wm__cell, .wm__cell i, .wm__word { transition: none; } }
