@import url('darkmode.css');

/* Minimalistisches Design */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f9f9f9;
    color: #2b2b2b;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
}

header {
    width: 75%;
    background: linear-gradient(135deg, #d9e7dd, #ebe4ed);
    color: #4b4e6d;
    padding: 9px;
    text-align: center;
    font-size: 1em;
    border-radius: 5px;
    box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.05);
    margin-top: 10px;
    max-width: 600px;
}

#timerContainer {
    font-size: 1.5em;
    color: #413a3a;
    margin-top: 20px;
}

#gameContainer {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Feste 3 Spalten */
    grid-template-rows: repeat(3, 1fr); /* 3 Zeilen */
    gap: 1%; /* Abstand zwischen den Karten */
    width: 90vw; /* 90% der Breite des Bildschirms */
    height: 60vh; /* 60% der Bildschirmhöhe */
    margin: 0 auto;
    padding: 3px;
    box-sizing: border-box;
}

.word-card {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    aspect-ratio: 1 !important; /* Quadratische Karten */
    font-size: calc(1.3vw + 1.3vh); /* Dynamische Schriftgröße passend zum Bildschirm */
    border-radius: 5px;
    border: 1px solid #da3e3e;
    background-color: #fffeef;
    color: #413a3a;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    width: 90% !important; /* Maximale Breite der Karte */
    height: 90% !important; /* Maximale Höhe der Karte */
    max-width: 200px !important; /* Maximalbreite für größere Displays */
    max-height: 200px !important; /* Maximale Höhe */
}

.word-card:hover {
    background-color: #ffd8d8;
    transform: scale(1.02); /* Leichte Vergrößerung bei Hover */
}

.word-card.selected {
    background-color: #59be7f;
    transform: scale(1.05);
}

.word-card.matched {
    background-color: #59be7f;
    color: #59be7f;
    cursor: default;
    visibility: hidden;
}

.word-card.error {
    background-color: #e18a96;
    color: #721c24;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    z-index: 1000;
}

.popup-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.popup h2 {
    margin-top: 0;
    color: #4b4e6d;
}

.button {
    padding: 10px 20px;
    font-size: clamp(16px, 2.5vw, 20px);
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid #da3e3e;
    background-color: #fffeef;
    color: #413a3a;
    transition: background-color 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.button:hover {
    background-color: #ffd8d8;
    transform: translateY(-3px);
}

.hidden {
    display: none;
}

/* Zurück-Pfeil */
#back-arrow {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: clamp(40px, 5vw, 40px);
    color: #da3e3e;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
}

#back-arrow:hover {
    color: #e18a96;
    transform: translateX(-5px);
}


#cookie-banner {
    position: fixed;
    top: 50%; /* Zentriert vertikal */
    left: 50%; /* Zentriert horizontal */
    transform: translate(-50%, -50%);
    width: 75%;
    max-width: 500px;
    min-width: 250px;
    background-color: #f1f1f1; /* Dezente graue Hintergrundfarbe */
    color: #333333; /* Dunkelgraue Textfarbe */
    border: 1px solid #dcdcdc; /* Heller Grauton für den Rand */
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    font-size: 1em;
    font-weight: normal; /* Weniger auffälliger Text */
    z-index: 1001;
    display: none; /* Banner wird erst durch JavaScript eingeblendet */
  }
  
  #cookie-banner p {
    margin: 0;
    padding-bottom: 10px;
  }
  
  #cookie-banner a {
    color: #cecece;
    text-decoration: underline;
  }
  
  .cookie-buttons {
    display: inline-flex;
    justify-content: center;
    gap: 10px;
  }
  #cookie-banner button {
    background-color: #cecece; /* Dezentes Grau für Standard-Buttons */
    color: #ffffff; /* Weißer Text */
    border: none;
    padding: 8px 16px;
    margin: 5px;
    cursor: pointer;
    border-radius: 5px; /* Korrektur: Hinzufügen des 'border' Präfix */
    font-size: 0.9em;
  }
  
  #cookie-banner button:hover {
    background-color: #bdbdbd; /* Etwas dunkleres Grau bei Hover */
  }
  
  #cookie-banner button#accept-cookies {
    background-color: #4caf50; /* Grüne Farbe für den Akzeptieren-Button */
  }
  
  #cookie-banner button#accept-cookies:hover {
    background-color: #45a049; /* Dunkleres Grün bei Hover */
  }
  
  #cookie-banner button#decline-cookies {
    background-color: #cecece; /* Dezentes Grau für den Ablehnen-Button */
  }
  
  #cookie-banner button#decline-cookies:hover {
    background-color: #bdbdbd; /* Etwas dunkleres Grau bei Hover */
  }
  

/* Dynamische Anordnung bei größeren Displays */
@media (min-width: 768px) {
    #gameContainer {
        grid-template-columns: repeat(4, 1fr); /* Wechsel zu 4 Spalten */
        grid-template-rows: repeat(3, 1fr); /* Wechsel zu 3 Zeilen */
    }

    .word-card {
        font-size: calc(1.2vw + 1vh); /* Schriftgröße leicht anpassen */
    }
}

/* Für kleinere Bildschirme */
@media (max-width: 600px) {
    #gameContainer {
        grid-template-columns: repeat(3, 1fr); /* 2 Spalten */
        grid-template-rows: repeat(4, 1fr); /* 6 Zeilen */
    }

    .word-card {
        font-size: calc(2vw + 1vh); /* Größere Schriftgröße für kleinere Bildschirme */
    }
}
