* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(180deg, #87CEEB 0%, #8B4513 100%);
    overflow: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Welcome Screen */
.welcome-card {
    background: white;
    border-radius: 25px;
    padding: 40px 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.water-icon {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.main-title {
    font-size: 2.5rem;
    color: #1e40af;
    margin-bottom: 10px;
    font-weight: 800;
}

.subtitle {
    font-size: 1.2rem;
    color: #4b5563;
    margin-bottom: 25px;
}

.instructions-box {
    background: #f0f9ff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: left;
}

.instructions-title {
    font-size: 1.6rem;
    color: #1e40af;
    margin-bottom: 15px;
    font-weight: 700;
}

.instructions-list {
    list-style: none;
    margin-bottom: 20px;
}

.instructions-list li {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon {
    font-size: 1.5rem;
}

.scoring-info {
    background: #fef3c7;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.scoring-info h3 {
    color: #92400e;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.score-item {
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #374151;
    display: flex;
    justify-content: space-between;
}

.score-item.bonus {
    grid-column: 1 / -1;
    background: #fbbf24;
    color: #78350f;
    font-weight: 700;
}

.score-item span {
    font-weight: 700;
    color: #059669;
}

.bonus-text {
    color: #059669;
    font-weight: 600;
    margin: 8px 0 4px 0;
    font-size: 0.95rem;
}

.penalty-text {
    color: #dc2626;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-start {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    padding: 18px 50px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.4);
    transition: all 0.3s ease;
}

.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.6);
}

/* Game Screen */
.game-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-box {
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex: 1;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    color: #1e40af;
    font-weight: 800;
}

.timer-box .stat-value {
    color: #dc2626;
}

.current-zone {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.game-canvas {
    background: linear-gradient(180deg, #8B4513 0%, #6B4423 50%, #4A2511 100%);
    height: 500px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 5px solid #654321;
}

.water-drop {
    position: absolute;
    font-size: 40px;
    z-index: 100;
    transition: all 0.1s ease;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.8));
}

.obstacle {
    position: absolute;
    font-size: 35px;
    z-index: 50;
}

.zone-marker {
    position: absolute;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.controls {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-row {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 70px;
    height: 70px;
    font-size: 2rem;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.control-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.6);
}

/* MCQ Screen */
.mcq-card {
    background: white;
    border-radius: 25px;
    padding: 40px 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.mcq-header {
    text-align: center;
    margin-bottom: 30px;
}

.zone-icon {
    font-size: 80px;
    margin-bottom: 15px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.mcq-title {
    font-size: 2.5rem;
    color: #7c3aed;
    margin-bottom: 10px;
    font-weight: 800;
}

.mcq-subtitle {
    font-size: 1.3rem;
    color: #6b7280;
    font-weight: 600;
}

.mcq-question-box {
    background: #f3f4f6;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #7c3aed;
}

.mcq-question {
    font-size: 1.3rem;
    color: #1f2937;
    font-weight: 600;
    line-height: 1.6;
}

.mcq-options {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.mcq-option {
    background: #f9fafb;
    border: 3px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    font-size: 1.1rem;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.mcq-option:hover:not(.disabled) {
    background: #ede9fe;
    border-color: #7c3aed;
    transform: translateX(5px);
}

.mcq-option.correct {
    background: #d1fae5;
    border-color: #10b981;
    color: #065f46;
}

.mcq-option.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.mcq-option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.mcq-feedback {
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 3px solid;
}

.mcq-feedback.hidden {
    display: none;
}

.mcq-feedback.correct {
    background: #d1fae5;
    border-color: #10b981;
}

.mcq-feedback.wrong {
    background: #fee2e2;
    border-color: #ef4444;
}

.feedback-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.feedback-icon {
    font-size: 3rem;
}

.feedback-text {
    font-size: 1.8rem;
    font-weight: 700;
}

.mcq-feedback.correct .feedback-text {
    color: #065f46;
}

.mcq-feedback.wrong .feedback-text {
    color: #991b1b;
}

.mcq-explanation {
    font-size: 1.1rem;
    color: #374151;
    line-height: 1.6;
}

.btn-continue {
    width: 100%;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 18px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
    transition: all 0.3s ease;
}

.btn-continue:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(124, 58, 237, 0.6);
}

.btn-continue.hidden {
    display: none;
}

/* Results Screen */
.results-card {
    background: white;
    border-radius: 25px;
    padding: 40px 35px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.result-icon {
    font-size: 100px;
    margin-bottom: 15px;
    animation: bounce 1s ease infinite;
}

.result-title {
    font-size: 3rem;
    color: #1e40af;
    margin-bottom: 10px;
    font-weight: 800;
}

.result-message {
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 25px;
}

.final-score-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
}

.final-score-label {
    font-size: 1.3rem;
    color: #92400e;
    font-weight: 600;
    margin-bottom: 10px;
}

.final-score {
    font-size: 4rem;
    font-weight: 800;
    color: #78350f;
}

.stats-breakdown {
    background: #f0f9ff;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
}

.breakdown-title {
    font-size: 1.4rem;
    color: #1e40af;
    margin-bottom: 15px;
    font-weight: 700;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-highlight {
    font-weight: 700;
    color: #059669;
}

.results-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-play-again, .btn-exit {
    font-size: 1.3rem;
    font-weight: 700;
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-play-again {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-play-again:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6);
}

.btn-exit {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.btn-exit:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(107, 114, 128, 0.6);
}
.homeBtn {
        position: fixed;   /* stays at top-left even on scroll */
        top: 10px;         /* distance from top */
        left: 10px;        /* distance from left */
        z-index: 1000;     /* stays above other elements */
        }

        .homeBtn button {
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        }

        #imgbtn {
        width: 100px;       /* adjust size if needed */
        height: auto;
        }


/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }
    
    .game-canvas {
        height: 400px;
    }
    
    .score-grid {
        grid-template-columns: 1fr;
    }
    
    .results-buttons {
        flex-direction: column;
    }
    
    .btn-play-again, .btn-exit {
        width: 100%;
    }
}