/* ============================================
   MEME SOUNDBOARD - style.css
   NEON GLASS JUICY EDITION ✨🔊
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;800&family=Nunito:wght@400;700;800;900&display=swap');

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

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 215, 0, 0.12), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(255, 60, 120, 0.14), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(0, 230, 255, 0.12), transparent 45%),
    #12081f;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 4rem;
  user-select: none;
  position: relative;
  overflow-x: hidden;
}

/* Animated floating particles */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 60% 20%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 80% 50%, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1.5px 1.5px at 90% 80%, rgba(255,255,255,0.5), transparent);
  background-repeat: repeat;
  opacity: 0.35;
  animation: particleTwinkle 7s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

@keyframes particleTwinkle {
  0% { opacity: 0.2; }
  100% { opacity: 0.5; }
}

/* Title with glow */
h1 {
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  font-family: 'Baloo 2', cursive;
  background: linear-gradient(90deg, #ffd700, #ff6b6b, #00ffe0, #ff6b6b, #ffd700);
  background-size: 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.4));
  animation: float 4s ease-in-out infinite, titleWave 8s linear infinite;
  position: relative;
  z-index: 1;
}

@keyframes titleWave {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

.sub {
  margin-top: 0.4rem;
  color: #b9a8e0;
  letter-spacing: 0.3em;
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Controls row */
.controls {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.controls button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 800;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  color: #12081f;
  background: #fff;
  transition: transform 0.1s, box-shadow 0.1s, filter 0.2s;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 1;
}

.controls button:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,0.4); }
.controls .random { background: linear-gradient(45deg, #ffd700, #ffb300); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.5); }
.controls .random:hover { filter: brightness(1.1); }
.controls .lock.off { background: #888; color: #fff; }
.controls .fav.active { background: linear-gradient(45deg, #ffd700, #ffb300); box-shadow: 0 0 0 3px #fff, 0 6px 0 rgba(0,0,0,0.4), 0 0 30px rgba(255, 215, 0, 0.5); }
.controls .fav.active:active { box-shadow: 0 0 0 3px #fff, 0 3px 0 rgba(0,0,0,0.4); }

/* Search box */
.controls .search {
  padding: 0.75rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  outline: none;
  min-width: 200px;
  transition: background 0.15s, box-shadow 0.15s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.controls .search::placeholder { color: #b9a8e0; }
.controls .search:focus {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px #ffd700;
  border-color: transparent;
}

/* The grid of buttons */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.2rem;
  width: 100%;
  max-width: 900px;
  position: relative;
  z-index: 1;
}

/* Each meme button - BIG JUICY! */
.meme-btn {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.25), transparent 50%),
    var(--c);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  box-shadow:
    0 10px 0 rgba(0, 0, 0, 0.35),
    inset 0 -15px 25px rgba(0, 0, 0, 0.25),
    0 0 25px var(--c);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.2s;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  color: #fff;
}

/* favorite star badge on each button */
.star {
  position: absolute;
  top: 8px;
  right: 9px;
  font-size: 1.3rem;
  padding: 0;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  filter: grayscale(1) opacity(0.55) drop-shadow(0 2px 3px rgba(0,0,0,0.5));
  transition: transform 0.12s, filter 0.12s;
  z-index: 2;
}
.star:hover { transform: scale(1.35) rotate(20deg); filter: grayscale(0.5) opacity(0.8); }
.star.faved { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8)); animation: starPulse 1.5s ease-in-out infinite; }
.star:active { transform: scale(0.9); }

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25) rotate(10deg); }
}

/* hidden when the board is showing only favorites or a search result */
.hide-btn { display: none; }

.meme-btn .emoji { font-size: 2.4rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); transition: transform 0.15s; }
.meme-btn:hover .emoji { transform: scale(1.15); }

/* press animation */
.meme-btn.pressed {
  transform: scale(0.92) translateY(6px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 0 15px var(--c);
}

.meme-btn:hover {
  filter: brightness(1.2) saturate(1.2);
  transform: translateY(-2px);
  box-shadow:
    0 12px 0 rgba(0, 0, 0, 0.35),
    inset 0 -15px 25px rgba(0, 0, 0, 0.25),
    0 0 40px var(--c);
}
.meme-btn:active { transform: scale(0.9); }

/* Huge BOOM flash in the middle of the screen */
.boom {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  text-shadow: 0 0 50px rgba(255, 200, 0, 0.8);
}
.boom.hidden { display: none; }
.boom.fire {
  display: block;
  animation: boomAnim 0.5s ease-out forwards;
}
@keyframes boomAnim {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8) rotate(10deg); }
}

/* tip at the bottom */
.tip {
  margin-top: 2rem;
  color: #8a7bb8;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
  opacity: 0.8;
}

/* responsive */
@media (max-width: 600px) {
  .board { gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .controls { gap: 0.6rem; }
}
