:root { color-scheme: dark; background: #000; --sticker-size: min(46vw, 46vh, 300px); --sticker-size: min(46vw, 46dvh, 300px); }
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { background: #000; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
body.playing { overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; }
button:focus-visible { outline: 2px solid #e4a8c3; outline-offset: 5px; }
.intro {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  cursor: pointer;
  touch-action: manipulation;
  gap: 24px;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.intro-main { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 32px 0 12px; }
.intro-sticker { display: block; width: var(--sticker-size); height: auto; image-rendering: pixelated; user-select: none; -webkit-user-drag: none; }
.start-prompt { margin: 0; color: #b8aeb7; font-size: 16px; line-height: 1.5; letter-spacing: .12em; user-select: none; }
.intro:focus { outline: none; }
.community { cursor: default; }
.community { position: relative; isolation: isolate; justify-self: center; width: min(100%, 480px); overflow: hidden; border: 1px solid #333b4c; border-radius: 12px; background: #131925; }
.community-visual { position: absolute; z-index: -1; inset: 0 0 0 auto; width: 42%; overflow: hidden; }
.community-art { position: absolute; top: 50%; right: -4px; width: auto; height: 140%; transform: translateY(-50%); }
.community-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #131925, transparent 38%); }
.community-copy { position: relative; padding: 17px 20px; }
.community-label { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; color: #b2bfd8; font-size: 12px; font-weight: 600; letter-spacing: .07em; }
.community h1 { margin: 0 0 9px; font-size: 19px; font-weight: 650; line-height: 1.35; }
.community-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.group-number { color: #dbe5fa; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .07em; user-select: all; }
#copy-group { min-height: 32px; padding: 4px 10px; color: #e4eafa; border: 1px solid #596477; border-radius: 6px; background: rgba(17,24,37,.65); font-size: 12px; cursor: pointer; touch-action: manipulation; }
#copy-group:hover { border-color: #c4d5f4; background: #29384c; }
.scene {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  touch-action: manipulation;
}
.sticker-button {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: var(--sticker-size);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sticker-button:focus-visible { outline: 2px solid #d2a7ca; outline-offset: 10px; }
.sticker-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  user-select: none;
  -webkit-user-drag: none;
}
.sticker-button .sticker-open { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.sticker-button.talking .sticker-open { animation: mouth-cycle 300ms linear infinite; }
@keyframes mouth-cycle {
  0%, 42% { opacity: 1; }
  43%, 75% { opacity: 0; }
  76%, 100% { opacity: 1; }
}
.ghosts { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ghost {
  position: absolute;
  top: var(--y); left: var(--x);
  display: block;
  width: var(--size);
  height: auto;
  image-rendering: pixelated;
  opacity: 0;
  filter: saturate(.55) brightness(1.25) drop-shadow(0 0 12px rgba(222, 164, 227, .48));
  animation: emerge var(--duration) linear forwards;
  animation-delay: var(--delay);
}
@keyframes emerge {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(var(--rotate-start)); }
  36% { opacity: .66; transform: translate(-50%, -50%) scale(.8) rotate(var(--rotate-mid)); }
  67% { opacity: .48; transform: translate(-50%, -50%) scale(1.1) rotate(var(--rotate-late)); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.38) rotate(var(--rotate-end)); }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  :root { --sticker-size: min(56vw, 42dvh, 240px); }
  .intro { gap: 20px; }
  .intro-main { gap: 24px; }
  .community-copy { padding: 15px 16px; }
  .community-visual { width: 34%; }
  .community-art { right: -22px; }
  .community h1 { font-size: 18px; }
}
@media (max-height: 540px) and (min-width: 600px) {
  .intro { gap: 12px; padding-top: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .intro-main { padding: 0; gap: 12px; }
  .community-copy { padding: 10px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ghost { animation-duration: .01s; }
}
