:root {
  --ink: #f7f4ff;
  --muted: #aaa3bd;
  --night: #090617;
  --panel: #110b26;
  --panel-2: #181034;
  --purple: #7d3bff;
  --purple-dark: #3d137d;
  --pink: #ff3eb5;
  --cyan: #29e7ff;
  --yellow: #ffe45e;
  --green: #5cffba;
  --border: rgba(205, 190, 255, 0.16);
  --cabinet-top: #5925a7;
  --cabinet-top-dark: #351168;
  --cabinet-edge: #8b4cff;
  --cabinet-side: #32116b;
  --cabinet-light: #6425b5;
  --cabinet-mid: #5c20ad;
  --cabinet-deep: #2f0d69;
  --cabinet-border: #7c3ce6;
  --deck-start: #512091;
  --deck-end: #321164;
  --pixel: "Press Start 2P", monospace;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 70% 12%, rgba(80, 32, 170, .24), transparent 32%),
    radial-gradient(circle at 10% 70%, rgba(16, 151, 185, .09), transparent 28%),
    linear-gradient(145deg, #0d0820 0%, #070513 55%, #0c071d 100%);
  font-family: var(--sans);
  overflow-x: hidden;
}
body.modal-open { overflow: hidden; }

body[data-skin="lagoon"] { --cabinet-top:#0877a6; --cabinet-top-dark:#064c79; --cabinet-edge:#27dfff; --cabinet-side:#063f69; --cabinet-light:#078ab8; --cabinet-mid:#046f9e; --cabinet-deep:#033657; --cabinet-border:#24ccea; --deck-start:#087aa5; --deck-end:#064063; }
body[data-skin="slime"] { --cabinet-top:#3f9a37; --cabinet-top-dark:#185427; --cabinet-edge:#7dff6d; --cabinet-side:#174e26; --cabinet-light:#4bae3e; --cabinet-mid:#2b8737; --cabinet-deep:#103d21; --cabinet-border:#72df61; --deck-start:#3e973b; --deck-end:#174d2d; }
body[data-skin="sunset"] { --cabinet-top:#cb3a66; --cabinet-top-dark:#771f54; --cabinet-edge:#ff7184; --cabinet-side:#722049; --cabinet-light:#dd4e62; --cabinet-mid:#b52e68; --cabinet-deep:#5b1741; --cabinet-border:#ff718f; --deck-start:#c83c68; --deck-end:#691c51; }
body[data-skin="midnight"] { --cabinet-top:#24152f; --cabinet-top-dark:#0d0913; --cabinet-edge:#ff3eb5; --cabinet-side:#0c0912; --cabinet-light:#35204d; --cabinet-mid:#251536; --cabinet-deep:#08060c; --cabinet-border:#d92f9b; --deck-start:#2f1a43; --deck-end:#0c0912; }
body[data-skin="gold"] { --cabinet-top:#bd7414; --cabinet-top-dark:#70410b; --cabinet-edge:#ffe45e; --cabinet-side:#6a3b08; --cabinet-light:#d9911f; --cabinet-mid:#b96812; --cabinet-deep:#573005; --cabinet-border:#ffd24b; --deck-start:#b96e14; --deck-end:#643807; }
body[data-theme="candy"] { --pink:#ff79c8; --cyan:#74dfff; --yellow:#fff08a; --green:#93ffd0; --purple:#9d67ff; --purple-dark:#56308f; }
body[data-theme="mint"] { --pink:#77ffc0; --cyan:#ad8cff; --yellow:#eaff72; --green:#65f5a5; --purple:#7956c7; --purple-dark:#37236b; }
body[data-theme="fire"] { --pink:#ff5b3d; --cyan:#ff9d2e; --yellow:#ffe45e; --green:#ffbe4d; --purple:#bd3c35; --purple-dark:#6b201f; }
body[data-background="grid"] { background: radial-gradient(circle at 50% 80%, rgba(41,231,255,.18), transparent 30%), linear-gradient(145deg, #071324, #030611 75%); }
body[data-background="grid"] .stars { background-image: linear-gradient(rgba(41,231,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(41,231,255,.12) 1px, transparent 1px); background-size: 52px 52px; transform: perspective(500px) rotateX(55deg) scale(1.65); transform-origin: center bottom; mask-image: linear-gradient(to top, black, transparent 82%); }
body[data-background="city"] { background: radial-gradient(circle at 70% 18%, rgba(255,118,77,.38), transparent 22%), radial-gradient(circle at 35% 70%, rgba(255,62,181,.2), transparent 34%), linear-gradient(155deg, #3c103c, #10071e 55%, #070511); }
body[data-background="city"] .stars { background-image: linear-gradient(90deg, transparent 0 8%, rgba(255,118,77,.12) 8% 9%, transparent 9% 20%); background-size: 110px 100%; opacity: .7; }
body[data-background="nebula"] { background: radial-gradient(ellipse at 72% 25%, rgba(66,103,231,.35), transparent 28%), radial-gradient(ellipse at 18% 68%, rgba(103,55,190,.27), transparent 35%), radial-gradient(circle at 52% 72%, rgba(41,231,255,.12), transparent 28%), #030611; }
body[data-background="nebula"] .stars { opacity: .85; background-size: 90px 90px, 145px 145px; }

button, input { font: inherit; }
button { color: inherit; }

button:focus-visible, input:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

.stars, .stars::before, .stars::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.5) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(150,102,255,.55) 1px, transparent 1.5px);
  background-position: 12px 25px, 80px 110px;
  background-size: 130px 130px, 190px 190px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.stars::before, .stars::after { content: ""; opacity: .4; transform: rotate(22deg) scale(1.2); }
.stars::after { transform: rotate(-18deg) scale(.8); opacity: .25; }

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 72px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(7, 5, 19, .62);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: white;
  text-decoration: none;
  font-family: var(--pixel);
  font-size: 16px;
  letter-spacing: -.6px;
}

.brand em { color: var(--pink); font-style: normal; text-shadow: 0 0 18px rgba(255,62,181,.7); }

.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: var(--night);
  background: var(--cyan);
  clip-path: polygon(15% 0, 85% 0, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0 85%, 0 15%);
  box-shadow: 0 0 22px rgba(41,231,255,.45);
}

.topbar-right, .machine-status { display: flex; align-items: center; }
.topbar-right { gap: 18px; }
.machine-status { gap: 9px; color: #8d869e; font-family: var(--pixel); font-size: 8px; }
.machine-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.ticket-counter { height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--yellow); background: rgba(255,228,94,.07); border: 1px solid rgba(255,228,94,.22); border-radius: 7px; transition: transform .25s, background .25s; }
.ticket-counter > span { font-size: 17px; }
.ticket-counter strong { font-family: var(--pixel); font-size: 10px; }
.ticket-counter small { color: #9c92a9; font-family: var(--pixel); font-size: 6px; }
.ticket-counter.bump { transform: scale(1.13) rotate(-2deg); background: rgba(255,228,94,.2); }
.shop-button { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 14px; color: #f5edff; background: linear-gradient(135deg, #6c32bf, #3e1a77); border: 1px solid #8e58dc; border-radius: 7px; cursor: pointer; font-family: var(--pixel); font-size: 7px; box-shadow: 0 0 16px rgba(125,59,255,.17); transition: transform .15s, filter .15s; }
.shop-button .shop-star { color: var(--yellow); }
.shop-button:hover { transform: translateY(-1px); filter: brightness(1.12); }

.app-shell {
  width: min(1360px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(600px, 1fr);
  gap: clamp(50px, 7vw, 108px);
  min-height: calc(100vh - 84px);
  padding: 66px 0 80px;
}

.task-panel { max-width: 400px; }
.task-panel > h1 { margin-top: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--pink);
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 1px;
}

.eyebrow span {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 7px;
  box-shadow: 0 0 12px rgba(255,62,181,.2);
}

h1, .stage-heading h2 {
  margin: 20px 0 13px;
  font-family: var(--pixel);
  line-height: 1.45;
  letter-spacing: -1px;
}
h1 { max-width: 370px; font-size: clamp(25px, 2.4vw, 34px); }
.stage-heading h2 { margin-bottom: 0; font-size: 23px; }
.stage-heading h2 { margin-top: 0; }
.intro { max-width: 360px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }

.task-form { margin-top: 34px; }
.task-form label, .task-list-heading {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: .5px;
  color: #a7a0b6;
}

.input-wrap {
  height: 58px;
  display: flex;
  margin-top: 10px;
  padding: 5px 6px 5px 17px;
  background: rgba(28, 18, 57, .75);
  border: 1px solid rgba(167, 130, 255, .3);
  border-radius: 8px;
  transition: .2s ease;
}
.input-wrap:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(41,231,255,.08), inset 0 0 16px rgba(41,231,255,.04); }
.input-wrap input { min-width: 0; flex: 1; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 15px; }
.input-wrap input::placeholder { color: #716a83; }
.input-wrap button {
  width: 45px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff54c0, #f3269d);
  color: white;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
  box-shadow: 0 0 18px rgba(255,62,181,.27);
  transition: transform .15s, filter .15s;
}
.input-wrap button:hover { transform: scale(1.04); filter: brightness(1.12); }
.input-note { margin: 7px 1px 0; text-align: right; color: #645e71; font-size: 10px; }

.task-list-heading { display: flex; justify-content: space-between; margin: 29px 0 11px; }
.task-list-heading span:last-child { color: var(--cyan); }
.task-list { display: grid; gap: 8px; max-height: 285px; overflow-y: auto; padding-right: 3px; }
.task-list::-webkit-scrollbar { width: 4px; }
.task-list::-webkit-scrollbar-thumb { background: #493273; border-radius: 3px; }

.task-item {
  min-height: 53px;
  display: grid;
  grid-template-columns: 28px 1fr 32px 30px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 12px;
  background: rgba(24, 16, 52, .76);
  border: 1px solid var(--border);
  border-radius: 8px;
  animation: slideIn .25s ease-out;
}
.task-item.current-task { border-color: rgba(255,228,94,.6); background: rgba(52, 36, 69, .9); box-shadow: inset 3px 0 0 var(--yellow), 0 0 18px rgba(255,228,94,.06); }
.task-item.current-task .task-name::after { content: "CURRENT"; margin-left: 8px; color: var(--yellow); font-family: var(--pixel); font-size: 5px; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }
.task-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--night); font-size: 13px; font-weight: 800; box-shadow: 0 0 12px color-mix(in srgb, var(--task-color), transparent 60%); background: var(--task-color); }
.task-name { overflow: hidden; color: #e7e3ef; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.delete-task { width: 28px; height: 28px; border: 0; border-radius: 5px; color: #71697f; background: transparent; cursor: pointer; font-size: 18px; }
.delete-task:hover { color: var(--pink); background: rgba(255,62,181,.09); }
.delete-task:disabled { color: #4c4656; cursor: not-allowed; background: transparent; }
.complete-task { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(92,255,186,.38); border-radius: 50%; color: var(--green); background: rgba(92,255,186,.06); cursor: pointer; font-size: 15px; font-weight: 800; transition: transform .15s, background .15s; }
.complete-task:hover { transform: scale(1.08); background: rgba(92,255,186,.17); }
.complete-task:disabled { color: #5f5968; border-color: #4b4356; background: transparent; cursor: not-allowed; transform: none; }

.empty-list {
  height: 112px;
  display: grid;
  justify-items: center;
  align-content: center;
  color: #6d6679;
  border: 1px dashed rgba(180, 153, 243, .17);
  border-radius: 8px;
}
.empty-list.hidden { display: none; }
.empty-orbit { width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: 7px; border: 1px solid #50455f; border-radius: 50%; }
.empty-list p { margin: 0; color: #8b8398; font-size: 12px; font-weight: 600; }
.empty-list > span { margin-top: 3px; font-size: 10px; }

.clear-button { display: none; margin: 13px 0 0 auto; border: 0; color: #716a7f; background: transparent; font-family: var(--pixel); font-size: 7px; cursor: pointer; }
.clear-button.visible { display: block; }
.clear-button:hover { color: var(--pink); }

.mission-card {
  margin-top: 18px;
  padding: 17px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(66,42,23,.65), rgba(35,21,54,.95));
  border: 1px solid rgba(255,228,94,.5);
  border-radius: 10px;
  box-shadow: inset 0 0 24px rgba(255,228,94,.05), 0 0 24px rgba(255,228,94,.07);
  animation: missionIn .35s ease-out;
}
.mission-card[hidden] { display: none; }
@keyframes missionIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.mission-topline { display: flex; justify-content: space-between; color: var(--yellow); font-family: var(--pixel); font-size: 6px; letter-spacing: .5px; }
.mission-topline span:last-child { color: var(--pink); }
.mission-content { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px; margin: 16px 0; }
.mission-toy { display: grid; place-items: center; width: 56px; height: 56px; font-size: 38px; background: rgba(255,255,255,.06); border-radius: 9px; filter: drop-shadow(0 4px 2px rgba(0,0,0,.25)); }
.mission-content div { min-width: 0; display: grid; gap: 6px; }
.mission-content small { color: #9a8fa8; font-family: var(--pixel); font-size: 5px; line-height: 1.6; }
.mission-content strong { overflow: hidden; color: white; font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.complete-button { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #181020; background: var(--green); border: 0; border-radius: 6px; cursor: pointer; font-family: var(--pixel); font-size: 7px; box-shadow: 0 0 18px rgba(92,255,186,.16); transition: transform .15s, filter .15s; }
.complete-button span { font-family: var(--sans); font-size: 17px; font-weight: 900; }
.complete-button:hover { transform: translateY(-1px); filter: brightness(1.08); }

.tiny-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 29px;
  padding: 13px 15px;
  color: #827a8f;
  background: rgba(255,255,255,.025);
  border-left: 2px solid #613aaa;
}
.tiny-tip span { color: var(--yellow); font-family: var(--pixel); font-size: 7px; }
.tiny-tip p { margin: 0; font-size: 11px; }

.game-stage { min-width: 0; }
.stage-heading { max-width: 710px; display: flex; align-items: flex-end; justify-content: space-between; margin: 0 auto 23px; }
.credit-pill { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; color: #8c8598; font-family: var(--pixel); font-size: 7px; }
.credit-pill span { display: grid; place-items: center; width: 25px; height: 25px; color: var(--yellow); border: 1px solid rgba(255,228,94,.45); border-radius: 50%; font-family: var(--sans); font-size: 16px; box-shadow: 0 0 10px rgba(255,228,94,.1); }
.credit-pill.locked { color: var(--pink); }
.credit-pill.locked span { color: var(--pink); border-color: rgba(255,62,181,.45); }

.machine-wrap { position: relative; width: min(710px, 100%); margin: 0 auto; }
.machine-glow { position: absolute; inset: 12% 5% 3%; background: rgba(92, 32, 220, .28); filter: blur(60px); border-radius: 45%; }
.machine { position: relative; z-index: 1; width: 100%; filter: drop-shadow(0 26px 35px rgba(0,0,0,.45)); }

.machine-top {
  height: 112px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 25px;
  background: linear-gradient(180deg, var(--cabinet-top) 0%, var(--cabinet-top-dark) 100%);
  border: 4px solid var(--cabinet-edge);
  border-bottom: 7px solid #26104f;
  clip-path: polygon(3% 0, 97% 0, 100% 18%, 100% 100%, 0 100%, 0 18%);
  box-shadow: inset 0 8px 0 rgba(255,255,255,.08), inset 0 -7px 0 #26104f, 0 0 30px rgba(125,59,255,.33);
}

.marquee {
  width: 70%;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  color: var(--yellow);
  text-align: center;
  background: linear-gradient(180deg, #22113e, #130923);
  border: 2px solid #af70ff;
  border-radius: 8px;
  box-shadow: inset 0 0 18px rgba(255,62,181,.16), 0 0 15px rgba(255,62,181,.13);
}
.marquee div { display: grid; gap: 6px; }
.marquee small { color: var(--pink); font-family: var(--pixel); font-size: 7px; }
.marquee strong { font-family: var(--pixel); font-size: clamp(18px, 3vw, 28px); letter-spacing: 1px; text-shadow: 3px 3px 0 #cb2a9b, 0 0 18px rgba(255,228,94,.4); }
.marquee-star { color: var(--cyan); font-size: 18px; text-shadow: 0 0 12px var(--cyan); animation: twinkle 1.3s steps(2) infinite; }
@keyframes twinkle { 50% { opacity: .25; transform: scale(.75); } }
.bulb { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #ff7ccc; box-shadow: 0 0 8px #ff3eb5; }
.b1 { left: 13px; top: 24px; } .b2 { left: 13px; top: 51px; } .b3 { left: 13px; top: 78px; }
.b4 { right: 13px; top: 24px; } .b5 { right: 13px; top: 51px; } .b6 { right: 13px; top: 78px; }

.machine-body {
  margin: -2px 12px 0;
  padding: 0 18px 21px;
  background: linear-gradient(90deg, var(--cabinet-side), var(--cabinet-light) 11%, var(--cabinet-mid) 88%, var(--cabinet-deep));
  border: 4px solid var(--cabinet-border);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: inset 7px 0 0 rgba(255,255,255,.05), inset -7px 0 0 rgba(0,0,0,.16);
}

.glass {
  height: 430px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(255,255,255,.055) 0 8%, transparent 8% 25%, rgba(255,255,255,.025) 25% 31%, transparent 31%),
    radial-gradient(circle at 50% 75%, rgba(73,31,138,.35), transparent 53%),
    linear-gradient(#09051b, #10072b 72%, #1a0a38);
  border: 4px solid #271047;
  border-top: 0;
  box-shadow: inset 0 0 30px rgba(25,221,255,.07);
}
.glass::before { content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none; border: 1px solid rgba(87,217,255,.18); }
.glass-shine { position: absolute; z-index: 7; top: 0; left: 10%; width: 9%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.035), transparent); transform: skewX(-10deg); pointer-events: none; }
.back-sign { position: absolute; top: 93px; width: 100%; color: rgba(143,112,197,.24); text-align: center; font-family: var(--pixel); font-size: 7px; line-height: 2; }
.back-sign strong { font-size: 11px; }
.rail { position: absolute; z-index: 4; top: 27px; left: 4%; width: 92%; height: 9px; background: #2a1552; border: 2px solid #583994; border-radius: 4px; box-shadow: 0 0 8px rgba(41,231,255,.13); }
.rail span { position: absolute; top: -5px; left: calc(var(--claw-x, 50%) - 10px); width: 21px; height: 14px; border-radius: 3px; background: #ba96e2; transition: left .8s cubic-bezier(.65,.05,.36,1); }

.claw { --drop: 0px; position: absolute; z-index: 5; top: 34px; left: var(--claw-x, 50%); width: 88px; height: 142px; transform: translateX(-50%) translateY(var(--drop)); transition: left .8s cubic-bezier(.65,.05,.36,1), transform .75s cubic-bezier(.45,.05,.55,.95); }
.aiming .claw { transition: left .06s linear, transform .75s cubic-bezier(.45,.05,.55,.95); }
.aiming .rail span { transition: left .06s linear; }
.claw-cable { width: 4px; height: 65px; margin: 0 auto; background: repeating-linear-gradient(180deg, #b6a1d3 0 4px, #5c4778 4px 8px); box-shadow: 0 0 5px rgba(255,255,255,.2); }
.claw-head { position: relative; width: 39px; height: 28px; margin: -2px auto 0; background: linear-gradient(#efe5ff, #876aa9); border: 3px solid #51376b; border-radius: 8px 8px 13px 13px; box-shadow: inset 0 3px 0 white; }
.claw-head i { position: absolute; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: #302040; }
.claw-head i:nth-child(1) { left: 6px; } .claw-head i:nth-child(2) { left: 15px; } .claw-head i:nth-child(3) { right: 6px; }
.claw-arm { position: absolute; top: 85px; width: 40px; height: 44px; border-bottom: 5px solid #cbb2e8; transition: transform .25s; }
.claw-arm.left { left: 6px; border-left: 5px solid #cbb2e8; border-radius: 0 0 0 70%; transform: rotate(-18deg); transform-origin: top right; }
.claw-arm.right { right: 6px; border-right: 5px solid #cbb2e8; border-radius: 0 0 70% 0; transform: rotate(18deg); transform-origin: top left; }
.claw.grabbing .claw-arm.left { transform: rotate(11deg); }
.claw.grabbing .claw-arm.right { transform: rotate(-11deg); }
.caught-prize { position: absolute; display: none; top: 96px; left: 50%; width: 58px; height: 58px; transform: translateX(-50%); filter: drop-shadow(0 0 13px var(--caught-color, var(--pink))) drop-shadow(0 5px 3px rgba(0,0,0,.45)); font-size: 42px; line-height: 1; }
.claw.has-prize .caught-prize { display: grid; place-items: center; }

.prize-bed { position: absolute; z-index: 3; inset: auto 5% 23px; height: 156px; }
.prize {
  --size: 62px;
  position: absolute;
  left: var(--x);
  bottom: var(--y);
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  transform: translateX(-50%) rotate(var(--r));
  animation: prizePop .35s ease-out backwards;
  animation-delay: var(--delay);
}
@keyframes prizePop { from { opacity: 0; transform: translateX(-50%) translateY(-18px) rotate(var(--r)) scale(.4); } }
.prize::before { content: ""; position: absolute; z-index: -1; inset: 8px; border-radius: 50%; background: var(--prize-color); opacity: .28; filter: blur(14px); }
.prize::after { content: ""; position: absolute; z-index: -1; left: 16%; right: 16%; bottom: 3px; height: 10px; border-radius: 50%; background: #030107; filter: blur(4px); }
.prize-face { font-size: 44px; line-height: 1; filter: drop-shadow(0 4px 2px rgba(0,0,0,.4)); }
.prize.selected { opacity: 0; transition: opacity .15s; }

.empty-machine { position: absolute; z-index: 6; inset: 126px auto auto 50%; width: max-content; transform: translateX(-50%); display: grid; justify-items: center; padding: 10px 14px; color: #8f79ae; background: rgba(8,4,21,.82); border: 1px solid rgba(147,110,207,.32); border-radius: 5px; box-shadow: 0 7px 22px rgba(0,0,0,.4); font-family: var(--pixel); font-size: 6px; line-height: 1.8; text-align: center; }
.empty-machine.hidden { display: none; }
.empty-machine strong { color: var(--cyan); font-size: 7px; }
.chute-shadow { position: absolute; z-index: 2; left: 50%; bottom: -2px; width: 122px; height: 25px; transform: translateX(-50%); border-radius: 50%; background: #05020c; filter: blur(4px); }

.control-deck {
  min-height: 148px;
  display: grid;
  grid-template-columns: 42% 1fr;
  background: linear-gradient(160deg, var(--deck-start), var(--deck-end));
  border: 4px solid #2a0e58;
  border-top: 7px solid #8a4edb;
  box-shadow: inset 0 9px 0 rgba(255,255,255,.05);
}
.chute { display: grid; place-items: center; border-right: 2px solid rgba(24,7,49,.5); }
.chute-door { width: min(162px, 76%); height: 78px; position: relative; display: grid; place-items: center; overflow: hidden; background: #120720; border: 6px solid #271047; border-radius: 9px; box-shadow: inset 0 9px 15px #030105, 0 2px 0 rgba(255,255,255,.06); }
.chute-door::after { content: ""; position: absolute; inset: 15px 24px; border-radius: 50%; background: #050208; box-shadow: 0 -3px 0 #32134f; }
.chute-door span { position: absolute; top: 5px; z-index: 2; color: #725b84; font-family: var(--pixel); font-size: 5px; letter-spacing: 1px; }
.chute-door i { position: absolute; z-index: 3; bottom: 10px; width: 50px; height: 4px; background: #391858; border-radius: 5px; }
.controls { display: flex; align-items: center; justify-content: space-evenly; padding: 10px; }
.joystick { --lever-angle: 0deg; width: 102px; display: grid; justify-items: center; padding: 12px 5px 4px; border-radius: 12px; cursor: grab; touch-action: none; user-select: none; transition: background .2s, box-shadow .2s; }
.joystick:hover { background: rgba(255,255,255,.035); }
.joystick:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.joystick.dragging { cursor: grabbing; background: rgba(41,231,255,.06); box-shadow: inset 0 0 0 1px rgba(41,231,255,.2); }
.stick { width: 12px; height: 49px; position: relative; z-index: 2; background: linear-gradient(90deg, #a487bd, #eee0ff, #74568c); border-radius: 5px; transform: rotate(-7deg); transform-origin: bottom; transition: transform .25s; }
.stick span { position: absolute; left: 50%; top: -21px; width: 39px; height: 39px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 35% 28%, #ff91db, #f02eaa 48%, #9f126c); border: 3px solid #691450; box-shadow: inset 3px 3px 0 rgba(255,255,255,.22), 0 0 15px rgba(255,62,181,.45); }
.joystick .stick { transform: rotate(var(--lever-angle)); }
.joystick.dragging .stick { transition: none; }
.stick-base { width: 68px; height: 20px; margin-top: -7px; border-radius: 50%; background: linear-gradient(#3b185e, #180926); border: 3px solid #1b0a32; }
.joystick small { margin-top: 7px; color: #b395ca; font-family: var(--pixel); font-size: 5px; white-space: nowrap; }

.play-button {
  width: 116px;
  height: 116px;
  position: relative;
  display: grid;
  place-content: center;
  gap: 7px;
  color: #35121e;
  background: radial-gradient(circle at 38% 27%, #fff9a8, #ffe45e 42%, #ecac18 75%);
  border: 7px solid #6f3a16;
  border-radius: 50%;
  box-shadow: inset 0 5px 0 rgba(255,255,255,.58), inset 0 -8px 0 rgba(157,76,7,.25), 0 6px 0 #2a103c, 0 0 23px rgba(255,228,94,.34);
  cursor: pointer;
  transition: transform .15s, filter .15s;
}
.play-button strong { font-family: var(--pixel); font-size: 14px; }
.play-button small { font-family: var(--pixel); font-size: 6px; }
.play-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.play-button:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 5px 0 rgba(255,255,255,.58), inset 0 -8px 0 rgba(157,76,7,.25), 0 2px 0 #2a103c; }
.play-button:disabled { cursor: not-allowed; filter: grayscale(.78) brightness(.55); box-shadow: inset 0 5px 0 rgba(255,255,255,.15), 0 5px 0 #21102e; }
.button-light { position: absolute; top: 12px; right: 21px; width: 8px; height: 8px; border-radius: 50%; background: white; opacity: .75; }

.machine-feet { display: flex; justify-content: space-between; padding: 0 64px; }
.machine-feet span { width: 91px; height: 18px; background: #1d093b; border-radius: 0 0 8px 8px; box-shadow: inset 0 -5px 0 #0b0319; }
.game-hint { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 18px 0 0; color: #777083; font-size: 11px; }
.game-hint span { color: var(--cyan); }
.game-hint.ready { color: #b3acbd; }

.collection-shelf { width: min(710px, 100%); margin: 34px auto 0; padding: 20px 20px 15px; background: linear-gradient(160deg, rgba(29,18,53,.92), rgba(12,7,27,.96)); border: 1px solid rgba(165,126,235,.25); border-radius: 12px; box-shadow: inset 0 0 25px rgba(125,59,255,.04), 0 16px 35px rgba(0,0,0,.2); }
.collection-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.collection-heading span { color: var(--pink); font-family: var(--pixel); font-size: 6px; letter-spacing: .7px; }
.collection-heading h3 { margin: 6px 0 0; font-family: var(--pixel); font-size: 14px; }
.collection-heading strong { padding: 7px 9px; color: var(--yellow); background: rgba(255,228,94,.07); border: 1px solid rgba(255,228,94,.22); border-radius: 5px; font-family: var(--pixel); font-size: 7px; }
.shelf-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 7px; padding: 8px 8px 15px; background: repeating-linear-gradient(to bottom, transparent 0 84px, #211035 84px 89px, #6a3aa2 89px 92px, #160b26 92px 98px); border-radius: 7px; }
.shelf-slot { min-width: 0; height: 82px; display: grid; place-items: center; align-content: center; gap: 5px; position: relative; background: radial-gradient(circle at 50% 65%, rgba(125,59,255,.13), transparent 62%); border: 1px solid rgba(255,255,255,.06); border-radius: 6px 6px 2px 2px; }
.shelf-slot.collected { border-color: rgba(41,231,255,.2); box-shadow: inset 0 0 13px rgba(41,231,255,.035); }
.shelf-toy { position: relative; z-index: 1; display: grid; place-items: center; min-height: 48px; font-size: 38px; line-height: 1; filter: drop-shadow(0 4px 2px rgba(0,0,0,.4)); }
.shelf-slot.locked .shelf-toy { filter: grayscale(1) brightness(0) drop-shadow(1px 0 #51485c) drop-shadow(-1px 0 #51485c) drop-shadow(0 1px #51485c) drop-shadow(0 -1px #51485c); opacity: .72; }
.shelf-slot small { max-width: 90%; overflow: hidden; color: #93889e; font-size: 7px; font-weight: 700; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.shelf-slot.locked small { color: #4f4857; font-family: var(--pixel); font-size: 5px; letter-spacing: 1px; }
.shelf-slot.new-prize { animation: shelfUnlock .7s cubic-bezier(.2,.9,.25,1.25); }
@keyframes shelfUnlock { 0% { transform: scale(.55); filter: brightness(3); } 55% { transform: scale(1.13) rotate(3deg); } }
.collection-note { margin: 10px 0 0; color: #6f6679; text-align: center; font-size: 9px; }

.result-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5,2,14,.82);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: .3s;
}
.result-overlay.visible { opacity: 1; visibility: visible; }
.result-card {
  width: min(490px, 100%);
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  padding: 50px 46px 36px;
  text-align: center;
  background: linear-gradient(160deg, rgba(39,19,74,.98), rgba(15,8,34,.99));
  border: 2px solid #8755e8;
  border-radius: 18px;
  box-shadow: 0 0 0 8px rgba(111,60,205,.11), 0 0 70px rgba(125,59,255,.38);
  transform: scale(.84) translateY(20px);
  transition: .4s cubic-bezier(.2,.9,.25,1.25);
}
.result-overlay.visible .result-card { transform: scale(1) translateY(0); }
.result-card.miss { border-color: #459bb0; box-shadow: 0 0 0 8px rgba(41,231,255,.07), 0 0 70px rgba(41,231,255,.18); }
.result-card.miss .winner-stamp { color: var(--cyan); border-color: rgba(41,231,255,.45); box-shadow: 0 0 14px rgba(41,231,255,.12); }
.result-card.miss .result-label { color: var(--cyan); }
.result-card.miss .result-prize { --result-color: var(--cyan) !important; }
.close-result { position: absolute; top: 14px; right: 16px; width: 33px; height: 33px; border: 0; border-radius: 50%; color: #9489a6; background: rgba(255,255,255,.06); cursor: pointer; font-size: 21px; }
.winner-stamp { padding: 7px 11px; color: var(--yellow); border: 1px solid rgba(255,228,94,.45); border-radius: 4px; font-family: var(--pixel); font-size: 7px; letter-spacing: 1px; transform: rotate(-2deg); box-shadow: 0 0 14px rgba(255,228,94,.12); }
.result-prize { width: 126px; height: 104px; display: grid; place-items: center; margin: 25px 0 21px; color: white; background: radial-gradient(circle, color-mix(in srgb, var(--result-color), transparent 65%), transparent 68%); animation: winnerBob 1.8s ease-in-out infinite; }
.result-prize span { font-size: 80px; line-height: 1; filter: drop-shadow(0 7px 3px rgba(0,0,0,.4)) drop-shadow(0 0 14px var(--result-color)); }
@keyframes winnerBob { 50% { transform: translateY(-8px) rotate(4deg); } }
.result-label { margin: 0 0 12px; color: var(--pink); font-family: var(--pixel); font-size: 7px; letter-spacing: 1px; }
.result-card h2 { max-width: 380px; margin: 0; font-size: clamp(23px, 5vw, 34px); line-height: 1.23; overflow-wrap: anywhere; }
.result-actions { width: 100%; display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 29px; }
.do-it-button { height: 52px; border-radius: 7px; cursor: pointer; font-family: var(--pixel); font-size: 8px; }
.do-it-button { display: flex; align-items: center; justify-content: center; gap: 14px; color: #1e0d25; background: var(--yellow); border: 0; box-shadow: 0 0 20px rgba(255,228,94,.2); }
.do-it-button span { font-family: var(--sans); font-size: 22px; }
.result-footnote { margin: 20px 0 0; color: #72697f; font-size: 11px; }

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 15px; background: var(--c); left: var(--l); animation: fall var(--d) linear forwards; animation-delay: var(--delay); }
@keyframes fall { to { transform: translate3d(var(--drift), 105vh, 0) rotate(780deg); } }

.toast { position: fixed; z-index: 200; left: 50%; bottom: 25px; padding: 12px 18px; color: #171021; background: var(--green); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 12px; font-weight: 700; opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: .25s; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.shop-overlay { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(5,2,14,.86); backdrop-filter: blur(14px); opacity: 0; visibility: hidden; transition: .25s; }
.shop-overlay.visible { opacity: 1; visibility: visible; }
.shop-panel { width: min(780px, 100%); max-height: min(780px, calc(100vh - 48px)); position: relative; overflow-y: auto; padding: 36px; background: linear-gradient(150deg, #241442, #0e0820 72%); border: 2px solid #7750b4; border-radius: 17px; box-shadow: 0 0 0 8px rgba(119,80,180,.1), 0 30px 80px rgba(0,0,0,.55); transform: translateY(16px) scale(.96); transition: .3s cubic-bezier(.2,.9,.25,1.1); }
.shop-overlay.visible .shop-panel { transform: translateY(0) scale(1); }
.close-shop { position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #a89db6; background: rgba(255,255,255,.06); cursor: pointer; font-size: 21px; }
.shop-kicker { color: var(--pink); font-family: var(--pixel); font-size: 7px; letter-spacing: 1px; }
.shop-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 9px 0 27px; padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.shop-heading h2 { margin: 0 0 7px; font-family: var(--pixel); font-size: 24px; }
.shop-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.shop-balance { min-width: 96px; height: 43px; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--yellow); background: rgba(255,228,94,.08); border: 1px solid rgba(255,228,94,.3); border-radius: 7px; }
.shop-balance strong { font-family: var(--pixel); font-size: 11px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.shop-item { position: relative; display: grid; gap: 10px; padding: 13px; background: rgba(255,255,255,.035); border: 1px solid rgba(210,190,255,.14); border-radius: 10px; transition: transform .18s, border-color .18s; }
.shop-item:hover { transform: translateY(-2px); border-color: rgba(210,190,255,.35); }
.shop-item.equipped { border-color: var(--green); box-shadow: inset 0 0 18px rgba(92,255,186,.05); }
.skin-preview { height: 92px; position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--preview-a), transparent 62%), #090516 72%); border-radius: 7px; }
.preview-background { background: radial-gradient(circle at 65% 26%, var(--preview-a), transparent 34%), linear-gradient(150deg, var(--preview-a), var(--preview-b) 66%); }
.mini-scene { width: 100%; height: 100%; display: grid; place-items: center; color: var(--preview-edge); background-image: radial-gradient(circle, rgba(255,255,255,.7) 1px, transparent 1.5px); background-size: 19px 19px; font-size: 25px; text-shadow: 0 0 13px var(--preview-edge); }
.preview-theme { background: linear-gradient(145deg, #110b22, #080510); }
.theme-swatches { display: flex; align-items: center; gap: 7px; }
.theme-swatches i { width: 25px; height: 40px; border-radius: 20px; box-shadow: 0 0 12px color-mix(in srgb, var(--swatch), transparent 45%); background: var(--swatch); transform: rotate(12deg); }
.theme-swatches i:first-child { --swatch:var(--preview-a); transform: rotate(-12deg); }
.theme-swatches i:nth-child(2) { --swatch:var(--preview-b); }
.theme-swatches i:last-child { --swatch:var(--preview-edge); transform: rotate(12deg); }
.mini-machine { width: 58px; height: 68px; position: relative; background: linear-gradient(90deg, var(--preview-b), var(--preview-a), var(--preview-b)); border: 3px solid var(--preview-edge); border-radius: 5px 5px 8px 8px; box-shadow: 0 0 18px color-mix(in srgb, var(--preview-edge), transparent 60%); }
.mini-machine::before { content: ""; position: absolute; left: 7px; right: 7px; top: 12px; height: 34px; background: #0a0618; border: 2px solid rgba(255,255,255,.35); }
.mini-machine::after { content: "★"; position: absolute; left: 0; right: 0; top: 21px; color: var(--yellow); text-align: center; font-size: 17px; }
.shop-item-info { min-width: 0; display: grid; gap: 4px; }
.shop-item-info em { color: var(--pink); font-family: var(--pixel); font-size: 5px; font-style: normal; letter-spacing: .5px; }
.shop-item-info strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.shop-item-info small { color: #84798f; font-size: 10px; }
.shop-item button { width: 100%; height: 35px; color: #1c1023; background: var(--yellow); border: 0; border-radius: 5px; cursor: pointer; font-family: var(--pixel); font-size: 6px; }
.shop-item button.owned { color: #e6dcef; background: rgba(125,59,255,.22); border: 1px solid rgba(155,103,255,.45); }
.shop-item button:disabled { color: #726a7b; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); cursor: not-allowed; }
.shop-note { margin: 18px 0 0; color: #71687d; text-align: center; font-size: 10px; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; gap: 65px; }
  .task-panel { max-width: 710px; width: 100%; margin: 0 auto; }
  .task-list { max-height: 240px; }
  h1 { max-width: none; }
}

@media (max-width: 650px) {
  .topbar { height: 70px; padding: 0 18px; }
  .brand { font-size: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .machine-status { display: none; }
  .topbar-right { gap: 7px; }
  .ticket-counter { height: 34px; padding: 0 9px; }
  .ticket-counter small { display: none; }
  .shop-button { width: 36px; height: 34px; justify-content: center; padding: 0; }
  .shop-label { display: none; }
  .shop-panel { padding: 30px 17px 22px; }
  .shop-heading { align-items: flex-start; }
  .shop-heading h2 { font-size: 18px; }
  .shop-heading p { max-width: 190px; font-size: 11px; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { width: min(100% - 24px, 600px); padding-top: 42px; }
  .stage-heading { align-items: center; }
  .credit-pill { display: none; }
  .machine-top { height: 90px; margin: 0 10px; gap: 5px; }
  .marquee { width: 78%; height: 62px; }
  .marquee strong { font-size: clamp(14px, 5vw, 21px); text-shadow: 2px 2px 0 #cb2a9b; }
  .marquee-star { font-size: 12px; }
  .machine-body { margin-inline: 0; padding-inline: 10px; }
  .glass { height: 360px; }
  .prize-bed { transform: scale(.83); transform-origin: bottom center; inset-inline: -4%; }
  .control-deck { grid-template-columns: 40% 1fr; min-height: 122px; }
  .chute-door { height: 65px; border-width: 4px; }
  .joystick { transform: scale(.75); width: 65px; }
  .play-button { width: 90px; height: 90px; border-width: 5px; }
  .play-button strong { font-size: 11px; }
  .machine-feet { padding-inline: 40px; }
  .machine-feet span { width: 60px; }
  .result-card { padding: 44px 22px 30px; }
  .result-actions { grid-template-columns: 1fr; }
  .collection-shelf { padding-inline: 11px; }
  .shelf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
