/* main.css - Основные стили и макет (минимализм) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background:
        radial-gradient(ellipse 60% 40% at 20% 0%, rgba(245,158,11,0.06), transparent),
        radial-gradient(ellipse 50% 35% at 80% 100%, rgba(239,68,68,0.05), transparent),
        #09090b;
    color: var(--text-primary);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === ГЛОБАЛЬНЫЙ HUD === */
.global-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    flex-flow: row nowrap;
    gap: var(--spacing-lg);
    align-items: center;
    justify-content: flex-start;
    background: rgba(9,9,11,0.92);
    border-bottom: 1px solid var(--border-accent);
    padding: 6px var(--spacing-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hud-stat {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.hud-health {
    color: #e74c3c;
}

.hud-energy {
    color: #3498db;
}

/* ── высоты фиксированных полос (меняй здесь одной строкой) ── */
:root {
    --hud-height: 50px;          /* globalHud сверху */
    --statusbar-height: 32px;    /* server-status-bar снизу */
    --bottom-navbar-height: 68px;/* bottom-navbar */
    --navbar-height: 100px;      /* bottom-navbar + server-status-bar (для screen-with-navbar) */
}

/* Скролл строго между globalHud и serverStatusBar */
.screen {
    position: fixed;
    top: var(--hud-height);
    bottom: var(--statusbar-height);
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--spacing-sm);
    background: var(--primary-color);
}

/* === ЭКИПИРОВКА === */
.equipment-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: start;
    margin-top: var(--spacing-md);
    justify-items: center;
}

.equip-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    width: 100%;
}

.equip-slot-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 56px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.equip-slot-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-1px);
    cursor: pointer;
}

.equip-slot-card.is-empty:hover {
    border-color: var(--border-color);
    transform: none;
    cursor: default;
}

/* Квадраты экипировки — компактные, как item-placeholder в инвентаре */
.equip-slot-cell {
    min-height: unset;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02);
    justify-content: center;
    position: relative;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    padding: 4px;
}

/* Угловые amber-декоры на ячейке снаряжения */
.equip-slot-cell::before,
.equip-slot-cell::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.equip-slot-cell::before {
    top: 2px; left: 2px;
    border-top: 1.5px solid rgba(245,158,11,0.6);
    border-left: 1.5px solid rgba(245,158,11,0.6);
}
.equip-slot-cell::after {
    bottom: 2px; right: 2px;
    border-bottom: 1.5px solid rgba(245,158,11,0.6);
    border-right: 1.5px solid rgba(245,158,11,0.6);
}

.equip-slot-cell:hover:not(.is-empty) {
    transform: scale(1.05);
    border-color: rgba(245,158,11,0.5);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px rgba(245,158,11,0.1);
    cursor: pointer;
}
.equip-slot-cell:hover:not(.is-empty)::before,
.equip-slot-cell:hover:not(.is-empty)::after {
    opacity: 1;
}

.equip-slot-cell:active:not(.is-empty) {
    transform: scale(0.96);
}

.equip-slot-cell.is-empty {
    opacity: 1;
    border-style: solid;
    background: var(--secondary-color);
    cursor: pointer;
}

.equip-slot-cell.is-empty:active {
    transform: translateY(1px);
    border-color: var(--accent-color);
}

.equip-slot-cell .item-icon {
    width: min(54px, 14vw);
    height: min(54px, 14vw);
    font-size: 1.6rem;
}

.equip-slot-cell .item-name {
    font-size: 0.65rem;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* item-meta removed from equip-slot-cell — kept comment for reference */

.equip-slot-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.equip-slot-icon {
    font-size: 1.1rem;
}

.equip-slot-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.equip-slot-value {
    text-align: right;
}

.equip-slot-name {
    font-weight: 700;
    color: var(--text-primary);
}

.equip-slot-empty {
    color: var(--text-secondary);
}

.equip-slot-rarity {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.equip-center {
    position: relative;
    width: 180px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equip-figure {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equip-avatar {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
                radial-gradient(circle at 30% 30%, rgba(245,158,11,0.12), transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(239,68,68,0.08), transparent 45%),
                var(--secondary-color);
    border: 1px solid var(--border-accent);
    position: relative;
    overflow: hidden;
}

.equip-avatar::after {
    content: '';
    position: absolute;
    inset: 14%;
    background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(0,0,0,0.35));
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 320"><path fill="white" d="M98 8c22 0 40 18 40 40s-18 40-40 40-40-18-40-40S76 8 98 8zm0 96c34 0 62 28 62 62v46c0 10-8 18-18 18H54c-10 0-18-8-18-18v-46c0-34 28-62 62-62z"/></svg>');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    pointer-events: none;
}

.equip-figure-shadow {
    position: absolute;
    width: 70%;
    height: 18px;
    background: radial-gradient(circle, rgba(0,0,0,0.35), transparent 60%);
    bottom: -10px;
    left: 15%;
    filter: blur(8px);
    opacity: 0.8;
}

.screen::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-md);
}

/* === ГЛАВНОЕ МЕНЮ === */
.menu-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    height: auto;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
}

/* Баннер / лого в главном меню */
.menu-logo {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.menu-logo-img {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    border-radius: var(--radius-lg);
    filter: drop-shadow(0 4px 20px rgba(245,158,11,0.15));
}

.game-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    text-align: center;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 0 40px rgba(245,158,11,0.3);
}

.game-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    width: 100%;
    max-width: 280px;
}

.menu-block {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: rgba(39, 39, 42, 0.3);
}

.menu-block-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2px;
    text-align: center;
}

/* === ЭКРАН ЗАГОЛОВОК === */
.screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-accent);
    padding-bottom: var(--spacing-md);
    position: relative;
}

.screen-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
}

/* === ХАРАКТЕРИСТИКИ === */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 0.9rem;
}

