/* ============================================================
   CHARACTER MANAGER LAYOUT
   char-layout.css — top nav + body below, game browser 600x524px
   ============================================================ */

/* ── MAIN LAYOUT: nav trên, content dưới ────────────────────── */
.char-layout {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 100%;
    padding: 8px 8px 20px;
    position: relative;
    z-index: 5;
}

/* ── TOP BAR ─────────────────────────────────────────────────── */
.char-topbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
}

/* ── AVATAR CARD ─────────────────────────────────────────────── */
.char-avatar-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    flex-shrink: 0;
    white-space: nowrap;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
}

.char-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(0,180,160,0.3), rgba(0,40,60,0.8));
    border: 1px solid var(--teal-dim);
    box-shadow: 0 0 12px var(--teal-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

    /* crop to face only — scale up GIF and shift down to show head */
    .char-avatar img {
        width: 180%;
        height: auto;
        margin-left: -40%;
        margin-top: 20px; /* was -8px, now -28px */
        image-rendering: pixelated;
    }

.char-avatar__name {
    font-size: 0.78rem;
    color: #fff;
    letter-spacing: 0.06em;
}

.char-avatar__level {
    font-size: 0.62rem;
    color: var(--teal-dim);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(0,180,160,0.1);
    border: 1px solid rgba(0,180,160,0.2);
    padding: 1px 6px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 2px;
}

/* ── NAV BAR ─────────────────────────────────────────────────── */
.char-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 0 4px;
}

    .char-nav::-webkit-scrollbar {
        display: none;
    }

.char-nav__group {
    display: none;
}

.char-nav__divider {
    width: 1px;
    height: 20px;
    background: rgba(0,180,160,0.2);
    margin: 0 2px;
    flex-shrink: 0;
}

.char-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    font-size: 0.65rem;
    color: var(--text-dim);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    background: none;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    letter-spacing: 0.03em;
    font-family: 'Roboto', sans-serif;
}

    .char-nav__item:hover {
        color: var(--text);
        border-bottom-color: rgba(0,180,160,0.4);
        background: rgba(0,180,160,0.05);
        text-decoration: none;
    }

    .char-nav__item.active {
        color: var(--teal);
        border-bottom-color: var(--teal);
        background: rgba(0,180,160,0.08);
    }

.char-nav__icon {
    font-size: 1rem;
}

/* ── PAGE CONTENT ────────────────────────────────────────────── */
.char-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.char-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.char-page-title {
    font-family: 'Roboto', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    color: #fff;
    text-transform: uppercase;
}

.char-page-sub {
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* ============================================================
   SILK CHARGER
   ============================================================ */

/* ── SPINNER ── */
.auth-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0,180,160,0.2);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: char-spin 0.8s linear infinite;
}

/* ── BACK BUTTON ── */
.silk-back-btn {
    margin-left: auto;
    background: rgba(0,180,160,0.1);
    border: 1px solid rgba(0,180,160,0.3);
    color: var(--teal);
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: background 0.2s;
}

    .silk-back-btn:hover {
        background: rgba(0,180,160,0.25);
    }

/* ── SUCCESS VIEW ── */
.silk-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
}

.silk-success__icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 16px rgba(0,180,160,0.9));
    animation: successPop 0.5s ease;
}

.silk-success__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--teal);
    letter-spacing: 0.08em;
}

.silk-success__amount {
    font-size: 2.4rem;
    font-weight: 900;
    color: #00ffcc;
    text-shadow: 0 0 24px rgba(0,255,200,0.7);
    line-height: 1.1;
}

.silk-success__msg {
    font-size: 0.82rem;
    color: var(--text-dim);
}

.silk-success__balance {
    font-size: 0.85rem;
    color: var(--text);
    background: rgba(0,180,160,0.08);
    border: 1px solid rgba(0,180,160,0.2);
    padding: 6px 20px;
    border-radius: 20px;
}

.silk-success__countdown {
    font-size: 0.72rem;
    color: var(--text-dim);
    opacity: 0.7;
    margin-top: 4px;
}

@keyframes successPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ── BALANCE CARD ── */
.silk-balance__amount--flash {
    animation: balanceFlash 1.2s ease;
}

@keyframes balanceFlash {
    0% {
        color: var(--text);
        text-shadow: none;
    }

    40% {
        color: #00ffcc;
        text-shadow: 0 0 20px rgba(0,255,200,0.8);
    }

    100% {
        color: var(--text);
        text-shadow: none;
    }
}

.silk-balance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}

.silk-balance__info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.silk-balance__icon {
    font-size: .9rem;
}

.silk-balance__label {
    font-size: .6rem;
}

.silk-balance__amount {
    font-size: .95rem;
    line-height: 1.2;
}

.silk-balance__sub {
    font-size: .58rem;
}

.silk-balance__polling {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .58rem;
    color: var(--text-dim);
    opacity: 0.7;
}

.silk-poll-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 6px var(--teal);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* ── PACKAGE BUY BUTTON ── */
.silk-package__buy {
    font-family: 'Roboto',sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(0,180,160,0.15);
    border: 1px solid rgba(0,180,160,0.3);
    color: var(--teal);
    padding: 5px 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

    .silk-package__buy:hover {
        background: rgba(0,180,160,0.3);
        box-shadow: 0 0 10px var(--teal-glow);
    }


/* ── QR SECTION ── */
.qr-section {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    margin-top: 10px;
    padding: 20px;
    background: rgba(0,180,160,0.04);
    border: 1px solid rgba(0,180,160,0.2);
    border-radius: 4px;
    align-items: start;
}

.qr-section__info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qr-section__title {
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.qr-section__highlight {
    color: var(--teal);
    font-weight: 700;
}

.qr-section__price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(200,168,75,0.3);
}

.qr-section__note {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.qr-section__steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.qr-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.qr-step__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,180,160,0.15);
    border: 1px solid rgba(0,180,160,0.3);
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.qr-section__image {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.qr-section__label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--teal);
    font-weight: 600;
}

/* ── QR SILK BREAKDOWN ── */
.qr-silk-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(0,180,160,0.06);
    border: 1px solid rgba(0,180,160,0.15);
    border-radius: 3px;
}

.qr-silk-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.qr-silk-val {
    font-weight: 600;
    color: var(--text);
}

.qr-silk-bonus {
    color: #00e080 !important;
}

.qr-silk-total {
    border-top: 1px solid rgba(0,180,160,0.2);
    margin-top: 4px;
    padding-top: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--teal) !important;
}

    .qr-silk-total .qr-silk-val {
        color: var(--teal) !important;
    }

@keyframes char-spin {
    to {
        transform: rotate(360deg);
    }
}
