/* styles/main.css
 * Путь: /styles/main.css
 * Описание: Основные стили игры
 */

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

body {
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: #000;
    color: #fff;
}

canvas {
    display: block;
    cursor: pointer;
}

canvas.rotating {
    cursor: grab;
}

canvas.hovering-occupied {
    cursor: not-allowed;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #fff;
    z-index: 1000;
}

#ui {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.6;
    z-index: 100;
    max-width: 250px;
}

#ui div {
    margin-bottom: 10px;
}

#ui span {
    color: #4CAF50;
    font-weight: bold;
}

.grid-toggle {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.grid-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.grid-toggle input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.controls div {
    margin-bottom: 5px;
}

/* Кнопка редактора мира */
.editor-button-wrapper {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.editor-button {
    width: 100%;
    padding: 10px 15px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.editor-button:hover {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.editor-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Мобильная кнопка для показа UI */
.ui-toggle-btn {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #4CAF50;
    border-radius: 50%;
    color: #4CAF50;
    font-size: 24px;
    cursor: pointer;
    z-index: 101;
    transition: all 0.3s ease;
}

.ui-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    #ui {
        font-size: 12px;
        padding: 15px;
    }
    
    .editor-button {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    #ui {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        max-width: none;
        background: rgba(0, 0, 0, 0.95);
        border-radius: 0;
        padding: 60px 20px 20px;
        font-size: 16px;
    }
    
    #ui.mobile {
        display: block;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    #ui.mobile.show {
        transform: translateX(0);
    }
    
    .ui-toggle-btn {
        display: block;
    }
    
    .controls {
        font-size: 14px;
    }
    
    .editor-button {
        font-size: 16px;
        padding: 12px 20px;
    }
}

/* Анимация загрузки */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

#loading {
    animation: pulse 1.5s infinite;
}

/* Подсказки при наведении */
[title] {
    position: relative;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
}

/* Дополнительные стили для улучшения внешнего вида */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
/* Добавьте эти стили в ваш файл styles/main.css */

/* Курсор при наведении на камень */
canvas.hovering-rock {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="%23fff" stroke="%23000" stroke-width="2" d="M8 24L24 8l-2-2L6 22v6h6l16-16-2-2L10 26"/><circle cx="24" cy="8" r="3" fill="%23ff0" stroke="%23000"/></svg>') 16 16, crosshair !important;
}

/* Альтернативный вариант с эмодзи курсором */
canvas.hovering-rock {
    cursor: crosshair !important;
}

/* Индикатор прочности кирки (для будущего UI) */
.pickaxe-durability {
    position: absolute;
    bottom: 60px;
    right: 20px;
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
}

.pickaxe-durability-bar {
    height: 100%;
    background: linear-gradient(to right, #ff4444, #ffaa00, #44ff44);
    transition: width 0.3s ease;
}

.pickaxe-durability-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 20px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

/* Анимация добычи */
@keyframes mining-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

canvas.mining {
    animation: mining-shake 0.2s infinite;
}

/* Всплывающие ресурсы (для будущего) */
.resource-popup {
    position: absolute;
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 5px;
    font-size: 14px;
    pointer-events: none;
    animation: float-up 2s ease-out forwards;
}

@keyframes float-up {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}
/* styles/main.css - добавьте эти стили в ваш файл */

/* === СТИЛИ ДЛЯ ИНВЕНТАРЯ === */
#inventory {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    border: 2px solid #333;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.inventory-slot {
    width: 50px;
    height: 50px;
    background: rgba(100, 100, 100, 0.5);
    border: 2px solid #555;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.inventory-slot:hover {
    background: rgba(150, 150, 150, 0.5) !important;
    border-color: #888 !important;
    transform: scale(1.05);
}

.inventory-slot.active {
    background: rgba(200, 200, 100, 0.5) !important;
    border-color: #FFD700 !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); 
    }
    50% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); 
    }
}

.item-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.8));
}

.item-tooltip {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    display: none;
    pointer-events: none;
    z-index: 1000;
    border: 1px solid #444;
}

.inventory-slot:hover .item-tooltip {
    display: block !important;
    animation: tooltipFadeIn 0.2s ease-in;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Анимация смены предмета */
#item-notification {
    animation: fadeInOut 2s ease-in-out;
}

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

/* Анимация неправильного инструмента */
@keyframes shake {
    0%, 100% { 
        transform: translate(-50%, -50%) translateX(0); 
    }
    10%, 30%, 50%, 70%, 90% { 
        transform: translate(-50%, -50%) translateX(-10px); 
    }
    20%, 40%, 60%, 80% { 
        transform: translate(-50%, -50%) translateX(10px); 
    }
}

/* === АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ === */
@media (max-width: 768px) {
    #inventory {
        bottom: 15px;
        padding: 8px;
        gap: 4px;
    }
    
    .inventory-slot {
        width: 45px !important;
        height: 45px !important;
    }
    
    .item-icon {
        font-size: 24px !important;
    }
}

@media (max-width: 480px) {
    #inventory {
        bottom: 10px;
        padding: 5px;
        gap: 3px;
        max-width: 95vw;
    }
    
    .inventory-slot {
        width: 40px !important;
        height: 40px !important;
    }
    
    .item-icon {
        font-size: 22px !important;
    }
    
    .item-tooltip {
        font-size: 11px;
        bottom: 55px;
    }
}

/* === СУЩЕСТВУЮЩИЕ СТИЛИ === */
/* Добавьте эти стили в конец файла, чтобы не перезаписать существующие */
/* Добавьте эту анимацию в ваш файл styles/main.css */

@keyframes shake {
    0%, 100% { 
        transform: translate(-50%, -50%) translateX(0); 
    }
    10%, 30%, 50%, 70%, 90% { 
        transform: translate(-50%, -50%) translateX(-10px); 
    }
    20%, 40%, 60%, 80% { 
        transform: translate(-50%, -50%) translateX(10px); 
    }
}