/* datei: style.css */

/* ---------------------------------- */
/* 1. VARIABLEN & GRUNDEINSTELLUNGEN */
/* ---------------------------------- */
:root {
    /* Farben (Neon-Palette) */
    --farbe-hintergrund: #0a0014;
    --farbe-schrift-hell: #f0f0f0;
    --farbe-akzent-cyan: #00ffff;
    --farbe-akzent-magenta: #ff00ff;
    --farbe-akzent-orange: #ffaa00;
    
    /* Schriftarten */
    --schrift-familie: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --schrift-retro: 'Monospace', monospace; /* Fallback */
}

body {
    background-color: var(--farbe-hintergrund);
    color: var(--farbe-schrift-hell);
    font-family: var(--schrift-familie);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    color: var(--farbe-akzent-cyan);
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.retro-font {
    font-family: var(--schrift-retro);
    letter-spacing: 2px;
}

main {
    padding: 20px;
    flex-grow: 1;
    max-width: 1200px;
    width: 95%;
    margin: 0 auto;
}

/* ---------------------------------- */
/* 2. HEADER & NAVIGATION */
/* ---------------------------------- */

header {
    background-color: rgba(20, 0, 40, 0.8);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--farbe-akzent-magenta);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--farbe-schrift-hell);
}

.nav-buttons a {
    color: var(--farbe-schrift-hell);
    text-decoration: none;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.nav-buttons a:hover {
    background-color: rgba(0, 255, 255, 0.1);
    color: var(--farbe-akzent-cyan);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.nav-buttons a.active {
    background-color: var(--farbe-akzent-magenta);
    color: var(--farbe-hintergrund);
    box-shadow: 0 0 15px var(--farbe-akzent-magenta);
    font-weight: bold;
}

/* ---------------------------------- */
/* 3. FOOTER */
/* ---------------------------------- */

footer {
    padding: 10px;
    text-align: center;
    font-size: 0.8em;
    color: #888;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

/* ---------------------------------- */
/* 4. SPIELE-SAMMLUNG GRID */
/* ---------------------------------- */

#spiel-karten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.spiel-karte {
    background-color: #1a0033;
    border: 1px solid rgba(255, 0, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.spiel-karte:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.4);
}

.spiel-karte.active-card {
    border-color: var(--farbe-akzent-orange);
    box-shadow: 0 0 20px var(--farbe-akzent-orange);
    background-color: #2a0050;
}

.karten-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 2px solid var(--farbe-akzent-magenta);
}

.karten-details {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.karten-titel {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 1.5em;
    color: var(--farbe-akzent-orange);
}

.karten-untertitel {
    font-size: 0.7em;
    color: var(--farbe-akzent-cyan);
    display: block;
    margin-top: 5px;
}

.karten-beschreibung {
    font-size: 0.9em;
    color: #ccc;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* ---------------------------------- */
/* 5. SPIEL BUTTONS STYLES (NEU & KORRIGIERT) */
/* ---------------------------------- */

/* Grundstil für alle interaktiven Buttons */
button, 
.karten-button,
.modus-button, 
.spiel-reset-button {
    font-family: var(--schrift-familie); 
    font-size: 1em;
    padding: 10px 20px;
    border: 2px solid var(--farbe-akzent-cyan);
    border-radius: 8px;
    background-color: transparent;
    color: var(--farbe-akzent-cyan);
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.2s ease-in-out;
    margin: 5px;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
    align-self: flex-start; /* Stellt sicher, dass Buttons linksbündig sind */
}

button:hover,
.karten-button:hover,
.modus-button:hover, 
.spiel-reset-button:hover {
    border-color: var(--farbe-akzent-orange);
    color: var(--farbe-akzent-orange);
    background-color: rgba(255, 170, 0, 0.1);
    box-shadow: 0 0 15px var(--farbe-akzent-orange);
    transform: translateY(-2px);
}

/* Karten-Button im Akzent-Stil (Primary) */
.karten-button {
    background: linear-gradient(135deg, var(--farbe-akzent-magenta), var(--farbe-akzent-cyan));
    color: var(--farbe-hintergrund); 
    border: none;
    box-shadow: 0 4px 15px rgba(255, 0, 255, 0.4);
    align-self: stretch; /* Füllt die Breite der Karte aus */
    font-size: 1.1em;
}

.karten-button:hover {
    box-shadow: 0 8px 25px rgba(255, 0, 255, 0.6);
    background: var(--farbe-akzent-orange);
    color: var(--farbe-hintergrund);
}


/* ---------------------------------- */
/* 6. MODUS-AUSWAHL STYLES */
/* ---------------------------------- */

.modus-auswahl-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px auto;
    flex-wrap: wrap; 
    max-width: 800px;
}

.modus-titel {
    text-align: center;
    color: var(--farbe-akzent-magenta);
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px var(--farbe-akzent-magenta);
}

.modus-button {
    font-size: 1.2em;
    padding: 15px 30px;
    flex-basis: 45%; 
    min-width: 300px;
    text-align: center;
}

/* ---------------------------------- */
/* 7. SPIEL-SPEZIFISCHE STYLES (Tic-Tac-Toe) */
/* ---------------------------------- */

#tictactoe-gitter {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 5px;
    margin: 20px auto;
    border: 3px solid var(--farbe-akzent-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    width: fit-content;
}

.zelle {
    background-color: #200040;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.zelle:hover {
    background-color: #300060;
}

.spieler-x {
    color: var(--farbe-akzent-pink); /* Magenta/Pink */
    text-shadow: 0 0 10px var(--farbe-akzent-magenta);
}

.spieler-o {
    color: var(--farbe-akzent-cyan);
    text-shadow: 0 0 10px var(--farbe-akzent-cyan);
}

#tictactoe-info {
    text-align: center;
    margin-bottom: 20px;
}

/* ---------------------------------- */
/* 8. SPIEL-SPEZIFISCHE STYLES (Tetris) */
/* ---------------------------------- */
#kristall-canvas {
    display: block;
    margin: 20px auto;
    border: 5px solid var(--farbe-akzent-orange);
    box-shadow: 0 0 25px rgba(255, 170, 0, 0.6);
}

#kristall-info {
    text-align: center;
    margin-bottom: 10px;
    color: var(--farbe-akzent-orange);
}

/* ---------------------------------- */
/* 9. MEDIA QUERIES */
/* ---------------------------------- */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    .nav-buttons {
        margin-top: 10px;
    }
    .modus-button {
        flex-basis: 100%;
    }
    #tictactoe-gitter {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
    }
    .zelle {
        font-size: 2.5em;
    }
}