@font-face {
    font-family: 'Galactic';
    src: url('/assets/galactic-alphabet.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Minecraft';
    src: url('/assets/Minecraft.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'Minecraft', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0d0d12;
    min-height: 100vh;
    color: #e4e4e7;
}

header {
    background: #12121a;
    padding: 40px 20px;
    text-align: center;
    border-bottom: 1px solid #1f1f2e;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.logo {
    width: 60px;
    height: 60px;
    animation: float 3s ease-in-out infinite;
}

.title-image {
    max-width: 300px;
    height: auto;
    image-rendering: pixelated;
}

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

.subtitle {
    font-size: 0.85rem;
    color: #6b6b7a;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Minecraft', 'Courier New', Courier, monospace;
}

.search-container {
    max-width: 500px;
    margin: 30px auto;
    padding: 0 20px;
}

#search {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    border: 1px solid #1f1f2e;
    border-radius: 8px;
    background: #15151f;
    color: #e4e4e7;
    outline: none;
    transition: border-color 0.2s ease;
}

#search:focus {
    border-color: #5b5b80;
}

#search::placeholder {
    color: #52525b;
}

.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.filter-btn {
    padding: 10px 18px;
    border: 1px solid #1f1f2e;
    border-radius: 6px;
    background: #15151f;
    color: #8a8a9d;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Minecraft', 'Courier New', Courier, monospace;
}

.filter-btn:hover {
    background: #1f1f2e;
    color: #e4e4e7;
}

.filter-btn.active {
    background: #2a2a3d;
    color: #e4e4e7;
    border-color: #3d3d52;
}

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

.section-title {
    font-size: 0.75rem;
    color: #6b6b7a;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 24px;
    padding-left: 10px;
    font-family: 'Minecraft', 'Courier New', Courier, monospace;
}

.enchant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.enchant-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.enchant-card {
    background: #15151f;
    border: 1px solid #1f1f2e;
    border-radius: 8px;
    padding: 20px 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 130px;
    width: 100%;
}

.enchant-card:hover {
    background: #1a1a25;
    border-color: #3d3d52;
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.enchant-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, #2a2a3d 1px, transparent 1px);
    background-size: 8px 8px;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.enchant-card:hover::before {
    opacity: 0.4;
}

.enchant-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
    transition: transform 0.1s ease;
}

.enchant-rarity {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: #0d0d12;
    border-radius: 6px;
    width: 70px;
    flex-shrink: 0;
    border: 1px solid #1f1f2e;
    gap: 4px;
}

.rarity-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    font-family: 'Minecraft', 'Courier New', Courier, monospace;
}

.rarity-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b6b7a;
    font-family: 'Minecraft', 'Courier New', Courier, monospace;
}

.enchant-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    transition: transform 0.1s ease;
}

.enchant-icon {
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.enchant-names {
    width: 100%;
}

.enchant-galactic {
    font-family: 'Galactic', sans-serif;
    font-size: 1rem;
    color: #8a8a9d;
    letter-spacing: 2px;
    margin-bottom: 6px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.enchant-english {
    font-size: 0.9rem;
    color: #d4d4d8;
    font-weight: 500;
    font-family: 'Minecraft', 'Courier New', Courier, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #6b6b7a;
}

.no-results h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #8a8a9d;
}

footer {
    text-align: center;
    padding: 40px;
    margin-top: 60px;
    border-top: 1px solid #1f1f2e;
    color: #52525b;
}

footer p {
    font-size: 0.85rem;
    font-family: 'Minecraft', 'Courier New', Courier, monospace;
}

.enchant-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    margin-bottom: 24px;
    color: #8a8a9d;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #a1a1aa;
}

.detail-card {
    background: #15151f;
    border: 1px solid #1f1f2e;
    border-radius: 8px;
    overflow: hidden;
}

.detail-header {
    background: #1a1a25;
    padding: 40px;
    text-align: center;
    border-bottom: 1px solid #1f1f2e;
}

.detail-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.detail-icon {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
}

.detail-names {
    text-align: center;
}

.detail-galactic {
    font-family: 'Galactic', sans-serif;
    font-size: 1.8rem;
    color: #8a8a9d;
    letter-spacing: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.detail-english {
    font-size: 1.2rem;
    color: #e4e4e7;
    font-weight: 500;
}

.detail-body {
    padding: 32px;
}

.detail-section {
    margin-bottom: 28px;
}

.detail-section-title {
    font-size: 0.75rem;
    color: #6b6b7a;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-weight: 600;
}

.detail-description {
    font-size: 1rem;
    color: #d4d4d8;
    line-height: 1.7;
    background: #0d0d12;
    padding: 18px;
    border-radius: 6px;
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.detail-stat-card {
    background: #0d0d12;
    padding: 18px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #1f1f2e;
}

.detail-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #a1a1aa;
}

.detail-stat-label {
    font-size: 0.75rem;
    color: #6b6b7a;
    text-transform: uppercase;
    margin-top: 6px;
}

.detail-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
}

.detail-item-tag {
    background: #0d0d12;
    padding: 14px;
    border-radius: 6px;
    text-align: center;
    color: #e4e4e7;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid #1f1f2e;
}

.detail-item-tag:hover {
    border-color: #3d3d52;
    background: #1a1a25;
}

.item-icon {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.item-label {
    font-size: 0.75rem;
    color: #8a8a9d;
}

.detail-obtain-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.obtain-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0d0d12;
    padding: 14px;
    border-radius: 6px;
    border: 1px solid #1f1f2e;
}

.obtain-icon {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
}

.obtain-text {
    color: #8a8a9d;
    font-size: 0.85rem;
}

.obtain-yes {
    color: #22c55e;
    font-weight: 600;
}

.obtain-no {
    color: #ef4444;
    font-weight: 600;
}

.detail-incompatible {
    background: #0d0d12;
    border: 1px solid #1f1f2e;
    padding: 14px;
    border-radius: 6px;
}

.incompatible-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.incompatible-tag {
    background: #1f1f2e;
    color: #fca5a5;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid #2a2a3d;
}

.error-page {
    text-align: center;
    padding: 100px 20px;
}

.error-code {
    font-size: 6rem;
    color: #5b5b80;
    margin-bottom: 20px;
    font-weight: 600;
}

.error-message {
    font-size: 1.25rem;
    color: #8a8a9d;
    margin-bottom: 30px;
}

.home-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #2a2a3d;
    color: #e4e4e7;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.home-btn:hover {
    background: #3d3d52;
}

@media (max-width: 768px) {
    .enchant-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .enchant-card {
        padding: 18px 14px;
    }

    .enchant-icon {
        width: 48px;
        height: 48px;
    }

    .stats-container,
    .detail-stats-grid {
        grid-template-columns: 1fr;
    }

    .detail-obtain-list {
        grid-template-columns: 1fr;
    }

    .detail-header-content {
        gap: 12px;
    }

    .detail-galactic {
        font-size: 1.4rem;
    }

    .title-image {
        max-width: 200px;
    }

    .error-code {
        font-size: 4rem;
    }

    .filter-container {
        gap: 6px;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}
