/* CSS переменные и базовые стили для gaming.html */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-header: #1a237e;
    --text-primary: #212121;
    --text-secondary: #757575;
    --accent-red: #d32f2f;
    --accent-black: #000000;
    --accent-green: #4caf50;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-theme {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-header: #121212;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-red: #f44336;
    --accent-black: #000000;
    --accent-green: #66bb6a;
    --border-color: #424242;
    --card-bg: #2d2d2d;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(211, 47, 47, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    padding-top: 80px;
}

/* Header */
.header {
    background: var(--bg-header);
    padding: 15px 0;
    box-shadow: 0 2px 10px var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
}

.header.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 20px var(--shadow);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(211, 47, 47, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(0, 0, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.logo-link {
    text-decoration: none;
    transition: opacity 0.3s;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    margin: 0;
    transition: transform 0.3s;
}

.logo-link:hover .logo {
    transform: scale(1.05);
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
    justify-content: center;
    margin: 0 20px;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-red);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.nav-link.active {
    color: #ffffff;
    font-weight: 600;
}

/* Специальные стили для кнопки "Играть" */
.nav-link[href="gaming.html"],
.nav-link[href="https://game.yahyagameinc.com"],
.nav-link[href*="game.yahyagameinc.com"] {
    background: transparent;
    border: none;
    padding: 8px 0;
    margin: 0 10px;
    font-weight: 700;
    font-size: 18px;
    position: relative;
    transition: all 0.3s ease;
    letter-spacing: 1.2px;
    color: var(--accent-red);
    text-shadow: 
        0 0 10px rgba(229, 57, 53, 0.8),
        0 0 20px rgba(229, 57, 53, 0.5),
        0 0 30px rgba(229, 57, 53, 0.3),
        -2px -2px 0 rgba(0, 0, 0, 0.8),
        2px -2px 0 rgba(0, 0, 0, 0.8),
        -2px 2px 0 rgba(0, 0, 0, 0.8),
        2px 2px 0 rgba(0, 0, 0, 0.8),
        -1px -1px 0 var(--accent-red),
        1px -1px 0 var(--accent-red),
        -1px 1px 0 var(--accent-red),
        1px 1px 0 var(--accent-red);
    animation: navPlayBounce 3s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(229, 57, 53, 0.6));
}

.nav-link[href="gaming.html"]::before,
.nav-link[href="https://game.yahyagameinc.com"]::before,
.nav-link[href*="game.yahyagameinc.com"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 20px);
    height: calc(100% + 10px);
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.1) 0%, transparent 50%, rgba(229, 57, 53, 0.1) 100%);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.nav-link[href="gaming.html"]::after,
.nav-link[href="https://game.yahyagameinc.com"]::after,
.nav-link[href*="game.yahyagameinc.com"]::after {
    width: 0;
    height: 0;
    display: none;
}

.nav-link[href="gaming.html"]:hover {
    color: #ff4444;
    text-shadow: 
        0 0 15px rgba(255, 68, 68, 1),
        0 0 25px rgba(255, 68, 68, 0.7),
        0 0 35px rgba(255, 68, 68, 0.4),
        -2px -2px 0 rgba(0, 0, 0, 0.9),
        2px -2px 0 rgba(0, 0, 0, 0.9),
        -2px 2px 0 rgba(0, 0, 0, 0.9),
        2px 2px 0 rgba(0, 0, 0, 0.9),
        -1.5px -1.5px 0 #ff4444,
        1.5px -1.5px 0 #ff4444,
        -1.5px 1.5px 0 #ff4444,
        1.5px 1.5px 0 #ff4444;
    filter: drop-shadow(0 0 12px rgba(255, 68, 68, 0.8));
    transform: translateY(-2px) scale(1.05);
    animation: none;
}

.nav-link[href="gaming.html"]:hover::before,
.nav-link[href="https://game.yahyagameinc.com"]:hover::before,
.nav-link[href*="game.yahyagameinc.com"]:hover::before {
    opacity: 1;
}

