.game-info-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    left: auto;
    width: 22px;
    height: 22px;
    background: rgba(80,80,80,0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s cubic-bezier(.4,0,.2,1), box-shadow 0.18s;
    z-index: 3;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.13);
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
    text-decoration: none;
    backdrop-filter: blur(2px);
}

.game-info-btn:hover {
    background: rgba(120,120,120,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.game-info-btn span {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.92;
    user-select: none;
    font-family: 'Orbitron', 'Inter', sans-serif;
    letter-spacing: 0.01em;
}

/* --- Game Card Hover Animation --- */
.game-card {
    position: relative;
    overflow: visible;
}

.game-thumbnail {
    position: relative;
}

.animated-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 2;
}

.animated-play-btn::after {
    content: '\25B6'; /* Play icon */
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 2px 8px #0006;
}

.animated-game-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 0 8px 0;
    background: rgba(30,34,54,0.6);
    backdrop-filter: blur(12px);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    color: #fff;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 1;
}

.game-card.active .animated-play-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.game-card.active .animated-game-info {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.game-card .game-title {
    font-family: 'Orbitron', 'Inter', Arial, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-shadow: 0 1px 4px rgba(0,0,0,0.18);
    padding: 0 2px;
}
/* --- End Game Card Hover Animation --- */

/* Lvl.Land - Premium interface */
:root {
    --primary-bg: linear-gradient(135deg, #0a0a0f 0%, #1a0a1f 25%, #0f1a2a 50%, #1a0f2a 75%, #0a0a1f 100%);
    --secondary-bg: #0f1419;
    --sidebar-bg: #0f1419;
    --card-bg: rgba(20, 25, 35, 0.8);
    --card-bg-hover: rgba(25, 35, 50, 0.9);
    --accent-primary: #00d4ff;
    --accent-secondary: #ff6b35;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-green: #22c55e;
    --accent-gold: #fbbf24;
    --accent-red: #ef4444;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --border-color: rgba(45, 55, 75, 0.6);
    --border-accent: rgba(0, 212, 255, 0.3);
    --glow-primary: 0 0 20px rgba(0, 212, 255, 0.4);
    --glow-secondary: 0 0 15px rgba(255, 107, 53, 0.3);
    --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --sidebar-width: 280px;
    --glass-bg: rgba(15, 20, 25, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Исправленный body для iOS */
body {
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: var(--primary-bg);
    -webkit-background-size: cover;
    background-size: cover;
}

/* Альтернатива для фиксированного фона на iOS */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-bg);
    z-index: -1;
    -webkit-backface-visibility: hidden;
    -webkit-transform: translateZ(0);
}

/* Cosmic Background */
.cosmic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(255, 107, 53, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
    animation: cosmicPulse 8s ease-in-out infinite alternate;
}

@keyframes cosmicPulse {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Main Layout */
.main-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Left Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 80px; /* Moved down to start below header */
    width: var(--sidebar-width);
    height: calc(100vh - 80px); /* Adjusted height to account for header */
    background: linear-gradient(180deg, 
        rgba(15, 20, 25, 0.95) 0%, 
        rgba(15, 20, 25, 0.90) 50%, 
        rgba(15, 20, 25, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    box-shadow: var(--shadow-primary);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Current Category Display - Make it clickable on mobile */
.current-category {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    text-align: center;
    margin-top: 1rem;
    box-shadow: var(--glow-primary), var(--shadow-card);
    position: relative;
    overflow: hidden;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.current-category:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary), 0 8px 25px rgba(0, 212, 255, 0.3);
    border-color: var(--accent-primary);
}

/* Add mobile click indicator */
@media (max-width: 1024px) {
    .current-category {
        cursor: pointer;
        position: relative;
    }
    .animated-play-btn {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }
}

.current-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.1) 50%, 
        transparent 100%);
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.current-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    position: relative;
    z-index: 2;
}



/* User Profile Display */
.user-profile {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.user-info {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.user-info:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary), var(--shadow-card);
    transform: translateY(-2px);
}



.username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

/* Sidebar Admin Section */
.sidebar-admin {
    padding-top: 1rem;
}

.admin-btn {
    background: linear-gradient(135deg, var(--secondary-bg), #1a1f2e);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.admin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.admin-btn:hover::before {
    left: 100%;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 31, 46, 0.4), var(--shadow-card);
    border-color: var(--border-accent);
}

/* Sidebar Logout Section */
.sidebar-logout {
    margin-top: auto;
    padding-top: 1rem;
    flex-shrink: 0;
}

.logout-btn {
    background: linear-gradient(135deg, var(--secondary-bg), #1a1f2e);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border-color);
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.logout-btn:hover::before {
    left: 100%;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 31, 46, 0.4), var(--shadow-card);
    border-color: var(--border-accent);
}

/* Profile Modal User Profile */
.profile-user-profile {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.profile-user-info {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.profile-user-info:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary), var(--shadow-card);
    transform: translateY(-2px);
}



.profile-username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

/* Profile Modal Admin Section */
.profile-admin-section {
    padding-top: 1rem;
}

.profile-admin-btn {
    background: linear-gradient(135deg, var(--secondary-bg), #1a1f2e);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.profile-admin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.profile-admin-btn:hover::before {
    left: 100%;
}

.profile-admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 31, 46, 0.4), var(--shadow-card);
    border-color: var(--border-accent);
}

/* Profile Modal Logout Section */
.profile-logout-section {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.profile-logout-btn {
    background: linear-gradient(135deg, var(--secondary-bg), #1a1f2e);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: var(--shadow-card);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--border-color);
}

.profile-logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.profile-logout-btn:hover::before {
    left: 100%;
}

.profile-logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 31, 46, 0.4), var(--shadow-card);
    border-color: var(--border-accent);
}

/* User Section */
.user-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.login-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4), var(--shadow-card);
}

.user-stats {
    display: flex;
    gap: 0.5rem;
}

.stat-item {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--glow-primary), var(--shadow-card);
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.gift-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.gift-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.gift-btn:hover::before {
    left: 100%;
}

.gift-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4), var(--shadow-card);
}

/* Currency Display */
.currency-display {
    display: flex;
    gap: 0.5rem;
}

.currency-item {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 0.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.currency-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3), var(--shadow-card);
}

/* Sidebar Divider */
.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--border-accent) 20%, 
        var(--accent-primary) 50%, 
        var(--border-accent) 80%, 
        transparent 100%);
    margin: 0.5rem 0;
    position: relative;
}

/* Только для десктопа: второй разделитель */
.sidebar-divider--desktop {
    display: block;
    margin-top: 18px;
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .sidebar-divider--desktop {
        display: none;
    }
}

.sidebar-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 212, 255, 0.3) 50%, 
        transparent 100%);
    animation: dividerGlow 3s ease-in-out infinite alternate;
}

@keyframes dividerGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.8; }
}

/* Categories Navigation */
.categories-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.categories-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.category-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 2px;
    transition: all 0.3s ease;
}

.category-item:hover::before {
    height: 60%;
}

.category-item:hover {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-accent);
    transform: translateX(5px);
    box-shadow: var(--shadow-card);
}

.category-item.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    color: white;
    box-shadow: var(--glow-primary), var(--shadow-card);
    border-color: var(--accent-primary);
}

.category-item.active::before {
    height: 60%;
    background: white;
}

.category-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.category-name {
    flex: 1;
    font-weight: 500;
}

