/* AUSWAHL-SEITE */
#auswahl {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    gap: 30px;
}

#auswahl h1 {
    font-size: 2.5rem;
    color: #7ecfff;
}

#auswahl p {
    color: #aad4f5;
    font-size: 1.1rem;
}

.schwierigkeit-auswahl {
    display: flex;
    gap: 25px;
    margin-top: 10px;
}

.schwierigkeit-btn {
    padding: 20px 45px;
    border: 2px solid #7ecfff;
    background: transparent;
    color: #7ecfff;
    font-size: 18px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
}

.schwierigkeit-btn:hover {
    background: #7ecfff;
    color: #001f3f;
    transform: scale(1.05);
}

/* SPIEL-SEITE */
#spiel {
    display: none;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 60px);
    padding: 30px 20px;
}

/* ZURÜCK PFEIL */
#zurueck-pfeil {
    position: fixed;
    top: 80px;
    left: 25px;
    background: #003399;
    border: 2px solid #7ecfff;
    color: #7ecfff;
    font-size: 22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 500;
}

#zurueck-pfeil:hover {
    background: #7ecfff;
    color: #001f3f;
}

/* SPIELFELD */
#spielfeld {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

#spielfeld.einfach {
    max-width: 900px;
    justify-content: center;
}

#spielfeld.mittel {
    max-width: 700px;
}

#spielfeld.schwer {
    max-width: 840px;
}

/* KARTEN */
.memory-card {
    background: #003399;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: transparent;
    border: 2px solid #4da6ff;
    transition: transform 0.3s, background 0.3s;
    user-select: none;
    font-size: 0px;
}

#spielfeld.einfach .memory-card { width: 160px; height: 160px; }
#spielfeld.mittel .memory-card  { width: 110px; height: 110px; }
#spielfeld.schwer .memory-card  { width: 110px; height: 110px; }

.memory-card:hover {
    transform: scale(1.05);
    border-color: #7ecfff;
}

.memory-card.flipped {
    background: #1a5fa8;
    color: white;
}

#spielfeld.einfach .memory-card.flipped { font-size: 80px; }
#spielfeld.mittel .memory-card.flipped  { font-size: 55px; }
#spielfeld.schwer .memory-card.flipped  { font-size: 50px; }

.memory-card.matched {
    background: #1a7a3a;
    border-color: #28a745;
    color: white;
    cursor: default;
}

#spielfeld.einfach .memory-card.matched { font-size: 80px; }
#spielfeld.mittel .memory-card.matched  { font-size: 55px; }
#spielfeld.schwer .memory-card.matched  { font-size: 50px; }

/* NACH SPIEL */
#nach-spiel-auswahl {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

#nach-spiel-auswahl p {
    color: #aad4f5;
    font-size: 1rem;
}

.nach-spiel-buttons {
    display: flex;
    gap: 15px;
}

.nach-spiel-btn {
    padding: 10px 25px;
    border: 2px solid #7ecfff;
    background: transparent;
    color: #7ecfff;
    font-size: 15px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.nach-spiel-btn:hover {
    background: #7ecfff;
    color: #001f3f;
}

/* GEWONNEN */
#gewonnen {
    display: none;
    margin-top: 30px;
    font-size: 2rem;
    color: #7ecfff;
    text-align: center;
}

#neu-starten {
    display: none;
    margin-top: 15px;
    padding: 12px 30px;
    background: #7ecfff;
    color: #001f3f;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}

#neu-starten:hover { transform: scale(1.05); }

/* KARTEN RÜCKSEITEN - NUR SOLANGE NICHT AUFGEDECKT */

#spielfeld.einfach .memory-card {
    background-color: #004da6;
    background-image: url('welle.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 150%;
}

#spielfeld.mittel .memory-card {
    background-color: #002b55;
    background-image: url('fische.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 150%;
}

#spielfeld.schwer .memory-card {
    background-color: #000814;
    background-image: url('hai.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 150%;
}

/* AUFGEDECKT - Kein Muster mehr, nur Farbe + Emoji sichtbar */
#spielfeld.einfach .memory-card.flipped,
#spielfeld.einfach .memory-card.matched {
    background-image: none;
    background-color: #7ecfff;
}

#spielfeld.mittel .memory-card.flipped,
#spielfeld.mittel .memory-card.matched {
    background-image: none;
    background-color: #1a5fa8;
}

#spielfeld.schwer .memory-card.flipped,
#spielfeld.schwer .memory-card.matched {
    background-image: none;
    background-color: #0a1628;
}

/* ===== KARTEN-BILDER ===== */
.karten-bild {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: none;          /* unaufgedeckt: Bild versteckt */
    pointer-events: none;
}

/* Bild nur sichtbar, wenn aufgedeckt oder gefunden */
.memory-card.flipped .karten-bild,
.memory-card.matched .karten-bild {
    display: block;
}

/* Aufgedeckte/gefundene Karte: Bild zeigen, Hintergrundmuster weg */
.memory-card.flipped,
.memory-card.matched {
    background-image: none !important;
}

/* Gefundenes Paar: grüner Rahmen, Karte bleibt an ihrem Platz */
.memory-card.matched {
    background: #1a7a3a;
    border: 3px solid #28a745;
    box-shadow: 0 0 12px rgba(40,167,69,0.6);
    visibility: visible;     /* falls altes CSS es versteckt hatte */
    cursor: default;
}

/* ===== PAAR-GEFUNDEN OVERLAY ===== */
#paar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 10, 30, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

#paar-overlay.sichtbar {
    opacity: 1;
    visibility: visible;
}

.paar-overlay-inhalt {
    background: #002b55;
    border: 4px solid #28a745;
    border-radius: 20px;
    padding: 25px 35px;
    text-align: center;
    box-shadow: 0 0 40px rgba(40,167,69,0.6);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

#paar-overlay.sichtbar .paar-overlay-inhalt {
    transform: scale(1);
}

#paar-overlay-bild {
    width: 320px;
    height: 240px;
    object-fit: cover;
    border-radius: 14px;
    border: 3px solid #7ecfff;
}

#paar-overlay-name {
    margin-top: 18px;
    font-size: 2rem;
    font-weight: bold;
    color: #7ecfff;
}