html, body{
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  overflow:hidden;
  background:#050510;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

#stage{ position:fixed; inset:0; }
canvas{ display:block; width:100vw; height:100vh; }

#ui{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  pointer-events:none;
}

/* ---------- Intro Card (Dark Liquid, no top spotlight) ---------- */
.introCard{
  pointer-events:auto;
  position:relative;
  display:grid;
  gap:12px;
  place-items:center;
  text-align:center;
  padding:18px 20px;
  border-radius:22px;

  background:
    radial-gradient(140% 180% at 85% 85%, rgba(170,140,255,0.10), rgba(170,140,255,0) 60%),
    linear-gradient(180deg, rgba(10,10,18,0.56), rgba(8,8,14,0.34));

  backdrop-filter: blur(14px) saturate(140%) contrast(125%);
  -webkit-backdrop-filter: blur(14px) saturate(140%) contrast(125%);

  border:1px solid rgba(255,255,255,0.14);

  box-shadow:
    0 24px 70px rgba(0,0,0,0.58),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.40);
}

/* subtle micro-noise, no bright highlight */
.introCard::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  background:
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.025) 0px,
      rgba(255,255,255,0.025) 1px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0) 4px);
  opacity:0.10;
  filter: blur(0.25px);
}

.introTitle{
  font-size: clamp(18px, 3vw, 22px);
  color: rgba(255,255,255,0.94);
  font-weight: 600;
  line-height:1.1;
  margin:0;
  text-shadow: 0 2px 14px rgba(0,0,0,0.55);
}

/* ---------- Warm cozy Start Button ---------- */
#startBtn{
  appearance:none;
  -webkit-appearance:none;
  border:0;
  padding:14px 28px;
  border-radius:999px;

  font-size:16px;
  font-weight:500;
  letter-spacing:0.2px;

  color: rgba(255,255,255,0.96);

  /* warm & cozy */
  background:
    radial-gradient(120% 140% at 30% 30%,
      rgba(255,205,220,0.95),
      rgba(240,165,200,0.72),
      rgba(150,120,255,0.22)
    );

  box-shadow:
    0 12px 26px rgba(0,0,0,0.35),
    0 0 30px rgba(255,175,210,0.28),
    0 0 60px rgba(255,170,220,0.16),
    inset 0 1px 0 rgba(255,255,255,0.45);

  transform: translateZ(0);
  transition: transform 120ms ease, box-shadow 160ms ease, filter 160ms ease;
}

#startBtn:active{
  transform: scale(0.97);
}

/* ---------- Message (Dark Liquid Glass, no top spotlight) ---------- */
#message{
  position:fixed;
  left:50%;
  top:18%;
  width:min(calc(84vw + 40px), 560px);
  padding:0;
  display:flex;
  flex-direction:column;
  border-radius:20px;
  max-height: var(--message-max-h, clamp(220px, 38vh, 320px));
  overflow: hidden;

  opacity:0;
  pointer-events:none;
  transform: translateX(-50%) translateY(10px);

  background:
    radial-gradient(150% 190% at 85% 90%, rgba(170,140,255,0.08), rgba(170,140,255,0) 62%),
    linear-gradient(180deg, rgba(10,10,18,0.38), rgba(8,8,14,0.16));

  /* key knobs for seeing tulips/fireflies behind the card */
  backdrop-filter: blur(11px) saturate(150%) contrast(130%);
  -webkit-backdrop-filter: blur(11px) saturate(150%) contrast(130%);

  border:1px solid rgba(255,255,255,0.16);

  box-shadow:
    0 26px 80px rgba(0,0,0,0.62),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.45);

  transition: opacity 900ms ease, transform 900ms ease;
}

.messageContent{
  flex:1 1 auto;
  min-height:0;
  padding:12px 12px 10px 18px;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
  touch-action: pan-y;
  position:relative;
  z-index:1;
}

/* subtle scrollbar to match the vibe */
.messageContent::-webkit-scrollbar{
  width:6px;
}

.messageContent::-webkit-scrollbar-track{
  background: transparent;
}

.messageContent::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
  border-radius:999px;
  border:2px solid transparent;
  background-clip: padding-box;
}

.messageContent::-webkit-scrollbar-thumb:hover{
  background: linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.12));
}

