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

:root {
    --bg-dark: #1a1a1e;
    --bg-panel: #222226;
    --bg-card: #2a2a2e;
    --bg-slot: #141416;
    --border-dark: #333338;
    --accent-gold: #ffcc33;
    --accent-blue: #5fa7ff;
    --text-primary: #e8e8ec;
    --text-muted: #888890;
    --input-bg: #3a3a42;
    --input-border: #555560;
    --title-white: #f8f8f8;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

/* Top Navigation Bar */
.top-nav {
    background: var(--bg-slot);
    border-bottom: 1px solid var(--border-dark);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0 16px;
}

.nav-home {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    margin-right: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-home:hover {
    color: var(--accent-gold);
}

.nav-home svg {
    display: block;
}

.nav-links {
    display: flex;
    gap: 0;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 14px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-decoration: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 60px;
}

.header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--title-white);
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.15);
    cursor: default;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
    display: inline-block;
}

.header h1:hover {
    transform: scale(1.03);
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3);
}

.header h1.twinkle {
    animation: titleTwinkle 0.6s ease-in-out;
}

@keyframes titleTwinkle {
    0%, 100% { 
        text-shadow: 
            0 0 10px rgba(255, 255, 255, 0.3),
            0 0 20px rgba(255, 255, 255, 0.15);
    }
    50% { 
        text-shadow: 
            0 0 20px rgba(255, 255, 255, 0.9),
            0 0 40px rgba(255, 255, 255, 0.6),
            0 0 60px rgba(255, 255, 255, 0.3);
    }
}

.search-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.search-label {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.search-box {
    max-width: 450px;
    width: 100%;
}

#usernameInput {
    width: 100%;
    border: 1px solid var(--input-border);
    outline: none;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 0;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

#usernameInput::placeholder {
    color: var(--text-muted);
}

#usernameInput:focus {
    border-color: var(--input-border);
    outline: none;
}

#searchBtn {
    background: var(--bg-card);
    border: 1px solid var(--input-border);
    color: var(--text-primary);
    padding: 5px 14px;
    border-radius: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    margin-top: 8px;
}

#searchBtn:hover {
    background: var(--bg-panel);
}

#searchBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.results-section {
    background: var(--bg-panel);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 20px;
}

.player-info {
    text-align: left;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    color: var(--text-primary);
}

.player-info h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-gold);
}

.player-info .stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: left;
}

.stat-number {
    font-size: 1.2rem;
    font-weight: 600;
    display: block;
    color: var(--accent-blue);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.items-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.items-container.database-view {
    grid-template-columns: 1fr;
}

.items-container.database-view .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
}

@media (max-width: 768px) {
    .items-container {
        grid-template-columns: 1fr;
    }
}

.items-section h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.items-grid::-webkit-scrollbar {
    width: 6px;
}

.items-grid::-webkit-scrollbar-track {
    background: var(--bg-slot);
}

.items-grid::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 3px;
}

.item-slot {
    aspect-ratio: 1;
    background: var(--bg-slot);
    border: 1px solid var(--border-dark);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    min-height: 50px;
    overflow: hidden;
}

.item-slot:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 8px rgba(255, 204, 51, 0.3);
}

.item-image {
    width: 80%;
    height: 80%;
    image-rendering: pixelated;
    object-fit: contain;
}

/* Button items need to be shrunk to look like buttons instead of planks */
.item-image.button-item {
    width: 32%;
    height: 32%;
}

.item-count {
    position: absolute;
    bottom: 2px;
    right: 3px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 2px;
    font-family: 'Inter', sans-serif;
}

.item-count.glitched {
    background: #000;
    color: #ff69b4;
    font-size: 9px;
}

.durability-bar {
    position: absolute;
    bottom: 2px;
    left: 3px;
    right: 3px;
    height: 3px;
    background: #000;
    border-radius: 1px;
    overflow: hidden;
}

.durability-fill {
    height: 100%;
    border-radius: 1px;
}

