/* Profile page — banner, HISTORY/LISTS tabs, custom anime lists.
   Matches the app's dark design language (style.css / for_you.css). */

/* ---------- Banner ---------- */
.profile-banner {
    padding: 46px 5% 30px;
    max-width: 1300px;
    margin: 0 auto;
    width: 90%;
}
.profile-banner-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    background: linear-gradient(135deg, rgba(143, 91, 255, .14), rgba(63, 140, 255, .08));
    border: 1px solid rgba(143, 91, 255, .3);
    border-radius: 24px;
    padding: 28px 32px;
    flex-wrap: wrap;
}
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 800;
    color: white;
    border: 3px solid rgba(255, 255, 255, .25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    flex-shrink: 0;
    background: linear-gradient(135deg, #7B2EFF, #3F8CFF);
}
.settings-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.settings-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.choose-avatar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 40px;
    border: 2px solid rgba(143, 91, 255, .4);
    background: rgba(143, 91, 255, .1);
    color: #c9a8ff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: .25s;
    font-family: 'Montserrat', sans-serif;
}
.choose-avatar-btn:hover {
    background: rgba(143, 91, 255, .25);
    border-color: #8F5BFF;
    color: white;
    transform: translateY(-1px);
}
.profile-id {
    flex: 1;
    min-width: 200px;
}
.profile-id h1 {
    font-size: 30px;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
}
.profile-id p {
    color: #8f94b0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 26px;
    border-radius: 40px;
    background: linear-gradient(135deg, #ff3b6b, #ff7a59);
    color: white;
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(255, 59, 107, .35);
    transition: .3s;
}
.profile-logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 59, 107, .6);
}

/* ---------- Tabs ---------- */
.profile-tabs {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 5%;
    width: 90%;
    display: flex;
    gap: 6px;
    /* Neutralize the shared nav{...} card styling (sticky slab) that leaks
       onto this <nav> — profile tabs are a plain underline bar. */
    position: static;
    top: auto;
    z-index: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.profile-tab {
    padding: 14px 26px;
    color: #8f94b0;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: 1px;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: .25s;
}
.profile-tab:hover {
    color: white;
}
.profile-tab.active {
    color: #ff8c42;
    border-bottom-color: #ff8c42;
}

/* ---------- Sections & grids ---------- */
.profile-section {
    max-width: 1300px;
    margin: 0 auto;
    padding: 34px 5% 60px;
    width: 90%;
}
.profile-section-head {
    margin-bottom: 26px;
}
.profile-section-head h2 {
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
}
.profile-section-head p {
    color: #8f94b0;
    font-size: 14.5px;
}
.profile-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
}
.profile-card-wrap {
    position: relative;
}
.profile-visited-chip {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 3;
    background: rgba(4, 6, 12, .78);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #d8d8d8;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}
.profile-remove-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(4, 6, 12, .8);
    color: #ff5c7a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .25s;
}
.profile-remove-chip:hover {
    background: #ff3b6b;
    color: white;
    transform: scale(1.1);
}

/* ---------- Lists toolbar + cards ---------- */
.profile-lists-toolbar {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.profile-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 26px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, .75);
    background: transparent;
    color: white;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .5px;
    cursor: pointer;
    transition: .25s;
    font-family: 'Montserrat', sans-serif;
}
.profile-create-btn:hover {
    background: rgba(255, 255, 255, .08);
    border-color: #ff8c42;
    color: #ff8c42;
}
.profile-list-counter {
    color: #8f94b0;
    font-size: 14px;
    font-weight: 600;
}
.profile-lists-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}
.profile-list-card {
    position: relative;
    background: #1b2138;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 24px 26px;
    transition: .25s;
}
.profile-list-card:hover {
    border-color: rgba(143, 91, 255, .45);
    background: #202743;
    transform: translateY(-3px);
}
.profile-list-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.profile-list-link h3 {
    color: white;
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-word;
}
.profile-list-link p {
    color: #8f94b0;
    font-size: 13.5px;
}
.profile-list-menu-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #8f94b0;
    cursor: pointer;
    transition: .25s;
}
.profile-list-menu-btn:hover {
    background: rgba(255, 255, 255, .08);
    color: white;
}
.profile-list-menu {
    position: absolute;
    top: 52px;
    right: 14px;
    z-index: 10;
    background: #141a2e;
    border: 1px solid rgba(143, 91, 255, .35);
    border-radius: 12px;
    padding: 6px;
    min-width: 150px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.profile-list-menu[hidden] {
    display: none;
}
.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #d8d8d8;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    transition: .2s;
}
.profile-menu-item:hover {
    background: rgba(143, 91, 255, .14);
    color: white;
}
.profile-menu-item.danger {
    color: #ff5c7a;
}
.profile-menu-item.danger:hover {
    background: rgba(255, 59, 107, .14);
    color: #ff8fa3;
}

