:root {
    --primary-color: #82c91e;
    --primary-dark: #6eb015;
    --bg-color: #f4f6f8;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --error-color: #e74c3c;
    --success-color: #82c91e;
    --border-color: #e2e8f0;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER */
header {
    background-color: transparent;
    padding: 30px 20px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--primary-color);
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #bdc3c7;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-btn:hover {
    color: var(--primary-color);
}

.back-link {
    left: 20px;
}

.home-link {
    right: 20px;
    font-size: 1.5rem;
}

/* MAIN CONTENT */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* SCREENS */
.screen {
    display: none;
    width: 100%;
    animation: fadeIn 0.4s ease forwards;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CARDS */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 30px 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.intro-card {
    text-align: center;
}

.intro-card h2 {
    margin-bottom: 20px;
    color: var(--text-color);
}

.intro-description {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

.box-explanation {
    list-style: none;
    margin: 20px 0;
    text-align: left;
}

.box-explanation li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* BADGES */
.box-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.box-1 {
    background: #e74c3c;
}

/* Falsch / Neu */
.box-2 {
    background: #e67e22;
}

.box-3 {
    background: #f1c40f;
    color: #333;
}

.box-4 {
    background: #3498db;
}

.box-5 {
    background: #82c91e;
}

/* Gelernt */

/* STATS */
.stats-overview {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
}

.stat-number.highlight {
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* BUTTONS */
.btn {
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 20px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(130, 201, 30, 0.3);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: var(--text-color);
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

/* PROGRESS & HEADER IN QUIZ */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

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

.quiz-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* QUIZ CARD ELEMENTS */
.label-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.beispiel-text {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 25px;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    font-style: italic;
}

.hint-container {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hint-container.hidden {
    display: none;
}

.erklaerung-text {
    font-size: 1rem;
    line-height: 1.5;
}

.actions {
    margin-bottom: 30px;
}

/* INPUTS */
.input-section {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-or {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
}

select,
input[type="text"] {
    width: 100%;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: var(--text-color);
    transition: border-color 0.2s;
}

select:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(130, 201, 30, 0.1);
}

/* RESULT SCREEN */
.result-feedback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    color: white;
    text-align: center;
}

.result-feedback.success {
    background: var(--success-color);
}

.result-feedback.error {
    background: var(--error-color);
}

.feedback-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.res-terminus {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 20px;
    text-align: center;
}

.result-card.error .res-terminus {
    color: var(--error-color);
}

.res-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.res-section:last-of-type {
    border-bottom: none;
}

.res-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.res-section p {
    font-size: 1.05rem;
    line-height: 1.5;
}

/* BOX ANIMATION */
.box-animation-container {
    width: 100%;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px 10px;
    margin-top: 20px;
    margin-bottom: 30px;
    position: relative;
    border: 1px solid #e2e8f0;
}

.box-tray {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.box-slot {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #94a3b8;
    position: relative;
}

.box-slot::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 20px;
    height: 4px;
    border-radius: 2px;
}

.slot-1::after {
    background: #e74c3c;
}

.slot-2::after {
    background: #e67e22;
}

.slot-3::after {
    background: #f1c40f;
}

.slot-4::after {
    background: #3498db;
}

.slot-5::after {
    background: #82c91e;
}

.anim-card {
    position: absolute;
    top: 5px;
    /* Above the slots */
    left: 17px;
    /* Start at slot 1 center roughly */
    width: 26px;
    height: 32px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--primary-color);
    z-index: 2;
    transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.4s ease;
}

.anim-card.lifted {
    top: -20px;
    transform: scale(1.1);
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5rem;
    }

    .nav-btn span {
        display: none;
    }

    .btn-large {
        width: 100%;
    }

    .stats-overview {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
}