:root {
    --c-bg:           #222;
    --c-panel:        #2b2b2b;
    --c-surface:      #2f2f2f;
    --c-surface-alt:  #3a3a3a;
    --c-card:         #383838;
    --c-surface-deep: #1f1f1f;
    --c-square:       #333;
    --c-hover:        #4a4a4a;
    --c-active:       #454545;
    --c-border:       #444;
    --c-border-subtle:#4b4b4b;
    --c-btn-icon:     #2a2a2a;
    --c-btn-secondary:#555;
    --c-input-bg:     #3a3a3a;
    --c-game-display: #3f3f3f;
    --c-game-left:    #2d2d2d;
    --c-game-desc:    #353535;
    --c-text:         white;
    --c-text-dim:     #cfcfcf;
    --c-text-muted:   #aaa;
    --c-text-label:   #bdbdbd;
    --c-text-placeholder: #d0d0d0;
    --c-warning:      #ffd580;
    --c-primary:      #0077cc;
    --c-play:         #4c78d6;
    --c-category-bg:  #1C1C1C;
    --c-header:       #141414;
}

[data-theme="light"] {
    --c-bg:           #eeeeee;
    --c-panel:        #d8d8d8;
    --c-surface:      #d1d1d1;
    --c-surface-alt:  #cdcdcd;
    --c-card:         #dddddd;
    --c-surface-deep: #ffffff;
    --c-square:       #dddddd;
    --c-hover:        #b8b8b8;
    --c-active:       #b0b0b0;
    --c-border:       #aaaaaa;
    --c-border-subtle:#bbbbbb;
    --c-btn-icon:     #b8b8b8;
    --c-btn-secondary:#888888;
    --c-input-bg:     #d0d0d0;
    --c-game-display: #d5d5d5;
    --c-game-left:    #cccccc;
    --c-game-desc:    #d2d2d2;
    --c-text:         #111111;
    --c-text-dim:     #444444;
    --c-text-muted:   #666666;
    --c-text-label:   #555555;
    --c-text-placeholder: #666666;
    --c-warning:      #cc8800;
    --c-primary:      #0077cc;
    --c-play:         #4c78d6;
    --c-category-bg:  #e0e0e0;
    --c-header:       #d8d8d8;
}

html, body {
    height: auto;
    min-height: 100%;
}

