/* The Adventurer's Ledger (js/ui/ledger.js): gear window, pack, journal, spells, town. */
#panel > .board { width: min(820px, 96vw); height: min(660px, 88vh); }
#panel-body { flex: 1; }
#panel-body h5 { margin: 10px 0 4px; font-size: 15px; font-weight: normal; color: #8a3a12; border-bottom: 2px solid #e2c693; letter-spacing: .03em; }
#panel-body h5:first-child { margin-top: 0; }
.key { position: absolute; left: 3px; top: 1px; font: 11px Pixel, monospace; color: #fff3d6; background: #6b2a0c; padding: 0 3px; font-weight: normal; }

/* hover tips */
#ltip { position: fixed; z-index: 60; max-width: 300px; pointer-events: none; background: #24160ff2; color: var(--parch); border: 2px solid #c9962c; padding: 7px 10px; font-size: 13px; line-height: 1.4; text-shadow: 1px 1px 0 #000; }
#ltip b { display: block; color: var(--gold); font-weight: normal; font-size: 15px; }
#ltip small { display: block; color: #d9b98c; margin-bottom: 3px; }
#ltip p { margin: 4px 0 0; color: #f0dcbc; }
#ltip em { display: block; margin-top: 4px; color: #b8ffc8; font-style: normal; }
#ltip .ok { color: #b8ffc8; } #ltip .then { color: #d9b98c; }

/* ----- Gear ----- (Sam's pick, 28 Nov, "Mock B": the gear | what you carry, or a slot's options | the stats, condensed) */
.lg-gear { display: grid; grid-template-columns: 262px minmax(0, 1fr) 190px; gap: 10px; align-items: start; }
.lg-left { position: relative; }
.doll { display: grid; grid-template-columns: 54px 136px 54px; grid-template-rows: repeat(4, 54px); gap: 6px 8px; justify-content: center; margin-top: 8px;
  grid-template-areas: "necklace hero belt" "armor hero belt" ". hero ring" ". boots ."; }
/* the slots either side sit a little lower, level with the hero rather than above his head (Sam, 28 Nov) */
.doll > .dslot:not([data-pick="boots"]), .doll > .belt { position: relative; top: var(--side-drop, 26px); }
/* the belt: the trinket and the food for Q, a space of their own */
.belt { grid-area: belt; position: relative; display: grid; grid-template-rows: 54px 54px; gap: 6px; }
.belt::before { content: ''; position: absolute; inset: -5px; border: 2px dashed #c9a46e; pointer-events: none; }
.belt small { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); z-index: 1; background: #fbecc9; padding: 0 3px; font-size: 11px; line-height: 14px; color: #8a5a34; }
/* the weapons and the shield, in a row under the hero */
.hands { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.hands .dslot { justify-self: auto; }
.dslot { position: relative; width: 54px; height: 54px; justify-self: center; display: grid; place-items: center; padding: 0; cursor: pointer; font: inherit; color: #8a5a34;
  background: url(../assets/ui/cell.png) 0 0 / 100% 100%; border: none; image-rendering: pixelated; }
.dslot img { width: 32px; height: 36px; object-fit: contain; image-rendering: pixelated; }   /* a 16 px icon drawn at 32 stays sharp */
.dslot i { font-style: normal; font-size: 10px; opacity: .75; }
.dslot.empty { opacity: .7; }
.dslot:hover, .dslot.on { outline: 2px solid var(--ember); outline-offset: 0; }
.dslot em { position: absolute; right: 4px; bottom: 2px; font-style: normal; font-size: 11px; color: #6b2a0c; }
.hero-model { position: relative; pointer-events: none; }
.hm-body { position: absolute; left: -12px; top: -12px; width: 160px; height: 240px; background-size: 1280px auto; background-repeat: no-repeat;
  image-rendering: pixelated; animation: hm-idle .72s steps(4) infinite; }
@keyframes hm-idle { from { background-position: 0 0; } to { background-position: -640px 0; } }
.hm-shadow { position: absolute; left: 44px; top: 156px; width: 48px; height: 12px; border-radius: 50%; background: #3b241833; }
.hm-weapon { position: absolute; left: 38px; top: 128px; height: 84px; transform: translate(-50%, -88%) rotate(-14deg); transform-origin: 50% 88%; image-rendering: pixelated; }
.hm-shield { position: absolute; left: 98px; top: 106px; width: 40px; image-rendering: pixelated; }
.vitals { display: flex; justify-content: center; gap: 12px; margin: 8px 0 6px; font-size: 14px; color: #4a1c08; }
.vitals span { display: flex; align-items: center; gap: 4px; } .vitals .ht { width: 16px; height: 16px; background: url(../assets/ui/heart.png) -64px 0 / 80px 16px; image-rendering: pixelated; }
.vitals .mana { color: #2b5c9a; } .vitals .gold { color: #8a5a10; }
.shieldbox small { display: block; text-align: center; color: #8a5a34; font-size: 12px; margin-bottom: 3px; }
.sockets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.socket { min-height: 40px; display: grid; place-items: center; text-align: center; background: #e9d3a6; border: 2px dashed #c9a46e; font-size: 10px; line-height: 1.1; padding: 2px; }
.socket i { font-style: normal; color: #b8936a; font-size: 14px; }
.socket.won { background: #fff3d6; border: 2px solid #c9962c; } .socket.won b { font-weight: normal; color: #6b2a0c; } .socket.won small { color: #2f6b3a; }
.lg-mid { min-width: 0; }
.picker { background: #fff8e8; border: 3px solid #8a5a34; box-shadow: 0 4px 0 #0002; padding: 4px 6px 6px; }
.picker.carried { border-color: #c9a46c; box-shadow: none; }
.phead { display: flex; align-items: center; gap: 6px; border-bottom: 2px solid #e2c693; padding: 0 0 3px; margin-bottom: 1px; }
.phead b { font-weight: normal; color: #8a3a12; font-size: 15px; } .phead i { flex: 1; font-style: normal; color: #8a7a66; font-size: 11px; }
.pclose { font: inherit; font-size: 13px; line-height: 1; color: #4a1c08; background: #f6c27a; border: 2px solid #8a5a34; padding: 1px 6px 2px; cursor: pointer; }
.pclose:hover { background: #ffd89a; }
.poff { font: inherit; font-size: 11px; color: #6b4a30; background: none; border: 0; text-decoration: underline; padding: 0 2px; cursor: pointer; }
.poff:hover { color: #b8501c; }
.prow { display: flex; align-items: center; gap: 6px; padding: 2px 3px; border-bottom: 1px dashed #e2c693; }
.prow img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; flex: none; }
.prow div { flex: 1; min-width: 0; } .prow b { display: block; font-weight: normal; color: #4a1c08; font-size: 13px; line-height: 1.15; }
.prow small { display: block; color: #6b4a30; font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow > span { font-size: 11px; color: #2f6b3a; padding: 0 4px; } .prow.on { background: #fff3d6; }
.prow[data-prev]:hover { background: #fbe6b6; outline: 2px solid #d88a3a; outline-offset: -2px; }
.prow .btn.small { font-size: 12px; min-height: 30px; border-width: 7px; border-image-width: 7px; padding: 0 3px; flex: none; }
.crow { cursor: pointer; } .crow:hover { background: #fbe6b6; } .crow.none b { color: #8a7a66; }
.cdot { width: 32px; height: 32px; flex: none; border: 2px dashed #d8c49a; box-sizing: border-box; }
.pnote { margin: 4px 0 0; font-size: 10px; color: #8a7a66; }
.prow[data-eq] { cursor: pointer; }
.prows.dense { display: grid; grid-template-columns: 1fr 1fr; column-gap: 6px; }
.prows.dense .prow small, .prows.dense .prow .btn, .prows.dense .prow > span { display: none; }
.prows.dense .prow.on { outline: 2px solid #2f7a3a; outline-offset: -2px; } .prows.dense .prow b { font-size: 12px; } .prows.dense .prow img { width: 16px; height: 16px; } .prows.dense .prow { min-height: 26px; }
.lg-stats { font-size: 12px; background: #fff8e8; border: 3px solid #c9a46c; padding: 2px 6px 4px; }
#panel-body .lg-stats h5 { font-size: 12px; margin: 5px 0 1px; border-bottom-width: 1px; }
.srow { display: flex; justify-content: space-between; gap: 6px; padding: 1px 2px; border-bottom: 1px dotted #e2c693; cursor: default; line-height: 1.25; }
.srow:hover { background: #fff3d6; } .srow span { color: #6b4a30; } .srow b { font-weight: normal; color: #4a1c08; text-align: right; }
.srow.buff b { color: #2f6b3a; }
/* hovering an option: what it would change (green better, red worse, amber just different), the old value struck through */
.lg-stats.previewing { border-color: #d88a3a; }
.srow.delta { background: #fff0c8; } .srow.delta.up b { color: #2f7a3a; } .srow.delta.down b { color: #b4402a; } .srow.delta.chg b { color: #9a5a10; }
.srow.delta.up span, .srow.delta.down span { color: #4a1c08; }
.srow .was { font-style: normal; color: #a08a70; text-decoration: line-through; margin-right: 4px; }

/* ----- Pack ----- */
.ptabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.ptab { font: inherit; font-size: 13px; background: #d9bd8c; color: var(--ink); border: 2px solid #8a5a34; padding: 4px 8px; cursor: pointer; min-height: 32px; }
.ptab em { font-style: normal; margin-left: 5px; color: #8a3a12; font-size: 11px; }
.ptab.on { background: #fff3d6; border-color: #6b2a0c; } .ptab.none { opacity: .45; cursor: default; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, 48px); gap: 5px; }
.pcell { position: relative; width: 48px; height: 48px; padding: 0; display: grid; place-items: center; cursor: pointer; background: url(../assets/ui/cell.png) 0 0 / 100% 100%; border: none; image-rendering: pixelated; }
.pcell img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.pcell em { position: absolute; right: 3px; bottom: 1px; font: 11px Pixel, monospace; font-style: normal; color: #4a1c08; text-shadow: 1px 1px 0 #fff3d6; }
.pcell:hover, .pcell.on { outline: 2px solid var(--ember); }
.pdetail { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 8px; background: #fff3d6; border-top: 3px solid #c9a46e; min-height: 64px; }
.pdetail.hint { color: #8a5a34; font-size: 14px; align-items: center; }
.pdetail .pic { flex: none; width: 52px; height: 52px; display: grid; place-items: center; background: url(../assets/ui/cell.png) 0 0 / 100% 100%; image-rendering: pixelated; }
.pdetail .pic img { image-rendering: pixelated; }
.ptext { flex: 1; min-width: 0; } .ptext b { font-weight: normal; font-size: 17px; color: #4a1c08; } .ptext b span { color: #8a3a12; font-size: 14px; }
.ptext small { display: block; color: #6b4a30; font-size: 13px; } .ptext p { margin: 3px 0 0; font-size: 14px; color: #4a2e1c; }
.ptext .want { color: #2f6b3a; }
.pbtns { display: flex; flex-direction: column; gap: 4px; flex: none; }

/* ----- Journal ----- */
.jregions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.jreg { font: inherit; text-align: left; flex: 1 1 180px; background: #f3dfb4; border: 2px solid #c9a46e; padding: 6px 10px; cursor: pointer; color: var(--ink); position: relative; }
.jreg b { display: block; font-weight: normal; font-size: 17px; color: #4a1c08; } .jreg small { color: #6b4a30; font-size: 13px; }
.jreg i { position: absolute; right: 8px; top: 6px; font-style: normal; font-size: 11px; color: #2f6b3a; }
.jreg.on { background: #fff3d6; border-color: #6b2a0c; box-shadow: inset 0 -3px 0 var(--ember); }
.jtabs { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.jq { position: relative; padding: 5px 64px 5px 6px; border-bottom: 2px dashed #e2c693; font-size: 14px; cursor: default; }
.jq:hover { background: #fff3d6; }
.jq-main b { font-weight: normal; color: #4a1c08; font-size: 16px; } .jq-main small { color: #8a5a34; }
.jq-st { color: #4a2e1c; font-size: 13px; } .jq.ready .jq-st { color: #2f6b3a; }
.jq.pinned { box-shadow: inset 3px 0 0 var(--ember); }
.pin { position: absolute; right: 4px; top: 6px; font: 12px Pixel, monospace; background: #f3dfb4; border: 2px solid #c9a46e; color: #6b4a30; padding: 2px 6px; cursor: pointer; }
.pin.on { background: var(--ember); border-color: #6b2a0c; color: #fff; }
.jdone { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 10px; }
.jq.done { padding-right: 6px; } .jq.done b { display: block; font-weight: normal; color: #4a1c08; font-size: 15px; } .jq.done small { color: #8a5a34; font-size: 12px; }

/* ----- Spells ----- */
.spkeys { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.spkey { position: relative; display: flex; align-items: center; gap: 8px; background: #fff3d6; border: 2px solid #c9962c; padding: 6px 8px 6px 22px; }
.spkey.empty { border-style: dashed; border-color: #c9a46e; opacity: .75; }
.spkey img { width: 28px; height: 28px; image-rendering: pixelated; } .spkey b { display: block; font-weight: normal; color: #4a1c08; }
.spkey .key { top: 6px; display: inline; color: #fff3d6; } .spkey small { color: #6b4a30; font-size: 13px; }

/* ----- Town ----- */
.thead { background: #fff3d6; padding: 8px 10px; margin-bottom: 4px; }
.tname { display: flex; justify-content: space-between; align-items: baseline; } .tname b { font-weight: normal; font-size: 20px; color: #4a1c08; } .tname span { color: #8a3a12; font-size: 18px; }
.tcounts { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }
.tcounts span { background: #f3dfb4; border: 2px solid #c9a46e; padding: 2px 8px; font-size: 13px; color: #6b4a30; } .tcounts b { font-weight: normal; color: #4a1c08; }
.thead > small { color: #6b4a30; font-size: 13px; }
.tnext { display: grid; gap: 4px; }
.tn { display: grid; grid-template-columns: 72px 1fr; column-gap: 8px; align-items: baseline; padding: 4px 6px; background: #fff3d680; border-left: 4px solid #c9a46e; font-size: 14px; }
.tn .tag { grid-row: span 2; font-size: 11px; text-transform: uppercase; color: #8a5a34; }
.tn b { font-weight: normal; color: #4a1c08; } .tn small { color: #8a5a34; margin-left: 6px; } .tn p { margin: 0; grid-column: 2; color: #4a2e1c; font-size: 13px; }
.tn.ready { border-color: #3d8a55; } .tn.ready .tag { color: #2f6b3a; } .tn.active { border-color: var(--ember); } .tn.active .tag { color: #b8501c; }
.tn.later { opacity: .7; border-style: dashed; } .tn.open { border-color: #c9962c; } .tn.open .tag { color: #8a5a10; } .tn.locked { opacity: .7; }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.tcard { background: #fff3d680; border: 2px solid #c9a46e; padding: 6px 8px; font-size: 13px; }
.tc-head { display: flex; justify-content: space-between; gap: 6px; } .tc-head .pips { flex: none; white-space: nowrap; } .tc-head b { font-weight: normal; color: #4a1c08; font-size: 15px; }
.tcard small { color: #8a5a34; } .tcard p { margin: 3px 0 0; color: #4a2e1c; line-height: 1.35; }
.tcard .next { color: #b8501c; } .tcard .next.done { color: #2f6b3a; } .tcard .next.ready { color: #2f6b3a; } .tcard .next.locked, .tcard .next.later { color: #8a6a50; }
.tsettlers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.ts { background: #fff3d680; border: 2px solid #c9a46e; padding: 5px 7px; font-size: 13px; } .ts b { font-weight: normal; color: #4a1c08; display: block; }
.ts small { color: #8a5a34; } .ts p { margin: 2px 0 0; color: #4a2e1c; } .ts.none { opacity: .65; border-style: dashed; }
.tpass { display: grid; gap: 4px; } .tpass div { background: #fff3d680; padding: 4px 8px; } .tpass b { font-weight: normal; color: #4a1c08; } .tpass small { display: block; color: #6b4a30; font-size: 13px; }

/* a short window: one line a row, so a slot's options still fit without scrolling */
@media (max-height: 600px) {
  .prow small { display: none; } .prow img { width: 16px; height: 16px; } .prow .btn.small { min-height: 22px; border-width: 6px; border-image-width: 6px; font-size: 11px; }
  #panel-body .lg-stats h5 { margin-top: 2px; } .lg-stats { font-size: 11px; } .srow { line-height: 1.05; }
}
@media (max-width: 760px) {
  .lg-gear { grid-template-columns: 1fr; }
  .lg-stats { order: 2; }
  .spkeys { grid-template-columns: 1fr; }
}
