:root { --room: #14102a; --lane: #f2c078; --pink: #ff3d8b; --cyan: #2de2e6; --orange: #ff8a2a; --yellow: #ffe14d;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Noto Color Emoji"; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--room); color: #fff; font-family: var(--font);
  overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

#top { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center;
  padding: calc(6px + env(safe-area-inset-top)) 10px 6px; pointer-events: none; z-index: 3; }
#top > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; line-height: 1.15; text-shadow: 0 0 12px var(--pink); }
.brand b { font-size: 15px; letter-spacing: .02em; color: #fff; white-space: nowrap; }
.brand span { font-size: 12px; color: var(--cyan); font-weight: 700; }
/* "a wefav game" (studio.js): under the name while the cabinet is on show, gone at the first roll; the top bar is
   clear of the lane, where the first flick starts */
.brand #mark { margin-top: 3px; } body.rolled .brand #mark { display: none; }
.right { display: flex; align-items: center; gap: 6px; }
.chip { background: rgba(20, 16, 42, .78); border: 1px solid rgba(255, 138, 42, .6); color: var(--orange); border-radius: 999px;
  padding: 7px 10px; font-weight: 800; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(20, 16, 42, .78); font-size: 19px; }

#meter { position: fixed; right: 10px; top: 30%; height: 34%; width: 12px; border-radius: 8px; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22); overflow: visible; z-index: 2; pointer-events: none; }
#meterFill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: 8px;
  background: linear-gradient(to top, var(--cyan), var(--yellow) 60%, var(--pink)); }
#meterLast { position: absolute; left: -5px; right: -5px; height: 3px; background: #fff; border-radius: 2px; bottom: 0; opacity: 0; box-shadow: 0 0 8px #fff; }

#pops { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.pop { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 30px; color: var(--yellow);
  text-shadow: 0 0 14px var(--orange), 0 2px 0 #000; animation: pop 1.3s ease-out forwards; white-space: nowrap; text-align: center; }
.pop small { display: block; font-size: 14px; color: #fff; }
.pop.miss { color: #b9b2d8; font-size: 20px; text-shadow: 0 2px 0 #000; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
#banner { position: fixed; left: 50%; top: 24%; transform: translateX(-50%); font-size: 34px; font-weight: 900; color: var(--yellow);
  text-shadow: 0 0 22px var(--pink), 0 3px 0 #000; z-index: 3; pointer-events: none; text-align: center; white-space: nowrap; animation: bn .5s ease-out; }
@keyframes bn { from { transform: translateX(-50%) scale(.5); opacity: 0; } }

#bottom { position: fixed; left: 0; right: 0; bottom: 0; padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); z-index: 2;
  pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
/* the fitted prizes: one column down the left edge, opposite the power bar, so the foot of the lane stays clear for
   the ball; it scrolls rather than wraps. Each box is 38 px inside a 44 px tap target (the transparent border). */
#fitted { position: fixed; left: 2px; top: calc(72px + env(safe-area-inset-top)); max-height: calc(100% - 72px - 92px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; pointer-events: auto; z-index: 2; }
#fitted::-webkit-scrollbar { display: none; }
#fitted button { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 14px; border: 3px solid transparent; background: rgba(20, 16, 42, .8) padding-box;
  box-shadow: inset 0 0 0 1px rgba(45, 226, 230, .5); font-size: 20px; line-height: 1; font-family: var(--font); }
#hint { margin: 0; font-size: 14px; color: #d9d3f5; text-align: center; text-shadow: 0 1px 0 #000; min-height: 18px; }
#ballsLeft { font-size: 13px; letter-spacing: 3px; color: var(--lane); }

.sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 460px); max-height: 92vh; overflow: auto;
  background: rgba(20, 16, 42, .95); border: 1px solid var(--pink); border-radius: 18px; padding: 18px 16px; z-index: 5; text-align: center;
  box-shadow: 0 0 40px rgba(255, 61, 139, .35), 0 20px 60px rgba(0, 0, 0, .6); }
.sheet h2 { margin: 2px 0 6px; font-size: 26px; color: var(--yellow); text-shadow: 0 0 16px var(--orange); }
.sheet p { margin: 6px 0; font-size: 15px; line-height: 1.4; color: #e6e1fb; }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 12px !important; color: var(--cyan) !important; font-weight: 800; }
.say { font-style: italic; color: #b9b2d8 !important; }
#cards { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.card { display: grid; grid-template-columns: 52px 1fr; gap: 2px 10px; align-items: center; text-align: left; min-height: 72px; padding: 10px 12px;
  border-radius: 14px; border: 2px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); font-family: var(--font); }
