/* ==========================================================================
   Rift Keeper Overlay (v1.5.123)
   ========================================================================== */

.tod-rift-keeper-overlay {
    position: fixed !important;  /* override .tod-overlay position:absolute so it escapes #tod-wrapper overflow:hidden */
    inset: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    z-index: 999999 !important;
}

.tod-rk-panel {
    background: #1a1a2e;
    border: 2px solid #8b6914;
    border-radius: 6px;
    width: min(560px, 95vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(139, 105, 20, 0.4);
}

.tod-rk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #8b6914;
    background: #12122a;
}

.tod-rk-title {
    margin: 0;
    font-size: 1.2rem;
    color: #d4af37;
}

.tod-rk-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.tod-rk-close:hover { color: #fff; }

.tod-rk-desc {
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #c0b090;
    margin: 0;
    border-bottom: 1px solid #333;
}

.tod-rk-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 16px;
}

.tod-rk-empty {
    color: #888;
    font-style: italic;
    padding: 12px 0;
}

.tod-rk-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tod-rk-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #2a2a3e;
    gap: 12px;
}
.tod-rk-item-row:last-child { border-bottom: none; }

.tod-rk-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.tod-rk-item-name {
    color: #e8dcc8;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tod-rk-item-type {
    color: #888;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.tod-rk-enchant {
    color: #a78bfa;
    font-size: 0.78rem;
    font-style: italic;
}

/* ── Item detail tags (upgrade, sockets, BUC) ── */
.tod-rk-detail {
    display: inline-block;
    font-size: 0.75rem;
    font-style: normal;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255,255,255,0.05);
    margin-top: 2px;
}

.tod-rk-detail--upg {
    color: #4ade80; /* green — upgrade level */
}

