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

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

.rz { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 18px; width: min(300px, 100%); }

/* five colours side by side in one rounded strip */
.rz__palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; height: min(132px, 34vh); border-radius: 20px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 26px 36px -26px rgba(23, 23, 26, 0.5); isolation: isolate; }
.rz__sw { --on: #ffffff; position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; justify-items: center; align-items: end; padding: 7px 0 10px; color: var(--on); background: #d9d7d2; overflow: hidden; transition: color 0.25s; }
.rz__wash { position: absolute; inset: -1px 0; transform: scaleY(0); transform-origin: 50% 100%; pointer-events: none; }
.rz__wash::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); }
.rz__lock { position: relative; z-index: 1; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; opacity: 0.5; transition: opacity 0.2s, background-color 0.2s; }
.rz__lock svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.500; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.rz__shackle { transform-box: view-box; transform-origin: 10.750px 7.250px; transform: rotate(28deg); transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.rz__lock[aria-pressed="true"] { opacity: 1; background: color-mix(in srgb, var(--on) 20%, transparent); }
.rz__lock[aria-pressed="true"] .rz__shackle { transform: none; }
.rz__lock[aria-pressed="true"] rect { fill: currentColor; }
.rz__lock:focus-visible { opacity: 1; box-shadow: 0 0 0 2px var(--on); }
@media (hover: hover) { .rz__lock:hover { opacity: 1; } }
.rz__hex { position: relative; z-index: 1; display: block; height: 14px; overflow: hidden; font-size: 10.5px; line-height: 14px; font-weight: 650; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; font-stretch: 88%; }
.rz__hex b { display: block; font-weight: inherit; }

/* the pill */
.rz__btn { position: relative; width: 172px; height: 50px; border-radius: 25px; background: var(--ink); color: #ffffff; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 16px 26px -16px rgba(23, 23, 26, 0.65); }
.rz__btn:focus-visible { box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 2px var(--ink); }
.rz__in { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.rz__die { display: block; flex: none; width: 22px; height: 22px; }
.rz__die svg { display: block; width: 22px; height: 22px; overflow: visible; }
.rz__die rect { fill: #ffffff; }
.rz__die circle { fill: var(--ink); opacity: 0; }
.rz__word { font-size: 15.5px; font-weight: 700; letter-spacing: 0.005em; white-space: nowrap; font-stretch: 100%; }
.rz__sheen { position: absolute; top: 0; bottom: 0; left: 0; width: 46%; background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)); opacity: 0; pointer-events: none; }

/* an empty box as big as the whole piece: the preview frames this */
.frame { position: absolute; left: 50%; top: 50%; width: 320px; height: 236px; margin: -118px 0 0 -160px; pointer-events: none; }
.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: #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-height: 300px) { .rz { gap: 12px; } .rz__btn { height: 44px; } }
@media (prefers-reduced-motion: reduce) { .rz__shackle, .rz__sw, .rz__lock { transition: none; } }
