* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    background: #f5f5f5;
}

.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.page.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Instructions Page */
#instructionsPage {
    background: linear-gradient(135deg, #43cea2 0%, #185a9d 100%);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.icon-circle {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 42px;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    color: #666;
}

.instructions-box {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
}

.instructions-box h2 {
    font-size: 28px;
    color: #00695c;
    margin-bottom: 15px;
}

.mission-text {
    font-size: 16px;
    color: #004d40;
    line-height: 1.6;
    margin-bottom: 25px;
}

.divisions-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.division-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    border-left: 5px solid;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.division-card h3 {
    margin-bottom: 12px;
    font-size: 20px;
}

.division-card p {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.thallo {
    border-color: #2196f3;
}

.thallo h3 {
    color: #2196f3;
}

.bryo {
    border-color: #4caf50;
}

.bryo h3 {
    color: #4caf50;
}

.pterido {
    border-color: #ff9800;
}

.pterido h3 {
    color: #ff9800;
}

.how-to-play {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border: 3px solid #e0e0e0;
}

.how-to-play h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.instructions-list {
    list-style: none;
}

.instructions-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.learning-note {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    color: #856404;
}

.btn-primary {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #757575 0%, #424242 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-secondary:hover {
    transform: translateY(-3px);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Game Page */
#gamePage {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    display: none;
}

#gamePage.active {
    display: block !important;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.game-header {
    background: white;
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stat-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 20px;
    border-radius: 12px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
}

.streak-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.streak-box.hidden {
    display: none !important;
}

.progress-container {
    background: white;
    border-radius: 15px;
    padding: 10px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    width: var(--progress, 0%);
    transition: width 0.5s ease;
    border-radius: 10px;
}

.feedback {
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
}

.feedback.hidden {
    display: none !important;
}

.feedback.correct {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%);
    color: white;
}

.feedback.wrong {
    background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);
    color: white;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.question-card {
    background: white;
    border-radius: 25px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
}

.plant-image {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    border: 5px solid #00acc1;
}

.image-placeholder {
    font-size: 120px;
    opacity: 0.7;
}

.plant-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.plant-name {
    font-size: 32px;
    color: #00695c;
    margin-bottom: 15px;
}

.plant-description {
    font-size: 16px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 10px;
}

.clues {
    background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%);
    border-radius: 15px;
    padding: 20px;
    border-left: 5px solid #fbc02d;
}

.clues h3 {
    color: #f57f17;
    margin-bottom: 12px;
    font-size: 18px;
}

.clues ul {
    list-style: none;
}

.clues li {
    color: #6d4c00;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    font-size: 15px;
}

.clues li::before {
    content: '🔎';
    position: absolute;
    left: 0;
}

.answer-section {
    background: white;
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.answer-title {
    text-align: center;
    font-size: 24px;
    color: #333;
    margin-bottom: 25px;
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.answer-btn {
    background: white;
    border: 4px solid #e0e0e0;
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.answer-btn:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.thallo-btn {
    border-color: #2196f3;
}

.thallo-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #1976d2;
}

.bryo-btn {
    border-color: #4caf50;
}

.bryo-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #388e3c;
}

.pterido-btn {
    border-color: #ff9800;
}

.pterido-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-color: #f57c00;
}

.answer-btn.correct {
    background: linear-gradient(135deg, #4caf50 0%, #8bc34a 100%) !important;
    border-color: #388e3c !important;
    color: white !important;
    animation: pulse 0.5s;
}

.answer-btn.wrong {
    background: linear-gradient(135deg, #f44336 0%, #e57373 100%) !important;
    border-color: #d32f2f !important;
    color: white !important;
    animation: shake 0.5s;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.btn-icon {
    font-size: 48px;
}

.btn-content {
    flex: 1;
}

.btn-title {
    font-size: 22px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.btn-hint {
    font-size: 14px;
    color: #666;
}

.answer-btn.correct .btn-title,
.answer-btn.correct .btn-hint,
.answer-btn.wrong .btn-title,
.answer-btn.wrong .btn-hint {
    color: white !important;
}

/* Score Card Page */
#scoreCardPage {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    display: none;
}

#scoreCardPage.active {
    display: flex !important;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.score-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.score-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.score-value {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
}

.score-label {
    font-size: 14px;
    opacity: 0.9;
}

.accuracy-display {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
}

.accuracy-label {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
    font-weight: bold;
}

.accuracy-bar {
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    width: 0%;
    transition: width 1s ease;
    border-radius: 15px;
}

.accuracy-percent {
    font-size: 32px;
    font-weight: bold;
    color: #4caf50;
}

.learning-summary {
    background: linear-gradient(135deg, #e1bee7 0%, #f8bbd0 100%);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
}

.learning-summary h3 {
    font-size: 24px;
    color: #6a1b9a;
    margin-bottom: 15px;
}

.learning-summary ul {
    list-style: none;
    color: #4a148c;
}
.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;
        }


.learning-summary li {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.5;
}

.fun-fact {
    background: linear-gradient(135deg, #b2dfdb 0%, #80cbc4 100%);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 25px;
    border-left: 5px solid #00897b;
}

.fun-fact h3 {
    font-size: 20px;
    color: #004d40;
    margin-bottom: 10px;
}

.fun-fact p {
    font-size: 16px;
    color: #00695c;
    line-height: 1.6;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .question-card {
        grid-template-columns: 1fr;
    }
    
    .answer-options {
        grid-template-columns: 1fr;
    }
    
    .score-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        grid-template-columns: 1fr;
    }
    
    .divisions-info {
        grid-template-columns: 1fr;
    }
    
    .stat-group {
        justify-content: center;
    }
}