/* ==========================================================================
   🎮 ROBLOX GAMING THEME - DIRASATI PLATFORM - AMIR MOHAMMED (READING GRADE 3)
   ========================================================================== */

:root {
    /* Roblox Signature Colors */
    --roblox-red: #E2231A;
    --roblox-red-dark: #A5140D;
    --roblox-red-glow: rgba(226, 35, 26, 0.45);
    --roblox-blue: #00A2FF;
    --roblox-blue-glow: rgba(0, 162, 255, 0.45);
    --roblox-green: #00B06F;
    --roblox-green-glow: rgba(0, 176, 111, 0.4);
    --roblox-gold: #FFD700;
    --roblox-gold-glow: rgba(255, 215, 0, 0.45);
    
    /* Dark Gaming Theme Palette */
    --roblox-bg: #121316;
    --roblox-panel: #1A1C20;
    --roblox-card: #24272D;
    --roblox-card-hover: #2F333B;
    --roblox-border: #383D47;
    --roblox-border-glow: rgba(0, 162, 255, 0.3);

    /* System Variable Mapping */
    --primary-color: #E2231A;
    --primary-light: #FF4A42;
    --secondary-color: #00A2FF;
    --secondary-light: #52BFFF;
    --accent-color: #FFD700;
    --accent-light: #FFEAA7;
    --success-color: #00B06F;
    --danger-color: #E2231A;
    --background-color: #121316;
    --card-bg: #24272D;
    --text-main: #FFFFFF;
    --text-muted: #9DA3AE;
    --text-dim: #6B7280;
    
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 30px rgba(226, 35, 26, 0.35);
    --border-radius: 14px;
    --radius-xl: 22px;
    --radius-lg: 16px;
    --transition-speed: 0.25s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body.roblox-theme {
    font-family: 'Cairo', 'Changa', 'Tajawal', sans-serif;
    background-color: var(--roblox-bg);
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 10% 20%, rgba(226, 35, 26, 0.12), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(0, 162, 255, 0.12), transparent 35%);
    background-size: 36px 36px, 36px 36px, 100% 100%, 100% 100%;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    direction: rtl;
    position: relative;
}

/* Hide header automatically when inside a lesson */
body.lesson-mode .app-header {
    display: none !important;
}

/* =========================================
   Floating Roblox Blox Background Elements
   ========================================= */
.roblox-floating-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.r-blox {
    position: absolute;
    font-size: 2.2rem;
    opacity: 0.25;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    animation: floatBlox 8s ease-in-out infinite alternate;
}

.blox-1 { top: 12%; right: 8%; animation-delay: 0s; }
.blox-2 { top: 35%; left: 6%; animation-delay: 1.5s; font-size: 2.6rem; }
.blox-3 { top: 75%; right: 12%; animation-delay: 3s; }
.blox-4 { top: 55%; right: 4%; animation-delay: 2s; }
.blox-5 { top: 22%; left: 18%; animation-delay: 4s; font-size: 1.8rem; }
.blox-6 { top: 82%; left: 10%; animation-delay: 2.5s; font-size: 2.4rem; }
.blox-7 { top: 68%; left: 45%; animation-delay: 5s; }
.blox-8 { top: 8%; left: 40%; animation-delay: 3.5s; }

@keyframes floatBlox {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(15deg); }
    100% { transform: translateY(10px) rotate(-10deg); }
}

/* =========================================
   App Container & Views
   ========================================= */
.view {
    display: none;
    max-width: 1350px;
    width: 94%;
    margin: 1.5rem auto;
    flex: 1;
    position: relative;
    z-index: 1;
}

.view.active-view {
    display: block;
    animation: viewEnter 0.35s ease-out;
}

.hidden,
.view.hidden {
    display: none !important;
}

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

/* =========================================
   Roblox Header & Navigation
   ========================================= */
