/* Globale Box-Sizing-Regel */
* {
  box-sizing: border-box;
}

/* CSS-Variable */
:root {
  --size: 20px;
}

/* --- Scanner-Seite (index-page) --- */
body.index-page {
  display: grid;
  place-items: center;
  min-height: 50vh;
  background: hsl(0, 0%, 6%);
  margin: 0;
  font-family: sans-serif;
  text-align: center;
  padding-top: 10px;
  color: #fff;
}

/* Animierter Hintergrund */
.el {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: conic-gradient(from 180deg at 50% 70%, hsla(0,0%,98%,1) 0deg, #9336d3 72deg, #5544d4 144deg, #1a3ca6 216deg, #9336d3 288deg, hsla(0,0%,98%,1) 1turn);
  -webkit-mask: radial-gradient(circle at 50% 50%, white 2px, transparent 2.5px) 50% 50% / var(--size) var(--size),
                url("noise-mask.png") 256px 50% / 256px 256px;
  mask: radial-gradient(circle at 50% 50%, white 2px, transparent 2.5px) 50% 50% / var(--size) var(--size),
        url("noise-mask.png") 256px 50% / 256px 256px;
  -webkit-mask-composite: intersect;
  mask-composite: intersect;
  animation: flicker 20s infinite linear;
  z-index: -1;
}
@keyframes flicker {
  to {
    -webkit-mask-position: 50% 50%, 0 50%;
    mask-position: 50% 50%, 0 50%;
  }
}

/* --- Inhaltsseiten (z. B. Datenschutz, Impressum, Feedback, Anleitung) --- */
body.content-page {
  background: hsl(0, 0%, 6%);
  padding: 20px;
  color: white !important;
  margin: 0;
  font-family: sans-serif;
  text-align: center;
}

/* --- Gemeinsame Elemente --- */

/* Videoelement (Scanfenster) */
video {
  width: 120px;
  height: 120px;
  border: 2px solid #ccc;
  margin: 1em auto;
  display: block;
  background: #000;
  object-fit: cover;
}

/* Statusanzeige */
#result {
  font-size: 1.2em;
  margin-top: 1em;
  word-wrap: break-word;
  color: white !important;
}

/* Canvas ausblenden */
#canvas {
  display: none;
  color: #fff;
}

/* Allgemeine Button-Styles (unverändert) */
button {
  font-size: 1.2em;
  padding: 12px 20px;
  margin: 8px auto;
  display: block;
  border: none;
  border-radius: 5px;
  background-color: #007BFF;
  color: #fff;
  cursor: pointer;
  z-index: 2000;
}
button:active {
  background-color: #0056b3;
}

/* YouTube-Player Container */
#playerContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  transition: all 0.3s ease;
  z-index: 1000;
  color: #fff;
}
#hiddenPlayer {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Lautstärkeregler */
#volumeControl {
  margin: 1em auto;
  font-size: 1.2em;
  width: 90%;
  max-width: 400px;
  color: #ffffff;
}
#volumeSlider {
  width: 100%;
}

/* Songdetails */
#songDetails {
  display: none;
  font-size: 1.2em;
  margin: 1em auto;
  word-wrap: break-word;
}

/* Footer */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-size: 0.9em;
  z-index: 1000;
}
footer a {
  color: #fff;
  text-decoration: none;
  margin: 0 10px;
}
footer a:hover {
  text-decoration: underline;
}

/* Consent-Overlay */
#consentOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  z-index: 3000;
}
#consentOverlay h1 {
  font-size: 2em;
  margin-bottom: 0.5em;
}
#consentOverlay p {
  font-size: 1.1em;
  margin-bottom: 1em;
  max-width: 600px;
}
#consentOverlay button {
  max-width: 300px;
}

/* Mobile Optimierung */
@media (max-width: 390px) {
  body.index-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
  }
  button {
    font-size: 1.3em;
    padding: 14px 24px;
  }
  #result, #songDetails {
    font-size: 1.0em;
  }
  #consentOverlay h1 {
    font-size: 1.0em;
  }
  #consentOverlay p {
    font-size: 1em;
  }
}

/* Header & Absatz für Inhaltsseiten */
header {
  background: rgba(0, 0, 0, 0.7);
  padding: 20px;
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 20px;
}
p {
  text-align: justify;
  margin: 1em auto;
  max-width: 800px;
}

/* --- Reduzierte vertikale Abstände für Scanner-Elemente (außer Buttons) --- */
#video,
#volumeControl,
#result,
#canvas,
#playerContainer,
#startAudioButton,
#toggleButton,
#revealButton,
#songDetails,
img {
  margin-top: 4px;
  margin-bottom: 4px;
}
