:root {
  --bg: #ffffff;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.58);
  --line: rgba(23, 23, 26, 0.1);
  --accent: #5b45e0;
}

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

.pt { 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); }
.pt__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 0 2px; }
.pt__head strong { font-size: 16px; line-height: 20px; font-weight: 740; letter-spacing: -0.01em; }
.pt__tok { font-size: 12.500px; line-height: 16px; font-weight: 660; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* the sentence: three lines tall whatever the words, so the card never changes height */
.pt__text { position: relative; height: 96px; padding: 12px 14px; border-radius: 16px; background: rgba(23, 23, 26, 0.045); font-size: 15px; line-height: 24px; font-weight: 560; letter-spacing: -0.005em; overflow: hidden; }
.pt__slot { display: inline-block; vertical-align: top; height: 22px; margin: 1px 0; padding: 0 7px; border-radius: 7px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 700; line-height: 22px; white-space: nowrap; overflow: hidden; box-shadow: inset 0 0 0 1.500px transparent; transition: box-shadow 0.25s, background-color 0.25s; }
.pt__slot span { display: block; }
.pt__slot.is-on { box-shadow: inset 0 0 0 1.500px var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pt__slot:focus-visible { box-shadow: inset 0 0 0 1.500px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.pt__meas { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }

.pt__opts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.pt__cap { display: block; height: 14px; padding: 0 2px; overflow: hidden; font-size: 11px; line-height: 14px; font-weight: 680; letter-spacing: 0.02em; color: var(--soft); }
.pt__cap span { display: block; }
.pt__row { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 38px; padding: 3px; border-radius: 13px; background: rgba(23, 23, 26, 0.06); }
.pt__pick { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc((100% - 6px) / 3); border-radius: 10px; 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); }
.pt__opt { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; height: 32px; border-radius: 10px; font-size: 12.500px; font-weight: 680; color: var(--soft); white-space: nowrap; overflow: hidden; transition: color 0.25s; }
.pt__opt span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pt__opt[aria-pressed="true"] { color: var(--ink); }
.pt__opt:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }

.pt__use { position: relative; display: block; width: 100%; height: 44px; border-radius: 22px; background: var(--ink); color: #ffffff; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 16px -10px rgba(23, 23, 26, 0.7); transition: background-color 0.3s; }
.pt__use.is-done { background: var(--accent); }
.pt__use:focus-visible { box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--ink); }
.pt__face { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 14px; font-weight: 720; white-space: nowrap; }
.pt__face[data-face="done"] { opacity: 0; }
.pt__face svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pt__face[data-face="done"] path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.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) {
  .pt__slot:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
  .pt__opt:hover { color: var(--ink); }
}
@media (max-width: 330px) { .pt__text { height: 120px; } }
@media (max-width: 350px) { .pt { padding: 16px 13px 14px; } .pt__text { font-size: 14.500px; padding: 12px; } .pt__opt { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { .pt__slot, .pt__opt, .pt__use { transition: none; } }