.app-header.roblox-header {
    background: linear-gradient(180deg, #1C1E23 0%, #15171B 100%);
    color: #FFF;
    padding: 1.6rem 4% 1.2rem 4%;
    border-bottom: 4px solid var(--roblox-red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 4px 15px var(--roblox-red-glow);
    position: relative;
    z-index: 10;
    border-radius: 0 0 24px 24px;
    margin-bottom: 2rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Roblox Gamer Badge */
.user-info.roblox-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(36, 39, 45, 0.85);
    padding: 0.5rem 1.2rem 0.5rem 0.6rem;
    border-radius: 14px;
    border: 2px solid var(--roblox-border);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.1);
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.user-info.roblox-badge:hover {
    transform: translateY(-3px);
    border-color: var(--roblox-gold);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.user-profile {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    position: relative;
    background: #2A2D35;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--roblox-gold);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.gamer-lvl {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: linear-gradient(135deg, var(--roblox-red), #B3130C);
    color: #FFF;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #FFF;
    font-family: 'Changa', sans-serif;
    letter-spacing: 0.5px;
}

.user-text-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: #FFF;
    font-family: 'Changa', sans-serif;
    line-height: 1.2;
}

.user-sub {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--roblox-gold);
    letter-spacing: 0.5px;
    font-family: 'Changa', sans-serif;
}

/* 3D Roblox Cube Logo */
.logo.roblox-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.roblox-cube {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--roblox-red) 0%, #A5140D 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 0 #7A0C06, 0 0 20px var(--roblox-red-glow);
    transform: rotate(-8deg);
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo.roblox-logo:hover .roblox-cube {
    transform: rotate(0deg) scale(1.1);
}

.roblox-cube span {
    color: #FFF;
    font-family: 'Changa', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.logo-text h1 {
    font-size: 1.6rem;
    font-weight: 900;
    color: #FFF;
    font-family: 'Changa', sans-serif;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.logo-sub {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--roblox-blue);
    letter-spacing: 1px;
    font-family: 'Changa', sans-serif;
    display: block;
}

/* Header Nav Actions */
.header-nav-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border-radius: 12px;
    border: 2px solid var(--roblox-border);
    background: #24272D;
    color: #FFF;
    font-family: 'Changa', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 0 #121418;
    transition: all 0.2s ease;
}

.header-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 0 #121418, 0 0 15px rgba(0, 162, 255, 0.4);
    border-color: var(--roblox-blue);
    background: #2F333B;
}

.header-action-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #121418;
}

.header-action-btn.game-btn {
    border-color: rgba(0, 162, 255, 0.5);
    background: linear-gradient(135deg, #1A3450 0%, #152233 100%);
}

.header-action-btn.game-btn:hover {
    border-color: #00E5FF;
    box-shadow: 0 7px 0 #121418, 0 0 20px rgba(0, 229, 255, 0.5);
}

/* Welcome Hero Strip */
.header-hero-strip {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-strip-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    text-align: center;
}

.hero-gamer-greeting {
    font-family: 'Changa', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--roblox-gold);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.hero-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
}

.hero-subtitle {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* =========================================
   Lessons Grid & Adventure Cards
   ========================================= */
.lesson-path-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 1.1rem;
    margin: 1.2rem 0 2.5rem 0;
}

.lesson-adventure-card {
    background: #1E2127;
    border: 2px solid var(--roblox-border);
    border-radius: 15px;
    padding: 0.85rem 0.75rem;
    box-shadow: 0 5px 0 #121418, 0 8px 16px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    min-height: 215px;
}

.lesson-adventure-card:hover {
    transform: translateY(-5px);
    background: #262B34;
    border-color: var(--roblox-blue);
    box-shadow: 0 9px 0 #121418, 0 0 20px rgba(0, 162, 255, 0.4);
}

.lesson-adventure-card:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #121418;
}

.card-header-pill {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 4px;
}

.lesson-status-pill {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    font-family: 'Changa', sans-serif;
    line-height: 1.2;
}

.lesson-status-pill.completed {
    background: rgba(0, 176, 111, 0.2);
    color: var(--roblox-green);
    border: 1px solid rgba(0, 176, 111, 0.4);
}

.lesson-status-pill.new {
    background: rgba(0, 162, 255, 0.15);
    color: #52BFFF;
    border: 1px solid rgba(0, 162, 255, 0.35);
}

.card-stage-bubble {
    width: 68px;
    height: 68px;
    border-radius: 14px;
    background: #14161B;
    border: 2px solid var(--roblox-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.55rem;
    position: relative;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
    overflow: hidden;
    flex-shrink: 0;
}

.card-stage-bubble .stage-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 162, 255, 0.25) 0%, transparent 70%);
}

