/* ======== GLOBAL STYLES (Theme Agnostic) ======== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* Add these to your existing index.css */
.game-grid, /* For the favorites grid */
.btn-container /* For the horizontal category containers */
{
    /* Ensure they are display contexts that arrange children */
    display: flex; /* Use flexbox for horizontal scrolling */
    overflow-x: auto; /* Enable horizontal scrolling */
    gap: 15px; /* Space between game cards */
    padding: 10px 0; /* Add some padding if needed */
    /* Prevent wrapping for horizontal scroll */
    flex-wrap: nowrap;
    /* Hide scrollbar if desired */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
}

/* Hide scrollbar for Chrome, Edge, Safari */
.btn-container::-webkit-scrollbar,
.game-grid::-webkit-scrollbar {
    display: none;
}


.game-card {
    /* Styles for the individual game card */
    flex: 0 0 auto; /* Prevent shrinking, don't grow, base size handled by width */
    width: 150px; /* Or whatever width you want each card to be */
    min-width: 150px; /* Ensure they don't get smaller than this */
    max-width: 150px; /* Optional: Cap the max width */
    /* Add other styles like border, padding, background, shadow, etc. */
    background-color: #2c2c2c; /* Example background */
    border-radius: 8px;
    overflow: hidden; /* Hide anything outside the border radius */
    display: flex;
    flex-direction: column;
    cursor: pointer; /* Indicate it's clickable (for the whole card if desired, or just the play button) */
    transition: transform 0.2s ease-in-out; /* Hover effect */
}

/* Add hover effect */
.game-card:hover {
    transform: translateY(-5px);
}

.game-card img.imgg {
    width: 100%; /* Image fills the card width */
    height: 100px; /* Fixed height for images, adjust as needed */
    object-fit: cover; /* Cover the area without distorting aspect ratio */
    border-bottom: 1px solid #444; /* Separator */
}

.game-card .game-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Info area grows to fill space */
}

.game-card h4 {
    margin: 0 0 5px 0;
    font-size: 0.9em; /* Adjust font size */
    color: #eee; /* Text color */
    white-space: nowrap; /* Prevent name from wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if name is too long */
}

.game-card .game-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Push actions to the bottom */
}

.game-card .play-button {
    background-color: #4CAF50; /* Green */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background-color 0.2s ease;
}

.game-card .play-button:hover {
    background-color: #45a049;
}

.game-card .favorite-button {
    background: none;
    border: none;
    color: #888; /* Default heart color */
    cursor: pointer;
    font-size: 1.2em; /* Adjust heart size */
    transition: color 0.2s ease;
}

.game-card .favorite-button .heart-icon.favorited {
    color: #e57373; /* Red color when favorited */
}

.game-card .favorite-button:hover .heart-icon:not(.favorited) {
     color: #b3b3b3; /* Lighter grey on hover for non-favorited */
}


/* Adjust .game-grid specifically to allow wrapping, if needed */
.game-grid {
    flex-wrap: wrap; /* Allow wrapping in the grid */
    justify-content: center; /* Center items in the grid */
}

/* Make sure the scroll arrows are positioned correctly */
.game-category {
    position: relative; /* Needed for absolute positioning of arrows */
}

.game-category .scroll-arrows {
    position: absolute;
    top: 50%; /* Center vertically */
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none; /* Allow clicks to pass through */
    z-index: 1; /* Ensure arrows are above cards */
}

.game-category .scroll-arrow {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    padding: 10px;
    cursor: pointer;
    z-index: 2; /* Ensure buttons are clickable */
    pointer-events: auto; /* Re-enable pointer events for the button itself */
    font-size: 1.5em;
    border-radius: 50%; /* Make them round */
    width: 40px;
    height: 40px;
    display: flex; /* Center icon */
    justify-content: center;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.game-category .scroll-arrow:hover {
    opacity: 1;
}

.game-category .left-arrow {
    left: 10px; /* Position from left */
}

.game-category .right-arrow {
    right: 10px; /* Position from right */
}
/* Settings Menu Enhancements */
.settings-divider {
    border: none;
    border-top: 1px solid var(--settings-menu-item-border); /* Use theme variable */
    margin: 15px 0;
}

.setting-group h5 {
    font-size: 1em;
    margin-bottom: 10px;
    color: var(--settings-menu-text); /* Use theme variable */
    padding-bottom: 5px;
    border-bottom: 1px dashed var(--settings-menu-item-border);
}

.setting-item input[type="text"],
.setting-item input[type="url"] {
    padding: 6px 8px;
    border: 1px solid var(--input-border); /* Use theme variable */
    border-radius: 4px;
    background-color: var(--input-background); /* Use theme variable */
    color: var(--input-text); /* Use theme variable */
    width: 120px; /* Adjust as needed */
    font-size: 0.9em;
}
.setting-item input[type="text"]:focus,
.setting-item input[type="url"]:focus {
    outline: none;
    border-color: var(--input-focus-border); /* Use theme variable */
    box-shadow: 0 0 3px var(--input-focus-border);
}
/* Style for readonly panic key input when active */
#panicKeyInput.key-capture-active {
    border-color: var(--header-accent-color); /* Use theme variable */
    box-shadow: 0 0 5px var(--header-accent-color);
    cursor: grab; /* Indicate key capture mode */
}


.stealth-button { /* For about:blank button, maybe different color */
    background-color: #3498db; /* Example: Blue */
}
.stealth-button:hover {
    background-color: #2980b9;
}

