/* Бандюга Вики — «в стиле игры»: только рисованные материалы из клиента (доска, пергамент, карточка, листок, крафт,
   кожаные вкладки, золотые кнопки). Без тёмных CSS-коробок, вебовских элементов и синего. Телефон — первый экран. */
@font-face { font-family: 'Russo One'; font-display: swap; src: url(russo-one.woff2) format('woff2'); unicode-range: U+0400-04FF, U+2116; }
@font-face { font-family: 'Russo One'; font-display: swap; src: url(russo-one-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
:root {
  --c-gold: #ffd76a; --c-gold-d: #d4a532; --c-leather: #6e1c1f; --c-lac: #2a1410; --c-paper: #f4e3bd;
  --c-ink: #3a2210; --c-ok: #5cbf3a; --c-bad: #e0352b; --c-off: #8a8070; --c-white: #fff;
  --fs-h1: 26px; --fs-h2: 20px; --fs-txt: 16px; --fs-cap: 14px; --fs-num: 13px;
  --btn-h: 40px; --pad: 12px;
}
@media (min-width: 900px) { :root { --fs-h1: 34px; --fs-h2: 24px; --fs-txt: 17px; --fs-cap: 15px; --btn-h: 44px; --pad: 20px; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* фон — ровный бордовый, без арта (Евген 27.11: двор мешал читать) */
body { margin: 0; font: var(--fs-txt)/1.45 'Russo One', system-ui, sans-serif; color: var(--c-white);
  background: #4a1418 radial-gradient(ellipse at 50% 0%, #5c1a1f 0%, #4a1418 55%, #3a0f12 100%) fixed; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
.stroke, h1, .btn span, .tab, .mi span { text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000; }

/* ---- материалы (border-image — тянется середина, углы держат форму) ---- */
.m-board { border-style: solid; border-color: transparent; border-width: 16px 44px; border-image: url(../i/dl_board.webp) 46 110 46 110 fill / 16px 44px stretch; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); color: var(--c-white); }
.m-paper { border: 22px solid transparent; border-image: url(../i/sk_parch.webp) 70 fill / 22px stretch; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); color: var(--c-ink); }
.m-card  { border: 14px solid transparent; border-image: url(../i/sk_card1.webp) 40 fill / 14px stretch; color: var(--c-ink); }
.m-note  { background: url(../i/dl_note.webp) 0 0 / 100% 100% no-repeat; padding: 12px 14px 6px; color: var(--c-ink); }
.m-kraft { background: url(../i/ui_buy_plate.webp) center / 100% 100% no-repeat; color: var(--c-white); padding: 26px 30px; }
@media (min-width: 900px) { .m-paper { border-width: 30px; border-image-width: 30px; } .m-board { border-width: 20px 56px; border-image-width: 20px 56px; } }

/* ---- кнопки: золотая / зелёная / оранжевая, без растяжки торцов ---- */
.btn { display: inline-grid; place-items: center; height: var(--btn-h); padding: 0 26px; text-decoration: none; cursor: pointer; white-space: nowrap;
  border-style: solid; border-color: transparent; border-width: 0 calc(var(--btn-h) * .5); border-image-width: 0 calc(var(--btn-h) * .5); color: #fff; font: inherit; font-size: var(--fs-cap); background: none; }
.btn.gold { border-image: url(../i/ui_btn_gold.webp) 0 66 fill / 0 calc(var(--btn-h) * .5) stretch; }
.btn.green { border-image: url(../i/ui_btn_green.webp) 0 66 fill / 0 calc(var(--btn-h) * .5) stretch; }
.btn.orange { border-image: url(../i/ui_btn_orange.webp) 0 66 fill / 0 calc(var(--btn-h) * .5) stretch; }
.btn span { padding: 0 2px; }
.btn:hover { filter: brightness(1.08); } .btn:active { transform: translateY(1px); }
.btn.big { --btn-h: 52px; font-size: var(--fs-txt); }
:focus { outline: none; } :focus-visible { outline: 3px solid var(--c-gold); outline-offset: 2px; }

/* ---- шапка ---- */
.hd { position: sticky; top: 0; z-index: 20; background: url(../i/sk_panel.webp) center / 100% 100%; box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.hdin { max-width: 1280px; margin: 0 auto; padding: 6px 10px; display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "logo logo play" "srch calc menu"; gap: 6px 8px; align-items: center; }
.logo { grid-area: logo; display: flex; align-items: center; gap: 6px; text-decoration: none; }
.logo img { width: 128px; height: auto; display: block; }
.logo b { color: var(--c-gold); font-size: 18px; font-weight: 400; text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000; }
.hcalc { grid-area: calc; justify-self: end; } .hplay { grid-area: play; }
.srch { grid-area: srch; position: relative; margin: 0; }
.mbtn { grid-area: menu; height: var(--btn-h); min-width: 92px; border: 0; font: inherit; font-size: var(--fs-cap); color: #ead4b0; cursor: pointer;
  background: url(../i/ui_tab.webp) center / 100% 100% no-repeat; text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000; }
.mbtn[aria-expanded="true"] { background-image: url(../i/ui_tab_on.webp); color: var(--c-gold); }
.hd .hcalc { width: var(--btn-h); height: var(--btn-h); padding: 0; border: 0; border-image: none; background: url(../i/ui_btn_guns.webp) center / contain no-repeat; }
.hcalc span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mbtn { min-width: 84px; }
@media (min-width: 900px) {
  .hdin { grid-template-columns: auto 1fr auto auto; grid-template-areas: "logo srch calc play"; padding: 8px 20px; gap: 16px; }
  .logo img { width: 150px; } .mbtn { display: none; }
  .hd .hcalc { width: auto; height: var(--btn-h); padding: 0 26px; border-style: solid; border-color: transparent; border-width: 0 calc(var(--btn-h) * .5); border-image: url(../i/ui_btn_gold.webp) 0 66 fill / 0 calc(var(--btn-h) * .5) stretch; background: none; }
  .hcalc span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* ---- поля ввода: бумажная полоска, не белый инпут ---- */
.in { width: 100%; height: var(--btn-h); padding: 0 14px; font: inherit; font-size: var(--fs-cap); color: var(--c-ink); appearance: none; -webkit-appearance: none;
  border: 2px solid #8b5a2b; border-radius: 6px; background: var(--c-paper) url(../i/dl_note.webp) center / 100% 100%; box-shadow: inset 0 2px 4px rgba(58,34,16,.25); }
.in::placeholder { color: #8b6a48; }
select.in { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--c-ink) 50%), linear-gradient(135deg, var(--c-ink) 50%, transparent 50%), url(../i/dl_note.webp);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%, center; background-size: 6px 6px, 6px 6px, 100% 100%; background-repeat: no-repeat; }
.srch input { width: 100%; height: var(--btn-h); padding: 0 14px; font: inherit; font-size: var(--fs-cap); color: var(--c-ink); border: 2px solid #8b5a2b; border-radius: 6px;
  background: var(--c-paper) url(../i/dl_note.webp) center / 100% 100%; -webkit-appearance: none; appearance: none; }
.sres { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 70vh; overflow: auto; }
.sres a, .pres a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-decoration: none; color: var(--c-ink); border-bottom: 1px dashed rgba(58,34,16,.3); }
.sres a:hover, .sres a.on { background: rgba(110,28,31,.12); }
.sres img, .pres img { width: 36px; height: 36px; object-fit: contain; }
.sres em, .pres em { margin-left: auto; font-style: normal; font-size: var(--fs-num); color: #7a5634; }

/* ---- раскладка ---- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 10px; display: block; }
@media (min-width: 900px) { .wrap { display: grid; grid-template-columns: 240px 1fr; gap: 22px; padding: 18px 20px; } }
main { min-width: 0; }
.menu { display: none; gap: 4px; margin-bottom: 10px; }
.menu.open { display: grid; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .menu { display: flex; flex-direction: column; position: sticky; top: 90px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; } }
.mi { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 4px 12px 4px 6px; text-decoration: none; color: #ead4b0; font-size: var(--fs-cap);
  background: url(../i/ui_tab.webp) center / 100% 100% no-repeat; position: relative; }
.mi img { width: 34px; height: 34px; flex: none; }
.mi.on { background-image: url(../i/ui_tab_on.webp); color: var(--c-gold); }
.mi:hover { filter: brightness(1.1); }
.mi.off { opacity: .55; cursor: default; }
.mi.off i { position: absolute; right: 10px; bottom: 2px; font-style: normal; font-size: 11px; color: #c9b08a; }
.crumbs { font-size: var(--fs-cap); margin: 2px 4px 8px; color: #ead4b0; text-shadow: 0 1px 2px #000; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.crumbs a { color: var(--c-gold); text-decoration: none; } .crumbs i { font-style: normal; opacity: .7; }
.ttl { display: inline-block; margin: 0 0 12px; font-size: var(--fs-h1); font-weight: 400; line-height: 1.2; max-width: 100%; }
.blk { margin: 0 0 14px; }
.blk h2 { margin: 0 0 8px; font-size: var(--fs-h2); font-weight: 400; color: var(--c-leather); }
.blk h3 { margin: 10px 0 6px; font-size: var(--fs-txt); font-weight: 400; color: var(--c-leather); }
.blk p { margin: 0 0 8px; } .blk p:last-child { margin-bottom: 0; }
.lead { font-size: var(--fs-txt); }
.note { font-size: var(--fs-cap); color: #6b4a2c; }
.lbl { margin-top: 10px !important; color: var(--c-leather); }
.lst { margin: 0; padding-left: 20px; } .lst li { margin: 4px 0; }
.lst a, .blk p a, .tbl a { color: var(--c-leather); }
.tag { font-style: normal; font-size: var(--fs-num); padding: 1px 6px; border-radius: 4px; background: rgba(110,28,31,.14); color: var(--c-leather); white-space: nowrap; }
.playcta { display: flex; width: max-content; max-width: 100%; margin: 18px auto 8px; }

/* ---- значки и суммы ---- */
.ic { width: 1.25em; height: 1.25em; vertical-align: -.28em; margin-left: 3px; object-fit: contain; }
.amt { white-space: nowrap; display: inline-flex; align-items: center; gap: 1px; margin-right: 8px; }
.amts { font-size: var(--fs-txt); }

/* ---- карточка авторитета ---- */
.hero { display: grid; grid-template-columns: 1fr; gap: 12px; }
.hero .portrait { width: 200px; justify-self: center; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
@media (min-width: 640px) { .hero { grid-template-columns: 240px 1fr; align-items: start; } .hero .portrait { width: 240px; } }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.facts > div { background: url(../i/dl_note.webp) 0 0 / 100% 100% no-repeat; padding: 10px 10px 6px; min-width: 0; }
.facts dt { font-size: var(--fs-num); color: #7a5634; } .facts dd { margin: 0; font-size: var(--fs-txt); }
.drop + .drop { margin-top: 6px; border-top: 1px dashed rgba(58,34,16,.3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px 4px 4px; text-decoration: none; color: var(--c-ink); font-size: var(--fs-cap);
  border: 10px solid transparent; border-image: url(../i/sk_card1.webp) 40 fill / 10px stretch; }
.chip img:not(.ic) { width: 34px; height: 34px; object-fit: contain; }
.chip .ic { margin: 0; }
.chip em { font-style: normal; font-size: var(--fs-num); color: #7a5634; margin-left: 2px; }
a.chip:hover { filter: brightness(1.05) drop-shadow(0 2px 3px rgba(0,0,0,.3)); }

/* ---- куклы ---- */
.dolls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dolls figure { margin: 0; text-align: center; }
.dolls img { width: 100%; max-width: 320px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); }
.dolls figcaption { font-size: var(--fs-cap); color: var(--c-leather); }

/* ---- таблицы: на бумаге, скролл вбок на телефоне, первый столбец прилипает ---- */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-cap); }
.tbl th { text-align: left; font-weight: 400; color: var(--c-leather); padding: 6px 8px; border-bottom: 2px solid rgba(110,28,31,.4); white-space: nowrap; }
.tbl td { padding: 6px 8px; border-bottom: 1px dashed rgba(58,34,16,.28); vertical-align: middle; }
.tbl .r { text-align: right; white-space: nowrap; }
.tbl.fit { width: auto; min-width: min(100%, 420px); }
.tbl.sort th { cursor: pointer; user-select: none; } .tbl.sort th::after { content: " ↕"; opacity: .4; } .tbl.sort th.up::after { content: " ↑"; opacity: 1; } .tbl.sort th.dn::after { content: " ↓"; opacity: 1; }
.tbl .nm a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--c-ink); white-space: nowrap; }
.tbl .nm img { width: 34px; height: 45px; object-fit: cover; object-position: top; border-radius: 4px; }
#bt td:first-child, #bt th:first-child { position: sticky; left: 0; background: #f1dcae; z-index: 1; }

/* ---- вкладки и фильтры ---- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.tab { height: var(--btn-h); min-width: 96px; padding: 0 18px; border: 0; font: inherit; font-size: var(--fs-cap); color: #ead4b0; cursor: pointer; background: url(../i/ui_tab.webp) center / 100% 100% no-repeat; }
.tab.on { color: var(--c-gold); background-image: url(../i/ui_tab_on.webp); }
.flt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; align-items: center; }
.flt [data-f="n"] { grid-column: 1 / -1; }
.found { justify-self: start; padding: 10px 16px 4px; font-size: var(--fs-cap); }
.found::before { content: "Найдено: "; }
@media (min-width: 900px) { .flt { grid-template-columns: repeat(4, minmax(0, 1fr)); } .flt [data-f="n"] { grid-column: 1 / span 3; } .found { justify-self: stretch; text-align: center; } }

/* ---- сетка карточек ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; } }
.card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; text-decoration: none; position: relative; min-width: 0; }
.card > img { width: 96px; height: 96px; object-fit: contain; }
.card.tall > img { width: 80px; height: 133px; }
.card .ic { width: 1.15em; height: 1.15em; }
.card b { font-weight: 400; font-size: var(--fs-cap); line-height: 1.2; }
.card .cnt, .card .src { font-size: var(--fs-num); color: #7a5634; }
.card .amts { font-size: var(--fs-num); }
.card .soon { position: absolute; top: -4px; right: -4px; font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 4px; background: rgba(110,28,31,.85); color: var(--c-gold); }
a.card:hover { filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); }
.card[hidden] { display: none; }

/* ---- плитки разделов ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; text-decoration: none; min-height: 90px; justify-content: center; }
.tile img { width: 64px; height: 64px; }
.tile b { font-weight: 400; font-size: var(--fs-cap); line-height: 1.2; }
.tile span { font-size: var(--fs-num); color: #7a5634; }
.tile.off { opacity: .6; }
.hbtns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---- калькулятор ---- */
.flds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.flds .fld:first-child, .flds .fld:nth-child(2) { grid-column: span 1; }
@media (max-width: 380px) { .flds { grid-template-columns: 1fr; } }
@media (min-width: 900px) { .flds { grid-template-columns: repeat(4, 1fr); } }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-cap); color: var(--c-leather); min-width: 0; }
.res { margin-top: 12px; }
.res .hp { margin-bottom: 6px; font-size: var(--fs-txt); color: var(--c-leather); }
.res .tscroll { margin: 0; }

/* ---- подвал ---- */
.ft { text-align: center; font-size: var(--fs-cap); color: #ead4b0; padding: 18px 12px 28px; text-shadow: 0 1px 2px #000; display: grid; gap: 6px; }
.ft a { color: var(--c-gold); }

/* ---- хаты, делюги, достижения ---- */
.hlist { display: grid; gap: 8px; }
@media (min-width: 900px) { .hlist { grid-template-columns: 1fr 1fr; } }
.hrow { display: grid; grid-template-columns: 140px 1fr; gap: 10px; align-items: start; }
.hrow img { width: 140px; height: auto; border-radius: 4px; }
.hrow b { font-weight: 400; font-size: var(--fs-txt); color: var(--c-leather); }
.hrow p { margin: 2px 0; font-size: var(--fs-cap); } .hrow .src { color: #6b4a2c; }
.dlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.card.dl { align-items: flex-start; text-align: left; padding: 8px 10px; border: 1px dashed rgba(58,34,16,.35); border-radius: 6px; }
.card.dl b { font-size: var(--fs-cap); } .card.dl a { color: var(--c-leather); }
details.ach > summary { cursor: pointer; list-style: none; } details.ach > summary::-webkit-details-marker { display: none; }
details.ach > summary h2 { display: inline; } details.ach > summary::after { content: " ▾"; color: var(--c-leather); } details.ach[open] > summary::after { content: " ▴"; }
details.ach > summary + * { margin-top: 8px; }
.step { display: inline-block; padding: 0 5px; margin: 1px; border-radius: 4px; background: rgba(110,28,31,.1); font-size: var(--fs-num); white-space: nowrap; }