.card-masha-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.25s ease;
}

.lesson-adventure-card:hover .card-masha-img {
    transform: scale(1.1);
}

.card-info-section {
    width: 100%;
    text-align: center;
    margin-bottom: 0.55rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #FFF;
    font-family: 'Changa', sans-serif;
    line-height: 1.35;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.card-type-chip {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--roblox-gold);
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 1px 6px;
    border-radius: 6px;
    display: inline-block;
    white-space: nowrap;
}

.card-action-btn {
    width: 100%;
    padding: 0.42rem 0.6rem;
    background: linear-gradient(135deg, var(--roblox-red) 0%, #B81912 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    color: #FFF;
    border-radius: 9px;
    font-weight: 800;
    font-family: 'Changa', sans-serif;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 3px 0 #7A0C06;
    transition: all 0.2s ease;
}

.lesson-adventure-card:hover .card-action-btn {
    background: linear-gradient(135deg, var(--roblox-blue) 0%, #0070BA 100%);
    box-shadow: 0 3px 0 #004573;
    border-color: #70CFFF;
}

/* =========================================
   Lesson View Header & Navigation
   ========================================= */
.lesson-header-bar.roblox-lesson-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
    background: #1A1C20;
    padding: 1rem 1.8rem;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--roblox-border);
    border-right: 6px solid var(--roblox-red);
}

.roblox-btn {
    background: #24272D;
    border: 2px solid var(--roblox-border);
    color: #FFF;
    padding: 0.65rem 1.4rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: 'Changa', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 0 #121418;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.roblox-btn:hover {
    background: #333845;
    border-color: var(--roblox-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #121418, 0 0 15px rgba(0, 162, 255, 0.4);
}

.roblox-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #121418;
}

.roblox-btn.btn-gold {
    background: linear-gradient(135deg, #FFB300, #FF8F00);
    color: #241600;
    border-color: #FFE082;
    box-shadow: 0 4px 0 #A86400;
}

.roblox-btn.btn-gold:hover {
    box-shadow: 0 6px 0 #A86400, 0 0 20px rgba(255, 179, 0, 0.5);
}

.lesson-title-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lesson-bear-icon {
    font-size: 2rem;
}

#lesson-title-display {
    font-size: 1.6rem;
    font-weight: 900;
    color: #FFF;
    font-family: 'Changa', sans-serif;
}

/* --- Roblox Lesson Tabs --- */
.lesson-tabs.roblox-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-trigger {
    padding: 0.75rem 1.6rem;
    border: 2px solid var(--roblox-border);
    border-radius: 14px;
    background: #1E2127;
    color: var(--text-muted);
    font-weight: 800;
    font-family: 'Changa', sans-serif;
    cursor: pointer;
    transition: all 0.22s ease;
    font-size: 1.05rem;
    box-shadow: 0 4px 0 #121418;
}

.tab-trigger:hover {
    transform: translateY(-3px);
    border-color: var(--roblox-blue);
    color: #FFF;
    box-shadow: 0 6px 0 #121418, 0 0 15px rgba(0, 162, 255, 0.3);
}

