:root {
    --primary: #0077ff;
    --primary-light: #3399ff;
    --secondary: #1a1a24;
    --accent: #ff7700;
    --dark: #0a0a0f;
    --light: #2a2a35;
    --white: #FFFFFF;
    --success: #55aa55;
    --warning: #ffaa00;

    --shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    --shadow-hover: 2px 2px 0px rgba(0, 0, 0, 0.5);
    --radius: 0px;

    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Orbitron', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ar);
    background-color: #0b1a0e;
    color: var(--white);
    line-height: 1.6;
    background-image: 
        /* Hexagonal Grid Effect */
        linear-gradient(30deg, transparent 48%, rgba(0, 119, 255, 0.1) 48%, rgba(0, 119, 255, 0.1) 52%, transparent 52%),
        linear-gradient(-30deg, transparent 48%, rgba(0, 119, 255, 0.1) 48%, rgba(0, 119, 255, 0.1) 52%, transparent 52%),
        linear-gradient(90deg, transparent 48%, rgba(0, 119, 255, 0.1) 48%, rgba(0, 119, 255, 0.1) 52%, transparent 52%),
        /* Grass Stripes */
        repeating-linear-gradient(90deg, rgba(25, 60, 25, 0.8) 0px, rgba(25, 60, 25, 0.8) 50px, rgba(30, 70, 30, 0.8) 50px, rgba(30, 70, 30, 0.8) 100px);
    background-size: 60px 104.4px, 60px 104.4px, 100% 104.4px, 100px 100%;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Typography */
.en-text {
    font-family: var(--font-en);
    direction: ltr;
    display: inline-block;
    font-size: 0.8em;
}

/* Header */
.app-header {
    background-color: #111;
    background-image: repeating-linear-gradient(45deg, #000 0px, #000 10px, #1a1a1a 10px, #1a1a1a 20px);
    border: 4px solid #333;
    border-radius: 0 0 20px 20px;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0, 119, 255, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-en);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--white);
    text-shadow: 0 0 10px var(--primary), 0 0 20px var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-style: italic;
}

.logo span {
    color: var(--accent);
    font-weight: 700;
    text-shadow: 0 0 10px var(--accent);
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

.home-btn,
.back-btn {
    background: transparent;
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: 0;
    font-weight: 900;
    border: none;
    transition: all 0.2s;
    text-shadow: none;
    font-family: var(--font-en);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.home-btn::before, .back-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, var(--primary), #0055cc);
    border: 2px solid var(--primary-light);
    box-shadow: 0 0 15px rgba(0, 119, 255, 0.6);
    transform: skewX(-15deg);
    z-index: -1;
    transition: all 0.2s;
}

.home-btn::after, .back-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
    z-index: -1;
    transform: skewX(-15deg);
}

.home-btn:hover::after, .back-btn:hover::after {
    left: 100%;
}

.home-btn:hover,
.back-btn:hover {
    transform: translateY(-2px);
    color: #fff;
}

.home-btn:hover::before, .back-btn:hover::before {
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    box-shadow: 0 0 25px rgba(0, 119, 255, 0.9);
    border-color: #fff;
}

/* Main Container */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard */
.main-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    font-weight: 900;
}

.subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 1px 1px 0px #333;
    margin-bottom: 3rem;
    font-weight: 700;
}

.book-selection-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.book-card {
    width: 300px;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #1f2326, #111314);
    border: 3px solid #444;
    border-top: 3px solid var(--primary);
    border-bottom: 3px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Carbon Fiber Texture */
    background:
        radial-gradient(black 15%, transparent 16%) 0 0,
        radial-gradient(black 15%, transparent 16%) 8px 8px,
        radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 0 1px,
        radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 8px 9px;
    background-color: #282828;
    background-size: 16px 16px;
    opacity: 0.3;
    pointer-events: none;
}

.book-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9), 0 0 20px var(--primary), inset 0 0 20px var(--accent);
    border-color: #fff;
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.book-card h2 {
    font-family: var(--font-en);
    color: var(--white);
    text-shadow: 0 0 5px var(--primary);
    margin-bottom: 0.5rem;
}

.book-card p {
    color: var(--accent);
    font-weight: 900;
    text-shadow: 0 0 5px var(--accent);
}

/* Units View */
.view-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed #eee;
}

.units-container {
    display: block;
    width: 100%;
}

.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.unit-card {
    background: linear-gradient(135deg, #1f2326, #111314);
    border: 2px solid #444;
    border-right: 4px solid var(--primary);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
}

.unit-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Carbon Fiber Texture */
    background:
        radial-gradient(black 15%, transparent 16%) 0 0,
        radial-gradient(black 15%, transparent 16%) 8px 8px,
        radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 0 1px,
        radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 8px 9px;
    background-color: #282828;
    background-size: 16px 16px;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.unit-card > * {
    z-index: 1;
}

.unit-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8), inset -50px 0 50px rgba(0, 119, 255, 0.1);
    border-color: #fff;
    border-right-color: var(--accent);
}

