/* Опознаватор QMuh — dark inventory-inspector theme.
   Self-contained: does NOT depend on the main site's /style.css. */
:root {
    --bg: #14110f;
    --panel: #1d1916;
    --panel2: #262019;
    --edge: #3a2f24;
    --slot: #2b2620;
    --slot-edge: #4a3f33;
    --txt: #e9e2d6;
    --muted: #a99c87;
    --accent: #c9a227;       /* tarnished gold */
    --accent2: #8b2e2e;      /* faded soviet red */
    --ok: #5a8f4d;
    --named: #d8b84a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0 0 60px;
    background: var(--bg);
    color: var(--txt);
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    line-height: 1.45;
}

header {
    padding: 22px 18px 14px;
    text-align: center;
    border-bottom: 2px solid var(--edge);
    background: linear-gradient(180deg, #20180f 0%, var(--bg) 100%);
}
header h1 {
    margin: 0 0 6px;
    font-size: 1.6rem;
    letter-spacing: .5px;
    color: var(--accent);
    text-shadow: 0 1px 0 #000;
}
header p { margin: 4px auto; max-width: 640px; color: var(--muted); font-size: .95rem; }
header a { color: var(--accent); }
.progress {
    margin: 10px auto 0;
    max-width: 520px;
    font-size: .9rem;
    color: var(--txt);
}
.progress b { color: var(--accent); }

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

/* ── one base card ───────────────────────────────────────── */
.card {
    background: var(--panel);
    border: 1px solid var(--edge);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card.done { border-color: var(--ok); }

.card .head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 12px;
    background: var(--panel2);
    border-bottom: 1px solid var(--edge);
}
.card .head .num { color: var(--accent); font-weight: 700; }
.card .head .id  { color: var(--muted); font-family: ui-monospace, monospace; font-size: .8rem; }
.card .head .lvl { margin-left: auto; color: var(--muted); font-size: .82rem; }

.card .sum {
    padding: 6px 12px;
    color: var(--named);
    font-size: .85rem;
    border-bottom: 1px solid var(--edge);
    min-height: 1.2em;
}

.card .body { padding: 10px 12px; }

/* ── inventory rendering (same markup as the map popup) ───── */
.pp { font-size: 12px; }
.lbl { margin: 8px 0 4px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; }
.lbl small { text-transform: none; letter-spacing: 0; color: #8a7d68; }
.named {
    background: #241d12;
    border: 1px solid #3d3119;
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 6px;
    color: var(--named);
    font-size: .82rem;
}
.named b { color: #f0d878; }

.grid { display: grid; gap: 2px; }
.row { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.row .sp { width: 14px; }

.slot {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--slot);
    border: 1px solid var(--slot-edge);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}
.row .slot { width: 30px; height: 30px; aspect-ratio: auto; }
.slot img {
    width: 86%;
    height: 86%;
    object-fit: contain;
    image-rendering: pixelated;
}
.slot.named { box-shadow: inset 0 0 0 2px var(--named); }
.slot b {
    position: absolute;
    right: 1px;
    bottom: -1px;
    font-size: 10px;
    line-height: 1;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    font-weight: 700;
}
.slot .noi {
    font-size: 8px;
    color: #c9b48a;
    text-align: center;
    padding: 1px;
    word-break: break-all;
    line-height: 1.05;
}

/* collapsible inventory */
details.inv > summary {
    cursor: pointer;
    color: var(--accent);
    font-size: .85rem;
    padding: 4px 0;
    list-style: none;
}
details.inv > summary::-webkit-details-marker { display: none; }
details.inv > summary::before { content: "▸ "; }
details.inv[open] > summary::before { content: "▾ "; }

/* ── submit form ─────────────────────────────────────────── */
.guess {
    margin-top: auto;
    padding: 10px 12px;
    background: var(--panel2);
    border-top: 1px solid var(--edge);
}
.guess .cnt { font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.guess .cnt b { color: var(--accent); }
.guess input, .guess textarea {
    width: 100%;
    background: #15120f;
    border: 1px solid var(--slot-edge);
    border-radius: 5px;
    color: var(--txt);
    padding: 7px 9px;
    font-size: .9rem;
    margin-bottom: 6px;
    font-family: inherit;
}
.guess textarea { resize: vertical; min-height: 34px; }
.guess button {
    width: 100%;
    background: var(--accent2);
    color: #fff;
    border: 1px solid #6e2424;
    border-radius: 5px;
    padding: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: .9rem;
}
.guess button:hover { background: #a23636; }
.guess button:disabled { opacity: .5; cursor: default; }
.guess .msg { font-size: .8rem; margin-top: 5px; min-height: 1em; }
.guess .msg.ok  { color: var(--ok); }
.guess .msg.err { color: #d98a8a; }

footer {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    margin-top: 24px;
    padding: 0 14px;
}
footer a { color: var(--accent); }

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