.category-badge {
    background: linear-gradient(135deg, var(--accent-green), #16a34a);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-link {
    background: none;
    border: none;
    color: var(--text-muted);
    text-align: left;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.footer-link:hover::after {
    transform: scaleX(1);
}

.footer-link:hover {
    color: var(--text-primary);
    background: var(--card-bg);
    transform: translateX(5px);
}

/* Right Sidebar */
.right-sidebar {
    position: fixed;
    right: 0;
    top: 80px;
    width: var(--sidebar-width);
    height: calc(100vh - 80px);
    background: linear-gradient(180deg, 
        rgba(15, 20, 25, 0.95) 0%, 
        rgba(15, 20, 25, 0.90) 50%, 
        rgba(15, 20, 25, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    box-shadow: var(--shadow-primary);
    padding: 2rem 1.5rem;
    overflow-y: visible;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Content Area */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--sidebar-width);
    padding: 3rem 2rem 2rem 2rem;
}

/* Page Footer */
.page-footer {
    display: none; /* Hidden by default on desktop */
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    margin-left: var(--sidebar-width);
    margin-right: var(--sidebar-width);
    z-index: 3; /* Ensure footer is above ad container */
    position: relative;
}

.page-footer-content {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-footer-link {
    background: none;
    border: none;
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    position: relative;
}

.page-footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.page-footer-link:hover::after {
    transform: scaleX(1);
}

.page-footer-link:hover {
    color: var(--text-primary);
    background: var(--card-bg-hover);
    transform: translateY(-2px);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

/* Ad Card Styles */
.ad-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: cardLoad 0.5s ease-out forwards;
}

.ad-card[hidden] {
    display: none !important;
}

.ad-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--glow-primary), 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

.ad-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Size only the platform mount; partner-owned descendants keep their geometry. */
.ad-content > .ad-render-root {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
}

.game-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: visible;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    opacity: 0;
    animation: slideInUp 0.6s ease forwards;
    box-shadow: var(--shadow-card);
    cursor: pointer;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 212, 255, 0.05) 0%, 
        rgba(255, 107, 53, 0.03) 50%, 
        rgba(168, 85, 247, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.game-card:hover::before {
    opacity: 1;
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--glow-primary), 0 25px 50px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
}

.game-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: linear-gradient(135deg, var(--accent-green), #16a34a);
    color: white;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
    animation: newBadgePulse 2s ease-in-out infinite;
}

.game-badge.new {
    left: 0.75rem;
    right: auto;
}

@keyframes newBadgePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(34, 197, 94, 0.6);
    }
}

.game-thumbnail {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 16px;
    background: #18181b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    border-radius: 16px;
}

.game-card.active .game-thumbnail::before {
    opacity: 1;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
    filter: brightness(0.9) contrast(1.1);
    border-radius: 16px;
    background: #18181b;
    display: block;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.05);
    filter: brightness(1) contrast(1.2);
}

.game-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4), transparent);
    backdrop-filter: blur(10px);
    z-index: 4;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    border-radius: 0 0 16px 16px;
}

.game-card.active .game-info {
    opacity: 1;
    pointer-events: auto;
    transform: none;
    animation: gameInfoAppear 0.4s ease-out 0.1s both;
}

@keyframes gameInfoAppear {
    0% {
        opacity: 0;
        transform: translateY(100%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-title {
    font-family: 'Orbitron', 'Inter', Arial, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    text-shadow: 0 1px 4px rgba(0,0,0,0.18);
    padding: 0 2px;
}

.game-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8rem;
}

.game-category {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.game-stats {
    display: flex;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.8);
}

.play-count,
.rating {
    font-size: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.play-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    color: white;
    text-decoration: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    pointer-events: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 212, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 3;
}

.play-btn::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 12px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-left: 3px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
}

.game-card.active .play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    animation: playBtnAppear 0.3s ease-out, playBtnPulse 2s ease-in-out 0.5s infinite;
}

@keyframes playBtnPulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 212, 255, 0.4);
    }
    50% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 0 10px rgba(0, 212, 255, 0);
    }
}

@keyframes playBtnAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) rotate(-5deg);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    border-radius: 50%;
    transform: translateX(-100%);
    transition: all 0.6s ease;
}

.play-btn:hover::before {
    transform: translateX(100%);
}

.play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), var(--glow-primary);
}

/* No Results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    color: white;
    text-decoration: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary), var(--shadow-card);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    max-width: 600px;
    max-height: 70vh;
    width: 90%;
    padding: 2.5rem;
    overflow-y: auto;
    position: relative;
    border-radius: 20px;
    border: 1px solid var(--border-accent);
    box-shadow: var(--glow-primary), 0 25px 80px rgba(0, 0, 0, 0.6);
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 1.5rem;
    z-index: 10;
    cursor: pointer;
    font-size: 2rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid transparent;
}

.modal-close:hover {
    color: var(--accent-secondary);
    background: var(--card-bg-hover);
    border-color: var(--accent-secondary);
    transform: rotate(90deg);
}

.modal-title {
    margin: 2.5rem 0 1.5rem 0; /* увеличенный отступ сверху, чтобы не пересекаться с кнопкой закрытия */
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
}

.modal-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Mobile Buttons Container */
.mobile-buttons-container {
    display: none;
}

/* Mobile Profile Button - Fixed Floating Button */
.mobile-profile-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    border: 1px solid var(--border-accent);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease, bottom 0.3s ease;
    box-shadow: var(--shadow-card);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.mobile-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card), 0 8px 25px rgba(0, 212, 255, 0.3);
    border-color: var(--accent-primary);
}

.mobile-profile-btn:active {
    transform: scale(0.95);
}

/* Add pulse animation to profile button */
.mobile-profile-btn::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--card-bg);
    border-radius: 50%;
    z-index: -1;
    animation: profilePulse 2s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes profilePulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.1;
    }
}

/* Mobile Categories Modal */
.categories-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.categories-modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.categories-modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-accent);
    box-shadow: var(--glow-primary), 0 25px 80px rgba(0, 0, 0, 0.6);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.4s ease-out;
}

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

.categories-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
}

.categories-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.categories-modal-close:hover {
    background: var(--card-bg-hover);
    color: var(--accent-secondary);
    transform: rotate(90deg);
}

.categories-modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.categories-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.categories-modal-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: var(--card-bg);
    position: relative;
    overflow: hidden;
}

.categories-modal-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    transition: all 0.3s ease;
}

.categories-modal-item:hover::before {
    height: 100%;
}

.categories-modal-item:hover {
    background: var(--card-bg-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
    transform: translateX(5px);
    box-shadow: var(--shadow-card);
}

.categories-modal-item.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    color: white;
    box-shadow: var(--glow-primary), var(--shadow-card);
    border-color: var(--accent-primary);
}

.categories-modal-item.active::before {
    height: 100%;
    background: white;
}

.categories-modal-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.categories-modal-name {
    flex: 1;
    font-weight: 500;
    font-size: 1rem;
}

.categories-modal-badge {
    background: linear-gradient(135deg, var(--accent-green), #16a34a);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* Custom scrollbar for modal */
.categories-modal-body::-webkit-scrollbar {
    width: 6px;
}

.categories-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.categories-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 3px;
}

.categories-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

/* Custom scrollbar for modal-content (Agreement/Privacy) */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

.modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(0,0,0,0.1);
}

/* Improved mobile interactions */
.categories-modal-item {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.categories-modal-item:active {
    transform: translateX(5px) scale(0.98);
}

.current-category:active {
    transform: translateY(-1px) scale(0.98);
}

.mobile-profile-btn:active {
    transform: scale(0.9);
}

/* Mobile Profile Modal */
.profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10002;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 1;
}

