.page {
    display: flex;
    flex-direction: row;
    max-width: 1200px;  /* <-- Повернули назад */
    margin: 0 auto;
    padding: 120px 20px 50px 20px;
    gap: 30px;
    min-height: 80vh;
    box-sizing: border-box;
    opacity: 0;
    animation: contentFadeUp 0.8s ease-out 0.2s forwards;
}

.wiki {
    background-color: #ffffffc2;
    border-radius: 15px;
    color: var(--color-text-dark);
    transform: scale(1.12);
}

.book-img {
    filter: invert(0.2);
}


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

@keyframes fadeIn {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

@keyframes fadeRight {
    from { 
        opacity: 0; 
        transform: translateX(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

/* ========================================================================== */
/* ОСНОВНИЙ САЙДБАР (КРАЙНІЙ СПРАВА) */
/* ========================================================================== */

.sidebar {
    position: fixed;
    top: 50%;
    right: 85px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
    opacity: 0;
    animation: sidebarFadeIn 0.6s ease-out 0.5s forwards;
}

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

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(27, 27, 27, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-link::before {
    content: attr(title);
    position: absolute;
    right: 54px;
    background: rgba(27, 26, 27, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.sidebar-link:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.sidebar-link img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    transition: transform 0.3s ease;
}

.sidebar-link:hover img {
    transform: scale(1.15);
}

/* ========================================================================== */
/* ДРУГИЙ САЙДБАР (ЛІВІШЕ ВІД ОСНОВНОГО) */
/* ========================================================================== */

.sidebar-secondary {
    right: 30px;
    animation: sidebarSecondaryFadeIn 0.6s ease-out 0.7s forwards;
}

.sidebar-link.active {
background: rgba(255, 255, 255, 0.15);
box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

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


/* ========================================================================== */
/* CONTENT */
/* ========================================================================== */

.content {
    flex: 1;
    width: 100%;  /* <-- Додано */
    background: linear-gradient(169deg, #1b1a1b 0%, #1b1a1b 100%);
    border: 1px solid #cccccc;
    border-radius: 12px;
    padding: 40px;
    color: #ffffff;
}

/* ========================================================================== */
/* BREADCRUMB */
/* ========================================================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.9em;
    color: #666;
}

.breadcrumb a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #ffffff;
}

/* ========================================================================== */
/* CONTENT HEADER */
/* ========================================================================== */

.content h1 {
    font-family: 'Minecraft', monospace;
    font-size: 2.5em;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 20px;
    text-shadow: 2px 2px 0px #000;
}

.content .intro {
    font-family: 'Nunito-normal', sans-serif;
    font-size: 1.1em;
    line-height: 1.7;
    color: #e0e0e0;
    margin-bottom: 15px;
}

.content hr {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin: 30px 0;
}

/* ========================================================================== */
/* ITEM CARD */
/* ========================================================================== */

.item {
    display: grid;
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto auto;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(0,0,0,0) 100%);
    border-left: 3px solid #444;
    border-radius: 6px;
    scroll-margin-top: 130px;
    transition: all 0.3s ease;
}

.item:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0) 100%);
    border-left-color: #fff;
    transform: translateX(5px);
}

/* ========================================================================== */
/* ITEM ICON */
/* ========================================================================== */

.item .icon {
    grid-row: 1 / 3;
    width: 64px;
    height: 64px;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    box-sizing: border-box;
    image-rendering: pixelated;
    transition: all 0.3s ease;
    margin-right: 10px;
}

/* ========================================================================== */
/* ITEM INFO */
/* ========================================================================== */

.item .info {
    flex-wrap: wrap;
    flex-direction: column;
    gap: 10px;
}

.item h2 {
    font-family: 'Minecraft', monospace;
    font-size: 1.2em;
    color: #e0e0e0;
    margin: 0;
    width: 100%;
    transition: color 0.3s ease;
    padding-left: 10px;
}

.item:hover h2 {
    color: #ffffff;
}

.item .sub {
    font-family: 'Minecraft', monospace;
    font-size: 0.85em;
    color: #888;
    margin: 0;
    width: 100%;
    padding-left: 10px;
    margin-top: 7px;
}

.item-sub{
    font-family: 'Minecraft', monospace;
    transition: all 0.3s ease;
    color: #888;
}

.item-sub:hover{
    font-family: 'Minecraft', monospace;
    transition: all 0.3s ease;
    color: #bebebe;
}

.item .hunger,
.item .hunger_yellow {
    display: block;   /* кожен займе окрему лінію */
}

.food {
    display: flex;
    flex-direction: column;
    gap: 2px; /* відстань між hunger та hunger_yellow */
    background-color: #1a1a1a10;
    padding: 8px;
    border-radius: 6px;  /* рамочка */
    border: 2px solid #333; /* сіра рамка */
    width: fit-content;  /* щоб рамка була під розмір іконок */
    margin-left: 10px;
}

.item .hunger,
.item .hunger_yellow {
    display: flex;     /* головне!!! */
    flex-direction: row;
}


.item .hunger img {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
}

.item .hunger_yellow img {
    width: 12px;
    height: 12px;
    image-rendering: pixelated;
    gap: 10px;
}




/* ========================================================================== */
/* TAGS */
/* ========================================================================== */

.tag {
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.75em;
    padding: 4px 12px;
    background: rgba(53, 53, 53, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: #888;
}

.tag.epic { background: rgba(255, 85, 255, 0.1); border-color: rgba(170, 85, 170, 0.5); color: #f5f; }
.tag.legendary { background: rgba(255, 170, 0, 0.1); border-color: rgba(170, 136, 0, 0.5); color: #fa0; }
.tag.rare { background: rgba(85, 255, 255, 0.1); border-color: rgba(85, 170, 170, 0.5); color: #5ff; }

/* ========================================================================== */
/* ITEM DESCRIPTION */
/* ========================================================================== */

.item .desc {
    grid-column: 1 / -1;
    color: #aaa;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 15px 0;
    font-family: 'Nunito-normal', sans-serif;
}

/* ========================================================================== */
/* CRAFT SECTION */
/* ========================================================================== */

.item .craft {
    grid-column: 1 / -1;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.9em;
}

.item .craft img {
    max-width: 2000px;
    image-rendering: pixelated;
    margin: 5px 10px 5px 0;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.item .craft img:hover {
    transform: scale(1.02);
}

.item .title_craft {
    font-family: 'Minecraft', monospace;
    color: #bbbbbb;
    line-height: 1.6;
    margin-bottom: -3px;
}

.item .subtitle-craft {
    font-family: 'Minecraft', monospace;
    color: #868686;
    line-height: 1.8;
}

/* ========================================================================== */
/* BACK LINK */
/* ========================================================================== */

.back {
    display: inline-block;
    font-family: 'Nunito-normal', sans-serif;
    font-size: 0.95em;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back:hover {
    color: #ffffff;
    transform: translateX(-5px);
}

/* ========================================================================== */
/* RESPONSIVE */
/* ========================================================================== */

@media (max-width: 1450px) {
    .sidebar {
        display: none;
    }
}

@media (max-width: 992px) {
    .page { padding: 120px 20px 40px; }
    .content { padding: 30px; }
    .content h1 { font-size: 2em; }
    .item { padding: 12px 18px; }
    .item .icon { width: 56px; height: 56px; }
}

@media (max-width: 768px) {
    .page { padding: 120px 15px 40px; }
    .content { padding: 25px 20px; }
    .content h1 { font-size: 1.8em; }
    .item { grid-template-columns: 56px 1fr; gap: 0 15px; padding: 12px 15px; }
    .item .icon { width: 56px; height: 56px; padding: 6px; }
    .item h2 { font-size: 1.1em; }
    .item .desc { font-size: 0.9em; }
    .tag { font-size: 0.7em; padding: 3px 10px; }
}

@media (max-width: 600px) {
    .page { padding: 130px 15px 40px; }
    .content { padding: 20px 15px;}
    .breadcrumb { font-size: 0.85em; margin-bottom: 15px; flex-wrap: wrap; }
    .content h1 { font-size: 1.5em; text-shadow: 1px 1px 0px #000; }
    .content .intro { font-size: 1em; }
    .item { grid-template-columns: 50px 1fr; gap: 0 12px; padding: 12px 15px; }
    .item .icon { width: 50px; height: 50px; padding: 5px; }
    .item h2 { font-size: 1em; }
    .item .sub { font-size: 0.8em; }
    .item .desc { font-size: 0.85em; margin: 12px 0; }
    .item .craft { padding-top: 12px; font-size: 0.85em; }
    .item .craft img { max-width: 140px; }
    .tag { font-size: 0.65em; padding: 3px 8px; }
    .back { font-size: 0.9em; margin-top: 15px; }
}

@media (max-width: 400px) {
    .page { padding: 120px 10px 30px; }
    .content { padding: 15px 12px; }
    .content h1 { font-size: 1.3em; }
    .item { grid-template-columns: 45px 1fr; gap: 0 10px; padding: 10px 12px; }
    .item .icon { width: 45px; height: 45px; }
    .item h2 { font-size: 0.95em; }
    .item .craft img { max-width: 120px; }
}