@font-face { font-family: "MC Bitmap"; src: url(fonts/mcbitmap.woff) format("woff"); font-display: swap; }
@font-face { font-family: "MC Pixel"; src: url(fonts/pixelify-sans-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: "MC Pixel"; src: url(fonts/pixelify-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; font-display: swap; }
:root {
  --bg: #14121c; --panel: #1d1a29; --panel2: #25213a; --line: #332e4d;
  --text: #e9e6f5; --muted: #8f8aa8; --accent: #b86fea; --good: #99e550; --bad: #e96b29;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
header { display: flex; align-items: center; gap: 20px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
header[hidden] { display: none; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.brand span { color: var(--accent); font-weight: 500; }
nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); }
nav a.active, nav a:hover { color: var(--text); background: var(--panel2); }
.grow { flex: 1; }
#who { color: var(--muted); font-size: 14px; }
#who b { color: var(--text); font-weight: 600; }
.role { margin-left: 6px; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--panel2); color: var(--accent); }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 8px; padding: 8px 16px; background: var(--accent); color: #17101f; font-weight: 600; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
button.ghost:hover { color: var(--text); border-color: var(--muted); }
input[type=text], input[type=password], input[type=search] {
  width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.login { max-width: 340px; margin: 12vh auto 0; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login p { margin: 0 0 20px; color: var(--muted); }
.login label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
.login button { width: 100%; margin-top: 18px; padding: 10px; }
.error { margin-top: 12px; color: var(--bad); min-height: 1.4em; font-size: 14px; }
.demo { margin-bottom: 16px; padding: 8px 12px; border-radius: 8px; background: #3a2f12; color: #f0c870; font-size: 14px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input { max-width: 320px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 12px; border-radius: 16px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 500; }
.chip.on { background: var(--accent); color: #17101f; border-color: var(--accent); }
.chip small { opacity: .7; margin-left: 4px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; }
th, td { padding: 10px 14px; text-align: left; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: var(--panel2); font-weight: 600; }
tbody tr { border-top: 1px solid var(--line); cursor: pointer; }
tbody tr:hover { background: var(--panel2); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 12px; background: var(--panel2); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.back { display: inline-block; margin-bottom: 14px; color: var(--muted); }
.back:hover { color: var(--text); }
.head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.head h1 { margin: 0; font-size: 28px; }
.sub { color: var(--muted); margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.card h2 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 600; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.lore p { margin: 0; color: #d9d4ee; }
.lore p + p { margin-top: 2px; }
pre { margin: 0; padding: 12px; background: var(--bg); border-radius: 8px; overflow: auto; font-size: 13px; }
details { margin-top: 16px; }
summary { cursor: pointer; color: var(--muted); }

a.btn { display: inline-block; padding: 8px 16px; border-radius: 8px; background: var(--accent); color: #17101f; font-weight: 600; }
a.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 10px; font-size: 11px; vertical-align: middle; }
.tag.draft { background: #3a2f12; color: #f0c870; }
.tag.new { background: #1f3a2c; color: var(--good); }
.banner { margin-bottom: 18px; padding: 14px 18px; border-radius: 12px; background: #2a2412; border: 1px solid #5a4a1c; }
.banner .actions { margin-top: 12px; }
.diff { margin-top: 10px; }
.diff dd { text-align: left; }
.old { color: var(--muted); text-decoration: line-through; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions.sticky { position: sticky; bottom: 0; margin-top: 18px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form h2 { margin-bottom: 0; }
.f { display: flex; flex-direction: column; gap: 4px; }
.f > span { font-size: 13px; color: var(--muted); }
.f small, .form > small { color: var(--muted); font-size: 12px; }
select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input[type=number] { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
input[type=color] { width: 42px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.color { display: flex; gap: 8px; }
.chk { display: inline-flex; gap: 6px; align-items: center; margin-right: 14px; }
table.mini { background: transparent; margin-top: 8px; }
table.mini td { padding: 5px 14px 5px 0; }
table.mini tbody tr { cursor: default; border-top: 0; }
table.mini tbody tr:hover { background: transparent; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--accent); opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; }
#toast.bad { border-color: var(--bad); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.switch { display: block; margin-top: 16px; text-align: center; color: var(--muted); }
.switch:hover { color: var(--text); }
.hint { display: block; margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.4; }
tr.static { cursor: default; }
tr.static:hover { background: transparent; }
td select { width: auto; min-width: 140px; }

.lnk { border-bottom: 1px dotted var(--muted); }
.lnk:hover { color: var(--accent); }
.two { display: flex; gap: 8px; }
.two select { flex: 1; }
.two input { width: 110px; flex: none; }
.ing { display: grid; grid-template-columns: 1fr 80px 36px; gap: 6px; margin-bottom: 10px; align-items: center; }
.ing small { grid-column: 1 / -1; color: var(--muted); margin-top: -2px; }
.ing .ingId { width: 100%; }
.ing .del { padding: 6px 0; font-size: 18px; line-height: 1; }
.warn { color: var(--bad); }
#craftBody { display: flex; flex-direction: column; gap: 12px; }
#craftBody[hidden] { display: none; }
.lbl { display: block; font-size: 12px; opacity: .7; margin: 8px 0 4px; }
.pv { background: #0d0b14; border: 1px solid #2c2640; border-radius: 6px; padding: 10px 12px; font-family: Consolas, monospace; }
.pv-name { font-size: 16px; font-weight: 700; padding: 6px 10px; background: #1a1627; border-radius: 4px; border-bottom: 2px solid #3a3257; }
.pv-block { margin-top: 12px; }
.pv-stars { color: #ffb84d; letter-spacing: 2px; }
.pv-foot { padding-top: 8px; border-top: 1px solid #2c2640; }
.pv-stat { color: #cfc8e6; }
.pv-ab { color: #fad786; margin-top: 4px; }
.pv-lore { color: #9a93b5; font-style: italic; }
#preview { position: sticky; top: 12px; align-self: start; }
.hl { background: rgba(160, 110, 255, .18); } .ok { color: #7ed99a; }
/* Отступы между панелями */
#view > .grid + *, #view > .card + * { margin-top: 16px; }

/* ----- Описание предмета как в игре (mc.js) ----- */
.mc-tip { display: inline-block; min-width: 300px; max-width: 100%; padding: 8px 10px; background: #100010; border: 4px solid #25005a; border-image: linear-gradient(#5000ff80, #28007f80) 1; font-family: "MC Bitmap", "MC Pixel", sans-serif; font-size: 16px; font-kerning: none; text-rendering: optimizeSpeed; color: #aaa; -webkit-font-smoothing: none; box-shadow: 0 0 0 2px #100010; }
.mc-l { white-space: pre; line-height: 20px; min-height: 20px; }
.mc-g { position: relative; display: inline-block; height: 0; vertical-align: baseline; }
.mc-g i { position: absolute; left: 0; display: block; image-rendering: pixelated; }
.mc-ind { display: inline-block; width: 64px; }

/* ----- Текстуры предметов ----- */
.pix { image-rendering: pixelated; }
.tex16 { width: 16px; height: 16px; vertical-align: -3px; margin-right: 6px; }
.texrow { display: flex; gap: 16px; align-items: flex-start; }
.texprev { width: 80px; height: 80px; flex: none; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#1b1826 0% 25%, #221e31 0% 50%) 50% / 16px 16px; border-radius: 6px; border: 1px solid #2c2640; }
.texprev img { width: 64px; height: 64px; }
.texact { display: flex; gap: 8px; margin: 10px 0 6px; flex-wrap: wrap; }
.texnote { margin-top: 8px; }
.mc-tip { width: max-content; max-width: 100%; overflow-x: auto; }
@media (min-width: 1000px) { #view .grid > .card:has(#itemTip), #view .grid > .card:has(.mc-tip) { grid-column: span 2; } }