.profile-modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border-accent);
    box-shadow: var(--glow-primary), 0 25px 80px rgba(0, 0, 0, 0.6);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    position: relative;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.profile-modal.show .profile-modal-content {
    transform: translateY(50px) scale(1);
    opacity: 1;
}

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

.profile-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease-in-out infinite;
}

.profile-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-modal-close:hover {
    background: var(--card-bg-hover);
    color: var(--accent-secondary);
    transform: rotate(90deg);
}

.profile-modal-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Profile User Section */
.profile-user-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-login-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.profile-login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.profile-login-btn:hover::before {
    left: 100%;
}

.profile-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4), var(--shadow-card);
}

.profile-currency-display {
    display: flex;
    gap: 0.5rem;
}

.profile-currency-item {
    flex: 1;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem 0.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.profile-currency-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3), var(--shadow-card);
}

.profile-buy-btn {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.profile-buy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.profile-buy-btn:hover::before {
    left: 100%;
}

.profile-buy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4), var(--shadow-card);
}

/* Better touch targets for mobile */
@media (max-width: 480px) {
    .categories-modal-item {
        padding: 1rem 1.2rem;
        min-height: 48px; /* Minimum touch target size */
    }
    
    .categories-modal-close {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }
    
    .mobile-profile-btn {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
        font-size: 1.3rem;
    }
}

/* Large screens - show both sidebars */
@media (min-width: 1025px) {
    .right-sidebar {
        display: flex;
    }
    
    .page-footer {
        display: none; /* Hide page footer on desktop */
    }
    
    .sidebar-footer {
        display: flex; /* Show sidebar footer on desktop */
    }
}

/* All tablet and mobile screens - common styles */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 250px;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        top: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        background: linear-gradient(180deg, 
            rgba(15, 20, 25, 0.95) 0%, 
            rgba(15, 20, 25, 0.90) 50%, 
            rgba(15, 20, 25, 0.95) 100%);
        backdrop-filter: blur(20px);
    }
    
    .right-sidebar {
        display: none; /* Hide right sidebar on all tablet and mobile */
    }
    
    .content {
        margin-left: 0;
        margin-right: 0;
    }
    
    .page-footer {
        display: block; /* Show page footer on all tablet and mobile */
        margin-left: 0;
        margin-right: 0;
        background: rgba(20, 23, 35, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: 1.5rem 1rem;
        margin-top: 2rem;
        margin-bottom: 0; /* Remove space for bottom ad container */
        z-index: 1; /* Footer should not be above ad container */
        position: relative;
    }
    
    .page-footer-content {
        justify-content: center;
        gap: 0.8rem;
    }
    
    .page-footer-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 6px;
        border: 1px solid transparent;
        transition: all 0.3s ease;
        flex: 1;
        max-width: 120px;
        text-align: center;
    }
    
    .page-footer-link:hover {
        border-color: var(--border-accent);
        background: var(--card-bg-hover);
    }
    
    .categories-nav {
        display: none; /* Hide default categories nav */
    }
    
    .mobile-profile-btn {
        display: flex; /* Show mobile profile button */
    }
    
    .sidebar-footer {
        display: none; /* Hide sidebar footer */
    }
}

