:root{
  --plastic-pink:#F4B8C4;
  --plastic-mint:#8FDCC4;
  --interior:#3B2A52;
  --chrome:#C9CFD6;
  --chrome-shade:#8A93A0;
  --marquee:#E8404F;
  --ink:#2A2230;
  --glass-edge:rgba(42,34,48,.18);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:"Baloo 2",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  color:var(--ink);
  background:
    radial-gradient(120% 80% at 50% 0%, #ffd9e2 0%, var(--plastic-pink) 45%, #e79fae 100%)
    fixed;
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding:20px 12px 40px;
  -webkit-text-size-adjust:100%;
}

.cabinet{
  width:100%;
  max-width:560px;
  background:linear-gradient(180deg,#f7c6d0,var(--plastic-pink) 30%,#eaa9b6);
  border-radius:26px;
  padding:14px;
  box-shadow:
    0 2px 0 #fff6 inset,
    0 -18px 40px #0000001a inset,
    0 24px 50px -12px #6c2b3a66;
}

/* ---------- marquee ---------- */
.marquee{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  background:linear-gradient(180deg,#ff5a67,var(--marquee));
  border-radius:16px;
  padding:10px 14px;
  box-shadow:0 3px 0 #0002, 0 0 0 3px #fff5 inset;
}
.marquee-word{
  font-family:"Bungee",system-ui,sans-serif;
  color:#fff;
  font-size:clamp(20px,6vw,30px);
  letter-spacing:.02em;
  text-shadow:0 2px 0 #0003, 0 0 14px #ffd6db99;
}
.bulbs{display:flex;gap:7px}
.bulbs i{
  width:9px;height:9px;border-radius:50%;
  background:#ffe9b0;
  box-shadow:0 0 6px #ffd479, 0 0 2px #fff inset;
  opacity:.55;
}
.marquee.chase .bulbs i{animation:chase .7s linear infinite}
.bulbs-right i{animation-direction:reverse}
.bulbs i:nth-child(2){animation-delay:.09s}
.bulbs i:nth-child(3){animation-delay:.18s}
.bulbs i:nth-child(4){animation-delay:.27s}
.bulbs i:nth-child(5){animation-delay:.36s}
@keyframes chase{
  0%,100%{opacity:.35;transform:scale(.9)}
  50%{opacity:1;transform:scale(1.15)}
}

/* ---------- glass / canvas ---------- */
.glass{
  position:relative;
  margin-top:14px;
  border-radius:18px;
  padding:10px;
  background:
    linear-gradient(180deg,#dfe4ea,var(--chrome) 40%,var(--chrome-shade));
  box-shadow:0 6px 16px -6px #0007, 0 0 0 2px #fff4 inset;
}
#game{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:520/640;
  border-radius:12px;
  background:var(--interior);
  box-shadow:0 0 0 3px var(--chrome-shade), 0 10px 24px -8px #000a inset;
  touch-action:none;
}
.glare{
  position:absolute;
  inset:10px;
  border-radius:12px;
  pointer-events:none;
  background:linear-gradient(115deg,
    rgba(255,255,255,.16) 0%,
    rgba(255,255,255,.05) 18%,
    rgba(255,255,255,0) 34%,
    rgba(255,255,255,0) 100%);
  mix-blend-mode:screen;
}
.touch-zone{
  position:absolute;
  top:10px;bottom:10px;
  width:33%;
  border:0;background:transparent;
  padding:0;margin:0;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.touch-left{left:10px}
.touch-right{right:10px}
@media (hover:hover) and (pointer:fine){
  .touch-zone{display:none}
}

/* ---------- control deck ---------- */
.deck{
  margin-top:14px;
  display:grid;
  grid-template-columns:1fr 1.4fr 1fr;
  grid-template-areas:"l d r" "c c c";
  gap:10px;
  align-items:center;
}
.btn{
  font-family:inherit;
  font-weight:600;
  border:0;
  border-radius:14px;
  cursor:pointer;
  color:var(--ink);
  background:linear-gradient(180deg,#fff,#e7ebf0);
  box-shadow:0 3px 0 var(--chrome-shade), 0 6px 12px -4px #0005;
  padding:14px 10px;
  font-size:18px;
  transition:transform .05s ease, box-shadow .05s ease;
  user-select:none;
}
.btn:active{transform:translateY(3px);box-shadow:0 0 0 var(--chrome-shade),0 3px 8px -4px #0005}
.btn.move{grid-area:l}
.btn.move#btnRight{grid-area:r}
.btn.drop{
  grid-area:d;
  background:linear-gradient(180deg,#ff5f6c,var(--marquee));
  color:#fff;
  font-size:22px;
  letter-spacing:.01em;
  box-shadow:0 4px 0 #a52630, 0 8px 16px -4px #a5263099;
}
.btn.drop:disabled{filter:grayscale(.5) opacity(.6);cursor:not-allowed}
.credits{
  grid-area:c;
  text-align:center;
  font-weight:500;
  color:var(--ink);
  background:#ffffff8c;
  border-radius:12px;
  padding:7px 10px;
}
.credits b{font-size:1.15em}
.coinslot{margin-left:10px;color:var(--chrome-shade);letter-spacing:3px}

.status{
  margin:12px 4px 0;
  text-align:center;
  font-size:16px;
  min-height:1.4em;
  color:#4b3a5c;
}

/* ---------- collection shelf ---------- */
.shelf{
  margin-top:14px;
  background:linear-gradient(180deg,#a8e7d5,var(--plastic-mint));
  border-radius:16px;
  padding:12px 14px;
  box-shadow:0 3px 0 #0002, 0 0 0 2px #fff5 inset;
}
.shelf-head{
  display:flex;align-items:baseline;justify-content:space-between;
  margin-bottom:8px;
}
.shelf-head h2{margin:0;font-size:18px;font-weight:700;color:#1f5346}
.streak{font-size:14px;color:#1f5346;font-weight:500}
.shelf-items{
  display:flex;gap:10px;
  overflow-x:auto;
  padding-bottom:4px;
  scrollbar-width:thin;
  min-height:44px;
  align-items:center;
}
.shelf-items::-webkit-scrollbar{height:6px}
.shelf-items::-webkit-scrollbar-thumb{background:#1f534633;border-radius:3px}
.shelf-empty{color:#1f5346;font-size:14px;opacity:.85}
.chip{
  flex:0 0 auto;
  display:flex;align-items:center;gap:4px;
  background:#ffffffcc;
  border-radius:999px;
  padding:5px 10px 5px 8px;
  font-size:20px;
  line-height:1;
  box-shadow:0 2px 5px -2px #0004;
}
.chip.legendary{background:linear-gradient(120deg,#fff3c4,#ffe08a);box-shadow:0 0 0 2px #f5c74d inset,0 2px 6px -1px #0004}
.chip.rare{background:linear-gradient(120deg,#e6dbff,#d6c6ff)}
.chip small{font-size:12px;font-weight:600;color:var(--ink)}

/* ---------- footer ---------- */
.footer{
  margin-top:14px;
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;flex-wrap:wrap;
}
.sound-toggle{
  font-family:inherit;font-size:13px;font-weight:600;
  border:0;border-radius:999px;cursor:pointer;
  padding:8px 14px;
  background:#ffffffcc;color:var(--ink);
  box-shadow:0 2px 6px -2px #0005;
}
.sound-toggle[aria-pressed="true"]{background:var(--plastic-mint);color:#1f5346}
.credit-line{font-size:12px;color:#6a4a58}

/* ---------- focus ---------- */
:focus-visible{
  outline:3px solid #2A2230;
  outline-offset:2px;
  border-radius:6px;
}
.touch-zone:focus-visible{outline-offset:-3px}

@media (prefers-reduced-motion:reduce){
  .marquee.chase .bulbs i{animation:none;opacity:.9}
  .btn{transition:none}
}

@media (max-width:430px){
  body{padding:10px 6px 24px}
  .cabinet{padding:10px;border-radius:20px}
  .btn{padding:13px 6px;font-size:16px}
  .btn.drop{font-size:19px}
}
