#profile-page {
    max-width: 1400px;
    margin: 0 auto;
}

#profile-content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.profile-left-column, .profile-right-column {
    min-width: 0;
}

#profile-content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#profile-page-name {
    margin: 0;
    font-size: 2em;
}

#subscription-status {
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 20px;
    background-color: rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
    min-height: 42.5px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

#subscription-status.subscribed {
    background-color: #9146FF;
    color: white;
    border-color: transparent;
}

html.dark-mode #subscription-status.subscribed {
    background-color: #a970ff;
}

.status-placeholder { display: inline-block; }
.status-text { display: none; }


/* --- PROFILE AVATAR & RING --- */
#profile-page-avatar-container {
    margin: 0 auto 20px;
}


/* --- PROFILE SETTINGS & CUSTOMIZATION --- */
.profile-settings-section {
    width: 100%;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.customization-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.customization-group {
    background: rgba(0,0,0,0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

html.dark-mode .customization-group {
    background: rgba(255,255,255,0.05);
}

.customization-label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
    opacity: 0.8;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 50%;
}

.gradient-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    font-weight: 600;
}

.sub-only-badge {
    font-size: 0.7em;
    background: #9146FF;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.color-picker-separator {
    width: 100%;
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 15px 0;
    color: var(--nav-text-color);
    font-size: 0.9em;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.7;
}

.color-picker-separator::before,
.color-picker-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}
.color-picker-separator:not(:empty)::before { margin-right: .5em; }
.color-picker-separator:not(:empty)::after { margin-left: .5em; }


/* --- GOODIES SECTION --- */
.goodies-section {
    width: 100%;
    align-items: center;
}

.goodies-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-items: center;
}

#goodie-display-area {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    background-color: rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    min-height: 250px;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

html.dark-mode #goodie-display-area {
    background-color: rgba(255,255,255,0.05);
}

.goodie-placeholder {
    font-style: italic;
    opacity: 0.7;
}

#goodie-display-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 1 / 1;
}

.goodie-display-info {
    text-align: center;
}

.goodie-display-name {
    margin: 0 0 5px 0;
    font-size: 1.5em;
    font-weight: 700;
}

.goodie-display-description {
    margin: 10px 0 0 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.goodie-rarity-capsule {
    display: inline-block;
    padding: 3px 12px;
    font-size: 0.8em;
    font-weight: 700;
    border-radius: 15px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.goodie-rarity-capsule[data-rarity="Common"] { background-color: #95a5a6; }
.goodie-rarity-capsule[data-rarity="Uncommon"] { background-color: #2ecc71; }
.goodie-rarity-capsule[data-rarity="Rare"] { background-color: #3498db; }
.goodie-rarity-capsule[data-rarity="Epic"] { background-color: #9b59b6; }
.goodie-rarity-capsule[data-rarity="Legendary"] { background-color: #f1c40f; color: #333; }
.goodie-rarity-capsule[data-rarity="Unique"] { background-color: #1abc9c; }

#owned-goodies-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.goodie-grid-item {
    position: relative;
    aspect-ratio: 1 / 1;
    padding: 5px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(0,0,0,0.05);
}

html.dark-mode .goodie-grid-item {
    background-color: rgba(255,255,255,0.05);
}

.goodie-grid-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-pink);
}

.goodie-grid-item.active {
    border-color: var(--accent-pink);
    box-shadow: 0 0 10px var(--accent-pink);
    background-color: rgba(255, 141, 209, 0.1);
}

.goodie-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.goodie-quantity-badge {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.8em;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

#set-pfp-btn {
    margin-top: 15px;
    font-size: 0.9em;
    padding: 8px 16px;
}


/* --- PROFILE PAGE DESKTOP LAYOUT --- */
@media (min-width: 1063px) {
    #profile-content-wrapper {
        grid-template-columns: 400px 1fr;
        align-items: stretch;
    }

    #goodie-display-area {
        padding-left: 20px;
        padding-right: 20px;
    }
}

.account-link-row {
    display: flex;
    justify-content: center; /* Center the button */
    align-items: center;
    padding: 0; /* Remove padding, let the button fill or sit nicely */
    border: none; /* Remove border if you want a cleaner look, or keep it */
    background: transparent;
}

/* --- WORDMAXXING HISTORY STYLES --- */
.wm-history-card {
    width: 100%;
    background: rgba(0,0,0,0.05);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

html.dark-mode .wm-history-card {
    background: rgba(255,255,255,0.05);
}

.wm-history-date {
    font-size: 0.85em;
    opacity: 0.7;
    font-weight: 700;
}

.wm-history-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wm-history-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.wm-history-tile {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: var(--border-color);
}

.wm-history-tile.green { background-color: #6aaa64; }
.wm-history-tile.yellow { background-color: #c9b458; }
.wm-history-tile.grey { background-color: #787c7e; }

.wm-history-row-score {
    font-size: 0.75em;
    font-weight: 800;
    color: var(--accent-pink);
    margin-left: 8px;
    min-width: 50px;
}

.wm-history-total {
    font-weight: 900;
    color: var(--accent-pink);
    font-size: 1.1em;
    margin-top: 5px;
}

.wm-history-placeholder {
    font-style: italic;
    opacity: 0.6;
    font-size: 0.9em;
    text-align: center;
}