/* Tablet specific adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .content {
        padding: 2rem;
    }
    
    .page-footer {
        padding: 1.5rem 2rem;
    }
    
    .page-footer-content {
        gap: 1rem;
    }
    
    .page-footer-link {
        padding: 0.6rem 1rem;
        max-width: 140px;
    }
    
    .user-section {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    
    .currency-display {
        flex-direction: row;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 1rem;
    }
    
    .page-footer-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        max-width: 100px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.875rem;
    }
    
    .ad-card {
        min-height: 150px;
    }
    
    .game-info {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
    
    .user-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .current-category-title {
        font-size: 1rem;
    }
    

    
    .current-category {
        padding: 1.2rem 0.8rem;
        min-height: 70px;
    }
    
    .sidebar {
        padding: 1rem;
    }
    
    /* Adjust modal size for mobile */
    .categories-modal-content {
        width: 95%;
        max-height: 85vh;
        margin: 1rem;
    }
    
    .categories-modal-header {
        padding: 1rem 1.5rem 0.5rem 1.5rem;
    }
    
    .categories-modal-title {
        font-size: 1.3rem;
    }
    
    .categories-modal-item {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .ad-card {
        min-height: 120px;
    }
    
    .game-info {
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .game-title {
        font-size: 0.8rem;
        line-height: 1.2;
        margin: 0;
    }
    
    .play-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
        top: 45%;
    }
    
    .play-btn::after {
        border-left: 10px solid white;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        margin-left: 2px;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 16px;
    }

    .game-card:hover {
        transform: translateY(-8px) scale(1.01);
    }
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

/* Loading Animation for game cards */
@keyframes cardLoad {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.game-card {
    animation: cardLoad 0.5s ease-out forwards;
}

/* Hover effects for interactive elements */
.sidebar,
.content {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.category-item:focus,
.footer-link:focus,
.login-btn:focus,
.gift-btn:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Glass morphism effect enhancement */
.sidebar,
.current-category,
.game-card,
.modal-content {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Additional glow effects */
.login-btn:hover,
.gift-btn:hover,
.play-btn:hover {
    filter: brightness(1.1);
}

/* Enhanced text shadows for better readability */
.current-category-title,
.game-title {
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Load More Games Button */
.load-more-container {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
    padding: 0 1rem;
}

.load-more-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border: none;
    border-radius: 25px;
    padding: 1rem 2.5rem;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    min-width: 160px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: all 0.6s ease;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary), 0 8px 25px rgba(0, 212, 255, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.load-more-btn:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-card);
}

.load-more-text {
    transition: all 0.3s ease;
}

.load-more-spinner {
    font-size: 1.2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile adjustments for load more button */
@media (max-width: 768px) {
    .load-more-container {
        margin: 2rem 0;
        padding: 0 0.5rem;
    }
    
    .load-more-btn {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
        min-width: 140px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .load-more-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
        min-width: 120px;
        height: 40px;
    }
}

/* Modal positioning responsive adjustments */
@media (max-width: 768px) {
    .modal,
    .profile-modal.show,
    .categories-modal.show {
        padding-top: 12vh;
    }
}

@media (max-width: 480px) {
    .modal,
    .profile-modal.show,
    .categories-modal.show {
        padding-top: 10vh;
    }
}

/* ========================================================================== */
/* Lvl.Land — luminous AAA gaming catalogue                                 */
/* One cohesive light theme layered over the legacy structural rules.       */
/* ========================================================================== */

:root {
    color-scheme: light;
    --primary-bg: #edf3ff;
    --secondary-bg: #e7effc;
    --sidebar-bg: rgba(249, 252, 255, 0.9);
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-bg-hover: #ffffff;
    --accent-primary: #006cff;
    --accent-secondary: #ff3d71;
    --accent-purple: #7047eb;
    --accent-pink: #ec3da5;
    --accent-green: #0b9f6e;
    --accent-gold: #d68200;
    --accent-red: #d72d4f;
    --text-primary: #101a38;
    --text-secondary: #405071;
    --text-muted: #697694;
    --border-color: rgba(89, 111, 157, 0.2);
    --border-accent: rgba(0, 108, 255, 0.35);
    --glow-primary: 0 0 0 4px rgba(0, 108, 255, 0.12), 0 14px 32px rgba(0, 108, 255, 0.13);
    --glow-secondary: 0 0 0 4px rgba(112, 71, 235, 0.1), 0 12px 28px rgba(112, 71, 235, 0.13);
    --shadow-primary: 0 18px 50px rgba(36, 56, 103, 0.14);
    --shadow-card: 0 10px 25px rgba(40, 59, 105, 0.1), 0 2px 7px rgba(40, 59, 105, 0.06);
    --shadow-card-hover: 0 25px 54px rgba(47, 61, 118, 0.2), 0 9px 22px rgba(0, 108, 255, 0.12);
    --sidebar-width: 270px;
    --header-height: 78px;
    --glass-bg: rgba(252, 254, 255, 0.88);
    --glass-border: rgba(106, 127, 171, 0.2);
    --surface-soft: #f4f7ff;
    --surface-blue: #e9f3ff;
    --surface-violet: #f0edff;
    --surface-pink: #fff0f7;
    --focus-ring: #005ce6;
    --gaming-gradient: linear-gradient(128deg, #006cff 0%, #5950e8 52%, #b334d2 100%);
    --gaming-gradient-hot: linear-gradient(128deg, #006cff 0%, #7047eb 48%, #ec3da5 100%);
    --gaming-edge: linear-gradient(90deg, #00b8ff, #5255ea 52%, #ec3da5);
}

html {
    background: #edf3ff;
    scrollbar-color: #8198bf #e6edfa;
    scrollbar-width: thin;
}

body {
    color: var(--text-primary);
    background: #edf3ff;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

body::before {
    background:
        radial-gradient(circle at 7% 3%, rgba(0, 184, 255, 0.2), transparent 29rem),
        radial-gradient(circle at 94% 9%, rgba(112, 71, 235, 0.17), transparent 32rem),
        radial-gradient(circle at 54% 90%, rgba(236, 61, 165, 0.08), transparent 34rem),
        linear-gradient(138deg, #f8fbff 0%, #edf4ff 43%, #f5f0ff 100%);
    z-index: -4;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(28, 78, 145, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 78, 145, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

.cosmic-bg {
    background:
        radial-gradient(circle at 18% 22%, rgba(0, 184, 255, 0.13), transparent 31%),
        radial-gradient(circle at 84% 17%, rgba(112, 71, 235, 0.12), transparent 32%),
        conic-gradient(from 105deg at 52% 42%, transparent 0 28%, rgba(255, 255, 255, 0.75) 33%, transparent 39% 100%);
    opacity: 0.92;
    animation: luminousField 14s ease-in-out infinite alternate;
    z-index: -2;
}

@keyframes luminousField {
    from {
        opacity: 0.68;
        transform: scale(1);
    }
    to {
        opacity: 1;
        transform: scale(1.035);
    }
}

::selection {
    color: #ffffff;
    background: #4c49d9;
}

/* Desktop rails */
.main-layout {
    min-height: calc(100vh - var(--header-height));
}

.sidebar,
.right-sidebar {
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    padding: 1.3rem 1.05rem;
    gap: 1.05rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.9)),
        linear-gradient(135deg, rgba(0, 184, 255, 0.08), rgba(112, 71, 235, 0.07));
    border-color: rgba(89, 111, 157, 0.2);
    box-shadow: 0 17px 44px rgba(36, 56, 103, 0.12);
    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.sidebar::before,
.right-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    width: 64%;
    height: 3px;
    background: var(--gaming-edge);
    opacity: 0.76;
    box-shadow: 0 0 17px rgba(0, 108, 255, 0.28);
    pointer-events: none;
}

.sidebar::before {
    right: 0;
}

.right-sidebar::before {
    left: 0;
    transform: scaleX(-1);
}

.sidebar {
    border-right: 1px solid rgba(89, 111, 157, 0.2);
}

.right-sidebar {
    border-left: 1px solid rgba(89, 111, 157, 0.2);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar,
.right-sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track,
.right-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.right-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(#32b9f3, #6b57e6);
    border-radius: 999px;
}

/* Category command module */
.current-category {
    min-height: 82px;
    margin-top: 0.15rem;
    padding: 1rem 0.95rem;
    color: var(--text-primary);
    background:
        linear-gradient(132deg, rgba(230, 247, 255, 0.98), rgba(239, 235, 255, 0.98) 62%, rgba(255, 239, 249, 0.94));
    border: 1px solid rgba(60, 113, 214, 0.3);
    border-radius: 18px;
    box-shadow: 0 14px 29px rgba(47, 67, 123, 0.12), inset 0 1px 0 #ffffff;
    isolation: isolate;
    backdrop-filter: none;
}

.current-category::before {
    display: block;
    top: -80%;
    left: -35%;
    width: 55%;
    height: 260%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.86), transparent);
    opacity: 0.68;
    animation: categorySweep 6s ease-in-out infinite;
    transform: rotate(22deg);
}

.current-category::after {
    content: '';
    position: absolute;
    right: -22px;
    bottom: -34px;
    z-index: -1;
    width: 96px;
    height: 96px;
    background: radial-gradient(circle, rgba(112, 71, 235, 0.23), transparent 67%);
    pointer-events: none;
}

@keyframes categorySweep {
    0%,
    52% {
        left: -65%;
    }
    88%,
    100% {
        left: 130%;
    }
}

.current-category:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 108, 255, 0.56);
    box-shadow: 0 18px 35px rgba(47, 67, 123, 0.16), 0 0 0 4px rgba(0, 108, 255, 0.07);
}

.current-category-title {
    color: #152344;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.42;
    letter-spacing: 0.015em;
    text-shadow: 0 1px 0 #ffffff;
}

.sidebar-divider {
    height: 1px;
    margin: 0.15rem 0;
    background: linear-gradient(90deg, transparent, rgba(0, 108, 255, 0.28), rgba(112, 71, 235, 0.26), transparent);
}

.sidebar-divider::after {
    display: none;
}

.sidebar-divider--desktop {
    margin: 0.4rem 0;
}

.categories-title {
    margin: 0 0 0.6rem 0.35rem;
    color: #687797;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.categories-nav {
    gap: 0.23rem;
}

.category-item {
    min-height: 44px;
    gap: 0.68rem;
    padding: 0.53rem 0.62rem;
    color: #435373;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 13px;
    isolation: isolate;
    overflow: hidden;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.category-item::before {
    left: 0;
    width: 3px;
    height: 58%;
    background: linear-gradient(#00b8ff, #7047eb);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transform: translateY(-50%) scaleY(0.4);
}

.category-item::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(108deg, rgba(0, 184, 255, 0.11), rgba(112, 71, 235, 0.08));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.category-item:hover {
    color: #10224a;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 108, 255, 0.17);
    box-shadow: 0 8px 18px rgba(39, 60, 106, 0.08);
    transform: translateX(3px);
}

.category-item:hover::before,
.category-item:hover::after {
    opacity: 1;
}

.category-item:hover::before {
    transform: translateY(-50%) scaleY(1);
}

.category-item.active {
    color: #ffffff;
    background: var(--gaming-gradient);
    border-color: rgba(45, 40, 151, 0.18);
    box-shadow: 0 12px 24px rgba(55, 66, 184, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transform: none;
}

.category-item.active::before {
    width: 4px;
    height: 64%;
    background: #ffffff;
    opacity: 0.82;
    transform: translateY(-50%) scaleY(1);
}

.category-item.active::after {
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.16), transparent 55%);
    opacity: 1;
}

.category-icon {
    display: inline-flex;
    width: 27px;
    min-width: 27px;
    height: 27px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 108, 255, 0.08);
    border: 1px solid rgba(0, 108, 255, 0.12);
    border-radius: 8px;
    font-size: 0.98rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.category-item.active .category-icon {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: none;
}

.category-name {
    position: relative;
    z-index: 1;
    font-size: 0.86rem;
    font-weight: 650;
}

.category-badge,
.categories-modal-badge {
    color: #ffffff;
    background: linear-gradient(135deg, #0b9f6e, #00bd8a);
    border: 1px solid rgba(0, 111, 77, 0.12);
    box-shadow: 0 5px 12px rgba(11, 159, 110, 0.22);
    animation: none;
}

.category-item.active .category-badge {
    color: #0b6d50;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.42);
}

.sidebar-footer {
    gap: 0.25rem;
    padding-top: 0.55rem;
}

.footer-link,
.page-footer-link {
    color: #62708d;
    font-weight: 650;
}

.footer-link::after,
.page-footer-link::after {
    background: var(--gaming-edge);
}

.footer-link:hover,
.page-footer-link:hover {
    color: #17274a;
    background: rgba(232, 241, 255, 0.85);
    transform: translateX(2px);
}

/* Player rail */
.user-section {
    gap: 0.78rem;
    margin-top: 0.15rem;
}

.user-info,
.profile-user-info,
.currency-item,
.profile-currency-item,
.stat-item {
    color: var(--text-primary);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 245, 255, 0.95));
    border: 1px solid rgba(89, 111, 157, 0.22);
    box-shadow: 0 7px 18px rgba(38, 57, 101, 0.08), inset 0 1px 0 #ffffff;
    backdrop-filter: none;
}

.user-info,
.profile-user-info {
    min-height: 46px;
    border-radius: 13px;
}

.user-info:hover,
.profile-user-info:hover,
.currency-item:hover,
.profile-currency-item:hover,
.stat-item:hover {
    border-color: rgba(0, 108, 255, 0.42);
    box-shadow: 0 10px 22px rgba(38, 57, 101, 0.12), 0 0 0 3px rgba(0, 108, 255, 0.06);
    transform: translateY(-2px);
}

.username,
.profile-username,
.stat-value {
    color: #17264a;
    font-weight: 700;
}

.currency-display {
    gap: 0.55rem;
}

.currency-item,
.profile-currency-item {
    min-height: 48px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 246, 221, 0.72));
    border-radius: 13px;
}

.currency-item:hover,
.profile-currency-item:hover {
    border-color: rgba(214, 130, 0, 0.43);
    box-shadow: 0 10px 23px rgba(176, 108, 0, 0.12);
}

.login-btn,
.gift-btn,
.profile-login-btn,
.profile-buy-btn,
.btn-primary,
.load-more-btn,
.gift-action-btn {
    color: #ffffff;
    background: var(--gaming-gradient-hot);
    border: 1px solid rgba(35, 31, 135, 0.16);
    box-shadow: 0 10px 22px rgba(69, 65, 190, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.26);
    text-shadow: 0 1px 3px rgba(27, 21, 91, 0.24);
}

.login-btn,
.gift-btn,
.profile-login-btn,
.profile-buy-btn {
    min-height: 45px;
    border-radius: 13px;
}

.login-btn::before,
.gift-btn::before,
.profile-login-btn::before,
.profile-buy-btn::before,
.admin-btn::before,
.logout-btn::before,
.profile-admin-btn::before,
.profile-logout-btn::before,
.btn-primary::before,
.load-more-btn::before {
    display: block;
    left: -125%;
    width: 70%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-18deg);
    transition: left 0.5s ease;
}

.login-btn:hover::before,
.gift-btn:hover::before,
.profile-login-btn:hover::before,
.profile-buy-btn:hover::before,
.btn-primary:hover::before,
.load-more-btn:hover::before {
    left: 140%;
}

.login-btn:hover,
.gift-btn:hover,
.profile-login-btn:hover,
.profile-buy-btn:hover,
.btn-primary:hover,
.load-more-btn:hover {
    filter: saturate(1.08) brightness(1.04);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(69, 65, 190, 0.31), 0 0 0 4px rgba(0, 108, 255, 0.08);
}

.sidebar-logout,
.profile-logout-section {
    padding-top: 0.78rem;
    border-top: 1px solid rgba(89, 111, 157, 0.18);
}

.admin-btn,
.logout-btn,
.profile-admin-btn,
.profile-logout-btn {
    min-height: 43px;
    color: #26375c;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(89, 111, 157, 0.23);
    border-radius: 12px;
    box-shadow: 0 5px 13px rgba(38, 57, 101, 0.06);
}

.admin-btn:hover,
.profile-admin-btn:hover {
    color: #3340b5;
    background: var(--surface-violet);
    border-color: rgba(112, 71, 235, 0.28);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(112, 71, 235, 0.1);
}

.logout-btn:hover,
.profile-logout-btn:hover {
    color: #b41e43;
    background: #fff0f3;
    border-color: rgba(215, 45, 79, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(215, 45, 79, 0.08);
}

/* Game catalogue — artwork-first cards */
.content {
    min-width: 0;
    padding: 1.8rem 1.4rem 2.65rem;
    position: relative;
}

.content::before {
    content: '';
    display: block;
    width: min(190px, 28%);
    height: 3px;
    margin: 0 0 1.2rem;
    background: var(--gaming-edge);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 108, 255, 0.18);
    opacity: 0.8;
}

.games-grid {
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 1.05rem;
    perspective: 1200px;
}

.game-card,
.ad-card {
    background: rgba(255, 255, 255, 0.93);
    border: 1px solid rgba(75, 100, 151, 0.24);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.game-card {
    overflow: hidden;
    opacity: 0;
    isolation: isolate;
    animation: gameCardDeploy 0.5s cubic-bezier(0.2, 0.72, 0.25, 1) forwards;
    transition:
        transform 0.28s cubic-bezier(0.2, 0.72, 0.25, 1),
        border-color 0.24s ease,
        box-shadow 0.28s ease;
}

@keyframes gameCardDeploy {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.975);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.game-card::before {
    inset: 0;
    z-index: 3;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 34%),
        linear-gradient(to top right, rgba(0, 184, 255, 0.08), transparent 46%, rgba(236, 61, 165, 0.09));
    border-radius: inherit;
    opacity: 0;
}

.game-card::after {
    content: '';
    position: absolute;
    right: 18%;
    bottom: 0;
    left: 18%;
    z-index: 6;
    height: 3px;
    background: var(--gaming-edge);
    border-radius: 4px 4px 0 0;
    box-shadow: 0 0 15px rgba(0, 108, 255, 0.48);
    opacity: 0.76;
    transform: scaleX(0.48);
    transition: opacity 0.24s ease, transform 0.3s ease;
    pointer-events: none;
}

.game-card:hover::before,
.game-card:focus-within::before {
    opacity: 1;
}

.game-card:hover::after,
.game-card:focus-within::after,
.game-card.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.game-card:hover,
.game-card:focus-within {
    transform: translateY(-8px) scale(1.018);
    border-color: rgba(0, 108, 255, 0.48);
    box-shadow: var(--shadow-card-hover), 0 0 0 4px rgba(0, 108, 255, 0.055);
}

.game-thumbnail {
    overflow: hidden;
    background: linear-gradient(135deg, #dce7f8, #ece8fb);
    border-radius: 19px;
}

.game-thumbnail::before {
    background:
        linear-gradient(to top, rgba(8, 14, 38, 0.88), rgba(14, 24, 58, 0.16) 62%, transparent),
        linear-gradient(135deg, rgba(0, 108, 255, 0.09), transparent 44%, rgba(236, 61, 165, 0.12));
    border-radius: 19px;
    opacity: 0.38;
}

.game-thumbnail::after {
    content: '';
    position: absolute;
    inset: -35% -80%;
    z-index: 2;
    background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 0.3) 50%, transparent 58%);
    opacity: 0;
    transform: translateX(-28%) rotate(5deg);
    transition: opacity 0.24s ease, transform 0.7s ease;
    pointer-events: none;
}

.game-card:hover .game-thumbnail::before,
.game-card:focus-within .game-thumbnail::before,
.game-card.active .game-thumbnail::before {
    opacity: 1;
}

.game-card:hover .game-thumbnail::after,
.game-card:focus-within .game-thumbnail::after {
    opacity: 0.62;
    transform: translateX(30%) rotate(5deg);
}

.game-thumbnail img {
    background: #dce7f8;
    border-radius: 19px;
    filter: saturate(1.02) contrast(1.035);
    transform: scale(1);
    transform-origin: center;
}

.game-card:hover .game-thumbnail img,
.game-card:focus-within .game-thumbnail img {
    transform: scale(1.1);
    filter: saturate(1.13) contrast(1.06);
}

.game-info,
.animated-game-info {
    padding: 2.8rem 0.82rem 0.84rem;
    color: #ffffff;
    background:
        linear-gradient(to top, rgba(7, 12, 34, 0.94), rgba(15, 26, 62, 0.68) 54%, transparent);
    border-radius: 0 0 19px 19px;
    opacity: 1;
    transform: none;
    pointer-events: none;
    backdrop-filter: none;
}

.game-card.active .game-info,
.game-card.active .animated-game-info {
    opacity: 1;
    transform: none;
    animation: none;
}

.game-card .game-title,
.game-title {
    margin: 0;
    padding: 0;
    color: #ffffff;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.79rem;
    font-weight: 700;
    line-height: 1.33;
    letter-spacing: 0.015em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.68);
}

.game-info-btn {
    top: 0.64rem;
    right: 0.64rem;
    width: 33px;
    height: 33px;
    z-index: 7;
    color: #ffffff;
    background: rgba(9, 18, 48, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 10px;
    box-shadow:
        0 10px 24px rgba(7, 14, 38, 0.3),
        0 2px 7px rgba(0, 108, 255, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px) scale(0.88);
    backdrop-filter: blur(11px) saturate(1.25);
    -webkit-backdrop-filter: blur(11px) saturate(1.25);
    transition:
        opacity 0.2s ease,
        transform 0.24s cubic-bezier(0.2, 0.72, 0.25, 1),
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.24s ease;
}

.game-info-btn span {
    color: #ffffff;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    text-shadow: 0 2px 7px rgba(4, 9, 30, 0.8);
}

.game-card:focus-within .game-info-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

@media (hover: hover) and (pointer: fine) {
    .game-card:hover .game-info-btn {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }
}

@media (hover: none), (pointer: coarse) {
    .game-card.active .game-info-btn {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0) scale(1);
    }
}

.game-info-btn:hover {
    color: #ffffff;
    background: rgba(14, 27, 67, 0.28);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 13px 29px rgba(7, 14, 38, 0.38),
        0 0 0 3px rgba(0, 184, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.58);
    transform: translateY(-2px) rotate(2deg);
}

.game-info-btn:hover span {
    color: #ffffff;
}

.game-badge,
.game-badge.new {
    top: 0.64rem;
    left: 0.64rem;
    right: auto;
    padding: 0.34rem 0.61rem;
    color: #ffffff;
    background: linear-gradient(130deg, #08a975, #00c18d);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 9px 9px 9px 3px;
    box-shadow: 0 7px 18px rgba(0, 106, 75, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    animation: badgeSignal 2.8s ease-in-out infinite;
}

@keyframes badgeSignal {
    0%,
    100% {
        transform: translateY(0);
        box-shadow: 0 7px 18px rgba(0, 106, 75, 0.27);
    }
    50% {
        transform: translateY(-1px);
        box-shadow: 0 8px 22px rgba(0, 180, 128, 0.4), 0 0 0 4px rgba(0, 193, 141, 0.08);
    }
}

.play-btn,
.animated-play-btn {
    width: 58px;
    height: 58px;
    background: var(--gaming-gradient-hot);
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 14px 31px rgba(7, 14, 38, 0.4),
        0 0 0 6px rgba(255, 255, 255, 0.14),
        0 0 0 7px rgba(0, 184, 255, 0.17);
}

.play-btn::before {
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.37), transparent 80%);
    opacity: 0.65;
}

.game-card:hover .animated-play-btn,
.game-card:focus-within .animated-play-btn,
.game-card.active .animated-play-btn,
.game-card:hover .play-btn,
.game-card:focus-within .play-btn,
.game-card.active .play-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    animation: playSignal 2.4s ease-in-out infinite;
}

