/* src/styles/loot-chest-popout.css
   Attack-menu / combat-tracker palette: charcoal, warm gold, choice cards. */

#loot-chest-nav-btn.hidden,
#loot-chest-nav-btn[hidden] {
    display: none !important;
}

#tab-nav {
    overflow: visible;
}

#tab-nav > #loot-chest-nav-btn {
    flex: 0 0 auto;
    align-self: flex-start;
    position: relative;
    z-index: 5;
    overflow: visible;
    pointer-events: auto;
    margin-top: 0.15rem;
}

#loot-chest-nav-btn {
    overflow: visible;
    --loot-tier: #c5c5c5;
    --loot-glow-rgb: 197, 197, 197;
}

#loot-chest-nav-btn[data-loot-tier="common"] {
    --loot-tier: #c5c5c5;
    --loot-glow-rgb: 197, 197, 197;
}
#loot-chest-nav-btn[data-loot-tier="uncommon"] {
    --loot-tier: #6fbf73;
    --loot-glow-rgb: 111, 191, 115;
}
#loot-chest-nav-btn[data-loot-tier="rare"] {
    --loot-tier: #5aa7ff;
    --loot-glow-rgb: 90, 167, 255;
}
#loot-chest-nav-btn[data-loot-tier="unique"] {
    --loot-tier: #c084fc;
    --loot-glow-rgb: 192, 132, 252;
}
#loot-chest-nav-btn .loot-nav-count {
    position: absolute;
    top: -0.2rem;
    right: -0.35rem;
    z-index: 6;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: rgb(var(--loot-glow-rgb));
    color: #16120e;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.15rem;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(12, 10, 8, 0.55);
    pointer-events: none;
}

#loot-chest-nav-btn .loot-nav-count[hidden] {
    display: none !important;
}

#loot-chest-nav-btn[data-loot-tier="mythic"] {
    --loot-tier: #ffb020;
    --loot-glow-rgb: 255, 176, 32;
}

#loot-chest-nav-btn .loot-nav-art {
    position: relative;
    display: block;
    isolation: isolate;
}

#loot-chest-nav-btn .loot-nav-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--loot-tier);
    mix-blend-mode: color;
    pointer-events: none;
}

#loot-chest-nav-btn img {
    width: 42px;
    height: 42px;
    display: block;
    opacity: 0.78;
    transform-origin: center;
    transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

#loot-chest-nav-btn:hover img,
#loot-chest-nav-btn.is-open img {
    opacity: 1;
}

#loot-chest-nav-btn:not(.hidden):not(.is-open) {
    animation: loot-chest-flash 1.15s ease-in-out infinite;
}

#loot-chest-nav-btn:not(.hidden):not(.is-open) .loot-nav-art {
    animation: loot-chest-flash-icon 1.15s ease-in-out infinite;
}

#loot-chest-nav-btn.is-attention:not(.hidden):not(.is-open) {
    animation: loot-chest-flash 0.7s ease-in-out infinite;
}

#loot-chest-nav-btn.is-attention:not(.hidden):not(.is-open) .loot-nav-art {
    animation: loot-chest-flash-icon 0.7s ease-in-out infinite;
}

@keyframes loot-chest-flash {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--loot-glow-rgb), 0);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(var(--loot-glow-rgb), 0.28), 0 0 18px rgba(var(--loot-glow-rgb), 0.85);
        filter: brightness(1.28);
    }
}

@keyframes loot-chest-flash-icon {
    0%, 100% { transform: scale(1); opacity: 0.82; }
    50% { transform: scale(1.14); opacity: 1; filter: drop-shadow(0 0 6px rgba(var(--loot-glow-rgb), 0.9)); }
}

#loot-chest-overlay.inv-overlay,
#gm-loot-chest-overlay.loot-chest-overlay {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 3000;
}

#loot-chest-overlay.inv-overlay {
    top: var(--tab-nav-h, 0px);
    height: calc(100dvh - var(--tab-nav-h, 0px));
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#loot-chest-overlay.inv-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

#gm-loot-chest-overlay.loot-chest-overlay {
    display: none;
}

#gm-loot-chest-overlay.loot-chest-overlay.active {
    display: flex;
}

#gm-loot-chest-overlay.hidden {
    display: none !important;
}

