:root {
    color-scheme: dark;
    --bg-dark: #0f0f11;
    --bg-panel: #18181b;
    --accent-primary: #f97316;
    --accent-hover: #ea580c;
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    --border-color: #27272a;

    --discord: #5865F2;
    --youtube: #FF0000;
    --twitter: #1DA1F2;

    --navbar-bg: rgba(15, 15, 17, 0.95);
    --navbar-text: #ffffff;
}

[data-theme="light"] {
    color-scheme: light;
    --bg-dark: #f3f4f6;
    --bg-panel: #ffffff;
    --accent-primary: #f97316;
    --accent-hover: #ea580c;
    --text-main: #18181b;
    --text-muted: #52525b;
    --border-color: #d4d4d8;

    --navbar-bg: rgba(255, 255, 255, 0.95);
    --navbar-text: #18181b;
}

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

*:focus {
    outline: none !important;
}

html {
    overflow-y: scroll;
    /* Force vertical scrollbar always */
    scrollbar-gutter: stable;
    /* Reserve scrollbar space */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: block;
    /* Removed flex to prevent vertical centering */
    padding-top: 65px;
    padding-bottom: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

a:hover {
    text-decoration: none !important;
}

/* ============================
   GLOBAL SNOW ANIMATION
   ============================ */
/* Global Snow Animation Removed */

/* ============================
   FIXED NAVBAR (Z-Index 10000)
   ============================ */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    height: 65px;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.brand-logo {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: var(--navbar-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 25px;
}

.nav-link {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-link:hover {
    color: var(--navbar-text);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 110px;
    padding: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    border-radius: 0;
}

.nav-btn:hover {
    background: var(--border-color);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.nav-balance {
    color: var(--navbar-text);
    font-weight: 400;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    /* Match currency icon size */
    width: 20px;
    background: transparent;
    /* Remove container style */
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    text-decoration: none;
    transition: 0.2s;
    border-radius: 0;
    position: relative;
    cursor: pointer;
    padding: 0;
}

.nav-icon-btn:hover {
    color: var(--navbar-text);
    /* Removed border/background hover effects */
}

.nav-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 4px;
    line-height: 1;
}

.currency-icon {
    width: 20px;
    height: 20px;
    background-color: var(--accent-primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    padding-top: 1px;
    padding-right: 1px;
}

.user-menu-container {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 100%;
}

.user-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--navbar-text);
    font-weight: 600;
    padding: 8px 12px;
    border: none;
    background: transparent;
    transition: 0.2s;
}

.user-toggle:hover {
    opacity: 0.8;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    margin-top: 5px;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    padding: 12px 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
    line-height: 1;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

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

.dropdown-item:hover {
    background: var(--border-color);
    color: var(--text-main);
}

/* ============================
   CONTENT SECTIONS & LAYOUT
   ============================ */
.place-container,
.hero,
.grid-section,
.auth-container,
.container,
.catalog-layout,
.dashboard-container,
.main-container {
    position: relative;
    z-index: 60;
    background-color: var(--bg-dark);
}

.main-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.place-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 25px 0 25px;
}

/* ============================
   AUTH PAGE (Login/Register)
   ============================ */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    position: relative;
    z-index: 60;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    text-align: center;
    border-radius: 0;
}

.auth-logo {
    margin-bottom: 10px;
}

.auth-header {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 30px;
    color: var(--text-main);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    height: 45px;
    padding: 0 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: white;
    font-size: 0.95rem;
    outline: none;
    border-radius: 0;
}

.form-input:focus {
    border-color: var(--accent-primary);
}

select {
    color-scheme: dark;
}

select option {
    background-color: var(--bg-panel);
    color: white;
}

select:focus {
    border-color: var(--accent-primary) !important;
    outline: none !important;
}

.form-actions {
    display: flex;
    gap: 10px;
    height: 45px;
}

.btn-auth {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-auth.primary {
    background: var(--accent-primary);
    color: white;
}

.btn-auth.secondary {
    background: var(--bg-dark);
    color: var(--text-muted);
    border-color: var(--border-color);
}

.auth-footer-link {
    margin-top: 25px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1;
}



/* Global Checkbox Style */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    margin: 0;
    flex-shrink: 0;
    outline: none !important;
    box-shadow: none !important;
    transition: background-color 0.2s, border-color 0.2s;
    /* Hide potential text artifacts/browser icons */
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden;
}

input[type="checkbox"]::before {
    content: none !important;
    display: none !important;
}

input[type="checkbox"]:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* SVG Checkmark using ::after for animation */
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block;
    border: none;
    transform: scale(1);
    transform-origin: center center;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================
   HOME / DASHBOARD
   ============================ */
.dashboard-container {
    padding: 40px 10%;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.user-header {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 80px;
}

.avatar {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 0;
}

.welcome-text h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 5px;
    line-height: 1;
}

.welcome-text p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-main);
}

/* Dashboard Game Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.game-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0;
    cursor: pointer;
    transition: 0.2s;
}

.game-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.game-thumb {
    width: 100%;
    height: 150px;
    background-color: #202023;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--border-color);
}

.game-info {
    padding: 15px;
}

.game-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.game-creator {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Hero Section */
.hero {
    position: relative;
    height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 10%;
    padding-bottom: 20px;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 15px;
    line-height: 1.1;
}

.hero h1 span {
    color: var(--accent-primary);
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    margin-bottom: 30px;
}

.hero-btn {
    padding: 12px 30px;
    background: white;
    color: black;
    font-weight: 700;
    border-radius: 0;
    font-size: 1rem;
    display: inline-block;
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

/* Grid Sections (Socials/Cards) */
.grid-section {
    padding: 40px 10%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: -30px;
    position: relative;
    z-index: 3;
}

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* cursor: pointer removed */
    transition: 0.2s;
}

/* .card:hover highlight removed */

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
}

.icon-discord {
    color: var(--discord);
}

.icon-youtube {
    color: var(--youtube);
}

.icon-twitter {
    color: var(--twitter);
}

.card-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================
   GAMES LIST PAGE (games-layout)
   ============================ */
.games-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    padding: 40px 10%;
    min-height: 80vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    /* Fix vertical alignment */
}

.sidebar-btn i {
    line-height: 1;
    display: flex;
    align-items: center;
    font-size: 1.1em;
    /* Slight adjustment */
    margin-top: 1px;
    /* Optical center */
}

.sidebar-btn:hover {
    color: white !important;
    border-color: var(--accent-hover) !important;
    background: var(--accent-hover) !important;
}

.sidebar-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
}

