* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1a1a2e;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none;
}

/* ========== ЗАГРУЗКА ========== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-title {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.loading-subtitle {
    font-size: 1.2em;
    color: #8892b0;
    margin-bottom: 30px;
}

.loading-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 0 auto 20px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #64ffda, #48bb78);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.loading-text {
    color: #8892b0;
    font-size: 0.9em;
}

/* ========== ИГРА ========== */
.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.game-container.active {
    display: block;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ========== UI ========== */
.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.game-ui > * {
    pointer-events: auto;
}

/* Информация о себе */
.player-info {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 18px;
    border-radius: 12px;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #64ffda;
}

.player-coords {
    font-size: 0.8em;
    color: #8892b0;
    margin-top: 4px;
}

/* Онлайн панель */
.online-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 18px;
    border-radius: 12px;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 200px;
}

.online-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #64ffda;
}

.online-list {
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9em;
}

.online-list::-webkit-scrollbar {
    width: 4px;
}

.online-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.online-player {
    padding: 4px 0;
    color: #ccd6f6;
    display: flex;
    align-items: center;
    gap: 6px;
}

.online-player::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
}

/* История чата */
.chat-history {
    position: absolute;
    bottom: 80px;
    left: 15px;
    width: 350px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-history::-webkit-scrollbar {
    width: 4px;
}

.chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.chat-message {
    font-size: 0.9em;
    color: white;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.chat-message .name {
    color: #64ffda;
    font-weight: bold;
}

.chat-message.system {
    color: #8892b0;
    font-style: italic;
}

.chat-message.system.join {
    color: #48bb78;
}

.chat-message.system.leave {
    color: #f56565;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ввод чата */
.chat-input-container {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: flex;
    gap: 8px;
    width: 350px;
}

#chatInput {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 25px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 1em;
    outline: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease;
}

#chatInput:focus {
    border-color: #64ffda;
}

#chatInput::placeholder {
    color: #8892b0;
}

#chatSend {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #64ffda, #48bb78);
    color: #1a1a2e;
    font-size: 1.3em;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#chatSend:hover {
    transform: scale(1.1);
}

/* Меню действий */
.actions-menu {
    position: absolute;
    bottom: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn:hover {
    transform: scale(1.1);
    background: rgba(100, 255, 218, 0.3);
}

.action-btn.active {
    background: rgba(100, 255, 218, 0.5);
    border-color: #64ffda;
}

/* Время суток */
.time-display {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-icon {
    font-size: 1.2em;
}

/* ========== МОБИЛЬНЫЕ КОНТРОЛЫ ========== */
.mobile-controls {
    display: none;
    position: absolute;
    bottom: 100px;
    left: 30px;
}

.joystick {
    position: relative;
    width: 120px;
    height: 120px;
}

.joystick-base {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.joystick-handle {
    position: absolute;
    width: 50px;
    height: 50px;
    background: rgba(100, 255, 218, 0.5);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: none;
}

.mobile-chat-btn {
    position: absolute;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(100, 255, 218, 0.3);
    font-size: 1.8em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(100, 255, 218, 0.5);
}


/* Кнопка рыбалки */
.action-btn[data-action="fish"].fishing {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    animation: fishingPulse 1s ease infinite;
}

.action-btn[data-action="fish"].bite {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    animation: bitePulse 0.3s ease infinite;
}

@keyframes fishingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes bitePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px #fbbf24; }
    50% { transform: scale(1.2); box-shadow: 0 0 20px #f59e0b; }
}



/* ============================================
   ИНВЕНТАРЬ
   ============================================ */

   .inventory-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5a2b, #654321);
    border: 3px solid #a67c52;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.inventory-toggle:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #a67c52, #8b5a2b);
}

.inventory-toggle.has-items {
    animation: bagPulse 2s ease infinite;
}

@keyframes bagPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 4px 20px rgba(139, 90, 43, 0.6); }
}

