/* =====================================================================
   AETHERIA — css/mercado.css  (MERCADO, scratch mercado/SPEC.md §7, owner 2026-11-09)
   The players' market window (ui.js "WINDOW: Mercado"), its HUD button (left of the VIP crown, the console's 6-column grid
   untouched; touch: the drawer tile instead) and its Esc menu entry. The two icons are SVG drawn here (no PNG): the market
   stall (.mk-stall) and the Moeda de Mana (.mk-mana). Colours: the Mana theme tokens (theme_mana.css), with fallbacks.
   Narrow screens: the window is a full-screen sheet (style.css .win), the content keeps a readable width.
   ===================================================================== */
.mk-stall, .mk-mana { display: inline-block; flex: none; background: center / contain no-repeat; pointer-events: none; }
.mk-stall {
  width: 1.25em; height: 1.25em; margin-right: .3em; vertical-align: -.22em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='c' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff1b8'/%3E%3Cstop offset='.55' stop-color='%23e2b65a'/%3E%3Cstop offset='1' stop-color='%23a8742a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M4.6 10.5v9.8M19.4 10.5v9.8' stroke='%235a3a20' stroke-width='1.8'/%3E%3Cpath d='M5 3.5h3.5l-1 5.5H3z' fill='%23d8434f'/%3E%3Cpath d='M8.5 3.5H12V9H7.5z' fill='%23fff4dc'/%3E%3Cpath d='M12 3.5h3.5l1 5.5H12z' fill='%23d8434f'/%3E%3Cpath d='M15.5 3.5H19l2 5.5h-4.5z' fill='%23fff4dc'/%3E%3Cpath d='M3 9a2.25 2.25 0 0 0 4.5 0z' fill='%23d8434f'/%3E%3Cpath d='M7.5 9a2.25 2.25 0 0 0 4.5 0z' fill='%23fff4dc'/%3E%3Cpath d='M12 9a2.25 2.25 0 0 0 4.5 0z' fill='%23d8434f'/%3E%3Cpath d='M16.5 9a2.25 2.25 0 0 0 4.5 0z' fill='%23fff4dc'/%3E%3Cpath d='M5 3.5h14l2 5.5a2.25 2.25 0 0 1-4.5 0 2.25 2.25 0 0 1-4.5 0 2.25 2.25 0 0 1-4.5 0A2.25 2.25 0 0 1 3 9z' fill='none' stroke='%234a2c06' stroke-width='1.1' stroke-linejoin='round'/%3E%3Crect x='3' y='15.2' width='18' height='5.6' rx='1.2' fill='url(%23c)' stroke='%234a2c06' stroke-width='1.1'/%3E%3Ccircle cx='12' cy='13.2' r='1.9' fill='%23ffd34d' stroke='%234a2c06' stroke-width='.9'/%3E%3C/svg%3E");
}
.mk-mana {
  width: 16px; height: 16px; vertical-align: middle;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.38' cy='.32' r='.75'%3E%3Cstop offset='0' stop-color='%23dff4ff'/%3E%3Cstop offset='.45' stop-color='%235b8cff'/%3E%3Cstop offset='1' stop-color='%233a1f8f'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='10' cy='10' r='8.6' fill='url(%23g)' stroke='%23c9953a' stroke-width='1.6'/%3E%3Ccircle cx='10' cy='10' r='6.3' fill='none' stroke='%23fff4c2' stroke-width='.7' opacity='.75'/%3E%3Cpath d='M10 4.6l3.2 5.4-3.2 5.4-3.2-5.4z' fill='%23f4fbff' stroke='%232a1a6a' stroke-width='.7' stroke-linejoin='round'/%3E%3Cpath d='M10 4.6v10.8M6.8 10h6.4' stroke='%238fb8ff' stroke-width='.55'/%3E%3C/svg%3E");
}

