/* ===== CUSTOM FONT ===== */
@font-face {
    font-family: 'Krabby Patty';
    src: url('font/Krabby Patty.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===== GOOGLE FONTS IMPORT ===== */
@import url('https://fonts.googleapis.com/css2?family=Luckiest+Guy&family=Nunito:wght@400;600;700;800&display=swap');


/* Headings use playful font */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Luckiest Guy', cursive;
    letter-spacing: 1px;
}

body {
    font-family: 'Luckiest Guy', 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #4A90E2 50%, #2E5C8A 100%);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 30%),
        linear-gradient(180deg, #87CEEB 0%, #4A90E2 50%, #2E5C8A 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

/* Floating bubbles animation */
body::before {
    content: '';
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10%),
        radial-gradient(circle, rgba(255, 255, 255, 0.2) 10%, transparent 10%),
        radial-gradient(circle, rgba(255, 255, 255, 0.25) 10%, transparent 10%);
    background-size: 50px 50px, 80px 80px, 120px 120px;
    background-position: 0 0, 40px 60px, 130px 270px;
    animation: bubbleFloat 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes bubbleFloat {
    0% {
        background-position: 0 0, 40px 60px, 130px 270px;
    }
    100% {
        background-position: 0 -1000px, 40px -1200px, 130px -1400px;
    }
}

#game-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 4px solid #FFD700;
}

/* ===== WELCOME SCREEN ===== */
#welcome-screen {
    padding: 120px 5vw;
    text-align: center;
    background: linear-gradient(rgba(255, 208, 1, 0.11), rgba(255, 208, 1, 0.11)),url('images/Every\ SpongeBob\ Frame\ In\ Order\ on\ Twitter\ \(1\).jpg') center/cover;
    position: relative;
    overflow: visible;
}

#welcome-screen::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background-image: url('images/SB\ house.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 1;
    top: 50px;
    right: -50px;
    transform: rotate(25deg);
}

#welcome-screen::after {
    content: '🪸';
    position: absolute;
    font-size: 100px;
    opacity: 1;
    bottom: -20px;
    left: -20px;
}

.game-title-img {
    max-width: 800px;
    width: 60%;
    height: auto;
    position: relative;
    top: -200px;
    margin: 0 auto 20px auto;
    display: block;
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.5));
    animation: titleBounce 2s ease-in-out infinite;
}

@keyframes titleBounce {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.grade-img {
    width: 1000px;
    height: 200px;
    margin: 0 auto -80px auto;
    background: url('images/G10.png') no-repeat center center;
    background-size: contain;
    text-indent: -9999px; /* hide the text */
}

#welcome-screen h1 {
    font-size: 3em;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-top: -150px;
}

#welcome-screen h2 {
    font-size: 3em;
    color: #fff;
    margin-top: -280px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.character-select {
    margin: 80px 0 60px 0;  /* More top margin */
}

.character-select h3 {
    font-size: 1.5em;
    color: #fff;
    margin-top: -80px;  /* More space between heading and cards */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);  /* Make text more visible */
}

.character-options {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.character-card {
    background: white;
    padding: 80px 20px 20px 20px;  /* More padding at top for bigger image */
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    border: 5px solid transparent;
    min-width: 150px;  /* Made wider for bigger images */
    position: relative;
    top: 80px;  /* Move the whole card down to accommodate the popped-out image */
    overflow: visible;  /* Changed from hidden to visible so image can pop out! */
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.character-card:hover::before {
    opacity: 1;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.character-card.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.character-icon {
    font-size: 3em;
    margin-bottom: 40px;
    height: 120px;  /* Taller container */
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;  /* Position it absolutely */
    top: -60px;  /* Move it UP and outside the card */
    left: 50%;
    transform: translateX(-50%);  /* Center it horizontally */
    z-index: 10;  /* Make sure it appears on top */
    width: 100%;
}

.character-icon img {
    max-width: 150px;  /* BIGGER! (was 70px) */
    max-height: 150px;  /* BIGGER! (was 70px) */
    object-fit: contain;
    filter: drop-shadow(3px 3px 8px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}

.character-card:hover .character-icon img {
    transform: scale(1.1) translateY(-5px);  /* Grow and bounce on hover */
}

.character-card p {
    font-weight: bold;
    color: #333;
    margin-top: 0;  /* No extra margin needed */
    text-align: center;
}

#player-name {
    padding: 15px 20px;
    font-size: 1.2em;
    border: 3px solid #fff;
    border-radius: 10px;
    width: 600px;
    max-width: 100%;
    text-align: center;
    margin: 40px auto;
    margin-top: 90px;
    display: block;
}

#player-name:focus {
    outline: none;
    border-color: #667eea;
}

/* ===== BUTTONS ===== */
.btn-primary, .btn-secondary {
    padding: 15px 40px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    margin: -30px auto;
    display: block;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-family: 'Krabby Patty', 'Comic Sans MS', Arial, sans-serif;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-primary:disabled, .btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* ===== ELABORATE BUTTON ===== */
#elaborate-start-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500) !important;
    color: #333 !important;
    font-weight: bold !important;
    border: 3px solid #FFA500 !important;
    padding: 5px 20px !important;
    border-radius: 10px !important;
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.5) !important;
    transition: all 0.3s ease !important;
    animation: pulse-elaborate 2s infinite !important;
    cursor: pointer !important;
    font-size: 1px !important;
    display: block !important;
    margin: 20px auto 0 !important;
    width: 50% !important;
    max-width: 50px !important;
    font-family: 'Luckiest Guy', cursive !important;
}

#elaborate-start-btn:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 8px 30px rgba(255, 165, 0, 0.9) !important;
}

