/* ===== RESET & БАЗА (премиальный дизайн) ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #FFFFFF;
    color: #111827;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
main {
    flex: 1;
}



/* ===== ПЕРЕМЕННЫЕ (БРЕНДОВЫЕ) ===== */
:root {
    --primary: #5B4BFF;
    --primary-dark: #4239cc;
    --primary-light: #8a7eff;
    --secondary: #FF6B6B;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== КОНТЕЙНЕРЫ ===== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
    position: relative;
}

.section--dark {
    background-color: var(--gray-900);
    color: var(--gray-100);
}

.section--light {
    background-color: var(--gray-50);
}

.section__header {
    text-align: center;
    margin-bottom: 4rem;
}

.section__tag {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 1rem;
    background: rgba(91, 75, 255, 0.1);
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
}

.section__title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.section__subtitle {
    font-size: 1.125rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== НАВИГАЦИЯ (ГЛАССМОРФИЗМ) ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.nav__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav--scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.nav__logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--gray-900);
}

.logo-mark {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
}

.nav__links {
    display: flex;
    gap: 2.5rem;
}

.nav__link {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: var(--transition);
    font-size: 1rem;
}

.nav__link:hover {
    color: var(--primary);
}

.nav__toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.nav__toggle span {
    width: 24px;
    height: 2px;
    background: var(--gray-800);
    transition: var(--transition);
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1rem;
    cursor: pointer;
    border: none;
}

.btn--primary,
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover,
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--text,
.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn--text:hover,
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ===== АВТОРИЗАЦИЯ В НАВБАРЕ ===== */
.auth-section {
    display: flex;
    align-items: center;
}

.auth-buttons {
    display: flex;
    gap: 12px;
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 16px;
    background: rgba(91, 75, 255, 0.08);
    border-radius: var(--radius-full);
}

.user-info span {
    font-weight: 500;
    color: var(--gray-800);
}

/* ===== СЕТКА ИГР (КАРТОЧКИ В СТИЛЕ ДИЗАЙНА) ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.game-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.game-thumbnail-container {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--gray-100);
    overflow: hidden;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    color: var(--gray-400);
    font-size: 3rem;
}

.game-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.game-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(2px);
}

.game-content {
    padding: 1.5rem;
}

.game-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
}

.game-description {
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.game-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.game-meta {
    text-align: right;
}

.game-author,
.game-type {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.game-type {
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
}

/* ===== ЗАГРУЗКА / ОШИБКИ ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    text-align: center;
    padding: 3rem;
    background: rgba(207, 102, 121, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(207, 102, 121, 0.2);
}

.error-message i {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.no-games {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    color: var(--gray-500);
}

.no-games i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* ===== МОДАЛЬНЫЕ ОКНА (адаптированы под премиум) ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1100;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 1.5rem;
}

/* ===== ФОРМЫ ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    transition: var(--transition);
    font-size: 0.95rem;
    color: var(--gray-800);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 75, 255, 0.1);
}

/* ===== ФУТЕР ===== */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 4rem 0 2rem;
}

.footer__grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer__logo {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, white, var(--gray-400));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 1rem;
}

.footer__description {
    max-width: 250px;
    font-size: 0.875rem;
}

.footer__links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer__col h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer__col ul {
    list-style: none;
}

.footer__col li {
    margin-bottom: 0.75rem;
}

.footer__col a {
    text-decoration: none;
    color: var(--gray-400);
    font-size: 0.875rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer__col a:hover {
    color: var(--primary);
}

.footer__bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 1024px) {
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav__links {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-lg);
        border-bottom: 1px solid var(--gray-200);
    }

    .nav__links.active {
        display: flex;
    }

    .nav__toggle {
        display: flex;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 4rem 0;
    }

    .container {
        padding: 0 1.5rem;
    }

    .footer__links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        margin-bottom: 1rem;
    }
}

/* Сообщения (успех/ошибка) — фиксируем сверху */
.message {
    position: fixed;
    top: 90px;
    /* Ниже навбара */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    max-width: 90%;
    width: auto;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .message {
        white-space: normal;
        text-align: center;
        width: 90%;
    }
}