/* ===================================================================
   Painted menu skin (art in assets/ui, made with the "Menu kit" prompts in docs/ART_PROMPTS.md).
   Loaded after style.css and only overrides how parts look. Each part is a 9-slice image (border-image):
   the corners keep their size and the edges and middle stretch, so one picture fits any size.
   The numbers after url(...) are where the image is cut, in its own pixels (top right bottom left);
   the sizes after "/" are how thick those borders are drawn on screen.
   Every menu part now has painted art (the close button is assets/icons/close.webp).
   =================================================================== */

/* ---------- panels ---------- */
/* the frame is a real (transparent) border, so content can never sit on top of it, whatever padding a panel sets */
.panel{border:22px solid transparent;border-image:url(assets/ui/panel.webp) 115 fill / 22px / 0 stretch;
  background:none;box-shadow:none;border-radius:0;padding:2px 2px 0;filter:drop-shadow(0 4px 0 #0003)}
/* panels with their own colours keep them inside the wooden frame */
.panel.warchest,.panel.scard.heroic,.panel.warpanel{border-image:url(assets/ui/panel.webp) 115 / 22px / 0 stretch;background-clip:padding-box}
.panel.warchest{background-image:linear-gradient(#fff3c4,#ffe08a)}
.panel.scard.heroic{background-image:linear-gradient(#fff6d0,#ffd87a)}
.panel.warpanel{background-image:linear-gradient(var(--parch),var(--parch2))}
.panel.bosspanel{border-image:url(assets/ui/panel-dark.webp) 115 fill / 22px / 0 stretch;background:none}
/* title ribbons sit on the top edge of a panel */
.ribbon{border:0 solid transparent;border-image:url(assets/ui/ribbon-blue.webp) 50 200 40 210 fill / 15px 60px 12px 63px / 0 stretch;
  background:none;border-radius:0;box-shadow:none;padding:2px 66px 13px 69px;margin:-40px auto 8px;line-height:1.1;filter:drop-shadow(0 3px 0 #0004)}
.ribbon.red{border-image-source:url(assets/ui/ribbon-red.webp);background:none}
.ribbon.purple{border-image-source:url(assets/ui/ribbon-purple.webp);background:none}
.ribbon.green{border-image-source:url(assets/ui/ribbon-green.webp);background:none}
.ribbon[style*="margin-top:0"]{margin-top:-6px!important}

/* ---------- buttons ---------- */
.btn{border:0 solid transparent;border-image:url(assets/ui/btn-green.webp) 45 110 55 110 fill / 7px 18px 9px 18px / 0 stretch;
  background:none;border-radius:0;box-shadow:none;padding:7px 18px 10px;
  text-shadow:-1.5px -1.5px 0 var(--out),1.5px -1.5px 0 var(--out),-1.5px 1.5px 0 var(--out),1.5px 1.5px 0 var(--out),0 2px 0 var(--out)}
.btn.yellow{border-image-source:url(assets/ui/btn-yellow.webp);background:none}
.btn.blue{border-image-source:url(assets/ui/btn-blue.webp);background:none}
.btn.red{border-image-source:url(assets/ui/btn-red.webp);background:none}
.btn.purple{border-image-source:url(assets/ui/btn-purple.webp);background:none}
.btn.gray,.btn:disabled{border-image-source:url(assets/ui/btn-gray.webp);background:none;filter:none;opacity:.9}
.btn.sm{border-image-width:5px 13px 6px 13px;padding:5px 13px 7px;border-radius:0}
.btn.big{border-image-width:9px 22px 11px 22px;padding:9px 22px 12px}
.btn:active{transform:translateY(2px);box-shadow:none;filter:brightness(.95)}
.backbtn{border:0 solid transparent;border-image:url(assets/ui/btn-yellow.webp) 45 110 55 110 fill / 6px 15px 8px 15px / 0 stretch;
  background:none;border-radius:0;box-shadow:none;padding:6px 16px 9px}

/* round buttons: settings, chat */
.iconbtn,#chatbtn{border:0;background:url(assets/ui/btn-round.webp) center/contain no-repeat;box-shadow:none;filter:drop-shadow(0 2px 0 #0005)}
.iconbtn{width:38px;height:38px}
#chatbtn{width:62px;height:62px}

/* ---------- tabs: a wooden strip with pill buttons, drawn in CSS so it scales to any width ---------- */
.tabs{gap:4px;padding:4px;border:3px solid var(--out);border-radius:16px;background:linear-gradient(#a0622d,#7a4520);
  box-shadow:inset 0 2px 0 #ffffff30,inset 0 -2px 0 #0003,0 3px 0 #0004}
.tabs button{border:2px solid #5a3418;border-radius:11px;padding:6px 8px 7px;color:var(--ink);font:14px var(--f-display);
  background:linear-gradient(#fff8e6,#efd8a8);box-shadow:inset 0 2px 0 #fff9,inset 0 -2px 0 #c9a46a;transition:filter .12s,transform .12s}
.tabs button:hover{filter:brightness(1.05)}
.tabs button:active{transform:translateY(1px)}
.tabs button.on{border-color:var(--out);color:#fff;background:linear-gradient(#7fd0ff,#2a8fe0 55%,#1d6fbf);
  box-shadow:inset 0 2px 0 #ffffff80,inset 0 -3px 0 #0f4f8a,0 0 0 2px #ffe14a;
  text-shadow:0 1px 0 var(--out),0 -1px 0 var(--out),1px 0 0 var(--out),-1px 0 0 var(--out)}

/* ---------- top bar and resource counters ---------- */
/* the top bar uses the same painted plank as the bottom menu (stone caps, gold trim) so the two match */
#topbar{border:0 solid transparent;border-image:url(assets/ui/navbar.webp) 0 190 0 190 fill / 0 56px / 0 stretch;
  background:none;box-shadow:0 3px 0 #0003;padding-block:8px}
/* counters: light cream bubbles with a dark outline (the same look as the bubbles on the town map) */
.res{border:3px solid var(--out);border-radius:14px;background:#fffbe9;box-shadow:0 3px 0 #0003;height:30px;padding:2px 10px 2px 4px}
.res b,.res.pow b{color:var(--ink);text-shadow:none}
.res.pow .powic{font-size:16px;line-height:1;color:var(--ink)}

/* ---------- bottom menu ---------- */
#nav{border:0 solid transparent;border-image:url(assets/ui/navbar.webp) 0 190 0 190 fill / 0 56px / 0 stretch;
  background:none;box-shadow:0 -3px 0 #0003;padding-block:6px 6px}
#nav .nb{border:0;background:url(assets/ui/nav-slot.webp) center/contain no-repeat;box-shadow:none;width:48px;height:48px;filter:drop-shadow(0 2px 0 #0005)}
#nav button.active .nb{background:url(assets/ui/nav-slot.webp) center/contain no-repeat;box-shadow:none;filter:drop-shadow(0 0 8px #ffe14a) drop-shadow(0 2px 0 #0005)}

/* ---------- progress bars: a dark groove with a gold rim, filled with glowing liquid (battle HP bars stay plain) ---------- */
.bar.xp,.bar.big,.bar.bosshp{border:0 solid transparent;border-image:url(assets/ui/bar-frame.webp) 0 48 fill / 0 6px / 0 stretch;
  background:none;border-radius:0;overflow:visible;height:12px;padding:2px 3px}
.bar.xp>i,.bar.big>i,.bar.bosshp>i{background:none;border:0 solid transparent;border-image:url(assets/ui/bar-fill-gold.webp) 0 48 fill / 0 4px / 0 stretch}
.bar.green>i{border-image-source:url(assets/ui/bar-fill-green.webp)}
.bar.big{height:16px;border-image-width:0 8px;padding:3px 4px}
.bar.big>i{border-image-width:0 5px}
.bar.bosshp{height:20px;border-image-width:0 10px;padding:3px 5px}
.bar.bosshp>i{border-image-source:url(assets/ui/bar-fill-red.webp);border-image-width:0 7px}

/* ---------- reward / cost chips (chips with their own colours, like gear rarity, keep them) ---------- */
.chip:not([style]):not(.on):not(.short){border:0 solid transparent;border-image:url(assets/ui/chip.webp) 22 96 fill / 2.5px 11px / 0 stretch;
  background:none;border-radius:0;padding:2px 10px 2px 5px}

/* ---------- text fields ---------- */
input:not([type]),input[type=text],input[type=password],input[type=search],input[type=email],input[type=number]{
  border:0 solid transparent;border-image:url(assets/ui/input.webp) 34 96 fill / 7px 19px / 0 stretch;background:none;border-radius:0;padding:9px 16px;outline:none}
input:not([type]):focus,input[type=text]:focus,input[type=password]:focus,input[type=search]:focus,input[type=email]:focus,input[type=number]:focus{filter:drop-shadow(0 0 4px #ffe14a)}

/* ---------- notification dots and the player's portrait ring ---------- */
#nav button.dot::after,.dotb::after,.wm-label.badge::after,.evbtn.dot::after{background:url(assets/ui/badge-dot.webp) center/contain no-repeat;border:0;box-shadow:none;width:17px;height:17px}
.avatar{border-color:transparent;box-shadow:none}
.avatar::after{content:'';position:absolute;inset:-7px;background:url(assets/ui/portrait-ring.webp) center/100% 100% no-repeat;pointer-events:none}
.avatar b{z-index:1}

/* ---------- pop-up windows ---------- */
/* the scroll frame is a real border: long windows scroll inside it, below the top roll and above the bottom one */
#modal-box,#modal-box.hero-modal{border-style:solid;border-color:transparent;border-width:44px 24px 35px 24px;border-image:url(assets/ui/modal.webp) 175 95 140 95 fill / 44px 24px 35px 24px / 0 stretch;
  background:none;border-radius:0;box-shadow:none;padding:8px 8px 6px;filter:drop-shadow(0 6px 10px #0006)}
#modal-box .ribbon{margin-top:2px}
#modal-box.battle-modal{border-image:none;border:4px solid var(--out);border-radius:16px;background:#1b120a;padding:0;filter:none}
/* phones: thinner counter frames so the numbers fit */
@media (max-width:600px){
  #topbar{border-image-width:0 26px}
  #app #topbar{padding-inline:22px}
  .res{border-width:2px;border-radius:12px;padding:2px 5px 2px 2px;gap:2px}
  .res .ic{width:16px;height:16px}
  #topbar .iconbtn{width:32px;height:32px}
}
/* bottom bar: a light inner disc inside the gold rim so the painted icons stand out from the dark wood
   (cool sky blue against the warm icons; the selected tab glows warm gold) */
#nav .nb{position:relative}
#nav .nb::before{content:"";position:absolute;inset:21%;border-radius:50%;z-index:0;
  background:radial-gradient(circle at 50% 38%,#fbfdff 0%,#d6ecfb 45%,#95c4e8 100%);box-shadow:inset 0 3px 4px #0003,inset 0 -2px 3px #fff8}
#nav button.active .nb::before{background:radial-gradient(circle at 50% 38%,#fffdf0 0%,#ffeeb0 45%,#f5c242 100%)}
#nav .nb > *{position:relative;z-index:1}
/* on the town map, the see-through ends of the top and bottom bars show the map's sky colours instead of the menu background */
#app.ontown #topbar{background-color:#7bacde}
#app.ontown #nav{background-color:#c5dbf1}
@media (max-width:900px), (max-height:560px){ #app.ontown #nav{background-color:transparent} }

/* chat: other players' messages in the painted speech bubble (its tail points down-left, toward the speaker's picture) */
.cmsg.wav:not(.me):not(.ping) .cbody{border:0 solid transparent;border-width:10px 12px 18px 22px;border-radius:0;background:none;
  border-image:url(assets/ui/chat-bubble.webp) 40 46 92 100 fill / 10px 12px 18px 22px / 0 stretch;padding:0 2px 0 0}
/* painted divider under the Codex group headings and shop headings */
.cxgroup + .cxgroup{background:url(assets/ui/divider.webp) top center/min(100%,420px) 14px no-repeat;padding-top:16px}
.shoph{padding-bottom:12px;background:url(assets/ui/divider.webp) bottom center/100% 12px no-repeat}