.stat-row > span:first-child {
    min-width: 80px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-bar {
    flex: 1;
    height: 16px;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-width: 0;
}

.stat-fill {
    height: 100%;
    background-color: var(--danger-color);
    transition: width 0.2s ease;
    min-width: 0;
}

.stat-fill.energy {
    background-color: var(--info);
}

.stat-row > span:last-child {
    min-width: 50px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
}

.stat-box {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 1px solid var(--border-dim);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* === ЭКИПИРОВКА === */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.equipment-slot {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.2s ease;
    text-align: center;
}

.equipment-slot:active {
    border-color: var(--accent-color);
}

.slot-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.slot-item {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    min-height: 20px;
    word-break: break-word;
}

/* === ИНВЕНТАРЬ === */
.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-accent);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.inventory-grid, .shop-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    width: 100%;
    box-sizing: border-box;
}

.item-cell {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.1s ease;
    aspect-ratio: 1 / 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Item icon fills cell minus 4px (2px inset on each side) */
.item-cell .item-icon {
    position: absolute;
    inset: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    overflow: hidden;
    aspect-ratio: unset;
    border: none;
}

.item-cell:active {
    border-color: var(--accent-color);
    transform: translateY(1px);
}

.item-cell .item-name {
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.rarity-trash { color: #9aa0a6; }
.rarity-poor { color: #7f8c8d; }
.rarity-normal { color: #4a90e2; }
.rarity-good { color: #8e44ad; }
.rarity-great { color: #f39c12; }
.rarity-perfect { color: #e74c3c; }

.item-cell .item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* === ВАЛЮТЫ === */
.currency-display {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(9,9,11,0.9);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    position: fixed;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 100;
    font-size: 0.82rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.currency {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    font-size: 0.9rem;
}

.currency-icon {
    font-size: 1rem;
    color: var(--accent-color);
}

/* === РЕЙД НА БОССОВ === */
.raid-tabs {
    display: flex;
    gap: 0;
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
}
.raid-tab {
    flex: 1;
    padding: 10px 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.raid-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.raid-boss-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: 0 4px;
    padding-bottom: 80px;
}

.raid-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-xl);
}

.raid-boss-card {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}
.raid-boss-card.disabled {
    opacity: 0.55;
}

.raid-boss-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 6px;
}
.raid-boss-icon {
    font-size: 2rem;
}
.raid-boss-title {
    flex: 1;
}
.raid-boss-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}
.raid-boss-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.raid-boss-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.raid-boss-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.raid-skill-tag {
    background: rgba(255,165,0,0.15);
    color: var(--accent-color);
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255,165,0,0.3);
}

.raid-boss-status {
    font-size: 0.8rem;
    margin-bottom: 8px;
}
.raid-locked { color: #888; }
.raid-cd { color: #f59e0b; }
.raid-active { color: #22c55e; }
.raid-ready { color: #22c55e; }

.raid-join-btn {
    width: 100%;
    min-height: 44px;
}

/* Lobby / Battle view */
.raid-lobby-content {
    padding: 0 4px;
    padding-bottom: 80px;
}
.raid-lobby-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}
.raid-boss-portrait {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}
.raid-boss-big-icon {
    font-size: 2.5rem;
}
.raid-boss-big-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* HP bars */
.raid-boss-hp-section {
    margin-bottom: var(--spacing-md);
}
.raid-hp-label {
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.raid-hp-bar-bg {
    width: 100%;
    height: 20px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.raid-hp-bar-bg.small {
    height: 10px;
}
.raid-hp-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}
.raid-hp-bar.boss {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}
.raid-hp-bar.player {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}
.raid-hp-bar.add {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* Adds */
.raid-adds-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--spacing-md);
    padding: 8px;
    background: rgba(255,165,0,0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,165,0,0.15);
}
.raid-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.raid-add-row .raid-hp-bar-bg {
    flex: 1;
}

/* Team */
.raid-team-section {
    margin-bottom: var(--spacing-md);
}
.raid-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.raid-player-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.raid-player-row.is-me {
    color: var(--accent-color);
    font-weight: 600;
}
.raid-player-row.dead {
    opacity: 0.4;
    text-decoration: line-through;
}
.raid-player-name {
    min-width: 80px;
    flex-shrink: 0;
}
.raid-player-hp {
    min-width: 60px;
    text-align: right;
    font-size: 0.75rem;
}
.raid-player-row .raid-hp-bar-bg {
    flex: 1;
}
.raid-player-dmg {
    min-width: 50px;
    text-align: right;
    font-size: 0.75rem;
    color: var(--accent-color);
}

/* Waiting */
.raid-waiting-info {
    text-align: center;
    margin: var(--spacing-md) 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.raid-lobby-id {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.raid-start-btn {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
}
.raid-waiting-msg {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-md);
}

/* Actions */
.raid-actions {
    margin-bottom: var(--spacing-md);
}
.raid-charge-wrap {
    margin-bottom: 8px;
}
.raid-charge-bar-bg {
    width: 100%;
    height: 44px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    position: relative;
    border: 2px solid var(--accent-color);
}
.raid-charge-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    transition: none;
}
.raid-charge-hint {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}
.raid-action-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.raid-action-btns .btn {
    min-height: 40px;
    font-size: 0.85rem;
}
.raid-stun-msg, .raid-cover-msg {
    text-align: center;
    padding: 6px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    margin-top: 6px;
}
.raid-stun-msg {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}
.raid-cover-msg {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}
.raid-dead-msg {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Results */
.raid-result {
    text-align: center;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}
.raid-result.won {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.3);
}
.raid-result.lost {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
}
.raid-result-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}
.raid-result.won .raid-result-title { color: #22c55e; }
.raid-result.lost .raid-result-title { color: #ef4444; }

.raid-scoreboard {
    text-align: left;
    margin-bottom: var(--spacing-md);
}
.raid-score-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.raid-score-row.is-me {
    color: var(--accent-color);
    font-weight: 600;
}

.raid-my-result {
    background: rgba(255,165,0,0.1);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
    color: var(--accent-color);
}
.raid-reward-item {
    color: var(--text-primary);
    margin-top: 4px;
}

/* Log */
.raid-log-section {
    margin-top: var(--spacing-md);
}
.raid-log {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.75rem;
    line-height: 1.5;
}
.raid-log-entry {
    color: var(--text-secondary);
    padding: 1px 0;
}

.battle-modal {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.battle-log {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 1px solid var(--border-accent);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    min-height: 150px;
    font-size: 0.82rem;
    font-family: 'Courier New', monospace;
}

.battle-log-entry {
    padding: var(--spacing-xs);
    margin: var(--spacing-xs) 0;
    border-left: 2px solid var(--border-color);
    padding-left: var(--spacing-md);
    line-height: 1.3;
}

.battle-log-entry.player {
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.battle-log-entry.enemy {
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

.battle-log-entry.info {
    border-left-color: var(--info);
    color: var(--info);
}

.battle-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.battle-actions .btn {
    width: 100%;
}

/* === ЭКРАН ПЕРСОНАЖА (новая структура) === */
#characterScreen {
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.char-page {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}

/* Аватар */
.char-avatar-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(24,24,27,0.7);
    border: 1px solid #3f3f46;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

/* amber gradient shimmer on top */
.char-avatar-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(245,158,11,0.4), transparent);
    pointer-events: none;
}

.char-avatar {
    width: 72px;
    height: 72px;
    background: var(--primary-color);
    border: 2px solid rgba(245,158,11,0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(245,158,11,0.2);
}

.char-avatar-icon {
    font-size: 2.4rem;
    line-height: 1;
}

/* Inline exp bar in avatar header */
.char-avatar-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.char-exp-inline {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.char-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.char-level {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-top: 4px;
}

/* Секции */
.char-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.char-section-title {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
    margin-bottom: 2px;
}

.char-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(217,119,6,0.35), transparent);
    border-radius: 1px;
}

/* Подзаголовок секции */
.char-section-subtitle {
    font-size: 0.58rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 6px;
    margin-bottom: 2px;
}

/* Бейдж класса */
.char-class-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--border-radius);
}

.char-class-badge .char-class-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.char-class-badge .char-class-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* Список скиллов */
.char-skills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.char-skill-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.char-skill-card:active {
    background: rgba(255,255,255,0.05);
    border-color: var(--accent-color);
}

.char-skill-icon {
    font-size: 1.5rem;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.char-skill-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.char-skill-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.char-skill-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.char-skill-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.6;
    text-align: center;
    padding: 16px 0;
}

/* Строка параметра */
.char-stat-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.88rem;
    padding: 7px 10px;
    background: rgba(24,24,27,0.45);
    border: 1px solid #27272a;
    border-radius: 7px;
}

.char-stat-label {
    min-width: 110px;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
}

.char-stat-value {
    min-width: 80px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
}

.char-stat-pct {
    min-width: 40px;
    text-align: right;
    margin-left: auto;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.char-stat-bar {
    display: none;
}

.char-bar-fill {
    height: 100%;
    transition: width 0.25s ease;
    border-radius: 3px;
}

.char-bar-fill.health {
    background: #e74c3c;
}

.char-bar-fill.energy {
    background: #3498db;
}

/* Кнопки снаряжения */
.char-equip-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.btn-equip {
    padding: 5px 8px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s;
}

.equip-count {
    font-size: 0.75rem;
    color: var(--text-secondary, #aaa);
    font-weight: 500;
    margin-left: auto;
    padding-left: 8px;
}

.btn-equip:hover:not(:disabled) {
    border-color: rgba(217,119,6,0.6);
}

.btn-equip:active:not(:disabled) {
    border-color: var(--accent-color);
    background: rgba(217,119,6,0.08);
}

.btn-equip.btn-future {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Валюта */
.char-currencies {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.char-currency-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(24,24,27,0.6);
    border: 1px solid #27272a;
    border-radius: 8px;
    font-size: 0.88rem;
}

.char-currency-icon {
    font-size: 1.1rem;
    color: var(--accent-color);
    min-width: 20px;
    text-align: center;
}

.char-currency-icon.rare {
    color: #60a5fa;
}

.char-currency-icon.unique {
    color: var(--accent-color);
}

.char-currency-icon.arena {
    color: #f87171;
}

.char-currency-label {
    flex: 1;
    color: var(--text-secondary);
    font-weight: 500;
}

.char-currency-amount {
    font-weight: 700;
    color: var(--text-primary);
}

/* Блок опыта */
.char-exp-block {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.char-exp-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.char-exp-bar-wrap {
    height: 10px;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.char-exp-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #ff9a5c);
    border-radius: 5px;
    transition: width 0.4s ease;
}

.char-exp-maxlabel {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Нижний слот экипировки (Рюкзак + заглушка) */
.equip-bottom {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: var(--spacing-sm);
}

/* Сообщение когда нет подходящих предметов в селекторе слота */
.slot-selector-empty {
    grid-column: 1 / -1;
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Вложенные панели (Рюкзак, Склад) */
.char-subpanel {
    position: absolute;
    inset: 0;
    background: var(--primary-color);
    padding: var(--spacing-md);
    overflow-y: auto;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.char-subpanel::-webkit-scrollbar { display: none; }

/* Сетки инвентаря/склада на вложенных панелях */
.char-subpanel .inventory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-md);
    width: 100%;
    box-sizing: border-box;
}

.subpanel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(to right, #18181b, #09090b);
    border: 1px solid #27272a;
    border-left: 3px solid rgba(217,119,6,0.6);
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.subpanel-header .storage-slots-label {
    margin-left: auto;
    font-family: monospace;
    color: #f59e0b;
    letter-spacing: 1px;
    font-size: 0.7rem;
}

.btn-back {
    background: none;
    border: none;
    color: rgba(245,158,11,0.8);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    padding: 2px 0;
    flex-shrink: 0;
    letter-spacing: 1px;
    transition: color 0.15s ease;
}
.btn-back:hover { color: #f59e0b; }

/* === СТАТУС-БАР ОНЛАЙНА === */
.server-status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--statusbar-height, 32px) + env(safe-area-inset-bottom, 0px));
    background: rgba(9,9,11,0.97);
    border-top: 1px solid rgba(39,39,42,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 1000;
    font-size: 0.72rem;
    color: var(--text-secondary);
    padding: 0 12px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.server-status-bar .status-indicator {
    font-size: 0.6rem;
}

.server-status-bar .status-indicator.online {
    color: #4ecdc4;
}

.server-status-bar .status-indicator.offline {
    color: #ff6b6b;
}

.server-status-bar .status-indicator.connecting {
    color: #ffd93d;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.server-status-bar .players-online {
    color: var(--text-primary);
    font-weight: 600;
}

/* Chat toggle button in status bar */
.chat-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 8px;
    margin-left: 8px;
    transition: all 0.2s ease;
}
.chat-toggle-btn:hover {
    border-color: var(--accent-color);
    background: rgba(255, 107, 53, 0.15);
}

/* Green outline when there are unread chat messages */
.chat-toggle-btn.has-unread {
    border-color: #4ecdc4;
    box-shadow: 0 0 6px rgba(78, 205, 196, 0.5);
    color: #4ecdc4;
}

/* === CHAT PANEL === */
.chat-panel {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: min(400px, 92vw);
    height: 350px;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}
.chat-tabs {
    display: flex;
    gap: 6px;
}
.chat-tab-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 3px 10px;
    transition: all 0.15s ease;
}
.chat-tab-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
.chat-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chat-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
}
.chat-message {
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
}
.chat-time {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-right: 4px;
}
.chat-author {
    color: var(--accent-color);
    font-weight: 600;
    margin-right: 4px;
}
.chat-text {
    color: var(--text-primary);
}
.chat-input-row {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid var(--border-color);
}
.chat-input {
    flex: 1;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 0.8rem;
    outline: none;
}
.chat-input:focus {
    border-color: var(--accent-color);
}
.chat-send-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* === MAIL TOGGLE BUTTON (status bar) === */
.mail-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 8px;
    margin-left: 4px;
    transition: all 0.2s ease;
    position: relative;
}
.mail-toggle-btn:hover {
    border-color: var(--accent-color);
    background: rgba(245, 158, 11, 0.15);
}
.mail-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* Mail blink animation for unread */
.mail-toggle-btn.has-unread {
    animation: mail-blink 2.5s ease-in-out infinite;
}

@keyframes mail-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

/* === MAIL PANEL === */
.mail-screen {
    position: fixed;
    top: var(--hud-height);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--primary-color);
}

/* Mail header */
.mail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--secondary-color);
}
.mail-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mail-header-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--elevated-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.mail-header-title {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}
.mail-header-sub {
    color: var(--text-muted);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
}
.mail-header-unread {
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(239, 68, 68, 0.2);
    color: #ff6060;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.mail-close-btn {
    background: rgba(39,39,42,0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 5px 10px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.mail-close-btn:active {
    opacity: 0.7;
}

/* Mail tabs */
.mail-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(24, 24, 27, 0.7);
}
.mail-tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.2s ease;
    position: relative;
}
.mail-tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(245, 158, 11, 0.05);
}
.mail-tab-btn:hover:not(.active) {
    color: var(--text-secondary);
}
.mail-tab-icon {
    font-size: 0.85rem;
    position: relative;
}
.mail-tab-count {
    position: absolute;
    top: -6px;
    right: -10px;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    background: #ef4444;
    color: #fff;
    font-size: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Mail list */
.mail-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--elevated-color) transparent;
}
.mail-list::-webkit-scrollbar {
    width: 4px;
}
.mail-list::-webkit-scrollbar-thumb {
    background: var(--elevated-color);
    border-radius: 2px;
}

.mail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 8px;
    color: var(--text-muted);
}
.mail-empty-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}
.mail-empty-text {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Mail item row */
.mail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(39, 39, 42, 0.3);
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
    width: 100%;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
}
.mail-item:hover {
    background: rgba(39, 39, 42, 0.3);
}
.mail-item.unread {
    background: rgba(245, 158, 11, 0.03);
}
.mail-item-dot {
    width: 8px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}
.mail-item-dot.unread::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-color);
    display: block;
}
.mail-item-content {
    flex: 1;
    min-width: 0;
}
.mail-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.mail-item-sender {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mail-item.unread .mail-item-sender {
    color: var(--accent-color);
}
.mail-item-date {
    font-size: 0.6rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.mail-item-bottom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.mail-item-subject {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.mail-item.unread .mail-item-subject {
    color: var(--text-primary);
}
.mail-item-attach-badge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
}
.mail-item-attach-badge.money {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-color);
}
.mail-item-attach-badge.item {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: #60a5fa;
}

/* Mail pagination */
.mail-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 12px;
    border-top: 1px solid rgba(39, 39, 42, 0.3);
}
.mail-page-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.15s ease;
}
.mail-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.mail-page-btn:not(:disabled):hover {
    border-color: var(--accent-color);
}
.mail-page-info {
    color: var(--text-muted);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

/* Mail bottom actions */
.mail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 4px;
    padding: 6px 8px;
    border-top: 1px solid var(--border-color);
    background: rgba(9, 9, 11, 0.8);
}
.mail-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: all 0.15s ease;
}
.mail-action-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}
.mail-action-btn.take-all {
    border-color: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}
