:root {
  --pink: #ff1493;
  --mag: #ff00aa;
  --hot: #ff4fd8;
  --cyan: #00f0ff;
  --violet: #b026ff;
  --gold: #ffd84d;
  --ink: #0a0008;
  --neon: 0 0 3px #fff, 0 0 8px var(--pink), 0 0 18px var(--pink), 0 0 36px var(--mag), 0 0 70px var(--mag);
  --neon-w: 0 0 2px #fff, 0 0 6px #fff, 0 0 16px #ffc6ec, 0 0 34px #ff7ad1;
  --jp: "Dela Gothic One", sans-serif;
  --hand: "Yomogi", sans-serif;
  --logo: "Rubik Wet Paint", "Dela Gothic One", sans-serif;
  --dot: "DotGothic16", monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: #fff; overflow: hidden; font-family: var(--jp); }
button { font: inherit; color: inherit; cursor: pointer; }

#stage { position: fixed; inset: 0; overflow: hidden; }
.scene {
  position: absolute; inset: 0; overflow: hidden;
  background-size: cover; background-position: center;
  transition: opacity .8s ease, transform 1s cubic-bezier(.2,.7,.2,1);
}
.scene.enter { opacity: 0; transform: scale(.86); }
.scene.leave { opacity: 0; transform: scale(1.3); pointer-events: none; }
.scene.has-photo .shell { display: none; }

/* ---------- HUD / toast / buttons ---------- */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; pointer-events: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  transition: opacity .6s;
}
#hud.hide { opacity: 0; }
.hud-logo { font-family: var(--logo); font-size: 18px; color: #fff; text-shadow: var(--neon); letter-spacing: .04em; }
.hud-count { font-family: var(--dot); font-size: 16px; background: rgba(0,0,0,.55); border: 2px solid var(--hot); border-radius: 999px; padding: 4px 12px; box-shadow: 0 0 12px var(--pink); }
#toast {
  position: fixed; left: 50%; top: 64px; z-index: 60; transform: translate(-50%, -20px);
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 14px;
  background: linear-gradient(135deg, var(--pink), var(--mag)); font-family: var(--hand); font-size: 15px; font-weight: 700;
  box-shadow: 0 0 24px var(--pink); opacity: 0; transition: .4s; pointer-events: none; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.btn {
  border: 0; border-radius: 999px; padding: 14px 28px; font-family: var(--jp); font-size: 18px; letter-spacing: .06em;
  background: linear-gradient(135deg, #ff3ea5, var(--mag) 50%, #c400ff); color: #fff;
  box-shadow: 0 0 0 3px #fff, 0 0 22px var(--pink), 0 0 50px var(--mag);
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
  animation: pulse 1.6s ease-in-out infinite;
}
.btn:active { transform: scale(.95); }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 34px var(--pink), 0 0 80px var(--mag); } }
.next {
  position: absolute; z-index: 30; right: 16px; bottom: max(20px, env(safe-area-inset-bottom));
  opacity: 0; pointer-events: none; transition: opacity .5s, transform .5s; transform: translateY(12px);
}
.next.show { opacity: 1; pointer-events: auto; transform: none; }
.sign {
  position: absolute; z-index: 20; top: 56px; left: 50%; transform: translateX(-50%);
  font-family: var(--logo); font-size: clamp(20px, 5.4vw, 36px); white-space: nowrap; color: #fff; text-shadow: var(--neon);
  animation: flicker 5s infinite;
}
.hint {
  position: absolute; z-index: 20; left: 16px; right: 16px; bottom: max(90px, calc(env(safe-area-inset-bottom) + 80px));
  text-align: center; font-family: var(--hand); font-size: 15px; font-weight: 700; color: #fff;
  text-shadow: 0 0 6px #000, 0 0 12px var(--mag); pointer-events: none;
}
@keyframes flicker { 0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; } 20%, 63% { opacity: .55; } }
.neon { color: #fff; text-shadow: var(--neon); }

/* ---------- 3D room ---------- */
.r3 { position: absolute; inset: 0; perspective: 700px; perspective-origin: 50% 46%; overflow: hidden; }
.r3-box {
  position: absolute; inset: 0; transform-style: preserve-3d; --D: 1100px;
  transform: translateZ(var(--cz, 90px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .8s ease-out;
}
.r3-f { position: absolute; overflow: hidden; }
.r3-f::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.r3-back { inset: 0; transform: translateZ(calc(-1 * var(--D))); }
.r3-left { left: 0; top: 0; height: 100%; width: var(--D); transform-origin: left center; transform: rotateY(90deg); }
.r3-right { right: 0; top: 0; height: 100%; width: var(--D); transform-origin: right center; transform: rotateY(-90deg); }
.r3-floor { left: 0; bottom: 0; width: 100%; height: var(--D); transform-origin: bottom center; transform: rotateX(90deg); }
.r3-ceil { left: 0; top: 0; width: 100%; height: var(--D); transform-origin: top center; transform: rotateX(-90deg); }
.r3-left::after { background: linear-gradient(to right, rgba(0,0,0,.05), rgba(0,0,0,.45)); }
.r3-right::after { background: linear-gradient(to left, rgba(0,0,0,.05), rgba(0,0,0,.45)); }
.r3-floor::after { background: linear-gradient(to top, rgba(0,0,0,0), rgba(0,0,0,.5)); }
.r3-ceil::after { background: linear-gradient(to bottom, rgba(0,0,0,.1), rgba(0,0,0,.6)); }

/* ---------- ESCALATOR ---------- */
.scene-escalator { background: #05000a; }
.t-esc .r3-box { --D: 1400px; }
.t-esc .r3-left, .t-esc .r3-right {
  background:
    linear-gradient(to bottom, transparent 0 64%, rgba(255,20,147,.0) 64%),
    linear-gradient(to bottom, #120720 0%, #1d0b2e 60%, #0b0414 100%);
}
.t-esc .r3-ceil {
  background: repeating-linear-gradient(to bottom, #0d0618 0 140px, #fff 140px 146px, #ff7ad1 146px 150px, #0d0618 150px 280px), #0d0618;
  box-shadow: inset 0 0 80px #000;
}
.t-esc .r3-floor { background: #0c0614; }
.t-esc .r3-back { background: radial-gradient(ellipse at 50% 60%, #fff 0%, #ffb3e6 12%, var(--pink) 28%, #3a0030 60%, #05000a 80%); display: grid; place-items: center; }
.esc-backlogo { font-family: var(--logo); font-size: 14vmin; line-height: .95; text-align: center; color: #fff; text-shadow: var(--neon); }
.esc-neon {
  position: absolute; top: 10%; white-space: nowrap; font-family: var(--jp); font-size: 15vh; line-height: 1;
  color: #fff; text-shadow: 0 0 3px #fff, 0 0 10px var(--pink), 0 0 22px var(--mag); animation: flicker 4s infinite;
}
.esc-neon.cyan { text-shadow: 0 0 3px #fff, 0 0 10px var(--cyan), 0 0 22px #0090ff; }
.esc-glass {
  position: absolute; left: 0; right: 0; top: 66%; bottom: 0;
  background: linear-gradient(to bottom, rgba(255,120,220,.18), rgba(255,20,147,.06));
  border-top: 3px solid rgba(255,255,255,.5);
  box-shadow: inset 0 -30px 60px rgba(255,20,147,.55), 0 0 40px rgba(255,20,147,.6);
}
.esc-rail { position: absolute; left: 0; right: 0; top: 60%; height: 6%; background: #08040c; overflow: hidden; border-top: 2px solid #444; border-bottom: 2px solid #222; }
.esc-rail-track {
  position: absolute; top: 50%; left: 0; transform: translateY(-50%); white-space: nowrap; font-family: var(--hand); font-weight: 700;
  font-size: 3.4vh; color: #ff7ad1; text-shadow: 0 0 6px var(--pink); animation: rail 18s linear infinite;
}
.r3-right .esc-rail-track { animation-direction: reverse; }
@keyframes rail { to { transform: translate(-50%, -50%); } }
.esc-steps {
  position: absolute; left: 20%; right: 20%; top: 0; bottom: 0;
  background:
    repeating-linear-gradient(to bottom, transparent 0 116px, var(--hot) 116px 120px),
    repeating-linear-gradient(to right, #6b6878 0 6px, #a9a6b8 6px 12px);
  background-position-y: var(--sp, 0px);
  box-shadow: 0 0 40px rgba(255,20,147,.5);
}
.esc-side { position: absolute; top: 0; bottom: 0; width: 6%; background: #0a0510; overflow: hidden; }
.esc-side.l { left: 14%; } .esc-side.r { right: 14%; }
.esc-side span {
  position: absolute; left: 50%; top: 0; writing-mode: vertical-rl; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--hand); font-weight: 700; font-size: 40px; color: #ff7ad1; text-shadow: 0 0 8px var(--pink);
}
.esc-word {
  position: absolute; left: 50%; transform: translateX(-50%); padding: 10px 26px; white-space: nowrap;
  font-family: var(--jp); font-size: 110px; color: rgba(255,255,255,.35); top: 0;
  background: rgba(10,4,16,.75); border-radius: 18px; transition: color .5s, text-shadow .5s, background .5s;
}
.esc-word.lit { color: #fff; text-shadow: 0 0 4px #fff, 0 0 14px var(--pink), 0 0 28px var(--mag); background: rgba(255,20,147,.35); }
.esc-sub {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: max(110px, calc(env(safe-area-inset-bottom) + 100px)); text-align: center;
  font-family: var(--jp); font-size: clamp(24px, 7vw, 48px); color: #fff; text-shadow: var(--neon); min-height: 1.2em;
}
.esc-ui { position: absolute; z-index: 32; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 12px; align-items: center; }
.esc-skip { background: none; border: 0; color: rgba(255,255,255,.7); font-family: var(--dot); font-size: 14px; text-decoration: underline; }
.intro {
  position: absolute; z-index: 30; inset: 0; display: grid; place-content: center; text-align: center; gap: 14px; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(40,0,40,.6), rgba(0,0,0,.85)); transition: opacity 1s;
}
.intro.gone { opacity: 0; pointer-events: none; }
.intro h1 { margin: 0; font-family: var(--logo); font-weight: 400; font-size: clamp(48px, 15vw, 120px); line-height: .9; color: #fff; text-shadow: var(--neon); }
.intro p { margin: 0; font-family: var(--hand); font-size: 16px; font-weight: 700; color: #ffd6f1; }

/* ---------- GATE ---------- */
.scene-gate { background: linear-gradient(to bottom, #12001f 0%, #3b0042 45%, #ff1493 62%, #2a0030 63%, #12000f 100%); }
.gate-stars { position: absolute; inset: 0 0 40% 0; background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), radial-gradient(2px 2px at 40% 12%, #ffc0ee, transparent), radial-gradient(1px 1px at 85% 40%, #fff, transparent), radial-gradient(1.5px 1.5px at 10% 55%, #fff, transparent), radial-gradient(1px 1px at 55% 45%, #fff, transparent); }
.gate-floor {
  position: absolute; left: -50%; right: -50%; bottom: 0; height: 37%; transform-origin: top; transform: perspective(400px) rotateX(60deg);
  background: repeating-linear-gradient(90deg, transparent 0 58px, rgba(255,79,216,.7) 58px 61px), repeating-linear-gradient(0deg, transparent 0 58px, rgba(255,79,216,.7) 58px 61px), #1a0018;
}
.gate { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%); width: min(92vw, 600px); display: flex; flex-direction: column; align-items: center; }
.gate-motto { margin-bottom: 14px; font-family: var(--jp); font-size: clamp(24px, 7.6vw, 58px); white-space: nowrap; color: #fff; text-shadow: var(--neon); animation: flicker 4s infinite; }
.gate-arch {
  position: relative; width: 100%; aspect-ratio: 2 / 1.05; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: radial-gradient(ellipse at 50% 100%, #3b0036 30%, #ff4fd8 31%, #ff1493 45%, #a8007a 70%);
  box-shadow: 0 0 40px var(--pink), 0 0 120px var(--mag), inset 0 -20px 40px rgba(0,0,0,.4);
  display: grid; place-items: center; padding-top: 10%;
}
.gate-title { font-family: var(--logo); font-size: clamp(34px, 10.5vw, 70px); line-height: .9; text-align: center; color: #fff; text-shadow: 0 4px 0 #8a0060, var(--neon-w); position: relative; z-index: 2; }
.gate-bulb { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff7c2; box-shadow: 0 0 8px #ffe680, 0 0 18px var(--gold); transform: translate(-50%, -50%); animation: bulb 1s steps(1) infinite; }
.gate-bulb:nth-child(odd) { animation-delay: .5s; }
@keyframes bulb { 50% { background: #ff7ad1; box-shadow: 0 0 8px var(--pink), 0 0 18px var(--mag); } }
.gate-body { display: flex; width: 100%; height: clamp(120px, 26vh, 220px); }
.gate-pillar { width: 22%; background: linear-gradient(90deg, #c4007f, #ff4fd8 40%, #ff9ee6 50%, #ff1493 70%, #8a0060); display: grid; place-items: center; box-shadow: 0 0 30px var(--pink); }
.gate-pillar span { writing-mode: vertical-rl; font-family: var(--jp); font-size: clamp(14px, 3.4vw, 22px); color: #fff; text-shadow: 0 0 8px #fff; }
.gate-door { flex: 1; position: relative; background: radial-gradient(ellipse at 50% 100%, #fff 0%, #ffd1f2 25%, #ff4fd8 55%, #2a0030 90%); box-shadow: inset 0 0 40px #000; overflow: hidden; }
.gate-door::before { content: "ENTER"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--logo); font-size: clamp(24px, 7vw, 46px); color: #fff; text-shadow: var(--neon); }
.gate-ui { position: absolute; z-index: 25; left: 0; right: 0; bottom: max(28px, env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.ticket {
  position: absolute; z-index: 40; left: 50%; top: 50%; width: min(86vw, 380px);
  transform: translate(-50%, 120vh) rotate(-8deg); transition: transform .9s cubic-bezier(.2,1.4,.4,1);
  background: linear-gradient(135deg, #fff 0%, #ffe3f5 100%); color: #2a0020; border-radius: 16px; padding: 22px 22px 18px;
  box-shadow: 0 0 0 4px var(--pink), 0 0 40px var(--mag), 0 30px 60px rgba(0,0,0,.5);
  -webkit-mask: radial-gradient(circle 14px at 0 62%, transparent 98%, #000) , radial-gradient(circle 14px at 100% 62%, transparent 98%, #000);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.ticket.show { transform: translate(-50%, -50%) rotate(-3deg); }
.ticket .t-head { display: flex; justify-content: space-between; font-family: var(--dot); font-size: 12px; color: var(--pink); }
.ticket .t-title { font-family: var(--logo); font-size: 30px; line-height: .95; color: var(--pink); margin: 6px 0 14px; }
.ticket .t-label { font-family: var(--dot); font-size: 12px; color: #a0337a; border-top: 2px dashed #ff9ee6; padding-top: 12px; }
.ticket .t-word { font-family: var(--hand); font-weight: 700; font-size: 24px; line-height: 1.35; color: #ff0090; margin: 6px 0 16px; }
.ticket .btn { width: 100%; font-size: 16px; }

/* ---------- FORK (pink neon room) ---------- */
.t-pink .r3-left, .t-pink .r3-right { background: linear-gradient(to bottom, #ffd0e8, #ff6fb5 60%, #ff3d9a); }
.t-pink .r3-back { background: linear-gradient(to bottom, #ffc2e2, #ff5aa8); display: grid; place-items: center; }
.t-pink .r3-floor { background: linear-gradient(to top, #ff4fa0, #d81b78); }
.t-pink .r3-ceil { background: repeating-linear-gradient(to bottom, #ffe9f5 0 300px, #fff 300px 312px, #ffe9f5 312px 600px); }
.t-pink .r3-ceil::after { background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,0,120,.25)); }
.fork-door {
  position: absolute; top: 18%; bottom: 0; width: 46%; left: 30%;
  background: radial-gradient(ellipse at 50% 100%, #fff, #ffd6ef 40%, #ff8fd0 80%);
  border-radius: 999px 999px 0 0; box-shadow: inset 0 0 60px rgba(255,0,120,.6), 0 0 40px #fff;
  cursor: pointer;
}
.fork-neon {
  position: absolute; top: 6%; left: 8%; right: 8%; font-family: "Rampart One", var(--jp); font-size: 8.5vh; line-height: 1.05; color: #fff;
  text-shadow: var(--neon-w); cursor: pointer; text-align: center; word-break: keep-all; overflow-wrap: anywhere;
}
.fork-q { font-family: "Rampart One", var(--jp); font-size: 16vmin; color: #fff; text-shadow: var(--neon-w); text-align: center; line-height: 1; }
.fork-arrow { position: absolute; z-index: 20; top: 46%; font-size: 40px; color: #fff; text-shadow: var(--neon); animation: nudge 1s ease-in-out infinite; pointer-events: none; }
.fork-arrow.l { left: 10px; } .fork-arrow.r { right: 10px; animation-direction: reverse; }
@keyframes nudge { 50% { transform: translateX(8px); } }

/* ---------- DQ window ---------- */
.dq {
  position: absolute; z-index: 35; left: 12px; right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto;
  background: rgba(8,0,12,.92); border: 4px double #fff; border-radius: 10px; padding: 14px 16px 12px;
  box-shadow: 0 0 0 2px #000, 0 0 24px var(--pink); font-family: var(--dot); font-size: 17px; line-height: 1.6;
}
.dq-msg { white-space: pre-wrap; min-height: 3.2em; margin: 0; }
.dq-opts { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed rgba(255,255,255,.35); }
.dq-opts li { padding: 6px 4px 6px 28px; position: relative; cursor: pointer; color: #ffd6f1; border-radius: 6px; }
.dq-opts li .cur { position: absolute; left: 6px; opacity: 0; color: var(--hot); }
.dq-opts li.sel { color: #fff; background: rgba(255,20,147,.18); }
.dq-opts li.sel .cur { opacity: 1; animation: blink .6s steps(1) infinite; }
.dq-opts li.chosen { background: var(--pink); color: #fff; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- CAROUSEL ---------- */
.scene-carousel { background: radial-gradient(ellipse at 50% 30%, #4a0a5a 0%, #1a0025 50%, #07000c 100%); }
.cr-lights { position: absolute; inset: 0; background-image: radial-gradient(3px 3px at 10% 12%, #ffe680, transparent), radial-gradient(3px 3px at 25% 8%, #ff9ee6, transparent), radial-gradient(3px 3px at 40% 11%, #ffe680, transparent), radial-gradient(3px 3px at 60% 8%, #ff9ee6, transparent), radial-gradient(3px 3px at 75% 12%, #ffe680, transparent), radial-gradient(3px 3px at 90% 9%, #ff9ee6, transparent); animation: flicker 3s infinite; }
.cr-wrap { position: absolute; inset: 0; perspective: 1100px; perspective-origin: 50% 30%; touch-action: none; }
.cr-canopy {
  position: absolute; left: 50%; top: 16%; width: min(96vw, 680px); aspect-ratio: 3 / 1; transform: translateX(-50%);
  border-radius: 50% 50% 8% 8% / 100% 100% 14% 14%;
  background: repeating-conic-gradient(from 0deg at 50% 100%, #ff1493 0 9deg, #fff 9deg 18deg);
  box-shadow: 0 0 40px var(--pink), inset 0 -16px 0 #ffd84d;
}
.cr-canopy::after { content: ""; position: absolute; left: 50%; top: -18%; width: 18%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--gold) 40%, #b37a00); box-shadow: 0 0 30px var(--gold); }
.cr-pole { position: absolute; left: 50%; top: 30%; bottom: 18%; width: 14px; transform: translateX(-50%); background: linear-gradient(90deg, #8a6a00, #fff3b0, #c9a000); }
.cr-base { position: absolute; left: 50%; bottom: 8%; width: min(100vw, 720px); aspect-ratio: 4 / 1; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse at 50% 40%, #ff9ee6, #ff1493 50%, #6a0050 75%); box-shadow: 0 0 60px var(--pink); }
.cr-ring { position: absolute; left: 50%; top: 52%; width: 0; height: 0; transform-style: preserve-3d; }
.cr-panel { position: absolute; left: -75px; top: -110px; width: 150px; height: 220px; transform-style: preserve-3d; }
.cr-panel::before { content: ""; position: absolute; left: 50%; top: -120px; height: 120px; width: 6px; transform: translateX(-50%); background: linear-gradient(90deg, #b38f00, #fff3b0, #b38f00); }
.cr-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 22px; display: grid; place-items: center; padding: 14px; text-align: center; cursor: pointer;
}
.cr-front { background: linear-gradient(160deg, #ff7ad1, #ff1493 45%, #c400ff); border: 4px solid #fff; box-shadow: 0 0 24px var(--pink); font-family: var(--logo); font-size: 34px; line-height: 1; color: #fff; text-shadow: 0 3px 0 #8a0060; }
.cr-back { transform: rotateY(180deg); background: #0b0010; border: 3px solid var(--hot); box-shadow: 0 0 20px var(--mag); font-family: var(--hand); font-weight: 700; font-size: 19px; line-height: 1.45; color: #ff9ee6; text-shadow: 0 0 6px var(--pink); }
.cr-face.picked { outline: 4px solid var(--gold); outline-offset: 4px; }

/* ---------- GACHA ---------- */
.scene-gacha { background: linear-gradient(to bottom, #ff6fb5 0%, #ff3d9a 62%, #b0005f 62%, #6a0040 100%); }
.gc-wall { position: absolute; inset: 0 0 38% 0; background-image: radial-gradient(circle at 20px 20px, rgba(255,255,255,.35) 6px, transparent 7px); background-size: 40px 40px; }
.gc { position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); width: min(66vw, 300px); display: flex; flex-direction: column; align-items: center; }
.gc-dome { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.95) 0 6%, rgba(255,255,255,.25) 7% 30%, rgba(255,255,255,.08) 60%); border: 6px solid rgba(255,255,255,.8); box-shadow: inset 0 0 40px rgba(255,255,255,.5), 0 0 40px rgba(255,255,255,.4); overflow: hidden; }
.gc-dome.shake .gc-capsule { animation: tumble .25s ease-in-out 4 alternate; }
@keyframes tumble { to { transform: translate(var(--tx), var(--ty)) rotate(140deg); } }
.gc-capsule { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; background: linear-gradient(to bottom, var(--c) 0 50%, #fff 50%); box-shadow: inset -4px -4px 8px rgba(0,0,0,.2); }
.gc-body { position: relative; width: 108%; height: 170px; margin-top: -10px; border-radius: 18px 18px 10px 10px; background: linear-gradient(90deg, #c4007f, #ff1493 30%, #ff7ad1 50%, #ff1493 70%, #c4007f); box-shadow: 0 0 30px var(--mag); }
.gc-label { position: absolute; left: 10px; top: 12px; font-family: var(--logo); font-size: 26px; line-height: 1; color: #fff; text-shadow: 0 2px 0 #8a0060; }
.gc-label small { font-family: var(--dot); font-size: 12px; }
.gc-handle { position: absolute; right: 18px; top: 18px; width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: radial-gradient(circle, var(--gold) 0 30%, #fff3b0 31% 60%, #c9a000 61%); box-shadow: 0 0 20px var(--gold); transition: transform .9s cubic-bezier(.3,1.4,.5,1); }
.gc-handle::after { content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 14px; transform: translateX(-50%); background: #fff; border-radius: 8px; }
.gc-tray { position: absolute; left: 14px; bottom: 14px; width: 100px; height: 64px; border-radius: 12px; background: #3a0028; box-shadow: inset 0 6px 14px #000; }
.gc-drop { position: absolute; left: 30px; bottom: 18px; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(to bottom, var(--c) 0 50%, #fff 50%); box-shadow: 0 0 20px #fff; animation: drop .6s cubic-bezier(.3,1.6,.5,1); cursor: pointer; }
@keyframes drop { from { transform: translateY(-80px) scale(.4); } }
.gc-drop::after { content: "TAP!"; position: absolute; left: 50%; top: -26px; transform: translateX(-50%); font-family: var(--dot); font-size: 13px; color: #fff; text-shadow: 0 0 6px var(--mag); animation: blink .8s steps(1) infinite; }
.gc-card { position: absolute; z-index: 40; inset: 0; display: grid; place-items: center; background: rgba(20,0,20,.6); opacity: 0; pointer-events: none; transition: .4s; }
.gc-card.show { opacity: 1; pointer-events: auto; }
.gc-card-in { width: min(86vw, 400px); aspect-ratio: 1; border-radius: 28px; display: grid; place-items: center; padding: 26px; text-align: center; transform: scale(.4) rotate(-12deg); transition: transform .6s cubic-bezier(.2,1.6,.4,1);
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.9) 0 2px, transparent 3px) 0 0/22px 22px, linear-gradient(135deg, #ff1493, #ff00aa 50%, #b026ff); border: 5px solid #fff; box-shadow: 0 0 60px var(--mag); }
.gc-card.show .gc-card-in { transform: none; }
.gc-card-in p { margin: 0; font-family: var(--hand); font-weight: 700; font-size: clamp(26px, 7.5vw, 40px); line-height: 1.35; color: #fff; text-shadow: 0 3px 0 #8a0060, 0 0 14px #fff; }

/* ---------- MIRROR ---------- */
.scene-mirror { background: linear-gradient(to bottom, #d9d6e6 0%, #b9b5cc 66%, #5d5873 66%, #2c283a 100%); touch-action: none; }
.mr-layer { position: absolute; inset: 0 0 34% 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2vh; padding: 70px 16px 0; text-align: center; }
.mr-layer.flip { transform: scaleX(-1); }
.mr-en { font-family: var(--jp); font-size: clamp(40px, 12vw, 120px); line-height: .95; color: #ff1493; }
.mr-ja { font-family: var(--jp); font-size: clamp(30px, 8.6vw, 80px); line-height: 1.1; color: #1a0016; }
.mr-sub { font-family: var(--logo); font-size: clamp(20px, 5vw, 40px); color: #6a2a8a; }
.mr-reflect { pointer-events: none; }
.mr-reflect .mr-en { color: #fff; text-shadow: var(--neon); }
.mr-reflect .mr-ja { color: #fff; text-shadow: var(--neon); }
.mr-reflect .mr-sub { color: #fff; text-shadow: var(--neon); }
.mr-reflect { background: linear-gradient(135deg, #2a0030, #ff1493 120%); inset: 0 0 34% 0; }
.mr-frame { position: absolute; z-index: 10; width: var(--mw); height: var(--mh); left: var(--mx); top: var(--my); transform: translate(-50%, -50%); border-radius: 50%; border: 12px solid #ffd6f1; box-shadow: 0 0 0 4px #ff1493, 0 0 0 9px #fff, 0 0 40px var(--pink), inset 0 0 0 3px #fff, inset 0 0 40px rgba(255,255,255,.45); cursor: grab; touch-action: none; }
.mr-frame::after { content: "✦ 鏡 ✦"; position: absolute; left: 50%; bottom: -36px; transform: translateX(-50%); font-family: var(--dot); font-size: 13px; color: #fff; white-space: nowrap; text-shadow: 0 0 6px #000; }

/* ---------- BLACKLIGHT ---------- */
.scene-blacklight { background: #030006; touch-action: none; cursor: none; }
.bl-layer { position: absolute; inset: 0; }
.bl-faint { opacity: .045; }
.bl-lit { -webkit-mask: radial-gradient(circle var(--r, 130px) at var(--x, 50%) var(--y, 60%), #000 0 55%, transparent 100%); mask: radial-gradient(circle var(--r, 130px) at var(--x, 50%) var(--y, 60%), #000 0 55%, transparent 100%); }
.bl-w { position: absolute; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); white-space: nowrap; font-family: var(--hand); font-weight: 700; color: #f6c6ff; text-shadow: 0 0 4px #fff, 0 0 12px var(--violet), 0 0 26px var(--violet), 0 0 50px var(--mag); }
.bl-w.main { font-family: var(--jp); color: #fff; text-shadow: 0 0 4px #fff, 0 0 14px var(--hot), 0 0 32px var(--mag), 0 0 64px var(--violet); }
.bl-found .bl-w.main.found { opacity: .5; }
.bl-torch { position: absolute; z-index: 5; width: calc(var(--r, 130px) * 2); height: calc(var(--r, 130px) * 2); left: var(--x, 50%); top: var(--y, 60%); transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(140,60,255,.22), rgba(90,0,200,.08) 60%, transparent 70%); pointer-events: none; }

/* ---------- MOBILE (hanging words) ---------- */
.t-white .r3-back { background: linear-gradient(to bottom, #fbfaff, #efedf6); }
.t-white .r3-left, .t-white .r3-right { background: linear-gradient(to bottom, #f6f4fb, #e6e3ef); }
.t-white .r3-floor { background: linear-gradient(to top, #d9d6e0, #b8b4c4); }
.t-white .r3-ceil { background: repeating-linear-gradient(to bottom, #f1eff7 0 260px, #fff 260px 270px); }
.t-white .r3-left::after, .t-white .r3-right::after { background: linear-gradient(to right, rgba(0,0,0,0), rgba(60,40,80,.18)); }
.t-white .r3-right::after { background: linear-gradient(to left, rgba(0,0,0,0), rgba(60,40,80,.18)); }
.t-white .r3-floor::after { background: linear-gradient(to top, rgba(0,0,0,0), rgba(60,40,80,.2)); }
.t-white .r3-ceil::after { background: none; }
.scene-mobile { touch-action: none; }
.mb-layer { position: absolute; inset: 0; z-index: 5; }
.mb-w { position: absolute; left: 0; top: 0; will-change: transform; }
.mb-w::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 1.5px; height: 140vh; background: linear-gradient(to top, rgba(40,20,50,.7), rgba(40,20,50,.15)); }
.mb-w span { display: block; padding: 6px 10px; font-family: var(--jp); font-size: var(--fs, 40px); line-height: 1; white-space: nowrap; color: #ff1493; background: #fff; border-radius: 10px; box-shadow: 0 16px 30px rgba(60,20,80,.25), 0 0 0 3px #ff1493; animation: bob 3s ease-in-out infinite; animation-delay: var(--dl, 0s); transition: background .6s, color .6s, box-shadow .6s; }
@keyframes bob { 50% { transform: translateY(6px) rotate(1.5deg); } }
.mb-layer.aligned .mb-w span { background: linear-gradient(135deg, #ff1493, #ff00aa); color: #fff; box-shadow: 0 0 0 3px #fff, 0 0 30px var(--pink), 0 0 60px var(--mag); animation: none; }
.mb-spot { position: absolute; z-index: 6; left: 50%; bottom: 7%; width: 120px; height: 40px; transform: translate(calc(-50% + var(--fx, 0px)), 0); border-radius: 50%; border: 3px dashed #ff1493; box-shadow: 0 0 20px rgba(255,20,147,.5); display: grid; place-items: center; font-family: var(--dot); font-size: 12px; color: #ff1493; pointer-events: none; }
.scene-mobile .hint { color: #3a0030; text-shadow: none; }

/* ---------- MONO ROOM ---------- */
.t-mono .r3-box { --D: 1300px; }
.t-mono .r3-f { cursor: pointer; }
.mono-txt { position: absolute; inset: -4%; font-family: var(--jp); line-height: .98; word-break: break-all; letter-spacing: -.02em; }
.mono-b { background: #0b0b0b; color: #f4f4f0; }
.mono-w { background: #f4f4f0; color: #0b0b0b; }
.t-mono .r3-left .mono-txt { font-size: 22vh; }
.t-mono .r3-right .mono-txt { font-size: 22vh; }
.t-mono .r3-floor .mono-txt { font-size: 21vw; }
.t-mono .r3-ceil .mono-txt { font-size: 13vw; }
.t-mono .r3-back { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4vh; padding: 6%; text-align: center; }
.t-mono .r3-back .mono-txt { position: static; font-size: min(8vh, 10vw); line-height: 1.15; word-break: keep-all; }
.t-mono .r3-back .mono-pink { word-break: keep-all; }
.mono-pink { font-family: "Rampart One", var(--jp); font-size: min(9vh, 11vw); line-height: 1.1; text-align: center; color: #fff; text-shadow: var(--neon); animation: flicker 6s infinite; }
.t-mono .r3-left::after, .t-mono .r3-right::after { background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,.3)); }
.t-mono .r3-right::after { background: linear-gradient(to left, rgba(0,0,0,0), rgba(0,0,0,.3)); }
.mono-stripe { background-image: repeating-linear-gradient(to bottom, transparent 0 1.1em, rgba(0,0,0,0) 1.1em); }
.scene-mono .sign { color: #0b0b0b; text-shadow: 0 0 0 #000, 0 0 14px #fff; font-family: var(--jp); letter-spacing: .3em; }
.scene-mono .hint { color: #fff; text-shadow: 0 0 4px #000, 0 0 10px #000; }

/* ---------- EXIT ---------- */
.scene-exit { background: radial-gradient(ellipse at 50% 20%, #ff4fd8 0%, #a8007a 35%, #2a0030 75%); overflow-y: auto; }
.ex-in { position: relative; min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 70px 16px 40px; }
.ex-neon { font-family: var(--logo); font-size: clamp(38px, 11vw, 80px); line-height: .95; text-align: center; color: #fff; text-shadow: var(--neon); }
.receipt {
  width: min(92vw, 360px); background: #fffdf8; color: #222; font-family: var(--dot); font-size: 14px; line-height: 1.55; padding: 20px 18px 26px; box-shadow: 0 20px 50px rgba(0,0,0,.5);
  -webkit-mask: linear-gradient(#000, #000) top/100% calc(100% - 10px) no-repeat, radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) bottom/14px 12px repeat-x;
  transform-origin: top; animation: print 1.6s steps(14);
}
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.receipt h2 { margin: 0 0 4px; font-family: var(--logo); font-weight: 400; font-size: 28px; text-align: center; color: var(--pink); line-height: 1; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 2px dashed #bbb; margin: 10px 0; }
.receipt .lbl { color: #999; font-size: 12px; }
.receipt .item { padding-left: 1em; color: #d4006f; word-break: break-all; }
.receipt .big { margin: 8px 0 4px; text-align: center; font-family: var(--jp); font-size: 24px; color: var(--pink); }
.receipt .tot { display: flex; justify-content: space-between; font-size: 18px; }
.ex-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn.ghost { background: transparent; box-shadow: 0 0 0 3px #fff, 0 0 16px var(--pink); animation: none; }
.ex-left { font-family: var(--hand); font-weight: 700; font-size: 15px; color: #ffd6f1; text-align: center; }

/* 飾りの板はタップを吸わない */
.cr-lights, .gate-stars, .gate-floor, .gc-wall, .esc-rail, .esc-glass, .bl-layer, .cr-canopy, .cr-pole, .cr-base { pointer-events: none; }
