/* components.css — военно-тактический дизайн (zinc + amber) */

/* === КНОПКИ === */
.btn {
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, opacity 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: var(--text-primary);
}

input,
textarea {
    text-transform: none;
    letter-spacing: normal;
    font-variant: normal;
    font-variant-caps: normal;
}

input.btn,
textarea.btn {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-variant: normal;
    font-variant-caps: normal;
    font-feature-settings: normal;
    font-weight: 500;
}

input::placeholder,
textarea::placeholder {
    text-transform: none;
    letter-spacing: normal;
}

.btn-primary {
    background: linear-gradient(135deg, #92400e, #78350f);
    color: #fef3c7;
    border-color: var(--border-accent);
}

.btn-primary:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:active {
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.btn-success {
    background: linear-gradient(135deg, #065f46, #064e3b);
    color: #d1fae5;
    border-color: rgba(16,185,129,0.4);
}

.btn-success:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.btn-danger {
    background: linear-gradient(135deg, #7f1d1d, #6b1212);
    color: #fee2e2;
    border-color: rgba(239,68,68,0.4);
}

.btn-danger:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.btn-warning {
    background: linear-gradient(135deg, #78350f, #92400e);
    color: #fef3c7;
    border-color: var(--border-accent);
}

.btn-warning:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.btn-small {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: 36px;
}

.btn-future {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.btn-future:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 0;
    top: 0;
}

.btn-close:active {
    color: var(--accent-color);
}

/* === ТАБЫ === */
.character-tabs, .shop-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-btn:active {
    color: var(--text-primary);
}

/* ── Scrollable tab/filter wrapper with edge fade & arrows ── */
.scroll-tabs-wrapper {
    position: relative;
    margin: var(--spacing-sm) 0;
}
.scroll-tabs-wrapper .scroll-tabs-inner {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 0 18px;
    scroll-behavior: smooth;
}
.scroll-tabs-wrapper .scroll-tabs-inner::-webkit-scrollbar { display: none; }

/* Edge fade masks */
.scroll-tabs-wrapper::before,
.scroll-tabs-wrapper::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 22px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.25s;
}
.scroll-tabs-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary, #18181b) 30%, transparent);
}
.scroll-tabs-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary, #18181b) 30%, transparent);
}
.scroll-tabs-wrapper.can-scroll-left::before  { opacity: 1; }
.scroll-tabs-wrapper.can-scroll-right::after   { opacity: 1; }

/* Scroll arrows */
.scroll-tabs-arrow {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(39,39,42,0.85);
    border: 1px solid rgba(113,113,122,0.4);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 10px;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.scroll-tabs-arrow.left  { left: 0; }
.scroll-tabs-arrow.right { right: 0; }
.scroll-tabs-wrapper.can-scroll-left  > .scroll-tabs-arrow.left  { opacity: 1; pointer-events: auto; }
.scroll-tabs-wrapper.can-scroll-right > .scroll-tabs-arrow.right { opacity: 1; pointer-events: auto; }

.shop-traders,
.shop-subtabs {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: nowrap;
}

.shop-subtabs {
    border-bottom: 1px dashed var(--border-accent);
    padding-bottom: 6px;
}

.character-tab-button {
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.character-tab-button.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.shop-tab-button {
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.shop-tab-button.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* === МОДАЛЬНЫЕ ОКНА === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    padding: var(--spacing-md);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(145deg, #18181b, #09090b);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    max-width: 90%;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
}

.item-modal {
    max-width: 520px;
    position: relative;
    overflow: hidden;
}

/* Corner accent decorations */
.item-modal::before,
.item-modal::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
    z-index: 1;
}
.item-modal::before {
    top: 0; left: 0;
    border-top: 2px solid rgba(245, 158, 11, 0.5);
    border-left: 2px solid rgba(245, 158, 11, 0.5);
    border-top-left-radius: var(--radius-lg, 12px);
}
.item-modal::after {
    top: 0; right: 0;
    border-top: 2px solid rgba(245, 158, 11, 0.5);
    border-right: 2px solid rgba(245, 158, 11, 0.5);
    border-top-right-radius: var(--radius-lg, 12px);
}

.item-modal-head {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.item-modal-level {
    padding: 4px 10px;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 700;
}

.item-modal-rarity {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.item-modal-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.item-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.item-hero-icon {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    font-size: 3rem;
    border-radius: var(--radius-lg);
}

.item-hero-name {
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
}

.item-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-sm);
}

.item-stat-line {
    display: flex;
    justify-content: space-between;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 0.85rem;
}

.item-stat-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.item-stat-icon {
    width: 18px;
    text-align: center;
}

.item-stat-better {
    border-color: var(--success-color, #2ecc71);
}

.item-stat-total {
    border-color: var(--accent-color, #f39c12);
    background: linear-gradient(90deg, rgba(243,156,18,0.15), transparent);
    font-weight: 700;
}

.item-weapon-type {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    font-weight: 600;
    color: var(--text-secondary);
}

.item-slot-label {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: var(--radius-sm);
    background: rgba(245,158,11,0.06);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--accent-color);
}

.item-stat-delta {
    color: var(--success-color, #2ecc71);
    font-weight: 700;
    margin-left: 6px;
}

.item-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.item-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-sm);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
}

/* === ОБОРУДОВАНИЕ === */
.equipment-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.equipment-option {
    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;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.equipment-option:active {
    border-color: var(--accent-color);
}

.equipment-option-name {
    color: var(--text-primary);
    font-weight: 600;
}

.equipment-option-stats {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* === РЕЙДЫ === */
.raid-option {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 1px solid var(--border-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.raid-option:active {
    border-color: var(--border-accent);
}

.raid-option.difficulty-1 {
    border-left: 3px solid var(--success-color);
}

.raid-option.difficulty-2 {
    border-left: 3px solid var(--warning-color);
}

.raid-option.difficulty-3 {
    border-left: 3px solid var(--danger-color);
}

.raid-option h3 {
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 1rem;
    font-weight: 700;
}

.raid-option p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: var(--spacing-xs) 0;
    line-height: 1.3;
}

.raid-option .difficulty {
    color: var(--accent-color);
    font-weight: 600;
    margin-top: var(--spacing-xs);
}

/* === ВРАГИ === */
.enemy {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 0.9rem;
}

.enemy.defeated {
    opacity: 0.5;
}

.enemy span {
    flex: 1;
    text-align: center;
    color: var(--text-primary);
}

.enemy button {
    padding: 6px 12px;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* === СООБЩЕНИЯ === */
.message {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    animation: slideIn 0.2s ease;
    font-size: 0.85rem;
    border-left: 2px solid transparent;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.info {
    background-color: var(--secondary-color);
    border-left-color: var(--info);
    color: var(--info);
}

.message.success {
    background-color: var(--secondary-color);
    border-left-color: var(--success-color);
    color: var(--success-color);
}

.message.warning {
    background-color: var(--secondary-color);
    border-left-color: var(--warning-color);
    color: var(--warning-color);
}

.message.error {
    background-color: var(--secondary-color);
    border-left-color: var(--danger-color);
    color: var(--danger-color);
}

/* === ITEM RARITY === */
.inventory-item.common,
.shop-item.common {
    border-color: var(--rarity-common);
}

.inventory-item.uncommon,
.shop-item.uncommon {
    border-color: var(--rarity-uncommon);
}

.inventory-item.rare,
.shop-item.rare {
    border-color: var(--rarity-rare);
}

.inventory-item.epic,
.shop-item.epic {
    border-color: var(--rarity-epic);
}

.inventory-item.legendary,
.shop-item.legendary {
    border-color: var(--rarity-legendary);
}

.shop-empty {
    padding: 20px;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--text-secondary);
    width: 100%;
}

/* === ITEM QUALITY (new system) === */
.inventory-item.trash,
.shop-item.trash,
.equipment-slot-card .trash {
    border-color: var(--quality-trash);
}

.inventory-item.poor,
.shop-item.poor,
.equipment-slot-card .poor {
    border-color: var(--quality-poor);
}

.inventory-item.normal,
.shop-item.normal,
.equipment-slot-card .normal {
    border-color: var(--quality-normal);
}

.inventory-item.good,
.shop-item.good,
.equipment-slot-card .good {
    border-color: var(--quality-good);
}

.inventory-item.great,
.shop-item.great,
.equipment-slot-card .great {
    border-color: var(--quality-great);
}

.inventory-item.perfect,
.shop-item.perfect,
.equipment-slot-card .perfect {
    border-color: var(--quality-perfect);
}

/* Quality text colors */
.item-rarity.trash { color: var(--quality-trash); }
.item-rarity.poor { color: var(--quality-poor); }
.item-rarity.normal { color: var(--quality-normal); }
.item-rarity.good { color: var(--quality-good); }
.item-rarity.great { color: var(--quality-great); }
.item-rarity.perfect { color: var(--quality-perfect); }

.inventory-item.equipped,
.shop-item.equipped {
    background-color: var(--secondary-color);
    border-color: var(--accent-color);
}

.inventory-item.empty {
    opacity: 0.5;
    border-style: dashed;
}

/* === ФОРМА АУТЕНТИФИКАЦИИ === */
.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 300px;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
}

.auth-form > button {
    width: 100%;
    margin-top: 8px;
}

.caps-warning {
    color: var(--warning-color);
    font-size: 0.85rem;
    margin-top: 4px;
    text-align: left;
}

.input-with-toggle {
    position: relative;
    width: 100%;
}

.input-with-toggle .btn {
    width: 100%;
    margin: 0;
    padding-right: 40px;
    text-transform: none;
    letter-spacing: normal;
}

.btn-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: color 0.2s ease;
    z-index: 1;
}

.btn-eye:hover {
    color: var(--text-primary);
}

.btn-eye:active {
    color: var(--accent-color);
}

/* === САФАРИ === */

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.location-card {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.location-card:hover {
    border-color: var(--border-accent);
}

.location-start-btn {
    touch-action: manipulation;
}

.location-card-image {
    font-size: 4rem;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 8px;
    min-height: 48px;
}

/* Картинка локации в селекторе */
.location-card-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 0;
}

.location-card-emoji {
    font-size: 4rem;
    display: block;
    text-align: center;
}

.location-card h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.location-card p {
    color: var(--text-secondary);
    margin: 8px 0;
    font-size: 0.9rem;
}

.location-level {
    color: var(--info);
    font-weight: bold;
}

.location-reward {
    color: var(--success-color);
    font-weight: bold;
}

/* Safari прогресс */
.safari-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.safari-location-name {
    font-size: 1.8rem;
    color: var(--accent-color);
    text-align: center;
    margin: 0;
}

.safari-progress-bar {
    width: 100%;
    height: 30px;
    background-color: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--warning-color));
    width: 0%;
    transition: width 0.3s ease;
}

.safari-step-counter {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    margin-top: -20px;
}

/* ── Safari Outcome Banner ── */
.safari-outcome-banner {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9000;
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    min-width: 200px;
    max-width: 80vw;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    animation: safariOutcomePopIn 0.25s ease-out;
}
.safari-outcome-success {
    background: linear-gradient(135deg, rgba(46,204,113,0.2), rgba(46,204,113,0.05));
    border: 1px solid rgba(46,204,113,0.5);
}
.safari-outcome-fail {
    background: linear-gradient(135deg, rgba(231,76,60,0.2), rgba(231,76,60,0.05));
    border: 1px solid rgba(231,76,60,0.5);
}
.safari-outcome-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.safari-outcome-icon {
    font-size: 1.1rem;
}
.safari-outcome-text {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.safari-outcome-success .safari-outcome-text { color: var(--success-color); }
.safari-outcome-fail .safari-outcome-text { color: var(--error-color); }

.safari-outcome-notifs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    margin-top: 8px;
}
.safari-outcome-notif {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.2);
    padding: 2px 8px;
    border-radius: 4px;
}
.safari-outcome-fade {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes safariOutcomePopIn {
    from { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

/* ── Safari Outcome Card (full event result screen) ── */
.safari-outcome-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 12px 20px;
    animation: safariCardSlideIn 0.3s ease-out;
}
.safari-outcome-card--success {
    border-top: 3px solid rgba(46,204,113,0.6);
}
.safari-outcome-card--fail {
    border-top: 3px solid rgba(231,76,60,0.6);
}
.safari-outcome-card__image {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 4/3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.08);
}
.safari-outcome-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.safari-outcome-card__emoji {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: rgba(0,0,0,0.15);
}
.safari-outcome-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.safari-outcome-card__header--success { color: var(--success-color); }
.safari-outcome-card__header--fail { color: var(--error-color); }
.safari-outcome-card__header--stepback { color: var(--warning-color, #f39c12); }

.safari-outcome-card__event-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}
.safari-outcome-card__text {
    font-size: 0.95rem;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.5;
    padding: 0 4px;
    max-width: 340px;
}
.safari-outcome-card__notifs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
}
.safari-outcome-card__notif {
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.25);
    padding: 3px 10px;
    border-radius: 6px;
}
.safari-outcome-card__continue {
    width: 100%;
    max-width: 340px;
    min-height: 48px;
    margin-top: 4px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark, #1a6b3a));
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: opacity 0.15s;
}
.safari-outcome-card__continue:active {
    opacity: 0.8;
}
@keyframes safariCardSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Safari Trade Modal (mini-shop 4×4) ── */
.safari-trade-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    padding: 16px;
    animation: safariCardSlideIn 0.25s ease-out;
}
.safari-trade-content {
    background: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}
.safari-trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.safari-trade-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-primary);
}
.safari-trade-currency {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    white-space: nowrap;
}
.safari-trade-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 14px;
}
.safari-trade-slot {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.12s, box-shadow 0.12s;
}
.safari-trade-slot--empty {
    background: rgba(255,255,255,0.03);
    border: 1px dashed rgba(255,255,255,0.08);
}
.safari-trade-slot--filled {
    background: rgba(255,255,255,0.06);
    border: 2px solid #666;
    cursor: pointer;
    padding: 4px 2px;
}
.safari-trade-slot--filled:active {
    transform: scale(0.93);
}
.safari-trade-slot--bought {
    background: rgba(46,204,113,0.10);
    border: 2px solid rgba(46,204,113,0.3);
    cursor: default;
}
.safari-trade-bought-label {
    font-size: 1.6rem;
}
.safari-trade-icon {
    width: 54%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
}
.safari-trade-icon--star {
    font-size: 1.7rem;
    filter: drop-shadow(0 0 4px gold);
}
.safari-trade-icon .item-svg-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.safari-trade-qty {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.5);
    padding: 1px 3px;
    border-radius: 3px;
    line-height: 1;
}
.safari-trade-name {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.15;
    max-height: 2.3em;
    overflow: hidden;
    margin-top: 2px;
}
.safari-trade-price {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-top: 1px;
    white-space: nowrap;
}
.safari-trade-close {
    width: 100%;
    min-height: 44px;
    font-size: 1rem;
}

