html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "Verdana", sans-serif;
    color: #ecf4ff;
}

* {
    box-sizing: border-box;
}

a {
    color: inherit;
}

h1,
h2,
h3 {
    margin-top: 0;
}

.page-title {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: #f1f7ff;
}

.page-subtitle {
    color: #aec2df;
}

.page-alert {
    border: 1px solid rgba(255, 116, 116, 0.5);
    border-radius: 12px;
    background: rgba(117, 26, 26, 0.36);
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(250px, 1fr));
}

.dashboard-card {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 1rem;
}

.dashboard-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
    color: #f7d37a;
}

.dashboard-card p {
    margin: 0.35rem 0;
}

.dashboard-card-wide {
    grid-column: 1 / -1;
}

.inventory-status {
    border: 1px solid rgba(123, 226, 186, 0.48);
    border-radius: 12px;
    background: rgba(30, 88, 65, 0.3);
    color: #d5ffea;
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
}

.booster-status {
    border: 1px solid rgba(123, 226, 186, 0.48);
    border-radius: 12px;
    background: rgba(30, 88, 65, 0.3);
    color: #d5ffea;
    padding: 0.7rem 0.85rem;
    margin-bottom: 1rem;
}

.booster-open-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
}

.booster-open-panel {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 1rem;
    min-width: 0;
}

.booster-open-result-panel {
    margin-top: 1rem;
}

.booster-open-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.booster-open-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #f7d37a;
}

.booster-list {
    display: grid;
    gap: 0.55rem;
}

.booster-list-item {
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 10px;
    background: rgba(11, 18, 31, 0.42);
    color: #e8f0ff;
    text-align: left;
    padding: 0.65rem 0.75rem;
    display: grid;
    gap: 0.2rem;
}

.booster-list-item:hover {
    border-color: rgba(124, 192, 255, 0.55);
    background: rgba(24, 44, 74, 0.45);
}

.booster-list-item.is-selected {
    border-color: rgba(255, 208, 121, 0.75);
    background: rgba(92, 66, 27, 0.42);
}

.booster-list-item-title {
    font-weight: 700;
}

.booster-list-item-meta {
    color: #a9bfdc;
    font-size: 0.84rem;
}

.booster-selected-summary p {
    margin: 0 0 0.4rem 0;
    color: #dce8fb;
}

.booster-open-button {
    margin-top: 0.2rem;
}

.booster-open-help {
    margin: 0.55rem 0 0 0;
    color: #a9bfdc;
    font-size: 0.9rem;
}

.booster-result-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.booster-result-card {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 11px;
    overflow: hidden;
    background: rgba(11, 18, 31, 0.42);
    opacity: 0;
    transform: translateY(6px);
    animation: boosterReveal 260ms ease-out forwards;
    animation-delay: var(--reveal-delay, 0ms);
}

.booster-result-image-wrap {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.booster-result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.booster-result-image-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-content: center;
    text-align: center;
    color: #9bb2d6;
    font-size: 0.84rem;
    padding: 0.5rem;
}

.booster-result-body {
    padding: 0.6rem 0.65rem;
}

.booster-slot-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.17rem 0.5rem;
    background: rgba(122, 203, 255, 0.2);
    color: #d8f2ff;
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
}

.booster-result-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.booster-result-meta {
    color: #a7bddb;
    font-size: 0.83rem;
}

@keyframes boosterReveal {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inventory-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.inventory-panel {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    min-width: 0;
}

.inventory-panel-wide {
    grid-column: 1 / -1;
}

.inventory-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.inventory-panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #f7d37a;
}

.inventory-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.inventory-table thead th {
    text-align: left;
    color: #b5c7e4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.45rem 0.4rem;
    white-space: nowrap;
}

.inventory-table tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.45rem 0.4rem;
    vertical-align: middle;
}

.inventory-card-name {
    font-weight: 700;
}

.inventory-card-hover-target {
    display: inline-block;
    border-bottom: 1px dashed rgba(155, 193, 242, 0.65);
    cursor: default;
}

.inventory-card-sub {
    color: #9ab0d3;
    font-size: 0.82rem;
}

.inventory-opened-list {
    margin: 0.55rem 0 0 1.2rem;
    padding: 0;
}

.inventory-opened-list li {
    margin-bottom: 0.45rem;
}

.inventory-opened-meta {
    display: inline-block;
    margin-left: 0.45rem;
    color: #9cb2d4;
    font-size: 0.86rem;
}

.inventory-filters {
    display: grid;
    grid-template-columns: 1fr 170px 150px 160px;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.inventory-filter-search,
.inventory-filter-select {
    min-height: 34px;
}

.inventory-view-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    color: #e6efff;
}

.inventory-view-toggle-label {
    font-size: 0.85rem;
    font-weight: 700;
}

.inventory-view-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.inventory-view-toggle-slider {
    width: 40px;
    height: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    transition: background-color 0.2s ease;
}

.inventory-view-toggle-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    transition: transform 0.2s ease;
}

