* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: #CF9FFF;
    padding: 20px;
}
.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;
        }


.container {
    max-width: 900px;
    margin: 0 auto;
}

.screen {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

.card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    padding: 40px;
    max-width: 700px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.wave-icon {
    font-size: 96px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.wave-icon.game-over {
    animation: shake 0.5s;
}

.wave-icon.victory {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

h1 {
    font-size: 48px;
    color: #2563eb;
    margin-bottom: 10px;
}

.game-over-title {
    color: #dc2626;
}

.victory-title {
    color: #16a34a;
}

.subtitle {
    font-size: 20px;
    color: #6b7280;
    margin-bottom: 30px;
}

.info-box {
    background: #eff6ff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: left;
}

.info-box h2 {
    font-size: 28px;
    color: #1e40af;
    margin-bottom: 20px;
}

.instructions {
    list-style: none;
}

.instructions li {
    color: #374151;
    margin-bottom: 12px;
    font-size: 16px;
    display: flex;
    align-items: flex-start;
}

.emoji {
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.btn {
    font-size: 24px;
    font-weight: bold;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: scale(1.05);
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-exit {
    background: #6b7280;
    color: white;
    margin-left: 10px;
}

.btn-exit:hover {
    background: #4b5563;
}

.header-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.game-title {
    font-size: 32px;
    color: #2563eb;
    margin-bottom: 5px;
}

.level-info {
    color: #6b7280;
    font-size: 16px;
}

.stats {
    display: flex;
    gap: 30px;
    align-items: center;
}

.exit-btn {
    background: #ef4444;
    color: white;
    font-weight: bold;
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-size: 16px;
}

.exit-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #2563eb;
}

.game-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 32px;
}

.habitat-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 8px 24px;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 20px;
}

.organism-display {
    text-align: center;
    margin-bottom: 30px;
}

.organism-display.success {
    animation: pulse 1s ease-in-out 2;
}

.organism-icon {
    font-size: 96px;
    margin-bottom: 16px;
}

.organism-name {
    font-size: 32px;
    color: #1f2937;
    margin-bottom: 12px;
}

.organism-type {
    display: inline-block;
    background: #d1fae5;
    color: #065f46;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
}

.challenge-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.challenge-box h3 {
    font-size: 20px;
    color: #92400e;
    margin-bottom: 12px;
}

.challenge-box p {
    color: #374151;
    font-size: 18px;
    line-height: 1.6;
}

.adaptations-section {
    margin-bottom: 30px;
}

.adaptations-section h3 {
    font-size: 24px;
    color: #1f2937;
    margin-bottom: 20px;
}

.adaptation-btn {
    width: 100%;
    background: #f9fafb;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.adaptation-btn:hover:not(:disabled) {
    background: #eff6ff;
    border-color: #3b82f6;
    transform: scale(1.02);
}

.adaptation-btn:disabled {
    cursor: not-allowed;
}

.adaptation-btn.selected {
    background: #dbeafe;
    border-color: #3b82f6;
    border-width: 4px;
}

.adaptation-btn.correct {
    background: #d1fae5;
    border-color: #10b981;
    border-width: 4px;
}

.adaptation-btn.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    border-width: 4px;
}

.adaptation-content h4 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 8px;
}

.adaptation-content p {
    color: #6b7280;
    font-size: 16px;
}

.adaptation-icon {
    font-size: 32px;
    margin-left: 16px;
    flex-shrink: 0;
}

.result-box {
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.result-box.correct {
    background: #d1fae5;
    border: 2px solid #10b981;
}

.result-box.wrong {
    background: #fee2e2;
    border: 2px solid #ef4444;
}

.result-box h3 {
    font-size: 24px;
    margin-bottom: 16px;
}

.result-box.correct h3 {
    color: #065f46;
}

.result-box.wrong h3 {
    color: #991b1b;
}

.result-box p {
    color: #374151;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.success-message {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.success-message p {
    color: #065f46;
    font-weight: 600;
    margin-bottom: 0;
}

.final-stats {
    background: #f3f4f6;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
}

.final-stats p {
    font-size: 18px;
    color: #374151;
    margin-bottom: 8px;
}

.final-score, .victory-score {
    font-size: 28px !important;
    font-weight: bold;
    color: #1f2937 !important;
}

.victory-stats {
    background: #d1fae5;
}

.learning-box {
    background: #eff6ff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    text-align: left;
}

.learning-box h3 {
    font-size: 20px;
    color: #1e40af;
    margin-bottom: 16px;
}

.learning-list {
    list-style: none;
}

.learning-list li {
    color: #374151;
    margin-bottom: 12px;
    font-size: 16px;
}

@media (max-width: 768px) {
    .card {
        padding: 24px;
    }

    h1 {
        font-size: 36px;
    }

    .game-title {
        font-size: 24px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats {
        width: 100%;
        justify-content: space-around;
    }

    .organism-icon {
        font-size: 64px;
    }

    .organism-name {
        font-size: 24px;
    }

    .btn {
        font-size: 18px;
        padding: 12px 32px;
    }
}