﻿:root {
    --fi-frost-blue: #1447BC;
    --fi-frost-blue-dark: #0F358C;
    --fi-frost-blue-light: #3E6ED8;
    --fi-war-red: #8F1E2A;
    --fi-war-red-dark: #65131D;
    --fi-war-red-light: #B22C3A;
    --fi-defender-gold: #C79A2E;
    --fi-defender-gold-dark: #9A731D;
    --fi-defender-gold-light: #E0BC62;
    --fi-bg: #1A1D24;
    --fi-bg-2: #22252d;
    --fi-panel: #EEE8D6;
    --fi-panel-2: #C6B9A4;
    --fi-text: #2a251d;
    --fi-muted: #5e5442;
    --fi-line: rgba(111, 84, 31, 0.35);
    --fi-input-bg: #F4F5F8;
    --fi-input-border: rgba(57, 70, 96, 0.35);
}

/* =========================================================
   Base / Background
   ========================================================= */

html, body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--fi-text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(1000px 600px at 14% 8%, rgba(20, 71, 188, 0.18), transparent 65%), radial-gradient(900px 500px at 88% 18%, rgba(143, 30, 42, 0.14), transparent 62%), radial-gradient(1200px 800px at 50% 100%, rgba(0, 0, 0, 0.22), transparent 70%), linear-gradient(180deg, rgba(8,10,14,0.15), rgba(8,10,14,0.35)), repeating-linear-gradient( 90deg, #22252d 0px, #22252d 16px, #2b2f39 16px, #2b2f39 34px );
    background-color: var(--fi-bg);
}

/* =========================================================
   App Shell / Header
   ========================================================= */

.fi-shell {
    max-width: 1180px;
    margin: 22px auto 28px;
    padding: 0 14px;
}

.fi-logo-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
}

.fi-logo {
    color: #fff;
    font-size: 54px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 1px;
    user-select: none;
    font-family: Georgia, "Times New Roman", serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.65), 0 0 20px rgba(20, 71, 188, 0.15);
}

    .fi-logo .nord {
        color: var(--fi-frost-blue);
    }

    .fi-logo .invasion {
        color: var(--fi-war-red);
    }

    .fi-logo .title-ni2 {
        color: var(--fi-frost-blue);
    }

.fi-account-box {
    min-width: 260px;
    background: linear-gradient(180deg, rgba(242, 244, 248, 0.95), rgba(225, 229, 238, 0.95));
    border: 1px solid rgba(39, 48, 66, 0.45);
    border-top: 2px solid var(--fi-defender-gold);
    border-radius: 18px 26px 18px 18px;
    padding: 14px 16px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(255,255,255,0.2);
}

    .fi-account-box .name {
        font-size: 16px;
        font-weight: 700;
        margin-bottom: 4px;
        font-family: Georgia, serif;
    }

    .fi-account-box .meta {
        color: var(--fi-text);
        font-size: 13px;
        line-height: 1.35;
    }

    .fi-account-box .gold {
        color: var(--fi-defender-gold-dark);
        font-weight: 700;
    }

.fi-account-guest-note {
    font-weight: 700;
    color: #4A3518;
    margin-top: 2px;
}

.fi-account-guest-subnote {
    color: var(--fi-muted);
    font-size: 12px;
    line-height: 1.35;
    margin-top: 2px;
}

@media (max-width: 920px) {
    .fi-account-box {
        min-width: 220px;
    }

    .fi-logo {
        font-size: 40px;
    }
}

/* =========================================================
   Parchment Container
   ========================================================= */

.fi-paper {
    position: relative;
    background: radial-gradient(circle at 15% 10%, rgba(20, 71, 188, 0.06), transparent 35%), radial-gradient(circle at 85% 15%, rgba(143, 30, 42, 0.06), transparent 40%), radial-gradient(circle at 80% 75%, rgba(0,0,0,0.05), transparent 42%), linear-gradient(180deg, var(--fi-panel), var(--fi-panel-2));
    border: 1px solid rgba(108, 82, 29, 0.55);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(255,255,255,0.2), inset 0 0 40px rgba(20, 71, 188, 0.03);
    padding: 18px 18px 20px;
}

    .fi-paper::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: 8px;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15), inset 0 0 18px rgba(20, 71, 188, 0.04);
    }

    .fi-paper::after {
        content: "";
        position: absolute;
        left: 14px;
        right: 14px;
        top: 10px;
        height: 3px;
        border-radius: 3px;
        background: linear-gradient( 90deg, var(--fi-frost-blue) 0%, var(--fi-defender-gold) 50%, var(--fi-war-red) 100% );
        opacity: 0.9;
        pointer-events: none;
    }

