
:root {
    /* Цветовая палитра - Dark Premium Theme */
    --bg-body: #0f111a;
    --bg-card: #1c1f2e;
    --bg-header: rgba(15, 17, 26, 0.85);
    --bg-overlay: rgba(0, 0, 0, 0.7);
    
    --primary-color: #7c3aed;
    --primary-hover: #6d28d9;
    --secondary-color: #ec4899;
    
    --accent-gold: #f59e0b;
    --accent-success: #10b981;
    
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --text-link: #a78bfa;

    --gradient-fancy: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    --gradient-banner: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    --gradient-card-overlay: linear-gradient(to top, rgba(0,0,0,0.9), transparent);

    /* Размеры и отступы */
    --spacing-xs: 0.25rem;
    --spacing-s: 0.5rem;
    --spacing-m: 1rem;
    --spacing-l: 1.5rem;
    --spacing-xl: 2rem;

    --radius-s: 0.5rem;
    --radius-m: 0.75rem;
    --radius-l: 1.25rem;
    --radius-full: 9999px;

    /* Тени и эффекты */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 15px rgba(124, 58, 237, 0.3);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Типографика */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- Reset & Normalize --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

/* --- Typography Helpers --- */
.ui-typography {
    font-family: var(--font-family);
}

.ui-typography_size_m {
    font-size: 1rem;
    font-weight: 500;
}

.ui-typography_size_xs {
    font-size: 0.75rem;
    font-weight: 700;
}

.ui-typography_strong {
    font-weight: 700;
}

.ui-typography_transforms_uppercase {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Icons --- */
.ui-icon {
    display: inline-block;
    vertical-align: middle;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

/* --- Layout Structure --- */
.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#page-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-m);
    padding-top: 140px; /* Space for fixed header */
}

/* --- Header --- */
.ui-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-smooth);
}

.ui-header__wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-m) var(--spacing-l);
    height: 80px;
}

.ui-header__container {
    display: flex;
    align-items: center;
    gap: var(--spacing-l);
}

.ui-logo {
    display: block;
    width: 120px;
    height: 40px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 30"><text x="0" y="20" fill="white" font-family="sans-serif" font-weight="bold" font-size="20">CASINO</text></svg>') no-repeat center left;
    background-size: contain;
}

.ui-header__menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-m);
}

.ui-header__item a {
    color: var(--text-main);
    font-weight: 600;
}

.ui-header__item a:not(.ui-button-base):hover {
    color: var(--primary-color);
}

/* Secondary Navigation (Tabs) */
.head-tabs-menu {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ui-head-tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-l);
    padding: var(--spacing-s) var(--spacing-m);
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}

.ui-head-tabs::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
}

.ui-head-tabs__item {
    white-space: nowrap;
    color: var(--text-muted);
    padding: var(--spacing-s) 0;
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
}

.ui-head-tabs__item:hover,
.ui-head-tabs__item.active {
    color: var(--text-main);
}

.ui-head-tabs__item:hover::after {
    content: '';
    position: absolute;
    bottom: -6px; /* Adjust to overlap border */
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-fancy);
    border-radius: var(--radius-full);
}

/* --- Buttons --- */
.ui-button-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6em 1.2em;
    border-radius: var(--radius-m);
    font-weight: 600;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.ui-button_kind_fancy {
    background: var(--gradient-fancy);
    color: white;
    box-shadow: 0 4px 15px rgba(219, 39, 119, 0.4);
}

.ui-button_kind_fancy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(219, 39, 119, 0.6);
}

.ui-button_kind_primary {
    background-color: var(--primary-color);
    color: white;
}

.ui-button_kind_primary:hover {
    background-color: var(--primary-hover);
}

.ui-button_kind_link {
    background: transparent;
    padding: var(--spacing-s);
}

.ui-button_kind_link:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.ui-button_icon svg {
    display: block;
}

/* --- Side Menu (Off-canvas) --- */
.ui-side-menu {
    position: fixed;
    inset: 0;
    z-index: 2000;
    visibility: hidden;
    transition: visibility 0s linear 0.3s;
}

.ui-side-menu_opened {
    visibility: visible;
    transition-delay: 0s;
}

.ui-side-menu__overlay {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.ui-side-menu_opened .ui-side-menu__overlay {
    opacity: 1;
}

.ui-side-menu__aside {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: var(--bg-card);
    transform: translateX(100%);
    transition: transform var(--transition-smooth);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
}

.ui-side-menu_opened .ui-side-menu__aside {
    transform: translateX(0);
}

.ui-side-menu__content {
    padding: var(--spacing-l);
    overflow-y: auto;
    flex: 1;
}

.ui-side-menu__close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-l);
}

.side-menu-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-m);
}

.side-menu-sections__link {
    display: flex;
    align-items: center;
    padding: var(--spacing-m);
    border-radius: var(--radius-m);
    background: rgba(255, 255, 255, 0.03);
    font-weight: 500;
    transition: var(--transition-fast);
}

