@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700;800&display=swap');

:root {
    --bg-body: #050507;
    --bg-card: rgba(22, 22, 26, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --primary: #6C5DD3;
    --primary-hover: #5a4cb5;
    --accent: #FF754C;
    --text-main: #FFFFFF;
    --text-muted: #808191;
    --border: rgba(255, 255, 255, 0.08);
    --glow: 0 10px 40px -10px rgba(108, 93, 211, 0.5);
    --radius: 24px;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding-bottom: 120px; /* Отступ под док-бар */
    overflow-x: hidden;
}

/* Скроллбар */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* === ГРИД КАРТОЧЕК === */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

/* === КАРТОЧКА === */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
    display: block; /* Чтобы ссылка работала как блок */
}

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: var(--glow);
    z-index: 2;
}

.game-img-wrapper {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 14px;
}

.game-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
    transition: 0.5s;
}
.game-card:hover .game-img-wrapper img { transform: scale(1.1); }

.card-title {
    font-weight: 700; font-size: 16px; margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: white;
}
.card-category { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.price-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 12px; font-weight: 700;
    color: var(--primary);
}
.price-tag.premium { background: var(--primary); color: white; }

/* === НИЖНЯЯ НАВИГАЦИЯ (ВСТРОЕННАЯ) === */
.mobile-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    height: 70px;
    
    background: rgba(30, 30, 35, 0.9); /* Темный фон */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px; /* Чуть меньше скругление */
    
    display: flex;
    justify-content: space-evenly; /* Равномерно распределяем */
    align-items: center;
    padding: 0 10px;
    
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.nav-item {
    color: #808191;
    font-size: 20px;
    width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 12px;
    transition: 0.3s;
}

.nav-item:active { transform: scale(0.9); }
.nav-item.active { color: white; background: rgba(255, 255, 255, 0.05); }

/* Центральная кнопка ВНУТРИ бара */
.nav-item.central-btn {
    background: linear-gradient(135deg, #6C5DD3 0%, #8B5CF6 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(108, 93, 211, 0.3);
    /* Убрали transform и border, теперь она просто стоит в ряду */
}

/* === ФОРМЫ И ПАНЕЛИ === */
.glass-panel {
    background: rgba(30, 30, 35, 0.6);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 30px;
    max-width: 400px;
    margin: 40px auto;
}

.form-input {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    color: white; width: 100%;
    margin-bottom: 15px;
    font-size: 15px; outline: none;
    transition: 0.3s;
}
.form-input:focus { border-color: var(--primary); background: rgba(255,255,255,0.05); }

.btn-primary-glow {
    background: linear-gradient(135deg, #6C5DD3 0%, #8B5CF6 100%);
    color: white; border: none; padding: 14px;
    border-radius: 16px; font-weight: 700; width: 100%;
    box-shadow: 0 4px 15px rgba(108, 93, 211, 0.4);
    cursor: pointer; transition: 0.3s;
    display: block; text-align: center;
}
.btn-primary-glow:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(108, 93, 211, 0.6); }

/* HERO */
.hero-card {
    position: relative; height: 220px;
    border-radius: 30px; overflow: hidden;
    margin-bottom: 30px; box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}
.hero-bg { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6); }
.hero-content { position: absolute; bottom: 30px; left: 30px; z-index: 2; }
.badge-hot {
    background: #FF754C; color: white; padding: 5px 10px;
    border-radius: 8px; font-size: 10px; font-weight: 800; letter-spacing: 1px;
    display: inline-block; margin-bottom: 10px;
}

/* Header App Page */
.app-header-bg {
    position: absolute; top: 0; left: 0; right: 0; height: 350px;
    z-index: -1; opacity: 0.3;
    mask-image: linear-gradient(to bottom, black, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent);
}

/* === ПРОФИЛЬ === */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.avatar-container {
    width: 100px; height: 100px;
    margin: 0 auto 15px;
    position: relative;
}

.avatar-img {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-body);
    box-shadow: 0 0 20px rgba(108, 93, 211, 0.6); /* Неоновое свечение */
}

.admin-badge {
    position: absolute; bottom: 0; right: 0;
    background: #FF754C; color: white;
    font-size: 10px; font-weight: 800;
    padding: 4px 8px; border-radius: 10px;
    border: 2px solid var(--bg-body);
}

.menu-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
}

.menu-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: rgba(255,255,255,0.05); }

/* === ПОИСК === */
.search-header {
    position: sticky; top: 10px; z-index: 100;
    background: rgba(5, 5, 7, 0.8);
    backdrop-filter: blur(10px);
    padding-bottom: 10px;
    margin: 0 -10px; padding: 0 10px 10px; /* Компенсация отступов контейнера */
}

.search-input-wrapper {
    position: relative;
}

.search-icon-absolute {
    position: absolute; left: 15px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-modern {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 14px 14px 45px; /* Отступ под иконку */
    color: white; width: 100%;
    font-size: 16px; outline: none;
    transition: 0.3s;
}
.search-input-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(108, 93, 211, 0.2);
}

/* Облако тегов */
.tags-scroll {
    display: flex; gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 20px;
}
.tags-scroll::-webkit-scrollbar { display: none; } /* Скрыть скроллбар */

.tag-chip {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    padding: 8px 16px; border-radius: 20px;
    font-size: 13px; color: var(--text-muted);
    white-space: nowrap;
}
.tag-chip:hover {
    background: var(--primary); color: white; border-color: var(--primary);
}

/* === АДМИН ПАНЕЛЬ === */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    display: flex; align-items: center; gap: 20px;
}

.stat-icon-box {
    width: 50px; height: 50px;
    border-radius: 14px;
    background: rgba(108, 93, 211, 0.1);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}

/* Таблица управления */
.admin-table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: white;
}

.admin-table th {
    text-align: left;
    padding: 15px;
    color: var(--text-muted);
    font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }

.action-btn {
    width: 35px; height: 35px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
    cursor: pointer;
}
.btn-delete { background: rgba(255, 76, 76, 0.1); color: #FF4C4C; }
.btn-delete:hover { background: #FF4C4C; color: white; }

/* === ОТЗЫВЫ И ЗВЕЗДЫ === */
.rating-area {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 5px;
}

.rating-area:not(:checked) > input { display: none; }

.rating-area:not(:checked) > label {
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.rating-area > input:checked ~ label { color: #FFD700; text-shadow: 0 0 10px #FFD700; }
.rating-area:not(:checked) > label:hover,
.rating-area:not(:checked) > label:hover ~ label { color: #FFD700; }

.review-card {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}