#loot-chest-overlay .inv-overlay-backdrop,
.loot-chest-overlay-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: pointer;
}

.loot-chest-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: min(760px, 96vw);
    height: min(720px, calc(100dvh - var(--tab-nav-h, 0px) - 2.5rem));
    max-height: min(86vh, 760px);
    border-radius: 16px;
    border: 1px solid rgba(180, 140, 90, 0.42);
    background:
        radial-gradient(120% 80% at 50% -30%, rgba(180, 140, 90, 0.16) 0%, transparent 55%),
        linear-gradient(168deg, #2c2624 0%, #1c1917 52%, #111010 100%);
    box-shadow:
        0 28px 64px rgba(0, 0, 0, 0.72),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 42px rgba(214, 158, 46, 0.12);
    color: rgba(248, 242, 236, 0.96);
    color-scheme: dark;
}

.gm-loot-chest-modal.loot-chest-shell {
    width: min(1180px, 96vw);
    height: min(88vh, 860px);
    max-height: 88vh;
}

.loot-chest-shell,
.loot-chest-shell * {
    scrollbar-width: thin;
    scrollbar-color: rgba(180, 140, 90, 0.55) rgba(0, 0, 0, 0.28);
}

.loot-chest-rewards-btn {
    position: absolute;
    top: 14px;
    right: 56px;
}

.gm-loot-chest-rewards-pop {
    position: absolute;
    top: calc(100% - 6px);
    right: 16px;
    z-index: 4;
    width: min(34rem, calc(100% - 24px));
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(180, 140, 90, 0.42);
    background: linear-gradient(168deg, #322a26 0%, #1a1614 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.gm-loot-chest-rewards-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.gm-loot-chest-rewards-table th,
.gm-loot-chest-rewards-table td {
    padding: 0.4rem 0.45rem;
    border-bottom: 1px solid rgba(180, 140, 90, 0.18);
    text-align: left;
    vertical-align: top;
}

.gm-loot-chest-rewards-table th {
    color: rgba(255, 193, 7, 0.82);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.loot-chest-shell-header {
    position: relative;
    flex-shrink: 0;
    padding: 12px 52px 10px 18px;
    border-bottom: 1px solid rgba(180, 140, 90, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%),
        rgba(0, 0, 0, 0.22);
}

.loot-chest-eyebrow,
.loot-chest-step-label {
    margin: 0 0 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(255, 193, 7, 0.82);
}

.loot-chest-shell-header h3,
.loot-chest-detail-head h3 {
    margin: 0;
    font-family: Cinzel, serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(240, 225, 195, 0.98);
    text-shadow: none;
}

#loot-chest-popout .loot-chest-detail-head h3 {
    font-size: 0.98rem;
}

.gm-loot-chest-title-row {
    display: flex;
    align-items: baseline;
    gap: 0.28rem;
}

.gm-loot-chest-io {
    display: inline-flex;
    align-items: center;
    gap: 0.02rem;
    transform: translateY(-0.08em);
}

.gm-loot-chest-io-btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0 0.1rem;
    margin: 0;
    font-size: 0.64rem;
    line-height: 1;
    color: rgba(248, 242, 236, 0.22);
    cursor: pointer;
}

.gm-loot-chest-io-btn:hover,
.gm-loot-chest-io-btn:focus-visible {
    color: rgba(255, 193, 7, 0.72);
    outline: none;
}

.loot-chest-shell-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(180, 140, 90, 0.45);
    background: linear-gradient(180deg, rgba(80, 56, 28, 0.85) 0%, rgba(40, 26, 14, 0.95) 100%);
    color: rgba(255, 232, 200, 0.92);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.loot-chest-shell-close:hover {
    border-color: rgba(255, 193, 7, 0.65);
}

.loot-chest-popout-body,
.gm-loot-chest-workspace {
    flex: 1 1 auto;
    min-height: 0;
}

.loot-chest-popout-body {
    overflow: auto;
    padding: 16px 18px 18px;
}

.loot-chest-help,
.loot-chest-notes,
.loot-chest-vote-status,
.loot-chest-item-hint,
.loot-chest-empty {
    margin: 0 0 8px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgba(243, 234, 216, 0.86);
}

.loot-chest-tabs,
.loot-chest-work-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.loot-chest-tab,
.loot-chest-work-tab,
.loot-chest-vote-btn,
.loot-chest-ghost-btn,
.loot-chest-primary-btn,
.gm-loot-chest-row,
.gm-loot-chest-search-hit {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: inherit;
    border-radius: 12px;
    cursor: pointer;
}

.loot-chest-tab,
.loot-chest-work-tab {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.loot-chest-tab.is-active,
.loot-chest-work-tab.is-active,
.loot-chest-vote-btn.is-selected,
.loot-chest-ghost-btn.is-selected,
.gm-loot-chest-row.is-selected {
    border-color: rgba(255, 193, 7, 0.55);
    background: linear-gradient(180deg, rgba(90, 64, 28, 0.62) 0%, rgba(28, 20, 12, 0.9) 100%);
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.18);
}

.loot-chest-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.loot-chest-detail-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.loot-chest-settle {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 193, 7, 0.78);
}

