/* Mobile-First Responsive Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --font-size-base: 16px;
    --font-size-large: 20px;
    --font-size-small: 14px;
}

/* High Contrast Mode */
body.high-contrast {
    --bg-color: #000000;
    --text-color: #ffffff;
    --card-bg: #1a1a1a;
    --border-color: #ffffff;
    --primary-color: #00ffff;
    --secondary-color: #ffff00;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: var(--font-size-base);
    line-height: 1.6;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding: 1rem;
}

.screen.active {
    display: block;
}

/* Character Selection */
.character-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.character-card {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.character-card:hover,
.character-card:focus {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-color: var(--primary-color);
}

.character-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(243, 156, 18, 0.1));
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.3);
}

.character-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Character emoji replaced with ml-character-select */
.character-emoji {
    display: none;
}

.character-name {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.character-ability {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: var(--font-size-base);
}

.character-description {
    font-size: var(--font-size-small);
    color: #666;
    margin-top: 0.5rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    font-size: var(--font-size-base);
    color: #666;
    margin-bottom: 2rem;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Typography */
h1, h2, h3, h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.game-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: var(--font-size-base);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    font-size: var(--font-size-base);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-base);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-height: 44px; /* Touch target size */
    width: 100%;
    margin-bottom: 0.75rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #357abd;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #d68910;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover,
.btn-danger:focus {
    background-color: #c0392b;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-small);
    width: auto;
    margin: 0.25rem;
}

.button-group {
    margin-top: 2rem;
}

/* Game Header */
.game-header {
    background-color: var(--card-bg);
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.scoreboard-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 1rem;
    margin-bottom: 1rem;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    min-width: 80px;
}

.score-item .label {
    font-size: var(--font-size-small);
    color: #666;
}

.score-item span:last-child {
    font-size: var(--font-size-large);
    font-weight: bold;
    color: var(--primary-color);
}

.hero-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(243, 156, 18, 0.1));
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.selected-hero {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

/* Mobile Legends Style Character - Human Form */
.ml-character {
    position: relative;
    width: 60px;
    height: 80px;
    margin: 0 auto;
    --char-color: #4a90e2;
}

.ml-character .char-head {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ffdbac, #f4a460);
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.ml-character .char-head::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 3px;
    height: 3px;
    background: #000;
    border-radius: 50%;
    box-shadow: 8px 0 0 #000;
}

.ml-character .char-body {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 30px;
    background: linear-gradient(135deg, var(--char-color), var(--char-color)dd);
    border-radius: 12px 12px 8px 8px;
    border: 2px solid rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Mage Character - Special Fantasy Style */
.ml-character.mage-character .char-body {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 30%, #f4d03f 50%, #f39c12 70%, #9b59b6 100%);
    background-size: 200% 200%;
    animation: robeFlow 3s ease-in-out infinite;
    box-shadow: 
        0 0 10px rgba(155, 89, 182, 0.6),
        0 0 20px rgba(244, 208, 63, 0.4),
        inset 0 0 10px rgba(155, 89, 182, 0.3);
    position: relative;
    overflow: visible;
}

.ml-character.mage-character .char-body::before {
    content: '⚡';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #f4d03f;
    text-shadow: 0 0 5px #f4d03f;
    animation: runeGlow 2s ease-in-out infinite;
}

.ml-character.mage-character .char-body::after {
    content: '✦';
    position: absolute;
    top: 15px;
    left: 3px;
    font-size: 6px;
    color: #f4d03f;
    text-shadow: 0 0 4px #f4d03f;
    animation: runeGlow 2s ease-in-out infinite 0.5s;
}

/* Crystal Staff */
.ml-character.mage-character::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -12px;
    width: 4px;
    height: 35px;
    background: linear-gradient(to bottom, 
        #00bfff 0%, 
        #1e90ff 30%, 
        #87ceeb 60%, 
        #00bfff 100%);
    border-radius: 2px;
    box-shadow: 
        0 0 8px #00bfff,
        0 0 15px rgba(30, 144, 255, 0.6),
        inset 0 0 5px rgba(255, 255, 255, 0.5);
    animation: staffGlow 2s ease-in-out infinite;
    z-index: 5;
}

.ml-character.mage-character::before {
    content: '';
    position: absolute;
    top: 15px;
    right: -14px;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #00ffff 0%, #1e90ff 50%, transparent 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 10px #00ffff,
        0 0 20px rgba(30, 144, 255, 0.8);
    animation: crystalPulse 1.5s ease-in-out infinite;
    z-index: 6;
}

/* Flowing Robe Effect */
@keyframes robeFlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Glowing Runes */
@keyframes runeGlow {
    0%, 100% { 
        opacity: 0.6; 
        transform: translateX(-50%) scale(1);
    }
    50% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1.2);
    }
}