.fi-banner {
    margin: 6px 0 14px;
    background: linear-gradient(180deg, rgba(224,188,98,0.9), rgba(199,154,46,0.9));
    border: 1px solid rgba(122, 88, 20, 0.7);
    color: #4E360A;
    border-radius: 6px;
    padding: 12px 14px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
    box-shadow: inset 0 -10px 24px rgba(143, 30, 42, 0.08), inset 0 10px 18px rgba(255,255,255,0.12);
}

/* =========================================================
   Top Nav
   ========================================================= */

.fi-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 18px;
    padding: 8px 0 10px;
    border-bottom: 1px solid var(--fi-line);
    align-items: center;
}

    .fi-nav a {
        color: #8A6316;
        text-decoration: none;
        font-weight: 700;
        font-size: 14px;
        position: relative;
        transition: color 0.15s ease;
    }

.fi-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

    .fi-nav-link:hover {
        color: var(--fi-frost-blue);
        text-decoration: none;
    }

    .fi-nav-link.active {
        color: var(--fi-defender-gold-dark);
        text-shadow: 0 0 8px rgba(199,154,46,0.18);
    }

        .fi-nav-link.active::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: -4px;
            height: 2px;
            border-radius: 2px;
            background: linear-gradient(90deg, var(--fi-war-red), var(--fi-defender-gold));
        }

.fi-nav-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    object-fit: contain;
    transform: translateY(-1px);
    filter: brightness(0) saturate(100%) invert(35%) sepia(55%) saturate(932%) hue-rotate(8deg) brightness(94%) contrast(92%);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.fi-nav-link.active .fi-nav-icon,
.fi-nav-extras-summary.active .fi-nav-icon {
    filter: brightness(0) saturate(100%) invert(28%) sepia(38%) saturate(771%) hue-rotate(11deg) brightness(94%) contrast(91%);
}

.fi-nav-link:hover .fi-nav-icon,
.fi-nav-extras-summary:hover .fi-nav-icon {
    filter: brightness(0) saturate(100%) invert(20%) sepia(83%) saturate(2645%) hue-rotate(221deg) brightness(89%) contrast(93%);
    transform: translateY(-1px) scale(1.03);
}

.fi-nav-link:hover .fi-nav-icon,
.fi-nav-extras-summary:hover .fi-nav-icon {
    transform: translateY(-1px) scale(1.03);
}

.fi-nav-link span,
.fi-nav-extras-summary span {
    display: inline-block;
}

/* Extras dropdown */
.fi-nav-extras {
    margin-left: auto;
    position: relative;
}

    .fi-nav-extras summary {
        list-style: none;
    }

        .fi-nav-extras summary::-webkit-details-marker {
            display: none;
        }

.fi-nav-extras-summary {
    color: #8A6316;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    position: relative;
    cursor: pointer;
    transition: color 0.15s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

    .fi-nav-extras-summary:hover {
        color: var(--fi-frost-blue);
    }

    .fi-nav-extras-summary.active {
        color: var(--fi-defender-gold-dark);
        text-shadow: 0 0 8px rgba(199,154,46,0.18);
    }

        .fi-nav-extras-summary.active::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: -4px;
            height: 2px;
            border-radius: 2px;
            background: linear-gradient(90deg, var(--fi-war-red), var(--fi-defender-gold));
        }

.fi-nav-extras-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: linear-gradient(180deg, rgba(250,246,236,0.98), rgba(232,224,203,0.98));
    border: 1px solid rgba(120,90,30,0.25);
    border-top: 2px solid var(--fi-defender-gold);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.2);
    padding: 8px 0;
    z-index: 50;
}