/* ---------- Empty states ---------- */
.profile-empty {
    text-align: center;
    padding: 60px 20px;
    border: 1px dashed rgba(255, 255, 255, .14);
    border-radius: 20px;
}
.profile-empty .empty-icon {
    font-size: 46px;
    margin-bottom: 16px;
}
.profile-empty h3 {
    color: white;
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 8px;
}
.profile-empty p {
    color: #8f94b0;
    max-width: 440px;
    margin: 0 auto 22px;
    font-size: 14.5px;
    line-height: 1.6;
}
.hero-badge {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 40px;
    background: rgba(143, 91, 255, .14);
    border: 1px solid rgba(143, 91, 255, .4);
    color: #c9a8ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.pick-btn-solid {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 28px;
    border-radius: 40px;
    background: linear-gradient(135deg, #7B2EFF, #3F8CFF);
    color: white;
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(123, 46, 255, .45);
    transition: .3s;
}
.pick-btn-solid:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(123, 46, 255, .7);
    color: white;
}
.empty-cta {
    margin-top: 6px;
}

/* ---------- Settings tab ---------- */
.profile-settings-card {
    background: linear-gradient(135deg, rgba(143, 91, 255, .12), rgba(63, 140, 255, .07));
    border: 1px solid rgba(143, 91, 255, .3);
    border-radius: 24px;
    padding: 34px 36px;
    max-width: 720px;
}
.profile-settings-id {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}
.profile-settings-id .profile-avatar {
    width: 96px;
    height: 96px;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.profile-settings-id .profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 40px rgba(143, 91, 255, .4);
}
.profile-settings-id h3 {
    color: white;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
}
.profile-settings-id p {
    color: #8f94b0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-settings-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 26px 0 0;
}
.profile-stat {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(165deg, rgba(143, 91, 255, .16), rgba(10, 13, 22, .65) 55%);
    border: 1px solid rgba(143, 91, 255, .25);
    border-radius: 18px;
    padding: 20px 14px 18px;
    text-decoration: none;
    text-align: center;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
.profile-stat::before {
    content: "";
    position: absolute;
    top: -45%;
    left: 50%;
    transform: translateX(-50%);
    width: 130%;
    height: 80%;
    background: radial-gradient(closest-side, rgba(143, 91, 255, .30), transparent);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.profile-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(143, 91, 255, .6);
    box-shadow: 0 14px 34px rgba(123, 46, 255, .28);
}
.profile-stat:hover::before { opacity: 1; }
.profile-stat-num {
    display: block;
    font-size: 27px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 5px;
}
.profile-stat:nth-child(1) .profile-stat-num { color: #38bdf8; }
.profile-stat:nth-child(2) .profile-stat-num { color: #a78bfa; }
.profile-stat:nth-child(3) .profile-stat-num { color: #ff8c42; }
.profile-stat:nth-child(4) .profile-stat-num { color: #27d07d; }
.profile-stat-label {
    color: #9aa3bd;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* ---------- List detail page ---------- */
.profile-list-head {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 5% 10px;
    width: 90%;
}
.profile-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8f94b0;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    margin-bottom: 18px;
    transition: .25s;
}
.profile-back-link:hover {
    color: #ff8c42;
}
.profile-list-head h1 {
    font-size: 32px;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
    word-break: break-word;
}
.profile-list-head p {
    color: #8f94b0;
    font-size: 14.5px;
}
.profile-list-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 6px;
}
.profile-list-title-row h1 {
    margin-bottom: 0;
}
.profile-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.profile-list-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(139, 92, 246, .4);
    background: rgba(139, 92, 246, .12);
    color: #c4b5fd;
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: .4px;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.profile-list-action-btn:hover {
    background: rgba(139, 92, 246, .25);
    border-color: rgba(139, 92, 246, .7);
    color: white;
}
.profile-list-action-btn:active {
    transform: scale(.96);
}
.profile-list-action-btn.danger {
    border-color: rgba(239, 68, 68, .4);
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
}
.profile-list-action-btn.danger:hover {
    background: rgba(239, 68, 68, .22);
    border-color: rgba(239, 68, 68, .7);
    color: white;
}
.profile-list-action-btn:disabled {
    opacity: .6;
    cursor: default;
}

/* ---------- Modals ---------- */
.profile-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 6, 12, .74);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.profile-modal-overlay[hidden] {
    display: none;
}
.profile-modal {
    width: min(460px, 100%);
    background: #12172a;
    border: 1px solid rgba(143, 91, 255, .35);
    border-radius: 22px;
    padding: 34px 36px 28px;
    position: relative;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
    text-align: center;
    animation: modalUp .3s ease;
}
@keyframes modalUp {
    from { opacity: 0; transform: translateY(20px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.profile-modal .hero-badge {
    margin-bottom: 14px;
}
.profile-modal h2 {
    color: white;
    font-size: 24px;
    font-weight: 800;
    margin: 12px 0 8px;
}
.profile-modal p {
    color: #8f94b0;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.profile-modal input[type=text] {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: .25s;
    margin-bottom: 22px;
}
.profile-modal input[type=text]:focus {
    border-color: #8F5BFF;
    box-shadow: 0 0 18px rgba(143, 91, 255, .35);
}
.profile-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    color: #d8d8d8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .3s;
}
.profile-modal-close:hover {
    background: #ff3b6b;
    border-color: #ff3b6b;
    color: white;
    transform: rotate(90deg);
}
.modal-x {
    position: relative;
    width: 14px;
    height: 14px;
    display: block;
}
.modal-x::before,
.modal-x::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(45deg);
}
.modal-x::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}
.profile-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.profile-btn-ghost {
    padding: 12px 24px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .05);
    color: #d8d8d8;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: .25s;
}
.profile-btn-ghost:hover {
    color: white;
    border-color: #8F5BFF;
}
.profile-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: 40px;
    border: none;
    background: linear-gradient(135deg, #7B2EFF, #3F8CFF);
    color: white;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 10px 26px rgba(123, 46, 255, .4);
    transition: .3s;
}
.profile-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(123, 46, 255, .65);
}
.profile-btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .profile-card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 900px) {
    .profile-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-banner-inner {
        padding: 22px;
    }
}
@media (max-width: 600px) {
    .profile-card-grid,
    .profile-lists-grid {
        grid-template-columns: 1fr;
    }
    .profile-banner-inner {
        flex-direction: column;
        text-align: center;
    }
    .profile-id p {
        justify-content: center;
    }
    .profile-tab {
        padding: 12px 16px;
        font-size: 12.5px;
    }
}