/* ── Safari Health Bar ── */
.safari-health-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 2px;
    padding: 0 4px;
}
.safari-health-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 70px;
}
.safari-health-track {
    flex: 1;
    height: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 5px;
    overflow: hidden;
}
.safari-health-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    transition: width 0.4s ease, background 0.4s ease;
}
.safari-health-fill--medium {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}
.safari-health-fill--low {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

/* Событие */
.safari-event {
    background-color: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    width: 100%;
}

.event-title {
    color: var(--accent-color);
    font-size: 1.4rem;
    margin: 0 0 15px 0;
    text-align: center;
}

.event-description {
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.event-image {
    text-align: center;
    font-size: 6rem;
    margin: 20px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
}

/* Картинка события сафари */
.event-img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Фолбэк-эмодзи если картинка не загрузилась */
.event-emoji-big {
    font-size: 6rem;
    line-height: 1;
}

/* Опции ответов */
.safari-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

.btn-safari-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 18px;
    background-color: var(--primary-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.btn-safari-option:hover {
    background-color: var(--secondary-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.2);
}

.btn-safari-option:active {
    opacity: 0.85;
}

.option-text {
    flex: 1;
    text-align: left;
}

.option-chance {
    color: var(--success-color);
    font-weight: bold;
    font-size: 0.9rem;
}

/* === ЭКРАН НАГРАДЫ === */
.reward-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    height: 100%;
    text-align: center;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(52, 152, 219, 0.1));
    border-radius: var(--radius-lg);
    padding: 40px 20px;
}

.reward-title {
    font-size: 2.5rem;
    color: var(--success-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: bounce 0.6s ease;
}

.reward-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.reward-details {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: center;
}

.reward-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background-color: var(--secondary-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
}

.reward-icon {
    font-size: 2rem;
}

.reward-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--success-color);
}

.reward-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1rem;
    min-width: 250px;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* === ЭКИПИРОВКА === */
.equipment-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.equipment-slot-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--secondary-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.equipment-slot-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.slot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background-color: rgba(74, 144, 226, 0.1);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.slot-icon {
    font-size: 1.5rem;
}

.slot-label {
    flex: 1;
}

.slot-content {
    padding: 15px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.equipped-item,
.empty-slot {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-slot {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
}

.equipment-display {
    padding: 20px;
}

.item-params {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 5px 0;
}

/* === МОДАЛЬНОЕ ОКНО === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background-color: var(--primary-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.btn-close-modal:hover {
    color: var(--text-primary);
}

.modal-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-item:hover {
    border-color: var(--accent-color);
    background-color: rgba(74, 144, 226, 0.05);
}

.modal-item .item-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.modal-item .item-params {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 5px 0;
}

.modal-item .param {
    display: flex;
    justify-content: space-between;
}

.modal-item .param span:last-child {
    color: var(--success-color);
    font-weight: 600;
}

/* === ИНВЕНТАРЬ С СЛОТАМИ === */
.inventory-slot-section {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.inventory-slot-header {
    background-color: rgba(74, 144, 226, 0.1);
    padding: 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.slot-icon {
    font-size: 1.3rem;
}

.inventory-slot-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding: 15px;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 0;
    width: 100%;
    min-height: 220px;
    align-content: start;
}

.inventory-grid .item-cell {
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: var(--spacing-xs);
    box-sizing: border-box;
    overflow: clip;
}

/* Storage grids — explicit 4 columns, 12px gap (overrides any responsive breakpoints) */
#storageContainer.inventory-grid,
#storageNavModalContainer.inventory-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Storage item cells — square, zero min-height (prevents 128px base from leaking) */
#storageContainer.inventory-grid .item-cell,
#storageNavModalContainer.inventory-grid .item-cell {
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: 100%;
    box-sizing: border-box;
    overflow: clip;
}

/* item-icon sizing inherited from .item-cell .item-icon (inset: 2px = 4px smaller than cell) */

.item-cell.item-placeholder {
    border: 1px dashed var(--border-color);
    background: rgba(39,39,42,0.3);
    opacity: 0.5;
    min-height: 0;
    cursor: default;
}

/* Highlight items that are stronger than currently equipped */
.item-cell.item-stronger {
    border: 2px solid var(--success-color) !important;
    box-shadow: inset 0 0 8px rgba(76, 175, 80, 0.35);
    position: relative;
}

/* Drag & drop styles */
.item-cell.item-dragging {
    opacity: 0.3;
    transform: scale(0.93);
    transition: opacity 0.1s, transform 0.1s;
}
.item-cell.item-drop-target {
    border: 2px dashed #3b82f6 !important;
    box-shadow: 0 0 14px rgba(59, 130, 246, 0.7) !important;
    background: rgba(59, 130, 246, 0.15) !important;
    transform: scale(1.06);
    transition: transform 0.1s;
}
.item-cell.item-selected {
    outline: 2px solid #22c55e;
    outline-offset: -2px;
}

/* Floating ghost clone shown while dragging */
.drag-ghost-clone {
    position: fixed !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    opacity: 0.88 !important;
    transform: scale(1.12) rotate(3deg) !important;
    box-shadow: 0 10px 32px rgba(0,0,0,0.65) !important;
    cursor: grabbing !important;
    transition: none !important;
}

/* Draggable cursor for inventory items */
.item-cell[data-item-id] {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    -webkit-touch-callout: none;
}

.item-cell.item-stronger::after {
    content: '⬆';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    color: var(--success-color);
}

.empty-slot-item {
    border: 2px dashed var(--border-color) !important;
    background-color: rgba(0, 0, 0, 0.2) !important;
    opacity: 0.6;
}

.empty-slot-item .item-text-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-small:active {
    opacity: 0.8;
}

/* === УРОВЕНЬ ПРЕДМЕТА === */
.item-level {
    font-size: 0.7rem;
    color: var(--accent-color);
    font-weight: 700;
    background: rgba(255, 107, 53, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 4px;
}

.item-level-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--accent-color);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    min-width: 18px;
    text-align: center;
}

.item-level-warning {
    font-size: 0.7rem;
    color: var(--danger-color);
    font-weight: 600;
    margin-top: 4px;
}

/* Modal item disabled state */
.modal-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* === SAFARI REWARD NOTIFICATION === */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

.safari-reward-notification {
    font-size: 0.95rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--accent-color);
}

