/* ОПОЗНАВАТОР QMuh — Minecraft-GUI style. Self-contained (no /style.css dep). */
@font-face {
    font-family: "MCpixel";
    src: url("/assets/fonts/Minecraft.ttf") format("truetype"),
         url("/assets/fonts/VT323-Regular.ttf") format("truetype");
    font-display: swap;
}

:root {
    --gui: #c6c6c6;          /* MC panel gray */
    --gui-hi: #fefefe;
    --gui-lo: #555555;
    --slot: #8b8b8b;
    --slot-lo: #373737;
    --slot-hi: #ffffff;
    --ink: #3b3b3b;
    --ink-soft: #6d6d6d;
    --green: #5a8f3c;
    --green-hi: #7ab552;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0 0 70px;
    color: #dddddd;
    font-family: "MCpixel", "Trebuchet MS", system-ui, sans-serif;
    font-size: 20px;
    line-height: 1.2;
    background: #2b2b2b;
}
/* darkened tiled dirt, like the Minecraft menu background */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1;
    background: #1b1b1b url("icons/block/dirt.png") repeat;
    background-size: 64px 64px;
    image-rendering: pixelated;
    filter: brightness(0.38);
}

/* ── header ── */
header { padding: 18px 16px 12px; text-align: center; }
.back { max-width: 1180px; margin: 0 auto 8px; text-align: left; }
.back a {
    display: inline-block;
    background: #8b8b8b; color: #fff;
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #c6c6c6, inset -1px -1px 0 #545454;
    padding: 4px 11px;
    text-decoration: none;
    text-shadow: 1px 1px 0 #2a2a2a;
}
.back a:hover { background: #9a9a9a; color: #ffec8b; }

header h1 {
    margin: 6px 0;
    font-size: 2.5rem;
    font-weight: normal;
    color: #fff;
    text-shadow: 3px 3px 0 #3f3f3f;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
header p { margin: 6px auto; max-width: 640px; color: #cfcfcf; font-size: 1.05rem; }
header b { color: #fff; }

/* green MC-panel banner */
.banner {
    display: inline-block;
    max-width: 640px;
    background: #3b6b2a;
    color: #e6ffd6 !important;
    border: 3px solid #000;
    box-shadow: inset 2px 2px 0 #6aa548, inset -2px -2px 0 #244618;
    padding: 8px 14px;
    font-size: 1.1rem;
    text-align: center;
}
.banner b { color: #fff; }

.progress { color: #cfcfcf; font-size: .95rem; }
.progress b { color: #ffec8b; }

.cta-top { margin: 8px auto; max-width: 640px; color: #ffe27a; font-size: 1.2rem; }
.cta-top a { color: #fff; }

/* Minecraft item icons used as inline markers (flex gap handles spacing) */
.mc-ic { height: 1.3em; width: auto; image-rendering: pixelated; flex: 0 0 auto; }
h1 .mc-ic { height: 1.5em; }
.banner .mc-ic { height: 1.4em; vertical-align: -0.25em; margin-right: 7px; }
.clue-h .mc-ic { height: 1.9em; }

/* ── grid of base cards ── */
main {
    max-width: 1180px;
    margin: 16px auto;
    padding: 0 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

/* a card = Minecraft GUI panel (beveled gray) */
.card {
    background: var(--gui);
    color: var(--ink);
    border: 3px solid #000;
    box-shadow: inset 3px 3px 0 var(--gui-hi), inset -3px -3px 0 var(--gui-lo);
    display: flex; flex-direction: column;
    padding: 4px;
}
.card.done { box-shadow: inset 3px 3px 0 #d2ecc2, inset -3px -3px 0 #4a7a36; }

.card .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 6px 8px 6px; }
.card .head .num { color: #262626; font-size: 1.1rem; white-space: nowrap; }
.card .head .lvl { margin-left: auto; flex: 0 0 auto; color: var(--ink-soft); font-size: .95rem; white-space: nowrap; }
.card .sum {
    padding: 0 8px 6px;
    margin-bottom: 4px;
    color: #4a4a4a;
    font-size: 1rem;
    border-bottom: 2px solid #b0b0b0;
}

/* ── clues ── */
.clues { padding: 2px 8px 6px; }
.clue-h {
    display: flex; align-items: center; gap: 9px;
    color: var(--ink-soft); font-size: .95rem;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.clue { display: flex; align-items: center; gap: 9px; padding: 3px 0; font-size: 1.05rem; color: var(--ink); }
.clue .ci {
    flex: 0 0 34px; width: 34px; height: 34px;
    background: var(--slot);
    box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
}
.clue .ci img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.clue .ct { flex: 1; min-width: 0; }
.clue .ct i { color: #6a4e12; font-style: normal; }
.clue .cn { color: var(--ink-soft); white-space: nowrap; }
.clue.named .ct { color: #5a3d0a; font-weight: bold; }
.clue.named .ci { box-shadow: inset 2px 2px 0 #6a5a1e, inset -2px -2px 0 #fff5cf; }

/* ── full inventory (collapsed, uniform) ── */
details.inv { padding: 2px 8px 4px; margin-top: auto; }
details.inv > summary {
    cursor: pointer;
    display: block;
    text-align: center;
    background: #8b8b8b;
    color: #fff;
    border: 2px solid #000;
    box-shadow: inset 2px 2px 0 #c6c6c6, inset -2px -2px 0 #545454;
    padding: 7px;
    margin: 2px 0 4px;
    font-size: 1rem;
    list-style: none;
    text-shadow: 1px 1px 0 #2a2a2a;
    user-select: none;
}
details.inv > summary:hover { background: #9a9a9a; color: #ffec8b; }
details.inv > summary::-webkit-details-marker { display: none; }
details.inv > summary::before { content: "▸ "; }
details.inv[open] > summary::before { content: "▾ "; }
.invbody { padding-top: 4px; }

/* inventory grid markup that lives inside bases.json html */
.pp { font-size: 14px; color: var(--ink); }
.lbl { margin: 8px 0 4px; color: var(--ink-soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }
.lbl small { text-transform: none; color: #777; }
.grid { display: grid; gap: 2px; }
.row { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.row .sp { width: 14px; }
.slot {
    position: relative; aspect-ratio: 1 / 1;
    background: var(--slot);
    box-shadow: inset 2px 2px 0 var(--slot-lo), inset -2px -2px 0 var(--slot-hi);
    display: flex; align-items: center; justify-content: center; min-width: 0;
}
.row .slot { width: 32px; height: 32px; aspect-ratio: auto; }
.slot img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.slot b { position: absolute; right: 1px; bottom: -2px; font-size: 13px; color: #fff; text-shadow: 1px 1px 0 #000; }
.slot .noi { font-size: 9px; color: #3a3a3a; text-align: center; word-break: break-all; line-height: 1.05; }

/* ── guess form (MC text fields + button) ── */
.guess { margin-top: auto; padding: 8px; }
.guess .cnt { color: var(--ink-soft); font-size: .95rem; margin-bottom: 6px; }
.guess .cnt b { color: #3a2700; }
.guess input, .guess textarea {
    width: 100%; background: #8b8b8b; color: #fff;
    box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #c6c6c6;
    border: none; padding: 8px 9px; font-family: inherit; font-size: 1rem; margin-bottom: 6px;
}
.guess input::placeholder, .guess textarea::placeholder { color: #e2e2e2; }
.guess textarea { resize: vertical; min-height: 36px; }
.guess button {
    width: 100%; background: var(--green); color: #fff;
    border: 3px solid #000; box-shadow: inset 2px 2px 0 var(--green-hi), inset -2px -2px 0 #244618;
    padding: 9px; font-family: inherit; font-size: 1.15rem; cursor: pointer;
    text-shadow: 2px 2px 0 #2c4a1c;
}
.guess button:hover { background: #669e44; }
.guess button:disabled { opacity: .5; cursor: default; }
.guess .msg { font-size: .95rem; margin-top: 5px; min-height: 1em; color: var(--ink); }
.guess .msg.ok { color: #2e6b1e; }
.guess .msg.err { color: #9a2a2a; }

/* ── footer ── */
footer { text-align: center; color: #bdbdbd; font-size: .95rem; margin-top: 24px; padding: 0 14px; }
footer a { color: #fff; }
footer code { color: #ffec8b; }

/* Minecraft-style item tooltip */
#mctip {
    position: fixed;
    z-index: 9999;
    display: none;
    pointer-events: none;
    max-width: 320px;
    background: rgba(20, 2, 28, 0.96);
    color: #fff;
    border: 2px solid #2a0a52;
    box-shadow: inset 0 0 0 1px #4b1791;
    padding: 4px 9px;
    font-family: "MCpixel", monospace;
    font-size: 1rem;
    line-height: 1.25;
    text-shadow: 2px 2px 0 #000;
}
#mctip.on { display: block; }
#mctip .tn { color: #fff; }
#mctip .te { color: #b6b6e6; font-size: .92em; }

/* enchanted-item glint on slots */
@keyframes glint { 0% { background-position: -120% 0; } 100% { background-position: 240% 0; } }
.slot.ench::after, .clue .ci.ench::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(115deg, transparent 40%, rgba(196, 128, 255, .55) 50%, transparent 60%);
    background-size: 250% 100%;
    animation: glint 2.8s linear infinite;
}

/* "наши инвентари" spoiler */
.known-spoiler { max-width: 1180px; margin: 10px auto 0; padding: 0 14px; text-align: center; }
.known-spoiler > summary {
    cursor: pointer; list-style: none;
    display: inline-block;
    background: #8b8b8b; color: #fff;
    border: 2px solid #000;
    box-shadow: inset 2px 2px 0 #c6c6c6, inset -2px -2px 0 #545454;
    padding: 8px 18px;
    font-size: 1.1rem;
    text-shadow: 1px 1px 0 #2a2a2a;
    user-select: none;
}
.known-spoiler > summary:hover { background: #9a9a9a; color: #ffec8b; }
.known-spoiler > summary::-webkit-details-marker { display: none; }
.known-spoiler > summary::before { content: "▸ "; }
.known-spoiler[open] > summary::before { content: "▾ "; }
.known-grid { text-align: left; }
.known-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px; margin-top: 8px;
}
.card.known { box-shadow: inset 3px 3px 0 #d2ecc2, inset -3px -3px 0 #4a7a36; }
.card.known .num { color: #2e5a1e; }

@media (max-width: 520px) { main { grid-template-columns: 1fr; } }
