/* --- Grundlayout --- */
body {
    font-family: "Poppins", Arial, sans-serif;
    background: linear-gradient(135deg, #ffe8f0, #e3f2ff);
    margin: 0;
    padding: 0;
    text-align: center;
}

h1 {
    margin: 25px 0;
    font-size: 45px;
    color: #333;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 800;
    text-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* --- Grid für Pferdekarten --- */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 35px;
    padding: 30px;
}

/* --- Pferdekarten --- */
.card {
    width: 260px;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    border: 4px solid transparent;
    background-clip: padding-box;
    position: relative;
}

/* Bunter Glow-Rand */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 25px;
    padding: 4px;
    background: linear-gradient(135deg, #ff7eb3, #65d6ff);
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
}

.card:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: 0 12px 35px rgba(0,0,0,0.3);
}

.card img {
    width: 100%;
    height: 230px;
    object-fit: contain;
    background: #f0f0f0;
    padding: 10px;
}

.card-content {
    padding: 15px;
    font-size: 22px;
    font-weight: bold;
    color: #444;
}

/* --- Popup Overlay --- */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* --- Popup Fenster --- */
.popup-content {
    background: white;
    padding: 25px;
    border-radius: 20px;
    width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease-out;
    border: 5px solid #ff7eb3;
}

.popup img {
    width: 100%;
    height: auto;
    border-radius: 15px;
}

/* --- Schließen X --- */
.close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: #444;
    transition: 0.2s;
}

.close:hover {
    color: #ff0066;
}

/* --- Animation --- */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.hidden {
    display: none;
}
