
:root {
  color-scheme: dark;
  --bg: #111722;
  --panel: rgba(12, 18, 30, 0.88);
  --pink: #ff5ba7;
  --cyan: #59e7ff;
  --purple: #9b6cff;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 91, 167, .15), transparent 36%),
    radial-gradient(circle at 82% 82%, rgba(89, 231, 255, .13), transparent 38%),
    #111722;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button { font: inherit; }

#app, .intro, .intro__viewport {
  width: 100%;
  height: 100%;
}

.intro {
  position: relative;
  overflow: hidden;
  background: #111722;
}

.intro__viewport {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.intro__stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 50% 50%;
  will-change: transform;
}

.intro-layer {
  position: absolute;
  display: block;
  object-fit: fill;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  max-width: none;
}

.layer-BG_BUILDING { z-index: 0; }
.layer-SHOP_IN { z-index: 10; }
.layer-PLANTS { z-index: 20; }
.layer-BANNER_LEFT_UP,
.layer-BANNER_RIGHT_UP,
.layer-BANNER_LEFT_DOWN,
.layer-BANNER_RIGHT_DOWN { z-index: 30; }
.layer-CAT_BASE { z-index: 40; }
.layer-CAT_BODY { z-index: 41; }
.layer-CAT_HAND_RISE_DOWN,
.layer-CAT_HAND_RISE_MID,
.layer-CAT_HAND_RISE_UP { z-index: 42; }
.layer-CLAW_BASE,
.layer-CLAW_LEFT,
.layer-CLAW_RIGHT { z-index: 51; }
.layer-BTN_ENTER { z-index: 60; }
.layer-BTN_ENTER_ARROW_1,
.layer-BTN_ENTER_ARROW_2,
.layer-BTN_ENTER_ARROW_3 { z-index: 61; }
.layer-BUTTON_SPEAK,
.layer-BUTTON_SOUND,
.layer-BUTTON_SETTING { z-index: 70; }



.intro-sign-group {
  position: absolute;
  z-index: 50;
  pointer-events: none;
  user-select: none;
  transform-origin: 0 0;
  overflow: visible;
}

.intro-sign-part {
  position: absolute;
  display: block;
  object-fit: fill;
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: filter, opacity;
}

.sign-base {
  z-index: 0;
}

.sign-decor-line {
  z-index: 1;
}

.sign-text {
  z-index: 2;
}

.sign-star {
  z-index: 3;
}

/*
  The sign body stays stable while the individual light-emitting parts pulse
  independently. Hue movement is deliberately subtle to avoid a rainbow effect.
*/
.motion-neon .sign-text--claw {
  animation: neon-claw 3.8s ease-in-out infinite;
}

.motion-neon .sign-text--studio {
  animation: neon-studio 4.25s ease-in-out -.85s infinite;
}

.motion-neon .sign-text--arcade {
  animation: neon-arcade 4.8s ease-in-out -1.45s infinite;
}

.motion-neon .sign-decor-line {
  animation: neon-decor 3.7s ease-in-out -.45s infinite;
}

.motion-neon .sign-star {
  animation: neon-star 2.65s ease-in-out -.3s infinite;
}

.motion-neon.is-neon-flicker .sign-text--claw,
.motion-neon.is-neon-flicker .sign-text--studio,
.motion-neon.is-neon-flicker .sign-text--arcade {
  filter: brightness(1.48) saturate(1.25)
          drop-shadow(0 0 14px rgba(255,255,255,.55)) !important;
  opacity: 1 !important;
}

.layer-CLAW_LEFT.motion-claw {
  transform-origin: 82% 8%;
  animation: claw-left 4.4s ease-in-out infinite;
}
.layer-CLAW_RIGHT.motion-claw {
  transform-origin: 18% 8%;
  animation: claw-right 4.4s ease-in-out infinite;
}

/* Only one cat-hand frame is visible at a time. */
.layer-CAT_HAND_RISE_DOWN,
.layer-CAT_HAND_RISE_MID,
.layer-CAT_HAND_RISE_UP {
  opacity: 0;
}
.layer-CAT_HAND_RISE_DOWN.cat-frame--active,
.layer-CAT_HAND_RISE_MID.cat-frame--active,
.layer-CAT_HAND_RISE_UP.cat-frame--active {
  opacity: 1;
}

/* Arrow animation is controlled by JS to preserve the 3 separated Photoshop layers. */
.layer-BTN_ENTER_ARROW_1,
.layer-BTN_ENTER_ARROW_2,
.layer-BTN_ENTER_ARROW_3 {
  opacity: .25;
  transition: opacity 120ms linear, filter 120ms linear;
}
.enter-arrow--on {
  opacity: 1 !important;
  filter: brightness(1.35) drop-shadow(0 0 5px rgba(255,91,167,.9));
}

