:root {
    --bg-dark: #070a12;
    --card-bg: #111622;
    --card-hover: #171f30;
    --primary: #0b44a3;
    --accent: #40a2fa;
    --accent-hover: #218fe9;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e2638;
    --border-glow: rgba(64, 162, 250, 0.3);
    --danger: #ef4444;
    --success: #10b981;
    --shadow-smooth: 0 10px 30px -10px rgba(11, 68, 163, 0.22);
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
}

/* Custom clean scrollbars across the site */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(55, 65, 81, 0.82) rgba(10, 14, 22, 0.72);
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 14, 22, 0.72);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb {
    background: rgba(55, 65, 81, 0.82);
    border-radius: 8px;
    border: 1px solid rgba(7, 10, 18, 0.8);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(75, 85, 99, 0.95);
}

/* Translucent select & dropdown styling for the whole site */
select {
    color-scheme: dark;
    background-color: rgba(255, 255, 255, 0.075) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px;
    color: #e2e8f0 !important;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
select:hover {
    background-color: rgba(255, 255, 255, 0.11) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
select:focus {
    border-color: rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08) !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
}
select option, select optgroup {
    /* Native option menus are opaque in many browsers, so keep the fallback neutral instead of navy. */
    background-color: rgba(35, 39, 46, 0.94) !important;
    color: #e2e8f0 !important;
    padding: 10px 14px;
}

.nav-btn {
    color: var(--text-main);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover, .nav-btn.active {
    background: linear-gradient(135deg, #0b44a3, #40a2fa);
    border-color: rgba(64, 162, 250, 0.5);
    color: #fff;
    box-shadow: 0 4px 15px rgba(64, 162, 250, 0.3);
    transform: translateY(-1px);
}

.user-profile {
    margin-top: auto;
    width: 100%;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #64748b;
    transition: border-color 0.2s ease;
}

.user-profile img.frame-status-online { border-color: #3b82f6; }
.user-profile img.frame-status-roblox-online { border-color: #6a9fd4; }
.user-profile img.frame-status-ingame { border-color: #10b981; }
.user-profile img.frame-status-studio { border-color: #f59e0b; }
.user-profile img.frame-status-offline { border-color: #64748b; }

.container {
    max-width: 1240px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Featured Slider */
.slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    border: none;
    margin-bottom: 40px;
    background: transparent;
    /* Bleed wider than container — uses negative margin trick */
    margin-left: -40px;
    margin-right: -40px;
    -webkit-mask-image: none;
    mask-image: none;
}

.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide {
    min-width: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}

/* Fade-out masks on left and right edges */
.slider-container::before,
.slider-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 2;
    pointer-events: none;
}
.slider-container::before {
    left: 0;
    width: clamp(90px, 14vw, 220px);
    background: linear-gradient(to right, var(--bg-dark, #070a12) 0%, rgba(7, 10, 18, 0.82) 28%, rgba(7, 10, 18, 0) 100%);
}
.slider-container::after {
    right: 0;
    width: clamp(90px, 14vw, 220px);
    background: linear-gradient(to left, var(--bg-dark, #070a12) 0%, rgba(7, 10, 18, 0.82) 28%, rgba(7, 10, 18, 0) 100%);
}

.slide-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.88));
    padding: 30px 40px;
}

.slide-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    z-index: 3;
    transition: color 0.2s ease, background 0.2s ease;
}
.slider-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.slider-btn.prev { left: 18px; }
.slider-btn.next { right: 18px; }

/* Categories Accordion */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 25px 0 15px 0;
    cursor: pointer;
    user-select: none;
}

.category-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toggle-icon {
    font-weight: bold;
    color: var(--text-muted);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.game-card {
    background: transparent;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: none;
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    aspect-ratio: 1 / 1;
    container-type: inline-size;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.for-you-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45) !important;
}

.game-card img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 14px;
}

.game-card .info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 33.333%;
    min-height: 33.333%;
    max-height: 33.333%;
    box-sizing: border-box;
    padding: clamp(4px, 3.5cqi, 10px) clamp(6px, 4.5cqi, 12px);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 0 14px 14px;
    background: rgba(8, 12, 20, 0.65);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.game-card:hover .info {
    background: rgba(8, 12, 20, 0.78);
    border-color: rgba(255, 255, 255, 0.18);
}

.game-card .title {
    font-size: clamp(10px, 6.8cqi, 13px);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    color: #fff;
}

.game-card .online {
    font-size: clamp(8px, 5cqi, 11px);
    color: #94a3b8;
    margin-top: clamp(1px, 1.2cqi, 3px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Remove button for favorites on hover */
.fav-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    max-width: 26px;
    max-height: 26px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    z-index: 10;
    padding: 0;
    margin: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.game-card:hover .fav-remove-btn {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.fav-remove-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    transform: scale(1.15);
}

.btn {
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

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

.form-box {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 16px;
    max-width: 500px;
    margin: 40px auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.guest-action-prompt {
    color: var(--text-muted);
    text-align: center;
    padding: 26px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    margin-bottom: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.guest-action-prompt a,
.guest-action-prompt a:visited {
    color: var(--accent);
    text-decoration: none;
}

.guest-action-prompt a:hover,
.guest-action-prompt a:focus-visible {
    color: var(--accent-hover);
}

.guest-action-prompt a strong {
    font-weight: 800;
}

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

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

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(11, 14, 22, 0.6);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.25s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(64, 162, 250, 0.15);
    background: rgba(11, 14, 22, 0.9);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: rgba(11, 14, 22, 0.6);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 14px;
    transition: color 0.2s ease;
}

.checkbox-group label:hover {
    color: var(--accent);
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

/* Pulsing / breathing sign-in button */
@keyframes oauth-pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(64, 162, 250, 0.6), 0 4px 18px rgba(11, 68, 163, 0.35); }
    70%  { box-shadow: 0 0 0 16px rgba(64, 162, 250, 0), 0 4px 18px rgba(11, 68, 163, 0.35); }
    100% { box-shadow: 0 0 0 0 rgba(64, 162, 250, 0), 0 4px 18px rgba(11, 68, 163, 0.35); }
}

@keyframes oauth-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

.oauth-pulse {
    animation: oauth-pulse-ring 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite,
               oauth-breathe 3.2s ease-in-out infinite;
    background: linear-gradient(135deg, #0b44a3, #40a2fa) !important;
    border: 1px solid rgba(64, 162, 250, 0.3) !important;
}

/* Dice random game button */
.dice-btn {
    font-size: 18px;
    line-height: 1;
    padding: 8px 12px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.2s ease, border-color 0.2s ease;
}

.dice-btn:hover {
    transform: rotate(25deg) scale(1.2);
    background: linear-gradient(135deg, #0b44a3, #40a2fa) !important;
    border-color: rgba(64, 162, 250, 0.5) !important;
}

.reviews-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}


/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 650px) {
    .user-profile {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        width: auto;
        justify-content: flex-end;
    }

    .container, .reviews-container {
        padding: 0 12px;
        margin: 15px auto;
    }

    .slider-container {
        margin-bottom: 25px;
        margin-left: -12px;
        margin-right: -12px;
    }

    .slide img {
        height: 220px;
    }

    .slide-info {
        padding: 15px;
    }

    .slide-title {
        font-size: 18px;
    }

    .filter-main-row {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .filter-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
    }

    .filter-actions button {
        width: 100%;
    }

    .trending-list-container {
        overflow-x: auto;
    }

    .trending-list-header, .trending-list-item {
        min-width: 550px;
    }

    .form-box {
        max-width: 95%;
        padding: 20px;
        margin: 20px auto;
    }
}

@media (max-width: 600px) {
    .nav-btn {
        padding: 5px 8px;
        font-size: 12px;
    }

    .user-profile img {
        width: 28px;
        height: 28px;
    }

    .slide img {
        height: 170px;
    }

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

    .game-card .info {
        padding: 8px;
    }

    .game-card .title {
        font-size: 13px;
    }

    .game-card .online {
        font-size: 11px;
    }

    .category-title {
        font-size: 15px;
    }

    .ranges-grid {
        grid-template-columns: 1fr !important;
    }

    .range-inputs {
        flex-direction: row;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* Tablet and phone layout: preserve access to every page control without page-wide overflow. */
@media (max-width: 900px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    .container { width: min(100% - 28px, 100%); padding-left: 0; padding-right: 0; }
    .profile-settings-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .profile-main-layout, .profile-layout, .profile-content-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .profile-left-column, .profile-right-column { min-width: 0; width: 100%; }
    .profile-tab-panel { min-width: 0; overflow-wrap: anywhere; }
    .profile-tabs { overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
    .profile-tab { flex: 0 0 auto; }
    .games-grid, .recommended-grid, .users-grid { grid-template-columns: repeat(auto-fill, minmax(min(180px, 46vw), 1fr)) !important; }
    .trending-list-container, .table-responsive { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    input, select, textarea { max-width: 100%; }
    .modal, .collection-modal-box, .form-box { max-width: min(94vw, 720px); }
}

@media (max-width: 600px) {
    .container { width: calc(100% - 22px); }
    .nav-links { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .nav-links > * { flex: 0 0 auto; }
    .profile-privacy-option { align-items: flex-start !important; flex-direction: column; gap: 8px; }
    .profile-privacy-option select { width: 100%; min-height: 42px; }
    .profile-agent-actions, .profile-agent-actions form, .profile-agent-actions button { width: 100%; }
    .games-grid, .recommended-grid, .users-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
    .profile-stat-grid, .profile-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .settings-toggle-title { min-width: 0; }
}

/* panel content push (scripts/pane-push.js): the old content slides out, the new one slides in from the other side */
.is-push-out { animation: rdash-push-out .12s ease-in both; pointer-events: none; }
.is-push-in { animation: rdash-push-in .28s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes rdash-push-out { to { opacity: 0; transform: translateX(calc(var(--push, 1) * -26px)); } }
@keyframes rdash-push-in { from { opacity: 0; transform: translateX(calc(var(--push, 1) * 30px)); } }
.is-pushed > .market-item-card, .is-pushed > .avatar-card { animation-name: rdash-push-in; animation-duration: .34s; }
@media (prefers-reduced-motion: reduce) { .is-push-out, .is-push-in, .is-pushed > * { animation: none !important; } }