.inventory-view-toggle input:checked + .inventory-view-toggle-slider {
    background: linear-gradient(135deg, #4ca2ff 0%, #7de7ff 100%);
}

.inventory-view-toggle input:checked + .inventory-view-toggle-slider::after {
    transform: translateX(18px);
}

.inventory-hover-preview {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background: rgba(11, 18, 31, 0.45);
    padding: 0.7rem;
    margin-bottom: 0.85rem;
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 0.75rem;
    align-items: center;
}

.inventory-hover-preview-frame {
    width: 150px;
    height: 210px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.17);
    background: rgba(255, 255, 255, 0.05);
    display: grid;
    place-content: center;
}

.inventory-hover-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inventory-hover-preview-empty {
    color: #9fb6d8;
    font-size: 0.82rem;
    text-align: center;
    padding: 0.6rem;
}

.inventory-hover-preview-caption {
    color: #dce9ff;
    font-size: 0.95rem;
}

.inventory-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.8rem;
}

.inventory-card-tile {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(11, 18, 31, 0.42);
    overflow: hidden;
}

.inventory-card-image-wrap {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.inventory-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.inventory-card-image-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-content: center;
    color: #98afd3;
    font-size: 0.82rem;
    text-align: center;
    padding: 0.5rem;
}

.inventory-card-tile-body {
    padding: 0.55rem 0.6rem;
}

.inventory-card-tile-title {
    font-weight: 700;
    color: #eff6ff;
    margin-bottom: 0.2rem;
}

.inventory-card-tile-meta {
    color: #aac0df;
    font-size: 0.82rem;
}

.trades-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(320px, 0.95fr) minmax(420px, 1.05fr);
}

.trades-busy-banner {
    border: 1px solid rgba(147, 197, 253, 0.45);
    border-radius: 8px;
    background: rgba(30, 64, 175, 0.24);
    color: #dbeafe;
    font-size: 0.86rem;
    padding: 0.4rem 0.55rem;
}

.trades-panel {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 1rem;
    min-width: 0;
}

.trades-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.trades-panel-header h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #f7d37a;
}

.trades-create-panel {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(11, 18, 31, 0.35);
    padding: 0.75rem;
    margin-bottom: 0.9rem;
}

.trades-create-panel h3 {
    margin: 0 0 0.6rem 0;
    font-size: 0.98rem;
    color: #f7d37a;
}

.trades-create-fields {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr);
    gap: 0.55rem;
    margin-bottom: 0.55rem;
}

.trades-create-summary {
    color: #b7c9e4;
    font-size: 0.84rem;
    margin-bottom: 0.5rem;
}

.trades-create-cards {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem;
    max-height: 230px;
    overflow-y: auto;
    display: grid;
    gap: 0.35rem;
}

.trades-create-card-item {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 0.45rem;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 0.45rem;
    align-items: center;
    cursor: pointer;
}

.trades-create-card-item:hover {
    border-color: rgba(124, 192, 255, 0.55);
}

.trades-create-card-item.is-selected {
    border-color: rgba(255, 208, 121, 0.75);
    background: rgba(92, 66, 27, 0.32);
}

.trades-create-card-item input {
    margin: 0;
}

.trades-create-card-text {
    color: #deebff;
    font-size: 0.83rem;
}

.trades-create-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.55rem;
}

.trades-list-sections {
    display: grid;
    gap: 0.95rem;
}

.trades-list-section h3 {
    margin: 0 0 0.55rem 0;
    font-size: 1rem;
    color: #dce8fb;
}

.trades-list {
    display: grid;
    gap: 0.5rem;
}

.trades-list-item {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(11, 18, 31, 0.42);
    color: #e8f0ff;
    text-align: left;
    padding: 0.6rem 0.7rem;
    display: grid;
    gap: 0.2rem;
}

.trades-list-item:hover {
    border-color: rgba(124, 192, 255, 0.55);
    background: rgba(24, 44, 74, 0.45);
}

.trades-list-item.is-selected {
    border-color: rgba(255, 208, 121, 0.75);
    background: rgba(92, 66, 27, 0.42);
}

.trades-list-item-title {
    font-weight: 700;
}

.trades-list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    color: #a9bfdc;
    font-size: 0.84rem;
}

.trade-status-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    width: fit-content;
}

.trade-status-badge.status-ongoing {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(120, 76, 16, 0.42);
}

.trade-status-badge.status-accepted {
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(22, 101, 52, 0.35);
}

.trade-status-badge.status-refused {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.52);
    background: rgba(127, 29, 29, 0.34);
}

.trade-status-badge.status-cancelled,
.trade-status-badge.status-expired {
    color: #dbe7fb;
    border-color: rgba(148, 163, 184, 0.48);
    background: rgba(51, 65, 85, 0.45);
}

.trade-status-badge.status-unknown {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(30, 41, 59, 0.4);
}

.trades-summary {
    margin-bottom: 0.8rem;
}

