:root {
    --bg-light: #d0ddea;
    --card-bg: rgba(255, 255, 255, 0.8);
    --accent-blue: #2b6c9e;
    --accent-purple: #6b4f8c;
    --text-dark: #1e2a3a;
    --text-soft: #2c3e50;
    --border-light: rgba(0, 0, 0, 0.05);
    --shadow: 0 10px 30px rgba(0, 20, 40, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-light);
    color: var(--text-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 18px;
    min-height: 100vh;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.5s ease;
    background-image: 
        linear-gradient(rgba(43,108,158,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(43,108,158,0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

body.fade-in {
    opacity: 1;
}


.page-title {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-dark);
}

.page-title span {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 1.5rem;                     
    max-width: 1200px;                 
    margin: 3rem auto 0;             
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 2rem;
    padding: 1rem 1.5rem;             
    text-align: center;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1.2rem;                
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    animation: slideIn 0.5s ease forwards;
}

.card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--accent-purple);
    box-shadow: 0 20px 30px rgba(107, 79, 140, 0.15);
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.15s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.25s; }
.card:nth-child(5) { animation-delay: 0.3s; }
.card:nth-child(6) { animation-delay: 0.35s; }
.card:nth-child(7) { animation-delay: 0.4s; }
.card:nth-child(8) { animation-delay: 0.45s; }
.card:nth-child(9) { animation-delay: 0.5s; }
.card:nth-child(10) { animation-delay: 0.55s; }
.card:nth-child(11) { animation-delay: 0.6s; }
.card:nth-child(12) { animation-delay: 0.65s; }
.card:nth-child(13) { animation-delay: 0.7s; }
.card:nth-child(14) { animation-delay: 0.75s; }
.card:nth-child(15) { animation-delay: 0.8s; }
.card:nth-child(16) { animation-delay: 0.85s; }
.card:nth-child(17) { animation-delay: 0.9s; }
.card:nth-child(18) { animation-delay: 0.95s; }
.card:nth-child(19) { animation-delay: 1.0s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#global-author {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 1.5rem;          
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.45);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

#global-author:hover {
    color: var(--accent-blue);
}

.list-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.list-item {
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-light);
    border-radius: 3rem;
    padding: 1rem 2rem;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.list-item:hover {
    border-color: var(--accent-purple);
    transform: translateX(8px);
    box-shadow: 0 10px 20px rgba(107, 79, 140, 0.1);
}

.quiz-container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.nav-panel {
    flex: 0 0 340px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 1rem;
}

.nav-group {
    margin-bottom: 1.8rem;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.group-header h3 {
    font-size: 1.2rem;
    color: var(--accent-purple);
    margin: 0;
}

.reset-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: var(--accent-purple);
}

.ball-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem;
}

.ball {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    background: rgba(255,255,255,0.5);
    border: 1.5px solid var(--border-light);
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.ball:hover {
    transform: scale(1.05);
    border-color: var(--accent-purple);
}

.ball.answered-correct {
    background: #2ecc71;
    color: white;
    border-color: #27ae60;
}

.ball.answered-wrong {
    background: #e74c3c;
    color: white;
    border-color: #c0392b;
}

.question-panel {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.question-title {
    font-size: 1.4rem;
    color: var(--accent-purple);
    margin: 0;
}

.next-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.5rem 2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.next-btn:hover {
    background: var(--accent-purple);
}

.question-text {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.options {
    margin-bottom: 2rem;
}

.option-item {
    margin-bottom: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(255,255,255,0.3);
    border-radius: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border: 2px solid transparent;
}

.option-item:hover {
    background: rgba(255,255,255,0.6);
}

.option-item.correct-answer {
    background: #d5f5e3;
    border-color: #2ecc71;
}

.option-item.selected-wrong {
    background: #fadbd8;
    border-color: #e74c3c;
}

.explanation {
    padding: 1.5rem;
    background: rgba(255,255,255,0.5);
    border-radius: 1rem;
    border-left: 5px solid var(--accent-purple);
    margin-top: 1.5rem;
}

.explanation h4 {
    margin-top: 0;
    color: var(--accent-purple);
}

.back-home {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.95rem;
}

.back-home:hover {
    color: var(--accent-blue);
}

@media (max-width: 768px) {
    .quiz-container {
        flex-direction: column;
    }
    .nav-panel {
        position: static;
        width: 100%;
    }
}