.brokenpinea-achievement-block{margin-top:8px}.brokenpinea-achievement-label{display:block;margin-bottom:5px;color:#6c756a;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.brokenpinea-achievement-showcase{display:flex;align-items:center;flex-wrap:wrap;gap:5px}.brokenpinea-achievement-badge{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--bp-border,#dce8d8);border-radius:999px;background:var(--bp-card,#fff);box-shadow:0 2px 7px rgba(47,82,40,.08);font-size:15px;line-height:1}.brokenpinea-achievement-badge-supporter{border-color:rgba(244,197,66,.65);background:rgba(244,197,66,.12)}.brokenpinea-achievement-badge-media{border-color:rgba(101,181,69,.55);background:rgba(101,181,69,.08)}.brokenpinea-achievements-profile{margin:18px 0;padding:18px;border:1px solid var(--bp-border,#dce8d8);border-radius:16px;background:var(--bp-card,#fff);box-shadow:0 5px 18px rgba(47,82,40,.08)}.brokenpinea-achievements-profile-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}.brokenpinea-achievements-profile-head h3{margin:0 0 3px;color:var(--bp-green-dark,#3f8f2f);font-size:20px}.brokenpinea-achievements-profile-head p{margin:0;color:#6c756a}.brokenpinea-achievement-total{display:flex;align-items:baseline;gap:6px;white-space:nowrap}.brokenpinea-achievement-total strong{color:var(--bp-green-dark,#3f8f2f);font-size:26px}.brokenpinea-achievement-total span{color:#6c756a;font-size:12px}.brokenpinea-profile-featured{display:flex;align-items:center;gap:10px;margin:0 0 14px;padding:9px 11px;border-radius:11px;background:rgba(101,181,69,.06)}.brokenpinea-achievement-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.brokenpinea-achievement-card{display:flex;gap:12px;min-width:0;padding:12px;border:1px solid var(--bp-border,#dce8d8);border-radius:13px;background:#fff}.brokenpinea-achievement-card.is-locked{opacity:.58;filter:grayscale(.28)}.brokenpinea-achievement-card.is-earned{border-color:rgba(101,181,69,.48);background:rgba(101,181,69,.045)}.brokenpinea-achievement-card-icon{display:flex;align-items:center;justify-content:center;flex:0 0 46px;width:46px;height:46px;border-radius:12px;background:var(--bp-green-soft,#eef8e9);font-size:24px}.brokenpinea-achievement-card-copy{min-width:0;flex:1}.brokenpinea-achievement-card-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.brokenpinea-achievement-card-top strong{color:var(--bp-text,#2f3a2d);font-size:14px}.brokenpinea-achievement-card-top span{color:var(--bp-green-dark,#3f8f2f);font-size:10px;font-weight:700;text-transform:uppercase}.brokenpinea-achievement-card p{margin:3px 0 8px;color:#6c756a;font-size:12px}.brokenpinea-achievement-progress{height:6px;overflow:hidden;border-radius:999px;background:#e7ece4}.brokenpinea-achievement-progress i{display:block;height:100%;border-radius:inherit;background:var(--bp-green,#65b545)}.brokenpinea-achievement-card small{display:block;margin-top:5px;color:#747d72;font-size:10px}.brokenpinea-featured-picker{margin-top:16px;padding:14px;border:1px solid var(--bp-border,#dce8d8);border-radius:13px;background:#fafcf9}.brokenpinea-featured-picker-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:11px}.brokenpinea-featured-picker-head h4{margin:0 0 3px;font-size:15px}.brokenpinea-featured-picker-head p{margin:0;color:#6c756a;font-size:12px}.brokenpinea-featured-options{display:flex;flex-wrap:wrap;gap:7px}.brokenpinea-featured-options label{display:inline-flex;align-items:center;gap:6px;margin:0;padding:8px 10px;border:1px solid #dfe8dc;border-radius:10px;background:#fff;cursor:pointer}.brokenpinea-featured-options input{margin:0}.brokenpinea-featured-actions{margin-top:11px}.brokenpinea-achievement-notice{margin-bottom:10px;padding:8px 10px;border-radius:9px;font-size:12px;font-weight:600}.brokenpinea-achievement-notice.is-success{background:#edf8e9;color:#347328}.brokenpinea-achievement-notice.is-error{background:#fff0ef;color:#9a332d}@media(max-width:700px){.brokenpinea-achievement-grid{grid-template-columns:1fr}.brokenpinea-achievements-profile-head,.brokenpinea-featured-picker-head{align-items:flex-start;flex-direction:column}.brokenpinea-featured-options{flex-direction:column}.brokenpinea-featured-options label{width:100%;box-sizing:border-box}}


/* ==========================================================
   Crushi Profile Identity v1.4.0
   ========================================================== */
.bp-profile-hero{
    margin:0 0 18px;
    overflow:hidden;
    border:1px solid var(--bp-border,#3b4651);
    border-radius:18px;
    background:var(--bp-card,#222831);
    color:var(--bp-text,#edf2f7);
    box-shadow:0 8px 24px rgba(0,0,0,.18)
}
.bp-profile-cover{
    position:relative;
    height:150px;
    overflow:hidden;
    background:
        radial-gradient(circle at 18% 25%,rgba(127,203,99,.20),transparent 28%),
        radial-gradient(circle at 82% 40%,rgba(215,177,76,.16),transparent 28%),
        linear-gradient(135deg,#18221b,#202a31 48%,#182126)
}
.bp-profile-cover-pattern{
    position:absolute;inset:0;opacity:.22;
    background-image:
        linear-gradient(45deg,transparent 46%,rgba(215,177,76,.18) 47%,rgba(215,177,76,.18) 49%,transparent 50%),
        linear-gradient(-45deg,transparent 46%,rgba(127,203,99,.13) 47%,rgba(127,203,99,.13) 49%,transparent 50%);
    background-size:54px 54px
}
.bp-profile-main{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:end;
    gap:16px;
    padding:0 18px 16px;
    margin-top:-48px;
    position:relative;
    z-index:2
}
.bp-profile-avatar{
    width:104px;height:104px;
    display:flex;align-items:center;justify-content:center;
    overflow:hidden;
    border:5px solid var(--bp-card,#222831);
    border-radius:50%;
    background:#1a2027;
    box-shadow:0 5px 18px rgba(0,0,0,.28)
}
.bp-profile-avatar img{width:100%!important;height:100%!important;object-fit:cover;border-radius:50%}
.bp-profile-avatar-fallback{font-size:48px}
.bp-profile-identity{min-width:0;padding-top:52px}
.bp-profile-name-row{display:flex;align-items:center;flex-wrap:wrap;gap:9px}
.bp-profile-name-row h2{margin:0!important;font-size:26px;line-height:1.1}
.bp-profile-online{
    display:inline-flex;align-items:center;
    padding:3px 8px;border-radius:999px;
    background:rgba(127,203,99,.12);color:#91df70;
    font-size:10px;font-weight:800;text-transform:uppercase
}
.bp-profile-rank{margin-top:4px;color:var(--bp-gold,#d7b14c);font-weight:700}
.bp-profile-featured-hero{display:flex;gap:6px;margin-top:8px}
.bp-profile-featured-hero span{
    display:inline-flex;align-items:center;justify-content:center;
    width:30px;height:30px;border-radius:50%;
    background:#29313b;border:1px solid rgba(255,255,255,.08);
    font-size:16px
}
.bp-profile-meta{display:flex;flex-wrap:wrap;gap:12px;margin-top:9px;color:#aeb8c2;font-size:12px}
.bp-profile-meta strong{color:#d8dee5}
.bp-profile-actions{display:flex;gap:7px;padding-top:52px}
.bp-profile-stats{
    display:grid;grid-template-columns:repeat(4,1fr);
    border-top:1px solid rgba(255,255,255,.06);
    border-bottom:1px solid rgba(255,255,255,.06);
    background:rgba(0,0,0,.08)
}
.bp-profile-stats div{padding:13px;text-align:center;border-right:1px solid rgba(255,255,255,.05)}
.bp-profile-stats div:last-child{border-right:0}
.bp-profile-stats strong{display:block;color:var(--bp-green,#7fcb63);font-size:21px;line-height:1}
.bp-profile-stats span{display:block;margin-top:5px;color:#aeb8c2;font-size:11px;text-transform:uppercase;letter-spacing:.05em}
.bp-profile-about{padding:15px 18px}
.bp-profile-about h3{margin:0 0 8px;color:var(--bp-green,#7fcb63);font-size:15px}
.bp-profile-about p{margin:5px 0;color:#c2cad1}

@media(max-width:700px){
    .bp-profile-cover{height:105px}
    .bp-profile-main{
        grid-template-columns:78px minmax(0,1fr);
        gap:11px;
        padding:0 12px 13px;
        margin-top:-36px
    }
    .bp-profile-avatar{width:72px;height:72px;border-width:4px}
    .bp-profile-avatar-fallback{font-size:34px}
    .bp-profile-identity{padding-top:39px}
    .bp-profile-name-row h2{font-size:21px}
    .bp-profile-actions{grid-column:1/-1;padding-top:0}
    .bp-profile-actions .button{flex:1;text-align:center}
    .bp-profile-meta{gap:8px}
    .bp-profile-stats{grid-template-columns:repeat(2,1fr)}
    .bp-profile-stats div:nth-child(2){border-right:0}
    .bp-profile-stats div:nth-child(-n+2){border-bottom:1px solid rgba(255,255,255,.05)}
}


/* ==========================================================
   Crushi Profile Identity v1.5.0
   ========================================================== */

/* Always keep the display name readable on dark profiles. */
.bp-profile-name-row h2,
.bp-profile-name-row h2 span {
    color: #edf2f7 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.bp-profile-cover-image {
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:cover;
    z-index:0;
}

.bp-profile-cover-pattern {
    z-index:1;
    background-color:rgba(10,15,20,.16);
}

.bp-profile-about,
.bp-profile-media,
.bp-profile-editor {
    margin:0 0 18px;
    border:1px solid var(--bp-border,#3b4651);
    border-radius:18px;
    background:var(--bp-card,#222831);
    color:var(--bp-text,#edf2f7);
    box-shadow:0 8px 24px rgba(0,0,0,.18);
}

.bp-profile-about {
    margin:0;
    border:0;
    border-top:1px solid rgba(255,255,255,.06);
    border-radius:0;
    box-shadow:none;
}

.bp-profile-bio {
    margin:0;
    color:#cbd3da;
    line-height:1.55;
    white-space:pre-wrap;
}

.bp-profile-section-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:15px 18px;
    border-bottom:1px solid rgba(255,255,255,.06);
}

.bp-profile-section-head h3 {
    margin:0;
    color:var(--bp-green,#7fcb63);
    font-size:16px;
}

.bp-profile-section-head p {
    margin:3px 0 0;
    color:#98a4ae;
    font-size:12px;
}

.bp-profile-media-grid {
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:10px;
    padding:14px;
}

.bp-profile-media-card {
    min-width:0;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.06);
    border-radius:12px;
    background:#1b222a;
}

.bp-profile-media-card > a {
    display:flex;
    align-items:center;
    justify-content:center;
    aspect-ratio:1 / 1;
    overflow:hidden;
    background:#131920;
}

.bp-profile-media-card img {
    width:100%;
    height:100%;
    object-fit:cover;
}

.bp-profile-video-thumb {
    display:flex;
    align-items:center;
    justify-content:center;
    width:48px;
    height:48px;
    border-radius:50%;
    background:rgba(127,203,99,.14);
    color:#94df73;
    font-size:24px;
}

.bp-profile-media-name {
    overflow:hidden;
    padding:8px 9px 5px;
    color:#b7c0c9;
    font-size:10px;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.bp-set-cover-form {
    padding:0 8px 8px;
}

.bp-set-cover-form .button2 {
    width:100%;
    padding:5px 6px !important;
    font-size:10px !important;
}

.bp-profile-editor {
    padding-bottom:16px;
}

.bp-profile-editor form {
    padding:14px 18px 0;
}

.bp-profile-field {
    display:block;
    margin-bottom:14px;
}

.bp-profile-field > span {
    display:block;
    margin-bottom:6px;
    color:#dce3e9;
    font-weight:700;
}

.bp-profile-field textarea,
.bp-profile-field input {
    width:100% !important;
    box-sizing:border-box;
}

.bp-profile-field textarea {
    resize:vertical;
    min-height:110px;
}

.bp-profile-field small {
    display:block;
    margin-top:5px;
    color:#8f9aa5;
}

.bp-profile-editor-actions {
    display:flex;
    justify-content:flex-end;
}

/* Make the old phpBB profile area feel less dominant beside the new identity card. */
.section-memberlist .panel {
    border-radius:16px !important;
}

.section-memberlist .panel h3 {
    color:var(--bp-green,#7fcb63) !important;
}

.section-memberlist .panel .corners-top,
.section-memberlist .panel .corners-bottom {
    display:none !important;
}

/* No private-message action in the profile UI. */
.bp-profile-actions a[href*="mode=compose"],
.section-memberlist a[href*="mode=compose"][href*="ucp.php"] {
    display:none !important;
}

@media(max-width:900px){
    .bp-profile-media-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media(max-width:700px){
    .bp-profile-section-head{padding:13px 14px}
    .bp-profile-media-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:10px}
    .bp-profile-editor form{padding:12px 14px 0}
    .bp-profile-editor-actions .button1{width:100%}
}


/* ==========================================================
   v1.5.1 Recent Media Stability
   Full attachment images are used instead of phpBB thumbnails.
   ========================================================== */

.bp-profile-media-card > a {
    position: relative;
}

.bp-profile-media-card img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
}

.bp-profile-media-name {
    display: block;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

.bp-profile-video-thumb {
    user-select: none;
}


/* ==========================================================
   v1.5.2 Recent Media fallback
   ========================================================== */
.bp-profile-media-card > a {
    color: transparent !important;
    text-decoration: none !important;
}

.bp-profile-media-image {
    font-size: 0 !important;
    color: transparent !important;
}

.bp-profile-media-image.bp-profile-media-broken {
    opacity: 0 !important;
}

.bp-profile-media-card > a:has(.bp-profile-media-broken)::after {
    content: "🖼️";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7fcb63;
    font-size: 28px;
    background: #131920;
}


/* ==========================================================
   v1.5.3 Browser-view attachment fix
   ========================================================== */
.bp-profile-media-card > a {
    overflow: hidden;
}

.bp-profile-media-image {
    background: #131920;
}

.bp-profile-media-image:not(.bp-profile-media-broken) {
    opacity: 1 !important;
}


/* ==========================================================
   Crushi Levels + XP v1.6.0
   ========================================================== */
.bp-profile-level-chip {
    display:flex;
    align-items:center;
    gap:7px;
    width:max-content;
    margin-top:8px;
    padding:5px 9px;
    border:1px solid rgba(127,203,99,.20);
    border-radius:999px;
    background:rgba(127,203,99,.08);
}
.bp-profile-level-chip span {
    color:#9ee47f;
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.05em;
}
.bp-profile-level-chip strong {
    color:#d7b14c;
    font-size:11px;
}

.bp-profile-xp {
    padding:14px 18px 15px;
    border-bottom:1px solid rgba(255,255,255,.06);
    background:rgba(0,0,0,.05);
}
.bp-profile-xp-head {
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
    margin-bottom:9px;
}
.bp-profile-xp-head > div {
    display:flex;
    align-items:baseline;
    gap:9px;
}
.bp-profile-xp-level {
    color:#8fdf70;
    font-size:15px;
    font-weight:900;
    text-transform:uppercase;
}
.bp-profile-xp-head strong {
    color:#f0d368;
    font-size:18px;
}
.bp-profile-xp-head > span {
    color:#9ba7b2;
    font-size:11px;
}
.bp-profile-xp-track,
.bp-mini-level-track {
    overflow:hidden;
    border-radius:999px;
    background:#151b21;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);
}
.bp-profile-xp-track {
    height:10px;
}
.bp-profile-xp-track i,
.bp-mini-level-track i {
    display:block;
    height:100%;
    border-radius:inherit;
    background:linear-gradient(90deg,#65b545,#9bdc69 65%,#d7b14c);
}
.bp-xp-breakdown {
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-top:10px;
}
.bp-xp-breakdown span {
    padding:4px 7px;
    border-radius:999px;
    background:#29313b;
    color:#aeb8c2;
    font-size:10px;
}

.bp-mini-level {
    margin-top:8px !important;
}
.bp-mini-level-head {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    margin-bottom:5px;
    font-size:10px;
}
.bp-mini-level-head span {
    color:#91df70;
    font-weight:900;
    letter-spacing:.04em;
}
.bp-mini-level-head strong {
    color:#d7b14c;
    font-weight:800;
}
.bp-mini-level-track {
    height:5px;
    max-width:150px;
}

@media(max-width:700px){
    .bp-profile-xp{padding:12px 14px}
    .bp-profile-xp-head{align-items:flex-start;flex-direction:column;gap:4px}
    .bp-profile-xp-head > div{width:100%;justify-content:space-between}
    .bp-xp-breakdown{gap:5px}
    .bp-xp-breakdown span{font-size:9px}
    .bp-mini-level-track{max-width:none}
}


/* ==========================================================
   v1.7.0 XP Polish + Reaction Achievement Expansion
   ========================================================== */
.bp-profile-level-chip em {
    padding-left:7px;
    border-left:1px solid rgba(255,255,255,.10);
    color:#c1cbd4;
    font-size:10px;
    font-style:normal;
    font-weight:700;
}
.bp-profile-xp-rank {
    color:#c4ced6;
    font-size:11px;
    font-style:normal;
    font-weight:700;
}
.bp-mini-level-head span {
    max-width:72%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.brokenpinea-achievement-card-icon {
    flex:0 0 auto;
}
@media(max-width:700px){
    .bp-profile-level-chip{
        max-width:100%;
        flex-wrap:wrap;
    }
    .bp-profile-level-chip em{
        border-left:0;
        padding-left:0;
        width:100%;
    }
}

/* ==========================================================
   v1.7.1 Mini Level Rank Readability Fix
   Let the full level/rank name wrap instead of showing "..."
   while keeping the XP total readable on the right.
   ========================================================== */

.bp-mini-level-head {
    align-items:flex-start !important;
}

.bp-mini-level-head span {
    flex:1 1 auto !important;
    min-width:0 !important;
    max-width:none !important;
    overflow:visible !important;
    text-overflow:clip !important;
    white-space:normal !important;
    line-height:1.2 !important;
}

.bp-mini-level-head strong {
    flex:0 0 auto !important;
    margin-left:8px !important;
    white-space:nowrap !important;
}

@media(max-width:700px){
    .bp-mini-level-head{
        gap:6px !important;
    }

    .bp-mini-level-head span{
        max-width:none !important;
        white-space:normal !important;
    }

    .bp-mini-level-head strong{
        margin-left:6px !important;
    }
}

/* ==========================================================
   v1.7.2 Mobile Profile Cleanup
   Hide redundant old phpBB profile details on phones while
   keeping the owner's/admin profile-management panel available.
   ========================================================== */

@media(max-width:700px){

    /* The modern BrokenPinea profile already shows these details. */
    .section-memberlist h2.memberlist-title {
        display:none !important;
    }

    /*
     * Hide the old phpBB profile-detail panels on mobile.
     * Achievements, Recent Media, and the BrokenPinea profile
     * use their own classes and remain visible.
     */
    .section-memberlist .panel {
        display:none !important;
    }

    /*
     * Keep the profile-management/admin panel when it contains
     * Edit profile / Administer user controls.
     */
    .section-memberlist .panel:has(a[href*="mode=editprofile"]),
    .section-memberlist .panel:has(a[href*="mode=admin"]),
    .section-memberlist .panel:has(a[href*="mode=group"]) {
        display:block !important;
        margin:12px 0 18px !important;
        padding:12px 14px !important;
        border:1px solid rgba(255,255,255,.07) !important;
        border-radius:14px !important;
        background:#222831 !important;
        box-shadow:none !important;
    }

    /*
     * Make the remaining management panel easier to read.
     */
    .section-memberlist .panel:has(a[href*="mode=editprofile"]) *,
    .section-memberlist .panel:has(a[href*="mode=admin"]) *,
    .section-memberlist .panel:has(a[href*="mode=group"]) * {
        line-height:1.35;
    }
}
