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

html, body {
  height: 100%;
  font-family: 'Segoe UI', Arial, sans-serif;
}

/* ---------- POZADÍ (textura s buldočky) ---------- */

#dopis-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('images/bulldogs-bg.jpg');
  background-repeat: repeat;
  background-size: 420px auto;
  filter: blur(2px);
  transform: scale(1.05);
}

#dopis-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(194, 24, 91, 0.25);
}

/* ---------- SAMOTNÝ DOPIS ---------- */

#letter-box {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 60px auto;
  padding: 40px 36px;
  background: #F5EBDD;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  min-height: calc(100dvh - 120px);
}

#letter-box p {
  text-align: justify;
  font-size: 17px;
  line-height: 1.7;
  color: #3a2e26;
  margin-bottom: 18px;
}

#letter-box p:last-child {
  margin-bottom: 0;
}

/* ---------- HUDBA ---------- */

#toggle-music {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 500;
  width: 44px;
  height: 44px;
  background: #C2185B;
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  overflow: visible;
}

#toggle-music::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #FF2E9A, #8B5CF6, #2DD4BF, #FF2E9A);
  filter: blur(9px);
  opacity: 0.85;
  z-index: -2;
  animation: spin-glow 3s linear infinite;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

#toggle-music::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, #FF2E9A, #8B5CF6, #2DD4BF, #FF2E9A);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  animation: spin-glow 3s linear infinite;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

#volume-control {
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 500;
  width: 44px;
  height: 150px;
  background: white;
  border-radius: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 8px;
  margin: 0;
  background: #FFD6E8;
  border-radius: 4px;
  transform: rotate(-90deg);
  cursor: pointer;
  outline: none;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #C2185B;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

#volume-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #C2185B;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

#volume-slider::-moz-range-track {
  background: #FFD6E8;
  height: 8px;
  border-radius: 4px;
}

/* ---------- HOME TLAČÍTKO ---------- */

#home-button {
  position: fixed;
  bottom: 16px;
  left: 10px;
  z-index: 500;
  width: 44px;
  height: 44px;
  background: #C2185B;
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  overflow: visible;
  text-decoration: none;
}

#home-button::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #FF2E9A, #8B5CF6, #2DD4BF, #FF2E9A);
  filter: blur(9px);
  opacity: 0.85;
  z-index: -2;
  animation: spin-glow 3s linear infinite;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

#home-button::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 0deg, #FF2E9A, #8B5CF6, #2DD4BF, #FF2E9A);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  animation: spin-glow 3s linear infinite;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

@keyframes spin-glow {
  from {
    transform: rotate(0deg) translateZ(0);
  }
  to {
    transform: rotate(360deg) translateZ(0);
  }
}