@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary-bg: #f0f3f7;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-main: #2d3436;
    --text-muted: #636e72;
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--primary-bg);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    direction: rtl;
    min-height: 100vh;
    padding-bottom: 50px;
}

header {
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content {
    text-align: right;
    flex: 1;
}

.home-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.home-btn:hover {
    background: white;
    color: #1e272e;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.student-name {
    color: #f1c40f;
    font-weight: 800;
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Units Grid */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.unit-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.unit-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 45px rgba(0,0,0,0.2);
}

.unit-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.unit-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
}

/* Chapters/Lessons Modal Style (View Change) */
#main-content {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chapter-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.chapter-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1e272e;
    border-right: 5px solid #ff6b6b;
    padding-right: 15px;
}

.lessons-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.lesson-item {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #ebeff2;
}

.lesson-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.lesson-icon-small {
    font-size: 1.8rem;
    background: #f1f2f6;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.lesson-info h4 {
    font-size: 1.1rem;
    color: #2d3436;
    margin-bottom: 5px;
}

.lesson-info span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.enrichment-tag {
    background: #ffeaa7;
    color: #d6a312;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-right: 10px;
}

/* Responsive */
/* Lesson Page Styles */
.lesson-page {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--card-shadow);
}

.back-link {
    background: #cbd5e0;
    border: none;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 20px;
    font-weight: 600;
}

.navigation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
}

.home-link {
    background: #74b9ff !important;
    color: white !important;
}

.lesson-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.lesson-titles h2 {
    font-size: 2.2rem;
    color: #2d3436;
    margin: 0;
}

.page-badge {
    background: #74b9ff;
    color: white;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.lesson-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #dfe6e9;
    padding-bottom: 10px;
}

.tab-link {
    background: transparent;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #636e72;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s;
}

.tab-link:hover {
    background: rgba(255, 255, 255, 0.5);
    color: #2d3436;
}