.mail-action-btn.take-all:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}
.mail-action-btn.delete-all {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.mail-action-btn.delete-all:hover {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}
.mail-action-btn.mark-read {
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}
.mail-action-btn.mark-read:hover {
    border-color: #3b82f6;
    background: rgba(96, 165, 250, 0.1);
}
.mail-action-btn.compose {
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}
.mail-action-btn.compose:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}
.mail-action-icon {
    font-size: 0.9rem;
}

/* === MAIL READ MODAL === */
.mail-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
}
.mail-modal {
    width: min(420px, 94vw);
    max-height: 85vh;
    border-radius: 14px 14px 0 0;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}
.mail-modal-header-info {
    flex: 1;
    min-width: 0;
    padding-right: 12px;
}
.mail-modal-sender {
    font-size: 0.62rem;
    color: var(--accent-dim);
    letter-spacing: 0.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mail-modal-subject {
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mail-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--secondary-color);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.mail-modal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    border-bottom: 1px solid rgba(39, 39, 42, 0.3);
    background: rgba(9, 9, 11, 0.5);
}
.mail-modal-date {
    color: var(--text-muted);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
}
.mail-modal-tab-badge {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.mail-modal-tab-badge.system {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.mail-modal-tab-badge.auction {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
}
.mail-modal-tab-badge.sent {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}
.mail-modal-tab-badge.all {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-color);
}

/* Mail body */
.mail-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--elevated-color) transparent;
}
.mail-modal-body::-webkit-scrollbar {
    width: 4px;
}
.mail-modal-body::-webkit-scrollbar-thumb {
    background: var(--elevated-color);
    border-radius: 2px;
}
.mail-modal-text {
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

/* Attachment block inside modal */
.mail-attachment-block {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(39, 39, 42, 0.3);
    border: 1px solid var(--border-color);
}
.mail-attachment-label {
    color: var(--text-muted);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.mail-attachment-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mail-attachment-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.mail-attachment-icon-box.money {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid rgba(245, 158, 11, 0.35);
}
.mail-attachment-icon-box.item {
    background: rgba(96, 165, 250, 0.08);
    border: 2px solid rgba(96, 165, 250, 0.25);
}
.mail-attachment-info {}
.mail-attachment-amount {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: monospace;
}
.mail-attachment-item-name {
    font-size: 0.85rem;
    font-weight: 600;
}
.mail-attachment-sub {
    color: var(--text-muted);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 2px;
}
.mail-attachment-taken {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-style: italic;
    margin-top: 16px;
    text-align: center;
}

/* Modal actions */
.mail-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
}
.mail-modal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid;
}
.mail-modal-action-btn.take {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
}
.mail-modal-action-btn.take:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}
.mail-modal-action-btn.take:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.mail-modal-action-btn.delete {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}
.mail-modal-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}
.mail-modal-action-btn.reply {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}
.mail-modal-action-btn.reply:active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

