:root {
  --bg: #f5f2ec;
  --card: #ffffff;
  --ink: #18191c;
  --soft: #7c7a74;
  --line: rgba(24, 25, 28, 0.1);
  --well: #f1eee7;
  --accent: #2f7d5b;
}

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

.kb {
  width: min(336px, 100%);
  padding: 16px 16px 12px;
  border-radius: 26px;
  background: var(--card);
  box-shadow:
    0 0 0 1px rgba(24, 25, 28, 0.05),
    0 1px 2px rgba(24, 25, 28, 0.06),
    0 34px 60px -32px rgba(24, 25, 28, 0.3);
}
.kb__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.kb__place { font-size: 15px; font-weight: 660; font-stretch: 106%; letter-spacing: -0.008em; white-space: nowrap; }
.kb__when { font-size: 12px; font-weight: 500; color: var(--soft); white-space: nowrap; }
.kb__label { margin: 14px 0 7px; font-size: 12px; font-weight: 560; color: var(--soft); }

/* four reels: each is a window on a strip of digits that slides up and stops on its number */
.kb__code { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.reel { position: relative; height: min(76px, 19vh); overflow: hidden; border-radius: 16px; background: var(--well); box-shadow: inset 0 2px 5px rgba(24, 25, 28, 0.1), inset 0 0 0 1px rgba(24, 25, 28, 0.05); }
.reel::before, .reel::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; z-index: 1; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(180deg, var(--well), transparent); }
.reel::after { bottom: 0; background: linear-gradient(0deg, var(--well), transparent); }
.reel__strip { position: absolute; left: 0; right: 0; top: 0; }
.reel__strip span { display: grid; place-items: center; height: min(76px, 19vh); font-size: min(42px, 10.5vh); font-weight: 640; font-stretch: 96%; letter-spacing: -0.02em; }
.reel__bar { position: absolute; left: 50%; top: 50%; width: 22px; height: 5px; margin: -2.5px 0 0 -11px; border-radius: 5px; background: rgba(24, 25, 28, 0.28); z-index: 2; }
.reel.is-set { box-shadow: inset 0 2px 5px rgba(24, 25, 28, 0.1), inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }

.kb__timer { height: 3px; margin: 10px 2px 12px; border-radius: 3px; background: rgba(24, 25, 28, 0.07); overflow: hidden; }
.kb__timer span { display: block; height: 100%; border-radius: 3px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
.kb__go { display: grid; place-items: center; width: 100%; height: 48px; border: 0; border-radius: 99px; background: var(--ink); color: #ffffff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color 0.4s ease; }
.kb__go[aria-pressed="true"] { background: var(--accent); }
.kb__go-text { display: block; height: 22px; overflow: hidden; line-height: 22px; }
.kb__go-text span { display: block; white-space: nowrap; }
.kb__go:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.kb__foot { margin-top: 10px; font-size: 12px; font-weight: 460; color: var(--soft); text-align: center; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #14151a;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (min-width: 700px) and (min-height: 500px) {
  .kb { zoom: 1.3; }
}
@media (min-width: 1100px) and (min-height: 760px) {
  .kb { zoom: 1.65; }
}