.fi-nav-extras-link {
    display: block;
    padding: 8px 14px;
    color: #7A5612 !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

    .fi-nav-extras-link:hover {
        background: rgba(20, 71, 188, 0.07);
        color: var(--fi-frost-blue) !important;
    }

.fi-nav-extras-link-danger {
    color: var(--fi-war-red) !important;
}

    .fi-nav-extras-link-danger:hover {
        color: var(--fi-war-red-dark) !important;
        background: rgba(143, 30, 42, 0.06);
    }

.fi-nav-extras-sep {
    height: 1px;
    background: rgba(120,90,30,0.18);
    margin: 6px 0;
}

/* =========================================================
   Generic UI
   ========================================================= */

.fi-title,
.fi-subtitle {
    font-family: Georgia, "Times New Roman", serif;
    color: #3C2B14;
    text-shadow: 0 1px 0 rgba(255,255,255,0.25);
    font-weight: 700;
}

.fi-title {
    font-size: 22px;
    margin: 0 0 10px;
}

.fi-subtitle {
    font-size: 18px;
    margin: 0 0 10px;
}

.fi-muted {
    color: var(--fi-muted);
}

.fi-divider {
    border: 0;
    border-top: 1px solid var(--fi-line);
    margin: 14px 0;
}

.fi-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.fi-link {
    color: var(--fi-frost-blue);
    font-weight: 700;
    text-decoration: none;
}

    .fi-link:hover {
        color: var(--fi-frost-blue-dark);
        text-decoration: underline;
    }

.fi-status {
    margin: 8px 0 14px;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid rgba(20, 71, 188, 0.25);
    border-left: 4px solid var(--fi-frost-blue);
    background: rgba(20, 71, 188, 0.06);
    color: #233652;
    font-weight: 600;
}

/* Buttons */
.fi-btn {
    appearance: none;
    border: 1px solid var(--fi-defender-gold-dark);
    background: linear-gradient(180deg, var(--fi-defender-gold-light), var(--fi-defender-gold-dark));
    color: #FFFDF7;
    border-radius: 3px;
    font-weight: 700;
    padding: 7px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    text-shadow: 0 1px 0 rgba(0,0,0,0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 1px 3px rgba(0,0,0,0.15);
}

    .fi-btn:hover {
        filter: brightness(1.03);
    }

    .fi-btn.secondary {
        border: 1px solid var(--fi-frost-blue-dark);
        background: linear-gradient(180deg, var(--fi-frost-blue-light), var(--fi-frost-blue));
        color: #F4F8FF;
    }

    .fi-btn.small {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        padding: 5px 8px;
        font-size: 12px;
    }

.fi-account-action {
    margin-top: 8px;
}

/* Inputs */
.fi-select,
.fi-input {
    border: 1px solid var(--fi-input-border);
    background: var(--fi-input-bg);
    border-radius: 3px;
    padding: 6px 8px;
    min-height: 32px;
    color: var(--fi-text);
    font-size: 13px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

.fi-select {
    min-width: 260px;
}

    .fi-select:focus,
    .fi-input:focus {
        outline: none;
        border-color: var(--fi-frost-blue);
        box-shadow: 0 0 0 2px rgba(20, 71, 188, 0.12), inset 0 1px 2px rgba(0,0,0,0.04);
    }

/* Cards */
.fi-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
    border: 1px solid rgba(92, 77, 43, 0.28);
    border-left: 3px solid var(--fi-defender-gold);
    border-radius: 6px;
    padding: 12px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.fi-grid-2 {
    display: grid;
    grid-template-columns: 1.05fr 1.35fr;
    gap: 22px;
}

@media (max-width:920px) {
    .fi-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Character Page
   ========================================================= */

.fi-grid-char-details {
    display: grid;
    grid-template-columns: 1.0fr 1.7fr;
    gap: 20px;
}

@media (max-width: 920px) {
    .fi-grid-char-details {
        grid-template-columns: 1fr;
    }
}

.fi-stats-list {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    font-size: 14px;
}

    .fi-stats-list .label {
        color: var(--fi-text);
    }

    .fi-stats-list .value {
        color: var(--fi-text);
        font-weight: 700;
    }

.fi-loadout-tabs {
    display: flex;
    gap: 8px;
    margin: 8px 0 14px;
}

    .fi-loadout-tabs a {
        text-decoration: none;
        border: 1px solid rgba(20, 71, 188, 0.20);
        padding: 6px 10px;
        border-radius: 4px;
        background: rgba(20, 71, 188, 0.05);
        color: var(--fi-frost-blue-dark);
        font-weight: 700;
        font-size: 13px;
    }

        .fi-loadout-tabs a:hover {
            background: rgba(20, 71, 188, 0.08);
        }

        .fi-loadout-tabs a.active {
            background: linear-gradient(180deg, rgba(224,188,98,0.95), rgba(170,113,28,0.95));
            border-color: rgba(122, 84, 19, 0.9);
            color: #FFF7E3;
            text-shadow: 0 1px 0 rgba(0,0,0,0.18);
            box-shadow: inset 0 -10px 18px rgba(143, 30, 42, 0.18);
        }

/* Compact slot cards (requested tighter layout) */
.fi-slot-card {
    padding: 4px 10px;
    margin-bottom: 7px !important;
}

    .fi-slot-card .fi-select {
        min-height: 24px;
        padding: 2px 6px;
    }

    .fi-slot-card .fi-btn {
        padding: 5px 8px;
        font-size: 12px;
    }

.fi-slot-row {
    display: grid;
    grid-template-columns: 140px minmax(220px, 1fr) auto;
    gap: 6px;
    align-items: center;
    margin-bottom: 0;
}

.fi-slot-label {
    font-weight: 700;
    color: #4A3518;
    font-size: 13px;
    line-height: 1.1;
}

.fi-slot-current {
    font-size: 11px;
    color: #5F5A52;
    margin-top: 1px;
    line-height: 1.15;
}

@media (max-width: 680px) {
    .fi-slot-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .fi-select {
        min-width: 0;
        width: 100%;
    }
}

/* =========================================================
   Inventory Page Layout
   ========================================================= */

.fi-inventory-grid {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 18px;
}

@media (max-width: 920px) {
    .fi-inventory-grid {
        grid-template-columns: 1fr;
    }
}

.fi-sidebar-title {
    font-family: Georgia, serif;
    font-size: 18px;
    margin: 0 0 8px;
}

/* OLD list-based categories (still kept for compatibility) */
.fi-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .fi-category-list li {
        margin: 0 0 4px;
    }

    .fi-category-list a {
        text-decoration: none;
        color: #8A6316;
        font-weight: 700;
    }

        .fi-category-list a:hover {
            color: var(--fi-frost-blue);
            text-decoration: none;
        }

        .fi-category-list a.active {
            color: var(--fi-war-red);
            text-decoration: underline;
        }

/* NEW box-based categories with dropdown groups */
.fi-cat-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
}

.fi-cat-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 5px 5px;
    min-height: 0;
    line-height: 1.1;
    font-size: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #8A6316;
    font-weight: 800;
    letter-spacing: 0.3px;
    border: 1px solid rgba(199, 154, 46, 0.35);
    background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(0,0,0,0.02));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

    .fi-cat-item:hover {
        border-color: rgba(20, 71, 188, 0.35);
        color: var(--fi-frost-blue);
    }

    .fi-cat-item.active {
        color: var(--fi-defender-gold-dark);
        border-color: rgba(199, 154, 46, 0.75);
        background: linear-gradient(180deg, rgba(224,188,98,0.22), rgba(255,255,255,0.06));
        box-shadow: inset 0 0 0 1px rgba(199,154,46,0.10);
    }

.fi-cat-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fi-cat-count {
    min-width: 34px;
    text-align: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    color: #3C2B14;
    border: 1px solid rgba(111, 84, 31, 0.35);
    background: rgba(0,0,0,0.06);
}

.fi-cat-caret {
    opacity: 0.75;
    font-size: 12px;
    line-height: 1;
}

/* details/summary cleanup */
.fi-cat-group > summary {
    list-style: none;
    cursor: pointer;
}

    .fi-cat-group > summary::-webkit-details-marker {
        display: none;
    }

/* nested items */
.fi-cat-children {
    margin-top: 8px;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fi-cat-item-sub {
    padding: 5px 5px;
    border-radius: 8px;
    font-weight: 800;
    border-color: rgba(111, 84, 31, 0.28);
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.02));
}

/* sidebar actions */
.fi-cat-actions {
    margin-top: 14px;
}

    .fi-cat-actions .fi-btn {
        width: 80%;
        text-align: center;
    }

/* Stack details above list (requested) */
.fi-inventory-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.fi-item-list-panel,
.fi-detail-panel {
    border: 1px solid rgba(92, 77, 43, 0.28);
    border-radius: 6px;
    background: rgba(255,255,255,0.10);
    padding: 10px;
}

.fi-detail-panel {
    border-left: 3px solid var(--fi-frost-blue);
    background: linear-gradient(180deg, rgba(20, 71, 188, 0.04), rgba(255,255,255,0.08));
}

/* Item grid exactly 3 columns (requested) */
.fi-items-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 1100px) {
    .fi-items-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .fi-items-grid {
        grid-template-columns: 1fr;
    }
}

