/* ============================================================
   MOBILE.CSS — SMARTPHONE FIXES (GEOPTIMALISEERD)
   ============================================================ */

@media (max-width: 768px) {

  /* Algemene tekst en body */
  body {
    padding: 10px;
    font-size: 16px;
  }

  h1 {
    font-size: 1.4em;
  }

  input, button, select {
    width: 100%;
    font-size: 1.1em;
  }

  /* Afbeeldingen — BELANGRIJK: stamvader-foto UITGESLOTEN */
  img:not(.stamvader-foto),
  #startPrent img {
    max-width: 100%;
    width: 100%;
    height: auto;
  }

  /* Introblok */
  .introblok {
    flex-direction: column;
    text-align: center;
    padding: 1em;
  }

  .introtekst {
    padding-right: 0;
    margin-bottom: 1em;
  }

  .introbeeld {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .introbeeld img {
    max-width: 20vw;
    max-height: 20vh;
    object-fit: contain;
  }

  /* Actiepanelen */
  .actiepanelen {
    flex-direction: column;
    gap: 1rem;
  }

  .visualisatie-paneel,
  .verjaardagen-paneel {
    width: 100%;
    min-width: unset;
  }

  /* Stamvaderkaart — GEEN overschrijving van desktop layout */
  .stamvader-kaart {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px;
  }

  .stamvader-foto {
    max-width: 80vw;
    height: auto;
  }

  .stamvader-info-blok {
    width: 100%;
    margin-top: 12px;
  }

  /* Personenlijst */
  #collageInterface {
    flex-direction: column;
    gap: 0.5em;
  }

  .thumbnail {
    width: 100px;
    height: 100px;
  }

  /* Foto-grid */
  .foto-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  /* Gezinstructuur */
  .generatie-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .gezin-blok {
    width: 100%;
    min-width: unset;
  }

  /* Mededeling */
  .mededeling {
    width: 95%;
    font-size: 1em;
    transform: none;
  }

  /* QR-overlay */
  .qr-overlay-content {
    width: 95%;
    padding: 1.2em;
  }

  .qr-overlay-close {
    font-size: 1.6em;
  }

  #qrOverlayText {
    font-size: 0.9rem;
  }

  /* Video thumbnails */
  .thumbnail-video {
    width: 120px;
    height: 68px;
  }

  .thumbnail-img {
    width: 90px;
    height: 50px;
  }

  /* Video lightbox */
  #lightboxVideoOnly .lightbox-content {
    max-width: 95vw;
    max-height: 85vh;
    padding: 10px;
  }

  #lightbox-video-only {
    max-height: 60vh;
  }

  /* PDF viewer */
  #pdfViewerBox {
    width: 95vw;
    height: 90vh;
  }

  #pdfCloseBtn {
    font-size: 16px;
    padding: 6px 10px;
  }

  /* Info-frame */
  .info-frame {
    width: 90%;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px;
  }

  /* Personenlijst gesorteerd */
  #personenLijst {
    flex-direction: column;
    gap: 10px;
  }

  .lijst-item {
    width: 100%;
    padding: 10px;
  }

  .personen-tabel {
    font-size: 1em;
  }

  /* Debug overlay verbergen */
  .debug-overlay {
    visibility: hidden;
  }

  /* Confetti */
  .confetti-piece {
    width: 6px;
    height: 10px;
  }

  /* Lightbox algemeen */
  .lightbox-content {
    max-width: 95%;
  }

  #lightbox-img {
    max-width: 100%;
  }

  /* Zweef-help knop */
  .zweef-help {
    bottom: 12px;
    left: 12px;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 40px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
  }
}

/* Buiten media-query — veilig */
.logout-warning {
  bottom: 10px;
  right: 10px;
  font-size: 14px;
  padding: 10px 14px;
}

.praat-interface { padding: 1em; }
.praat-titel { font-size: 1.4em; }
.praat-intro { font-size: 1em; padding: 0 1em; }
.praat-upload { margin-top: 1em; }
.praat-input { font-size: 1em; }
.praat-berichten { padding: 0.8em; }

.video-lightbox .lightbox-content {
  max-width: 95vw;
  max-height: 85vh;
  padding: 10px;
}

#lightbox-video-only { max-height: 60vh; }

.collage-controls {
  flex-direction: column;
  gap: 0.8em;
}

.foto-lightbox .lightbox-content {
  max-width: 95vw;
  max-height: 85vh;
  padding: 10px;
}

#lightbox-img {
  max-width: 100%;
  height: auto;
}

.praat-foto { max-width: 120px; }
.praat-bericht { font-size: 0.95em; }

.startprent img {
  max-width: 95%;
  max-height: 80%;
}

.zweef-reset {
  bottom: 12px;
  right: 12px;
  padding: 10px 14px;
  font-size: 16px;
}

#familiewapen {
  width: auto;
  height: auto;
  max-width: 20vw;
  max-height: 20vh;
  object-fit: contain;
}
@media (max-width: 768px) {
  .collage-header {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .collage-terugblok {
    flex: 0 0 auto;
  }

  .collage-terug {
    font-size: 1.2rem;
    padding: 4px 8px;
  }
}

  .collage-interface {
    padding: 0.5rem;
  }


  .collage-header {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.6rem;
    padding-top: 2.5rem; /* ruimte voor terugknop */
  }

  .collage-reeksblok,
  .collage-modusblok,
  .collage-pauzeblok {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .collage-reeksblok select,
  .collage-modusblok select,
  .collage-pauzeblok button {
    width: 100%;
  }

  .collage-foto-container {
    margin-top: 0.8rem;
  }

  .collage-sliders {
    margin-top: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .collage-slider {
    flex-direction: column;
    align-items: flex-start;
  }

  .collage-slider input[type="range"] {
    width: 100%;
  }
}

html, body {
  margin: 0;
  padding: 0;
  height: auto;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  position: static;
}

body {
  display: block;
  flex: none;
}
