body.shlottery-page {
    background-color: #141414;
    color: #e6e6e6;
}

.shlottery-top,
.shlottery-container,
.demo-mode-message,
.bottom-selection-controls,
.box-opening-modal,
.item-details-modal,
.box-opening-content,
.item-details-content {
    border-radius: 0 !important;
    box-sizing: border-box;
}

.shlottery-top *,
.shlottery-top *::before,
.shlottery-top *::after,
.shlottery-container *,
.shlottery-container *::before,
.shlottery-container *::after,
.demo-mode-message *,
.bottom-selection-controls *,
.box-opening-modal *,
.box-opening-modal *::before,
.box-opening-modal *::after,
.item-details-modal *,
.item-details-modal *::before,
.item-details-modal *::after {
    box-sizing: border-box;
    border-radius: 0 !important;
}

.shlottery-container h1,
.shlottery-container h2,
.shlottery-container h3,
.shlottery-container h4,
.shlottery-top h1,
.box-opening-modal h3,
.item-details-modal h3 {
    color: #ffffff;
    margin: 0 0 8px 0;
    text-shadow: none;
    font-weight: bold;
}

.main-container {
    max-width: 1100px;
    margin: 24px auto 40px auto;
    padding: 0 12px;
}

.shlottery-top {
    text-align: center;
    margin: 0 auto 20px auto;
    padding: 12px 0 4px 0;
}

.shlottery-title {
    color: #ffffff;
    font-size: 40px;
    line-height: 1.1;
    margin: 0 0 8px 0;
    text-shadow: none;
}

.shlottery-balance {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 18px;
    color: #ffd66a;
    font-weight: bold;
}

.shlottery-balance .token-icon {
    width: 22px;
    height: 22px;
    image-rendering: auto;
    vertical-align: middle;
}

.demo-mode-message {
    background: #2a2416;
    border: 1px solid #544a2a;
    color: #e6d89a;
    padding: 8px 12px;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.demo-mode-message-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.demo-mode-message-inner p {
    margin: 0;
    flex: 1 1 220px;
}

.demo-mode-signin {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #1a1408;
    background: #ffd66a;
    border: 1px solid #c9a84a;
    text-decoration: none;
}

.demo-mode-signin:hover {
    background: #ffe08a;
    color: #1a1408;
}

.shlottery-container.panel {
    background: radial-gradient(ellipse 120% 90% at 50% 18%, #1c1c1c 0%, #141414 42%, #0e0e0e 72%, #080808 100%) !important;
    border: 1px solid #242424 !important;
    padding: 12px;
    box-shadow: none !important;
    backdrop-filter: none !important;
    border-radius: 0 !important;
}

.shlottery-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    border-bottom: 1px solid #333;
    margin-bottom: 16px;
    padding-bottom: 0;
}

.shlottery-tab {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #262626 0%, #1a1a1a 48%, #121212 100%);
    color: #cccccc;
    border: 1px solid #333;
    border-bottom: none;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    text-shadow: none;
}

.shlottery-tab.active {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #303030 0%, #242424 42%, #181818 100%);
    color: #ffffff;
    border-color: #4a4a4a;
}

.shlottery-tab.demo-disabled {
    opacity: 0.45;
    color: #888;
    filter: grayscale(0.6);
}

.shlottery-tab.demo-disabled:hover {
    opacity: 0.55;
}

.shlottery-tab.demo-disabled.active {
    opacity: 0.7;
    color: #bbb;
}

.shlottery-tab-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 9px;
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}

.shlottery-tab-pill[hidden] {
    display: none;
}

.shlottery-content {
    display: none;
    padding: 4px 2px 0 2px;
}

.shlottery-content.shlottery-catalog-hidden,
.shlottery-content.shlottery-trading-hidden {
    display: none !important;
}

.shlottery-content.active {
    display: block !important;
}

.shlottery-container .tab-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 14px;
    padding: 10px 12px;
    margin: 0 0 14px 0;
    background: radial-gradient(ellipse 120% 100% at 50% 0%, #242424 0%, #1a1a1a 45%, #131313 100%);
    border: 1px solid #2a2a2a;
    color: #e6e6e6;
}

.shlottery-container .tab-toolbar .toolbar-title {
    font-weight: bold;
    color: #ffffff;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shlottery-container .tab-toolbar .toolbar-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #cccccc;
}

.shlottery-container .tab-toolbar .toolbar-btn {
    width: auto;
    min-height: 30px;
    padding: 4px 12px;
}

.shlottery-container select,
.shlottery-container input[type="number"],
.shlottery-container input[type="text"] {
    background: #0f0f0f;
    color: #e6e6e6;
    border: 1px solid #444;
    padding: 4px 6px;
    font-family: inherit;
    font-size: 14px;
    min-height: 26px;
}

.shlottery-container select:focus,
.shlottery-container input:focus {
    outline: 1px solid #7fb6ff;
    border-color: #7fb6ff;
}