.server-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.server-card {
    display: flex;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    height: 140px;
    overflow: hidden;
}

.server-thumb {
    width: 220px;
    height: 100%;
    background-color: #000;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.server-info {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.server-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-decoration: none;
}

.server-title:hover {
    text-decoration: underline;
}

.server-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.server-creator-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

.server-creator-link:hover {
    color: var(--accent-primary);
}

.server-action {
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.play-btn {
    width: 100%;
    height: 50px;
    background: var(--accent-primary);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.play-btn i {
    line-height: 1;
    display: flex;
    align-items: center;
}

.play-btn:hover {
    background: var(--accent-hover);
}

/* ============================
   CATALOG PAGE
   ============================ */
.catalog-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 30px;
    padding: 40px 10%;
    position: relative;
    z-index: 60;
}

.catalog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
    width: 100%;
}

.sidebar-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 0;
    /* Flush content */
    border-radius: 0;
}

.sidebar-header {
    padding: 12px 15px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.category-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    /* Bigger touch targets */
    color: var(--text-muted);
    font-size: 1rem;
    /* Larger text */
    text-decoration: none;
    transition: 0.2s;
    border-left: 2px solid transparent;
}

.category-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.category-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

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

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.catalog-search {
    display: flex;
    gap: 0;
    /* Connected look */
    height: 40px;
    /* Enforce fixed height */
}

.search-input {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-right: none;
    color: var(--text-main);
    padding: 0 15px;
    width: 250px;
    outline: none;
    border-radius: 0;
    height: 100%;
}

.search-input:focus {
    border-color: var(--accent-primary);
}

.search-btn {
    background: var(--accent-primary) !important;
    border: 1px solid var(--accent-primary) !important;
    color: white;
    padding: 0 20px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: none !important;
    transition: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    transform: none !important;
    margin: 0 !important;
}

.search-btn:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    transform: none !important;
    /* Force static */
    margin-top: 0 !important;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: -6px;
    /* Shift up slightly for alignment */
}

.item-card {
    background: transparent;
    border: none;
    border-radius: 0;
    transition: none;
    position: relative;
    display: flex;
    flex-direction: column;
}

.item-card:hover {
    transform: none;
}

.item-card:hover .item-thumb {
    transform: none;
    border-color: var(--border-color);
    /* No highlight */
}

.item-thumb {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: var(--bg-panel);
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
    border-radius: 0;
    margin-bottom: 5px;
    position: relative;
    overflow: hidden;
}

.item-details {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-name {
    font-size: 1rem;
    font-weight: 400;
    /* Regular weight like the screenshot */
    color: var(--accent-primary);
    /* Link color */
    white-space: nowrap;
    line-height: 1.5;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-bottom: 2px;
    display: block;
}

.item-name:hover {
    text-decoration: underline;
}

.item-creator {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.item-price {
    font-size: 1rem;
    color: var(--text-main);
    /* Changed from white to var for theme support */

    /* Roblox Green */
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    text-align: left;
}

/* Ensure icons are centered perfectly */
.item-price .currency-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    /* Slightly larger inner text */
    width: 18px;
    /* Match closer to text height */
    height: 18px;
    border-radius: 0;
    /* Ensure square */
    padding-bottom: 2px;
    /* Visual tweak for the character baseline */
    padding-left: 1px;
    /* Nudge character slightly right */
}

/* Hide the 'details' button for a cleaner catalog look, clicking the card text/image is enough */
.item-card .buy-btn,
.buy-btn {
    display: none !important;
}

/* ============================
   GAME DETAILS (game.php) & CREATE PAGE
   ============================ */
.place-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 10%;
    width: 100%;
    position: relative;
    z-index: 60;
}

.place-content {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
}

/* 1. Base style for the Thumbnail Container */
.place-thumb {
    flex: 0 0 auto;
    width: 480px;
    aspect-ratio: 16/9;
    background-color: #000;
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 0;
    overflow: hidden;
}

/* 2. Specific styles for the Upload Label (Create Page Only) */
label#preview-box.place-thumb {
    cursor: pointer;
    border: 0 none transparent !important;
    outline: 0 none transparent !important;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.place-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100%;
    /* Match thumb height */
}

.place-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    margin-bottom: 5px;
    word-break: break-word;
    /* Prevent overflow */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.place-creator {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.place-tag {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    border-radius: 0;
    margin-bottom: 10px;
}

.place-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-height: 120px;
    /* Limit height */
    overflow-y: auto;
    /* Scroll if too long */
}

.place-desc::before {
    content: "description";
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    text-transform: lowercase;
}

.play-btn-large {
    width: 100%;
    height: 50px;
    /* Reduced from 65px */
    background: var(--accent-primary);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.2s;
    margin-top: auto;
    line-height: 1;
    /* Fix text alignment */
    /* line-height removed to let flex align center */
}

.play-btn-large:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.play-btn-large i {
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    margin-top: 2px;
    /* Push icon down to match lowercase text */
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
    z-index: 60;
}

.stat-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Servers / Active Players */
.servers-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
    min-height: 200px;
    position: relative;
    z-index: 60;
}

.section-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 15px;
}

.avatar-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.player-avatar {
    width: 60px;
    height: 60px;
    background: #222;
    border: 1px solid var(--border-color);
}

/* Upload Zone - Fixed to remove outer border gap & overlay correctly */
.upload-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    right: auto;
    bottom: auto;

    margin: 0;
    border: 2px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 600;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.02);
    box-sizing: border-box;
    z-index: 10;
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 1000px) {
    .place-content {
        flex-direction: column;
    }

    .place-thumb {
        width: 100% !important;
        aspect-ratio: 16/9;
        height: auto !important;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================
   FIXED FOOTER (Z-Index 10000)
   ============================ */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10000;
    /* Highest priority */
    border-top: 1px solid var(--border-color);
    padding: 25px 0;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

/* FAQ Styles */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text-main);
    padding-bottom: 20px;
}

.faq-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

details {
    padding: 20px;
    cursor: pointer;
    transition: 0.2s;
}

details[open] {
    background: rgba(255, 255, 255, 0.02);
}

summary {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-weight: 400;
    font-size: 1.5rem;
    color: var(--text-muted);
}

details[open] summary::after {
    content: '-';
}

.answer {
    margin-top: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
    padding-top: 15px;
}

/* DARK GARY THEME */
[data-theme='dark-gary'] {
    --bg-dark: rgba(5, 5, 5, 0.85);
    /* Semi-transparent background for containers */
    --bg-panel: rgba(20, 20, 20, 0.85);
    --border-color: #333;
}