@keyframes playSignal {
    0%,
    100% {
        box-shadow:
            0 14px 31px rgba(7, 14, 38, 0.4),
            0 0 0 6px rgba(255, 255, 255, 0.14),
            0 0 0 7px rgba(0, 184, 255, 0.17);
    }
    50% {
        box-shadow:
            0 16px 34px rgba(7, 14, 38, 0.46),
            0 0 0 8px rgba(255, 255, 255, 0.12),
            0 0 0 13px rgba(0, 184, 255, 0);
    }
}

.play-btn:hover {
    transform: translate(-50%, -50%) scale(1.09);
    filter: saturate(1.15) brightness(1.08);
}

.ad-card {
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(237, 244, 255, 0.95)),
        linear-gradient(135deg, rgba(0, 184, 255, 0.08), rgba(112, 71, 235, 0.08));
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ad-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(0, 108, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 108, 255, 0.04) 1px, transparent 1px);
    background-size: 18px 18px;
    pointer-events: none;
}

.ad-card:hover {
    transform: translateY(-5px);
    border-color: rgba(112, 71, 235, 0.34);
    box-shadow: 0 19px 37px rgba(47, 61, 118, 0.15);
}

.no-results {
    color: var(--text-primary);
    background:
        radial-gradient(circle at 15% 20%, rgba(0, 184, 255, 0.12), transparent 34%),
        radial-gradient(circle at 88% 80%, rgba(112, 71, 235, 0.1), transparent 36%),
        rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(75, 100, 151, 0.24);
    border-radius: 22px;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
}