body.dark-mode .stealth-button {
    background-color: #2980b9;
}
body.dark-mode .stealth-button:hover {
    background-color: #1f6391;
}


.panic-status-message {
    display: block;
    font-size: 0.8em;
    margin-top: 8px;
    color: var(--card-meta-text-color); /* Use theme variable */
    min-height: 1.2em; /* Prevent layout shift */
}

/* If using settings-open on body to blur content: */
body.settings-open main,
body.settings-open .hero,
body.settings-open .games,
body.settings-open .updates, /* Add other main content sections */
body.settings-open .coming-soon-container {
 filter: blur(3px);
 pointer-events: none;
}
body {
  font-family: 'Arial', sans-serif; /* Or your preferred sans-serif from original */
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scroll */
  /* overflow-y: auto; /* Handled by scrollbar styles section */
  position: relative; /* Needed for z-index stacking with particles */
  z-index: 0;
  /* Custom cursor related */
  /* cursor: none !important; /* Applied by JS if custom cursor enabled */
}

/* Animations (Can be global) */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes controlsEntrance {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes categoriesEntrance {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes categoryHeaderEntrance {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes arrowPulse {
  0% { transform: scale(1) translateZ(0); }
  50% { transform: scale(1.15) translateZ(0); }
  100% { transform: scale(1) translateZ(0); }
}
@keyframes noResultsEntrance {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ======== LIGHT THEME STYLES (Defaults) ======== */
:root {
    --text-color: #333;
    --background-color: #f4f4f4;
    --header-background: #ffffff;
    --header-text-color: #333;
    --header-accent-color: #2a9d8f; /* Teal accent for light mode */
    --nav-link-color: #333;
    --nav-link-hover-color: var(--header-accent-color);
    --hero-background-overlay: rgba(255, 255, 255, 0.7);
    --hero-text-color: #333;
    --section-title-color: var(--header-accent-color);
    --section-border-color: #e0e0e0;
    --card-background: #ffffff;
    --card-border-color: #ddd;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --card-hover-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    --card-text-color: #333;
    --card-meta-text-color: #666;
    --button-primary-bg: var(--header-accent-color);
    --button-primary-text: #fff;
    --button-primary-hover-bg: #258a7e;
    --icon-button-bg: rgba(0, 0, 0, 0.05);
    --icon-button-hover-bg: rgba(0, 0, 0, 0.1);
    --icon-color: #555;
    --icon-hover-color: var(--header-accent-color);
    --favorited-icon-color: #e74c3c; /* Red for favorited */
    --footer-background: #f8f8f8;
    --footer-text-color: #777;
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --controls-bar-bg: #333; /* Dark bar for light mode game window */
    --controls-bar-text: #fff;
    --input-background: #fff;
    --input-border: #ccc;
    --input-text: #333;
    --input-placeholder: #999;
    --input-focus-border: var(--header-accent-color);
    --scrollbar-track-bg: #f1f1f1;
    --scrollbar-thumb-bg: #c1c1c1;
    --scrollbar-thumb-hover-bg: #a8a8a8;
    --settings-menu-bg: #fff;
    --settings-menu-border: #ddd;
    --settings-menu-text: #333;
    --settings-menu-header-border: #eee;
    --settings-menu-item-border: #f0f0f0;
    --settings-action-button-bg: #e74c3c;
    --settings-action-button-text: #fff;
    --settings-action-button-hover-bg: #c0392b;
    --toggle-slider-off-bg: #ccc;
    --toggle-slider-knob-bg: white;
    --particles-bg: #e9e9e9;
    --hub-controls-bg: rgba(255, 255, 255, 0.8);
    --hub-search-bg: rgba(0, 0, 0, 0.05);
    --hub-search-focus-bg: rgba(0, 0, 0, 0.08);
    --hub-search-focus-shadow: 0 0 8px rgba(42, 157, 143, 0.3);
    --hub-category-header-border: rgba(0,0,0,0.1);
    --hub-category-header-text-gradient-from: #555;
    --hub-category-header-text-gradient-to: #333;
    --hub-scroll-arrow-bg: rgba(0,0,0,0.05);
    --hub-scroll-arrow-border: rgba(0,0,0,0.1);
    --hub-scroll-arrow-color: #666;
    --hub-scroll-arrow-hover-bg: rgba(0,0,0,0.1);
    --hub-scroll-arrow-hover-color: var(--header-accent-color);
    --hub-btn-bg-gradient-from: rgba(250, 250, 250, 0.8);
    --hub-btn-bg-gradient-to: rgba(240, 240, 240, 0.9);
    --hub-btn-border: rgba(0,0,0,0.1);
    --hub-btn-text-color: #444;
    --hub-btn-hover-bg-gradient-from: rgba(255, 255, 255, 0.9);
    --hub-btn-hover-bg-gradient-to: rgba(245, 245, 245, 1);
    --hub-btn-hover-border: rgba(0,0,0,0.15);
    --hub-btn-img-border: rgba(0,0,0,0.1);
    --hub-btn-img-fallback-bg: #e0e0e0;
    --hub-btn-info-bar-bg: rgba(0, 0, 0, 0.6); /* Dark bar for contrast */
    --hub-btn-info-bar-text: #fff;
    --hub-btn-heart-icon-color: rgba(0,0,0,0.4);
    --hub-btn-heart-icon-bg: rgba(255,255,255,0.5);
    --hub-btn-heart-icon-hover-color: rgba(0,0,0,0.6);
    --hub-btn-heart-icon-hover-bg: rgba(255,255,255,0.7);
    --hub-btn-heart-icon-hearted-color: var(--favorited-icon-color);
    --hub-favorites-section-bg: rgba(0,0,0,0.02);
    --hub-no-results-text-color: #888;
    --side-settings-bg: rgba(250, 250, 250, 0.98);
    --side-settings-border: rgba(0,0,0,0.1);
    --side-settings-shadow: -3px 0 12px rgba(0,0,0,0.1);
    --side-settings-button-bg: #f0f0f0;
    --side-settings-button-text: #333;
    --side-settings-button-border: #ccc;
    --side-settings-button-hover-bg: #e0e0e0;
    --side-settings-button-hover-border: #bbb;
    --side-settings-select-arrow-fill: '%23333333'; /* Dark arrow for select */
    --side-settings-select-option-bg: #fff;
    --side-settings-select-option-text: #333;
    --custom-cursor-border: rgba(0,0,0,0.6);
    --custom-cursor-hover-border: var(--header-accent-color);
    --unfocused-overlay-fallback-bg: #f8f8f8;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
}

/* --- Scrollbar Styles --- */
body {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-bg) var(--scrollbar-track-bg);
  overflow-y: auto;
}
body::-webkit-scrollbar {
  width: 10px;
}
body::-webkit-scrollbar-track {
  background: var(--scrollbar-track-bg);
  border-radius: 5px;
}
body::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb-bg);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
body::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover-bg);
}