[data-theme='dark-gary'] body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9000;
    /* Overlay on top of content (z-60), but below navbar (z-10000) */
    background-image: url('assets/dark_gary.png');
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    /* Barely visible */
    pointer-events: none;
}

[data-theme='dark-gary'] body {
    background-color: #050505;
    /* Fallback dark background */
}

/* Ensure containers don't block the view if they have solid backgrounds override */
[data-theme='dark-gary'] .dashboard-container,
[data-theme='dark-gary'] .place-container,
[data-theme='dark-gary'] .catalog-layout,
[data-theme='dark-gary'] .hero,
[data-theme='dark-gary'] .grid-section {
    background-color: transparent;
    /* Let the body/overlay shine through */
}

/* PROFILE PAGE UPDATES */
.profile-header-card {
    display: flex;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 25px;
    gap: 30px;
    margin-bottom: 20px;
    position: relative;
    align-items: flex-start;
}

.profile-avatar {
    width: 200px;
    height: 200px;
    /* background/border removed */
    flex-shrink: 0;
}

.profile-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-username {
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.role-badge {
    font-size: 0.8rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-stat {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.profile-stat a {
    color: var(--accent-primary);
}

.blurb-container {
    margin-top: 10px;
    max-width: 600px;
}

.blurb-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 5px;
}

.blurb-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
    /* Respect user spacing exactly */
    word-wrap: break-word;
}

.place-container {
    max-width: 1250px;
    /* Increased from 1100px */
    margin: 0 auto;
    padding: 10px 25px 0 25px;
}

/* Main Profile Grid (Friends & Places) */
.profile-layout {
    display: grid;
    grid-template-columns: 405px 1fr;
    /* Wide sidebar for Friends (approx 4 avatars) */
    gap: 25px;
}

/* Secondary Profile Grid (Inventory) */
.profile-inventory-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    /* Narrow sidebar for Inventory Menu */
    gap: 25px;
}

.left-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.friends-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 15px;
    height: 100%;
}

.box-header {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.box-header a {
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.friends-grid {
    display: flex;
    gap: 15px;
    overflow: hidden;
}

.friend-item {
    text-align: center;
    width: 80px;
}

.friend-avatar {
    width: 80px;
    height: 80px;
    /* background removed */
    margin-bottom: 5px;
    border: 1px solid var(--border-color);
}

.friend-name {
    font-size: 0.8rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Matching Catalog Sidebar Style */
.inventory-menu {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: 0;
    width: 100%;
    /* Fill the column */
}

.inv-header {
    padding: 12px 15px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    margin-bottom: 0;
}

/* Container for items to handle padding if needed, but menu is column */
.inv-menu-list {
    display: flex;
    flex-direction: column;
    padding: 5px 0;
}

/* The items themselves */
.inv-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-muted);
    font-size: 1rem;
    border-bottom: none;
    /* Removed heavy borders */
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
    border-left: 2px solid transparent;
    /* Prepare for active state */
}

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

.inv-item.active {
    background: rgba(255, 255, 255, 0.05);
    /* Subtle dark active */
    color: var(--text-main);
    border-left-color: var(--accent-primary);
    /* Left accent strip */
    font-weight: 600;
}

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

/* SETTINGS PAGE REDESIGN */
.settings-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    align-items: start;
    /* Pin items to top */
}

.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.settings-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    padding-left: 10px;
}

.settings-nav-item {
    padding: 8px 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    border-left: 2px solid transparent;
}

/* Button Helper Classes */
.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
    line-height: 1;
    gap: 6px;
    /* Ensure gap exists */
}

.btn-sm.disabled {
    background: #444;
    cursor: default;
    opacity: 0.7;
}

.btn-sm.danger {
    background: #dc2626;
    /* Red */
}

.btn-sm.success {
    background: #16a34a;
    /* Green */
}

.btn-sm:hover:not(.disabled) {
    opacity: 0.9;
}

.settings-nav-item:hover,
.settings-nav-item.active {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent);
}

.settings-content {
    min-height: 400px;
}

.settings-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-panel.active {
    display: block;
}

.user-details-box {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-main);
    padding: 5px 0;
}

.detail-label {
    font-weight: 700;
    width: 100px;
    color: var(--text-muted);
}

.detail-value {
    flex-grow: 1;
    font-family: monospace;
}

.dark-input {
    background: #0a0a0c;
    border: 1px solid var(--border-color);
    padding: 15px;
    color: var(--text-muted);
    width: 100%;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    outline: none;
}

.dark-input:focus {
    border-color: var(--accent-primary);
    color: white;
}

.update-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 8px 20px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 15px;
}

.update-btn:hover {
    background: var(--accent-hover);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.settings-layout {
    align-items: start;
}

.dark-input {
    font-family: 'Segoe UI', sans-serif;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 25px;
    width: 400px;
    max-width: 90%;
    position: relative;
}

.modal-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.g-translate {
    padding: 20px;
    background: white;
    border-radius: 0;
    color: black;
}

/* Friends Page Styles */
.page-header-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    /* border-bottom removed */
}

.page-header-block h1 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin: 0;
}

.tab-nav {
    display: flex;
    gap: 10px;
}

.tab-link {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.2s;
}

.tab-link.active {
    background: var(--accent-primary);
    color: white;
}

.tab-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.section-title-bar {
    font-size: 1.2rem;
    color: var(--text-main);
    /* border-bottom removed */
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.friends-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.friend-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: 0.2s;
    border-radius: 0;
}

/* Hover effect removed */

.friend-card-avatar {
    width: 60px;
    height: 60px;
    /* background removed */
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    /* Square avatar */
}

.friend-card-name {
    text-align: left;
}

.friend-card-name a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.friend-card-name a:hover {
    text-decoration: none;
    /* No underline, maybe color shift? */
    color: var(--accent-primary);
}

.request-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.request-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
}

.req-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.req-avatar-mini {
    width: 30px;
    height: 30px;
    background: #444;
    border-radius: 0;
    flex-shrink: 0;
}

.req-user a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

.req-actions {
    display: flex;
    gap: 10px;
}

/* Social Links Grid */
.grid-section {
    padding: 20px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.social-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.social-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 700;
}

.icon-discord {
    color: var(--discord);
    font-size: 1.5rem;
}

.icon-youtube {
    color: var(--youtube);
    font-size: 1.5rem;
}

.icon-twitter {
    color: var(--twitter);
    font-size: 1.5rem;
}

.social-card-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ========================
   GAMES PAGE REDESIGN
   ======================== */
/* Games Toolbar moved to end of file for priority */

