/* The island HUD on the pixelkit: the kit's dark chunky vocabulary (hud.css) with the island's own accent
   (the chart's cream from brand.json), the sea-blue for the tide and talk, the chart red for strikes.
   Layout: a fixed stage holds the world + the in-world HUD; the panel sits in a spacer that scrolls away with the
   hero; the sections below the fold are opaque and slide over the world. Phone: world 55svh, HUD stacked under it. */
:root {
  --accent: #f3ead3; --accent-dim: #8a8064; --num: #e9d9ad;
  --teal: #8aa5bd; --down: #e05a4a; --bad: #e05a4a; --warn: #e3a24a; --gold: #e9d9ad;
  --sea: #1d4a70; --red: #b4271c;
}
html, body { overflow: auto; height: auto; min-height: 100%; }
body { background: var(--bg); }
body.watch { overflow: hidden; height: 100%; }
@media (width <= 760px) { body.watch { overflow: auto; height: auto; } }

/* ---- the stage: the world and the HUD that floats on it ---- */
.stage { position: fixed; inset: 0; height: 100svh; z-index: 1; background: #0b0a09; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#ui { position: absolute; inset: 0; }
.stage-space { position: relative; z-index: 2; height: 100svh; pointer-events: none; }
.stage-space > * { pointer-events: auto; }
.panel { position: absolute; top: 82px; right: 12px; bottom: 12px; width: 384px; }
.tl { right: 600px; }
.brand { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line); box-shadow: 0 2px #0006; image-rendering: auto; }
.logo { text-transform: uppercase; text-shadow: 0 2px #3a3222, 0 0 18px #f3ead340; }
.hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font: 500 11.5px var(--sans); color: var(--muted2); background: #12110fc0; border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; white-space: nowrap; pointer-events: none; }
.leftcol a { border: 1px solid var(--line); color: #cfc8b4; background: #1b1815eb; border-radius: 10px; flex-direction: column; justify-content: center; align-items: center; gap: 3px; width: 54px; height: 54px; display: flex; box-shadow: 0 2px #0006; text-decoration: none; font: 600 11.5px var(--pix); }
.leftcol a:hover { border-color: var(--accent); color: var(--accent); }
.leftcol svg { width: 18px; height: 18px; }
.chip.xlink { padding: 0 9px; }
.chip.xlink svg { width: 15px; height: 15px; }
.chip.ca .k { font: 700 12px var(--pix); color: var(--muted2); letter-spacing: 1px; }
.chip.ca .v { font: 500 12.5px var(--mono); color: var(--text); }
.chip.ca .c { font: 600 11px var(--pix); color: var(--accent); border-left: 1px solid var(--line); padding-left: 7px; }
.chip.th b { color: var(--num); }

/* ---- panel pieces ---- */
.tabs button.on .live-dot { background: #2a6b3a; }
.agent-card { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border: 1px solid var(--accent-dim); border-radius: 10px; padding: 8px 8px 8px 10px; margin-bottom: 10px; animation: pop .25s both; }
.agent-card[hidden] { display: none; }
.card-pt { width: 48px; height: 46px; background: var(--panel2); border-radius: 8px; overflow: hidden; flex: none; display: flex; align-items: flex-end; justify-content: center; }
.card-pt canvas { width: 64px; height: 60px; image-rendering: pixelated; margin-bottom: -8px; }
.card-b { flex: 1; min-width: 0; font-size: 12px; color: var(--muted2); }
.card-b > b { font: 700 15px var(--pix); color: var(--accent); }
.card-l { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.card-l .mono { color: var(--num); font-weight: 600; }
.hp { display: inline-block; width: 64px; height: 8px; background: #2a221c; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; vertical-align: middle; flex: none; }
.hp u { display: block; height: 100%; background: var(--up); transition: width .5s; }
.hp.mid u { background: #e3c04a; }
.hp.low u { background: var(--down); }
.lv-hero h2 { font-size: 20px; }
.lv-nowallet { color: var(--muted2); display: block; line-height: 1.4; }
.lv-nowallet .mono { color: var(--num); }
.kpi b small { font-family: var(--sans); font-weight: 500; }
.lv-feed .lv-pt, .ro .lv-pt, .lv-lb .lv-pt { flex: none; width: 32px; height: 32px; display: block; overflow: hidden; border-radius: 7px; border: 1px solid var(--line); box-sizing: border-box; }
.lv-feed .lv-pt canvas, .ro .lv-pt canvas, .lv-lb .lv-pt canvas { width: 64px; height: 60px; max-width: none; max-height: none; margin: -25px 0 0 -17px; image-rendering: pixelated; display: block; }
canvas.pt.house { filter: grayscale(.9) brightness(.85); }
.lv-pt .sea { width: 14px; height: 14px; border-radius: 50%; background: var(--sea); border: 2px solid #8aa5bd; margin: 8px auto 0; display: block; box-sizing: border-box; }
.lv-d.bad { border-left-color: var(--down); }
.lv-d.burn { border-left-color: var(--warn); }
.lv-d.buy { border-left-color: var(--teal); }
.lv-d.sell { border-left-color: var(--accent); }
.lv-d q.say { font-style: italic; color: #e3dccb; }
.lv-d q i { color: var(--muted2); font-style: normal; }
.lv-d q b { color: var(--text); }
.tag { color: var(--muted2); border-color: var(--line); }
.tag.burn { color: var(--warn); border-color: #6a4a1e; }
.tag.bad { color: #ff9d8a; border-color: #6a2e24; }
.tag.buy { color: var(--teal); border-color: #34506a; }
.tag.money, .tag.win { color: var(--up); border-color: #35513f; }
.tag.sell { color: var(--accent); border-color: #5a5340; }
.tag:not([class*=" "]) { color: #7fe0a8; border-color: #35513f; }
.slide { animation: slidein .35s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes slidein { 0% { opacity: 0; transform: translateY(-6px); } }
.lv-lb li i { color: var(--accent); }
.lv-lb .n { font: 700 13px var(--pix); color: var(--num); min-width: 42px; text-align: right; }
.ro { background: var(--card); border: 1px solid var(--line); cursor: pointer; border-radius: 8px; align-items: center; gap: 8px; padding: 5px 8px; display: flex; }
.ro:hover, .ro.sel { border-color: var(--accent-dim); }
.ro.sel { background: #f3ead30d; }
.ro.out { opacity: .55; }
.ro.out .lv-pt canvas { filter: grayscale(1) brightness(.6); }
.ro .lv-n b { font-size: 13px; }
.ro .lv-n small { font-size: 10.5px; }
.ro .k { font: 600 13px var(--mono); color: var(--num); min-width: 14px; text-align: right; }
.ro .x { color: var(--down); font-size: 13px; }
.ro .spear { color: var(--muted2); font-style: normal; font-family: var(--mono); }
.rules-l { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.rules-l li { display: flex; gap: 9px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 12.5px; color: #cfc8b4; line-height: 1.35; }
.rules-l li i { font: 700 13px/18px var(--pix); color: var(--ink); background: var(--accent); border-radius: 5px; width: 18px; height: 18px; text-align: center; flex: none; font-style: normal; }
.rules-l b { color: var(--num); font-family: var(--mono); font-weight: 600; }
.banner { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; color: #cfc8b4; margin-bottom: 10px; line-height: 1.4; }
.banner.win { border-color: #35513f; color: var(--text); }
.banner b { font-family: var(--mono); color: var(--num); font-weight: 600; }
.banner b.n { font-family: var(--sans); color: var(--text); }
.pbody .tab[hidden] { display: none; }
.key { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--muted2); margin: 8px 0 0; }
.key b { font-family: var(--pix); color: var(--text); font-weight: 400; font-size: 13px; }
.key .x { color: #d9533f; font-weight: 700; }
.lv-stats .kpi b.txt { font: 600 14px var(--sans); color: var(--text); }
.mono { color: var(--num); }

/* ---- below the fold ---- */
.below { position: relative; z-index: 3; background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px #0008; }
.sec { max-width: 1180px; margin: 0 auto; padding: 36px 16px 8px; }
.sec:last-child { padding-bottom: 36px; }
.sec-h { font: 700 26px/1 var(--pix); color: var(--accent); margin: 0 0 4px; letter-spacing: .5px; text-shadow: 0 2px #3a3222; }
.sec-h small { font: 500 13px var(--sans); color: var(--muted2); margin-left: 10px; letter-spacing: 0; text-shadow: none; }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-top: 14px; }
.ct { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 6px 24px #00000055; }
.ct .band { background: var(--panel2); border-bottom: 1px solid var(--line); padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; font: 700 14px var(--pix); color: var(--text); }
.ct .band .dim { font: 500 11.5px var(--sans); color: var(--muted2); }
.ct .body { padding: 8px 10px 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font: 600 11px var(--pix); color: var(--muted2); letter-spacing: .5px; padding: 6px 6px 5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 6px; border-bottom: 1px solid #38322d80; color: #cfc8b4; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num, .tbl th.num { text-align: right; font-family: var(--mono); color: var(--num); }
.tbl td.red { color: #ff9d8a; }
.tbl td b { color: var(--text); font-weight: 600; }
.tbl td .empty, .tbl td.empty { color: var(--muted); font-size: 12px; }
.tbl .lv-pt { display: inline-block; width: 26px; height: 26px; vertical-align: middle; margin-right: 7px; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); box-sizing: border-box; }
.tbl .lv-pt canvas { width: 64px; height: 60px; max-width: none; max-height: none; margin: -27px 0 0 -20px; image-rendering: pixelated; display: block; }
.signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.sign { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 10px 10px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #cfc8b4; line-height: 1.4; box-shadow: 0 3px #0006; position: relative; }
.sign::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; background: var(--accent-dim); border-radius: 0 2px 2px 0; }
.sign .n { font: 700 16px/22px var(--pix); color: var(--ink); background: var(--accent); width: 22px; height: 22px; border-radius: 5px; text-align: center; flex: none; }
.sign b { color: var(--num); font-family: var(--mono); font-weight: 600; }
.enter { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field span { font: 600 11.5px var(--pix); color: var(--muted2); letter-spacing: .4px; }
.field input { background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 8px; height: 38px; padding: 0 10px; font: 500 14px var(--mono); outline: none; }
.field input:focus { border-color: var(--accent-dim); }
.err { color: #ff9d8a; font-size: 12.5px; min-height: 18px; margin: 2px 0 6px; }
.hintp { color: var(--muted2); font-size: 12px; margin: 10px 0 0; }
.hintp code, .terms code { font-family: var(--mono); color: var(--num); }
.result { display: none; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.result.show { display: block; }
.result .k { font: 600 11.5px var(--pix); color: var(--muted2); display: block; margin: 8px 0 4px; letter-spacing: .4px; }
.result pre { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 12px/1.45 var(--mono); color: var(--text); white-space: pre-wrap; word-break: break-all; margin: 0 0 8px; }
.terms { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; font-size: 12.5px; color: #cfc8b4; line-height: 1.4; }
.terms dt { font: 600 11.5px var(--pix); color: var(--accent); letter-spacing: .4px; padding-top: 2px; }
.terms dd { margin: 0; }
footer { position: relative; z-index: 3; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted2); font-size: 12px; }
footer .wrap { max-width: 1180px; margin: 0 auto; padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: var(--accent); text-decoration: none; }
footer .addr { font-family: var(--mono); font-size: 11px; color: var(--muted); word-break: break-all; }
body.watch footer { display: none; }

/* ---- phone: world on top, HUD stacked under it as tabs ---- */
@media (width <= 760px) {
  .stage { height: 55svh; }
  .stage-space { height: auto; padding-top: 55svh; }
  .panel { position: relative; inset: auto; width: auto; height: auto; max-height: none; border-radius: 0; margin: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .pbody { overflow: visible; }
  .tl { right: 8px; }
  .tr { top: auto; bottom: 10px; right: 8px; left: 8px; flex-wrap: wrap; justify-content: flex-end; }
  .hint { display: none; }
  .chip.explain { display: none; }
  .leftcol { top: 74px; } .leftcol button { display: none; } .leftcol a { width: 44px; height: 44px; font-size: 10px; }
  .two, .enter, .signs { grid-template-columns: 1fr; }
  .sec { padding: 26px 16px 8px; }
  .tbl { font-size: 12px; }
  .tbl th, .tbl td { padding: 5px 4px; }
  #board .ct:first-child .tbl th:nth-child(2), #board .ct:first-child .tbl td:nth-child(2), #board .ct:first-child .tbl th:nth-child(3), #board .ct:first-child .tbl td:nth-child(3) { display: none; }
  .ct .body { overflow-x: auto; }
  body.watch .stage-space { padding-top: 55svh; }
}
@media (width <= 1100px) and (width > 760px) { .tl { right: 470px; } .chip.explain { display: none; } }
@media (prefers-reduced-motion: reduce) { .slide, .agent-card { animation: none; } }

/* ---- fifth pass: five tabs, the small chart, the sign-on form inside the panel ---- */
[hidden] { display: none !important; }
.stage { background: #07263f; }
.tabs.five { gap: 3px; padding: 8px 6px; }
.tabs.five button { font-size: 12.5px; padding: 0 2px; gap: 3px; min-width: 0; }
.tabs.five button .mono { font-size: 11px; }
.mini { position: absolute; left: 12px; bottom: 12px; padding: 4px 4px 2px; background: #1b1815eb; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 2px #0006; display: flex; flex-direction: column; gap: 1px; align-items: center; }
.mini canvas { width: 144px; height: 122px; image-rendering: pixelated; border-radius: 5px; cursor: crosshair; display: block; touch-action: none; }
.mini span { font: 600 10.5px var(--pix); color: var(--muted2); letter-spacing: .3px; }
.panel #signon .field input { width: 100%; box-sizing: border-box; }
.panel .result pre { max-height: 190px; overflow: auto; }
.panel .terms { font-size: 12px; }
a.linkish { color: var(--accent); }
@media (width <= 1100px) { .mini { display: none; } }
@media (height <= 640px) { .mini { display: none; } }
@media (width <= 760px) { .tabs.five button { font-size: 12px; } .leftcol button { display: none; } }