.side-menu-sections__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--secondary-color);
    padding-left: calc(var(--spacing-m) + 5px);
}

.ui-side-menu__bottom {
    padding: var(--spacing-l);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    gap: var(--spacing-m);
    align-items: center;
}

/* --- Main Banner Slider --- */
.banner-slider {
    margin-bottom: var(--spacing-xl);
    border-radius: var(--radius-l);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}

.swiper-slide.main-slider__item {
    width: 100%;
}

.ui-main-banner {
    position: relative;
    min-height: 350px;
    display: flex;
    align-items: center;
    padding: var(--spacing-xl);
    background: var(--gradient-banner);
    overflow: hidden;
}

/* Decorative background shapes for banner */
.ui-main-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
    z-index: 1;
}

.ui-main-banner__inner {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.ui-main-banner__inner-description {
    max-width: 60%;
}

.ui-main-banner__title p {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.2;
    margin-bottom: var(--spacing-l);
    background: linear-gradient(to right, #fff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Games Menu (Categories) --- */
.games-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: var(--spacing-m);
    margin-bottom: var(--spacing-xl);
    padding: 0 var(--spacing-s);
}

.games-menu__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-s);
    padding: var(--spacing-m);
    background: var(--bg-card);
    border-radius: var(--radius-m);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
}

.games-menu__item:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.games-menu__icon {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
}

.games-menu__item:hover .games-menu__icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

.games-menu__item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.games-menu__item:hover .games-menu__item-title {
    color: var(--text-main);
}

/* --- Game Sliders & Cards --- */
.home-page-games-slider {
    margin-bottom: var(--spacing-xl);
    position: relative;
}

.games-slider-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-s);
    margin-bottom: var(--spacing-m);
    padding-left: var(--spacing-s);
    color: var(--text-main);
}

.games-slider-title__el {
    color: var(--accent-gold);
}

/* Simulate Grid for slider items since JS isn't active in CSS view */
.home-page-games-slider .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--spacing-m);
    padding-bottom: var(--spacing-m);
}

.game-card {
    height: 100%;
}

.ui-card {
    position: relative;
    border-radius: var(--radius-m);
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
    aspect-ratio: 3/4; /* Vertical card aspect ratio */
}

.ui-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.ui-card-body, .ui-card-media {
    height: 100%;
    width: 100%;
}

.ui-card-media__image {
    height: 100%;
    width: 100%;
}

/* Placeholder for missing images */
.ui-image-loader-wrapper {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #2d3748, #1a202c);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ui-image-loader-wrapper::after {
    content: 'GAME';
    color: rgba(255,255,255,0.1);
    font-weight: 800;
    font-size: 1.5rem;
}

/* Card Overlay (e.g., "New" badge) */
.ui-card-media__wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.ui-card-media-overlay {
    position: absolute;
    top: var(--spacing-s);
    left: var(--spacing-s);
}

.ui-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: var(--radius-s);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.ui-chip_kind_success {
    background: var(--accent-success);
    color: #fff;
}

/* Navigation Arrows (Simulated) */
.navigation-element {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    transition: var(--transition-fast);
    opacity: 0; /* Hidden by default until hover */
}

.home-page-games-slider:hover .navigation-element {
    opacity: 1;
}

.slider-btn-next { right: -20px; }
.slider-btn-prev { left: -20px; }

.navigation-element:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* --- Mobile / Tablet Adaptability --- */
@media (max-width: 1024px) {
    .ui-header__menu {
        display: none; /* Hide main menu, rely on burger */
    }
    
    .games-menu {
        grid-template-columns: repeat(4, 1fr);
        overflow-x: auto;
        padding-bottom: var(--spacing-s);
    }
}

@media (max-width: 768px) {
    #page-container {
        padding-top: 130px;
        padding-left: var(--spacing-s);
        padding-right: var(--spacing-s);
    }

    .ui-header__wrapper {
        padding: var(--spacing-s) var(--spacing-m);
        height: 60px;
    }

    .ui-logo {
        width: 100px;
    }

    .ui-head-tabs {
        justify-content: flex-start;
    }

    .ui-main-banner {
        min-height: 250px;
        padding: var(--spacing-m);
    }

    .ui-main-banner__title p {
        font-size: 1.5rem;
    }

    .games-menu {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-s);
    }

    .games-menu__item {
        padding: var(--spacing-s);
    }

    .games-menu__icon {
        width: 32px;
        height: 32px;
    }

    /* Adjust Grid for smaller screens */
    .home-page-games-slider .swiper-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .games-menu {
        grid-template-columns: repeat(3, 1fr); /* 3 cols on mobile */
    }
    
    .home-page-games-slider .swiper-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-s);
    }

    .ui-button_size_l {
        padding: 0.5em 1em;
        font-size: 0.9rem;
    }
}