/* Tabs */
.games-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg-panel);
}

.games-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: 0.2s;
    border-bottom: 3px solid transparent;
}

.games-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: linear-gradient(to top, rgba(239, 68, 68, 0.1), transparent);
}

/* Filters Menu */
/* Filters Menu */
.filter-dropdown {
    position: absolute;
    top: 60px;
    left: 0;
    width: 240px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;

    /* Animation States */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    border-radius: 0;
}

.filter-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-header {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.filter-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: 0.2s;
}

.filter-opt:hover {
    color: white;
}

.filter-radio {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-radius: 0;
    position: relative;
    flex-shrink: 0;
}

.filter-opt.selected .filter-radio {
    border-color: var(--accent-primary);
}

.filter-opt.selected .filter-radio::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 0;
}

.filter-opt.selected {
    color: var(--text-main);
}

/* Global Custom Checkbox */
/* Global Custom Checkbox (Defined in GLOBAL FORM STYLES below) */

/* Edit Game Specifics */
.edit-version-box {
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    margin-bottom: 30px;
}

/* New Game Grid */
.games-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 15px;
}

.game-card-new {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: 0.2s;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    z-index: 5;
}

.game-card-new:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.gcn-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Tag removed */

.gcn-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gcn-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main) !important;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.gcn-creator {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gcn-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* ========================
   GLOBAL FORM STYLES
   ======================== */


/* File Input Styling */
input[type="file"] {
    background: var(--bg-dark);
    color: var(--text-muted);
    padding: 8px;
    border-radius: 0;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 0;
    cursor: pointer;
    margin-right: 10px;
    transition: 0.2s;
}

input[type="file"]::-webkit-file-upload-button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ============================
   USERS / PLAYER LIST PAGE
   ============================ */
.users-search-container {
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
}

.search-input-lg {
    flex-grow: 1;
    height: 50px;
    padding: 0 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
}

.search-input-lg:focus {
    border-color: var(--accent-primary);
}

.search-btn-lg {
    width: 60px;
    height: 50px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
}

.search-btn-lg:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.user-entry-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}

.user-entry-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.user-entry-avatar {
    width: 60px;
    height: 60px;
    border-radius: 0;
    /* Keeping with square-ish theme */
    background-color: #202023;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border-color);
}

.user-entry-info {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-entry-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-entry-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.online-status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 0;
    box-shadow: 0 0 5px #22c55e;
}

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: 0.2s;
}

.page-btn:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.page-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.page-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================
   GLOBAL "NO ROUNDING" OVERRIDE
   ============================ */
/* Buttons */
button,
.btn-sm,
.btn-lg,
.play-btn,
.hero-btn,
.nav-btn,
.sidebar-btn,
.page-btn,
/* Inputs */
input,
textarea,
select,
.form-control,
.form-input,
.dark-input,
.search-input,
/* Containers */
.card,
.game-card,
.game-card-new,
.profile-header-card,
.auth-container,
.sidebar-box,
.item-card,
.modal,
.dropdown-menu,
.filter-dropdown,
.place-tag,
.role-badge,
/* Misc */
.menu-item,
.alert,
.badge,
.games-tab,
.filter-opt input[type="checkbox"] {
    border-radius: 0 !important;
}

/* File Upload Button Styling */
input[type="file"]::-webkit-file-upload-button {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    margin-right: 10px;
    cursor: pointer;
    border-radius: 0 !important;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--border-color);
}

/* ============================
   NEW FORUM DESIGN (Feed Style)
   ============================ */
.forum-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    align-items: start;
}

.forum-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-btn-large {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: white;
    font-weight: 600;
    text-align: center;
    border-radius: 0;
    /* Slight roundness as per ref */
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
}

.sidebar-btn-large:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.forum-search-bar {
    position: relative;
    width: 100%;
}

.forum-search-input {
    width: 100%;
    padding: 10px 15px;
    /* Space for icon */
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 0;
    font-size: 0.9rem;
    outline: none;
}

.forum-search-input:focus {
    border-color: var(--accent-primary);
}

.sidebar-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 0;
    transition: 0.1s;
    font-size: 0.95rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.sidebar-link.active {
    font-weight: 600;
}

.cat-dot {
    width: 8px;
    height: 8px;
    border-radius: 0;
    background: #555;
    flex-shrink: 0;
}

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

.forum-page-header {
    text-align: center;
    margin-bottom: 20px;
}

.forum-page-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 5px;
}

.forum-page-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Thread Item Card */
.thread-card {
    background: var(--bg-panel);
    /* Dark background */
    border: 1px solid transparent;
    /* No visible border initially */
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    border-radius: 0;
    transition: 0.2s;
    text-decoration: none;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.thread-card:hover {
    border-color: var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

.thread-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.thread-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-right: 10px;
    display: inline;
}

.thread-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.thread-meta span {
    color: white;
    font-weight: 500;
}

.cat-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    background: #333;
    opacity: 0.8;
    vertical-align: 3px;
}

/* Reply Box */
.thread-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 5px 10px;
}

.stat-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

@media (max-width: 800px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================
   FORUM THREAD VIEW
   ============================ */
.thread-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-row {
    display: flex;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0;
    /* Consistent rounding */
    overflow: hidden;
}

.post-author-col {
    width: 200px;
    padding: 25px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
}

.post-avatar {
    width: 100px;
    height: 100px;
    background-size: cover;
    background-position: center;
    border-radius: 0;
    /* No border radius on avatar image itself */
    margin-bottom: 10px;
    /* No border as requested */
}

.post-username {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 4px;
    text-decoration: none;
}

.post-role {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.post-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-content-col {
    flex-grow: 1;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
}

.post-header-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-body-text {
    line-height: 1.6;
    color: var(--text-main);
    white-space: pre-wrap;
    font-size: 0.95rem;
    min-height: 100px;
}

.reply-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 0;
}

/* ============================
   GLOBAL CHECKBOX STYLE
   ============================ */


/* Forum Textarea - No Resize */
.dark-input,
textarea.dark-input {
    resize: none;
}

/* ============================
   GAMES PAGE FILTER DROPDOWN
   ============================ */
.games-toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
}

.filter-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
}

.filter-btn:hover {
    border-color: var(--accent-primary);
    color: white;
}

.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 15px;
    min-width: 200px;
    z-index: 100;
    flex-direction: column;
    gap: 15px;
}

.filter-dropdown.show {
    display: flex;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.filter-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 0;
}

.filter-opt:hover {
    color: white;
}