.loot-chest-tier {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    flex-shrink: 0;
}

.loot-chest-tier--common { color: #c5c5c5; }
.loot-chest-tier--uncommon { color: #6fbf73; }
.loot-chest-tier--rare { color: #5aa7ff; }
.loot-chest-tier--unique { color: #c084fc; }
.loot-chest-tier--mythic { color: #ffb020; }

.loot-chest-item,
.loot-chest-gold,
.loot-chest-card {
    border: 1px solid rgba(180, 140, 90, 0.28);
    border-left-width: 5px;
    border-radius: 10px;
    padding: 0.65rem 0.7rem 0.7rem;
    margin: 0 0 0.65rem;
    background: rgba(0, 0, 0, 0.22);
}

#loot-chest-popout .loot-chest-item {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 40%),
        rgba(18, 14, 12, 0.55);
}

#loot-chest-popout .loot-chest-item.rarity-starter { border-left-color: #c4a574; }
#loot-chest-popout .loot-chest-item.rarity-common { border-left-color: #c9c4b4; }
#loot-chest-popout .loot-chest-item.rarity-uncommon { border-left-color: #6fbf73; }
#loot-chest-popout .loot-chest-item.rarity-rare { border-left-color: #5aa7ff; }
#loot-chest-popout .loot-chest-item.rarity-very-rare { border-left-color: #c084fc; }
#loot-chest-popout .loot-chest-item.rarity-unique { border-left-color: #ffb020; }
#loot-chest-popout .loot-chest-item.rarity-mythic { border-left-color: #fb923c; }

#loot-chest-popout .loot-chest-item.loot-kind-consumable {
    background:
        linear-gradient(90deg, rgba(45, 140, 130, 0.16) 0%, transparent 42%),
        rgba(18, 14, 12, 0.55);
}
#loot-chest-popout .loot-chest-item.loot-kind-accessory {
    background:
        linear-gradient(90deg, rgba(160, 70, 110, 0.16) 0%, transparent 42%),
        rgba(18, 14, 12, 0.55);
}
#loot-chest-popout .loot-chest-item.loot-kind-weapon {
    background:
        linear-gradient(90deg, rgba(170, 70, 40, 0.16) 0%, transparent 42%),
        rgba(18, 14, 12, 0.55);
}
#loot-chest-popout .loot-chest-item.loot-kind-shield {
    background:
        linear-gradient(90deg, rgba(80, 110, 170, 0.16) 0%, transparent 42%),
        rgba(18, 14, 12, 0.55);
}
#loot-chest-popout .loot-chest-item.loot-kind-armor {
    background:
        linear-gradient(90deg, rgba(120, 95, 50, 0.16) 0%, transparent 42%),
        rgba(18, 14, 12, 0.55);
}

#loot-chest-popout .loot-chest-gold {
    border-left-color: #ffd27a;
    background:
        linear-gradient(90deg, rgba(214, 158, 46, 0.16) 0%, transparent 46%),
        rgba(18, 14, 12, 0.55);
}

.loot-chest-item-head {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.55rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: default;
}

.loot-chest-item.le-expand-card {
    cursor: pointer;
}

.loot-chest-item.le-expand-card .le-expand-details {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0;
    transition: grid-template-rows 0.45s ease, opacity 0.38s ease, margin-top 0.38s ease;
}