.fi-item-card {
    border: 1px solid rgba(92, 77, 43, 0.32);
    border-top: 2px solid rgba(20, 71, 188, 0.28);
    border-left: 3px solid rgba(199, 154, 46, 0.75);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.10));
    padding: 9px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07), 0 2px 5px rgba(0,0,0,0.04);
}

    .fi-item-card.selected {
        border-top: 2px solid rgba(143, 30, 42, 0.65);
        border-left: 3px solid rgba(20, 71, 188, 0.85);
        box-shadow: inset 0 0 0 1px rgba(20, 71, 188, 0.12), 0 0 0 1px rgba(20, 71, 188, 0.06);
        background: linear-gradient(180deg, rgba(20, 71, 188, 0.06), rgba(255,255,255,0.10));
    }

    .fi-item-card .item-name {
        font-weight: 700;
        font-size: 14px;
        margin-bottom: 6px;
        line-height: 1.15;
    }

    .fi-item-card .item-meta {
        font-size: 12px;
        color: var(--fi-muted);
        line-height: 1.35;
    }

    .fi-item-card .item-actions {
        margin-top: 8px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

/* Rectangular item images (requested) */
.fi-item-thumb {
    height: 76px;
    border-radius: 4px;
    border: 1px solid rgba(57, 70, 96, 0.25);
    margin-bottom: 8px;
    background: linear-gradient(135deg, rgba(20, 71, 188, 0.14), rgba(143, 30, 42, 0.10)), linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0.08));
    position: relative;
    overflow: hidden;
}

    .fi-item-thumb::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(45deg, transparent 35%, rgba(255,255,255,0.20) 50%, transparent 65%);
        opacity: 0.55;
        pointer-events: none;
    }

    .fi-item-thumb span {
        position: absolute;
        left: 8px;
        right: 8px;
        bottom: 6px;
        font-size: 11px;
        font-weight: 700;
        color: #233652;
        text-shadow: 0 1px 0 rgba(255,255,255,0.35);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.fi-detail-thumb {
    height: 110px;
    border-radius: 5px;
    border: 1px solid rgba(57, 70, 96, 0.25);
    margin-bottom: 10px;
    background: radial-gradient(circle at 20% 20%, rgba(20, 71, 188, 0.18), transparent 50%), radial-gradient(circle at 80% 25%, rgba(143, 30, 42, 0.14), transparent 55%), linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.08));
    position: relative;
    overflow: hidden;
}

    .fi-detail-thumb::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.15) 55%, transparent 70%);
        pointer-events: none;
    }

    .fi-detail-thumb span {
        position: absolute;
        left: 10px;
        right: 10px;
        bottom: 8px;
        font-weight: 700;
        font-size: 13px;
        color: #24324e;
        text-shadow: 0 1px 0 rgba(255,255,255,0.4);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* =========================================================
   Detail Panel
   ========================================================= */

.fi-chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0 10px;
}

