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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Animated Chemistry Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
    background-image: 
        /* Молекулы ДНК */
        url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 Q40 15 30 25 Q20 15 30 5 M30 25 Q40 35 30 45 Q20 35 30 25 M25 10 L35 10 M25 20 L35 20 M25 30 L35 30 M25 40 L35 40' stroke='white' fill='none' stroke-width='2'/%3E%3C/svg%3E"),
        /* Атомы */
        url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='5' fill='white'/%3E%3Cellipse cx='20' cy='20' rx='15' ry='8' fill='none' stroke='white' stroke-width='1.5'/%3E%3Cellipse cx='20' cy='20' rx='8' ry='15' fill='none' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E"),
        /* Формулы */
        url("data:image/svg+xml,%3Csvg width='80' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='5' y='25' font-family='Arial' font-size='18' fill='white' font-weight='bold'%3EH₂O%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='80' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='5' y='25' font-family='Arial' font-size='18' fill='white' font-weight='bold'%3ECO₂%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg width='80' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='5' y='25' font-family='Arial' font-size='18' fill='white' font-weight='bold'%3ENaCl%3C/text%3E%3C/svg%3E"),
        /* Колбы */
        url("data:image/svg+xml,%3Csvg width='50' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 10 L15 25 L10 40 Q10 50 25 50 Q40 50 40 40 L35 25 L35 10 Z M15 10 L35 10' fill='none' stroke='white' stroke-width='2'/%3E%3Cpath d='M12 35 Q25 37 38 35' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"),
        /* Микроскоп */
        url("data:image/svg+xml,%3Csvg width='50' height='70' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M25 10 L25 30 M20 30 L30 30 M15 35 Q25 40 35 35 M10 60 L40 60 M25 35 L25 55' stroke='white' stroke-width='2' fill='none'/%3E%3Ccircle cx='25' cy='10' r='5' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E"),
        /* Клетки */
        url("data:image/svg+xml,%3Csvg width='50' height='50' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='white' stroke-width='2'/%3E%3Ccircle cx='25' cy='25' r='8' fill='white' opacity='0.5'/%3E%3Cellipse cx='25' cy='25' rx='12' ry='18' fill='none' stroke='white' stroke-width='1'/%3E%3C/svg%3E");
    background-position: 
        0 0,
        120px 80px,
        250px 30px,
        400px 120px,
        550px 200px,
        700px 50px,
        100px 250px,
        450px 280px;
    background-size: 
        60px 60px,
        40px 40px,
        80px 40px,
        80px 40px,
        80px 40px,
        50px 60px,
        50px 70px,
        50px 50px;
    background-repeat: repeat;
    animation: floatElements 60s linear infinite;
}

@keyframes floatElements {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100px);
    }
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header */
.game-header {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.game-header h1 {
    color: #667eea;
    font-size: 2.5em;
    font-weight: 800;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.2em;
    font-weight: 600;
}

/* Score Panel */
.game-info {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.score-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1em;
}

.score-item .label {
    color: #666;
    font-weight: 600;
}

.score-item .value {
    font-weight: 800;
    font-size: 1.5em;
    padding: 5px 15px;
    border-radius: 10px;
    background: #f0f0f0;
}

.value.correct {
    color: #22c55e;
}

.value.incorrect {
    color: #ef4444;
}

/* Game Area */
.game-area {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.question-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Test Tube Animation */
.test-tube-animation {
    position: relative;
    margin: 20px 0;
}

.test-tube {
    width: 80px;
    height: 200px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(200,200,200,0.3));
    border: 3px solid #333;
    border-radius: 0 0 20px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, #4299e1, #667eea);
    transition: all 0.5s ease;
    border-radius: 0 0 17px 17px;
}

/* Question Content */
.question-content {
    text-align: center;
    width: 100%;
}

.question-text {
    font-size: 1.8em;
    color: #333;
    font-weight: 700;
    margin-bottom: 10px;
}

.question-hint {
    font-size: 1.1em;
    color: #666;
    font-style: italic;
}

/* Answer Buttons */
.answer-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 500px;
}

.answer-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border: 3px solid transparent;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Nunito', sans-serif;
}

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

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

.answer-btn.acidic {
    border-color: #ef4444;
    color: #ef4444;
}

.answer-btn.acidic:hover:not(:disabled) {
    background: #fef2f2;
}

.answer-btn.neutral {
    border-color: #22c55e;
    color: #22c55e;
}

.answer-btn.neutral:hover:not(:disabled) {
    background: #f0fdf4;
}

.answer-btn.alkaline {
    border-color: #3b82f6;
    color: #3b82f6;
}

.answer-btn.alkaline:hover:not(:disabled) {
    background: #eff6ff;
}

.answer-btn .emoji {
    font-size: 1.5em;
}

.answer-btn .text {
    flex: 1;
    text-align: left;
    margin: 0 15px;
}

.answer-btn .ph-range {
    font-size: 0.9em;
    opacity: 0.7;
    font-weight: 600;
}

.answer-btn.correct-answer {
    background: #22c55e !important;
    color: white !important;
    border-color: #22c55e !important;
    animation: correctPulse 0.5s ease;
}

.answer-btn.wrong-answer {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
    animation: wrongShake 0.5s ease;
}

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

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Feedback */
.feedback {
    width: 100%;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 700;
    margin-top: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feedback.correct {
    background: #dcfce7;
    color: #166534;
    border: 2px solid #22c55e;
}

.feedback.incorrect {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #ef4444;
}

/* Result Screen */
.result-screen {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.result-screen.hidden {
    display: none;
}

.result-title {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 30px;
    font-weight: 800;
}

.result-stats {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 15px;
    border: 2px solid #e5e7eb;
}

.stat-value {
    font-size: 3em;
    font-weight: 800;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1em;
    color: #666;
    font-weight: 600;
}

.result-message {
    font-size: 1.5em;
    color: #333;
    margin: 20px 0;
    font-weight: 600;
    padding: 20px;
    background: #f0f9ff;
    border-radius: 10px;
}

.restart-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    margin-top: 20px;
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Info Panel */
.info-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.info-panel h3 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 15px;
    font-weight: 700;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.info-item strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
    font-size: 1.1em;
}

.info-item p {
    color: #666;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    .game-area {
        padding: 20px;
    }

    .question-text {
        font-size: 1.4em;
    }

    .answer-btn {
        padding: 15px 20px;
        font-size: 1em;
    }

    .answer-btn .text {
        margin: 0 10px;
    }

    .result-stats {
        flex-direction: column;
    }

    .stat-value {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .game-header {
        padding: 20px;
    }

    .game-header h1 {
        font-size: 1.5em;
    }

    .answer-btn .ph-range {
        display: none;
    }
}