.tod-rk-detail--sockets {
    color: #818cf8; /* indigo — socket container */
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.tod-rk-detail--blessed {
    color: #fbbf24; /* amber gold — blessed */
}

.tod-rk-detail--cursed {
    color: #f87171; /* red — cursed (should not normally appear; guard display) */
}

.tod-rk-detail--equipped {
    color: #94a3b8; /* slate — item is currently equipped */
    font-style: italic;
}

/* Individual gem spans inside a socket tag */
.tod-rk-gem {
    font-size: 0.72rem;
    font-style: italic;
    /* colour is set inline by rarity */
}

.tod-rk-gem--empty {
    color: #555; /* dim grey — empty socket */
    font-style: italic;
}

.tod-rk-item-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tod-rk-price-label {
    color: #d4af37;
    font-size: 0.85rem;
    white-space: nowrap;
}

.tod-rk-extract-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    background: #8b6914;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
}
.tod-rk-extract-btn:hover:not(:disabled) { background: #a07820; }
.tod-rk-extract-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Vault listing fields — price input and List for Sale button (v1.5.154)
   ========================================================================== */

.tod-vault-price-input {
    width: 90px;
    padding: 4px 8px;
    background: #111;
    border: 1px solid #555;
    border-radius: 3px;
    color: #e8dcc8;
    font-size: 0.85rem;
    text-align: right;
    -moz-appearance: textfield;
    appearance: textfield;
}
.tod-vault-price-input::-webkit-outer-spin-button,
.tod-vault-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.tod-vault-price-input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

.tod-vault-list-btn {
    padding: 5px 14px;
    font-size: 0.82rem;
    background: #8b6914;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.tod-vault-list-btn:hover:not(:disabled) { background: #a07820; }
.tod-vault-list-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Player Shop Tab (My Account page — v1.5.123)
   ========================================================================== */

.tod-player-shop-wrap {
    padding: 16px 0;
}

.tod-shop-section {
    margin-bottom: 28px;
}

.tod-shop-section h3 {
    color: #d4af37;
    font-size: 1rem;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}

.tod-shop-listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.tod-shop-listing-card {
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 12px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
}

.tod-shop-listing-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tod-shop-listing-card__icon {
    width: 80px;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.35;
    padding: 8px;
}

.tod-shop-listing-card__icon svg {
    width: 56px;
    height: 56px;
}

.tod-shop-listing-card__name {
    color: #e8dcc8;
    font-weight: 600;
    font-size: 0.9rem;
}

.tod-shop-listing-card__type {
    color: #888;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.tod-shop-listing-card__price {
    color: #d4af37;
    font-size: 0.85rem;
}

.tod-shop-listing-card__seller {
    color: #aaa;
    font-size: 0.78rem;
}

.tod-shop-listing-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.tod-shop-buy-btn,
.tod-shop-unlist-btn,
.tod-shop-list-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.tod-shop-buy-btn {
    background: #2e7d32;
    color: #fff;
}
.tod-shop-buy-btn:hover:not(:disabled) { background: #388e3c; }

.tod-shop-unlist-btn {
    background: #7b1fa2;
    color: #fff;
}
.tod-shop-unlist-btn:hover:not(:disabled) { background: #8e24aa; }

.tod-shop-list-btn {
    background: #8b6914;
    color: #fff;
}
.tod-shop-list-btn:hover:not(:disabled) { background: #a07820; }

.tod-shop-buy-btn:disabled,
.tod-shop-unlist-btn:disabled,
.tod-shop-list-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tod-shop-empty {
    color: #888;
    font-style: italic;
    padding: 8px 0;
}

.tod-shop-balance {
    color: #d4af37;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.tod-shop-price-input {
    width: 80px;
    padding: 3px 6px;
    background: #111;
    border: 1px solid #555;
    border-radius: 3px;
    color: #e8dcc8;
    font-size: 0.8rem;
}

.tod-vault-import-select {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.tod-vault-import-select input[type="checkbox"] {
    accent-color: #d4af37;
}

.tod-vault-import-btn {
    padding: 6px 16px;
    background: #8b6914;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 8px;
}
.tod-vault-import-btn:hover:not(:disabled) { background: #a07820; }
.tod-vault-import-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   Altar Enchanting Overlay  (v1.5.124)
   ========================================================================== */

.tod-overlay-inner--enchant {
    max-width: 780px;
    width: 96%;
}

.tod-enchant-intro {
    color: var(--tod-text-dim, #b0a080);
    font-size: 0.88rem;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.tod-enchant-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 560px) {
    .tod-enchant-body { grid-template-columns: 1fr; }
}

.tod-enchant-pane {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--tod-border, #4a3f2a);
    border-radius: 6px;
    padding: 0.75rem;
    max-height: 260px;
    overflow-y: auto;
}

.tod-enchant-pane__title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tod-gold, #c9a84c);
    margin: 0 0 0.5rem;
}

.tod-enchant-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tod-enchant-list-item {
    padding: 0.45rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.tod-enchant-list-item:hover:not(.tod-enchant-list-item--disabled) {
    background: rgba(201,168,76,0.12);
    border-color: var(--tod-gold, #c9a84c);
}

.tod-enchant-list-item.selected {
    background: rgba(201,168,76,0.22);
    border-color: var(--tod-gold, #c9a84c);
}

.tod-enchant-list-item--disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.tod-enchant-item-name {
    color: var(--tod-text, #d4c9a8);
    font-size: 0.88rem;
}

.tod-enchant-unavail {
    font-size: 0.72rem;
    color: var(--tod-text-dim, #888);
    font-style: italic;
}

.tod-enchant-empty {
    color: var(--tod-text-dim, #888);
    font-size: 0.82rem;
    padding: 0.5rem 0;
    line-height: 1.5;
}

/* Preview panel */
.tod-enchant-preview {
    background: rgba(201,168,76,0.08);
    border: 1px solid var(--tod-gold, #c9a84c);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.tod-enchant-preview__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tod-gold, #c9a84c);
    margin-bottom: 0.3rem;
}

.tod-enchant-preview__desc {
    font-size: 0.85rem;
    color: var(--tod-text, #d4c9a8);
    margin-bottom: 0.3rem;
}

.tod-enchant-preview__stats {
    font-size: 0.82rem;
    color: #7ec87e;
    margin-bottom: 0.3rem;
}

.tod-enchant-preview__cost {
    font-size: 0.82rem;
    color: var(--tod-text-dim, #aaa);
}

.tod-enchant-cost--unaffordable {
    color: #e05555 !important;
    font-weight: 600;
}

/* Footer */
.tod-enchant-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Altar card — Enchant */
.tod-altar-card--enchant {
    background: linear-gradient(135deg, rgba(100,60,180,0.18), rgba(60,30,100,0.12));
    border-color: rgba(160,100,255,0.35);
}
.tod-altar-card--enchant:hover {
    background: linear-gradient(135deg, rgba(100,60,180,0.32), rgba(60,30,100,0.22));
    border-color: rgba(160,100,255,0.7);
}

/* ==========================================================================
   Vault Item Picker Overlay  (v1.5.153)
   Compact modal opened by the vault icon button in the char-create form.
   ========================================================================== */

.tod-overlay-inner--vault-picker {
    max-width: 420px;
    width:     96%;
}

.tod-vault-picker-desc {
    color:       var(--tod-text-dim, #b0a080);
    font-size:   0.88rem;
    margin:      0 0 0.75rem;
    line-height: 1.5;
}

.tod-vault-picker-list {
    list-style:    none;
    margin:        0 0 1rem;
    padding:       0;
    max-height:    260px;
    overflow-y:    auto;
    border:        1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
    background:    rgba(0, 0, 0, 0.25);
}

.tod-vault-picker-list .tod-vault-import-select {
    padding:       6px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tod-vault-picker-list .tod-vault-import-select:last-child {
    border-bottom: none;
}

.tod-vault-picker-empty {
    color:      #888;
    font-style: italic;
    padding:    12px 10px;
    text-align: center;
}


/* ==========================================================================
   Vault Discard Button (v1.5.158)
   ========================================================================== */

.tod-vault-discard-btn {
    display:       inline-flex;
    align-items:   center;
    gap:           5px;
    padding:       5px 12px;
    margin-left:   8px;
    background:    transparent;
    border:        1px solid rgba(180, 60, 60, 0.55);
    border-radius: 4px;
    color:         #c06060;
    font-size:     0.82rem;
    font-family:   inherit;
    cursor:        pointer;
    white-space:   nowrap;
    transition:    background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.tod-vault-discard-btn:hover:not(:disabled) {
    background:    rgba(180, 40, 40, 0.18);
    border-color:  rgba(220, 80, 80, 0.75);
    color:         #e07070;
}

.tod-vault-discard-btn:disabled {
    opacity: 0.5;
    cursor:  not-allowed;
}
