* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive;
  color: #4a0033;
  background-color: #ffb6e1;
  background-image:
    radial-gradient(#fff 1.5px, transparent 1.5px),
    radial-gradient(#ff69b4 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px;
  background-position: 0 0, 14px 14px;
  overflow-x: hidden;
}

.marquee {
  background: #000;
  color: #ff0;
  font-weight: bold;
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 0;
  border-bottom: 3px ridge #ff69b4;
}

.marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: scroll 25s linear infinite;
}

@keyframes scroll {
  to { transform: translateX(-100%); }
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 14px 40px;
}

.title-box {
  text-align: center;
  background: #fff0fa;
  border: 5px ridge #ff1493;
  padding: 16px;
  margin-bottom: 18px;
}

h1 {
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  margin: 0;
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 #fff, 5px 5px 0 #ff1493;
}

.rainbow {
  background: linear-gradient(90deg, #ff0080, #ff8c00, #ffd700, #00c853, #00b0ff, #aa00ff, #ff0080);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow 3s linear infinite;
}

h1.rainbow {
  text-shadow: none;
  filter: drop-shadow(3px 3px 0 #fff) drop-shadow(2px 2px 0 #ff1493);
}

@keyframes rainbow {
  to { background-position: 200% center; }
}

.subtitle {
  font-style: italic;
  margin: 6px 0 12px;
}

.construction {
  display: inline-block;
  background: repeating-linear-gradient(45deg, #ffd700 0 14px, #000 14px 28px);
  padding: 4px;
  font-weight: bold;
  color: #000;
  text-shadow: 0 0 4px #ffd700, 0 0 4px #ffd700, 0 0 4px #ffd700;
}

.grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.box {
  background: #fff;
  border: 3px solid #ff69b4;
  box-shadow: 6px 6px 0 #c2185b;
  padding: 0 14px 14px;
}

.box h2 {
  margin: 0 -14px 12px;
  padding: 6px 14px;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(90deg, #ff1493, #ff69b4);
  text-shadow: 1px 1px 0 #880e4f;
}

.photo-frame {
  margin: 0 0 12px;
  padding: 8px 8px 4px;
  background: #fff;
  border: 2px dashed #ff1493;
  text-align: center;
  transform: rotate(-2deg);
  transition: transform 0.3s;
}

.photo-frame:hover {
  transform: rotate(1deg) scale(1.04);
}

.photo-frame img {
  width: 100%;
  display: block;
  background: linear-gradient(135deg, #ffd1ec, #ffe4f3);
}

.photo-frame figcaption {
  font-weight: bold;
  color: #ff1493;
  padding-top: 4px;
}

.photo-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, #ffd1ec, #ffe4f3);
  font-size: 0.9rem;
  padding: 12px;
}

.stats {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 1.8;
}

.online {
  color: #00c853;
  font-weight: bold;
}

.blink {
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to { visibility: hidden; }
}

.counter {
  font-family: "Courier New", monospace;
  font-size: 2rem;
  letter-spacing: 6px;
  text-align: center;
  background: #000;
  color: #39ff14;
  padding: 6px;
  border: 3px inset #888;
}

.tiny {
  font-size: 0.8rem;
  text-align: center;
  margin: 8px 0 0;
}

.top8 {
  list-style: none;
  counter-reset: top;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.top8 li {
  counter-increment: top;
  text-align: center;
  font-size: 0.85rem;
  border: 2px solid #ffb6e1;
  padding: 8px 4px;
  background: #fff0fa;
}

.top8 li::before {
  content: "#" counter(top);
  display: block;
  font-weight: bold;
  color: #ff1493;
}

.top8 li span {
  display: block;
  font-size: 2rem;
}

.achievements {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 1.9;
}

.quiz {
  text-align: center;
}

.question {
  font-size: 1.3rem;
  font-weight: bold;
}

.quiz-area {
  position: relative;
  height: 110px;
}

.btn {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: bold;
  padding: 10px 22px;
  border: 3px outset #ff69b4;
  background: #ffe4f3;
  color: #c2185b;
  cursor: pointer;
}

.btn:active {
  border-style: inset;
}

.btn.yes {
  position: absolute;
  left: 25%;
  top: 30px;
  transform: translateX(-50%);
  background: #ff1493;
  color: #fff;
}

.btn.no {
  position: absolute;
  left: 70%;
  top: 30px;
  transition: left 0.15s, top 0.15s;
}

.quiz-result {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ff1493;
  min-height: 1.5em;
}

.guestbook .entry {
  border-bottom: 1px dotted #ff69b4;
  padding: 8px 0;
}

.guestbook .entry b {
  color: #ff1493;
}

.sign {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sign input {
  font-family: inherit;
  flex: 1 1 160px;
  padding: 8px;
  border: 2px inset #ffb6e1;
}

.footer {
  text-align: center;
  margin-top: 26px;
  font-size: 0.9rem;
}

.sparkle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 16px;
  animation: sparkle-fade 0.9s ease-out forwards;
}

@keyframes sparkle-fade {
  to {
    opacity: 0;
    transform: translateY(24px) scale(0.3) rotate(90deg);
  }
}

.heart-rain {
  position: fixed;
  top: -40px;
  pointer-events: none;
  z-index: 9998;
  animation: fall linear forwards;
}

@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); }
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .top8 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .marquee span,
  .rainbow,
  .blink {
    animation: none;
  }
}