/* --- Header & Navigation --- */
header {
    background-color: var(--header-background);
    padding: 10px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    /* position: fixed; width: 100%; top: 0; z-index: 100; */ /* If using fixed header */
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px; /* Or your preferred max-width */
    margin: 0 auto;
}
nav h1 {
    margin: 0;
    font-size: 1.8em;
    color: var(--header-accent-color);
}
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}
nav li {
    margin-left: 20px;
}
nav a {
    color: var(--nav-link-color);
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease, transform 0.2s ease;
}
nav a:hover {
    color: var(--nav-link-hover-color);
    transform: translateY(-2px);
}

/* Settings Button in Header */
.settings-button {
    background: none;
    border: none;
    color: var(--nav-link-color);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 10px;
    margin-left: 15px;
    transition: color 0.3s ease;
}
.settings-button:hover {
    color: var(--nav-link-hover-color);
}

/* --- Hero Section --- */
.hero {
    /* Assuming background image is set globally or via JS if it changes with theme */
    /* background: linear-gradient(var(--hero-background-overlay), var(--hero-background-overlay)), url('Imgs/hero-bg.jpg') no-repeat center center/cover; */
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)); /* Example light overlay */
    padding: 60px 20px;
    text-align: center;
    color: var(--hero-text-color);
    animation: fadeIn 1s ease-out forwards;
}
.hero.fade-in { opacity: 0; animation: fadeIn 1s ease-out 0.2s forwards; } /* Ensure fade-in works */

.hero h2 {
    margin-top: 0;
    font-size: 2.5em;
    margin-bottom: 10px;
    /* text-shadow: 1px 1px 2px rgba(0,0,0,0.1); */ /* Lighter shadow for light mode */
}
.hero p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* --- Games Section & Cards (game realm style) --- */
.games {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}
.games h3 {
    font-size: 1.8em;
    color: var(--section-title-color);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--section-border-color);
    padding-bottom: 10px;
}
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
.game-card { /* This is the game realm style .game-card */
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--card-background);
    text-align: center;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, background-color 0.2s ease;
    position: relative;
    padding-bottom: 10px; /* For spacing if content varies */
    box-shadow: var(--card-shadow);
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn 0.5s ease-out forwards;
}
.game-card:hover {
   transform: translateY(-5px);
   box-shadow: var(--card-hover-shadow);
   background-color: var(--card-background); /* Keep or slightly change on hover */
}
.game-card .imgg { /* Assuming this is an <img> tag */
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid var(--card-border-color);
}
.game-card h4 {
    margin: 10px 5px;
    color: var(--card-text-color);
    font-size: 1.1em;
    flex-grow: 1;
    word-break: break-word;
}
.game-card .game-info { /* Placeholder if used */
    display: flex;
    flex-direction: column;
    padding: 0 10px;
    flex-grow: 1;
}
.game-card .game-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 5px 0;
    margin-top: auto;
}
.game-card .play-button { /* Specific class from user CSS */
   background-color: var(--button-primary-bg);
   color: var(--button-primary-text);
   border: none;
   border-radius: 5px;
   padding: 8px 15px;
   cursor: pointer;
   font-size: 1em;
   transition: background-color 0.3s ease;
   flex-grow: 1;
   margin-right: 5px;
}
.game-card .play-button:hover {
    background-color: var(--button-primary-hover-bg);
}
.game-card .favorite-button { /* Specific class from user CSS for heart on card top */
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--icon-button-bg);
    color: var(--icon-color); /* Initial color for the icon via .heart-icon */
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em; /* For the <i> tag inside */
    transition: color 0.3s ease, background-color 0.3s ease;
    z-index: 5;
}
.game-card .favorite-button:hover {
     background-color: var(--icon-button-hover-bg);
}
.game-card .favorite-button .heart-icon { /* The <i> tag */
     color: var(--icon-color);
     transition: color 0.3s ease;
}
.game-card .favorite-button:hover .heart-icon {
    color: var(--icon-hover-color);
}
.game-card .favorite-button .heart-icon.favorited {
     color: var(--favorited-icon-color) !important; /* Ensure override */
}
#noFavoritesMessage {
    color: var(--card-meta-text-color);
    text-align: center;
    width: 100%;
    grid-column: 1 / -1;
    font-size: 1.2em;
    margin-top: 10px;
}