.unit-title {
    font-family: var(--font-en);
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--white);
    text-shadow: 0 0 5px var(--primary);
}

/* Lesson Car Shaped Buttons */
.lesson-car-btn {
    position: relative;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 10px;
}

.lesson-car-btn:hover {
    transform: scale(1.1) translateY(-5px);
}

.lesson-car-btn svg {
    width: 100%;
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.6));
    z-index: 1;
}

.lesson-car-btn .content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    margin-top: -10px;
    padding: 5px 20px;
    background: linear-gradient(135deg, rgba(30,30,40,0.9), rgba(10,10,15,0.9));
    border-radius: 20px;
    border: 2px solid var(--accent);
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
}

.lesson-car-btn .content .unit-title {
    margin-bottom: 0;
    font-size: 1.2rem;
    text-shadow: 0 0 5px var(--accent);
}

/* Unit Grouping */
.unit-section-group {
    margin-bottom: 3rem;
    width: 100%;
    grid-column: 1 / -1;
}

.unit-main-title {
    font-size: 1.8rem;
    color: var(--white);
    margin: 2rem 0 1.5rem 0;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(90deg, #111, transparent);
    border-radius: 5px;
    display: inline-block;
    border-right: 8px solid var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.lessons-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}

/* Lesson Content Layout */
.lesson-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.lesson-section {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.section-title {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 25px;
    background: var(--accent);
    border-radius: 4px;
}

/* Clickable Text for TTS */
.clickable-text {
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: inline-block;
}

.clickable-text:hover {
    color: var(--primary);
    background: rgba(108, 92, 231, 0.1);
    border-radius: 5px;
    padding: 0 5px;
}

.clickable-text::after {
    content: '🔊';
    font-size: 0.8em;
    margin-left: 5px;
    opacity: 0.5;
}

/* Characters Section */
.characters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media(min-width: 768px) {
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.char-card {
    display: flex;
    background: var(--light);
    border-radius: 15px;
    padding: 1.5rem;
    gap: 1rem;
    border: 1px solid #eee;
}

.char-bubble {
    background: var(--white);
    padding: 1rem;
    border-radius: 15px;
    border-top-left-radius: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    flex: 1;
}

.char-text {
    font-family: var(--font-en);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

/* Vocabulary Grid */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.vocab-item {
    background: var(--primary-light);
    color: var(--white);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.vocab-item:hover,
.vocab-item.clickable-text:hover {
    transform: scale(1.05);
    background: var(--primary);
    color: var(--white);
}

.vocab-en {
    font-family: var(--font-en);
    font-weight: 800;
}

.vocab-ar {
    font-weight: 700;
}

/* Grammar Tables */
.grammar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.grammar-table th,
.grammar-table td {
    padding: 1rem;
    border: 1px solid #eee;
    text-align: right;
}

.grammar-table th {
    background: var(--secondary);
    color: var(--white);
}

.grammar-example {
    background: var(--light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-right: 4px solid var(--accent);
}

/* Quiz Section */
.quiz-question {
    margin-bottom: 2rem;
    background: var(--light);
    padding: 1.5rem;
    border-radius: 10px;
}

.q-text {
    font-family: var(--font-en);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    direction: ltr;
}

.q-options {
    display: flex;
    gap: 1rem;
    direction: ltr;
}

.q-option {
    background: var(--white);
    border: 2px solid var(--primary-light);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-en);
    font-weight: 700;
    color: var(--primary);
}

.q-option:hover {
    background: var(--primary-light);
    color: var(--white);
}

.q-option.correct {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.q-option.wrong {
    background: #FF7675;
    border-color: #FF7675;
    color: var(--white);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 52, 54, 0.95);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.2rem;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

    /* Games Menu */
    .game-card {
        background: rgba(42, 42, 53, 0.8);
        border: 2px solid var(--accent);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(255, 119, 0, 0.2);
        padding: 2rem;
        text-align: center;
        border-radius: 15px;
        cursor: pointer;
        transition: transform 0.3s, box-shadow 0.3s;
        color: white;
    }

    .game-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 40px rgba(255, 119, 0, 0.4), inset 0 0 30px rgba(255, 119, 0, 0.4);
        border-color: #ff9933;
    }

    .game-card h3 {
        color: var(--accent);
        text-shadow: 0 0 10px var(--accent);
        margin-bottom: 1rem;
        font-size: 1.5rem;
    }

    .game-card .icon {
        font-size: 4rem;
    }

    /* Games Canvas UI */
    .game-area {
        background: radial-gradient(circle at center, #1a1a24, #0a0a0f);
        border: 4px solid var(--primary);
        border-radius: 15px;
        min-height: 400px;
        position: relative;
        overflow: hidden;
        padding: 2rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        box-shadow: 0 0 30px rgba(0, 119, 255, 0.3), inset 0 0 50px rgba(0, 0, 0, 0.8);
    }

    .game-hud {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 2rem;
    }

    .game-hearts {
        color: #ff5555;
        font-size: 1.5rem;
        text-shadow: 2px 2px 0px #550000;
    }

    .game-diamonds {
        color: #55ffff;
        font-size: 1.5rem;
        text-shadow: 2px 2px 0px #005555;
    }

    .game-question {
        font-family: var(--font-en);
        font-size: 1.5rem;
        color: white;
        background: rgba(0, 0, 0, 0.7);
        padding: 1rem 2rem;
        border-radius: 10px;
        border: 3px solid #fff;
        text-align: center;
        margin-bottom: 3rem;
        direction: ltr;
    }
    /* Boost Collection Game (formerly Mining) */
    .boost-container {
        display: flex;
        gap: 2rem;
        justify-content: center;
        position: relative;
    }

    .boost-pad {
        width: 120px;
        height: 120px;
        background: radial-gradient(circle, rgba(0, 119, 255, 0.2) 0%, rgba(0, 20, 50, 0.8) 100%);
        border: 4px solid #00aaff;
        border-radius: 50%;
        box-shadow: 0 0 20px #00aaff, inset 0 0 20px #00aaff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s, border-color 0.2s;
        position: relative;
    }

    .boost-pad:hover {
        transform: scale(1.1);
        border-color: #00ffff;
        box-shadow: 0 0 30px #00ffff, inset 0 0 30px #00ffff;
    }

    .boost-orb {
        font-size: 2.5rem;
        text-shadow: 0 0 10px #00ffff;
        animation: floatOrb 2s infinite ease-in-out;
    }

    .boost-text {
        font-family: var(--font-en);
        font-size: 1.2rem;
        font-weight: bold;
        color: white;
        margin-top: 5px;
        text-shadow: 0 0 5px #00aaff;
    }

    @keyframes floatOrb {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }

    .boost-pad.collected {
        transform: scale(1.3);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease-out;
    }

    .boost-pad.wrong-shake {
        animation: shake 0.3s;
        border-color: #ff0000;
        box-shadow: 0 0 15px red;
    }

    .boost-particle {
        position: absolute;
        width: 10px;
        height: 10px;
        background: #00ffff;
        border-radius: 50%;
        box-shadow: 0 0 15px #00ffff;
        pointer-events: none;
        animation: flyOut 0.8s forwards cubic-bezier(0.25, 1, 0.5, 1);
    }

    @keyframes flyOut {
        0% { opacity: 1; transform: translate(0, 0) scale(1); }
        100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); }
    }

    @keyframes shake {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-10px); }
        50% { transform: translateX(10px); }
        75% { transform: translateX(-10px); }
    }

    /* Striking Game (formerly Archery) */
    .goals-container {
        display: flex;
        gap: 2rem;
        justify-content: space-around;
        width: 100%;
        position: relative;
        padding-top: 2rem;
    }

    .rl-goal {
        width: 140px;
        height: 100px;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 119, 255, 0.4));
        border: 4px solid #fff;
        border-bottom: none;
        border-radius: 10px 10px 0 0;
        position: relative;
        cursor: crosshair;
        box-shadow: 0 0 20px rgba(0, 119, 255, 0.5), inset 0 0 20px rgba(0, 119, 255, 0.3);
        display: flex;
        justify-content: center;
        align-items: center;
        animation: floatGoal 3s infinite alternate ease-in-out;
    }

    .goal-net {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background-image: linear-gradient(45deg, transparent 48%, rgba(255,255,255,0.3) 50%, transparent 52%), linear-gradient(-45deg, transparent 48%, rgba(255,255,255,0.3) 50%, transparent 52%);
        background-size: 15px 15px;
        z-index: 1;
        border-radius: 6px 6px 0 0;
    }

    @keyframes floatGoal {
        from { transform: translateY(-10px); }
        to { transform: translateY(10px); }
    }

    .goal-option {
        position: relative;
        z-index: 2;
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
        font-family: var(--font-en);
        font-weight: bold;
        font-size: 1.2rem;
        padding: 5px 15px;
        border: 2px solid #00aaff;
        border-radius: 8px;
        box-shadow: 0 0 10px #00aaff;
        text-align: center;
    }

    .rl-goal:hover {
        border-color: #00ffff;
        box-shadow: 0 0 30px #00ffff, inset 0 0 30px rgba(0,255,255,0.5);
    }
    .rl-goal:hover .goal-option {
        border-color: #00ffff;
        box-shadow: 0 0 15px #00ffff;
    }

    .rl-goal.goal-scored {
        animation: goalFlash 0.5s forwards;
        pointer-events: none;
    }

    @keyframes goalFlash {
        0% { filter: brightness(1); transform: scale(1); }
        50% { filter: brightness(3) hue-rotate(90deg); transform: scale(1.1); }
        100% { filter: brightness(1); transform: scale(1); opacity: 0.5; }
    }

    .goal-explosion {
        position: absolute;
        z-index: 10;
        font-size: 2rem;
        font-family: var(--font-en);
        font-weight: 900;
        color: #fff;
        text-shadow: 0 0 20px #ff0055, 0 0 40px #ff0055;
        animation: explodeUp 1s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes explodeUp {
        0% { transform: scale(0) translateY(20px); opacity: 1; }
        100% { transform: scale(1.5) translateY(-50px); opacity: 0; }
    }

    .rl-ball-projectile {
        position: absolute;
        font-size: 2.5rem;
        z-index: 100;
        pointer-events: none;
        transition: left 0.4s cubic-bezier(0.3, 0.1, 0.3, 1), top 0.4s cubic-bezier(0.3, 0.1, 0.3, 1), transform 0.4s;
        filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
    }

    .player-striker-car {
        font-size: 4rem;
        text-align: center;
        margin-top: 2rem;
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        filter: drop-shadow(0 10px 10px rgba(0,0,0,0.6));
    }

    /* Dribbling Game (formerly Parkour) */
    .dribbling-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        height: 300px;
        position: relative;
        padding-bottom: 40px;
        overflow: hidden;
    }

    .field-grass {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100px;
        background: linear-gradient(180deg, #1f6c24, #124015);
        border-top: 3px solid #33aa3a;
        box-shadow: 0 0 20px rgba(51, 170, 58, 0.4);
        z-index: 5;
    }

    .field-line {
        position: absolute;
        bottom: 0;
        width: 4px;
        height: 100%;
        background: rgba(255, 255, 255, 0.3);
    }

    .player-dribbler {
        font-size: 3.5rem;
        position: absolute;
        z-index: 10;
        transform-origin: bottom center;
        animation: engineIdle 0.5s infinite alternate;
        filter: drop-shadow(0 10px 5px rgba(0,0,0,0.5));
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .dribble-ball {
        font-size: 1.5rem;
        animation: rollBall 1s infinite linear;
    }

    @keyframes rollBall {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }

    @keyframes engineIdle {
        from { transform: translateY(0); }
        to { transform: translateY(-2px); }
    }

    .player-dribbler.dodging {
        animation: dodgeMove 0.5s forwards cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    @keyframes dodgeMove {
        0% { transform: scale(1) translateY(0) rotate(0deg); }
        50% { transform: scale(1.2) translateY(-20px) rotate(15deg); }
        100% { transform: scale(1) translateY(0) rotate(0deg); }
    }

    .player-dribbler.demoed {
        animation: explosionFlash 0.5s forwards;
    }

    .opponent-car {
        position: absolute;
        font-size: 3.5rem;
        cursor: pointer;
        z-index: 8;
        transition: transform 0.2s;
        filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .opponent-car:hover {
        transform: scale(1.1);
        filter: drop-shadow(0 10px 15px rgba(255,0,0,0.5));
    }

    .opponent-body {
        transform: scaleX(-1); /* Facing left */
    }
    
    .opponent-sign {
        position: absolute;
        top: -40px;
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #ff0055;
        padding: 5px 10px;
        font-family: var(--font-en);
        font-weight: bold;
        color: #fff;
        border-radius: 5px;
        box-shadow: 0 0 10px rgba(255,0,85,0.6);
        pointer-events: none;
        white-space: nowrap;
        font-size: 1.1rem;
    }

    .dodged-opponent {
        font-size: 3rem;
        position: absolute;
        bottom: 50px;
        z-index: 7;
        filter: grayscale(1) opacity(0.5);
    }

    /* Aerial Hit Game (formerly Fishing) */
    .aerial-container {
        position: relative;
        width: 100%;
        height: 400px;
        background: linear-gradient(to top, #1E90FF 0%, #000 100%);
        border: 4px solid #333;
        overflow: hidden;
        border-radius: 10px;
    }
    
    .aerial-sky {
        position: absolute;
        top: 0;
        width: 100%;
        height: 80%;
    }
    
    .aerial-player {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 4rem;
        transition: transform 0.1s;
        filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
    }
    
    .aerial-ball {
        position: absolute;
        top: 20%;
        cursor: pointer;
        animation: floatSky 10s linear infinite;
        display: flex;
        flex-direction: column;
        align-items: center;
        filter: drop-shadow(0 5px 15px rgba(255,255,255,0.3));
    }
    
    .aerial-ball:hover {
        filter: drop-shadow(0 10px 25px rgba(255,255,255,0.8));
    }
    
    .aerial-ball-sprite {
        font-size: 3rem;
        animation: spinBall 3s linear infinite;
    }
    
    .aerial-text {
        background: rgba(0, 0, 0, 0.7);
        color: #fff;
        padding: 5px 10px;
        border: 2px solid #00aaff;
        border-radius: 8px;
        font-weight: bold;
        font-family: var(--font-en);
        margin-top: 5px;
    }
    
    @keyframes floatSky {
        0% { left: 110%; top: 20%; }
        25% { top: 40%; }
        50% { left: -10%; top: 10%; }
        75% { top: 30%; }
        100% { left: 110%; top: 20%; }
    }
    
    @keyframes spinBall {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
    
    .aerial-jumping {
        animation: aerialJump 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }
    
    @keyframes aerialJump {
        0% { transform: translate(-50%, 0) rotate(0deg); }
        50% { transform: translate(calc(-50% + (var(--tx) / 2)), calc(var(--ty) / 2)) rotate(-45deg); }
        100% { transform: translate(calc(-50% + var(--tx)), var(--ty)) rotate(-90deg); }
    }
    
    .aerial-ball.hit-midair {
        animation: explodeBall 0.5s forwards;
        pointer-events: none;
    }
    
    .aerial-ball.wrong-shake {
        animation: shake 0.3s forwards;
        border-color: red;
        filter: hue-rotate(180deg);
    }
    
    @keyframes explodeBall {
        0% { transform: scale(1); filter: brightness(1); }
        50% { transform: scale(1.5); filter: brightness(2) hue-rotate(90deg); }
        100% { transform: scale(0); opacity: 0; }
    }
    
    .aerial-explosion {
        position: absolute;
        font-size: 3rem;
        z-index: 10;
        animation: fadeOutUp 0.5s forwards;
    }
    
    @keyframes fadeOutUp {
        0% { opacity: 1; transform: translateY(0); }
        100% { opacity: 0; transform: translateY(-30px); }
    }

    /* Drop Crate Game (formerly Chest) */
    .crate-container {
        display: flex;
        justify-content: space-around;
        align-items: center;
        height: 250px;
        background: linear-gradient(135deg, #1a1a1a, #333);
        border: 4px solid #555;
        border-radius: 10px;
        box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
    }
    .crate-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
    }
    .crate-label {
        background: rgba(0,0,0,0.9);
        color: #00ffff;
        padding: 5px 15px;
        margin-bottom: 10px;
        border-radius: 5px;
        font-family: var(--font-en);
        font-weight: bold;
        border: 1px solid #00ffff;
        box-shadow: 0 0 10px rgba(0,255,255,0.5);
    }
    .crate-block {
        font-size: 5rem;
        cursor: pointer;
        transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        filter: drop-shadow(0 10px 10px rgba(0,0,0,0.6));
    }
    .crate-block:hover {
        transform: scale(1.1) translateY(-5px);
        filter: drop-shadow(0 15px 15px rgba(0,255,255,0.4));
    }
    .crate-block.opened {
        animation: popItem 1s forwards;
    }
    @keyframes popItem {
        0% { transform: scale(1); }
        40% { transform: scale(1.3) translateY(-10px) rotate(10deg); }
        100% { transform: scale(1) translateY(0) rotate(0deg); }
    }
    .crate-loot {
        font-size: 4rem;
        animation: floatItemUp 1s ease-out forwards;
        filter: drop-shadow(0 0 15px #ff0055);
    }
    @keyframes floatItemUp {
        0% { transform: translateY(0) scale(0.5); opacity: 0; }
        20% { opacity: 1; transform: translateY(-20px) scale(1.2); }
        100% { transform: translateY(-80px) scale(1); opacity: 0; }
    }

    /* Garage Customization Game (formerly Crafting) */
    .garage-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        background: linear-gradient(to bottom, #2a2a35, #111);
        padding: 20px;
        border: 4px solid #00aaff;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(0,170,255,0.4);
    }
    .garage-bay {
        display: flex;
        align-items: center;
        gap: 20px;
        background: #1a1a25;
        padding: 15px;
        border: 2px solid #0055aa;
        border-radius: 8px;
        box-shadow: inset 0 0 15px #000;
    }
    .garage-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        background: #000;
        padding: 5px;
        border-radius: 5px;
    }
    .garage-slot {
        width: 60px;
        height: 60px;
        background: #2a2a35;
        border: 2px dashed #00aaff;
        border-radius: 5px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .garage-arrow {
        font-size: 2rem;
        animation: pulseArrow 1s infinite alternate;
    }
    @keyframes pulseArrow {
        from { transform: scale(1); filter: drop-shadow(0 0 5px #ffaa00); }
        to { transform: scale(1.1); filter: drop-shadow(0 0 15px #ffaa00); }
    }
    .garage-result-slot {
        width: 80px;
        height: 80px;
        background: #111;
        border: 3px solid #ff0055;
        border-radius: 5px;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 3rem;
        box-shadow: 0 0 15px rgba(255,0,85,0.6);
    }
    .garage-result-slot.pop-in {
        animation: popDiamond 1s forwards;
    }
    .garage-inventory {
        display: flex;
        gap: 15px;
    }
    .garage-part {
        background: rgba(0, 170, 255, 0.1);
        padding: 10px;
        border: 2px solid #00aaff;
        border-radius: 8px;
        cursor: pointer;
        text-align: center;
        transition: transform 0.2s, background 0.2s;
    }
    .garage-part:hover {
        transform: scale(1.1);
        background: rgba(0, 170, 255, 0.3);
    }
    .garage-part.equipped {
        opacity: 0.5;
        transform: scale(0.9);
        border-color: #555;
    }
    .part-sprite {
        font-size: 2rem;
        filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
    }
    .part-text {
        color: #fff;
        font-family: var(--font-en);
        font-weight: bold;
        margin-top: 5px;
    }

    /* Matchmaking Game (formerly Portal) */
    .matchmaking-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        background: radial-gradient(circle, #1a1a2e 0%, #000 100%);
        padding: 20px;
        border: 4px solid #0055aa;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(0,85,170,0.5);
    }
    .matchmaking-screen {
        width: 250px;
        height: 150px;
        background: #001122;
        border: 2px solid #00aaff;
        border-radius: 5px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: relative;
        overflow: hidden;
        box-shadow: inset 0 0 20px rgba(0,170,255,0.2);
    }
    .match-status {
        color: #00aaff;
        font-family: var(--font-en);
        font-weight: bold;
        letter-spacing: 2px;
        animation: pulseText 1.5s infinite;
        margin-bottom: 15px;
    }
    @keyframes pulseText {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
    }
    .match-bars {
        display: flex;
        gap: 10px;
    }
    .match-bar {
        width: 30px;
        height: 10px;
        background: #113344;
        border-radius: 5px;
        transition: background 0.3s, box-shadow 0.3s;
    }
    .match-bar.active-bar {
        background: #00ff00;
        box-shadow: 0 0 10px #00ff00;
    }
    .match-bar.searching-bar {
        border: 2px dashed #00aaff;
        background: rgba(0, 170, 255, 0.2);
        animation: pulseSearch 1s infinite alternate;
    }
    @keyframes pulseSearch {
        from { box-shadow: 0 0 5px #00aaff; }
        to { box-shadow: 0 0 15px #00aaff; }
    }
    .matchmaking-found {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 255, 0, 0.2);
        display: flex;
        justify-content: center;
        align-items: center;
        color: #00ff00;
        font-family: var(--font-en);
        font-style: italic;
        text-shadow: 0 0 10px #00ff00;
        animation: matchFoundPulse 0.5s infinite alternate;
    }
    @keyframes matchFoundPulse {
        from { background: rgba(0, 255, 0, 0.2); }
        to { background: rgba(0, 255, 0, 0.4); }
    }
    .server-options {
        display: flex;
        gap: 15px;
    }
    .server-node {
        background: #0f1f2f;
        padding: 10px;
        border: 2px solid #00aaff;
        cursor: pointer;
        text-align: center;
        width: 90px;
        height: 90px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: white;
        transition: transform 0.2s, border-color 0.2s;
        border-radius: 10px;
    }
    .server-node:hover {
        transform: scale(1.1);
        border-color: #00ff00;
        box-shadow: 0 0 15px rgba(0,255,0,0.5);
    }
    .server-node.activated {
        opacity: 0.5;
        transform: scale(0.9);
        pointer-events: none;
        border-color: #555;
    }
    .server-icon {
        font-size: 2rem;
        animation: spinDish 4s infinite linear;
    }
    @keyframes spinDish {
        from { transform: rotateY(0deg); }
        to { transform: rotateY(360deg); }
    }
    .server-text {
        font-family: var(--font-en);
        font-size: 0.8rem;
        margin-top: 5px;
    }

    /* Boost Management Game (formerly Farming) */
    .boost-management-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        background: radial-gradient(circle, #2a2a35 0%, #111 100%);
        padding: 20px;
        border-radius: 10px;
        border: 4px solid #ffaa00;
        box-shadow: 0 0 20px rgba(255,170,0,0.3);
    }
    .boost-meter-container {
        display: flex;
        align-items: center;
        gap: 20px;
        background: #000;
        padding: 20px;
        border-radius: 10px;
        border: 2px solid #555;
    }
    .boost-meter-bar {
        width: 150px;
        height: 30px;
        background: #222;
        border: 2px solid #ffaa00;
        border-radius: 15px;
        overflow: hidden;
        position: relative;
    }
    .boost-meter-fill {
        height: 100%;
        background: linear-gradient(90deg, #ffaa00, #ff0055);
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        font-family: var(--font-en);
        font-weight: bold;
        font-size: 0.8rem;
        transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .car-sprite-boost {
        font-size: 3rem;
        animation: idleVibrate 0.1s infinite;
    }
    @keyframes idleVibrate {
        0% { transform: translate(1px, 1px) rotate(0deg); }
        100% { transform: translate(-1px, -1px) rotate(0deg); }
    }
    .boost-options-container {
        display: flex;
        gap: 15px;
    }
    .boost-pad-option {
        background: rgba(255, 170, 0, 0.1);
        padding: 10px;
        border: 2px solid #ffaa00;
        cursor: pointer;
        text-align: center;
        border-radius: 5px;
        transition: transform 0.2s, background 0.2s;
    }
    .boost-pad-option:hover {
        transform: scale(1.1);
        background: rgba(255, 170, 0, 0.3);
        box-shadow: 0 0 10px rgba(255,170,0,0.5);
    }
    .boost-sprite { font-size: 1.5rem; filter: drop-shadow(0 0 5px #ffaa00); }
    .boost-pad-text { color: #fff; font-family: var(--font-en); font-weight: bold; margin-top: 5px; }

    /* Engine Tuning Game (formerly Potion) */
    .engine-tuning-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        background: linear-gradient(135deg, #111, #222);
        padding: 20px;
        border: 4px solid #ff0055;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(255,0,85,0.3);
    }
    .engine-bay {
        width: 150px;
        height: 120px;
        background: #000;
        border: 2px solid #555;
        border-radius: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: inset 0 0 20px rgba(255,0,85,0.2);
    }
    .engine-status {
        font-size: 2rem;
        color: #ff0055;
        font-family: var(--font-en);
        font-weight: bold;
        text-shadow: 0 0 10px rgba(255,0,85,0.5);
        transition: transform 0.3s;
    }
    .tuning-options-container {
        display: flex;
        gap: 15px;
    }
    .tuning-option {
        background: rgba(255, 0, 85, 0.1);
        padding: 10px;
        border: 2px solid #ff0055;
        cursor: pointer;
        text-align: center;
        border-radius: 50%;
        width: 70px;
        height: 70px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: transform 0.2s, background 0.2s;
    }
    .tuning-option:hover {
        transform: scale(1.1) rotate(15deg);
        background: rgba(255, 0, 85, 0.3);
        box-shadow: 0 0 15px rgba(255,0,85,0.5);
    }
    .tuning-sprite { font-size: 1.5rem; filter: drop-shadow(0 0 5px #ff0055); }
    .tuning-text { color: #fff; font-family: var(--font-en); font-size: 0.7rem; font-weight: bold; margin-top: 2px; }

/* =========================================
   Translator Bot UI (Rocket League Style)
   ========================================= */

#translator-bot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-ar);
}

#translator-fab {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0055aa, #00aaff);
    color: var(--white);
    border: 2px solid #00aaff;
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.6);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
}

#translator-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 170, 255, 1);
}

#translator-chat-window {
    width: 320px;
    height: 400px;
    background: linear-gradient(135deg, #111, #222);
    border: 2px solid #00aaff;
    border-top: 4px solid #ffaa00;
    border-bottom: 4px solid #ff0055;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0,170,255,0.2);
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

#translator-chat-window::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* Metallic grid background */
    background:
        linear-gradient(rgba(0,170,255,0.05) 1px, transparent 1px) 0 0,
        linear-gradient(90deg, rgba(0,170,255,0.05) 1px, transparent 1px) 0 0;
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

#translator-chat-window.hidden {
    display: none;
}

.chat-header {
    background: linear-gradient(90deg, #002244, #001122);
    color: #00aaff;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-family: var(--font-en);
    font-size: 1rem;
    border-bottom: 2px solid #00aaff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 1;
    letter-spacing: 1px;
}

.close-chat-btn {
    background: transparent;
    border: none;
    color: #ff0055;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 10px #ff0055;
    transition: transform 0.2s, text-shadow 0.2s;
}

.close-chat-btn:hover {
    transform: scale(1.2);
    text-shadow: 0 0 20px #ff0055;
}

.chat-body {
    flex: 1;
    padding: 15px;
    background-color: transparent;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
}

.chat-message {
    padding: 10px;
    font-size: 0.9rem;
    max-width: 85%;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.bot-message {
    background-color: rgba(0, 170, 255, 0.1);
    color: #fff;
    border: 1px solid #00aaff;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
    align-self: flex-start;
    border-radius: 0 10px 10px 10px;
}

.user-message {
    background-color: rgba(255, 170, 0, 0.1);
    color: #fff;
    align-self: flex-end;
    border: 1px solid #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.3);
    border-radius: 10px 0 10px 10px;
    text-align: left;
    direction: ltr;
}

.chat-input-area {
    display: flex;
    padding: 10px;
    background: #0a0a0a;
    border-top: 2px solid #ffaa00;
    z-index: 1;
}

#translator-input {
    flex: 1;
    padding: 8px;
    background: #111;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.9rem;
    direction: ltr; /* English input */
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#translator-input:focus {
    border-color: #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.4);
}

.chat-input-area .send-btn {
    background: linear-gradient(135deg, #ffaa00, #ff0055);
    color: white;
    border: none;
    border-radius: 5px;
    width: 40px;
    margin-right: 5px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 85, 0.4);
    font-size: 1.2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-input-area .send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.8);
}

.message-audio-btn {
    background: none;
    border: none;
    color: #00aaff;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: 5px;
    vertical-align: middle;
}
.message-audio-btn:hover {
    color: #fff;
    text-shadow: 0 0 10px #00aaff;
}

/* --- DIVERSE INTERACTIVE MECHANICS --- */

/* 1. Timing Game */
.timing-game {
    display: flex; flex-direction: column; align-items: center; width: 100%;
}
.timing-bar {
    width: 80%; height: 60px; background: #222; border: 3px solid #555;
    border-radius: 30px; position: relative; margin: 40px 0; overflow: hidden;
    display: flex;
}
.timing-zone {
    flex: 1; border-right: 2px solid #111; color: #fff; display: flex;
    justify-content: center; align-items: center; font-weight: bold; font-family: var(--font-en);
}
.timing-zone:nth-child(1) { background: rgba(255, 0, 0, 0.2); }
.timing-zone:nth-child(2) { background: rgba(255, 255, 0, 0.2); }
.timing-zone:nth-child(3) { background: rgba(0, 255, 0, 0.2); border-right: none; }
.timing-needle {
    position: absolute; top: -10px; bottom: -10px; width: 6px; background: #00ffff;
    box-shadow: 0 0 15px #00ffff; border-radius: 3px; z-index: 10;
}

/* 2. Striking Game */
.striking-game {
    display: flex; flex-direction: column; align-items: center; width: 100%;
}
.goals-row {
    display: flex; width: 100%; justify-content: space-around; margin: 20px 0;
    position: relative;
}
.strike-goal {
    width: 120px; height: 80px; border: 3px solid #fff; border-bottom: none;
    border-radius: 10px 10px 0 0; background: rgba(0, 150, 255, 0.2);
    display: flex; justify-content: center; align-items: center; color: white;
    font-weight: bold;
}
.crosshair {
    position: absolute; bottom: 80px; font-size: 3rem; filter: drop-shadow(0 0 10px red);
    z-index: 20; transform: translateX(-50%);
}

/* 3. Bouncing Game */
.bouncing-game {
    position: relative; width: 100%; height: 250px; overflow: hidden;
}
.bouncing-ball {
    position: absolute; width: 80px; height: 80px; background: radial-gradient(circle, #fff, #aaa);
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    color: #000; font-weight: bold; cursor: crosshair;
    animation: bounceAround 3s infinite ease-in-out alternate;
    box-shadow: inset -5px -5px 15px rgba(0,0,0,0.5); border: 2px solid #333;
}
@keyframes bounceAround {
    0% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(150px) scale(0.9); }
    100% { transform: translateY(50px) scale(1.1); }
}

/* 4. Dodge Game */
.dodge-game {
    position: relative; width: 100%; height: 250px; overflow: hidden;
    background: #1a1a1a; border-radius: 10px; border: 2px solid #444;
}
.scrolling-road {
    position: absolute; width: 100%; height: 100%;
    background: repeating-linear-gradient(180deg, #333 0px, #333 20px, transparent 20px, transparent 40px);
    animation: scrollRoad 1s linear infinite; opacity: 0.5;
}
@keyframes scrollRoad { from { background-position: 0 0; } to { background-position: 0 40px; } }
.enemies-row {
    position: absolute; width: 100%; top: 50px; display: flex; justify-content: space-around;
}
.enemy-obstacle {
    display: flex; flex-direction: column; align-items: center; color: #fff;
    cursor: pointer; z-index: 10; transition: 0.2s;
}
.enemy-obstacle:hover { transform: scale(1.2); filter: drop-shadow(0 0 10px #ff0000); }
.enemy-car-icon { font-size: 3rem; }

/* 5. Smash Game */
.smash-game {
    display: flex; justify-content: space-around; padding: 30px 0;
}
.smash-crate {
    display: flex; flex-direction: column; align-items: center; color: #fff;
    cursor: pointer; transition: 0.1s; user-select: none;
}
.crate-box { font-size: 4rem; filter: drop-shadow(0 5px 5px #000); }
.crate-label { background: rgba(0,0,0,0.7); padding: 5px 10px; border-radius: 5px; margin-bottom: 10px;}

/* 6. Slider Game */
.slider-game {
    display: flex; flex-direction: column; align-items: center; width: 100%; padding: 30px 0;
}
.slider-labels-row {
    display: flex; width: 80%; justify-content: space-between; color: #fff; font-weight: bold;
    margin-bottom: 15px;
}
.engine-slider {
    width: 80%; margin-bottom: 30px; cursor: pointer;
}

/* 7. Drag Drop Game */
.drag-drop-game {
    display: flex; flex-direction: column; align-items: center; padding: 20px;
}
.drag-items {
    display: flex; gap: 15px; margin-bottom: 30px;
}
.drag-item {
    background: #333; color: #fff; padding: 15px 25px; border-radius: 8px; border: 2px solid #555;
    cursor: grab; font-weight: bold; font-family: var(--font-en);
}
.drag-item:active { cursor: grabbing; }
.drop-zone {
    width: 300px; height: 150px; border: 3px dashed #00aaff; border-radius: 15px;
    display: flex; justify-content: center; align-items: center; color: #00aaff; font-size: 1.5rem;
    background: rgba(0, 170, 255, 0.1);
}

.correct-flash { animation: correctF 0.5s forwards; pointer-events: none; }
@keyframes correctF { 50% { transform: scale(1.2); filter: brightness(2) hue-rotate(90deg); } }