/* Mistfall Hunter Wiki — Build Planner
   Paleta y formas tomadas de MediaWiki:Citizen.css */

:root {
    --surface-0: #07090b;
    --surface-1: #0d1116;
    --surface-2: #141a22;
    --surface-3: #1b232d;
    --text: #d9d6cc;
    --text-strong: #fff4da;
    --text-subtle: #a99f8c;
    --gold: #d7a84f;
    --gold-soft: #e8c16d;
    --gold-line: rgba(215, 168, 79, 0.26);
    --gold-glow: rgba(215, 168, 79, 0.18);
    --good: #6fd38a;
    --bad: #ef6b63;
    --radius-lg: 24px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
    --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* rarezas (mismos valores que .mf-quality-* de la wiki) */
.r-damaged   { --r: #8d8a83; --r-rgb: 141, 138, 131; }
.r-common    { --r: #d6d6d1; --r-rgb: 214, 214, 209; }
.r-rare      { --r: #57c96b; --r-rgb: 87, 201, 107; }
.r-excellent { --r: #4b98ff; --r-rgb: 75, 152, 255; }
.r-epic      { --r: #a95cff; --r-rgb: 169, 92, 255; }
.r-legendary { --r: #e8b43e; --r-rgb: 232, 180, 62; }
.r-holy      { --r: #e6534d; --r-rgb: 230, 83, 77; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font: 15px/1.55 var(--font);
    background:
        radial-gradient(circle at 50% 0%, rgba(177, 126, 45, 0.18), transparent 34rem),
        linear-gradient(180deg, #050608 0%, #0b1013 48%, #050608 100%) fixed;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

/* ---------- Top bar ---------- */

.bb-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px clamp(14px, 4vw, 32px);
    background: rgba(7, 9, 11, 0.86);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(215, 168, 79, 0.12);
}

.bb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-strong);
    font-weight: 700;
    letter-spacing: 0.01em;
}
.bb-brand:hover { text-decoration: none; color: #fff; }
.bb-brand img { width: 40px; height: 40px; object-fit: contain; display: block; transition: filter .2s; }
.bb-brand:hover img { filter: drop-shadow(0 0 6px rgba(215, 168, 79, 0.55)); }

.bb-topnav { display: flex; gap: 18px; font-size: 0.92rem; }
.bb-topnav a { color: var(--text-subtle); }
.bb-topnav a:hover { color: var(--gold-soft); text-decoration: none; }

/* ---------- Page ---------- */

.bb-page {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: 24px clamp(14px, 4vw, 32px) 120px;
}

.bb-card {
    background: linear-gradient(180deg, rgba(20, 26, 34, 0.92), rgba(13, 17, 22, 0.94));
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(16px, 2.4vw, 26px);
}

.bb-kicker {
    display: inline-flex;
    padding: 6px 14px;
    border: 1px solid rgba(215, 168, 79, 0.35);
    border-radius: 999px;
    background: rgba(215, 168, 79, 0.08);
    color: var(--gold-soft);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.bb-section-title {
    margin: 0;
    color: var(--gold-soft);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.bb-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.bb-subtitle {
    margin: 22px 0 10px;
    color: var(--text-subtle);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* ---------- Hero ---------- */

.bb-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: clamp(22px, 4vw, 40px);
    border: 1px solid var(--gold-line);
    border-radius: 28px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(5, 6, 8, 0.94), rgba(5, 6, 8, 0.7) 55%, rgba(5, 6, 8, 0.35)),
        url("/assets/season2-fires-of-the-past.webp") 70% 35% / cover no-repeat;
    box-shadow: var(--shadow);
}
.bb-hero h1 {
    margin: 14px 0 8px;
    color: var(--text-strong);
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
}
.bb-hero p { margin: 0; max-width: 560px; color: #d8cfbd; }
.bb-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */

.bb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid rgba(215, 168, 79, 0.4);
    border-radius: 999px;
    background: rgba(13, 17, 22, 0.7);
    color: var(--text-strong);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.bb-btn:hover { border-color: var(--gold); background: rgba(215, 168, 79, 0.12); }
.bb-btn:active { transform: translateY(1px); }
.bb-btn--gold {
    border-color: transparent;
    background: linear-gradient(180deg, #e7bd66, #b8862f);
    color: #120d05;
    box-shadow: 0 10px 30px rgba(215, 168, 79, 0.25);
}
.bb-btn--gold:hover { background: linear-gradient(180deg, #f0c977, #c4923a); }
.bb-btn--small { min-height: 36px; padding: 0 14px; font-size: 0.88rem; }

.bb-icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--gold-line);
    border-radius: 50%;
    background: rgba(13, 17, 22, 0.8);
    color: var(--text-strong);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.bb-icon-btn:hover { border-color: var(--gold); }

/* ---------- Classes ---------- */

.bb-classes { margin-bottom: 18px; }
.bb-classes .bb-section-title { margin-bottom: 14px; }

.bb-class-list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.bb-class {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px 12px;
    border: 1px solid rgba(215, 168, 79, 0.16);
    border-radius: var(--radius);
    background: rgba(7, 9, 11, 0.55);
    color: var(--text-subtle);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.bb-class img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: grayscale(0.6) brightness(0.8);
    transition: filter 0.15s;
}
.bb-class:hover { border-color: rgba(215, 168, 79, 0.45); color: var(--text-strong); }
.bb-class:hover img { filter: none; }
.bb-class[aria-checked="true"] {
    border-color: var(--gold);
    background: radial-gradient(circle at 50% 0%, rgba(215, 168, 79, 0.22), rgba(7, 9, 11, 0.6) 70%);
    color: var(--text-strong);
    box-shadow: 0 0 0 1px rgba(215, 168, 79, 0.35), 0 12px 30px rgba(215, 168, 79, 0.12);
}
.bb-class[aria-checked="true"] img { filter: drop-shadow(0 4px 14px rgba(215, 168, 79, 0.45)); }
.bb-class small { color: var(--text-subtle); font-weight: 500; font-size: 0.72rem; text-align: center; }

/* ---------- Layout ---------- */

.bb-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 18px;
    align-items: start;
}

.bb-stats { position: sticky; top: 74px; }

/* ---------- Slots ---------- */

.bb-group-title {
    margin: 18px 0 10px;
    color: var(--text-subtle);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.bb-section-head + .bb-group-title { margin-top: 0; }
.bb-weapons,
.bb-slots--two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.bb-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 12px;
}
.bb-slots.bb-slots--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bb-slot.has-badge .bb-slot-label { padding-right: 58px; }

.bb-slot {
    --r: rgba(215, 168, 79, 0.5);
    --r-rgb: 215, 168, 79;
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 12px;
    border: 1px solid rgba(var(--r-rgb), 0.28);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 0% 50%, rgba(var(--r-rgb), 0.12), transparent 60%),
        rgba(7, 9, 11, 0.6);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.bb-slot:hover {
    border-color: rgba(var(--r-rgb), 0.7);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(var(--r-rgb), 0.12);
}
.bb-slot.is-empty { --r-rgb: 215, 168, 79; border-style: dashed; background: rgba(7, 9, 11, 0.45); }
.bb-slot.is-inactive { opacity: 0.6; }

.bb-slot-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 1px solid rgba(var(--r-rgb), 0.45);
    background: radial-gradient(circle at 50% 35%, rgba(var(--r-rgb), 0.3), rgba(5, 6, 8, 0.9) 75%);
    overflow: hidden;
}
.bb-slot-icon img { width: 56px; height: 56px; object-fit: contain; }
.bb-slot.is-empty .bb-slot-icon { color: rgba(215, 168, 79, 0.6); font-size: 1.6rem; font-weight: 300; }

.bb-slot-body { display: block; min-width: 0; }
.bb-slot-label, .bb-slot-name, .bb-slot-stats { display: block; }
.bb-slot-label {
    color: var(--text-subtle);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.bb-slot-name {
    margin-top: 2px;
    color: var(--r);
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bb-slot.is-empty .bb-slot-name { color: var(--text-subtle); font-weight: 500; }
.bb-slot-stats {
    margin-top: 4px;
    color: var(--text-subtle);
    font-size: 0.76rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bb-slot-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(215, 168, 79, 0.16);
    color: var(--gold-soft);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.bb-weapons .bb-slot { min-height: 104px; grid-template-columns: 76px minmax(0, 1fr); }
.bb-weapons .bb-slot-icon { width: 76px; height: 76px; }
.bb-weapons .bb-slot-icon img { width: 68px; height: 68px; }

/* ---------- Stats ---------- */

.bb-toggle {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: rgba(5, 6, 8, 0.6);
}
.bb-toggle button {
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-subtle);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.bb-toggle button[aria-pressed="true"] { background: var(--gold); color: #120d05; }

.bb-stat-list { margin: 0; display: grid; gap: 2px; }
.bb-stat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: rgba(5, 6, 8, 0.35);
}
.bb-stat:nth-child(odd) { background: rgba(5, 6, 8, 0.55); }
.bb-stat dt { color: var(--text); font-size: 0.9rem; }
.bb-stat dd { margin: 0; color: var(--text-strong); font-weight: 800; font-variant-numeric: tabular-nums; }
.bb-stat.is-zero dd { color: #5f5a50; font-weight: 600; }
.bb-stat.is-main dt { color: var(--text-strong); font-weight: 700; }
.bb-stat.is-main dd { color: var(--gold-soft); font-size: 1.08rem; }

.bb-value {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--gold-line);
    border-radius: var(--radius);
    background: rgba(215, 168, 79, 0.06);
}
.bb-value strong { color: var(--text-strong); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.bb-value span { color: var(--text-subtle); font-size: 0.8rem; text-align: right; }

.bb-save { display: flex; gap: 8px; }
.bb-share {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-sm);
    background: rgba(5, 6, 8, 0.45);
}
.bb-share-status { margin: 6px 0 0 25px; font-size: 0.78rem; color: var(--text-subtle); line-height: 1.45; }
.bb-share-status.is-ok { color: var(--good); }
.bb-share-fields { display: grid; gap: 8px; margin-top: 10px; }
.bb-share-fields[hidden] { display: none; }
.bb-share-fields input, .bb-share-fields textarea {
    width: 100%;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--gold-line);
    border-radius: var(--radius-sm);
    background: rgba(5, 6, 8, 0.6);
    color: var(--text);
    font: inherit;
    font-size: 0.86rem;
    resize: vertical;
}
.bb-share-fields small { color: var(--text-subtle); font-size: 0.74rem; line-height: 1.4; }
.bb-save input {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: rgba(5, 6, 8, 0.6);
}
.bb-saves { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.bb-saves li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
    padding: 6px 6px 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(5, 6, 8, 0.45);
    font-size: 0.86rem;
}
.bb-saves li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-saves li small { color: var(--text-subtle); }
.bb-saves button {
    padding: 4px 10px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: 0.76rem;
    cursor: pointer;
}
.bb-saves button:hover { border-color: var(--gold); }
.bb-saves .bb-empty { color: var(--text-subtle); background: none; padding-left: 0; }

.bb-note { margin: 20px 0 0; color: var(--text-subtle); font-size: 0.76rem; line-height: 1.5; }
.bb-sheet-close { display: none; }

.bb-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
    color: var(--text-subtle);
    font-size: 0.8rem;
}

/* ---------- Picker ---------- */

.bb-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
}

.bb-picker {
    position: fixed;
    z-index: 50;
    top: 50%;
    left: 50%;
    width: min(820px, calc(100vw - 32px));
    max-height: min(780px, calc(100vh - 48px));
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(215, 168, 79, 0.35);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #151b23, #0b0f14);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7);
}
.bb-picker-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 12px;
}
.bb-picker-head h2 { margin: 10px 0 0; color: var(--text-strong); font-size: 1.35rem; }
.bb-picker-tools { padding: 0 22px 12px; display: grid; gap: 10px; }
.bb-picker-tools input {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: rgba(5, 6, 8, 0.7);
}
.bb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bb-chip {
    padding: 5px 12px;
    border: 1px solid rgba(var(--r-rgb, 215, 168, 79), 0.4);
    border-radius: 999px;
    background: transparent;
    color: var(--r, var(--text));
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.bb-chip[aria-pressed="true"] { background: rgba(var(--r-rgb, 215, 168, 79), 0.18); border-color: var(--r, var(--gold)); }

.bb-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 22px 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-content: start;
    overscroll-behavior: contain;
}
.bb-picker-empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--text-subtle); }

.bb-option {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(var(--r-rgb), 0.25);
    border-radius: var(--radius);
    background: radial-gradient(circle at 0% 0%, rgba(var(--r-rgb), 0.1), transparent 60%), rgba(7, 9, 11, 0.6);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.bb-option:hover, .bb-option:focus-visible { border-color: rgba(var(--r-rgb), 0.75); }
.bb-option.is-current { border-color: var(--r); box-shadow: inset 0 0 0 1px rgba(var(--r-rgb), 0.5); }
.bb-option .bb-slot-icon { width: 56px; height: 56px; }
.bb-option .bb-slot-icon img { width: 50px; height: 50px; }
.bb-option-body { display: block; min-width: 0; }
.bb-option-name { display: block; color: var(--r); font-weight: 700; line-height: 1.25; }
.bb-option-meta { display: block; color: var(--text-subtle); font-size: 0.74rem; margin: 2px 0 7px; }
.bb-option-stats { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.bb-pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 244, 218, 0.06);
    color: var(--text);
    font-size: 0.74rem;
    white-space: nowrap;
}
.bb-pill .up { color: var(--good); font-weight: 700; }
.bb-pill .down { color: var(--bad); font-weight: 700; }

.bb-picker-foot {
    display: flex;
    justify-content: flex-end;
    padding: 12px 22px 18px;
    border-top: 1px solid rgba(215, 168, 79, 0.12);
}

/* ---------- Summary bar & toast ---------- */

.bb-summary { display: none; }

.bb-toast {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    padding: 10px 18px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: #141a22;
    color: var(--text-strong);
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.bb-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .bb-layout { grid-template-columns: minmax(0, 1fr) 330px; }
    .bb-class-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .bb-topnav { display: none; }
    .bb-layout { grid-template-columns: minmax(0, 1fr); }
    .bb-hero { align-items: flex-start; background-position: 0 0, 50% 0; background-size: auto, auto 160%; }
    .bb-hero-actions { width: 100%; }
    .bb-hero-actions .bb-btn { flex: 1; }

    .bb-class-list {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        margin: 0 -8px;
        padding: 2px 8px 6px;
    }
    .bb-class { flex: 0 0 104px; scroll-snap-align: start; }

    /* el panel de stats se convierte en hoja inferior */
    .bb-stats {
        position: fixed;
        z-index: 50;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        max-height: 86vh;
        overflow-y: auto;
        border-radius: 24px 24px 0 0;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        transform: translateY(105%);
        transition: transform 0.25s ease;
        overscroll-behavior: contain;
    }
    .bb-stats.open { transform: translateY(0); }
    .bb-sheet-close {
        display: block;
        position: sticky;
        top: 0;
        margin: -6px -6px 6px auto;
        width: 38px;
        height: 38px;
        border: 1px solid var(--gold-line);
        border-radius: 50%;
        background: #141a22;
        color: var(--text-strong);
        font-size: 1.3rem;
        cursor: pointer;
    }

    .bb-summary {
        position: fixed;
        z-index: 35;
        left: 10px;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 10px 10px 16px;
        border: 1px solid rgba(215, 168, 79, 0.4);
        border-radius: 18px;
        background: rgba(13, 17, 22, 0.94);
        backdrop-filter: blur(12px);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    }
    .bb-summary-stats { display: flex; gap: 14px; min-width: 0; overflow: hidden; }
    .bb-summary-stats div { display: grid; line-height: 1.15; }
    .bb-summary-stats small { color: var(--text-subtle); font-size: 0.64rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
    .bb-summary-stats b { color: var(--text-strong); font-variant-numeric: tabular-nums; }

    /* el selector ocupa toda la pantalla desde abajo */
    .bb-picker {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 92vh;
        transform: none;
        border-radius: 24px 24px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bb-picker-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
    body { font-size: 14px; }
    .bb-weapons, .bb-slots, .bb-slots--two, .bb-slots.bb-slots--two { grid-template-columns: minmax(0, 1fr); }
    .bb-slot, .bb-weapons .bb-slot { min-height: 80px; grid-template-columns: 58px minmax(0, 1fr); }
    .bb-slot-icon, .bb-weapons .bb-slot-icon { width: 58px; height: 58px; }
    .bb-slot-icon img, .bb-weapons .bb-slot-icon img { width: 52px; height: 52px; }
    .bb-picker-head, .bb-picker-tools, .bb-picker-list, .bb-picker-foot { padding-left: 14px; padding-right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---------- Tabs ---------- */

.bb-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--gold-line);
    border-radius: 999px;
    background: rgba(5, 6, 8, 0.6);
}
.bb-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-subtle);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.bb-tabs button:hover { color: var(--text-strong); }
.bb-tabs button small {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 244, 218, 0.08);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.bb-tabs button[aria-selected="true"] {
    background: linear-gradient(180deg, rgba(232, 193, 109, 0.22), rgba(215, 168, 79, 0.1));
    color: var(--gold-soft);
    box-shadow: inset 0 0 0 1px rgba(215, 168, 79, 0.45);
}
.bb-tabs button[aria-selected="true"] small { background: rgba(215, 168, 79, 0.2); color: var(--text-strong); }
.bb-panel > .bb-group-title:first-child { margin-top: 0; }

/* ---------- Skills ---------- */

.bb-panel-intro { margin: 0 0 14px; color: var(--text); font-size: 0.92rem; line-height: 1.55; }
.bb-panel-intro b { color: var(--text-strong); }
.bb-skill-filter { margin-bottom: 6px; }
.bb-skill-filter .bb-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.bb-skill-filter .bb-chip small { color: var(--text-subtle); font-weight: 600; }
.bb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-soft); box-shadow: 0 0 8px var(--gold); }

.bb-skill-group { margin-top: 22px; }
.bb-skill-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(215, 168, 79, 0.14);
}
.bb-skill-group-head h3 { margin: 0; color: var(--text-strong); font-size: 1.08rem; }
.bb-skill-group-head p { margin: 3px 0 0; color: var(--text-subtle); font-size: 0.84rem; }
.bb-skill-group.is-none .bb-skill { opacity: 0.72; }
.bb-skill-group.is-none .bb-skill:hover { opacity: 1; }

.bb-tag {
    flex: none;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 244, 218, 0.14);
    color: var(--text-subtle);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.bb-tag.is-active { border-color: var(--gold); background: rgba(215, 168, 79, 0.16); color: var(--gold-soft); }
.bb-tag.is-equipped { border-color: rgba(215, 168, 79, 0.45); color: var(--gold-soft); }
.bb-tag.is-shared { border-color: rgba(111, 211, 138, 0.4); color: var(--good); }

.bb-skill-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bb-skill {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(215, 168, 79, 0.2);
    border-radius: var(--radius);
    background: radial-gradient(circle at 0% 0%, rgba(215, 168, 79, 0.08), transparent 55%), rgba(7, 9, 11, 0.6);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.bb-skill:hover {
    border-color: rgba(215, 168, 79, 0.65);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(215, 168, 79, 0.1);
}
.bb-skill-group.is-active .bb-skill { border-color: rgba(215, 168, 79, 0.42); }
.bb-skill-icon {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid rgba(215, 168, 79, 0.35);
    background: #05070a;
    overflow: hidden;
}
.bb-skill-icon img { width: 100%; height: 100%; object-fit: cover; }
.bb-skill-body { display: block; min-width: 0; }
.bb-skill-name { display: block; color: var(--text-strong); font-weight: 800; line-height: 1.25; }
.bb-skill-desc {
    display: -webkit-box;
    margin-top: 6px;
    color: var(--text-subtle);
    font-size: 0.8rem;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bb-type {
    display: inline-block;
    margin-top: 5px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 244, 218, 0.07);
    color: var(--text);
}
.bb-type.t-weapon { background: rgba(215, 168, 79, 0.15); color: var(--gold-soft); }
.bb-type.t-class  { background: rgba(75, 152, 255, 0.15); color: #8fbfff; }
.bb-type.t-shared { background: rgba(111, 211, 138, 0.14); color: var(--good); }

/* hoja de detalle */
.bb-skill-sheet { width: min(640px, calc(100vw - 32px)); }
.bb-skill-sheet-body { overflow-y: auto; overscroll-behavior: contain; }
.bb-skill-sheet .bb-skill-sheet-body { padding: 0 22px 18px; flex: 1; }
.bb-skill-anim {
    margin: 0 0 14px;
    border: 1px solid rgba(215, 168, 79, 0.25);
    border-radius: var(--radius);
    background: #05070a;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}
.bb-skill-anim { background: radial-gradient(circle, rgba(215, 168, 79, 0.08), transparent 70%), #05070a; }
.bb-skill-anim { position: relative; }
.bb-skill-anim img { position: relative; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s; }
.bb-skill-anim.is-ready img { opacity: 1; }
/* loading state while the (large) animation downloads */
.bb-skill-anim::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid rgba(215, 168, 79, 0.2);
    border-top-color: var(--gold-soft);
    border-radius: 50%;
    animation: bb-spin 0.9s linear infinite;
}
.bb-skill-anim::after {
    content: attr(data-loading);
    position: absolute;
    left: 0;
    right: 0;
    top: calc(50% + 26px);
    text-align: center;
    color: var(--text-subtle);
    font-size: 0.75rem;
}
.bb-skill-anim.is-ready::before, .bb-skill-anim.is-ready::after { display: none; }
@keyframes bb-spin { to { transform: rotate(360deg); } }
.bb-skill-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bb-skill-meta .bb-type { margin: 0 0 3px; }
.bb-skill-meta small { display: block; color: var(--text-subtle); font-size: 0.78rem; }
.bb-skill-text { color: var(--text); line-height: 1.65; font-size: 0.95rem; }
.bb-skill-text p { margin: 0 0 10px; }
.bb-skill-text i { color: var(--text-subtle); }
.bb-kw { color: var(--gold-soft); font-weight: 700; }
.bb-skill-foot { justify-content: space-between; gap: 8px; }
.bb-skill-foot a.bb-btn { display: inline-flex; align-items: center; text-decoration: none; }
.bb-btn:disabled { opacity: 0.35; cursor: default; }

/* talentos (próximamente) */
.bb-soon {
    padding: 40px 20px;
    text-align: center;
    border: 1px dashed rgba(215, 168, 79, 0.35);
    border-radius: var(--radius);
    background: radial-gradient(circle at 50% 0%, rgba(215, 168, 79, 0.1), transparent 60%);
}
.bb-soon-icon { color: var(--gold-soft); font-size: 2rem; }
.bb-soon h3 { margin: 8px 0; color: var(--text-strong); }
.bb-soon p { max-width: 460px; margin: 0 auto; color: var(--text-subtle); line-height: 1.6; }

@media (max-width: 860px) {
    .bb-skill-sheet { width: 100%; }
    .bb-tabs { position: sticky; top: 64px; z-index: 20; backdrop-filter: blur(10px); background: rgba(5, 6, 8, 0.85); }
}
@media (max-width: 640px) {
    .bb-skill-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
    .bb-tabs button { font-size: 0.72rem; letter-spacing: 0.06em; gap: 5px; padding: 0 6px; }
    .bb-tabs button small { display: none; }
    .bb-skill-sheet .bb-skill-sheet-body { padding: 0 14px 14px; }
    .bb-skill-group-head { flex-direction: column; gap: 6px; }
}


/* ---------- gems & affixes ---------- */
.t-peridot  { --g: #9ccc4a; }
.t-agate    { --g: #e0793f; }
.t-moonstone { --g: #7fb6ff; }
.t-amethyst { --g: #b77cff; }
.c-red    { --a: #e6604f; }
.c-blue   { --a: #5aa2ff; }
.c-yellow { --a: #e8b43e; }
.bb-chip.t-peridot, .bb-chip.t-agate, .bb-chip.t-moonstone, .bb-chip.t-amethyst { color: var(--g); }
.bb-slot-gems { display: flex; align-items: center; gap: 3px; margin-top: 4px; }
.bb-slot-gems img { width: 18px; height: 18px; object-fit: contain; }
.bb-slot-gems small { margin-left: 4px; font-size: 0.7rem; color: rgba(236, 225, 204, 0.6); }
.bb-gem-pieces { display: grid; gap: 12px; }
.bb-gem-piece {
    border: 1px solid rgba(var(--r-rgb, 215, 168, 79), 0.28);
    border-radius: 14px;
    padding: 12px;
    background: linear-gradient(180deg, rgba(var(--r-rgb, 215, 168, 79), 0.06), rgba(0, 0, 0, 0.12));
}
.bb-gem-piece.is-inactive { opacity: 0.6; }
.bb-gem-piece header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bb-gem-piece header .bb-slot-icon { width: 44px; height: 44px; flex: none; }
.bb-gem-piece header .bb-slot-name { color: var(--r); }
.bb-sockets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bb-socket {
    display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 58px;
    padding: 8px; text-align: left; cursor: pointer; color: inherit; font: inherit;
    border-radius: 10px; border: 1px solid rgba(var(--r-rgb, 215, 168, 79), 0.2);
    border-left: 3px solid var(--g, rgba(215, 168, 79, 0.35));
    background: rgba(5, 7, 10, 0.55);
}
.bb-socket:hover, .bb-socket:focus-visible { border-color: rgba(215, 168, 79, 0.6); outline: none; }
.bb-socket.is-empty { border-style: dashed; border-left-width: 1px; color: rgba(236, 225, 204, 0.55); }
.bb-socket-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; font-size: 1.2rem; }
.bb-socket-icon img { width: 36px; height: 36px; object-fit: contain; }
.bb-socket-body { min-width: 0; display: grid; gap: 2px; }
.bb-socket-name { font-weight: 700; font-size: 0.82rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bb-socket:not(.is-empty) .bb-socket-name { color: var(--g); }
.bb-socket-body small { font-size: 0.7rem; color: rgba(236, 225, 204, 0.6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-gem-option .bb-option-name { color: var(--g); }
.bb-gem-affixes { display: grid; gap: 4px; margin-top: 6px; }
.bb-affix-line { display: flex; gap: 6px; align-items: flex-start; font-size: 0.76rem; line-height: 1.35; color: rgba(236, 225, 204, 0.78); }
.bb-affix-line b { color: var(--a); }
.bb-affix-icon { flex: none; display: grid; place-items: center; }
.bb-affix-icon img { object-fit: contain; }
.bb-affix-noicon {
    width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
    font-size: 0.7rem; font-weight: 700; color: #0b1013; background: var(--a, #e8b43e);
}
.bb-affix {
    display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border-radius: 10px;
    background: rgba(5, 7, 10, 0.45); border-left: 3px solid var(--a);
}
.bb-affix .bb-affix-noicon { width: 28px; height: 28px; }
.bb-subtitle small { font-weight: 400; opacity: 0.6; margin-left: 4px; }
@media (max-width: 640px) {
    .bb-sockets { grid-template-columns: minmax(0, 1fr); }
    .bb-socket { min-height: 52px; }
}
.bb-gem-piece header .bb-slot-icon img { width: 40px; height: 40px; }
/* afijos: mismo marco que en la wiki (iconos oscuros sobre fondo de color) */
.c-red    { --a-rgb: 230, 83, 77; }
.c-blue   { --a-rgb: 75, 152, 255; }
.c-yellow { --a-rgb: 232, 180, 62; }
.bb-affix-icon {
    width: 26px; height: 26px; border-radius: 7px;
    border: 1px solid rgba(var(--a-rgb, 232, 180, 62), 0.6);
    background: radial-gradient(circle at 50% 35%, rgba(var(--a-rgb, 232, 180, 62), 0.4), rgba(18, 14, 10, 0.95) 75%);
}
.bb-affix-icon img { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.bb-affix .bb-affix-icon { width: 36px; height: 36px; border-radius: 9px; }
.bb-affix .bb-affix-icon img { width: 30px; height: 30px; }
.bb-affix-icon .bb-affix-noicon, .bb-affix .bb-affix-icon .bb-affix-noicon { width: 100%; height: 100%; background: none; color: rgba(255, 244, 218, 0.8); }


/* ---------- tipos de hueco ---------- */
.s-p { --s: #9ccc4a; }
.s-a { --s: #e0793f; }
.s-m { --s: #7fb6ff; }
.s-y { --s: #b77cff; }
.s-x { --s: #f3e6c8; }
.s-u { --s: rgba(236, 225, 204, 0.5); }
.bb-slot-type {
    justify-self: start; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--s); padding: 1px 6px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--s) 45%, transparent);
}
.bb-socket.is-empty { border-left: 3px solid var(--s, rgba(215, 168, 79, 0.35)); }
.bb-picker-slot:empty { display: none; }
.bb-picker-slot { padding: 0 18px 10px; }
.bb-slot-pick { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(5, 7, 10, 0.5); border: 1px solid rgba(215, 168, 79, 0.18); }
.bb-slot-pick-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #d7a84f; }
.bb-slot-pick-label small { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; color: rgba(236, 225, 204, 0.7); margin-top: 2px; }
.bb-chip-label { align-self: center; min-width: 46px; font-size: 0.72rem; font-weight: 700; color: rgba(236, 225, 204, 0.6); }
.bb-slot-chip { color: var(--s); }
.bb-slot-chip[aria-pressed="true"] { border-color: var(--s); background: color-mix(in srgb, var(--s) 16%, transparent); }
.bb-gem-note { margin: 2px 0 10px; font-size: 0.78rem; color: rgba(236, 225, 204, 0.65); }

/* ---------- selector de afijo innato (bajo los huecos) ---------- */
.s-innate { --s: #d7a84f; }
.bb-innate-row { grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
.bb-innate:not(.is-empty) { border-left-color: var(--a, #d7a84f); }
.bb-innate:not(.is-empty) .bb-socket-name { color: var(--a, #d7a84f); }
.bb-innate small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.bb-innate-icon .bb-affix-noicon { width: 30px; height: 30px; }
.bb-option .bb-innate-icon { display: grid; place-items: center; }
.bb-option-name small { font-size: 0.72rem; opacity: 0.7; font-weight: 600; }
.bb-slot-type .bb-slot-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 4px; vertical-align: -1px; background: var(--s); }

/* ---------- talentos ---------- */
.bb-tal-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 10px;
    margin-bottom: 14px;
    border: 1px solid rgba(215, 168, 79, 0.2);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(215, 168, 79, 0.07), rgba(7, 9, 11, 0.5));
}
.bb-tal-pages { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.35); }
.bb-tal-pages button {
    display: grid;
    gap: 1px;
    min-width: 104px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: none;
    color: var(--text-subtle);
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.bb-tal-pages button small { font-size: 0.7rem; letter-spacing: 0.04em; color: inherit; opacity: 0.8; font-variant-numeric: tabular-nums; }
.bb-tal-pages button:hover { color: var(--text-strong); }
.bb-tal-pages button[aria-selected="true"] {
    color: #1a1206;
    background: linear-gradient(180deg, var(--gold-soft), var(--gold));
    box-shadow: 0 6px 18px rgba(215, 168, 79, 0.25);
}
.bb-tal-points { display: flex; align-items: center; gap: 12px; margin-left: auto; color: var(--text-subtle); font-size: 0.86rem; }
.bb-tal-points b { color: var(--text-strong); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.bb-tal-pips { display: flex; gap: 7px; }
.bb-tal-pips i {
    width: 11px;
    height: 11px;
    transform: rotate(45deg);
    border: 1px solid rgba(215, 168, 79, 0.45);
    background: rgba(0, 0, 0, 0.4);
    transition: background 0.2s, box-shadow 0.2s;
}
.bb-tal-pips i.on { background: var(--gold-soft); border-color: var(--gold-soft); box-shadow: 0 0 10px rgba(232, 193, 109, 0.6); }
.bb-tal-bar .bb-btn[disabled] { opacity: 0.4; cursor: default; }
.bb-tal-or, .bb-tal-fork {
    display: inline-grid;
    place-items: center;
    padding: 1px 6px;
    border: 1px solid rgba(232, 193, 109, 0.6);
    border-radius: 999px;
    background: #1a140a;
    color: var(--gold-soft);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bb-tal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.bb-tal-tree {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    min-width: 0;
    overflow: hidden;
    gap: 6px;
    padding: 14px;
    border: 1px solid rgba(215, 168, 79, 0.16);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 50% 55%, rgba(215, 168, 79, 0.08), transparent 62%),
        linear-gradient(180deg, rgba(20, 26, 34, 0.9), rgba(7, 9, 11, 0.85));
    transition: border-color 0.2s, box-shadow 0.2s;
}
.bb-tal-tree.has-picks { border-color: rgba(215, 168, 79, 0.42); box-shadow: inset 0 0 0 1px rgba(215, 168, 79, 0.08), 0 10px 30px rgba(0, 0, 0, 0.3); }
.bb-tal-tree.is-off .bb-tal-stage { opacity: 0.78; }
.bb-tal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; min-width: 0; box-sizing: border-box; padding-right: 2px; }
.bb-tal-head > div { min-width: 0; overflow-wrap: anywhere; }
.bb-tal-kicker { display: block; color: var(--gold); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.bb-tal-head h3 { margin: 2px 0 0; color: var(--text-strong); font-size: 0.98rem; line-height: 1.25; }
.bb-tal-count { flex: none; color: var(--gold-soft); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.bb-tal-count small { color: var(--text-subtle); font-size: 0.78rem; }
.bb-tal-tree .bb-tag { justify-self: center; }

.bb-tal-stage { position: relative; width: 100%; max-width: 236px; aspect-ratio: 1; }
.bb-tal-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bb-tal-stage circle { fill: none; stroke: rgba(215, 168, 79, 0.22); stroke-width: 0.5; stroke-dasharray: 1.2 1.6; }
.bb-tal-stage line { stroke: rgba(255, 244, 218, 0.16); stroke-width: 1.1; stroke-linecap: round; transition: stroke 0.2s; }
.bb-tal-stage line.is-ready { stroke: rgba(215, 168, 79, 0.5); stroke-dasharray: 2 2; }
.bb-tal-stage line.is-lit { stroke: var(--gold-soft); filter: drop-shadow(0 0 1.5px rgba(232, 193, 109, 0.9)); }
.bb-tal-fork { position: absolute; transform: translate(-50%, -50%); z-index: 1; cursor: help; }

.bb-tal-node {
    position: absolute;
    display: grid;
    place-items: center;
    width: 25%;
    aspect-ratio: 1;
    min-width: 46px;
    padding: 0;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 244, 218, 0.14);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #1d2530, #0a0d11 70%);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    cursor: pointer;
    z-index: 2;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s, background 0.18s;
}
.bb-tal-node img { width: 58%; height: 58%; object-fit: contain; pointer-events: none; transition: opacity 0.18s, filter 0.18s; }
.bb-tal-node:hover { transform: translate(-50%, -50%) scale(1.07); }
.bb-tal-node:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 3px; }
.bb-tal-node.is-open { border-color: rgba(215, 168, 79, 0.7); }
.bb-tal-node.is-open img { opacity: 0.92; }
.bb-tal-node.is-open:hover { border-color: var(--gold-soft); box-shadow: 0 0 0 4px rgba(215, 168, 79, 0.14), 0 4px 14px rgba(0, 0, 0, 0.55); }
.bb-tal-node.is-on {
    border-color: var(--gold-soft);
    background: radial-gradient(circle at 50% 40%, rgba(232, 193, 109, 0.42), #2a1d08 72%);
    box-shadow: 0 0 0 3px rgba(215, 168, 79, 0.22), 0 0 22px rgba(232, 193, 109, 0.55);
}
.bb-tal-node.is-on img { opacity: 1; filter: drop-shadow(0 0 4px rgba(255, 236, 190, 0.8)); }
.bb-tal-node.is-on::after {
    content: "\2713";
    position: absolute;
    right: -3px;
    bottom: -3px;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-soft);
    color: #1a1206;
    font-size: 0.66rem;
    font-weight: 900;
    box-shadow: 0 0 0 2px #0a0d11;
}
.bb-tal-node.is-req img, .bb-tal-node.is-full img { opacity: 0.5; filter: grayscale(1); }
.bb-tal-node.is-excl { border-color: rgba(239, 107, 99, 0.35); border-style: dashed; }
.bb-tal-node.is-excl img { opacity: 0.28; filter: grayscale(1); }

.bb-tal-pop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    width: min(320px, calc(100vw - 20px));
    padding: 14px;
    border: 1px solid rgba(215, 168, 79, 0.4);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #19202a, #0c1015);
    box-shadow: var(--shadow);
    color: var(--text);
    pointer-events: none;
}
.bb-tal-pop[hidden] { display: none; }
.bb-tal-pop-head { display: flex; align-items: center; gap: 10px; }
.bb-tal-pop-head img {
    width: 40px;
    height: 40px;
    padding: 6px;
    border: 1px solid rgba(215, 168, 79, 0.45);
    border-radius: 50%;
    background: #0a0d11;
}
.bb-tal-pop-head small { display: block; color: var(--gold); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.bb-tal-pop-head b { color: var(--text-strong); font-size: 1rem; }
.bb-tal-pop p { margin: 10px 0; font-size: 0.86rem; line-height: 1.55; }
.bb-tal-pop-foot { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid rgba(255, 244, 218, 0.08); color: var(--gold-soft); font-size: 0.76rem; font-weight: 700; }
.bb-tal-pop-foot span { color: var(--text-subtle); font-weight: 600; }
.bb-tal-pop-foot.is-req, .bb-tal-pop-foot.is-full { color: var(--text-subtle); }
.bb-tal-pop-foot.is-excl { color: var(--bad); }
.bb-tal-pop-foot.is-on { color: var(--good); }

.bb-talent-sum { display: grid; gap: 10px; }
.bb-tal-sum-page small { display: block; margin-bottom: 6px; color: var(--text-subtle); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.bb-tal-sum-page > div { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-tal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    border: 1px solid rgba(215, 168, 79, 0.3);
    border-radius: 999px;
    background: rgba(215, 168, 79, 0.08);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}
.bb-tal-chip:hover { border-color: var(--gold-soft); color: var(--text-strong); }
.bb-tal-chip img { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: #0a0d11; }
.bb-talent-sum .bb-empty { margin: 0; color: var(--text-subtle); font-size: 0.84rem; }

@media (max-width: 640px) {
    .bb-tal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .bb-tal-tree { padding: 10px; }
    .bb-tal-head h3 { font-size: 0.86rem; }
    .bb-tal-node { min-width: 38px; }
    .bb-tal-node.is-on::after { width: 15px; height: 15px; font-size: 0.56rem; }
    .bb-tal-points { margin-left: 0; width: 100%; justify-content: space-between; }
    .bb-tal-pages { flex: 1; }
    .bb-tal-pages button { flex: 1; min-width: 0; }
}
@media (max-width: 480px) {
    /* one tree per row on phones: two ~150px cards cut the side nodes */
    .bb-tal-grid { grid-template-columns: minmax(0, 1fr); }
    .bb-tal-node { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .bb-tal-node, .bb-tal-node img, .bb-tal-pips i { transition: none; }
}

.bb-tal-ph {
    display: grid;
    place-items: center;
    color: var(--gold-soft);
    font-weight: 800;
    letter-spacing: 0.04em;
    pointer-events: none;
}
.bb-tal-node .bb-tal-ph { width: 66%; height: 66%; font-size: 0.82rem; }
.bb-tal-node.is-req .bb-tal-ph, .bb-tal-node.is-full .bb-tal-ph { opacity: 0.5; }
.bb-tal-node.is-excl .bb-tal-ph { opacity: 0.3; }
.bb-tal-pop-head .bb-tal-ph { width: 40px; height: 40px; flex: none; border: 1px solid rgba(215, 168, 79, 0.45); border-radius: 50%; background: #0a0d11; font-size: 0.8rem; }
.bb-tal-chip .bb-tal-ph { width: 22px; height: 22px; border-radius: 50%; background: #0a0d11; font-size: 0.56rem; }

.bb-socket.is-locked, .bb-option.is-locked { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.6); }
.bb-socket.is-locked:hover, .bb-option.is-locked:hover { transform: none; border-color: inherit; }

/* tabs on phones: label over count so all four fit in one row */
@media (max-width: 520px) {
    .bb-tabs { margin-bottom: 14px; }
    .bb-tabs button { flex-direction: column; gap: 1px; min-height: 46px; padding: 2px 2px; font-size: 0.66rem; letter-spacing: 0.03em; }
    .bb-tabs button small { display: block; padding: 0 6px; font-size: 0.6rem; }
}
/* class carousel: fade on the right edge hints that it scrolls */
@media (max-width: 860px) {
    .bb-classes { position: relative; }
    .bb-classes::after { content: ""; position: absolute; top: 40px; right: 0; bottom: 14px; width: 36px; pointer-events: none;
        background: linear-gradient(90deg, transparent, rgba(11, 16, 19, 0.92)); border-radius: 0 var(--radius) var(--radius) 0; }
}
@media (prefers-reduced-motion: reduce) { .bb-skill-anim::before { animation: none; } }
.bb-toast-action { margin-left: 10px; padding: 3px 10px; border: 1px solid var(--gold-soft); border-radius: 999px; background: transparent; color: var(--gold-soft); font: inherit; font-weight: 800; cursor: pointer; }
.bb-toast.show:has(.bb-toast-action) { pointer-events: auto; }
@media (max-width: 860px) { .bb-toast { bottom: calc(88px + env(safe-area-inset-bottom)); } }
.bb-affix-max {
    margin-left: 6px; padding: 0 6px; border: 1px solid rgba(232, 193, 109, 0.45); border-radius: 999px;
    font-style: normal; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #e8c16d;
}
.bb-affix-max.is-over { border-color: rgba(255, 140, 120, 0.55); color: #ffb3a3; }
.bb-affix-val { font-style: normal; font-weight: 700; color: #f3e6c8; }

/* =====================================================
   v27 — visual pass: buttons, classes, cards (same language as the wiki homepage)
   Only transform / opacity / shadow / colour change, so nothing reflows.
   ===================================================== */

/* ---------- Buttons ---------- */

.bb-btn {
    position: relative;
    overflow: hidden;
    text-decoration: none;
    transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s, filter 0.18s;
}
a.bb-btn:hover { text-decoration: none; }
.bb-btn:active:not(:disabled) { transform: translateY(0) scale(0.97); filter: brightness(0.95); }

.bb-btn--gold {
    background: linear-gradient(135deg, #e9c06a, #b07c2a 70%, #8d5d1d);
    color: #120d05;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(215, 168, 79, 0.28), inset 0 1px 0 rgba(255, 244, 214, 0.45);
}
/* light sweep */
.bb-btn--gold::before, .bb-btn--danger::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 60%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-130%) skewX(-12deg);
    transition: transform 0.52s ease;
    pointer-events: none;
}
.bb-btn--danger::before { background: linear-gradient(105deg, transparent, rgba(255, 200, 190, 0.32), transparent); }

/* Reset: ember red, so it never reads as a primary action */
.bb-btn--danger {
    border-color: rgba(240, 110, 96, 0.55);
    background: linear-gradient(135deg, rgba(168, 52, 44, 0.92), rgba(92, 22, 24, 0.94));
    color: #ffe7e1;
    box-shadow: 0 10px 26px rgba(190, 60, 50, 0.22), inset 0 1px 0 rgba(255, 200, 190, 0.22);
}
.bb-btn-ico { display: inline-block; font-size: 1.05em; line-height: 1; transition: transform 0.4s ease; }

/* ---------- Classes ---------- */

.bb-class {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}
/* warm light rising from the bottom of the card */
.bb-class::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 50% 115%, rgba(232, 193, 109, 0.3), transparent 62%);
    opacity: 0;
    transition: opacity 0.25s;
}
/* gold bar under the chosen class */
.bb-class::after {
    content: "";
    position: absolute;
    right: 22%;
    bottom: 0;
    left: 22%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, transparent, #ffd98a, transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.bb-class img { transition: filter 0.2s, transform 0.25s ease; }
.bb-class[aria-checked="true"]::before { opacity: 1; }
.bb-class[aria-checked="true"]::after { transform: scaleX(1); }
.bb-class[aria-checked="true"] {
    box-shadow: 0 0 0 1px rgba(215, 168, 79, 0.4), 0 14px 34px rgba(215, 168, 79, 0.16);
}
.bb-class[aria-checked="true"] img { filter: drop-shadow(0 4px 14px rgba(215, 168, 79, 0.55)); }
.bb-class:active { transform: translateY(0) scale(0.98); }

/* ---------- Cards, hero and small parts ---------- */

.bb-card, .bb-hero { transition: border-color 0.24s, box-shadow 0.24s; }
.bb-slot, .bb-socket, .bb-option, .bb-skill { transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s; }
.bb-topnav a { position: relative; padding: 4px 0; transition: color 0.18s; }
.bb-topnav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--gold-soft);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}
.bb-chip, .bb-tabs button, .bb-toggle button, .bb-icon-btn { transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s; }
.bb-affix { transition: border-color 0.18s, background 0.18s; }

/* ---------- Pointer devices only (no stuck hover on touch screens) ---------- */

@media (hover: hover) {
    .bb-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(232, 193, 109, 0.25); }
    .bb-btn--gold:hover:not(:disabled) {
        background: linear-gradient(135deg, #f3d084, #c08a31 70%, #9a6821);
        filter: saturate(1.08);
        box-shadow: 0 16px 38px rgba(215, 168, 79, 0.46), inset 0 0 0 1px rgba(255, 240, 205, 0.5);
    }
    .bb-btn--gold:hover:not(:disabled)::before, .bb-btn--danger:hover:not(:disabled)::before { transform: translateX(260%) skewX(-12deg); }
    .bb-btn--danger:hover:not(:disabled) {
        border-color: #ff8f80;
        background: linear-gradient(135deg, rgba(205, 68, 56, 0.96), rgba(120, 28, 30, 0.96));
        color: #fff;
        box-shadow: 0 16px 36px rgba(214, 70, 58, 0.42), inset 0 0 0 1px rgba(255, 190, 180, 0.35);
    }
    .bb-btn--danger:hover:not(:disabled) .bb-btn-ico { transform: rotate(-200deg); }

    .bb-class:hover {
        transform: translateY(-4px);
        border-color: rgba(232, 193, 109, 0.7);
        background: rgba(13, 17, 22, 0.8);
        color: var(--text-strong);
        box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42), 0 0 26px rgba(215, 168, 79, 0.18);
    }
    .bb-class:hover::before { opacity: 1; }
    .bb-class:hover::after { transform: scaleX(0.6); }
    .bb-class[aria-checked="true"]:hover::after { transform: scaleX(1); }
    .bb-class:hover img { transform: scale(1.1) translateY(-2px); filter: drop-shadow(0 6px 14px rgba(232, 193, 109, 0.5)); }
    .bb-class:hover small { color: var(--gold-soft); }

    .bb-card:hover, .bb-hero:hover {
        border-color: rgba(232, 193, 109, 0.46);
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 34px rgba(215, 168, 79, 0.08);
    }
    .bb-slot:hover, .bb-socket:hover:not(:disabled), .bb-skill:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
    .bb-option:hover { transform: translateX(3px); }
    .bb-topnav a:hover::after { transform: scaleX(1); }
    .bb-chip:hover { border-color: rgba(232, 193, 109, 0.6); color: var(--text-strong); transform: translateY(-1px); }
    .bb-icon-btn:hover { background: rgba(215, 168, 79, 0.16); transform: rotate(90deg); }
    .bb-affix:hover { border-color: rgba(232, 193, 109, 0.4); }
}

@media (prefers-reduced-motion: reduce) {
    .bb-btn, .bb-btn::before, .bb-btn-ico, .bb-class, .bb-class::before, .bb-class::after, .bb-class img,
    .bb-slot, .bb-socket, .bb-option, .bb-skill, .bb-chip, .bb-icon-btn, .bb-topnav a::after { transition: none; }
    .bb-btn:hover:not(:disabled), .bb-class:hover, .bb-class:hover img, .bb-slot:hover, .bb-socket:hover, .bb-skill:hover,
    .bb-option:hover, .bb-chip:hover, .bb-icon-btn:hover, .bb-btn--danger:hover .bb-btn-ico { transform: none; }
    .bb-btn--gold::before, .bb-btn--danger::before { display: none; }
}

/* =====================================================
   v28 — "Save & share" card under the build (was at the bottom of the stats column)
   ===================================================== */

.bb-col { display: grid; gap: 18px; min-width: 0; align-content: start; }
.bb-main { scroll-margin-top: 78px; }

.bb-savecard-head { margin-bottom: 18px; }
.bb-savecard-head p { margin: 8px 0 0; max-width: 720px; color: var(--text); font-size: 0.98rem; line-height: 1.55; }
.bb-savecard-head p b { color: var(--gold-soft); }

.bb-savecard-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
.bb-savecol {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(215, 168, 79, 0.18);
    border-radius: var(--radius);
    background: rgba(7, 9, 11, 0.5);
}
.bb-savecard-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
    color: var(--text-strong);
    font-size: 1.08rem;
    font-weight: 800;
}
.bb-step-n {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e9c06a, #8d5d1d);
    color: #120d05;
    font-size: 0.9rem;
    font-weight: 900;
}
.bb-savecol > p { margin: 0 0 14px; color: var(--text-subtle); font-size: 0.9rem; line-height: 1.5; }
.bb-savecard .bb-save input { min-height: 44px; font-size: 1rem; }
.bb-savecard .bb-save .bb-btn { min-height: 44px; padding: 0 20px; font-size: 0.95rem; }
.bb-savecard .bb-saves { margin-top: 12px; }
.bb-savecard .bb-saves li { font-size: 0.95rem; }
.bb-savecard .bb-share { margin: 0; padding: 18px; border: 1px solid rgba(215, 168, 79, 0.18); background: rgba(7, 9, 11, 0.5); }

/* progress */
.bb-progress-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 6px; }
.bb-progress-row b { color: var(--text-strong); font-size: 0.95rem; }
.bb-progress-row span { color: var(--text-subtle); font-size: 0.85rem; }
.bb-progress { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bb-progress i {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #b07c2a, #f3d084);
    transform: scaleX(var(--p, 0));
    transform-origin: left;
    transition: transform 0.35s ease, background 0.3s;
}
.bb-share.is-ready .bb-progress i { background: linear-gradient(90deg, #3f9d5a, #7fe09a); }

.bb-savecard .bb-share-status {
    margin: 12px 0;
    padding: 10px 14px;
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    background: rgba(215, 168, 79, 0.08);
    color: var(--text-strong);
    font-size: 0.95rem;
    line-height: 1.5;
}
.bb-savecard .bb-share-status.is-ok { border-left-color: var(--good); background: rgba(111, 211, 138, 0.1); color: #c9f3d4; }

/* checklist: every row jumps to the tab where that step is finished */
.bb-checklist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.bb-check {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(232, 193, 109, 0.3);
    border-radius: 12px;
    background: rgba(215, 168, 79, 0.06);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.18s;
}
.bb-check-ico {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    color: var(--gold-soft);
    font-size: 1rem;
    font-weight: 900;
}
.bb-check-body { display: grid; gap: 2px; min-width: 0; }
.bb-check-title { color: var(--text-strong); font-size: 1rem; font-weight: 800; }
.bb-check-title em { margin-left: 8px; font-style: normal; font-weight: 700; font-size: 0.88rem; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.bb-check-body small { color: var(--text); font-size: 0.86rem; line-height: 1.45; }
.bb-check-go { color: var(--gold-soft); font-size: 0.82rem; font-weight: 800; white-space: nowrap; }
.bb-check.is-done { border-color: rgba(111, 211, 138, 0.3); background: rgba(111, 211, 138, 0.05); }
.bb-check.is-done .bb-check-ico { border-color: var(--good); background: rgba(111, 211, 138, 0.16); color: var(--good); }
.bb-check.is-done .bb-check-title em { color: var(--good); }
.bb-check.is-done .bb-check-body small { color: var(--text-subtle); }
.bb-check.is-done .bb-check-go { color: var(--text-subtle); font-weight: 600; }

.bb-savecard .bb-share-fields { margin-top: 0; }
.bb-savecard .bb-share-fields input, .bb-savecard .bb-share-fields textarea { font-size: 0.95rem; }
.bb-savecard .bb-share-fields small { font-size: 0.84rem; }
.bb-post-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.bb-post-row .bb-btn { min-height: 46px; padding: 0 22px; font-size: 1rem; }
.bb-post-row small { flex: 1; min-width: 180px; color: var(--text-subtle); font-size: 0.84rem; line-height: 1.45; }
.bb-savecard .bb-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.5); }

@media (hover: hover) {
    .bb-check:hover { border-color: var(--gold-soft); background: rgba(215, 168, 79, 0.12); transform: translateX(3px); }
    .bb-check.is-done:hover { border-color: rgba(111, 211, 138, 0.55); background: rgba(111, 211, 138, 0.09); }
}
@media (max-width: 980px) {
    .bb-savecard-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
    .bb-savecol, .bb-savecard .bb-share { padding: 14px; }
    .bb-check { grid-template-columns: 30px minmax(0, 1fr); }
    .bb-check-go { display: none; }
    .bb-check-ico { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    .bb-check, .bb-progress i { transition: none; }
    .bb-check:hover { transform: none; }
}

/* the card stacks its two steps whenever it is narrow (it shares the row with the stats column) */
.bb-savecard { container-type: inline-size; }
@container (max-width: 780px) {
    .bb-savecard-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================
   SIDE ART v2 (desktop only, 1600px and wider)
   The heroine on the left and the golden ember on the right, fixed so they stay while the page scrolls.
   Both scale with the side margin (--mf-g), so nothing is cut at any window width:
   the face always shows the same part (hair, eye, cheek) and the ember always fits its margin.
   Inside the media query, so phones and small screens never download the two images.
   ===================================================== */

@media (min-width: 1600px) {
    body {
        --mf-g: calc((100vw - 1176px) / 2);              /* side margin next to the content */
        --mf-ih: clamp(560px, calc(var(--mf-g) * 3.1), 112vh);  /* height of the face image */
    }

    body::before,
    body::after {
        content: "";
        position: fixed;
        z-index: -1;
        pointer-events: none;
    }

    /* left: the box is the image itself, so the fades follow it and never leave a hard edge */
    body::before {
        left: 0;
        top: calc(42vh - var(--mf-ih) * 0.36);                  /* her eye sits at 42% of the window height */
        width: calc(var(--mf-g) + 60px);
        height: var(--mf-ih);
        background: url("/assets/bg/side-face.webp") no-repeat;
        background-size: auto 100%;
        background-position: calc(var(--mf-g) * 0.5 - var(--mf-ih) * 0.444) 0;  /* ...and in the middle of the margin */
        opacity: 0.85;
        -webkit-mask-image:
            linear-gradient(to right, #000 0, #000 52%, transparent 96%),
            linear-gradient(to bottom, transparent 0, #000 16%, #000 62%, transparent 96%);
        -webkit-mask-composite: source-in;
        mask-image:
            linear-gradient(to right, #000 0, #000 52%, transparent 96%),
            linear-gradient(to bottom, transparent 0, #000 16%, #000 62%, transparent 96%);
        mask-composite: intersect;
    }

    /* right: the ember (transparent image), centred in its margin and faded on all four sides */
    body::after {
        top: 0;
        bottom: 0;
        width: min(var(--mf-g), 300px);
        right: calc((var(--mf-g) - min(var(--mf-g), 300px)) / 2);
        background: url("/assets/bg/side-ember-4.webp") 50% 50% / 100% 100% no-repeat;
        opacity: 0.9;
        -webkit-mask-image:
            linear-gradient(to right, transparent 0, #000 38%, #000 62%, transparent 100%),
            linear-gradient(to bottom, transparent 0, #000 18%, #000 82%, transparent 100%);
        -webkit-mask-composite: source-in;
        mask-image:
            linear-gradient(to right, transparent 0, #000 38%, #000 62%, transparent 100%),
            linear-gradient(to bottom, transparent 0, #000 18%, #000 82%, transparent 100%);
        mask-composite: intersect;
    }
}

/* =====================================================
   v32 — affixes as a horizontal block under Class (was a long list in the stats column)
   ===================================================== */

.bb-affixcard { margin-bottom: 18px; }
.bb-affixcard .bb-section-head { margin-bottom: 12px; flex-wrap: wrap; }
.bb-affixcard .bb-section-title small { margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(215, 168, 79, 0.16); color: var(--text-strong); font-size: 0.72rem; letter-spacing: 0; }
.bb-affixcard .bb-section-title small:empty { display: none; }
.bb-affixcard-hint { color: var(--text-subtle); font-size: 0.82rem; }

.bb-achips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.bb-achips .bb-empty { grid-column: 1 / -1; color: var(--text-subtle); font-size: 0.92rem; }
.bb-achip {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 8px 12px 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--a);
    border-radius: 12px;
    background: rgba(5, 7, 10, 0.5);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}
.bb-achip .bb-affix-icon { width: 34px; height: 34px; border-radius: 9px; }
.bb-achip .bb-affix-icon img { width: 26px; height: 26px; }
.bb-achip-body { display: grid; gap: 1px; min-width: 0; }
.bb-achip-name { color: var(--a); font-size: 0.9rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-achip-name b { margin-left: 4px; color: #f3e6c8; font-size: 0.78rem; }
.bb-achip-val { color: var(--text-strong); font-size: 0.8rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bb-achip-caret { color: var(--text-subtle); font-size: 0.9rem; transition: transform 0.2s; }
.bb-achip.is-open { border-color: var(--a); background: rgba(215, 168, 79, 0.1); box-shadow: 0 0 0 1px var(--a) inset; }
.bb-achip.is-open .bb-achip-caret { transform: rotate(180deg); color: var(--a); }

/* the description of the affix that is open */
.bb-adetail {
    margin-top: 12px;
    padding: 16px 18px;
    border: 1px solid var(--a);
    border-left-width: 4px;
    border-radius: 14px;
    background: rgba(5, 7, 10, 0.6);
    animation: bb-adetail-in 0.2s ease;
}
@keyframes bb-adetail-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.bb-adetail-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 10px; }
.bb-adetail-head .bb-affix-icon { width: 44px; height: 44px; border-radius: 11px; }
.bb-adetail-head .bb-affix-icon img { width: 34px; height: 34px; }
.bb-adetail-name { color: var(--a); font-size: 1.1rem; font-weight: 800; }
.bb-adetail-name b { margin-left: 6px; color: #f3e6c8; font-size: 0.9rem; }
.bb-adetail-val { color: var(--text-strong); font-size: 0.98rem; font-weight: 700; }
.bb-adetail p { margin: 0 0 8px; max-width: 900px; color: var(--text); font-size: 0.94rem; line-height: 1.55; }
.bb-adetail-from { color: var(--text-subtle) !important; font-size: 0.84rem !important; }
.bb-adetail-from b { color: var(--text); }
.bb-adetail a { font-size: 0.88rem; font-weight: 700; }

@media (hover: hover) {
    .bb-achip:hover { border-color: var(--a); background: rgba(215, 168, 79, 0.08); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32); }
}
/* phones: one row that scrolls sideways, so the block stays short */
@media (max-width: 860px) {
    .bb-achips { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .bb-achips > li { flex: 0 0 min(78%, 280px); scroll-snap-align: start; }
    .bb-achips > .bb-empty { flex: 1 1 auto; }
    .bb-affixcard-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .bb-achip, .bb-achip-caret { transition: none; }
    .bb-achip:hover { transform: none; }
    .bb-adetail { animation: none; }
}


/* five tabs: one row that keeps each label on one line (scrolls sideways on very narrow screens) */
.bb-tabs { display: flex; overflow-x: auto; scrollbar-width: none; border-radius: 24px; }
.bb-tabs::-webkit-scrollbar { display: none; }
.bb-tabs button { flex: 1 0 auto; white-space: nowrap; letter-spacing: 0.07em; padding: 0 10px; gap: 6px; font-size: 0.78rem; }
.bb-tabs button small { padding: 2px 6px; }

/* ===== Soul Brand (Season 2) ===== */
.bb-sb-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 14px 0 18px; }
.bb-sb-card {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; min-height: 124px; justify-content: center;
    border: 1px solid var(--gold-line); border-radius: 14px; background: rgba(255, 255, 255, 0.03); color: inherit; cursor: pointer; font: inherit;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.bb-sb-card:hover { border-color: var(--gold); background: rgba(215, 168, 79, 0.08); transform: translateY(-2px); }
.bb-sb-card.is-on { border-color: var(--r, var(--gold)); background: rgba(215, 168, 79, 0.12); box-shadow: 0 0 0 1px var(--r, var(--gold)) inset; }
.bb-sb-card b { font-size: 0.98rem; color: var(--r, var(--gold-soft)); }
.bb-sb-card small { opacity: 0.72; font-size: 0.74rem; text-align: center; }
.bb-sb-card img { width: 56px; height: 56px; object-fit: contain; }
.bb-sb-none { width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.7rem; opacity: 0.55; }
.bb-sb-level { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 6px; }
.bb-sb-level > span { font-weight: 700; color: var(--gold-soft); }
.bb-sb-level small { opacity: 0.75; flex: 1 1 240px; }
.bb-sb-level .bb-toggle button { min-width: 40px; }
.bb-sb-level .bb-toggle button.is-reshape:not([aria-pressed="true"]) { opacity: 0.6; font-style: italic; }
.bb-sb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bb-sb-row {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 6px 12px; align-items: center; padding: 12px;
    border: 1px dashed var(--gold-line); border-radius: 12px; background: rgba(255, 255, 255, 0.02);
}
.bb-sb-row.is-set { border-style: solid; background: rgba(215, 168, 79, 0.05); }
.bb-sb-ico {
    width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--gold-line);
    background: rgba(0, 0, 0, 0.35); font-weight: 800; color: var(--gold-soft);
}
.bb-sb-ico img { width: 30px; height: 30px; object-fit: contain; }
.bb-sb-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.1fr); gap: 8px; }
.bb-sb-fields select {
    width: 100%; min-height: 42px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--gold-line);
    background: #12171b; color: inherit; font: inherit; font-size: 0.92rem;
}
.bb-sb-fields select:hover, .bb-sb-fields select:focus { border-color: var(--gold); }
.bb-sb-note { grid-column: 2; margin: 0; font-size: 0.84rem; opacity: 0.78; line-height: 1.45; }
.bb-sb-sum {
    display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px; text-align: left; cursor: pointer; font: inherit; color: inherit;
    border: 1px solid var(--gold-line); border-radius: 12px; background: rgba(255, 255, 255, 0.03);
}
.bb-sb-sum:hover { border-color: var(--gold); }
.bb-sb-sum img { flex: none; object-fit: contain; }
.bb-sb-sum span { display: grid; gap: 2px; min-width: 0; }
.bb-sb-sum b { color: var(--r, var(--gold-soft)); }
.bb-sb-sum small { opacity: 0.85; font-size: 0.82rem; }
.bb-sb-sum small.is-open { opacity: 0.5; font-style: italic; }
@media (max-width: 760px) {
    .bb-sb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bb-sb-card { min-height: 104px; }
    .bb-sb-fields { grid-template-columns: minmax(0, 1fr); }
}

/* Victory Wine (Gems & Affixes tab): wine cards and socket-like affix slots */
.bb-wine-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.bb-wine-card {
    display: grid; justify-items: center; gap: 3px; padding: 10px 6px; min-width: 0; text-align: center;
    cursor: pointer; color: inherit; font: inherit; border-radius: 12px;
    border: 1px solid rgba(215, 168, 79, 0.2); background: rgba(5, 7, 10, 0.55);
}
.bb-wine-card:hover, .bb-wine-card:focus-visible { border-color: rgba(215, 168, 79, 0.6); outline: none; }
.bb-wine-card.is-on { border-color: var(--gold, #d7a84f); background: linear-gradient(180deg, rgba(215, 168, 79, 0.2), rgba(5, 7, 10, 0.6)); box-shadow: 0 0 0 1px rgba(215, 168, 79, 0.35) inset; }
.bb-wine-card-ico { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.5rem; opacity: 0.85; }
.bb-wine-card-ico img { width: 44px; height: 44px; object-fit: contain; }
.bb-wine-card b { font-size: 0.82rem; line-height: 1.2; color: var(--text-strong, #f1ead9); }
.bb-wine-card small { font-size: 0.68rem; color: rgba(236, 225, 204, 0.6); line-height: 1.25; }
.bb-wine-slots { margin-top: 10px; }
@media (max-width: 640px) {
    .bb-wine-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bb-wine-card:first-child { grid-column: 1 / -1; grid-auto-flow: column; justify-content: center; align-items: center; gap: 8px; padding: 6px; }
    .bb-wine-card:first-child .bb-wine-card-ico { width: 24px; height: 24px; font-size: 1.1rem; }
}

/* game modes the gear can enter (side panel) */
.bb-modes { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.bb-mode { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(5, 7, 10, 0.45); }
.bb-mode-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; border: 1px solid currentColor; color: rgba(236, 225, 204, 0.5); margin-top: 1px; }
.bb-mode-body { min-width: 0; display: grid; gap: 1px; font-size: 0.8rem; line-height: 1.3; }
.bb-mode-body b { color: var(--text-strong, #f1ead9); }
.bb-mode-body small { color: rgba(236, 225, 204, 0.6); font-size: 0.72rem; }
.bb-mode-body span { color: rgba(236, 225, 204, 0.75); font-size: 0.74rem; }
.bb-mode.is-ok { border-color: rgba(87, 201, 107, 0.4); }
.bb-mode.is-ok .bb-mode-mark { color: #57c96b; }
.bb-mode.is-low { border-color: rgba(232, 180, 62, 0.45); }
.bb-mode.is-low .bb-mode-mark { color: #e8b43e; }
.bb-mode.is-no { border-color: rgba(230, 83, 77, 0.45); }
.bb-mode.is-no .bb-mode-mark { color: #e6534d; }
.bb-mode.is-no .bb-mode-body span { color: #f0a09c; }

/* step 3 of Save & share: the game's loadout code */
.bb-gamecode { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(215, 168, 79, 0.18); background: rgba(5, 7, 10, 0.4); }
.bb-gamecode p { margin: 4px 0 10px; font-size: 0.86rem; color: rgba(236, 225, 204, 0.75); }
.bb-gamecode-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.bb-gamecode-row small { flex: 1; min-width: 180px; font-size: 0.76rem; color: rgba(236, 225, 204, 0.6); }
.bb-gamecode-row input { flex: 1; min-width: 200px; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(0, 0, 0, 0.45); color: var(--text-strong, #f1ead9); font: inherit; font-size: 0.86rem; font-family: ui-monospace, Consolas, monospace; }
.bb-gamecode-row input:focus-visible { outline: 2px solid #d7a84f; outline-offset: 2px; }