/* Specific style for the Favorites section grid */
#favoriteGamesGrid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    margin-bottom: 40px;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 20px;
  background-color: var(--footer-background);
  color: var(--footer-text-color);
  font-size: 0.9em;
  border-top: 1px solid var(--section-border-color);
}


/* ======== DARK THEME STYLES (`body.dark-mode`) ======== */

body.dark-mode {
    --text-color: #e0e0e0;
    --background-color: #121212;
    --header-background: #1e1e1e;
    --header-text-color: #e0e0e0;
    --header-accent-color: #4CAF50; /* Green accent for dark mode */
    --nav-link-color: #e0e0e0;
    --nav-link-hover-color: var(--header-accent-color);
    --hero-background-overlay: rgba(0, 0, 0, 0.7);
    --hero-text-color: #f5f5f5;
    --section-title-color: var(--header-accent-color);
    --section-border-color: #333;
    --card-background: #2a2a2a; /* Was #1a1a1a, then #2a2a2a */
    --card-border-color: #444;
    --card-shadow: 0 2px 5px rgba(0,0,0,0.3);
    --card-hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    --card-text-color: #f0f0f0;
    --card-meta-text-color: #a0a0a0;
    --button-primary-bg: var(--header-accent-color);
    --button-primary-text: #fff;
    --button-primary-hover-bg: #5cb85c; /* Was #45a049 */
    --icon-button-bg: rgba(0, 0, 0, 0.5);
    --icon-button-hover-bg: rgba(0, 0, 0, 0.7);
    --icon-color: #bbb; /* Unfavorited heart in dark mode */
    --icon-hover-color: #fff;
    /* --favorited-icon-color is same red */
    --footer-background: #1e1e1e;
    --footer-text-color: #a0a0a0;
    --overlay-bg: rgba(0, 0, 0, 0.95);
    --controls-bar-bg: #222; /* Dark bar for dark mode game window */
    --controls-bar-text: #e0e0e0;
    --input-background: rgba(255, 255, 255, 0.1); /* From hub search */
    --input-border: transparent;
    --input-text: #fff;
    --input-placeholder: #aaa;
    --input-focus-border: var(--header-accent-color); /* Or specific focus color */
    --scrollbar-track-bg: rgba(255, 255, 255, 0.05);
    --scrollbar-thumb-bg: rgba(255, 255, 255, 0.2);
    --scrollbar-thumb-hover-bg: rgba(255, 255, 255, 0.3);
    --settings-menu-bg: #2a2a2a;
    --settings-menu-border: #444;
    --settings-menu-text: #e0e0e0;
    --settings-menu-header-border: #444;
    --settings-menu-item-border: #444;
    /* --settings-action-button colors are same */
    --toggle-slider-off-bg: #555;
    --toggle-slider-knob-bg: #f1f1f1;
    --particles-bg: #2a2a2a; /* From #particles-js default */
    --hub-controls-bg: rgba(30, 30, 30, 0.5);
    --hub-search-bg: rgba(255, 255, 255, 0.1);
    --hub-search-focus-bg: rgba(255, 255, 255, 0.2);
    --hub-search-focus-shadow: 0 0 10px rgba(76, 175, 80, 0.3); /* Green shadow */
    --hub-category-header-border: rgba(255,255,255,0.1);
    --hub-category-header-text-gradient-from: #ffffff;
    --hub-category-header-text-gradient-to: #cccccc;
    --hub-scroll-arrow-bg: rgba(255,255,255,0.1);
    --hub-scroll-arrow-border: rgba(255,255,255,0.2);
    --hub-scroll-arrow-color: #ccc;
    --hub-scroll-arrow-hover-bg: rgba(255,255,255,0.2);
    --hub-scroll-arrow-hover-color: #fff;
    --hub-btn-bg-gradient-from: rgba(45, 45, 45, 0.65);
    --hub-btn-bg-gradient-to: rgba(60, 60, 60, 0.75);
    --hub-btn-border: rgba(255,255,255,0.15);
    --hub-btn-text-color: #ddd;
    --hub-btn-hover-bg-gradient-from: rgba(55, 55, 55, 0.75);
    --hub-btn-hover-bg-gradient-to: rgba(70, 70, 70, 0.85);
    --hub-btn-hover-border: rgba(255,255,255,0.25);
    --hub-btn-img-border: rgba(255,255,255,0.1);
    --hub-btn-img-fallback-bg: #222;
    --hub-btn-info-bar-bg: rgba(0, 0, 0, 0.7);
    --hub-btn-info-bar-text: #ddd;
    --hub-btn-heart-icon-color: rgba(255,255,255,0.5);
    --hub-btn-heart-icon-bg: rgba(0,0,0,0.4);
    --hub-btn-heart-icon-hover-color: rgba(255,255,255,0.8);
    --hub-btn-heart-icon-hover-bg: rgba(0,0,0,0.6);
    --hub-btn-heart-icon-hearted-color: #ff6b6b; /* Brighter red for dark */
    --hub-favorites-section-bg: rgba(255,255,255,0.03);
    --hub-no-results-text-color: #ccc;
    --side-settings-bg: rgba(18, 18, 18, 0.97); /* Darker than game card */
    --side-settings-border: rgba(255,255,255,0.1);
    --side-settings-shadow: -5px 0 15px rgba(0,0,0,0.5);
    --side-settings-button-bg: #333;
    --side-settings-button-text: #eee;
    --side-settings-button-border: #555;
    --side-settings-button-hover-bg: #444;
    --side-settings-button-hover-border: #777;
    --side-settings-select-arrow-fill: '%23eeeeee'; /* Light arrow for select */
    --side-settings-select-option-bg: #2a2a2a;
    --side-settings-select-option-text: #eee;
    --custom-cursor-border: rgba(255,255,255,0.7);
    --custom-cursor-hover-border: var(--header-accent-color); /* Green for dark mode */
    --unfocused-overlay-fallback-bg: #121212;
}