.inventory-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: linear-gradient(180deg, #2a2a3a 0%, #1a1a2a 100%);
    border: 3px solid #4a4a5a;
    border-radius: 15px;
    padding: 0;
    min-width: 340px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.inventory-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(90deg, #3a3a4a, #2a2a3a);
    border-bottom: 2px solid #4a4a5a;
    border-radius: 12px 12px 0 0;
}

.inventory-title {
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
}

.inventory-close {
    background: #ff4757;
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.inventory-close:hover {
    background: #ff6b7a;
    transform: scale(1.1);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 15px;
}

.inventory-slot {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #1a1a2a, #0a0a1a);
    border: 2px solid #3a3a4a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.inventory-slot:hover {
    border-color: #6a6a7a;
    background: linear-gradient(135deg, #2a2a3a, #1a1a2a);
}

.inventory-slot.has-item:hover {
    border-color: #ffd700;
    transform: scale(1.05);
}

.inventory-slot .item-icon {
    font-size: 28px;
    line-height: 1;
}

.inventory-slot .item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 11px;
    color: #fff;
    text-shadow: 1px 1px 2px black;
    font-weight: bold;
}

.inventory-slot.empty {
    opacity: 0.5;
}

.inventory-slot.rare .item-icon {
    animation: rareGlow 2s ease infinite;
}

@keyframes rareGlow {
    0%, 100% { filter: drop-shadow(0 0 3px gold); }
    50% { filter: drop-shadow(0 0 8px gold); }
}

.inventory-footer {
    padding: 10px 15px;
    border-top: 2px solid #4a4a5a;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* Тултип предмета */
.item-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #ffd700;
    border-radius: 8px;
    padding: 10px 15px;
    color: white;
    font-size: 14px;
    z-index: 300;
    pointer-events: none;
    max-width: 200px;
}

.item-tooltip .tooltip-name {
    color: #ffd700;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.item-tooltip .tooltip-type {
    color: #888;
    font-size: 12px;
}

/* ============================================
   ПРОГРЕСС-БАР ДЕЙСТВИЯ
   ============================================ */

.action-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #8b5a2b;
    border-radius: 15px;
    padding: 20px 30px;
    text-align: center;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.action-progress.active {
    opacity: 1;
    pointer-events: auto;
}

.action-progress-text {
    color: #ffd700;
    font-size: 18px;
    margin-bottom: 15px;
}

.action-progress-bar {
    width: 200px;
    height: 20px;
    background: #1a1a2a;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #4a4a5a;
}

.action-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5a2b, #ffd700);
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 8px;
}

.action-cancel {
    margin-top: 15px;
    padding: 8px 20px;
    background: #ff4757;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.action-cancel:hover {
    background: #ff6b7a;
}

/* ============================================
   ПОДСКАЗКА ВЗАИМОДЕЙСТВИЯ
   ============================================ */

.interaction-hint {
    position: fixed;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #64ffda;
    border-radius: 10px;
    padding: 10px 20px;
    color: #64ffda;
    font-size: 16px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.interaction-hint.visible {
    opacity: 1;
}

.interaction-hint .hint-key {
    display: inline-block;
    background: #64ffda;
    color: #0a0a0f;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin: 0 3px;
}



/* ============================================
   ПАНЕЛЬ РЕСУРСОВ
   ============================================ */

   .resources-panel {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.6) 100%);
    padding: 10px 25px;
    border-radius: 25px;
    border: 2px solid #4a4a5a;
    z-index: 100;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-icon {
    font-size: 24px;
}

.resource-value {
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
    min-width: 50px;
}

/* ============================================
   РЕЖИМ СТРОИТЕЛЬСТВА
   ============================================ */

.build-mode-panel {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(20, 60, 20, 0.95) 0%, rgba(10, 40, 10, 0.95) 100%);
    border: 3px solid #4a7c59;
    border-radius: 15px;
    padding: 15px 25px;
    text-align: center;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.build-mode-panel.active {
    opacity: 1;
    pointer-events: auto;
}

.build-mode-header {
    margin-bottom: 10px;
}

.build-mode-title {
    font-size: 18px;
    color: #90ee90;
    font-weight: bold;
}

.build-mode-name {
    font-size: 20px;
    color: #ffd700;
    margin-bottom: 10px;
}

.build-mode-cost {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.cost-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
}

.cost-item.sufficient {
    color: #90ee90;
}

.cost-item.insufficient {
    color: #ff6b6b;
}

.build-mode-hint {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 15px;
}

.build-mode-cancel {
    padding: 8px 25px;
    background: #dc3545;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.build-mode-cancel:hover {
    background: #c82333;
}

/* ============================================
   ИНТЕРЬЕР ЗДАНИЯ
   ============================================ */

.interior-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    z-index: 500;
    display: none;
}

.interior-overlay.active {
    display: block;
}

#interiorCanvas {
    width: 100%;
    height: 100%;
}

.exit-building-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 40px;
    background: linear-gradient(135deg, #8b5a2b, #654321);
    border: 3px solid #a67c52;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    z-index: 501;
    transition: all 0.3s;
}

.exit-building-btn:hover {
    background: linear-gradient(135deg, #a67c52, #8b5a2b);
    transform: translateX(-50%) scale(1.05);
}

/* ============================================
   ПРОЕКТ В ИНВЕНТАРЕ
   ============================================ */

.inventory-slot.blueprint {
    border-color: #4a7c59;
    background: linear-gradient(135deg, rgba(74, 124, 89, 0.3), rgba(30, 70, 32, 0.3));
}

.inventory-slot.blueprint:hover {
    border-color: #90ee90;
    box-shadow: 0 0 10px rgba(144, 238, 144, 0.3);
}

/* ============================================
   ПОДСВЕТКА ЗДАНИЯ
   ============================================ */

.building-preview-valid {
    stroke: #90ee90;
    stroke-width: 3;
    stroke-dasharray: 10, 5;
    fill: rgba(144, 238, 144, 0.2);
}

.building-preview-invalid {
    stroke: #ff6b6b;
    stroke-width: 3;
    stroke-dasharray: 10, 5;
    fill: rgba(255, 107, 107, 0.2);
}


/* Инструменты в инвентаре */
.inventory-slot.tool {
    border-color: #4a7c9c;
    background: linear-gradient(135deg, rgba(74, 124, 156, 0.3), rgba(30, 70, 100, 0.3));
}

.inventory-slot.tool:hover {
    border-color: #6ac;
}

/* Подсветка ресурсов при изменении */
.resource-value.changed {
    animation: resourcePulse 0.5s ease;
}

@keyframes resourcePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); color: #90ee90; }
    100% { transform: scale(1); }
}

/* Лимит ресурсов */
.resource-value.at-limit {
    color: #ff6b6b;
}