/* Crystal Staff Glow */
@keyframes staffGlow {
    0%, 100% { 
        box-shadow: 
            0 0 8px #00bfff,
            0 0 15px rgba(30, 144, 255, 0.6),
            inset 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% { 
        box-shadow: 
            0 0 15px #00bfff,
            0 0 25px rgba(30, 144, 255, 0.9),
            inset 0 0 8px rgba(255, 255, 255, 0.8);
    }
}

/* Crystal Pulse */
@keyframes crystalPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.3);
        opacity: 1;
    }
}

.ml-character .char-left-arm,
.ml-character .char-right-arm {
    position: absolute;
    top: 22px;
    width: 8px;
    height: 20px;
    background: linear-gradient(135deg, var(--char-color), var(--char-color)dd);
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.2);
}

.ml-character .char-left-arm {
    left: 8px;
    transform: rotate(-20deg);
}

.ml-character .char-right-arm {
    right: 8px;
    transform: rotate(20deg);
}

.ml-character .char-left-leg,
.ml-character .char-right-leg {
    position: absolute;
    top: 46px;
    width: 10px;
    height: 22px;
    background: linear-gradient(135deg, var(--char-color), var(--char-color)dd);
    border-radius: 5px 5px 8px 8px;
    border: 1px solid rgba(0,0,0,0.2);
}

.ml-character .char-left-leg {
    left: 16px;
}

.ml-character .char-right-leg {
    right: 16px;
}

/* Small character for header */
.ml-character-small {
    position: relative;
    width: 30px;
    height: 40px;
    --char-color: #4a90e2;
}

.ml-character-small .char-head-small {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #ffdbac, #f4a460);
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.2);
}

.ml-character-small .char-body-small {
    position: absolute;
    top: 9px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 15px;
    background: linear-gradient(135deg, var(--char-color), var(--char-color)dd);
    border-radius: 6px 6px 4px 4px;
    border: 1px solid rgba(0,0,0,0.2);
}

/* Character for selection */
.ml-character-select {
    position: relative;
    width: 80px;
    height: 100px;
    margin: 0 auto;
    --char-color: #4a90e2;
}

.ml-character-select .char-head-select {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ffdbac, #f4a460);
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.ml-character-select .char-head-select::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 4px;
    height: 4px;
    background: #000;
    border-radius: 50%;
    box-shadow: 10px 0 0 #000;
}