.shlottery-container label { font-size: 14px; color: #cccccc; }

.shlottery-container .action-button,
.bottom-selection-controls .action-button,
.box-opening-modal .action-button,
.item-details-modal .action-button {
    background: #2a2a2a;
    color: #ffffff;
    border: 1px solid #444;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: none;
    text-transform: none;
    box-shadow: none;
    min-height: 32px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: auto;
}

.shlottery-container .action-button[disabled],
.shlottery-container .action-button:disabled {
    color: #666;
    background: #1a1a1a;
    border-color: #2a2a2a;
    cursor: not-allowed;
}

.shlottery-container .action-button.secondary { background: #222; }
.shlottery-container .action-button.buy-button,
.shlottery-container .action-button.open-button,
.bottom-selection-controls .action-button.buy-button,
.bottom-selection-controls .action-button.open-button,
.box-opening-modal .action-button.buy-button,
.box-opening-modal .action-button.open-button {
    background: linear-gradient(180deg, #3d4a36 0%, #283228 42%, #1a2218 100%);
    border-color: #4d5c48;
}
.shlottery-container .action-button.buy-button:hover:not(:disabled):not(.is-cooling),
.shlottery-container .action-button.open-button:hover:not(:disabled),
.bottom-selection-controls .action-button.buy-button:hover:not(:disabled):not(.is-cooling),
.bottom-selection-controls .action-button.open-button:hover:not(:disabled),
.box-opening-modal .action-button.buy-button:hover:not(:disabled):not(.is-cooling),
.box-opening-modal .action-button.open-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #485542 0%, #323c2c 42%, #222a1e 100%);
    border-color: #5a6a54;
}
.shlottery-container .action-button.sell-button,
.bottom-selection-controls .action-button.sell-button,
.box-opening-modal .action-button.sell-button,
.item-details-modal .action-button.sell-button {
    background: linear-gradient(180deg, #4a3434 0%, #3a2424 45%, #2a1818 100%);
    border-color: #5a3a3a;
}
.shlottery-container .action-button.sell-button:hover:not(:disabled):not(.is-cooling),
.bottom-selection-controls .action-button.sell-button:hover:not(:disabled):not(.is-cooling),
.box-opening-modal .action-button.sell-button:hover:not(:disabled):not(.is-cooling),
.item-details-modal .action-button.sell-button:hover:not(:disabled):not(.is-cooling) {
    background: linear-gradient(180deg, #564040 0%, #442e2e 45%, #322020 100%);
    border-color: #6a4a4a;
}
.shlottery-container .action-button.view-button,
.bottom-selection-controls .action-button.view-button,
.box-opening-modal .action-button.view-button,
.item-details-modal .action-button.view-button {
    background: linear-gradient(180deg, #2c3a4e 0%, #1e2836 45%, #141a24 100%);
    border-color: #3a4d68;
}
.shlottery-container .action-button.view-button:hover:not(:disabled),
.bottom-selection-controls .action-button.view-button:hover:not(:disabled),
.box-opening-modal .action-button.view-button:hover:not(:disabled),
.item-details-modal .action-button.view-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #34455c 0%, #263040 45%, #1a222e 100%);
    border-color: #4a5f82;
}
.shlottery-container .action-button.buy-button:disabled,
.shlottery-container .action-button.buy-button[disabled],
.shlottery-container .action-button.open-button:disabled,
.shlottery-container .action-button.open-button[disabled],
.shlottery-container .action-button.view-button:disabled,
.shlottery-container .action-button.view-button[disabled],
.shlottery-container .action-button.sell-button:disabled,
.shlottery-container .action-button.sell-button[disabled],
.bottom-selection-controls .action-button.buy-button:disabled,
.bottom-selection-controls .action-button.open-button:disabled,
.bottom-selection-controls .action-button.view-button:disabled,
.bottom-selection-controls .action-button.sell-button:disabled,
.box-opening-modal .action-button.buy-button:disabled,
.box-opening-modal .action-button.open-button:disabled,
.box-opening-modal .action-button.view-button:disabled,
.box-opening-modal .action-button.sell-button:disabled,
.item-details-modal .action-button.buy-button:disabled,
.item-details-modal .action-button.open-button:disabled,
.item-details-modal .action-button.view-button:disabled,
.item-details-modal .action-button.sell-button:disabled {
    background: linear-gradient(180deg, #242424 0%, #161616 100%);
    color: #666;
    border-color: #2a2a2a;
    cursor: not-allowed;
}
.shlottery-container .action-button.close-button,
.box-opening-modal .action-button.close-button,
.item-details-modal .action-button.close-button {
    background: linear-gradient(180deg, #383838 0%, #2c2c2c 45%, #222222 100%);
    border-color: #4a4a4a;
}
.shlottery-container .action-button.close-button:hover:not(:disabled),
.box-opening-modal .action-button.close-button:hover:not(:disabled),
.item-details-modal .action-button.close-button:hover:not(:disabled) {
    background: linear-gradient(180deg, #444444 0%, #363636 45%, #2a2a2a 100%);
    border-color: #5a5a5a;
}

.shlottery-container .action-button.buy-button.is-cooling {
    position: relative;
    overflow: hidden;
    cursor: not-allowed;
    background: linear-gradient(180deg, #2f382c 0%, #222a20 45%, #181e16 100%);
    color: #ffffff;
    border: 1px solid #3d4a3a;
}
.shlottery-container .action-button.sell-button.is-cooling,
.bottom-selection-controls .action-button.sell-button.is-cooling {
    position: relative;
    overflow: hidden;
    cursor: not-allowed;
    background: linear-gradient(180deg, #342828 0%, #281c1c 45%, #1a1414 100%);
    color: #ffffff;
    border: 1px solid #4a3636;
}

.shlottery-container .action-button.buy-button.is-cooling .cooldown-overlay,
.shlottery-container .action-button.sell-button.is-cooling .cooldown-overlay,
.bottom-selection-controls .action-button.sell-button.is-cooling .cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    background: #1a1a1a;
    border-right: 1px solid #2a2a2a;
    pointer-events: none;
    z-index: 1;
    animation: shlottery-cooldown-shrink var(--cooldown-duration, 600ms) linear forwards;
    animation-delay: var(--cooldown-delay, 0ms);
}

.shlottery-container .action-button.buy-button.is-cooling .cooldown-text,
.shlottery-container .action-button.sell-button.is-cooling .cooldown-text,
.bottom-selection-controls .action-button.sell-button.is-cooling .cooldown-text {
    position: relative;
    z-index: 2;
    color: #888;
}

@keyframes shlottery-cooldown-shrink {
    from { width: 100%; }
    to { width: 0%; }
}

.shlottery-container .item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 6px;
    align-items: stretch;
}

.shlottery-container .item-card {
    background: radial-gradient(ellipse 110% 100% at 50% 28%, #262626 0%, #232323 50%, #202020 100%) !important;
    border: 1px solid #333 !important;
    padding: 12px 10px 10px 10px;
    text-align: center;
    position: relative;
    color: #e6e6e6;
    box-shadow: none !important;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.shlottery-container #inventoryGrid .item-card {
    isolation: isolate;
}

.shlottery-container #inventoryGrid .item-card > .item-image-container,
.shlottery-container #inventoryGrid .item-card > .item-image {
    position: relative;
    z-index: 0;
}

.shlottery-container #inventoryGrid .item-card > .item-name,
.shlottery-container #inventoryGrid .item-card > .item-properties,
.shlottery-container #inventoryGrid .item-card > .item-price,
.shlottery-container #inventoryGrid .item-card > .hover-buttons {
    position: relative;
    z-index: 2;
}

.shlottery-container #inventoryGrid .item-card > .favorite-star {
    z-index: 30;
}

.shlottery-container .item-card > *:not(.favorite-star) {
    flex-shrink: 0;
}

.shlottery-container #inventoryGrid .item-card.item-card-sold {
    filter: grayscale(1);
    opacity: 0.55;
}

.shlottery-container #inventoryGrid .item-card.item-card-sold .item-card-sold-blocker {
    position: absolute;
    inset: 0;
    z-index: 40;
    pointer-events: auto;
}

.shlottery-container #inventoryGrid .item-card.item-card-sold .item-card-sold-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.shlottery-container #inventoryGrid .item-card.item-card-sold .item-card-sold-label {
    background: #c41e1e;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.65rem;
    letter-spacing: 0.06em;
    padding: 10px 22px;
    transform: rotate(-8deg);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.shlottery-container .item-card.locked-box { opacity: 0.85; }
.shlottery-container .item-card.favorited-disabled { opacity: 0.85; }

.shlottery-container .item-card.rarity-common    { background: radial-gradient(ellipse 110% 100% at 50% 28%, #2c2c2c 0%, #292929 48%, #262626 100%) !important; }
.shlottery-container .item-card.rarity-uncommon  { background: radial-gradient(ellipse 110% 100% at 50% 28%, #182820 0%, #17261e 48%, #152819 100%) !important; }
.shlottery-container .item-card.rarity-rare      { background: radial-gradient(ellipse 110% 100% at 50% 28%, #18242e 0%, #17222c 48%, #15202e 100%) !important; }
.shlottery-container .item-card.rarity-fancy     { background: radial-gradient(ellipse 110% 100% at 50% 28%, #2c1822 0%, #2b1720 48%, #2a1520 100%) !important; }
.shlottery-container .item-card.rarity-digital   { background: radial-gradient(ellipse 110% 100% at 50% 28%, #182a2e 0%, #17282c 48%, #15282e 100%) !important; }
.shlottery-container .item-card.rarity-secret    { background: radial-gradient(ellipse 110% 100% at 50% 28%, #261e2e 0%, #251c2c 48%, #221a2e 100%) !important; }
.shlottery-container .item-card.rarity-corrupt   { background: radial-gradient(ellipse 110% 100% at 50% 28%, #2c181c 0%, #2b161a 48%, #2a1418 100%) !important; }
.shlottery-container .item-card.rarity-wonderful { background: radial-gradient(ellipse 110% 100% at 50% 28%, #281a2e 0%, #27182c 48%, #241528 100%) !important; }
.shlottery-container .item-card.rarity-box       { background: radial-gradient(ellipse 110% 100% at 50% 28%, #241c12 0%, #231b11 48%, #231a0f 100%) !important; }
.shlottery-container .item-card.insufficient-funds { background: radial-gradient(ellipse 110% 100% at 50% 28%, #2c2424 0%, #2b2222 48%, #2a1a1a 100%) !important; }

.shlottery-container .item-image,
.shlottery-container .item-base-image {
    display: block;
    width: 96px;
    height: 96px;
    max-width: 100%;
    object-fit: contain;
    margin: 4px auto;
    transform-origin: center center;
    border-radius: 0 !important;
}

img[data-quirk="1"],
.quirk-layer[data-quirk="1"] {
    will-change: filter, transform;
}

.shlottery-container .item-image-container {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 4px auto;
    display: block;
    transform-origin: center center;
}

.shlottery-container .item-image-container .item-base-image,
.shlottery-container .item-image-container .quantum-modifier-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

.shlottery-container .trade-item .item-image-container,
.shlottery-container .trade-inv-card .item-image-container {
    position: relative;
}

.shlottery-container .trade-item .item-image-container .item-base-image,
.shlottery-container .trade-item .item-image-container .quantum-modifier-overlay,
.shlottery-container .trade-inv-card .item-image-container .item-base-image,
.shlottery-container .trade-inv-card .item-image-container .quantum-modifier-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
}

.shlottery-container img,
.box-opening-modal img,
.item-details-modal img,
.bottom-selection-controls img,
.shlottery-top img {
    transition: none !important;
}

.shlottery-container img:hover:not([class*="scale-"]):not(.quirk-layer-img),
.shlottery-container .item-card:hover img:not([class*="scale-"]):not(.quirk-layer-img),
.shlottery-container .item-card img:hover:not([class*="scale-"]):not(.quirk-layer-img),
.box-opening-modal img:hover:not([class*="scale-"]):not(.quirk-layer-img),
.item-details-modal img:hover:not([class*="scale-"]):not(.quirk-layer-img),
.bottom-selection-controls img:hover,
.shlottery-top img:hover {
    transform: none !important;
}

.shlottery-container .quantum-modifier-overlay { pointer-events: none; }

.item-quirk-label {
    color: #ff7fb8;
    font-weight: 600;
}

.quirk-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    pointer-events: none;
    transform-origin: center center;
}

.quirk-layer .quirk-layer-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
    transform-origin: 50% 50%;
}

.shlottery-container .item-name {
    font-weight: bold;
    font-size: 15px;
    margin: 6px 0 0 0;
    word-break: break-word;
    color: #ffffff;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shlottery-container .item-full-id,
.modal-stats-block .item-full-id {
    color: #ffe9a8;
    font-weight: 600;
    font-size: 11px;
    word-break: break-all;
    margin-bottom: 2px;
    letter-spacing: 0.2px;
}

.shlottery-container .item-properties {
    font-size: 12px;
    color: #aaa;
    margin: 2px 0 4px 0;
    line-height: 1.4;
    min-height: 16px;
}

.shlottery-container .item-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-weight: bold;
    font-size: 14px;
    background: #222;
    border: 1px solid #444;
    padding: 3px 8px;
    margin: 6px auto;
    color: #ffd66a;
    min-height: 26px;
}

.shlottery-container .item-price.item-price-expected {
    margin-top: 0;
    margin-bottom: 6px;
    color: #7ec8e8;
    background: #1a252c;
    border-color: #355a6e;
}

.shlottery-container .item-price.insufficient { background: #2a1818; border-color: #5a2a2a; color: #ff8080; }
.shlottery-container .item-price.locked { background: #1a1a1a; border-color: #333; color: #777; }

.shlottery-container .hover-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}

.shlottery-container .hover-buttons .action-button {
    width: 100%;
    margin: 0;
}

.shlottery-container .favorite-star {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border: 1px solid #444;
    background: #1a1a1a url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><polygon points="8,2 10,6 14,6.5 11,9.5 12,14 8,11.5 4,14 5,9.5 2,6.5 6,6" fill="none" stroke="%23bbbbbb" stroke-width="1"/></svg>') center/14px 14px no-repeat;
    cursor: pointer;
}

.shlottery-container .favorite-star.favorited {
    background-color: #2a2416;
    border-color: #7a6a2a;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><polygon points="8,2 10,6 14,6.5 11,9.5 12,14 8,11.5 4,14 5,9.5 2,6.5 6,6" fill="%23ffd66a" stroke="%23ffd66a" stroke-width="1"/></svg>');
}

.item-details-modal .contents-item-name.rarity-common,
.box-opening-modal .contents-item-name.rarity-common,
.shlottery-container .contents-item-name.rarity-common,
.shlottery-container .item-card.rarity-common .item-name,
.item-details-modal .modal-header h3.rarity-common,
.box-opening-modal #openingText .result-text.rarity-common    { color: #9e9e9e; }
.item-details-modal .contents-item-name.rarity-uncommon,
.box-opening-modal .contents-item-name.rarity-uncommon,
.shlottery-container .contents-item-name.rarity-uncommon,
.shlottery-container .item-card.rarity-uncommon .item-name,
.item-details-modal .modal-header h3.rarity-uncommon,
.box-opening-modal #openingText .result-text.rarity-uncommon  { color: #66bb6a; }
.item-details-modal .contents-item-name.rarity-rare,
.box-opening-modal .contents-item-name.rarity-rare,
.shlottery-container .contents-item-name.rarity-rare,
.shlottery-container .item-card.rarity-rare .item-name,
.item-details-modal .modal-header h3.rarity-rare,
.box-opening-modal #openingText .result-text.rarity-rare      { color: #64b5f6; }
.item-details-modal .contents-item-name.rarity-fancy,
.box-opening-modal .contents-item-name.rarity-fancy,
.shlottery-container .contents-item-name.rarity-fancy,
.shlottery-container .item-card.rarity-fancy .item-name,
.item-details-modal .modal-header h3.rarity-fancy,
.box-opening-modal #openingText .result-text.rarity-fancy     { color: #ff69b4; }
.item-details-modal .contents-item-name.rarity-digital,
.box-opening-modal .contents-item-name.rarity-digital,
.shlottery-container .contents-item-name.rarity-digital,
.shlottery-container .item-card.rarity-digital .item-name,
.item-details-modal .modal-header h3.rarity-digital,
.box-opening-modal #openingText .result-text.rarity-digital   { color: #80deea; }
.item-details-modal .contents-item-name.rarity-secret,
.box-opening-modal .contents-item-name.rarity-secret,
.shlottery-container .contents-item-name.rarity-secret,
.shlottery-container .item-card.rarity-secret .item-name,
.item-details-modal .modal-header h3.rarity-secret,
.box-opening-modal #openingText .result-text.rarity-secret    { color: #e1bee7; }
.item-details-modal .contents-item-name.rarity-corrupt,
.box-opening-modal .contents-item-name.rarity-corrupt,
.shlottery-container .contents-item-name.rarity-corrupt,
.shlottery-container .item-card.rarity-corrupt .item-name,
.item-details-modal .modal-header h3.rarity-corrupt,
.box-opening-modal #openingText .result-text.rarity-corrupt   { color: #ef5350; }
.item-details-modal .contents-item-name.rarity-wonderful,
.box-opening-modal .contents-item-name.rarity-wonderful,
.shlottery-container .contents-item-name.rarity-wonderful,
.shlottery-container .item-card.rarity-wonderful .item-name,
.item-details-modal .modal-header h3.rarity-wonderful,
.box-opening-modal #openingText .result-text.rarity-wonderful { color: #ba68c8; }
.item-details-modal .contents-item-name.rarity-box,
.box-opening-modal .contents-item-name.rarity-box,
.shlottery-container .contents-item-name.rarity-box,
.shlottery-container .item-card.rarity-box .item-name,
.item-details-modal .modal-header h3.rarity-box       { color: #a57844; }

.bottom-selection-controls {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse 120% 100% at 50% 100%, #222222 0%, #181818 45%, #101010 100%);
    border-top: 1px solid #333;
    padding: 10px 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    z-index: 1200;
    color: #e6e6e6;
    font-family: inherit;
    text-align: center;
}

.bottom-selection-controls .selection-summary {
    text-align: center;
}

.bottom-selection-controls .selection-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bottom-selection-controls .sell-value { font-weight: bold; color: #ffd66a; }

.box-opening-modal,
.item-details-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: none;
    justify-content: center;
    align-items: center;
    padding-top: max(15vh, env(safe-area-inset-top));
    padding-bottom: max(5vh, env(safe-area-inset-bottom));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    z-index: 1500;
    backdrop-filter: none;
    overflow-y: auto;
    box-sizing: border-box;
}

.box-opening-modal .box-opening-content,
.item-details-modal .item-details-content {
    background: radial-gradient(ellipse 120% 95% at 50% 10%, #222222 0%, #181818 45%, #101010 100%) !important;
    color: #e6e6e6 !important;
    border: 1px solid #3a3a3a !important;
    box-shadow: none !important;
    padding: 0;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: inherit;
    border-radius: 0 !important;
}

.item-details-modal .item-details-content { max-width: 640px; }

.box-opening-modal .modal-header,
.item-details-modal .modal-header {
    background: radial-gradient(ellipse 120% 100% at 50% 0%, #2a2a2a 0%, #1e1e1e 48%, #161616 100%);
    color: #ffffff;
    padding: 10px 14px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    flex-shrink: 0;
}

.box-opening-modal .modal-header h3,
.item-details-modal .modal-header h3 {
    color: #ffffff;
    font-size: 16px;
    margin: 0;
    border: none;
    padding: 0;
}

.box-opening-modal .close-modal,
.item-details-modal .close-modal {
    background: linear-gradient(180deg, #3c3c3c 0%, #2e2e2e 50%, #262626 100%);
    border: 1px solid #4a4a4a;
    color: #ffffff;
    width: 26px;
    height: 24px;
    line-height: 18px;
    padding: 0;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

.box-opening-modal .close-modal:hover,
.item-details-modal .close-modal:hover {
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 50%, #303030 100%);
    border-color: #5a5a5a;
}

.box-opening-modal .modal-body,
.item-details-modal .modal-body {
    padding: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: center;
    color: #e6e6e6;
    flex: 1 1 auto;
    min-height: 0;
}

.item-details-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.item-details-modal .modal-image-section {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.item-details-modal .modal-info-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-details-modal .modal-item-image,
.item-details-modal .modal-item-image-container,
.box-opening-modal .modal-item-image {
    display: block;
    margin: 0 auto;
    width: 160px;
    height: 160px;
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
    border-radius: 0 !important;
}

.item-details-modal .modal-item-image-container {
    position: relative;
    width: 160px;
    height: 160px;
}
.item-details-modal .modal-item-image-container .modal-item-image,
.item-details-modal .modal-item-image-container .modal-quantum-modifier-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.item-details-modal .item-info,
.item-details-modal .box-contents,
.box-opening-modal .box-contents {
    background: radial-gradient(ellipse 100% 120% at 50% 0%, #1a1a1a 0%, #141414 50%, #0c0c0c 100%) !important;
    border: 1px solid #333 !important;
    padding: 10px 12px !important;
    margin: 0;
    color: #e6e6e6;
    box-shadow: none !important;
    text-align: center;
    border-radius: 0 !important;
    backdrop-filter: none !important;
}

.item-details-modal .box-contents,
.box-opening-modal .box-contents { text-align: left; }

.item-details-modal .modal-stats-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0 10px 0;
    font-size: 14px;
    align-items: center;
}

.item-details-modal .modal-info-section .action-button {
    width: auto;
    margin: 2px 4px;
}

.item-details-modal .contents-list,
.box-opening-modal .contents-list {
    list-style: none;
    margin: 4px 0 0 0;
    padding: 0;
}

.item-details-modal .contents-item,
.box-opening-modal .contents-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #2a2a2a;
}

.item-details-modal .contents-item:last-child,
.box-opening-modal .contents-item:last-child { border-bottom: none; }

.item-details-modal .contents-item-left,
.box-opening-modal .contents-item-left {
    display: flex;
    gap: 10px;
    align-items: center;
}

.item-details-modal .contents-item-image,
.box-opening-modal .contents-item-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border: 1px solid #333;
    background: #0f0f0f;
    border-radius: 0 !important;
}

.item-details-modal .contents-item-info,
.box-opening-modal .contents-item-info {
    display: flex;
    flex-direction: column;
}

.item-details-modal .contents-item-name,
.box-opening-modal .contents-item-name { font-weight: bold; font-size: 14px; }
.item-details-modal .contents-item-value,
.box-opening-modal .contents-item-value { font-size: 12px; color: #ffd66a; }

.item-details-modal .secret-item-silhouette,
.box-opening-modal .secret-item-silhouette { filter: brightness(0) !important; }

.box-opening-modal .box-opening-content {
    align-items: center;
    padding-bottom: 16px;
}

.box-opening-modal .box-opening-content > h3 {
    background: #1e1e1e;
    color: #ffffff;
    padding: 10px 14px;
    border-bottom: 1px solid #333;
    margin: 0;
    font-size: 16px;
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

.box-opening-modal .opening-animation {
    margin: 14px auto;
    background: #0f0f0f;
    border: 1px solid #333;
    padding: 10px;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.box-opening-modal .spinning-item-container,
.box-opening-modal .final-item-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.box-opening-modal .spinning-item,
.box-opening-modal .final-item {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 0 !important;
}

.box-opening-modal .final-quantum-overlay {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.box-opening-modal .opening-progress {
    width: 240px;
    max-width: 100%;
    height: 14px;
    background: #0f0f0f;
    border: 1px solid #333;
    margin: 8px auto;
    padding: 1px;
    flex-shrink: 0;
}

.box-opening-modal .opening-progress-bar {
    background: #7fb6ff;
    height: 100%;
    width: 0%;
    transition: width 120ms linear;
}

.box-opening-modal #openingText {
    text-align: center;
    padding: 0 14px;
    margin: 10px 0;
    overflow-y: auto;
    min-height: 0;
}

.box-opening-modal #openingText .result-text {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
}

.box-opening-modal #openingText .item-properties {
    font-size: 13px;
    color: #cccccc;
    line-height: 1.5;
}

.box-opening-modal #openingText .opening-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
}

.box-opening-modal #openingText .opening-buttons .action-button {
    width: auto;
    min-width: 0;
}

.box-opening-modal .action-button.close-button {
    align-self: center;
    width: auto;
}

.shlottery-container hr { border: none; border-top: 1px solid #333; margin: 10px 0; }

.scale-1-1 { transform: scaleX(0.3) scaleY(0.3) !important; }
.scale-1-2 { transform: scaleX(0.3) scaleY(0.4) !important; }
.scale-1-3 { transform: scaleX(0.3) scaleY(0.55) !important; }
.scale-1-4 { transform: scaleX(0.3) scaleY(0.7) !important; }
.scale-1-5 { transform: scaleX(0.3) scaleY(0.85) !important; }
.scale-1-6 { transform: scaleX(0.3) scaleY(1.0) !important; }
.scale-1-7 { transform: scaleX(0.3) scaleY(1.2) !important; }
.scale-1-8 { transform: scaleX(0.3) scaleY(1.4) !important; }
.scale-1-9 { transform: scaleX(0.3) scaleY(1.6) !important; }
.scale-2-1 { transform: scaleX(0.4) scaleY(0.3) !important; }
.scale-2-2 { transform: scaleX(0.4) scaleY(0.4) !important; }
.scale-2-3 { transform: scaleX(0.4) scaleY(0.55) !important; }
.scale-2-4 { transform: scaleX(0.4) scaleY(0.7) !important; }
.scale-2-5 { transform: scaleX(0.4) scaleY(0.85) !important; }
.scale-2-6 { transform: scaleX(0.4) scaleY(1.0) !important; }
.scale-2-7 { transform: scaleX(0.4) scaleY(1.2) !important; }
.scale-2-8 { transform: scaleX(0.4) scaleY(1.4) !important; }
.scale-2-9 { transform: scaleX(0.4) scaleY(1.6) !important; }
.scale-3-1 { transform: scaleX(0.55) scaleY(0.3) !important; }
.scale-3-2 { transform: scaleX(0.55) scaleY(0.4) !important; }
.scale-3-3 { transform: scaleX(0.55) scaleY(0.55) !important; }
.scale-3-4 { transform: scaleX(0.55) scaleY(0.7) !important; }
.scale-3-5 { transform: scaleX(0.55) scaleY(0.85) !important; }
.scale-3-6 { transform: scaleX(0.55) scaleY(1.0) !important; }
.scale-3-7 { transform: scaleX(0.55) scaleY(1.2) !important; }
.scale-3-8 { transform: scaleX(0.55) scaleY(1.4) !important; }
.scale-3-9 { transform: scaleX(0.55) scaleY(1.6) !important; }
.scale-4-1 { transform: scaleX(0.7) scaleY(0.3) !important; }
.scale-4-2 { transform: scaleX(0.7) scaleY(0.4) !important; }
.scale-4-3 { transform: scaleX(0.7) scaleY(0.55) !important; }
.scale-4-4 { transform: scaleX(0.7) scaleY(0.7) !important; }
.scale-4-5 { transform: scaleX(0.7) scaleY(0.85) !important; }
.scale-4-6 { transform: scaleX(0.7) scaleY(1.0) !important; }
.scale-4-7 { transform: scaleX(0.7) scaleY(1.2) !important; }
.scale-4-8 { transform: scaleX(0.7) scaleY(1.4) !important; }
.scale-4-9 { transform: scaleX(0.7) scaleY(1.6) !important; }
.scale-5-1 { transform: scaleX(0.85) scaleY(0.3) !important; }
.scale-5-2 { transform: scaleX(0.85) scaleY(0.4) !important; }
.scale-5-3 { transform: scaleX(0.85) scaleY(0.55) !important; }
.scale-5-4 { transform: scaleX(0.85) scaleY(0.7) !important; }
.scale-5-5 { transform: scaleX(0.85) scaleY(0.85) !important; }
.scale-5-6 { transform: scaleX(0.85) scaleY(1.0) !important; }
.scale-5-7 { transform: scaleX(0.85) scaleY(1.2) !important; }
.scale-5-8 { transform: scaleX(0.85) scaleY(1.4) !important; }
.scale-5-9 { transform: scaleX(0.85) scaleY(1.6) !important; }
.scale-6-1 { transform: scaleX(1.0) scaleY(0.3) !important; }
.scale-6-2 { transform: scaleX(1.0) scaleY(0.4) !important; }
.scale-6-3 { transform: scaleX(1.0) scaleY(0.55) !important; }
.scale-6-4 { transform: scaleX(1.0) scaleY(0.7) !important; }
.scale-6-5 { transform: scaleX(1.0) scaleY(0.85) !important; }
.scale-6-6 { transform: scaleX(1.0) scaleY(1.0) !important; }
.scale-6-7 { transform: scaleX(1.0) scaleY(1.2) !important; }
.scale-6-8 { transform: scaleX(1.0) scaleY(1.4) !important; }
.scale-6-9 { transform: scaleX(1.0) scaleY(1.6) !important; }
.scale-7-1 { transform: scaleX(1.2) scaleY(0.3) !important; }
.scale-7-2 { transform: scaleX(1.2) scaleY(0.4) !important; }
.scale-7-3 { transform: scaleX(1.2) scaleY(0.55) !important; }
.scale-7-4 { transform: scaleX(1.2) scaleY(0.7) !important; }
.scale-7-5 { transform: scaleX(1.2) scaleY(0.85) !important; }
.scale-7-6 { transform: scaleX(1.2) scaleY(1.0) !important; }
.scale-7-7 { transform: scaleX(1.2) scaleY(1.2) !important; }
.scale-7-8 { transform: scaleX(1.2) scaleY(1.4) !important; }
.scale-7-9 { transform: scaleX(1.2) scaleY(1.6) !important; }
.scale-8-1 { transform: scaleX(1.4) scaleY(0.3) !important; }
.scale-8-2 { transform: scaleX(1.4) scaleY(0.4) !important; }
.scale-8-3 { transform: scaleX(1.4) scaleY(0.55) !important; }
.scale-8-4 { transform: scaleX(1.4) scaleY(0.7) !important; }
.scale-8-5 { transform: scaleX(1.4) scaleY(0.85) !important; }
.scale-8-6 { transform: scaleX(1.4) scaleY(1.0) !important; }
.scale-8-7 { transform: scaleX(1.4) scaleY(1.2) !important; }
.scale-8-8 { transform: scaleX(1.4) scaleY(1.4) !important; }
.scale-8-9 { transform: scaleX(1.4) scaleY(1.6) !important; }
.scale-9-1 { transform: scaleX(1.6) scaleY(0.3) !important; }
.scale-9-2 { transform: scaleX(1.6) scaleY(0.4) !important; }
.scale-9-3 { transform: scaleX(1.6) scaleY(0.55) !important; }
.scale-9-4 { transform: scaleX(1.6) scaleY(0.7) !important; }
.scale-9-5 { transform: scaleX(1.6) scaleY(0.85) !important; }
.scale-9-6 { transform: scaleX(1.6) scaleY(1.0) !important; }
.scale-9-7 { transform: scaleX(1.6) scaleY(1.2) !important; }
.scale-9-8 { transform: scaleX(1.6) scaleY(1.4) !important; }
.scale-9-9 { transform: scaleX(1.6) scaleY(1.6) !important; }

.quality-1 { image-rendering: pixelated; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; }
.quality-2 { image-rendering: pixelated; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; }
.quality-3 { image-rendering: pixelated; image-rendering: -moz-crisp-edges; image-rendering: crisp-edges; }
.quality-4 { image-rendering: pixelated; image-rendering: -moz-crisp-edges; }
.quality-5 { image-rendering: auto; }
.quality-6 { image-rendering: auto; }
.quality-7 { image-rendering: auto; }
.quality-8 { image-rendering: auto; }
.quality-9 { image-rendering: auto; }

.quality-1:not([class*="color-filter"]) { filter: blur(1px); image-rendering: pixelated; image-rendering: crisp-edges; }
.quality-2:not([class*="color-filter"]) { filter: blur(0.8px); image-rendering: pixelated; image-rendering: crisp-edges; }
.quality-3:not([class*="color-filter"]) { filter: blur(0.6px); image-rendering: pixelated; image-rendering: crisp-edges; }
.quality-4:not([class*="color-filter"]) { filter: blur(0.4px); image-rendering: pixelated; image-rendering: crisp-edges; }
.quality-5:not([class*="color-filter"]) { filter: blur(0.1px); image-rendering: auto; }

.catalog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: min(960px, 100%);
    margin: 0 auto;
    padding: 20px 22px 24px;
    max-height: min(70vh, calc(100vh - 200px));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.catalog-row {
    display: grid;
    grid-template-columns: minmax(88px, min(128px, 24%)) 1fr;
    align-items: stretch;
    gap: 14px;
    padding: 12px 14px;
    background: radial-gradient(ellipse 115% 100% at 50% 22%, #222222 0%, #1a1a1a 48%, #121212 100%);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    transition: border-color 0.15s ease, background 0.15s ease;
    overflow: visible;
}

.catalog-row:hover {
    border-color: #3a3a3a;
    background: radial-gradient(ellipse 115% 100% at 50% 22%, #282828 0%, #1e1e1e 48%, #161616 100%);
}

.catalog-row.is-owned {
    background: radial-gradient(ellipse 115% 100% at 50% 22%, #1e2a22 0%, #18201a 48%, #101814 100%);
    border-color: #2f4a3a;
}

.catalog-row.is-owned:hover {
    background: radial-gradient(ellipse 115% 100% at 50% 22%, #243028 0%, #1c261e 48%, #141c18 100%);
    border-color: #3a5a47;
}

.catalog-row-art {
    width: 100%;
    min-width: 0;
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.catalog-row-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 96px;
    min-height: 0;
    object-fit: contain;
    display: block;
    filter:
        drop-shadow(0 2px 5px rgba(0, 0, 0, 0.14))
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.catalog-row-img.is-empty {
    min-height: 72px;
    width: 72px;
    background: transparent;
}

.catalog-row-img.secret-item-silhouette {
    filter:
        brightness(0)
        drop-shadow(0 2px 5px rgba(0, 0, 0, 0.14))
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12)) !important;
}

.catalog-row-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.catalog-row-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-width: 0;
}

.catalog-row-header .catalog-row-name {
    flex: 1 1 auto;
    min-width: 0;
}

.catalog-header-id {
    flex-shrink: 0;
    margin-left: auto;
}

.catalog-header-value,
.catalog-header-owned,
.catalog-header-quirk {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.catalog-header-quirk {
    background: #2a0d10;
    color: #ff7b8a;
    border: 1px solid #5a2027;
}

.catalog-header-quirk i {
    font-size: 10px;
    opacity: 0.95;
}

.catalog-header-value {
    background: #2a200d;
    color: #ffd66a;
    border: 1px solid #4a3818;
}

.catalog-header-value img {
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

.catalog-header-owned {
    background: #122430;
    color: #9cdbff;
    border: 1px solid #224558;
}

.catalog-header-owned i {
    font-size: 10px;
    opacity: 0.9;
}

.catalog-row-name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: #eaeaea;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.catalog-row-name.rarity-common { color: #c8c8c8; }
.catalog-row-name.rarity-uncommon { color: #66bb6a; }
.catalog-row-name.rarity-rare { color: #64b5f6; }
.catalog-row-name.rarity-fancy { color: #ff69b4; }
.catalog-row-name.rarity-digital { color: #80deea; }
.catalog-row-name.rarity-secret { color: #e1bee7; }
.catalog-row-name.rarity-corrupt { color: #ef5350; }
.catalog-row-name.rarity-wonderful { color: #ba68c8; }

.catalog-rarity-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.05em;
    line-height: 1.6;
    flex-shrink: 0;
}

.catalog-rarity-pill.rarity-common { background: #232323; color: #9e9e9e; border-color: #3a3a3a; }
.catalog-rarity-pill.rarity-uncommon { background: #142319; color: #66bb6a; border-color: #244e30; }
.catalog-rarity-pill.rarity-rare { background: #131d2a; color: #64b5f6; border-color: #244258; }
.catalog-rarity-pill.rarity-fancy { background: #25131d; color: #ff69b4; border-color: #4a223c; }
.catalog-rarity-pill.rarity-digital { background: #13232a; color: #80deea; border-color: #244e57; }
.catalog-rarity-pill.rarity-secret { background: #1d162a; color: #e1bee7; border-color: #3d2f4f; }
.catalog-rarity-pill.rarity-corrupt { background: #251315; color: #ef5350; border-color: #4a2424; }
.catalog-rarity-pill.rarity-wonderful { background: #1f1325; color: #ba68c8; border-color: #40244a; }
.catalog-rarity-pill.rarity-box { background: #1e160e; color: #a57844; border-color: #3f311d; }

.catalog-row-blurb {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #e0e0e0;
    font-style: italic;
    font-weight: 400;
}

.catalog-blurb-desc {
    color: inherit;
    font-style: inherit;
    font-weight: inherit;
}

.catalog-box-name {
    font-weight: 700;
    font-style: italic;
}

.catalog-box-name.rarity-common { color: #c8c8c8; }
.catalog-box-name.rarity-uncommon { color: #66bb6a; }
.catalog-box-name.rarity-rare { color: #64b5f6; }
.catalog-box-name.rarity-fancy { color: #ff69b4; }
.catalog-box-name.rarity-digital { color: #80deea; }
.catalog-box-name.rarity-secret { color: #e1bee7; }
.catalog-box-name.rarity-corrupt { color: #ef5350; }
.catalog-box-name.rarity-wonderful { color: #ba68c8; }
.catalog-box-name.rarity-box { color: #a57844; }

.catalog-blurb-sale {
    color: #ffd66a;
    font-weight: 600;
}

.catalog-blurb-you {
    color: #81c784;
    font-weight: 600;
    font-style: italic;
}

.catalog-rarity-word {
    font-weight: 700;
    font-style: italic;
}

.catalog-sort-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 0 4px 14px 4px;
    margin: 0 0 8px 0;
}

.catalog-sort-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #2a2a2a 0%, #1c1c1c 50%, #141414 100%);
    color: #d8d8d8;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.catalog-sort-btn:hover {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #343434 0%, #242424 50%, #1a1a1a 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.16);
}

.catalog-sort-btn.is-active {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 45%, #2e7d32 100%);
    border-color: #66bb6a;
    color: #fff;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.35);
}

.catalog-rarity-word.rarity-common { color: #c8c8c8; }
.catalog-rarity-word.rarity-uncommon { color: #66bb6a; }
.catalog-rarity-word.rarity-rare { color: #64b5f6; }
.catalog-rarity-word.rarity-fancy { color: #ff69b4; }
.catalog-rarity-word.rarity-digital { color: #80deea; }
.catalog-rarity-word.rarity-secret { color: #e1bee7; }
.catalog-rarity-word.rarity-corrupt { color: #ef5350; }
.catalog-rarity-word.rarity-wonderful { color: #ba68c8; }

.catalog-stat-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    font-size: 12px;
    color: #9a9a9a;
}

.catalog-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.catalog-stat-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    color: #6a6a6a;
}

.catalog-stat-value {
    color: #ffd66a;
    font-weight: 600;
}

.catalog-stat-value img {
    width: 13px;
    height: 13px;
    vertical-align: middle;
}

.catalog-stat-owned {
    color: #9cdbff;
}

.catalog-stat-owned.is-zero {
    color: #6a6a6a;
    font-style: italic;
}

.catalog-stat-icon {
    font-size: 11px;
    opacity: 0.85;
}

.catalog-lock-icon {
    font-size: 10px;
    color: #b39ddb;
}

.catalog-lock-icon.is-open {
    color: #81c784;
}

.catalog-boxes {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.catalog-boxes-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5a5a5a;
    margin-right: 2px;
}

.catalog-box-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    background: radial-gradient(ellipse 120% 100% at 30% 30%, #1e1e1e 0%, #141414 55%, #0c0c0c 100%);
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    font-size: 13px;
    color: #c8c8c8;
    line-height: 1.35;
    max-width: 100%;
}

.catalog-box-chip-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    background: #0a0a0a;
    flex-shrink: 0;
}

.catalog-box-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.catalog-box-chip-pct {
    font-size: 13px;
    color: #8bc4ff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.catalog-boxes-empty {
    font-size: 11px;
    color: #5a5a5a;
    font-style: italic;
}

.history-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #2a2a2a;
    background: radial-gradient(ellipse 120% 100% at 50% 0%, #1c1c1c 0%, #141414 50%, #0e0e0e 100%);
    overflow-x: auto;
}

.history-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.2fr) 90px minmax(180px, 2fr) 90px 140px;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid #262626;
    font-size: 14px;
    color: #d8d8d8;
}

.history-row:last-child {
    border-bottom: none;
}

.history-row.history-header {
    background: radial-gradient(ellipse 120% 100% at 50% 0%, #2a2a2a 0%, #202020 45%, #181818 100%);
    color: #b0b0b0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    position: sticky;
    top: 0;
    z-index: 1;
}

.history-row:nth-child(odd):not(.history-header) {
    background: radial-gradient(ellipse 100% 100% at 50% 50%, #1a1a1a 0%, #161616 60%, #121212 100%);
}

.history-cell {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-detail {
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}

.history-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-avatar {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border: 1px solid #333;
    background: #000;
    flex: 0 0 auto;
}

.history-avatar-fallback {
    background: #2a2a2a;
}

.history-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.history-view-btn {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    line-height: 20px;
    color: #e6e6e6;
    background: linear-gradient(180deg, #2c3a4e 0%, #1e2836 50%, #141a24 100%);
    border: 1px solid #3a4d68;
    border-radius: 0 !important;
    cursor: pointer;
    text-align: center;
}

.history-view-btn:hover {
    background: linear-gradient(180deg, #34455c 0%, #263040 50%, #1a222e 100%);
    border-color: #4a5f82;
    color: #fff;
}

.history-view-btn:active {
    background: #111;
}

.toolbar-view-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #1c1c1c;
    border: 1px solid #444;
    color: #e6e6e6;
    font-size: 13px;
    font-style: italic;
}

.toolbar-view-banner .toolbar-btn {
    margin-left: 4px;
    font-style: normal;
}

.history-type {
    color: #b8b8b8;
}

.history-row.history-type-purchase .history-type { color: #ffb066; }
.history-row.history-type-box_open .history-type { color: #7fb6ff; }
.history-row.history-type-sale .history-type { color: #7fd29a; }

.history-amount {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.history-amount-positive { color: #7fd29a; }
.history-amount-negative { color: #e08686; }
.history-amount-zero { color: #666; }

.history-when {
    color: #888;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.history-empty {
    padding: 20px;
    text-align: center;
    color: #888;
    border: 1px solid #2a2a2a;
    background: radial-gradient(ellipse 100% 100% at 50% 40%, #1a1a1a 0%, #141414 60%, #101010 100%);
}

.history-pager {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
}

.history-pager-btn {
    background: linear-gradient(180deg, #343434 0%, #282828 50%, #1e1e1e 100%);
    color: #e6e6e6;
    border: 1px solid #3a3a3a;
    padding: 6px 10px;
    cursor: pointer;
    font: inherit;
    min-height: 30px;
    min-width: 34px;
    border-radius: 0 !important;
}

.history-pager-btn:hover:not([disabled]):not(.active) {
    background: linear-gradient(180deg, #3e3e3e 0%, #323232 50%, #282828 100%);
    border-color: #4a4a4a;
}

.history-pager-btn.active {
    background: linear-gradient(180deg, #ffe08a 0%, #ffd66a 45%, #e6b850 100%);
    color: #141414;
    border-color: #ffd66a;
    cursor: default;
}

.history-pager-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.history-pager-gap {
    color: #666;
    padding: 0 4px;
}

.history-pager-info {
    color: #888;
    font-size: 12px;
    margin-left: 8px;
}

.history-pager-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #aaa;
    font-size: 12px;
    margin-left: 4px;
}

.history-pager-jump-input {
    width: 64px;
    padding: 4px 6px;
    background: radial-gradient(ellipse 100% 120% at 50% 0%, #1a1a1a 0%, #121212 100%);
    color: #e6e6e6;
    border: 1px solid #333;
    font: inherit;
    font-size: 13px;
    border-radius: 0 !important;
    -moz-appearance: textfield;
}

.history-pager-jump-input::-webkit-outer-spin-button,
.history-pager-jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.history-search-field input[type="search"] {
    background: radial-gradient(ellipse 100% 120% at 50% 0%, #1a1a1a 0%, #121212 100%);
    color: #e6e6e6;
    border: 1px solid #333;
    padding: 4px 8px;
    min-width: 180px;
    font: inherit;
    font-size: 14px;
    border-radius: 0 !important;
}

.history-search-field input[type="search"]:focus {
    outline: none;
    border-color: #7fb6ff;
}

@media (max-width: 720px) {
    .history-row {
        grid-template-columns: 1fr 80px 80px;
        grid-template-areas:
            "user type amount"
            "detail detail detail"
            "when when when";
        row-gap: 4px;
    }
    .history-row .history-user { grid-area: user; }
    .history-row .history-type { grid-area: type; }
    .history-row .history-amount { grid-area: amount; }
    .history-row .history-detail { grid-area: detail; }
    .history-row .history-when { grid-area: when; font-size: 11px; }
    .history-row.history-header {
        grid-template-columns: 1fr 80px 80px;
        grid-template-areas: "user type amount";
    }
    .history-row.history-header .history-detail,
    .history-row.history-header .history-when {
        display: none;
    }
}

.trading-root {
    padding: 8px 4px 16px;
    color: #e6e6e6;
}

.trade-list-view {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.trade-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #2a2a2a 0%, #1f1f1f 45%, #161616 100%);
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    padding: 14px 18px;
}

.trade-list-title {
    margin: 0;
    color: #f5f5f5;
    font-size: 1.25rem;
    letter-spacing: 0.3px;
}

.trade-list-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trade-error {
    background: linear-gradient(180deg, #4a1f1f 0%, #391818 100%);
    border: 1px solid #6a2a2a;
    color: #ffd6d6;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.shlottery-content.shlottery-demo-locked > :not(.shlottery-demo-lock) {
    display: none !important;
}

.shlottery-content.shlottery-demo-locked > .shlottery-demo-lock {
    display: block;
    padding: 8px 4px 16px;
}

.trade-bucket {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #1f1f1f 0%, #181818 45%, #131313 100%);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 12px 14px 14px;
}

.trade-bucket-title {
    margin: 0 0 10px;
    color: #ffe9a8;
    font-size: 1.0rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trade-bucket-count {
    background: #2a2a2a;
    color: #ddd;
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 0.78rem;
}

.trade-bucket-empty {
    color: #888;
    font-style: italic;
    padding: 8px 4px;
    font-size: 0.92rem;
}

.trade-bucket-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trade-row {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #262626 0%, #1c1c1c 45%, #141414 100%);
    border: 1px solid #2c2c2c;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-row-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.trade-row-other strong {
    color: #f5f5f5;
    font-size: 1.02rem;
}

.trade-row-time {
    color: #777;
    font-size: 0.78rem;
}

.trade-row-body {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
}

.trade-row-side {
    flex: 0 1 220px;
    min-width: 0;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid #232323;
    border-radius: 8px;
    padding: 8px 10px;
}

.trade-row-side-label {
    color: #aaa;
    font-size: 0.78rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.trade-row-side-empty-text {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
    padding: 6px 0 2px;
}

.trade-row-arrow {
    color: #ffe9a8;
    font-size: 1.4rem;
    padding: 0 4px;
}

.trade-row-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.trade-row-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    overflow: visible;
    background: #111;
    border: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.75rem;
}

.trade-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.trade-row-thumb.is-more {
    background: #1a1a1a;
    color: #ddd;
    font-weight: 600;
}

.trade-row-note {
    color: #cfcfcf;
    font-style: italic;
    font-size: 0.9rem;
    background: rgba(255, 235, 168, 0.06);
    border-left: 2px solid #ffe9a8;
    padding: 6px 10px;
    border-radius: 4px;
}

.trade-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.action-button.compact {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Compose view */
.trade-compose {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.trade-compose-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trade-compose-header h3 {
    margin: 0;
    color: #f5f5f5;
}

.trade-recipient-search {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #1f1f1f 0%, #181818 45%, #121212 100%);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-search-label {
    color: #ccc;
    font-size: 0.92rem;
    font-weight: 500;
}

.trade-search-input {
    width: 100%;
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #1c1c1c 0%, #141414 100%);
    color: #f0f0f0;
    border: 1px solid #2c2c2c;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
}

.trade-user-results {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
}

.trade-user-result {
    background: #1d1d1d;
    border: 1px solid #2a2a2a;
    color: #eaeaea;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.trade-user-result:hover {
    background: #232323;
    border-color: #3a3a3a;
}

.trade-user-id {
    color: #888;
    font-size: 0.8rem;
}

.trade-empty-result {
    color: #888;
    font-style: italic;
    padding: 6px 4px;
    font-size: 0.9rem;
}

.trade-recipient-chip {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #2a2a2a 0%, #1c1c1c 100%);
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #f0f0f0;
}

.trade-boxes-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.trade-box {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #232323 0%, #1a1a1a 45%, #131313 100%);
    border: 1px solid #2c2c2c;
    border-radius: 12px;
    padding: 12px 14px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.trade-box.is-editable {
    border-color: #3a4a3a;
}

.trade-box-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 10px;
    min-height: 28px;
}

.trade-box-items {
    align-content: flex-start;
}

.trade-boxes-row {
    align-items: start;
}

.trade-box-header h4 {
    margin: 0;
    color: #f5f5f5;
    font-size: 1.0rem;
}

.trade-box-sub {
    color: #888;
    font-size: 0.82rem;
}

.trade-box-count {
    margin-left: auto;
    color: #aaa;
    font-size: 0.8rem;
    background: #1f1f1f;
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    padding: 2px 8px;
}

.trade-box-total {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #ffd87a;
    font-size: 0.82rem;
    font-weight: 600;
    background: #1f1f1f;
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    padding: 2px 8px;
}

.trade-box-total .trade-box-token-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.trade-box-empty {
    color: #777;
    font-style: italic;
    padding: 12px 4px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-box-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trade-item {
    width: 150px;
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 8px 8px 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.trade-item .item-name {
    color: #eaeaea;
    font-size: 0.9rem;
    min-height: 0;
    margin-top: 4px;
    word-break: break-word;
}

.trade-item .item-properties,
.trade-inv-card .item-properties {
    font-size: 0.72rem;
    color: #bbb;
    line-height: 1.25;
    margin-top: 4px;
    text-align: center;
}

.trade-item .item-properties .trade-full-id,
.trade-inv-card .item-properties .trade-full-id {
    color: #ffe9a8;
    font-weight: 600;
    font-size: 0.72rem;
    word-break: break-all;
}

.trade-item-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(180deg, #b04141 0%, #802626 100%);
    color: #fff;
    border: 1px solid #c75555;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-weight: 700;
    z-index: 2;
}

.trade-item-remove:hover {
    background: linear-gradient(180deg, #c84a4a, #8d2a2a);
}

.trade-item-sell-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #ffd87a;
    font-weight: 600;
}

.trade-item-sell-value .trade-item-sell-token {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.trade-item.rarity-common    { border-color: #3a3a3a; background: radial-gradient(ellipse 110% 100% at 50% 28%, #2c2c2c 0%, #262626 100%) !important; }
.trade-item.rarity-uncommon  { border-color: #2c5d2c; background: radial-gradient(ellipse 110% 100% at 50% 28%, #1f3a2a 0%, #172a1f 100%) !important; }
.trade-item.rarity-rare      { border-color: #2d4f8a; background: radial-gradient(ellipse 110% 100% at 50% 28%, #1c304a 0%, #152240 100%) !important; }
.trade-item.rarity-fancy     { border-color: #8a2d5f; background: radial-gradient(ellipse 110% 100% at 50% 28%, #3a1a2a 0%, #2a1220 100%) !important; }
.trade-item.rarity-digital   { border-color: #2d8a85; background: radial-gradient(ellipse 110% 100% at 50% 28%, #163f3d 0%, #0f2b2d 100%) !important; }
.trade-item.rarity-secret    { border-color: #6c2c8a; background: radial-gradient(ellipse 110% 100% at 50% 28%, #3a2850 0%, #221a3a 100%) !important; }
.trade-item.rarity-corrupt   { border-color: #8a2a2a; background: radial-gradient(ellipse 110% 100% at 50% 28%, #3a1818 0%, #2a1212 100%) !important; }
.trade-item.rarity-wonderful { border-color: #b4881e; background: radial-gradient(ellipse 110% 100% at 50% 28%, #3a2d12 0%, #2a1e0a 100%) !important; }
.trade-item.rarity-box       { border-color: #6a5220; background: radial-gradient(ellipse 110% 100% at 50% 28%, #2e2412 0%, #231a0f 100%) !important; }

.trade-row-thumb.rarity-uncommon { border-color: #2c5d2c; }
.trade-row-thumb.rarity-rare { border-color: #2d4f8a; }
.trade-row-thumb.rarity-epic { border-color: #6c2c8a; }
.trade-row-thumb.rarity-legendary { border-color: #b4881e; }
.trade-row-thumb.rarity-mythic { border-color: #b32a55; }
.trade-row-thumb.rarity-godlike { border-color: #d8a93a; }

.trade-inventory {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #1f1f1f 0%, #181818 45%, #121212 100%);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 12px 14px;
}

.trade-inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.trade-inv-card {
    background: #181818;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 8px 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    position: relative;
}

.trade-inv-card .item-name {
    color: #eaeaea;
    font-size: 0.92rem;
    min-height: 0;
    margin-top: 4px;
    word-break: break-word;
}

.trade-inv-actions {
    margin-top: 6px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.trade-inv-card.is-in-trade {
    opacity: 0.55;
}

.trade-inv-card.rarity-common    { border-color: #3a3a3a; background: radial-gradient(ellipse 110% 100% at 50% 28%, #2c2c2c 0%, #262626 100%) !important; }
.trade-inv-card.rarity-uncommon  { border-color: #2c5d2c; background: radial-gradient(ellipse 110% 100% at 50% 28%, #1f3a2a 0%, #172a1f 100%) !important; }
.trade-inv-card.rarity-rare      { border-color: #2d4f8a; background: radial-gradient(ellipse 110% 100% at 50% 28%, #1c304a 0%, #152240 100%) !important; }
.trade-inv-card.rarity-fancy     { border-color: #8a2d5f; background: radial-gradient(ellipse 110% 100% at 50% 28%, #3a1a2a 0%, #2a1220 100%) !important; }
.trade-inv-card.rarity-digital   { border-color: #2d8a85; background: radial-gradient(ellipse 110% 100% at 50% 28%, #163f3d 0%, #0f2b2d 100%) !important; }
.trade-inv-card.rarity-secret    { border-color: #6c2c8a; background: radial-gradient(ellipse 110% 100% at 50% 28%, #3a2850 0%, #221a3a 100%) !important; }
.trade-inv-card.rarity-corrupt   { border-color: #8a2a2a; background: radial-gradient(ellipse 110% 100% at 50% 28%, #3a1818 0%, #2a1212 100%) !important; }
.trade-inv-card.rarity-wonderful { border-color: #b4881e; background: radial-gradient(ellipse 110% 100% at 50% 28%, #3a2d12 0%, #2a1e0a 100%) !important; }
.trade-inv-card.rarity-box       { border-color: #6a5220; background: radial-gradient(ellipse 110% 100% at 50% 28%, #2e2412 0%, #231a0f 100%) !important; }

.trade-inv-tabs {
    display: flex;
    gap: 6px;
    margin: 10px 0 8px;
    border-bottom: 1px solid #262626;
    padding-bottom: 6px;
}

.trade-inv-tab {
    background: #1a1a1a;
    color: #bbb;
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.trade-inv-tab:hover {
    background: #222;
    color: #eaeaea;
}

.trade-inv-tab.is-active {
    background: linear-gradient(180deg, #3a2f1a 0%, #221a0d 100%);
    color: #ffe9a8;
    border-color: #7a5d1a;
}

.trade-inv-tab-count {
    background: rgba(255, 255, 255, 0.06);
    color: #ddd;
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
}

.trade-compose-footer {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding-top: 4px;
}

@media (max-width: 720px) {
    .trade-boxes-row {
        grid-template-columns: 1fr;
    }
    .trade-row-arrow {
        display: none;
    }
}

.trade-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    flex-shrink: 0;
}

.trade-avatar-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.trade-avatar-wrap.trade-avatar-md {
    width: 44px;
    height: 44px;
}

.trade-avatar-wrap .trade-avatar-fallback-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.trade-avatar-wrap .trade-avatar-img {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
}

.trade-avatar-md {
    width: 44px;
    height: 44px;
}

.trade-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
}

.trade-row-other {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.trade-row-other-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trade-row-other-name {
    color: #f5f5f5;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.1;
}

.trade-row-thumb {
    position: relative;
    width: 44px;
    height: 44px;
    overflow: hidden;
}

.trade-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.trade-row-thumb-qm {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #1a1a1a;
}

.trade-recipient-chip {
    gap: 12px;
}

.trade-recipient-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.trade-recipient-label {
    color: #999;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.trade-recipient-name {
    color: #f5f5f5;
    font-size: 1.15rem;
    font-weight: 600;
}

.trade-user-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

.trade-user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.trade-user-name {
    color: #f5f5f5;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trade-user-id {
    color: #888;
    font-size: 0.8rem;
}

.trade-compose-header {
    justify-content: space-between;
    flex-wrap: wrap;
}

.trade-compose-header h3 {
    flex: 1 1 auto;
}

.trade-compose-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.trade-box-empty-msg {
    color: #888;
    font-style: italic;
    padding: 18px 4px;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shlottery-container .trade-item .item-image-container,
.shlottery-container .trade-item .item-image,
.shlottery-container .trade-inv-card .item-image-container,
.shlottery-container .trade-inv-card .item-image {
    width: 88px;
    height: 88px;
    margin: 2px auto 0;
}

.shlottery-container .trade-row-thumb .item-image-container,
.shlottery-container .trade-row-thumb .item-image {
    width: 100%;
    height: 100%;
    margin: 0;
}

.trade-row-thumb {
    background: transparent;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.25);
}

.trade-decision-panel {
    background: radial-gradient(ellipse 130% 100% at 50% 0%, #1f1f1f 0%, #181818 45%, #121212 100%);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 16px 18px;
    text-align: center;
}

.trade-decision-panel h4 {
    margin: 0 0 12px;
    color: #ffe9a8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
}

.trade-decision-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.trade-decision-buttons .action-button {
    min-width: 130px;
    padding: 10px 16px;
}

.history-trade-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    text-align: left;
}

.history-trade-col-label {
    color: #ffe9a8;
    font-size: 0.85rem;
    font-weight: 600;
}

.history-trade-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-trade-item {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.78rem;
    line-height: 1.3;
    color: #ccc;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    word-break: break-word;
}

.history-trade-item-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.shlottery-container .history-trade-item-imgbox,
.shlottery-container .history-trade-item .item-image-container,
.shlottery-container .history-trade-item .item-image {
    width: 56px;
    height: 56px;
    margin: 0;
    flex-shrink: 0;
}

.shlottery-container .history-trade-item .item-image-container {
    position: relative;
}

.shlottery-container .history-trade-item .item-image-container .item-base-image,
.shlottery-container .history-trade-item .item-image-container .quantum-modifier-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
}

.history-trade-item-noimg {
    background: #0c0c0c;
    border-radius: 6px;
}

.history-trade-item-name {
    color: #f0f0f0;
    font-weight: 600;
}

.history-trade-item-id {
    color: #ffe9a8;
    font-weight: 600;
    font-size: 0.72rem;
    word-break: break-all;
}

.history-trade-item-stats {
    color: #aaa;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.history-trade-item-quantum {
    color: lightblue;
}

.history-trade-empty {
    color: #777;
    font-style: italic;
    font-size: 0.8rem;
    padding: 4px 2px;
}
