:root {
    --bg: #0f1117;
    --card: #14151b;
    --text: #fff;
    --muted: #9aa0a6;
    --accent: #4effff;
    --ring: rgba(78, 255, 255, .25);
    --danger: #e74c3c;
    --success: #27ae60;
    --radius: 16px;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased
}

img {
    display: block;
    max-width: 100%
}

button {
    font: inherit
}

.profile-app {
    min-height: 100%;
    display: flex;
    flex-direction: column
}

/* hero */
.hero {
    /* aspect-ratio: 1/1; */
    position: relative;
    min-height: auto;
    background: #0b0c10;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    display: flex;
    flex-direction: column
}

.hero__cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.7)
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, .65) 65%, rgba(15, 17, 23, 1))
}

.hero__bar {
    position: static;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 14px;
    order: 3
}

.hero.has-video {
    border-bottom: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .35);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(6px)
}

.btn.ghost {
    background: transparent
}

/* identity */
.identity {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 10px 10px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 1));
}

.identity__avatar {
    position: relative;
    width: 168px;
    height: 168px;
    margin-top: 24px;
    display: grid;
    place-items: center
}

.identity__avatar .frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 0;
    pointer-events: none
}

.identity__avatar .avatar {
    width: 82%;
    height: 82%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .08)
}

.identity__avatar .badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: contain;
    z-index: 2;
}

.identity .title,
.identity .subtitle,
.identity .id {
    text-align: center
}

.identity .title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 12px 0 4px; /* A bit more space above, 4px gap below */
    line-height: 1.4;
}

.identity .subtitle {
    color: var(--muted);
    font-weight: 400;
    margin: 0 0 6px; /* 6px gap between subtitle and ID */
    line-height: 1.4;
}

.identity .id {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 400;
    margin: 0; 
    line-height: 1.4;
}

/* cover wrapper that won't interfere with existing .hero__cover styles */
.hero__cover-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* match the size/fit of the image cover; no change to your .hero__cover */
.hero__cover-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.7);
    /* mirrors .hero__cover filter */
}

/* stat chips */
.chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px 14px;
    margin-top: 8px
}

@media(min-width:520px) {
    .chips {
        grid-template-columns: repeat(4, 1fr)
    }
}

.chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border-radius: 999px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: var(--shadow)
}

.chip>div {
    text-align: left
}

.chip strong {
    font-weight: 700
}

.chip small {
    display: block;
    color: var(--muted);
    font-size: .75rem;
    margin-top: 2px
}

/* Tabs bar */
.tabs-wrap {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(#0f1117, #0f1117ee 85%, #0f111700);
    padding-block: 8px;
    border-bottom: 1px solid #2c2f3a;
    width: 100%;
}

.tabs {
    position: relative;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 8px 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none
}

/* Edge fades */
.tabs-wrap::before,
.tabs-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22px;
    pointer-events: none;
}

.tabs-wrap::before {
    left: 0;
    background: linear-gradient(90deg, #0f1117, rgba(15, 17, 23, 0));
}

.tabs-wrap::after {
    right: 0;
    background: linear-gradient(270deg, #0f1117, rgba(15, 17, 23, 0));
}

.tab {
    flex: 0 0 auto;
    scroll-snap-align: center;
    border: 1px solid rgba(255, 255, 255, .08);
    background: var(--card);
    color: #bfc5d1;
    border-radius: 999px;
    padding: 10px 14px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
}

.tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tab:active {
    transform: scale(.98)
}

.tab[aria-selected="true"] {
    background: var(--accent);
    color: #000;
    border-color: transparent;
}

#frame-popup .frame-tab[aria-selected="true"] .pill-pro {
    background: linear-gradient(90deg, #003f3f, #005f5f);
    color: #4effff;
    box-shadow: 0 0 8px rgba(78, 255, 255, .25);
}

#frame-popup .frame-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

#frame-popup .frame-pagination .page-label {
    font-size: .85rem;
    color: #9aa0a6;
}

#frame-popup .frame-pagination .btn.pager {
    padding: 6px 10px;
    font-size: 1rem;
}