.card i { grid-row: span 2; font-style: normal; font-size: 36px; text-align: center; }
.card b { font-size: 16px; color: #fff; }
.card span { font-size: 13.5px; color: #cfc8ee; line-height: 1.3; }
.card kbd { float: right; font: 700 11px ui-monospace, monospace; color: #8f88b8; border: 1px solid #5c5590; border-radius: 4px; padding: 1px 5px; }
.card.sel { border-color: var(--yellow); background: rgba(255, 225, 77, .12); box-shadow: 0 0 18px rgba(255, 225, 77, .35); }
body.touch .card kbd { display: none; }
.pill { min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); font-weight: 800; font-size: 15px; }
.pill.primary { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 0 18px rgba(255, 61, 139, .6); }
.pill:disabled { opacity: .45; box-shadow: none; }
.buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0 6px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0; font-size: 15px; text-align: left; }
#ballPick { display: flex; gap: 6px; }
#ballPick button { min-width: 46px; height: 46px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); font-size: 20px; font-family: var(--font); }
#ballPick button.sel { border-color: var(--yellow); }
#ballPick button:disabled { opacity: .35; }
#how { font-size: 13.5px !important; text-align: left; color: #cfc8ee !important; }
#shelfHome { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-size: 24px; min-height: 30px; }
#shelfHome span.no { filter: grayscale(1) brightness(.35); }
.more a { color: var(--cyan); font-size: 13px; }
#overMore { margin: 10px -4px 0; }
/* the vote and the fake door, between the buttons and the studio row */
#ask .q { font-size: 13px !important; color: #cfc8ee !important; margin: 6px 0 !important; }
#ask .q a { color: var(--cyan); }
/* the vote on one line that scrolls sideways, so the result stays short enough for the studio row */
#ask .chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
#ask .chips::-webkit-scrollbar { display: none; }
#ask .chips button { flex: none; white-space: nowrap; min-height: 44px; padding: 0 12px; border-radius: 22px; border: 1px solid rgba(45, 226, 230, .5); background: rgba(255, 255, 255, .05); color: #fff; font-size: 13px; font-weight: 700; }
#door button { min-height: 44px; width: 100%; margin: 8px 0 2px; padding: 6px 12px; border-radius: 14px; border: 1px dashed var(--yellow); background: rgba(255, 225, 77, .08); color: var(--yellow); font-size: 13px; font-weight: 700; }
@media (min-width: 900px) { #over { width: 600px; } }
#toast { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); max-width: min(90vw, 420px);
  background: rgba(10, 7, 22, .94); border: 1px solid var(--cyan); border-radius: 12px; padding: 10px 14px; font-size: 14px; line-height: 1.35; z-index: 6; text-align: center; pointer-events: none; }
@media (min-width: 900px) { .brand b { font-size: 22px; } .brand span { font-size: 14px; } #top { padding: 14px 20px; } #meter { right: calc(50% - 300px); } #fitted { left: calc(50% - 312px); top: 96px; max-height: calc(100% - 96px - 92px); }
  #hint { font-size: 15px; } .pop { font-size: 40px; } }
#replay { position: fixed; left: 56px; top: calc(62px + env(safe-area-inset-top)); z-index: 3; pointer-events: none; font: 800 14px ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .16em; color: #fff; text-shadow: 0 0 10px var(--pink); display: flex; align-items: center; gap: 7px; }
#replay i { width: 10px; height: 10px; border-radius: 50%; background: #ff2244; box-shadow: 0 0 10px #ff2244; animation: rec .7s steps(2) infinite; }
@keyframes rec { to { opacity: 0; } }
/* rigs, the ending and the result card */
#fitted button.rig { box-shadow: inset 0 0 0 1px #ff2244, inset 0 0 10px rgba(255, 34, 68, .6); }
#ending { text-align: center; }
.box { font-size: 96px; line-height: 1.2; margin: 10px 0; font-family: "Noto Color Emoji", sans-serif; }
.box.shut { animation: shake 1.1s ease-in-out infinite; }
.box.open { animation: reveal .6s ease-out; filter: drop-shadow(0 0 22px var(--yellow)); }
#endWhat { font-size: 18px !important; font-weight: 800; color: #fff !important; min-height: 1.4em; }
@keyframes shake { 0%, 60%, 100% { transform: rotate(0); } 66% { transform: rotate(-9deg); } 74% { transform: rotate(8deg); } 82% { transform: rotate(-6deg); } 90% { transform: rotate(4deg); } }
@keyframes reveal { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
#cardThumb { float: right; width: 76px; aspect-ratio: 4 / 5; margin: 0 0 6px 10px; border-radius: 8px; border: 1px solid rgba(255, 61, 139, .7);
  box-shadow: 0 0 14px rgba(255, 61, 139, .4); cursor: pointer; background: #14102a; }
#over .buttons { clear: both; }
@media (min-width: 900px) { #cardThumb { width: 110px; } }
body.touch #saveCard { display: none; } /* on a phone, Share sends the card itself; tapping the picture saves it */
/* Dot's face beside a line: pops in, blinks every few seconds (the blink picture shows only across the eyes) */
.say.with, #toast.with { display: flex; align-items: center; gap: 10px; text-align: left; }
#toast.with { padding: 8px 12px 8px 8px; width: min(90vw, 420px); }
.dot { position: relative; flex: none; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; background: #14102a;
  border: 2px solid var(--cyan); box-shadow: 0 0 12px rgba(45, 226, 230, .5); animation: dotIn .4s cubic-bezier(.3, 1.6, .5, 1); }
.dot.worried { border-color: #ff2244; box-shadow: 0 0 12px rgba(255, 34, 68, .6); }
.dot.side { border-color: var(--yellow); box-shadow: 0 0 12px rgba(255, 225, 77, .5); }
.dot.stunned { border-color: var(--orange); box-shadow: 0 0 16px rgba(255, 138, 42, .7); width: 64px; height: 64px; }
.dot img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dot .blink { clip-path: inset(44% 0 30% 0); opacity: 0; animation: blink 4.3s steps(1) 1.4s infinite; }
@keyframes blink { 0% { opacity: 1; } 3% { opacity: 0; } }
@keyframes dotIn { from { transform: scale(.2) rotate(-25deg); opacity: 0; } }
@media (min-width: 900px) { .dot { width: 60px; height: 60px; } .dot.stunned { width: 76px; height: 76px; } }
/* an unlock: the "New ball!" card at the counter (the ball turns on its own canvas), and new prizes on the result */
.unlock { display: flex; align-items: center; gap: 12px; text-align: left; margin: 10px 0 4px; padding: 10px 12px; border-radius: 16px;
  border: 2px solid var(--yellow); background: linear-gradient(135deg, rgba(255, 225, 77, .16), rgba(255, 61, 139, .1)); box-shadow: 0 0 22px rgba(255, 225, 77, .35);
  animation: reveal .5s ease-out; }
.unlock canvas { flex: none; width: 96px; height: 96px; }
.unlock i { flex: none; font-style: normal; font-size: 34px; font-family: var(--font); }
.unlock > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.unlock .kicker { margin: 0 !important; color: var(--yellow) !important; }
.unlock b { font-size: 17px; color: #fff; }
.unlock span { font-size: 13px; color: #cfc8ee; line-height: 1.3; }
.unlock .pill { margin-top: 6px; min-height: 44px; padding: 0 16px; font-size: 14px; background: var(--yellow); border-color: var(--yellow); color: #14102a; }
.unlock .pill:disabled { opacity: 1; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); color: #fff; }
#overUnlock { padding: 6px 12px; margin: 6px 0; gap: 10px; animation: none; }
#overUnlock i { font-size: 26px; } #overUnlock b { font-size: 14px; } #overUnlock span { display: none; }
@media (max-width: 899px) { .unlock canvas { width: 76px; height: 76px; } .unlock { padding: 8px 10px; } .unlock span { font-size: 12.5px; } }
.unlock .pill kbd { margin-left: 8px; font: 700 11px ui-monospace, monospace; border: 1px solid rgba(20, 16, 42, .5); border-radius: 4px; padding: 1px 5px; }
body.touch .unlock .pill kbd { display: none; }
/* The counter's Take button stays in view when the sheet scrolls (a New ball card plus four prizes is taller than a
   phone), and with a New ball card showing the prize cards tighten up */
.takebar { position: sticky; bottom: -18px; z-index: 1; margin: 0 -16px -18px; padding: 10px 16px 18px; background: linear-gradient(rgba(20, 16, 42, 0), #14102a 14px); }
@media (max-width: 899px) {
  #counter.tall h2 { display: none; }
  #counter.tall #cards { gap: 6px; margin: 8px 0 10px; }
  #counter.tall .card { min-height: 0; padding: 7px 10px; grid-template-columns: 40px 1fr; }
  #counter.tall .card i { font-size: 28px; }
  #counter.tall .card span { font-size: 12.5px; }
}
/* The top-shelf sheet sits low, under the box on top of the machine */
.sheet.low { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-height: 46vh; padding: 12px 14px; }
.sheet.low h2 { font-size: 22px; margin: 0 0 4px; }
/* Your shelf: the prize cabinet, over the whole screen */
#cabinet { position: fixed; inset: 0; z-index: 8; background: #0d0a1e; }
#cabC { width: 100%; height: 100%; display: block; touch-action: none; }
.cab-top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 12px; right: 8px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.cab-top button { pointer-events: auto; }
#cabInfo { position: absolute; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(92vw, 420px); padding: 12px 14px; border-radius: 16px;
  background: rgba(20, 16, 42, .95); border: 1px solid var(--yellow); box-shadow: 0 0 24px rgba(255, 225, 77, .3); text-align: left; animation: reveal .3s ease-out; }
#cabInfo b { display: block; font-size: 17px; color: #fff; margin-bottom: 2px; }
#cabInfo span { display: block; font-size: 14px; color: #cfc8ee; line-height: 1.35; }
#cabInfo small { display: block; margin-top: 6px; font-size: 12.5px; color: var(--cyan); }
.shelf-btn { display: block; margin: 12px auto 4px; background: rgba(255, 225, 77, .12); border-color: var(--yellow); color: var(--yellow); }
#overShelf { display: inline-block; margin: 0; }
#cashOut { margin-left: 8px; }
.takebar { display: flex; justify-content: center; gap: 0; }
#lanePick { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#lanePick button { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); font: 700 14px var(--font); color: #fff; }
#lanePick button.sel { border-color: var(--yellow); }
#lanePick button:disabled { opacity: .45; }
#overUnlock .pill { margin-top: 8px; background: var(--yellow); border-color: var(--yellow); color: #14102a; }