/* ======== POPUP SETTINGS MENU (Original from previous + theme vars) ======== */
.settings-menu {
    position: fixed;
    top: 60px; /* Adjust based on your header height */
    right: 20px;
    background-color: var(--settings-menu-bg);
    border: 1px solid var(--settings-menu-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px;
    z-index: 1001;
    width: 280px;
    color: var(--settings-menu-text);
}
.settings-menu h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: var(--settings-menu-text);
    border-bottom: 1px solid var(--settings-menu-header-border);
    padding-bottom: 10px;
}
.close-settings-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8em;
    color: #aaa; /* Keep consistent or use a variable */
    cursor: pointer;
}
.close-settings-btn:hover {
    color: var(--settings-menu-text); /* Or a brighter accent */
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--settings-menu-item-border);
}
.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.setting-item label {
    font-size: 0.95em;
    color: var(--settings-menu-text); /* Adjust if needed, might be too bright */
}
.settings-action-button {
    background-color: var(--settings-action-button-bg);
    color: var(--settings-action-button-text);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}
.settings-action-button:hover {
    background-color: var(--settings-action-button-hover-bg);
}

/* Toggle Switch for Dark Mode (using theme vars) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--toggle-slider-off-bg);
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--toggle-slider-knob-bg);
  transition: .4s;
}
input:checked + .slider {
  background-color: var(--header-accent-color); /* Use main accent for "on" */
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--header-accent-color);
}
input:checked + .slider:before {
  transform: translateX(26px);
}
.slider.round {
  border-radius: 24px;
}
.slider.round:before {
  border-radius: 50%;
}


/* ======== GAME WINDOW OVERLAY ======== */
.game-window-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    z-index: 1000; /* Original: 1000 */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}
.game-window-overlay.active {
    opacity: 1;
    visibility: visible;
    display: flex;
}
.game-iframe-container {
    width: 100%;
    max-width: 1200px;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000; /* Always black for iframe contrast */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}
.game-window-overlay iframe {
    display: block;
    border: none;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.game-window-controls {
    margin-top: auto;
    width: 100%;
    max-width: 1200px;
    height: 60px;
    background-color: var(--controls-bar-bg);
    color: var(--controls-bar-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    flex-shrink: 0;
}
.game-window-controls span#gameTitle { /* Be specific for the title */
    flex-grow: 1;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 15px;
    color: var(--controls-bar-text);
}
.game-window-controls div { /* Button container */
    display: flex;
    align-items: center;
}
.game-window-controls button {
    background-color: transparent;
    border: none;
    color: var(--controls-bar-text);
    font-size: 1.5em;
    cursor: pointer;
    margin-left: 15px;
    transition: color 0.2s ease-in-out;
    display: flex;
    align-items: center;
    padding: 8px;
}
.game-window-controls button:hover {
    color: var(--header-accent-color); /* Use theme accent for hover */
}
body.game-active {
  overflow: hidden;
}


/* ======== "HUB" SPECIFIC STYLES (Particles, Main Content, Controls, Categories, Buttons) ======== */

/* Particles div */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: var(--particles-bg);
    pointer-events: none;
}

/* Main Content Area */
main.hub-container {
  padding-top: 80px; /* Adjust if header is fixed, e.g. 100px */
  padding-bottom: 20px;
  padding-left: 40px;
  padding-right: 40px;
  width: 100%;
  max-width: 1600px; /* var(--content-max-width) */
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
  box-sizing: border-box;
}
body.settings-open main.hub-container,
body.side-settings-open main.hub-container { /* Add for new side settings too */
 /* transform: translateX(-20px); */
 filter: blur(3px);
 pointer-events: none;
}

/* Hub Controls section */
.hub-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--hub-controls-bg);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    gap: 20px;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
    animation: controlsEntrance 0.6s ease-out forwards 0.7s;
    z-index: 1;
}
.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--hub-search-bg);
    border-radius: 20px;
    padding: 0px 5px 0px 15px;
    flex-grow: 1;
    max-width: 500px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.search-wrapper:focus-within {
    background: var(--hub-search-focus-bg);
    box-shadow: var(--hub-search-focus-shadow);
}
#myInput { /* Search Input */
    flex-grow: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--input-text); /* Uses variable from dark/light */
    font-size: 1rem;
    outline: none;
}
body.custom-cursor-enabled #myInput {
   cursor: none !important;
}
#myInput::placeholder {
    color: var(--input-placeholder);
}
.search-icon-btn {
    background: transparent;
    border: none;
    color: var(--icon-color); /* Themeable icon color */
    font-size: 1.1rem;
    padding: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}
