/* responsive.css
   Enthält alle Media Queries, die die Desktop-Stile in layout.css überschreiben,
   um eine optimale Darstellung auf Tablets und Smartphones zu gewährleisten.
*/

/* ==========================================================
   1) Tablet (bis 768px) – Porträtansicht
   Optimiert das Layout für Tablets und kleinere Bildschirme im Hochformat.
   ==========================================================
*/
@media (max-width: 768px) and (orientation: portrait) {
  /* Container-Anpassungen: Vertikale Anordnung statt horizontal */
  .container {
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: none;
    margin: 10px auto;
    padding: 10px;
  }

  .left,
  .right {
    width: 100%;
    max-width: 100%;
  }

  .left .image {
    /* Bildanpassungen für Tablets */
    width: 90%;
    max-width: 400px;
    height: auto;
  }

  .right-top {
    position: relative;
    z-index: 20;
  }

  /* Anpassungen für die Button-Gruppe */
  .buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 20;
  }

  #button-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  #button-container button {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 40px;
    margin: 0;
    padding: 6px 8px;
    font-size: 15px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 21;
  }

  /* Fix für Jubiläum-Button nach Reset */
  #button-container button.reset-state {
    animation: none !important;
    background-color: #007BFF !important; /* Standardfarbe */
    color: white !important;
    border: none !important;
  }

  /* Experience-Container: Angepasste Schriftgröße und Ausrichtung */
  .experience-container {
    text-align: center;
    width: 90%;
    height: auto;
    margin-top: 10px;
    font-size: 20px;
  }

  /* Overlay-Text: Leicht verkleinerte Schrift und Positionsanpassung */
  #overlay-text {
    font-size: 20px;
    bottom: 3%;
  }

  /* Jubiläum-Bilder: Angepasste maximale Größe */
  .jubilaeum-container img {
    max-width: 80%;
    max-height: 40vh;
  }
}


/* ==========================================================
   2) Smartphone (bis 480px)
   Optimiert das Layout für sehr kleine Bildschirme.
   ==========================================================
*/
@media (max-width: 480px) {
  .right-top {
    position: relative;
    z-index: 20;
  }

  /* Buttons liegen in #button-container – Grid muss dort gesetzt werden */
  .buttons {
    width: 100%;
    max-width: 420px;
    margin: 6px auto 0;
    padding: 0 12px;
    box-sizing: border-box;
    position: relative;
    z-index: 20;
  }

  #button-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    width: 100%;
  }

  #button-container button {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 40px;
    min-height: unset;
    padding: 6px 8px;
    font-size: 15px;
    line-height: 1.1;
    box-sizing: border-box;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 6px;
    margin: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  #button-container button:disabled {
    background-color: #ddd;
    color: #888;
    cursor: not-allowed;
  }

  #button-container button.party-mode {
    animation: partyText 1s infinite alternate ease-in-out !important;
  }

  #button-container button.reset-state {
    animation: none !important;
    background-color: #007BFF !important;
    color: white !important;
    border: none !important;
  }
  
  /* Bildanpassungen: Zentrierung und maximale Höhe */
  .left .image {
    display: block;
    margin: 0 auto;
    max-width: 90%;
    height: auto;
    max-height: 80vh;
  }
  
  /* Overlay-Text: Kleinere Schriftgröße */
  #overlay-text {
    font-size: 16px;
    bottom: 3%;
  }
  
  /* Jubiläum-Bilder: Angepasste maximale Dimensionen */
  .jubilaeum-container img {
    max-width: 90%;
    max-height: 35vh;
  }
  
  /* Experience-Container: Zentrierte Ausrichtung mit zusätzlichem Padding */
  .experience-container {
    text-align: center;
    justify-content: flex-start;
    padding: 10px;
  }
}