.loot-chest-item.le-expand-card .le-expand-details > * {
    overflow: hidden;
    min-height: 0;
}

.loot-chest-item.le-expand-card.is-expanded .le-expand-details {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 0.28rem;
}

@media (hover: hover) {
    .loot-chest-item.le-expand-card:hover .le-expand-details {
        grid-template-rows: 1fr;
        opacity: 1;
        margin-top: 0.28rem;
    }
}

.loot-chest-item-name {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-family: Cinzel, serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(248, 242, 236, 0.96);
}

.loot-chest-item-name .item-stat-badge {
    display: inline-flex;
    vertical-align: middle;
    font-family: inherit;
    font-size: 0.62rem;
}

.loot-chest-armor-type {
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.62rem;
    font-family: inherit;
}

.loot-chest-armor-type--light { color: #93c5fd; }
.loot-chest-armor-type--medium { color: #6ee7b7; }
.loot-chest-armor-type--heavy { color: #fbbf24; }
.loot-chest-armor-type--robe { color: #c4b5fd; }

.loot-chest-item-desc {
    margin: 0.4rem 0 0.15rem;
    color: #f3ead8;
    font-size: 0.72rem;
    line-height: 1.4;
}

.loot-chest-sell {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    margin: 0.2rem 0 0;
    font-size: 0.68rem;
    color: #e8c36a;
    font-weight: 600;
}

#loot-chest-popout .loot-chest-item--gold .loot-chest-gold-amount,
#loot-chest-popout .loot-chest-gold-amount {
    color: #ffd27a;
    border-color: rgba(255, 210, 122, 0.55);
}

.loot-chest-item-meta,
.gm-loot-chest-row-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    opacity: 0.88;
}

.loot-chest-rarity,
.loot-chest-type {
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
}

#loot-chest-popout .loot-chest-rarity.rarity-starter { color: #e6d2a8; }
#loot-chest-popout .loot-chest-rarity.rarity-common { color: #d8d3c4; }
#loot-chest-popout .loot-chest-rarity.rarity-uncommon { color: #86efac; }
#loot-chest-popout .loot-chest-rarity.rarity-rare { color: #7dd3fc; }
#loot-chest-popout .loot-chest-rarity.rarity-very-rare { color: #d8b4fe; }
#loot-chest-popout .loot-chest-rarity.rarity-unique { color: #fbbf24; }
#loot-chest-popout .loot-chest-rarity.rarity-mythic { color: #fb923c; }

.loot-chest-type {
    color: #9ee7dc;
}

.loot-chest-item-card {
    margin: 0.4rem 0 0.15rem;
    color: #f3ead8;
    font-size: 0.72rem;
    line-height: 1.4;
}

#loot-chest-popout .loot-chest-item-card .shop-item-description,
#loot-chest-popout .loot-chest-item-card .item-card-description,
#loot-chest-popout .loot-chest-item-card p,
#loot-chest-popout .loot-chest-item-card li,
#loot-chest-popout .loot-chest-item-card .slot-label,
#loot-chest-popout .loot-chest-item-card strong {
    color: #f3ead8 !important;
    font-size: 0.72rem;
    line-height: 1.4;
}

#loot-chest-popout .loot-chest-item-card .item-card-subheader {
    margin: 0.35rem 0 0.12rem;
    color: #e8c36a !important;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
}

#loot-chest-popout .loot-chest-item-card ul {
    margin: 0.12rem 0 0.2rem;
    padding-left: 1rem;
}

#loot-chest-popout .loot-chest-item-card .item-sell-price {
    display: flex;
    margin-top: 0.2rem;
    font-size: 0.68rem !important;
    color: #e8c36a !important;
    font-weight: 600;
}

#loot-chest-popout .loot-chest-item-card .item-sell-price strong {
    font-size: inherit !important;
    color: inherit !important;
}

#loot-chest-popout .loot-chest-item-card .item-hands-type-row {
    margin: 0.15rem 0 0;
}

.loot-chest-vote-picks,
.loot-chest-gold-actions,
.loot-chest-gold-shares,
.loot-chest-vote-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.loot-chest-vote-row {
    flex-direction: column;
    align-items: stretch;
    margin-top: 0.55rem;
}