/* ---------- HUD: a square button left of the VIP crown (the buff row keeps the crown first among the buffs) ---------- */
.hud-tl-top { display: flex; align-items: flex-start; gap: 5px; }
.mk-hud {
  position: relative; display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin-bottom: 10px; padding: 2px;
  font: inherit; color: inherit; cursor: var(--cur-pointer, pointer); pointer-events: auto;
  background: linear-gradient(180deg, #fffaf0, #f1e2bf); border: 1px solid var(--mn-gold-mid, #c9953a); border-radius: 8px;
  box-shadow: 0 0 0 1px var(--ink, #120c18), 0 0 8px -2px rgba(244, 212, 124, .5);
}
.mk-hud .mk-stall { width: 20px; height: 20px; margin: 0; }
.mk-hud:hover, .mk-hud:focus-visible { outline: none; border-color: var(--mn-gold, #e2b65a); box-shadow: 0 0 0 1px var(--ink, #120c18), 0 0 10px -1px rgba(255, 211, 77, .85); }
.mk-hud:focus-visible { outline: 2px solid #fffaf0; outline-offset: 1px; }
.mk-hud .badge { top: -6px; right: -6px; }
html.ae-touch .mk-hud { display: none; }   /* touch: the drawer's "Mercado" tile (js/touch.js) */
.btn.mk-menu .mk-stall { width: 1.3em; height: 1.3em; }

/* ---------- the window ---------- */
.w-market { width: calc(520px * var(--txt-h, 1)); max-width: calc(100vw - 16px); }
.w-market .win-b { display: flex; flex-direction: column; gap: 9px; padding: 12px 16px 14px; }
/* VITRINE (Pergaminho Real, 2026-11-10): the hero's framed plate: a gold medallion with the blinking face and the class seal,
   the name, class · level, the Moedas de Mana and the free zen, the coins on hold. The corner filigree is the windows' own
   (frame-corners.svg), smaller. */
.mk-head {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px; padding: 12px 14px 11px 12px;
  border: 1.5px solid var(--mn-gold-mid, #c9953a); border-radius: 12px;
  background: radial-gradient(ellipse 80% 120% at 18% 0%, rgba(255, 244, 194, .7), transparent 60%), linear-gradient(180deg, #fffaf0, #f3e4c2);
  box-shadow: inset 0 0 0 1px var(--mn-gold-hi, #fff4c2), inset 0 0 0 3px rgba(255, 250, 236, .7), inset 0 0 0 4px rgba(201, 149, 58, .4), var(--mn-shadow-sm, 0 2px 6px rgba(74, 46, 20, .2));
}
.mk-head::after, .mk-card::after, .mk-sellbox::after, .mk-cf-box::after {
  content: ""; position: absolute; inset: -5px; border: 20px solid transparent; border-image: url(../assets/ui/mana/frame-corners.svg) 32 / 20px stretch; pointer-events: none;
}
.mk-head > .mk-medal { grid-row: 1 / 3; }
.mk-me { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mk-me-l { font: 700 calc(9.5px * var(--txt, 1))/1.25 var(--f-num, serif); letter-spacing: .16em; text-transform: uppercase; color: var(--mn-gold-deep, #8a5f1e); }   /* "Seu herói" */
.mk-me-n { font: 700 calc(18px * var(--txt-h, 1))/1.15 var(--f-title, serif); letter-spacing: .03em; text-transform: uppercase; color: var(--mn-gold-deep, #8a5f1e); text-shadow: 0 1px 0 var(--mn-paper-hi, #fffaf0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-me-s { font: 700 calc(12.5px * var(--txt, 1))/1.25 var(--f-num, serif); letter-spacing: .03em; color: var(--mn-ink-2, #6b5442); }
.mk-purse { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.mk-bal {
  display: inline-flex; align-items: center; gap: 6px; flex: 1 1 150px; min-width: 0; padding: 4px 10px;
  border: 1.5px solid var(--mn-line, #d8bd86); border-radius: 9px; background: linear-gradient(180deg, rgba(255, 253, 246, .98), rgba(246, 234, 206, .9)); box-shadow: inset 0 1px 0 #fff;
}
.mk-bal img, .mk-bal .mk-mana { width: 18px; height: 18px; }
.mk-bl { font: 700 calc(10.5px * var(--txt, 1))/1.1 var(--f-num, serif); letter-spacing: .04em; text-transform: uppercase; color: var(--mn-ink-3, #7a6650); }
.mk-v { margin-left: auto; font: 800 calc(15px * var(--txt, 1))/1 var(--f-num, serif); color: var(--mn-ink, #3b2a1f); white-space: nowrap; }
.mk-bal.coin .mk-v { color: var(--mn-lav-deep, #6a4fb0); }
.mk-v.bad, .mk-bal.coin .mk-v.bad { color: var(--mn-rose-deep, #b23a52); }
/* MOEDAS EM ESPERA: the card coins on hold, a line under the balances */
.mk-held { grid-column: 1 / -1; padding: 2px 4px 0; font: italic 600 calc(12px * var(--txt, 1))/1.3 var(--f-ui, serif); color: var(--mn-lav-deep, #6a4fb0); cursor: help; text-align: center; }
/* the medallions: a gold ring, the face (whole-number scale: 48 px at 1×, 96 px at 2×, the ring crops the cell's corners), the wax seal */
.mk-medal {
  --md: 46px; --fc: 48px; position: relative; display: inline-block; flex: none; width: var(--md); height: var(--md); padding: 2px; border-radius: 50%;
  background: conic-gradient(from 200deg, #8f6d2c, #f6e1a2, #b8903f, #fff4cc, #8f6d2c, #e0bd6c, #8f6d2c); box-shadow: 0 0 0 1px #5a3d0c, 0 2px 5px rgba(74, 46, 20, .4);
}
.mk-medal.lg { --md: 80px; --fc: 96px; padding: 3px; }
.mk-medal-face {
  position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #fff3d4, #e6cc96 60%, #c9a35a); box-shadow: inset 0 0 0 1px #5a3d0c, inset 0 2px 6px rgba(74, 46, 20, .45);
}
.mk-face { position: absolute; left: 50%; top: 50%; width: var(--fc); height: var(--fc); transform: translate(-50%, -50%); image-rendering: pixelated; }
.mk-medal-emb { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; transform: translate(-50%, -50%); image-rendering: pixelated; }
.mk-medal:not(.lg) .mk-medal-emb { width: 16px; height: 16px; }
.mk-medal-initial { display: grid; place-items: center; width: 100%; height: 100%; font: 700 calc(var(--md) * .42)/1 var(--f-title, serif); color: var(--mn-gold-deep, #8a5f1e); }
.mk-head .mk-medal .mk-face, .mk-head .mk-medal.pt .mk-medal-emb { display: none; }   /* the plate: the emblem until the face is drawn */
.mk-head .mk-medal.pt .mk-face { display: block; }
.mk-seal {
  position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(40, 10, 10, .6));
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CradialGradient id='w' gradientUnits='userSpaceOnUse' cx='9' cy='8' r='16'%3E%3Cstop offset='0' stop-color='%23f0837a'/%3E%3Cstop offset='.45' stop-color='%23b3262f'/%3E%3Cstop offset='1' stop-color='%23610d16'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='url(%23w)'%3E%3Ccircle cx='12' cy='12' r='9.4'/%3E%3Ccircle cx='12' cy='2.7' r='2.1'/%3E%3Ccircle cx='17.5' cy='4.5' r='2.1'/%3E%3Ccircle cx='20.9' cy='9.1' r='2.1'/%3E%3Ccircle cx='20.9' cy='14.9' r='2.1'/%3E%3Ccircle cx='17.5' cy='19.5' r='2.1'/%3E%3Ccircle cx='12' cy='21.3' r='2.1'/%3E%3Ccircle cx='6.5' cy='19.5' r='2.1'/%3E%3Ccircle cx='3.1' cy='14.9' r='2.1'/%3E%3Ccircle cx='3.1' cy='9.1' r='2.1'/%3E%3Ccircle cx='6.5' cy='4.5' r='2.1'/%3E%3C/g%3E%3Ccircle cx='12' cy='12' r='6.7' fill='none' stroke='%23ffd7b0' stroke-opacity='.5' stroke-width='.8'/%3E%3C/svg%3E");
}
.mk-seal img { width: 16px; height: 16px; image-rendering: pixelated; filter: drop-shadow(0 0 1px #3a0a0f); }   /* the 16 px emblem at 1×: crisp */
.mk-medal.lg .mk-seal { width: 32px; height: 32px; right: -4px; bottom: -4px; }
.mk-tabs { margin: 0; gap: 5px; }
.mk-tabs .btn { flex: 1 1 auto; }
.mk-tabs .btn.mk-tab { min-height: 32px; font-family: var(--f-num, serif); letter-spacing: .03em; }
.mk-tabs .btn.mk-tab.on { box-shadow: inset 0 -2px 0 var(--mn-gold, #e2b65a), inset 0 2px 0 #fffbe6, 0 0 10px rgba(255, 217, 138, .55); }
.mk-msg {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 22px 10px; text-align: center;
  font: italic 500 calc(14px * var(--txt, 1))/1.35 var(--f-ui, serif); color: var(--mn-ink-2, #6b5442);
}
.mk-pane { display: flex; flex-direction: column; gap: 8px; }
.mk-h { margin-top: 4px; font: 400 calc(10px * var(--txt, 1))/1.2 var(--f-num, serif); letter-spacing: 1px; text-transform: uppercase; color: var(--mn-gold-deep, #8a5f1e); }
.mk-note { margin: 0; font: italic 500 calc(11.5px * var(--txt, 1))/1.35 var(--f-ui, serif); color: var(--mn-ink-3, #7a6650); }
.w-market .inv-hint { font-size: calc(11px * var(--txt, 1)); line-height: 1.3; color: var(--mn-ink-3, #7a6650); }
.mk-price .mk-mana { width: 16px; height: 16px; }

/* ---------- Comprar ---------- */
.mk-search { display: flex; gap: 6px; }
.mk-search .vault-in { flex: 1 1 auto; min-width: 0; height: 32px; font-size: calc(13px * var(--txt, 1)); }
.mk-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mk-sel {
  width: 100%; min-width: 0; height: 32px; padding: 0 6px; font: 500 calc(12.5px * var(--txt, 1))/1 var(--f-ui, serif);
  color: var(--mn-ink, #3b2a1f); background: #fffdf6; border: 1px solid #d2b98a; border-radius: 8px; cursor: var(--cur-pointer, pointer);
}
.mk-sel:focus-visible { outline: none; box-shadow: var(--mn-focus, 0 0 0 2px #2f8592); }
.mk-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 120px; align-content: start; transition: opacity .15s; }
.mk-list.busy { opacity: .55; }
.mk-list .list-empty { grid-column: 1 / -1; }
/* VITRINE: each card a gilded parchment slip; the item in its walnut display case, on a gold plinth with the rarity's glow;
   the time left on the case; the seller's medallion, name, class · level; the price and Comprar */
.w-market .sc.mk-card {
  --glow: rgba(230, 223, 204, .22); gap: 5px; padding: 7px 7px 9px; border: 1.5px solid var(--mn-gold-mid, #c9953a); border-radius: 11px;
  background: linear-gradient(180deg, #fffdf6, #f6ead0); box-shadow: inset 0 0 0 1px var(--mn-gold-hi, #fff4c2), inset 0 0 0 3px rgba(255, 250, 236, .7), inset 0 0 0 4px rgba(201, 149, 58, .3), var(--mn-shadow-sm, 0 2px 6px rgba(74, 46, 20, .2));
}
.mk-card::after { inset: -4px; border-width: 16px; border-image-width: 16px; }
.w-market .sc.mk-card:hover { border-color: var(--mn-gold, #e2b65a); box-shadow: inset 0 0 0 1px var(--mn-gold-hi, #fff4c2), inset 0 0 0 3px rgba(255, 250, 236, .7), inset 0 0 0 4px rgba(201, 149, 58, .45), 0 0 14px rgba(255, 217, 138, .6), var(--mn-shadow-sm, none); }
.mk-card[data-r="magico"] { --glow: rgba(147, 172, 255, .55); }
.mk-card[data-r="raro"] { --glow: rgba(255, 211, 77, .55); }
.mk-card[data-r="excelente"] { --glow: rgba(98, 224, 124, .55); }
.mk-card[data-r="lendario"] { --glow: rgba(255, 154, 60, .65); }
.mk-card .sc-ic {
  height: 92px; border-color: #a8833d;
  background: radial-gradient(ellipse 46% 44% at 50% 46%, var(--glow), transparent 72%), radial-gradient(ellipse 72% 70% at 50% 30%, #5a4734 0%, #2e241b 55%, #17110c 100%);
  box-shadow: inset 0 2px 9px rgba(0, 0, 0, .85), inset 0 -14px 18px rgba(0, 0, 0, .45);
}
.mk-card .sc-ic::after {
  content: ""; position: absolute; left: 50%; bottom: 8px; z-index: 0; width: 58%; height: 14px; transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse 50% 50% at 50% 40%, #4b3a22 0 52%, #2a1d0e 66%, #e2b65a 70%, #8f6d2c 82%, #3a2a10 100%); box-shadow: 0 4px 8px rgba(0, 0, 0, .8), 0 0 12px var(--glow);
}
.mk-card .sc-ic > img { position: relative; z-index: 1; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .7)); }
.mk-card .sc-ic > .ig { z-index: 1; }
.mk-card .sc-ic .it-plus, .mk-card .sc-ic .it-qty { z-index: 2; }
.mk-card .sc-ic .it-qty { right: 4px; bottom: 3px; }
.mk-card .sc-ic .mk-left {
  position: absolute; top: 4px; left: 4px; z-index: 2; padding: 1px 7px; border-radius: 999px; background: rgba(23, 17, 12, .82); border: 1px solid rgba(226, 182, 90, .55);
  font: 700 calc(10.5px * var(--txt, 1))/1.45 var(--f-num, serif); letter-spacing: .02em; color: #f6ead0;
}
.mk-card .sc-n { min-height: 2.4em; font: 800 calc(13px * var(--txt, 1))/1.2 var(--f-ui, serif); justify-content: center; text-align: center; text-shadow: 0 1px 0 #fffaf0; }
.mk-card .sc-s { margin-top: -2px; color: var(--mn-ink-3, #7a6650); }
.mk-card.own { border-style: dashed; }
.mk-who {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 3px 2px; text-align: left;
  background: url(../assets/ui/mana/divider.svg) center top / 88% 10px no-repeat;
}
.mk-who-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mk-seller { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 calc(13px * var(--txt, 1))/1.15 var(--f-ui, serif); color: var(--mn-ink, #3b2a1f); }
.mk-seller-s { font: 700 calc(11px * var(--txt, 1))/1.2 var(--f-num, serif); letter-spacing: .02em; color: var(--mn-ink-3, #7a6650); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-card .sc-b { padding: 6px 2px 0; border-top: 1px solid rgba(201, 149, 58, .35); }
/* the price and Comprar on ONE line on every card, zen or Moeda de Mana (a coin price is its icon + the number: ui.js mkCardPrice),
   at the same height on every card of a row (.sc-b margin-top: auto); a card too narrow for both (a phone's two columns, the
   container query): the price centred over a full-width Comprar, on every card alike */
.w-market .sc.mk-card { container-type: inline-size; }
.mk-card .sc-b { flex-wrap: nowrap; min-height: 32px; }
.mk-card .sc-b > .price { flex: 1 1 auto; min-width: 0; white-space: normal; }
.mk-card .sc-b > .price > span:not(.mk-sr) { white-space: nowrap; }
.mk-card .sc-b > .btn { flex: none; }
@container (max-width: 205px) {
  .mk-card .sc-b { flex-direction: column; align-items: stretch; gap: 6px; }
  .mk-card .sc-b > .price { flex: none; justify-content: center; }
  .mk-card .sc-b > .btn { justify-content: center; min-height: 32px; }
}
.mk-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mk-left { white-space: nowrap; }
.mk-pager { display: flex; align-items: center; justify-content: center; gap: 10px; }
.mk-pager .btn { min-width: 36px; justify-content: center; }
.mk-page { font: 700 calc(12px * var(--txt, 1))/1.2 var(--f-num, serif); color: var(--mn-ink-2, #6b5442); text-align: center; }

/* ---------- Vender ---------- */
.mk-sellbox { display: flex; align-items: center; gap: 12px; }
.mk-slot {
  position: relative; flex: none; width: 76px; height: 88px; display: grid; place-items: center; cursor: var(--cur-pointer, pointer);
  border: 2px dashed #a8833d; border-radius: 10px; background: radial-gradient(ellipse 72% 66% at 50% 46%, #4d3d2e 0%, #2e241b 52%, #17110c 100%);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .85);
}
.mk-slot.full { border-style: solid; border-color: var(--mn-gold-mid, #c9953a); }
.mk-slot:focus-visible { outline: none; box-shadow: var(--mn-focus, 0 0 0 2px #2f8592); }
#ui.holding .mk-slot { border-color: var(--mn-gold, #e2b65a); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .85), 0 0 12px rgba(255, 217, 138, .8); }   /* a cursor item: drop it here */
.mk-slot-ic { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.mk-slot-ic img { display: block; }
.mk-slot-ic .it-qty { right: 4px; bottom: 3px; }
.mk-slot-t { min-width: 0; }
.mk-slot-n { font: 800 calc(15px * var(--txt, 1))/1.2 var(--f-ui, serif); color: var(--mn-ink, #3b2a1f); overflow-wrap: anywhere; }
.mk-slot-s { margin-top: 2px; font-size: calc(12px * var(--txt, 1)); color: var(--mn-ink-3, #7a6650); }
.mk-line { display: flex; align-items: center; gap: 10px; }
.mk-lbl { flex: 0 0 4.6em; font: 700 calc(11px * var(--txt, 1))/1 var(--f-num, serif); letter-spacing: .05em; text-transform: uppercase; color: var(--mn-ink-3, #7a6650); }
.mk-curs { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.mk-cur { display: inline-flex; align-items: center; gap: 5px; }
.btn.mk-cur.on { color: var(--mn-gold-deep, #8a5f1e); border-color: var(--mn-gold-mid, #c9953a); background: linear-gradient(180deg, #fffbe6, #ffe7a8); box-shadow: inset 0 2px 0 var(--mn-gold, #e2b65a), var(--mn-shadow-sm, none); }
.btn.mk-cur img, .btn.mk-cur .mk-mana { width: 16px; height: 16px; }
.mk-pricebox { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.mk-pricebox .vault-in { flex: 1 1 auto; max-width: 14em; height: 32px; font-size: calc(14px * var(--txt, 1)); }
.mk-unit { font: 700 calc(12px * var(--txt, 1))/1 var(--f-num, serif); color: var(--mn-ink-2, #6b5442); white-space: nowrap; }
.mk-fee { font: 700 calc(13px * var(--txt, 1))/1.3 var(--f-ui, serif); color: var(--mn-leaf-deep, #2f7a3a); }
.mk-lim { font-size: calc(12px * var(--txt, 1)); line-height: 1.3; color: var(--mn-ink-3, #7a6650); }
.mk-lim.bad { font-weight: 700; color: var(--mn-rose-deep, #b23a52); }
.mk-sellact { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.mk-slots { font: 700 calc(12px * var(--txt, 1))/1 var(--f-num, serif); color: var(--mn-ink-2, #6b5442); }
.mk-slots.full { color: var(--mn-rose-deep, #b23a52); }
.btn.mk-go { min-width: 10em; min-height: 38px; justify-content: center; font-size: calc(15px * var(--txt, 1)); }
.mk-pick { max-height: 150px; }
.mk-pick .it-qty { right: 2px; bottom: 1px; }

/* ---------- Meus anúncios, Caixa: rows ---------- */
.mk-rows { display: flex; flex-direction: column; gap: 5px; }
.sr.mk-r { grid-template-columns: 42px minmax(0, 1fr) auto; }
.mk-r .sr-ic { position: relative; }
.mk-r .sr-n { font-size: calc(13px * var(--txt, 1)); overflow-wrap: anywhere; }
.mk-sub { font-size: calc(11.5px * var(--txt, 1)); line-height: 1.3; color: var(--mn-ink-3, #7a6650); }
.mk-sub.st-sold { color: var(--mn-leaf-deep, #2f7a3a); }
.mk-r .sr-buy { flex-direction: column; align-items: flex-end; gap: 5px; }
.mk-boxzen {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px;
  border: 1.5px solid var(--mn-line, #d8bd86); border-radius: 10px; background: rgba(255, 250, 236, .8);
  font: 600 calc(13px * var(--txt, 1))/1.2 var(--f-ui, serif); color: var(--mn-ink-2, #6b5442);
}
.mk-boxzen img { width: 18px; height: 18px; }
.mk-boxzen .mk-v { margin-left: 0; }
.mk-boxzen .btn { margin-left: auto; }

/* ---------- the confirmation over the window (buy / list / cancel) ---------- */
.mk-cf {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 14px;
  background: rgba(59, 42, 31, .45); border-radius: inherit;
}
.mk-cf-box {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: min(100%, 380px); max-height: 100%; overflow: hidden; padding: 14px;
  border: 2px solid var(--mn-gold-mid, #c9953a); border-radius: 14px; background: var(--mn-paper-hi, #fffaf0); box-shadow: var(--mn-shadow, 0 10px 26px rgba(74, 46, 20, .32));
}
/* a short window: only the tooltip shrinks and scrolls; the question, the note and Confirmar | Voltar stay in view */
.mk-cf-box > * { flex: none; }
.mk-cf-box > .mk-cf-tip { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.mk-cf-tip .itip { min-width: 0; max-width: none; }
.mk-cf-q { font: 800 calc(16px * var(--txt, 1))/1.3 var(--f-ui, serif); color: var(--mn-ink, #3b2a1f); text-align: center; overflow-wrap: anywhere; }
.mk-cf-n { margin: 0; font-size: calc(12.5px * var(--txt, 1)); line-height: 1.35; color: var(--mn-ink-2, #6b5442); text-align: center; }
.mk-cf-a { display: flex; gap: 8px; }
.mk-cf-a .btn { flex: 1 1 0; min-height: 40px; justify-content: center; }

.mk-cf-who { padding: 9px 4px 0; }
/* ---------- VITRINE: the other tabs in the same gilded parchment (Vender, Meus anúncios, Caixa, the confirmation) ---------- */
.mk-h { display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 700 calc(11px * var(--txt, 1))/1.2 var(--f-num, serif); letter-spacing: 1.2px; }
.mk-h::before, .mk-h::after { content: ""; flex: 1 1 0; height: 1px; background: linear-gradient(90deg, rgba(201, 149, 58, 0), var(--mn-gold-mid, #c9953a)); }
.mk-h::after { background: linear-gradient(90deg, var(--mn-gold-mid, #c9953a), rgba(201, 149, 58, 0)); }
.mk-sellbox {
  position: relative; padding: 10px 12px; border: 1.5px solid var(--mn-gold-mid, #c9953a); border-radius: 12px; background: linear-gradient(180deg, #fffdf6, #f6ead0);
  box-shadow: inset 0 0 0 1px var(--mn-gold-hi, #fff4c2), inset 0 0 0 3px rgba(255, 250, 236, .7), inset 0 0 0 4px rgba(201, 149, 58, .3);
}
.mk-sellbox::after { inset: -4px; border-width: 16px; border-image-width: 16px; }
.mk-slot { background: radial-gradient(ellipse 72% 70% at 50% 30%, #5a4734 0%, #2e241b 55%, #17110c 100%); }
.w-market .sr.mk-r {
  padding: 6px 8px; border: 1.5px solid var(--mn-line, #d8bd86); border-radius: 10px; background: linear-gradient(180deg, #fffdf6, #f8eed6);
  box-shadow: inset 0 0 0 1px #fffaf0, 0 1px 0 rgba(138, 95, 30, .2);
}
.w-market .sr.mk-r:hover { border-color: var(--mn-gold-mid, #c9953a); }
.mk-r .sr-ic { width: 42px; height: 42px; border: 1px solid #a8833d; border-radius: 8px; background: radial-gradient(ellipse 72% 70% at 50% 30%, #5a4734 0%, #2e241b 55%, #17110c 100%); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .8); }
.mk-r .sr-n { font-weight: 800; }
.mk-boxzen { border-color: var(--mn-gold-mid, #c9953a); background: linear-gradient(180deg, #fffdf6, #f6ead0); box-shadow: inset 0 0 0 1px var(--mn-gold-hi, #fff4c2), inset 0 0 0 3px rgba(255, 250, 236, .7), inset 0 0 0 4px rgba(201, 149, 58, .3); }
.mk-cf-box { position: relative; overflow: visible; box-shadow: inset 0 0 0 1px var(--mn-gold-hi, #fff4c2), inset 0 0 0 3px rgba(255, 250, 236, .7), inset 0 0 0 4px rgba(201, 149, 58, .35), var(--mn-shadow, 0 10px 26px rgba(74, 46, 20, .32)); }
.mk-cf-box::after { inset: -6px; border-width: 22px; border-image-width: 22px; }
.w-market .sc.mk-card:focus-within { border-color: var(--mn-gold, #e2b65a); }

/* ---------- narrow screens (a full-screen sheet): a readable column, bigger touch targets ---------- */
@media (max-width: 760px) {
  .w-market { max-width: none; }   /* the whole screen as every sheet (style.css .win): no strip of the game on the right */
  .w-market .win-b > * { width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
  .w-market .win-b { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .mk-tabs { display: grid; grid-template-columns: 1fr 1fr; }   /* the 4 tabs as 2 × 2 (not 3 + 1) */
  .mk-filters { grid-template-columns: 1fr 1fr; }
  .mk-filters .mk-sel:first-child { grid-column: 1 / -1; }
  .mk-card .sc-ic { height: 84px; }
  .mk-head { gap: 4px 10px; padding: 10px 10px 9px; }
  .mk-medal.lg { --md: 56px; --fc: 48px; }
  .mk-me-n { font-size: calc(16px * var(--txt-h, 1)); }
  /* a phone: the balances under the whole plate, each a label over its value */
  .mk-head > .mk-medal { grid-row: auto; }
  .mk-purse { grid-column: 1 / -1; flex-wrap: nowrap; }
  .mk-bal { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1px 6px; flex: 1 1 0; padding: 4px 8px; }
  .mk-bal > img, .mk-bal > .mk-mana { grid-row: 1 / 3; }
  .mk-bl { font-size: calc(9.5px * var(--txt, 1)); }
  .mk-v { margin-left: 0; font-size: calc(14px * var(--txt, 1)); }
  .mk-seller-s { white-space: normal; }
  .mk-medal { --md: 38px; }
  .mk-who { gap: 6px; }
}
@media (max-width: 330px) { .mk-list { grid-template-columns: 1fr; } }
/* a short desktop screen (a 1366 x 768 laptop, 1280 x 720; the window is the screen less 140 px): the plate on one row (the
   balances stacked at its right, the medallion smaller), tighter gaps, so the first row of cards shows its price and Comprar */
@media (min-width: 761px) and (max-height: 760px) {
  .w-market .win-b { gap: 6px; padding-top: 8px; }
  .w-market .mk-pane { gap: 6px; }
  .mk-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; padding: 5px 12px 4px 9px; }
  .mk-head > .mk-medal { grid-row: auto; }
  .mk-medal.lg { --md: 52px; --fc: 48px; }
  .mk-me { gap: 0; }
  .mk-me-l, .mk-me-s { line-height: 1.1; }
  .mk-purse { flex-direction: column; flex-wrap: nowrap; gap: 3px; }
  .mk-bal { flex: none; padding: 1px 9px; }
  .mk-bal img, .mk-bal .mk-mana { width: 16px; height: 16px; }
  .mk-bal .mk-v { font-size: calc(13.5px * var(--txt, 1)); }
  .mk-held { padding-top: 0; line-height: 1.2; }
  .mk-card .sc-ic { height: 76px; }   /* the art box of fitWhenLoaded (64 x 76) */
  .mk-medal { --md: 36px; }
  .mk-who { padding-top: 7px; }
}
@media (pointer: coarse) {
  .mk-sel, .mk-search .vault-in, .mk-pricebox .vault-in { height: 38px; }
  .mk-pick .chaos-pk { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .mk-list { transition: none; } }
