/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #1a1a1a;
    --text-primary: rgba(255, 255, 255, 0.8);
    --accent-color: #feef9f;
    --accent-hover: #c88e2f;
    --border-color: #4a4a4a;
}

body {
    font-family: 'Arial', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape mode */
    min-width: 320px; /* Minimum mobile width */
}

.wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Responsive Header */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px 0;
    gap: 15px;
}

.logo {
    max-width: 250px;
    height: auto;
    object-fit: contain;
}

.header h1 {
    font-size: 1.25rem;
    color: var(--accent-color);
    max-width: 90%;
    word-break: break-word;
}

/* Banner and CTA Responsive */
.banner-container {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.game-image {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.game-image:hover {
    transform: scale(1.05);
}

.cta-button {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    padding: 15px;
    background-color: var(--accent-color);
    color: #1a1a1a;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}

/* Game Carousel Responsive */
.game-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.game-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(50% - 10px);
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
}

.game-carousel::-webkit-scrollbar {
    display: none;
}

.game-carousel > img {
    scroll-snap-align: center;
    width: 100%;
    max-width: 250px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
    }
    
    .game-carousel > img:hover {
        transform: scale(1.05);
    }
    
    /* Scrolling hint */
    .game-carousel-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.1));
        pointer-events: none;
    }
    
    /* Content Zone Styles */
    .content-zone {
        background-color: rgba(0, 0, 0, 0.3);
        border-radius: 10px;
        padding: 20px;
        margin: 20px 0;
    }
    
    .content-zone h1 {
        font-size: 1.5rem;
        font-weight: bold;
        margin-bottom: 1rem;
        color: var(--accent-color);
    }
    
    .content-zone h2 {
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        color: var(--accent-color);
    }
    
    .content-zone h3 {
        font-size: 1.125rem;
        font-weight: 500;
        margin-bottom: 0.5rem;
        color: var(--accent-color);
    }
    
    .content-zone p {
        margin-bottom: 1rem;
        color: rgba(255, 255, 255, 0.8);
    }
    
    .content-zone ul {
        list-style-type: disc;
        margin-left: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .content-zone ol {
        list-style-type: decimal;
        margin-left: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .content-zone li {
        margin-bottom: 0.5rem;
        color: rgba(255, 255, 255, 0.8);
    }
    
   .content-zone table {
       width: 100%;
       margin-bottom: 1rem;
       border-collapse: collapse;
       display: block;
       max-width: 100%;
       overflow-x: auto;
   }
   
   .content-zone table,
   .content-zone table th,
   .content-zone table td {
       border: 1px solid var(--border-color);
   }
   
   .content-zone table thead {
       background-color: rgba(0, 0, 0, 0.5);
   }
   
   .content-zone table th {
       padding: 0.75rem;
       text-align: left;
       color: var(--accent-color);
       white-space: nowrap;
   }
   
   .content-zone table td {
       padding: 0.75rem;
       color: rgba(255, 255, 255, 0.8);
       vertical-align: top;
   }
   
   /* Responsive table for mobile devices */
   @media (max-width: 768px) {
       .content-zone table {
           border: none;
       }
   
       .content-zone table thead {
           display: none;
       }
   
       .content-zone table tbody {
           display: block;
       }
   
       .content-zone table tr {
           display: block;
           margin-bottom: 1rem;
           border: 1px solid var(--border-color);
       }
   
       .content-zone table td {
           display: block;
           text-align: right;
           border-bottom: 1px solid rgba(255,255,255,0.1);
           padding: 0.75rem;
           position: relative;
       }
   
       .content-zone table td:last-child {
           border-bottom: none;
       }
   }
   
   /* Ensure horizontal scrolling for very wide tables */
   .content-zone table {
       -webkit-overflow-scrolling: touch;
   }
    .content-zone blockquote {
        border-left: 4px solid var(--accent-color);
        padding-left: 1rem;
        font-style: italic;
        color: rgba(255, 255, 255, 0.7);
    }
    
    .content-zone code {
        background-color: rgba(0, 0, 0, 0.3);
        padding: 0.125rem 0.25rem;
        border-radius: 0.25rem;
        color: var(--accent-color);
    }
    
    .content-zone pre {
        background-color: rgba(0, 0, 0, 0.3);
        padding: 1rem;
        border-radius: 0.5rem;
        overflow-x: auto;
    }
    
    .content-zone a {
        color: var(--accent-color);
        text-decoration: underline;
    }
    
    .content-zone a:hover {
        color: var(--accent-hover);
    }
    
    .content-zone hr {
        margin-top: 2rem;
        margin-bottom: 2rem;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .content-zone img {
        border-radius: 0.5rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
        max-width: 100%;
        height: auto;
    }
    
    .content-zone figure {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    .content-zone figcaption {
        text-align: center;
        color: rgba(255, 255, 255, 0.6);
        margin-top: 0.5rem;
    }
    
    /* Footer Styles */
    .footer {
        background-color: rgba(0, 0, 0, 0.5);
        padding: 40px 15px;
        margin-top: 30px;
    }
    
    .footer-content {
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
    }
    
    .footer-links {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 30px;
    }
    
    .footer-section {
        padding: 0 15px;
    }
    
    .footer-section h3 {
        color: var(--accent-color);
        margin-bottom: 15px;
        font-size: 1.2rem;
        font-weight: bold;
    }
    
    .footer-section ul {
        list-style-type: none;
    }
    
    .footer-section ul li {
        margin-bottom: 10px;
    }
    
    .footer-section ul li a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        transition: color 0.3s ease;
    }
    
    .footer-section ul li a:hover {
        color: var(--accent-color);
    }
    
    .footer-bottom {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 20px;
        text-align: center;
    }
    
    .footer-legal p {
        color: rgba(255, 255, 255, 0.6);
        margin-bottom: 10px;
    }
    
    /* Responsive Adjustments */
    @media (min-width: 480px) {
        .header h1 {
            font-size: 1.5rem;
        }
    
        .game-carousel {
            grid-auto-columns: calc(40% - 15px);
        }
    
        .footer-links {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    @media (min-width: 768px) {
        .header {
            flex-direction: row;
            gap: 20px;
        }
    
        .logo {
            max-width: 300px;
        }
    
        .header h1 {
            font-size: 1.75rem;
            max-width: 60%;
        }
    
        .game-carousel {
            grid-auto-columns: calc(33.333% - 15px);
        }
    
        .cta-button {
            max-width: 400px;
        }
    }
    
    @media (min-width: 1024px) {
        .header h1 {
            font-size: 2rem;
        }
    
        .logo {
            max-width: 350px;
        }
    
        .game-carousel {
            grid-auto-columns: calc(25% - 15px);
        }
    
        .content-zone h1 {
            font-size: 2rem;
        }
        
        .content-zone h2 {
            font-size: 1.75rem;
        }
        
        .content-zone h3 {
            font-size: 1.5rem;
        }
        
        .content-zone p {
            font-size: 1.125rem;
        }
    }
    
    /* Accessibility and Interaction */
    a:focus, button:focus {
        outline: 3px solid var(--accent-color);
        outline-offset: 2px;
    }
    
    /* Disable user select to prevent text selection during swipe */
    .game-carousel {
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* Ensure images are direct children for snap alignment */
    .game-carousel > * {
        scroll-snap-align: center;
    }
    
    /* Додаткові медіа-запити для екстра-адаптивності */
    @media (max-width: 320px) {
        .wrapper {
            padding: 0 10px;
        }
    
        .logo {
            max-width: 200px;
        }
    
        .header h1 {
            font-size: 1.1rem;
        }
    
        .cta-button {
            padding: 10px;
            font-size: 0.9rem;
        }
    }
    
    /* Покращена доступність для екранних зчитувачів */
    [aria-hidden="true"] {
        display: none;
    }
    
    /* Додаткові анімації */
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .animated-element {
        animation: fadeIn 0.5s ease-in-out;
    }
    
    /* Hover ефекти */
    .hover-scale {
        transition: transform 0.3s ease;
    }
    
    .hover-scale:hover {
        transform: scale(1.05);
    }
    
    /* Додаткові корекції для друку */
    @media print {
        body {
            background-color: white;
            color: black;
        }
    
        .header, .footer {
            display: none;
        }
    }