/* =========================
   🌈 Üldine kujundus
========================= */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at top right,
              rgba(255, 239, 186, 0.2),
              rgba(255, 125, 95, 0.3),
              rgba(106, 48, 147, 0.4)),
              url('taust.jpg') no-repeat center center fixed;
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 40px;
  box-sizing: border-box;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: -1;
}

/* =========================
   🧭 Päis ja muusika nupud
========================= */
header {
  position: relative;
  width: 100%;
  text-align: center;
  color: #fff;
  margin-bottom: 50px;
  text-shadow: 0 0 20px rgba(255, 150, 80, 0.8);
}

header h1 {
  font-size: 2.8rem;
  letter-spacing: 1px;
}

.music-controls {
  position: absolute;
  top: 10px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.music-controls button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 1.4rem;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  text-shadow: 0 0 8px rgba(255, 160, 100, 0.6);
}

.music-controls button:hover {
  background: rgba(255, 200, 150, 0.3);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(255, 160, 100, 0.6);
}

#restart-btn {
  font-size: 1.6rem;
}

/* =========================
   🔗 Link kastid
========================= */
.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
  width: 100%;
  max-width: 1200px;
}

.link-box {
  position: relative;
  height: 150px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: all 0.35s ease;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.9s forwards;
}

.link-box img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  transition: transform 0.4s ease;
  filter: drop-shadow(0 0 8px rgba(255, 180, 120, 0.6));
  z-index: 1;
}

.link-box span {
  position: absolute;
  bottom: 12px;
  font-size: 1.05em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  color: rgba(255, 220, 200, 0.85);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
}

/* Hover efektid */
.link-box:hover {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 0 25px rgba(255, 140, 80, 0.45);
  background: rgba(255, 255, 255, 0.25);
}

.link-box:hover img {
  transform: scale(1.15) rotate(3deg);
}

.link-box:hover span {
  opacity: 1;
  transform: translateY(0);
  animation: glowOn 0.8s ease forwards, neonPulse 3s ease-in-out infinite;
}

/* Läige */
.link-box::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(120deg,
              rgba(255,255,255,0) 30%,
              rgba(255,255,255,0.3) 50%,
              rgba(255,255,255,0) 70%);
  transform: rotate(25deg);
  opacity: 0;
  transition: opacity 0.4s;
}

.link-box:hover::before {
  opacity: 1;
  animation: shine 1s forwards;
}

/* =========================
   ✨ Animatsioonid
========================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shine {
  0% { transform: translateX(-200%) rotate(25deg); }
  100% { transform: translateX(200%) rotate(25deg); }
}

@keyframes glowOn {
  0% { text-shadow: 0 0 0 rgba(255,160,100,0); color: rgba(255,210,180,0.6); }
  50% { text-shadow: 0 0 20px rgba(255,160,100,0.9); color: rgba(255,235,220,1); }
  100% { text-shadow: 0 0 10px rgba(255,100,200,0.7); color: rgba(255,230,255,1); }
}

@keyframes neonPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(255,100,200,0.6); }
  50% { text-shadow: 0 0 20px rgba(255,180,250,0.9); }
}