*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


@font-face {
    font-family: 'bangers';
    src: url('/fonts/bangers-regular-webfont.woff2') format('woff2'),
         url('/fonts/bangers-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'atma';
    src: url('/fonts/atma-medium-webfont.woff2') format('woff2'),
         url('/fonts/atma-medium-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'atma';
    src: url('/fonts/atma-bold-webfont.woff2') format('woff2'),
         url('/fonts/atma-bold-webfont.woff') format('woff');
    font-weight: bold;
    font-style: normal;

}

html {
  font-size: 30px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
  font-family: atma, 'Segoe UI', system-ui, -apple-system, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

/* === FULL-SCREEN PHOTO (two layers for crossfade) === */
#otto-photo,
#otto-photo-next {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  transition: opacity 1s ease-in-out;
}

#otto-photo {
  z-index: 0;
}

#otto-photo-next {
  z-index: 1;
  opacity: 0;
}

/* === CANVAS OVERLAY === */
#trail-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  touch-action: none;
  cursor: pointer;
  mix-blend-mode: hard-light;
}

/* === HEADLINE === */
#headline {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  padding: 20px 16px 24px;
  /*background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);*/
  pointer-events: none;
}

#headline h1 {
  font-size: clamp(2rem, 6vw, 6rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  /*letter-spacing: 0.02em;*/
}

/* === COUNTER === */
#counter-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  padding: 24px 16px 28px;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

#counter-display {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  font-weight: 600;
}

#counter-value {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  margin-left: 0.3em;
}

/* === FLOATING POINTS + MESSAGE ANIMATION === */
.pet-points {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  /* font-size is set dynamically by JS based on score */
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 0 20px rgba(255, 200, 50, 0.6);
  animation: float-up 1.5s ease-out forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%); /* center on the pointer position */
  white-space: nowrap;
}

.pet-score {
  display: block;
  line-height: 1.1;
}

.pet-message {
  display: block;
  font-size: 0.5em; /* relative to parent — scales with score */
  font-weight: 600;
  opacity: 0.9;
  margin-top: 0.1em;
}


@keyframes float-up {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  60% {
    opacity: 0.9;
    transform: translateX(-50%) translateY(-60px) scale(1.05);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-120px) scale(0.9);
  }
}

/* === REMOTE HEARTS === */
.remote-heart {
  position: fixed;
  z-index: 4;
  pointer-events: none;
  line-height: 1;
  transform: translate(-50%, -50%);
  animation: heart-float 1.5s ease-out forwards;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

@keyframes heart-float {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0) translateX(0) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) translateY(-25px) translateX(var(--heart-drift, 0px)) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-50px) translateX(var(--heart-drift, 0px)) scale(0.8);
  }
}

/* === SERVER FULL OVERLAY === */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
  color: #fff;
  padding: 40px;
  max-width: 400px;
}

.overlay-content p {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  margin-bottom: 16px;
  line-height: 1.4;
}

.overlay-content p:last-child {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
}