.search-icon-btn:hover {
    color: var(--icon-hover-color);
}
.toggle-categories-btn {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.15)); /* This is dark-specific */
    color: #e0e0e0; /* Dark-specific */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Dark-specific */
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
body.dark-mode .toggle-categories-btn:hover { /* Explicit dark mode hover for this button */
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.2));
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}
body:not(.dark-mode) .toggle-categories-btn { /* Light mode for this button */
    background: linear-gradient(90deg, rgba(0,0,0,0.05), rgba(0,0,0,0.08));
    color: var(--text-color);
    border: 1px solid rgba(0,0,0,0.1);
}
body:not(.dark-mode) .toggle-categories-btn:hover {
    background: linear-gradient(90deg, rgba(0,0,0,0.08), rgba(0,0,0,0.1));
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    color: var(--header-accent-color);
    transform: translateY(-1px);
}

/* Categories */
.categories-wrapper {
  opacity: 0;
  transform: translateY(20px);
  animation: categoriesEntrance 0.6s ease-out forwards 0.9s;
  z-index: 1;
  position: relative;
}
.game-category {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
}
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hub-category-header-border);
}
.category-header h6 {
  font-size: 1.8rem;
  background: linear-gradient(45deg, var(--hub-category-header-text-gradient-from), var(--hub-category-header-text-gradient-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  /* text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 25px rgba(255, 255, 255, 0.5); Dark mode specific shadow */
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-20px);
  animation: categoryHeaderEntrance 0.5s ease-out forwards;
  animation-delay: 1.2s;
}
body.dark-mode .category-header h6 {
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 25px rgba(255, 255, 255, 0.5);
}
body:not(.dark-mode) .category-header h6 {
  text-shadow: 0 0 8px rgba(0,0,0,0.1);
}
.category-header h6 i { /* Icon within header */
  font-size: 0.9em;
  background: linear-gradient(45deg, var(--hub-category-header-text-gradient-from), var(--hub-category-header-text-gradient-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
.scroll-arrows {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}
.scroll-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: scale(1) translateZ(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
  width: 35px;
  height: 35px;
  font-size: 1rem;
  background: var(--hub-scroll-arrow-bg);
  border: 1px solid var(--hub-scroll-arrow-border);
  color: var(--hub-scroll-arrow-color);
  border-radius: 50%;
  will-change: opacity, transform;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.scroll-arrow.hidden {
  opacity: 0;
  transform: scale(0.8) translateZ(0);
  pointer-events: none;
}
.scroll-arrow:hover {
  transform: scale(1.1) translateZ(0);
  background: var(--hub-scroll-arrow-hover-bg);
  color: var(--hub-scroll-arrow-hover-color);
  box-shadow: 0 0 8px var(--hub-scroll-arrow-hover-bg); /* Use bg for shadow color */
}
.scroll-arrow:active {
  transform: scale(0.95) translateZ(0);
  transition: transform 0.1s ease;
}
.scroll-arrow.show-pulse {
  animation: arrowPulse 0.4s ease;
}

/* Game Button Containers (Hub style) */
.btn-container,
.favorite-container { /* For horizontal scroll */
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 5px 20px 5px;
  gap: 20px;
  white-space: nowrap;
  flex-wrap: nowrap;
  scroll-behavior: smooth;
  will-change: scroll-position;
  transform: translateZ(0);
  scrollbar-width: none;
  -ms-overflow-style: none;
  opacity: 0;
  transform: translateY(20px);
  animation: categoriesEntrance 0.6s ease-out forwards 0.9s;
}
.btn-container::-webkit-scrollbar,
.favorite-container::-webkit-scrollbar {
  display: none;
}
.btn-container-grid { /* For grid layout */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 10px 0;
  opacity: 0;
  transform: translateY(20px);
  animation: categoriesEntrance 0.6s ease-out forwards 0.9s;
}

/* Individual Game Button (Hub style) */
.btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 180px;
  height: 150px;
  background: linear-gradient(135deg, var(--hub-btn-bg-gradient-from), var(--hub-btn-bg-gradient-to));
  border: 1px solid var(--hub-btn-border);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  color: var(--hub-btn-text-color);
  text-decoration: none;
  cursor: pointer;
  position: relative;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  vertical-align: top;
  flex-shrink: 0;
  transform: translateZ(0);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  will-change: opacity, transform;
}
.btn-container-grid .btn {
  width: auto; /* Takes grid width */
  /* height: 150px; keep fixed height or make auto */
}
.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); /* Generic shadow, adjust per theme if needed */
  border-color: var(--hub-btn-hover-border);
  background: linear-gradient(135deg, var(--hub-btn-hover-bg-gradient-from), var(--hub-btn-hover-bg-gradient-to));
}
body.dark-mode .btn:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4); /* Darker shadow for dark mode */
}
.btn.hidden {
  display: none !important;
}
.btn .imgg { /* Image inside hub button */
  display: block;
  width: 100%;
  flex-grow: 1; /* Fill space if title bar is fixed height */
  height: calc(100% - 40px); /* Example if info bar is 40px */
  object-fit: cover;
  border-bottom: 1px solid var(--hub-btn-img-border);
  background-color: var(--hub-btn-img-fallback-bg);
}
.game-info-bar { /* Title bar on hub button */
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background-color: var(--hub-btn-info-bar-bg);
  color: var(--hub-btn-info-bar-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  z-index: 2;
  pointer-events: none;
}
.game-info-bar .game-name {
  display: block;
  font-size: 0.95rem;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}
.btn:hover .game-info-bar {
  transform: translateY(0);
}
.btn .heart-icon { /* Heart icon on hub button */
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.1rem;
  color: var(--hub-btn-heart-icon-color);
  background-color: var(--hub-btn-heart-icon-bg);
  padding: 4px 5px;
  border-radius: 4px;
  transition: all 0.3s ease;
  z-index: 5;
  cursor: pointer;
  pointer-events: auto;
}
.btn:hover .heart-icon {
  color: var(--hub-btn-heart-icon-hover-color);
  background-color: var(--hub-btn-heart-icon-hover-bg);
}
.btn .heart-icon.hearted {
  color: var(--hub-btn-heart-icon-hearted-color) !important; /* Ensure override */
}
body.dark-mode .btn .heart-icon.hearted {
  text-shadow: 0 0 8px rgba(255, 107, 107, 0.8);
}
.btn .heart-icon.hearted:hover {
   color: var(--favorited-icon-color); /* Keep red or slightly darker red */
}
body.dark-mode .btn .heart-icon.hearted:hover {
   color: #ff4747;
}

/* Favorites Section (Hub style) */
.favorites-section {
  background: var(--hub-favorites-section-bg);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 40px;
  /* display is controlled by JS */
}

/* Message for no search results */
#noResultsMessage {
  text-align: center;
  margin-top: 30px;
  font-size: 1.3em;
  color: var(--hub-no-results-text-color);
  opacity: 0;
  transform: translateY(20px);
  animation: noResultsEntrance 0.5s ease-out forwards;
  animation-delay: 1.5s;
}