.trades-summary p {
    margin: 0 0 0.35rem 0;
    color: #dce8fb;
}

.trades-summary .trade-status-badge {
    margin-left: 0.35rem;
    vertical-align: middle;
}

.trades-counter-offer-panel {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(11, 18, 31, 0.35);
    padding: 0.75rem;
    margin-bottom: 0.85rem;
}

.trades-counter-offer-panel h3 {
    margin: 0 0 0.6rem 0;
    font-size: 0.98rem;
    color: #f7d37a;
}

.trades-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.trades-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 0.8rem;
}

.trades-card-panel {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(11, 18, 31, 0.35);
    padding: 0.7rem;
    min-width: 0;
}

.trades-card-panel h3 {
    margin: 0 0 0.6rem 0;
    font-size: 0.98rem;
    color: #f7d37a;
}

.trades-card-list {
    display: grid;
    gap: 0.55rem;
}

.trades-card-item {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
    display: grid;
    grid-template-columns: 74px 1fr;
    min-width: 0;
}

.trades-card-image-wrap {
    width: 74px;
    height: 98px;
    background: rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.11);
}

.trades-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.trades-card-image-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-content: center;
    text-align: center;
    color: #99b1d4;
    font-size: 0.74rem;
    padding: 0.25rem;
}

.trades-card-body {
    padding: 0.45rem 0.55rem;
    min-width: 0;
}

.trades-card-title {
    font-weight: 700;
    color: #eef6ff;
    margin-bottom: 0.15rem;
}

.trades-card-meta {
    color: #a9bfdc;
    font-size: 0.79rem;
}

.trades-events-panel {
    margin-top: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(11, 18, 31, 0.35);
    padding: 0.7rem;
}

.trades-events-panel h3 {
    margin: 0 0 0.6rem 0;
    font-size: 0.98rem;
    color: #f7d37a;
}

.trades-event-list {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 0.55rem;
}

.trades-event-item {
    color: #dce8fb;
}

.trades-event-title {
    font-weight: 700;
    color: #e9f2ff;
}

.trades-event-meta {
    color: #a9bfdc;
    font-size: 0.84rem;
}

.trades-event-details {
    color: #c7d9f2;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.8rem;
    margin-top: 0.2rem;
    word-break: break-word;
}

.login-card {
    width: min(440px, 95vw);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(7, 14, 24, 0.78);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
    padding: 1.25rem;
    color: #eef5ff;
}

.login-card-header {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1rem;
}

.login-card-header h1 {
    font-size: 1.55rem;
    margin-bottom: 0.35rem;
}

.login-card-header p {
    margin: 0;
    color: #adc2e3;
}

.login-badge {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: grid;
    place-content: center;
    font-weight: 800;
    color: #17233b;
    background: linear-gradient(145deg, #f6c655 0%, #f49e3f 100%);
}

.login-form .form-control {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(25, 37, 56, 0.28);
    color: #0f1726;
}

.login-submit {
    width: 100%;
    border-radius: 10px;
    font-weight: 700;
}

.login-error {
    border: 1px solid rgba(255, 117, 117, 0.5);
    border-radius: 10px;
    background: rgba(140, 31, 31, 0.3);
    color: #ffc8c8;
    padding: 0.65rem 0.8rem;
}

.login-callback-guard {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.7rem 0.8rem;
    margin-bottom: 1rem;
}

.login-callback-guard.is-ok {
    border-color: rgba(124, 232, 186, 0.45);
    background: rgba(29, 83, 59, 0.24);
}

.login-callback-guard.is-warning {
    border-color: rgba(255, 199, 107, 0.55);
    background: rgba(103, 72, 27, 0.24);
}

.login-callback-title {
    font-weight: 700;
    margin: 0 0 0.35rem 0;
    color: #eff6ff;
}

.login-callback-code {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(9, 15, 27, 0.6);
    color: #ebf4ff;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 0.9rem;
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.45rem;
    word-break: break-all;
}

.login-callback-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.45rem;
}

.login-callback-copy-success {
    color: #aef1cf;
    font-size: 0.9rem;
}

.login-callback-copy-error {
    color: #ffd1a3;
    font-size: 0.9rem;
}

.login-callback-help {
    margin: 0;
    color: #c6d6ef;
}

.login-callback-warning {
    margin: 0.4rem 0 0 0;
    color: #ffd998;
}

.validation-message,
.validation-errors,
.validation-summary-errors {
    color: #ff9f9f;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #43d088;
}

.invalid {
    outline: 1px solid #ff7979;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff5c4;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .booster-open-grid {
        grid-template-columns: 1fr;
    }

    .inventory-grid {
        grid-template-columns: 1fr;
    }

    .inventory-filters {
        grid-template-columns: 1fr;
    }

    .inventory-hover-preview {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .trades-grid {
        grid-template-columns: 1fr;
    }

    .trades-detail-grid {
        grid-template-columns: 1fr;
    }

    .trades-create-fields {
        grid-template-columns: 1fr;
    }
}