.fi-chip {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid rgba(57, 70, 96, 0.2);
    background: rgba(20, 71, 188, 0.06);
    color: var(--fi-frost-blue-dark);
}

    .fi-chip.gold {
        background: rgba(199, 154, 46, 0.12);
        border-color: rgba(199, 154, 46, 0.25);
        color: #7A5612;
    }

.fi-equip-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(111, 84, 31, 0.22);
}

.fi-equip-title {
    font-weight: 700;
    color: #47361C;
    margin-bottom: 6px;
    font-size: 13px;
}

.fi-equip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
}

    .fi-equip-grid form {
        margin: 0;
    }

.fi-stat-list {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    font-size: 13px;
    margin-top: 8px;
}

    .fi-stat-list .k {
        color: #4E4A43;
    }

    .fi-stat-list .v {
        font-weight: 700;
        color: #2A2A2A;
    }

.fi-empty-detail {
    color: var(--fi-muted);
    font-style: italic;
    padding: 8px 0;
}

/* =========================================================
   Item Rarity
   ========================================================= */

.fi-rarity-text {
    font-weight: 700;
}

.fi-rarity-common {
    color: #5F5A52;
}

.fi-rarity-uncommon {
    color: #2F7A3E;
}

.fi-rarity-rare {
    color: #1447BC;
}

.fi-rarity-elite {
    color: #B07A15;
}

.fi-rarity-legendary {
    color: #9B1F2C;
    text-shadow: 0 0 8px rgba(155, 31, 44, 0.15);
}

/* Rarity chips */
.fi-chip.rarity-common {
    background: rgba(95, 90, 82, 0.08);
    border-color: rgba(95, 90, 82, 0.20);
    color: #5F5A52;
}

.fi-chip.rarity-uncommon {
    background: rgba(47, 122, 62, 0.10);
    border-color: rgba(47, 122, 62, 0.22);
    color: #2F7A3E;
}

.fi-chip.rarity-rare {
    background: rgba(20, 71, 188, 0.10);
    border-color: rgba(20, 71, 188, 0.22);
    color: #1447BC;
}

.fi-chip.rarity-elite {
    background: rgba(199, 154, 46, 0.14);
    border-color: rgba(199, 154, 46, 0.28);
    color: #8A6316;
}

.fi-chip.rarity-legendary {
    background: rgba(143, 30, 42, 0.10);
    border-color: rgba(143, 30, 42, 0.24);
    color: #8F1E2A;
}

/* Rarity on cards */
.fi-item-card.rarity-common {
    border-left-color: rgba(120, 112, 100, 0.65);
}

.fi-item-card.rarity-uncommon {
    border-left-color: rgba(47, 122, 62, 0.75);
    border-top-color: rgba(47, 122, 62, 0.25);
}

.fi-item-card.rarity-rare {
    border-left-color: rgba(20, 71, 188, 0.85);
    border-top-color: rgba(20, 71, 188, 0.35);
    box-shadow: inset 0 0 0 1px rgba(20, 71, 188, 0.05);
}

.fi-item-card.rarity-elite {
    border-left-color: rgba(199, 154, 46, 0.85);
    border-top-color: rgba(199, 154, 46, 0.30);
    box-shadow: inset 0 0 0 1px rgba(199, 154, 46, 0.05);
}

