:root {
    --primary: #007bff;
    --bg-main: #f4f7fe;
    --bg-side: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #5f6368;
    --border: #f0f2f5;
    --sidebar-width: 280px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0b1120;
    --bg-side: #111827;
    --text-main: #f3f4f6;
    --text-muted: #a0aec0;
    --border: #1f2937;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    display: flex;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-side);
    position: fixed;
    left: 0; top: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-logo {
    display: flex; align-items: center; gap: 15px;
    padding: 30px 25px;
}

.logo-wrapper {
    width: 45px; height: 45px;
    background: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.logo-text { font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.logo-text span { color: var(--primary); }

.nav-menu { flex: 1; padding: 0 15px; }

.nav-item {
    display: flex; align-items: center;
    padding: 14px 18px;
    text-decoration: none; color: var(--text-muted);
    border-radius: 14px; margin-bottom: 5px;
    font-weight: 600; transition: 0.2s;
}

.nav-item i { font-size: 18px; width: 30px; }

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 16px rgba(0, 123, 255, 0.2);
}

.nav-item:hover:not(.active) { background: rgba(0, 123, 255, 0.1); color: var(--primary); }

.sidebar-footer { padding: 20px; border-top: 1px solid var(--border); }
.theme-switch {
    width: 100%; border: none; background: var(--bg-main);
    padding: 12px; border-radius: 12px; cursor: pointer;
    color: var(--text-main); font-weight: 600;
    display: flex; align-items: center; gap: 10px; justify-content: center;
}

/* --- MAIN CONTENT --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1; padding: 40px;
    box-sizing: border-box;
}

.hero-banner {
    background: linear-gradient(135deg, #007bff, #00f2fe);
    border-radius: 30px; padding: 50px; color: white;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 20px 40px rgba(0, 123, 255, 0.2);
}

.typing-box { background: rgba(255,255,255,0.2); padding: 6px 15px; border-radius: 50px; display: inline-block; font-size: 13px; margin-bottom: 15px; }
.hero-text h1 { font-size: 2.8rem; margin: 0 0 15px 0; font-weight: 800; }
.btn-start { background: white; color: var(--primary); padding: 14px 30px; border-radius: 14px; text-decoration: none; font-weight: 800; display: inline-block; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.hero-stats { display: flex; gap: 20px; background: rgba(255,255,255,0.2); padding: 20px; border-radius: 20px; backdrop-filter: blur(10px); }
.stat-card { text-align: center; }
.stat-card b { display: block; font-size: 22px; }
.stat-sep { width: 1px; background: rgba(255,255,255,0.3); }

/* --- GAMES GRID --- */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px; margin-top: 30px;
}

.game-card {
    background: var(--bg-side); border-radius: 28px;
    padding: 35px; text-decoration: none; color: var(--text-main);
    border: 1px solid var(--border); transition: 0.4s;
    position: relative; overflow: hidden; display: flex; flex-direction: column;
}

.game-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.05); }

.game-card::after {
    content: ""; position: absolute; width: 150px; height: 150px;
    background: var(--card-color); opacity: 0.08;
    border-radius: 50%; top: -50px; right: -50px;
}

.card-icon {
    width: 60px; height: 60px; background: var(--card-color);
    border-radius: 18px; display: flex; align-items: center; justify-content: center;
    color: white; font-size: 24px; margin-bottom: 25px;
}

.play-link { color: var(--card-color); font-weight: 800; display: flex; align-items: center; gap: 8px; margin-top: auto; }

/* --- МОБИЛДИК АДАПТАЦИЯ (ТЕЛЕФОН ҮЧҮН) --- */
.mobile-header { display: none; }
.overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 999; display: none; backdrop-filter: blur(4px); }

@media (max-width: 992px) {
    .sidebar { left: -100%; width: 280px; }
    .sidebar.active { left: 0; }
    .main-content { margin-left: 0; padding: 100px 20px 20px 20px; }
    .mobile-header { display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 70px; background: var(--bg-side); z-index: 1050; border-bottom: 1px solid var(--border); align-items: center; justify-content: space-between; padding: 0 20px; box-sizing: border-box; }
    .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
    .logo i { color: var(--primary); }
    .hamburger { background: none; border: none; font-size: 24px; color: var(--primary); cursor: pointer; }
    .overlay.active { display: block; }
    .hero-banner { flex-direction: column; text-align: center; gap: 30px; padding: 40px 20px; }
    .hero-text h1 { font-size: 2rem; }
}