body {
            background-color: var(--c-bg);
            color: var(--c-text);
            font-family: Arial, sans-serif;
            text-align: center;
            margin: 0;
            padding: 0;
        }

        h1 {
            font-size: 50px;
            margin-top: 0px;
            margin-bottom: 0px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            position: relative;
        }

        #homeLink {
            position: absolute;
            left: 10px;
            top: 10px;
            width: 50px;
            height: 50px;
        }

        #homeLink img {
            width: 75px;
            height: 75px;
        }

        #header {
            background-color: var(--c-header) !important;
        }

        #categoryHeader {
            background-color: var(--c-category-bg) !important;
        }

        #accountCard {
            background: var(--c-surface);
        }

        #screenAccount {
            background: var(--c-bg);
        }

        #icon {
            background-color: transparent;
            border: none;
        }

        .category {
            height: 40px;
            background-color: transparent;
            color: var(--c-text);
            font-weight: bold;
            text-transform: uppercase;
            border-top: none;
            border-bottom: none;
            padding: 10px 20px;
            cursor: pointer;
        }

        .category:hover {
            background-color: var(--c-square);
        }

        .category.active {
            background-color: var(--c-hover);
            border-bottom: 2px solid var(--c-text);
        }

        #friendRow {
            display: flex;
            flex-wrap: nowrap;
            gap: 25px;
            padding: 20px;
            overflow-x: auto;
            cursor: grab;
            user-select: none;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        #friendRow::-webkit-scrollbar {
            display: none;
        }
        #friendRow.dragging {
            cursor: grabbing;
        }

        .friendSquare {
            width: 180px;
            flex-shrink: 0;
            background-color: var(--c-square);
            border-radius: 10px;
            padding: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
        }

        .friendSquare img {
            width: 90%;
            border-radius: 8px;
        }

        .friendSquare p {
            margin: 10px 0;
            font-size: 16px;
            text-transform: uppercase;
            font-weight: bold;
        }

        .friendButton1 {
            width: 65%;
            height: 70%;
            background-color: var(--c-primary);
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .friendButton1 img {
            height: 100%;
            width: auto;
        }

        .friendSettings {
            width: 25%;
            height: 70%;
            background-color: var(--c-btn-secondary);
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .friendSettings img {
            height: 100%;
            width: auto;
        }

        #gameSquares {
            display: grid;
            grid-template-columns: repeat(auto-fill, 180px);
            justify-content: start;
            gap: 25px;
            padding: 20px;
        }

        .gameSquare {
            width: 180px;
            background-color: var(--c-square);
            border-radius: 10px;
            padding: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
        }

        .gameSquare img {
            width: 90%;
            border-radius: 8px;
        }

        .gameSquare p {
            margin: 10px 0;
            font-size: 16px;
            text-transform: uppercase;
            font-weight: bold;
        }

        .buttonBar {
            width: 90%;
            height: 40px;
            border-radius: 6px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 10px;
            box-sizing: border-box;
        }

        .playGame {
            width: 65%;
            height: 70%;
            background-color: #009900;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .playGame img {
            height: 100%;
            width: auto;
        }

        .settingsGame {
            width: 25%;
            height: 70%;
            background-color: var(--c-btn-secondary);
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .settingsGame img {
            height: 100%;
            width: auto;
        }

        #screenMessages {
            display: grid;
            grid-template-columns: 280px minmax(0, 1fr) 300px;
            height: calc(100vh - 70px);
            min-height: 500px;
            background-color: var(--c-panel);
            border-top: 1px solid var(--c-border);
        }

        #messageFriendList,
        #friendSearchPanel {
            background-color: var(--c-surface);
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            border-right: 1px solid var(--c-border);
        }

        .messageList,
        .searchUserRow,
        .friendRequestRow,
        .friendPanelRow {
            width: 100%;
            min-height: 78px;
            background-color: transparent;
            display: grid;
            grid-template-columns: 70px minmax(0, 1fr);
            grid-template-areas:
                "pfp username"
                "pfp bottom";
            border-bottom: 1px solid var(--c-border-subtle);
            cursor: pointer;
            padding: 8px 10px;
            box-sizing: border-box;
            transition: background-color .15s ease;
        }

        .messageList:hover,
        .searchUserRow:hover,
        .friendRequestRow:hover,
        .friendPanelRow:hover {
            background-color: var(--c-surface-alt);
        }

        .messageList.active {
            background-color: var(--c-active);
        }

        .messageList img,
        .searchUserRow img,
        .friendRequestRow img,
        .friendPanelRow img {
            grid-area: pfp;
            width: 52px;
            height: 52px;
            margin: auto;
            border-radius: 50%;
            object-fit: cover;
            background-color: #666;
        }

        .messageList h4,
        .searchUserRow h4,
        .friendRequestRow h4,
        .friendPanelRow h4 {
            grid-area: username;
            margin: 0;
            display: flex;
            align-items: center;
            padding-left: 6px;
            font-size: 17px;
            font-weight: bold;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            background-color: transparent;
        }

        .messageBottomRow {
            grid-area: bottom;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 10px;
            padding: 0 6px;
            background-color: transparent;
            min-width: 0;
        }

        .messageLevel,
        .messageStatus {
            font-size: 13px;
            color: var(--c-text-dim);
            white-space: nowrap;
        }

        .messageStatus {
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
        }

        #rightMessageSide {
            display: grid;
            grid-template-rows: 80px minmax(0, 1fr) 70px;
            background-color: var(--c-surface-alt);
            min-width: 0;

            height: 100%;
            overflow: hidden;
        }

        #rightMessageHeader {
            background-color: var(--c-bg);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            color: var(--c-text);
            border-bottom: 1px solid var(--c-border);
            gap: 10px;
        }

        #activeChatName {
            margin: 0;
            font-size: 24px;
            text-align: left;
        }

        #rightMessageBody {
            padding: 15px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 10px;
            min-width: 0;
            min-height: 0;
        }
        #rightMessageBody::-webkit-scrollbar {
            display: none;
        }

        .message {
            max-width: 60%;
            padding: 10px 14px;
            border-radius: 12px;
            color: var(--c-text);
            text-align: left;
            word-break: break-word;
        }

        .incoming {
            background-color: var(--c-hover);
            align-self: flex-start;
        }

        .outgoing {
            background-color: var(--c-primary);
            color: white;
            align-self: flex-end;
        }

        .messagePlaceholder {
            margin: auto;
            color: var(--c-text-placeholder);
            font-size: 18px;
            opacity: .8;
        }

        #rightMessageInput {
            background-color: var(--c-bg);
            display: flex;
            padding: 12px;
            gap: 10px;
            border-top: 1px solid var(--c-border);
            box-sizing: border-box;
        }

        #messageInput,
        #friendSearchInput,
        #loginEmail,
        #loginPassword,
        #signUpEmail,
        #signUpPassword,
        #signUpUsername,
        #signUpDisplayName {
            flex: 1;
            padding: 12px;
            border-radius: 6px;
            border: 1px solid var(--c-border);
            outline: none;
            font-size: 15px;
            box-sizing: border-box;
            background-color: var(--c-input-bg);
            color: var(--c-text);
        }

        #sendMessageButton,
        .panelButton {
            padding: 10px 20px;
            background-color: #0077cc;
            border: none;
            border-radius: 6px;
            color: white;
            cursor: pointer;
            font-weight: bold;
        }

        #sendMessageButton:disabled,
        #messageInput:disabled {
            opacity: .5;
            cursor: not-allowed;
        }

        #friendSearchPanel {
            border-right: none;
            border-left: 1px solid var(--c-border);
            padding: 12px;
            box-sizing: border-box;
            gap: 12px;
        }

        .panelCard {
            background: var(--c-card);
            padding: 12px;
            border-radius: 10px;
            text-align: left;
        }

        .panelCard h3 {
            margin-top: 0;
        }

        .searchActions {
            display: flex;
            gap: 8px;
            align-items: center;
            margin-top: 8px;
            margin-bottom: 8px;
        }

        #authOverlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, .82);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }

        #authCard {
            width: min(500px, 92vw);
            background: var(--c-surface);
            border-radius: 16px;
            padding: 20px;
            box-sizing: border-box;
            display: grid;
            gap: 16px;
        }

        .authSection {
            background: var(--c-surface-alt);
            padding: 14px;
            border-radius: 10px;
            display: grid;
            gap: 10px;
        }

        #authStatus {
            color: var(--c-warning);
            text-align: left;
            min-height: 20px;
        }

        .miniButton {
            padding: 6px 10px;
            background-color: #0077cc;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
        }

        #refreshEverything {
            flex-shrink: 0;
        }

        #logoMenuPanel {
            position: fixed;
            top: 70px;
            left: 12px;
            width: 300px;
            background: var(--c-surface-deep);
            border: 1px solid var(--c-border);
            border-radius: 14px;
            box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
            z-index: 9998;
            padding: 12px;
            box-sizing: border-box;
            display: none;
            text-align: left;
        }

        #logoMenuPanel.open {
            display: block;
        }

        .logoMenuSection {
            background: var(--c-panel);
            border-radius: 10px;
            padding: 10px;
            margin-bottom: 10px;
        }

        .logoMenuSection:last-child {
            margin-bottom: 0;
        }

        .logoMenuTitle {
            margin: 0 0 8px 0;
            font-size: 14px;
            text-transform: uppercase;
            color: var(--c-text-label);
            letter-spacing: 1px;
        }

        .logoMenuButton,
        .quickChatRow {
            width: 100%;
            background: var(--c-card);
            border: none;
            color: var(--c-text);
            border-radius: 8px;
            padding: 10px 12px;
            cursor: pointer;
            text-align: left;
            box-sizing: border-box;
            margin-bottom: 8px;
            transition: background-color .15s ease;
        }

        .logoMenuButton:hover,
        .quickChatRow:hover {
            background: var(--c-hover);
        }

        .logoMenuButton:last-child,
        .quickChatRow:last-child {
            margin-bottom: 0;
        }

        .quickChatName {
            font-weight: bold;
            font-size: 15px;
            margin-bottom: 3px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .quickChatPreview {
            font-size: 12px;
            color: var(--c-text-dim);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .quickChatEmpty {
            color: var(--c-text-label);
            font-size: 13px;
            padding: 4px 2px;
        }

        #notifMenuPanel {
            position: fixed;
            top: 70px;
            right: 12px;
            width: 300px;
            max-height: calc(100vh - 90px);
            overflow-y: auto;
            background: var(--c-surface-deep);
            border: 1px solid var(--c-border);
            border-radius: 14px;
            box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
            z-index: 9998;
            padding: 12px;
            box-sizing: border-box;
            display: none;
            text-align: left;
        }

        #notifMenuPanel.open {
            display: block;
        }

        .notifMenuSection {
            background: var(--c-panel);
            border-radius: 10px;
            padding: 10px;
            margin-bottom: 10px;
        }

        .notifMenuSection:last-child {
            margin-bottom: 0;
        }

        .notifMenuTitle {
            margin: 0 0 8px 0;
            font-size: 14px;
            text-transform: uppercase;
            color: var(--c-text-label);
            letter-spacing: 1px;
        }

        .notifMenuButton,
        .quickChatRow {
            width: 100%;
            background: var(--c-card);
            border: none;
            color: var(--c-text);
            border-radius: 8px;
            padding: 10px 12px;
            cursor: pointer;
            text-align: left;
            box-sizing: border-box;
            margin-bottom: 8px;
            transition: background-color .15s ease;
        }

        .notifMenuButton:hover,
        .quickChatRow:hover {
            background: var(--c-hover);
        }

        .notifMenuButton:last-child,
        .quickChatRow:last-child {
            margin-bottom: 0;
        }

        .notifItem {
            width: 100%;
            background: var(--c-card);
            border: none;
            color: var(--c-text);
            border-radius: 8px;
            padding: 10px 12px;
            cursor: pointer;
            text-align: left;
            box-sizing: border-box;
            margin-bottom: 8px;
            transition: background-color .15s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .notifItem:hover {
            background: var(--c-hover);
        }

        .notifItemText {
            flex: 1;
            min-width: 0;
        }

        .notifName {
            font-weight: bold;
            font-size: 15px;
            margin-bottom: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .notifSub {
            font-size: 12px;
            color: var(--c-text-dim);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .notifGameUpdate {
            cursor: default;
        }

        .notifGameUpdate:hover {
            background: var(--c-card);
        }

        .notifSeen .notifName,
        .notifSeen .notifSub {
            opacity: 0.5;
        }

        .notifDeleteBtn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            flex-shrink: 0;
            opacity: 0.4;
            transition: opacity 0.15s;
            display: flex;
            align-items: center;
            color: var(--c-text);
        }

        .notifDeleteBtn:hover {
            opacity: 1;
        }

        .notifDeleteBtn .icon {
            width: 16px;
            height: 16px;
        }

        .notifEmpty {
            color: var(--c-text-label);
            font-size: 13px;
            padding: 4px 2px;
        }
#profileOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

#profileOverlay.open {
    display: flex;
}

#profileCard {
    position: relative;
    width: min(460px, 92vw);
    background: var(--c-surface);
    border-radius: 16px;
    padding: 28px 24px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
}