#frame-popup .frame-pagination .btn.pager[disabled] {
    opacity: .4;
    cursor: not-allowed;
}


/* panels */
.panel {
    display: none;
    padding: 10px 14px 24px
}

.panel[aria-hidden="false"] {
    display: block
}

/* overview */
.section-title {
    margin: 10px 0 8px;
    font-size: 1rem;
    color: #e6ebf2;
    letter-spacing: .3px
}

.achv-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px
}

@media(min-width:520px) {
    .achv-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.achv-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 6px;
    text-align: center;
    box-shadow: var(--shadow)
}

.achv-card .icon {
    aspect-ratio: 1/1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent);
    border-radius: 8px;
    display: grid;
    place-items: center;
    overflow: hidden
}

.achv-card .name {
    margin-top: 4px;
    font-size: .75rem;
    font-weight: 600;
    
    /* 1. Let words wrap to the next line IF there is a space */
    white-space: normal; 
    
    /* 2. If a single word has no spaces and exceeds the width, add ... */
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.guild-card {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 12px;
    box-shadow: var(--shadow);
}

.guild-meta {
    display: flex;
    align-items: center;
    gap: 10px
}

.guild-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent)
}

.guild-name {
    font-weight: 700
}

.guild-role {
    color: var(--muted);
    font-size: .85rem
}

.guild-level {
    color: #e6ebf2
}

.id-card {
    margin-top: 12px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    overflow: hidden
}

.id-card .id-canvas {
    background: linear-gradient(135deg, #1a1d27, #0f1218);
    display: grid;
    place-items: center;
    color: #bfc5d1;
    margin-left: 4px
}

/* inventory */
.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 6px 0 10px
}

.input {
    flex: 1;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    padding: 10px 12px;
    color: #fff
}

.select {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    padding: 10px 12px;
    color: #fff
}

.inv-section {
    margin-top: 10px
}

.inv-title {
    font-weight: 700;
    margin: 6px 0 8px;
    color: #e6ebf2
}

.inv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px
}

@media(min-width:520px) {
    .inv-grid {
        grid-template-columns: repeat(4, 1fr)
    }
}

.inv-card {
    position: relative;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.inv-thumb {
    aspect-ratio: 1/1;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent)
}

.inv-thumb img {
    width: 70%;
    height: 70%;
    object-fit: contain
}

.inv-name {
    padding: 8px 10px;
    font-weight: 700;
    font-size: .95rem
}

.qty {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: .75rem
}

/* pokemons */
.poke-wrap {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 per row */
    gap: 12px;
}

.poke {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 10px;
}

.poke-name {
    font-weight: 700;
    font-size: .95rem;
}

.poke-status {
    font-size: .8rem;
    color: var(--muted);
    background: rgba(255, 255, 255, .05);
    padding: 4px 8px;
    border-radius: 8px;
    /* dialog look */
    margin-top: 2px;
    display: inline-block;
}

.poke img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* toast + loader */
.toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: -80px;
    background: #0f1218;
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: bottom .3s ease;
    z-index: 60
}

.toast.show {
    bottom: 18px
}

.loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1005
}

.loader.show {
    display: flex
}

.spinner {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .15);
    border-top-color: var(--accent);
    animation: spin 1s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* popup (frames) */
/* === Frames dialog (scoped; safe) === */
#frame-popup {
    /* local tokens (only inside the dialog) */
    --card: #0b0c10;
    --border: rgba(255, 255, 255, .06);
    --accent: #4effff;
    --ring: rgba(78, 255, 255, .25);
}

/* container + shell */
#frame-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .82);
    z-index: 900;
    justify-content: center;
    align-items: center;
}

#frame-popup .frame-popup-content {
    width: min(92vw, 900px);
    max-height: min(86vh, 820px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

#frame-popup .close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 26px;
    cursor: pointer;
    color: #fff;
    opacity: .8;
}

#frame-popup .close:hover {
    opacity: 1;
}

/* header */
#frame-popup .frame-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border);
}

#frame-popup .frame-head h2 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: .2px;
}

#frame-popup .frame-head .hint {
    margin: 4px 0 0;
    color: #9aa0a6;
    font-size: .9rem;
}