.nav-link[href="gaming.html"].active {
    color: var(--accent-red);
    text-shadow: 
        0 0 12px rgba(229, 57, 53, 0.9),
        0 0 22px rgba(229, 57, 53, 0.6),
        0 0 32px rgba(229, 57, 53, 0.4),
        -2px -2px 0 rgba(0, 0, 0, 0.8),
        2px -2px 0 rgba(0, 0, 0, 0.8),
        -2px 2px 0 rgba(0, 0, 0, 0.8),
        2px 2px 0 rgba(0, 0, 0, 0.8),
        -1.5px -1.5px 0 var(--accent-red),
        1.5px -1.5px 0 var(--accent-red),
        -1.5px 1.5px 0 var(--accent-red),
        1.5px 1.5px 0 var(--accent-red);
    filter: drop-shadow(0 0 10px rgba(229, 57, 53, 0.7));
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 3px;
    transition: all 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 24px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding-bottom: 40px;
}

/* Info Section */
.info-banner {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-black) 100%);
    padding: 30px 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--shadow);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

.info-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 0, 0, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.info-banner h2 {
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.info-text {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px var(--shadow);
    line-height: 1.8;
    animation: fadeInUp 0.6s ease-out;
    border-left: 4px solid var(--accent-red);
}

.info-text p {
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--text-primary);
}

.info-text strong {
    color: var(--accent-red);
    font-weight: bold;
}

/* Quizzes Section */
.quizzes-section {
    margin-top: 40px;
}

.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.quizzes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.quiz-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.quiz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(211, 47, 47, 0.1), transparent);
    transition: left 0.5s;
}

.quiz-card:hover::before {
    left: 100%;
}

.quiz-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 8px 25px var(--shadow);
    border: 2px solid var(--accent-red);
}

.quiz-card:nth-child(1) { animation-delay: 0.1s; }
.quiz-card:nth-child(2) { animation-delay: 0.2s; }
.quiz-card:nth-child(3) { animation-delay: 0.3s; }
.quiz-card:nth-child(4) { animation-delay: 0.4s; }
.quiz-card:nth-child(5) { animation-delay: 0.5s; }
.quiz-card:nth-child(6) { animation-delay: 0.6s; }

.quiz-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
    transition: transform 0.3s;
    display: inline-block;
}

.quiz-card:hover .quiz-icon {
    transform: scale(1.2) rotate(5deg);
    animation: bounce 0.6s ease;
}

.quiz-card h4 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.quiz-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    flex: 1;
}

.quiz-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.start-quiz-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-black) 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.start-quiz-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.start-quiz-btn:hover::before {
    width: 300px;
    height: 300px;
}

.start-quiz-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
}

.start-quiz-btn:active {
    transform: scale(0.98);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 14px;
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1.2) rotate(5deg);
    }
    50% {
        transform: scale(1.3) rotate(-5deg);
    }
}

@keyframes navPlayBounce {
    0%, 90%, 100% {
        transform: translateY(0) scale(1);
    }
    92% {
        transform: translateY(-8px) scale(1.05);
    }
    94% {
        transform: translateY(-4px) scale(1.02);
    }
    96% {
        transform: translateY(-6px) scale(1.03);
    }
    98% {
        transform: translateY(-2px) scale(1.01);
    }
}