/* === МОБИЛЬНЫЕ УЛУЧШЕНИЯ === */
@media (max-width: 480px) {
    /* Увеличенные области касания */
    .btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .btn-small {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .tab-btn {
        min-height: 40px;
        padding: 10px 14px;
    }
    
    /* Улучшенные карточки предметов */
    .inventory-item, .shop-item {
        padding: 12px;
        position: relative;
    }
    
    .item-name {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .item-rarity {
        font-size: 0.65rem;
    }
    
    .item-action {
        margin-top: 8px;
    }
    
    .item-action button {
        width: 100%;
        padding: 10px;
    }
    
    /* Улучшенные слоты снаряжения */
    .equipment-slot-card {
        padding: 12px;
    }
    
    .slot-header {
        font-size: 0.85rem;
    }
    
    /* Улучшенная читаемость модалок */
    .modal-content {
        padding: 16px;
        max-height: 90vh;
        width: 95vw;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    /* Safari события */
    .safari-event-options .btn {
        padding: 14px 12px;
        font-size: 0.85rem;
    }
    
    .option-text {
        font-size: 0.85rem;
    }
    
    .option-chance {
        font-size: 0.75rem;
    }
}

/* Улучшение для очень маленьких экранов */
@media (max-width: 360px) {
    .inventory-slot-items {
        grid-template-columns: 1fr;
    }
    
    .equipment-slots-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* === АДМИН-ПАНЕЛЬ === */
.admin-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--secondary-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.admin-stats span {
    color: var(--text-secondary);
}

.admin-stats strong {
    color: var(--accent-color);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
    overflow-y: auto;
}

.admin-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.admin-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--secondary-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-user-card:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.03);
}

.admin-user-card:active {
    transform: scale(0.99);
}

.admin-user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.admin-user-meta {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.admin-user-level {
    color: var(--accent-color);
}

.admin-user-gold {
    color: var(--warning-color);
}

.admin-user-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.admin-user-status.active {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
}

.admin-user-status.inactive {
    background: rgba(220, 53, 69, 0.2);
    color: var(--danger-color);
}

/* Модальное окно пользователя (админ) */
.admin-user-modal {
    max-width: 400px;
}

.admin-user-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.admin-detail-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.admin-detail-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

.admin-hash {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-user-actions .btn-danger {
    width: 100%;
}

/* === ДРОПДАУН ИНВЕНТАРЯ (над кнопкой Инвентарь) === */
.inv-dropdown {
    position: fixed;
    bottom: 112px; /* над navbar (68px высота + 32px отступ + 12px зазор) */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(9,9,11,0.98);
    border: 1px solid rgba(63,63,70,0.7);
    border-radius: 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1100;
    min-width: 230px;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(245,158,11,0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Угловые amber-акценты */
.inv-dropdown-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
    z-index: 1;
}
.inv-dropdown-corner-tl {
    top: 0; left: 0;
    border-top: 1.5px solid rgba(245,158,11,0.45);
    border-left: 1.5px solid rgba(245,158,11,0.45);
    border-radius: 14px 0 0 0;
}
.inv-dropdown-corner-tr {
    top: 0; right: 0;
    border-top: 1.5px solid rgba(245,158,11,0.45);
    border-right: 1.5px solid rgba(245,158,11,0.45);
    border-radius: 0 14px 0 0;
}

/* Треугольник-указатель вниз-вправо (для инвентаря) */
.inv-dropdown-arrow {
    position: absolute;
    bottom: -7px;
    right: 36px;
    width: 12px;
    height: 12px;
    background: rgba(9,9,11,0.98);
    border-right: 1px solid rgba(63,63,70,0.7);
    border-bottom: 1px solid rgba(63,63,70,0.7);
    transform: rotate(45deg);
    z-index: -1;
}

/* Треугольник-указатель вниз-влево (для меню) */
.inv-dropdown-arrow.inv-dropdown-arrow-left {
    right: auto;
    left: 36px;
    border-right: none;
    border-bottom: 1px solid rgba(63,63,70,0.7);
    border-left: 1px solid rgba(63,63,70,0.7);
}

/* Треугольник-указатель вниз-центр (для ЧВК) */
.inv-dropdown-arrow.inv-dropdown-arrow-center {
    right: auto;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    border-right: 1px solid rgba(63,63,70,0.7);
    border-bottom: 1px solid rgba(63,63,70,0.7);
    border-left: none;
}

.menu-dropdown {
    left: 8px;
    transform: none;
    min-width: 215px;
}

/* ЧВК дропдаун — по центру над кнопкой ЧВК */
.pmc-dropdown {
    left: 50%;
    transform: translateX(-50%);
    min-width: 215px;
}

/* Кнопка назад в заголовках клановых экранов */
.clan-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(63,63,70,0.5);
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 8px;
    min-height: 36px;
}
.clan-back-btn:hover { color: var(--text-primary); border-color: rgba(245,158,11,0.4); }

/* ═══════════════ CLAN STORAGE ═══════════════ */
/* ═══════════════════════════════════════════════════ */
/*  CLAN STORAGE (Общак) — Standalone Page             */
/* ═══════════════════════════════════════════════════ */

.cs-page {
    padding: 0 12px 24px;
    max-width: 480px;
    margin: 0 auto;
}

/* ── Header ── */
.cs-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0 10px;
}
.cs-back-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
}
.cs-back-btn:active {
    background: rgba(255,255,255,0.05);
}
.cs-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cs-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}
.cs-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Empty state ── */
.cs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 20px;
    color: var(--text-secondary);
    text-align: center;
}
.cs-empty-icon {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* ── Page tabs ── */
.cs-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.cs-tabs::-webkit-scrollbar { display: none; }

.cs-tab {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(39,39,42,0.4);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
    transition: all 0.15s;
}
.cs-tab.active {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.5);
    color: var(--accent-color);
    font-weight: 600;
}

/* ── Stats bar ── */
.cs-stats-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cs-stat {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(39,39,42,0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.cs-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Sections ── */
.cs-section {
    margin-bottom: 14px;
}
.cs-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 6px;
}
.cs-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.cs-section-count {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: rgba(39,39,42,0.5);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

/* ── Grid ── */
.cs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.cs-grid .item-cell {
    aspect-ratio: 1/1;
    min-height: 0;
}

/* ── Actions ── */
.cs-actions {
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cs-deposit-btn {
    width: 100%;
    min-height: 44px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── Tab settings (leader/deputy) ── */
.cs-settings {
    margin-top: 8px;
    padding: 14px;
    background: rgba(39,39,42,0.35);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}
.cs-settings h4 {
    margin: 0 0 10px;
    font-size: 0.88rem;
    color: var(--text-primary);
}
.cs-settings-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.cs-settings-row label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 80px;
}
.cs-settings-row input,
.cs-settings-row select {
    flex: 1;
    min-width: 0;
}

/* ── Deposit overlay ── */
.cs-deposit-content {
    max-height: 80vh;
    overflow-y: auto;
}
.cs-deposit-content .cs-grid {
    gap: 6px;
    padding: 8px 0;
}

/* ── Storage building modal (from Buildings page) ── */
.clan-storage-modal-content {
    max-width: 400px;
    width: 94%;
}
.clan-storage-page-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(39,39,42,0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    gap: 8px;
}
.clan-storage-page-row.clan-storage-page-locked {
    opacity: 0.55;
}
.clan-storage-page-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.clan-storage-page-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.clan-storage-page-cap {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.clan-storage-page-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.clan-storage-page-cost {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ── Clickable building card ── */
.clan-building-clickable {
    cursor: pointer;
    transition: border-color 0.15s;
}
.clan-building-clickable:active {
    border-color: var(--accent-color);
}

/* ═══════════════════════════════════════════════════ */
/*  PERSONAL STORAGE (Личный Склад) — Standalone Page  */
/* ═══════════════════════════════════════════════════ */

.ps-page {
    padding: 0 12px 24px;
    max-width: 480px;
    margin: 0 auto;
}
.ps-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0 10px;
}
.ps-back-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
}
.ps-back-btn:active {
    background: rgba(255,255,255,0.05);
}
.ps-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.ps-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}
.ps-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.ps-stats-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.ps-stat {
    flex: 1;
    min-width: 80px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(39,39,42,0.4);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.ps-stat-value {
    font-weight: 600;
    color: var(--text-primary);
}
.ps-section {
    margin-bottom: 14px;
}
.ps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}
.ps-grid .item-cell {
    aspect-ratio: 1/1;
}

.inv-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(39,39,42,0.8);
    color: #e4e4e7;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
    width: 100%;
}

.inv-dropdown-item:last-of-type {
    border-bottom: none;
}

.inv-dropdown-item:hover {
    background: rgba(39,39,42,0.7);
}

.inv-dropdown-item:active {
    background: rgba(63,63,70,0.7);
}

/* Иконка в боксе */
.inv-dropdown-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(39,39,42,0.6);
    border-radius: 8px;
    border: 1px solid rgba(63,63,70,0.5);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.inv-dropdown-label {
    flex: 1;
    color: #d4d4d8;
    font-size: 0.88rem;
    font-weight: 500;
}

.inv-dropdown-count {
    color: #f59e0b;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: monospace;
    margin-right: 4px;
}

.inv-dropdown-sep {
    color: #52525b;
    margin: 0 1px;
}

.inv-dropdown-chevron {
    color: #52525b;
    font-size: 1.1rem;
    line-height: 1;
    margin-left: 2px;
}

.inv-dropdown-item .equip-count {
    margin-left: auto;
    padding-left: 10px;
}

/* Currency row in inventory dropdown */
.inv-dropdown-currency-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(39,39,42,0.8);
    background: rgba(24,24,27,0.3);
}

.inv-dd-cur {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: monospace;
}

.inv-dd-cur-icon {
    font-size: 0.75rem;
    color: var(--accent-color);
}

.inv-dd-cur-icon.rare {
    color: #818cf8;
}

.inv-dd-cur-icon.unique {
    color: #f59e0b;
}

/* === МОДАЛЬНЫЕ ОКНА ИНВЕНТАРЯ === */
.inv-modal .inv-modal-content {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inv-modal .inventory-grid {
    overflow-y: auto;
    flex: 1;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 8px 0;
    min-height: 220px;
}

/* Storage grid inside inventory modal — let it grow naturally, parent scrolls */
#invSubPanel-storage .inventory-grid,
#inventoryNavModal .inv-tab-panel .inventory-grid {
    flex: none;
    overflow-y: visible;
    min-height: unset;
}

/* Hide scrollbar on inventory modal sub-tab panels */
.inv-tab-panel {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.inv-tab-panel::-webkit-scrollbar { display: none; }

.inv-modal .equipment-layout {
    overflow-y: auto;
    flex: 1;
    align-items: start;
    padding: 8px 0;
}

/* === НАСТРОЙКИ === */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.03);
}

.settings-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.settings-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.settings-actions .btn {
    flex: 1;
}

/* Режимы интерфейса из настроек */
body.ui-compact .screen,
body.ui-compact .modal-content {
    padding: 12px;
}

body.ui-compact .btn {
    padding: 8px 10px;
}

body.ui-no-animations *,
body.ui-no-animations *::before,
body.ui-no-animations *::after {
    transition: none !important;
    animation: none !important;
}

/* Комбинированный инвентарный модал (карманы + рюкзак) */
.inv-sections {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    gap: 0;
}

.inv-section {
    display: flex;
    flex-direction: column;
}

.inv-section + .inv-section {
    border-top: 2px solid var(--border-color);
}

.inv-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
}

.inv-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.inv-section-count {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Сетка внутри секции не должна быть flex-1 или иметь min-height */
.inv-section-grid {
    overflow-y: visible !important;
    flex: none !important;
    min-height: unset !important;
    padding: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Объединённый инвентарь (карманы + рюкзак + пояс) */
.inv-unified-section {
    display: flex;
    flex-direction: column;
}

.inv-section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-color) 15%, var(--border-color) 85%, transparent 100%);
    margin: 4px 12px;
    opacity: 0.6;
}

.inv-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* === ARENA BATTLE UI (v2 — clean military design) === */

/* Battle layout */
.arena-battle-layout {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

/* Teams grid — two columns */
.arena-teams-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 16px 0;
}

.arena-team {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    background: none;
    border: none;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 0;
}

.arena-team-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.arena-team-allies .arena-team-label { color: var(--success-color); }
.arena-team-enemies .arena-team-label { color: var(--danger-color); }

.arena-vs { display: none; }

.arena-players-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Player cards */
.arena-player-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-width: 0;
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
    background: var(--secondary-color);
}

/* HP fill — gradient background behind card content */
.arena-player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--hp-pct, 100%);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    transition: width 0.3s ease;
    z-index: 0;
    pointer-events: none;
}

.arena-player-card.is-ally::before,
.arena-player-card.is-active-ally::before {
    background: rgba(47, 160, 90, 0.2);
}

.arena-player-card.is-enemy::before,
.arena-player-card.is-target::before {
    background: rgba(184, 58, 47, 0.2);
}

.arena-player-card > * {
    position: relative;
    z-index: 1;
}

.arena-player-card.is-active-ally {
    border-color: var(--success-color);
}

.arena-player-card.is-target {
    border-color: var(--accent-color);
    outline: none;
}

.arena-player-card.is-dead {
    opacity: 0.4;
    background: transparent;
    border-color: transparent;
}

.arena-player-card.is-dead::before {
    display: none;
}

.arena-player-icon {
    font-size: 14px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.arena-player-card.is-dead .arena-player-icon { color: var(--text-muted); }
.arena-player-card.is-active-ally .arena-player-icon { color: var(--success-color); }
.arena-player-card.is-target .arena-player-icon { color: var(--text-muted); }

.arena-player-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.arena-player-card.is-dead .arena-player-name {
    text-decoration: line-through;
    color: var(--text-muted);
}

.arena-player-hp-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.arena-player-card.is-dead .arena-player-hp-text {
    color: var(--text-muted);
}

/* Status area — HP left, target right */
.arena-my-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 0;
    min-width: 0;
    gap: 12px;
}