/* Scoped frame dialog tabs */
#frame-popup .frame-tabs-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
}

#frame-popup .frame-tab {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: var(--card);
    color: #bfc5d1;
    border-radius: 999px;
    padding: 10px 14px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
    margin-right: 8px;
}

#frame-popup .tab {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    background: var(--card);
    color: #bfc5d1;
    border-radius: 999px;
    padding: 10px 14px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
}

#frame-popup .frame-tab:active {
    transform: scale(.98);
}

#frame-popup .frame-tab[aria-selected="true"] {
    background: var(--accent);
    color: #000 !important;
    border-color: transparent;
    font-weight: 700;
}

#frame-popup .pill-pro {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .7rem;
    background: var(--accent);
    color: #000;
    border: 1px solid rgba(0, 0, 0, .06);
}

/* panels */
#frame-popup .panel {
    padding: 14px 14px 16px;
    overflow: auto;
}

#frame-popup .panel[aria-hidden="true"] {
    display: none;
}

/* note */
#frame-popup .note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin: 0 0 12px;
    background: rgba(78, 255, 255, .08);
    border: 1px solid rgba(78, 255, 255, .25);
    border-radius: 12px;
    color: #d9f9ff;
    font-size: .9rem;
}

/* grid + tiles */
#frame-popup .frame-list {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, 1fr);
}

@media (min-width:680px) {
    #frame-popup .frame-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width:980px) {
    #frame-popup .frame-list {
        grid-template-columns: repeat(5, 1fr);
    }
}

#frame-popup .frame-item {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
}

#frame-popup .frame-item:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 6px var(--ring);
}

#frame-popup .frame-item.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 6px var(--ring);
}

#frame-popup .frame-item img,
#frame-popup .frame-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* animated flair + lock */
#frame-popup .frame-item.animated::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(60% 60% at 50% 50%, rgba(78, 255, 255, .12), transparent 60%);
    mix-blend-mode: screen;
}

#frame-popup .badge-animated {
    position: absolute;
    left: 8px;
    top: 8px;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: .7rem;
    font-weight: 700;
    background: rgba(78, 255, 255, .18);
    border: 1px solid rgba(78, 255, 255, .35);
    color: #d9f9ff;
}

#frame-popup .frame-item.locked {
    cursor: not-allowed;
}

#frame-popup .frame-item.locked::after {
    content: "Pro Only";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .55);
    font-weight: 800;
    letter-spacing: .3px;
    color: #eafffb;
}

/* footer + buttons */
#frame-popup .frame-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
}

#frame-popup .foot-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9aa0a6;
    font-size: .9rem;
}

#frame-popup .btn {
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: transform .15s, background .2s, border-color .2s;
}

#frame-popup .btn:active {
    transform: scale(.98);
}

#frame-popup .btn.primary {
    background: var(--accent);
    color: #000 !important;
    border-color: transparent;
    font-weight: 800;
}

#frame-popup .btn.primary:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* focus */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px var(--ring)
}