.intro-hit {
  position: absolute;
  z-index: 100;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
}

.intro-hit--enter:hover,
.intro-hit--enter:focus-visible {
  box-shadow: 0 0 22px rgba(255,91,167,.5), 0 0 42px rgba(155,108,255,.28);
}
.intro-hit--enter:active { transform: scale(.98); }

.intro-hit--speak:focus-visible,
.intro-hit--sound:focus-visible,
.intro-hit--settings:focus-visible {
  box-shadow: 0 0 0 3px rgba(89,231,255,.75);
}

.intro-hit[aria-pressed="false"]::after {
  content: "";
  position: absolute;
  left: 12%;
  top: 48%;
  width: 76%;
  height: 3px;
  background: #ff6b9f;
  border-radius: 999px;
  transform: rotate(-42deg);
  box-shadow: 0 0 8px rgba(255,91,167,.75);
}

.intro__boot {
  position: absolute;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background: #090d14;
  opacity: 1;
  animation: boot-fade 1.1s ease-out forwards;
}

.intro.is-entering .intro__stage {
  transition: transform 1.15s cubic-bezier(.2,.72,.2,1), filter .85s ease;
  filter: brightness(1.2) saturate(1.08);
}
.intro.is-entering .intro-hit {
  opacity: 0;
  transition: opacity .25s ease;
}
.intro.is-entering::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 180;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(255,255,255,.88), rgba(255,91,167,.22) 32%, transparent 65%);
  animation: enter-flash 1.15s ease-in forwards;
}