/* === MAIL COMPOSE MODAL === */
.mail-compose-overlay {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
}
.mail-compose {
    width: min(400px, 92vw);
    max-height: 85vh;
    border-radius: 10px;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mail-compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--secondary-color);
}
.mail-compose-title {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.mail-compose-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--elevated-color);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.mail-compose-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mail-compose-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mail-compose-label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.mail-compose-input {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 0.78rem;
    outline: none;
    transition: border-color 0.15s ease;
}
.mail-compose-input:focus {
    border-color: var(--accent-color);
}
.mail-compose-textarea {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
    padding: 8px 10px;
    font-size: 0.78rem;
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: border-color 0.15s ease;
}
.mail-compose-textarea:focus {
    border-color: var(--accent-color);
}
/* Recipient search dropdown */
.mail-compose-recipients {
    position: relative;
}
.mail-recipient-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 0 0 5px 5px;
    z-index: 10;
    max-height: 120px;
    overflow-y: auto;
}
.mail-recipient-option {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.1s ease;
}
.mail-recipient-option:hover {
    background: var(--elevated-color);
}
.mail-recipient-level {
    color: var(--text-muted);
    font-size: 0.65rem;
}
/* Attachment section */
.mail-compose-attach-section {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: rgba(39, 39, 42, 0.2);
}
.mail-compose-attach-title {
    color: var(--text-secondary);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.mail-compose-attach-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.mail-compose-attach-row:last-child {
    margin-bottom: 0;
}
.mail-compose-attach-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    min-width: 60px;
}
.mail-compose-item-select {
    flex: 1;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 6px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    outline: none;
}
.mail-compose-currency-input {
    flex: 1;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 6px 8px;
    font-size: 0.72rem;
    outline: none;
    max-width: 100px;
}
.mail-compose-currency-input:focus {
    border-color: var(--accent-color);
}
/* Cost preview */
.mail-compose-cost {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 5px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.mail-compose-cost-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
}
.mail-compose-cost-amount {
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: monospace;
}
/* Send button */
.mail-compose-send-btn {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s ease;
}
.mail-compose-send-btn:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.2));
    border-color: #f59e0b;
}
.mail-compose-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === НИЖНЯЯ НАВИГАЦИЯ === */
.bottom-navbar {
    position: fixed;
    bottom: var(--statusbar-height, 32px);
    left: 0;
    right: 0;
    height: var(--bottom-navbar-height, 68px);
    background: rgba(9,9,11,0.96);
    border-top: 1px solid rgba(39,39,42,0.5);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    z-index: 999;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
    overflow: visible;
}