.scrollFadeTop{
  position:absolute;
  left:0;
  right:0;
  top:0;
  height:22px;
  pointer-events:none;
  opacity:0;
  z-index:2;
  border-radius:20px 20px 0 0;
  background: linear-gradient(180deg, rgba(8,8,14,0.08) 0%, rgba(8,8,14,0.02) 70%, rgba(8,8,14,0) 100%);
  backdrop-filter: blur(18px) saturate(140%) contrast(120%);
  -webkit-backdrop-filter: blur(18px) saturate(140%) contrast(120%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  transition: opacity 180ms ease;
}

#message.is-scrollable:not(.at-top) .scrollFadeTop{
  opacity:0.6;
}

#message::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:22px;
  pointer-events:none;
  opacity:0;
  z-index:2;
  border-radius:0 0 20px 20px;
  background: linear-gradient(180deg, rgba(8,8,14,0) 0%, rgba(6,6,10,0.18) 55%, rgba(5,5,10,0.45) 100%);
  backdrop-filter: blur(18px) saturate(140%) contrast(120%);
  -webkit-backdrop-filter: blur(18px) saturate(140%) contrast(120%);
  mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%);
  transition: opacity 180ms ease;
}

#message.is-scrollable:not(.at-bottom)::before{
  opacity:0.6;
}

.scrollHint{
  position:absolute;
  left:50%;
  bottom:7px;
  width:18px;
  height:14px;
  pointer-events:none;
  opacity:0;
  z-index:3;
  transform: translateX(-50%);
  transition: opacity 180ms ease;
}

.scrollHint::before{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:10px;
  height:10px;
  border-left:2.8px solid rgba(255,255,255,0.9);
  border-bottom:2.8px solid rgba(255,255,255,0.9);
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius:1px;
  filter: none;
  z-index:1;
}

.scrollHint::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:18px;
  height:18px;
  transform: translate(-50%, -50%) rotate(-45deg);
  border-left:6px solid rgba(255,190,215,0.75);
  border-bottom:6px solid rgba(255,190,215,0.75);
  filter: blur(2px);
  opacity:0;
  pointer-events:none;
  z-index:0;
}

#message.is-scrollable:not(.at-bottom) .scrollHint{
  opacity:0.7;
}

#message.is-scrollable:not(.at-bottom):not(.at-top) .scrollHint{
  opacity:0.3;
}

#message.hint-pulse.is-scrollable:not(.at-bottom) .scrollHint{
  animation: hintPulse 2.1s ease-in-out infinite;
}

#message.hint-pulse.is-scrollable:not(.at-bottom) .scrollHint::before{
  filter: drop-shadow(0 0 4px rgba(255,210,235,0.85))
          drop-shadow(0 0 10px rgba(255,190,215,0.7))
          drop-shadow(0 0 18px rgba(255,170,220,0.4));
}

#message.hint-pulse.is-scrollable:not(.at-bottom) .scrollHint::after{
  filter: blur(5px);
  opacity:0.75;
}

@keyframes hintPulse{
  0%, 100%{
    opacity:0.55;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: drop-shadow(0 0 6px rgba(255,205,230,0.7));
  }
  50%{
    opacity:1;
    transform: translateX(-50%) translateY(4px) scale(1.06);
    filter: drop-shadow(0 0 10px rgba(255,205,230,0.9))
            drop-shadow(0 0 18px rgba(255,170,220,0.55));
  }
}

/* micro-noise only */
#message::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  pointer-events:none;
  z-index:0;
  background:
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.025) 0px,
      rgba(255,255,255,0.025) 1px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0) 4px);
  opacity:0.10;
  filter: blur(0.25px);
}

#message.show{
  opacity:1;
  transform: translateX(-50%) translateY(0);
  pointer-events:auto;
}

#message h1{
  margin:0 0 8px 0;
  font-size: clamp(20px, 3.2vw, 28px);
  font-weight:600;
  color: rgba(255,255,255,0.96);
  text-shadow: 0 2px 16px rgba(0,0,0,0.62);
}

#message p{
  margin:0;
  font-size: clamp(16px, 2.6vw, 19px);
  line-height:1.65;
  font-weight:400;
  color: rgba(255,255,255,0.90);
  text-shadow: 0 2px 18px rgba(0,0,0,0.62);
}

@media (max-width: 520px){
  .messageContent{
    padding:14px 14px 16px;
  }
}
