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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #4CAF50;
    --error: #f44336;
    --warning: #ff9800;
    --light: #ffffff;
    --dark: #2c3e50;
    --card-bg: rgba(255, 255, 255, 0.1);
    --text-light: rgba(255, 255, 255, 0.9);
    --text-lighter: rgba(255, 255, 255, 0.7);
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
}

.quiz-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Стартовый экран */
.start-screen {
    text-align: center;
    max-width: 600px;
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.start-screen.active {
    opacity: 1;
    transform: translateY(0);
}

.quiz-icon {
    font-size: 5rem;
    color: var(--light);
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.start-screen h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    background: linear-gradient(45deg, var(--light), #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    color: var(--text-lighter);
    font-weight: 300;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 50px;
}

.feature {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 1.2rem;
    padding: 15px 30px;
    background: var(--card-bg);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateX(10px);
}

.feature i {
    color: var(--light);
    font-size: 1.5rem;
}

.start-btn {
    background: linear-gradient(45deg, var(--light), #f0f0f0);
    color: var(--primary);
    border: none;
    padding: 20px 50px;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.start-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.start-btn:active {
    transform: translateY(-2px);
}

/* Экран викторины */
.quiz-screen {
    display: none;
    max-width: 800px;
    width: 100%;
    background: var(--card-bg);
    border-radius: 30px;
    padding: 40px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
}

.quiz-screen.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.progress-container {
    flex: 1;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #8BC34A);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 10%;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-lighter);
    font-weight: 500;
}

.score-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--light);
}

.score-display i {
    color: gold;
}

.question-container {
    text-align: center;
}

.question-number {
    font-size: 1rem;
    color: var(--text-lighter);
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 2px;
}

.question-text {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 40px;
    line-height: 1.3;
    color: var(--light);
}

.options-container {
    display: grid;
    gap: 15px;
    margin-bottom: 40px;
}

.option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.option.correct {
    background: rgba(76, 175, 80, 0.3);
    border-color: var(--success);
    color: var(--light);
}

.option.incorrect {
    background: rgba(244, 67, 54, 0.3);
    border-color: var(--error);
    color: var(--light);
}

.option.disabled {
    pointer-events: none;
}

.option-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
}

.option.correct .option-icon {
    background: var(--success);
}

.option.incorrect .option-icon {
    background: var(--error);
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.control-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prev-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.next-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--light);
    border: 2px solid transparent;
}

.control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Экран результатов */
.results-screen {
    display: none;
    max-width: 600px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s ease;
}

.results-screen.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.results-content {
    background: var(--card-bg);
    border-radius: 30px;
    padding: 50px 40px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.result-icon {
    font-size: 4rem;
    color: gold;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.results-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    background: linear-gradient(45deg, var(--light), #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 40px;
}

.circle-background {
    width: 100%;
    height: 100%;
    border: 10px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    position: absolute;
}

.circle-progress {
    width: 100%;
    height: 100%;
    border: 10px solid;
    border-radius: 50%;
    position: absolute;
    border-image: linear-gradient(45deg, var(--success), #8BC34A) 1;
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    transition: all 1s ease;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-percent {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--light);
}

.score-label {
    font-size: 0.9rem;
    color: var(--text-lighter);
}

.score-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.detail-label {
    color: var(--text-lighter);
}

.detail-value {
    font-weight: 700;
    color: var(--light);
}

.result-message {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
}

.results-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.result-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.retry-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--light);
}

.review-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.result-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Обзор ответов */
.review-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.review-screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.review-header h2 {
    font-size: 2rem;
    color: var(--light);
}

.close-review {
    background: none;
    border: none;
    color: var(--light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-review:hover {
    background: rgba(255, 255, 255, 0.1);
}

.review-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.review-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid transparent;
}

.review-item.correct {
    border-left-color: var(--success);
}

.review-item.incorrect {
    border-left-color: var(--error);
}

.review-question {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--light);
}

.review-answer {
    color: var(--text-lighter);
    margin-bottom: 5px;
}

.review-correct {
    color: var(--success);
    font-weight: 600;
}

/* Плавающие элементы */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: floatAround 20s linear infinite;
}

.element-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.element-2 {
    top: 20%;
    right: 15%;
    animation-delay: -5s;
}

.element-3 {
    bottom: 30%;
    left: 20%;
    animation-delay: -10s;
}

.element-4 {
    bottom: 20%;
    right: 25%;
    animation-delay: -15s;
}

.element-5 {
    top: 50%;
    left: 50%;
    animation-delay: -7s;
}

@keyframes floatAround {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(100px, 50px) rotate(90deg);
    }
    50% {
        transform: translate(50px, 100px) rotate(180deg);
    }
    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .quiz-container {
        padding: 10px;
    }
    
    .start-screen h1 {
        font-size: 2.5rem;
    }
    
    .quiz-screen {
        padding: 20px;
    }
    
    .question-text {
        font-size: 1.8rem;
    }
    
    .options-container {
        grid-template-columns: 1fr;
    }
    
    .quiz-controls {
        flex-direction: column;
    }
    
    .results-buttons {
        flex-direction: column;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    .score-percent {
        font-size: 2rem;
    }
}

/* Анимации для ответов */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.option.selected {
    animation: pulse 0.3s ease;
}

/* Анимация появления */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.option {
    animation: slideIn 0.5s ease;
}

.option:nth-child(1) { animation-delay: 0.1s; }
.option:nth-child(2) { animation-delay: 0.2s; }
.option:nth-child(3) { animation-delay: 0.3s; }
.option:nth-child(4) { animation-delay: 0.4s; }