/* DUMBGEON EXPLORER (7.24 D). The game's own drawn interface: every frame, button, slot and tab is a pixel-art PNG
   from /img/ui put on with border-image, exactly as public/css/skin.css does in the game. One art pixel is --ap. */
:root { --ap: 2px; --side: 330px; color-scheme: dark; }
@media (max-width: 760px) { :root { --ap: 1.5px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 400 15px/1.4 var(--f-body);
  background: #586174 url("/img/ui/bg-win.png") repeat; background-size: calc(16 * var(--ap)) calc(16 * var(--ap)); background-blend-mode: multiply;
  image-rendering: auto; overflow-x: hidden;
}
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(ellipse at 50% 30%, transparent 40%, rgba(0, 0, 0, .55) 100%); }
a { color: var(--gold); }
button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pi { display: inline-block; vertical-align: -2px; image-rendering: pixelated; flex: none; }
.ico { display: inline-flex; margin-right: 4px; }

/* ───────── the top: a wooden plank with the logo ───────── */
#ex-top {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px max(16px, calc((100vw - 1400px) / 2 + 12px));
  background: #2a1a10 url("/img/ui/wood.png") repeat; background-size: calc(16 * var(--ap)) calc(16 * var(--ap));
  border-bottom: calc(4 * var(--ap)) solid #120a05; box-shadow: 0 4px 0 rgba(0, 0, 0, .45); image-rendering: pixelated;
}
#ex-top::after { content: ''; position: absolute; left: 0; right: 0; bottom: calc(-4 * var(--ap)); height: calc(2 * var(--ap)); background: #b8862a; box-shadow: 0 calc(1 * var(--ap)) 0 #6e4a12; }
.ex-brand { text-decoration: none; line-height: 1; }
.ex-logo {
  display: block; font-family: var(--f-display); font-weight: 900; font-size: 34px; letter-spacing: .06em;
  background: linear-gradient(180deg, #fff8d6 0%, #ffe28a 30%, #d9a63a 48%, #8a5d12 52%, #e9c062 66%, #fff0b0 82%, #a87a20 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px #1f1404; filter: drop-shadow(0 3px 0 #120b02);
}
.ex-plate {
  border: 0 solid transparent; border-image: url("/img/ui/plate.png") 4 fill / calc(4 * var(--ap)) stretch; image-rendering: pixelated;
  padding: 9px 14px 8px; font-family: var(--f-pixel); font-size: 12px; line-height: 1; color: #2b1903; letter-spacing: 1px; text-shadow: 0 1px 0 rgba(255, 238, 170, .55);
}
.ex-realm { display: inline-flex; align-items: center; gap: 7px; font: 600 13px var(--f-px); letter-spacing: 2px; color: #dcc68c; text-shadow: 0 2px 0 #000; }
.ex-realm .dot { width: 8px; height: 8px; background: var(--practice); box-shadow: 0 0 0 2px #000; }
.ex-realm .dot.live { background: var(--live); }
.ex-play { margin-left: auto; text-decoration: none; }

/* ───────── buttons, tabs, fields: the game's drawn pieces ───────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 14px; cursor: pointer;
  background: none; border: 0 solid transparent; border-image: url("/img/ui/btn-stone.png") 4 fill / calc(4 * var(--ap)); image-rendering: pixelated;
  font: 600 14px var(--f-px); letter-spacing: 1px; text-transform: uppercase; color: #e8edf4; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); white-space: nowrap;
}
.btn:hover { border-image-source: url("/img/ui/btn-stone-h.png"); }
.btn:active { border-image-source: url("/img/ui/btn-stone-p.png"); top: 1px; }
.btn.gold { border-image-source: url("/img/ui/btn-gold.png"); color: #2b1903; text-shadow: 0 1px 0 rgba(255, 240, 175, .6); }
.btn.gold:hover { border-image-source: url("/img/ui/btn-gold-h.png"); }
.btn.gold:active { border-image-source: url("/img/ui/btn-gold-p.png"); }
#ex-tabs { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; max-width: 1400px; margin: 0 auto; padding: 0 12px 10px; }
@media (max-width: 900px) { #ex-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tab {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 6px 8px; cursor: pointer;
  background: none; border: 0 solid transparent; border-image: url("/img/ui/tab.png") 4 fill / calc(4 * var(--ap)); image-rendering: pixelated;
  font: 600 15px var(--f-px); letter-spacing: 1.2px; color: #a9b4c6; text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.tab:hover { color: #fff; }
.tab.on { border-image-source: url("/img/ui/tab-on.png"); color: #fff; }
.tab .pi { width: 18px; height: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
/* v0.33: online now and heroes, the landing page's numbers */
.xp-counts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; font-size: 14px; color: var(--dim, #9aa); }
.xp-counts b { color: var(--gold, #f5c542); margin-left: 4px; }
.chip {
  min-height: 36px; padding: 5px 12px; cursor: pointer; background: none; border: 0 solid transparent; border-image: url("/img/ui/btn-stone.png") 4 fill / calc(4 * var(--ap)); image-rendering: pixelated;
  font: 600 13px var(--f-px); letter-spacing: 1px; color: #c8d0dc; text-shadow: 0 2px 0 rgba(0, 0, 0, .5);
}
.chip:hover { border-image-source: url("/img/ui/btn-stone-h.png"); }
.chip.on { border-image-source: url("/img/ui/btn-gold.png"); color: #2b1903; text-shadow: 0 1px 0 rgba(255, 240, 175, .6); }
.chip small { font-size: 12px; opacity: .75; margin-left: 3px; }
.inp, select {
  min-height: 40px; padding: 7px 11px; background: none; color: var(--text); outline: none; caret-color: var(--gold);
  border: 0 solid transparent; border-image: url("/img/ui/field.png") 3 fill / calc(3 * var(--ap)); image-rendering: pixelated; font: 500 15px var(--f-body);
}
.inp:focus, select:focus { border-image-source: url("/img/ui/field-on.png"); }
select { cursor: pointer; padding-right: 8px; }
select option { background: #10151e; color: var(--text); }
.inp::placeholder { color: var(--dimmer); }
.sel { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font: 600 13px var(--f-px); letter-spacing: 1px; text-transform: uppercase; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.tools .inp { flex: 1 1 200px; min-width: 0; }

/* ───────── frames ───────── */
.win {
  min-width: 0; border-style: solid; border-color: transparent; border-width: calc(8 * var(--ap));
  border-image: url("/img/ui/win.png") 10 / calc(10 * var(--ap)) / 0 round;
  background: #141a24 url("/img/ui/bg-win.png") repeat; background-size: calc(16 * var(--ap)) calc(16 * var(--ap)); background-clip: padding-box;
  box-shadow: 6px 8px 0 rgba(0, 0, 0, .45); image-rendering: pixelated;
}
.win-bar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; border: 0 solid transparent; border-image: url("/img/ui/winbar.png") 4 fill / calc(4 * var(--ap)) round; }
.win-ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: calc(16 * var(--ap)); height: calc(16 * var(--ap)); background: url("/img/ui/socket.png") center / 100% 100% no-repeat; image-rendering: pixelated; }
.win-title { margin: 0; flex: 0 1 auto; padding: 7px 18px 6px; border: 0 solid transparent; border-image: url("/img/ui/plate.png") 4 fill / calc(4 * var(--ap)) stretch; color: #2b1903; text-shadow: 0 1px 0 rgba(255, 238, 170, .55); font: 700 18px/1.25 var(--f-display); letter-spacing: 1.6px; white-space: nowrap; }
.win-note { margin-left: auto; color: var(--dim); font: 500 13px var(--f-px); }
.win-body { padding: 14px; min-height: 300px; }
.panel { border: 0 solid transparent; border-image: url("/img/ui/panel.png") 4 fill / calc(4 * var(--ap)); image-rendering: pixelated; }
.inset { border: 0 solid transparent; border-image: url("/img/ui/inset.png") 3 fill / calc(3 * var(--ap)); image-rendering: pixelated; }
.parch { border: 0 solid transparent; border-image: url("/img/ui/parch.png") 6 fill / calc(6 * var(--ap)) round; image-rendering: pixelated; color: #33220d; padding: 12px 16px; }
#ex-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 1400px; margin: 0 auto; padding: 0 12px 16px; align-items: start; }
#ex-side { display: none; }
@media (min-width: 1200px) {
  #ex-main { grid-template-columns: minmax(0, 1fr) var(--side); }
  #ex-side { display: block; position: sticky; top: 10px; }
  .on-drops #ex-main { grid-template-columns: minmax(0, 1fr); }
  .on-drops #ex-side { display: none; }
  #ex-side .win-body { min-height: 0; max-height: calc(100vh - 120px); overflow: auto; padding: 10px; scrollbar-width: thin; }
}

/* ───────── the freshness line ───────── */
#ex-fresh { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; max-width: 1400px; margin: 0 auto; padding: 12px 16px 10px; color: var(--dim); font: 500 13px var(--f-px); }
#ex-fresh .fr-k { color: var(--amber); letter-spacing: 1px; text-transform: uppercase; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
#ex-fresh .fr-i b { color: #c8d0dc; font-weight: 600; }

/* ───────── text ───────── */
h3 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; font: 400 12px/1.5 var(--f-pixel); color: var(--amber); text-shadow: 2px 2px 0 #000; letter-spacing: .5px; }
h3 .pi { align-self: center; }
h3 small { font: 500 13px var(--f-body); color: var(--dim); text-shadow: none; letter-spacing: 0; }
h4 { margin: 0 0 2px; font: 600 15px var(--f-px); letter-spacing: 1.2px; display: flex; gap: 8px; align-items: baseline; }
.explain { margin: 0 0 12px; color: #b9c3d2; font-size: 14px; }
.none { margin: 4px 0; color: var(--dim); font-size: 14px; }
.t-sub { display: block; color: var(--dim); font: 600 12px var(--f-px); letter-spacing: 1px; text-transform: uppercase; }
.t-gold { color: var(--gold); }
.t-good { color: var(--good); } .t-bad { color: var(--bad); }
.who { color: #ffe9a6; font-weight: 600; text-decoration: none; border-bottom: 1px dotted rgba(255, 217, 74, .45); cursor: pointer; overflow-wrap: anywhere; }
.who:hover { color: #fff; border-bottom-color: #fff; }
.money { display: inline-flex; align-items: center; white-space: nowrap; font: 600 15px var(--f-px); }
.money.sil b { color: var(--amber); } .money.tok b { color: var(--gold); } .money.pow b { color: #7cc7ff; }
.money small { margin-left: 3px; font-size: 12px; color: var(--dim); }
.rv { font: 600 15px var(--f-px); color: #e8edf4; white-space: nowrap; }
.sec { margin: 0 0 18px; min-width: 0; }
.tag { flex: none; padding: 2px 6px; font: 600 12px var(--f-px); letter-spacing: 1px; color: #0b0e14; background: #9aa4b0; box-shadow: 0 0 0 2px #07090d; white-space: nowrap; }
.tag.k-card { background: #4aa3ff; } .tag.k-boss { background: #e04848; color: #fff; } .tag.k-trophy { background: var(--gold); } .tag.k-look { background: #ff6bd0; } .tag.k-lost { background: #e9c46a; color: #2a1c05; }
.g-t-common { color: var(--g-common); } .g-t-uncommon { color: var(--g-uncommon); } .g-t-rare { color: var(--g-rare); } .g-t-epic { color: var(--g-epic); } .g-t-relic { color: var(--gold); }

/* ───────── item slots ───────── */
.slot {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; background: #0b0e14;
  border: 0 solid transparent; border-image: url("/img/ui/slot.png") 4 / calc(4 * var(--ap)); image-rendering: pixelated; cursor: default;
}
.slot.g-common { border-image-source: url("/img/ui/slot-c.png"); } .slot.g-uncommon { border-image-source: url("/img/ui/slot-u.png"); }
.slot.g-rare { border-image-source: url("/img/ui/slot-r.png"); } .slot.g-epic { border-image-source: url("/img/ui/slot-e.png"); } .slot.g-relic { border-image-source: url("/img/ui/slot-l.png"); }
.slot.empty { border-image-source: url("/img/ui/slot-empty.png"); background: #0b0e14 url("/img/ui/slot-mark.png") center / calc(8 * var(--ap)) calc(8 * var(--ap)) no-repeat; }
.slot.empty em { font: 600 12px var(--f-px); font-style: normal; color: #4d576a; letter-spacing: 1px; background: #0b0e14; padding: 0 2px; }
.slot .it-img { width: 82%; height: 82%; object-fit: contain; image-rendering: auto; pointer-events: none; }
.slot .it-img.no-pic { visibility: hidden; }
.slot[data-tip] { cursor: help; }
.slot[data-tip]:hover, .slot[data-tip]:focus-visible { outline: 2px solid #ffd94a; outline-offset: 1px; }
.s-s { width: 40px; height: 40px; } .s-m { width: 56px; height: 56px; } .s-l { width: 68px; height: 68px; }
.slot.big { width: 96px; height: 96px; }
.slot .rf { position: absolute; left: 3px; top: 1px; font: 600 12px var(--f-px); font-style: normal; color: #ffd94a; text-shadow: 1px 1px 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.slot .st { position: absolute; left: 3px; top: 1px; display: inline-flex; align-items: center; gap: 1px; font: 600 12px var(--f-px); font-style: normal; color: #ffd94a; text-shadow: 1px 1px 0 #000; }
.slot .nn { position: absolute; right: 3px; bottom: 1px; font: 600 12px var(--f-px); font-style: normal; color: #fff; text-shadow: 1px 1px 0 #000, -1px 0 0 #000; }
.slot .cdots { position: absolute; right: 3px; top: 3px; display: flex; gap: 2px; }
.slot .cdots b { width: 6px; height: 6px; background: #2a3242; box-shadow: 0 0 0 1px #000; }
.slot .cdots b.on { background: #7cc7ff; }
.ci { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.ci.ci-none { display: inline-flex; align-items: center; justify-content: center; background: #10151e; box-shadow: 0 0 0 2px #07090d; }

/* ───────── states ───────── */
.ex-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px; color: var(--dim); font: 600 14px var(--f-px); letter-spacing: 1px; }
.ex-loading .pi { width: 32px; height: 32px; animation: bob 0.8s steps(2) infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.ex-err { display: flex; gap: 8px; align-items: center; }
.ex-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 10px; text-align: center; }
.ex-empty p { margin: 0; max-width: 420px; color: #b9c3d2; font-size: 15px; }
#ex-toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px); border: 0 solid transparent; border-image: url("/img/ui/parch.png") 6 fill / calc(6 * var(--ap)) round; color: #33220d; padding: 10px 16px; font-weight: 600; image-rendering: pixelated; overflow-wrap: anywhere; }
#ex-foot { max-width: 1400px; margin: 0 auto; padding: 4px 16px 24px; color: var(--dim); font-size: 13px; text-align: center; }

/* ───────── tooltip ───────── */
#ex-tip { position: absolute; z-index: 50; width: max-content; max-width: min(320px, calc(100vw - 12px)); padding: 10px 12px; pointer-events: none;
  background: #10151e; border: 0 solid transparent; border-image: url("/img/ui/tip.png") 4 fill / calc(4 * var(--ap)); image-rendering: pixelated; box-shadow: 4px 5px 0 rgba(0, 0, 0, .5); font-size: 14px; }
.tt { --gc: var(--g-common); }
.tt.g-uncommon { --gc: var(--g-uncommon); } .tt.g-rare { --gc: var(--g-rare); } .tt.g-epic { --gc: var(--g-epic); } .tt.g-relic { --gc: var(--gold); }
.tt-n { display: block; color: var(--gc); font: 600 16px var(--f-px); letter-spacing: .5px; }
.tt-k { color: var(--dim); font: 600 12px var(--f-px); letter-spacing: 1px; margin: 1px 0 6px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.tt-st { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; margin: 4px 0; }
.tt-st div { display: flex; justify-content: space-between; gap: 8px; font: 500 14px var(--f-px); }
.tt-st span { color: var(--dim); } .tt-st b { color: #fff; }
.tt-b { margin: 4px 0; color: var(--good); }
.tt-t { margin: 6px 0 0; color: #b9c3d2; font-style: italic; }
.tt-boss { margin: 2px 0 4px; color: #ff8a85; font: 600 13px var(--f-px); }
.tt-drop { margin: 6px 0 0; color: var(--gold); font: 600 13px var(--f-px); }
.tt-pow { margin: 4px 0; color: #7cc7ff; font: 600 13px var(--f-px); }
.tt-cards { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #313c51; }
.tt-sub { display: block; color: var(--amber); font: 600 12px var(--f-px); letter-spacing: 1px; text-transform: uppercase; }
.tt-cards .cd { margin: 3px 0; color: var(--dim); }
.tt-cards .cd.on b { color: #7cc7ff; } .tt-cards .cd span { color: #b9c3d2; }
.stars { display: inline-flex; gap: 1px; }

/* ───────── RANKING ───────── */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; margin: 26px 0 14px; }
.podium.n1 { grid-template-columns: minmax(0, 300px); justify-content: center; }
.podium.n2 { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; }
.pod { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px 12px; text-align: center; min-width: 0; }
.pod-1 { padding-top: 26px; padding-bottom: 20px; border-image-source: url("/img/ui/panel-on.png"); }
.pod .crown { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); width: calc(13px * 3); height: calc(8px * 3); background: url("/img/ui/crown.png") center / 100% 100% no-repeat; image-rendering: pixelated; }
.pod-rank { position: absolute; left: 8px; top: 8px; font: 400 14px var(--f-pixel); color: #c3ccd8; text-shadow: 2px 2px 0 #000; }
.pod-1 .pod-rank { color: var(--gold); font-size: 18px; } .pod-2 .pod-rank { color: #dfe7ee; } .pod-3 .pod-rank { color: #d08a4a; }
.pod-pic { display: inline-flex; padding: 6px; background: #0b0e14; box-shadow: 0 0 0 2px #07090d, inset 2px 2px 0 #0a0d13, inset -2px -2px 0 #3a4458; }
.pod-pic .ci { width: 56px; height: 56px; }
.pod-1 .pod-pic .ci { width: 72px; height: 72px; }
.pod-n { max-width: 100%; font: 600 16px var(--f-px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-1 .pod-n { font-size: 18px; }
.pod-s { color: var(--dim); font: 500 13px var(--f-px); letter-spacing: .5px; }
.pod-v { margin-top: 2px; }
.pod-1 .pod-v .money, .pod-1 .pod-v .rv { font-size: 19px; }
.rk-list { list-style: none; margin: 0; padding: 6px; }
.rk-row { display: grid; grid-template-columns: 42px 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; }
.rk-row:nth-child(odd) { background: rgba(255, 255, 255, .035); }
.rk-n { font: 400 12px var(--f-pixel); color: #8d99ab; text-align: right; }
.rk-pic .ci { width: 28px; height: 28px; }
.rk-name { display: flex; flex-direction: column; min-width: 0; }
.rk-name .who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-name small { color: var(--dim); font: 500 13px var(--f-px); }

/* ───────── CHARACTER ───────── */
.ch-search { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.ch-search .inp { flex: 1 1 200px; min-width: 0; }
.ch-intro p { margin: 0 0 8px; font-size: 15px; } .ch-intro .t-sub { color: #6e5631; margin-top: 12px; }
.ch-try { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ch-try .ci { width: 18px; height: 18px; }
.ch-none { display: flex; gap: 8px; align-items: center; }
.ch-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ch-grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; margin-top: 8px; }
@media (min-width: 980px) { .ch-grid { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); } .ch-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ch-doll { display: grid; grid-template-columns: 84px minmax(0, 1fr) 84px; gap: 8px; padding: 12px 8px; background-color: #0d1118; }
.ch-col { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.ch-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; }
.ch-sn { min-height: 30px; width: 100%; font: 500 12px/1.2 var(--f-px); text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ch-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.ch-model { position: relative; width: 100%; height: 290px; }
.ch-model .ch-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.no3d { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; color: var(--dim); font-size: 13px; padding: 10px; }
.no3d .ci { width: 72px; height: 72px; }
.ch-plate { width: 100%; padding: 8px 10px; text-align: center; }
.ch-pl-top { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.ch-pl-top .ci { width: 28px; height: 28px; }
.ch-name { font: 600 19px var(--f-px); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-cls { color: #c8d0dc; font: 500 15px var(--f-px); letter-spacing: .5px; }
.ch-title { display: inline-block; margin-top: 4px; padding: 1px 8px; color: #ff6bd0; font: 400 12px var(--f-pixel); text-shadow: 1px 1px 0 #000; }
.ch-guest { margin-top: 4px; color: var(--dim); font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tiles.t4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-width: 0; }
.tl-k { display: flex; align-items: center; gap: 6px; color: var(--amber); font: 600 12px var(--f-px); letter-spacing: 1px; text-transform: uppercase; }
.tl-v { display: flex; align-items: center; font: 600 24px/1.2 var(--f-px); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.hot .tl-v { color: #ff8a5c; } .tile.gold .tl-v { color: var(--gold); }
.tl-d { color: var(--dim); font-size: 13px; line-height: 1.3; }
.rel-row { display: grid; grid-template-columns: repeat(6, 56px); gap: 8px; }
@media (max-width: 760px) { .rel-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; } .rel-row .slot { width: 100%; height: auto; aspect-ratio: 1; } .rel-row .slot.empty em { font-size: 0; } }
.cos-row { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.cos { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cos > span:last-child { display: flex; flex-direction: column; font: 600 14px var(--f-px); }
.cos small { color: var(--dim); font-size: 12px; letter-spacing: 1px; }
.lst { list-style: none; margin: 0; padding: 0; }
.lst li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px dashed rgba(90, 107, 133, .35); min-width: 0; }
.lst li:last-child { border-bottom: 0; }
.l-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.l-main b { font: 600 15px var(--f-px); overflow-wrap: anywhere; }
.l-main small { color: var(--dim); font-size: 13px; }

/* ───────── RARE ITEMS ───────── */
.rare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.rare { display: flex; flex-direction: column; gap: 8px; padding: 10px; min-width: 0; }
.rare.k-boss { border-image-source: url("/img/ui/panel-on.png"); }
.rare-head { display: flex; gap: 10px; align-items: center; }
.rare-t { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.rare-n { font: 600 16px/1.2 var(--f-px); overflow-wrap: anywhere; }
.ex-n { font: 600 14px var(--f-px); color: var(--good); }
.ex-n.zero { color: var(--teal-hi); }
.rare-b p { margin: 0 0 6px; }
.rare-drop { color: var(--gold); font: 600 14px var(--f-px); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rare-drop small { color: var(--dim); font: 500 13px var(--f-body); width: 100%; }
.rare-hold { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }
.rare-avg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rare-avg small { color: var(--dim); font-size: 12px; }
.rare-avg .t-sub, .rare-f .t-sub { display: inline-block; margin-right: 6px; }
.rare-f { margin: 0; } .rare-f .none { display: inline; margin: 0; }
.rare.zero .rare-n { color: #c8d0dc; }
.finds { margin: 2px 0 0; padding: 0 0 0 20px; font-size: 14px; }
.finds li { margin: 2px 0; } .finds li::marker { color: var(--dimmer); }
.finds span { color: #b9c3d2; } .finds small { color: var(--dim); }

/* ───────── MARKET ───────── */
.rules { display: block; margin: 0 0 14px; padding: 10px 14px; font-size: 14px; line-height: 1.4; }
.rules summary { cursor: pointer; font: 600 14px var(--f-px); letter-spacing: 1px; text-transform: uppercase; color: #5a3a12; list-style-position: inside; }
.rules p { margin: 6px 0 0; }
.mk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1000px) { .mk-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.mk-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mk-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background-color: #0d1118; }
.mk-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.mk-main b { font: 600 16px var(--f-px); overflow-wrap: anywhere; }
.mk-main small { color: var(--dim); font-size: 13px; }
.mk-price { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.mk-price small { color: var(--dim); font-size: 12px; }
.avg { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.avg small { color: var(--dim); font-size: 12px; }

/* ───────── ECONOMY ───────── */
.exist { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin-bottom: 10px; }
.ex-k { color: var(--amber); font: 400 12px var(--f-pixel); text-shadow: 2px 2px 0 #000; }
.ex-v { display: flex; align-items: center; font: 600 32px/1.2 var(--f-px); color: var(--amber); }
.io-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.io { padding: 10px 12px; background-color: #0d1118; min-width: 0; }
.io-move { margin-top: 10px; }
.io h4 b { color: #fff; }
.io .tl-d { margin: 0 0 8px; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 38%) auto; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; }
.b-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-bar { height: 12px; background: #07090d; box-shadow: inset 0 0 0 1px #252e3f; }
.b-bar i { display: block; height: 100%; background: var(--good); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 -2px 0 rgba(0, 0, 0, .3); }
.bars.out .b-bar i { background: var(--bad); } .bars.move .b-bar i { background: var(--teal-hi); }
.b-v { font: 600 14px var(--f-px); text-align: right; }
.net { margin: 10px 0; font: 600 15px var(--f-px); } .net small { color: var(--dim); font: 400 13px var(--f-body); }
.chart { position: relative; padding: 10px 10px 8px; margin-top: 10px; background-color: #0d1118; }
.chart canvas { display: block; width: 100%; height: 180px; }
.ch-t { display: block; margin-bottom: 6px; color: var(--dim); font: 600 13px var(--f-px); letter-spacing: 1px; text-transform: uppercase; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 6px; color: #b9c3d2; font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: -6px; box-shadow: 0 0 0 1px #000; }
.lg-in { background: #59e06b; } .lg-out { background: #ff5a55; } .lg-spent { background: #ffd94a; } .lg-burn { background: #ff6b3d; } .lg-pool { background: #3fa79a; } .lg-paid { background: #7cc7ff; }

/* ───────── DROPS ───────── */
.drops li { padding: 8px 4px; }
.d-line { font-size: 15px; } .d-what { color: #fff; }
.drop.k-boss .d-what { color: #ff8a85; } .drop.k-trophy .d-what { color: var(--gold); } .drop.k-card .d-what { color: #7cc7ff; } .drop.k-look .d-what { color: #ff9be0; } .drop.k-lost .d-what { color: #f3d27a; }
.drops.compact li { gap: 8px; padding: 6px 2px; }
.drops.compact .d-line { font-size: 14px; }
#ex-side .tl-d { margin: 8px 2px 0; }

/* ───────── ITEMS ───────── */
.tt-set { margin: 2px 0 4px; color: #7cc7ff; font: 600 13px var(--f-px); }
.ix-tools select { flex: 0 1 auto; }
.ix-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 1000px) { .ix-wrap { grid-template-columns: minmax(0, 1fr) 340px; } }
.ix-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.ix-grid > .none { grid-column: 1 / -1; }
.ix-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 6px 2px 4px; cursor: pointer; background: none; border: 0; color: inherit; text-align: center; }
.ix-cell:hover .ix-n, .ix-cell.on .ix-n { color: #fff; }
.ix-cell.on .slot { outline: 2px solid #ffd94a; outline-offset: 1px; }
.ix-cell:focus-visible { outline: 2px solid #ffd94a; }
.ix-n { width: 100%; min-height: 30px; font: 500 12px/1.25 var(--f-px); color: #c8d0dc; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.ix-lv { margin-top: -3px; font: 600 11px var(--f-px); color: var(--dim); letter-spacing: .5px; }
.ix-more { display: flex; justify-content: center; padding: 14px 0 4px; }
.ix-detail { position: sticky; top: 10px; padding: 12px; max-height: calc(100vh - 20px); overflow: auto; scrollbar-width: thin; min-width: 0; }
.ix-pick { margin: 6px 2px; color: var(--dim); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.ix-head { position: relative; display: flex; gap: 10px; align-items: center; margin-bottom: 8px; padding-right: 0; }
.ix-ht { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ix-name { font: 600 17px/1.2 var(--f-px); overflow-wrap: anywhere; }
.ix-kind { color: var(--dim); font: 600 12px var(--f-px); letter-spacing: 1px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ix-boss { color: #ff8a85; font: 600 13px var(--f-px); }
.ix-x { display: none; }
.ix-sec { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed #313c51; }
.ix-sec .t-sub { margin-bottom: 4px; color: var(--amber); }
.ix-st { width: 100%; border-collapse: collapse; font: 500 14px var(--f-px); }
.ix-st th { font: 600 11px var(--f-px); letter-spacing: .5px; text-align: right; padding: 2px 4px; }
.ix-st td { padding: 2px 4px; text-align: right; color: #fff; }
.ix-st td:first-child { text-align: left; color: var(--dim); }
.ix-st tr:nth-child(odd) td { background: rgba(255, 255, 255, .035); }
.ix-st .ix-cs td { color: #7cc7ff; }
.ix-b { margin: 4px 0; color: var(--good); }
.ix-t { margin: 8px 0 0; color: #b9c3d2; font-style: italic; }
.ix-note { margin: 2px 0 4px; color: var(--dim); font-size: 13px; }
.ix-set ul { list-style: none; margin: 0; padding: 0; }
.ix-set li { margin: 2px 0; font-size: 14px; } .ix-set li b { color: #7cc7ff; font: 600 13px var(--f-px); } .ix-set li span { color: var(--good); }
.ix-price { list-style: none; margin: 0; padding: 0; }
.ix-price li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 2px 0; }
.ix-price li > span { color: var(--dim); font-size: 14px; }
.ix-price li > b { font: 600 15px var(--f-px); }
.t-blue { color: #7cc7ff; }
.ix-where { list-style: none; margin: 0; padding: 0; }
.ix-where li { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0; color: #e8edf4; font-size: 14px; line-height: 1.35; }
.ix-where li .pi { margin-top: 3px; }
.ix-back { display: none; }
/* below 1000 px the detail is a sheet over the grid */
@media (max-width: 999px) {
  .ix-detail { display: none; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; max-height: 82vh; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); background-color: #141a24; box-shadow: 0 -6px 0 rgba(0, 0, 0, .45); }
  .ix-detail.open { display: block; }
  .ix-back:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .55); }
  .ix-x { display: inline-flex; position: absolute; right: 0; top: 0; min-height: 32px; padding: 3px 10px; font-size: 12px; }
  .ix-head { padding-right: 84px; }
  body.ix-sheet { overflow: hidden; }
}

/* ───────── phone and tablet ───────── */
@media (max-width: 760px) {
  #ex-top { gap: 6px 10px; padding: 8px 12px; }
  #ex-top::before { content: ''; order: 3; flex-basis: 100%; height: 0; }
  .ex-brand { order: 1; }
  .ex-logo { font-size: 26px; }
  .ex-plate { order: 4; padding: 7px 10px 6px; font-size: 10px; }
  .ex-realm { order: 5; font-size: 12px; letter-spacing: 1.5px; }
  .ex-play { order: 2; min-height: 36px; padding: 4px 12px; }
  #ex-tabs { padding: 0 8px 8px; gap: 5px; }
  .tools select { flex: 1 1 0; min-width: 0; font-size: 14px; padding: 6px 6px; }
  .mk-open .tools .inp { flex-basis: 100%; }
  .tab { min-height: 42px; font-size: 14px; letter-spacing: .6px; gap: 5px; padding: 4px; }
  .tab .pi { width: 16px; height: 16px; }
  #ex-main { padding: 0 6px 12px; }
  #ex-fresh { padding: 10px 12px 8px; gap: 2px 10px; font-size: 12px; }
  .win { border-width: calc(8 * var(--ap)); box-shadow: none; }
  .win-body { padding: 8px 6px; }
  .win-title { font-size: 16px; padding: 6px 12px 5px; }
  .podium { gap: 6px; margin-top: 22px; }
  .pod { padding: 14px 4px 10px; }
  .pod-1 { padding-top: 20px; }
  .pod-pic .ci { width: 40px; height: 40px; } .pod-1 .pod-pic .ci { width: 52px; height: 52px; }
  .pod-n, .pod-1 .pod-n { font-size: 14px; }
  .pod-s { font-size: 12px; }
  .pod .money, .pod .rv, .pod-1 .pod-v .money, .pod-1 .pod-v .rv { font-size: 14px; }
  .pod-rank { left: 5px; top: 5px; font-size: 11px; } .pod-1 .pod-rank { font-size: 13px; }
  .pod .crown { width: 30px; height: 19px; top: -16px; }
  .rk-row { grid-template-columns: 30px 28px minmax(0, 1fr) auto; gap: 6px; padding: 6px 4px; }
  .ch-doll { grid-template-columns: 62px minmax(0, 1fr) 62px; gap: 4px; padding: 8px 4px; }
  .s-l { width: 54px; height: 54px; }
  .ch-sn { font-size: 12px; min-height: 29px; }
  .ch-model { height: 220px; }
  .ch-name { font-size: 17px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tile { padding: 8px 9px; }
  .tl-v { font-size: 20px; }
  .rare-grid { grid-template-columns: minmax(0, 1fr); }
  .io-grid { grid-template-columns: minmax(0, 1fr); }
  .mk-row { padding: 6px 7px; gap: 8px; }
  .s-m { width: 50px; height: 50px; }
  h3 { font-size: 11px; }
  .ix-chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -6px; margin-right: -6px; padding: 0 6px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ix-chips::-webkit-scrollbar { display: none; }
  .ix-chips .chip { flex: none; }
  .ix-tools .inp { flex-basis: 100%; }
  .ix-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; }
  .ix-cell .slot.s-m { width: 56px; height: 56px; }
  .tab { font-size: 13px; letter-spacing: .3px; }
}
@media (max-width: 380px) {
  .ex-logo { font-size: 23px; }
  .tab span { font-size: 13px; }
}

/* ───────── PURCHASES (owner 2026-11-25): bought looks, who and when ───────── */
.buys li { padding: 8px 4px; }
.buys time, .own-row time { color: #b9c3d2; }
.pno { display: inline-block; margin-left: 4px; padding: 0 5px; font: 600 12px var(--f-px); letter-spacing: .5px; color: #0b0e14; background: var(--gold); box-shadow: 0 0 0 2px #07090d; white-space: nowrap; vertical-align: 1px; }
.b-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.tag.k-ltd { background: #ff6bd0; } .tag.k-shop { background: #7cc7ff; } .tag.k-excl { background: #c9a2ff; } /* CONTRACT 59 */
.tag.k-own { background: var(--good); } .tag.k-first { background: #c9b07a; } .tag.k-seal { background: #9aa4b0; }
.drop.k-buy .d-what { color: #ff9be0; }
.b-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0 2px; color: var(--dim); font: 600 13px var(--f-px); }
.b-nav .btn[disabled] { opacity: .45; cursor: default; }
.own-list { list-style: none; margin: 0; padding: 0; }
.own-row { padding: 7px 0; border-bottom: 1px dashed rgba(90, 107, 133, .35); }
.own-row:last-child { border-bottom: 0; }
.own-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 600 14px var(--f-px); }
.own-top .pno { margin-left: 0; }
.own-p { margin-left: auto; }
.own-t { display: block; margin-top: 2px; font-size: 12px; }
.own-h { list-style: none; margin: 4px 0 0 8px; padding: 0 0 0 8px; border-left: 2px solid #313c51; }
.own-h li { display: flex; gap: 6px; align-items: flex-start; margin: 3px 0; font-size: 13px; line-height: 1.35; }
.own-h li .pi { margin-top: 3px; flex: none; }
.own-h small { display: block; font-size: 12px; }
.own-hh { display: block; margin-top: 10px; }
.own-ev { margin-left: 0; }
@media (max-width: 760px) { .b-side .tag { display: none; } .buys .l-main small { font-size: 12px; } }
/* v0.32: a relic the public tables do not know (the server's labels): the best relic of its slot in a gold frame with its number; a neutral picture for an id nobody explains */
.slot.g-lost { box-shadow: 0 0 0 2px #ffd94a, 0 0 10px 2px rgba(255, 200, 60, .55); background: radial-gradient(circle at 50% 45%, #4a3610 0%, #1a1306 70%); }
.slot .lno { position: absolute; right: 3px; bottom: 1px; font: 600 11px var(--f-px); font-style: normal; color: #ffe9a8; background: rgba(40, 26, 4, .85); padding: 0 2px; text-shadow: 1px 1px 0 #000; }
.slot.unknown { color: #5c6779; }
.tt.g-lost { --gc: #ffe27a; } .tt-no { color: #ffdf8a; font: 600 12px var(--f-px); letter-spacing: 1px; margin: 1px 0 2px; }
.tt-own { margin: 2px 0 6px; } .tt-own .tt-b { color: #b8f0ff; }
.tag.k-relic { background: #e9c46a; color: #2a1c05; } .rare.k-relic .rare-n { color: var(--gold); }