#closeProfile {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

#profilePhoto {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    background: #666;
}

#profileDisplayName {
    margin: 0;
    font-size: 26px;
    font-weight: bold;
}

#profileUsername {
    margin: 0;
    color: var(--c-text-muted);
    font-size: 14px;
}

#profileLevelRow {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 13px;
    color: var(--c-text-dim);
}

#profileXpBar {
    flex: 1;
}

#profileStats {
    display: flex;
    gap: 0;
    width: 100%;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    padding: 12px 0;
}

.profileStat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border-right: 1px solid var(--c-border);
}

.profileStat:last-child {
    border-right: none;
}

.profileStatValue {
    font-size: 18px;
    font-weight: bold;
}

.profileStatLabel {
    font-size: 12px;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#profileActions {
    display: flex;
    gap: 10px;
    width: 100%;
}

#profileActions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
}

#reportOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

#reportOverlay.open {
    display: flex;
}

#reportCard {
    position: relative;
    width: min(480px, 92vw);
    background: var(--c-surface);
    border-radius: 16px;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: white;
    font-family: Arial, sans-serif;
}

#closeReport {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

#reportDetails {
    width: 100%;
    min-height: 90px;
    background: var(--c-input-bg);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 10px;
    color: var(--c-text);
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}

#cancelReport {
    padding: 10px 20px;
    background: var(--c-btn-secondary);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

