/* --- style.css --- */

:root {
    --bg-color: #f4f7f6;
    --text-color: #333;
    --primary: #e74c3c;
    --secondary: #2c3e50;
    --card-bg: #ffffff;
    
    /* Farbpalette für Kategorien & Modi */
    --color-blue: #2980b9;
    --color-green: #27ae60;
    --color-purple: #8e44ad;
    --color-yellow: #d4ac0d;
    --color-red: #c0392b;
    --color-orange: #f39c12;
}

/* Textauswahl (Highlighting) auf Weiß umstellen */
::selection {
  background-color: #2a5043;
  color: #ffffff;
}

/* 1. Das "Fenster" (html) wird starr gemacht, damit das Hintergrundbild nicht wackelt */
html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* Verhindert das Rausscrollen des gesamten Dokuments (Gummiband) */
}

/* 2. Der "Inhalt" (body) darf jetzt scrollen */
body {
    margin: 0;
    padding: 20px;
    height: 100%; /* Füllt das Fenster aus */
    overflow-y: auto; /* Macht den Body scrollbar */
    -webkit-overflow-scrolling: touch; /* Sorgt für flüssiges "Apple-Scrollen" */
    
    /* Layout-Einstellungen */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    color: #ecf0f1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 3. Der Hintergrund bleibt als starre Ebene dahinter */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #2c3e50;
    background-image: url('tafel.webp');
    background-size: cover;
    background-position: center;
}


h1 {
            /* Minimum auf dem Handy auf 2.5rem erhöht, damit es größer bleibt */
            font-size: clamp(1.2rem, 5vw, 3.5rem);
            
            text-align: center;
            margin-bottom: 20px;
            
            /* Erzwingt die weiße Farbe gegen alle anderen Regeln */
            color: #ffffff !important;
            
            /* Bringt den schönen, leichten Schatten zurück */
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        }


.subtitle {
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

.header-link {
    color: #ecf0f1; 
    text-decoration: none;
    margin-bottom: 30px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5); /* Leichter Schatten für die Tafel */
}

.header-link:hover {
    text-decoration: underline;
    color: #ffffff;
}

/* --- Menü Grid & Kategorie-Buttons --- */
#menu-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
}

.btn-mode {
    padding: 25px 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.btn-mode:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.mode-icon {
    font-size: 2rem;
}

/* --- Die 3D Flip-Karte --- */
#game-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    perspective: 1000px;
}

.flip-card {
    background-color: transparent;
    width: 100%;
    max-width: 600px;
    height: 600px;
    margin-bottom: 20px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
    border-radius: 20px;
}

.flip-card.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    padding: 30px;
    box-sizing: border-box;
}

/* Rückseite der Karte (Zuerst sichtbar) */
.flip-card-front {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    text-align: center;
}

.card-category-big {
    font-size: 2.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.2;
}

/* Vorderseite der Karte (Die Aufgabe/Frage) */
.flip-card-back {
    background-color: var(--card-bg);
    color: var(--text-color);
    transform: rotateY(180deg);
    border: 8px solid #ccc; /* Farbe wird in JS dynamisch überschrieben */
    align-items: center;
}

.card-category-small {
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-align: center;
}

/* --- Standard Inhalte auf Karten --- */
.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow-y: auto; /* Scrollen ermöglichen falls Text zu lang */
}

/* --- Buttons auf den Karten --- */
.btn-card {
    width: 100%;
    padding: 15px 0;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 15px;
    flex-shrink: 0;
}

.btn-flip {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid white;
}

.btn-flip:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #1a252f;
}

.footer-container {
    margin-top: auto; /* Schiebt den Footer ganz nach unten! */
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #bdc3c7;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 20px;
    padding-top:50px;
}

        .footer-links a {
            color: #bdc3c7;
            text-decoration: none;
            margin-right: 15px;
            transition: color 0.2s;
        }

        .footer-links a:hover {
            color: #7f8c8d;
        }

        @media (max-width: 600px) {
            h1 {
                font-size: 3rem;
            }

            .footer-container {
                flex-direction: column;
                gap: 15px;
            }
            .footer-links {
                margin-bottom: 10px;
            }

        }