.no-results-icon {
    filter: drop-shadow(0 9px 15px rgba(67, 68, 160, 0.18));
    opacity: 1;
}

.no-results h3 {
    color: #17264a;
    font-family: 'Orbitron', 'Inter', sans-serif;
}

.no-results p {
    color: #5f6e8c;
}

.btn-primary,
.load-more-btn {
    border-radius: 14px;
}

.load-more-container {
    margin: 2.3rem 0 1rem;
}

.load-more-btn {
    min-height: 50px;
    height: auto;
    padding: 0.82rem 1.95rem;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.055em;
}

.load-more-btn:disabled {
    color: #697694;
    background: #dce4f3;
    border-color: #c6d2e6;
    box-shadow: none;
    text-shadow: none;
}

/* Mobile footer */
.page-footer {
    color: var(--text-secondary);
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.96), rgba(239, 244, 255, 0.94));
    border-top: 1px solid rgba(89, 111, 157, 0.22);
    box-shadow: 0 -10px 28px rgba(36, 56, 103, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.page-footer::before {
    content: '';
    position: absolute;
    top: 0;
    right: 22%;
    left: 22%;
    height: 2px;
    background: var(--gaming-edge);
    box-shadow: 0 0 13px rgba(0, 108, 255, 0.24);
}

.page-footer-link {
    min-height: 42px;
}

/* Dialogs */
.modal,
.categories-modal,
.profile-modal {
    background:
        radial-gradient(circle at 20% 14%, rgba(0, 184, 255, 0.17), transparent 29rem),
        rgba(16, 26, 56, 0.57);
    backdrop-filter: blur(11px) saturate(125%);
    -webkit-backdrop-filter: blur(11px) saturate(125%);
}

.modal {
    align-items: center;
    padding: 1.5rem;
}

.modal-content,
.categories-modal-content,
.profile-modal-content {
    color: var(--text-primary);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(242, 247, 255, 0.98) 66%, rgba(247, 240, 255, 0.98));
    border: 1px solid rgba(119, 134, 171, 0.32);
    border-radius: 23px;
    box-shadow: 0 34px 90px rgba(11, 21, 52, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
}

.modal-content {
    width: min(92vw, 620px);
    max-height: min(80vh, 760px);
    max-height: min(80dvh, 760px);
    padding: 2rem;
}

.modal-content::before,
.categories-modal-content::before,
.profile-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    right: 18%;
    left: 18%;
    z-index: 2;
    height: 3px;
    background: var(--gaming-edge);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 17px rgba(0, 108, 255, 0.32);
    pointer-events: none;
}