.fi-item-card.rarity-legendary {
    border-left-color: rgba(143, 30, 42, 0.85);
    border-top-color: rgba(199, 154, 46, 0.35);
    box-shadow: inset 0 0 0 1px rgba(143, 30, 42, 0.06), 0 0 0 1px rgba(199, 154, 46, 0.05);
}

/* =========================================================
   V2 Topbar (Character Panel + Account Hub)
   Append this at the end of frostinvasion.css
   ========================================================= */

.fi-logo-row-v2 {
    margin-bottom: 14px;
}

.fi-paper-v2 {
    padding-top: 16px;
}

/* small pill in the header (top-right) */
.fi-login-pill-wrap {
    display: flex;
    justify-content: flex-end;
}

.fi-login-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(242, 244, 248, 0.92);
    border: 1px solid rgba(39, 48, 66, 0.30);
    text-decoration: none;
    color: var(--fi-text);
    box-shadow: 0 6px 14px rgba(0,0,0,0.18), inset 0 0 0 1px rgba(255,255,255,0.18);
}

.fi-login-pill-name {
    font-weight: 800;
    font-family: Georgia, serif;
}

.fi-login-pill-dot {
    opacity: 0.55;
}

.fi-login-pill-state {
    opacity: 0.75;
    font-weight: 700;
}

/* Layout of the new topbar */
.fi-topbar {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 12px;
}

@media (max-width: 980px) {
    .fi-topbar {
        grid-template-columns: 1fr;
    }
}

/* Icon: uses mask so it always matches currentColor */
.fi-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    background-color: currentColor;
    -webkit-mask-image: var(--fi-icon);
    mask-image: var(--fi-icon);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    opacity: 0.95;
    transform: translateY(-1px);
}

/* Character Panel */
.fi-char-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.10));
    border: 1px solid rgba(92, 77, 43, 0.28);
    border-radius: 10px;
    padding: 10px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

.fi-char-panel-title {
    font-weight: 900;
    letter-spacing: 2px;
    font-size: 13px;
    color: var(--fi-frost-blue);
    margin-bottom: 10px;
}

.fi-char-panel-row {
    display: grid;
    grid-template-columns: 1fr 35px 35px;
    gap: 10px;
    align-items: center;
}

.fi-char-panel-select {
    min-width: 0;
    width: 100%;
    font-weight: 700;
}

.fi-char-panel-btn {
    white-space: nowrap;
    padding: 5px 9px;
}

    .fi-char-panel-btn .fi-icon {
        transform: translateY(1px);
    }

.fi-char-panel-hint {
    margin-top: 2px;
    color: var(--fi-muted);
    font-size: 12.5px;
}

.fi-char-panel-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

@media (max-width: 420px) {
    .fi-char-panel-actions {
        grid-template-columns: 1fr;
    }
}

.fi-char-panel-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    color: var(--fi-frost-blue-dark);
    background: rgba(20, 71, 188, 0.07);
    border: 1px solid rgba(20, 71, 188, 0.18);
    font-size: 13px;
    line-height: 1.1;
}

    .fi-char-panel-link .fi-icon {
        width: 16px;
        height: 16px;
    }

    .fi-char-panel-link:hover {
        background: rgba(20, 71, 188, 0.13);
    }

    .fi-char-panel-link.active {
        background: rgba(20, 71, 188, 0.2);
        border-color: rgba(20, 71, 188, 0.3);
    }

/* Account Hub */
.fi-account-hub {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(92, 77, 43, 0.28);
    border-radius: 14px;
    padding: 10px 12px 10px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}

.fi-account-hub-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.fi-account-hub-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fi-hub-title {
    font-weight: 900;
    letter-spacing: 2.2px;
    font-size: 12px;
    color: #7A5612;
    margin-right: 10px;
    line-height: 1.05;
}

.fi-hub-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(199,154,46,0.10);
    border: 1px solid rgba(199,154,46,0.35);
    color: #7A5612;
    font-weight: 900;
    letter-spacing: 1.5px;
    font-size: 12px;
}

.fi-hub-account {
    font-weight: 900;
    font-size: 16px;
    color: #1f1f1f;
    font-family: Georgia, serif;
    line-height: 1.05;
}

.fi-gold-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 40px;
    border-radius: 999px;
    border: 1px solid rgba(199,154,46,0.8);
    background: rgba(255,255,255,0.35);
    color: #7A5612;
    font-weight: 900;
    white-space: nowrap;
}

.fi-gold-coin {
    opacity: 0.85;
    font-size: 14px;
    transform: translateY(1px);
}

/* Hub nav links */
.fi-hub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: center;
    padding-top: 6px;
    border-top: 1px solid rgba(111, 84, 31, 0.22);
}