.tab-trigger.active {
    background: linear-gradient(135deg, var(--roblox-blue) 0%, #0070BA 100%);
    color: #FFF;
    border-color: #70CFFF;
    box-shadow: 0 5px 0 #004573, 0 0 20px rgba(0, 162, 255, 0.5);
}

/* --- Tab Body & Panels --- */
.lesson-body.roblox-lesson-body {
    background: #1A1C20;
    border: 2px solid var(--roblox-border);
    border-radius: 24px;
    padding: 2.2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.tab-content {
    display: none;
    animation: tabSlideIn 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.tab-content.active {
    display: block;
}

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

/* =========================================
   1. Reader Tab
   ========================================= */
.lesson-cover-banner {
    margin-bottom: 1.8rem;
    width: 100%;
}

.lesson-banner-card {
    background: #24272D;
    border-radius: 18px;
    border: 2px solid var(--roblox-border);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 1.8rem;
}

.lesson-banner-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid var(--roblox-gold);
    flex-shrink: 0;
}

.lesson-banner-caption h3 {
    font-size: 1.4rem;
    color: #FFF;
    font-family: 'Changa', sans-serif;
    font-weight: 800;
    margin: 4px 0;
}

.lesson-banner-caption p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.banner-badge {
    background: var(--roblox-gold);
    color: #1A1C20;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: 10px;
    display: inline-block;
}

.section-header.roblox-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header.roblox-section-header h3 {
    font-size: 1.4rem;
    color: var(--roblox-gold);
    font-family: 'Changa', sans-serif;
    font-weight: 800;
}

.roblox-repeat-btn {
    background: linear-gradient(135deg, var(--roblox-blue), #0070BA);
    color: white;
    border: 2px solid #70CFFF;
    border-radius: 12px;
    padding: 0.65rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: 'Changa', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 0 #004573;
    transition: all 0.2s ease;
}

.roblox-repeat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #004573, 0 0 15px rgba(0, 162, 255, 0.5);
}

.info-bubble.roblox-info-bubble {
    background: rgba(0, 162, 255, 0.1);
    color: #52BFFF;
    border: 1px solid rgba(0, 162, 255, 0.3);
    padding: 0.85rem 1.4rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.text-display.roblox-text-display {
    background: #14161A;
    color: #FFF;
    padding: 3rem 2.2rem;
    border-radius: 20px;
    font-size: 2.2rem;
    line-height: 2.5;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
    text-align: center;
    border: 2px solid var(--roblox-border);
    border-top: 5px solid var(--roblox-red);
    font-family: 'Tajawal', sans-serif;
}

.reading-line {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.22s ease;
    margin: 4px 3px;
    border: 2px solid transparent;
}

.reading-line:hover {
    background: rgba(0, 162, 255, 0.18);
    border-color: var(--roblox-blue);
    color: #00E5FF;
    text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.reading-line.playing {
    background: linear-gradient(135deg, var(--roblox-red), #B81912);
    color: #FFFFFF;
    transform: scale(1.06);
    border-color: #FFA39E;
    box-shadow: 0 6px 20px rgba(226, 35, 26, 0.5);
}

/* =========================================
   2. Vocab Tab
   ========================================= */
.vocab-header-info h3 {
    font-size: 1.4rem;
    color: var(--roblox-gold);
    margin-bottom: 1.5rem;
    font-family: 'Changa', sans-serif;
}

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

.vocab-item {
    background: #24272D;
    border: 2px solid var(--roblox-border);
    border-top: 4px solid var(--roblox-gold);
    padding: 2rem 1.4rem;
    border-radius: 18px;
    text-align: center;
    transition: all 0.25s ease;
    cursor: pointer;
    box-shadow: 0 6px 0 #121418;
    position: relative;
}

.vocab-item::before {
    content: '💎';
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.vocab-item:hover {
    transform: translateY(-5px);
    border-color: var(--roblox-gold);
    box-shadow: 0 10px 0 #121418, 0 0 20px rgba(255, 215, 0, 0.3);
    background: #2C3038;
}

.vocab-word {
    font-size: 1.9rem;
    font-weight: 900;
    color: #FFF;
    margin-bottom: 0.8rem;
    font-family: 'Changa', sans-serif;
}

.vocab-meaning {
    color: #FFD700;
    font-size: 1.25rem;
    font-weight: 800;
    background: rgba(255, 215, 0, 0.1);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px dashed var(--roblox-gold);
    opacity: 0;
    transform: translateY(6px);
    transition: all 0.25s ease;
}

.vocab-item.flipped .vocab-meaning {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   3. Game Tab (Roblox Mini-Games)
   ========================================= */
.game-menu.roblox-game-menu h3 {
    text-align: center;
    color: var(--roblox-gold);
    font-size: 1.7rem;
    font-weight: 900;
    font-family: 'Changa', sans-serif;
    margin-bottom: 2rem;
}

.game-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.game-card-btn {
    background: #24272D;
    border: 2px solid var(--roblox-border);
    border-radius: 18px;
    padding: 2rem 1.4rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 0 #121418, 0 10px 20px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    color: #FFF;
    text-align: center;
}

.game-card-racing { border-top: 5px solid var(--roblox-blue); }
.game-card-shooting { border-top: 5px solid var(--roblox-gold); }
.game-card-jumping { border-top: 5px solid var(--roblox-green); }

.game-card-btn:hover {
    transform: translateY(-6px);
    background: #2D323B;
    border-color: var(--roblox-blue);
    box-shadow: 0 10px 0 #121418, 0 15px 30px rgba(0, 162, 255, 0.35);
}

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

.game-card-btn h4 {
    font-size: 1.35rem;
    font-family: 'Changa', sans-serif;
    font-weight: 800;
    color: #FFF;
}

.game-card-btn p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.game-arena {
    background: #141619;
    border-radius: 20px;
    padding: 2rem 1.8rem;
    border: 2px solid var(--roblox-border);
    border-top: 5px solid var(--roblox-blue);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    position: relative;
    overflow: hidden;
    min-height: 400px;
    margin-top: 1rem;
}

.game-arena-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.4rem;
}

.game-badge {
    background: rgba(0, 162, 255, 0.15);
    color: #52BFFF;
    padding: 6px 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1rem;
    border: 1px solid rgba(0, 162, 255, 0.35);
    font-family: 'Changa', sans-serif;
}

/* Racing Game Track */
.timer-bar {
    width: 100%;
    height: 10px;
    background: #24272D;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.timer-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--roblox-green), #00FF88);
}

.racing-track.roblox-track {
    width: 100%;
    height: 150px;
    border-bottom: 5px solid var(--roblox-border);
    position: relative;
    margin-bottom: 1.5rem;
    background: linear-gradient(180deg, #1C1E24 0%, #15171B 100%);
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.runner-character {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 3rem;
    transition: right 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), bottom 0.3s;
    z-index: 2;
}

.runner-character.jumping {
    bottom: 65px;
}

.bear-finish-house {
    position: absolute;
    bottom: 6px;
    left: 12px;
    font-size: 3rem;
    z-index: 1;
}

.obstacle {
    position: absolute;
    bottom: 15px;
    left: 22%;
    background: #24272D;
    padding: 0.8rem 1.6rem;
    border-radius: 14px;
    border: 2px solid var(--roblox-gold);
    font-weight: 800;
    color: #FFF;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
    z-index: 3;
    min-width: 160px;
    text-align: center;
    font-size: 1.2rem;
    font-family: 'Changa', sans-serif;
}

.racing-answers {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.racing-ans-btn {
    padding: 0.9rem 1.8rem;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Changa', sans-serif;
    background: #24272D;
    color: #FFF;
    border: 2px solid var(--roblox-border);
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 4px 0 #121418;
    transition: all 0.2s ease;
}

.racing-ans-btn:hover {
    background: #333845;
    border-color: var(--roblox-blue);
    transform: translateY(-3px);
    box-shadow: 0 7px 0 #121418, 0 0 15px rgba(0, 162, 255, 0.4);
}

/* Shooting Game */
.shooting-title {
    text-align: center;
    color: #FFF;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Changa', sans-serif;
}

.shooting-area {
    position: relative;
    width: 100%;
    height: 350px;
    background: #0E1013;
    border-radius: 16px;
    border: 2px solid var(--roblox-border);
    overflow: hidden;
}

.moving-target {
    position: absolute;
    padding: 0.9rem 1.6rem;
    background: linear-gradient(135deg, var(--roblox-blue), #0070BA);
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 15px rgba(0, 162, 255, 0.4);
    border: 2px solid #70CFFF;
    transition: all 0.22s ease;
    font-family: 'Changa', sans-serif;
}

.moving-target::before {
    content: '💎 ';
}

.moving-target:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.7);
}

.moving-target.hit {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* Jumping Game */
.jumping-title {
    text-align: center;
    color: #FFF;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Changa', sans-serif;
}

.jumping-sky.roblox-sky {
    position: relative;
    width: 100%;
    height: 380px;
    background: linear-gradient(180deg, #0A1118 0%, #151F2C 100%);
    border-radius: 16px;
    border: 2px solid var(--roblox-border);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 1.5rem;
    overflow: hidden;
}

.jumper-character {
    font-size: 3rem;
    position: absolute;
    bottom: 15px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

.bear-at-top {
    position: absolute;
    top: 12px;
    font-size: 2.8rem;
    z-index: 1;
}

.clouds-container {
    width: 100%;
    display: flex;
    justify-content: space-around;
    position: absolute;
    bottom: 95px;
    z-index: 3;
    flex-wrap: wrap;
    gap: 10px;
}

.cloud-platform {
    background: #24272D;
    color: #FFF;
    padding: 0.8rem 1.6rem;
    border-radius: 14px;
    font-weight: 800;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #121418;
    border: 2px solid var(--roblox-border);
    transition: all 0.22s ease;
    font-family: 'Changa', sans-serif;
}

.cloud-platform::before {
    content: '🧱 ';
}

.cloud-platform:hover {
    transform: translateY(-4px);
    border-color: var(--roblox-gold);
    box-shadow: 0 7px 0 #121418, 0 0 18px rgba(255, 215, 0, 0.4);
}

/* =========================================
   4. Writing Tab
   ========================================= */
.writing-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
    min-width: 300px;
    background: #1A1C20;
    padding: 2rem;
    border-radius: 20px;
    border: 2px solid var(--roblox-border);
}

#write-canvas {
    background: #0E1013;
    border-radius: 16px;
    border: 3px solid var(--roblox-border);
    cursor: crosshair;
    width: 100%;
    max-width: 900px;
    height: 380px;
    display: block;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
}

/* =========================================
   5. Quiz Tab
   ========================================= */
.quiz-card.roblox-quiz-card {
    background: #14161A;
    border-radius: 20px;
    padding: 2.8rem 2rem;
    border: 2px solid var(--roblox-border);
    border-top: 5px solid var(--roblox-gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    text-align: center;
    max-width: 750px;
    margin: 0 auto;
}

.quiz-card h3 {
    font-size: 1.8rem;
    color: #FFF;
    margin-bottom: 2rem;
    font-family: 'Changa', sans-serif;
    font-weight: 800;
}

.option-btn {
    width: 100%;
    text-align: right;
    font-size: 1.25rem;
    padding: 1.1rem 1.8rem;
    border-radius: 14px;
    border: 2px solid var(--roblox-border);
    background: #24272D;
    color: #FFF;
    transition: all 0.22s ease;
    box-shadow: 0 4px 0 #121418;
}

.option-btn:hover {
    background: #323640;
    border-color: var(--roblox-blue);
    box-shadow: 0 6px 0 #121418, 0 0 15px rgba(0, 162, 255, 0.4);
}

/* =========================================
   Modals (Checklist, Success, Drawing)
   ========================================= */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content.roblox-modal {
    background: #1A1C20;
    border: 2px solid var(--roblox-gold);
    border-radius: 24px;
    padding: 2.4rem;
    text-align: center;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.25);
    color: #FFF;
}

.celebration-icon {
    font-size: 4.5rem;
    margin-bottom: 0.8rem;
}

.celebration-content h2 {
    font-size: 1.8rem;
    font-family: 'Changa', sans-serif;
    color: var(--roblox-gold);
    margin-bottom: 0.6rem;
}

.celebration-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 700;
}

.reward-stars {
    font-size: 2.6rem;
    margin: 1.4rem 0;
}

/* Checklist Items */
.checklist-item {
    display: flex;
    align-items: center;
    background: #24272D;
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid var(--roblox-border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.checklist-item:hover {
    border-color: var(--roblox-blue);
    background: #2E323A;
}

.checklist-item.completed {
    background: rgba(0, 176, 111, 0.15);
    border-color: var(--roblox-green);
}

.checklist-item.completed .checklist-title {
    color: #00FF88;
    text-decoration: line-through;
}

.checklist-checkbox {
    width: 22px;
    height: 22px;
    margin-left: 12px;
    accent-color: var(--roblox-green);
    cursor: pointer;
}

.checklist-title {
    font-size: 1.15rem;
    font-weight: 800;
    flex-grow: 1;
    color: #FFF;
    font-family: 'Changa', sans-serif;
}

/* Drawing Studio Modal */
.drawing-studio-content.roblox-modal {
    max-width: 820px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.8rem;
    border-radius: 24px;
    background: #1A1C20;
    border: 2px solid var(--roblox-border);
}

.studio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid var(--roblox-border);
    padding-bottom: 0.8rem;
}

.studio-title-box h2 {
    font-size: 1.5rem;
    font-family: 'Changa', sans-serif;
    color: var(--roblox-gold);
}

.close-studio-btn {
    background: #24272D;
    border: 2px solid var(--roblox-border);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    transition: all 0.2s ease;
}

.close-studio-btn:hover {
    background: var(--roblox-red);
    border-color: #FFA39E;
    transform: rotate(90deg);
}

.drawing-challenge-banner {
    background: #24272D;
    border: 2px solid var(--roblox-border);
    border-radius: 16px;
    padding: 1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin-bottom: 1.2rem;
}

.challenge-masha-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--roblox-gold);
}

.challenge-text h3 {
    font-family: 'Changa', sans-serif;
    color: var(--roblox-gold);
    margin-bottom: 4px;
}

.challenge-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

#masha-draw-canvas {
    background: #0E1013;
    border-radius: 16px;
    border: 2px solid var(--roblox-border);
    cursor: crosshair;
    width: 100%;
    height: 380px;
    display: block;
}

.studio-tools-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.color-palette {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 2px solid #FFF;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    outline: 3px solid var(--roblox-gold);
    transform: scale(1.15);
}

.brush-size-picker {
    display: flex;
    gap: 8px;
}

.size-btn {
    padding: 6px 14px;
    background: #24272D;
    border: 2px solid var(--roblox-border);
    color: #FFF;
    border-radius: 10px;
    font-family: 'Changa', sans-serif;
    font-weight: 800;
    cursor: pointer;
}

.size-btn.active {
    background: var(--roblox-blue);
    border-color: #70CFFF;
}

.studio-actions-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 1rem;
}

/* =========================================
   7-Second Roblox Celebration & Laser Show
   ========================================= */
.roblox-screen-lasers {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 99999;
    display: none;
}

.roblox-screen-lasers.active {
    display: block;
    animation: laserPulseScreen 0.25s infinite alternate;
}

@keyframes laserPulseScreen {
    0% {
        box-shadow: 
            inset 0 0 50px rgba(226, 35, 26, 0.8),
            inset 0 0 100px rgba(0, 162, 255, 0.4);
    }
    50% {
        box-shadow: 
            inset 0 0 70px rgba(255, 215, 0, 0.9),
            inset 0 0 120px rgba(0, 176, 111, 0.6);
    }
    100% {
        box-shadow: 
            inset 0 0 60px rgba(0, 162, 255, 0.9),
            inset 0 0 110px rgba(226, 35, 26, 0.7);
    }
}

.roblox-powerup-toast {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FFB300 0%, #E2231A 100%);
    color: #FFF;
    padding: 14px 34px;
    border-radius: 50px;
    border: 3px solid #FFF;
    box-shadow: 0 10px 40px rgba(226, 35, 26, 0.8), 0 0 30px rgba(255, 215, 0, 0.9);
    font-family: 'Changa', sans-serif;
    font-weight: 900;
    font-size: 1.35rem;
    z-index: 100000;
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    white-space: nowrap;
}

.roblox-powerup-toast.show {
    top: 35px;
}

.roblox-burst-particle {
    position: fixed;
    font-size: 2rem;
    pointer-events: none;
    z-index: 999999;
    user-select: none;
}

@keyframes robloxParticleExplode {
    0% {
        transform: translate(0, 0) scale(0.3) rotate(0deg);
        opacity: 1;
    }
    60% {
        opacity: 1;
        transform: translate(var(--dest-x), var(--dest-y)) scale(1.4) rotate(240deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dest-x), calc(var(--dest-y) + 80px)) scale(0.6) rotate(360deg);
    }
}

.user-info.roblox-badge.roblox-supercharged {
    animation: badgeSupercharge 0.3s infinite alternate !important;
    border-color: #FFD700 !important;
}

@keyframes badgeSupercharge {
    0% {
        transform: scale(1.05) rotate(-2deg);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.9), 0 0 50px rgba(226, 35, 26, 0.6);
    }
    100% {
        transform: scale(1.09) rotate(2deg);
        box-shadow: 0 0 35px rgba(0, 162, 255, 0.9), 0 0 60px rgba(255, 215, 0, 0.8);
    }
}

body.roblox-party-mode {
    animation: partyFlicker 0.4s infinite alternate;
}

@keyframes partyFlicker {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.12); }
}