.durability-fill.high { background: #4ade80; }
.durability-fill.medium { background: #fbbf24; }
.durability-fill.low { background: #ef4444; }
.durability-fill.critical { background: #b91c1c; animation: durability-pulse 1s infinite alternate; }

@keyframes durability-pulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.enchanted-glint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 2px;
    overflow: hidden;
}

.enchanted-glint::before,
.enchanted-glint::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        radial-gradient(ellipse 3px 6px at 20% 30%, rgba(255, 140, 220, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 4px 8px at 60% 20%, rgba(255, 100, 200, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 3px 5px at 40% 70%, rgba(255, 120, 210, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 5px 7px at 80% 50%, rgba(255, 90, 195, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 3px 6px at 10% 60%, rgba(255, 130, 215, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 4px 5px at 70% 80%, rgba(255, 110, 205, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 3px 7px at 30% 40%, rgba(255, 135, 218, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 4px 6px at 90% 25%, rgba(255, 105, 200, 0.9) 0%, transparent 70%);
    animation: glint-flow-1 3s linear infinite;
    mix-blend-mode: screen;
}

.enchanted-glint::after {
    background-image: 
        radial-gradient(ellipse 4px 7px at 25% 45%, rgba(255, 125, 212, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 3px 5px at 55% 65%, rgba(255, 145, 222, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 5px 6px at 75% 35%, rgba(255, 115, 208, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 3px 8px at 15% 85%, rgba(255, 100, 198, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 4px 5px at 85% 15%, rgba(255, 130, 215, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 3px 6px at 45% 55%, rgba(255, 120, 210, 0.95) 0%, transparent 70%);
    animation: glint-flow-2 3s linear infinite;
    animation-delay: -1s;
}

.enchanted-glint-layer3 {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        radial-gradient(ellipse 3px 6px at 35% 25%, rgba(255, 135, 218, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 4px 7px at 65% 55%, rgba(255, 110, 205, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 3px 5px at 15% 75%, rgba(255, 140, 220, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 5px 6px at 85% 40%, rgba(255, 105, 200, 0.9) 0%, transparent 70%),
        radial-gradient(ellipse 4px 8px at 50% 15%, rgba(255, 125, 212, 0.95) 0%, transparent 70%),
        radial-gradient(ellipse 3px 6px at 75% 85%, rgba(255, 115, 208, 0.9) 0%, transparent 70%);
    animation: glint-flow-3 3s linear infinite;
    animation-delay: -2s;
    mix-blend-mode: screen;
    pointer-events: none;
}

@keyframes glint-flow-1 {
    0% { transform: translate(0%, 0%) rotate(-25deg); }
    100% { transform: translate(50%, 50%) rotate(-25deg); }
}

@keyframes glint-flow-2 {
    0% { transform: translate(0%, 0%) rotate(-30deg); }
    100% { transform: translate(45%, 45%) rotate(-30deg); }
}

@keyframes glint-flow-3 {
    0% { transform: translate(0%, 0%) rotate(-20deg); }
    100% { transform: translate(50%, 50%) rotate(-20deg); }
}

.error-section {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.error-message {
    color: #ef4444;
    font-size: 1rem;
    font-weight: 500;
}

.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 20px;
    margin-top: auto;
    background: transparent;
}

/* Homepage Footer */
.homepage-footer {
    margin-top: 0;
    padding: 10px 20px 20px 20px;
    background: transparent;
    flex: 1;
    display: flex;
    align-items: flex-start;
}

.footer-three-col {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 20px;
    gap: 20px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    flex: 0 0 auto;
}

.footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    flex: 0 0 auto;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Press Start 2P', cursive;
    font-size: 15px;
    transition: all 0.2s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.footer-link:hover {
    color: var(--accent-gold);
    text-shadow: 0 0 15px rgba(255, 204, 51, 0.5);
    transform: scale(1.05);
}

.footer-link img {
    border-radius: 4px;
}

.footer-center iframe {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.youtube-subscribe-link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Press Start 2P', cursive;
    font-size: 15px;
    transition: all 0.2s ease;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.youtube-subscribe-link:hover {
    color: #ff0000;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
    transform: scale(1.05);
}

.credit-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e0e0e0;
    text-decoration: none;
    font-family: 'Press Start 2P', cursive;
    font-size: 13px;
    transition: all 0.2s ease;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.credit-link img,
.credit-link svg {
    border-radius: 3px;
    flex-shrink: 0;
}

.credit-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.credit-url {
    color: var(--accent-blue);
}

.credit-link:hover {
    color: var(--accent-gold);
    text-shadow: 0 0 12px rgba(255, 204, 51, 0.5);
    transform: scale(1.05);
}

.credit-link:hover .credit-url {
    color: var(--accent-gold);
}

/* Players List Page */
.players-section {
    text-align: center;
    padding: 20px 0;
}

.section-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 18px;
    color: var(--title-white);
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-dark);
    padding: 12px 16px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.player-card:hover {
    background: var(--bg-card);
    border-color: var(--accent-gold);
}

.player-avatar img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.player-header-with-avatar {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.player-page-avatar {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    border-radius: 4px;
}

.player-header-info h2 {
    margin: 0;
    color: var(--text-primary);
}

.player-header-info p {
    margin: 4px 0 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.player-info-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.player-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.player-date {
    color: var(--text-muted);
    font-size: 11px;
}

.no-players, .loading-message {
    color: var(--text-muted);
    font-size: 14px;
    padding: 40px 20px;
    grid-column: 1 / -1;
}

.loading-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 20px;
}

.loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-dark);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-status-text {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.loading-status-text.error {
    color: #ff6b6b;
}

.loading-status-text.warning {
    color: var(--accent-gold);
}

.refresh-btn {
    background: var(--accent-gold);
    border: none;
    color: #1a1a1e;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #e6b82e;
}

.refresh-btn-small {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn-small:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.player-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
}

.cached-label {
    display: inline-block;
    background: var(--bg-card);
    color: var(--text-muted);
    padding: 2px 8px;
    font-size: 11px;
    margin-bottom: 8px;
}

.database-section {
    text-align: center;
    padding: 20px 0;
}

.database-grid {
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.database-grid .item-slot {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
}

.query-section {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.query-box {
    background: #32323d;
    border: 1px solid #3a3a45;
    padding: 15px;
    min-width: 400px;
    max-width: 600px;
}

.query-header {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
    padding-left: 5px;
}

.query-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.query-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.query-field,
.query-field-select {
    width: 200px;
    min-width: 200px;
    background: #5a5a6e;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
}

.query-field-select {
    cursor: pointer;
}

.query-value {
    width: 120px;
    min-width: 120px;
    background: #5a5a6e;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
}

.query-value::placeholder {
    color: var(--text-muted);
}

.remove-row-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}

.remove-row-btn:hover {
    color: #ff6b6b;
}

.add-row-btn {
    display: block;
    width: 100%;
    background: #3a3a45;
    border: 1px dashed #5a5a6e;
    color: var(--text-muted);
    padding: 8px;
    margin-top: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-row-btn:hover {
    background: #42424d;
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.search-items-btn {
    display: block;
    width: auto;
    margin: 15px auto 0;
    background: #2a2a35;
    border: 1px solid #3a3a45;
    color: var(--text-primary);
    padding: 10px 30px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-items-btn:hover {
    background: #32323d;
    border-color: var(--accent-gold);
}

.search-results-section {
    text-align: center;
    padding: 30px 0;
}

.player-page-section {
    text-align: center;
    padding: 40px 20px;
}

.nav-btn.active {
    background: var(--bg-card);
    border-color: var(--accent-gold);
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.empty-items {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 40px 20px;
    border: 1px dashed var(--border-dark);
    border-radius: 4px;
    grid-column: 1 / -1;
}

/* Tooltip */
.item-tooltip {
    position: fixed;
    background: rgba(20, 20, 24, 0.98);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    padding: 15px;
    z-index: 1000;
    max-width: 525px;
    min-width: 270px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-size: 15px;
}

.tooltip-owner {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 9px;
    text-align: center;
}

.tooltip-header {
    margin-bottom: 9px;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 9px;
}

.tooltip-name {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 16px;
}

.tooltip-id {
    color: var(--text-muted);
    font-size: 15px;
}

.tooltip-enchantments {
    margin: 9px 0;
}

.tooltip-enchantment {
    display: block;
    color: #55ffff;
    margin: 3px 0;
    font-size: 16px;
}

.tooltip-lore {
    margin-top: 9px;
    border-top: 1px solid var(--border-dark);
    padding-top: 9px;
}

.tooltip-lore-line {
    margin: 3px 0;
    line-height: 1.4;
    font-size: 16px;
}

/* Search Modal */
.search-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-dark);
    margin: 5% auto;
    padding: 0;
    border-radius: 6px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.search-modal-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-dark);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-modal-header h2 {
    margin: 0;
    color: var(--accent-gold);
    font-size: 1.2rem;
    font-weight: 600;
}

.search-close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.search-close:hover {
    background: var(--bg-slot);
    color: var(--text-primary);
}

.search-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.search-filters {
    display: grid;
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.filter-group input, .filter-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-dark);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.filter-group input:focus, .filter-group select:focus {
    border-color: var(--accent-gold);
    outline: none;
}

.filter-group select option {
    background: var(--bg-panel);
    color: var(--text-primary);
}

.filter-group input::placeholder {
    color: var(--text-muted);
}

.enchant-search {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
}

.search-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.apply-btn {
    background: var(--accent-gold);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.apply-btn:hover {
    background: #e6b82e;
}

.clear-btn {
    background: var(--bg-slot);
    border: 1px solid var(--border-dark);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.clear-btn:hover {
    background: var(--bg-panel);
}

.results-count {
    color: var(--text-muted);
    font-size: 13px;
}

/* Mobile */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .items-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .item-slot {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Admin section */
.admin-section {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
    padding-top: 16px;
    border-top: 1px solid var(--border-dark);
}

.admin-btn {
    background: var(--bg-slot);
    border: 1px solid var(--border-dark);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.admin-btn:hover {
    background: var(--bg-panel);
    border-color: var(--text-muted);
}

/* Modal (general) */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-dark);
    margin: 5% auto;
    border-radius: 6px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-primary);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: var(--accent-gold);
}

.close {
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.close:hover {
    background: var(--bg-slot);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    color: var(--text-primary);
}

.stats-section, .mappings-section {
    margin-bottom: 24px;
}

.stats-section h3, .mappings-section h3 {
    color: var(--accent-gold);
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 8px;
    margin-bottom: 12px;
    font-size: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    padding: 12px;
    border-radius: 4px;
    text-align: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-blue);
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
}

.mapping-table th,
.mapping-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-dark);
    color: var(--text-primary);
}

.mapping-table th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--accent-gold);
}

.mapping-table tr:hover {
    background: rgba(255, 204, 51, 0.05);
}

.confidence-badge {
    background: var(--accent-gold);
    color: #000;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Debug colors (hidden) */
.debug-colors-btn { display: none; }
.debug-colors-modal { display: none; }
