@media (max-width: 1024px) {

  .image-item  { max-width: 350px; }
  .image-frame { height: 220px; }

  .cardPic {
    height: 220px;
    border-radius: 12px;
    aspect-ratio: auto;
    width: 100% !important;
    max-width: 100% !important;
    background-position: center center !important;   }

  .link-bubble,
  .link-bubble2 {
    max-width: 400px;
    height: 180px;
  }

  .bubble-title,
  .bubble-title2 { font-size: 1.1em; }
}


@media (max-width: 768px) {

  .collcard-content p {
    text-align: left !important;
}

  p[style*="text-align: justify"] { text-align: left !important; }

  h1 { font-size: 1.0rem; letter-spacing: 2px; }
  h2 {
    font-size: 1.05rem;
    letter-spacing: 2.5px;
    gap: 12px;
    margin: 28px 0;
  }

  #meoo { padding: 0 10px; }

  .maincontainer,
  .video-display-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
  }

  .texcontainer,
  .container,
  .video-display,
  .video-chat,
  .collcard,
  .link-bubble,
  .link-bubble2,
  #ship-info,
  .ship-select,
  #uploadedImages,
  .cardText,
  .transpcardText {
    width: 95% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    margin: 10px auto;
    padding: 12px;
  }


  .cardPic {
    width: 100% !important;
    max-width: 100% !important;
    min-width: unset !important;
    height: 240px !important;
    border-radius: 10px;
    background-position: center center !important;
    background-size: cover !important;
    margin: 15px auto !important;
  }

  .responsive-stack {
    flex-direction: column !important;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
    box-sizing: border-box;
  }

  .responsive-stack .cardPic,
  .responsive-stack .transpcardText {
    width: 100% !important;
    margin: 8px auto !important;
  }

  .transpcardText {
    height: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .texcontainer { overflow-wrap: break-word; }

  mjx-container {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .link-bubble,
  .link-bubble2 {
    height: 160px !important;
    position: relative !important;       overflow: hidden;
  }

  .bubble-title,
  .bubble-title2 {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    font-size: 1em;
    padding: 10px 12px;
    box-sizing: border-box;
    /* Szöveg ne törjön ki */
    white-space: normal;
    word-break: break-word;
  }



  .image-item {
    max-width: 100%;
    padding: 15px;
  }

  .image-frame  { height: 200px; }

    h3 {
        font-size:      0.82rem;
        letter-spacing: 2px;
    }


  .comments-list {
    max-height: 120px;
    font-size: 13px;
    width: 100%;
    padding-right: 0;
  }

  .comments-list p {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
  }

  .comment-form,
  .chat-input { flex-direction: column; width: 100%; }

  .comment-form input,
  .comment-form button,
  .chat-input input,
  .chat-input button { width: 100%; }

  .comment-form input[type="text"],
  .comment-form textarea {
    font-size: 13px;
    padding: 7px 10px;
  }

  .admin-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .admin-controls button {
    width: auto;
    margin: 5px;
    white-space: nowrap;
  }





  .filter-btn {
    width: 80%;
    max-width: 250px;
    font-size: 14px;
    padding: 10px;
  }


  /* collcard header: szöveg ne lógjon ki */
  .collcard-header {
    gap: 12px;
    padding: 14px;
  }

  .collcard-img {
    flex-shrink: 0;
    margin-right: 0;
  }

  .collcard-title {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
    font-size: 18px;
  }

}


@media (max-width: 480px) {

  h1 { font-size: 0.9rem; letter-spacing: 1.5px; }

  h2 {
    font-size: 0.92rem;
    letter-spacing: 1.5px;
    gap: 8px;
    margin: 20px 0;
  }

    h3 {
        font-size:      0.78rem;
        letter-spacing: 1.5px;
    }

  .cardPic {
    height: 160px !important;
    border-radius: 8px;
    margin-top: 5px !important;
  }

  .link-bubble,
  .link-bubble2 { height: 140px !important; }

  .bubble-title,
  .bubble-title2 {
    font-size: 0.9em;
    padding: 8px 10px;
  }

  .cardText,
  .transpcardText {
    font-size: 15px;
    padding: 10px;
    margin-top: 15px !important;
  }

  .collcard-header {
    gap: 12px;
    padding: 14px;
    align-items: center;
  }

  .collcard-img {
    width: 60px;
    height: 60px;
    flex-shrink: 0;       /* ikon soha ne zsugorodjon */
    margin-right: 0;        }

  .collcard-title {
    font-size: 15px;
    flex: 1;
    min-width: 0;             overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
  }

  .comment-form input[type="text"],
  .chat-input input {
    font-size: 13px;
    padding: 6px 8px;
  }

  .comment-form button,
  .chat-input button {
    font-size: 13px;
    padding: 6px 10px;
  }

  .playlist-selector select,
  .ship-select select {
    font-size: 14px;
    padding: 8px 10px;
    width: 160px;
  }

  .image-item  { padding: 12px; }
  .image-frame { height: 200px; }

  #welcomeCard {
    min-height: 350px;
    height: auto;
    padding: 15px;
  }
}


/* Csak a minimum magasságot biztosítjuk, hogy ne legyen láthatatlan. */
#banner {
    min-height: 80px;
}

@media (max-width: 1024px) {
    .cardPic[style*="LFRes.webp"],
    .cardPic[style*="lf.webp"] {
        height: auto !important;
        aspect-ratio: 4 / 3;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Banner táblázat-képek: aspect-ratio megtartása, de ne legyen túl kicsi */
    #banner {
        min-height: 120px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* Portré cardPic-ek (faj képek, 170x500 inline) — oszlop módban teljes szélesség, de ne legyen 500px magas, inkább négyzet-szerű arány */
    .responsive-stack .cardPic {
        width: 100% !important;
        height: 220px !important;
        max-width: 100% !important;
        background-size: contain !important;
        background-position: center top !important;
        margin: 10px auto !important;
    }

    .cardPic[style*="olf.webp"] {
        width: 100% !important;
        max-width: 100% !important;
        height: 80px !important;
        background-size: contain !important;
    }

    #banner {
        min-height: 100px !important;
    }

    .cardPic[style*="LFRes.webp"],
    .cardPic[style*="lf.webp"] {
        height: auto !important;
        aspect-ratio: 4 / 3;
        width: 100% !important;
        max-width: 100% !important;
        background-size: contain !important;
    }
}

@media (max-width: 480px) {
    .responsive-stack .cardPic {
        height: 180px !important;
    }

    #banner {
        min-height: 70px !important;
    }

    .cardPic[style*="olf.webp"] {
        height: 60px !important;
    }
}