.arena-status-hp {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--danger-color);
    flex-shrink: 0;
}

.arena-status-target {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
}

.arena-status-target-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--warning-color);
    font-weight: 500;
}

/* Attack power bar */
.arena-attack-power-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px 0;
}

.arena-attack-power-bar {
    flex: 1;
    height: 10px;
    background: var(--elevated-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.arena-attack-power-fill {
    height: 100%;
    width: 30%;
    background: var(--success-color);
    border-radius: var(--radius-sm);
    transition: width 0.1s linear, background 0.2s ease;
}

.arena-attack-power-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    min-width: 50px;
}

/* Actions panel */
.arena-actions {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.arena-attack-main-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px;
    min-height: 56px;
    border-radius: var(--radius-sm);
    background: var(--accent-color);
    color: var(--primary-color);
    border: none;
    font-family: inherit;
}

.arena-attack-main-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.arena-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.arena-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--elevated-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    min-height: 48px;
    font-family: inherit;
    position: relative;
}

.arena-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Class skills — 4-column square grid */
.arena-class-skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.arena-skill-btn {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    aspect-ratio: 1;
    padding: 0;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--radius-sm);
    min-height: 52px;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.arena-skill-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}

.arena-skill-btn:not(:disabled) {
    border-color: var(--accent-dim);
    color: var(--accent-color);
    background: rgba(255, 176, 46, 0.05);
}

.arena-skill-btn:not(:disabled):active {
    background: rgba(255, 176, 46, 0.12);
    border-color: var(--accent-color);
}

.arena-skill-btn:disabled {
    opacity: 0.4;
    background: rgba(20, 20, 20, 0.5);
    border-color: rgba(255,255,255,0.04);
}

.arena-skill-btn .skill-cd {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.arena-surrender-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--danger-color);
    color: #fff;
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    border: none;
    font-family: inherit;
}

/* Battle end animation — hide actions, show result */
.arena-attack-power-wrap,
.arena-actions {
    transition: opacity 0.5s ease, max-height 0.5s ease;
    overflow: hidden;
}

.arena-battle-ended .arena-attack-power-wrap,
.arena-battle-ended .arena-actions {
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
}

.arena-battle-ended #arenaBattleResult {
    animation: arena-result-fadein 0.5s ease 0.5s both;
}

.arena-battle-result {
    padding: 12px 16px;
}

@keyframes arena-result-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Battle log — monospace, dark */
.arena-battle-log {
    flex: 1;
    background: #0d0f0e;
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    overflow-y: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
}

.arena-battle-log .log-entry {
    display: flex;
    flex-direction: column;
    gap: 2px;
    word-break: break-word;
    padding: 0;
    border-bottom: none;
}

.arena-battle-log .log-player-name {
    color: var(--success-color);
    font-weight: 600;
}

.arena-battle-log .log-enemy-name {
    color: var(--danger-color);
    font-weight: 600;
}

.arena-battle-log .log-damage {
    color: var(--warning-color);
}

/* === ARENA RESULT MODAL === */

.arena-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.arena-modal {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.arena-modal-header {
    text-align: center;
    padding: 18px 16px 10px;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--border-color);
}

.arena-modal-scoreboard {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.arena-modal-scoreboard-title {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.arena-sb-columns {
    display: flex;
    gap: 8px;
}

.arena-sb-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.arena-sb-col-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-secondary);
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 2px;
}

.arena-sb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
}

.arena-sb-row.is-me {
    background: rgba(255,255,255,0.08);
    font-weight: 700;
}

.arena-sb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena-sb-dmg  { min-width: 40px; text-align: right; color: var(--warning-color); }
.arena-sb-rate { min-width: 45px; text-align: right; font-size: 0.7rem; }
.arena-sb-rate.positive { color: var(--success-color); }
.arena-sb-rate.negative { color: var(--danger-color); }

.arena-modal-rewards {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.arena-modal-rewards-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.arena-reward-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    padding: 4px 0;
}

.arena-reward-row .reward-icon { font-size: 1rem; }
.arena-reward-row .reward-label { flex: 1; color: var(--text-secondary); }
.arena-reward-row .reward-value { font-weight: 700; }

.arena-modal-exit-btn {
    margin: 12px 14px 16px;
    width: calc(100% - 28px);
    min-height: 48px;
    font-size: 1rem;
    font-weight: 700;
}

/* Arena currency icon */
.char-currency-icon.arena {
    color: #e06c35;
}

/* ================================================================
   ARENA LOBBY — CARD-BASED DESIGN (военный/тактический стиль)
   ================================================================ */

.arena-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px 16px 24px;
    max-width: 560px;
    margin: 0 auto;
}

/* Заголовок страницы */
.arena-page-header {
    text-align: center;
    padding: 2px 0 4px;
}
.arena-page-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
}
.arena-page-subtitle {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin: 3px 0 0;
}

/* Карточка репутации */
.arena-reputation-card {
    position: relative;
    background: linear-gradient(135deg, #18181b 0%, #27272a 50%, #09090b 100%);
    border: 2px solid var(--border-accent);
    border-radius: 10px;
    padding: 18px 20px;
    overflow: hidden;
}
.arena-reputation-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(245,158,11,0.06), transparent 60%);
    pointer-events: none;
}
.arena-reputation-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.arena-reputation-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(245,158,11,0.85);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 6px;
}
.arena-reputation-value {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 900;
    font-family: monospace;
    line-height: 1;
}
.arena-reputation-sub {
    color: var(--text-secondary);
    font-size: 0.7rem;
    margin-top: 4px;
}
.arena-rank-badge {
    background: rgba(39,39,42,0.75);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    padding: 8px 14px;
    text-align: right;
    white-space: nowrap;
}
.arena-rank-badge-label {
    color: #71717a;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 2px;
}
.arena-rank-badge-value {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.arena-rep-mini-stats {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-align: right;
}

/* Разделитель */
.arena-divider {
    display: flex;
    align-items: center;
    gap: 12px;
}
.arena-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(217,119,6,0.5), transparent);
}
.arena-divider-text {
    color: var(--accent-color);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    white-space: nowrap;
}

/* Карточки режимов */
.arena-card {
    background: linear-gradient(160deg, #18181b 0%, #09090b 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s ease;
}
.arena-card:hover {
    border-color: var(--border-accent);
}

/* Шапка карточки */
.arena-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 2px solid rgba(217,119,6,0.35);
    position: relative;
}
.arena-card-header.mode-pve {
    background: linear-gradient(to right, #065f46, #064e3b);
}
.arena-card-header.mode-pvp1v1 {
    background: linear-gradient(to right, #7f1d1d, #5e0e0e);
}
.arena-card-header.mode-pvp5v5 {
    background: linear-gradient(to right, #1e3a5f, #0f1f36);
}

.arena-card-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.arena-card-title-block {
    flex: 1;
    min-width: 0;
}
.arena-card-title-block h3 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}
.arena-card-title-block p {
    color: rgba(254,243,199,0.5);
    font-size: 0.7rem;
    margin: 3px 0 0;
}
.arena-card-rating-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(217,119,6,0.3);
    border-radius: 6px;
    padding: 5px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--text-primary);
}

