:root {
    --bg-primary: #1e1e2e;
    --bg-secondary: #252536;
    --bg-tertiary: #2a2a3a;
    --bg-items: #333344;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --accent-color: #7700ff;
    --color-orange: #ffaa00;
    --color-warning: #aa0000;
    --border-color: #444444;
    --hover-color: #3a3a4a;
    --sidebar-width: 200px;
    --info-panel-width: 400px;
    --item-size: 60px;
    --item-icon-size: 54px;
    --color-lime: #55FF55;
    --pin-color: #4CAF50;
    --color-light-blue: #55FFFF;
    --color-yellow: #FFFF55;
    --color-purple: #AA00AA;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    min-height: 100vh;
}

.container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--info-panel-width);
    height: 100vh;
}

/* Боковая панель */
.sidebar {
    background: var(--bg-secondary);
    padding: 15px;
    overflow-y: auto;
}

.category {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    word-break: break-word;
}

.category:hover {
    background: var(--hover-color);
}

/* Основная область */
.main-content {
    padding: 20px;
    overflow-y: auto;
}

.items-section h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.items-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--item-size), 1fr));
    gap: 12px;
}

.item-btn {
    width: 100%;
    aspect-ratio: 1;
    max-width: var(--item-size);
    background: var(--bg-items);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.item-btn:hover {
    transform: scale(1.1);
    background: var(--hover-color);
    box-shadow: 0 0 12px rgba(119, 0, 255, 0.6);
}

.item-btn img {
    width: var(--item-icon-size);
    height: var(--item-icon-size);
    object-fit: contain;
}

/* Панель информации */
.info-panel {
    background: var(--bg-tertiary);
    padding: 20px;
    overflow-y: auto;
}

.info-default {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.pin-hint {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--pin-color);
}

.info-content {
    display: none;
}

.info-content.pinned {
    display: block;
    position: relative;
    border: 2px solid var(--pin-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.info-content.pinned::after {
    content: "Закреплено (кликните чтобы открепить)";
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8em;
    color: var(--pin-color);
}

/* Стили для информации о предмете */
.item-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-icon, .craft-result {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.item-icon {
    max-width: 100px;
}

.item-name {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    text-align: center;
    color: #fff;
    word-break: break-word;
}

.item-description {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    line-height: 1.5;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Стили для крафта */
.craft-section, .additional-craft {
    margin-top: 20px;
}

.craft-section h4, .additional-craft h4 {
    margin-bottom: 10px;
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.additional-craft h4 {
    color: var(--color-orange);
}

.craft-process {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    flex-wrap: wrap;
}

.craft-result {
    max-width: 400px;
}

.additional-craft {
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
}

.footnote {
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-style: italic;
}

.item-color-light-blue{
  color: var(--color-light-blue);
  font-weight: bold;
  }

.item-color-yellow{
  color: var(--color-yellow);
  font-weight: bold;
}

.item-accent {
    color: var(--color-orange);
    font-weight: bold;
}

.item-color-lime {
    color: var(--color-lime);
    font-weight: bold;
}

.item-color-purple{
  color: var(--color-purple);
  font-weight: bold;
}

.warning-text {
    color: var(--color-warning);
    font-style: italic;
}

.img__img_ench {
    animation-name: ench;
    animation-duration: 3s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

/* Добавляем к существующим стилям */
.item-btn.active {
    transform: scale(1.1);
    box-shadow: 0 0 0 3px var(--pin-color);
    background: var(--hover-color);
    position: relative;
}

.item-btn.active::after {
    content: "✓";
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: var(--pin-color);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.version-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-secondary);
    text-align: center;
    padding: 8px 0;
    font-size: 0.8em;
    z-index: 1000;
    backdrop-filter: blur(2px);
    border-top: 1px solid var(--border-color);
}

.version-footer span {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Для мобильных адаптируем положение */
@media (max-width: 768px) {
    .version-footer {
        padding: 6px 0;
        font-size: 0.7em;
    }
}

@keyframes ench {
    from {
        filter: drop-shadow(0px 0px 2px #de9cff);
    }
    50% {
        filter: drop-shadow(0px 0px 6px #de9cff) hue-rotate(20deg);
    }
    to {
        filter: drop-shadow(0px 0px 2px #de9cff);
    }
}

/* Адаптивность */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 160px;
        --info-panel-width: 250px;
        --item-size: 50px;
        --item-icon-size: 46px;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: auto;
        min-height: 100vh;
    }
    
    .sidebar {
        order: 1;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }
    
    .category {
        margin-bottom: 0;
        flex: 1 1 120px;
        text-align: center;
    }
    
    .main-content {
        order: 2;
    }
    
    .info-panel {
        order: 3;
        max-height: 400px;
    }
    
    .pin-hint {
        display: none;
    }
}

@media (max-width: 480px) {
    :root {
        --item-size: 45px;
        --item-icon-size: 40px;
    }
    
    .item-name {
        font-size: 1.3rem;
    }
}