/* ======== SIDE SETTINGS PANEL (Hub style) ======== */
section#settings.content-section { /* Assuming this is the side panel */
    position: fixed;
    top: 0;
    right: -350px; /* Adjust width below */
    width: 100%;
    max-width: 340px;
    height: 100vh;
    overflow-y: auto;
    background-color: var(--side-settings-bg);
    border-left: 1px solid var(--side-settings-border);
    box-shadow: var(--side-settings-shadow);
    z-index: 100; /* Check against header z-index */
    transition: right 0.3s ease-out, visibility 0s linear 0.3s;
    padding-top: 80px; /* Space for header */
    padding-bottom: 40px;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    display: block !important;
    visibility: hidden;
    /* Scrollbar styles for this panel */
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-bg) var(--scrollbar-track-bg);
}
section#settings.content-section::-webkit-scrollbar { width: 10px; }
section#settings.content-section::-webkit-scrollbar-track { background: var(--scrollbar-track-bg); border-radius: 5px; }
section#settings.content-section::-webkit-scrollbar-thumb { background-color: var(--scrollbar-thumb-bg); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
section#settings.content-section::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover-bg); }

section#settings.content-section.is-visible {
    right: 0;
    visibility: visible;
    transition: right 0.3s ease-out, visibility 0s linear 0s;
}
#settings-overlay { /* Overlay for side settings */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg); /* General overlay bg */
    z-index: 99; /* Below side settings */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}
#settings-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/* Buttons and Selects within side settings */
section#settings.content-section button,
section#settings.content-section select {
   background-color: var(--side-settings-button-bg);
   color: var(--side-settings-button-text);
   border: 1px solid var(--side-settings-button-border);
   border-radius: 4px;
   padding: 8px 12px;
   font-family: inherit;
   font-size: 1rem;
   cursor: pointer;
   transition: background-color 0.2s ease, border-color 0.2s ease;
}
section#settings.content-section button:hover,
section#settings.content-section select:hover {
    background-color: var(--side-settings-button-hover-bg);
    border-color: var(--side-settings-button-hover-border);
}
section#settings.content-section button:active { /* Assuming similar active style */
     background-color: var(--side-settings-button-bg); /* Darken slightly from hover */
     border-color: var(--side-settings-button-border);
 }
section#settings.content-section button:disabled,
section#settings.content-section select:disabled {
     opacity: 0.5;
     cursor: not-allowed;
}
/* Color buttons in side settings */
.settings-group .setting-item .color-button-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
    align-items: center;
}
.settings-color-button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.settings-color-button.active {
    border-color: var(--custom-cursor-hover-border); /* Use cursor hover color for active */
    box-shadow: 0 0 8px var(--custom-cursor-hover-border); /* Glow with same color */
}
.settings-color-button:hover:not(.active) {
    border-color: var(--text-color); /* Subtle hover, use text color for visibility */
    opacity: 0.8;
}
/* Sneak Mode Select Specific Styles */
#sneak-mode-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2C114.7L159.3%2C242.5c-5.8%2C5.8-15.2%2C5.8-21%2C0L5.4%2C114.7c-5.8-5.8-5.8-15.2%2C0-21l19.8-19.8c5.8-5.8%2C15.2-5.8%2C21%2C0l109.5%2C109.5l109.5-109.5c5.8-5.8%2C15.2-5.8%2C21%2C0l19.8%2C19.8C292.8%2C99.5%2C292.8%2C108.9%2C287%2C114.7z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px auto;
  padding-right: 30px;
}
#sneak-mode-select option {
 background-color: var(--side-settings-select-option-bg);
 color: var(--side-settings-select-option-text);
}


/* ======== CUSTOM CURSOR ======== */
#custom-cursor {
   position: fixed;
   top: 0;
   left: 0;
   width: 24px;
   height: 24px;
   border-radius: 50%;
   border: 2px solid var(--custom-cursor-border);
   pointer-events: none;
   z-index: 10000;
   opacity: 0;
   transition: opacity 0.3s ease, transform 0s linear, border-color 0.2s ease; /* Add border-color transition */
   transform: translate(var(--mouse-x, 0), var(--mouse-y, 0));
}
body.custom-cursor-enabled #custom-cursor {
    opacity: 1;
}
body.custom-cursor-enabled {
    cursor: none !important;
}
body.custom-cursor-enabled #custom-cursor.on-interactive {
   transform: translate(var(--mouse-x), var(--mouse-y)) scale(1.5);
   border-color: var(--custom-cursor-hover-border);
   transition-duration: 0.1s, 0.1s, 0.2s; /* transform, opacity, border-color */
}
body.custom-cursor-enabled #custom-cursor.clicked {
   transform: translate(var(--mouse-x), var(--mouse-y)) scale(0.8);
   transition-duration: 0.1s, 0.1s; /* transform, opacity */
}