.settings {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 22px;
  padding: 0;
  color: white;
  background: rgba(13,18,30,.92);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 28px rgba(155,108,255,.2);
  backdrop-filter: blur(18px);
}
.settings::backdrop { background: rgba(5,8,15,.55); backdrop-filter: blur(6px); }
.settings__panel { min-width: min(86vw, 360px); padding: 22px; }
.settings__head { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.settings__head h2 { margin:0; font-size:20px; letter-spacing:.08em; }
.settings__close { width:38px; height:38px; border-radius:50%; border:1px solid rgba(255,255,255,.16); color:white; background:rgba(255,255,255,.08); cursor:pointer; font-size:24px; }
.settings__row { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:16px 0; border-top:1px solid rgba(255,255,255,.1); }
.settings__note { margin:10px 0 0; color:#aab6c8; font-size:12px; line-height:1.5; }

.placeholder {
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  text-align:center;
  padding:24px;
  color:white;
  background:
    radial-gradient(circle at center, rgba(155,108,255,.24), transparent 42%),
    linear-gradient(145deg, #111722, #171d29);
}
.placeholder[hidden] { display:none; }
.placeholder__eyebrow { color:#59e7ff; letter-spacing:.22em; font-size:12px; }
.placeholder h1 { margin:.25em 0; font-size:clamp(38px,8vw,86px); }
.placeholder p { color:#aab6c8; }
.placeholder button { margin-top:20px; padding:14px 22px; color:white; background:linear-gradient(135deg,#ff5ba7,#9b6cff); border:0; border-radius:999px; cursor:pointer; }

@keyframes boot-fade {
  0% { opacity:1; }
  20% { opacity:.96; }
  48% { opacity:.45; }
  65% { opacity:.68; }
  100% { opacity:0; visibility:hidden; }
}
@keyframes neon-claw {
  0%, 100% {
    filter: hue-rotate(-8deg) brightness(.82) saturate(.90)
            drop-shadow(0 0 2px rgba(255, 40, 170, .18));
    opacity: .90;
  }
  18% {
    filter: hue-rotate(-2deg) brightness(1.02) saturate(1.05)
            drop-shadow(0 0 7px rgba(255, 65, 190, .55));
    opacity: .98;
  }
  42% {
    filter: hue-rotate(7deg) brightness(1.30) saturate(1.25)
            drop-shadow(0 0 12px rgba(255, 90, 205, .85))
            drop-shadow(0 0 22px rgba(255, 50, 175, .45));
    opacity: 1;
  }
  58% {
    filter: hue-rotate(11deg) brightness(1.12) saturate(1.18)
            drop-shadow(0 0 9px rgba(255, 80, 200, .68));
    opacity: 1;
  }
  76% {
    filter: hue-rotate(1deg) brightness(.93) saturate(1.00)
            drop-shadow(0 0 4px rgba(255, 70, 190, .34));
    opacity: .95;
  }
}

@keyframes neon-studio {
  0%, 100% {
    filter: hue-rotate(-10deg) brightness(.84) saturate(.90)
            drop-shadow(0 0 2px rgba(50, 205, 255, .18));
    opacity: .91;
  }
  22% {
    filter: hue-rotate(-4deg) brightness(1.03) saturate(1.06)
            drop-shadow(0 0 7px rgba(70, 225, 255, .54));
    opacity: .98;
  }
  49% {
    filter: hue-rotate(9deg) brightness(1.28) saturate(1.22)
            drop-shadow(0 0 12px rgba(85, 235, 255, .85))
            drop-shadow(0 0 22px rgba(45, 205, 255, .42));
    opacity: 1;
  }
  67% {
    filter: hue-rotate(13deg) brightness(1.10) saturate(1.16)
            drop-shadow(0 0 9px rgba(75, 225, 255, .66));
    opacity: 1;
  }
  84% {
    filter: hue-rotate(0deg) brightness(.95) saturate(1.00)
            drop-shadow(0 0 4px rgba(60, 220, 255, .32));
    opacity: .96;
  }
}

@keyframes neon-arcade {
  0%, 100% {
    filter: hue-rotate(-5deg) brightness(.84) saturate(.92)
            drop-shadow(0 0 2px rgba(255, 200, 150, .15));
    opacity: .91;
  }
  38% {
    filter: hue-rotate(2deg) brightness(1.06) saturate(1.06)
            drop-shadow(0 0 7px rgba(255, 220, 175, .50));
    opacity: .98;
  }
  57% {
    filter: hue-rotate(8deg) brightness(1.28) saturate(1.18)
            drop-shadow(0 0 11px rgba(255, 228, 185, .76))
            drop-shadow(0 0 18px rgba(255, 185, 120, .35));
    opacity: 1;
  }
  77% {
    filter: hue-rotate(0deg) brightness(.98) saturate(1.00)
            drop-shadow(0 0 4px rgba(255, 215, 170, .28));
    opacity: .96;
  }
}

@keyframes neon-decor {
  0%, 100% {
    filter: hue-rotate(-8deg) brightness(.78) saturate(.88);
    opacity: .72;
  }
  48% {
    filter: hue-rotate(10deg) brightness(1.30) saturate(1.20)
            drop-shadow(0 0 10px rgba(165, 105, 255, .75))
            drop-shadow(0 0 18px rgba(120, 90, 255, .35));
    opacity: 1;
  }
}

@keyframes neon-star {
  0%, 100% {
    filter: hue-rotate(-6deg) brightness(.78) saturate(.90)
            drop-shadow(0 0 2px rgba(255, 115, 95, .18));
    opacity: .65;
    transform: scale(.96);
  }
  36% {
    filter: hue-rotate(7deg) brightness(1.55) saturate(1.28)
            drop-shadow(0 0 10px rgba(255, 125, 95, .90))
            drop-shadow(0 0 20px rgba(255, 80, 70, .42));
    opacity: 1;
    transform: scale(1.06);
  }
  56% {
    filter: hue-rotate(2deg) brightness(1.18) saturate(1.10)
            drop-shadow(0 0 6px rgba(255, 120, 90, .58));
    opacity: .92;
    transform: scale(1.015);
  }
}
@keyframes claw-left {
  0%,17%,88%,100% { transform:rotate(0deg); }
  36%,62% { transform:rotate(-11deg); }
}
@keyframes claw-right {
  0%,17%,88%,100% { transform:rotate(0deg); }
  36%,62% { transform:rotate(11deg); }
}
@keyframes enter-flash {
  0%,58% { opacity:0; }
  78% { opacity:.2; }
  94% { opacity:.92; }
  100% { opacity:1; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-neon .sign-text--claw,
  .motion-neon .sign-text--studio,
  .motion-neon .sign-text--arcade,
  .motion-neon .sign-decor-line,
  .motion-neon .sign-star {
    animation: none !important;
    filter: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .intro__boot { animation-duration:.25s; }
  .motion-neon, .motion-claw { animation:none !important; }
  .layer-BTN_ENTER_ARROW_1,
  .layer-BTN_ENTER_ARROW_2,
  .layer-BTN_ENTER_ARROW_3 { transition:none; }
}


/* ================================================================
   START GATE — user gesture unlock for BGM + intro activation
   ================================================================ */

.start-gate {
  position: absolute;
  inset: 0;
  z-index: 190;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.start-gate__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 56%, rgba(10, 14, 24, .12), rgba(6, 9, 15, .22) 70%),
    rgba(4, 7, 12, .10);
  backdrop-filter: brightness(.90) saturate(.94);
  -webkit-backdrop-filter: brightness(.90) saturate(.94);
  transition:
    opacity .9s ease,
    backdrop-filter .9s ease,
    -webkit-backdrop-filter .9s ease;
}

.start-gate__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2.2vh, 26px);
  transform: translateY(clamp(20px, 5vh, 64px));
  transition: opacity .55s ease, transform .7s cubic-bezier(.2,.7,.2,1);
}

.start-cat {
  position: relative;
  display: block;
  width: clamp(150px, 15vw, 210px);
  aspect-ratio: 191 / 231;
  filter:
    drop-shadow(0 10px 22px rgba(0,0,0,.38))
    drop-shadow(0 0 16px rgba(255,91,167,.22));
}

.start-cat img {
  position: absolute;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.start-cat__body {
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
  z-index: 2;
}

.start-cat__hand {
  z-index: 3;
  height: auto;
  opacity: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.22));
}

/*
  Keep each TAP TO START hand frame aligned to CAT_BODY using the
  original 1920x1080 authored layer relationship.
  CAT_BODY: x=1452, y=575, w=191, h=231
*/
.start-cat__hand--down {
  left: 2.1%;
  top: 70.1%;
  width: 34.6%;
  animation: start-hand-down 3.2s steps(1,end) infinite;
}
.start-cat__hand--mid {
  left: -5.8%;
  top: 58.4%;
  width: 29.8%;
  animation: start-hand-mid 3.2s steps(1,end) infinite;
}
.start-cat__hand--up {
  left: -15.7%;
  top: 46.8%;
  width: 37.2%;
  animation: start-hand-up 3.2s steps(1,end) infinite;
}

.start-gate__label {
  display: block;
  padding: .3em .65em .35em;
  border-radius: 999px;
  font-weight: 800;
  font-size: clamp(22px, 3.1vw, 40px);
  letter-spacing: .28em;
  text-indent: .28em;
  text-transform: uppercase;
  color: rgba(255,255,255,.97);
  text-shadow:
    0 2px 2px rgba(0,0,0,.9),
    0 0 10px rgba(255,255,255,.24);
  animation: start-label-pulse 2.1s ease-in-out infinite;
}

.start-gate:hover .start-gate__label,
.start-gate:focus-visible .start-gate__label {
  text-shadow:
    0 2px 2px rgba(0,0,0,.9),
    0 0 14px rgba(255,255,255,.38),
    0 0 24px rgba(255,91,167,.25);
}

.start-gate:focus-visible {
  outline: none;
}

.intro.is-started .start-gate {
  pointer-events: none;
}

.intro.is-started .start-gate__scrim {
  opacity: 0;
  backdrop-filter: brightness(1) saturate(1);
  -webkit-backdrop-filter: brightness(1) saturate(1);
}

.intro.is-started .start-gate__content {
  opacity: 0;
  transform: translateY(clamp(8px, 2vh, 22px)) scale(.96);
}

.intro.is-started .start-gate {
  animation: remove-start-gate .95s ease forwards;
}

@keyframes start-hand-down {
  0%, 17%, 72%, 100% { opacity: 1; }
  18%, 71% { opacity: 0; }
}
@keyframes start-hand-mid {
  0%, 17%, 35%, 55%, 73%, 100% { opacity: 0; }
  18%, 34%, 56%, 72% { opacity: 1; }
}
@keyframes start-hand-up {
  0%, 34%, 56%, 100% { opacity: 0; }
  35%, 55% { opacity: 1; }
}

@keyframes start-label-pulse {
  0%,100% { opacity: .76; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

@keyframes remove-start-gate {
  0%, 84% { visibility: visible; }
  100% { visibility: hidden; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .start-gate__content {
    transform: translateY(4vh);
  }
  .start-cat {
    width: clamp(126px, 42vw, 178px);
  }
  .start-gate__label {
    font-size: clamp(20px, 7vw, 29px);
    letter-spacing: .22em;
    text-indent: .22em;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .start-gate__content {
    gap: 8px;
    transform: translateY(16vh);
  }
  .start-cat {
    width: clamp(96px, 20vh, 128px);
  }
  .start-gate__label {
    font-size: clamp(16px, 4.8vh, 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-cat__hand--down,
  .start-cat__hand--mid,
  .start-cat__hand--up,
  .start-gate__label {
    animation: none !important;
  }
  .start-cat__hand--mid { opacity: 1; }
  .start-cat__hand--down,
  .start-cat__hand--up { opacity: 0; }
  .start-gate__scrim,
  .start-gate__content {
    transition-duration: .2s;
  }
}


/* Phase Intro Login Gate: ENTER artwork/button is retired. */
.layer-BTN_ENTER,
.layer-BTN_ENTER_ARROW_1,
.layer-BTN_ENTER_ARROW_2,
.layer-BTN_ENTER_ARROW_3,
.intro-hit--enter { display:none !important; }