.fi-hub-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 900;
    padding: 4px 9px;
    border-radius: 8px;
    border: 1px solid rgba(199,154,46,0.35);
    background: rgba(199,154,46,0.10);
    color: #6E4F12;
    font-size: 13px;
    line-height: 1.1;
}

    .fi-hub-link .fi-icon {
        opacity: 0.9;
        width: 16px;
        height: 16px;
        margin-right: 2px;
    }

    .fi-hub-link:hover {
        color: #5C3F0D;
        background: rgba(199,154,46,0.16);
        border-color: rgba(199,154,46,0.55);
    }

    .fi-hub-link.active {
        color: #4E360A;
        background: linear-gradient(180deg, rgba(224,188,98,0.55), rgba(199,154,46,0.25));
        border-color: rgba(122, 84, 19, 0.65);
    }

.fi-hub-link-extras {
    flex-basis: 100%;
    width: fit-content;
    margin-top: 2px;
}

/* make existing <img class="fi-nav-icon"> not fight with the new icon system */
.fi-nav-icon {
    filter: none;
}

/* =========================================================
   Extras dropdown inside Account Hub (button-looking)
   ========================================================= */

.fi-hub-extras {
    position: relative;
    display: inline-block;
}

/* Remove default marker triangle */
.fi-hub-extras-summary::-webkit-details-marker {
    display: none;
}

.fi-hub-extras-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

/* Dropdown menu */
.fi-hub-extras-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    z-index: 50;
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(235,230,214,0.95));
    border: 1px solid rgba(92, 77, 43, 0.35);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.fi-hub-extras-link {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    color: #6E4F12;
}

    .fi-hub-extras-link:hover {
        background: rgba(199,154,46,0.14);
        color: #5C3F0D;
    }

.fi-hub-extras-sep {
    height: 1px;
    margin: 6px 4px;
    background: rgba(92, 77, 43, 0.22);
}

.fi-hub-extras-link-danger {
    color: #8F1E2A;
}

    .fi-hub-extras-link-danger:hover {
        background: rgba(143,30,42,0.10);
        color: #65131D;
    }

.fi-account-gold {
    color: #b58810; /* “gold” */
    font-weight: 800;
}

    .fi-account-gold .fi-icon {
        vertical-align: -0.3em; /* lowers it slightly */
    }

.fi-assist-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}


.fi-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

    .fi-page-header .fi-title {
        margin: 0;
    }

.fi-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
}

.fi-modal {
    width: 100%;
    max-width: 460px;
    background: #dcd1bf;
    border: 2px solid #444;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.fi-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.fi-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(0,0,0,0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

    .fi-icon-btn:hover {
        background: rgba(255,255,255,0.12);
    }

    .fi-icon-btn.danger:hover {
        background: rgba(180, 40, 40, 0.85);
    }

    .fi-icon-btn.info:hover {
        background: rgba(20,71,188,0.85);
    }

/* ===== Market hover dropdown (clickable header) ===== */

.fi-hub-dropdown {
    position: relative;
    display: inline-block;
    z-index: 1;
}

    /* show menu on hover OR keyboard focus */
    .fi-hub-dropdown:hover,
    .fi-hub-dropdown:focus-within {
        z-index: 50;
    }

        .fi-hub-dropdown:hover .fi-hub-dropdown-menu,
        .fi-hub-dropdown:focus-within .fi-hub-dropdown-menu {
            display: block;
        }

.fi-hub-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Menu */
.fi-hub-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 190px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(92, 77, 43, 0.30);
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(235,230,214,0.96));
    box-shadow: 0 10px 18px rgba(0,0,0,0.18);
}

    /* "Hover bridge" so the menu doesn't close while moving the mouse down */
    .fi-hub-dropdown-menu::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: -10px;
        height: 10px;
        /* transparent but hoverable */
        background: transparent;
    }

.fi-hub-dropdown-link {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    color: #8A6316;
}

    .fi-hub-dropdown-link:hover {
        color: var(--fi-frost-blue);
        background: rgba(20, 71, 188, 0.06);
    }

    .fi-hub-dropdown-link.active {
        color: var(--fi-war-red);
        background: rgba(143, 30, 42, 0.06);
    }

.fi-hub-caret {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.8;
}

/* =========================================================
   Character Progression (Proficiencies / Attributes cards)
   ========================================================= */

.fi-prog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.fi-prog-actions {
    display: flex;
    gap: 8px;
}

    .fi-prog-actions form {
        margin: 0;
    }

.fi-prog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 1050px) {
    .fi-prog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .fi-prog-grid {
        grid-template-columns: 1fr;
    }
}