/* Filter Radio - Styled like checkbox */
.filter-radio {
    width: 14px;
    height: 14px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.filter-opt.selected .filter-radio {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.search-bar-group {
    display: flex;
    flex-grow: 1;
    max-width: 400px;
}

.search-in {
    flex-grow: 1;
    padding: 10px 15px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-right: none;
    color: white;
    outline: none;
}

.search-in:focus {
    border-color: var(--accent-primary);
}

.games-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.games-tab {
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.games-tab:hover {
    color: white;
}

.games-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.games-grid-new {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.game-card-new {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: 0.2s;
}

.game-card-new:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
}

.gcn-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: #000;
    border-bottom: 1px solid var(--border-color);
}

.gcn-info {
    padding: 12px;
}

.gcn-title {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.gcn-creator {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.gcn-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================
   GLOBAL CHECKBOX STYLING
   ============================ */


/* Specific styling for the 'custom' checkboxes in games.php to match */
/* The user wants these to look exactly like the checkboxes above. */

.filter-radio {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-dark);
    border-radius: 0;
    display: inline-block;
}

/* When selected, it should look like the checked checkbox: Dark BG, Orange Border, Orange Center Square */
.filter-opt.selected .filter-radio {
    background: var(--bg-dark);
    border-color: var(--accent-primary) !important;
    position: relative;
}

.filter-opt.selected .filter-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
}

/* Disable resize on all textareas, especially forum */
textarea {
    resize: none !important;
}

/* ============================
   FORUM REDESIGN V2 - 'Card Stream'
   ============================ */

/* Redesigning the thread/post view to be lighter and more 'modern' as requested */
/* We will override the .post-row and .post-author-col styles defined previously above */

.thread-container {
    gap: 30px;
    /* More spacing between posts */
}

.post-row {
    background: transparent;
    /* Remove container background */
    border: none;
    /* Remove border */
    border-radius: 0;
    overflow: visible;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Author column becomes a standalone floating avatar/info block on left */
.post-author-col {
    width: 120px;
    background: transparent;
    border: none;
    padding: 0;
    text-align: center;
}

.post-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.post-username {
    font-size: 0.95rem;
    color: var(--text-main);
    display: block;
    margin-bottom: 2px;
}

.post-role {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.post-stats {
    display: none;
    /* Hide 'joined' date to clean up */
}

/* Content bubble */
.post-content-col {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0;
    /* No rounding */
    padding: 25px;
    position: relative;
    flex-grow: 1;
}

/* Little triangle pointing to author */
.post-content-col::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 30px;
    width: 10px;
    height: 10px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.post-header-meta {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 15px;
    padding-bottom: 8px;
}

.post-body-text {
    font-size: 1rem;
    color: #e4e4e7;
}

.reply-card {
    margin-left: 140px;
    /* Indent reply box to align with posts */
    border-radius: 0;
}

@media (max-width: 768px) {
    .post-row {
        flex-direction: column;
        gap: 10px;
    }

    .post-author-col {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 15px;
        text-align: left;
    }

    .post-avatar {
        width: 40px;
        height: 40px;
        margin: 0;
    }

    .post-content-col {
        padding: 15px;
    }

    .post-content-col::before {
        display: none;
    }

    .reply-card {
        margin-left: 0;
    }
}

/* ============================
   GAMES PAGE REDESIGN - TOOLBAR (Consolidated)
   ============================ */
.games-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
    z-index: 70;
}

.filter-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    border-radius: 0;
}

.search-bar-group {
    flex-grow: 1;
    display: flex;
    width: 100%;
    max-width: none;
    /* Ensure it takes full available width */
}

/* Specific overrides with !important to defeat global resets and ensure specificity */
.games-toolbar .search-in {
    flex-grow: 1;
    width: 100%;
    min-width: 0;
    padding: 10px;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-right: none;
    color: white;
    font-family: inherit;
    border-radius: 0 !important;
    /* NO ROUNDING */
}

.games-toolbar .search-btn {
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
}

/* Filter Dropdown Menu */
.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    min-width: 200px;
    z-index: 100;
}

.filter-dropdown.show {
    display: block;
}

.filter-section {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-header i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.filter-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.filter-opt:hover {
    color: white;
}

.filter-radio {
    width: 14px;
    height: 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.filter-opt.selected .filter-radio {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Checkbox styling for filter dropdown - simple size override, inherit global icons */
.filter-opt input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

/* Inherits global checkbox checkmark style */

/* ============================
   GLOBAL BUTTON REDESIGN
   ============================ */

/* Generic Button Reset & Base */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-auth,
.play-btn,
.buy-btn,
.hero-btn,
.sidebar-btn,
.sidebar-btn-large,
.nav-btn,
.btn-sm,
.search-btn:not(.games-toolbar .search-btn) {
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1;
    vertical-align: middle;
}

/* Primary Action Buttons (Orange) */
.btn-primary,
.play-btn,
.buy-btn,
.btn-auth.primary,
.search-btn:not(.games-toolbar .search-btn) {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(249, 115, 22, 0.2);
}

.btn-primary:hover,
.play-btn:hover,
.buy-btn:hover,
.btn-auth.primary:hover,
.search-btn:not(.games-toolbar .search-btn):hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(249, 115, 22, 0.3);
}

/* Secondary / Panel Buttons (Dark with Border) */
.btn-secondary,
.sidebar-btn,
.sidebar-btn-large,
.nav-btn,
.game-card-new,
.browse-btn,
.btn-auth.secondary {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 0;
}

.filter-btn {
    border-radius: 0 !important;
}

.btn-secondary:hover,

.sidebar-btn-large:hover,
.nav-btn:hover,
.game-card-new:hover,
.browse-btn:hover,
.filter-btn:hover,
.btn-auth.secondary:hover {
    background: var(--bg-panel);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* Hero Button specific */
.hero-btn {
    padding: 12px 32px;
    font-size: 1.1rem;
    background: white;
    color: black;
    border-radius: 0;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.25);
    background: #fff;
}

/* Small Buttons */
.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    color: white;
}

.btn-sm:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
}

/* Ensure Nav Buttons fit nicely */
.nav-btn {
    height: 38px;
    width: auto;
    padding: 0 20px;
    border-radius: 6px;
}

/* Fix for Games Toolbar Filter Button */
.games-toolbar .filter-btn {
    border-radius: 6px;
}

/* ============================
   PROFILE PAGE IMPROVEMENTS
   ============================ */


/* ============================
   PROFILE PAGE REDESIGN
   ============================ */

.profile-header-expanded {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 30px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    /* Optional: subtle gradient */
    background: var(--bg-panel);
}

.profile-header-top {
    display: flex;
    gap: 30px;
    margin-bottom: 10px;
}

.profile-avatar-container {
    flex-shrink: 0;
}

.profile-avatar-lg {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border: none;
    background: transparent;
}

.profile-main-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Tighten up the spacing between name, role, button, blurb */
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Reduced from 15px to bring button closer */
}