/* Верхняя amber‑линия (градиент) */
.nav-top-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(245,158,11,0.3), transparent);
    pointer-events: none;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 4px;
    background: transparent;
    border: none;
    color: #52525b;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 10px;
    position: relative;
    flex: 1;
    min-width: 0;
}

/* Индикатор сверху (подсветка активной вкладки) */
.nav-btn::before {
    display: none;
}

/* Иконка-бокс */
.nav-icon-box {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(39,39,42,0.6);
    font-size: 1.3rem;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.nav-btn:active .nav-icon-box {
    transform: scale(0.95);
}

/* Активное состояние по умолчанию */
.nav-btn.active .nav-icon-box {
    transform: scale(1.1);
}

/* Персонаж — фиолетовый */
.nav-btn-character.active::before {
    background: linear-gradient(to right, #7c3aed, #6d28d9);
    box-shadow: 0 2px 8px rgba(124,58,237,0.5);
}
.nav-btn-character.active .nav-icon-box {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: 0 4px 16px rgba(124,58,237,0.4);
}
.nav-btn-character.active {
    color: #a78bfa;
}

/* Меню — amber */
.nav-btn-menu.active::before,
#navMenu.active::before {
    background: linear-gradient(to right, #d97706, #f59e0b);
    box-shadow: 0 2px 8px rgba(245,158,11,0.5);
}
.nav-btn-menu.active .nav-icon-box,
#navMenu.active .nav-icon-box {
    background: rgba(245,158,11,0.15);
    border-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.nav-btn-menu.active,
#navMenu.active {
    color: #fbbf24;
}

/* Инвентарь — amber */
.nav-btn-inventory.active::before,
#navInventory.active::before {
    background: linear-gradient(to right, #d97706, #f59e0b);
    box-shadow: 0 2px 8px rgba(245,158,11,0.5);
}
.nav-btn-inventory.active .nav-icon-box,
#navInventory.active .nav-icon-box {
    background: rgba(245,158,11,0.15);
    border-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.nav-btn-inventory.active,
#navInventory.active {
    color: #fbbf24;
}