#elaborate-start-btn:active {
    transform: scale(0.96) !important;
}

@keyframes pulse-elaborate {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(255, 165, 0, 0.5);
        text-shadow: 0 0 0 rgba(255, 165, 0, 0);
    }
    50% {
        box-shadow: 0 6px 35px rgba(255, 165, 0, 1);
        text-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
    }
}

/* ===== SCREENS ===== */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* ===== GAME SCREEN ===== */
#game-screen {
    padding: 0;
}

/* ===== STATS BAR ===== */
.stats-bar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.stats-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255,255,255,0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255,255,255,0.08) 0%, transparent 20%);
    pointer-events: none;
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    display: block;
    margin-bottom: 5px;
}

.stat span:not(.stat-label) {
    font-size: 1.5em;
    font-weight: bold;
}

.xp-value {
    color: #ffd700;
}

/* ===== SMALL ICON BUTTONS ABOVE PLAYER NAME ===== */
.player-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.icon-btn {
    background: #fff;
    border: 2px solid #667eea;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: #667eea;
    color: #fff;
    transform: scale(1.2);
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 3px solid #e0e0e0;
}

.tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-family: 'Krabby Patty', 'Comic Sans MS', Arial, sans-serif;
    font-weight: 600;
}

.tab:hover {
    background: #e9ecef;
}

.tab.active {
    background: white;
    border-bottom-color: #667eea;
    font-weight: bold;
}

