/* --- THEME VARIABLES --- */
:root {
    --bg-color: #f2f4f5;
    --card-bg: #ffffff;
    --text-main: #393b3d;
    --text-secondary: #555;
    --text-light: #888;
    --border-color: #e3e3e3;
    --border-dark: #ccc;
    --input-bg: #ffffff;
    --nav-secondary-bg: #ffffff;
    --nav-secondary-border: #dadada;
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --btn-cancel-bg: #fff;
    --link-color: #00a2ff;
}

[data-theme='dark'] {
    --bg-color: #191B1D;
    --card-bg: #232527;
    --text-main: #f2f4f5;
    --text-secondary: #bdbebf;
    --text-light: #888;
    --border-color: #393b3d;
    --border-dark: #444;
    --input-bg: #1b1d1f;
    --nav-secondary-bg: #232527;
    --nav-secondary-border: #393b3d;
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --btn-cancel-bg: #393b3d;
    --link-color: #00a2ff;
}

/* --- GLOBAL RESET & TYPOGRAPHY --- */
body {
    margin: 0;
    padding: 0;
    font-family: 'HCo Gotham SSm', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
}

a {
    text-decoration: none;
}

/* --- LAYOUT UTILITIES --- */
.container {
    max-width: 970px;
    margin: 0 auto;
    padding: 20px;
}

/* --- NAVIGATION BAR (.rbx-header) --- */
.rbx-header {
    background-color: #191B1D; /* Roblox Dark Theme */
    height: 55px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    color: white;
    position: relative;
}

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

.rbx-right-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.rbx-left-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.rbx-menu-item {
    text-decoration: none;
    color: white;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
    white-space: nowrap;
}

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

.rbx-btn-logout {
    font-size: 14px;
    background-color: rgba(255,255,255,0.1);
    padding: 6px 12px;
}

.rbx-btn-logout:hover {
    background-color: rgba(255,255,255,0.2);
}

/* --- NAV CURRENCY STATS --- */
.rbx-currency-container {
    display: flex;
    gap: 15px;
    font-weight: 600;
}

.currency-item {
    cursor: pointer;
}

