
:root {
    /* Цветовая палитра (Dark Mode Gaming Theme) */
    --c-bg-body: #0f1118;
    --c-bg-sidebar: #151823;
    --c-bg-header: rgba(21, 24, 35, 0.85);
    --c-bg-card: #1e2230;
    --c-bg-input: #12141c;
    
    --c-primary: #3b82f6; /* Яркий синий */
    --c-primary-hover: #2563eb;
    --c-secondary: #10b981; /* Зеленый (win/online) */
    --c-accent: #f59e0b; /* Оранжевый/Золотой */
    --c-danger: #ef4444; /* Красный */
    
    --c-text-main: #ffffff;
    --c-text-secondary: #94a3b8;
    --c-text-muted: #64748b;
    
    --c-border: #2d3748;
    --c-shadow: rgba(0, 0, 0, 0.4);
    --c-glow-primary: rgba(59, 130, 246, 0.5);
    
    /* Размеры и отступы */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    /* Типографика */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --fz-sm: 0.875rem;
    --fz-base: 1rem;
    --fz-lg: 1.125rem;
    --fz-xl: clamp(1.25rem, 2vw, 1.5rem);
    
    /* Анимации */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 4rem;
    --sidebar-width: 4.5rem;
}

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

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

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

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

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--c-bg-body);
}
::-webkit-scrollbar-thumb {
    background: var(--c-border);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--c-text-muted);
}

/* --- Utilities --- */
.flex { display: flex; }
.a-center { align-items: center; }
.j-between { justify-content: space-between; }
.j-center { justify-content: center; }
.column { flex-direction: column; }
.f-bold { font-weight: 700; }
.unselectable { user-select: none; }

/* Responsive Utilities */
@media (max-width: 768px) {
    .d-tablet-none { display: none !important; }
    .d-mobile-only { display: flex !important; }
}
@media (min-width: 769px) {
    .d-mobile-none { display: flex !important; } /* Исправлено для flex контейнеров */
    .d-desktop-none { display: none !important; }
    .d-mobile-only { display: none !important; }
}

/* --- Layout Structure --- */
#{@__layout}, .layout-default {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-left: var(--sidebar-width); /* Отступ для сайдбара */
    padding-top: calc(var(--header-height) * 2); /* Отступ для хедера */
    transition: padding var(--transition-smooth);
}

@media (max-width: 1024px) {
    .main-content { padding-left: 0; }
}

/* --- Loader --- */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
}
.loaderThink {
    width: 3rem;
    height: 3rem;
    border: 3px solid var(--c-bg-card);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Header --- */
.AppHeader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: var(--c-bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-smooth);
}

/* Header Top */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3rem;
    padding: 0 var(--spacing-md);
    background: rgba(0,0,0,0.2);
    font-size: var(--fz-sm);
}

/* Header Links (Stats & Socials) */
.header-top__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--c-text-secondary);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.header-top__link:hover {
    color: var(--c-text-main);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.header-top__link svg {
    fill: currentColor;
    width: 1rem;
    height: 1rem;
}

.header-top__link.blue { color: var(--c-primary); }

.header-top__logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.header-top__logo-trapezoid {
    position: absolute;
    top: 0;
    fill: var(--c-bg-body); /* Цвет трапеции под лого */
    height: 100%;
    z-index: -1;
}

/* Header Mid (Navigation) */
.header-mid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    padding: 0 var(--spacing-md);
}

.header-mid__links {
    display: flex;
    gap: var(--spacing-md);
}

.header-mid__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--c-text-main);
    font-weight: 600;
    font-size: var(--fz-sm);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.header-mid__link:hover,
.header-mid__link.nuxt-link-active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--c-primary);
}

.header-mid__link svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

.header-mid__link.yellow {
    color: var(--c-accent);
}

.header-mid__link-counter {
    background: var(--c-danger);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
}

/* Mobile Games Scroll */
.header-games-mobile {
    background: var(--c-bg-panel);
    padding: var(--spacing-sm) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--c-border);
}

.header-games-mobile__wrap {
    display: flex;
    padding: 0 var(--spacing-md);
    gap: var(--spacing-sm);
}

.header-games-mobile__item {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    font-size: var(--fz-sm);
    white-space: nowrap;
    border: 1px solid transparent;
}

