/* Trend-Kartenspiel – Board & Card Styles
   Uses ÖFIT "Zusammengesetzt" palette + custom accents
   ------------------------------------------------------------------------
   NOTE: Load zusammengesetzt-palette.css first so the palette variables exist.
*/

/* -------Board container--------- */
.board-frame {
  margin: 20px 0;
  overflow: hidden;  
  padding: 30px;
  width: 100%;
  border: 4px solid var(--color-frame-accent);
  border-radius: 0;
  background-color: #ffffff; 
  min-height: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.6);
  color: var(--color-anchor);
  transform: perspective(900px);
}

.board-config {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.board-config {
  position: relative;
  z-index: 10;
}
.board-config .form-control {
  width: 80px;
}

#game-board {
    position: relative;
    align-items: stretch;
    width: 100%;
}

/* ------Card grid--------} */
.board {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}


/* -----------Individual card----------------- */
#game-board .card,
.game-card {
    width: 90%;
    max-width: calc(70vw / var(--board-cols))  !important ;
    aspect-ratio: 1;
    position: relative;   
    aspect-ratio: 1;
    margin: 0 auto;  
}

#game-board .card img,
.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  position: absolute;
  inset: 0;
}

 .card.matched,
 .game-card.matched {
  visibility: hidden;
  pointer-events: none;
}
 .card-text,
 .popup-text {
  text-align: left;
  word-wrap: break-word;
  hyphens: auto;
}

/* ---Stapel---- */
#stapel .stacked-photos{
  position: relative !important;     
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 95%;
  aspect-ratio: 1 / 1;               
  height: auto;
  margin: 4px auto -8px; 
  pointer-events: none;
  overflow: hidden;
  display: block;
}

#stapel .stacked-photos .stack-img{
  --stack-gap: 9px;
  --stack-tilt: 1deg;
  position: absolute;
  inset: 0;
  width: 80%;
  height: auto;
  margin: 0 auto;
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  display: block;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

#stapel .stacked-photos .back{
  transform: translate(8px,8px), calc(var(--stack-gap)*1.2)
             rotate(calc(var(--stack-tilt)));
  z-index: 0;
}

#stapel .stacked-photos .front{
  transform: translate(calc(var(--stack-gap) * -1), 10%)
             rotate(var(--stack-tilt));
  z-index: 1;
}

#stapel .stapel-card h3,
#stapel .stapel-card .card-title{
    margin: -4px auto 4px;
    font-weight: 700;
    text-align: center;
}

#stapel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
  }
  
#stapel .stapel-card {
    background: white;
    border-radius: 14px;
    overflow: hidden; 
    padding: 10px;
    width: 220px; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-align: center;
    font-family: 'Segoe UI', sans-serif;
  }

  
#stapel .stapel-card h3 {
    font-size: 0.9rem;
    font-weight: bold;
    margin:  0.2rem 0 0.2rem;
    color: var(--color-text-light);
  }
  
#stapel .stapel-card p {
    margin: 0;
    text-align: left;
    color: var(--color-text-light);
  }


  

  @media (min-width: 992px) {
    #stapel .stapel-card .card-img-top {
      height: clamp(80px, 9vw, 120px);
    }
  }
  

/* Modal overlay */
.modal {
    display: none; 
    position: fixed;
    z-index: 1065;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(252, 252, 252, 0.4); 
  }

  
  .modal-dialog {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
  }
  
  .modal-content {
    background: #ffffff;
    width: 400px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease-in-out;
  }
  
  .modal-header, .modal-footer {
    padding: 10px 16px;
    color: var(--color-frame-accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
  }
  
  .modal-close {
    font-size: 1.4rem;
    cursor: pointer;
  }
  
  .modal-body {
    padding: 20px;
    text-align: center;
  }
  
  .modal-body img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
  }
  
  .modal-body p {
    font-size: 0.9rem;
    text-align: left;
  }
  
  .modal-footer button {
    padding: 6px 14px;
    border: none;
    color: var(--color-frame-accent);
    color: white;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .modal-footer button:hover {
    color: var(--color-frame-accent);
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
  } 
/* --------------------------------------------------
   Match info popup (visual feedback for match)
-------------------------------------------------- */
.matched-info {
  display: flex;
  flex-direction: row;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  border: 2px dashed #ced3f6;
  border-radius: 16px;
  padding: 20px;
  z-index: 999;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.matched-info .popup-card {
  display: flex;
  flex-direction: column;
  align-items: left;
  max-width: 100px;
  margin: 0 10px;
}

.matched-info .popup-card img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
}

.matched-info .popup-card p {
  font-size: 0.85rem;
  text-align: left;
  margin-top: 8px;
}

/* --------------------------------------------------
   Win message
-------------------------------------------------- */
  
  #win-ok {
    padding: 8px 16px;
    color: var(--color-frame-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-width: 100px;     
    text-align: center;
  }
  
  #win-ok:hover {
    color: var(--color-frame-accent);
  }

  .win-modal-content {
    border-radius: 20px;
    border: none;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  }
  
  .win-emoji {
    font-size: 4rem;
    animation: bounce 0.6s infinite alternate;
  }
  
  .win-title {
    font-weight: 800;
    color: var(--color-frame-accent);
    margin-top: 1rem;
  }
  
  .win-subtitle {
    color: var(--color-frame-accent);
    font-size: 1.1rem;
  }
  
  @keyframes bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-12px); }
  }