/* Индикатор текущей активности */
.activity-indicator {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 8px 20px;
    color: #ffd700;
    font-size: 16px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.activity-indicator.visible {
    opacity: 1;
}

/* Разные цвета для разных типов камня в инвентаре */
.inventory-slot .item-icon.stone-common {
    filter: grayscale(0%);
}

.inventory-slot .item-icon.stone-granite {
    filter: hue-rotate(20deg) saturate(1.2);
}

.inventory-slot .item-icon.stone-slate {
    filter: hue-rotate(-20deg) brightness(0.9);
}



/* Мобильная адаптация */
@media (max-width: 768px) {
    .mobile-controls {
        display: block;
    }

    .chat-history {
        width: calc(100% - 30px);
        max-height: 120px;
        bottom: 180px;
    }

    .chat-input-container {
        width: calc(100% - 100px);
    }

    .online-panel {
        display: none;
    }

    .actions-menu {
        bottom: 100px;
        right: 100px;
    }
}



/* ============================================
   ИНТЕРАКТИВНАЯ ПОДСКАЗКА (МОБИЛЬНАЯ)
   ============================================ */

   .interaction-hint {
    position: fixed;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #64ffda;
    border-radius: 15px;
    padding: 12px 24px;
    color: #64ffda;
    font-size: 16px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.interaction-hint.visible {
    opacity: 1;
    pointer-events: auto;  /* Включаем возможность клика */
}

/* Эффект при наведении/тапе */
.interaction-hint:hover,
.interaction-hint:active {
    background: rgba(0, 0, 0, 0.95);
    border-color: #90ffea;
    transform: translateX(-50%) scale(1.05);
}

/* Стиль для тапа на мобильных */
.hint-tap {
    display: inline-block;
    background: linear-gradient(135deg, #64ffda, #00bfa5);
    color: #0a0a0f;
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: bold;
    margin-right: 5px;
    animation: tapPulse 1.5s ease infinite;
}

@keyframes tapPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 5px rgba(100, 255, 218, 0.5);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 15px rgba(100, 255, 218, 0.8);
    }
}

/* Клавиша E для десктопа */
.hint-key {
    display: inline-block;
    background: #64ffda;
    color: #0a0a0f;
    padding: 2px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
    margin: 0 3px;
}

/* ============================================
   ПРОГРЕСС-БАР (МОБИЛЬНАЯ АДАПТАЦИЯ)
   ============================================ */

.action-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #8b5a2b;
    border-radius: 15px;
    padding: 20px 30px;
    text-align: center;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    min-width: 250px;
}

.action-progress.active {
    opacity: 1;
    pointer-events: auto;
}

.action-cancel {
    margin-top: 15px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #ff4757, #c0392b);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.action-cancel:hover,
.action-cancel:active {
    background: linear-gradient(135deg, #ff6b7a, #e74c3c);
    transform: scale(1.05);
}

/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ ПОДСКАЗКИ
   ============================================ */

@media (max-width: 768px) {
    .interaction-hint {
        bottom: 180px;
        padding: 15px 25px;
        font-size: 18px;
        border-width: 3px;
        border-radius: 20px;
        max-width: 90%;
    }

    .hint-tap {
        padding: 6px 15px;
        font-size: 16px;
    }

    .action-progress {
        width: 85%;
        max-width: 300px;
        padding: 25px 20px;
    }

    .action-cancel {
        padding: 15px 40px;
        font-size: 18px;
        width: 100%;
    }

    /* Увеличить область касания для кнопок */
    .inventory-toggle,
    .exit-building-btn,
    .build-mode-cancel {
        min-height: 50px;
        min-width: 50px;
    }
}

/* ============================================
   ИНДИКАТОР КЛЁВА (МОБИЛЬНЫЙ)
   ============================================ */

.bite-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 215, 0, 0.95);
    border: 4px solid #ff6b6b;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    cursor: pointer;
}

.bite-indicator.active {
    opacity: 1;
    pointer-events: auto;
    animation: biteShake 0.3s ease infinite;
}

.bite-indicator .bite-icon {
    font-size: 50px;
    animation: biteJump 0.4s ease infinite;
}

.bite-indicator .bite-text {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-top: 5px;
}

@keyframes biteShake {
    0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); }
    50% { transform: translate(-50%, -50%) rotate(3deg); }
}

@keyframes biteJump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
    .bite-indicator {
        width: 180px;
        height: 180px;
    }

    .bite-indicator .bite-icon {
        font-size: 60px;
    }

    .bite-indicator .bite-text {
        font-size: 20px;
    }
}



/* ============================================
   МАГАЗИН ТОРГОВЦА
   ============================================ */

   .shop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 600;
    display: none;
    justify-content: center;
    align-items: center;
}

.shop-overlay.active {
    display: flex;
}

.shop-container {
    background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 100%);
    border: 4px solid #8b6914;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(139, 105, 20, 0.5);
}

/* Заголовок */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(90deg, #8b6914, #a67c52, #8b6914);
    border-bottom: 3px solid #654321;
}

.shop-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.shop-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-close:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Основной контент */
.shop-content {
    display: flex;
    height: calc(85vh - 80px);
    max-height: 600px;
}

/* Левая часть - товары */
.shop-left {
    flex: 2;
    padding: 20px;
    overflow-y: auto;
    border-right: 2px solid #654321;
}

/* Табы */
.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.shop-tab {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #654321;
    border-radius: 10px;
    background: #4a3a2a;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-tab:hover {
    background: #5a4a3a;
}

