/* =====================================================================
   PIXEL LEGACY — Higgsfield scenes (Nov 2026 update)
   Section backgrounds, the living arcade hero, music button,
   and the secret door.
   ===================================================================== */

/* ---------- section backgrounds ---------- */
.scene { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--night); }
.scene-img { position: absolute; inset: 0; background: url(../media/arcade-hall.webp) center/cover no-repeat; opacity: .5; transition: opacity .6s, background-image 0s; }
.scene::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 30%, rgba(7,4,15,.35), rgba(7,4,15,.82) 70%), linear-gradient(180deg, rgba(7,4,15,.55), rgba(7,4,15,.25) 30%, rgba(7,4,15,.9)); }
body[data-view="hall"] .scene-img { background-image: url(../media/trophy-alcove.webp); opacity: .62; }
body[data-view="agency"] .scene-img { background-image: url(../media/control-room.webp); opacity: .6; }
body[data-view="requests"] .scene-img { background-position: 50% 70%; opacity: .55; }
body { background: transparent; }
html { background: var(--night); }

/* ---------- the living arcade hero ---------- */
.hero-media { position: absolute; inset: 0; z-index: -3; overflow: hidden; }
.hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  transition: opacity .35s linear; background: url(../media/arcade-hall.webp) 50% 40%/cover; }
.hero-shade { position: absolute; inset: 0;
  background: radial-gradient(60% 55% at 50% 48%, rgba(7,4,15,.62), rgba(7,4,15,.15) 75%),
              linear-gradient(180deg, rgba(7,4,15,.55) 0, rgba(7,4,15,0) 22%, rgba(7,4,15,0) 60%, var(--night) 100%); }
#stars { display: none; }
.hero { min-height: min(96vh, 900px); }
.hero h1 .chrome, .hero h1 .neon { filter: drop-shadow(0 6px 24px rgba(7,4,15,.8)); }

/* ---------- treasure hunt: the neon tube and the coin ---------- */
.neon-tube { position: absolute; z-index: 2; cursor: pointer; width: 80px; height: 36px; margin: -18px 0 0 -40px; border: 0; padding: 0; background: transparent; }
.neon-tube::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 6px; margin-top: -3px; border-radius: 6px; transform: rotate(var(--rot, 30deg));
  background: #9ff8ff; box-shadow: 0 0 10px #00e5ff, 0 0 26px #00e5ff, 0 0 50px rgba(0,229,255,.6); opacity: 0; }
.neon-tube.sun { height: 70px; margin-top: -35px; }
.neon-tube.sun::after { left: 0; right: 0; top: 0; bottom: 0; height: auto; margin: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255,210,120,.9), rgba(255,90,140,.5) 45%, transparent 70%); box-shadow: none; }
.neon-tube.flicker::after { animation: tube 4s steps(1) infinite; }
@keyframes tube { 0%, 78%, 100% { opacity: .18 } 80% { opacity: 1 } 82% { opacity: .1 } 84% { opacity: .9 } 87% { opacity: .1 } 89% { opacity: 1 } 92% { opacity: .18 } }
.neon-tube.zap::after { animation: zap .7s steps(1); }
@keyframes zap { 0% { opacity: 1 } 15% { opacity: 0 } 30% { opacity: 1 } 45% { opacity: 0 } 60% { opacity: 1 } 100% { opacity: 0 } }
.hunt-coin { position: absolute; z-index: 3; width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 0; padding: 0; background: none; cursor: pointer; filter: drop-shadow(0 0 10px rgba(255,224,102,.8)); }
.hunt-coin svg { width: 100%; height: 100%; animation: spin 1.1s steps(6) infinite; }
@keyframes spin { 0% { transform: scaleX(1) } 25% { transform: scaleX(.45) } 50% { transform: scaleX(.08) } 75% { transform: scaleX(.45) } 100% { transform: scaleX(1) } }
.hunt-coin.drop { animation: coinDrop 1.1s cubic-bezier(.3,0,.6,1) forwards; }
@keyframes coinDrop { 0% { transform: translateY(0) } 60% { transform: translateY(var(--fall)) } 75% { transform: translateY(calc(var(--fall) - 30px)) } 88% { transform: translateY(var(--fall)) } 94% { transform: translateY(calc(var(--fall) - 8px)) } 100% { transform: translateY(var(--fall)) } }
.hunt-coin.take { animation: coinTake .7s cubic-bezier(.6,0,.4,1) forwards; }
@keyframes coinTake { to { transform: translateY(calc(var(--fall) - 260px)) scale(2.2); opacity: 0 } }
.hunt-whisper { position: absolute; z-index: 3; left: 50%; bottom: 18px; transform: translateX(-50%); font: 9px/1.6 var(--f-pixel); letter-spacing: .12em; color: var(--yellow);
  text-shadow: 0 0 10px rgba(255,224,102,.8); white-space: nowrap; opacity: 0; transition: opacity .8s; pointer-events: none; }