#reportStatus {
    color: var(--c-warning);
    min-height: 20px;
    font-size: 14px;
}

#gameDisplay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
}

#gameDisplayPanel {
    position: relative;
    width: 70vw;
    max-width: 1200px;
    height: 80vh;
    max-height: 850px;
    background-color: var(--c-game-display);
    border-radius: 18px;
    box-shadow: 0 0 30px rgba(0,0,0,.45);
    overflow: hidden;
    display: flex;
    color: var(--c-text);
    font-family: Arial, sans-serif;
}

#closeGameDisplay {
    position: absolute;
    top: 0px;
    right: 0px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: none;
    color: white;
    font-size: 26px;
    cursor: pointer;
    z-index: 2;
}

#gameDisplayLeft {
    width: 38%;
    min-width: min(320px, 38%);
    height: 100%;
    background: var(--c-game-left);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2.5vw, 30px);
    box-sizing: border-box;
}

#gameDisplayImage {
    width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 0 18px rgba(0,0,0,.35);
}

#gameDisplayRight {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: clamp(14px, 3.5vh, 38px) clamp(10px, 2.5vw, 34px) clamp(10px, 2.5vh, 30px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.5vh, 18px);
}

#gameDisplayTitle {
    margin: 0;
    font-size: clamp(18px, 4vh, 42px);
    line-height: 1.1;
    padding-right: 15px;
}