.shop-tab.active {
    background: linear-gradient(135deg, #8b6914, #a67c52);
    color: white;
    border-color: #ffd700;
}

/* Панели */
.shop-panel {
    display: block;
}

.shop-panel.hidden {
    display: none;
}

/* Категории */
.shop-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.category-btn {
    padding: 8px 15px;
    border: 2px solid #654321;
    border-radius: 8px;
    background: #3a2a1a;
    color: #ddd;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-btn:hover {
    background: #4a3a2a;
}

.category-btn.active {
    background: #654321;
    border-color: #ffd700;
    color: #ffd700;
}

/* Сетка товаров */
.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.shop-item {
    background: linear-gradient(135deg, #4a3a2a, #3a2a1a);
    border: 2px solid #654321;
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-item:hover {
    border-color: #ffd700;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.shop-item-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.shop-item-name {
    font-size: 12px;
    color: #ddd;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-item-price {
    font-size: 14px;
    color: #ffd700;
    font-weight: bold;
}

/* Инвентарь для продажи */
.sell-hint {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.shop-inventory {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.shop-inv-slot {
    aspect-ratio: 1;
    background: #2a1a0a;
    border: 2px solid #654321;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.shop-inv-slot.empty {
    opacity: 0.5;
    cursor: default;
}

.shop-inv-slot:not(.empty):hover {
    border-color: #ffd700;
    background: #3a2a1a;
}

.shop-inv-slot .slot-icon {
    font-size: 28px;
}

.shop-inv-slot .slot-count {
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 12px;
    color: #ffd700;
}

.shop-inv-slot .slot-price {
    font-size: 10px;
    color: #90ee90;
    margin-top: 2px;
}

.shop-inv-slot.no-sell {
    opacity: 0.6;
}

.shop-inv-slot.no-sell::after {
    content: '✕';
    position: absolute;
    top: 2px;
    right: 5px;
    color: #ff6b6b;
    font-size: 12px;
}

/* Правая часть - торговец */
.shop-right {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, #2a2010 0%, #1a1005 100%);
}

.trader-portrait {
    text-align: center;
    margin-bottom: 20px;
}

.trader-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b6914, #654321);
    border: 4px solid #ffd700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    margin-bottom: 10px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.trader-name {
    font-size: 22px;
    color: #ffd700;
    font-weight: bold;
}

.trader-speech {
    background: #3a2a1a;
    border: 2px solid #654321;
    border-radius: 15px;
    padding: 15px;
    color: #ddd;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.trader-speech::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #654321;
}

.player-gold {
    background: linear-gradient(135deg, #4a3a2a, #3a2a1a);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gold-icon {
    font-size: 30px;
}

.gold-amount {
    font-size: 24px;
    color: #ffd700;
    font-weight: bold;
}

/* Модальные окна */
.shop-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.shop-modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 100%);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 25px;
    min-width: 300px;
    text-align: center;
}

.modal-header {
    font-size: 22px;
    color: #ffd700;
    margin-bottom: 20px;
}

.modal-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-icon {
    font-size: 40px;
}

.modal-name {
    font-size: 18px;
    color: #fff;
}

.modal-price, .modal-total {
    font-size: 16px;
    color: #ddd;
    margin-bottom: 15px;
}

.modal-total {
    font-size: 20px;
    color: #ffd700;
    font-weight: bold;
}

.modal-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.modal-amount label {
    color: #aaa;
}

.amount-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #654321;
    border-radius: 8px;
    background: #4a3a2a;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.amount-btn:hover {
    background: #5a4a3a;
    border-color: #ffd700;
}

.amount-btn.sell-all {
    width: auto;
    padding: 0 15px;
    font-size: 14px;
}

#buyAmountInput, #sellAmountInput {
    width: 60px;
    height: 35px;
    border: 2px solid #654321;
    border-radius: 8px;
    background: #2a1a0a;
    color: #fff;
    text-align: center;
    font-size: 16px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-btn.confirm {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.modal-btn.confirm:hover {
    background: linear-gradient(135deg, #34ce57, #28a745);
}

.modal-btn.cancel {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.modal-btn.cancel:hover {
    background: linear-gradient(135deg, #e4606d, #dc3545);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .shop-content {
        flex-direction: column-reverse;
        height: auto;
        max-height: none;
    }

    .shop-left {
        border-right: none;
        border-top: 2px solid #654321;
        max-height: 50vh;
    }

    .shop-right {
        padding: 15px;
    }

    .trader-avatar {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .trader-speech {
        font-size: 13px;
        padding: 10px;
    }

    .shop-items {
        grid-template-columns: repeat(3, 1fr);
    }

    .shop-inventory {
        grid-template-columns: repeat(4, 1fr);
    }

    .modal-content {
        width: 90%;
        min-width: auto;
    }
}


/* ============================================
   ПЛАВИЛЬНЯ
   ============================================ */

   .smeltery-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 600;
    display: none;
    justify-content: center;
    align-items: center;
}

.smeltery-overlay.active {
    display: flex;
}

.smeltery-container {
    background: linear-gradient(180deg, #2a1a0a 0%, #1a0a00 100%);
    border: 4px solid #ff6600;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(255, 100, 0, 0.5);
}

.smeltery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(90deg, #8b2500, #ff4500, #8b2500);
    border-bottom: 3px solid #ff6600;
}

.smeltery-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.smeltery-close {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.smeltery-content {
    display: flex;
    padding: 20px;
    gap: 20px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

/* Печи */
.smeltery-furnaces {
    flex: 2;
}

.smeltery-furnaces h3 {
    color: #ff6600;
    margin-bottom: 15px;
}

.furnaces-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.furnace-slot {
    background: linear-gradient(135deg, #3a2a1a, #2a1a0a);
    border: 3px solid #654321;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.furnace-slot.active {
    border-color: #ff6600;
    box-shadow: 0 0 20px rgba(255, 100, 0, 0.3);
}

.furnace-icon {
    width: 60px;
    height: 60px;
    background: #1a0a00;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    position: relative;
}

.furnace-icon.active {
    animation: furnaceGlow 1s ease infinite;
}

@keyframes furnaceGlow {
    0%, 100% { box-shadow: inset 0 0 20px #ff4500; }
    50% { box-shadow: inset 0 0 40px #ff6600; }
}

.furnace-info {
    flex: 1;
}

.furnace-status {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 5px;
}

.furnace-status.working {
    color: #ff6600;
}

.furnace-progress {
    height: 20px;
    background: #1a0a00;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.furnace-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4500, #ff6600, #ffcc00);
    width: 0%;
    transition: width 0.3s;
}

.furnace-result {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: #90ee90;
}

/* Ресурсы */
.smeltery-resources {
    flex: 1;
    min-width: 200px;
}

.resource-section {
    margin-bottom: 20px;
}

.resource-section h3 {
    color: #ff6600;
    margin-bottom: 10px;
    font-size: 16px;
}

.ores-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ore-item {
    background: #2a1a0a;
    border: 2px solid #654321;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.ore-item:hover {
    border-color: #ff6600;
    background: #3a2a1a;
}

.ore-icon {
    font-size: 24px;
}

.ore-info {
    flex: 1;
}

.ore-name {
    color: #ddd;
    font-size: 13px;
}

.ore-amount {
    color: #ff6600;
    font-size: 12px;
}

.fuel-info {
    background: #2a1a0a;
    border: 2px solid #654321;
    border-radius: 8px;
    padding: 10px;
}

.fuel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.fuel-item:last-child {
    margin-bottom: 0;
}

.fuel-icon {
    font-size: 20px;
}

.fuel-name {
    color: #aaa;
}

.fuel-amount {
    color: #ff6600;
    font-weight: bold;
}

.smelt-hint {
    background: rgba(255, 100, 0, 0.1);
    border: 1px solid #654321;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
}

.smelt-hint p {
    color: #aaa;
    font-size: 12px;
    margin: 5px 0;
}

/* Модальное окно плавки */
.smelt-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.smelt-modal.hidden {
    display: none;
}

.smelt-modal .modal-content {
    background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 100%);
    border: 3px solid #ff6600;
    border-radius: 15px;
    padding: 25px;
    min-width: 300px;
    text-align: center;
}

.smelt-modal .modal-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 40px;
    margin: 15px 0;
}

.smelt-modal .modal-names {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #ddd;
    margin-bottom: 20px;
}

.smelt-modal .modal-info {
    color: #aaa;
    font-size: 14px;
    margin: 15px 0;
}

.smelt-modal .modal-info p {
    margin: 5px 0;
}

/* ============================================
   ХРАНЕНИЕ В ДОМЕ
   ============================================ */

.house-storage-item {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s;
    text-align: center;
}

.house-storage-item:hover {
    transform: scale(1.1);
    z-index: 10;
}

.storage-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.storage-icon {
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.storage-count {
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-top: 2px;
}

/* Стек слитков - визуализация */
.stack-ingots {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.stack-ingot-row {
    display: flex;
    gap: 2px;
    margin-bottom: -8px;
}

/* Контекстное меню хранилища */
.storage-context-menu {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 10px;
    z-index: 100;
    min-width: 150px;
}

.storage-context-menu .menu-item {
    padding: 8px 15px;
    color: #ddd;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.2s;
}

.storage-context-menu .menu-item:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

/* ============================================
   РУДЫ - ЦВЕТА
   ============================================ */

.ore-iron { color: #a0a0a0; }
.ore-copper { color: #cd7f32; }
.ore-silver { color: #c0c0c0; }
.ore-gold { color: #ffd700; }
.ore-mithril { color: #00bfff; }

.ingot-iron { color: #808080; }
.ingot-copper { color: #b87333; }
.ingot-silver { color: #e0e0e0; }
.ingot-gold { color: #ffd700; }
.ingot-mithril { color: #40e0d0; }

/* Адаптация */
@media (max-width: 768px) {
    .smeltery-content {
        flex-direction: column;
    }

    .furnaces-grid {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .furnace-slot {
        flex: 1;
        min-width: 200px;
    }
}


/* ============================================
   ДИАЛОГ СБРОСА ПРЕДМЕТОВ
   ============================================ */

   .drop-item-dialog {
    background: rgba(0, 0, 0, 0.95);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 20px;
    min-width: 280px;
}

.drop-item-dialog .dialog-content {
    text-align: center;
}

.drop-item-dialog .dialog-header {
    color: #ffd700;
    font-size: 18px;
    margin-bottom: 15px;
}

.drop-item-dialog .dialog-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.drop-item-dialog .dialog-amount input {
    width: 80px;
    height: 40px;
    background: #1a1a1a;
    border: 2px solid #654321;
    border-radius: 8px;
    color: #fff;
    text-align: center;
    font-size: 18px;
}

.drop-item-dialog .dialog-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.drop-item-dialog .dialog-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #4a3a2a;
    color: #ddd;
}

.drop-item-dialog .dialog-btn:hover {
    background: #5a4a3a;
}

.drop-item-dialog .dialog-btn.confirm {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.drop-item-dialog .dialog-btn.cancel {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

/* ============================================
   КОНТЕКСТНОЕ МЕНЮ ХРАНИЛИЩА
   ============================================ */

.storage-context-menu {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 8px 0;
    z-index: 1000;
    min-width: 160px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.storage-context-menu .menu-title {
    padding: 8px 15px;
    color: #ffd700;
    font-weight: bold;
    font-size: 14px;
}

.storage-context-menu .menu-subtitle {
    padding: 0 15px 8px;
    color: #aaa;
    font-size: 12px;
}

.storage-context-menu .menu-divider {
    height: 1px;
    background: #654321;
    margin: 5px 0;
}

.storage-context-menu .menu-item {
    padding: 10px 15px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.storage-context-menu .menu-item:hover {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.storage-context-menu .menu-item.cancel {
    color: #ff6b6b;
}

/* ============================================
   СТЕК СЛИТКОВ ВИЗУАЛИЗАЦИЯ
   ============================================ */

.stack-ingots {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    padding: 5px;
}

.stack-ingot-row {
    display: flex;
    gap: 1px;
    margin-bottom: -10px;
}

.stack-ingot-icon {
    font-size: 16px;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
}

/* Разные металлы */
.stack-ingots.iron .stack-ingot-icon { filter: brightness(0.8) drop-shadow(1px 1px 2px #333); }
.stack-ingots.copper .stack-ingot-icon { filter: sepia(0.5) hue-rotate(-10deg); }
.stack-ingots.silver .stack-ingot-icon { filter: brightness(1.2); }
.stack-ingots.gold .stack-ingot-icon { filter: sepia(1) saturate(3) hue-rotate(10deg); }
.stack-ingots.mithril .stack-ingot-icon { filter: hue-rotate(180deg) brightness(1.3); }

/* ============================================
   ПЕЧЬ В ПЛАВИЛЬНЕ
   ============================================ */

.furnace-select-btn {
    padding: 8px 15px;
    background: linear-gradient(135deg, #ff6600, #cc5200);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    margin-top: 8px;
}

.furnace-select-btn:hover {
    background: linear-gradient(135deg, #ff8533, #ff6600);
    transform: scale(1.05);
}

/* Анимация огня */
@keyframes fireFlicker {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.1); }
}

.furnace-slot.active .furnace-icon::after {
    content: '🔥';
    position: absolute;
    animation: fireFlicker 0.5s ease infinite;
}

/* ============================================
   УВЕДОМЛЕНИЕ О РЕДКОЙ РУДЕ
   ============================================ */

.rare-ore-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    border: 3px solid #fff;
    border-radius: 15px;
    padding: 15px 30px;
    color: #000;
    font-size: 18px;
    font-weight: bold;
    z-index: 500;
    animation: rareOrePopup 3s ease forwards;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
}

@keyframes rareOrePopup {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Сообщение в чате о редкой руде */
.chat-message.system.rare {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 140, 0, 0.3));
    border-left: 4px solid #ffd700;
}

/* ============================================
   НЕТ РЕСУРСОВ
   ============================================ */

.no-ores {
    color: #888;
    text-align: center;
    padding: 20px;
    font-style: italic;
}


/* Выбранная печь */
.furnace-slot.selected {
    border-color: #ffcc00;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

/* Завершённая плавка */
.furnace-slot.completed {
    border-color: #90ee90;
    animation: completedPulse 1s ease infinite;
}

@keyframes completedPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(144, 238, 144, 0.5); }
    50% { box-shadow: 0 0 25px rgba(144, 238, 144, 0.8); }
}

/* Детали печи */
.furnace-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
}

.furnace-result {
    color: #90ee90;
}

.furnace-time {
    color: #ffcc00;
    font-weight: bold;
}

.furnace-name {
    color: #ff6600;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 3px;
}

/* Сообщение в плавильне */
.smeltery-message {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ff6600;
    border-radius: 10px;
    padding: 10px 20px;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.smeltery-message.visible {
    opacity: 1;
}



/* ============================================
   ИНТЕРЬЕР ДОМА
   ============================================ */

   .house-interior-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 500;
    display: none;
    justify-content: center;
    align-items: center;
}

.house-interior-overlay.active {
    display: flex;
}

.house-interior-container {
    width: 95%;
    max-width: 1000px;
    height: 85vh;
    background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 100%);
    border: 4px solid #8b4513;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Заголовок */
.house-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(90deg, #5a3a2a, #8b4513, #5a3a2a);
    border-bottom: 3px solid #654321;
}

.house-header h2 {
    margin: 0;
    color: #ffd700;
    font-size: 22px;
}

.house-exit-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
}

.house-exit-btn:hover {
    transform: scale(1.05);
}

/* Основной контент */
.house-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Пол дома */
.house-floor {
    flex: 1;
    position: relative;
    background: #4a3728;
    margin: 15px;
    border-radius: 10px;
    overflow: hidden;
    min-height: 400px;
}

/* Сетка пола (деревянные доски) */
.floor-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 60px,
            rgba(0,0,0,0.1) 60px,
            rgba(0,0,0,0.1) 62px
        ),
        repeating-linear-gradient(
            0deg,
            #5a4738 0px,
            #4a3728 3px,
            #5a4738 6px
        );
    background-size: 62px 6px;
    pointer-events: none;
}

/* Подсказка */
.floor-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.3);
    font-size: 18px;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s;
}

.house-floor.has-items .floor-hint,
.house-floor.dragging .floor-hint {
    opacity: 0;
}

.house-floor.drag-over {
    background: #5a4738;
    box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.3);
}

/* Контейнер предметов */
.house-items {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Предмет на полу */
.house-item {
    position: absolute;
    cursor: pointer;
    transition: transform 0.15s ease;
    user-select: none;
}

.house-item:hover {
    transform: scale(1.15);
    z-index: 10;
}

.house-item-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 5px 8px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.house-item:hover .house-item-content {
    border-color: #ffd700;
}

.house-item-icon {
    font-size: 32px;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.house-item-count {
    font-size: 12px;
    color: #ffd700;
    font-weight: bold;
    margin-top: 2px;
}

.house-item-name {
    font-size: 10px;
    color: #ccc;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Стопка слитков */
.house-item.ingot-stack .house-item-content {
    background: transparent;
    padding: 0;
}

.ingot-pile {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}

.ingot-row {
    display: flex;
    margin-bottom: -12px;
}

.ingot-row span {
    font-size: 20px;
    margin: 0 -2px;
}

/* Панель инвентаря */
.house-inventory-panel {
    width: 280px;
    background: rgba(0, 0, 0, 0.5);
    border-left: 3px solid #654321;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.house-inventory-panel h3 {
    color: #ffd700;
    margin: 0 0 15px 0;
    text-align: center;
}

.house-inventory-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    align-content: start;
}

.house-inv-slot {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #654321;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.house-inv-slot:hover:not(.empty) {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.house-inv-slot.empty {
    opacity: 0.5;
    cursor: default;
}

.house-inv-slot.selected {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.house-inv-slot.dragging {
    opacity: 0.5;
}

.house-inv-slot-icon {
    font-size: 24px;
}

.house-inv-slot-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 11px;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

/* Информация о хранилище */
.house-storage-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #654321;
    text-align: center;
    color: #aaa;
    font-size: 13px;
}

/* Превью выбранного предмета */
.selected-item-preview {
    position: fixed;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
}

.selected-item-preview.hidden {
    display: none;
}

.preview-icon {
    font-size: 28px;
}

.preview-name {
    color: #fff;
    font-size: 14px;
}

.preview-amount {
    color: #ffd700;
    font-size: 12px;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО КОЛИЧЕСТВА
   ============================================ */

.amount-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 600;
}

.amount-modal.hidden {
    display: none;
}

.amount-modal-content {
    background: linear-gradient(180deg, #3a2a1a 0%, #2a1a0a 100%);
    border: 3px solid #ffd700;
    border-radius: 15px;
    padding: 25px;
    min-width: 300px;
    text-align: center;
}

.amount-modal-header {
    color: #ffd700;
    font-size: 20px;
    margin-bottom: 20px;
}

.amount-modal-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.amount-item-icon {
    font-size: 36px;
}

.amount-item-name {
    color: #fff;
    font-size: 18px;
}

.amount-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.amount-controls input {
    width: 80px;
    height: 40px;
    text-align: center;
    font-size: 18px;
    background: #1a1a1a;
    border: 2px solid #654321;
    border-radius: 8px;
    color: #fff;
}

.amount-btn {
    width: 40px;
    height: 40px;
    background: #4a3a2a;
    border: 2px solid #654321;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.amount-btn:hover {
    background: #5a4a3a;
    border-color: #ffd700;
}

.amount-quick-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.quick-btn {
    padding: 8px 16px;
    background: #3a3a3a;
    border: 2px solid #555;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: #4a4a4a;
    border-color: #ffd700;
}

.amount-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.confirm-btn:hover {
    transform: scale(1.05);
}

.cancel-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #6c757d, #545b62);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .house-content {
        flex-direction: column;
    }

    .house-inventory-panel {
        width: 100%;
        border-left: none;
        border-top: 3px solid #654321;
        max-height: 200px;
    }

    .house-inventory-slots {
        grid-template-columns: repeat(6, 1fr);
    }
}



/* ============================================
   ИНТЕРЬЕР ДОМА
   ============================================ */

   .house-interior-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 400;
    display: none;
    justify-content: center;
    align-items: center;
}

.house-interior-overlay.active {
    display: flex;
}

.house-interior-container {
    width: 95%;
    max-width: 900px;
    height: 80vh;
    max-height: 700px;
    background: linear-gradient(180deg, #2a1a0a 0%, #1a0a00 100%);
    border: 4px solid #8b4513;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(139, 69, 19, 0.5);
}

/* Заголовок дома */
.house-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(90deg, #5a3a1a, #8b4513, #5a3a1a);
    border-bottom: 3px solid #654321;
}

.house-header h2 {
    margin: 0;
    color: #ffd700;
    font-size: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.house-exit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8b0000, #5a0000);
    border: 2px solid #ff4444;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.house-exit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
}

/* Комната */
.house-room {
    flex: 1;
    position: relative;
    margin: 15px;
    border-radius: 10px;
    overflow: hidden;
}

/* Пол комнаты */
.room-floor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            90deg,
            #5a4030 0px,
            #5a4030 48px,
            #4a3020 48px,
            #4a3020 50px
        ),
        repeating-linear-gradient(
            0deg,
            #5a4030 0px,
            #4a3525 2px
        );
    background-color: #4a3525;
}

/* Декор */
.room-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.decor-carpet {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 120px;
    background: linear-gradient(135deg, #8b0000, #5a0000);
    border-radius: 5px;
    border: 4px solid #ffd700;
    opacity: 0.7;
}

.decor-table {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 50px;
    background: #3a2515;
    border-radius: 5px;
    border: 3px solid #2a1a0a;
}

/* Сундуки в комнате */
.room-chests {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.room-chest {
    position: absolute;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.room-chest:hover {
    transform: scale(1.1);
    z-index: 20;
}

.room-chest:hover .chest-glow {
    opacity: 1;
}

.chest-sprite {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chest-body {
    font-size: 48px;
    filter: drop-shadow(3px 3px 5px rgba(0,0,0,0.5));
    transition: transform 0.2s;
}

.room-chest:hover .chest-body {
    transform: translateY(-5px);
}

.chest-label {
    margin-top: 5px;
    padding: 3px 10px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    color: #ffd700;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid #654321;
}

.chest-count {
    font-size: 10px;
    color: #aaa;
    margin-top: 2px;
}

.chest-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255,215,0,0.3) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

/* Легенда сундуков */
.chests-legend {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 2px solid #654321;
}

.legend-title {
    color: #ffd700;
    font-size: 14px;
    margin-bottom: 8px;
}

.legend-items {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.legend-item:hover {
    background: rgba(255, 215, 0, 0.2);
}

.legend-item-icon {
    font-size: 20px;
}

.legend-item-name {
    color: #ddd;
    font-size: 12px;
}

.legend-item-count {
    color: #888;
    font-size: 11px;
}

/* Подсказка в комнате */
.room-hint {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    color: #aaa;
    font-size: 13px;
    pointer-events: none;
}

/* ============================================
   ИНТЕРФЕЙС СУНДУКА
   ============================================ */

.chest-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 500;
    display: none;
    justify-content: center;
    align-items: center;
}

.chest-overlay.active {
    display: flex;
}

.chest-interface {
    width: 95%;
    max-width: 950px;
    background: linear-gradient(180deg, #2a2a3a 0%, #1a1a2a 100%);
    border: 3px solid #6a5acd;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(106, 90, 205, 0.4);
}

/* Заголовок сундука */
.chest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(90deg, #3a3a5a, #4a4a6a, #3a3a5a);
    border-bottom: 2px solid #6a5acd;
}

.chest-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chest-icon {
    font-size: 28px;
}

.chest-name {
    color: #ffd700;
    font-size: 20px;
    font-weight: bold;
}

.chest-close-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.chest-close-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
}

/* Контент сундука */
.chest-content {
    display: flex;
    padding: 15px;
    gap: 15px;
    min-height: 400px;
}

/* Панели (сундук и инвентарь) */
.chest-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #4a4a6a;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #4a4a6a;
}

.panel-title {
    color: #ddd;
    font-size: 14px;
    font-weight: bold;
}

.panel-count {
    color: #888;
    font-size: 13px;
}

/* Сетка слотов */
.chest-slots,
.inventory-slots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    flex: 1;
    align-content: start;
    overflow-y: auto;
    padding-right: 5px;
}

/* Один слот */
.slot {
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #3a3a5a;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    min-height: 55px;
}

.slot:hover {
    border-color: #6a5acd;
    background: rgba(106, 90, 205, 0.2);
}

.slot.selected {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.15);
}

.slot.empty {
    opacity: 0.5;
    cursor: default;
}

.slot.empty:hover {
    border-color: #3a3a5a;
    background: rgba(0, 0, 0, 0.5);
}

.slot-icon {
    font-size: 26px;
    line-height: 1;
}

.slot-count {
    position: absolute;
    bottom: 3px;
    right: 5px;
    font-size: 11px;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.slot-name {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #aaa;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    background: rgba(0,0,0,0.8);
    padding: 2px 5px;
    border-radius: 3px;
}

.slot:hover .slot-name {
    opacity: 1;
}

/* Цветовая маркировка типов */
.slot.type-weapon { border-color: #ff6b6b; }
.slot.type-tool { border-color: #4ecdc4; }
.slot.type-resource { border-color: #95e1d3; }
.slot.type-ore { border-color: #dfe6e9; }
.slot.type-ingot { border-color: #ffeaa7; }
.slot.type-food { border-color: #a29bfe; }
.slot.type-fish { border-color: #74b9ff; }

/* Панель переноса */
.transfer-panel {
    width: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
}

.transfer-info {
    text-align: center;
    color: #aaa;
    font-size: 13px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transfer-info.has-item {
    color: #ffd700;
    font-size: 14px;
}

.transfer-amount {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.transfer-amount.visible {
    display: flex;
}

.transfer-amount label {
    color: #888;
    font-size: 12px;
}

.amount-selector {
    display: flex;
    align-items: center;
    gap: 5px;
}

.amt-btn {
    width: 32px;
    height: 32px;
    background: #3a3a5a;
    border: 1px solid #5a5a7a;
    border-radius: 5px;
    color: #ddd;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.amt-btn:hover {
    background: #4a4a6a;
    border-color: #ffd700;
}

#transferAmountInput {
    width: 50px;
    height: 32px;
    text-align: center;
    background: #1a1a2a;
    border: 2px solid #4a4a6a;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
}

/* Кнопки переноса */
.transfer-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.transfer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.transfer-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.transfer-btn.to-chest {
    background: linear-gradient(135deg, #6a5acd, #483d8b);
    color: white;
}

.transfer-btn.to-chest:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(106, 90, 205, 0.5);
}

.transfer-btn.to-inventory {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.transfer-btn.to-inventory:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.5);
}

/* Быстрые действия */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #4a4a6a;
}

.quick-btn {
    padding: 8px 12px;
    background: #2a2a3a;
    border: 1px solid #4a4a6a;
    border-radius: 6px;
    color: #aaa;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-btn:hover {
    background: #3a3a4a;
    color: #fff;
    border-color: #6a5acd;
}

/* Подвал */
.chest-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid #4a4a6a;
}

.chest-footer .hint {
    color: #666;
    font-size: 12px;
}

/* ============================================
   ТИПЫ СУНДУКОВ (цвета)
   ============================================ */

/* Сундук ресурсов */
.chest-interface.type-resources {
    border-color: #4ecdc4;
}
.chest-interface.type-resources .chest-header {
    background: linear-gradient(90deg, #1a3a38, #2a4a48, #1a3a38);
}
.chest-interface.type-resources .chest-name {
    color: #4ecdc4;
}

/* Сундук оружия */
.chest-interface.type-weapons {
    border-color: #ff6b6b;
}
.chest-interface.type-weapons .chest-header {
    background: linear-gradient(90deg, #3a1a1a, #4a2a2a, #3a1a1a);
}
.chest-interface.type-weapons .chest-name {
    color: #ff6b6b;
}

/* Сундук инструментов */
.chest-interface.type-tools {
    border-color: #ffd93d;
}
.chest-interface.type-tools .chest-header {
    background: linear-gradient(90deg, #3a3a1a, #4a4a2a, #3a3a1a);
}
.chest-interface.type-tools .chest-name {
    color: #ffd93d;
}

/* Сундук руды/слитков */
.chest-interface.type-ores {
    border-color: #a8a8a8;
}
.chest-interface.type-ores .chest-header {
    background: linear-gradient(90deg, #2a2a2a, #3a3a3a, #2a2a2a);
}
.chest-interface.type-ores .chest-name {
    color: #ddd;
}

/* Сундук еды */
.chest-interface.type-food {
    border-color: #a29bfe;
}
.chest-interface.type-food .chest-header {
    background: linear-gradient(90deg, #2a1a3a, #3a2a4a, #2a1a3a);
}
.chest-interface.type-food .chest-name {
    color: #a29bfe;
}

/* ============================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ
   ============================================ */

@media (max-width: 900px) {
    .chest-content {
        flex-direction: column;
    }

    .chest-panel {
        min-height: 200px;
    }

    .transfer-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
    }

    .transfer-buttons {
        flex-direction: row;
    }

    .quick-actions {
        flex-direction: row;
        border-top: none;
        border-left: 1px solid #4a4a6a;
        padding-top: 0;
        padding-left: 15px;
        margin-top: 0;
        margin-left: 15px;
    }

    .chest-slots,
    .inventory-slots {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 600px) {
    .chest-slots,
    .inventory-slots {
        grid-template-columns: repeat(4, 1fr);
    }

    .slot {
        min-height: 50px;
    }

    .slot-icon {
        font-size: 22px;
    }
}

/* ============================================
   ЭКРАН ЗАГРУЗКИ
   ============================================ */

   .loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h1 {
    font-size: 48px;
    margin-bottom: 40px;
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.5);
}

.loading-bar {
    width: 400px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 2px solid rgba(100, 255, 218, 0.3);
}

.loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #64ffda, #00bfa5);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.loading-text {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 10px;
}

.loading-percent {
    font-size: 24px;
    color: #64ffda;
    font-weight: bold;
}

@media (max-width: 768px) {
    .loading-content h1 {
        font-size: 32px;
    }

    .loading-bar {
        width: 80%;
    }
}

/* ========== ПИКСЕЛЬНЫЕ ШРИФТЫ ========== */
@font-face {
    font-family: 'PixelFont';
    src: url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
}