* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #000033;
  color: #ffff66;
  font-family: 'Comic Neue', 'Comic Sans MS', cursive;
  overflow-x: hidden;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'><text y='18' font-size='18'>✨</text></svg>") 4 4, auto;
}

/* Twinkling tiled star background */
#stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 70px, #ff0, transparent),
    radial-gradient(2px 2px at 150px 120px, #0ff, transparent),
    radial-gradient(1px 1px at 60px 160px, #f0f, transparent),
    radial-gradient(1px 1px at 180px 20px, #fff, transparent);
  background-size: 200px 200px;
  animation: twinkle 3s steps(2) infinite;
}

@keyframes twinkle {
  50% { opacity: 0.4; }
}

.construction {
  height: 16px;
  background: repeating-linear-gradient(45deg, #ffcc00 0 16px, #000 16px 32px);
}

header {
  text-align: center;
  padding: 24px 16px 8px;
}

.wordart {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(18px, 5vw, 40px);
  line-height: 1.5;
  margin: 0 0 16px;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(3px 3px 0 #000) drop-shadow(2px 2px 0 #fff);
  animation: rainbow 3s linear infinite, wobble 2s ease-in-out infinite;
}

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

@keyframes wobble {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg) scale(1.03); }
}

marquee {
  background: #ff00cc;
  color: #fff;
  border: 3px ridge #ffccff;
  padding: 6px 0;
  font-size: 18px;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

/* Album buttons, like desktop folder icons */
#albums {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.album-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #c0c0c0;
  border: 3px outset #fff;
  font-family: 'Comic Neue', 'Comic Sans MS', cursive;
  font-size: 18px;
  color: #000;
  cursor: pointer;
}

.album-button .folder { font-size: 26px; }

.album-button:hover .label { color: #ff00cc; text-decoration: underline; }

.album-button.active {
  border-style: inset;
  background: #000080;
  color: #ffff66;
}

.album-button.active .label { animation: blink 1s steps(1) infinite; }

@keyframes blink {
  50% { opacity: 0.3; }
}

/* Windows 98 style window */
.window {
  background: #c0c0c0;
  border: 3px outset #fff;
  color: #000;
}

.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  font-family: Tahoma, Verdana, sans-serif;
  font-weight: bold;
  font-size: 14px;
  padding: 3px 4px;
}

.titlebar .buttons b {
  display: inline-block;
  width: 18px;
  height: 16px;
  margin-left: 2px;
  background: #c0c0c0;
  border: 2px outset #fff;
  color: #000;
  font-size: 11px;
  line-height: 11px;
  text-align: center;
  cursor: pointer;
}

#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px;
  padding: 28px 20px;
  background: #008080;
}

/* Polaroids */
.polaroid {
  background: #fff;
  margin: 0;
  padding: 10px 10px 14px;
  align-self: start;
  box-shadow: 4px 4px 0 #000;
  transform: rotate(var(--tilt));
  transition: transform 0.3s;
  cursor: pointer;
  position: relative;
  animation: drop-in 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) backwards;
  animation-delay: var(--delay);
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.08);
  z-index: 2;
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: saturate(1.3) contrast(1.05);
}

.polaroid .caption {
  margin: 8px 0 0;
  text-align: center;
  font-size: 15px;
  line-height: 1.2;
}

.polaroid::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 60px;
  height: 18px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(255, 255, 153, 0.75);
}

@keyframes drop-in {
  from { opacity: 0; transform: translateY(-80px) rotate(30deg) scale(0.5); }
  to { opacity: 1; transform: rotate(var(--tilt)); }
}

.cake-zone {
  text-align: center;
  padding: 32px 0;
}

#cake {
  font-size: 72px;
  background: none;
  border: none;
  cursor: pointer;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  50% { transform: translateY(-14px); }
}

footer {
  text-align: center;
  padding: 16px 16px 110px;
}

.counter {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: #000;
  border: 2px inset #888;
}

.counter span {
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  color: #0f0;
  background: #111;
  padding: 6px 4px;
}

.badges {
  margin: 16px 0;
}

.badge {
  display: inline-block;
  margin: 4px;
  padding: 2px 6px;
  font-family: Verdana, sans-serif;
  font-size: 10px;
  color: #fff;
  background: #333;
  border: 1px solid #999;
}

/* Winamp-style music player */
#player {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 220px;
  z-index: 5;
}

.player-body {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
}

#player-toggle {
  width: 32px;
  height: 28px;
  background: #c0c0c0;
  border: 2px outset #fff;
  font-size: 14px;
  cursor: pointer;
}

#player-toggle:active { border-style: inset; }

.player-screen {
  flex: 1;
  min-width: 0;
  background: #000;
  border: 2px inset #888;
  color: #0f0;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 5px 2px;
}

.player-screen marquee {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}

.eq i {
  width: 4px;
  height: 4px;
  background: linear-gradient(#f00, #ff0, #0f0);
}

#player.playing .eq i { animation: eq 0.5s ease-in-out infinite alternate; }
#player.playing .eq i:nth-child(2) { animation-delay: 0.15s; }
#player.playing .eq i:nth-child(3) { animation-delay: 0.3s; }
#player.playing .eq i:nth-child(4) { animation-delay: 0.05s; }
#player.playing .eq i:nth-child(5) { animation-delay: 0.2s; }

@keyframes eq {
  to { height: 22px; }
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10;
}

#lightbox[hidden] { display: none; }

#lightbox .window {
  max-width: min(90vw, 800px);
  animation: pop 0.25s ease-out;
}

#lightbox img {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  margin: 8px auto;
  border: 2px inset #fff;
}

#lightbox-caption {
  margin: 0 8px 8px;
  text-align: center;
}

#lightbox-caption:empty { display: none; }

@keyframes pop {
  from { transform: scale(0.3); opacity: 0; }
}

/* Falling Un mañana characters; click one to get a phrase */
.faller {
  position: fixed;
  top: 0;
  z-index: 6;
  cursor: pointer;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 6px #ff00cc);
}

.faller:hover {
  filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 10px #0ff);
}

.phrase {
  position: fixed;
  z-index: 15;
  width: min(280px, calc(100vw - 32px));
  animation: pop 0.25s ease-out;
}

.phrase p {
  margin: 0;
  padding: 12px;
  font-size: 17px;
}

/* Cursor sparkles and confetti */
.sparkle, .confetti {
  position: fixed;
  pointer-events: none;
  z-index: 20;
}

.sparkle {
  font-size: 14px;
  animation: sparkle-fade 0.8s ease-out forwards;
}

@keyframes sparkle-fade {
  to { opacity: 0; transform: translateY(20px) scale(0.3); }
}

.confetti {
  top: -20px;
  width: 10px;
  height: 14px;
  animation: fall linear forwards;
}

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