/* Мобильные стили */
@media (max-width: 768px) {
    .header {
        padding: 12px 0;
    }

    .header-content {
        flex-wrap: nowrap;
    }

    .logo {
        font-size: 18px;
    }

    .main-nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--bg-header);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 20px var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        gap: 0;
        z-index: 999;
        margin: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        width: 100%;
        padding: 15px 0;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link[href="gaming.html"],
    .nav-link[href="https://game.yahyagameinc.com"],
    .nav-link[href*="game.yahyagameinc.com"] {
        background: transparent;
        border: none;
        padding: 15px 0;
        margin: 0;
        font-weight: 700;
        font-size: 17px;
        letter-spacing: 1.2px;
        color: var(--accent-red);
        text-shadow: 
            0 0 10px rgba(229, 57, 53, 0.8),
            0 0 20px rgba(229, 57, 53, 0.5),
            -2px -2px 0 rgba(0, 0, 0, 0.8),
            2px -2px 0 rgba(0, 0, 0, 0.8),
            -2px 2px 0 rgba(0, 0, 0, 0.8),
            2px 2px 0 rgba(0, 0, 0, 0.8),
            -1px -1px 0 var(--accent-red),
            1px -1px 0 var(--accent-red),
            -1px 1px 0 var(--accent-red),
            1px 1px 0 var(--accent-red);
        filter: drop-shadow(0 0 8px rgba(229, 57, 53, 0.6));
        animation: navPlayBounce 3s ease-in-out infinite;
    }

    .nav-link[href="gaming.html"]:hover,
    .nav-link[href="https://game.yahyagameinc.com"]:hover,
    .nav-link[href*="game.yahyagameinc.com"]:hover {
        color: #ff4444;
        text-shadow: 
            0 0 15px rgba(255, 68, 68, 1),
            0 0 25px rgba(255, 68, 68, 0.7),
            -2px -2px 0 rgba(0, 0, 0, 0.9),
            2px -2px 0 rgba(0, 0, 0, 0.9),
            -2px 2px 0 rgba(0, 0, 0, 0.9),
            2px 2px 0 rgba(0, 0, 0, 0.9),
            -1.5px -1.5px 0 #ff4444,
            1.5px -1.5px 0 #ff4444,
            -1.5px 1.5px 0 #ff4444,
            1.5px 1.5px 0 #ff4444;
        filter: drop-shadow(0 0 12px rgba(255, 68, 68, 0.8));
        transform: translateY(-2px) scale(1.05);
        animation: none;
    }

    .nav-link[href="gaming.html"].active,
    .nav-link[href="https://game.yahyagameinc.com"].active,
    .nav-link[href*="game.yahyagameinc.com"].active {
        color: var(--accent-red);
        text-shadow: 
            0 0 12px rgba(229, 57, 53, 0.9),
            0 0 22px rgba(229, 57, 53, 0.6),
            -2px -2px 0 rgba(0, 0, 0, 0.8),
            2px -2px 0 rgba(0, 0, 0, 0.8),
            -2px 2px 0 rgba(0, 0, 0, 0.8),
            2px 2px 0 rgba(0, 0, 0, 0.8),
            -1.5px -1.5px 0 var(--accent-red),
            1.5px -1.5px 0 var(--accent-red),
            -1.5px 1.5px 0 var(--accent-red),
            1.5px 1.5px 0 var(--accent-red);
        filter: drop-shadow(0 0 10px rgba(229, 57, 53, 0.7));
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-actions {
        gap: 10px;
    }

    .container {
        padding-top: 70px;
    }

    .quizzes-grid {
        grid-template-columns: 1fr;
    }

    .info-banner h2 {
        font-size: 24px;
    }

    .section-title {
        font-size: 20px;
    }

    .info-text {
        padding: 20px;
    }

    .quiz-card {
        padding: 20px;
    }
}

/* Дополнительные стили для маленьких экранов */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
        padding-top: 65px;
    }

    .header-content {
        padding: 0 15px;
    }

    .logo {
        font-size: 16px;
    }

    .info-banner {
        padding: 20px 15px;
    }

    .info-banner h2 {
        font-size: 20px;
    }

    .info-text {
        padding: 15px;
    }

    .info-text p {
        font-size: 14px;
    }

    .section-title {
        font-size: 18px;
    }

    .quiz-card {
        padding: 15px;
    }

    .quiz-card h4 {
        font-size: 18px;
    }

    .quiz-card p {
        font-size: 13px;
    }

    .quiz-icon {
        font-size: 40px;
    }

    .start-quiz-btn {
        padding: 10px;
        font-size: 14px;
    }

    .theme-toggle {
        font-size: 20px;
        padding: 6px 10px;
    }
}

/* Стили для очень маленьких экранов */
@media (max-width: 360px) {
    .logo {
        font-size: 14px;
    }

    .info-banner h2 {
        font-size: 18px;
    }

    .section-title {
        font-size: 16px;
    }

    .quiz-card h4 {
        font-size: 16px;
    }

    .quiz-icon {
        font-size: 36px;
    }
}

/* Стили для планшетов (портретная ориентация) */
@media (min-width: 481px) and (max-width: 768px) {
    .quizzes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Стили для планшетов (альбомная ориентация) и небольших ноутбуков */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 900px;
    }

    .quizzes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Стили для больших экранов */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
}