.profile-username-lg {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
    margin: 0;
    /* Remove default browser margins for perfect centering */
}

.edit-profile-btn {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: 0.2s;
}

.edit-profile-btn:hover {
    color: var(--text-main);
}

.btn-profile-action {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: 0.2s;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-profile-action:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

.btn-profile-action.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.btn-profile-action.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-profile-action.success {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.btn-profile-action.success:hover {
    background: #16a34a;
    border-color: #16a34a;
}

.btn-profile-action.danger {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.btn-profile-action.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-profile-action.disabled {
    opacity: 0.6;
    cursor: default;
}

.profile-badges-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    margin-top: 5px;
}

.role-badge-lg {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.blurb-container.expanded {
    margin-top: 0;
    margin-bottom: 0;
    max-width: 800px;
}

/* STATS GRID */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 0;
    /* border-top removed */
    /* padding-top removed */
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    /* transition removed */
}

/* .stat-card:hover removed */

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

/* .stat-value.text-sm removed */

.stat-link {
    font-size: 0.8rem;
    color: var(--accent-primary);
    margin-top: 2px;
}

.stat-link:hover {
    text-decoration: underline;
}

/* ACTIONS BAR */
.profile-actions-bar {
    margin-top: 25px;
    display: flex;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-action {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-dark);
    color: var(--text-main);
    transition: 0.2s;
    flex: 1;
    /* Stretch buttons */
    max-width: 200px;
}

.btn-action:hover {
    background: var(--border-color);
    color: white;
}

.btn-action.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.btn-action.primary:hover {
    background: var(--accent-hover);
}

.btn-action.danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-action.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.btn-action.success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.btn-action.success:hover {
    background: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
}

.profile-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-value {
    color: var(--text-main);
    font-weight: 500;
}

.stat-action {
    color: var(--accent-primary);
    font-size: 0.85rem;
    text-decoration: none;
    margin-left: 2px;
    opacity: 0.9;
    font-weight: 500;
}

.stat-action:hover {
    text-decoration: underline;
    opacity: 1;
}

.blurb-container {
    margin-top: 25px;
    background: transparent;
}

.blurb-label {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.blurb-text {
    color: var(--text-main);
    /* Bright Zinc-100 */
    font-size: 0.95rem;
    line-height: 1.6;
    font-weight: 400;
    opacity: 0.95;
}

.no-desc {
    font-style: italic;
    opacity: 0.6;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================
   FRIENDS PAGE REDESIGN
   ============================ */

.friends-header {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
}

.modern-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.modern-tab {
    padding: 10px 5px;
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
    margin-bottom: -1px;
}

.modern-tab:hover,
.modern-tab.active {
    color: var(--text-main);
}

.modern-tab.active {
    border-bottom-color: var(--accent-primary);
}

/* FRIENDS GRID */
.friends-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.friend-card-modern {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 0;
    /* No rounding */
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: 0.2s;
}

.friend-card-modern:hover {
    background: rgba(255, 255, 255, 0.05);
    /* Subtle highlight */
    border-color: var(--text-muted);
}

.fc-avatar {
    width: 60px;
    height: 60px;
    background-size: cover;
    background-position: center;
    /* No border or background as requested */
    border-radius: 0;
    flex-shrink: 0;
}

.fc-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.fc-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    margin-bottom: 4px;
}

.fc-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-indicator {
    width: 6px;
    height: 6px;
    /* No rounding for consistency if desired, or keep as dot */
    border-radius: 0;
    background-color: var(--text-muted);
}

.status-indicator.online {
    background-color: #10b981;
    /* Emerald green */
}

/* REQUESTS TAB STYLES */
.req-section-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    /* Matched to friends tab spacing */
    text-transform: uppercase;
    color: var(--text-muted);

}

/* Requests use the same card style for consistnecy */
.req-card-modern {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 0;
    /* No rounding */
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    transition: 0.2s;
}

.req-card-modern:hover {
    background: rgba(255, 255, 255, 0.05);
}

.req-left {
    display: flex;
    align-items: center;
    /* Vertically center avatar and username */
    gap: 15px;
}

.req-actions {
    display: flex;
    gap: 8px;
}

/* Updated Button Styles for Requests */
.btn-sm {
    padding: 6px 15px;
    /* Restored padding for content */
    width: auto;
    /* Allow auto width based on text */
    min-width: 80px;
    /* Keep minimum width for small buttons */
    height: 32px;
    /* Explicit height */
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    box-sizing: border-box;
    /* Include border in height */
    cursor: pointer;
    transition: 0.2s;
    text-transform: capitalize;
    border-radius: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    line-height: normal;
}

.btn-sm.success {
    background-color: var(--accent-primary);
    color: white;
    /* Border is transparent but present */
}

.btn-sm.success:hover {
    opacity: 0.9;
}

.btn-sm.danger {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-muted);
}

.btn-sm.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Solid gray secondary button for Ignore */
.btn-sm.secondary {
    background-color: #4a4a4a;
    border-color: #4a4a4a;
    color: white;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-sm.secondary:hover {
    background-color: #5a5a5a;
    border-color: #5a5a5a;
}

/* ===========================================
   SITE ALERTS
   =========================================== */
.site-alert {
    position: fixed;
    top: 64px;
    /* Adjusted to overlap border slightly or sit flush */
    left: 0;
    right: 0;
    z-index: 999;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.site-alert-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.site-alert i {
    font-size: 1rem;
}

/* Alert Types */
.site-alert-info {
    background: #1d4ed8;
    color: white;
}

.site-alert-warning {
    background: #b45309;
    color: white;
}

.site-alert-danger {
    background: #b91c1c;
    color: white;
}

.site-alert-success {
    background: #15803d;
    color: white;
}

.site-alert-spacer {
    height: 38px;
    /* Same height as the alert */
}

/* GAMES TOOLBAR & FILTER */
.games-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    position: relative;
}

.filter-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
}

.filter-btn:hover {
    border-color: var(--text-muted);
    color: white;
}

.filter-dropdown {
    position: absolute;
    top: 50px;
    left: 0;
    width: 220px;
    background: #18181b;
    border: 1px solid var(--border-color);
    z-index: 100;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s !important;
    display: block !important;
    /* Ensure it's always 'display:block' so transitions work. Control visibility only via opacity/visibility. */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.filter-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-section {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-header i {
    color: var(--text-muted);
}

.filter-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

.filter-opt:hover {
    color: white;
}

.filter-radio {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.filter-opt.selected .filter-radio {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
}

.search-bar-group {
    display: flex;
    flex-grow: 1;
    gap: 0;
}

.search-in {
    flex-grow: 1;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-right: none;
    color: white;
    padding: 0 15px;
    height: 40px;
    font-size: 0.9rem;
    outline: none;
}

.search-in:focus {
    border-color: var(--accent-orange);
    border-right: 1px solid var(--accent-orange);
}

.search-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-btn:hover {
    color: white;
}

.gcn-thumb {
    background-size: cover !important;
    background-position: center !important;
}

/* ============================
   MARKDOWN & SPOILERS
   ============================ */
.spoiler {
    background-color: #000;
    color: transparent;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
    transition: 0.1s;
    padding: 0 2px;
}

.spoiler:hover {
    background-color: #111;
}

.spoiler.revealed {
    background-color: rgba(255, 255, 255, 0.1);
    color: inherit;
    cursor: text;
    user-select: text;
}

/* ============================
   LINK WARNING MODAL
   ============================ */
.link-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20000;
    display: flex;
    /* Always flex to center, control via opacity */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.link-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.link-modal {
    background: var(--bg-panel);
    width: 100%;
    max-width: 480px;
    padding: 25px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-radius: 0;

    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.link-modal-overlay.show .link-modal {
    transform: scale(1);
}

.link-modal-header {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-modal-body {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.link-modal-url {
    background: var(--bg-dark);
    padding: 12px;
    color: var(--accent-primary);
    font-family: monospace;
    word-break: break-all;
    border: 1px solid var(--border-color);
    margin: 10px 0;
    font-size: 0.95rem;
}

.link-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

.btn-modal {
    padding: 10px 20px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border-radius: 0;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-modal:hover {
    background: var(--border-color);
}

.btn-modal.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.btn-modal.primary:hover {
    background: var(--accent-hover);
}

/* Wardrobe Styles */
.wardrobe-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.wardrobe-item {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    aspect-ratio: 1;
}

.wardrobe-item:hover {
    border-color: var(--text-muted);
}

.wardrobe-item.equipped {
    border: 2px solid var(--accent-primary);
}

.wardrobe-thumb {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
}

.equipped-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--accent-primary);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Remove border from friend avatars on profile */
.friend-avatar {
    border: none !important;
    background-color: transparent !important;
}

/* START SITE ALERTS STACKING FIX */
.site-alerts-wrapper {
    position: fixed;
    top: 65px;
    left: 0;
    width: 100%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.site-alert {
    position: relative !important;
    /* Override previous fixed */
    top: auto !important;
    left: auto !important;
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    box-sizing: border-box;
}

/* Colors (Ensure these are defined if not already) */


/* Spacer update */
.site-alert-spacer {
    /* Height is now set inline by PHP based on count */
    width: 100%;
    pointer-events: none;
}

/* END SITE ALERTS STACKING FIX */

/* ============================
   ADMIN USER DETAILS CARDS
   ============================ */

/* ========================
   ADMIN DASHBOARD LAYOUT
   ======================== */

.user-search-toolbar {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    margin: 0 auto 30px auto;
    /* Centered */
    display: flex;
    width: fit-content;
    /* Shrink to content */
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 0;
    min-width: 0;
    /* width: auto removed to allow fit-content to work */
}

.user-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
    flex-grow: 0;
}

.search-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding-left: 5px;
}

.user-search-form input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 0 !important;
    padding: 6px 10px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    transition: 0.2s;
    /* Height will be handled by global rule or inherited, approx 38px usually */
}

.user-search-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.user-search-form button {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0 15px;
    /* Use standard padding */
    height: 38px !important;
    /* Match Input Height */
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    width: auto;
    /* Allow auto width */
}

.user-search-form button i {
    font-size: 0.9rem;
    color: white;
    margin: 0;
}

/* Hide text in button, show icon only if strictly desired, but standardizing implies maybe text? */
/* Keeping icon only as per design preference but square */
.user-search-form button {
    font-size: 0;
}

.user-search-form button i {
    font-size: 1rem;
}

/* TOOLS GRID */


.user-search-form button:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

/* DASHBOARD SPLIT VIEW */
.user-manage-dashboard {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    /* Center the entire block */
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* SIDEBAR */






.umd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.umd-identity {
    margin-bottom: 25px;
}

.umd-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.umd-id {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.umd-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--bg-dark);
    color: white;
    border: 1px solid var(--border-color);
    border-radius: 0;
}

.umd-badge.role-administrator {
    background: rgba(239, 68, 68, 0.1);
    /* Red tint */
    color: #ef4444;
    border-color: #ef4444;
}

.umd-meta-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.umd-meta-item {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 12px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.umd-meta-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.umd-meta-item span {
    color: var(--text-muted);
}

.umd-meta-item strong {
    color: var(--text-main);
}

/* CONTENT AREA */
/* CONTENT AREA */


.umd-section-title {
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}



.tool-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.tool-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-main);
    border-radius: 0;
}

.tool-info {
    flex-grow: 1;
}

.tool-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3px;
    line-height: 1.2;
}

.tool-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Joined Input for Tools */
.input-joined {
    display: flex;
    gap: 0;
    margin-top: auto;
}

.input-joined input {
    flex-grow: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-right: none;
    padding: 0 12px;
    color: var(--text-main);
    height: 38px !important;
    font-size: 0.9rem;
    min-width: 0;
}

.input-joined input:focus {
    outline: none;
    border-color: var(--accent-primary);
    z-index: 2;
    border-right: 1px solid var(--accent-primary);
}

.input-joined button {
    background: var(--border-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0 15px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    height: 38px !important;
    white-space: nowrap;
}

.input-joined button:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.user-not-found-state {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed var(--border-color);
}

.user-not-found-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 15px;
    color: #ef4444;
}

/* ============================
   RESPONSIVE & MOBILE DESIGN
   ============================ */

/* Mobile Menu Button - Hidden on Desktop */
.mobile-menu-toggle {
    display: none !important;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    height: 100%;
    align-items: center;
}

@media (max-width: 900px) {

    /* Navbar Adjustments */
    .navbar {
        padding: 0 15px;
        justify-content: flex-start;
        /* Use auto margins for positioning */
    }

    .mobile-menu-toggle {
        display: flex;
        order: 0;
        margin-right: 15px;
    }

    .brand-logo {
        height: 40px;
        order: 1;
        margin-right: auto;
        /* Pushes right side to the end */
    }

    .brand-logo img {
        height: 32px !important;
        /* Slightly smaller logo on mobile */
    }

    /* Right side container */
    .navbar>div:last-child {
        order: 2;
    }

    /* Nav Links as Mobile Dropdown */
    .nav-links {
        display: none !important;
        /* Force hide unless active */
        position: fixed;
        top: 65px;
        left: 0;
        width: 100%;
        height: auto;
        background-color: var(--bg-panel);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 10px 0;
        gap: 0;
        z-index: 9999;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        transform: translateY(-10px);
        /* Start slightly up */
        opacity: 0;
        transition: all 0.3s ease;
    }

    .nav-links.mobile-active {
        display: flex !important;
        /* Override desktop absolute/flex */
        opacity: 1;
        transform: translateY(0);
        left: 0 !important;
        /* Reset desktop centering */
    }

    .nav-link {
        padding: 15px 25px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        color: var(--text-main);
        width: 100%;
        text-align: left;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-link:hover {
        background-color: var(--bg-dark);
        color: var(--accent-primary);
        padding-left: 35px;
    }

    /* Main Container & Layouts */
    .main-container,
    .dashboard-container,
    .grid-section,
    .games-layout,
    .place-container,
    .hero {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Dashboard Header */
    .user-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 25px;
        margin-bottom: 40px;
    }

    .avatar {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }

    /* Games Page (Sidebar + Grid) */
    .games-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--border-color);
        gap: 10px;
        align-items: center;
        width: 100%;
        /* Hide scrollbar */
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox */
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .sidebar-btn {
        width: auto;
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 0.9rem;
        flex-shrink: 0;
        border-radius: 20px;
        /* Pill shape for horizontal scroll */
    }

    .filter-group {
        display: none;
        /* Hide detailed filters on mobile for now, or move to details */
    }

    /* Game Details Page */
    .place-content {
        flex-direction: column;
    }

    .place-thumb {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16/9;
    }

    /* Profile Page Header */
    .profile-header-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .profile-avatar-lg {
        width: 140px;
        height: 140px;
    }

    .profile-main-info {
        width: 100%;
        align-items: center;
    }

    .profile-name-row {
        flex-direction: column;
        gap: 10px;
        justify-content: center;
    }

    .profile-username-lg {
        font-size: 1.8rem;
    }

    .profile-badges-row {
        justify-content: center;
        flex-wrap: wrap;
        margin-top: 10px;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-actions-bar {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        max-width: none;
    }

    /* Catalog Sidebar */
    .catalog-layout {
        /* Assuming Flex or Grid */
        display: flex;
        flex-direction: column;
    }

    .catalog-sidebar {
        /* Similar treatment to Games sidebar */
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
        margin-bottom: 15px;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .catalog-sidebar .sidebar-btn {
        /* Assuming classes match */
        width: auto;
        border-radius: 20px;
    }

    .catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        /* Smaller cards */
        gap: 10px;
    }

    /* Forms & Auth */
    .auth-container {
        padding: 30px 20px;
        width: 90%;
        max-width: 400px;
    }
}

@media (max-width: 480px) {

    /* Small Phone Optimizations */
    .games-grid,
    .games-grid-new {
        grid-template-columns: 1fr;
    }

    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-balance span:not(.currency-icon) {
        display: none;
        /* Hide balance amount if screen too tight? Maybe keep it. */
    }

    /* Actually keep balance, it's small enough */

    .user-toggle {
        padding: 8px 5px;
        /* Reduce padding */
    }

    .user-toggle span {
        display: none;
        /* Hide username in top right, just show avatar */
    }
}


/* Catalog Mobile Fixes */
@media (max-width: 900px) {
    .catalog-sidebar {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        /* Ensure it scrolls if too wide */
        overflow-x: auto;
        padding-bottom: 5px;
        margin-bottom: 15px;
    }

    .catalog-sidebar .sidebar-box {
        display: flex;
        align-items: center;
        width: auto;
        border: none;
        padding: 0;
        background: transparent;
        margin-bottom: 0;
    }

    .catalog-sidebar .sidebar-header {
        display: none;
    }

    .category-list {
        display: flex;
        gap: 10px;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .category-link {
        display: inline-block;
        padding: 6px 14px;
        background: var(--bg-panel);
        border: 1px solid var(--border-color);
        color: var(--text-muted);
        border-radius: 20px;
        white-space: nowrap;
        font-size: 0.85rem;
        transition: 0.2s;
    }

    .category-link.active {
        background: var(--accent-primary);
        color: white;
        border-color: var(--accent-primary);
    }

    .catalog-sidebar .sidebar-btn {
        margin-bottom: 0;
        border-radius: 20px;
        white-space: nowrap;
        height: auto;
        padding: 6px 14px;
        font-size: 0.85rem;
    }

    .pagination-container {
        grid-column: 1 !important;
        width: 100%;
        justify-content: center;
        margin-top: 20px;
    }
}


/* Profile Layout Mobile Fixes */
@media (max-width: 900px) {

    .profile-layout,
    .profile-inventory-layout {
        display: flex !important;
        /* Ensure flex */
        flex-direction: column !important;
        gap: 20px;
    }

    .profile-layout .left-col,
    .profile-layout .right-col,
    .profile-inventory-layout .left-col,
    .profile-inventory-layout .right-col {
        width: 100% !important;
        max-width: none !important;
        flex: auto !important;
    }

    /* Inventory Menu Horizontal Scroll */
    .inventory-menu {
        display: flex;
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 10px;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 15px;
    }

    .inv-header {
        display: none;
    }

    .inv-item {
        white-space: nowrap;
        padding: 8px 16px;
        background: var(--bg-panel);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .inv-item.active {
        background: var(--accent-primary);
        color: white;
        border-color: var(--accent-primary);
    }

    /* Friends Grid Adjustments */
    .friends-grid {
        justify-content: flex-start;
    }
}


/* Game Details Mobile Polish */
@media (max-width: 900px) {
    .stats-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .comment-row {
        flex-direction: column;
    }

    .c-user-col {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 10px;
    }

    .c-avatar {
        width: 40px;
        height: 40px;
        margin-bottom: 0;
    }

    .c-username {
        font-size: 0.9rem;
    }
}

/* Extra Safety for Desktop Navbar: Stop currency from expanding too much */
@media (min-width: 901px) {
    .nav-balance {
        max-width: 200px;
        /* Cap width */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Centering safety removed to prioritize perfect centering */