.loot-chest-vote-drop {
    position: relative;
    max-width: 18rem;
}

.loot-chest-vote-summary,
.loot-chest-vote-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.28);
    color: inherit;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
}

.loot-chest-vote-summary img,
.loot-chest-vote-option img,
.loot-chest-vote-even,
.loot-chest-vote-pass {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.loot-chest-vote-even,
.loot-chest-vote-pass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 193, 7, 0.18);
    color: #ffd27a;
    font-size: 0.72rem;
    font-weight: 700;
}

.loot-chest-vote-pass {
    background: rgba(160, 160, 180, 0.18);
    color: #c8c4d0;
}

.loot-chest-vote-drop.is-open .loot-chest-vote-summary {
    border-color: rgba(255, 193, 7, 0.55);
}

.loot-chest-vote-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 5;
    display: grid;
    gap: 0.3rem;
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid rgba(180, 140, 90, 0.42);
    background: linear-gradient(168deg, #322a26 0%, #1a1614 100%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.loot-chest-vote-option.is-selected {
    border-color: rgba(255, 193, 7, 0.55);
    background: linear-gradient(180deg, rgba(90, 64, 28, 0.62) 0%, rgba(28, 20, 12, 0.9) 100%);
}

.loot-chest-vote-btn,
.loot-chest-ghost-btn,
.loot-chest-primary-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
}

.loot-chest-primary-btn {
    border-color: rgba(255, 193, 7, 0.5);
    background: linear-gradient(180deg, rgba(110, 74, 28, 0.95) 0%, rgba(58, 36, 14, 0.98) 100%);
    color: #ffd27a;
}

.loot-chest-gold-total {
    margin: 0 0 0.45rem;
    font-family: Cinzel, serif;
    font-size: 0.95rem;
    color: #ffd27a;
}

#loot-chest-popout .loot-chest-vote-summary,
#loot-chest-popout .loot-chest-vote-option {
    padding: 0.28rem 0.45rem;
    font-size: 0.75rem;
    color: rgba(243, 234, 216, 0.92);
}

#loot-chest-popout .loot-chest-vote-summary span,
#loot-chest-popout .loot-chest-vote-option span {
    color: rgba(243, 234, 216, 0.92);
}

.loot-chest-gold-share {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 11rem;
    padding: 0.4rem 0.55rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
}

.loot-chest-gold-share input,
.gm-loot-chest-form input,
.gm-loot-chest-form select,
.gm-loot-chest-form textarea,
.gm-loot-chest-qty,
.gm-loot-chest-assign select,
#gm-loot-chest-item-search {
    background: rgba(8, 6, 6, 0.72);
    border: 1px solid rgba(180, 140, 90, 0.28);
    color: rgba(248, 242, 236, 0.96);
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
}

.loot-chest-gold-share input,
.gm-loot-chest-qty {
    width: 4.6rem;
}

/* GM workspace */
.gm-loot-chest-workspace {
    display: grid;
    grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr);
    min-height: 0;
}

.gm-loot-chest-library {
    min-height: 0;
    overflow: auto;
    padding: 14px 12px 16px;
    border-right: 1px solid rgba(180, 140, 90, 0.2);
    background: rgba(0, 0, 0, 0.16);
}

.gm-loot-chest-library-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.gm-loot-chest-sort {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    margin-left: auto;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(230, 214, 186, 0.72);
}

.gm-loot-chest-sort select {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
}

.gm-loot-chest-library-head .loot-chest-step-label {
    margin: 0;
}

.gm-loot-chest-list-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
}

.gm-loot-chest-list-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.28rem 0.62rem;
    border-radius: 999px;
    border: 1px solid rgba(180, 140, 90, 0.28);
    background: rgba(12, 10, 8, 0.55);
    color: rgba(230, 214, 186, 0.88);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    line-height: 1.2;
    cursor: pointer;
}

.gm-loot-chest-list-pill span {
    opacity: 0.65;
    font-variant-numeric: tabular-nums;
}

.gm-loot-chest-list-pill.is-selected span {
    opacity: 0.9;
}