/* =====================================================
   RANK BADGES — S+ / S / A / B / C / D / F
   ===================================================== */

.profile-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 6px;
}
.rank-xp {
    font-size: 11px;
    opacity: .7;
    font-weight: 400;
}

/* F Rank — Red glitch */
.rank-badge-f {
    background: rgba(239,68,68,.12);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,.3);
    animation: rankF 2s ease-in-out infinite;
}
@keyframes rankF {
    0%, 100% { opacity: .7; }
    50% { opacity: 1; box-shadow: 0 0 8px rgba(239,68,68,.3); }
}

/* D Rank — Gray subtle */
.rank-badge-d {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.5);
    border: 1px solid rgba(255,255,255,.1);
}

/* C Rank — Blue glow */
.rank-badge-c {
    background: rgba(56,189,248,.08);
    color: #38bdf8;
    border: 1px solid rgba(56,189,248,.2);
    animation: rankGlow 3s ease-in-out infinite;
}
@keyframes rankGlow {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 12px rgba(56,189,248,.15); }
}

/* B Rank — Purple pulse */
.rank-badge-b {
    background: rgba(167,139,250,.08);
    color: #a78bfa;
    border: 1px solid rgba(167,139,250,.2);
    animation: rankPulse 2.5s ease-in-out infinite;
}
@keyframes rankPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 14px rgba(167,139,250,.2); }
}

/* A Rank — Cyan shimmer */
.rank-badge-a {
    background: rgba(34,211,238,.08);
    color: #22d3ee;
    border: 1px solid rgba(34,211,238,.25);
    animation: rankShimmer 3s ease-in-out infinite;
}
@keyframes rankShimmer {
    0%, 100% { box-shadow: none; border-color: rgba(34,211,238,.25); }
    50% { box-shadow: 0 0 18px rgba(34,211,238,.2); border-color: rgba(34,211,238,.4); }
}

/* S Rank — Green glow */
.rank-badge-s {
    background: rgba(39,208,125,.1);
    color: #27d07d;
    border: 1px solid rgba(39,208,125,.3);
    animation: rankSGlow 2s ease-in-out infinite;
}
@keyframes rankSGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(39,208,125,.1); }
    50% { box-shadow: 0 0 22px rgba(39,208,125,.25); }
}

/* S+ Rank — Green pulsing aura */
.rank-badge-sp {
    background: linear-gradient(135deg, rgba(39,208,125,.15), rgba(34,197,94,.1));
    color: #27d07d;
    border: 1px solid rgba(39,208,125,.4);
    animation: rankSP 1.8s ease-in-out infinite;
    font-size: 14px;
}
@keyframes rankSP {
    0%, 100% { box-shadow: 0 0 15px rgba(39,208,125,.15); transform: scale(1); }
    50% { box-shadow: 0 0 30px rgba(39,208,125,.3); transform: scale(1.02); }
}

