:root { --red: #c3122f; --red2: #8d0a20; --chrome: linear-gradient(180deg, #ffffff, #c9cfd8 45%, #8d96a3 55%, #e9edf2); --ink: #1b1420; --cream: #f6eedd; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #14101c; color: #fff; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-tap-highlight-color: transparent; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
button { font: inherit; color: inherit; }

/* ---- loading: the marquee's bulbs light up as the machine loads */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #2a1430, #0e0a12 70%); transition: opacity .6s; }
#loader.done { opacity: 0; pointer-events: none; }
.lm { position: relative; width: min(78vw, 360px); aspect-ratio: 1.25; border-radius: 22px; background: linear-gradient(180deg, #d0163a, #8d0a20); box-shadow: 0 0 0 6px #e9edf2, 0 0 0 9px #8d96a3, 0 30px 80px rgba(0,0,0,.6); display: grid; place-items: center; }
.lbulbs { position: absolute; inset: 10px; pointer-events: none; }
.lb { position: absolute; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: #4a1a12; box-shadow: inset 0 -2px 3px rgba(0,0,0,.5); transition: background .2s, box-shadow .2s; }
.lb.on { background: #ffe9a8; box-shadow: 0 0 10px 3px rgba(255, 196, 90, .85), inset 0 -2px 3px rgba(255,160,40,.6); }
.lclaw { width: 34%; height: auto; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); animation: dangle 2.4s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes dangle { 50% { transform: rotate(4deg) translateY(4px); } }

/* ---- top buttons */
#top { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 10; display: flex; gap: 8px; opacity: 0; transition: opacity .6s .3s; }
body.live #top, body.live #deck { opacity: 1; }
#top button { height: 40px; min-width: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: rgba(20, 14, 26, .72); color: #fff; font-weight: 700; letter-spacing: .04em; cursor: pointer; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.22); backdrop-filter: blur(6px); }
#top #sound { padding: 0; width: 40px; display: grid; place-items: center; }
#sound svg { width: 22px; height: 22px; }
#sound .x { display: none; } #sound.off .x { display: block; } #sound.off .w { display: none; }
#top button:focus-visible, #deck button:focus-visible, .slot:focus-visible, .prize:focus-visible { outline: 3px solid #ffd27a; outline-offset: 2px; }

/* ---- the control deck */
#deck { position: fixed; z-index: 10; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; justify-content: space-between; gap: 28px;
  width: min(440px, calc(100vw - 24px)); padding: 14px 22px; border-radius: 26px; background: linear-gradient(180deg, #d81a3c, #9a0c24); box-shadow: 0 0 0 4px #e9edf2, 0 0 0 6px #7b8491, 0 18px 40px rgba(0,0,0,.55), inset 0 2px 0 rgba(255,255,255,.25); opacity: 0; transition: opacity .6s .3s; touch-action: none; user-select: none; -webkit-user-select: none; }
#pad { position: relative; width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #2d2d33, #0f0f12 70%); box-shadow: 0 0 0 5px #c9cfd8, 0 0 0 7px #6e7784, inset 0 6px 14px rgba(0,0,0,.8); cursor: grab; touch-action: none; }
#pad::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, #444 0 18%, transparent 19%); }
#ball { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8c9a, #e3132b 45%, #7d0614); box-shadow: 0 6px 10px rgba(0,0,0,.55); transition: transform .12s; pointer-events: none; }
#pad.on #ball { transition: none; }
#drop { width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font: 900 24px/1 "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: .06em; text-shadow: 0 2px 0 rgba(0,0,0,.35);
  background: radial-gradient(circle at 38% 30%, #ff9aa6, #f11d38 42%, #a5081d 78%); box-shadow: 0 0 0 7px #e9edf2, 0 0 0 9px #6e7784, 0 9px 0 #5e0612, 0 14px 22px rgba(0,0,0,.5); transition: transform .08s, box-shadow .08s; touch-action: manipulation; }
#drop.down, #drop:active { transform: translateY(6px); box-shadow: 0 0 0 7px #e9edf2, 0 0 0 9px #6e7784, 0 3px 0 #5e0612, 0 6px 12px rgba(0,0,0,.5); }
@media (min-width: 900px) and (pointer: fine) { #deck { width: 380px; } #pad { width: 96px; height: 96px; } #drop { width: 112px; height: 112px; font-size: 21px; } }

/* ---- the prize shelf */
#shelf { position: fixed; z-index: 9; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); max-width: calc(100vw - 150px); padding: 6px 10px 0; border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, rgba(30, 20, 34, .55), rgba(30, 20, 34, .2)); }
#shelf::after { content: ""; display: block; height: 7px; margin: 0 -10px; border-radius: 3px; background: var(--chrome); box-shadow: 0 4px 8px rgba(0,0,0,.4); }
.shelf-row { display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior: contain; }
.shelf-row::-webkit-scrollbar { display: none; }
.prize { flex: 0 0 auto; width: 54px; height: 54px; padding: 0; border: 0; background: none; cursor: pointer; animation: plop .5s cubic-bezier(.3, 1.6, .5, 1); }
.prize img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)); }
@keyframes plop { from { transform: translateY(-30px) scale(.4); opacity: 0; } }

/* ---- the Work drawer */
#drawer { position: fixed; inset: 0; z-index: 30; display: grid; align-items: end; justify-items: center; background: rgba(10, 6, 14, .0); pointer-events: none; transition: background .3s; }
#drawer.open { background: rgba(10, 6, 14, .6); pointer-events: auto; }
.drawer-box { position: relative; width: min(980px, 100vw); max-height: min(78vh, 760px); max-height: min(78dvh, 760px); overflow-y: auto; overscroll-behavior: contain; padding: 56px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; background: linear-gradient(180deg, #2b1f33, #1a1220); box-shadow: 0 -4px 0 #e9edf2, 0 -7px 0 #6e7784, 0 -20px 60px rgba(0,0,0,.6); transform: translateY(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
#drawer.open .drawer-box { transform: none; }
#drawer-close, #case-close { position: absolute; top: 10px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 22px; background: rgba(255,255,255,.12); color: #fff; font: 28px/44px system-ui, sans-serif; cursor: pointer; z-index: 2; }
#drawer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.slot { display: grid; grid-template-rows: auto auto auto; justify-items: center; gap: 2px; padding: 8px 6px 12px; border: 0; border-radius: 14px; background: rgba(255,255,255,.05); cursor: pointer; text-align: center; }
.slot:hover { background: rgba(255,255,255,.1); }
.slot-toy { width: 104px; height: 104px; display: grid; place-items: center; }
.slot-toy img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(0,0,0,.45)); }
.slot-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.slot-client { font-size: 11px; letter-spacing: .08em; opacity: .6; }
.slot.won .slot-toy { background: radial-gradient(circle, rgba(255, 210, 122, .22), transparent 70%); }
@media (max-width: 520px) { #drawer-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } .slot-toy { width: 84px; height: 84px; } .slot-name { font-size: 12.5px; } }

/* ---- the prize tag and the work */
#case { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; background: rgba(10, 6, 14, 0); transition: background .3s; }
#case.open { background: rgba(10, 6, 14, .62); }
.case-card { position: relative; width: min(860px, 100vw); height: min(92vh, 980px); height: min(92dvh, 980px); border-radius: 22px 22px 0 0; background: var(--cream); color: var(--ink); box-shadow: 0 -20px 60px rgba(0,0,0,.6); transform: translateY(100%); transition: transform .4s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
#case.open .case-card { transform: none; }
#case-close { background: rgba(27, 20, 32, .1); color: var(--ink); }
#case-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 18px 20px calc(30px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.tag { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin: 0 48px 18px 0; }
#tag-toy { width: 132px; height: 132px; }
#tag-toy img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 6px rgba(0,0,0,.25)); }
#case.fresh #tag-toy img { animation: plop .6s cubic-bezier(.3, 1.6, .5, 1); }
.tag-card { position: relative; justify-self: start; padding: 14px 18px 14px 34px; border-radius: 6px 14px 14px 6px; background: #fff; box-shadow: 0 2px 0 #e2d6bf, 0 8px 18px rgba(60, 30, 10, .12); transform: rotate(-1.5deg); }
.tag-hole { position: absolute; left: 12px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--cream); box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.tag-card::before { content: ""; position: absolute; left: -26px; top: 50%; width: 42px; height: 2px; background: #c3122f; transform: rotate(-8deg); }
#tag-name { margin: 0; font: 900 clamp(22px, 4.6vw, 34px)/1.05 "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: -.01em; }
#tag-client { margin: 4px 0 0; font-size: 12px; letter-spacing: .14em; font-weight: 700; color: #c3122f; }
#case-work { --ab-chrome: 150px; --ab-muted: #6b5d63; --ab-accent: #c3122f; }
#case-work .ab-lede { font-size: 17px; max-width: 60ch; }
#case-work .ab-heading { font-size: 18px; margin-top: 8px; }
#case-work .ab-credits { white-space: pre-line; }
@media (max-width: 600px) { #tag-toy { width: 96px; height: 96px; } .tag { gap: 10px; } #case-scroll { padding: 14px 14px calc(26px + env(safe-area-inset-bottom)); } .case-card { height: 94dvh; } }

/* wide screens: the control deck stands at the side of the machine */
body.side #deck { left: auto; right: max(28px, calc((100vw - 1500px) / 2)); bottom: 50%; transform: translateY(50%); flex-direction: column; width: 200px; gap: 30px; padding: 26px 20px; }

/* the About slot and card (from /data.json) */
.about-tag { display: grid; place-items: center; width: 72px; height: 86px; border-radius: 8px 8px 14px 14px; background: #fff; color: #c3122f; font: 900 26px/1 "Arial Black", Arial, sans-serif; transform: rotate(-4deg); box-shadow: 0 4px 0 #e2d6bf; position: relative; }
.about-tag::before { content: ""; position: absolute; top: 9px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #2a1b30; }
.about { max-width: 640px; }
.about-bio { font-size: 19px; line-height: 1.45; margin: 0 0 14px; }
.about-contact { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 22px; font-size: 15px; }
.about-contact a { color: #c3122f; font-weight: 700; }
.about-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.about-jobs li { padding-top: 12px; border-top: 1px solid rgba(27, 20, 32, .12); }
.about-jobs strong { display: block; font-size: 16px; }
.about-co { font-size: 11px; letter-spacing: .14em; font-weight: 700; color: #c3122f; }
.about-jobs p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.45; opacity: .85; }
:focus-visible { outline: 3px solid #ffd27a; outline-offset: 2px; }
#tag-toy:empty { display: none; }
.tag:has(#tag-toy:empty) .tag-card::before { display: none; }