.ml-character-select .char-body-select {
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 40px;
    background: linear-gradient(135deg, var(--char-color), var(--char-color)dd);
    border-radius: 16px 16px 10px 10px;
    border: 2px solid rgba(0,0,0,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Mage Character Select - Special Styling */
.ml-character-select.mage-character .char-body-select {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 30%, #f4d03f 50%, #f39c12 70%, #9b59b6 100%);
    background-size: 200% 200%;
    animation: robeFlow 3s ease-in-out infinite;
    box-shadow: 
        0 0 15px rgba(155, 89, 182, 0.7),
        0 0 25px rgba(244, 208, 63, 0.5),
        inset 0 0 15px rgba(155, 89, 182, 0.4);
    position: relative;
    overflow: visible;
}

.ml-character-select.mage-character .char-body-select::before {
    content: '⚡';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #f4d03f;
    text-shadow: 0 0 8px #f4d03f;
    animation: runeGlow 2s ease-in-out infinite;
}

.ml-character-select.mage-character .char-body-select::after {
    content: '✦';
    position: absolute;
    top: 20px;
    left: 4px;
    font-size: 8px;
    color: #f4d03f;
    text-shadow: 0 0 6px #f4d03f;
    animation: runeGlow 2s ease-in-out infinite 0.5s;
}

.ml-character-select.mage-character::after {
    content: '';
    position: absolute;
    top: 30px;
    right: -15px;
    width: 5px;
    height: 45px;
    background: linear-gradient(to bottom, 
        #00bfff 0%, 
        #1e90ff 30%, 
        #87ceeb 60%, 
        #00bfff 100%);
    border-radius: 3px;
    box-shadow: 
        0 0 10px #00bfff,
        0 0 20px rgba(30, 144, 255, 0.7),
        inset 0 0 8px rgba(255, 255, 255, 0.6);
    animation: staffGlow 2s ease-in-out infinite;
    z-index: 5;
}

.ml-character-select.mage-character::before {
    content: '';
    position: absolute;
    top: 25px;
    right: -17px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #00ffff 0%, #1e90ff 50%, transparent 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 12px #00ffff,
        0 0 25px rgba(30, 144, 255, 0.9);
    animation: crystalPulse 1.5s ease-in-out infinite;
    z-index: 6;
}

.ml-character-select .char-left-arm-select,
.ml-character-select .char-right-arm-select {
    position: absolute;
    top: 30px;
    width: 10px;
    height: 26px;
    background: linear-gradient(135deg, var(--char-color), var(--char-color)dd);
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.2);
}

.ml-character-select .char-left-arm-select {
    left: 10px;
    transform: rotate(-20deg);
}

.ml-character-select .char-right-arm-select {
    right: 10px;
    transform: rotate(20deg);
}

.ml-character-select .char-left-leg-select,
.ml-character-select .char-right-leg-select {
    position: absolute;
    top: 64px;
    width: 12px;
    height: 28px;
    background: linear-gradient(135deg, var(--char-color), var(--char-color)dd);
    border-radius: 6px 6px 10px 10px;
    border: 1px solid rgba(0,0,0,0.2);
}

.ml-character-select .char-left-leg-select {
    left: 20px;
}

.ml-character-select .char-right-leg-select {
    right: 20px;
}

/* Enemy character styling - Animal Form */
.enemy-character-map,
.enemy-character-battle {
    --char-color: #8B4513;
}

/* Animal Enemy Styles */
.ml-character.enemy-animal {
    position: relative;
}

.ml-character.enemy-animal .char-head {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--char-color), #654321);
    border-radius: 50% 50% 45% 45%;
    position: relative;
}

/* Wolf Enemy */
.ml-character.enemy-animal.wolf .char-head {
    background: linear-gradient(135deg, #8B4513, #654321);
    border-radius: 50% 50% 40% 40%;
    position: relative;
}

.ml-character.enemy-animal.wolf .char-head::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 6px;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 8px 0 0 #fff;
}

.ml-character.enemy-animal.wolf .char-head::after {
    content: '🐺';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    z-index: 2;
}

.ml-character.enemy-animal.wolf .char-body {
    background: linear-gradient(135deg, #8B4513, #654321);
    width: 28px;
    height: 35px;
    border-radius: 14px 14px 10px 10px;
}

/* Dragon Enemy */
.ml-character.enemy-animal.dragon .char-head {
    background: linear-gradient(135deg, #DC143C, #B22222);
    border-radius: 50% 50% 40% 40%;
}

.ml-character.enemy-animal.dragon .char-head::before {
    content: '🐲';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    z-index: 2;
}

.ml-character.enemy-animal.dragon .char-body {
    background: linear-gradient(135deg, #DC143C, #B22222);
    width: 30px;
    height: 40px;
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.6);
}

/* Witch Enemy - Cat Form */
.ml-character.enemy-animal.witch .char-head {
    background: linear-gradient(135deg, #7B2CBF, #5B189B);
    border-radius: 50% 50% 45% 45%;
}

.ml-character.enemy-animal.witch .char-head::before {
    content: '🐱';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    z-index: 2;
}

.ml-character.enemy-animal.witch .char-body {
    background: linear-gradient(135deg, #7B2CBF, #5B189B);
    width: 28px;
    height: 38px;
    box-shadow: 0 0 12px rgba(123, 44, 191, 0.5);
}

/* Troll Enemy - Bear Form */
.ml-character.enemy-animal.troll .char-head {
    background: linear-gradient(135deg, #2F4F2F, #1e3e1e);
    border-radius: 50% 50% 45% 45%;
}

.ml-character.enemy-animal.troll .char-head::before {
    content: '🐻';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    z-index: 2;
}

.ml-character.enemy-animal.troll .char-body {
    background: linear-gradient(135deg, #2F4F2F, #1e3e1e);
    width: 32px;
    height: 42px;
}

/* Queen Enemy - Snake Form */
.ml-character.enemy-animal.queen .char-head {
    background: linear-gradient(135deg, #8B008B, #6A006A);
    border-radius: 50% 50% 45% 45%;
}

.ml-character.enemy-animal.queen .char-head::before {
    content: '🐍';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    z-index: 2;
}

.ml-character.enemy-animal.queen .char-body {
    background: linear-gradient(135deg, #8B008B, #6A006A);
    width: 28px;
    height: 50px;
    border-radius: 14px;
}

/* Wizard Enemy - Owl Form */
.ml-character.enemy-animal.wizard .char-head {
    background: linear-gradient(135deg, #4B0082, #3A0069);
    border-radius: 50% 50% 45% 45%;
}

.ml-character.enemy-animal.wizard .char-head::before {
    content: '🦉';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    z-index: 2;
}

.ml-character.enemy-animal.wizard .char-body {
    background: linear-gradient(135deg, #4B0082, #3A0069);
    width: 30px;
    height: 40px;
    box-shadow: 0 0 15px rgba(75, 0, 130, 0.6);
}

/* Goblin Enemy - Monkey Form */
.ml-character.enemy-animal.goblin .char-head {
    background: linear-gradient(135deg, #FF6347, #FF4500);
    border-radius: 50% 50% 45% 45%;
}

.ml-character.enemy-animal.goblin .char-head::before {
    content: '🐵';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    z-index: 2;
}

.ml-character.enemy-animal.goblin .char-body {
    background: linear-gradient(135deg, #FF6347, #FF4500);
    width: 28px;
    height: 38px;
}

/* Shadow Enemy - Bat Form */
.ml-character.enemy-animal.shadow .char-head {
    background: linear-gradient(135deg, #000000, #1a1a1a);
    border-radius: 50% 50% 45% 45%;
}

.ml-character.enemy-animal.shadow .char-head::before {
    content: '🦇';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    z-index: 2;
}

.ml-character.enemy-animal.shadow .char-body {
    background: linear-gradient(135deg, #000000, #1a1a1a);
    width: 28px;
    height: 35px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.hero-icon-small {
    font-size: 1.5rem;
}

.hero-name-small {
    font-weight: bold;
    font-size: var(--font-size-base);
    color: var(--primary-color);
}

.mission-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px solid var(--secondary-color);
}

.mission-icon {
    font-size: 1.5rem;
}

.mission-text {
    font-weight: bold;
    font-size: var(--font-size-base);
    color: var(--secondary-color);
}

.game-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Jungle Map Scene */
.jungle-map {
    background: linear-gradient(to bottom, #87CEEB 0%, #98D8C8 30%, #228B22 50%, #2F4F2F 100%);
    padding: 2rem 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.jungle-background {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.jungle-trees {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: 
        repeating-linear-gradient(90deg, 
            transparent 0px, 
            transparent 60px, 
            rgba(34, 139, 34, 0.3) 60px, 
            rgba(34, 139, 34, 0.3) 80px
        ),
        radial-gradient(ellipse at 20% 50%, rgba(34, 139, 34, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(34, 139, 34, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(34, 139, 34, 0.4) 0%, transparent 50%);
    z-index: 1;
}

.jungle-ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, #8B7355, #654321, #3E2723);
    z-index: 2;
}

.jungle-path {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, 
        rgba(139, 115, 85, 0.8) 0%, 
        rgba(101, 67, 33, 0.9) 50%, 
        rgba(62, 39, 35, 1) 100%);
    z-index: 3;
    border-top: 2px solid rgba(139, 115, 85, 0.5);
    border-bottom: 2px solid rgba(62, 39, 35, 0.5);
}

.hero-on-map,
.enemy-on-map {
    position: absolute;
    bottom: 100px;
    width: 80px;
    height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    animation: characterBounce 2s infinite;
}

@keyframes characterBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.hero-on-map {
    left: 10%;
}

.enemy-on-map {
    right: 10%;
    background: linear-gradient(135deg, #8B4513, #654321);
    box-shadow: 0 0 20px rgba(139, 69, 19, 0.6);
}

/* Characters on map use ml-character styling */
.hero-on-map .ml-character,
.enemy-on-map .ml-character {
    width: 70px;
    height: 90px;
}

.hero-on-map .ml-character .char-head,
.enemy-on-map .ml-character .char-head {
    width: 24px;
    height: 24px;
}

.hero-on-map .ml-character .char-body,
.enemy-on-map .ml-character .char-body {
    width: 28px;
    height: 35px;
    top: 22px;
}

.hero-on-map .ml-character .char-left-arm,
.hero-on-map .ml-character .char-right-arm,
.enemy-on-map .ml-character .char-left-arm,
.enemy-on-map .ml-character .char-right-arm {
    width: 10px;
    height: 24px;
    top: 26px;
}

.hero-on-map .ml-character .char-left-leg,
.hero-on-map .ml-character .char-right-leg,
.enemy-on-map .ml-character .char-left-leg,
.enemy-on-map .ml-character .char-right-leg {
    width: 12px;
    height: 26px;
    top: 54px;
}

.hero-name-map,
.enemy-name-map {
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.map-message {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
}

/* Battle Scene - Mobile Legends Style */
.battle-scene {
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    padding: 2rem 1rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.battle-scene.jungle-battle {
    background: linear-gradient(to bottom, 
        rgba(135, 206, 235, 0.2) 0%, 
        rgba(152, 216, 200, 0.3) 30%, 
        rgba(34, 139, 34, 0.4) 50%, 
        rgba(47, 79, 47, 0.6) 100%),
        linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
}

.battle-scene::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(74, 144, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(231, 76, 60, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Mystical Battlefield Background for Mage */
.battle-scene.has-mage::before {
    content: '✧ ✦ ✧ ✦ ✧';
    position: absolute;
    top: 20%;
    left: 10%;
    font-size: 20px;
    color: rgba(244, 208, 63, 0.3);
    text-shadow: 0 0 10px rgba(244, 208, 63, 0.5);
    animation: floatSymbol 4s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
    background: none;
}

.battle-scene.has-mage::after {
    content: '✦ ✧ ✦ ✧';
    position: absolute;
    top: 60%;
    right: 15%;
    font-size: 18px;
    color: rgba(155, 89, 182, 0.4);
    text-shadow: 0 0 10px rgba(155, 89, 182, 0.6);
    animation: floatSymbol 4s ease-in-out infinite 2s;
    z-index: 1;
    pointer-events: none;
}

@keyframes floatSymbol {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
}

.battle-lane {
    position: relative;
    height: 200px;
    margin: 2rem 0;
    background: linear-gradient(to bottom, 
        rgba(22, 33, 62, 0.8) 0%, 
        rgba(15, 52, 96, 0.6) 50%, 
        rgba(22, 33, 62, 0.8) 100%);
    border: 2px solid rgba(74, 144, 226, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.battle-lane.jungle-battle {
    background: 
        linear-gradient(to bottom, 
            rgba(34, 139, 34, 0.3) 0%, 
            rgba(47, 79, 47, 0.5) 50%, 
            rgba(62, 39, 35, 0.7) 100%),
        linear-gradient(to bottom, 
            rgba(22, 33, 62, 0.8) 0%, 
            rgba(15, 52, 96, 0.6) 50%, 
            rgba(22, 33, 62, 0.8) 100%);
    border: 2px solid rgba(34, 139, 34, 0.5);
}

.battle-lane::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, 
        transparent, 
        rgba(74, 144, 226, 0.5), 
        rgba(231, 76, 60, 0.5), 
        transparent);
    transform: translateY(-50%);
}

.hero-character,
.enemy-character {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.hero-character {
    left: 10%;
    animation: heroPulse 2s infinite;
}

.enemy-character {
    right: 10%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.6);
    animation: enemyPulse 2s infinite;
}

@keyframes heroPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(74, 144, 226, 0.6); }
    50% { box-shadow: 0 0 30px rgba(74, 144, 226, 0.9); }
}

@keyframes enemyPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(231, 76, 60, 0.6); }
    50% { box-shadow: 0 0 30px rgba(231, 76, 60, 0.9); }
}

.hero-icon,
.enemy-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.hero-name,
.enemy-name {
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.battle-progress {
    margin-top: 1.5rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(74, 144, 226, 0.3);
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a90e2, #27ae60);
    transition: width 1s ease-out, background-color 0.5s ease;
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

.battle-message {
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    animation: messageFlash 0.5s ease;
}

@keyframes messageFlash {
    0% { opacity: 0.5; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* Level Map */
.level-map {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.level-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.level-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.level-card:hover,
.level-card:focus {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border-color: white;
}

.level-card.completed {
    background: linear-gradient(135deg, var(--success-color), #2ecc71);
}

.level-card.locked {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Panels */
.panel {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.passage-container {
    background-color: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    font-size: var(--font-size-base);
    line-height: 1.8;
}

.passage-container #continue-reading-btn {
    margin-top: 1.5rem;
    width: 100%;
}

/* Questions */
.question-item {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.question-text {
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: var(--font-size-base);
}

.mcq-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mcq-option {
    padding: 0.75rem;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: var(--font-size-base);
}

.mcq-option:hover,
.mcq-option:focus {
    border-color: var(--primary-color);
    background-color: #e8f4f8;
}

.mcq-option.selected {
    border-color: var(--primary-color);
    background-color: #d4e8f1;
}

.mcq-option.correct {
    border-color: var(--success-color);
    background-color: #d4edda;
}

.mcq-option.incorrect {
    border-color: var(--danger-color);
    background-color: #f8d7da;
}

.short-answer-input {
    width: 100%;
    padding: 0.75rem;
    font-size: var(--font-size-base);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.short-answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Email Panel */
.email-prompt {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.model-email {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #e8f4f8;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.email-example p {
    margin: 0.5rem 0;
}

.email-example strong {
    color: var(--primary-color);
}

.email-editor {
    margin: 1rem 0;
}

#email-textarea {
    width: 100%;
    padding: 1rem;
    font-size: var(--font-size-base);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
}

#email-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.email-tips {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #fff3cd;
    border-radius: 8px;
    font-size: var(--font-size-small);
}

/* Mini-Battle */
.battle-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.timer {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--danger-color);
    margin: 1rem 0;
}

.battle-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.battle-choice {
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: var(--font-size-base);
    font-weight: bold;
    transition: all 0.3s ease;
}

.battle-choice:hover,
.battle-choice:focus {
    background-color: #357abd;
    transform: scale(1.05);
}

.battle-choice.correct {
    background-color: var(--success-color);
}

.battle-choice.incorrect {
    background-color: var(--danger-color);
}

.battle-result {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-weight: bold;
}

.battle-result.success {
    background-color: #d4edda;
    color: var(--success-color);
}

.battle-result.failure {
    background-color: #f8d7da;
    color: var(--danger-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
    padding: 1rem;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: var(--danger-color);
}

/* Leaderboard */
#leaderboard-list {
    margin: 1.5rem 0;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.leaderboard-rank {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary-color);
    min-width: 40px;
}

.leaderboard-info {
    flex: 1;
    margin-left: 1rem;
}

.leaderboard-name {
    font-weight: bold;
    font-size: var(--font-size-base);
}

.leaderboard-class {
    font-size: var(--font-size-small);
    color: #666;
}

.leaderboard-score {
    font-weight: bold;
    font-size: var(--font-size-large);
    color: var(--secondary-color);
}

.leaderboard-date {
    font-size: var(--font-size-small);
    color: #666;
    margin-top: 0.25rem;
}

/* Results */
.result-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.result-label {
    font-weight: bold;
}

.feedback-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 8px;
}

.feedback-section ul {
    list-style-position: inside;
    margin-top: 0.5rem;
}

.feedback-section li {
    margin: 0.5rem 0;
}

/* Instructions */
.instructions-text {
    margin-top: 1rem;
}

.instructions-text ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.instructions-text li {
    margin: 0.5rem 0;
}

/* Feedback Messages */
.feedback-message {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-weight: bold;
}

.feedback-message.success {
    background-color: #d4edda;
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.feedback-message.error {
    background-color: #f8d7da;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
}

.feedback-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 2px solid #0c5460;
}

/* Responsive Design - Mobile */
@media (max-width: 767px) {
    .character-list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .character-card {
        padding: 1rem;
    }
    
    .character-icon {
        width: 80px;
        height: 80px;
    }
    
    .character-emoji {
        font-size: 2rem;
    }
    
    .hero-display {
        flex-direction: column;
        align-items: stretch;
    }
    
    .mission-display {
        flex: 1;
        width: 100%;
    }
    
    .battle-scene {
        padding: 1rem 0.5rem;
        min-height: 250px;
    }
    
    .battle-lane {
        height: 150px;
        margin: 1rem 0;
    }
    
    .hero-character,
    .enemy-character {
        width: 60px;
        height: 60px;
    }
    
    .hero-icon,
    .enemy-icon {
        font-size: 1.5rem;
    }
    
    .battle-message {
        font-size: 1rem;
    }
}

/* Responsive Design - Tablet and Desktop */
@media (min-width: 768px) {
    .container {
        padding: 3rem 2rem;
    }

    .game-title {
        font-size: 2.5rem;
    }

    .btn {
        width: auto;
        min-width: 150px;
        margin-right: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .button-group {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }

    .scoreboard-bar {
        flex-wrap: nowrap;
    }

    .level-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .mcq-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .battle-choices {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .game-content {
        display: grid;
        grid-template-columns: 300px 1fr;
        gap: 1.5rem;
    }

    .level-map {
        position: sticky;
        top: 1rem;
        height: fit-content;
    }
}

/* Accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .game-header,
    .game-controls,
    .btn {
        display: none;
    }
}

