:root {
    /* CrazyGames Dark Theme Color Palette */
    --bg-dark: #0f1015;
    --bg-header: #181922;
    --bg-sidebar: #181922;
    --bg-card: #20222f;
    --bg-input: #292a3b;
    --bg-promo: #1c1d29;
    --bg-promo-cat: #252736;
    --text-main: #f0f0f5;
    --text-muted: #9fa3bc;
    --primary: #5c43d6;
    --primary-hover: #4a34b3;
    --border: #2c2e40;
    
    /* Badges */
    --hot: #ff4747;
    --new: #47ff72;
    --top: #ffcf47;
    --updated: #47b2ff;
    --original: #9d47ff;
    
    /* Layout */
    --header-height: 56px;
    --sidebar-width: 220px;
    --sidebar-collapsed: 54px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--bg-input);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* ================= HEADER ================= */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--bg-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.02);
}

.header-left {
    display: flex;
    align-items: center;
    width: var(--sidebar-collapsed); /* Aligns perfectly with collapsed sidebar */
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-expanded .header-left,
.sidebar:not(.hidden):hover ~ .top-header .header-left {
    width: var(--sidebar-width); /* Aligns perfectly with expanded sidebar */
}

body.sidebar-hidden .header-left {
    width: auto !important;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.3px;
    color: white;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.icon-btn svg,
.icon-btn span {
    pointer-events: none;
}


/* Search Bar */
.search-container {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 24px;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    height: 40px;
    background-color: var(--bg-input);
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 0 20px 0 44px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    transition: 0.2s ease;
}

.search-bar input::placeholder {
    color: #7b7e9a;
}

.search-bar input:focus {
    outline: none;
    background-color: #313347;
    border-color: rgba(255,255,255,0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #7b7e9a;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative; /* Anchor for notifications dropdown */
}

.notification-btn {
    position: relative;
    padding: 0;
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-btn .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
    font-weight: 800;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-header);
    color: white;
    pointer-events: none;
}

.notification-dropdown {
    position: absolute;
    top: calc(var(--header-height) + 12px);
    right: -10px;
    width: 380px;
    background: rgba(26, 27, 38, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.notification-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.notification-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
    margin: 0;
}

.close-notifications {
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-notifications:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

.notification-body {
    max-height: 440px;
    overflow-y: auto;
    padding: 8px 0;
}

.notification-body::-webkit-scrollbar {
    width: 4px;
}

.notification-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.notification-item {
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    position: relative;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.note-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(92, 67, 214, 0.1);
    color: #a491ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.3s;
}

.notification-item:hover .note-icon {
    background: #5c43d6;
    color: white;
    transform: scale(1.05);
}

.note-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.note-content h4 {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.4;
}

.note-content p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 4px;
}

.empty-notifications {
    padding: 60px 40px;
    text-align: center;
}

.empty-notifications .emoji {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    filter: drop-shadow(0 0 15px rgba(164, 145, 255, 0.2));
}

.empty-notifications p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}


/* ================= LAYOUT ================= */
.main-layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    position: relative;
}

/* ================= SIDEBAR ================= */
/* Transition for Sidebar Expansion */
.sidebar {
    width: var(--sidebar-collapsed);
    background-color: var(--bg-sidebar);
    height: calc(100vh - var(--header-height));
    position: fixed;
    left: 0;
    top: var(--header-height);
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, backdrop-filter 0.3s;
    z-index: 1000; /* Higher priority to overlap content on hover */
    border-right: 1px solid rgba(255,255,255,0.02);
}

/* Hover or Expanded State */
.sidebar.expanded,
.sidebar:not(.hidden):hover {
    width: var(--sidebar-width);
    box-shadow: 20px 0 50px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

/* Permanent Fixed Expanded State (via class on body) */
body.sidebar-expanded .sidebar {
    width: var(--sidebar-width);
}

/* Hidden State (toggle via logic) */
.sidebar.hidden {
    width: 0 !important;
    transform: translateX(-100%);
    border: none;
}

.sidebar-inner {
    width: var(--sidebar-width);
    padding: 16px 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.sidebar-inner::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.nav-section {
    padding: 0;
}

.nav-section-title {
    padding: 0 20px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 8px 0;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar:hover .nav-section-title,
.sidebar.expanded .nav-section-title {
    opacity: 1;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13.5px;
    transition: 0.1s ease;
    padding: 0;
    margin: 2px 0;
}

.nav-icon {
    width: var(--sidebar-collapsed);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg,
.nav-icon img,
.nav-icon * {
    width: 18px;
    height: 18px;
    display: block;
}

.nav-text {
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.25s;
    padding-right: 16px;
}

.sidebar:hover .nav-text,
.sidebar.expanded .nav-text {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s, visibility 0s 0s;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.nav-item.active {
    background-color: rgba(164, 145, 255, 0.08); /* Subtle premium highlight */
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 4px;
    background-color: #a491ff;
    border-radius: 0 2px 2px 0;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    color: white;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar.expanded .sidebar-footer,
.sidebar:not(.hidden):hover .sidebar-footer {
    opacity: 1;
    pointer-events: auto;
}

.contact-btn {
    background: linear-gradient(135deg, #5c43d6, #7d5fff);
    color: white;
    border: none;
    border-radius: 12px; /* Matching card border radius for consistency */
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Left aligned icon+text for friendliness */
    gap: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    box-shadow: 0 4px 12px rgba(92, 67, 214, 0.25);
    margin-bottom: 8px;
}

.contact-btn:hover {
    background: linear-gradient(135deg, #4a34b3, #5c43d6);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(92, 67, 214, 0.4);
}

.contact-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-footer-links a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sidebar-footer-links a:hover {
    color: white;
}

.sidebar-social {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 15px;
    max-width: 185px; /* Fits 4 icons (36*4 + 12*3 = 180px) */
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(255, 255, 255, 0.04);
}

.social-icon:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(92, 67, 214, 0.3);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

.divider {
    height: 1px;
    background-color: rgba(255,255,255,0.05);
    margin: 16px 20px;
}

/* ================= CONTENT AREA ================= */
.content-area {
    flex: 1;
    padding: 32px 40px;
    margin-left: var(--sidebar-collapsed) !important;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* Only shift content when sidebar is explicitly LOCKED in expanded mode */
body.sidebar-expanded .content-area {
    margin-left: var(--sidebar-width) !important;
}

body.sidebar-hidden .content-area {
    margin-left: 0 !important;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Sections */
.game-section {
    display: flex;
    flex-direction: column;
}

.game-section, .promo-block {
    margin-bottom: 10px; /* High-density gaps per user request */
}

.section-header {
    display: flex;
    justify-content: flex-start; /* Aligning Show all next to the title */
    align-items: baseline;
    gap: 16px; /* Gap between title and Show all */
    margin-bottom: 8px; /* Tighter header spacing */
}

.section-header h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: white;
}

.show-all {
    color: #a491ff;
    font-size: 14px;
    font-weight: 700;
}
.show-all:hover { color: var(--primary-hover); }

/* Game Cards Row */
.game-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px; /* For hover effect space */
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
/* Hide scrollbar for Chrome, Safari and Opera */
.game-row::-webkit-scrollbar {
    display: none;
}

.game-card {
    display: block; /* Ensures hit-box fills container in Firefox */
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: #1a1b26; /* Darker placeholder background */
    cursor: pointer;
    transition: box-shadow 0.25s ease; /* Transition for the highlight effect */
    flex-shrink: 0; /* Prevents thumbnails from shrinking in flex rows/sliders */
    border: 1px solid rgba(255,255,255,0.05); /* Subtle border for broken images */
}

/* Fallback state when image is broken */
.game-card img:not([src]), 
.game-card img[src=""],
.game-card img[src*="error"] {
    opacity: 0;
}

.game-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); /* Glow shadow */
    z-index: 10;
}

/* Hover Border Overlay: On top of image */
.game-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid transparent; /* Base state */
    pointer-events: none;
    transition: border-color 0.25s ease;
    z-index: 5;
}

.game-card:hover::after {
    border-color: #5c43d6; /* Purple highlight on top of image */
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0; /* Hidden by default, shown by JS on load */
    transition: opacity 0.3s ease;
    min-height: 100%;
    background-color: #1a1b26;
}

.game-card img.loaded {
    opacity: 1;
}

/* Ensure empty/broken images don't show icons */
.game-card.img-broken img {
    display: none;
}

/* Card Overlays */
.game-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px 12px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.large-title {
    font-size: 16px;
    padding: 30px 16px 12px;
}

/* Badges */
.badge-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.badge-tag.top { background-color: var(--top); color: #000; }
.badge-tag.hot { background-color: var(--hot); color: #fff; }
.badge-tag.updated { background-color: var(--updated); color: #fff; }
.badge-tag.original { background-color: var(--original); color: #fff; }

/* Specifically styled cards */
.border-card {
    border-radius: 15px;
    padding: 0; /* Removed padding to make images edge-to-edge */
    background-color: transparent; /* No inner background */
}
.border-card img { border-radius: 12px; }

/* Standardized Card Variants */
.continue-playing-card { 
    width: 86px; 
    height: 86px; 
    border-radius: 18px; 
}

.small-card { width: 140px; height: 110px; }
.medium-card { width: 180px; height: 180px; border-radius: 16px; }
.portrait-card { width: 180px; height: 270px; border-radius: 20px; } /* Cleaned up duplication and restored original tall size */
.landscape-card { width: 191px; height: 108px; border-radius: 12px; }
 /* Restored original featured/landscape size */

.mega-grid-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.mega-scroll-row {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    scroll-behavior: smooth;
    padding-bottom: 5px;
}

.mega-scroll-row::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.mega-flex-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-start;
    min-width: min-content; /* Ensures it doesn't shrink and allows scrolling */
}

.mega-featured {
    flex: 0 0 390px;
    flex-shrink: 0;
    height: 224px;
    display: flex;
    overflow: visible;
}

/* Removed .mega-scroll-container as it is merged into .mega-grid */

.mega-set {
    display: flex !important;
    gap: 8px;
    flex-shrink: 0;
}

/* Secondary and Tall grid tweaks for slider */
.mega-grid-secondary {
    display: grid;
    grid-template-columns: 191px 191px;
    grid-template-rows: 108px 108px;
    gap: 8px;
    width: 390px;
    height: 224px;
}

.mega-tall {
    width: 390px;
    height: 224px;
    display: flex;
}

/* Scroll buttons positioning for Mega Grid */
.mega-grid-wrapper .scroll-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100; /* Ensure it stays above cards on hover */
}

.mega-grid-wrapper:hover .scroll-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mega-grid-wrapper .scroll-btn.prev {
    left: 20px; /* Better spacing from left edge */
}

.mega-grid-wrapper .scroll-btn.next {
    right: 20px; /* Symmetrical spacing from right edge */
}

.mega-grid-secondary .landscape-card {
    width: 191px !important;
    height: 108px !important;
}

.mega-featured .game-card,
.mega-tall .game-card,
.mega-grid-secondary .game-card {
    width: 100% !important;
    height: 100% !important;
    min-width: 0;
}

.mega-featured .game-card img,
.mega-tall .game-card img,
.mega-grid-secondary .game-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.game-card {
    border-radius: 12px;
}

.game-card img {
    border-radius: 12px;
}

.badge-tag.top { 
    background-color: #f7d147; 
    color: #000;
    box-shadow: 0 4px 10px rgba(247, 209, 71, 0.4);
    border: none;
    font-weight: 900;
}

.badge-tag.hot { 
    background-color: #ff4b4b; 
    color: #fff;
    box-shadow: 0 4px 10px rgba(255, 75, 75, 0.4);
}

.badge-tag.trending { 
    background-color: #00d2ff; 
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 210, 255, 0.4);
}

.badge-tag.featured { 
    background-color: #a491ff; 
    color: #fff;
    box-shadow: 0 4px 10px rgba(164, 145, 255, 0.4);
}

/* ================= PROMO BLOCK ================= */
.promo-block {
    display: flex;
    background-color: var(--bg-promo);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.03);
}

.promo-content {
    flex: 1;
    padding: 36px 40px;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.promo-content h2 {
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: 800;
}

.promo-content p {
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.promo-content .learn-more {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 24px;
    display: inline-block;
}

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

.store-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #000;
    padding: 8px 16px;
    border-radius: 10px;
    color: white;
    transition: 0.2s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.store-btn:hover {
    background-color: #222;
    border-color: rgba(255,255,255,0.2);
}

.store-btn .btn-text {
    display: flex;
    flex-direction: column;
}

.store-btn .small-text {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
}

.store-btn .large-text {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.promo-categories {
    flex: 2;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    grid-auto-rows: 80px;
    gap: 10px;
    padding: 24px;
    background-color: rgba(0,0,0,0.2);
}

.promo-cat-card {
    background-color: var(--bg-promo-cat);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s ease;
    color: var(--text-muted);
}

.promo-cat-card:hover {
    background-color: #2f3246;
    color: white;
    transform: translateY(-2px);
}

.promo-cat-card svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.promo-cat-card span {
    font-size: 12px;
    font-weight: 700;
}

/* ================= FOOTER ================= */
.site-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 60px 0 80px;
}

.game-slider-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 0;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    pointer-events: none; /* Hidden buttons should not catch clicks */
    transition: opacity 0.3s ease, background-color 0.2s ease, transform 0.2s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.game-slider-wrapper:hover .scroll-btn {
    opacity: 1;
    pointer-events: auto; /* Active only when visible */
}

.scroll-btn.prev {
    left: 8px;
}

.scroll-btn.next {
    right: 8px;
}

.scroll-btn:hover {
    background-color: #5c43d6;
    border-color: #5c43d6;
    transform: translateY(-50%) scale(1.1);
}

.scroll-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.site-footer {
    display: flex;
    flex-direction: column; /* Stacked: Buttons then Copyright */
    align-items: center;
    justify-content: center;
    gap: 24px; /* Balanced gap between actions and copyright */
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* ================= TAGS SECTION ================= */
.tags-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tags-section .section-header {
    align-items: center;
    gap: 12px;
}

.tags-section .header-icon {
    color: #a491ff;
    display: flex;
    align-items: center;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tag-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: #1a1b26;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag-pill svg {
    color: #a491ff;
    opacity: 0.9;
}

.tag-pill:hover {
    background-color: rgba(164, 145, 255, 0.1);
    border-color: #5c43d6;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(92, 67, 214, 0.2);
}

.footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.footer-actions {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 12px;
    justify-content: center;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px; /* Extra push from buttons */
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 100px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 160px; /* Uniform width for better visual balance */
    justify-content: center;
}

.random-btn {
    background-color: rgba(255,255,255,0.08);
    color: white;
}
.random-btn:hover { background-color: rgba(255,255,255,0.15); transform: translateY(-2px); }

.back-top-btn {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 8px 24px rgba(92, 67, 214, 0.3);
}
.back-top-btn:hover { background-color: var(--primary-hover); transform: translateY(-2px); }

/* ================= RESPONSIVE ================= */
.search-toggle-btn {
    display: none;
}

.mobile-search-close {
    display: none;
}

@media (max-width: 1200px) {
    .top-picks-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto;
    }
    .promo-block {
        flex-direction: column;
    }
    .promo-categories {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        --sidebar-collapsed: 0px;
    }
    
    .search-toggle-btn {
        display: flex;
    }

    .search-container {
        display: none !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--bg-header);
        z-index: 1100;
        padding: 0 12px;
        align-items: center;
    }

    .search-container.active {
        display: flex !important;
    }

    .mobile-search-close {
        display: block;
        background: transparent;
        border: none;
        color: var(--text-muted);
        margin-right: 8px;
        flex-shrink: 0;
        cursor: pointer;
    }

    .search-bar {
        max-width: none;
        display: flex;
        align-items: center;
        flex: 1;
    }

    .search-bar input {
        border-radius: 12px;
    }

    .top-picks-grid {
        display: flex;
        flex-direction: column;
    }
    .promo-categories {
        grid-template-columns: repeat(3, 1fr);
    }
    .content-area {
        padding: 16px;
        margin-left: 0 !important;
    }

    /* Hide sidebar completely on mobile */
    .sidebar {
        display: none !important;
    }

    .sidebar-inner {
        display: none !important;
    }

    .sidebar-mobile-active {
        overflow: hidden;
    }

    .sidebar-mobile-active::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.7);
        backdrop-filter: blur(4px);
        z-index: 1500;
    }

    /* Game grid 2 columns */
    .game-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Change from 100% to 150px for sliders to show ~2.5 cards */
    .game-row .landscape-card {
        width: 150px !important;
        height: 92px !important;
    }

    /* Keep 100% for cards inside actual grids */
    .game-grid .landscape-card {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 10;
    }
}

/* ================= GAME VIEW ================= */
.game-view-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .game-view-container {
        grid-template-columns: 1fr;
    }
    .game-sidebar {
        display: none;
    }
}

.game-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Game Player Wrapper */
.game-player-wrapper {
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.player-preloader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
}

.player-preloader::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(15px);
}

.preloader-content {
    position: relative;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.preloader-thumb {
    width: 180px;
    height: 120px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.preloader-title {
    font-size: 24px;
    font-weight: 800;
    color: white;
}

.play-now-btn {
    background-color: #5c43d6;
    color: white;
    padding: 14px 48px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(92, 67, 214, 0.4);
}

.play-now-btn:hover {
    transform: scale(1.05);
    background-color: #6e56e0;
}

/* Game Control Bar */
.game-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--bg-card);
    border-radius: 12px;
}

.game-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-meta-icon {
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.game-meta-title {
    font-size: 16px;
    font-weight: 700;
}

.game-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.action-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.action-item.active {
    color: var(--primary);
}

.action-item svg {
    width: 18px;
    height: 18px;
}

/* Adsense Banner */
.adsense-banner {
    width: 100%;
    background-color: white;
    min-height: 90px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.adsense-sidebar {
    width: 100%;
    min-height: 480px;
    margin-bottom: 20px;
}

/* Game Info Section */
.game-info-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.info-section-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.description-text {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 12px;
}

.tags-container, .categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-chip {
    padding: 8px 16px;
    background-color: #2e2459;
    color: #a491ff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
}

.tag-chip:hover {
    background-color: #3e327a;
    transform: translateY(-2px);
}

.tag-chip.category {
    background-color: #292a3b;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Sidebar Grid */
.sidebar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sidebar-grid .game-card {
    width: 100%;
    aspect-ratio: 16 / 10;
}

/* ================= CATEGORY VIEW ================= */
.category-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.category-main {
    flex: 1;
    min-width: 0;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.category-header h1 {
    font-size: 24px;
    font-weight: 800;
    color: white;
}

.sort-dropdown {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.sort-dropdown:focus {
    outline: none;
    border-color: var(--primary);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-layout {
        flex-direction: column;
    }
    .sticky-sidebar-ad {
        display: none;
    }
}

.sticky-sidebar-ad {
    width: 300px;
    position: sticky;
    top: calc(var(--header-height) + 32px);
    flex-shrink: 0;
    z-index: 10;
}

.sticky-sidebar-ad .adsense-banner {
    min-height: 600px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* Category Specific Card Styles (Landscape as per image) */
.category-grid .game-card {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: var(--bg-card);
    display: block;
    overflow: hidden;
}

.category-grid .game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-grid .game-card:hover img {
    transform: scale(1.05);
}

/* ================= CONTACT PAGE ================= */
.contact-layout {
    display: flex;
    gap: 40px;
    align-items: center; /* Vertical centering */
    justify-content: center; /* Horizontal centering */
    min-height: calc(100vh - var(--header-height) - 64px);
    width: 100%;
    margin-top: -16px; /* Offset to feel perfectly centered */
}

.contact-main {
    flex: 0 1 700px; /* Take up to 700px */
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid rgba(255,255,255,0.03);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.contact-sidebar {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-header {
    margin-bottom: 32px;
}

.contact-header h1 {
    font-size: 32px;
    color: white;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.contact-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* ================= CONTACT PAGE ================= */
.contact-container {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 32px;
    align-items: flex-start;
}

.contact-card {
    background-color: var(--bg-card);
    border-radius: 28px;
    padding: 48px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.03);
}

.contact-card h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.contact-header-text {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 40px;
    max-width: 500px;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.contact-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-input-group label {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-left: 4px;
}

.contact-control {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 16px 20px;
    color: white;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.contact-control:focus {
    outline: none;
    border-color: #7d5fff;
    background-color: rgba(125, 95, 255, 0.05);
}

.contact-control::placeholder {
    color: rgba(255,255,255,0.3);
}

.contact-submit-btn {
    background: linear-gradient(135deg, #7d5fff, #5c43d6);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 20px rgba(92, 67, 214, 0.3);
    width: 100%;
    margin-top: 24px;
}

.contact-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(92, 67, 214, 0.5);
    background: linear-gradient(135deg, #8e73ff, #6d54e7);
}

/* Info Cards Sidebar */
.contact-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background-color: var(--bg-card);
    border-radius: 24px;
    padding: 24px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: 0.2s;
    border: 1px solid rgba(255,255,255,0.02);
}

.info-card:hover {
    border-color: rgba(255,255,255,0.08);
}

.info-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon.purple { background-color: #6366f1; }
.info-icon.orange { background-color: #f59e0b; }
.info-icon.blue { background-color: #3b82f6; }

.info-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.info-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-details h3 {
    font-size: 17px;
    font-weight: 800;
    color: white;
}

.info-details p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.social-links-row {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.contact-social-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: 0.2s;
}

.contact-social-btn:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 1024px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .contact-card {
        padding: 30px;
    }
    .contact-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Center contact layout and fit viewport in web view */
@media (min-width: 1025px) {
    body:has(.contact-layout) {
        overflow: hidden;
    }
    
    body:has(.contact-layout) .content-area {
        height: calc(100vh - var(--header-height));
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 40px;
        overflow-y: auto;
    }

    .contact-layout {
        max-width: 1200px;
        width: 100%;
        transform: scale(0.88); /* Adjusted for better headroom */
        transform-origin: center;
        margin-top: -10px; /* Slight offset for better visual centering */
    }
}

.contact-info-card {
    background-color: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.03);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: 0.2s ease;
}

.contact-info-card:hover {
    background-color: rgba(255,255,255,0.04);
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(92, 67, 214, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.card-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(92, 67, 214, 0.1);
    color: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-content h3 {
    font-size: 16px;
    color: white;
    margin-bottom: 4px;
}

.card-content p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Gradients for icons and buttons */
.gradient-purple { background: linear-gradient(135deg, #5c43d6, #8062ff) !important; color: white !important; }
.gradient-orange { background: linear-gradient(135deg, #ff8c42, #ffb347) !important; color: white !important; }
.gradient-blue { background: linear-gradient(135deg, #42a5f5, #478eff) !important; color: white !important; }

/* Social Links Grid */
.social-links-grid {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.social-link-item {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.social-link-item svg {
    width: 18px;
    height: 18px;
}

.social-link-item:hover {
    transform: translateY(-4px);
    color: white;
}

.social-link-item.fb:hover { background-color: #3b5998; border-color: #3b5998; box-shadow: 0 5px 15px rgba(59, 89, 152, 0.4); }
.social-link-item.ig:hover { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); border-color: transparent; box-shadow: 0 5px 15px rgba(188, 24, 136, 0.4); }
.social-link-item.tw:hover { background-color: #1da1f2; border-color: #1da1f2; box-shadow: 0 5px 15px rgba(29, 161, 242, 0.4); }

@media (max-width: 1000px) {
    .contact-layout {
        flex-direction: column;
    }
    .contact-main {
        width: 100%;
    }
    .contact-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .contact-form {
        grid-template-columns: 1fr;
    }
    .form-group.full-width, .submit-btn {
        grid-column: 1 / 2;
    }
}

/* ================= INFINITE SCROLL ================= */
.pagination-wrapper {
    display: none !important; /* Fully invisible to user, accessed via JS */
}

.infinite-scroll-loader {
    display: none; /* Shown via JS when loading */
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    width: 100%;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(164, 145, 255, 0.1);
    border-radius: 50%;
    border-top-color: #a491ff;
    animation: spin 0.8s linear infinite;
}

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

/* ================= GAME PLAY PAGE ================= */
.game-play-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    max-width: 100%; /* Fill the content area */
    margin: 0;
    padding-bottom: 40px;
}

.game-main-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.game-player-wrapper {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.game-player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.fullscreen-overlay-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 16, 21, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    font-size: 13px;
    font-weight: 700;
}

.fullscreen-overlay-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Splash Screen */
.game-splash {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.splash-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.4);
    transform: scale(1.1);
}

.splash-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
}

.splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    animation: fadeInScale 0.5s ease;
}

.splash-thumb {
    width: 191px;
    height: 108px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 3px solid rgba(255,255,255,0.1);
}

.splash-title {
    color: white;
    font-size: 24px;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.play-now-btn {
    background: linear-gradient(135deg, #7d5fff, #5c43d6);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 18px;
    font-weight: 800;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(92, 67, 214, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.play-now-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(92, 67, 214, 0.6);
    background: linear-gradient(135deg, #8e73ff, #6d54e7);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Ad Containers (Dynamic Adsense Support) */
.ad-container {
    background: rgba(255, 255, 255, 0.02); /* Very subtle background for load state */
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 100%;
}

@media (max-width: 768px) {
    .ad-container {
        display: none !important;
    }
}

.home-center-ad {
    margin: 40px auto;
    max-width: 1200px;
    min-height: 120px;
}

.horizontal-ad {
    margin: 20px 0;
    min-height: 90px;
}

.vertical-ad {
    width: 100% !important; /* Spans the the sidebar width */
    height: 600px;
    margin: 0 auto 24px;
}

.ad-label {
    font-size: 14px;
}

/* Game Info container */
.game-info-container {
    padding: 0 4px;
}

.game-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.game-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
    color: white;
}

.game-category-info {
    font-size: 14px;
    color: var(--text-muted);
}

.cat-link {
    color: var(--primary);
    font-weight: 700;
    margin-left: 4px;
}

.game-stats-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-item.views {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
}

.action-group {
    background: rgba(26, 27, 38, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.action-btn {
    background: transparent;
    border: none;
    height: 40px;
    min-width: 44px;
    padding: 0 10px;
    border-radius: 8px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.action-btn.favorite-btn.active {
    color: #ff4757;
}

.action-btn.favorite-btn.active svg {
    fill: #ff4757;
    filter: drop-shadow(0 0 8px rgba(255, 71, 87, 0.4));
}

.action-btn.like-btn.active {
    color: #47ff72;
}

.action-btn.dislike-btn.active {
    color: #ff4747;
}

.action-btn.like-btn.active,
.action-btn.dislike-btn.active {
    pointer-events: none;
}

.action-btn .count {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.divider-v {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

/* About Box */
.game-about-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-top: 10px;
}

.about-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
    color: white;
}

.about-content {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 15px;
}

/* Tags Display in Game View */
.game-tags-wrapper {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tags-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    opacity: 0.9;
}

.tags-header svg {
    color: #a491ff;
    opacity: 1;
}

.game-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-pill {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tag-pill:hover {
    background-color: rgba(164, 145, 255, 0.1);
    border-color: rgba(164, 145, 255, 0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Home Section Tags (Old logic preserved for global support if needed elsewhere) */
.tags-section {
    display: none; /* Hide global tags per user request */
}

/* Sidebar Related Grid */
.game-sidebar-content {
    display: flex;
    flex-direction: column;
}

.sidebar-related-grid {
    display: grid;
    grid-template-columns: 191px 191px;
    gap: 12px;
    justify-content: center;
}

.sidebar-related-grid .game-card {
    width: 100% !important;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .game-play-container {
        grid-template-columns: 1fr;
    }
    
    .game-sidebar-content {
        margin-top: 40px;
    }
}

/* ================= DYNAMIC PAGE STYLES (v4) ================= */
.page-container {
    max-width: 1200px;
    margin: 15px auto 40px; 
    padding: 0 40px;
    position: relative;
}

.page-layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px; 
    gap: 40px;
    align-items: start;
}

/* Reading Progress Bar */
.reading-progress-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1001;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    background: linear-gradient(to right, #7d5fff, #a491ff);
    width: 0%;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(125, 95, 255, 0.5);
}

.page-card {
    background-color: rgba(32, 34, 47, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 60px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: visible;
}

.page-card.glassmorphism {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.page-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px; 
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.page-breadcrumbs a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.page-breadcrumbs a:hover {
    color: #a491ff;
}

.page-header-section {
    margin-bottom: 32px; /* Further reduced from 40px */
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 20px;
}

.page-title {
    font-size: 48px;
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item svg {
    color: #a491ff;
}

.page-content {
    color: #cbd5e1;
    font-size: 10pt; /* Updated from 11pt */
    line-height: 1.8;
}

/* Maximum Vertical Density per User Request */
.page-content p {
    margin-bottom: 4px; /* Significantly reduced from 8px */
}

.page-content h1, .page-content h2, .page-content h3 {
    color: white;
    margin: 24px 0 8px; /* Further reduced vertical margins */
    font-weight: 800;
    scroll-margin-top: 100px;
}

.page-content h2 { font-size: 26px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px; }
.page-content h3 { font-size: 22px; }

/* Sidebar UX Improvements (Iteration 4) */
.page-sidebar-ux {
    position: sticky;
    top: calc(var(--header-height) + 15px); 
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ux-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.ux-card-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* TOC Card */
.toc-container {
    display: none; /* Shown via JS */
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-link {
    font-size: 13.5px;
    color: var(--text-muted);
    transition: all 0.2s;
    line-height: 1.4;
    display: block;
    text-decoration: none;
}

.toc-link:hover, .toc-link.active {
    color: #a491ff;
    padding-left: 4px;
}

/* Taller Support Card per User Request */
.support-card {
    background: linear-gradient(135deg, rgba(125, 95, 255, 0.15), rgba(92, 67, 214, 0.15));
    text-align: center;
    padding: 60px 30px; 
    min-height: 400px; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-color: rgba(164, 145, 255, 0.2);
}

.support-icon-wrapper {
    width: 64px; 
    height: 64px;
    background: linear-gradient(135deg, #7d5fff, #5c43d6);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 10px 30px rgba(92, 67, 214, 0.4);
}

.support-icon-wrapper svg {
    width: 32px;
    height: 32px;
}

.support-card p {
    font-size: 15px;
    color: #cbd5e1;
    margin-bottom: 40px;
    line-height: 1.6;
}

.ux-action-btn {
    display: block;
    width: 100%;
    background: white;
    color: #0f1015;
    padding: 16px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ux-action-btn:hover {
    transform: translateY(-3px) scale(1.02);
    background: #f8f9ff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1100px) {
    .page-layout-grid {
        grid-template-columns: 1fr;
    }
    .page-sidebar-ux {
        position: static;
    }
    .support-card {
        min-height: auto;
        padding: 40px;
    }
}

@media (max-width: 768px) {
    .page-card {
        padding: 40px 24px;
    }
    .page-title {
        font-size: 32px;
    }
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(24, 25, 34, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px 20px;
    color: white;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    min-width: 280px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-success .toast-icon { 
    background: rgba(71, 255, 114, 0.2); 
    color: #47ff72; 
}

.toast-error .toast-icon { 
    background: rgba(255, 71, 71, 0.2); 
    color: #ff4747; 
}

.toast-message {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.2px;
}

/* ================= MOBILE NAV OVERLAY ================= */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 11, 16, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.mobile-nav-overlay.active {
    transform: translateY(0);
    visibility: visible;
}

.mobile-nav-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 40px;
}

.mobile-nav-section {
    margin-bottom: 32px;
}

.mobile-nav-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-left: 4px;
}

.mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.mobile-nav-item:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.97);
}

.mobile-nav-item .icon {
    width: 20px;
    height: 20px;
    color: #a491ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-item.active {
    background: linear-gradient(135deg, rgba(92, 67, 214, 0.2), rgba(164, 145, 255, 0.1));
    border-color: rgba(164, 145, 255, 0.3);
}

.mobile-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mobile-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.mobile-cat-item .icon {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}

.mobile-nav-footer {
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mobile-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.mobile-footer-links a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.mobile-socials {
    display: flex;
    gap: 16px;
}

.mobile-socials a {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* ================= INFINITE SCROLL ================= */
.infinite-scroll-loader {
    display: flex; /* Must be visible to be observed, we control spinner visibility instead */
    justify-content: center;
    align-items: center;
    padding: 20px 0 60px; /* Give it some space to be tracked */
    width: 100%;
    min-height: 100px;
}

.infinite-scroll-loader .spinner {
    visibility: hidden; /* Hide spinner by default, show via JS */
}

.infinite-scroll-loader.loading .spinner {
    visibility: visible;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(164, 145, 255, 0.1);
    border-radius: 50%;
    border-top-color: #a491ff;
    animation: spin 0.8s linear infinite;
}

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

.game-card.new-item-fade {
    animation: fadeInSlideUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide pagination for infinite scroll users */
body.has-infinite-scroll .pagination-wrapper {
    display: none !important;
}
