/* The vault page on the pixelkit HUD: the vault fills the fold, the dark chunky panel sits on it, the sections below use
   the same vocabulary. hud.css (the kit) loads first; this file sets the accent to coin gold and adds
   the page layout. Fonts: Tiny5 headings, Inter body, IBM Plex Mono numbers. */
:root {
  --accent: #e8b21e; --accent-dim: #7a5e10; --num: #e8b21e; --gold: #e8b21e;
}
html, body { height: auto; overflow: auto; overflow-x: hidden; }
* { box-sizing: border-box; }
a { color: var(--accent); }
.hide { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---- the screen: the world with the HUD on it ---- */
.screen { position: relative; height: 100svh; min-height: 620px; background: var(--bg); }
.world { position: absolute; inset: 0; overflow: hidden; }
#game { position: absolute; inset: 0; display: block; image-rendering: pixelated; touch-action: none; }
#ui { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#ui > * { pointer-events: auto; }
.tk-strip { position: absolute; }
.tl { top: 40px; left: 12px; right: 410px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.brand { text-decoration: none; }
.brand img { width: 30px; height: 30px; image-rendering: auto; border-radius: 6px; box-shadow: 0 2px #0006; }
.logo { font-size: 34px; text-shadow: 0 3px #4a3a10; }
.chip.nav { font: 600 14px var(--pix); letter-spacing: .3px; color: #cfc8b4; }
.chip.nav:hover, .chip.nav.on { color: var(--accent); border-color: var(--accent-dim); }
.chip.xlink.dim { opacity: .45; pointer-events: none; }
.chip.cachip { font-family: var(--mono); font-size: 12.5px; }
.chip.cachip b { font: 700 13px var(--pix); color: var(--accent); letter-spacing: 1px; }
.chip.cachip.empty { color: var(--muted); cursor: default; }
.chip.cachip.empty b { color: var(--muted2); }
.chip.cachip.live:hover { border-color: var(--accent); }
.tr { top: 40px; right: 12px; }
.tr .chip.th b { color: var(--accent); }
.leftcol { top: auto; bottom: 20px; transform: none; }
.leftcol .zoom { margin-top: 8px; display: flex; gap: 6px; }
.leftcol .zoom button { width: 32px; height: 32px; font: 700 15px var(--pix); color: #cfc8b4; }
.hint { position: absolute; left: 76px; bottom: 24px; font: 500 11.5px var(--sans); color: var(--muted2); background: #12110fcc; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.panel { z-index: 6; }
.panel.closed { display: none; }
.pbody .tab.hide { display: none; }
.lv-hero { background: var(--card); }
.lv-hero h2 em { text-shadow: 2px 2px #3d2e08; }
.btn.big { box-shadow: 0 3px #8a6a10; }
.btn.big:active { box-shadow: 0 1px #8a6a10; }
.lv-kick .status { color: var(--muted2); font: 500 11.5px var(--sans); letter-spacing: 0; }
.kpi .addr { display: flex; gap: 6px; align-items: center; }
.kpi .addr button { font: 600 10.5px var(--sans); color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.lv-pt { width: 26px; height: 26px; }
.lv-pt canvas { max-width: 24px; max-height: 24px; }
.lv-pt.big { width: 56px; height: 56px; }
.lv-pt.big canvas { max-width: 54px; max-height: 54px; }
.lv-pt i { display: block; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
.lv-d q a { color: var(--accent); }
.tag.house { color: var(--muted2); border-color: var(--line); }
.lv-d.win { border-left-color: var(--accent); }
.lv-empty b { display: block; margin-bottom: 2px; }

/* the agent card */
.card { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--accent-dim); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.card .cbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card p { margin: 0; display: flex; align-items: center; gap: 6px; }
.card p .x { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.card b { color: var(--accent); font-size: 13px; }
.card small { color: var(--muted2); font-size: 11.5px; line-height: 1.3; }
.card q { quotes: none; color: #cfc8b4; font-size: 12px; font-style: italic; }

/* door list + racks (panel and page) */
.doorlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.doorlist li { display: flex; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.doorlist li i { width: 26px; height: 26px; border-radius: 6px; background: var(--panel2); color: var(--muted2); font: 700 15px/26px var(--pix); text-align: center; font-style: normal; flex: none; border: 1px solid var(--line); }
.doorlist li.open i { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.doorlist li b { font: 700 14px var(--pix); color: var(--text); display: block; }
.doorlist li.open b { color: var(--accent); }
.doorlist li small { color: var(--muted2); font-size: 11.5px; }
.rack { display: flex; flex-direction: column; gap: 8px; }
.rack .lane .lbh { margin: 6px 0 4px; }
.rack .lane.key .lbh { color: var(--up); }
.lv-lb li { cursor: pointer; }
.lv-lb li.slot { border-style: dashed; cursor: default; min-height: 30px; }
.lv-lb .lv-n b { display: flex; align-items: center; gap: 6px; }
.lv-lb .lv-n .dot { width: 6px; height: 6px; box-shadow: none; background: var(--line); margin-left: auto; }
.lv-lb .lv-n .dot.on { background: var(--up); }
.lv-lb .lv-n small.note { color: #cfc8b4; font-style: italic; white-space: normal; }
.rules .lb li { padding: 5px 0; }
.rules .lb li b { color: var(--accent); font: 700 14px var(--pix); }
.plaque { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; }
.plaque .row { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid #38322d80; font-size: 12.5px; color: #cfc8b4; }
.plaque .row:last-child { border-bottom: 0; }
.plaque .row b { font: 700 14px var(--pix); color: var(--accent); }

/* sign-on */
.signon .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.signon .field span { color: var(--muted); font-size: 11.5px; }
.signon input { height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font: 500 14px var(--sans); padding: 0 10px; outline: none; }
.signon input:focus { border-color: var(--accent); }
.signon .f-err { color: var(--down); font-size: 12.5px; margin-bottom: 8px; }
.signon .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.signon .prompt { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--accent-dim); border-radius: 8px; padding: 10px; font: 500 12px/1.5 var(--mono); color: #e8e3d6; margin: 6px 0 10px; }
.signon .steps { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.signon .steps li { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted2); line-height: 1.35; }
.signon .steps i { background: var(--accent); width: 18px; height: 18px; color: var(--ink); font: 700 12px/18px var(--pix); text-align: center; border-radius: 5px; flex: none; font-style: normal; }
.signon .steps .mono { color: var(--text); }

/* ---- below the fold ---- */
main { position: relative; z-index: 2; background: var(--bg); border-top: 1px solid var(--line); }
.sec { max-width: 1180px; margin: 0 auto; padding: 44px 16px 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { font: 700 26px var(--pix); color: var(--accent); margin: 0; letter-spacing: .5px; text-shadow: 0 2px #4a3a10; }
.sec-head .sub { color: var(--muted2); font-size: 12.5px; }
.sec-head .sub b { font: 700 13px var(--pix); color: var(--num); }
.sheet { background: #1b1815f0; border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 6px 24px #00000073; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.page-rack.rack { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.page-rack .lane .lbh { margin-top: 0; }
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rules-grid .rule { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #cfc8b4; line-height: 1.4; }
.rules-grid .rule i { background: var(--accent); width: 22px; height: 22px; color: var(--ink); font: 700 14px/22px var(--pix); text-align: center; border-radius: 6px; flex: none; font-style: normal; }
.facts { width: 100%; border-collapse: collapse; font-size: 13px; }
.facts td { padding: 6px 0; border-bottom: 1px solid #38322d80; }
.facts td:first-child { color: var(--muted); width: 45%; }
.facts tr:last-child td { border-bottom: 0; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font: 700 13px var(--pix); color: var(--muted2); padding: 6px 8px; border-bottom: 1px solid var(--line); letter-spacing: .3px; }
table.tbl td { padding: 7px 8px; border-bottom: 1px solid #38322d80; }
table.tbl tr:last-child td { border-bottom: 0; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 560px; overflow: auto; scrollbar-width: thin; scrollbar-color: #4a423a transparent; }
.prize-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.prize-top b { font: 700 30px var(--pix); color: var(--accent); }
.prize-top .addr { font: 500 12px var(--mono); color: var(--muted2); overflow-wrap: anywhere; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.foot { max-width: 1180px; margin: 44px auto 0; padding: 16px 16px 28px; border-top: 1px solid var(--line); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted2); }
.foot a { color: #cfc8b4; text-decoration: none; }
.foot a:hover { color: var(--accent); }
.foot .treasury { margin-left: auto; font: 500 11.5px var(--mono); overflow-wrap: anywhere; }
.foot .name { font: 700 15px var(--pix); color: var(--accent); }

/* ---- past page ---- */
.topbar { position: sticky; top: 0; z-index: 10; background: #12110ff0; border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar .brand { margin-right: 6px; }
.topbar .right { margin-left: auto; display: flex; gap: 8px; }
.stage { margin-top: 14px; }
.stage-h { display: flex; justify-content: space-between; gap: 10px; font: 700 16px var(--pix); color: var(--accent); margin-bottom: 6px; }
.stage-b p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; color: #cfc8b4; white-space: pre-wrap; }
.stage-b img { max-width: 100%; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; }
.stage-b details summary { cursor: pointer; font: 700 13px var(--pix); color: var(--muted2); margin-bottom: 6px; }
.code { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 500 11.5px/1.45 var(--mono); max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: #cfc8b4; }
.answer { margin-top: 8px; }
.answer .lbl { font: 700 12px var(--pix); color: var(--muted2); margin-bottom: 3px; }
.answer pre { margin: 0; background: var(--card); border: 1px solid var(--accent-dim); border-radius: 8px; padding: 8px 10px; font: 600 12.5px/1.45 var(--mono); color: var(--accent); white-space: pre-wrap; overflow-wrap: anywhere; }
.outcome { background: var(--card); border: 1px solid var(--accent-dim); border-radius: 10px; padding: 12px; font: 700 18px var(--pix); color: var(--accent); margin-bottom: 12px; }
.outcome small { display: block; font: 500 12px var(--sans); color: var(--muted2); margin-top: 4px; overflow-wrap: anywhere; }
.detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 28px 0 12px; }
.detail-head h2 { font: 700 26px var(--pix); color: var(--accent); margin: 0; }

/* ---- responsive ---- */
@media (width <= 1320px) { .tl { right: 410px; } }
@media (width <= 1100px) {
  .page-rack.rack { grid-template-columns: repeat(4, 1fr); }
  .rules-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (width <= 760px) {
  .screen { height: auto; min-height: 0; }
  .world { position: relative; height: 55svh; min-height: 380px; }
  .tl { top: 32px; left: 8px; right: 8px; gap: 6px; }
  .logo { font-size: 24px; }
  .brand img { width: 24px; height: 24px; }
  .chip.nav { font-size: 12px; }
  .tr { top: 74px; left: 8px; right: 8px; justify-content: flex-start; flex-wrap: wrap; }
  .leftcol { display: none; }
  .hint { display: none; }
  .panel { position: relative; inset: auto; width: auto; height: auto; max-height: none; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; background: var(--panel); }
  .panel .tabs .pclose { display: none; }
  .pbody { overflow: visible; }
  .grid2 { grid-template-columns: 1fr; }
  .page-rack.rack { grid-template-columns: 1fr 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .sec { padding-top: 32px; }
  .foot .treasury { margin-left: 0; }
  .plaque .row { grid-template-columns: 1fr; gap: 2px; }
}
.lv-d > .lv-pt { flex: none; }
.logo { text-transform: uppercase; }
.lv-kick { flex-wrap: wrap; }
.lv-kick .status { flex-basis: 100%; margin-top: 4px; }
.lv-pt canvas { max-width: 22px; max-height: 22px; }
.lv-pt.big canvas { max-width: 54px; max-height: 54px; }
@media (width <= 760px) {
  .tl .chip.explain, .tl .chip.nav.on { display: none; }
  .tr { top: 68px; gap: 5px; }
  .topbar .right { margin-left: 0; }
}
@media (width <= 760px) {
  .tr { flex-wrap: nowrap; }
  .tr .lp-t em { display: none; }
  .tr .cachip { position: absolute; left: 0; top: calc(max(55svh, 380px) - 68px - 36px); }
}
