﻿/* =========================================
   Profile overlay - sectioned settings mockup
   ========================================= */

#profile-root {
    gap: 16px;
}

.pf-section-card {
    background: linear-gradient(180deg, #f6f4ef, #efebe4);
    border: 1px solid #d8d2c7;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    text-align: left;
}

.pf-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: #2a2a2a;
    letter-spacing: 0;
    text-transform: none;
}

.pf-list,
.pf-activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pf-list-item,
.pf-activity-item {
    width: 100%;
    min-height: 72px;
    background: linear-gradient(180deg, #f3f1ec, #ebe7df);
    border: 1px solid #d4cdc0;
    border-radius: 16px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.75);
    display: grid;
    grid-template-columns: 46px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-align: left;
}

button.pf-list-item {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: inherit;
}

.pf-list-item:hover {
    transform: translateY(-1px);
}

.pf-list-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 3px 8px rgba(0,0,0,0.10);
}

.pf-list-icon--green {
    background: linear-gradient(180deg, #cfead8, #9fd2b0);
}

.pf-list-icon--purple {
    background: linear-gradient(180deg, #dccdff, #b692ff);
}

.pf-list-icon--gold {
    background: linear-gradient(180deg, #f6e8a8, #dfc763);
}

.pf-list-icon--transparent {
    background: transparent;
    box-shadow: none;
}

.pf-list-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.pf-list-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
    color: #2a2a2a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-list-subtitle {
    font-size: 12px;
    line-height: 1.3;
    color: #66615a;
}

.pf-list-chevron {
    font-size: 28px;
    line-height: 1;
    color: #8e8a84;
    padding-left: 6px;
}

.pf-mini-switch {
    position: relative;
    width: 48px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: #d5d1ca;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.16);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

    .pf-mini-switch::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 22px;
        height: 22px;
        border-radius: 999px;
        background: #ffffff;
        box-shadow: 0 2px 6px rgba(0,0,0,0.16);
        transition: left 0.15s ease;
    }

    .pf-mini-switch.is-on {
        background: linear-gradient(180deg, #58b866, #3f924d);
    }

        .pf-mini-switch.is-on::after {
            left: 23px;
        }

@media (max-width: 480px) {
    .pf-list-item,
    .pf-activity-item {
        min-height: 68px;
        grid-template-columns: 42px 1fr auto;
        gap: 10px;
        padding: 10px;
    }

    .pf-list-icon {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .pf-list-title {
        font-size: 15px;
    }

    .pf-list-subtitle {
        font-size: 11px;
    }
}




/* =========================================
   Badges Overlay
   ========================================= */

#badges-overlay {
    background: var(--cb-overlay-bg, linear-gradient(180deg, #5CE65C, #2E9E2E)) !important;
}

#badges-root {
    background: linear-gradient(180deg, #fbfbfb, #f3f3f3) !important;
    border-radius: 24px !important;
    padding: 18px !important;
    color: #1e1e24 !important;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Header */
.badges-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 12px;
}

.badges-title {
    margin: 0;
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    color: #1f2330;
    line-height: 1.1;
}


/* Tabs */
.badges-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #d8d8dd;
}

.badges-tab {
    background: transparent;
    border: none;
    border-bottom: 4px solid transparent;
    padding: 12px 8px 14px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a7a85;
    cursor: pointer;
}

    .badges-tab.active {
        color: #6e56e8;
        border-bottom-color: #6e56e8;
    }

/* Intro callout */
.badges-callout {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 18px;
    background: #efebfb;
    border: 1px solid #e2dbfb;
}

.badges-callout-icon {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: linear-gradient(180deg, #7d63f1, #6248dd);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.badges-callout-text {
    font-size: 12px;
    line-height: 1.35;
    color: #2b2b34;
}

/* Section heading */
.badges-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.badges-section-label {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b8b93;
    white-space: nowrap;
}

.badges-section-line {
    height: 1px;
    background: #d9d9df;
    flex: 1;
}

/* Grid */
.badges-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Badge card */
.badge-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #d9d9df;
    border-radius: 20px;
    padding: 18px 16px 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 310px;
}

.badge-info-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid #cfcfd6;
    background: #ffffff;
    color: #8a8a95;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.badge-icon-wrap {
    width: 140px;
    height: 140px;
    margin: 18px 0 14px;
    border-radius: 999px;
    border: 2px dashed #d2d2d8;
    background: #f7f7f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.badge-icon-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0.78;
    filter: grayscale(0.18);
}

.badge-card-title {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.15;
    font-weight: 800;
    color: #171721;
}

.badge-card-desc {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.35;
    color: #4b4b55;
    min-height: 38px;
}

.badge-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #ececef;
    overflow: hidden;
    margin-bottom: 10px;
}

.badge-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #7d63f1, #6248dd);
    border-radius: 999px;
}

.badge-progress-text {
    font-size: 13px;
    font-weight: 700;
    color: #6f61db;
    margin-bottom: 8px;
}

.badge-xp {
    font-size: 14px;
    font-weight: 800;
    color: #6f61db;
}

/* Footer callout */
.badges-footer-callout {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 14px;
    align-items: center;
    padding: 16px 18px;
    border-radius: 18px;
    background: #f2edff;
    border: 1px solid #e2dbfb;
    margin-top: 6px;
}

.badges-footer-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #ece3ff;
    color: #7d63f1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.badges-footer-text {
    font-size: 12px;
    font-weight: 600;
    color: #363643;
}