/* =========================================
   Footer
   ========================================= */
.app-footer.roblox-footer {
    text-align: center;
    padding: 2.2rem 1rem;
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 2;
}

.footer-link {
    color: #9DA3AE;
    text-decoration: none;
    font-family: 'Cairo', 'Changa', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 8px 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.25s ease;
    display: inline-block;
}

.footer-link:hover {
    color: #00E5FF;
    background: rgba(0, 229, 255, 0.1);
    border-color: #00E5FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(0, 229, 255, 0.35);
}

/* =========================================
   Walking Roblox SVG Characters Animation
   ========================================= */
.roblox-walkers-stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99998;
    overflow: hidden;
    transition: opacity 0.8s ease;
}

.roblox-walkers-stage.fade-out {
    opacity: 0;
}

.roblox-walker {
    position: absolute;
    width: 88px;
    height: 140px;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    z-index: 99999;
}

.roblox-walker:hover {
    filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.8));
}

.roblox-character-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Direction flipping */
.roblox-walker.dir-rtl .roblox-character-svg {
    transform: scaleX(1);
}

.roblox-walker.dir-ltr .roblox-character-svg {
    transform: scaleX(-1);
}

/* Walking Limb Cycle */
.roblox-limb.roblox-arm-left {
    transform-origin: 17px 46px;
    animation: robloxArmWalkLeft 0.5s infinite alternate ease-in-out;
}

