/* ═══════════════════════════════════════════
   MINECRAFT GUI — Chest/Inventory Style
   ═══════════════════════════════════════════ */

@font-face {
    font-family: 'Minecraftia';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/Minecraftia.woff') format('woff');
    font-display: swap;
}

.mc-gui-wrapper {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.mc-gui {
    background: #c6c6c6;
    border: 4px solid;
    border-color: #ffffff #555555 #555555 #ffffff;
    padding: 6px;
    display: inline-block;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
    font-family: 'Minecraftia', monospace;
}

.mc-gui-title {
    text-align: center;
    color: #404040;
    font-size: 12px;
    font-weight: 400;
    padding: 3px 0 5px;
    font-family: 'Minecraftia', monospace;
    letter-spacing: 0.5px;
}

.mc-grid {
    display: grid;
    grid-template-columns: repeat(9, 48px);
    gap: 2px;
}

.mc-slot {
    width: 48px;
    height: 48px;
    background: #8b8b8b;
    border: 2px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.mc-slot.has-item {
    cursor: pointer;
}

.mc-slot.has-item:hover {
    background: #a8a8ff;
    border-color: #5555ff #8888ff #8888ff #5555ff;
}

.mc-item-icon {
    font-size: 28px;
    line-height: 1;
    pointer-events: none;
}

.mc-item-img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    pointer-events: none;
}

.mc-count {
    position: absolute;
    bottom: 0;
    right: 2px;
    color: #ffffff;
    font-size: 13px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 2px 2px 0 #3f3f3f;
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

/* ── Separator row (glass panes in MC) ── */
.mc-slot.mc-glass {
    background: #8b8b8b;
    opacity: 0.5;
}

/* ── Tooltip (Minecraft style) ── */
.mc-tooltip {
    position: fixed;
    z-index: 10000;
    background: #0c0015;
    border: 2px solid #28007a;
    outline: 2px solid #0c0015;
    padding: 6px 10px;
    pointer-events: none;
    font-family: 'Minecraftia', monospace;
    font-size: 11px;
    line-height: 1.6;
    white-space: nowrap;
    max-width: 340px;
    display: none;
    letter-spacing: 0.5px;
}

/* Name line — biggest, always has text-shadow matching its color */
.mc-tooltip-name {
    color: #ffffff;
    font-size: 13px;
    margin-bottom: 2px;
    text-shadow: 2px 2px 0 #3f3f3f;
}

/* Enchant lines — slightly smaller, indigo glow */
.mc-tooltip-enchant {
    color: #9999ff;
    font-size: 11px;
    text-shadow: 1px 1px 0 #1a1a4f;
}

/* Lore lines — smallest, muted, each line inherits color from MC codes */
.mc-tooltip-lore {
    white-space: normal;
    font-size: 10px;
    text-shadow: 1px 1px 0 #1a0a1a;
    line-height: 1.5;
    color: #aaaaaa;
}

/* Empty lore line = small spacer */
.mc-tooltip-lore:empty {
    display: block;
    height: 4px;
}

.mc-tooltip-count {
    color: #555555;
    font-size: 10px;
    margin-top: 3px;
    text-shadow: 1px 1px 0 #0a0a0a;
}

.mc-tooltip-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, #2d0060, transparent);
    margin: 4px 0;
    border: none;
}

/* ══════════════════════════════════════
   MC Color Codes — with matching text-shadow
   In Minecraft each color has its own darker shadow.
   ══════════════════════════════════════ */
.mc-0 { color: #000000; text-shadow: 1px 1px 0 #000000; }
.mc-1 { color: #0000aa; text-shadow: 1px 1px 0 #00002a; }
.mc-2 { color: #00aa00; text-shadow: 1px 1px 0 #002a00; }
.mc-3 { color: #00aaaa; text-shadow: 1px 1px 0 #002a2a; }
.mc-4 { color: #aa0000; text-shadow: 1px 1px 0 #2a0000; }
.mc-5 { color: #aa00aa; text-shadow: 1px 1px 0 #2a002a; }
.mc-6 { color: #ffaa00; text-shadow: 1px 1px 0 #3f2a00; }
.mc-7 { color: #aaaaaa; text-shadow: 1px 1px 0 #2a2a2a; }
.mc-8 { color: #555555; text-shadow: 1px 1px 0 #151515; }
.mc-9 { color: #5555ff; text-shadow: 1px 1px 0 #15153f; }
.mc-a { color: #55ff55; text-shadow: 1px 1px 0 #153f15; }
.mc-b { color: #55ffff; text-shadow: 1px 1px 0 #153f3f; }
.mc-c { color: #ff5555; text-shadow: 1px 1px 0 #3f1515; }
.mc-d { color: #ff55ff; text-shadow: 1px 1px 0 #3f153f; }
.mc-e { color: #ffff55; text-shadow: 1px 1px 0 #3f3f15; }
.mc-f { color: #ffffff; text-shadow: 1px 1px 0 #3f3f3f; }
.mc-bold { font-weight: bold; }
.mc-italic { font-style: italic; }
.mc-line { text-decoration: line-through; }

/* Name inherits color from MC code — override shadow when colored */
.mc-tooltip-name .mc-6 { font-size: 13px; }
.mc-tooltip-name .mc-e { font-size: 13px; }
.mc-tooltip-name .mc-c { font-size: 13px; }
.mc-tooltip-name .mc-d { font-size: 13px; }
.mc-tooltip-name .mc-4 { font-size: 13px; }
.mc-tooltip-name .mc-b { font-size: 13px; }
.mc-tooltip-name .mc-a { font-size: 13px; }
.mc-tooltip-name .mc-bold { font-size: 13px; }

/* ── Kit Label ── */
.mc-kit-label {
    text-align: center;
    margin-bottom: 12px;
}

.mc-kit-name {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.mc-kit-cooldown {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    .mc-grid {
        grid-template-columns: repeat(9, 36px);
    }

    .mc-slot {
        width: 36px;
        height: 36px;
    }

    .mc-item-icon {
        font-size: 20px;
    }

    .mc-item-img {
        width: 24px;
        height: 24px;
    }

    .mc-count {
        font-size: 10px;
    }

    .mc-gui {
        padding: 4px;
        border-width: 3px;
    }

    .mc-gui-title {
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .mc-grid {
        grid-template-columns: repeat(9, 30px);
    }

    .mc-slot {
        width: 30px;
        height: 30px;
        border-width: 1px;
    }

    .mc-item-icon {
        font-size: 16px;
    }

    .mc-item-img {
        width: 20px;
        height: 20px;
    }

    .mc-count {
        font-size: 9px;
    }
}

/* ── Touch devices: tooltip on tap ── */
@media (hover: none) {
    .mc-tooltip {
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        top: auto !important;
        white-space: normal;
        max-width: 90vw;
    }
}