/* ======== UNFOCUSED OVERLAY ======== */
#unfocused-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--unfocused-overlay-fallback-bg);
    display: none;
    z-index: 102; /* Above header and settings */
    box-sizing: border-box;
    pointer-events: none;
}
body.unfocused main.hub-container,
body.unfocused header, /* Hide header too if unfocused */
body.unfocused footer {
   display: none !important; /* Force hide */
}
body.unfocused #settingsMenu, /* Hide popup settings */
body.unfocused section#settings.content-section { /* Hide side settings */
    display: none !important;
}


/* ======== RESPONSIVE STYLES ======== */
/* Base responsive styles for hub-container and side-settings panel */
@media (max-width: 1200px) {
    main.hub-container { padding-top: 90px; padding-left: 30px; padding-right: 30px; }
    section#settings.content-section { padding-top: 90px; max-width: 300px; right: -310px; }
}
@media (max-width: 768px) {
    header { padding: 10px 15px; }
    header nav, nav { flex-direction: column; gap: 10px; align-items: flex-start; } /* Adjust nav for stacking */
    header nav ul, nav ul { flex-direction: column; align-items: flex-start; gap: 8px; margin-left:0; }
    nav li { margin-left: 0; } /* Reset margin for stacked items */
    .settings-button { margin-left: 0; margin-top: 5px; } /* Adjust settings button in stacked nav */

    main.hub-container { padding-top: 160px; /* Increased due to stacked header */ padding-left: 15px; padding-right: 15px; }
    section#settings.content-section { padding-top: 80px; max-width: 280px; right: -290px; }

    .hub-controls { flex-direction: column; align-items: stretch; padding: 10px; gap: 10px; animation-delay: 0.8s; }
    .search-wrapper { max-width: none; padding: 0px 5px 0px 10px; }
    #myInput { padding: 8px; font-size: 0.9rem; }
    .search-icon-btn { padding: 8px; }

    .categories-wrapper { animation-delay: 1s; }
    .category-header h6 { font-size: 1.6rem; gap: 8px; animation-delay: 1.3s;}
    .scroll-arrow { width: 30px; height: 30px; font-size: 0.9rem; }

    .btn-container, .favorite-container { gap: 15px; padding: 8px 5px 15px 5px; }
    .btn-container-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
    .btn { width: 140px; height: 130px; }
    .game-info-bar { height: 30px; } .game-info-bar .game-name { font-size: 0.85em; }
    .btn .heart-icon { font-size: 1rem; top: 6px; right: 6px; padding: 3px 4px; }
    #noResultsMessage { animation-delay: 1.6s; }
    
    /* Game Realm Cards */
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .game-card .imgg { height: 120px; }
    .game-card h4 { font-size: 1em; }
}

@media (max-width: 480px) {
    main.hub-container { padding-top: 150px; /* Adjust if header stacks taller */ padding-left: 10px; padding-right: 10px; }
    section#settings.content-section { max-width: 90%; right: -100%; }

    .category-header h6 { font-size: 1.4rem; gap: 6px; }
    .scroll-arrow { width: 28px; height: 28px; font-size: 0.8rem; }

    .btn-container, .favorite-container { gap: 10px; padding: 6px 4px 12px 4px; }
    .btn-container-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; } /* Smaller minmax */
    .btn { width: 120px; height: 110px; } /* Even smaller */
    .game-info-bar { height: 25px; } .game-info-bar .game-name { font-size: 0.75em; }
    .btn .heart-icon { font-size: 0.9rem; top: 5px; right: 5px; padding: 3px; }

    /* Game Realm Cards */
    .game-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .game-card .imgg { height: 100px; }
    .game-card h4 { font-size: 0.9em; }
    .game-card .play-button { font-size: 0.9em; padding: 6px 10px; }
    .game-card .favorite-button { width: 26px; height: 26px; font-size: 1em; }
}

/* Final check on the .game-card from the *very end* of user's CSS - this seems like a different style */
/* If this is the preferred game card style, it needs theming too. I've themed the one that appeared earlier. */
/* Example for the last game-card definition if it was primary: */
/*
body:not(.dark-mode) .game-card-alternate-style {
  background: #fff;
  padding: 1em;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
body:not(.dark-mode) .game-card-alternate-style h4 { color: #333; }
body:not(.dark-mode) .game-card-alternate-style button {
  background: var(--header-accent-color); color: #fff;
}

body.dark-mode .game-card-alternate-style {
  background: #222;
  padding: 1em;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 255, 153, 0.2); // Specific green shadow
}
body.dark-mode .game-card-alternate-style img { width: 100%; border-radius: 5px; }
body.dark-mode .game-card-alternate-style h4 { margin: 1em 0 0.5em; color: #fff; }
body.dark-mode .game-card-alternate-style button {
  background: #00ff99; border: none; padding: 0.5em 1em; color: #000; font-weight: bold;
  cursor: pointer; border-radius: 5px; transition: background 0.3s;
}
body.dark-mode .game-card-alternate-style button:hover { background: #00cc77; }
*/