/* The painted skin: stone frames, bronze edges, ember buttons and parchment, cut from the CraftPix "RPG Game UI" kit
   by tools/make-ui.py into img/ui/. Loaded after style.css and game.css and only changes how things look: the layout
   stays theirs. Frames are drawn with border-image (corners kept, sides and middle stretched). */
:root {
  --r: 3px;
  --edge: #0d0906;            /* the dark line round a sunk well */
  --bronze: #6f5a48;          /* the kit's worn bronze */
  --bronze2: #a08468;
  --well: rgba(0, 0, 0, .32);
}
body { background: #120e0b url(../img/ui/leather.webp); }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 30%, transparent 30%, rgba(0, 0, 0, .55)); z-index: 0; }
#app { position: relative; z-index: 1; }
* { scrollbar-width: thin; scrollbar-color: #5d4a3a #120d09; }

/* ---------- frames ---------- */
.box, .card, .modal, .bf-set-box, .bf-end > div, .menu {
  border: 11px solid transparent; border-image: url(../img/ui/panel.webp) 34 fill / 11px stretch; background: none; border-radius: 0;
  backdrop-filter: none;
}
.box, .card, .modal, .bf-set-box, .bf-end > div, .menu { box-shadow: 0 10px 34px rgba(0, 0, 0, .6); }
.menu { border-width: 8px; border-image-width: 8px; padding: 2px; }
.menu button { border-radius: 2px; }
.menu button:hover { background: rgba(255, 220, 160, .09); color: var(--gold2); }
.modal.sheet { border-radius: 0; }
.box-head, .people-head, .bf-set-head {
  background: #2e2620 url(../img/ui/head.webp) center / auto 100%; border-bottom: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 230, 190, .08), 0 1px 0 rgba(125, 100, 75, .35); text-shadow: 0 1px 2px #000;
}
.box-head h2::before { background: var(--bronze2); box-shadow: 0 0 0 1px var(--edge); }
.gleft, .gmid, .people { border-right-color: var(--edge); box-shadow: 1px 0 0 rgba(125, 100, 75, .22); }
.cats, .dtabs, .cat-row { border-bottom-color: var(--edge); box-shadow: 0 1px 0 rgba(125, 100, 75, .22); }
.chat-form, .bf-set-foot { border-top-color: var(--edge); box-shadow: 0 -1px 0 rgba(125, 100, 75, .22); }
.splitter span { width: 220px; max-width: 60%; height: 4px; border-radius: 0; background: url(../img/ui/rule.webp) center / 100% 100%; opacity: .8; }
.splitter:hover span { background: url(../img/ui/rule.webp) center / 100% 100%; opacity: 1; filter: brightness(1.6); }

/* ---------- the bars along the top ---------- */
.topbar, .bf-top {
  background: #2a231d url(../img/ui/head.webp) center / auto 100%; border-bottom: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 230, 190, .1), inset 0 -2px 0 var(--bronze), 0 3px 12px rgba(0, 0, 0, .6);
}
.topnav button { font-family: var(--head); font-size: 14px; letter-spacing: .06em; text-shadow: 0 1px 2px #000; }
.topnav button.on { border-bottom-color: #e8a04a; background: linear-gradient(transparent 30%, rgba(232, 130, 50, .16)); }
.me-chip { border-radius: 2px; background: var(--well); border-color: var(--edge); box-shadow: inset 0 0 0 1px rgba(125, 100, 75, .3); }
.me-chip:hover { border-color: var(--edge); box-shadow: inset 0 0 0 1px var(--bronze2); }
.mnav { background: #1c1612 url(../img/ui/bar.webp) top / auto 100% !important; border-top: 2px solid var(--bronze) !important; }

/* ---------- buttons ---------- */
.btn {
  border: 9px solid transparent; border-image: url(../img/ui/btn.webp) 26 fill / 9px stretch; background: none; border-radius: 0;
  padding: 1px 9px; color: #efe3cc; text-shadow: 0 1px 2px #000; font-family: var(--head); font-size: 14px; letter-spacing: .05em;
  transition: none;
}
.btn:hover { border-image-source: url(../img/ui/btn-h.webp); filter: none; color: #fff; }
.btn:active { border-image-source: url(../img/ui/btn-p.webp); }
.btn:disabled { border-image-source: url(../img/ui/btn-p.webp); opacity: .55; }
.btn.gold, .btn.red { border-image-source: url(../img/ui/btn-o.webp); color: #fff1d2; text-shadow: 0 1px 3px #3a1400; }
.btn.gold:hover, .btn.red:hover { border-image-source: url(../img/ui/btn-o-h.webp); }
.btn.gold:active, .btn.red:active, .btn.gold:disabled, .btn.red:disabled { border-image-source: url(../img/ui/btn-o-p.webp); }
.btn.red { filter: hue-rotate(-22deg) saturate(1.35) brightness(.9); }
.btn.red:hover { filter: hue-rotate(-22deg) saturate(1.35); }
.btn.ghost { border-image: none; color: var(--muted); text-shadow: none; }
.btn.ghost:hover { border-image: none; color: var(--text); }
.btn.small { border-width: 7px; border-image-width: 7px; padding: 0 6px; font-size: 13px; }
.gleft .btn { padding: 1px 2px; font-size: 13px; }
/* the one big button: the kit's curved ember plate */
.btn.big {
  border: 0; border-image: none; background: url(../img/ui/big.webp) center / 100% 100%; aspect-ratio: 461 / 156; width: 100%;
  padding: 0 4px 5% !important; font-size: 13px !important; display: flex; align-items: center; justify-content: center; line-height: 1.05;
}
.btn.big:hover { border-image: none; background-image: url(../img/ui/big-h.webp); }
.btn.big:active, .btn.big:disabled { border-image: none; background-image: url(../img/ui/big-p.webp); }

/* tabs and filters: small stone plates */
.cats button, .rooms button, .bf-sq, .bf-bbtn, .tabs2 .btn {
  border: 5px solid transparent; border-image: url(../img/ui/tab.webp) 10 fill / 5px stretch; background: none; border-radius: 0;
}
.cats button, .rooms button { padding: 2px 7px; }
.cats button.on, .rooms button.on, .bf-sq.on, .tabs2 .btn.on { border-image-source: url(../img/ui/tab-h.webp); background: none; color: var(--gold2); box-shadow: 0 0 0 1px #c98b3c, 0 0 8px rgba(232, 130, 50, .35); }
.cats button:hover, .rooms button:hover, .bf-sq:hover, .bf-bbtn:hover { border-image-source: url(../img/ui/tab-h.webp); }
.tabs2 .btn { padding: 5px 8px; }
.dtabs button { border-radius: 0; font-family: var(--head); }
.dtabs button.on { background: rgba(0, 0, 0, .3); border-color: var(--edge); box-shadow: inset 0 2px 0 #c98b3c; }

/* ---------- fields ---------- */
.field input, .field textarea, .chat-form input, .find input, .cat-select, .bf-trib-to, .bf-set-ctl select,
.cfg-f input:not([type=checkbox]), .cfg-f select {
  border: 3px solid transparent; border-image: url(../img/ui/input.webp) 6 fill / 3px stretch; background: none; border-radius: 0;
}
.cat-select option, .bf-trib-to option, .bf-set-ctl select option, .cfg-f select option { background: #1b1410; }
.field input:focus, .field textarea:focus, .chat-form input:focus, .find input:focus, .cfg-f input:focus { outline: 1px solid #c98b3c; outline-offset: 0; }
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex: none; margin: 0; cursor: pointer;
  background: url(../img/ui/check.webp) center / 100% 100%;
}
input[type=checkbox]:checked { background-image: url(../img/ui/check-on.webp); }
input[type=checkbox]:disabled { opacity: .5; cursor: default; }
.check input { margin-top: 1px; }
input[type=range] { accent-color: #c98b3c; }

/* ---------- lists: rows and wells ---------- */
.grow { border: 5px solid transparent; border-image: url(../img/ui/tab.webp) 10 fill / 5px stretch; background: none; border-radius: 0; padding: 4px 6px 4px 0; }
.grow:hover { border-image-source: url(../img/ui/tab-h.webp); background: none; }
.grow.sel { border-image-source: url(../img/ui/tab-h.webp); background: none; box-shadow: 0 0 0 1px #c98b3c, 0 0 10px rgba(232, 130, 50, .3); }
.grow .kbar { margin: -1px 0; }
.stat, .pcard, .award, .hero-t, .cfg-item, .cfg-g {
  background: var(--well); border: 1px solid var(--edge); border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(125, 100, 75, .22);
}
.stat.hero { background: linear-gradient(rgba(170, 90, 30, .28), rgba(60, 30, 10, .3)); border-color: var(--edge); box-shadow: inset 0 0 0 1px rgba(232, 150, 70, .45); }
.pcard:hover, button.hero-t:hover { border-color: var(--edge); box-shadow: inset 0 0 0 1px var(--bronze2); }
.hero-t.on, .cfg-item.on { border-color: var(--edge); background: rgba(200, 110, 40, .2); box-shadow: inset 0 0 0 1px #c98b3c; }
.chip { border-radius: 2px; }
.prow, .swatch { border-radius: 2px; }
.msg.tell { border-radius: 0; }
.unread { border-radius: 2px; }
.hero-lvl { border: 0; background: url(../img/ui/disc.webp) center / 100% 100%; filter: drop-shadow(0 2px 3px #000); }
.hero-lvl small { color: #3a2917; opacity: 1; font-weight: 700; }
.hero-lvl b { color: #2a1b0c; text-shadow: 0 1px 0 rgba(255, 235, 200, .35); }
.hero-bar, .bf-hp { background: url(../img/ui/track.webp) center / 100% 100%; border: 0; border-radius: 0; }
.hero-bar { height: 9px; padding: 2px; }
.hero-bar i { background: url(../img/ui/fill-gold.webp) left / auto 100%; }

/* parchment: tips and passing notes */
.bf-tip, #toast {
  border: 12px solid transparent; border-image: url(../img/ui/paper.webp) 30 fill / 12px stretch; background: none; border-radius: 0;
  box-shadow: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7)); color: #eadfc8; padding: 1px 4px;
}
.bf-tip b { color: #ffe7a0; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.bf-tip-lock { color: #ffbe73; }
.bf-tip .bf-cost { color: #f3e8cf; }
#toast.bad { filter: drop-shadow(0 0 2px #e0705f) drop-shadow(0 6px 10px rgba(0, 0, 0, .7)); }

/* ---------- the battlefield ---------- */
.bf-title { position: relative; isolation: isolate; text-shadow: 0 1px 2px #000; }
.bf-title::before {
  content: ''; position: absolute; z-index: -1; left: 50%; top: -6px; width: min(440px, 100%); height: 62px; transform: translateX(-50%);
  background: url(../img/ui/plaque.webp) top center / contain no-repeat; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .7)); pointer-events: none;
}
.bf-title b { font-size: 14px; }
.bf-age { border-radius: 0; border-color: var(--edge); background: var(--well); box-shadow: inset 0 0 0 1px rgba(160, 132, 104, .4); }
.bf-w { border-radius: 1px; }
.bf-bar {
  background: #1c1612 url(../img/ui/bar.webp) top / auto 100%; border-top: 3px solid var(--bronze);
  box-shadow: inset 0 1px 0 rgba(255, 230, 190, .18), inset 0 2px 0 var(--edge), 0 -1px 0 var(--edge), 0 -6px 24px rgba(0, 0, 0, .6);
  padding-top: 7px; padding-bottom: 7px;
}
.bf-cmd, .bf-info { background: var(--well); border: 1px solid var(--edge); border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(125, 100, 75, .25), inset 0 3px 10px rgba(0, 0, 0, .5); }
.bf-mini { border: 9px solid transparent; border-image: url(../img/ui/frame.webp) 20 / 9px stretch; border-radius: 0; padding: 0; background: #0c0907; }
.bf-minimap { border-radius: 0; }
.bf-cb { background: url(../img/ui/slot.webp) center / 100% 100%; border: 0; border-radius: 2px; box-shadow: none; text-shadow: 0 1px 2px #000; }
.bf-cb:hover { filter: brightness(1.25); }
.bf-cb img { inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); border-radius: 1px; }
.bf-cb-foot { left: 4px; right: 4px; bottom: 4px; padding: 1px 0; background: rgba(8, 6, 4, .88); font-size: 9.5px; letter-spacing: -.01em; overflow: hidden; }
/* drawn and pixel icons sit in the space above the label, inside the stone edge */
.bf-cb > .svg, .bf-cb > .px { inset: 5px 5px 17px 5px; }
.bf-cb > .px img { width: 26px; height: 26px; border-radius: 1px; background: #d8c9a6; }
.bf-cb > .svg svg { width: 22px; height: 22px; }
@media (min-width: 761px) and (min-height: 461px) { .bf-hp { min-width: 130px; } .bf-unit .bf-hp { min-width: 0; } }
.bf-cb kbd { left: 5px; top: 5px; border-radius: 1px; }
.bf-cb.on, .bf-cb.gold, .bf-cb.age { background: url(../img/ui/slot.webp) center / 100% 100%; }
.bf-cb.on { box-shadow: inset 0 0 0 2px #f0b860, 0 0 10px rgba(240, 150, 60, .7); }
.bf-cb.on.red { background: url(../img/ui/slot.webp) center / 100% 100%; box-shadow: inset 0 0 0 2px #e0705f, 0 0 10px rgba(224, 90, 70, .7); }
.bf-cb.gold, .bf-cb.age { box-shadow: inset 0 0 0 1px #c98b3c, inset 0 0 12px rgba(232, 130, 50, .45); }
.bf-port { border: 8px solid transparent; border-image: url(../img/ui/port.webp) 16 / 8px stretch; border-radius: 0; }
.bf-unit, .bf-q, .bf-trib-b { border: 1px solid var(--edge); border-radius: 1px; box-shadow: inset 0 0 0 1px rgba(160, 132, 104, .45); }
.bf-unit:hover, .bf-trib-b:hover { border-color: var(--edge); box-shadow: inset 0 0 0 1px #f0b860; }
.bf-hp { padding: 1px; }
.bf-hp i.good { background: url(../img/ui/fill-gold.webp) left / auto 100%; filter: hue-rotate(38deg) saturate(1.25); }
.bf-hp i.mid { background: url(../img/ui/fill-gold.webp) left / auto 100%; filter: hue-rotate(-14deg) saturate(1.3); }
.bf-hp i.low { background: url(../img/ui/fill-red.webp) left / auto 100%; }
.bf-hp.build i { background: url(../img/ui/fill-gold.webp) left / auto 100%; filter: hue-rotate(-14deg) saturate(1.3); }
.bf-qbar { background: #f0b860; }
.bf-score { border: 8px solid transparent; border-image: url(../img/ui/panel.webp) 34 fill / 8px stretch; background: none; border-radius: 0; padding: 1px 3px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.bf-shead { border-bottom: 1px solid rgba(125, 100, 75, .35); padding-bottom: 2px; }
.bf-hint { border: 5px solid transparent; border-image: url(../img/ui/tab.webp) 10 fill / 5px stretch; background: none; border-radius: 0; padding: 4px 6px; color: #d8cbb2; }
.bf-hold { border-radius: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 6px 24px #000; }
.bf-relic { border-radius: 2px; }
.bf-sq { line-height: 22px; height: 32px; padding: 0 6px; }
.bf-set-box { background: none; }
.bf-set-head { padding-top: 9px; padding-bottom: 9px; }
/* a star over the result when you win */
.bf-end:not(.lost) > div::before { content: ''; flex: none; width: 54px; height: 53px; margin: -4px 0 -8px; background: url(../img/ui/star.webp) center / contain no-repeat; filter: drop-shadow(0 0 10px rgba(255, 190, 80, .7)); }
.bf-results td { border-top-color: rgba(125, 100, 75, .3); }

@media (max-width: 760px), (max-height: 460px) {
  .box, .card, .modal, .bf-set-box, .bf-end > div { border-width: 8px; border-image-width: 8px; }
  .gpanel.box, .cbox.box { border-width: 6px; border-image-width: 6px; }
  .btn { border-width: 7px; border-image-width: 7px; padding: 2px 8px; }
  .bf-bar { background: none; box-shadow: none; border-top: 0; padding: 0; }
  .bf-bar > .bf-mini { border-width: 5px; border-image-width: 5px; padding: 0; background: #0c0907; }
  .bf-port { border-width: 4px; border-image-width: 4px; }
  .bf-title::before { display: none; }
  .bf-score { border-width: 5px; border-image-width: 5px; }
  .bf-tip, #toast { border-width: 9px; border-image-width: 9px; }
}

/* chat on the battlefield: a stone window like the others, lines over the map on dark strips */
.bf-chat { border: 9px solid transparent; }
.bf-chat::before { inset: -9px; border: 9px solid transparent; border-image: url(../img/ui/panel.webp) 34 fill / 9px stretch; border-radius: 0; background: none; box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }
.bf-chat-grip { top: -9px; right: -9px; }
.bf-chat-head { padding: 0 16px 4px 0; }
@media (max-width: 760px), (max-height: 460px) { .bf-chat-grip { top: auto; bottom: -9px; } }
.bf-chat .chat-log { padding: 4px 4px; }
.bf-chat .chat-form { padding: 6px 0 0; }
.bf-feed-line { border-radius: 2px; border-left: 2px solid var(--bronze); }
.bf-chat-x.btn { font-size: 22px; line-height: 1; padding: 0 8px; color: var(--muted); }
.bf-chat-x.btn:hover { color: var(--gold2); }