/* ===== TAB CONTENT ===== */
.tab-content {
    display: none;
    padding: 30px;
    min-height: 500px;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

.info-text {
    color: #666;
    margin-bottom: 30px;
    text-align: center;
}

/* ===== LEVELS GRID ===== */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.level-card {
    background: linear-gradient(135deg, #f59b9b 0%, #FFD93D 100%);
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

/* Level 1 - Krusty Krab (Red/Orange) */
.level-card[data-level="1"] {
    background: linear-gradient(135deg, #FF6B6B 0%, #FFD93D 100%);
}

/* Level 2 - Jellyfish Fields (Pink/Purple) */
.level-card[data-level="2"] {
    background: linear-gradient(135deg, #FF6EC7 0%, #C06FF5 100%);
}

/* Level 3 - Sandy's Treedome (Green/Brown) */
.level-card[data-level="3"] {
    background: linear-gradient(135deg, #95E1D3 0%, #6A9955 100%);
}

/* Level 4 - Goo Lagoon (Blue/Yellow) */
.level-card[data-level="4"] {
    background: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
}

.level-card::before {
    content: '';
    position: relative;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.level-card:hover::before {
    opacity: 1;
}

.level-card:hover:not(.locked) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.level-card.locked {
    background: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.level-card.completed {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.level-icon {
    font-size: 3em;
    margin-bottom: 10px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.level-icon img {
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
    filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.3));
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.level-card h3 {
    color: rgb(3, 3, 3);
    margin-bottom: 10px;
    font-size: 1.3em;
}

.level-card p {
    color: #3a3838;
    margin: 5px 0;
    font-size: 0.9em;
}

.level-status {
    margin-top: 10px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    display: inline-block;
    font-size: 0.85em;
}

/* Additional styles for 30-level structure */

/* Sublevel Grid */
.sublevels-grid {
    display: grid;
    grid-template-columns: repeat(6, 120px);
    gap: 20px;
    margin-top: 20px;
    position: relative;
}

.sublevel-btn {
    position: relative;
    width: 80px;
    height: 80px;
    border: 4px solid #ddd;
    border-radius: 50%;
    background: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sublevel-btn:hover:not(.locked) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.sublevel-btn.easy {
    border-color: #4caf50;
    color: #4caf50;
}

.sublevel-btn.average {
    border-color: #ff9800;
    color: #ff9800;
}

.sublevel-btn.difficult {
    border-color: #f44336;
    color: #f44336;
}

.sublevel-btn.completed {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.sublevel-btn.locked {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

.sublevel-btn .check {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.sublevel-btn .lock {
    position: absolute;
    font-size: 14px;
}

/* Difficulty Legend - smaller */
.difficulty-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 12px 0 25px 0;
    flex-wrap: wrap;
}

.difficulty-label {
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 11px;
}

.difficulty-label.easy {
    background: #e8f5e9;
    color: #2e7d32;
}

.difficulty-label.average {
    background: #fff3e0;
    color: #e65100;
}

.difficulty-label.difficult {
    background: #ffebee;
    color: #c62828;
}

/* Setting subject display - smaller */
.setting-subject {
    text-align: center;
    font-size: 15px;
    color: #666;
    margin: 8px 0 5px 0;
    font-style: italic;
}

/* Sublevel header container */
.sublevel-header {
    margin-bottom: 20px;
}

.sublevel-header h2 {
    margin-top: 10px;
    margin-bottom: 5px;
}

/* Back button - smaller and cleaner */
.btn-back {
    padding: 8px 16px;
    font-size: 0.9em;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-family: 'Krabby Patty', 'Comic Sans MS', Arial, sans-serif;
    display: inline-block;
    margin-bottom: 15px;
}

.btn-back:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

/* Question difficulty badges */
.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
}

.difficulty-badge.easy {
    background: #e8f5e9;
    color: #2e7d32;
}

.difficulty-badge.average {
    background: #fff3e0;
    color: #e65100;
}

.difficulty-badge.difficult {
    background: #ffebee;
    color: #c62828;
}

/* Question character display */
.question-character {
    font-size: 14px;
    color: #666;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Feedback Container Styles */
.feedback-container {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-container.correct {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.feedback-container.incorrect {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.feedback-container.already-correct {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.feedback-content {
    margin-bottom: 15px;
}

.feedback-content strong {
    display: block;
    font-size: 18px;
    margin-bottom: 10px;
}

.feedback-content p {
    margin: 10px 0;
    line-height: 1.6;
}

.hint {
    background: #fff9e6;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #ffc107;
    margin-top: 10px;
}

/* Option button states */
.option-btn {
    width: 100%;
    text-align: left;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateX(5px);
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn.correct {
    border-color: #4caf50;
    background: #e8f5e9;
    font-weight: bold;
}

.option-btn.incorrect {
    border-color: #f44336;
    background: #ffebee;
}

/* Next level and retry buttons */
.next-level-btn,
.retry-btn {
    margin-top: 15px;
    width: 100%;
}

/* Already answered indicator */
.already-answered {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    margin: 10px 0;
}

.correct-answer-review {
    padding: 10px;
}

.correct-answer-review strong {
    display: block;
    color: #2196f3;
    margin-bottom: 10px;
}

/* Level progress on setting cards */
.level-progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
}

.level-progress span {
    font-size: 14px;
    color: #666;
}

/* Question meta info */
.question-meta {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 14px;
}

.question-meta span {
    color: #666;
    font-weight: bold;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sublevels-grid {
        grid-template-columns: repeat(5, 50px);
        gap: 8px;
    }
    
    .sublevel-btn {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .difficulty-legend {
        gap: 8px;
    }
    
    .difficulty-label {
        font-size: 10px;
        padding: 4px 10px;
    }
}

/* Story page styling */
.story-page {
    padding: 20px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.story-character {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
}

.story-text {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

/* Achievement cards */
.achievement-card {
    display: flex;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    background: white;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.achievement-card.earned {
    border-color: #4caf50;
    background: #e8f5e9;
}

.achievement-card.locked {
    opacity: 0.6;
}

.achievement-icon {
    font-size: 40px;
    margin-right: 20px;
}

.achievement-info {
    flex: 1;
}

.achievement-info h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-family: 'Luckiest Guy', cursive;
    color: #333;
}

.achievement-info p {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 15px;
}

.achievement-xp {
    color: #667eea;
    font-weight: bold;
    font-size: 14px;
}

.achievement-earned {
    color: #4caf50;
    font-weight: bold;
    font-size: 20px;
}

/* Progress stats cards */
.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.progress-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.progress-card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #666;
}

.big-stat {
    font-size: 36px;
    font-weight: bold;
    color: #667eea;
    margin: 10px 0;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: block;
}

/* ===== XP INFO MODAL ===== */
.xp-info-content {
    max-width: 1000px !important;
    margin: 5% auto !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4) !important;
    animation: modalSlideIn 0.5s ease !important;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.xp-info-wrapper {
    display: flex;
    gap: 0;
    align-items: stretch;
    min-height: 500px;
}

.xp-info-character {
    flex: 0 0 35%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.xp-info-character::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.xp-info-char-img {
    max-width: 85%;
    max-height: 400px;
    object-fit: contain;
    filter: drop-shadow(5px 5px 15px rgba(0,0,0,0.3));
    position: relative;
    z-index: 1;
    animation: characterFloat 2s ease-in-out infinite;
}

@keyframes characterFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.xp-info-text {
    flex: 1;
    background: white;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 600px;
}

.xp-info-text h2 {
    color: #667eea;
    font-size: 2em;
    margin: 0 0 10px 0;
    text-align: center;
}

.xp-intro {
    font-size: 1.1em;
    color: #666;
    font-style: italic;
    text-align: center;
    margin-bottom: 20px;
}

.xp-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.xp-rule-box {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.xp-rule-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.rule-icon {
    display: block;
    font-size: 2em;
    margin-bottom: 10px;
}

.xp-rule-box h3 {
    color: #333;
    font-size: 1.15em;
    margin: 0 0 8px 0;
}

.xp-rule-box p {
    color: #666;
    font-size: 0.95em;
    margin: 0;
    line-height: 1.5;
}

.xp-tips {
    background: linear-gradient(135deg, #fff9e6 0%, #fffbe6 100%);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #ffc107;
    margin-top: 20px;
}

.xp-tips h3 {
    color: #ff8c00;
    font-size: 1.1em;
    margin: 0 0 15px 0;
}

.xp-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.xp-tips li {
    color: #666;
    font-size: 0.95em;
    padding: 8px 0;
    line-height: 1.6;
}

.xp-tips strong {
    color: #333;
    font-weight: bold;
}

#close-xp-modal {
    margin-top: 20px;
    width: 100%;
    padding: 15px !important;
    font-size: 1.1em !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .xp-info-wrapper {
        flex-direction: column;
        min-height: auto;
    }
    
    .xp-info-character {
        flex: 0 0 250px;
        padding: 20px;
    }
    
    .xp-info-char-img {
        max-height: 250px;
    }
    
    .xp-info-text {
        padding: 25px;
        max-height: none;
    }
    
    .xp-rules {
        grid-template-columns: 1fr;
    }
    
    .xp-info-content {
        margin: 10% auto !important;
    }
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

/* Character Introduction Modal */
.character-intro-content {
    max-width: 900px;
    padding: 20px 40px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
}

.character-intro-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.character-intro-left {
    display: flex;
    flex-direction: column;
    gap: 50px;
    flex: 0 0 280px;
}

.character-intro-image {
    text-align: center;
}

.character-intro-image img {
    max-width: 400px;
    max-height: 400px;
    object-fit: contain;
    filter: drop-shadow(5px 5px 10px rgba(0,0,0,0.2));
    animation: characterPop 0.5s ease-out;
}

@keyframes characterPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.character-intro-text {
    flex: 1;
}

.character-intro-text h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 2em;
}

.character-quote {
    font-size: 1.2em;
    font-style: italic;
    color: #555;
    background: #fff3cd;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #ffc107;
    margin-bottom: 20px;
}

.character-description {
    font-size: 1.05em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.character-traits {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.character-traits h3 {
    color: #1976d2;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.character-traits ul {
    list-style: none;
    padding: 0;
}

.character-traits li {
    padding: 8px 0;
    font-size: 1em;
    color: #333;
}

.intro-buttons {
    display: flex;
    flex-direction: column;
    gap: 70px;
    width: 100%;
}

.intro-buttons button {
    width: 100%;
}

/* Responsive design for character intro */
@media (max-width: 768px) {
    .character-intro-container {
        flex-direction: column;
        align-items: center;
    }
    
    .character-intro-left {
        flex: 0 0 auto;
        width: 100%;
        max-width: 300px;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #000;
}

/* ===== QUESTIONS ===== */
#questions-container {
    margin-top: 20px;
}

.question-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.question-item.answered {
    background: #d4edda;
    border-left-color: #28a745;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-number {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.question-cost {
    background: #ffd700;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.question-text {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #333;
    font-family: 'Nunito', sans-serif;  /* ADD THIS */
    font-weight: 600;                   /* ADD THIS */
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s;
    font-size: 1em;
    font-family: 'Nunito', sans-serif;  /* ADD THIS */
    font-weight: 500;                   /* ADD THIS */
}

.option-btn:hover:not(:disabled) {
    background: #f0f4ff;
    border-color: #667eea;
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn.correct {
    background: #d4edda;
    border-color: #28a745;
}

.option-btn.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
}

.question-feedback {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
}

.question-feedback.correct {
    background: #d4edda;
    color: #155724;
}

.question-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.explanation {
    margin-top: 10px;
    font-weight: normal;
    font-style: italic;
}

/* ===== ADVENTURE GRID ===== */
.adventure-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.adventure-card {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.adventure-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.adventure-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.adventure-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.adventure-card p {
    color: #666;
    margin: 5px 0;
    font-size: 0.9em;
}

.xp-reward {
    margin-top: 10px;
    padding: 8px 15px;
    background: #ffd700;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
}

/* ===== MINI-GAME STYLES ===== */
#adventure-game-container {
    text-align: center;
    padding: 20px;
}

#jellyfish-game {
    background: #e3f2fd;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2em;
}

#game-canvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    display: block;
    margin: 20px auto;
    background: white;
    cursor: crosshair;
}

#start-game-btn {
    margin-top: 20px;
}

/* ===== STORY GRID ===== */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.story-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.story-card:hover:not(.locked) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.story-card.locked {
    background: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
}

.story-card.completed {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.story-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.story-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.story-card p {
    color: #666;
    margin: 5px 0;
    font-size: 0.9em;
}

/* ===== STORY READER ===== */
.story-reader {
    max-width: 900px;
}

#story-content-display {
    min-height: 300px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
    line-height: 1.8;
    font-size: 1.1em;
}

.story-page {
    display: none;
}

.story-page.active {
    display: block;
}

.story-character {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2em;
    margin-bottom: 10px;
    display: block;
}

.story-navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

#story-progress {
    font-weight: bold;
    color: #666;
}

/* ===== ELABORATE BUTTON IN STORY MODAL ===== */
.elaborate-flash-btn {
    display: block;
    width: 50%;
    padding: 16px 24px;
    margin: 50px auto 0;
    position: relative;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: 3px solid #FF8C00;
    border-radius: 12px;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Luckiest Guy', cursive;
    cursor: pointer;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    transition: transform 0.1s ease;
}

.elaborate-flash-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 165, 0, 1), inset 0 0 15px rgba(255, 255, 255, 0.4);
}

.elaborate-flash-btn:active {
    transform: scale(0.98);
}

@keyframes elaborate-flash {
    0% {
        box-shadow: 0 0 20px rgba(255, 165, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
        background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 165, 0, 1), inset 0 0 20px rgba(255, 255, 255, 0.5);
        background: linear-gradient(135deg, #FFFF00 0%, #FFB300 100%);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 165, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
        background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    }
}

/* ===== PROGRESS TAB ===== */
.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.progress-card {
    background: linear-gradient(135deg, #040a27 0%, #2c1146 100%);
    color: rgb(255, 255, 255);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.progress-card h3 {
    font-size: 1em;
    margin-bottom: 15px;
    opacity: 0.9;
}

.big-stat {
    font-size: 2em;
    font-weight: bold;
    margin: 0;
}

.achievements h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

#achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.achievement {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #e0e0e0;
}

.achievement.unlocked {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
    border-color: #ffd700;
}

.achievement-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.achievement h4 {
    margin-bottom: 5px;
}

.achievement p {
    font-size: 2em;
    opacity: 0.8;
}

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.notification.show {
    display: block;
}

.notification.error {
    background: #dc3545;
}

.notification.warning {
    background: #ffc107;
    color: #333;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    #welcome-screen h1 {
        font-size: 2em;
    }
    
    .character-options {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-bar {
        flex-direction: column;
        text-align: center;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        font-size: 2em;
        padding: 10px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .levels-grid, .adventure-grid, .story-grid {
        grid-template-columns: 1fr;
    }
}

/* === READABLE QUESTION FONTS === */
.question-text,
.option-btn,
.question-feedback,
.explanation,
.feedback-container,
.feedback-content,
.feedback-content strong,
.feedback-content p,
.hint,
.correct-answer-review strong,
.correct-answer-review p {
    font-family: 'Nunito', sans-serif !important;
    letter-spacing: 0.3px;
}

.question-text {
    font-size: 1.2em !important;
    font-weight: 700 !important;
}

.feedback-content strong {
    font-weight: 800 !important;
}

/* === END READABLE QUESTION FONTS === */

/* ====================================================================
   ENHANCED CLOSE/BACK BUTTON FOR QUESTIONS MODAL
   Add this to your style.css or additional-styles.css
   ==================================================================== */

/* Make the X button more visible and stylish */
.modal .close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f5f5f5;
    line-height: 1;
}

.modal .close:hover {
    color: #ff4444;
    background: #ffebee;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

/* Add a text "Back to Levels" button option */
.back-to-levels-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 1000;
}

.back-to-levels-btn:hover {
    background: #5568d3;
    transform: translateX(-3px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.back-to-levels-btn::before {
    content: '←';
    font-size: 16px;
}

/* Alternative: Larger X button with tooltip */
.modal .close-with-tooltip {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 36px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    border: 2px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.modal .close-with-tooltip:hover {
    color: white;
    background: #ff4444;
    border-color: #ff4444;
    transform: rotate(90deg) scale(1.1);
}

.modal .close-with-tooltip::after {
    content: 'Back to Levels';
    position: absolute;
    top: 50%;
    right: 55px;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    font-family: 'Nunito', sans-serif;
}

.modal .close-with-tooltip:hover::after {
    opacity: 1;
}

/* Style for questions modal specifically */
#questions-modal .modal-content {
    position: relative;
    padding-top: 60px; /* Make room for close button */
}

#questions-modal .close {
    /* Specific styling for questions modal close button */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 28px;
    width: 45px;
    height: 45px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#questions-modal .close:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    transform: scale(1.15) rotate(90deg);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .modal .close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .back-to-levels-btn {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    #questions-modal .modal-content {
        padding-top: 50px;
    }
}

/* Keep both visible */
#questions-modal .close {
    /* X button on top right */
    top: 15px;
    right: 15px;
}

#questions-modal .back-to-levels-btn {
    /* Text button on top left */
    top: 15px;
    left: 15px;
}

/* Make modal title centered with space for both buttons */
#questions-modal #level-title {
    text-align: center;
    margin: 0 80px 20px 80px; /* Space for buttons on both sides */
}

/* ====================================================================
   MINI-GAMES / ADVENTURE STYLES
   Add this CSS to your style.css file
   ==================================================================== */

/* Adventure Grid */
.adventure-grid {
    grid-template-columns: repeat(3, 1fr);
    display: flex;
    flex-direction: row;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Adventure Cards */
.adventure-card {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 25px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.adventure-card::before {
    content: '';
    position: relative;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.adventure-card:hover::before {
    opacity: 1;
}

.adventure-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.adventure-icon {
    font-size: 64px;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.adventure-card h3 {
    margin: 15px 0 10px 0;
    color: #333;
    font-size: 22px;
}

.adventure-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.adventure-info {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.adventure-difficulty {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: capitalize;
    background: #fff;
}

.adventure-reward {
    color: #667eea;
    font-weight: bold;
    font-size: 16px;
}

.play-adventure-btn {
    margin-top: 10px;
    width: 100%;
}

/* Mini-Game Wrapper */
.mini-game-wrapper {
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
}

/* Game Info Bar */
.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-icon {
    font-size: 24px;
}

.game-stat span {
    font-size: 14px;
}

.game-stat strong {
    font-size: 20px;
    font-weight: bold;
}

/* Game Canvas */
.game-canvas-wrapper {
    position: relative;
    margin: 20px 0;
    text-align: center;
}

#game-canvas {
    border: 3px solid #667eea;
    border-radius: 10px;
    background: #87CEEB;
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

.game-message {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    min-height: 30px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Timing Game Styles */
.timing-game-area {
    text-align: center;
    padding: 20px;
}

.timing-bar {
    position: relative;
    width: 100%;
    height: 80px;
    background: linear-gradient(to right, #ff4444 0%, #ff4444 30%, #4CAF50 45%, #4CAF50 55%, #ff4444 70%, #ff4444 100%);
    border-radius: 10px;
    margin: 30px 0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.timing-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    background: white;
    box-shadow: 0 0 10px rgba(255,255,255,0.8);
    transition: left 0.02s linear;
}

.timing-target {
    position: absolute;
    left: 45%;
    top: 0;
    width: 10%;
    height: 100%;
    border-left: 3px dashed white;
    border-right: 3px dashed white;
    pointer-events: none;
}

#flip-btn {
    margin: 20px 0;
    padding: 20px 40px;
    font-size: 20px;
}

/* Game Results */
.game-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    display: none;
}

.game-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.game-success h3 {
    color: #155724;
    font-size: 28px;
    margin-bottom: 15px;
}

.game-success p {
    color: #155724;
    font-size: 18px;
    margin: 10px 0;
}

.xp-earned {
    font-size: 24px !important;
    font-weight: bold;
    color: #667eea !important;
    margin: 15px 0 !important;
}

.game-failure {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.game-failure h3 {
    color: #721c24;
    font-size: 28px;
    margin-bottom: 15px;
}

.game-failure p {
    color: #721c24;
    font-size: 18px;
    margin: 10px 0;
}

/* Button Styles */
.btn-large {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
}

/* Simple Game */
.simple-game {
    text-align: center;
    padding: 40px;
}

.simple-game p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .adventure-grid {
        grid-template-columns: 1fr;
    }
    
    .adventure-icon {
        font-size: 48px;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .timing-bar {
        height: 60px;
    }
    
    #flip-btn {
        padding: 15px 30px;
        font-size: 16px;
    }
}

/* Animation for adventure cards appearing */
.adventure-card {
    animation: slideUp 0.5s ease forwards;
    opacity: 0;
}

.adventure-card:nth-child(1) { animation-delay: 0.1s; }
.adventure-card:nth-child(2) { animation-delay: 0.2s; }
.adventure-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== STORY AUDIO PLAYER STYLES ===== */

.story-audio-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.audio-control-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.audio-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #f0f0f0;
}

.audio-control-btn:active {
    transform: translateY(0);
}

.audio-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    color: white;
    font-weight: bold;
}

.audio-progress-bar {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.audio-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.audio-progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.audio-progress-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.audio-progress-bar::-moz-range-thumb:hover {
    transform: scale(1.2);
}

#audio-current-time,
#audio-duration {
    font-size: 0.9em;
    min-width: 45px;
    text-align: center;
}

/* Hide audio player when no audio is available */
.story-audio-player.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .story-audio-player {
        padding: 15px;
    }
    
    .audio-control-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .audio-progress-container {
        flex-wrap: wrap;
    }
}

/* ===== STORY IMAGES ===== */
.story-content-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 10px;
}

.story-image-container {
    flex: 0 0 300px;
    max-width: 900px;
}

.story-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.story-image:hover {
    transform: scale(1.05);
}

.story-text-container {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
}

/* Mobile responsive for story images */
@media (max-width: 768px) {
    .story-content-wrapper {
        flex-direction: column;
    }
    
    .story-image-container {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }
    
    .story-image {
        max-height: 250px;
        object-fit: contain;
    }
}

/* Tablet view */
@media (max-width: 1024px) and (min-width: 769px) {
    .story-image-container {
        flex: 0 0 250px;
        max-width: 250px;
    }
}


/* ===== ELABORATE MINI-GAMES ===== */
#elaborate-modal .modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.elaborate-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

.elaborate-header h2 {
    margin: 0 0 10px 0;
    font-size: 2em;
}

.elaborate-header p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.9;
}

.elaborate-content {
    padding: 20px;
}

/* Drag and Drop Styles */
.parts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.draggable-part {
    padding: 15px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 10px;
    cursor: grab;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.draggable-part:active {
    cursor: grabbing;
}

.draggable-part.dragging {
    opacity: 0.5;
    transform: scale(0.95);
    background: transparent;
    border: 2px dashed #667eea;
}

.part-icon {
    display: block;
    font-size: 2em;
    margin-bottom: 5px;
}

.part-label {
    display: block;
    font-weight: bold;
    color: #333;
}

.matching-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.match-item {
    padding: 20px;
    background: white;
    border: 3px dashed #ccc;
    border-radius: 10px;
    min-height: 100px;
    transition: all 0.3s ease;
}

.match-item.drag-over {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: scale(1.02);
}

.match-item.correct {
    background: #e8f5e9;
    border: 3px solid #4caf50;
}

.match-item.incorrect {
    background: #ffebee;
    border: 3px solid #f44336;
    animation: shake 0.5s;
}

.match-placeholder {
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
    text-align: center;
    color: #999;
    margin-bottom: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-item p {
    margin: 0;
    color: #666;
    font-size: 0.95em;
}

.match-item .dropped-part {
    padding: 10px;
    background:  #f5f5f5;
    color: white;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 10px;
}

.dropped-part .part-icon {
    font-size: 1.5em;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Click and Submit Style Games */
.circle-diagram {
    width: 100%;
    max-width: 500px;
    height: 500px;
    margin: 0 auto 30px;
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.clickable-point {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #667eea;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.clickable-point:hover {
    transform: scale(1.2);
    background: #764ba2;
}

.clickable-point.selected {
    background: #4caf50;
    transform: scale(1.3);
}

.clickable-point.incorrect {
    background: #f44336;
    animation: shake 0.5s;
}

/* Input Form Styles */
.equation-input-container {
    display: grid;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.input-group {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: 'Krabby Patty', Arial, sans-serif;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Progress and Score */
.game-progress {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.game-progress h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.elaborate-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.elaborate-actions button {
    padding: 15px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Krabby Patty', Arial, sans-serif;
    transition: all 0.3s ease;
}

.btn-check {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-check:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-reset {
    background: #f44336;
    color: white;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.btn-continue {
    background: #4caf50;
    color: white;
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Completion Message */
.completion-message {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border-radius: 15px;
    color: white;
    margin: 20px 0;
}

.completion-message h2 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
}

.completion-message p {
    margin: 0;
    font-size: 1.2em;
}

.completion-message .xp-earned {
    font-size: 2em;
    font-weight: bold;
    margin: 20px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .parts-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .matching-container {
        grid-template-columns: 1fr;
    }
    
    .elaborate-actions {
        flex-direction: column;
    }
    
    .elaborate-actions button {
        width: 100%;
    }
    
    .circle-diagram {
        height: 400px;
    }
}
/* ===== EQUATION BUILDER (SETTING 3 ELABORATE) ===== */
.problem-statement {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}
 
.problem-statement h3 {
    margin: 0 0 10px 0;
    color: #667eea;
}
 
.equation-builder {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
 
.equation-builder h3 {
    margin: 0 0 15px 0;
    color: #333;
}
 
.equation-display {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 25px;
    background: #f0f4ff;
    border-radius: 10px;
    font-size: 1.5em;
    margin: 20px 0;
}
 
.equation-part {
    font-weight: bold;
    color: #333;
}
 
.equation-input {
    padding: 10px;
    font-size: 0.9em;
    border: 2px solid #667eea;
    border-radius: 5px;
    text-align: center;
    font-family: 'Krabby Patty', Arial, sans-serif;
    background: white;
}
 
.equation-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
}
 
input.equation-input {
    width: 80px;
}
 
select.equation-input {
    width: 60px;
    cursor: pointer;
}
 
.helper-section {
    margin-top: 25px;
}
 
.helper-box {
    background: #fff9e6;
    border-left: 4px solid #ffcc00;
    padding: 20px;
    border-radius: 8px;
}
 
.helper-box h4 {
    margin: 0 0 10px 0;
    color: #f57c00;
}
 
.helper-box ul {
    margin: 10px 0;
    padding-left: 20px;
}
 
.helper-box li {
    margin: 8px 0;
    line-height: 1.6;
}
 
.feedback-message {
    margin-top: 20px;
}
 
.feedback {
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
}
 
.feedback.success {
    background: #e8f5e9;
    border: 2px solid #4caf50;
    color: #2e7d32;
}
 
.feedback.error {
    background: #ffebee;
    border: 2px solid #f44336;
    color: #c62828;
}
 
.feedback.hint {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    color: #1565c0;
}
 
.feedback h3 {
    margin: 0 0 10px 0;
}
 
.feedback p {
    margin: 8px 0;
}
 
.feedback ul {
    margin: 10px 0;
    padding-left: 20px;
}
 
.feedback li {
    margin: 5px 0;
}
 
/* Mobile responsive for equation builder */
@media (max-width: 768px) {
    .equation-display {
        font-size: 1.2em;
        padding: 15px;
    }
    
    input.equation-input {
        width: 60px;
        padding: 8px;
    }
    
    select.equation-input {
        width: 50px;
        padding: 8px;
    }
}