#creatorLine {
    margin-top: -10px;
    font-size: clamp(11px, 2.2vh, 20px);
}

#gameDisplayActions {
    display: flex;
    align-items: stretch;
    gap: clamp(4px, 0.8vw, 12px);
    height: 10vh;
    min-height: 44px;
    max-height: 80px;
}

#playGameButton {
    flex: 3;
    min-width: 0;
    border: none;
    border-radius: 12px;
    background: var(--c-play);
    color: white;
    font-size: clamp(12px, 1.8vh, 20px);
    font-weight: bold;
    cursor: pointer;
}

#thumbsUpButton,
#thumbsDownButton,
#gameSettingsButton,
#displayFavoriteButton,
#displayBlockButton,
#displayNotifyButton,
#displayShareButton,
#displayStatsButton,
#displayReportButton,
#displayDeleteSaveButton {
    flex: 1;
    min-width: 0;
    border: none;
    background: var(--c-btn-icon);
    color: white;
    border-radius: 10px;
    cursor: pointer;
}

#gameSettingsButton {
    border-radius: 12px;
}

#thumbsUpCount {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(12px, 2.5vh, 35px);
    font-weight: bold;
}

#gameDisplaySettings {
    display: flex;
    align-items: stretch;
    gap: clamp(4px, 0.8vw, 12px);
    height: 10vh;
    min-height: 44px;
    max-height: 80px;
}

#gameDisplayDescriptionWrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: var(--c-game-desc);
    border-radius: 14px;
    padding: 20px;
    box-sizing: border-box;
}

#gameDisplayDescription,
#gameDisplayCategories {
    margin: 0;
    font-size: 20px;
    line-height: 1.55;
    white-space: normal;
}

#gameDisplayDescription {
    text-align: left;
}

#gameDisplayCategories {
    text-align: center;
}

#gameDisplayDateInfo {
    font-size: 16px;
}
.icon {
  width: 100%;
  height: 100%;
  fill: currentColor;
  color: var(--c-text);
}

/* ─── Customization Screen ───────────────────────────────── */

#screenCustomization {
    min-height: calc(100vh - 70px);
    background-color: var(--c-bg);
    padding: 30px 40px;
    box-sizing: border-box;
    text-align: left;
}

