@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', cursive;
    background: #1a1a1a;
    color: #fff;
    min-height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.3) 2px, rgba(0, 0, 0, 0.3) 4px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%);
    border: 4px solid #000;
    box-shadow: 0 8px 0 #000, 0 8px 20px rgba(0, 0, 0, 0.5);
}

.minecraft-title {
    font-size: 2.5rem;
    color: #FFD700;
    text-shadow: 4px 4px 0 #000;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 0.8rem;
    color: #AAA;
    text-shadow: 2px 2px 0 #000;
}

.search-section {
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    background: #2a2a2a;
    border: 3px solid #555;
    color: #fff;
    margin-bottom: 20px;
    outline: none;
}

.search-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    background: #4a4a4a;
    border: 3px solid #555;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #5a5a5a;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #2ecc71;
    border-color: #27ae60;
    box-shadow: 0 4px 0 #1e8449;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.item-card {
    background: #2a2a2a;
    border: 4px solid #555;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.item-card:hover {
    transform: translateY(-5px);
    border-color: #FFD700;
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.2);
}

.item-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 15px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-icon img {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.item-name {
    font-size: 0.7rem;
    text-align: center;
    color: #FFD700;
    text-shadow: 2px 2px 0 #000;
    word-wrap: break-word;
}

.item-category {
    font-size: 0.5rem;
    text-align: center;
    color: #888;
    margin-top: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    background: #2a2a2a;
    margin: 5% auto;
    padding: 30px;
    border: 4px solid #FFD700;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.close {
    color: #aaa;
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover {
    color: #FFD700;
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    min-height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon img {
    width: 128px;
    height: 128px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.modal-title {
    font-size: 1.5rem;
    color: #FFD700;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 10px;
}

.modal-category {
    font-size: 0.7rem;
    color: #888;
}

.modal-section {
    margin: 25px 0;
    padding: 20px;
    background: #1a1a1a;
    border: 3px solid #555;
}

.section-title {
    font-size: 0.9rem;
    color: #2ecc71;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0 #000;
}

.modal-description {
    font-size: 0.7rem;
    line-height: 1.6;
    color: #ccc;
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    gap: 5px;
    margin: 20px auto;
    justify-content: center;
    background: #3a3a3a;
    padding: 15px;
    border: 3px solid #666;
}

.recipe-slot {
    width: 60px;
    height: 60px;
    background: #1a1a1a;
    border: 2px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: relative;
    cursor: help;
}

.recipe-slot img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.recipe-slot:hover {
    background: #2a2a2a;
    border-color: #FFD700;
    transform: scale(1.1);
    transition: all 0.2s;
    z-index: 10;
}

.recipe-slot[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #FFD700;
    padding: 8px 12px;
    border: 3px solid #FFD700;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.6rem;
    font-family: 'Press Start 2P', cursive;
    margin-bottom: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
}

.recipe-arrow {
    text-align: center;
    font-size: 2rem;
    margin: 20px 0;
    color: #FFD700;
}

.recipe-result {
    text-align: center;
    margin-top: 20px;
}

.result-item {
    display: inline-block;
    background: #1a1a1a;
    border: 3px solid #FFD700;
    padding: 20px;
}

.result-icon {
    font-size: 3rem;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-icon img {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.result-text {
    font-size: 0.7rem;
    color: #FFD700;
    margin-top: 10px;
}

.properties-list {
    list-style: none;
    font-size: 0.6rem;
    line-height: 2;
}

.properties-list li {
    padding: 8px;
    background: #1a1a1a;
    margin: 5px 0;
    border-left: 4px solid #2ecc71;
}

@media (max-width: 768px) {
    .minecraft-title {
        font-size: 1.5rem;
    }
    
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .filter-btn {
        font-size: 0.5rem;
        padding: 8px 15px;
    }
}
