@font-face {
  font-family: "InterV";
  src: url("Inter-V.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* ---------------- Hintergrund ---------------- */
html {
  min-height: 100%;
  background: linear-gradient(to bottom, #ffffff, #d9d9d9);
}

body {
  font-family: "InterV", sans-serif;
  min-height: 100dvh;
  margin: 0;
  background: transparent;
  overflow-x: hidden;
}

/* Verlauf fix nur auf Desktop */
@media (min-width: 1025px) {
  html { background-attachment: fixed; }
}
@media (max-width: 1024px) {
  html { background-attachment: scroll; }
}

/* ---------------- Buttons / Header ---------------- */
.button-container { 
  margin: 30px; 
  display: flex; 
  flex-wrap: wrap;
  justify-content: flex-start;   /* wieder linksbündig */
  gap: 13px;
}

.btn { 
  display: inline-block;
  border: none;
  border-radius: 20px;
  background: white;
  color: #555; 
  box-shadow: 0 0 10px rgba(0,0,0,.3); 
  cursor: pointer; 
  transition: transform .2s ease;
  font-size: 13px;
  text-align: center;
  padding: 8px 18px;
  min-width: 140px;              /* feste Breite */
  flex: 0 0 auto;                /* verhindert Dehnung */
}
.btn:hover { transform: scale(1.05); } 
.btn.active { background: #00FFFB; color: #555; }

/* ABOUT Button angleichen */
.btn[data-tab="tab7"] {
  min-width: 140px;
}

/* ---------------- Layout ---------------- */
.tab-container { 
  margin-left: 30px; 
  display: grid; 
  grid-template-columns: 1fr 350px;
  gap: 40px; 
  width: calc(100% - 60px); 
  height: calc(100vh - 120px); 
  overflow: visible; 
}

.tab-stack { 
  position: relative; 
  width: 100%; 
  height: 100%; 
  display: flex;
  justify-content: flex-end; 
  align-items: flex-start; 
  overflow: visible; 
}

/* ------------ Tab-Karten ------------ */
.tab-square {
  --tx: 0px;
  --ty: 0px;
  transform: translate(var(--tx), var(--ty)) scale(1);
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(0,0,0,.3);
  padding: 20px;
  box-sizing: border-box;
  max-width: 100%;
  max-height: 100%;
  justify-content: center;
  align-items: center;
  z-index: 1;
  --scale: 0.95;
  opacity: 0;
  transform: translate3d(var(--tx), var(--ty), 0) scale(var(--scale));
  transition: opacity 0.35s ease, transform 0.35s ease;
  will-change: transform;
  touch-action: none;
}

.tab-square.show {
  display: flex;
  opacity: 1;
  --scale: 1;
}

.tab-square.hide {
  opacity: 0;
  --scale: 0.9;
  pointer-events: none;
}

.tab-square img { 
  display: block; 
  border-radius: 5px;
  max-width: 100%; 
  max-height: 80vh; 
  object-fit: contain; 
}

/* ---------------- rechte Spalte ---------------- */
.tab-texts { 
  width: 320px;
  margin-left: auto; 
  margin-right: 30px; 
  display: flex; 
  flex-direction: column; 
  justify-content: flex-end; 
}

.tab-messages#messages { 
  position: relative; 
  display: flex; 
  flex-direction: column; 
  gap: 4px;
  max-height: calc(100vh - 120px); 
  padding: 0 20px 0px 20px; 
  overflow-y: scroll; 
  overflow-x: scroll; 
}

/* ---------------- Bubbles ---------------- */
.tab-description {
  --bubble: white;     
  font-size: 12px;  
  color: #555;
  background: var(--bubble);
  padding: 10px 18px;   
  line-height: 1.4;
  border-radius: 28px; 
  max-width: 100%;
  margin: 6px 0 3px; 
  position: relative; 
  align-self: flex-start;
  box-shadow: 0 2px 12px rgba(0,0,0,.2); 
  word-wrap: break-word;
  opacity: 0; 
  transform: translateY(12px) scale(0.97); 
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.tab-description.active { 
  opacity: 1; 
  transform: translateY(0) scale(1);
}
.tab-description::after {
  content: ""; 
  position: absolute; 
  left: -18px; 
  bottom: 15px; 
  width: 25px; 
  height: 20px;
  background: var(--bubble);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
.tab-description.latest {
  --bubble: #00FFFB;  
  color: #555;
}

/* Delivered smoother */
.tab-delivered {
  font-size: 11px; 
  text-align: end;
  color: #555; 
  margin: 3px 0px 6px 0px; 
  opacity: 0; 
  transform: translateY(8px); 
  transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}
.tab-delivered.show { 
  opacity: 1; 
  transform: translateY(0);
}

/* Close Button */
.close-btn { 
  position: absolute; 
  top: 10px; 
  left: 10px; 
  width: 13px; 
  height: 13px; 
  border: 0.5px solid #d9d9d9; 
  border-radius: 50%;
  background: #00FFFB; 
  cursor: pointer; 
  z-index: 200; 
  transition: transform .2s ease; 
}
.close-btn:hover { transform: scale(1.05); }

/* ---------------- Slideshow ---------------- */
.slideshow { 
  position: relative; 
  width: 100%; 
  height: 100%; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  cursor: pointer;
}
.slideshow img { 
  display: none; 
  max-width: 100%; 
  max-height: 80vh; 
  object-fit: contain; 
  pointer-events: none;
}
.slideshow img.active { 
  display: block; 
  animation: fade 1s ease; 
}
.slideshow .counter {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #555;
  color: #fff;
  opacity: 60%;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 13px;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- Tablet ---------------- */
@media (max-width: 1024px) {
  .tab-container {
    grid-template-columns: 1fr;
    gap: 20px;
    height: auto;
    margin-left: 0;
    margin-top: 30px;
    width: 100%;
  }
  .tab-stack {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: auto;
  }
  .tab-square {
    position: relative;
    width: min(90%, 560px);
    max-height: none;
  }
  .tab-texts {
    width: min(90%, 560px);
    margin: 0 auto 40px;
    padding: 0;
  }
  .tab-messages#messages {
    max-height: none;
    overflow: visible;
    padding: 0 0 12px 0;
  }
  .slideshow .counter { bottom: -6px; }
}

/* ---------------- Mobile ---------------- */
@media (max-width: 767px) {
  .button-container {
    margin: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;  /* auch auf Mobile links */
    gap: 10px;
    width: auto;
  }
  .btn {
    flex: 0 0 auto;
    min-width: 120px;
    text-align: center;
    font-size: 12px;
    padding: 8px 14px;
  }

  .tab-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 25px auto 0;
    width: 100%;
    height: auto;
    gap: 20px;
  }
  .tab-square {
    position: relative;
    display: none;
    width: 90%;
    max-width: 500px;
    padding: 15px;
    border-radius: 20px;
    box-sizing: border-box;
  }
  .tab-square[style*="display: flex"] {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .tab-square img {
    max-width: 100%;
    max-height: 50vh;
    object-fit: cover;
    border-radius: 12px;
  }

  .tab-texts {
    width: 90%;
    margin: 0 auto;
    padding: 0;
  }

  .tab-description {
    max-width: 90%;
    margin: 8px auto;
    text-align: center;
  }
  .tab-delivered {
    text-align: center;
    margin: 4px auto 10px;
    width: 90%;
  }
  .tab-description::after { display: none; }

  .close-btn {
    display: block;
    position: absolute;
    top: 10px;
    left: 10px;
    width: 16px;
    height: 16px;
    background: #00FFFB;
    border-radius: 50%;
    border: 0.5px solid #555; 
    cursor: pointer;
    z-index: 9999; 
  }

  .slideshow .counter {
    bottom: -4px;
    font-size: 11px;
    padding: 5px 12px;
  }
}