#customizationContent {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

#customizationContent h1 {
    margin: 0 0 4px 0;
    font-size: 32px;
    justify-content: flex-start;
}

.customSection {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.customSection h2 {
    margin: 0;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--c-text-label);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--c-border);
}

/* Theme cards */
#themeCards {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.themeCard {
    width: 160px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--c-border);
    transition: border-color .15s ease, transform .1s ease;
    background: var(--c-surface);
    user-select: none;
}

.themeCard:hover {
    transform: translateY(-2px);
}

.themeCard.selected {
    border-color: var(--c-play);
}

.themePreview {
    width: 100%;
    height: 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    box-sizing: border-box;
}

.themePreviewDark {
    background: #222;
}

.themePreviewLight {
    background: #f0f0f0;
}

.themePreview-bar {
    height: 12px;
    border-radius: 4px;
    opacity: 0.7;
}

.themeCard-label {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
    color: var(--c-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.themeCard-check {
    color: var(--c-play);
    font-size: 16px;
}

/* Icon game grid */
#iconGameGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    gap: 16px;
    justify-content: start;
}

.iconGameCard {
    width: 160px;
    background: var(--c-square);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .15s ease, transform .1s ease;
}

.iconGameCard:hover {
    transform: translateY(-2px);
    border-color: var(--c-border);
}

.iconGameCard img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
}

.iconGameCard-info {
    padding: 8px;
}

.iconGameCard-name {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iconGameCard-count {
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 2px;
}

.iconSectionNote {
    margin: 0;
    color: var(--c-text-muted);
    font-size: 14px;
}

/* Icon picker overlay */
#iconPickerOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 100001;
    align-items: center;
    justify-content: center;
}

#iconPickerOverlay.open {
    display: flex;
}

#iconPickerCard {
    position: relative;
    width: min(520px, 92vw);
    background: var(--c-surface);
    border-radius: 16px;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--c-text);
}

#closeIconPicker {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--c-text);
    font-size: 20px;
    cursor: pointer;
}

#iconPickerTitle {
    margin: 0;
    font-size: 20px;
}

#iconPickerGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 120px);
    gap: 12px;
    justify-content: start;
}

.iconPickerTile {
    width: 120px;
    background: var(--c-square);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .15s ease;
}

.iconPickerTile:hover {
    border-color: var(--c-border);
}

.iconPickerTile.selected {
    border-color: var(--c-play);
}

.iconPickerTile img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
}

.iconPickerTile-name {
    padding: 6px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    color: var(--c-text);
}

.iconPickerTile-locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.iconPickerTile-locked .iconPickerTile-name::after {
    content: " 🔒";
}

/* ─── Achievements Screen ────────────────────────────────── */

#screenAchievements {
    min-height: calc(100vh - 70px);
    background-color: var(--c-bg);
    padding: 30px 40px;
    box-sizing: border-box;
    text-align: left;
}

#achievementsContent {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

#achievementsContent h1 {
    margin: 0 0 4px 0;
    font-size: 32px;
    justify-content: flex-start;
}

.achievementGameSection {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievementGameHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--c-border);
}

.achievementGameName {
    font-size: 18px;
    font-weight: bold;
    color: var(--c-text);
}

.achievementGameCount {
    font-size: 13px;
    color: var(--c-text-muted);
    background: var(--c-surface-alt);
    padding: 3px 10px;
    border-radius: 999px;
}

.achievementGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.achievementTile {
    width: 180px;
    background: var(--c-surface);
    border-radius: 10px;
    padding: 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 2px solid transparent;
    transition: border-color .15s ease;
}

.achievementTile.earned {
    border-color: #c9a227;
    background: var(--c-surface);
}

.achievementTile.locked {
    opacity: 0.5;
}

.achievementTileIcon {
    font-size: 26px;
    line-height: 1;
}

.achievementTileName {
    font-size: 14px;
    font-weight: bold;
    color: var(--c-text);
}

.achievementTileDesc {
    font-size: 12px;
    color: var(--c-text-muted);
    line-height: 1.4;
}

