/*
 * Account menu (desktop dropdown + phone bottom sheet). Spec: ~/lf-ceo/growth/account-menu-2026-12-05/design/spec.md section 3.
 * Loaded after bundle.min.css; overrides the old .user-menu-dropdown / avatar-glow rules without editing the minified bundle.
 * Mobile first: 320 and 360 are the design widths. No text under 14px, rows 44px+, no infinite animations.
 */
:root {
    --text-meta: var(--color-gray-400, #8a8a8a);
    --surface-raised: #161616;
}

/* ---------- trigger: calm avatar with an accent ring, gold gift badge for free rewards ---------- */
.header-user-menu .user-avatar {
    animation: none;
    box-shadow: 0 0 0 2px var(--acct-accent, var(--color-btc-orange, #f7931a));
    color: #111;
    font-size: 0.85rem;
}
.site-header[data-area="earn"] .header-user-menu { --acct-accent: #10b981; }
.site-header[data-area="build"] .header-user-menu { --acct-accent: var(--color-lightning, #9945ff); }
.header-user-menu .user-avatar, .site-header[data-area] .header-user-menu .user-avatar { animation: none; }
.header-user-menu .user-menu-btn.open { box-shadow: none; }
.acct-gift {
    position: absolute; right: -6px; bottom: -6px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--color-btc-gold, #ffd700); color: #1a1200;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px #121212; pointer-events: none;
}
.acct-gift svg { width: 12px; height: 12px; display: block; }
.user-avatar .pnav-av { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.user-avatar.has-pnav-avatar { background: transparent; padding: 0; }

/* ---------- panel (desktop dropdown) ---------- */
.user-menu-dropdown.acct-panel {
    position: absolute; top: calc(100% + 8px); right: 0; left: auto; bottom: auto;
    width: 344px; max-width: calc(100vw - 16px);
    max-height: calc(100vh - 80px); overflow-y: auto; overscroll-behavior: contain;
    background: var(--surface-raised); backdrop-filter: none; -webkit-backdrop-filter: none;
    border: 1px solid var(--border-default, rgba(255,255,255,.12)); border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .12s ease-in, transform .12s ease-in, visibility 0s linear .12s;
    color: #fff; font-family: var(--font-body, inherit); text-align: left;
}
.user-menu-dropdown.acct-panel.open {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .16s cubic-bezier(.2,.8,.2,1), transform .16s cubic-bezier(.2,.8,.2,1), visibility 0s;
}
.acct-panel *, .acct-panel *::before, .acct-panel *::after { box-sizing: border-box; }
.acct-grab { display: none; }
.acct-scrim { display: none; }
.acct-sec { padding: 16px; border-top: 1px solid var(--border-subtle, rgba(255,255,255,.08)); }
.acct-meta { font-size: 0.875rem; line-height: 1.4; color: var(--text-meta); }
.acct-panel a { color: inherit; }

/* identity */
.acct-ident { display: flex; align-items: center; gap: 12px; padding: 16px; }
.acct-ident-av { width: 44px; height: 44px; border-radius: 50%; flex: 0 0 44px; background: linear-gradient(135deg,#f7931a,#ffc107); color: #111; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.acct-ident-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acct-ident-av svg { width: 22px; height: 22px; }
.acct-ident-text { min-width: 0; flex: 1 1 auto; }
.acct-ident-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.acct-role { font-size: 0.875rem; font-weight: 500; line-height: 1.2; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; color: var(--color-btc-orange-light, #ffaa33); }
.acct-role[data-role="earner"] { color: #34d399; }
.acct-role[data-role="builder"] { color: #c084fc; }
.acct-handle { display: inline-block; font-size: 0.875rem; color: var(--text-meta); text-decoration: none; min-height: 44px; line-height: 1.3; display: inline-flex; align-items: center; margin: -10px 0; overflow-wrap: anywhere; }
a.acct-handle { color: var(--color-btc-orange-light, #ffaa33); text-decoration: underline; }

/* money */
.acct-money-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 0.875rem; color: var(--text-meta); }
.acct-amount { display: flex; align-items: baseline; flex-wrap: nowrap; margin: 4px 0 8px; font: 700 1.5rem/1.2 var(--font-mono, monospace); font-variant-numeric: tabular-nums; color: #fff; }
.acct-amount-n { min-width: 0; overflow-wrap: anywhere; }
.acct-amount svg { width: 18px; height: 18px; align-self: center; flex: 0 0 18px; margin-right: 6px; color: var(--color-btc-orange, #f7931a); }
.acct-amount small { font-size: 0.875rem; font-weight: 500; color: var(--text-meta); font-family: var(--font-body, inherit); margin-left: 4px; }
.acct-lines { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.acct-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.875rem; line-height: 1.4; }
.acct-line-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.acct-line-label i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; background: var(--color-gray-500, #6a6a6a); }
.acct-line-label i[data-dot="ok"] { background: var(--color-success, #22c55e); }
.acct-line-label i[data-dot="bonus"] { background: var(--color-btc-orange, #f7931a); }
.acct-line-label i[data-dot="play"] { background: var(--color-info, #3b82f6); }
.acct-line-val { font: 500 0.875rem/1.4 var(--font-mono, monospace); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-bar { margin: 8px 0; }
.acct-bar-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.acct-bar-fill { height: 100%; background: var(--color-btc-orange, #f7931a); border-radius: 3px; }
.acct-bar-text { margin-top: 4px; font-size: 0.875rem; color: var(--text-meta); }
.acct-note { margin: 8px 0 0; font-size: 0.875rem; line-height: 1.4; color: var(--text-meta); }
.acct-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.acct-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 16px; border-radius: 8px; cursor: pointer;
    font: 600 1rem/1 var(--font-body, inherit); text-decoration: none;
    background: transparent; color: #fff; border: 1px solid var(--border-strong, rgba(255,255,255,.2));
}
.acct-btn svg { width: 16px; height: 16px; flex: 0 0 16px; display: block; }
.acct-btn.primary { background: var(--color-btc-orange, #f7931a); color: #111; border-color: transparent; }
.acct-btn:hover { background: rgba(255,255,255,.06); }
.acct-btn.primary:hover { background: var(--color-btc-orange-light, #ffaa33); }
.acct-deposit-sheet { display: none; }

/* free rewards */
.acct-rew-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; font-size: 0.875rem; color: var(--text-meta); }
.acct-rew-head h3 { margin: 0; font: 600 0.875rem/1.3 var(--font-body, inherit); color: #fff; }
.acct-rew-list { list-style: none; margin: 0; padding: 0; }
.acct-reward { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 8px; margin: 0 -8px; border-radius: 8px; text-decoration: none; font-size: 1rem; color: #fff; }
.acct-reward:hover { background: rgba(255,255,255,.06); }
.acct-reward:active { background: rgba(255,255,255,.1); }
.acct-reward-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-reward-l svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--color-gray-300, #b0b0b0); }
.acct-reward[data-state="ready"] .acct-reward-l svg { color: var(--color-btc-gold, #ffd700); }
.acct-reward-s { font-size: 0.875rem; color: var(--text-meta); white-space: nowrap; }
.acct-reward[data-state="ready"] .acct-reward-s { background: var(--color-btc-gold, #ffd700); color: #1a1200; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.acct-rew-line { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 0.875rem; color: var(--text-meta); text-decoration: none; }
.acct-rew-line svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--color-gray-300, #b0b0b0); }
a.acct-rew-line { color: #fff; }

/* navigation and footer */
.acct-nav { padding: 8px; border-top: 1px solid var(--border-subtle, rgba(255,255,255,.08)); display: flex; flex-direction: column; }
.acct-nav-item, .acct-foot-item {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px; border-radius: 8px;
    color: #fff; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left;
    font: 500 1rem/1.3 var(--font-body, inherit);
}
.acct-nav-item:hover, .acct-foot-item:hover { background: rgba(255,255,255,.06); }
.acct-nav-item:active, .acct-foot-item:active { background: rgba(255,255,255,.1); }
.acct-nav-item[aria-current="page"] { font-weight: 600; }
.acct-nav-item > svg, .acct-foot-item > svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--color-gray-300, #b0b0b0); }
.acct-nav-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.acct-nav-desc { font-size: 0.875rem; font-weight: 400; line-height: 1.35; color: var(--text-meta); white-space: normal; }
.acct-nav-meta { font-size: 0.875rem; font-weight: 400; color: var(--text-meta); white-space: nowrap; }
.acct-foot { padding: 8px; border-top: 1px solid var(--border-subtle, rgba(255,255,255,.08)); display: flex; flex-direction: column; }
.acct-foot-item.logout { color: var(--text-meta); }
.acct-foot-item.logout:hover { color: #fff; }
.acct-panel a:focus-visible, .acct-panel button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.acct-nav-item:focus-visible, .acct-foot-item:focus-visible, .acct-reward:focus-visible, .acct-rew-line:focus-visible { outline-offset: -2px; }

/* ---------- hamburger: one "My account" row ---------- */
.mobile-account-open { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px; background: none; border: 0; color: #fff; font: 500 1rem/1.3 var(--font-body, inherit); text-align: left; cursor: pointer; text-decoration: none; }
.mobile-account-open svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--color-gray-300, #b0b0b0); }
.mobile-account-open small { display: block; font-size: 0.875rem; font-weight: 400; color: var(--text-meta); }

/* ---------- phone: bottom sheet ---------- */
@media (max-width: 768px) {
    .user-menu-dropdown.acct-panel {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none;
        max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px);
        border-radius: 16px 16px 0 0; border-bottom: 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%); opacity: 1;
        transition: transform .18s ease-in, visibility 0s linear .18s;
        z-index: 1001;
    }
    .user-menu-dropdown.acct-panel.open { transform: translateY(0); transition: transform .24s cubic-bezier(.2,.8,.2,1), visibility 0s; }
    .user-menu-dropdown.acct-panel.dragging { transition: none; }
    .acct-grab { display: flex; justify-content: center; height: 28px; position: sticky; top: 0; background: var(--surface-raised); z-index: 1; }
    .acct-grab-btn { width: 100%; height: 28px; background: none; border: 0; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; }
    .acct-grab-btn::before { content: ''; position: absolute; left: 0; right: 0; top: 0; bottom: -16px; }
    .acct-grab-btn span { width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); display: block; }
    .acct-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 1000; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
    .acct-scrim.open { opacity: 1; visibility: visible; transition: opacity .2s ease, visibility 0s; }
    .acct-deposit-sheet { display: inline-flex; }
    .acct-actions { grid-template-columns: 1fr 1fr; }
    .acct-actions.single { grid-template-columns: 1fr; }
    html.acct-lock, html.acct-lock body { overflow: hidden; }
    }
@media (min-width: 769px) {
    .acct-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .user-menu-dropdown.acct-panel, .user-menu-dropdown.acct-panel.open { transform: none; transition: opacity .1s linear, visibility 0s; }
    .user-menu-dropdown.acct-panel { opacity: 0; }
    .user-menu-dropdown.acct-panel.open { opacity: 1; }
    .acct-scrim { transition: opacity .1s linear; }
}
