/* Cards grid: 3 per row on phone, 4 on tablet, 5 on desktop/laptop */
.cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    column-gap: 50px;
    row-gap: 30px;
    padding: 5px 0;
    padding-bottom: 10%;
}

/* The old markup has stray <hr>/<br> tags between cards, left over from
   when cards were a single vertical column. In a grid they'd each become
   their own (mostly empty) cell and break the column alignment, so they're
   hidden — the grid's own "gap" now provides the spacing between cards. */
.cards > hr,
.cards > br {
    display: none;
}

/* Card base */
.card {
    background: linear-gradient(135deg, #ffffff, #ffffff);
    border-radius: 18px;
    padding: 1px 1px;
    width: 100%;
    height: auto;
    min-height: 200px;
    color: rgb(0, 0, 0);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Layout: image over text, centered — this fits a narrow grid cell far
   better than the old side-by-side layout, which only worked when a card
   spanned the full row width. */
.card-content {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 15px;
    text-align: center;
}

/* Text */
.text {
    text-align: center;
}

.text strong {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
}

.text p {
    margin: 2px 0;
    font-size: 14px;
}

/* Keep (ឈ្មោល) and (ញី) inline */
.text .gender span {
    margin-right: 6px;
}

/* Image */
.image img {
    width: 80px;
    height: 80px;
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Tablet Layout */
@media (max-width: 900px) {
    .cards {
        grid-template-columns: repeat(4, 1fr);
        column-gap: 35px;
        row-gap: 22px;
    }
}

/* Mobile Layout */
@media (max-width: 600px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 35px;
        row-gap: 15px;
    }

    .card {
        padding: 1px;
        padding-top: 10%;
        min-height: 150px;
    }

    .text strong {
        font-size: 13px;
    }

    .text p {
        font-size: 11px;
    }

    .image img {
        width: 50px;
        height: 50px;
    }
}

@media (min-width: 768px) {
    body {
      cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%2393c5fd' stroke='%233b82f6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M5.5 3.21V20.8l4.57-4.57 3.55 7.77 2.87-1.32-3.55-7.77 6.13-.15Z'/%3E%3C/svg%3E"), auto;
    }
    
    #constellation-canvas {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 9997;
    }
  
    .custom-cursor {
      display: none;
    }
  }