/* tensura lord */
.achv-card--tensura-lord {
    position: relative;
    border-radius: 12px;
    padding: 6px;
    color: #fff;
    background: linear-gradient(135deg, #2e003e, #551a8b, #8a2be2, #da70d6);
    border: 2px solid rgba(138, 43, 226, .7);
    box-shadow: 0 0 10px rgba(186, 85, 211, .5);
    background-size: 300% 300%;
    animation: achvRoyalRedBG 6s ease infinite;
}

@keyframes achvRoyalRedBG {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

.achv-card--tensura-lord .icon {
    background: #481675
}

/* tensura guardian */
.achv-card--guardian {
    background: linear-gradient(135deg, #001f3f, #005f99, #66ccff, #e0e0e0);
    border: 2px solid rgba(102, 204, 255, .7);
    box-shadow: 0 0 10px rgba(102, 204, 255, .5);
    background-size: 300% 300%;
    animation: guardianBlueGlow 6s ease infinite;
}

@keyframes guardianBlueGlow {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

.achv-card--guardian .icon {
    background: #166592
}

/* desktop/tablet enhancements */
@media (min-width: 768px) {
    .profile-app {
        align-items: center
    }

    .hero {
        aspect-ratio: auto;
        min-height: 380px;
        height: 42vh;
        max-height: 520px;
        width: 100%
    }

    .hero__bar {
        justify-content: space-between;
        gap: 12px;
        padding: 16px 24px
    }

    .identity {
        padding: 64px 24px 18px
    }

    .identity__avatar {
        width: 196px;
        height: 196px
    }

    .identity .title {
        font-size: 1.8rem
    }

    .chips {
        grid-template-columns: repeat(6, 1fr);
        max-width: 1100px;
        width: 100%
    }

    .tabs {
        max-width: 1100px;
        width: 100%;
        margin-inline: auto
    }

    .panel {
        max-width: 1100px;
        width: 100%;
        margin-inline: auto
    }

    .section-title {
        font-size: 1.1rem
    }

    .achv-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }

    .inv-grid {
        grid-template-columns: repeat(6, 1fr)
    }

    .poke-wrap {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media (min-width: 1024px) {

    /* .hero{height:46vh; max-height:560px}*/
    .hero {
        height: 420px
    }

    .identity {
        flex-direction: row;
        gap: 18px;
        align-items: flex-end
    }

    .identity__avatar {
        width: 212px;
        height: 212px;
        margin-top: 0
    }

    .identity .title,
    .identity .subtitle,
    .identity .id {
        text-align: left
    }

    .chips {
        gap: 10px
    }

    .achv-grid {
        grid-template-columns: repeat(10, minmax(0, 1fr));
    }

    .inv-grid {
        grid-template-columns: repeat(8, 1fr)
    }

    .poke-wrap {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media (min-width: 1280px) {
    .hero {
        height: 420px
    }

    .identity {
        gap: 22px
    }

    .identity .title {
        font-size: 2rem
    }

    .tabs {
        padding: 12px 0
    }

    .panel {
        padding: 16px 0 32px
    }

    .inv-grid {
        grid-template-columns: repeat(6, 1fr)
    }
}

/* wide layout polish */
@media (min-width: 768px) {
    .guild-card {
        padding: 14px 16px
    }

    .guild-name {
        font-size: 1.05rem
    }

    .guild-role {
        font-size: .9rem
    }

    .inv-title {
        font-size: 1.05rem
    }

    .chip {
        padding: 12px 14px
    }

    .inv-name {
        font-size: 1rem
    }

    .tab {
        padding: 10px 14px
    }
}

/* large screens: keep content centered */
@media (min-width: 768px) {
    .panel>*:not(.id-card) {
        max-width: 100%
    }

    .toast {
        bottom: 24px
    }
}

/* optional: make hero content width match panels */
@media (min-width: 768px) {

    .hero>.hero__bar,
    .hero>.identity {
        max-width: 1100px;
        width: 100%;
        margin-inline: auto;
        align-items: center;
    }

    .hero>.identity {
        margin-top: 40px
    }
}

#idCanvas svg {
    width: 100%;
    height: auto;
    max-width: 100%;
}

#idCanvas svg image {
    width: 100%;
    height: 100%;
}

/* achievements: empty state */
.achv-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    color: var(--muted);
    min-height: 140px;
    text-align: center;
    box-shadow: var(--shadow);
}

.achv-empty img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    opacity: .9;
}

.achv-empty p {
    margin: 0;
    font-weight: 600;
}


#username.owner {
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(270deg,
            #fbbf24,
            #f59e0b,
            #d97706,
            #facc15,
            #fbbf24);
    background-size: 1000% 1000%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldShift 6s linear infinite;

    /* subtle golden glow */
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.6),
        0 0 15px rgba(217, 119, 6, 0.4);
}

@keyframes goldShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#username.mod {
    font-size: 1.5em;
    /* adjust as needed */
    font-weight: bold;
    background: linear-gradient(270deg,
            #a855f7,
            #9333ea,
            #7e22ce,
            #6d28d9,
            #a855f7);
    background-size: 1000% 1000%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s linear infinite;

    /* subtle glow */
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.6),
        0 0 15px rgba(147, 51, 234, 0.4);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#username.guardian {
    font-size: 1.5em;
    font-weight: bold;
    background: linear-gradient(270deg,
            #4effff,
            #3fd6ff,
            #00bcd4,
            #4effff);
    background-size: 1000% 1000%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: premiumShift 6s linear infinite;

    /* soft aqua glow */
    text-shadow: 0 0 8px rgba(78, 255, 255, 0.6),
        0 0 15px rgba(63, 214, 255, 0.4);
}

@keyframes guardianShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#username.pro {
    background: linear-gradient(270deg,
            #84cc16,
            #a3e635,
            #d9f99d,
            #84cc16);
    background-size: 800% 800%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: oliveShift 12s linear infinite;
    text-shadow: 0 0 6px rgba(163, 230, 53, .6),
        0 0 12px rgba(217, 249, 157, .5);
}

@keyframes oliveShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Deck viewer (read-only) --- */
.cdg-deck-wrap {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: var(--shadow);
}

.cdg-deck-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: .7;
}

.cdg-deck-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 14px;
}