/* КИЧИНЕКЕЙ КАРТОЧКАЛАРДЫН СЕТКАСЫ */
.mini-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Карточкаларды кичине кылат */
    gap: 15px;
    padding: 20px 0;
}

/* КИЧИНЕ КАРТОЧКА СТИЛИ */
.mini-card {
    background: var(--bg-side, #ffffff);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    border: 1px solid var(--border, #f0f2f5);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.mini-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* КАРТОЧКА ИКОНКАСЫ */
.mini-icon {
    width: 45px;
    height: 45px;
    background: var(--accent-color);
    opacity: 0.15; /* Өтө ачык түс */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    font-size: 18px;
    position: relative;
}

/* Иконканын ичиндеги чыныгы түстөгү белги */
.mini-icon i {
    position: absolute;
    opacity: 1;
}

/* МААЛЫМАТ БӨЛҮМҮ */
.mini-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-main, #1a1a1a);
}

.mini-info span {
    font-size: 13px;
    color: var(--text-muted, #5f6368);
    display: block;
    margin-top: 4px;
}

/* АРТКА БАСКЫЧЫ */
.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.btn-back {
    background: #f0f2f5;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.btn-back:hover {
    background: #e2e8f0;
}
/* --- ГЛОБАЛДЫК ӨЗГӨРМӨЛӨР --- */
:root {
    --primary: #007bff;
    --bg-main: #f4f7fe;
    --bg-side: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #5f6368;
    --border: #f0f2f5;
    --sidebar-width: 280px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ТҮН РЕЖИМИ ҮЧҮН ТҮСТӨР */
[data-theme="dark"] {
    --bg-main: #0b1120;
    --bg-side: #111827;
    --text-main: #f3f4f6;
    --text-muted: #a0aec0;
    --border: #1f2937;
}

/* --- САЙДБАРДЫН НЕГИЗГИ СТИЛИ --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-side);
    position: fixed;
    left: 0; top: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

/* Логотиптин дизайны */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 30px 25px;
}

.logo-wrapper {
    width: 45px; height: 45px;
    background: var(--primary);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Категориялардын аталыштары (Оюндар, Мугалимдерге) */
.menu-label {
    padding: 20px 25px 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Менюнун элементтери */
.nav-menu { flex: 1; overflow-y: auto; padding: 0 15px; }

.nav-item {
    display: flex; align-items: center;
    padding: 14px 18px;
    text-decoration: none; color: var(--text-muted);
    border-radius: 14px; margin-bottom: 5px;
    font-weight: 600; transition: 0.2s;
}

.nav-item i { font-size: 18px; width: 30px; }

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 16px rgba(0, 123, 255, 0.2);
}

.nav-item:hover:not(.active) {
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary);
}

/* Сайдбардын асты (Түн режими) */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.theme-switch {
    width: 100%; border: none; background: var(--bg-main);
    padding: 12px; border-radius: 12px; cursor: pointer;
    color: var(--text-main); font-weight: 600;
    display: flex; align-items: center; gap: 10px; justify-content: center;
}

/* --- МОБИЛДИК АДАПТАЦИЯ (БУЗУЛБАЙ ТУРГАН КЫЛЫП) --- */
@media (max-width: 992px) {
    .sidebar {
        left: -100%; /* Телефондо жашыруу */
        box-shadow: 15px 0 40px rgba(0,0,0,0.1);
    }

    /* Меню ачылганда ушул класс кошулат */
    .sidebar.active {
        left: 0;
    }

    /* Контентти сайдбардын ордуна жылдыруу */
    .main-content {
        margin-left: 0 !important;
        padding-top: 80px !important;
    }
}

/* 1. ЖАЛПЫ САЙДБАРДЫ КЫСУУ */
.sidebar {
    width: 260px !important; /* Бир аз ичкерттик */
    padding: 10px !important; /* Ашыкча боштукту алып салдык */
}

/* 2. ЛОГОТИПТИН ӨЛЧӨМҮН ТҮЗДӨӨ */
.sidebar-logo {
    padding: 15px 10px !important;
    margin-bottom: 10px !important;
}

/* 3. МЕНЮЛАРДЫН ОРТОСУН ЖАКЫНДАТУУ */
.nav-item {
    padding: 8px 12px !important; /* Скриншоттогудай ичке кылдык */
    margin-bottom: 2px !important; /* Менюлардын ортосун жакындаттык */
    border-radius: 12px !important;
}

/* 4. ИКОНКАЛАР ЖАНА ТЕКСТ */
.icon-box {
    width: 32px !important;  /* Кичирейттик */
    height: 32px !important; /* Кичирейттик */
    margin-right: 10px !important;
    font-size: 14px !important;
}

.nav-item span {
    font-size: 13.5px !important; /* Шрифти кичирейттик */
    font-weight: 600 !important;
}

/* 5. КАТЕГОРИЯ АТАЛЫШТАРЫ (ОЮНДАР, МУГАЛИМДЕРГЕ) */
.menu-label {
    padding: 12px 0 5px 12px !important; /* Ашыкча отступ жок */
    font-size: 10px !important;
    letter-spacing: 0.5px !important;
}

/* 6. ХИТ ТАГЫН КИЧИНЕ КЫЛУУ */
.hit-tag {
    font-size: 8px !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
}

/* 1. НЕГИЗГИ САЙДБАР (КОМПАКТТУУ) */


/* 2. МЕНЮ ЭЛЕМЕНТТЕРИ (ЖАКЫН ЖАЙГАШКАН) */
.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0 5px !important;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 12px !important; /* Ичке отступ */
    margin-bottom: 2px !important; /* Аралыгы абдан жакын */
    text-decoration: none;
    border-radius: 10px !important;
    transition: 0.2s;
}

/* ИКОНКА КУТУЧАСЫ */
.icon-box {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px !important;
    font-size: 14px !important;
}

/* ТЕКСТ ШРИФТИ */
.nav-item span {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #475569;
}

/* КАТЕГОРИЯЛАР (ОЮНДАР, МУГАЛИМДЕРГЕ) */
.menu-label {
    
    padding: 10px;
    font-size: 10px !important;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #007bff, #00f2fe);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top-right-radius: 60px;
}

/* --- ХИТ БЕЛГИСИ ЖАНА АНИМАЦИЯ --- */
.hit-tag {
    margin-left: auto;
    background: #ff4757; /* Кызыл түс */
    color: white !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 6px;
    font-weight: 800;
}

/* Очуп-жануу анимациясы */
.pulse {
    animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(255, 71, 87, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

/* АКТИВДҮҮ МЕНЮ СТИЛИ (СКРИНШОТТОГУДАЙ) */
.nav-item.active {
    background: #f1f5f9 !important;
}

.nav-item.active .icon-box {
    background: #007bff !important;
    color: white !important;
    text-align: center;
}



/* КАРТОЧКАЛАР СЕТКАСЫ (Бир катарда 4төн баткыдай) */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

/* НЕГИЗГИ КАРТОЧКА СТИЛИ */
.sub-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    text-decoration: none;
    color: #1e293b;
    position: relative;
    overflow: hidden; /* Фигура сыртка чыкпоо үчүн */
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

/* ОҢ ЖАКТАГЫ ФИГУРА (ТЕГЕРЕК) */
.sub-card::before {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--card-color);
    opacity: 0.05;
    border-radius: 50%;
    top: -30px;
    right: -30px;
    transition: all 0.4s ease; /* Фигуранын анимациясы */
    z-index: 0;
}

/* HOVER ЭФФЕКТИ (Мышка барганда) */
.sub-card:hover {
    transform: scale(1.03); /* Карточка бир аз чоңоёт */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--card-color);
}

.sub-card:hover::before {
    transform: scale(1.4); /* Фигура чоңоёт */
    opacity: 0.12; /* Түсү каныкыраак болот */
}

/* ИКОНКА, ТЕКСТ ЖАНА БАСКЫЧ */
.sub-icon {
    width: 44px;
    height: 44px;
    background: var(--card-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    margin-bottom: 15px;
    z-index: 1;
}

.sub-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px 0;
    z-index: 1;
}

.sub-card p {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 20px 0;
    z-index: 1;
}

.sub-play {
    font-size: 13px;
    font-weight: 700;
    color: var(--card-color);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    z-index: 1;
}

.sub-play i {
    transition: transform 0.3s ease;
}

.sub-card:hover .sub-play i {
    transform: translateX(5px); /* Жебенин анимациясы */
}

