body {
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    background: #f7f8fa;
    color: #222;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

    a:hover {
        color: #0056b3;
    }

header table {
    border-collapse: collapse;
    width: 100%;
    background: #1f1f1f;
    color: white;
}

header img {
    border-radius: 8px;
}

header nav a {
    color: #fff;
    margin: 0 10px;
    font-weight: 500;
}

    header nav a:hover {
        color: #00bfff;
    }

header td:last-child a {
    background: #00bfff;
    color: white !important;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
}

    header td:last-child a:hover {
        background: #0095cc;
    }

footer {
    background: #1f1f1f;
    color: white;
    margin-top: 40px;
    text-align: center;
}

    footer table {
        border-collapse: collapse;
        width: 100%;
    }

    footer a {
        color: #00bfff;
        text-decoration: none;
    }

        footer a:hover {
            text-decoration: underline;
        }

/* === Кнопка профиля в шапке === */
.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(0,191,255,0.15), rgba(0,191,255,0.05));
    border: 1px solid rgba(0,191,255,0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
}

    .profile-trigger:hover {
        background: linear-gradient(135deg, rgba(0,191,255,0.25), rgba(0,191,255,0.1));
        border-color: #00bfff;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,191,255,0.2);
    }

.profile-icon {
    font-size: 1.3em;
}

.profile-name {
    font-weight: 600;
    color: #00bfff;
    font-size: 0.95em;
}

.profile-arrow {
    font-size: 0.7em;
    color: #00bfff;
    transition: transform 0.2s;
}

.profile-trigger:hover .profile-arrow {
    transform: rotate(180deg);
}

/* === Выпадающее меню профиля === */
.profile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 10px;
    margin-top: 8px;
    min-width: 240px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border: 1px solid rgba(0,0,0,0.08);
    z-index: 10000;
    overflow: hidden;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #00bfff, #0095cc);
    color: white;
}

.dropdown-greeting {
    display: block;
    font-weight: 600;
    font-size: 1.05em;
    margin-bottom: 2px;
}

.dropdown-subtitle {
    display: block;
    font-size: 0.85em;
    opacity: 0.9;
}

.dropdown-links {
    padding: 8px 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.2s;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

    .dropdown-link:hover {
        background: rgba(0,191,255,0.08);
        color: #00bfff;
        padding-left: 24px;
    }

.link-icon {
    font-size: 1.2em;
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 6px 0;
}

.logout-link {
    color: #dc3545;
}

    .logout-link:hover {
        background: rgba(220,53,69,0.08);
        color: #c82333;
    }

.logout-form {
    margin: 0;
    padding: 0;
}

/* Адаптив */
@media (max-width: 600px) {
    .profile-name {
        display: none;
    }

    .profile-trigger {
        padding: 8px 12px;
    }

    .profile-dropdown {
        right: 0;
        min-width: 200px;
    }
}

/* === Страница избранного === */
#favorites-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

    #favorites-page h1 {
        text-align: center;
        margin: 30px 0 40px;
        font-size: 2em;
        color: #1f1f1f;
        position: relative;
        padding-bottom: 15px;
    }

        #favorites-page h1::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 3px;
            background: linear-gradient(90deg, #00bfff, #0095cc);
            border-radius: 2px;
        }
.game-rating-display {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(0,191,255,0.1), rgba(0,191,255,0.05));
    border: 1px solid rgba(0,191,255,0.2);
    border-radius: 8px;
    margin: 10px 0;
}

    .game-rating-display .rating-number {
        font-size: 1.8em;
        font-weight: 700;
        color: #00bfff;
        line-height: 1;
    }

    .game-rating-display .rating-divider {
        color: #888;
        font-weight: 500;
        font-size: 1.2em;
    }

    .game-rating-display .rating-total {
        color: #666;
        font-weight: 600;
        font-size: 1.1em;
    }

    .game-rating-display .rating-label {
        color: #888;
        font-size: 0.9em;
        margin-left: 6px;
    }


/* Сетка игр */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.fav-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

    .fav-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    }

    .fav-card .poster {
        width: 100%;
        height: 280px;
        object-fit: cover;
        display: block;
        transition: transform 0.3s;
    }

    .fav-card:hover .poster {
        transform: scale(1.03);
    }

    .fav-card .card-body {
        padding: 15px;
    }

    .fav-card h3 {
        margin: 0 0 8px;
        font-size: 1.1em;
    }

        .fav-card h3 a {
            color: #1f1f1f;
            text-decoration: none;
            transition: color 0.2s;
        }

            .fav-card h3 a:hover {
                color: #00bfff;
            }

    .fav-card .meta {
        color: #666;
        font-size: 0.9em;
        margin: 0 0 10px;
    }

    .fav-card .rating-text {
        margin: 8px 0;
    }

/* Кнопка удаления из избранного */
.btn-remove-fav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: rgba(220,53,69,0.1);
    color: #dc3545;
    border: 1px solid rgba(220,53,69,0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
}

    .btn-remove-fav:hover {
        background: rgba(220,53,69,0.2);
        border-color: #dc3545;
    }

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 20px 0;
}

    .empty-state p {
        color: #666;
        font-size: 1.1em;
        margin-bottom: 20px;
    }

.btn-more-news {
    display: inline-block;
    padding: 10px 24px;
    background: #00bfff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

    .btn-more-news:hover {
        background: #0095cc;
    }

/* Анимация удаления */
@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.removing {
    animation: fadeOut 0.3s ease forwards;
}

.rating-text {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    font-weight: 600;
    font-size: 1.1em;
    color: #00bfff;
}

.rating-value {
    font-size: 1.2em;
}

.rating-max {
    color: #888;
    font-size: 0.9em;
    font-weight: 400;
}