.cdg-slot {
    aspect-ratio: 7/9;
    display: grid;
    place-items: center;
}

.cdg-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 1));
}

@media (min-width:768px) {
    .cdg-deck-grid {
        gap: 14px;
        padding: 16px
    }
}

/* DECK */
.cdg-controls-bar,
.cdg-bg-controls {
    width: 100%;
    max-width: 1140px;
    margin-bottom: 20px !important;
    padding: 0 16px;
}

.cdg-controls-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(23, 26, 36, 0.9), rgba(23, 26, 36, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}


.cdg-deck-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}


#cdg-deck-select {
    background: #1f2332;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    flex: 1 1 260px;
    min-width: 0;
    outline: none;
}

#cdg-deck-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--ring);
}

.cdg-btn-sm {
    background: #2e3141;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.cdg-btn-sm:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

/* Compact icon buttons for prev/next */
#cdg-deck-prev,
#cdg-deck-next {
    width: 38px;
    height: 38px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 10px;
}



/* Optional: keep controls visible while scrolling */
@media (min-width: 769px) {
    .cdg-deck-picker {
        flex: 1 1 60%;
        justify-content: flex-start;
    }


    #cdg-deck-select {
        flex: 1 1 100%;
        max-width: 400px;
    }

    .cdg-controls-bar {
        padding: 14px 24px;
    }
}


/* Mobile tuning */
@media (max-width: 640px) {

    .cdg-deck-picker {
        flex: 1 1 100%;
    }

    .cdg-btn-sm {
        flex: 0 0 auto;
    }

    .cdg-btn-sm {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }

    #cdg-deck-select {
        flex: 1 1 auto;
    }
}

/* Ultra-small devices */
@media (max-width: 380px) {
    .cdg-btn-sm {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }

    .cdg-deck-picker {
        gap: 6px;
    }
}

/* --- Welcome Popup --- */
#welcome-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.welcome-popup-content {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welcome-popup-content .close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 26px;
    cursor: pointer;
    color: #9aa0a6;
    transition: color 0.2s;
}

.welcome-popup-content .close:hover {
    color: #fff;
}

.welcome-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    border: 2px solid var(--accent);
    object-fit: cover;
    box-shadow: 0 0 12px rgba(78, 255, 255, 0.3);
}

.welcome-popup-content h2 {
    margin: 0 0 12px;
    font-size: 1.4rem;
    color: #fff;
}

.welcome-popup-content p {
    color: #9aa0a6;
    margin: 0 0 24px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.welcome-popup-content .btn {
    text-decoration: none;
    font-weight: 700;
    padding: 12px 24px;
    width: 100%;
    justify-content: center;
    border-radius: 999px;
    transition: transform 0.15s, filter 0.2s;
}

.welcome-popup-content .btn:active {
    transform: scale(0.98);
}

.welcome-popup-content .btn.primary {
    background: var(--accent);
    color: #000 !important;
    border: none;
}

.welcome-popup-content .btn.secondary {
    background: transparent;
    color: var(--accent) !important;
    border: 2px solid var(--accent);
}