/* Тело карточки */
.arena-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.arena-card-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: rgba(39,39,42,0.5);
    border: 1px solid rgba(63,63,70,0.5);
    border-radius: 6px;
}
.arena-card-stat-left {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #d4d4d8;
    font-size: 0.82rem;
}
.arena-card-stat-left .stat-icon {
    font-size: 0.9rem;
}
.arena-card-stat-value {
    color: var(--accent-color);
    font-family: monospace;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Кнопка действия карточки */
.arena-card-btn {
    width: 100%;
    padding: 13px 16px;
    border-radius: 6px;
    border: 1px solid rgba(217,119,6,0.35);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.15s ease, filter 0.1s ease;
}
.arena-card-btn:hover {
    filter: brightness(1.1);
    border-color: rgba(245,158,11,0.5);
}
.arena-card-btn:active {
    transform: scale(0.985);
    filter: brightness(0.95);
}
.arena-card-btn.mode-pve   { background: linear-gradient(to right, #065f46, #064e3b); }
.arena-card-btn.mode-pvp1v1 { background: linear-gradient(to right, #7f1d1d, #5e0e0e); }
.arena-card-btn.mode-pvp5v5 { background: linear-gradient(to right, #1e3a5f, #0f1f36); }
.arena-card-btn.mode-leave  {
    background: rgba(39,39,42,0.5);
    border-color: rgba(63,63,70,0.8);
    color: var(--text-secondary);
}
.arena-card-btn.mode-leave:hover { border-color: var(--border-color); color: var(--text-primary); }

/* Лобби ожидания */
.arena-lobby-card {
    background: linear-gradient(135deg, #18181b, #09090b);
    border: 2px solid var(--border-accent);
    border-radius: 10px;
    padding: 20px 20px;
    text-align: center;
}
.arena-lobby-status {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 6px;
}
.arena-lobby-count {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: monospace;
}

/* Предупреждение внизу */
.arena-warning-footer {
    padding: 12px 16px;
    background: rgba(88,12,12,0.25);
    border: 1px solid rgba(127,29,29,0.5);
    border-radius: 8px;
    text-align: center;
    color: #f87171;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

/* ================================================================
   INVENTORY MODAL — НОВЫЙ ДИЗАЙН (карточный тактический стиль)
   ================================================================ */

/* Основной контейнер (центрируется внутри .modal overlay) */
#inventoryNavModal {
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.inv-new-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    background: #09090b;
    border: 1px solid #27272a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.18s ease;
}

/* Угловые amber-акценты */
.inv-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 3;
    pointer-events: none;
}
.inv-corner-tl { top: 0; left: 0; border-top: 2px solid #f59e0b; border-left: 2px solid #f59e0b; border-radius: 10px 0 0 0; }
.inv-corner-tr { top: 0; right: 0; border-top: 2px solid #f59e0b; border-right: 2px solid #f59e0b; border-radius: 0 10px 0 0; }
.inv-corner-bl { bottom: 0; left: 0; border-bottom: 2px solid #f59e0b; border-left: 2px solid #f59e0b; border-radius: 0 0 0 10px; }
.inv-corner-br { bottom: 0; right: 0; border-bottom: 2px solid #f59e0b; border-right: 2px solid #f59e0b; border-radius: 0 0 10px 0; }

/* Шапка */
.inv-new-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(to right, #18181b, #18181b, #09090b);
    border-bottom: 2px solid rgba(217,119,6,0.4);
    flex-shrink: 0;
}
.inv-new-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.inv-new-header-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(217,119,6,0.15);
    border: 1px solid rgba(217,119,6,0.35);
    border-radius: 6px;
    font-size: 1rem;
    flex-shrink: 0;
}
.inv-new-title {
    color: #fef3c7;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0;
}
.inv-new-subtitle {
    color: #52525b;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin: 2px 0 0;
}
.inv-new-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.inv-new-total {
    background: rgba(39,39,42,0.8);
    border: 1px solid #3f3f46;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-family: monospace;
    white-space: nowrap;
}
.inv-new-total .inv-total-filled { color: #f59e0b; }
.inv-total-sep { color: #52525b; margin: 0 1px; }
.inv-new-total .inv-total-cap { color: #a1a1aa; }
.inv-new-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    color: #71717a;
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.inv-new-close:hover { color: #f87171; background: rgba(127,29,29,0.25); border-color: #7f1d1d; }

/* Тело с прокруткой */
.inv-new-body {
    overflow-y: auto;
    flex: 1;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Секции инвентаря — переопределение старых стилей */
#inventoryNavModal .inv-section {
    display: flex;
    flex-direction: column;
    border-top: none;
}
#inventoryNavModal .inv-section + .inv-section { border-top: none; }
#inventoryNavModal .inv-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px 8px;
    background: transparent;
    border-bottom: none;
    position: static;
}
.inv-section-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.inv-section-emoji { font-size: 1rem; line-height: 1; }
#inventoryNavModal .inv-section-title {
    color: #f59e0b;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
}
#inventoryNavModal .inv-section-count {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.68rem;
    font-family: monospace;
    color: #a1a1aa;
    opacity: 1;
}
.inv-section-sep {
    height: 1px;
    background: linear-gradient(to right, rgba(217,119,6,0.3), rgba(217,119,6,0.08), transparent);
    margin-bottom: 10px;
}

/* Предупреждение внизу */
.inv-warning {
    padding: 9px 12px;
    background: rgba(69,10,10,0.2);
    border: 1px solid rgba(127,29,29,0.4);
    border-radius: 6px;
    text-align: center;
    color: rgba(248,113,113,0.7);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ── Редизайн ячеек инвентаря по редкости ── */

/* Гарантируем позиционирование для ::after акцента */
.item-cell { position: relative; }

/* Угловой цветной акцент в зависимости от редкости */
.item-cell[class*="rarity-cell-"]::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-radius: 0 var(--radius-md) 0 4px;
    pointer-events: none;
}

/* Фоны и бордеры по редкости — яркие фоны для отображения рарности */
.item-cell.rarity-cell-trash   { background: rgba(63,63,70,0.6);   border-color: #71717a; }
.item-cell.rarity-cell-poor    { background: rgba(82,82,91,0.65);   border-color: #a1a1aa; }
.item-cell.rarity-cell-normal  { background: rgba(37,99,235,0.3);   border-color: #3b82f6; }
.item-cell.rarity-cell-normal::after  { background: #3b82f6; }
.item-cell.rarity-cell-good    { background: rgba(139,92,246,0.35); border-color: #a78bfa; }
.item-cell.rarity-cell-good::after    { background: #a78bfa; }
.item-cell.rarity-cell-great   { background: rgba(245,158,11,0.35); border-color: #f59e0b; }
.item-cell.rarity-cell-great::after   { background: #f59e0b; }
.item-cell.rarity-cell-perfect { background: rgba(239,68,68,0.35);  border-color: #ef4444; }
.item-cell.rarity-cell-perfect::after { background: #ef4444; }

/* Placeholder пустые слоты в новом стиле */
.item-cell.item-placeholder {
    background: rgba(39,39,42,0.3) !important;
    border: 1px dashed #3f3f46 !important;
    opacity: 0.5;
    cursor: default;
}
.item-cell.item-placeholder:hover {
    border-color: #3f3f46 !important;
    background: rgba(39,39,42,0.3) !important;
}



/* Quantity badge for stacked items (habar) */
.item-qty-badge {
    position: absolute;
    bottom: 2px;
    right: 3px;
    background: rgba(0,0,0,0.75);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 700;
    padding: 0 4px;
    border-radius: 4px;
    line-height: 16px;
    pointer-events: none;
    z-index: 2;
}

.item-mech-star {
    position: absolute;
    top: 1px;
    right: 2px;
    font-size: 11px;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 0 2px rgba(255, 193, 7, 0.6));
}

/* Enhancement level badge (+1 to +15) — top-left of item cell */
.item-enhance-badge {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 10px;
    font-weight: 800;
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 8px currentColor;
    line-height: 1;
}

/* ── Mechanic Upgrades in Item Modal ── */
.item-modal-mechanic-section {
    padding: 8px 0;
}

.item-modal-mechanic-section .item-modal-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #ffc107;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.mechanic-upgrades-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mechanic-upgrade-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 6px;
    font-size: 13px;
    color: #ffc107;
}

/* ── Split Stack / Sell Quantity Modal ── */
.split-modal-content {
    background: var(--bg-secondary, #1e1e22);
    border: 1px solid #3f3f46;
    border-radius: var(--radius-lg, 12px);
    max-width: 340px;
    width: 90%;
    margin: auto;
    overflow: hidden;
}
.split-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
    font-weight: 600;
    font-size: 15px;
    color: #e4e4e7;
}
.split-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.split-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}
.split-item-icon { font-size: 24px; }
.split-item-name { color: #d4d4d8; font-weight: 500; }
.split-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.split-pile {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}
.split-pile-label {
    font-size: 11px;
    color: #71717a;
    text-transform: uppercase;
}
.split-pile-val {
    font-size: 20px;
    font-weight: 700;
    color: #fbbf24;
}
.split-slider {
    flex: 1;
    accent-color: #fbbf24;
    height: 6px;
}
.split-confirm-btn {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
}
.sell-qty-price-row,
.sell-qty-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #a1a1aa;
}
.sell-qty-input {
    width: 60px;
    padding: 6px 8px;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 6px;
    color: #e4e4e7;
    font-size: 15px;
    text-align: center;
}
.sell-qty-input:focus { outline: none; border-color: #fbbf24; }

/* Habar-specific button colors */
.item-act-split { background: #1e3a5f; color: #60a5fa; }
.item-act-split:active { background: #1e40af; }
.item-act-sell-qty { background: #422006; color: #fbbf24; }
.item-act-sell-qty:active { background: #78350f; }

/* ================================================================
   COMBINED INVENTORY MODAL — TABS (Снаряга / Карманы / Рюкзак)
   ================================================================ */

.inv-tabs {
    display: flex;
    border-bottom: 1px solid #27272a;
    background: #0d0d0f;
    flex-shrink: 0;
}
.inv-tab {
    flex: 1;
    padding: 9px 6px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #52525b;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.inv-tab:hover { color: #a1a1aa; }
.inv-tab.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
    background: rgba(245,158,11,0.04);
}
.inv-tab-count {
    font-family: monospace;
    font-size: 0.58rem;
    color: #52525b;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 3px;
    padding: 1px 4px;
    letter-spacing: 0;
}
.inv-tab.active .inv-tab-count {
    color: #a1a1aa;
    border-color: #3f3f46;
}

/* Панели вкладок */
.inv-tab-panel {
    display: flex;
    flex-direction: column;
}

/* Sub-tabs inside inventory panel */
.inv-subtabs {
    margin-bottom: 6px;
    border-radius: var(--radius-md);
    background: #18181b;
    border: 1px solid #27272a;
    overflow: hidden;
}
.inv-subtabs .inv-tab {
    font-size: 0.6rem;
    padding: 7px 6px;
}
.inv-subtabs .inv-tab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Drag-to-tab highlight */
.inv-tab.item-drop-target {
    background: rgba(245,158,11,0.15) !important;
    border-bottom-color: #f59e0b !important;
    color: #f59e0b !important;
    box-shadow: inset 0 -2px 8px rgba(245,158,11,0.2);
}

/* Строка счётчика под гридом */
.inv-slots-line {
    text-align: right;
    padding: 4px 2px 0;
    color: #52525b;
    font-size: 0.65rem;
    font-family: monospace;
}

/* Снаряга внутри tab body — отменить overflow чтобы всё влезло */
#inventoryNavModal .inv-new-body {
    padding: 10px 12px 14px;
}
#invPanel-equip .equipment-layout {
    overflow-y: visible;
    padding: 4px 0;
}
/* Аватар по центру экипировки (в модалке и на экране) */
.equip-avatar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.equip-avatar-center .equip-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
                var(--secondary-color);
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}
.equip-avatar-center .equip-avatar-icon {
    font-size: 2.5rem;
}

/* Нижний ряд под снарягой (рюкзак + заглушка) */
.equip-bottom {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: var(--spacing-sm);
}

/* Уравниваем размер слотов снаряги с inventory item-cell */
.equipment-layout .equip-slot-cell {
    width: auto !important;
    min-width: unset !important;
    max-width: none !important;
}

/* Слоты снаряжения (is-empty) внутри inventoryNavModal — 45×45, как item-placeholder */
/* Идёт ПОСЛЕ .equipment-layout .equip-slot-cell чтобы перебить width: auto !important */
#inventoryNavModal .equipment-layout .equip-slot-cell.is-empty {
    width: 45px !important;
    height: 45px !important;
    min-width: unset !important;
    max-width: unset !important;
    min-height: unset !important;
    flex-shrink: 0;
}

/* ================================================================
   ITEM DETAIL MODAL v2 — тактический карточный стиль
   ================================================================ */

/* Overlay */
#itemModal {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Контейнер */
.item-modal-v2 {
    position: relative;
    width: 100%;
    max-width: 360px;
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    background: #09090b;
    border: 1px solid #27272a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0,0,0,0.95);
    animation: fadeIn 0.18s ease;
}

/* Камо-текстура */
.item-modal-camo {
    position: absolute;
    inset: 0;
    opacity: 0.025;
    background: url('https://images.unsplash.com/photo-1621045215388-49323192e675?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&q=80&w=400') center/cover;
    pointer-events: none;
    z-index: 0;
}

/* Шапка */
.item-modal-v2-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(24,24,27,0.8);
    border-bottom: 1px solid #27272a;
}
.item-modal-v2-hl {
    display: flex;
    align-items: center;
    gap: 10px;
}
.item-modal-lvl-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #27272a;
    border: 1px solid #3f3f46;
    padding: 4px 8px;
    border-radius: 4px;
}
.item-modal-lvl-label {
    color: #71717a;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.item-modal-lvl-val {
    color: #fcd34d;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 700;
}
.item-modal-vdivider {
    width: 1px;
    height: 18px;
    background: #3f3f46;
}
.item-modal-rarity {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #a1a1aa;
}

/* Тело */
.item-modal-v2-body {
    position: relative;
    z-index: 1;
    padding: 18px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Иконка */
.item-modal-icon-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.item-modal-icon-box {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px solid #3f3f46;
    background: #18181b;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.item-modal-icon-glow {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    filter: blur(12px);
    transition: opacity 0.2s ease;
}
.item-hero-icon { font-size: 2rem; line-height: 1; position: relative; z-index: 1; }
.item-hero-name {
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fef3c7;
    text-align: center;
}
.item-weapon-type {
    color: #71717a;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    text-align: center;
    margin-top: 3px;
}

/* Точка редкости на иконке */
.item-modal-rarity-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #09090b;
    background: #52525b;
    z-index: 2;
}

/* Классы редкости для icon-box и glow */
.border-rarity-trash  { border-color: #52525b !important; }
.border-rarity-poor   { border-color: #52525b !important; }
.border-rarity-normal { border-color: #1d4ed8; background: rgba(23,37,84,0.4); }
.border-rarity-good   { border-color: #7c3aed; background: rgba(59,7,100,0.35); }
.border-rarity-great  { border-color: #d97706; background: rgba(120,53,15,0.35); }
.border-rarity-perfect{ border-color: #dc2626; background: rgba(69,10,10,0.4); }

.glow-rarity-normal { background: #3b82f6; opacity: 0.18; }
.glow-rarity-good   { background: #8b5cf6; opacity: 0.18; }
.glow-rarity-great  { background: #f59e0b; opacity: 0.18; }
.glow-rarity-perfect{ background: #ef4444; opacity: 0.18; }

.dot-rarity-trash   { background: #52525b; }
.dot-rarity-poor    { background: #6b7280; }
.dot-rarity-normal  { background: #3b82f6; }
.dot-rarity-good    { background: #8b5cf6; }
.dot-rarity-great   { background: #f59e0b; }
.dot-rarity-perfect { background: #ef4444; }

/* Цвет редкости для текстов */
.item-modal-rarity.rarity-normal  { color: #93c5fd; }
.item-modal-rarity.rarity-good    { color: #c4b5fd; }
.item-modal-rarity.rarity-great   { color: #fcd34d; }
.item-modal-rarity.rarity-perfect { color: #fca5a5; }

/* Сетка статов */
.item-stat-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-stat-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: rgba(24,24,27,0.6);
    border: 1px solid #27272a;
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}
.item-stat-card--better {
    border-color: #059669;
    box-shadow: inset 0 0 12px rgba(16,185,129,0.07);
}
.item-stat-card-top {
    display: flex;
    align-items: center;
    gap: 5px;
}
.item-stat-card-icon { font-size: 0.8rem; line-height: 1; }
.item-stat-card-label {
    color: #71717a;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-stat-card-bot {
    display: flex;
    align-items: center;
    gap: 6px;
}
.item-stat-card-val {
    color: #e4e4e7;
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 700;
}
.item-stat-card-val .stat-pct {
    color: #71717a;
    font-size: 0.65rem;
    font-weight: 400;
}
.item-stat-card-delta {
    color: #34d399;
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Строка суммы */
.item-stat-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: rgba(24,24,27,0.6);
    border: 1px solid #27272a;
    border-radius: 6px;
}
.item-stat-total-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #71717a;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.item-stat-sigma {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 4px;
    color: #a1a1aa;
    font-family: monospace;
    font-weight: 700;
    font-size: 0.75rem;
}
.item-stat-total-val {
    color: #fcd34d;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 700;
}

/* Описание */
.item-modal-desc {
    color: #52525b;
    font-size: 0.72rem;
    line-height: 1.5;
    margin: 0;
}

/* Разделитель */
.item-modal-sep {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(217,119,6,0.25), transparent);
}

/* Кнопки действий */
.item-modal-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.item-act-btn {
    padding: 11px 4px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: filter 0.12s ease, transform 0.1s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.item-act-btn:active { transform: scale(0.965); filter: brightness(0.9); }
.item-act-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }
.item-act-equip {
    background: linear-gradient(to bottom, #92400e, #78350f);
    border-color: #d97706;
    color: #fef3c7;
}
.item-act-equip:hover { filter: brightness(1.15); border-color: #f59e0b; }
.item-act-open {
    background: linear-gradient(to bottom, #1e3a5f, #14263e);
    border-color: #3b82f6;
    color: #bfdbfe;
}
.item-act-open:hover { filter: brightness(1.15); border-color: #60a5fa; }
.item-act-move {
    background: rgba(39,39,42,0.8);
    border-color: #3f3f46;
    color: #d4d4d8;
}
.item-act-move:hover { background: rgba(63,63,70,0.8); border-color: #52525b; }
.item-act-drop {
    background: linear-gradient(to bottom, rgba(127,29,29,0.8), rgba(69,10,10,0.8));
    border-color: #991b1b;
    color: #fca5a5;
}
.item-act-drop:hover { filter: brightness(1.15); border-color: #dc2626; }

/* ════════════════════════════════════════════════════════════
   CLAN (ЧВК) STYLES
   ════════════════════════════════════════════════════════════ */

/* ── Page header ── */
.clan-page-header {
    text-align: center;
    padding: 16px 12px 10px;
}
.clan-page-title {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-primary);
}
.clan-page-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ── Inputs ── */
.clan-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--secondary-color);
    color: var(--text-primary);
    font-size: 0.82rem;
    margin-bottom: 8px;
}
.clan-input-sm { width: 80px; margin-bottom: 0; }
.clan-select {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--secondary-color);
    color: var(--text-primary);
    font-size: 0.8rem;
}
.clan-error {
    color: var(--error-color);
    font-size: 0.78rem;
    margin-top: 6px;
}

/* ── Create card ── */
.clan-create-card {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: 0 12px 14px;
}
.clan-create-card h3 {
    margin: 0 0 6px;
    font-size: 0.95rem;
}
.clan-create-cost {
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

/* ── Divider ── */
.clan-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 12px;
}
.clan-divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}
.clan-divider-text {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ── Clan list ── */
.clan-list { padding: 0 12px 20px; }
.clan-loading, .clan-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 0.82rem;
}
.clan-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.clan-list-item:hover { border-color: var(--accent-color); }
.clan-list-icon { font-size: 1.4rem; }
.clan-list-info { flex: 1; min-width: 0; }
.clan-list-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.clan-list-tag { color: var(--accent-color); font-weight: 600; }
.clan-list-meta { font-size: 0.7rem; color: var(--text-secondary); }
.clan-list-arrow { color: var(--text-secondary); font-size: 1.2rem; }

/* ── Clan view (preview) ── */
.clan-view-card {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.clan-view-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.clan-view-icon { font-size: 1.8rem; }
.clan-view-stats { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 10px; }
.clan-view-member {
    display: flex; justify-content: space-between;
    padding: 5px 0; font-size: 0.8rem; border-bottom: 1px solid var(--border-color);
}
.clan-rank-label { color: var(--accent-color); font-size: 0.72rem; }
.clan-view-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── My clan: info card ── */
.clan-info-card {
    background: linear-gradient(135deg, var(--secondary-color), rgba(245,158,11,0.08));
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin: 0 12px 12px;
}
.clan-info-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.clan-info-icon { font-size: 2rem; }
.clan-info-title { flex: 1; }
.clan-info-title h2 { font-size: 1.05rem; margin: 0; font-weight: 800; }
.clan-tag { color: var(--accent-color); font-weight: 700; font-size: 0.82rem; }
.clan-level-badge {
    text-align: center;
    background: rgba(245,158,11,0.15);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-md);
    padding: 4px 10px;
}
.clan-level-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); }
.clan-level-value { font-size: 1.2rem; font-weight: 900; color: var(--accent-color); }

/* XP bar */
.clan-xp-bar {
    position: relative;
    height: 14px;
    background: var(--primary-color);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.clan-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #eab308);
    border-radius: 7px;
    transition: width 0.4s ease;
}
.clan-xp-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* ── Tabs ── */
.clan-tabs {
    display: flex;
    gap: 4px;
    padding: 0 12px;
    margin-bottom: 12px;
}
.clan-tab {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--secondary-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.15s;
    text-align: center;
}
.clan-tab.active {
    background: rgba(245,158,11,0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ── Tab content ── */
.clan-tab-content { padding: 0 12px 16px; }

/* ── Base sub-tabs (Строения / Производство) ── */
.clan-base-subtabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}
.clan-base-subtab {
    flex: 1;
    padding: 8px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--secondary-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.15s;
    text-align: center;
}
.clan-base-subtab.active {
    background: rgba(245,158,11,0.12);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ── Production list (rows) ── */
.clan-prod-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.clan-prod-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.clan-prod-row:active {
    background: rgba(245,158,11,0.06);
    border-color: rgba(245,158,11,0.3);
}
.clan-prod-row-icon { font-size: 1.3rem; width: 28px; text-align: center; }
.clan-prod-row-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.clan-prod-row-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.clan-prod-row-level { font-size: 0.72rem; color: var(--text-secondary); }
.clan-prod-row-arrow { color: var(--text-muted); font-size: 1.1rem; }

/* ── Battle-result modal (shared overlay for clan modals) ── */
.battle-result-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    padding: 16px;
}
.battle-result-content {
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

/* ── Production modal ── */
.clan-prod-modal-content {
    max-width: 380px;
    width: 94%;
}
.clan-prod-modal-info {
    padding: 12px 0;
}
.clan-prod-modal-level {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.clan-prod-modal-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 10px;
    line-height: 1.4;
}
.clan-prod-modal-cost {
    font-size: 0.82rem;
    color: var(--accent-color);
    margin-bottom: 8px;
}
.clan-prod-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 4px;
}
.clan-prod-modal-locked {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 8px;
}

/* Bank */
.clan-bank-card, .clan-stats-card, .clan-actions-card {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}
.clan-bank-card h3 { margin: 0 0 8px; font-size: 0.9rem; }
.clan-bank-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.82rem;
}
.clan-donate-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
}
.clan-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 0.82rem;
}

/* ── Members list ── */
.clan-member-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
}
.clan-member-me { border-color: var(--accent-color); }
.clan-member-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.clan-member-name { font-weight: 700; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clan-member-rank-icon { font-size: 0.84rem; flex-shrink: 0; }
.clan-member-xp { font-size: 0.72rem; color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.clan-member-boss { font-size: 0.72rem; line-height: 1; }
.clan-member-boss.boss-on-cd { opacity: 0.3; filter: grayscale(1); }
.clan-rank-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(245,158,11,0.12);
    color: var(--accent-color);
    border: 1px solid rgba(245,158,11,0.25);
    white-space: nowrap;
}
.rank-leader { background: rgba(245,158,11,0.25); border-color: var(--accent-color); }
.rank-general { background: rgba(168,85,247,0.18); color: #c084fc; border-color: rgba(168,85,247,0.35); }
.rank-deputy { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.rank-officer { background: rgba(34,197,94,0.12); color: #4ade80; border-color: rgba(34,197,94,0.25); }
.clan-member-actions { display: flex; gap: 4px; }
.clan-member-right { display: flex; align-items: center; gap: 6px; }
.clan-member-arrow { font-size: 1.1rem; color: var(--text-secondary); opacity: 0.5; }
.clan-member-row { cursor: pointer; transition: background 0.15s; }
.clan-member-row:active { background: rgba(255,255,255,0.04); }

/* ── Clan member modal ── */
.clan-member-modal-content {
    position: relative;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl, 16px);
    width: 92%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px 16px;
}
.clan-member-modal-body { }

.cmm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.cmm-avatar {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    border-radius: 50%;
    flex-shrink: 0;
}
.cmm-header-info { flex: 1; min-width: 0; }
.cmm-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.cmm-level { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 4px; }

.cmm-section {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.cmm-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    margin-bottom: 10px;
}
.cmm-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cmm-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cmm-stat-icon {
    font-size: 1.1rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.cmm-stat-body { flex: 1; }
.cmm-stat-label { font-size: 0.72rem; color: var(--text-secondary); display: block; }
.cmm-stat-value { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }

.cmm-management {
    border-color: rgba(245,158,11,0.25);
}
.cmm-action-row {
    margin-bottom: 10px;
}
.cmm-action-row label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}
.cmm-rank-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.cmm-rank-row .clan-select {
    flex: 1;
}
.cmm-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-warning {
    background: rgba(245,158,11,0.15);
    color: var(--accent-color);
    border: 1px solid rgba(245,158,11,0.3);
}
.btn-warning:hover { background: rgba(245,158,11,0.25); }

.cmm-self-info {
    text-align: center;
}
.cmm-self-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ── Buildings ── */
.clan-building-card {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
}
.clan-building-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.clan-building-icon { font-size: 1.6rem; }
.clan-building-title h4 { margin: 0; font-size: 0.88rem; }
.clan-building-lvl { font-size: 0.7rem; color: var(--accent-color); }
.clan-building-desc { font-size: 0.73rem; color: var(--text-secondary); margin: 0 0 6px; }
.clan-building-effect { font-size: 0.75rem; color: var(--success-color); margin-bottom: 8px; }
.clan-building-footer { display: flex; justify-content: space-between; align-items: center; }
.clan-building-cost { font-size: 0.75rem; color: var(--accent-color); }
.clan-building-max { font-size: 0.72rem; color: var(--text-secondary); font-weight: 700; }

/* ── Boss info card ── */
.clan-boss-info-card {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}
.clan-boss-info-card h3 { margin: 0 0 8px; font-size: 1rem; }
.clan-boss-info-card p { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 12px; }
.clan-boss-cd { color: var(--error-color); font-weight: 700; font-size: 0.85rem; }

/* ── Boss battle screen ── */
.clan-boss-battle-page { padding: 4px 0 60px; }

/* Waiting */
.clan-boss-waiting-header { text-align: center; padding: 16px 12px 12px; }
.clan-boss-waiting-header h2 { font-size: 1.1rem; margin: 0; }
.clan-boss-waiting-header p { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.clan-boss-waiting-list { padding: 0 12px; }
.clan-boss-waiting-player {
    display: flex; justify-content: space-between; padding: 8px 12px;
    background: var(--secondary-color); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); margin-bottom: 6px; font-size: 0.84rem;
}
.clan-boss-waiting-actions {
    display: flex; gap: 8px; padding: 12px; justify-content: center;
}

/* Battlefield */
.clan-boss-battlefield { padding: 8px 12px; }

.clan-boss-enemy {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, rgba(127,29,29,0.2), var(--secondary-color));
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
}
.clan-boss-portrait { font-size: 2.2rem; margin-bottom: 4px; }
.clan-boss-name { font-size: 0.9rem; font-weight: 800; margin-bottom: 6px; }
.clan-boss-hp-bar {
    position: relative;
    width: 100%;
    height: 16px;
    background: var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.clan-boss-hp-fill {
    background: linear-gradient(90deg, #dc2626, #ef4444) !important;
}

/* Team list */
.clan-boss-team { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.clan-boss-team-member {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}
.clan-boss-team-member.dead { opacity: 0.4; }
.clan-boss-tm-name { flex: 0 0 80px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clan-boss-tm-hp-bar {
    flex: 1;
    position: relative;
    height: 10px;
    background: var(--primary-color);
    border-radius: 5px;
    overflow: hidden;
}
.clan-boss-tm-hp-bar .hp-bar-inner { background: var(--success-color); border-radius: 5px; }
.clan-boss-tm-hp-bar .hp-bar-text { font-size: 0.5rem; }
.clan-boss-tm-dmg { font-size: 0.65rem; color: var(--text-secondary); white-space: nowrap; }

/* My status */
.clan-boss-my-status {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 0 12px 8px;
}
.clan-boss-my-hp { font-size: 0.85rem; font-weight: 700; }
.clan-boss-my-statuses { display: flex; gap: 6px; }
.status-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(34,197,94,0.15);
    color: #4ade80;
}
.status-badge.status-bad { background: rgba(220,38,38,0.15); color: #f87171; }

/* Actions */
.clan-boss-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 12px;
    margin-bottom: 10px;
}
.btn-boss-attack {
    grid-column: 1 / -1;
    position: relative;
    overflow: hidden;
    padding: 14px;
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(245,158,11,0.2), var(--secondary-color));
    color: var(--text-primary);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}
.btn-boss-attack .charge-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0;
    background: rgba(245,158,11,0.25);
    transition: width 0.05s linear;
    pointer-events: none;
}
.btn-boss-action {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--secondary-color);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
}
.btn-boss-action:disabled, .btn-boss-attack:disabled { opacity: 0.4; cursor: not-allowed; }

/* Log */
.clan-boss-log {
    max-height: 140px;
    overflow-y: auto;
    padding: 8px 12px;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 0 12px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.clan-boss-log-line { padding: 2px 0; border-bottom: 1px solid rgba(63,63,70,0.3); }

/* Result modal */
.clan-boss-result-content {
    max-width: 380px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}
.clan-boss-result-content h2 { text-align: center; margin-bottom: 12px; }
.clan-boss-score-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 0.78rem;
}
.clan-boss-score-table th {
    text-align: left;
    padding: 4px 6px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.68rem;
    text-transform: uppercase;
}
.clan-boss-score-table td { padding: 6px; border-bottom: 1px solid rgba(63,63,70,0.3); }
.clan-boss-score-table .score-me { background: rgba(245,158,11,0.1); }
.clan-boss-rewards h3 { font-size: 0.9rem; margin-bottom: 8px; }
.clan-boss-reward-line { font-size: 0.82rem; padding: 3px 0; }
.clan-boss-reward-item {
    font-size: 0.82rem;
    padding: 6px 10px;
    background: rgba(245,158,11,0.1);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-md);
    margin-top: 6px;
}

/* ── Button helpers ── */
.btn-xs {
    padding: 4px 8px;
    font-size: 0.65rem;
    border-radius: 4px;
}
.btn-sm {
    padding: 7px 12px;
    font-size: 0.75rem;
}

/* ================================================================
   WEAPON ATTACHMENTS UI
   ================================================================ */

.item-attachments-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.item-attachments-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    margin-bottom: 6px;
}

.item-attachments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.attach-slot-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 52px;
}

.attach-slot-card:hover {
    border-color: var(--accent-color);
    background: rgba(245,158,11,0.05);
}

.attach-slot-card.is-filled {
    border-color: rgba(76, 175, 80, 0.4);
}

.attach-slot-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.attach-slot-name {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attach-slot-empty {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-style: italic;
}

.attach-slot-actions {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.attach-slot-actions button {
    font-size: 0.6rem;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    cursor: pointer;
}

.attach-slot-actions button:hover {
    border-color: var(--accent-color);
    background: rgba(245,158,11,0.1);
}

/* Attachment selector modal */
.attach-selector-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.attach-selector-box {
    background: #09090b;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 320px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 12px;
}

.attach-selector-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent-color);
}

.attach-selector-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.attach-selector-item:hover {
    border-color: var(--accent-color);
}

.attach-selector-item .attach-item-icon {
    font-size: 1.2rem;
}

.attach-selector-item .attach-item-info {
    flex: 1;
    min-width: 0;
}

.attach-selector-item .attach-item-name {
    font-size: 0.75rem;
    font-weight: 600;
}

.attach-selector-item .attach-item-stats {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ARENA SHOP
   ═══════════════════════════════════════════════════════════════════════════ */

#arenaShopScreen {
    display: none;
    padding: 12px;
    max-width: var(--max-content-width, 480px);
    margin: 0 auto;
}

/* Arena shop — now uses inventory-grid + item-cell (see redesign.css) */

/* ================================================
   CLAN BADGE (на странице персонажа)
   ================================================ */
.char-clan-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-color);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
    letter-spacing: 0.5px;
}
.char-clan-badge:active {
    color: var(--accent-light);
}

/* Class + Level row under nickname */
.char-class-level-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.char-level-inline {
    color: var(--accent-color);
    font-weight: 600;
}

/* Faction & Clan section */
.char-faction-clan-section {
    padding: 8px 12px !important;
    margin-bottom: 4px;
}

/* ================================================
   CLICKABLE PLAYER NAME (в чате, клане, арене)
   ================================================ */
.clickable-name {
    cursor: pointer;
    transition: color 0.15s;
}
.clickable-name:hover,
.clickable-name:active {
    color: var(--accent-color);
    text-decoration: underline;
}

/* ================================================
   MODAL OVERLAY (generic base for profile, combat, loot modals)
   ================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ================================================
   PROFILE MODAL
   ================================================ */
.profile-modal-content {
    position: relative;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 92%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
}
.profile-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
}
.profile-modal-body {
    padding: 20px 16px;
}
.profile-loading,
.profile-error {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Profile header */
.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--secondary-color);
    border: 2px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.profile-avatar-icon {
    font-size: 1.6rem;
}
.profile-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.profile-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.profile-level {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.profile-clan-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-sm);
    color: var(--accent-color);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
}
.profile-no-clan {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.profile-class-level {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.profile-faction {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.btn-profile-action {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
}
.btn-profile-action:active {
    background: var(--accent-color);
    color: #fff;
}
.profile-clan-info-line {
    font-size: 0.78rem;
    color: var(--accent-color);
    padding: 8px 0;
    font-weight: 600;
}

/* Profile sections */
.profile-section {
    margin-bottom: 16px;
}
.profile-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-color);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

/* Stats grid */
.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.profile-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: var(--secondary-color);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}
.profile-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.profile-stat-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Equipment grid */
.profile-equip-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-equip-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s;
}
.profile-equip-slot.is-empty {
    opacity: 0.4;
    cursor: default;
}
.profile-equip-slot:not(.is-empty):active {
    border-color: var(--accent-color);
}
.profile-equip-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.profile-equip-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.profile-equip-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
}
.profile-equip-quality {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Safari Resume Banner */
.safari-resume-banner {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 12px 12px;
}
.safari-resume-info {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   Safari Arena Combat — Modal Overlay Mode
   ═══════════════════════════════════════════════════════════════ */

.safari-combat-modal {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050 !important;
    background: var(--bg-color, #0f0f23) !important;
    display: block !important;
    overflow-y: auto;
}

/* ───────────────────────────────────────────────────────────────
   Battle Countdown — большие цифры по центру экрана (арена + сафари)
   ─────────────────────────────────────────────────────────────── */

.battle-countdown-big {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2000 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.85) !important;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
    animation: countdown-fade-in 0.15s ease-out;
}

@keyframes countdown-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes countdown-pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.15); opacity: 0.85; }
    100% { transform: scale(1);   opacity: 1; }
}

.battle-countdown-big #arenaCountdownTimer {
    font-size: 10rem !important;
    font-weight: 900 !important;
    font-family: monospace !important;
    line-height: 1 !important;
    color: var(--accent-color, #e06c35) !important;
    text-shadow: 0 0 40px rgba(224, 108, 53, 0.8),
                 0 0 80px rgba(224, 108, 53, 0.4) !important;
    display: block;
    animation: countdown-pulse 0.8s ease-in-out infinite;
}

.battle-countdown-big #arenaCountdownTimer.battle-countdown-boj {
    font-size: 5rem !important;
    color: #ff4444 !important;
    text-shadow: 0 0 40px rgba(255, 68, 68, 0.9),
                 0 0 80px rgba(255, 68, 68, 0.5) !important;
    letter-spacing: 6px;
    animation: countdown-pulse 0.4s ease-in-out infinite;
}

.battle-countdown-big #arenaCountdownSuffix {
    font-size: 2.5rem;
    color: var(--text-secondary, #a0a0b0);
    font-family: monospace;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   Safari PvE Combat
   ═══════════════════════════════════════════════════════════════ */

#safariCombatModal {
    z-index: 1100;
}
#safariCombatModal .safari-combat-body {
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 12px;
    padding: 16px;
    max-width: 420px;
    width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #333);
}
.sc-turn {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
}
.sc-status {
    font-size: 1rem;
    font-weight: 700;
}
.sc-battlefield {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.sc-player-card,
.sc-enemy-card {
    background: var(--bg-tertiary, #222);
    border-radius: 8px;
    padding: 10px 14px;
    width: 100%;
}
.sc-player-card {
    border-left: 3px solid #4a90e2;
}
.sc-enemy-card {
    border-left: 3px solid #e74c3c;
    cursor: pointer;
    transition: border-color 0.2s;
}
.sc-enemy-card.sc-dead {
    opacity: 0.4;
    cursor: default;
    border-left-color: #555;
}
.sc-enemy-card.sc-selected {
    border-left-color: #f39c12;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.3);
}
.sc-enemy-card.sc-targetable:hover:not(.sc-dead) {
    border-left-color: #f39c12;
}
.sc-card-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.sc-hp-bar {
    height: 20px;
    background: #333;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.sc-hp-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}
.sc-hp-player {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}
.sc-hp-enemy {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}
.sc-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.sc-vs {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-muted, #888);
    text-align: center;
}
.sc-enemies {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sc-log {
    background: var(--bg-tertiary, #222);
    border-radius: 8px;
    padding: 8px 12px;
    max-height: 120px;
    overflow-y: auto;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sc-log-entry {
    padding: 2px 0;
    line-height: 1.3;
}
.sc-log-hit { color: #e74c3c; }
.sc-log-crit { color: #f39c12; font-weight: 700; }
.sc-log-miss, .sc-log-dodge { color: #666; font-style: italic; }
.sc-log-cover { color: #4a90e2; }
.sc-actions,
.sc-result-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sc-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}
.sc-btn:active {
    transform: scale(0.97);
}
.sc-btn-attack {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}
.sc-btn-aimed {
    background: linear-gradient(135deg, #f39c12, #d68910);
    color: #fff;
}
.sc-btn-cover {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}
.sc-btn-finish {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: #fff;
}

@keyframes sc-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}


/* ═══════════════════════════════════════════════════════════════
   Loot Crate Modal
   ═══════════════════════════════════════════════════════════════ */

#lootCrateModal {
    z-index: 1150;
}
.loot-crate-content {
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 12px;
    max-width: 420px;
    width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.loot-crate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #333);
}
.loot-crate-title {
    font-size: 1rem;
    font-weight: 700;
}
.loot-crate-body {
    padding: 12px 16px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.loot-crate-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #333);
}
.loot-crate-take-all {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: #fff;
    font-weight: 600;
}
.loot-crate-close {
    background: var(--bg-tertiary, #333);
    color: var(--text-primary, #eee);
}
.loot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary, #222);
    border-radius: 8px;
    padding: 10px 12px;
    transition: opacity 0.3s;
}
.loot-item.loot-placed {
    opacity: 0.5;
}
.loot-item-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.loot-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.loot-item-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.loot-item-quality {
    font-size: 0.72rem;
    color: var(--text-muted, #888);
}
.loot-item-slot {
    font-size: 0.7rem;
    color: var(--text-muted, #666);
}
.loot-item-placed {
    font-size: 0.75rem;
    color: #27ae60;
    font-weight: 600;
}
.loot-item-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.loot-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: 4px;
    background: var(--bg-primary, #111);
    color: var(--text-primary, #eee);
    border: 1px solid var(--border-color, #444);
    cursor: pointer;
    white-space: nowrap;
}
.loot-btn:hover {
    background: var(--accent-color, #4a90e2);
    color: #fff;
}
.loot-empty {
    text-align: center;
    color: var(--text-muted, #888);
    padding: 24px;
}


/* ═══════════════════════════════════════════════════════════════
   Container Loot Modal (grid-based)
   ═══════════════════════════════════════════════════════════════ */

#containerLootModal {
    z-index: 1160;
}

.container-loot-content {
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 12px;
    max-width: 420px;
    width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container-loot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #333);
}

.container-loot-title {
    font-size: 1rem;
    font-weight: 700;
}

/* ── Grid ──────────────────────────────────────────────────── */

.container-loot-grid {
    display: grid;
    gap: 8px;
    padding: 16px;
}

.container-loot-slot {
    aspect-ratio: 1;
    border-radius: 10px;
    background: var(--bg-tertiary, #222);
    border: 2px solid var(--border-color, #333);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    min-height: 80px;
}

.container-loot-slot.has-item {
    cursor: pointer;
}

.container-loot-slot.has-item:active {
    transform: scale(0.96);
}

.container-loot-slot.selected {
    border-color: var(--accent-color, #4a90e2);
    box-shadow: 0 0 12px rgba(74, 144, 226, 0.35);
}

.container-loot-slot.empty-slot {
    opacity: 0.3;
    border-style: dashed;
}

.container-loot-slot.claimed-slot {
    opacity: 0.4;
    border-color: #27ae60;
}

/* Rarity cell borders */
.container-loot-slot.rarity-cell-trash   { border-color: #666; }
.container-loot-slot.rarity-cell-poor    { border-color: #888; }
.container-loot-slot.rarity-cell-normal  { border-color: #4a90e2; }
.container-loot-slot.rarity-cell-good    { border-color: #9b59b6; }
.container-loot-slot.rarity-cell-great   { border-color: #f1c40f; }
.container-loot-slot.rarity-cell-perfect { border-color: #e74c3c; }

.container-loot-slot-icon {
    font-size: 1.6rem;
}

.container-loot-slot-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.2;
}

.container-loot-slot-quality {
    font-size: 0.6rem;
    color: var(--text-muted, #888);
}

.container-loot-slot-status {
    font-size: 0.7rem;
    color: #27ae60;
    font-weight: 600;
}

/* ── Detail panel ──────────────────────────────────────────── */

.container-loot-detail {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #333);
    background: var(--bg-tertiary, #1e1e34);
}

.container-loot-detail-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.container-loot-detail-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.container-loot-detail-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.container-loot-detail-meta {
    font-size: 0.72rem;
    color: var(--text-muted, #888);
    margin-top: 2px;
}

.container-loot-detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.container-loot-stat {
    font-size: 0.72rem;
    background: rgba(74, 144, 226, 0.12);
    color: var(--accent-color, #6ab0ff);
    padding: 2px 7px;
    border-radius: 4px;
}

.container-loot-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.container-loot-claim-btn {
    width: 100%;
    padding: 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    background: var(--bg-primary, #111);
    color: var(--text-primary, #eee);
    border: 1px solid var(--border-color, #444);
    cursor: pointer;
    font-weight: 600;
    min-height: 44px;
    transition: background 0.2s;
}

.container-loot-claim-btn:active {
    background: var(--accent-color, #4a90e2);
    color: #fff;
}

/* ── Footer ────────────────────────────────────────────────── */

.container-loot-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #333);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.container-loot-take-all-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, rgba(46,204,113,0.25), rgba(46,204,113,0.1));
    color: var(--success-color, #2ecc71);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    min-height: 44px;
    cursor: pointer;
    border: 1px solid rgba(46,204,113,0.4);
    transition: background 0.2s;
}

.container-loot-take-all-btn:active {
    background: rgba(46,204,113,0.4);
}

.container-loot-close-btn {
    width: 100%;
    padding: 10px;
    background: var(--bg-tertiary, #333);
    color: var(--text-primary, #eee);
    border-radius: 8px;
    font-size: 0.85rem;
    min-height: 44px;
    cursor: pointer;
    border: 1px solid var(--border-color, #444);
    transition: background 0.2s;
}

.container-loot-close-btn:active {
    background: var(--accent-color, #4a90e2);
    color: #fff;
}

/* ================================================================
   SKILL DETAIL MODAL — модалка детального описания скилла
   ================================================================ */

/* Skills popup — hide scrollbar but keep scroll */
#skillsPopupOverlay > .modal-content {
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
}
#skillsPopupOverlay > .modal-content::-webkit-scrollbar {
    display: none;                  /* Chrome/Safari */
}

.skill-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.skill-detail-modal {
    background: var(--primary-color, #111);
    border: 1px solid var(--border-accent, #333);
    border-radius: var(--radius-lg, 12px);
    width: 100%;
    max-width: 360px;
    padding: 20px;
    position: relative;
}
.skill-detail-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.skill-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.skill-detail-icon {
    font-size: 2.5rem;
    line-height: 1;
}
.skill-detail-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.skill-detail-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.skill-detail-class {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.skill-detail-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.skill-detail-desc {
    font-size: 0.9rem;
    color: var(--accent-color, #f59e0b);
    font-weight: 600;
}
.skill-detail-full {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.skill-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.skill-detail-stat {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.skill-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.skill-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Rare Trader ── */

.rare-trader-page {
    padding: 12px;
    max-width: 480px;
    margin: 0 auto;
}

.rare-trader-desc {
    color: var(--text-secondary, #aaa);
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
}

.rare-trader-currency {
    text-align: center;
    font-size: 18px;
    margin-bottom: 16px;
    color: #f39c12;
}

.rare-trader-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rare-trader-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-secondary, #1a1f2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
}

.rare-trader-card-icon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.rare-trader-card-info {
    flex: 1;
    min-width: 0;
}

.rare-trader-card-name {
    font-weight: 700;
    font-size: 14px;
}

.rare-trader-card-desc {
    font-size: 12px;
    color: var(--text-secondary, #aaa);
    margin-top: 2px;
}

.rare-trader-card-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.rare-trader-card-price {
    font-weight: 700;
    font-size: 14px;
    color: #f39c12;
}

.rare-trader-loading,
.rare-trader-empty,
.rare-trader-error {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary, #aaa);
    font-size: 14px;
}

.rare-trader-error {
    color: #e74c3c;
}

/* ═══════════════════════════════════════════
   Rare Trader — Tabs
   ═══════════════════════════════════════════ */

.rare-trader-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 3px;
    position: relative;
    z-index: 1;
}
.rare-trader-tab {
    flex: 1;
    min-height: 44px;
    padding: 10px 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #a1a1aa);
    cursor: pointer;
    transition: background .2s, color .2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.rare-trader-tab--active {
    background: var(--accent-color, #6366f1);
    color: #fff;
}

/* ═══════════════════════════════════════════
   Star Exchange (Биржа ★)
   ═══════════════════════════════════════════ */

.se-loading, .se-error {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary, #a1a1aa);
    font-size: 14px;
}
.se-error { color: #ef4444; }

/* Rates */
.se-rates {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.se-rate {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 8px 4px;
}
.se-rate-label {
    font-size: 11px;
    color: var(--text-secondary, #a1a1aa);
    margin-bottom: 2px;
}
.se-rate-value {
    font-size: 16px;
    font-weight: 700;
}
.se-rate-buy { color: #22c55e; }
.se-rate-sell { color: #ef4444; }
.se-rate-last { border: 1px solid rgba(245,158,11,0.3); }

/* Chart */
.se-chart-section {
    margin-bottom: 12px;
}
.se-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #a1a1aa);
    margin-bottom: 6px;
}
.se-chart-wrap {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 8px 4px;
    overflow: hidden;
}
.se-chart-wrap canvas {
    width: 100%;
    height: 160px;
    display: block;
}

/* Order book */
.se-book {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}
.se-book-col {
    flex: 1;
    min-width: 0;
}
.se-title-buy { color: #22c55e; }
.se-title-sell { color: #ef4444; }
.se-book-empty {
    font-size: 12px;
    color: var(--text-secondary, #71717a);
    padding: 8px 0;
    text-align: center;
}
.se-book-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 2px;
}
.se-book-row--buy {
    background: rgba(34,197,94,0.1);
}
.se-book-row--sell {
    background: rgba(239,68,68,0.1);
}
.se-book-price { font-weight: 600; }
.se-book-qty {
    color: var(--text-secondary, #a1a1aa);
}

/* Order form */
.se-order-form {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}
.se-form-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.se-form-label {
    font-size: 13px;
    min-width: 80px;
    color: var(--text-secondary, #a1a1aa);
}
.se-input {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 14px;
    min-height: 40px;
}
.se-slider-row {
    padding: 4px 0 8px;
}
.se-slider {
    width: 100%;
    accent-color: var(--accent-color, #6366f1);
}
.se-form-total {
    text-align: center;
    font-size: 15px;
    margin-bottom: 4px;
}
.se-form-commission {
    text-align: center;
    font-size: 12px;
    color: #f59e0b;
    margin-bottom: 6px;
}
.se-form-balance {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary, #a1a1aa);
    margin-bottom: 10px;
}
.se-form-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.se-btn-buy {
    background: #22c55e !important;
    border-color: #22c55e !important;
    min-height: 44px;
    font-size: 15px;
    font-weight: 700;
}
.se-btn-sell {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    min-height: 44px;
    font-size: 15px;
    font-weight: 700;
}

/* My orders */
.se-my-orders {
    margin-bottom: 12px;
}
.se-my-order {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
}
.se-my-order--buy {
    background: rgba(34,197,94,0.1);
    border-left: 3px solid #22c55e;
}
.se-my-order--sell {
    background: rgba(239,68,68,0.1);
    border-left: 3px solid #ef4444;
}
.se-my-order-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.se-my-order-side {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}
.se-my-order-filled {
    font-size: 11px;
    color: var(--text-secondary, #71717a);
}
