:root {
    --primary-color: #0052CC;
    --accent-color: #FF9500;
    --surface-color: #FBFBFD;
    --text-color: #1D1D1F;
    --border-color: #D2D2D7;
    --correct-color: #1B874B;
    --correct-gradient: linear-gradient(145deg, #28A745, #198038);
    --wrong-color: #CC1F1A;
    --wrong-gradient: linear-gradient(145deg, #E3342F, #CC1F1A);
    --neutral-color: #8E8E93;
    --neutral-gradient: linear-gradient(145deg, #78909C, #455A64);
    --primary-gradient: linear-gradient(145deg, #1E88E5, #1565C0);
}

[data-theme="dark"] {
    --surface-color: #1D1D1F;
    --text-color: #FBFBFD;
    --border-color: #424245;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--surface-color);
    color: var(--text-color);
    line-height: 1.5;
    transition: background-color 0.3s ease;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.clock-logo {
    margin-right: 0.5rem;
}

.blue { color: var(--primary-color); }
.orange { color: var(--accent-color); }

.score-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
}

.score-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
}

.score-label {
    font-size: 0.875rem;
    color: var(--neutral-color);
    display: block;
}

.score-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
}

.progress {
    width: 0;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

#quiz-container {
    background-color: var(--surface-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
}

#question-number {
    color: var(--primary-color);
    font-weight: 500;
}

.question-info {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.category {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background-color: var(--surface-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    height: 48px;
    display: flex;
    align-items: center;
}

.level {
    display: flex;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background-color: var(--surface-color);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    height: 48px;
    min-width: 100px;
    justify-content: center;
    align-items: center;
}

.difficulty-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: auto 0;
    border: 2px solid var(--border-color);
}

.difficulty-dot.active {
    border: none;
}

/* Schwierigkeitsgrade */
.level[data-difficulty="1"] .difficulty-dot.active {
    background-color: var(--correct-color);
}

.level[data-difficulty="2"] .difficulty-dot.active {
    background-color: #FFCC00;
}

.level[data-difficulty="3"] .difficulty-dot.active {
    background-color: var(--accent-color);
}

.level[data-difficulty="4"] .difficulty-dot.active {
    background-color: var(--wrong-color);
}

#timer {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: color 0.3s ease;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

#timer.warning {
    color: var(--wrong-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

#question-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--primary-color);
}

#answers-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.answer {
    padding: 1rem;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    min-height: 80px;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    transform-style: preserve-3d;
    transform: perspective(1000px) translateZ(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.answer:hover:not(:disabled):not(.selected):not(.correct):not(.wrong) {
    transform: perspective(1000px) translateZ(10px);
    border-color: var(--primary-color);
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.answer.selected {
    transform: perspective(1000px) translateZ(-5px);
    border-color: var(--primary-color);
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
                inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.answer:active:not(:disabled) {
    transform: perspective(1000px) translateZ(-5px);
    transition: all 0.1s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1),
                inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.answer:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.answer.correct {
    background: var(--correct-gradient);
    color: white;
    border-color: var(--correct-color);
    box-shadow: 0 4px 15px rgba(27, 135, 75, 0.4),
                inset 0 -2px 5px rgba(0, 0, 0, 0.2),
                inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.answer.wrong {
    background: var(--wrong-gradient);
    color: white;
    border-color: var(--wrong-color);
    box-shadow: 0 4px 15px rgba(204, 31, 26, 0.4),
                inset 0 -2px 5px rgba(0, 0, 0, 0.2),
                inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.button-container {
    display: block;
    gap: 1rem;
    margin-top: 1rem;
}

#hint-button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 82, 204, 0.3),
                inset 0 -2px 5px rgba(0, 0, 0, 0.1),
                inset 0 2px 5px rgba(255, 255, 255, 0.1);
}

#hint-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15),
                inset 0 -2px 5px rgba(0, 0, 0, 0.2),
                inset 0 2px 5px rgba(255, 255, 255, 0.2);
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 2rem;
    border-radius: 12px;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.popup.happy { background-color: var(--correct-color); }
.popup.sad { background-color: var(--wrong-color); }
.popup.neutral { background-color: var(--neutral-color); }

.score-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.reset-button {
    padding: 5px 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.reset-button:hover {
    background-color: #e0e0e0;
}

.points-popup {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    animation: slideIn 0.5s ease-out forwards;
    transform: translateY(-50%);
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translate(-20px, -50%);
    }
    100% {
        opacity: 1;
        transform: translate(0, -50%);
    }
}

.points-popup.positive {
    background-color: var(--correct-color);
    box-shadow: 0 4px 15px rgba(27, 135, 75, 0.3);
}

.points-popup.negative {
    background-color: var(--wrong-color);
    box-shadow: 0 4px 15px rgba(204, 31, 26, 0.3);
}

#result-container {
    text-align: center;
    padding: 2rem;
}

#restart-button {
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#restart-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 600px) {
    header {
        padding: 1rem;
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    #quiz-container {
        padding: 1rem;
    }

    .answer {
        padding: 0.8rem;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.modal {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 16px;
    max-width: 90%;
    width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.2s ease;
    cursor: default;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hint-text {
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--text-color);
    text-align: center;
}