.modal-close,
.categories-modal-close,
.profile-modal-close {
    width: 42px;
    height: 42px;
    min-width: 42px;
    color: #566685;
    background: rgba(239, 244, 255, 0.92);
    border: 1px solid rgba(89, 111, 157, 0.22);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 #ffffff;
}

.modal-close {
    top: 1rem;
    right: 1rem;
    font-size: 1.65rem;
}

.modal-close:hover,
.categories-modal-close:hover,
.profile-modal-close:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #d72d4f, #ec3da5);
    border-color: transparent;
    box-shadow: 0 9px 20px rgba(215, 45, 79, 0.22);
    transform: rotate(4deg);
}

.modal-title {
    margin: 0.35rem 3rem 1.3rem 0;
    color: #17264a;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: clamp(1.3rem, 3vw, 1.72rem);
    line-height: 1.25;
    text-align: left;
}

.modal-text {
    color: #425273;
    line-height: 1.75;
}

.modal-text a {
    color: #005ee0;
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.categories-modal.show,
.profile-modal.show {
    align-items: center;
    padding: 1.5rem;
}

.categories-modal-content,
.profile-modal-content {
    width: min(92vw, 440px);
    max-height: min(84vh, 730px);
    max-height: min(84dvh, 730px);
}

.profile-modal.show .profile-modal-content {
    opacity: 1;
    transform: none;
}

.categories-modal-header,
.profile-modal-header {
    padding: 1.28rem 1.3rem 1rem;
    background: rgba(248, 251, 255, 0.78);
    border-bottom: 1px solid rgba(89, 111, 157, 0.18);
}

.categories-modal-title,
.profile-modal-title {
    color: transparent;
    background: linear-gradient(110deg, #17264a, #006cff 50%, #7047eb);
    background-clip: text;
    -webkit-background-clip: text;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 1.26rem;
    animation: none;
}

.categories-modal-body,
.profile-modal-body {
    padding: 1rem;
    scrollbar-color: #728db8 #e7edf8;
}

.categories-modal-list {
    gap: 0.42rem;
}

.categories-modal-item {
    min-height: 50px;
    padding: 0.78rem 0.88rem;
    color: #455577;
    background: rgba(248, 251, 255, 0.88);
    border: 1px solid rgba(89, 111, 157, 0.17);
    border-radius: 13px;
}

.categories-modal-item::before {
    background: linear-gradient(#00b8ff, #7047eb);
}

.categories-modal-item:hover {
    color: #17264a;
    background: linear-gradient(110deg, rgba(231, 246, 255, 0.95), rgba(240, 236, 255, 0.95));
    border-color: rgba(0, 108, 255, 0.25);
    box-shadow: 0 8px 18px rgba(39, 60, 106, 0.09);
    transform: translateX(3px);
}

.categories-modal-item.active {
    color: #ffffff;
    background: var(--gaming-gradient);
    border-color: transparent;
    box-shadow: 0 11px 24px rgba(55, 66, 184, 0.23);
}

.categories-modal-item.active::before {
    background: #ffffff;
}

.categories-modal-body::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: #e7edf8;
}

.categories-modal-body::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(#32b9f3, #6b57e6);
}

.modal-content {
    scrollbar-color: #728db8 #e7edf8;
}

/* Login and registration forms */
#login-form label,
#register-form label {
    color: #334567 !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 700;
}

#login-form input,
#register-form input {
    min-height: 47px;
    color: #101a38 !important;
    background: rgba(248, 251, 255, 0.96) !important;
    border: 1px solid rgba(89, 111, 157, 0.3) !important;
    border-radius: 13px !important;
    font-family: 'Inter', sans-serif !important;
    box-shadow: inset 0 1px 0 #ffffff;
}

#login-form input:focus,
#register-form input:focus {
    outline: 3px solid rgba(0, 108, 255, 0.15);
    outline-offset: 2px;
    background: #ffffff !important;
    border-color: #006cff !important;
    box-shadow: 0 8px 21px rgba(0, 108, 255, 0.1);
}

#login-form button,
#register-form button {
    min-height: 47px;
    border-radius: 13px !important;
    font-family: 'Inter', sans-serif !important;
}

#login-form button[type='submit'],
#register-form button[type='submit'] {
    color: #ffffff !important;
    background: var(--gaming-gradient-hot) !important;
    box-shadow: 0 10px 22px rgba(69, 65, 190, 0.24);
}

#open-register,
#open-login {
    color: #3d3cb6 !important;
    background: var(--surface-violet) !important;
    border: 1px solid rgba(112, 71, 235, 0.24) !important;
}

#login-error,
#register-error {
    color: #c52249 !important;
}

#register-success {
    color: #087e58 !important;
}

/* Gift dialog retains inline legacy sizing; these rules own its visual layer. */
.gift-modal {
    padding: 1rem;
    background:
        radial-gradient(circle at 20% 14%, rgba(0, 184, 255, 0.17), transparent 29rem),
        rgba(16, 26, 56, 0.57) !important;
    backdrop-filter: blur(11px);
    -webkit-backdrop-filter: blur(11px);
}