/* Responsive */
@media (max-width: 700px) {
    .badges-title {
        font-size: 26px;
    }

    .badges-grid {
        grid-template-columns: 1fr;
    }

    .badge-card {
        min-height: auto;
    }

    .badge-icon-wrap {
        width: 120px;
        height: 120px;
    }
}



/* =========================================
   Badges overlay sizing / scrolling fix
   ========================================= */

#badges-overlay.tab-overlay {
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 16px 16px calc(64px + env(safe-area-inset-bottom, 0px) + 12px) !important;
}

#badges-root {
    width: min(100%, 760px) !important;
    max-height: calc(100dvh - 96px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* Slightly reduce the overall badge card footprint */
.badges-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.badge-card {
    min-height: 255px;
    padding: 16px 14px 14px;
}

/* Shrink the icon circle */
.badge-icon-wrap {
    width: 100px;
    height: 100px;
    margin: 12px 0 12px;
    padding: 14px;
}

.badge-icon-img {
    max-width: 64px;
    max-height: 64px;
}

/* Tighten text spacing a little */
.badge-card-title {
    font-size: 16px;
    margin-bottom: 8px;
}

.badge-card-desc {
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 34px;
}

.badge-xp,
.badge-progress-text {
    font-size: 13px;
}

/* Mobile */
@media (max-width: 640px) {
    #badges-root {
        padding: 16px !important;
    }

    .badges-grid {
        grid-template-columns: 1fr;
    }

    .badge-card {
        min-height: auto;
    }
}


/* =========================================
   Badges mobile 3-column layout + locked state
   Put this at the very bottom of citybits-profile.css
   ========================================= */

/* Use 3 across by default for phone-sized badge view */
.badges-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.badge-card {
    min-height: auto !important;
    border-radius: 16px;
    padding: 12px 8px 12px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.badge-info-btn {
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.badge-icon-wrap {
    position: relative;
    width: 74px !important;
    height: 74px !important;
    margin: 10px 0 10px !important;
    padding: 10px !important;
    overflow: visible;
}

.badge-icon-img {
    max-width: 42px !important;
    max-height: 42px !important;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

/* Lock bubble overlapping the badge circle */
.badge-lock-bubble {
    position: absolute;
    right: -4px;
    bottom: -2px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f7f7f9, #ececf1);
    border: 1px solid #cfcfd6;
    box-shadow: 0 3px 8px rgba(0,0,0,0.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
}

/* Locked is the default look */
.badge-card.is-locked .badge-icon-img {
    filter: grayscale(1) brightness(1.02);
    opacity: 0.42 !important;
}

.badge-card.is-locked .badge-icon-wrap {
    border-color: #d8d8de;
    background: #f3f3f5;
}

/* Earned state */
.badge-card.is-earned .badge-icon-img {
    filter: none;
    opacity: 1 !important;
}

.badge-card.is-earned .badge-lock-bubble {
    display: none;
}

/* Tighten text so 3 columns fit better */
.badge-card-title {
    font-size: 12px !important;
    line-height: 1.15;
    margin-bottom: 6px !important;
}

.badge-card-desc {
    font-size: 10px !important;
    line-height: 1.25;
    min-height: 30px !important;
    margin-bottom: 10px !important;
}

.badge-progress-bar {
    height: 8px;
    margin-bottom: 8px;
}

.badge-progress-text,
.badge-xp {
    font-size: 10px !important;
}

/* If the phone is extremely narrow, fall back to 2 columns */
@media (max-width: 360px) {
    .badges-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .badge-icon-wrap {
        width: 82px !important;
        height: 82px !important;
    }
}


/* =========================================
   Settings overlay - profile style
   ========================================= */

#settings-overlay.modal-overlay {
    background: var(--cb-overlay-bg, linear-gradient(180deg, #5CE65C, #2E9E2E)) !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 16px 16px calc(64px + env(safe-area-inset-bottom, 0px) + 12px) !important;
}

#settings-overlay .settings-sheet {
    width: min(100%, 760px);
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(180deg, #fbfbfb, #f2f2f2) !important;
    border-radius: 24px !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 18px 40px rgba(0,0,0,0.18) !important;
    display: flex;
    flex-direction: column;
    padding: 18px !important;
    gap: 18px;
}

.settings-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 12px;
}

.settings-title {
    margin: 0;
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: #1f2330;
    line-height: 1.1;
}

.settings-header-spacer {
    width: 44px;
    height: 44px;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-list-item {
    width: 100%;
    min-height: 72px;
    background: linear-gradient(180deg, #f7f4ef, #ede9e2);
    border: 1px solid #d7d1c6;
    border-radius: 16px;
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 12px;
    text-align: left;
    box-shadow: 0 6px 14px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.75);
}

.settings-list-item--multiline {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
}

.settings-meta {
    font-size: 13px;
    font-weight: 800;
    color: #6c6760;
    white-space: nowrap;
}

    .settings-meta.is-disabled,
    #settings-overlay .is-disabled {
        opacity: 0.5;
        pointer-events: none;
        cursor: not-allowed;
    }

.settings-signout-btn {
    width: 100%;
}

#avatar-preview-anchor {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#unity-render-preview-body {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}


@media (max-width: 640px) {
    #settings-overlay .settings-sheet {
        padding: 16px !important;
    }

    .settings-title {
        font-size: 24px;
    }

    .settings-list-item {
        min-height: 68px;
        grid-template-columns: 34px 1fr auto;
        gap: 10px;
    }
}