.achievementTileEarned {
    font-size: 11px;
    color: #c9a227;
    font-weight: bold;
    margin-top: 2px;
}

/* ─── Share Toast ───────────────────────────────────────── */

#shareToast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: var(--c-card);
    color: var(--c-text);
    border: 1px solid var(--c-border);
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

#shareToast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Blocked Games Section ─────────────────────────────── */

#blockedGamesSection {
    margin-top: 8px;
}

#blockedGamesToggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    border-top: 1px solid var(--c-border-subtle);
    width: 100%;
    padding: 10px 4px;
    color: var(--c-text-muted);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}

#blockedGamesToggle:hover {
    color: var(--c-text);
}

#blockedGamesChevron {
    font-size: 10px;
}

#blockedGamesGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 16px 4px;
    opacity: 0.65;
}

#blockedGamesGrid .gameSquare img {
    filter: grayscale(60%);
}

/* ─── Game Display Stats Panel ──────────────────────────── */

#gameDisplayStats {
    padding: 4px 0;
}

.gameStatRow {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--c-border-subtle);
    font-size: 14px;
    color: var(--c-text-dim);
}

.gameStatRow span:first-child {
    color: var(--c-text-muted);
}

/* ─── Activity Feed ──────────────────────────────────────── */

#recentActivitySection {
    display: grid;
    grid-template-areas: 'a b b' 'c c c';
}

#activityFeed {
    grid-area: c;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 16px 20px;
    overflow-x: auto;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#activityFeed::-webkit-scrollbar {
    display: none;
}

#activityFeed.dragging {
    cursor: grabbing;
}

.activityCard {
    flex-shrink: 0;
    width: 220px;
    background: var(--c-square);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
}

.activityCardTop {
    display: flex;
    align-items: center;
    gap: 8px;
}

.activityPfp {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: #666;
    flex-shrink: 0;
}

.activityAchIcon {
    font-size: 20px;
    line-height: 1;
}

.activityName {
    font-size: 13px;
    font-weight: bold;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activityDetail {
    font-size: 12px;
    color: var(--c-text-dim);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activityTime {
    font-size: 11px;
    color: var(--c-text-muted);
    margin-top: 2px;
}

/* ─── Profile Overlay Tabs ───────────────────────────────── */

#profileTabs {
    display: flex;
    width: 100%;
    border-bottom: 1px solid var(--c-border);
    gap: 0;
}

.profileTab {
    flex: 1;
    padding: 8px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--c-text-muted);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color .15s ease, border-color .15s ease;
    margin-bottom: -1px;
}

.profileTab:hover {
    color: var(--c-text);
}

.profileTab.active {
    color: var(--c-text);
    border-bottom-color: var(--c-play);
}

#profileTabOverview {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#profileTabAchievements {
    width: 100%;
    max-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 4px;
}

#profileTabAchievements::-webkit-scrollbar {
    width: 4px;
}

#profileTabAchievements::-webkit-scrollbar-thumb {
    background: var(--c-border);
    border-radius: 2px;
}

.profileAchGroup {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profileAchGroupName {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--c-text-muted);
    letter-spacing: 0.5px;
}

.profileAchItem {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--c-surface-alt);
    border-radius: 8px;
    padding: 8px 10px;
}

.profileAchItemIcon {
    font-size: 18px;
    flex-shrink: 0;
}

.profileAchItemName {
    font-size: 13px;
    font-weight: bold;
    color: var(--c-text);
}

.profileAchItemDesc {
    font-size: 11px;
    color: var(--c-text-muted);
}

#profileCard {
    max-height: 85vh;
    overflow-y: auto;
}

#pfpPickerGrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 4px;
}

.pfpOption {
    aspect-ratio: 1;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #444;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pfpOption img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.pfpOption:hover {
    border-color: purple;
}

.pfpOption.pfpSelected {
    border-color: purple;
    box-shadow: 0 0 0 2px rgba(128, 0, 128, 0.4);
}

.pfpUploadOption {
    background: #2a2a2a;
    cursor: pointer;
}

.pfpPlusIcon {
    font-size: 30px;
    color: #aaa;
    line-height: 1;
    pointer-events: none;
}