/* ฐานข้อมูลเกม pages: the 11-tab bar + shops / craft / npcs / mall / skills / boxes (js/dbx.js) + map spawn plots (js/maps.js) */
/* tab bar: centred while it fits, scrolls from the first tab when it does not (justify-content:center would cut off the left tabs) */
.dbtabs .wrap { justify-content: flex-start; }
.dbtabs .wrap > a:first-child { margin-left: auto; }
.dbtabs .wrap > a:last-child { margin-right: auto; }

.dbx .note { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.dbx .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.dbx .card { background: linear-gradient(rgba(44, 24, 16, .92), rgba(26, 14, 8, .92)); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.dbx .card h3 { font: 19px var(--font-head); color: var(--gold-2); margin: 0 0 4px; }
.dbx .meta { color: var(--muted); font-size: 13.5px; margin: 0 0 6px; }
.dbx .where { color: var(--paper-2); font-size: 14px; margin: 0 0 8px; }
.dbx .muted { color: var(--muted); }
.dbx .desc { color: var(--paper-2); font-size: 13.5px; white-space: pre-line; margin: 2px 0; }
.dbx .desc.in { color: var(--gold); }
.dbx ul.list { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.dbx ul.list > li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.dbx ul.list > li.blk { display: block; }
.dbx ul.list .ln { display: flex; justify-content: space-between; gap: 10px; }
.dbx ul.list .price { color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dbx .sub { margin: 3px 0 4px 14px; font-size: 13.5px; }
.dbx .pill { display: inline-block; padding: 1px 8px; margin: 1px 2px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); background: rgba(227, 179, 88, .1); color: var(--paper-2); }
.dbx .pill.red { background: rgba(184, 40, 26, .35); border-color: rgba(220, 80, 60, .6); color: #fff; }
.dbx .tblp { padding: 0; overflow: auto; }
.dbx .tbl td.nm, .dbx .tbl .nm { color: var(--gold-2); font-weight: 600; }
.dbx tr.row { cursor: pointer; }
.dbx tr.open td { background: rgba(227, 179, 88, .1); }
.dbx tr.detail td { background: rgba(0, 0, 0, .3); }
.dbx .talk { color: var(--text); }
.dbx ul.opts { list-style: none; padding: 0; margin: 6px 0 0; }
.dbx h2.sec { font: 22px var(--font-head); color: var(--gold-2); margin: 26px 0 10px; }
.dbx h2.sec .muted { font: 14px var(--font-body); }
.dbx .seg { margin-bottom: 14px; }
.dbx .toolbar label.chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* maps.html: spawn plot + coordinates (modal) */
.mapcard .plotbtn { justify-self: start; }
.plot { display: block; width: 100%; max-height: 320px; background: #1a0e08; border: 1px solid var(--line); border-radius: 6px; }
.plot circle { stroke: #000; }
.plotkey { font-size: 13px; color: var(--paper-muted); margin: 6px 0 12px; }
.plotkey i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 10px; vertical-align: -1px; }
.ptlist { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.ptlist li { padding: 4px 0; border-bottom: 1px dashed rgba(122, 80, 40, .35); }
.ptlist .xy { color: var(--paper-muted); font-size: 13px; }

/* tables sit on the cream .panel (site.css): dark text there (v1 used the dark-card colours and was unreadable, 2026-10-19) */
.dbx .tblp .tbl td { color: var(--paper-ink); }
.dbx .tblp .tbl td.nm, .dbx .tblp .tbl .nm { color: #7a160d; font-weight: 700; }
.dbx .tblp .muted, .dbx .tblp .where { color: #6a4a2c; }
.dbx .tblp .desc, .dbx .tblp .talk { color: var(--paper-ink); }
.dbx .tblp .desc.in { color: #8f1a12; }
.dbx .tblp b { color: #5a160c; }
.dbx .tblp .pill { background: rgba(122, 22, 13, .08); border-color: rgba(122, 80, 40, .5); color: var(--paper-ink); }
.dbx .tblp .pill.red { background: #a3261a; border-color: #7a160d; color: #fff; }
.dbx .tblp tr.open td { background: rgba(184, 40, 26, .12); }
.dbx .tblp tr.detail td { background: rgba(122, 80, 40, .12); }
.dbx .tblp .tbl tr:hover td { background: rgba(184, 40, 26, .07); }

/* icons (2026-10-19 v3): item icons next to every item, NPC pictures, coin before prices, a colour per job */
.icon.sm { width: 30px; height: 30px; background-size: 26px 26px; border-radius: 3px; }
.dbx .itn { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; min-width: 0; }
.dbx .itn.link { cursor: pointer; }
.dbx .itn.link:hover > span:last-child { text-decoration: underline; }
.dbx ul.list > li { align-items: center; padding: 5px 0; }
.dbx ul.list .ln { align-items: center; }
.dbx ul.list .qty { color: var(--gold); white-space: nowrap; }
.dbx .price { display: inline-flex; align-items: center; gap: 5px; }
.dbx .price::before { content: ''; width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b8, #e3b358 45%, #8a5a14); box-shadow: 0 0 0 1px #6a4210; }
.dbx .price.none::before { display: none; }
.dbx .card h3.hd { display: flex; align-items: center; gap: 10px; }
.dbx .card h3.hd .itn > span:last-child { font: 19px var(--font-head); color: var(--gold-2); }
.dbx .tblp .mats { line-height: 2; }
.dbx .tblp .mat { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.dbx .tblp .plus { color: #8a6a44; margin: 0 8px; }
.dbx .npcn { display: flex; align-items: center; gap: 10px; }
.dbx .npcth { width: 44px; height: 54px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.dbx .npcth.none { display: inline-flex; align-items: center; justify-content: center; font-size: 24px; opacity: .45; }
.dbx .npcbig { float: right; max-width: 170px; max-height: 210px; margin: 0 0 10px 18px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.dbx tr.detail td::after { content: ''; display: block; clear: both; }
.dbx .pill.j0, .dbx .tblp .pill.j0 { background: #a3261a; border-color: #7a160d; color: #fff; }
.dbx .pill.j1, .dbx .tblp .pill.j1 { background: #1f5296; border-color: #143a6c; color: #fff; }
.dbx .pill.j2, .dbx .tblp .pill.j2 { background: #2e7034; border-color: #1f4f24; color: #fff; }
.dbx .pill.j3, .dbx .tblp .pill.j3 { background: #6a3594; border-color: #4a2268; color: #fff; }
.dbx .pill.j4, .dbx .tblp .pill.j4 { background: #3d3d3d; border-color: #1f1f1f; color: #fff; }
.dbx .pill.j5, .dbx .tblp .pill.j5 { background: #a5651a; border-color: #744410; color: #fff; }
/* maps.html modal: monster thumbnails */
.ptlist li { display: flex; gap: 10px; align-items: flex-start; }
.ptlist .mth { width: 46px; height: 46px; object-fit: contain; flex-shrink: 0; }
.ptlist .mth.none { display: inline-block; }
.dbx img.skico { object-fit: contain; padding: 1px; }

/* maps.html v2 (2026-10-19): cards with the game's mini-map + the map view (js/maps.js) */
.mapcard .smapthumb { display: block; width: 100%; padding: 0; border: 1px solid #6a4a1c; border-radius: 6px; overflow: hidden; background: #000; cursor: pointer; }
.mapcard .smapthumb img { display: block; width: 100%; height: 56px; object-fit: fill; image-rendering: auto; }
.mapcard .smapthumb:hover { border-color: var(--gold); }
.mapcard .lv.town { background: linear-gradient(#2e5e8a, #173a5c); }
.mapcard .mapfacts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--paper-2); }
.modal .box:has(.mapview) { width: min(1120px, 100%); }
.mapview .mvh { margin: 0 24px 2px 0; font-size: 24px; }
.mapview .mvfacts { font-size: 13px; color: var(--paper-muted); margin-bottom: 8px; }
.mapview .mvlayers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.mapview .mvlayers .chip { cursor: pointer; background: #e9d6ab; color: #6a4a2c; border-color: #b88a3a; }
.mapview .mvlayers .chip.on { background: #7a160d; color: #fff; border-color: #5a0f08; }
.mvframe { position: relative; height: 270px; border-radius: 8px; border: 2px solid #6a4a1c; background: #1a0e08 center / 100% 100% no-repeat; box-shadow: inset 0 0 0 1px #000; overflow: hidden; }
.mvframe.noimg { background-image: linear-gradient(90deg, rgba(227, 179, 88, .08) 1px, transparent 1px), linear-gradient(rgba(227, 179, 88, .08) 1px, transparent 1px); background-size: 40px 40px; }
.mvframe .ax { position: absolute; bottom: 3px; font-size: 11px; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.mvframe .ax.l { left: 6px; } .mvframe .ax.r { right: 6px; }
.mk { position: absolute; transform: translate(-50%, -50%); font-style: normal; z-index: 1; }
.mk.mon { width: 9px; height: 9px; border-radius: 50%; background: var(--c); border: 1px solid #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.mk.boss { width: 15px; height: 15px; background: #ff4a30; border: 2px solid #fff3c0; box-shadow: 0 0 6px #ff4a30; z-index: 3; }
.mk.army { width: 11px; height: 11px; background: #6fc3ff; border: 1px solid #000; transform: translate(-50%, -50%) rotate(45deg); }
.mk.npc { min-width: 17px; height: 17px; border-radius: 9px; background: #1f5296; color: #fff; border: 1px solid #fff; font-size: 10px; line-height: 15px; text-align: center; font-weight: bold; z-index: 4; padding: 0 3px; }
.mk.shop { width: 17px; height: 17px; border-radius: 4px; background: #e3b358; color: #3a2414; border: 1px solid #fff; font-size: 11px; line-height: 15px; text-align: center; font-weight: bold; z-index: 4; }
.mk.warp { z-index: 5; } .mk.warp b { display: block; white-space: nowrap; padding: 2px 7px; border-radius: 10px; background: #2e7034; color: #fff; border: 1px solid #c8ffb0; font-size: 11px; transform: translateY(0); }
.mk.hl { z-index: 9; outline: 3px solid #fff; outline-offset: 2px; animation: mkpulse 1s infinite alternate; }
@keyframes mkpulse { from { box-shadow: 0 0 0 0 rgba(255, 255, 255, .9); } to { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); } }
.mapview.focus .mk:not(.hl) { opacity: .25; }
.mapview.hide-mon .mk[data-g="mon"], .mapview.hide-boss .mk[data-g="boss"], .mapview.hide-npc .mk[data-g="npc"], .mapview.hide-shop .mk[data-g="shop"], .mapview.hide-warp .mk[data-g="warp"] { display: none; }
.mvhelp { font-size: 12px; color: var(--paper-muted); margin: 6px 0 10px; }
.mvlists { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.mvlists h4 { margin: 0 0 6px; font-size: 15px; color: #7a160d; }
.mvlists ul { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; }
.mvlists li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.mvlists li:hover { background: rgba(122, 22, 13, .08); } .mvlists li.sel { background: rgba(122, 22, 13, .18); }
.mvlists li small { color: var(--paper-muted); font-size: 12px; }
.mvlists .sw { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 1px solid #000; }
.mvlists .th { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.mvlists .th img { max-width: 38px; max-height: 38px; object-fit: contain; }
.mvlists .num { min-width: 20px; height: 20px; border-radius: 10px; background: #1f5296; color: #fff; font-size: 11px; font-weight: bold; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mvlists .num.shop { background: #e3b358; color: #3a2414; border-radius: 4px; } .mvlists .num.warp { background: #2e7034; }
.mvlists li.go .tx b { color: #2e7034; }
.mapcard .mapfacts { color: #6a4a2c; }
.mapcard .copies { font-size: 12px; color: #6a4a2c; }
.mk.warp.edge-l { transform: translate(0, -50%); } .mk.warp.edge-r { transform: translate(-100%, -50%); }
.mk.warp.edge-b { transform: translate(-50%, -100%); } .mk.warp.edge-t { transform: translate(-50%, 0); }
.mk.warp.edge-l.edge-b { transform: translate(0, -100%); } .mk.warp.edge-r.edge-b { transform: translate(-100%, -100%); }
.mk.warp.edge-l.edge-t { transform: translate(0, 0); } .mk.warp.edge-r.edge-t { transform: translate(-100%, 0); }
.mvframe .mvbg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 0; pointer-events: none; }
