/* ========================================================
   FIX: Ältischte-Seite nach oben zwingen
   ======================================================== */
.eldest-container {
    height: auto !important;         /* Verhindert das Aufspannen auf 100% Höhe */
    min-height: auto !important;     /* Verhindert erzwungene Streckung */
    display: block !important;       /* Ändert Flex zu Block, damit es nicht mehr nach unten drückt */
}

.eldest-grid {
    display: grid !important;
    align-content: start !important; /* Sorgt dafür, dass Karten oben im Grid kleben */
    margin-top: 0 !important;
    padding-top: 5px !important;
    gap: 5px !important;
}

/* Falls der Container in einem 'content' div steckt, das global gestreckt wird */
.eldest-container .content {
    flex: none !important;
    justify-content: flex-start !important;
}

.eldest-spacer-right {
    height: 52px; /* Perfekter Höhenausgleich zur linken Überschrift */
}

/* ========================================================
   STECKBRIEF KACHELN
   ======================================================== */
.eldest-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.25);
    border: 1px dashed rgba(90, 61, 27, 0.25);
    border-radius: 12px;
    padding: 12px 8px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, background 0.2s;
}

.eldest-card:hover {
    transform: scale(1.03);
    background: rgba(255, 255, 255, 0.45);
}

.eldest-avatar-frame {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid #5a3d1b;
    padding: 2px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 6px;
}

.eldest-avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.eldest-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.eldest-name {
    font-size: 13.5px;
    font-weight: bold;
    color: #521010;
    line-height: 1.2;
}

.eldest-role {
    font-size: 11px;
    font-style: italic;
    color: #6e4a24;
}

/* ========================================================
   EIGENES, HELLES STECKBRIEF POPUP (MODAL)
   ======================================================== */
.eldest-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(40, 25, 10, 0.5); /* Angenehmes Warm-Braun statt Schwarz */
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.eldest-popup.hidden {
    display: none !important;
}

.eldest-popup-content {
    background: #fcf5e5; /* Helles, warmes Buchseiten-Pergament */
    border: 3px double #5a3d1b;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    padding: 30px 20px 20px 20px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: eldestPopupShow 0.25s ease-out;
}

@keyframes eldestPopupShow {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.eldest-popup-close {
    position: absolute;
    top: 6px;
    right: 14px;
    background: none;
    border: none;
    font-size: 32px;
    color: #5a3d1b;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s;
    line-height: 1;
}

.eldest-popup-close:hover {
    color: #521010;
}

.eldest-popup-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.eldest-popup-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #5a3d1b;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    background: #fff;
}

.eldest-popup-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eldest-popup-body h2 {
    margin: 0;
    color: #521010;
    font-size: 24px;
    border: none;
}

.eldest-popup-age {
    font-style: italic;
    color: #6e4a24;
    font-size: 14px;
    margin-top: -6px;
}

.eldest-popup-desc {
    text-align: justify;
    line-height: 1.5;
    font-size: 14.5px;
    max-width: 95%;
    margin: 8px 0 0 0;
    background: rgba(255, 255, 255, 0.5);
    padding: 12px;
    border-radius: 8px;
    border: 1px dashed rgba(90, 61, 27, 0.2);
    color: #2b1a08;
}

/* ========================================================
   RESPONSIVE DESIGN (TABLETS / PHONES)
   ======================================================== */
@media (max-width: 900px) {
    .eldest-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .eldest-spacer-right {
        display: none;
    }
}