.hunt-whisper.on { opacity: 1; }

/* ---------- the trophy in the Hall of Fame ---------- */
.trophy { display: inline-block; vertical-align: -3px; width: 16px; height: 16px; margin-right: 8px; padding: 0; border: 0; background: none; cursor: default; opacity: .75; }
.trophy svg { width: 100%; height: 100%; display: block; }
.trophy.glint { cursor: pointer; opacity: 1; animation: glint 3.2s ease-in-out infinite; }
@keyframes glint { 0%, 80%, 100% { filter: none } 86% { filter: drop-shadow(0 0 6px #ffe066) brightness(1.6) } }
.trophy.clink { animation: clink .3s; }
@keyframes clink { 30% { transform: rotate(-14deg) } 70% { transform: rotate(10deg) } }

/* ---------- music button ---------- */
#musicBtn .mute-x { display: none; }
#musicBtn[aria-pressed="false"] .mute-x { display: inline; }
#musicBtn[aria-pressed="false"] { opacity: .55; }
#musicBtn[aria-pressed="true"] svg { filter: drop-shadow(0 0 4px var(--cyan)); }

/* ---------- secret door ---------- */
.vault { position: fixed; inset: 0; z-index: 9000; background: #05020c; overflow: hidden; opacity: 0; visibility: hidden; transition: opacity .7s, visibility 0s .7s; }
.vault.on { opacity: 1; visibility: visible; transition: opacity .7s; }
.vault-stage { position: absolute; left: 0; top: 0; width: 1344px; height: 752px; transform-origin: 0 0; }
.vault.unlocked .vault-stage { transition: transform 3.5s cubic-bezier(.4,0,.2,1) .4s; }
@media (prefers-reduced-motion: reduce) { .vault.unlocked .vault-stage { transition: none; } }
.vault-img { position: absolute; inset: 0; background: center/100% 100% no-repeat; transition: opacity 1.4s ease, transform 6s ease-out; }
.vault-img.closed { background-image: url(../media/door-closed.webp); }
.vault-img.open { background-image: url(../media/door-open.webp); opacity: 0; }
.vault.unlocked .vault-img.open { opacity: 1; }
.vault.unlocked .vault-img.closed { opacity: 0; }
.vault-flash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 70% 48%, #fff6d6, #ffcf66 30%, rgba(255,160,40,0) 70%); opacity: 0; }
.vault.flash .vault-flash { animation: vflash 1.6s ease-out; }
@keyframes vflash { 0% { opacity: 0 } 12% { opacity: .95 } 100% { opacity: 0 } }
.vault-x { position: absolute; z-index: 5; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(7,4,15,.6); color: #fff; font: 18px var(--f-pixel); cursor: pointer; }
.vault-x:focus-visible { outline: 2px solid var(--yellow); }

/* the keypad on the wall */
.keypad { position: absolute; left: 1083px; top: 290px; width: 68px; height: 94px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; box-shadow: 0 0 0 0 rgba(0,229,255,.0); animation: kp 2s ease-in-out infinite; }
@keyframes kp { 50% { box-shadow: 0 0 26px 6px rgba(0,229,255,.55) } }
.vault.unlocked .keypad { display: none; }
.vault.ok .keypad { animation: none; box-shadow: 0 0 30px 10px rgba(80,255,140,.8); }

/* the lock terminal */
.lock { position: absolute; z-index: 4; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100% - 32px));
  padding: 20px 22px 18px; border-radius: 16px; text-align: center; color: #eafcff;
  background: linear-gradient(160deg, rgba(8,30,44,.92), rgba(10,6,28,.94)); box-shadow: 0 0 0 1px rgba(0,229,255,.35), 0 0 40px rgba(0,229,255,.25), 0 20px 60px rgba(0,0,0,.6);
  transition: opacity .6s, transform .6s; }
.lock::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); }
.lock .lk { font: 9px/1.4 var(--f-pixel); letter-spacing: .14em; color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.lock .lq { margin: 12px 0 4px; font: 600 clamp(16px, 2.2vw, 20px)/1.4 var(--f-body); color: #fff; text-wrap: balance; }
.lock .lh { font-size: 13px; color: rgba(220,240,255,.6); margin-bottom: 14px; }
.lock form { display: flex; gap: 10px; }
.lock input { flex: 1; min-width: 0; font: 16px/1.2 var(--f-pixel); letter-spacing: .1em; text-align: center; text-transform: uppercase; color: #7ff6ff; background: rgba(0,0,0,.45);
  border: 2px solid rgba(0,229,255,.4); border-radius: 10px; padding: 14px 10px; outline: none; caret-color: var(--pink); }
.lock input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0,229,255,.18); }
.lock button[type="submit"] { font: 11px var(--f-pixel); letter-spacing: .1em; color: #04131a; background: var(--cyan); border: 0; border-radius: 10px; padding: 0 18px; cursor: pointer; box-shadow: 0 0 18px rgba(0,229,255,.6); }
.lock .lm { min-height: 16px; margin-top: 10px; font: 9px/1.6 var(--f-pixel); color: #ff5577; }
.lock.shake { animation: lshake .4s; }
@keyframes lshake { 20%, 60% { transform: translateX(calc(-50% - 9px)) } 40%, 80% { transform: translateX(calc(-50% + 9px)) } }
.vault.unlocked .lock { opacity: 0; transform: translate(-50%, 30px); pointer-events: none; }

/* the hidden cabinet */
.marquee { position: absolute; left: 884px; top: 252px; width: 104px; height: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  font-family: "Yeseva One", Georgia, serif; color: #5a2a0c; opacity: 0; transition: opacity 1.2s 1s; pointer-events: none; }
.marquee b { font-size: 12px; line-height: 1; font-weight: 400; text-shadow: 0 1px 0 rgba(255,240,200,.7), 0 0 14px rgba(255,200,100,.7); }
.marquee small { font-size: 5px; letter-spacing: .3em; margin-top: 2px; color: #7a3d12; }
.vault.unlocked .marquee { opacity: 1; }
.cab-screen { position: absolute; left: 876px; top: 304px; width: 124px; height: 90px; border-radius: 8px; border: 0; padding: 0; background: transparent; cursor: pointer; display: none; }
.vault.unlocked .cab-screen { display: block; }
.cab-screen span { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); white-space: nowrap; font: 6px var(--f-pixel); color: #fff; padding: 4px 5px; border-radius: 3px;
  background: rgba(60,20,4,.75); text-shadow: 0 0 8px #ffcf66; opacity: 0; transition: opacity .8s 2s; animation: pressBlink 1.1s steps(2) infinite; }
.vault.unlocked .cab-screen span { opacity: 1; }
@keyframes pressBlink { 50% { color: #ffcf66 } }
.cab-screen:hover, .cab-screen:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255,207,102,.9), 0 0 30px rgba(255,190,90,.8); }
.vault-dust { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 2s 1s; }
.vault.unlocked .vault-dust { opacity: 1; }
.vault-dust i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #ffe7a8; box-shadow: 0 0 6px #ffcf66; animation: dust linear infinite; }
@keyframes dust { from { transform: translateY(0); opacity: 0 } 20% { opacity: 1 } to { transform: translateY(-120px); opacity: 0 } }

@media (prefers-reduced-motion: reduce) {
  .neon-tube.flicker::after, .hunt-coin svg, .trophy.glint, .keypad, .vault-dust i, .cab-screen span { animation: none; }
  .vault-img { transition: opacity .3s; }
}

/* two hidden cabinets (2026-11-20): Yan Bibiyan on the left, Evermark on the right */
.marquee.m-yan { left: 845px; top: 259px; width: 77px; height: 34px; }
.marquee.m-ev  { left: 959px; top: 258px; width: 76px; height: 34px; }
.marquee.m-yan b { font-size: 10px; }
.marquee.m-ev b { font-size: 10px; letter-spacing: .04em; color: #4a2508; }
.marquee small { font-size: 4px; letter-spacing: .25em; }
.cab-screen.c-yan { left: 841px; top: 305px; width: 88px; height: 84px; }
.cab-screen.c-ev  { left: 958px; top: 305px; width: 80px; height: 84px; }
.cab-screen span { font-size: 5px; padding: 3px 4px; }
