:root {
  --bg: #ffffff;
  --card: #f6f5f2;
  --ink: #17171a;
  --soft: rgba(23, 23, 26, 0.52);
  --line: rgba(23, 23, 26, 0.1);
  --accent: #e8467c;
}

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

.bg { position: relative; width: min(268px, 100%); padding: 12px; border-radius: 22px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 #ffffff, 0 22px 34px -22px rgba(23, 23, 26, 0.45); }

.bg__top { position: relative; display: flex; align-items: center; gap: 10px; height: 48px; }
/* the called ball: glossy, with its letter over the number */
.bg__ball { flex: none; display: grid; place-content: center; justify-items: center; width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 26% 22%, #ffffff 0 6%, color-mix(in srgb, var(--accent) 60%, #ffffff) 20%, var(--accent) 62%, color-mix(in srgb, var(--accent) 70%, #000000) 100%); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, 0.18), 0 8px 12px -6px color-mix(in srgb, var(--accent) 80%, #000000); color: #ffffff; opacity: 0; }
.bg__ball b { font-size: 10px; line-height: 10px; font-weight: 800; letter-spacing: 0.04em; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25); }
.bg__ball strong { font-size: 17px; line-height: 18px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.bg__title { flex: 1; min-width: 0; display: grid; gap: 1px; }
.bg__name { display: block; height: 19px; overflow: hidden; font-size: 14.500px; line-height: 19px; font-weight: 720; font-stretch: 104%; letter-spacing: -0.006em; }
.bg__name span { display: block; white-space: nowrap; }
.bg__status { font-size: 11.500px; line-height: 15px; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* the balls called before, small */
.bg__past { flex: none; display: flex; gap: 3px; }
.bg__past i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #ffffff; box-shadow: inset 0 0 0 1px var(--line); font-style: normal; font-size: 8.500px; font-weight: 720; color: var(--soft); font-variant-numeric: tabular-nums; opacity: 0; }

.bg__letters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 8px; }
.bg__letters b { height: 16px; font-size: 11px; line-height: 16px; font-weight: 800; letter-spacing: 0.08em; text-align: center; color: var(--accent); }
.bg__grid { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 2px; }
.bg__cell { position: relative; display: grid; place-items: center; height: 36px; border-radius: 9px; background: #ffffff; box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px -1px rgba(23, 23, 26, 0.2); }
.bg__cell b { position: relative; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; transition: font-weight 0.4s cubic-bezier(0.3, 1.4, 0.5, 1), color 0.3s ease; }
.bg__cell.is-free b { font-size: 9.500px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.bg__cell[data-on] b { font-weight: 820; color: color-mix(in srgb, var(--accent) 60%, #17171a); }
/* the dauber's mark: a slightly uneven blot */
.bg__daub { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 52% 48% 50% 50% / 48% 52% 48% 52%; background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--accent) 34%, transparent), color-mix(in srgb, var(--accent) 22%, transparent) 70%); box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--accent) 38%, transparent); transform: scale(0); }
.bg__cell.is-free .bg__daub { transform: none; }
/* the ring that closes around the winning line */
.bg__line { position: absolute; left: 0; top: 0; height: 44px; border-radius: 14px; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); opacity: 0; pointer-events: none; }

.bg__btn { display: block; width: 100%; height: 40px; margin-top: 10px; border: 0; border-radius: 13px; background: var(--ink); color: #ffffff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; outline: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 16px -10px rgba(23, 23, 26, 0.7); transition: background-color 0.35s ease, box-shadow 0.35s ease; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bg__btn[data-won] { background: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 16px -10px var(--accent); }
.bg__btn:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
@media (hover: hover) { .bg__btn:not([data-won]):hover { background: #2a2a2f; } }
.bg__btntext { display: block; height: 19px; line-height: 19px; overflow: hidden; }
.bg__btntext span { display: block; white-space: nowrap; }

.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; }