.fi-prog-grid-2 {
    display: grid;
    grid-template-columns: 2fr 7fr;
    gap: 22px;
}

@media (max-width:920px) {
    .fi-prog-grid-2 {
        grid-template-columns: 1fr;
    }
}

.fi-prog-item {
    display: grid;
    grid-template-columns: 60px 1fr 34px;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(92, 77, 43, 0.32);
    border-top: 2px solid rgba(20, 71, 188, 0.20);
    border-left: 3px solid rgba(199, 154, 46, 0.80);
    border-radius: 8px;
    padding: 9px;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.10));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07), 0 2px 5px rgba(0,0,0,0.04);
}

.fi-prog-thumb {
    height: 60px;
    width: 60px;
    border-radius: 6px;
    border: 1px solid rgba(57,70,96,0.25);
    background: linear-gradient(135deg, rgba(20,71,188,0.14), rgba(143,30,42,0.10)), linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0.08));
    position: relative;
    overflow: hidden;
}

.fi-prog-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fi-prog-name {
    font-weight: 900;
    color: #3C2B14;
    line-height: 1.1;
}

.fi-prog-meta {
    font-size: 12px;
    margin-top: 4px;
    color: var(--fi-muted);
    font-weight: 700;
}

.fi-icon-plus {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(20, 71, 188, 0.35);
    background: rgba(20, 71, 188, 0.08);
    color: var(--fi-frost-blue-dark);
    font-weight: 900;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

    .fi-icon-plus:hover {
        background: rgba(20, 71, 188, 0.14);
    }

    .fi-icon-plus:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.ni2-class-selection-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* =========================================================
 Footer
 ========================================================= */
.fi-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(111,84,31,0.22);
    color: var(--fi-muted);
    font-size: 12.5px;
}

.fi-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.fi-footer-links {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .fi-footer-links a {
        color: #8A6316;
        text-decoration: none;
        font-weight: 800;
    }

        .fi-footer-links a:hover {
            color: var(--fi-frost-blue);
            text-decoration: underline;
        }

.fi-footer-sep {
    opacity: 0.6;
}

.fi-footer-meta {
    opacity: 0.85;
    font-weight: 700;
}

@media (max-width:520px) {
    .fi-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
 Character Quests
 ========================================================= */

.fi-quests-grid {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 14px;
    align-items: start;
}

@media (max-width:1100px) {
    .fi-quests-grid {
        grid-template-columns: 1fr;
    }
}

.fi-quests-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.fi-quest-list {
    display: grid;
    gap: 8px;
}

.fi-quest-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    border: 2px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.3);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}

    .fi-quest-row:hover {
        background: rgba(255,255,255,.4);
    }

    .fi-quest-row.active {
        border-color: rgba(122,162,247, .7);
        background: rgba(180,190,200,.3);
        box-shadow: 2px rgba(122,162,247, .3);
    }

.fi-quests-titlebar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 0;
    margin-bottom: 12px;
}

.fi-quest-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

    .fi-quest-progress-row .fi-quest-row-progress,
    .fi-quest-progress-row .fi-quest-details-progress {
        flex: 11 auto;
    }

.fi-quest-progress-pct {
    flex: 00 auto;
    min-width: 44px;
    text-align: right;
}

.fi-quest-progress-row--details {
    margin-top: 10px;
}

.fi-quest-row-progress,
.fi-quest-details-progress {
    height: 16px;
    border: 1px solid rgba(20,71,188,0.35);
    background: rgba(255,255,255,0.7);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
}

.fi-quest-row-progressbar,
.fi-quest-details-progressbar {
    height: 100%;
    background: linear-gradient(90deg, #1447BC, #d4a017);
}

.fi-quests-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
    margin-top: 14px;
}

@media (max-width:820px) {
    .fi-quests-details-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
 Crafting
 ========================================================= */

.fi-crafting-card {
    margin-top: 6px;
    max-width: 520px; /* ~half page on desktop */
}

.fi-crafting-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(111,84,31,0.22);
    margin-bottom: 8px;
}

.fi-crafting-count {
    font-weight: 800;
    font-size: 11.5px;
}

.fi-material-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 4px;
}

.fi-material-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(92,77,43,0.22);
    background: rgba(255,255,255,0.10);
}

    .fi-material-row:hover {
        border-color: rgba(20,71,188,0.28);
        background: rgba(20,71,188,0.04);
    }

.fi-material-main {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.fi-material-qty-inline {
    font-weight: 900;
    color: #3C2B14;
    white-space: nowrap;
}

.fi-material-name {
    font-size: 13.5px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fi-material-rarity {
    justify-self: auto;
    flex: 00 auto;
    font-size: 11.5px;
    padding: 3px 4px;
}

@media (max-width:920px) {
    .fi-crafting-card {
        max-width: 100%;
    }
}