.tab-link.active {
    background: #0984e3;
    color: white;
    box-shadow: 0 4px 15px rgba(9, 132, 227, 0.3);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header-voice {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.speak-btn {
    background: #6c5ce7;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
}

.speak-btn:hover {
    transform: scale(1.05);
    background: #a29bfe;
}

.speak-btn-sm {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #2d3436;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s;
}

.chapter-section .speak-btn-sm {
    color: white;
}

.speak-btn-sm:hover {
    background: white;
    transform: scale(1.1);
}

.option-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.option-wrapper .speak-btn-sm {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Voice Hero Card */
.voice-hero-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    border-radius: 24px;
    padding: 25px 40px;
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.2);
}

.voice-hero-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.voice-hero-icon {
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.voice-hero-card h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* Mic Button */
.mic-btn {
    background: #ff7675;
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(255, 118, 117, 0.4);
    transition: all 0.3s;
    margin: 20px auto;
}

.mic-btn.listening {
    animation: micPulse 1.5s infinite;
    background: #d63031;
}

@keyframes micPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(214, 48, 49, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(214, 48, 49, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(214, 48, 49, 0); }
}



.info-section {
    margin-bottom: 25px;
}

.info-section h3 {
    font-size: 1.4rem;
    color: #e67e22;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.facts-list {
    list-style: none;
    padding: 0;
}

.facts-list li {
    background: #f1f2f6;
    margin-bottom: 10px;
    padding: 12px 20px;
    border-radius: 12px;
    position: relative;
    padding-right: 40px;
}

.facts-list li::before {
    content: '⭐';
    position: absolute;
    right: 12px;
}

.discovery-box {
    background: #fff9db;
    border-right: 6px solid #f1c40f;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
}

.discovery-box h4 {
    color: #827717;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.lesson-emoji {
    font-size: 3.5rem;
}

.lesson-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.main-image {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 5px solid white;
}

.lesson-text-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    line-height: 1.8;
}

.lesson-text-card h3 {
    margin-bottom: 15px;
    color: #e67e22;
}

/* Challenge Box */
.challenge-box {
    background: linear-gradient(135deg, #1e3799, #0c2461);
    color: white;
    padding: 40px;
    border-radius: 24px;
    text-align: center;
}

.challenge-box .question {
    font-size: 1.5rem;
    margin: 20px 0;
    font-weight: 700;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.option-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.option-btn:hover {
    background: white;
    color: #0c2461;
    transform: scale(1.05);
}

.feedback-area {
    margin-top: 30px;
    font-size: 1.3rem;
    font-weight: 800;
}

.success-msg { color: #2ecc71; animation: pop 0.5s ease; }
.error-msg { color: #ff7675; animation: shake 0.5s ease; }

@keyframes pop {
    0% { transform: scale(0.5); }
    100% { transform: scale(1); }
}

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

.anim-fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* --- Access Screen Styles --- */
.access-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.access-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    margin-top: 50px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.access-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.access-card h2 {
    color: white;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.access-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}

.access-card input {
    width: 100%;
    padding: 15px 25px;
    border-radius: 15px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 25px;
    outline: none;
    transition: all 0.3s ease;
}

.access-card input:focus {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.access-card button {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.access-card button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.premium-visual {
    background: white;
    padding: 30px;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.heart-pulse {
    animation: premiumPulse 1s infinite ease-in-out;
    width: 80%;
}

@keyframes premiumPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0px red); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 15px rgba(255,0,0,0.3)); }
}

.visual-footer {
    margin-top: 20px;
    text-align: center;
}

.badge {
    background: #e67e22;
    color: white;
    padding: 5px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.svg-label {
    font-size: 14px;
    font-weight: 800;
}

.fallback-icon {
    font-size: 8rem;
    padding: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .lesson-content-grid { grid-template-columns: 1fr; }
}

/* Progress & Gamification */
.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    margin: 15px 0 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #55efc4;
    transition: width 0.5s ease-in-out;
}

.progress-text {
    font-size: 0.8rem;
    color: white;
    font-weight: 700;
}

.lesson-completed {
    border: 2px solid #2ecc71 !important;
    background: #f1fff7 !important;
}

/* ==========================================
   Word Mega-Factory (Industrial Theme Styles)
   ========================================== */

.factory-container {
    background: #2f3640;
    border: 8px solid #f1c40f;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.factory-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 10px;
    background: repeating-linear-gradient(45deg, #f1c40f, #f1c40f 10px, #2d3436 10px, #2d3436 20px);
}

.station-header {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #f1c40f;
    border-bottom: 2px dashed #7f8fa6;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.station-header h3 {
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Excavator Game */
.excavator-game {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.word-to-break {
    font-size: 3rem;
    font-weight: 900;
    color: #fff;
    text-align: center;
    letter-spacing: 5px;
    text-shadow: 0 0 10px #e1b12c;
}

.syllable-blocks {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.syllable {
    background: #e1b12c;
    color: #2f3640;
    padding: 15px 25px;
    font-size: 2rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: grab;
    border: 4px solid #c23616;
    box-shadow: 0 5px 0 #8c2610;
    user-select: none;
}

.syllable:active {
    cursor: grabbing;
    transform: translateY(5px);
    box-shadow: none;
}

.truck-trailers {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 100px;
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 10px;
    border: 2px dashed #f5f6fa;
}

.trailer {
    width: 80px;
    height: 80px;
    border: 3px solid #7f8fa6;
    background: rgba(127, 143, 166, 0.3);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trailer.filled {
    background: #44bd32;
    border-color: #2f3640;
}

/* Cement Mixer Game */
.mixer-game {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scattered-words {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.word-brick {
    background: #7f8fa6;
    color: #fff;
    padding: 10px 20px;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: grab;
    border: 2px solid #2f3640;
    box-shadow: 2px 2px 0 #2f3640;
}

.mixer-drum {
    min-height: 80px;
    background: #e1b12c;
    border: 5px solid #2f3640;
    border-radius: 40px;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
}

.mixer-drum::after {
    content: '\f011';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    font-size: 2rem;
    color: rgba(47, 54, 64, 0.2);
}

/* Speedometer Game */
.speed-game {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.reading-text {
    font-size: 1.5rem;
    line-height: 2;
    color: #fff;
    text-align: center;
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 12px;
}

.speedometer-ui {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.road {
    flex: 1;
    height: 40px;
    background: #2d3436;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.road::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 4px;
    background: repeating-linear-gradient(90deg, #fff, #fff 20px, transparent 20px, transparent 40px);
    transform: translateY(-50%);
}

.racing-truck {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #e84118;
    transition: right 0.5s ease-out;
    z-index: 2;
}

.read-btn {
    background: #e84118;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 0 #c23616;
}

.read-btn:active {
    transform: translateY(5px);
    box-shadow: none;
}

/* Dump Truck Game */
.dump-game {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.question-text {
    font-size: 1.5rem;
    color: #f1c40f;
    font-weight: bold;
    text-align: center;
}

.rocks-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.rock-answer {
    background: #718093;
    color: #fff;
    padding: 15px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    border: 4px solid #2f3640;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.rock-answer:hover {
    transform: scale(1.1);
}

.dump-truck-ui {
    font-size: 6rem;
    color: #fbc531;
    text-align: center;
    margin-top: 20px;
    animation: idle 2s infinite ease-in-out;
}

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

.next-station-btn {
    background: #44bd32;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 0 #2f3640;
    margin: 20px auto 0;
    width: fit-content;
}

.next-station-btn:active {
    transform: translateY(5px);
    box-shadow: none;
}

.hidden {
    display: none !important;
}

/* Main Menu Factory Overrides */
.factory-unit-card {
    transition: transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.factory-unit-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.cargo-box {
    background: #eccc68;
    border: 4px solid #2f3640;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.5), 5px 5px 0 rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.cargo-box::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -20px;
    width: 60px;
    height: 60px;
    background: repeating-linear-gradient(45deg, #ff4757, #ff4757 10px, #ffffff 10px, #ffffff 20px);
    transform: rotate(45deg);
    opacity: 0.7;
}

.cargo-box:hover {
    transform: translateY(-5px);
    background: #ffeaa7;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.5), 5px 10px 0 rgba(0,0,0,0.4);
}

.cargo-completed {
    background: #7bed9f;
    border-color: #2ed573;
}

.cargo-completed::after {
    background: repeating-linear-gradient(45deg, #2ed573, #2ed573 10px, #ffffff 10px, #ffffff 20px);
}

/* --- New Games CSS (Crane & Conveyor) --- */
.conveyor-game { display: flex; flex-direction: column; align-items: center; padding: 20px; }
.conveyor-belt { width: 100%; height: 80px; background: #353b48; border-bottom: 10px solid #2f3640; border-top: 10px solid #2f3640; position: relative; overflow: hidden; display: flex; align-items: center; background-image: repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.05) 40px, rgba(255,255,255,0.05) 80px); animation: moveBelt 2s linear infinite; margin-bottom: 30px; border-radius: 5px; box-shadow: inset 0 0 20px rgba(0,0,0,0.5);}
@keyframes moveBelt { 0% { background-position: 0 0; } 100% { background-position: 80px 0; } }
.fact-item { background: #f1c40f; color: #2f3640; padding: 15px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: transform 0.2s; width: 80%; max-width: 400px; text-align: center; border: 3px solid #e1b12c;}
.fact-item:active { transform: scale(0.95); }
.sorting-bins { display: flex; gap: 20px; justify-content: center; width: 100%; flex-wrap: wrap; }
.sort-bin { width: 180px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: bold; color: white; border-radius: 15px; cursor: pointer; border: 4px dashed rgba(255,255,255,0.5); transition: all 0.2s;}
.sort-bin:hover { transform: scale(1.05); border-style: solid; box-shadow: 0 10px 20px rgba(0,0,0,0.3);}
.bin-truck { background: #44bd32; }
.bin-trash { background: #e84118; }
.active-fact { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); animation: pulseFact 1.5s infinite; z-index: 10; box-shadow: 0 0 15px rgba(241, 196, 15, 0.8);}
@keyframes pulseFact { 0% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.02); } 100% { transform: translate(-50%, -50%) scale(1); } }

.crane-game { position: relative; padding: 30px 20px; background: #2f3640; border-radius: 15px; box-shadow: inset 0 0 30px rgba(0,0,0,0.6); margin-bottom: 20px;}
.crane-rail { height: 15px; background: #7f8fa6; width: 100%; border-radius: 10px; position: relative; margin-bottom: 80px; box-shadow: 0 5px 10px rgba(0,0,0,0.5);}
.crane-hook { width: 50px; height: 70px; background: #f1c40f; position: absolute; left: 50%; top: 10px; transform: translateX(-50%); border: 4px solid #353b48; border-radius: 5px; transition: left 0.5s ease; display: flex; align-items: flex-end; justify-content: center; z-index: 5;}
.crane-hook::after { content: ''; position: absolute; width: 4px; height: 100px; background: #353b48; bottom: 100%; left: 50%; transform: translateX(-50%); z-index: -1; }
.crane-hook::before { content: 'U'; font-size: 2.5rem; color: #e84118; font-weight: bold; transform: rotate(180deg); margin-bottom: -20px; text-shadow: 2px 2px 0 #2f3640; }
.magnetized { animation: magnetFloat 0.8s ease-in-out infinite alternate; box-shadow: 0 0 20px #f1c40f !important; border-color: #f1c40f !important; transform: translateY(-5px);}
@keyframes magnetFloat { from { transform: translateY(-5px); } to { transform: translateY(-15px); } }
.words-yard { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-bottom: 30px; padding: 20px; background: rgba(0,0,0,0.2); border-radius: 10px;}
.word-brick-btn { background: #7f8fa6; color: white; padding: 15px 30px; border-radius: 8px; font-weight: bold; font-size: 1.3rem; cursor: pointer; border: 3px solid transparent; transition: all 0.2s; box-shadow: 0 5px 0 #353b48;}
.word-brick-btn:hover { background: #f1c40f; color: #2f3640; transform: translateY(2px); box-shadow: 0 3px 0 #353b48; }
.word-brick-btn:active { transform: translateY(5px); box-shadow: none; }
.sentence-trailer { background: #353b48; padding: 30px; border-radius: 10px; border: 3px dashed #f1c40f; color: white; font-size: 1.6rem; text-align: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; align-items: center; line-height: 1.8;}
.empty-slot { display: inline-block; width: 120px; height: 40px; border-bottom: 4px solid #f1c40f; margin: 0 10px; vertical-align: middle; transition: all 0.3s;}
.empty-slot.filled { border-bottom: none; color: #44bd32; font-weight: 900; animation: pop 0.5s ease; }