.gm-loot-chest-list-pill--quick,
.gm-loot-chest-list-pill--starter {
    border-color: rgba(232, 195, 106, 0.42);
    color: #f0d78a;
}
.gm-loot-chest-list-pill--quick.is-selected,
.gm-loot-chest-list-pill--starter.is-selected {
    border-color: rgba(232, 195, 106, 0.85);
    background: linear-gradient(180deg, rgba(120, 88, 22, 0.78) 0%, rgba(42, 30, 10, 0.94) 100%);
    color: #ffe8a3;
}

.gm-loot-chest-list-pill--dungeon {
    border-color: rgba(125, 168, 214, 0.4);
    color: #9ec4e8;
}
.gm-loot-chest-list-pill--dungeon.is-selected {
    border-color: rgba(125, 168, 214, 0.8);
    background: linear-gradient(180deg, rgba(36, 62, 96, 0.82) 0%, rgba(14, 22, 36, 0.94) 100%);
    color: #d4e8ff;
}

.gm-loot-chest-list-pill--town {
    border-color: rgba(214, 138, 90, 0.45);
    color: #e8b089;
}
.gm-loot-chest-list-pill--town.is-selected {
    border-color: rgba(214, 138, 90, 0.85);
    background: linear-gradient(180deg, rgba(110, 58, 28, 0.8) 0%, rgba(40, 20, 12, 0.94) 100%);
    color: #ffd4b0;
}

.gm-loot-chest-list-pill--drop {
    border-color: rgba(111, 191, 115, 0.42);
    color: #8fd494;
}
.gm-loot-chest-list-pill--drop.is-selected {
    border-color: rgba(111, 191, 115, 0.82);
    background: linear-gradient(180deg, rgba(28, 78, 40, 0.8) 0%, rgba(12, 28, 16, 0.94) 100%);
    color: #c8f0cc;
}

.gm-loot-chest-list-pill--event {
    border-color: rgba(192, 132, 252, 0.45);
    color: #d4b0ff;
}
.gm-loot-chest-list-pill--event.is-selected {
    border-color: rgba(192, 132, 252, 0.85);
    background: linear-gradient(180deg, rgba(72, 36, 110, 0.82) 0%, rgba(28, 14, 42, 0.94) 100%);
    color: #eedcff;
}

.gm-loot-chest-list-pill--given {
    border-color: rgba(134, 239, 172, 0.4);
    color: #86efac;
}
.gm-loot-chest-list-pill--given.is-selected {
    border-color: rgba(134, 239, 172, 0.8);
    background: linear-gradient(180deg, rgba(22, 78, 48, 0.8) 0%, rgba(10, 28, 18, 0.94) 100%);
    color: #bbf7d0;
}

.gm-loot-chest-group {
    margin: 0 0 0.95rem;
}

.gm-loot-chest-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(230, 214, 186, 0.72);
}

.gm-loot-chest-group-title span {
    letter-spacing: 0;
    opacity: 0.7;
}

.gm-loot-chest-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    width: 100%;
    text-align: left;
    margin: 0 0 0.5rem;
    padding: 0.7rem 0.75rem;
}

.gm-loot-chest-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    width: 100%;
}

.gm-loot-chest-row-title {
    font-weight: 700;
}

.gm-loot-chest-given {
    font-size: 0.7rem;
    color: rgba(154, 209, 255, 0.9);
}

.gm-loot-chest-given.is-given {
    color: #86efac;
}

.gm-loot-chest-main {
    min-height: 0;
    overflow: auto;
    padding: 14px 16px 18px;
}

.gm-loot-chest-pane {
    display: none;
}

.gm-loot-chest-pane.is-active {
    display: block;
}

.gm-loot-chest-identity {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(6.5rem, 0.55fr) minmax(7rem, 0.65fr) auto;
    gap: 0.65rem;
    align-items: end;
}

.gm-loot-chest-form textarea {
    min-height: 3.2rem;
}

.gm-loot-chest-form label,
.gm-loot-chest-search-label,
.gm-loot-chest-qty-wrap,
.gm-loot-chest-assign {
    display: block;
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(230, 214, 186, 0.78);
}

.gm-loot-chest-form input,
.gm-loot-chest-form select,
.gm-loot-chest-form textarea,
#gm-loot-chest-item-search {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.92rem;
}