/* Popup-открытый инвентарь/меню — amber border */
.nav-btn.popup-open .nav-icon-box {
    background: rgba(245,158,11,0.15);
    border-color: #f59e0b;
    box-shadow: 0 4px 16px rgba(245,158,11,0.3);
}
.nav-btn.popup-open {
    color: #fbbf24;
}

.nav-btn.nav-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.nav-btn:not(.nav-disabled):hover .nav-icon-box {
    background: rgba(63,63,70,0.7);
}
.nav-btn:not(.nav-disabled):hover {
    color: #a1a1aa;
}

.nav-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    top: -6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

/* Экраны с навбаром — поднимаем bottom выше, чтобы навбар не накрывал контент */
.screen-with-navbar {
    bottom: var(--navbar-height) !important;
}

/* Кнопка выхода */
.btn-logout {
    background: linear-gradient(135deg, rgba(127,29,29,0.5), rgba(69,10,10,0.5)) !important;
    border-color: rgba(239,68,68,0.4) !important;
    color: #fca5a5 !important;
}

.btn-logout:active {
    opacity: 0.8 !important;
}

/* === УВЕДОМЛЕНИЯ (единый контейнер) === */
.toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: max-content;
    max-width: 90vw;
}

.toast {
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid;
    font-family: monospace;
    font-size: 0.85rem;
    white-space: nowrap;
    animation: toastSlideIn 0.25s ease-out;
    box-shadow: 0 4px 16px rgba(0,0,0,0.55);
    text-align: center;
}

.toast.info {
    background: rgba(15, 25, 40, 0.93);
    border-color: rgba(96, 165, 250, 0.45);
    color: #93c5fd;
}

