:root {
  --bg: #f6f4ff;
  --floor: #ebe8fb;
  --ink: #2f3150;
  --line: #3a3d5c;
  --accent: #91a1fb;
  --accent-deep: #6e7ee6;
  --accent-soft: #e4e8ff;
  --pink: #ff7fa8;
  --body-hi: #ffffff;
  --body-lo: #e9ecf8;
  --side-hi: #d5daf3;
  --side-lo: #bcc3e6;
  --glass: #262a44;
  --glass-hi: #343958;
  --lcd: #23263b;
  --lcd-ink: #cff7dd;
  --font: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
.stage {
  position: relative;
  min-height: 100svh;
  padding: 92px 16px 210px;
  background: linear-gradient(to bottom, var(--bg) var(--floor-y, 70%), var(--floor) var(--floor-y, 70%));
}
.crowd { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.vm {
  --w: min(78vw, 340px);
  --side: calc(var(--w) * .11);
  position: relative;
  z-index: 2;
  width: calc(var(--w) + var(--side));
  margin: 0 auto;
}
.vm-canopy {
  position: relative;
  height: 30px;
  margin: 0 calc(var(--side) * -0.2) 0 -10px;
  background: linear-gradient(var(--accent), #8293f3);
  border: 3px solid var(--line);
  border-radius: 10px 14px 4px 4px;
  transform: perspective(500px) rotateX(28deg);
  transform-origin: bottom;
  box-shadow: 0 6px 0 rgba(58, 61, 92, .18);
  z-index: 3;
}
.vm-canopy::after {
  content: "";
  position: absolute; left: 6%; right: 6%; bottom: 5px;
  height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .45);
}
.vm-box { position: relative; width: var(--w); margin-top: -4px; }
.vm-top {
  position: absolute; left: 6px; top: -2px;
  width: calc(var(--w) - 8px); height: 14px;
  background: var(--side-hi);
  border: 3px solid var(--line); border-bottom: 0;
  transform: translateX(calc(var(--side) * .5)) skewX(-40deg) translateY(-11px);
  transform-origin: bottom left;
  border-radius: 6px 6px 0 0;
}
.vm-side {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--w) - 6px);
  width: var(--side);
  background: linear-gradient(var(--side-hi), var(--side-lo));
  border: 3px solid var(--line); border-left: 0;
  border-radius: 0 12px 14px 0;
  transform: skewY(-24deg);
  transform-origin: top left;
  display: grid; place-items: center;
}
.vm-emblem {
  width: 70%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
  font: 400 clamp(12px, 3.4vw, 17px)/1 var(--font);
  transform: skewY(24deg);
  border: 2px solid rgba(58, 61, 92, .35);
}
.vm-front {
  position: relative;
  z-index: 2;
  background: linear-gradient(var(--body-hi), var(--body-lo));
  border: 3px solid var(--line);
  border-radius: 16px 16px 12px 12px;
  padding: 0 10px 12px;
  box-shadow: inset -5px -6px 0 rgba(58, 61, 92, .06);
}
.vm-banner {
  margin: 10px 0 10px;
  padding: 8px 6px 7px;
  background: var(--accent);
  border: 3px solid var(--line);
  border-radius: 10px;
  color: #fff;
  font: 400 clamp(18px, 5.2vw, 24px)/1.1 var(--font);
  text-align: center;
  letter-spacing: .02em;
  text-shadow: 0 2px 0 var(--accent-deep);
}
.vm-mid { display: grid; grid-template-columns: 1fr 34%; gap: 8px; }
.vm-glass {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  background: linear-gradient(160deg, var(--glass-hi), var(--glass));
  border: 3px solid var(--line);
  border-radius: 10px;
  padding: 6px 6px 0;
  min-height: 264px;
}
.shelf {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: 0 2px 7px;
  border-bottom: 5px solid #9aa3cf;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.shelf + .shelf { margin-top: 2px; }
.shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, .16) 18% 27%, transparent 27% 34%, rgba(255, 255, 255, .08) 34% 38%, transparent 38%);
}
.apple {
  --c1: #ff8b8f; --c2: #e5484d; --c3: #a92330;
  position: relative;
  width: clamp(22px, 6.4vw, 30px); aspect-ratio: 1 / .94;
  border-radius: 48% 48% 44% 44% / 52% 52% 48% 48%;
  background: radial-gradient(circle at 34% 30%, var(--c1) 0 16%, var(--c2) 48%, var(--c3) 100%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  transition: opacity .25s ease, transform .25s ease;
}
.apple::before {
  content: ""; position: absolute; left: 46%; top: -18%;
  width: 9%; height: 26%; border-radius: 3px; background: #6b4a2b;
}
.apple::after {
  content: ""; position: absolute; left: 54%; top: -16%;
  width: 30%; height: 20%; border-radius: 0 80% 0 80%;
  background: #6cc08a; transform: rotate(-12deg);
}
.apple.g1 { --c1: #ffc2d6; --c2: #ff7fa8; --c3: #c94b77; }
.apple.g2, .apple.gold { --c1: #fff4b8; --c2: #f6c844; --c3: #b8860b; }
.apple.gone { opacity: 0; transform: translateY(6px) scale(.8); }
.vm-panel {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--accent-soft);
  border: 3px solid var(--line);
  border-radius: 10px;
  padding: 6px;
}
.vm-lcd {
  min-height: 40px;
  display: grid; place-items: center;
  background: var(--lcd); color: var(--lcd-ink);
  border-radius: 7px;
  font: 400 13px/1.2 var(--font);
  text-align: center; word-break: keep-all;
  padding: 4px;
}
.vm-go {
  appearance: none;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 150px;
  border: 3px solid var(--line);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 0 var(--accent-deep), 0 6px 0 2px var(--line);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .07s ease, box-shadow .07s ease, background-color .2s ease, filter .2s ease;
}
.vm-go i { font: 400 30px/1 var(--font); font-style: normal; color: #ffe1ec; text-shadow: 0 2px 0 var(--accent-deep); }
.vm-go b { font: 400 24px/1 var(--font); letter-spacing: .02em; text-shadow: 0 2px 0 var(--accent-deep); }
.vm-go small { font: 400 12px/1 var(--font); color: #eef0ff; }
.vm-go:hover:not(:disabled) { filter: brightness(1.04); }
.vm-go:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 3px; }
.vm-go.pressed { transform: translateY(5px); box-shadow: 0 1px 0 var(--accent-deep), 0 1px 0 2px var(--line); }
.vm-go:disabled { cursor: default; background: #c9cde8; box-shadow: 0 2px 0 #aab0d6, 0 2px 0 2px var(--line); transform: translateY(4px); }
.vm-go:disabled i { color: #f2f3fb; text-shadow: none; }
.vm-go:disabled b, .vm-go:disabled small { text-shadow: none; }
.vm-btn {
  appearance: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: 400 18px/1 var(--font);
  box-shadow: 0 4px 0 var(--line);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .07s ease, box-shadow .07s ease, background-color .15s ease;
  min-height: 56px;
}
.vm-btn small { font: 400 11px/1.15 var(--font); color: #7f84b0; word-break: keep-all; text-align: center; }
.vm-btn i {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2) 60%, var(--c3));
  --c1: #ff8b8f; --c2: #e5484d; --c3: #a92330;
}
.vm-btn[data-g="1"] i { --c1: #ffc2d6; --c2: #ff7fa8; --c3: #c94b77; }
.vm-btn[data-g="2"] i { --c1: #d3dbff; --c2: #91a1fb; --c3: #5a68c9; }
.vm-btn:hover { background: #f8f9ff; }
.vm-btn:focus-visible { outline: 3px solid var(--accent-deep); outline-offset: 2px; }
.vm-btn.pressed { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); background: var(--accent); color: #fff; }
.vm-btn.pressed small { color: #eef0ff; }
.vm-count { text-align: center; font: 400 12px/1.2 var(--font); color: #6b6f99; }
.vm-count b { color: var(--accent-deep); font-weight: 400; font-size: 16px; }
.vm-slot {
  position: relative;
  margin-top: 10px;
  height: 62px;
  background: #1f2236;
  border: 3px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 8px 10px rgba(0, 0, 0, .45);
}
.vm-slot .flap {
  position: absolute; left: 0; right: 0; top: 0; height: 24px;
  background: linear-gradient(#545985, #43476e);
  border-bottom: 2px solid #6a6fa0;
  transform-origin: top;
  transition: transform .18s ease;
}
.vm-slot.open .flap { transform: perspective(300px) rotateX(55deg); }
.drop { position: absolute; z-index: 4; pointer-events: none; }
.heart {
  position: absolute; z-index: 6; pointer-events: none;
  font: 400 22px/1 var(--font); color: var(--pink);
  text-shadow: 0 1px 0 rgba(58, 61, 92, .25);
}
.star { color: #f6c844; }
.note { position: relative; z-index: 2; margin: 26px auto 0; text-align: center; color: #8b90bb; font-size: 13px; }
.foot { padding: 16px; text-align: center; color: #8b90bb; font-size: 13px; background: var(--floor); }
.foot a { color: var(--accent-deep); }
.bb { position: absolute; left: 0; top: 0; width: var(--s, 72px); height: var(--s, 72px); pointer-events: auto; cursor: pointer; }
.bb::after {
  content: ""; position: absolute; left: 18%; right: 18%; bottom: 2%; height: 10%;
  border-radius: 50%; background: rgba(58, 61, 92, .16); z-index: -1;
}
.bb .flip { width: 100%; height: 100%; }
.bb img { width: 100%; height: 100%; display: block; transform-origin: 50% 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.bb.walk img { animation: hop .44s cubic-bezier(.3, .6, .45, 1) infinite; }
.bb.jump img { animation: jump .6s ease-out 1; }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1.05, .95); } 50% { transform: translateY(-11%) scale(.97, 1.03); } }
@keyframes jump { 0% { transform: translateY(0) scale(1.1, .9); } 35% { transform: translateY(-40%) scale(.94, 1.07); } 72% { transform: translateY(0) scale(1.07, .93); } 100% { transform: none; } }
@media (min-width: 760px) {
  .stage { padding: 96px 24px 220px; }
  .vm { --w: 360px; }
  .vm-glass { min-height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .bb.walk img, .bb.jump img { animation: none; }
  .vm-go, .apple, .vm-slot .flap { transition: none; }
}
