/* Importiere moderne Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

/* Schlichtere Variablen für minimalistisches Design */
:root {
    --primary-color: #4a5fc1;
    --primary-dark: #3a4ba1;
    --secondary-color: #6b7fd1;
    --accent-color: #5eb3f6;
    --success-color: #4caf50;
    --error-color: #ef5350;
    --warning-color: #ff9800;
    --text-light: #ffffff;
    --text-dark: #2c3e50;
    --text-gray: #607d8b;
    --bg-light: rgba(255, 255, 255, 0.92);
    --bg-hover: rgba(255, 255, 255, 0.98);
    --border-color: rgba(74, 95, 193, 0.2);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-image: url('hintergrund2.jpg');
    background-size: cover;
    background-repeat: repeat-y;
    background-position: center;
    /* Hintergrund soll mitscrollen: attachment fixed entfernt */
    background-attachment: scroll;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden; /* Verhindert horizontales Scrollen durch Transform */
}

html, body {
    /* Smooth Scroll für sanfteres Navigieren */
    scroll-behavior: smooth;
    /* Verhindert weißes Overscroll/Glühen an Ober- und Unterkante, wo unterstützt */
    overscroll-behavior: none;
    /* Fallback-Hintergrundfarbe für Rubber-Band-Bereiche */
    background-color: #0f1a2a;
}

/* Einfaches Overlay */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 3, 69, 0.326);
    pointer-events: none;
    z-index: 0;
}

/* Zweite Hintergrundhälfte: dasselbe Bild gespiegelt, fügt sich unten nahtlos an */
body::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100vh; /* Startet direkt nach der ersten Bildhöhe (Viewport-Höhe) */
    height: 100vh; /* Gleiche Höhe wie erste Hälfte */
    background-image: url('hintergrund2.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scaleY(-1); /* Spiegelt das Bild vertikal */
    transform-origin: top; /* Spiegelung ab oberer Kante */
    z-index: -1; /* Hinter Overlay und Inhalt */
    pointer-events: none;
}

.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

.text-box {
    background: var(--bg-light);
    backdrop-filter: blur(10px);
    padding: 30px;
    margin-bottom: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.text-box:hover {
    box-shadow: var(--shadow-hover);
}

/* Header-Box mit Logo */
.header-box {
    text-align: center;
    padding: 25px 30px;
}

.lang-switch {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.lang-switch select {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.lang-switch select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 95, 193, 0.12);
}

.logo {
    max-width: 180px;
    height: auto;
    margin: 0 auto 15px;
    display: block;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.text-box h1 {
    margin: 10px 0 0 0;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    letter-spacing: -0.5px;
}

.question h2 {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.6;
}

.option {
    margin: 12px 0;
    padding: 14px 18px;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
    background: rgba(74, 95, 193, 0.08);
    border: 2px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    user-select: none;
}

.option:hover {
    background: rgba(74, 95, 193, 0.15);
    border-color: var(--primary-color);
}

.option input[type="radio"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    vertical-align: middle;
}

.option:has(input[type="radio"]:checked) {
    background: rgba(74, 95, 193, 0.2);
    border-color: var(--primary-color);
    font-weight: 600;
}

/* Input Felder */
input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 95, 193, 0.1);
}

/* Drag & Drop Planeten-Sortierung */
.instruction {
    font-size: 1rem;
    color: var(--text-gray);
    margin: 12px 0 20px;
    text-align: center;
    font-weight: 500;
}

.planet-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 20px;
    background: rgba(74, 95, 193, 0.06);
    border-radius: 10px;
    margin-bottom: 25px;
    min-height: 100px;
    border: 1px dashed var(--border-color);
}

.planet-button {
    background: var(--primary-color);
    border: none;
    color: var(--text-light);
    /* Einheitliche Größe für alle Drag-Elemente */
    width: 130px;
    height: 48px;
    padding: 0 10px; /* Innenabstand horizontal, vertikal über height geregelt */
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    cursor: grab;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
    white-space: nowrap;
}

.planet-button:hover {
    background: var(--primary-dark);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.planet-button:active {
    cursor: grabbing;
}

.planet-button.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.drop-zones-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drop-zone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px;
    background: rgba(74, 95, 193, 0.04);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
    /* Einheitliche Höhe passend zu Buttons */
    height: 55px;
}

.drop-zone.drag-over {
    background: rgba(74, 95, 193, 0.12);
    border-color: var(--primary-color);
    border-style: solid;
}

.position-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 25px;
    font-family: 'Space Grotesk', sans-serif;
}

.drop-zone input[type="text"] {
    margin: 0;
    flex: 1;
    background: rgba(255, 255, 255, 0.8);
    cursor: default;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Buttons */
.text-box button[type="button"]:not(.joker-button):not(.planet-button) {
    background: var(--primary-color);
    border: none;
    color: var(--text-light);
    padding: 10px 20px;
    margin: 6px 4px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-box button[type="button"]:not(.joker-button):not(.planet-button):hover {
    background: var(--primary-dark);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Auswerte-Button innerhalb von .text-box */
.text-box input[type="button"] {
    background: var(--primary-color);
    border: none;
    color: var(--text-light);
    padding: 14px 35px;
    text-align: center;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    margin: 15px auto;
    transition: var(--transition);
    cursor: pointer;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.text-box input[type="button"]:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

/* Globaler Auswerte-Button (außerhalb von .text-box) */
.action-button {
    background: var(--primary-color);
    border: none;
    color: var(--text-light);
    padding: 14px 35px;
    text-align: center;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    margin: 15px auto;
    transition: var(--transition);
    cursor: pointer;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.action-button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-hover);
}

/* Joker Button */
.joker-button {
    background: var(--warning-color);
    border: none;
    color: var(--text-light);
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 12px 0 8px 0;
    display: inline-block;
}

.joker-button:hover {
    background: #f57c00;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

button:disabled,
.joker-button:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

/* Antwort-Feedback */
.correct-answer {
    background: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: white !important;
    font-weight: 600;
}

.incorrect-answer {
    background: var(--error-color) !important;
    border-color: var(--error-color) !important;
    color: white !important;
    font-weight: 600;
}

/* Ergebnis-Anzeige */
#result,
#antwort {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    border-radius: var(--border-radius);
    background: var(--primary-color);
    color: var(--text-light);
    box-shadow: var(--shadow);
}

#result a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-color);
    transition: var(--transition);
    font-weight: 600;
}

#result a:hover {
    color: var(--text-light);
    border-bottom-color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    .text-box {
        padding: 20px;
        margin-bottom: 20px;
    }

    .logo {
        max-width: 140px;
    }

    .text-box h1 {
        font-size: 2rem;
    }

    .question h2 {
        font-size: 1.1rem;
    }

    .text-box input[type="button"],
    .action-button {
        padding: 12px 28px;
        font-size: 1rem;
    }

    .planet-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 110px;
        margin-bottom: 12px;
    }

    .text-box h1 {
        font-size: 1.8rem;
    }

    .option {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .planet-button {
        padding: 8px 14px;
        font-size: 0.85rem;
        margin: 4px;
    }

    .drop-zone {
        gap: 8px;
        padding: 8px;
    }

    .position-number {
        font-size: 1rem;
        min-width: 20px;
    }
}