.roblox-limb.roblox-arm-right {
    transform-origin: 83px 46px;
    animation: robloxArmWalkRight 0.5s infinite alternate ease-in-out;
}

.roblox-limb.roblox-leg-left {
    transform-origin: 37px 94px;
    animation: robloxLegWalkLeft 0.5s infinite alternate ease-in-out;
}

.roblox-limb.roblox-leg-right {
    transform-origin: 63px 94px;
    animation: robloxLegWalkRight 0.5s infinite alternate ease-in-out;
}

.roblox-body-group {
    animation: robloxTorsoBob 0.25s infinite alternate ease-in-out;
}

@keyframes robloxArmWalkLeft {
    0% { transform: rotate(-28deg); }
    100% { transform: rotate(28deg); }
}

@keyframes robloxArmWalkRight {
    0% { transform: rotate(28deg); }
    100% { transform: rotate(-28deg); }
}

@keyframes robloxLegWalkLeft {
    0% { transform: rotate(24deg); }
    100% { transform: rotate(-24deg); }
}

@keyframes robloxLegWalkRight {
    0% { transform: rotate(-24deg); }
    100% { transform: rotate(24deg); }
}

@keyframes robloxTorsoBob {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

/* Speech Bubble */
.walker-speech-bubble {
    background: rgba(20, 22, 26, 0.95);
    border: 2px solid var(--roblox-gold);
    color: #FFF;
    border-radius: 12px;
    padding: 4px 10px;
    font-family: 'Changa', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 215, 0, 0.3);
    margin-bottom: 5px;
    animation: speechBob 1.5s infinite ease-in-out;
    pointer-events: none;
}

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

