/* ==================== Basis-Styles ==================== */
:root {
  --bg: #a7cfe6;
  --primary: #5d9ea2;
  --accent: #e5c3b7;
  --text: #ffffff;
  --white: #ffffff;
  --progress: #5d9ea2;
  --progress-warning: #ff9800;
  --progress-danger: #f44336;
  --ring-bg: rgba(0,0,0,0.1);
}

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Intro-Video */
#introVideo {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Double-Buffer Videos */
#mediaDisplay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg);
  overflow: hidden;
  z-index: 2;
}
.clip {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.clip.active {
  opacity: 1;
}

/* Overlay (Timer & Controls) */
#overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* Progress Circle */
#progressWrapper {
  position: relative;
  width: 250px; height: 250px;
  margin-top: 30px;
}
#progressCircle {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
#progressCircle circle {
  fill: none; stroke-width: 10;
}
#progressCircle .bg {
  stroke: var(--ring-bg);
}
#progressCircle .progress {
  stroke: var(--progress);
  stroke-dasharray: 628.32;
  stroke-dashoffset: 628.32;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}
#progressInner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
#timerDisplay {
  font-size: 40px;
  font-weight: bold;
  color: rgba(255,255,255,0.5);
  margin-bottom: 10px;
}

/* Start/Stop Button */
#startStopBtn {
  padding: 12px 24px;
  font-size: 18px;
  border: none; border-radius: 30px;
  background: var(--primary); color: var(--white);
  cursor: pointer; font-weight: 600;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: background 0.3s ease;
}
#startStopBtn:hover {
  background: #407f83;
}

/* Duration Selector */
#durationSelector {
  margin-top: 30px;
  text-align: center;
}
#durationSelector p {
  font-size: 16px;
  margin-bottom: 12px;
}
.durationButtons {
  display: flex; gap: 12px;
  justify-content: center; flex-wrap: wrap;
}
.durationButtons button {
  background: var(--accent);
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.2s;
}
.durationButtons button:hover {
  background: #d4a69c;
}

/* Bottom Controls (Music & Voice) */
#bottomControls {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
#trackInfo { font-size: 14px; }
#volumeControls { display: flex; gap: 20px; }
.volumeGroup label { font-size: 13px; margin-bottom: 4px; }
.volumeGroup input[type=range] { width: 150px; }
#duckingNotice { font-size: 12px; opacity: 0.7; }

/* Keto-Speisen-Vorschlag (Top) */
.foodSuggestion {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}
.foodButtons {
  display: flex; gap: 12px;
  justify-content: center; flex-wrap: wrap;
}
.foodButtons button {
  background: var(--accent);
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.2s;
}
.foodButtons button:hover {
  background: #d4a69c;
}

/* Popup für Bild, Titel & Rezept */
#foodDisplay {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw; max-width: 400px;
  max-height: 90vh;
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 12px;
  z-index: 1000;
  display: flex; flex-direction: column;
  align-items: center;
  overflow: visible;
}

/* Titel über dem Bild */
#foodDisplay > p {
  margin: 0 0 8px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 16px;
  border-radius: 6px;
  text-align: center;
  width: calc(100% - 24px);
}

/* Bild in der Mitte */
#foodDisplay > img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin-bottom: 0;
}

/* Rezept-Overlay über dem Foto */
#recipeDisplay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  z-index: 1002;
}
#recipeDisplay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
#recipeDisplay h3 {
  margin-top: 0; font-size: 18px;
}
#recipeDisplay h4 {
  margin: 12px 0 6px; font-size: 16px;
}
#recipeDisplay ul {
  margin: 0 0 12px 20px;
}
#recipeDisplay li {
  margin-bottom: 6px;
}
#recipeDisplay::-webkit-scrollbar {
  width: 6px;
}
#recipeDisplay::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 480px) {
  #progressWrapper { width: 180px; height: 180px; }
  #timerDisplay { font-size: 28px; }
  #startStopBtn { font-size: 16px; padding: 8px 16px; }
  .volumeGroup input[type=range] { width: 120px; }
  #bottomControls, .foodSuggestion { width: calc(100% - 40px); }
  #recipeDisplay { font-size: 12px; max-height: 80vh; }
  #recipeDisplay h3 { font-size: 14px; }
  #recipeDisplay h4 { font-size: 12px; }
}

#foodDisplay,
#foodDisplayOverlay {
  touch-action: auto;
}
/* Context-Menu / Long-Press deaktivieren */
body {
  -webkit-touch-callout: none; /* iOS Safari: kein Long-Press Callout */
  -webkit-user-select: none;   /* iOS Safari: kein Text-Select */
  user-select: none;           /* Desktop: kein Text-Select */
}

/* Versteckt den Player nur, wenn wir .hidden darauf setzen */
#bottomControls.hidden {
  display: none;
}
/* ganz unten in style.css einfügen */
@media (max-width: 360px) {
  /* Obere Rezept-Suggestion */
  .foodSuggestion {
    padding: 8px;
  }
  #foodQuestion {
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.2;
  }
  .foodButtons {
    gap: 6px;
  }
  .foodButtons button {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* Untere Steuerleiste (Musik & Stimme) */
  #bottomControls {
    padding: 8px;
    gap: 6px;
    bottom: 6px;
  }
  #bottomControls .volumeGroup label {
    font-size: 11px;
    margin-bottom: 2px;
  }
  #duckingNotice {
    font-size: 10px;
  }
}
#demoOverlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,128,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#demoOverlay.hidden { display: none; }
.demoMessage {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}
#demoOverlay input {
  padding: 8px;
  margin-top: 10px;
  width: 80%;
}
#demoOverlay button {
  margin-top: 10px;
  padding: 8px 16px;
}
#demoOverlay a {
  font-size: 0.9em;
  color: #0066cc;
  text-decoration: none;
  margin: 0 5px;
}

/* Trainer-Buttons */
.trainerBtn {
  position: absolute;
  top: 10px;
  width: 50px;
  height: 50px;
  background-size: cover;
  background-position: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
}
#trainerEva  { left: 10px;  }
#trainerCarl { right: 10px; }

/* ausgewählt = farbige Umrandung */
.trainerBtn.selected {
  box-sizing: border-box;
  border: 3px solid var(--primary);
}