.gift-modal-content {
    color: var(--text-primary);
    background:
        radial-gradient(circle at 15% 5%, rgba(0, 184, 255, 0.1), transparent 42%),
        linear-gradient(145deg, #ffffff, #f2f7ff 68%, #f8f0ff) !important;
    border: 1px solid rgba(89, 111, 157, 0.25) !important;
    border-radius: 23px !important;
    box-shadow: 0 34px 90px rgba(11, 21, 52, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.7) !important;
    padding: 1.55rem !important;
}

.gift-speech-bubble {
    color: #344669;
    background: rgba(245, 249, 255, 0.92) !important;
    border: 1px solid rgba(89, 111, 157, 0.22) !important;
    box-shadow: inset 0 1px 0 #ffffff;
}

.gift-speech-bubble > span[aria-hidden='true'] {
    border-top-color: rgba(89, 111, 157, 0.27) !important;
}

.gift-action-btn {
    min-height: 47px;
    background: var(--gaming-gradient-hot) !important;
    border-radius: 13px !important;
    font-family: 'Orbitron', 'Inter', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.gift-panda {
    filter: drop-shadow(0 11px 17px rgba(67, 68, 160, 0.2));
}

/* Mobile profile beacon */
.mobile-profile-btn {
    color: #ffffff;
    background: var(--gaming-gradient-hot);
    border: 2px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 34px rgba(50, 56, 161, 0.32), 0 0 0 5px rgba(0, 184, 255, 0.09);
    backdrop-filter: none;
}

.mobile-profile-btn::before {
    display: block;
    inset: -5px;
    background: transparent;
    border: 1px solid rgba(0, 108, 255, 0.22);
    animation: profileBeacon 2.6s ease-out infinite;
}

@keyframes profileBeacon {
    from {
        opacity: 0.55;
        transform: scale(0.88);
    }
    to {
        opacity: 0;
        transform: scale(1.22);
    }
}

.mobile-profile-btn:hover {
    border-color: #ffffff;
    box-shadow: 0 18px 39px rgba(50, 56, 161, 0.38), 0 0 0 7px rgba(0, 184, 255, 0.1);
}

/* Keyboard navigation */
.category-item:focus-visible,
.footer-link:focus-visible,
.page-footer-link:focus-visible,
.login-btn:focus-visible,
.gift-btn:focus-visible,
.admin-btn:focus-visible,
.logout-btn:focus-visible,
.profile-login-btn:focus-visible,
.profile-buy-btn:focus-visible,
.profile-admin-btn:focus-visible,
.profile-logout-btn:focus-visible,
.mobile-profile-btn:focus-visible,
.categories-modal-item:focus-visible,
.categories-modal-close:focus-visible,
.profile-modal-close:focus-visible,
.modal-close:focus-visible,
.game-info-btn:focus-visible,
.play-btn:focus-visible,
.btn-primary:focus-visible,
.load-more-btn:focus-visible,
#login-form button:focus-visible,
#register-form button:focus-visible {
    outline: 3px solid #00aeea;
    outline-offset: 3px;
}

/* Compact desktop */
@media (min-width: 1025px) and (max-width: 1280px) {
    :root {
        --sidebar-width: 238px;
    }

    .content {
        padding-right: 1.05rem;
        padding-left: 1.05rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
        gap: 0.86rem;
    }

    .category-item {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .main-layout {
        display: block;
        min-height: 0;
    }

    .sidebar {
        position: static;
        width: auto;
        height: auto;
        margin: 1rem 1rem 0;
        padding: 0;
        overflow: visible;
        background: transparent;
        border: 0;
        box-shadow: none;
        backdrop-filter: none;
    }

    .sidebar::before {
        display: none;
    }

    .current-category {
        min-height: 60px;
        padding: 0.82rem 3.4rem 0.82rem 1rem;
        text-align: left;
    }

    .current-category::after {
        content: '\203A';
        top: 50%;
        right: 1rem;
        bottom: auto;
        z-index: 2;
        width: auto;
        height: auto;
        color: #3159ca;
        background: none;
        font-family: 'Inter', sans-serif;
        font-size: 2.1rem;
        font-weight: 500;
        line-height: 1;
        transform: translateY(-53%);
    }

    .current-category-title {
        align-items: flex-start;
        gap: 0.15rem;
    }

    .categories-nav,
    .sidebar-divider,
    .sidebar-divider--desktop,
    .sidebar-footer {
        display: none;
    }

    .right-sidebar {
        display: none;
    }

    .content {
        margin: 0;
        padding: 1.2rem 1rem 2rem;
    }

    .content::before {
        margin-bottom: 1rem;
    }

    .page-footer {
        display: block;
        margin: 0;
        padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom));
    }

    .page-footer-content {
        gap: 0.5rem;
    }

    .page-footer-link {
        min-width: 96px;
        min-height: 44px;
        color: #576684;
        border: 1px solid transparent;
    }

    .page-footer-link:hover {
        border-color: rgba(0, 108, 255, 0.17);
        background: rgba(232, 241, 255, 0.86);
        transform: translateY(-1px);
    }

    .mobile-profile-btn {
        display: flex;
        right: 18px;
        bottom: calc(18px + env(safe-area-inset-bottom));
        width: 59px;
        height: 59px;
    }
}

/* Phones */
@media (max-width: 640px) {
    body::after {
        background-size: 28px 28px;
        opacity: 0.7;
    }

    .sidebar {
        margin: 0.82rem 0.72rem 0;
    }

    .current-category {
        min-height: 56px;
        border-radius: 16px;
    }

    .content {
        padding: 0.86rem 0.72rem 1.55rem;
    }

    .content::before {
        width: 32%;
        margin-bottom: 0.82rem;
    }

    .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.72rem;
    }

    .game-card,
    .ad-card,
    .game-thumbnail,
    .game-thumbnail img,
    .game-thumbnail::before {
        border-radius: 16px;
    }

    .game-info,
    .animated-game-info {
        padding: 2.15rem 0.58rem 0.65rem;
        border-radius: 0 0 16px 16px;
    }

    .game-card .game-title,
    .game-title {
        font-size: 0.66rem;
        line-height: 1.35;
    }

    .game-info-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 31px;
        height: 31px;
        border-radius: 9px;
    }

    .game-badge,
    .game-badge.new {
        top: 0.5rem;
        left: 0.5rem;
        padding: 0.29rem 0.48rem;
        font-size: 0.53rem;
    }

    .play-btn,
    .animated-play-btn {
        top: 48%;
        width: 49px;
        height: 49px;
    }

    .animated-play-btn::after {
        font-size: 1.55rem;
    }

    .modal,
    .categories-modal.show,
    .profile-modal.show {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content,
    .categories-modal-content,
    .profile-modal-content {
        width: 100%;
        max-width: none;
        max-height: 89vh;
        max-height: 89dvh;
        margin: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 23px 23px 0 0;
    }

    .modal-content {
        padding: 1.5rem 1.12rem calc(1.5rem + env(safe-area-inset-bottom));
    }

    .modal-title {
        font-size: 1.28rem;
    }

    .gift-modal {
        align-items: center !important;
        padding: 0.8rem;
    }

    .gift-modal-content {
        border-radius: 21px !important;
    }

    .page-footer-content {
        gap: 0.4rem;
    }

    .page-footer-link {
        max-width: none;
        padding: 0.62rem 0.5rem;
    }
}

@media (max-width: 380px) {
    .games-grid {
        gap: 0.56rem;
    }

    .game-card .game-title,
    .game-title {
        font-size: 0.61rem;
    }

    .game-info-btn {
        width: 29px;
        height: 29px;
    }

    .mobile-profile-btn {
        right: 12px;
        width: 55px;
        height: 55px;
    }
}

@media (hover: none) {
    .game-card:hover,
    .game-card:focus-within,
    .ad-card:hover,
    .current-category:hover {
        transform: none;
    }

    .game-card:hover .game-thumbnail img,
    .game-card:focus-within .game-thumbnail img {
        transform: scale(1);
    }
}

@media (prefers-contrast: more) {
    :root {
        --text-secondary: #283a5d;
        --text-muted: #475879;
        --border-color: rgba(35, 55, 98, 0.42);
    }

    .game-card,
    .ad-card,
    .current-category,
    .modal-content,
    .categories-modal-content,
    .profile-modal-content {
        border-width: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .game-card {
        opacity: 1 !important;
        transform: none !important;
    }
}