/* Walking Across Tracks */
.walker-path-1 {
    bottom: 20px;
    animation: walkTrackRtl 8.5s linear forwards;
}

.walker-path-2 {
    bottom: 55px;
    animation: walkTrackLtr 7.8s linear 0.4s forwards;
}

.walker-path-3 {
    bottom: 95px;
    animation: walkTrackRtl 9.2s linear 0.8s forwards;
}

.walker-path-4 {
    bottom: 35px;
    animation: walkTrackLtr 6.8s linear 1.2s forwards;
}

@keyframes walkTrackRtl {
    0% {
        left: 105vw;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: -130px;
        opacity: 0;
    }
}

@keyframes walkTrackLtr {
    0% {
        left: -130px;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 105vw;
        opacity: 0;
    }
}

/* Click acrobatic flip */
.roblox-walker.jump-flip {
    animation: robloxAcrobaticFlip 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes robloxAcrobaticFlip {
    0% { transform: translateY(0) rotate(0deg) scale(1); }
    50% { transform: translateY(-90px) rotate(-180deg) scale(1.2); }
    100% { transform: translateY(0) rotate(-360deg) scale(1); }
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 768px) {
    .app-header.roblox-header { padding: 1.2rem 4%; }
    .header-top { flex-direction: column; gap: 0.9rem; text-align: center; }
    .header-nav-actions { justify-content: center; width: 100%; }
    .hero-strip-content { flex-direction: column; gap: 0.3rem; }
    .lesson-path-container { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.8rem; }
}