.toast.success {
    background: rgba(6, 78, 59, 0.93);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.toast.error {
    background: rgba(127, 29, 29, 0.93);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.toast.balance-up {
    background: rgba(6, 78, 59, 0.93);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.toast.balance-down {
    background: rgba(127, 29, 29, 0.93);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.toast.reward {
    background: rgba(0, 0, 0, 0.92);
    border-color: var(--accent-color, #f39c12);
    color: #f39c12;
    font-weight: 700;
}

.toast.fade-out {
    animation: toastFadeOut 0.4s ease-in forwards;
}

@keyframes toastSlideIn {
    from { transform: translateY(-16px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-8px); }
}

/* Старые классы (обратная совместимость) */
.balance-notification-container {
    display: none; /* заменён .toast-container */
}

/* === SHOP RARITY FRAMES === */
.shop-item.rarity-frame-common   { border-color: var(--rarity-common); }
.shop-item.rarity-frame-uncommon { border-color: #60a5fa; box-shadow: 0 0 8px rgba(96,165,250,0.2); }
.shop-item.rarity-frame-rare     { border-color: #818cf8; box-shadow: 0 0 10px rgba(129,140,248,0.25); }
.shop-item.rarity-frame-epic     { border-color: #c084fc; box-shadow: 0 0 12px rgba(192,132,252,0.3); }
.shop-item.rarity-frame-legendary{ border-color: #f59e0b; box-shadow: 0 0 14px rgba(245,158,11,0.35); }

.shop-item.sold-out {
    opacity: 0.4;
    pointer-events: none;
    position: relative;
}

.shop-item .shop-stock {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: monospace;
}

.shop-item .shop-stock-warning {
    color: var(--danger-color);
}

/* Compact shop stock/price for inventory-style grid */
.shop-stock-compact {
    font-size: 0.55rem;
    color: var(--text-muted);
    position: absolute;
    top: 2px;
    right: 3px;
    font-family: monospace;
    line-height: 1;
    z-index: 2;
}
.shop-stock-compact.shop-stock-warning {
    color: var(--danger-color);
}
.shop-price-compact {
    font-size: 0.6rem;
    color: var(--accent-color);
    position: absolute;
    bottom: 1px;
    left: 0;
    right: 0;
    text-align: center;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    z-index: 2;
}
.item-cell.sold-out {
    opacity: 0.35;
    pointer-events: none;
}

/* Фильтры магазина */
.shop-filters-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
}

.shop-filter-btn {
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: rgba(39,39,42,0.5);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.shop-filter-btn:hover {
    border-color: var(--border-color);
    color: var(--text-primary);
}

.shop-filter-btn.active {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(245,158,11,0.1);
}

/* Rarity colors — base (subtle border hint) */
.shop-filter-btn.rarity-trash   { border-color: rgba(113,113,122,0.3); color: #71717a; }
.shop-filter-btn.rarity-poor    { border-color: rgba(161,161,170,0.3); color: #a1a1aa; }
.shop-filter-btn.rarity-normal  { border-color: rgba(59,130,246,0.3);  color: #6ba3f7; }
.shop-filter-btn.rarity-good    { border-color: rgba(167,139,250,0.3); color: #a78bfa; }
.shop-filter-btn.rarity-great   { border-color: rgba(245,158,11,0.3);  color: #f5b642; }
.shop-filter-btn.rarity-perfect { border-color: rgba(239,68,68,0.3);   color: #ef6868; }

/* Rarity colors — active */
.shop-filter-btn.rarity-trash.active   { border-color: #71717a; color: #71717a; background: rgba(113,113,122,0.15); }
.shop-filter-btn.rarity-poor.active    { border-color: #a1a1aa; color: #a1a1aa; background: rgba(161,161,170,0.15); }
.shop-filter-btn.rarity-normal.active  { border-color: #3b82f6; color: #3b82f6; background: rgba(59,130,246,0.15); }
.shop-filter-btn.rarity-good.active    { border-color: #a78bfa; color: #a78bfa; background: rgba(167,139,250,0.15); }
.shop-filter-btn.rarity-great.active   { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,0.15); }
.shop-filter-btn.rarity-perfect.active { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,0.15); }

.shop-level-sort {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

/* Цена в модале предмета */
.item-modal-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin: 8px 0;
    background: rgba(39,39,42,0.5);
    border: 1px solid rgba(63,63,70,0.5);
    border-radius: 6px;
}

.item-modal-price-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.item-modal-price-val {
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: 700;
    font-family: monospace;
}

/* Кнопка Купить */
.item-act-buy {
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(16,185,129,0.1)) !important;
    border-color: rgba(34,197,94,0.5) !important;
    color: #6ee7b7 !important;
}

.item-act-buy:hover {
    background: linear-gradient(135deg, rgba(34,197,94,0.35), rgba(16,185,129,0.2)) !important;
}

/* Магазин — клик на карточку */
.shop-item {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--secondary-color);
    min-height: 140px;
    text-align: center;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.shop-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.shop-item-name {
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.2;
    word-break: break-word;
}

.shop-item-rarity {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop-item-type {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.shop-item-level {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.shop-item-level-warning {
    font-size: 0.7rem;
    color: var(--danger-color);
}

.shop-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: monospace;
}

.shop-item-price.sell-price {
    color: #6ee7b7;
}

.shop-item-params {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
}

.shop-item-param {
    padding: 1px 0;
}

.shop-item-param strong {
    color: var(--text-primary);
}

.shop-item-actions {
    width: 100%;
    margin-top: auto;
}

.btn-sell-item {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(34,197,94,0.5);
    border-radius: 4px;
    background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(16,185,129,0.1));
    color: #6ee7b7;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-sell-item:hover {
    background: linear-gradient(135deg, rgba(34,197,94,0.35), rgba(16,185,129,0.2));
}

.shop-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    padding: 30px 0;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   AUCTION / MARKETPLACE PANEL
   ═══════════════════════════════════════════════════════════ */

.auction-screen {
    position: fixed;
    top: var(--hud-height);
    bottom: var(--navbar-height);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--primary-color);
}

/* Header */
.auction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.auction-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.auction-header-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: rgba(202,138,4,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.auction-header h3 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
    letter-spacing: 0.06em;
}
.auction-header .sub {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
}
.auction-close-btn {
    background: rgba(39,39,42,0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 5px 10px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.auction-close-btn:active {
    opacity: 0.7;
}

/* Tabs */
.auction-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: rgba(9,9,11,0.4);
}
.auction-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 10px 0;
    cursor: pointer;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.auction-tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(255,255,255,0.03);
}

/* ─── BUY TAB ─────────────────────────────────── */

.auction-buy-tab {
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

/* Search */
.auction-search-row {
    padding: 10px 12px 6px;
    flex-shrink: 0;
}
.auction-search-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(39,39,42,0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    box-sizing: border-box;
}
.auction-search-input::placeholder {
    color: var(--text-secondary);
}

/* Categories horizontal scroll */
.auction-categories {
    display: flex;
    gap: 6px;
    padding: 4px 12px 8px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.auction-categories::-webkit-scrollbar { display: none; }

.auction-cat-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 16px;
    background: rgba(39,39,42,0.4);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.7rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.auction-cat-btn.active {
    background: rgba(202,138,4,0.2);
    border-color: rgba(202,138,4,0.5);
    color: #fbbf24;
}
.auction-cat-icon { font-size: 0.8rem; }

/* Filters row */
.auction-filters {
    display: flex;
    gap: 6px;
    padding: 0 12px 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.auction-filter-select {
    padding: 4px 8px;
    background: rgba(39,39,42,0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.65rem;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}

/* Results count */
.auction-buy-count {
    padding: 0 12px 4px;
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
    flex-shrink: 0;
}

/* Item list */
.auction-buy-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.auction-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(63,63,70,0.3);
    transition: background 0.15s;
}
.auction-item-row:active {
    background: rgba(255,255,255,0.03);
}

.auction-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: rgba(39,39,42,0.5);
    border: 1px solid var(--border-color);
}
.auction-item-icon.small {
    width: 34px;
    height: 34px;
    font-size: 16px;
    border-radius: 6px;
}

.auction-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.auction-item-name {
    color: var(--text-primary);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auction-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.auction-rarity-badge {
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(39,39,42,0.5);
    border: 1px solid var(--border-color);
    letter-spacing: 0.04em;
}
.auction-level-badge {
    font-size: 0.6rem;
    color: var(--text-secondary);
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(39,39,42,0.3);
    border: 1px solid rgba(63,63,70,0.4);
}
.auction-item-slot {
    font-size: 0.6rem;
    color: var(--text-secondary);
}
.auction-item-seller {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.65rem;
    color: var(--text-secondary);
}
.auction-time-left {
    font-size: 0.6rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.auction-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.auction-item-price {
    font-size: 0.85rem;
    color: #fbbf24;
    font-weight: 600;
    white-space: nowrap;
}
.auction-item-price-sm {
    font-size: 0.7rem;
    color: #fbbf24;
    white-space: nowrap;
}

.auction-buy-btn {
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.4);
    color: #6ee7b7;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.auction-buy-btn:active {
    background: rgba(34,197,94,0.3);
    transform: scale(0.96);
}

.auction-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

/* Pagination */
.auction-buy-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px;
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.auction-buy-pagination button {
    background: rgba(39,39,42,0.5);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
}

/* ─── SELL TAB ─────────────────────────────────── */

.auction-sell-tab {
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    padding: 12px;
}

/* Item picker */
.auction-sell-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
    margin-bottom: 6px;
}

.auction-pick-item-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(39,39,42,0.3);
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}
.auction-pick-item-btn:active { transform: scale(0.99); }
.auction-pick-item-btn.has-item {
    border-style: solid;
}
.auction-pick-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(39,39,42,0.5);
    border: 1px dashed rgba(63,63,70,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.auction-pick-info {
    flex: 1;
    min-width: 0;
}
.auction-pick-name {
    color: var(--text-primary);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auction-pick-chevron {
    color: var(--text-secondary);
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* Price input */
.auction-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(39,39,42,0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 6px;
}
.auction-price-icon { font-size: 1rem; flex-shrink: 0; }
.auction-price-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fbbf24;
    font-size: 1.1rem;
    outline: none;
    -moz-appearance: textfield;
}
.auction-price-input::-webkit-outer-spin-button,
.auction-price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.auction-price-suffix {
    color: var(--text-secondary);
    font-size: 0.7rem;
    flex-shrink: 0;
}

/* Duration buttons */
.auction-dur-row {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.auction-dur-btn {
    flex: 1;
    padding: 8px 4px;
    border-radius: 6px;
    background: rgba(39,39,42,0.3);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.auction-dur-btn.active {
    background: rgba(202,138,4,0.15);
    border-color: rgba(202,138,4,0.4);
    color: #fbbf24;
}
.auction-dur-label { font-size: 0.65rem; }
.auction-dur-comm { font-size: 0.55rem; opacity: 0.7; }
.auction-dur-comm.free { color: #6ee7b7; }
.auction-dur-comm.paid { color: #fbbf24; }

/* Commission calc */
.auction-comm-box {
    margin-top: 8px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(9,9,11,0.4);
    border: 1px solid rgba(63,63,70,0.3);
}
.auction-comm-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.commission-loss { color: #ef4444; }
.auction-comm-total {
    display: flex;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px solid rgba(63,63,70,0.3);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.auction-proceeds {
    color: #6ee7b7;
    font-size: 0.9rem;
    font-weight: 600;
}

/* List button */
.auction-list-btn {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    background: rgba(39,39,42,0.3);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
    opacity: 0.4;
}
.auction-list-btn.active {
    background: rgba(34,197,94,0.15);
    border-color: rgba(34,197,94,0.4);
    color: #6ee7b7;
    opacity: 1;
}
.auction-list-btn:active:not(:disabled) {
    transform: scale(0.99);
}

/* My listings */
.auction-my-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0 8px;
    border-top: 1px solid rgba(63,63,70,0.3);
    margin-top: 12px;
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
}
.auction-my-count {
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(39,39,42,0.5);
    color: var(--accent-color);
    font-size: 0.6rem;
}
.auction-my-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(39,39,42,0.2);
    border: 1px solid rgba(63,63,70,0.3);
    margin-bottom: 6px;
}
.auction-my-info {
    flex: 1;
    min-width: 0;
}
.auction-my-name {
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.auction-my-meta {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}
.auction-my-empty {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 16px 0;
}

.auction-cancel-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    cursor: pointer;
    font-size: 0.7rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.auction-cancel-btn:active {
    background: rgba(239,68,68,0.3);
    transform: scale(0.9);
}

/* ─── INVENTORY MODAL ─────────────────────────── */

#auctionInvModal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.auction-inv-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
}
.auction-inv-content {
    position: relative;
    width: min(420px, 94vw);
    max-height: 75vh;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.auction-inv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}
.auction-inv-title {
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
}
.auction-inv-subtitle {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-top: 2px;
}
.auction-inv-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(63,63,70,0.5);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Inv tabs */
.auction-inv-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(9,9,11,0.3);
}
.auction-inv-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.65rem;
    transition: all 0.15s;
}
.auction-inv-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(255,255,255,0.03);
}
.auction-inv-tab-label { font-size: 0.6rem; }
.auction-inv-tab-count { font-size: 0.55rem; opacity: 0.6; }

/* Grid */
.auction-inv-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.auction-inv-slot {
    aspect-ratio: 1;
    border-radius: 8px;
    background: rgba(39,39,42,0.3);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.auction-inv-slot:active {
    transform: scale(0.94);
}
.auction-inv-slot-icon { font-size: 1.2rem; }
.auction-inv-slot-name {
    font-size: 0.5rem;
    color: var(--text-primary);
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
}
.auction-inv-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 30px 0;
}

/* ============================================================
   CONFIRM MODAL — universal confirmation dialog
   ============================================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(4px);
    animation: confirm-fade-in 0.15s ease;
}

@keyframes confirm-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.confirm-box {
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: var(--radius-lg, 12px);
    padding: 24px 20px 20px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    animation: confirm-slide-up 0.2s ease;
}

@keyframes confirm-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.confirm-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.confirm-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 0.9rem;
    color: var(--text-secondary, #aaa);
    margin-bottom: 20px;
    line-height: 1.4;
}

.confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.confirm-btn-ok {
    background: var(--accent-color, #f59e0b) !important;
    color: #000 !important;
    font-weight: 700;
    min-height: 44px;
    border: none;
    border-radius: var(--radius-md, 8px);
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.15s;
}
.confirm-btn-ok:active {
    opacity: 0.8;
}

.confirm-btn-cancel {
    background: transparent !important;
    color: var(--text-secondary, #aaa) !important;
    border: 1px solid var(--border-color, #333) !important;
    min-height: 44px;
    border-radius: var(--radius-md, 8px);
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.15s;
}
.confirm-btn-cancel:active {
    opacity: 0.7;
}

/* Danger variant */
.confirm-btn-ok.confirm-danger {
    background: #ef4444 !important;
    color: #fff !important;
}

/* === Item icon images === */
.item-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

/* In item-icon cells (inventory / equipment slots) */
.item-icon .item-icon-img,
.item-cell .item-icon .item-icon-img {
    width: 100%;
    height: 100%;
    padding: 6px;
    box-sizing: border-box;
    object-fit: contain;
}

/* In modal hero-icon (120×120) */
.item-hero-icon .item-icon-img {
    width: 90px;
    height: 90px;
    padding: 0;
}

/* In small equip slot cells */
.equip-slot-cell .item-icon .item-icon-img {
    padding: 3px;
}

/* Legacy compat */
.item-svg-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