.robux-val { color: #00b06f; }
.tix-val { color: #b8860b; }

/* --- USER PROFILE: HEADER CARD --- */
.profile-header {
    background-color: var(--card-bg);
    padding: 16px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.header-avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 1px solid var(--border-dark);
    overflow: hidden;
    margin-right: 15px;
}

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

.header-username {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-main);
}

/* --- USER PROFILE: BODY CARD --- */
.profile-body {
    background-color: var(--card-bg);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: flex;
    min-height: 400px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.body-avatar-view {
    width: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-right: 1px solid var(--border-color);
    padding: 20px;
}

.body-avatar-view img {
    width: 350px;
    object-fit: contain;
}

.body-info-view {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* --- SECTIONS (About, Stats) --- */
.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
}

.about-box {
    white-space: pre-wrap;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 30px;
    overflow-wrap: break-word;
}

/* --- STATISTICS GRID --- */
.stats-container {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.stat-grid {
    display: flex;
    gap: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    color: var(--text-main);
    font-weight: 400;
    margin-top: 2px;
}

.robux-text { color: #00b06f; font-weight: 600; }
.tix-text { color: #b8860b; font-weight: 600; }

/* --- DASHBOARD SPECIFIC --- */
.avatar-circle {
    border-radius: 50%;
    border: 1px solid var(--border-dark);
    object-fit: cover;
}

/* --- BADGES SECTION --- */
.badges-placeholder {
    padding: 20px;
    text-align: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 25px;
}

/* --- SEPARATE BADGES CONTAINER --- */
.profile-badges-section {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

/* --- AVATAR EDITOR PAGE --- */
.avatar-editor-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    align-items: flex-start;
}

.editor-left {
    width: 300px;
    background: var(--card-bg);
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    position: sticky;
    top: 20px;
    border: 1px solid var(--border-color);
}

.editor-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.editor-tab {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    padding-bottom: 5px;
}

.editor-tab:hover {
    color: var(--text-main);
}

.editor-tab.active {
    border-bottom: 3px solid var(--text-main);
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.editor-btn {
    background: var(--input-bg);
    border: 1px solid var(--border-dark);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-main);
}

.editor-search {
    padding: 8px;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    flex: 1;
    background: var(--input-bg);
    color: var(--text-main);
}

.item-grid-container {
    min-height: 400px;
}

.empty-items-box {
    background-color: var(--card-bg);
    border-radius: 4px;
    padding: 50px;
    text-align: center;
    color: var(--text-light);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

/* --- BODY COLOR EDITOR --- */
.body-editor-wrapper {
    display: none;
    gap: 30px;
}

.paper-doll {
    display: grid;
    grid-template-columns: 50px 50px 50px 50px;
    grid-template-rows: 60px 100px 100px;
    gap: 4px;
    width: fit-content;
    margin: 0 auto;
}

.doll-part {
    background-color: var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.part-head {
    grid-column: 2 / span 2;
    grid-row: 1;
    width: 50px;
    height: 50px;
    margin: auto;
    border-radius: 12px;
}

.part-larm { grid-column: 1; grid-row: 2; }
.part-torso { grid-column: 2 / span 2; grid-row: 2; }
.part-rarm { grid-column: 4; grid-row: 2; }
.part-lleg { grid-column: 2; grid-row: 3; }
.part-rleg { grid-column: 3; grid-row: 3; }

.doll-part:hover { filter: brightness(0.9); }
.doll-part.selected {
    border-color: #00a2ff;
    box-shadow: 0 0 10px rgba(0, 162, 255, 0.4);
    z-index: 10;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
    margin-top: 20px;
    background: #232527; /* Palette always stays dark for swatches */
    padding: 20px;
    border-radius: 8px;
}

.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.1s;
}

.color-swatch:hover { transform: scale(1.2); border-color: white; }

/* --- ITEM CARDS --- */
.item-card {
    width: 100px;
    display: inline-block;
    vertical-align: top;
    margin: 5px;
    cursor: pointer;
    text-align: center;
    position: relative;
}

.wearing-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background-color: #00b06f;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.item-card img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

.item-card img:hover { border-color: #00a2ff; }

.item-name {
    font-size: 12px;
    color: var(--text-main);
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 3D VIEWER CONTAINER --- */
#render-container {
    position: relative;
    width: 100%;
    min-height: 350px;
    border-radius: 4px;
    background-color: var(--border-color);
    overflow: hidden;
}

#render-container canvas { display: block; width: 100%; height: 100%; }

.render-toggle-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.render-toggle-bar button {
    background-color: var(--text-main);
    color: var(--card-bg);
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.render-toggle-bar button:hover { opacity: 0.8; }
.render-toggle-bar button.active { background-color: #00a2ff; color: white; }

/* --- GAMES PAGE --- */
.games-page-container { background-color: var(--bg-color); }
.games-main-wrapper { max-width: 1200px; margin: 0 auto; display: flex; gap: 20px; }
.games-list-container { flex: 1; }
.games-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.games-filter-header h2 { font-size: 20px; font-weight: 400; color: var(--text-main); margin: 0; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; margin-bottom: 40px; }

.game-item-card {
    background: var(--card-bg);
    padding: 0;
    border: 1px solid var(--card-bg);
    text-decoration: none;
    transition: border 0.1s;
    display: block;
}

.game-item-visits { display: none; font-size: 11px; color: var(--text-light); margin-top: 2px; }
.game-item-card:hover { border: 1px solid var(--border-dark); }
.show-visits-on-hover .game-item-card:hover .game-item-visits { display: block; }

.game-item-thumb {
    width: 100%;
    aspect-ratio: 1/1;
    background-color: var(--border-color);
    overflow: hidden;
    position: relative;
}

.game-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.game-item-card:hover .game-item-thumb::after {
    content: '▶';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.1);
    color: white;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-item-details { min-height: 58px; padding: 8px 5px; }
.game-item-name { font-size: 14px; font-weight: 700; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.game-item-creator { font-size: 11px; color: var(--text-light); margin-bottom: 5px; }
.game-item-creator a { color: #00a2ff; }
.game-item-stats { font-size: 11px; color: var(--text-light); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }

.game-vote-bar { width: 100%; height: 3px; background-color: #d32f2f; border-radius: 1px; overflow: hidden; margin-top: 5px; }
.game-vote-fill { height: 100%; background-color: #00b06f; }

.ad-box {
    width: 300px; height: 250px; background-color: var(--border-color);
    margin-bottom: 20px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); position: relative;
}

.ad-img { width: 100%; height: 100%; object-fit: cover; }
.ad-label { position: absolute; bottom: 0; right: 0; background: rgba(0,0,0,0.5); color: white; font-size: 10px; padding: 2px 4px; }

.game-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.game-row-title { font-size: 24px; font-weight: 400; color: var(--text-main); }
.see-all-btn { font-size: 14px; color: #00a2ff; text-decoration: none; font-weight: 500; }
.see-all-btn:hover { text-decoration: underline; }

.game-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 30px; justify-content: flex-start; }
.game-card { width: 196px; cursor: pointer; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.game-thumb-container { width: 196px; height: 110px; border-radius: 3px; overflow: hidden; position: relative; box-shadow: 0 1px 2px rgba(0,0,0,0.1); background: var(--card-bg); margin-bottom: 5px; }
.game-thumb-container img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s; }
.game-card:hover .game-thumb-container img { opacity: 0.8; }
.game-title { font-size: 14px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; text-align: left; }
.game-card:hover .game-title { color: #00a2ff; text-decoration: underline; }
.game-stats { font-size: 11px; color: var(--text-light); margin-bottom: 4px; text-align: left; }

.rating-bar-container { width: 100%; height: 4px; background-color: var(--border-dark); border-radius: 2px; overflow: hidden; }
.rating-bar-fill { height: 100%; background-color: var(--text-main); }

/* --- SECONDARY NAVIGATION --- */
.rbx-subheader {
    background-color: var(--nav-secondary-bg);
    border-bottom: 1px solid var(--nav-secondary-border);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.rbx-sub-nav-links { display: flex; gap: 25px; }
.rbx-sub-menu-item { text-decoration: none; color: var(--text-main); font-size: 14px; font-weight: 500; padding: 8px 5px; border-bottom: 2px solid transparent; transition: all 0.2s; }
.rbx-sub-menu-item:hover { color: #00a2ff; border-bottom: 2px solid #00a2ff; }

/* --- CATALOG PAGE --- */
.catalog-container { display: flex; gap: 20px; margin-top: 20px; }
.catalog-sidebar { width: 180px; flex-shrink: 0; font-size: 14px; }
.catalog-header { font-size: 24px; font-weight: 700; margin-bottom: 15px; color: var(--text-main); }
.filter-group { margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.filter-header { font-weight: 700; color: var(--text-main); margin-bottom: 5px; cursor: pointer; }
.filter-options { list-style: none; padding-left: 10px; margin: 0; }
.filter-options li a { text-decoration: none; color: #00a2ff; font-size: 13px; line-height: 1.8; }
.filter-options li a:hover { text-decoration: underline; }
.filter-options li a.active { font-weight: bold; color: var(--text-main); }

.catalog-search { width: 100%; padding: 6px; border: 1px solid var(--border-dark); border-radius: 3px; margin-bottom: 15px; background: var(--input-bg); color: var(--text-main); }
.catalog-results { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.catalog-card { width: 150px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 3px; text-decoration: none; color: inherit; display: flex; flex-direction: column; overflow: hidden; }
.catalog-card:hover { box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.card-thumb { width: 150px; height: 150px; background: var(--bg-color); position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-info { padding: 8px; font-size: 12px; }

.card-title {
    color: #00a2ff; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 32px; line-height: 1.3; margin-bottom: 2px;
}
.catalog-card:hover .card-title { text-decoration: underline; }
.card-creator { color: var(--text-light); margin-bottom: 5px; font-size: 11px; }
.card-price { font-weight: 700; font-size: 12px; }
.price-robux { color: #00b06f; }
.price-tix { color: #b8860b; }
.price-free { color: var(--text-main); }

.item-purchase-area { background: var(--bg-color); border: 1px solid var(--border-color); padding: 15px; border-radius: 4px; margin-bottom: 20px; }
.buy-btn { display: block; width: 100%; padding: 10px; text-align: center; border-radius: 4px; font-weight: 700; font-size: 16px; color: white; margin-bottom: 5px; cursor: pointer; border: 1px solid transparent; }
.buy-btn-robux { background-color: #00b06f; border-color: #008c59; }
.buy-btn-robux:hover { background-color: #008c59; }
.buy-btn-tix { background-color: #b8860b; border-color: #966e09; }
.buy-btn-tix:hover { background-color: #966e09; }
.item-stat-grid { display: flex; gap: 20px; margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 10px; }

.sub-options { list-style: none; padding-left: 15px; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.sub-options li a { font-size: 12px; color: var(--text-secondary); text-decoration: none; }
.sub-options li a:hover { color: #00a2ff; text-decoration: underline; }
.sub-options li a.active { color: var(--text-main); font-weight: bold; }

.card-creator-info { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.creator-headshot { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-color); object-fit: cover; }
.creator-link { font-size: 11px; color: var(--text-light); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.creator-link:hover { color: #00a2ff; text-decoration: underline; }

/* --- MODALS --- */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: var(--modal-overlay); z-index: 1000; justify-content: center; align-items: center; }
.modal-box { background-color: var(--card-bg); width: 400px; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,0.2); overflow: hidden; color: var(--text-main); border: 1px solid var(--border-dark); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border-color); background: var(--card-bg); }
.modal-title { font-size: 22px; font-weight: 400; }
.modal-close { cursor: pointer; font-size: 24px; color: var(--text-main); font-weight: bold; line-height: 1; }
.modal-body { padding: 20px; text-align: center; }
.modal-text { font-size: 15px; margin-bottom: 20px; line-height: 1.4; color: var(--text-secondary); }
.modal-item-preview { width: 110px; height: 110px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 4px; margin: 0 auto 20px auto; display: flex; justify-content: center; align-items: center; position: relative; }
.modal-item-preview img { width: 100%; height: 100%; object-fit: contain; }
.modal-footer { display: flex; justify-content: center; gap: 15px; padding-bottom: 5px; }
.modal-btn { padding: 8px 20px; border-radius: 4px; font-size: 18px; font-weight: 500; cursor: pointer; border: 1px solid transparent; min-width: 110px; color: white; }
.modal-btn-cancel { background-color: var(--btn-cancel-bg); color: var(--text-main); border: 1px solid var(--border-dark); }
.modal-balance-text { font-size: 12px; color: var(--text-light); margin-top: 15px; font-weight: 500; }

.modal-btn.btn-robux { background-color: #00b06f; color: white; border-color: #008c59; }
.modal-btn.btn-tix { background-color: #b8860b; color: white; border-color: #966e09; }
.modal-btn.btn-free { background-color: #00a2ff; color: white; border-color: #0088cc; }

/* --- HOME PAGE --- */
.home-container { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.home-header { display: flex; align-items: center; background: var(--card-bg); padding: 20px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); gap: 20px; border: 1px solid var(--border-color); }
.home-avatar { width: 100px; height: 100px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-color); }
.home-header h1 { margin: 0; font-size: 28px; color: var(--text-main); }
.status-update { margin-top: 10px; display: flex; gap: 10px; }
.status-input { flex: 1; padding: 8px; border: 1px solid var(--border-dark); border-radius: 4px; background: var(--input-bg); color: var(--text-main); }
.home-content-row { display: flex; gap: 20px; }
.home-main-col { flex: 1; }
.home-side-col { width: 300px; }
.home-section { background: var(--card-bg); padding: 15px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; border: 1px solid var(--border-color); }
.home-section-title { font-size: 18px; font-weight: 700; margin-bottom: 15px; display: flex; justify-content: space-between; color: var(--text-main); }

.friends-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; }
.friend-card { text-align: center; text-decoration: none; }
.friend-card img { width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--border-color); background: var(--bg-color); }
.friend-name { display: block; font-size: 12px; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 5px; }

/* --- FRIENDS PAGE --- */
.friends-content { background-color: var(--card-bg); padding: 20px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--border-color); }
.friends-tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.friends-tab { padding-bottom: 10px; font-size: 16px; font-weight: 600; color: var(--text-light); text-decoration: none; cursor: pointer; border-bottom: 3px solid transparent; }
.friends-tab.active { color: var(--text-main); border-bottom-color: var(--text-main); }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.user-card { border: 1px solid var(--border-color); border-radius: 4px; padding: 10px; text-align: center; background: var(--card-bg); transition: box-shadow 0.2s; }
.user-card img { width: 100px; height: 100px; border-radius: 50%; margin-bottom: 10px; border: 1px solid var(--border-color); }
.user-card-name { display: block; font-weight: 700; font-size: 14px; color: var(--text-main); margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-actions { display: flex; flex-direction: column; gap: 5px; }

/* --- NAVIGATION DROPDOWN --- */
.rbx-nav-dropdown { position: relative; display: flex; align-items: center; height: 40px; }
.rbx-btn-settings { background: none; border: none; color: white; cursor: pointer; font-size: 18px; padding: 0 10px; height: 100%; display: flex; align-items: center; }
.rbx-dropdown-content { display: none; position: absolute; top: 40px; right: 0; background-color: #191B1D; min-width: 150px; box-shadow: 0px 4px 8px rgba(0,0,0,0.5); z-index: 1000; border-radius: 0 0 4px 4px; border: 1px solid rgba(255,255,255,0.1); border-top: none; }
.rbx-dropdown-content a { color: white; padding: 12px 16px; text-decoration: none; display: block; font-size: 14px; transition: background 0.2s; }
.rbx-dropdown-content a:hover { background-color: rgba(255, 255, 255, 0.1); }
.rbx-nav-dropdown:hover .rbx-dropdown-content { display: block; }

/* --- SETTINGS PAGE --- */
.settings-box { background: var(--card-bg); padding: 25px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.2); max-width: 650px; margin: 40px auto; border: 1px solid var(--border-color); }
.form-section { margin-bottom: 25px; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.form-section:last-child { border-bottom: none; }
.form-label { display: block; font-weight: bold; margin-bottom: 8px; color: var(--text-main); font-size: 14px; }
.settings-box input[type="text"], .settings-box input[type="password"], .settings-box textarea { width: 100%; padding: 10px; border: 1px solid var(--border-dark); border-radius: 3px; box-sizing: border-box; font-size: 14px; background: var(--input-bg); color: var(--text-main); }
.save-btn { display: inline-block; padding: 10px 20px; background-color: #00a2ff; color: white; border: 1px solid #0088cc; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 14px; }
.save-btn.btn-robux { background-color: #00b06f; border-color: #008c59; }

/* --- MISC --- */
.view-toggle-box { background-color: rgba(255, 255, 255, 0.9); border: 1px solid var(--border-dark); border-radius: 4px; padding: 5px 10px; font-size: 13px; font-weight: 700; color: #666; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.rig-switch-container { display: flex; background-color: var(--border-color); padding: 3px; border-radius: 6px; margin-top: 15px; width: 100%; max-width: 200px; }
.rig-option.active { background-color: var(--card-bg); color: #00a2ff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.btn-play { background-color: #00b06f; border: 1px solid #008c59; color: white; font-size: 24px; font-weight: 700; width: 100%; padding: 12px; border-radius: 4px; cursor: pointer; }

.loader-container { width: 100%; height: 10px; background-color: var(--bg-color); border-radius: 5px; overflow: hidden; position: relative; margin: 25px 0; border: 1px solid var(--border-dark); }
.loader-fill { width: 40%; height: 100%; background-color: #00b06f; position: absolute; left: -40%; border-radius: 5px; animation: slide-loader 1.5s infinite ease-in-out; }
@keyframes slide-loader { 0% { left: -40%; } 100% { left: 100%; } }

.game-main-container { background-color: var(--card-bg); padding: 20px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid var(--border-color); }
.game-tabs-container { border-bottom: 1px solid var(--border-color); margin-bottom: 20px; display: flex; gap: 40px; }
.game-tab.active { color: var(--text-main); border-bottom: 3px solid #00a2ff; }
.game-description-text { font-size: 15px; line-height: 1.5; color: var(--text-secondary); white-space: pre-wrap; }

/* --- MESSAGES --- */
.messages-main { flex: 1; background: var(--card-bg); border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); min-height: 400px; border: 1px solid var(--border-color); }
.msg-list-item { display: flex; padding: 12px; border-bottom: 1px solid var(--border-color); text-decoration: none; color: var(--text-main); align-items: center; }
.msg-list-item:hover { background: var(--bg-color); }
.msg-unread { background: var(--nav-secondary-bg); font-weight: bold; }
.redraw-text { font-size: 12px; color: #888; margin-top: 10px; text-align: center; }
        .redraw-link { color: #00a2ff; cursor: pointer; text-decoration: none; }
        .redraw-link:hover { text-decoration: underline; }

        /* Viewer Container Sizing */
        .viewer-container { position: relative; width: 100%; border-radius: 4px; overflow: hidden; }
        #viewer-2d img { width: 100%; display: block; }
        
        #viewer-3d-wrapper {
            position: relative; width: 100%; padding-bottom: 100%; display: none;
        }
        #viewer-3d-wrapper iframe {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none;
        }

        /* Overlay Controls */
        .render-controls-overlay { position: absolute; bottom: 10px; right: 10px; z-index: 100; }
        .view-toggle-box {
            background-color: rgba(255, 255, 255, 0.9); border: 1px solid #dcdcdc;
            border-radius: 4px; padding: 5px 10px; font-size: 13px; font-weight: 700;
            color: #666; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }

        /* Rig Switcher */
        .rig-switch-container {
            display: flex; background-color: #e3e3e3; padding: 3px;
            border-radius: 6px; margin-top: 15px; width: 100%; max-width: 200px;
        }
        .rig-option {
            flex: 1; padding: 6px 0; text-align: center; font-size: 13px;
            font-weight: 700; color: #666; cursor: pointer; border-radius: 4px;
        }
        .rig-option.active { background-color: #ffffff; color: #00a2ff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
        .btn-create { background: #00b06f; color: white; border: none; padding: 8px 20px; border-radius: 3px; cursor: pointer; }
        .btn-cancel { background: #ccc; color: white; border: none; padding: 8px 20px; border-radius: 3px; cursor: pointer; }

/* --- 2017 GAME PAGE LAYOUT --- */
.game-main-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.game-top-section {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.game-media {
    flex: 1.5; /* Larger area for the image */
}

.game-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.game-info-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-title-header {
    font-size: 32px;
    font-weight: 400;
    color: var(--text-main);
    margin: 0;
}

.game-creator-link {
    font-size: 14px;
    color: #888;
    margin: 5px 0 20px 0;
}

.game-creator-link a {
    color: #00a2ff;
    text-decoration: none;
}

/* --- TABS SYSTEM --- */
.game-tabs-container {
    border-bottom: 1px solid #e3e3e3;
    margin-bottom: 20px;
    display: flex;
    gap: 40px;
}

.game-tab {
    padding: 10px 5px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.game-tab:hover {
    color: var(--text-main);
}

.game-tab.active {
    color: var(--text-main);
    border-bottom: 3px solid #00a2ff; /* Active blue line */
}

/* --- DESCRIPTION SECTION --- */
.game-description-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-main);
}

.game-description-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-main);
    white-space: pre-wrap;
}

.game-stats-list {
    margin-top: 30px;
    display: flex;
    border-top: 1px solid #eee;
    padding-top: 15px;
    gap: 40px;
}
/* --- BROWSE / PEOPLE PAGE --- */
.search-container {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-input-large {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

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

.browse-user-card {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e3e3e3;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s;
}

.browse-user-card:hover {
    background-color: var(--card-bg);
    border-color: #00a2ff;
}

.browse-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 1px solid #eee;
    margin-right: 20px;
    flex-shrink: 0;
}

.browse-info {
    flex: 1;
    min-width: 0; /* Allows text truncation to work */
}

.browse-username {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.browse-user-card:hover .browse-username {
    background-color: var(--card-bg);
    text-decoration: underline;
}

.browse-blurb {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* --- PAGINATION STYLES --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 10px;
}

.page-btn {
    background-color: white;
    border: 1px solid #ccc;
    padding: 5px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
    color: #393b3d;
}

.page-btn:disabled {
    background-color: #f5f5f5;
    color: #ccc;
    cursor: default;
}

.page-info {
    font-size: 14px;
    color: #666;
}

/* --- LOGIN & REGISTER PAGES --- */
.auth-wrapper {
    max-width: 400px;
    margin: 60px auto;
    background-color: white;
    padding: 35px;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.auth-title {
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 25px;
    color: #393b3d;
}

.auth-form-group {
    margin-bottom: 15px;
}

.auth-label {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #393b3d;
    margin-bottom: 5px;
}

.auth-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #c3c3c3;
    border-radius: 3px;
    box-sizing: border-box; /* Prevents input from sticking out */
    font-size: 16px;
}

.auth-input:focus {
    border-color: #00a2ff;
    outline: none;
}

.auth-btn {
    width: 100%;
    background-color: #00a2ff;
    color: white;
    border: 1px solid #0088cc;
    padding: 12px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
}

.auth-btn:hover {
    background-color: #0088cc;
}

.auth-message {
    background-color: #fff1f1;
    border: 1px solid #ffcaca;
    color: #d8000c;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-link {
    color: #00a2ff;
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}
       .admin-dashboard { display: flex; gap: 20px; justify-content: center; margin-top: 50px; }
        .admin-card {
            background-color: var(--card-bg); width: 300px; padding: 30px;
            border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            text-align: center; text-decoration: none; color: var(--text-main);
            transition: transform 0.2s;
        }
        .admin-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.15); }
        .admin-card h2 { margin-top: 0; color: #00a2ff; }
/* --- LOGO --- */

        .edit-container { background-color: var(--card-bg);  padding: 25px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.2); max-width: 600px; margin: 40px auto; }
        .form-group { margin-bottom: 20px; }
        .form-group label { display: block; font-weight: bold; margin-bottom: 8px; font-size: 14px; }
        .form-group input[type="text"], .form-group input[type="number"], .form-group textarea {
            width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 3px; box-sizing: border-box;
        }
        .checkbox-group { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: bold; margin-bottom:10px; }
        .checkbox-group input { width: 18px; height: 18px; }
        .admin-badge { background: #ff4444; color: white; padding: 2px 6px; border-radius: 3px; font-size: 11px; vertical-align: middle; margin-left: 10px; }

        .create-box { background-color: var(--card-bg); padding: 25px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); max-width: 500px; margin: 40px auto; }
        .form-group { margin-bottom: 15px; }
        label { display: block; font-weight: bold; margin-bottom: 5px; }
        input[type="text"], textarea, select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 3px; box-sizing: border-box; }
        .upload-btn { background: #00a2ff; color: white; border: none; padding: 10px 20px; border-radius: 3px; cursor: pointer; font-weight: bold; width: 100%; margin-top: 10px; }
        .hint { font-size: 11px; color: #888; margin-top: 5px; }
.rbx-logo-img { height: 45px; width: auto; max-width: 150px; display: block; }