.gm-loot-chest-form textarea {
    resize: vertical;
}

.gm-loot-chest-given-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.35rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
    color: rgba(248, 242, 236, 0.92);
    cursor: pointer;
}

.gm-loot-chest-given-toggle:has(input:checked) {
    border-color: rgba(134, 239, 172, 0.45);
    color: #86efac;
}

.gm-loot-chest-slot-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.gm-loot-chest-slot-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-height: 3.4rem;
    padding: 0.45rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.gm-loot-chest-slot-tab span {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 193, 7, 0.78);
}

.gm-loot-chest-slot-tab small {
    font-size: 0.72rem;
    opacity: 0.78;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.gm-loot-chest-slot-tab.is-active,
.gm-loot-chest-slot-tab.is-filled.is-active {
    border-color: rgba(255, 193, 7, 0.55);
    background: linear-gradient(180deg, rgba(90, 64, 28, 0.62) 0%, rgba(28, 20, 12, 0.9) 100%);
}

.gm-loot-chest-slot-tab.is-filled:not(.is-active) {
    border-color: rgba(134, 239, 172, 0.28);
}

.gm-loot-chest-mode-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.gm-loot-chest-slot-pane {
    display: grid;
    gap: 0.55rem;
}

.gm-loot-chest-slot-pane label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(230, 214, 186, 0.78);
}

.gm-loot-chest-slot-pane select,
.gm-loot-chest-slot-pane input[type="search"],
.gm-loot-chest-slot-pane input[type="number"] {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.92rem;
}

.gm-loot-chest-optional {
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.6;
}

.gm-loot-chest-picked {
    margin: 0;
    font-weight: 700;
}

.gm-loot-chest-browse-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.55rem;
}

.gm-loot-chest-given-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.25rem 0 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.88rem;
    color: rgba(248, 242, 236, 0.92);
}

.gm-loot-chest-stock-row,
.gm-loot-chest-search-hit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    margin: 0 0 0.45rem;
    padding: 0.55rem 0.65rem;
}

.gm-loot-chest-stock-name {
    flex: 1 1 auto;
    font-weight: 700;
}

.gm-loot-chest-qty-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.gm-loot-chest-build-actions,
.gm-loot-chest-gift-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gm-loot-chest-gift-grid {
    margin: 0.5rem 0 0.85rem;
}

.gm-loot-chest-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 7.5rem;
    padding: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    cursor: pointer;
}

.gm-loot-chest-pick img {
    width: 3.8rem;
    height: 3.8rem;
    object-fit: cover;
    border-radius: 0.5rem;
}

.gm-loot-chest-pick:has(input:checked) {
    border-color: rgba(255, 193, 7, 0.55);
    box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.18);
}

.gm-loot-chest-pick-name {
    font-weight: 700;
    font-size: 0.82rem;
    text-align: center;
}

.gm-loot-chest-pick-meta {
    font-size: 0.7rem;
    opacity: 0.7;
}

.gm-loot-chest-live-card header {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.gm-loot-chest-live-item {
    display: grid;
    gap: 0.4rem;
    margin: 0.55rem 0 0;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(180, 140, 90, 0.18);
}

.gm-loot-chest-live-item-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.gm-loot-chest-assign {
    margin: 0;
}

.gm-loot-chest-assign select {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
}

@media (max-width: 860px) {
    .gm-loot-chest-workspace,
    .gm-loot-chest-identity,
    .gm-loot-chest-slot-tabs {
        grid-template-columns: 1fr;
    }

    .gm-loot-chest-library {
        border-right: 0;
        border-bottom: 1px solid rgba(180, 140, 90, 0.2);
        max-height: 12rem;
    }

    .gm-loot-chest-modal.loot-chest-shell,
    .loot-chest-shell {
        height: min(94vh, 860px);
    }

    .loot-chest-vote-drop {
        max-width: none;
    }
}

@media (max-width: 640px) {
    #loot-chest-overlay.inv-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .loot-chest-shell {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .loot-chest-detail-head {
        flex-direction: column;
    }

    .loot-chest-detail-meta {
        align-items: flex-start;
    }

    .loot-chest-vote-summary,
    .loot-chest-vote-option {
        min-height: 2.5rem;
    }
}