/* =====================================================
   REVIEW HISTORY
   ===================================================== */

.review-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.review-history-item {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 10px;
    padding: 14px 16px;
}
.review-anime-link {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    font-size: .95rem;
}
.review-anime-link:hover {
    color: #27d07d;
}
.review-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.review-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}
.review-type-badge.episode-badge {
    background: rgba(56,189,248,.15);
    color: #38bdf8;
}
.review-type-badge.anime-badge {
    background: rgba(167,139,250,.15);
    color: #a78bfa;
}
.review-rating {
    font-size: 13px;
    color: #ffd54a;
}
.review-likes {
    font-size: 12px;
    color: rgba(255,255,255,.4);
    display: flex;
    align-items: center;
    gap: 6px;
}
.review-likes i { font-size: 11px; }
.review-comment {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255,255,255,.5);
    line-height: 1.5;
}

/* ---- Developer tag ---- */
.dev-tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em;
    color: #5eead4; background: rgba(45,212,191,0.12);
    border: 1px solid rgba(45,212,191,0.4); border-radius: 999px;
    padding: 2px 9px; vertical-align: middle; white-space: nowrap;
}
.dev-tag i { color: #5eead4; font-size: 0.62rem; }

/* ============================================================
   PROFILE — MOBILE polish
   ============================================================ */
@media (max-width: 600px) {
    .profile-banner-inner { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
    .profile-id { flex-wrap: wrap; }
    .profile-card-grid { grid-template-columns: 1fr; }
    .profile-list-card { flex-wrap: wrap; row-gap: 10px; }
    .profile-avatar { width: 84px; height: 84px; }
}

/* ============================================================
   PROFILE — phone tabs + settings
   ============================================================ */
@media (max-width: 900px) {
    .profile-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; scrollbar-width: none; }
    .profile-tabs::-webkit-scrollbar { display: none; }
    .profile-tab { white-space: nowrap; }
}
@media (max-width: 600px) {
    .profile-banner { padding: 14px 12px 18px; width: 94%; }
    .profile-banner-inner { padding: 26px 18px; border-radius: 20px; }
    .profile-id { min-width: 0; width: 100%; }
    .profile-id h1 { font-size: 23px; }
    .profile-id p { justify-content: center; flex-wrap: wrap; }
    .profile-rank-badge { margin-top: 8px; }
    .profile-logout-btn { width: 100%; justify-content: center; padding: 13px 20px; }

    /* Tab bar becomes a compact 4-across pill dock — SETTINGS always reachable */
    .profile-tabs {
        width: 94%;
        padding: 6px;
        gap: 4px;
        border-bottom: none;
        background: rgba(10, 13, 22, .72);
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 14px;
    }
    .profile-tab {
        flex: 1 1 0;
        min-width: 0;
        padding: 10px 4px;
        font-size: 11.5px;
        letter-spacing: .5px;
        text-align: center;
        border-bottom: none;
        border-radius: 10px;
    }
    .profile-tab.active {
        border-bottom: none;
        background: rgba(143, 91, 255, .16);
    }

    .profile-section { padding: 26px 4% 44px; width: 94%; }
    .profile-section-head h2 { font-size: 22px; }
    .profile-section-head p { font-size: 13.5px; line-height: 1.5; }

    .profile-settings-card { padding: 20px 16px; border-radius: 18px; }
    .profile-settings-id { flex-direction: column; align-items: flex-start; gap: 16px; }
    .profile-settings-id .profile-avatar { width: 84px; height: 84px; }
    .profile-settings-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
    .profile-stat { padding: 16px 10px 14px; border-radius: 16px; }
    .profile-stat-num { font-size: 21px; }
    .profile-btn-ghost, .profile-btn-primary { padding: 10px 14px; font-size: 13px; }
}

/* ============================================================
   PROFILE — phone history grid: compact 2-across like home/browse
   (the inner .anime-card rules from style.css keep each card tight)
   ============================================================ */
@media (max-width: 640px) {
    .profile-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .profile-section {
        padding: 24px 4% 40px;
        width: 94%;
    }
}

/* History cards: the visit-time pill in the badge slot stays tidy next to
   the rating badge, even on compact 2-across phone cards. */
.anime-badge.visited-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    padding: 5px 11px;
    line-height: 1;
    background: rgba(11, 10, 26, .78);
    border: 1px solid rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    white-space: nowrap;
}
.anime-badge.visited-pill i { font-size: 9.5px; }
@media (max-width: 640px) {
    .anime-badge.visited-pill { padding: 4px 8px; }
    .anime-badge.visited-pill i { display: none; }
}