.header-games-mobile__item:hover,
.header-games-mobile__item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--c-primary);
    color: var(--c-primary);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--fz-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn.blue {
    background: linear-gradient(135deg, var(--c-primary) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn.blue:hover {
    box-shadow: 0 6px 16px var(--c-glow-primary);
    transform: translateY(-1px);
}

.btn.blue:active {
    transform: translateY(0) scale(0.98);
}

.header-mid__signIn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--c-text-secondary);
    font-weight: 600;
    font-size: var(--fz-sm);
}
.header-mid__signIn:hover {
    color: var(--c-text-main);
}
.header-mid__signIn svg {
    fill: currentColor;
}

/* --- Sidebar --- */
.AppSidebar {
    position: fixed;
    left: 0;
    top: calc(var(--header-height) * 1.5); /* Корректировка под хедер */
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--c-bg-sidebar);
    border-right: 1px solid var(--c-border);
    z-index: 900;
    overflow-y: auto;
    padding-top: var(--spacing-md);
}

.sidebar-list {
    gap: var(--spacing-sm);
    width: 100%;
}

.sidebar-item {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--c-text-muted);
    transition: all var(--transition-fast);
    position: relative;
    cursor: pointer;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--c-primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

/* Имитация иконок (т.к. в HTML они пустые или ссылками) */
.sidebar-item a {
    display: block;
    width: 100%;
    height: 100%;
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.sidebar-item:hover a { opacity: 1; }

/* Примерные иконки (через CSS mask или background для демонстрации) */
.sidebar-item a[href*="crash"] { background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 20h20' stroke='white' stroke-width='2'/%3E%3Cpath d='M4 16l6-8 4 4 6-10' stroke='white' stroke-width='2' fill='none'/%3E%3C/svg%3E"); }
/* Для остальных игр можно добавить аналогично */

.sidebar-item__new {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--c-secondary);
    color: #000;
    font-size: 0.55rem;
    font-weight: 800;
    padding: 1px 3px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* --- Chat --- */
.AppChat {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    background: var(--c-bg-sidebar);
    border-left: 1px solid var(--c-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform var(--transition-smooth);
}

.chat-head {
    height: var(--header-height);
    padding: 0 var(--spacing-md);
    border-bottom: 1px solid var(--c-border);
    background: var(--c-bg-header);
    display: flex;
    align-items: center;
}

.chat-head__title {
    font-weight: 700;
    font-size: var(--fz-lg);
}

.chat-head__rules-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--fz-sm);
    color: var(--c-text-muted);
}
.chat-head__rules-btn:hover { color: var(--c-text-main); }
.chat-head__rules-btn svg { fill: currentColor; }

.chat-container-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--c-bg-body);
}

.chat-container {
    height: 100%;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.chat__input-fixed {
    padding: var(--spacing-md);
    background: var(--c-bg-panel);
    border-top: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    text-align: center;
    color: var(--c-text-muted);
    font-size: var(--fz-sm);
}

.chat-wrap__open-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--c-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    z-index: 999;
}

/* --- Dropdowns & Toggles --- */
.select-language {
    position: relative;
    margin-right: var(--spacing-md);
    cursor: pointer;
}

.select-language__field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
}
.select-language__arrow {
    fill: var(--c-text-muted);
    transition: transform 0.2s;
}
.select-language:hover .select-language__arrow {
    transform: rotate(180deg);
}

.sound-switcher button {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}
.sound-switcher button:hover {
    background: rgba(255, 255, 255, 0.1);
}
.sound-switcher svg {
    fill: var(--c-text-secondary);
}

/* --- Burger Menu --- */
.burger-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.burger-menu__burger {
    width: 24px;
    height: 2px;
    background: white;
    position: relative;
}
.burger-menu__burger::before,
.burger-menu__burger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: white;
    left: 0;
}
.burger-menu__burger::before { top: -6px; }
.burger-menu__burger::after { bottom: -6px; }

/* --- Mobile Adaptation (Max Width 768px) --- */
@media (max-width: 768px) {
    .AppSidebar { display: none; }
    .AppChat { 
        width: 100%; 
        transform: translateX(100%); 
    }
    .AppChat.active { transform: translateX(0); }
    
    .header-top { display: none; }
    
    .main-content {
        padding-left: 0;
        padding-top: 110px; /* Header height + mobile games nav */
    }
    
    .header-mid {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        background: var(--c-bg-header);
        border-bottom: 1px solid var(--c-border);
        justify-content: space-between;
    }
    
    .header-games-mobile {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        z-index: 1000;
        background: var(--c-bg-body);
    }
}
