:root {
  --ink: #f3ecff; --dim: #b9a9d9; --violet: #8247e5; --violet2: #b48cff; --gold: #f2c75c;
  --panel: rgba(20, 12, 38, .92); --edge: #5b3fa0; --hp: #e5485f; --mp: #4fa3ff; --ok: #62d68a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #0b0614; color: var(--ink); overflow: hidden; }
body:has(.page) { overflow: auto; }
body { font: 15px/1.4 Spectral, Georgia, serif; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#app { position: fixed; inset: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px) 0; overflow: hidden; }
#screen { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

/* panels */
.hud.top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.place, .stats { background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; padding: 4px 10px; font-family: Cinzel, serif; font-size: 13px; letter-spacing: .04em; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.stats { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.stats .gold { color: var(--gold); } .stats .shards { color: var(--violet2); }

.partybar { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; pointer-events: none; }
.pc { background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; padding: 4px 6px; width: 112px; display: grid; grid-template-columns: 30px 1fr; gap: 2px 6px; align-items: center; }
.pc canvas { grid-row: span 3; width: 30px; height: 26px; image-rendering: pixelated; }
.pc b { font: 600 12px Cinzel, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc b small { color: var(--dim); font-weight: 400; }
.bar { height: 5px; border-radius: 3px; background: #2a1d44; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--hp); transition: width .35s; }
.bar.mp i { background: var(--mp); }
.bar.xp { height: 3px; margin-top: 1px; } .bar.xp i { background: #4fd06a; } /* experience to the next level (Dallas 2026-11-06) */
.gobtn { position: absolute; z-index: 4; transform: translate(-50%, -100%); background: rgba(30,18,56,.92); border: 1px solid var(--gold); color: var(--gold); border-radius: 10px; padding: 5px 10px; font: 600 13px Cinzel, serif; white-space: nowrap; cursor: pointer; max-width: min(260px, calc(100% - 16px)); overflow: hidden; text-overflow: ellipsis; } /* the Enter/Exit icon by a way out (Dallas 2026-11-06) */
.gobtn:hover { background: rgba(60,38,104,.95); }
.tip.squeezed .cmp { min-width: 0; } /* a tip squeezed into the room beside a panel (2026-11-06) */
#shop.tipstrip { max-height: calc(100% - 64px - 196px); } .tip.docked { max-height: 188px; overflow: hidden; } .tip.docked .cmp { min-width: 0; } /* no room at the side (a phone): the strip under the shop holds the tip */
.pc.down { opacity: .45; }
.pc.turn { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(242,199,92,.4); }

/* touch pad */
.pad { position: absolute; right: 12px; bottom: 12px; width: 132px; height: 132px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 2px; }
.pad button, .dpad3d button, .abtn { background: rgba(30, 18, 56, .78); border: 1px solid var(--edge); border-radius: 10px; font-size: 18px; color: var(--violet2); }
.pad button:active, .dpad3d button:active, .abtn:active { background: var(--violet); color: #fff; }
.pad [data-k=up] { grid-area: 1 / 2; } .pad [data-k=left] { grid-area: 2 / 1; } .pad [data-k=right] { grid-area: 2 / 3; } .pad [data-k=down] { grid-area: 3 / 2; }
.abtns { position: absolute; right: 152px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.abtn { width: 64px; height: 64px; border-radius: 50%; font: 700 14px Cinzel, serif; }
.abtn.small { width: 48px; height: 32px; border-radius: 16px; font-size: 11px; }
.dpad3d { position: absolute; right: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(3, 52px); grid-auto-rows: 48px; gap: 4px; }
.dpad3d .dsearch { grid-column: 1 / 4; font: 700 13px Cinzel, serif; padding-bottom: 0; } .dpad3d .dsearch::after { content: none; } /* Search (2026-10-27): a full-width row under the arrows */
#automap { position: absolute; right: 12px; top: 48px; width: 128px; height: 128px; image-rendering: pixelated; border: 1px solid var(--edge); border-radius: 8px; background: rgba(10,6,20,.8); cursor: zoom-in; }
#automap.big { width: 256px; height: 256px; cursor: zoom-out; }
#compass { position: absolute; right: 148px; top: 48px; width: 64px; height: 64px; cursor: pointer; }
body.mapoff #compass { right: 12px; }
#automap.big + #compass { right: 276px; }
/* keyboard players (no touch screen at all): the on-screen pad, Act/Map and dungeon arrows are replaced by hotkeys
   (Marty 2026-10-19); body.kb is set in game.js when no coarse pointer exists. Battle buttons show their number key. */
body.kb .pad, body.kb .abtns, body.kb .dpad3d { display: none !important; }
/* one control set per platform in every menu and hint (Dallas 2026-10-21): .kbonly = keys (desktop), .touchonly = taps (touch) */
body.kb .touchonly, body:not(.kb) .kbonly { display: none !important; }
body:not(.kb) .choices button i { display: none; }
/* one list of options in a talk (2026-10-27): reply buttons, then the words this person knows about, then Bye */
.choices button.topic { background: #2a1a4c; border: 1px solid var(--edge); color: var(--ink); }
.choices button.bye { background: transparent; border: 1px solid var(--edge); color: var(--dim); }
body.kb #bacts { counter-reset: bk; }
body.kb #bacts button { counter-increment: bk; }
body.kb #bacts button::before { content: counter(bk); display: inline-block; min-width: 16px; margin-right: 6px; padding: 0 4px; border: 1px solid var(--edge); border-radius: 4px; font-size: 11px; line-height: 15px; text-align: center; opacity: .8; }

/* dialogue */
.talk { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 40px rgba(0,0,0,.6); z-index: 5; }
.talk-head { display: flex; align-items: center; gap: 10px; font-family: Cinzel, serif; font-size: 16px; color: var(--gold); }
.talk-head canvas { width: 52px; height: 44px; image-rendering: pixelated; background: #1c1233; border-radius: 6px; border: 1px solid var(--edge); }
.talk-text { margin: 8px 0 10px; min-height: 3em; font-size: 16px; }
.talk-text em { color: var(--violet2); font-style: normal; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { background: #2a1a4c; border: 1px solid var(--edge); border-radius: 999px; padding: 4px 12px; font: 600 12px Cinzel, serif; letter-spacing: .05em; text-transform: uppercase; }
.chips button.new { border-color: var(--violet2); color: var(--violet2); }
.chips button.bye { background: transparent; color: var(--dim); }
.ask { display: flex; gap: 6px; margin-top: 8px; }
.ask input { flex: 1; min-width: 0; background: #140b26; color: var(--ink); border: 1px solid var(--edge); border-radius: 8px; padding: 5px 8px; font: inherit; }
.ask button { background: var(--violet); border: 0; border-radius: 8px; padding: 0 12px; font-family: Cinzel, serif; }

/* battle menu */
.bmenu { position: absolute; right: 12px; bottom: 12px; background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 10px; width: 240px; z-index: 4; }
.bwho { font: 600 13px Cinzel, serif; color: var(--gold); margin-bottom: 6px; }
.bacts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bacts button { background: #2a1a4c; border: 1px solid var(--edge); border-radius: 8px; padding: 8px 6px; font: 600 13px Cinzel, serif; }
.bacts button small { display: block; font: 400 11px Spectral, serif; color: var(--dim); }
.bacts button:disabled { opacity: .4; }
.bacts button.wide { grid-column: span 2; }

.msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 16px; text-align: center; z-index: 6; }
.msg p { margin: 0 0 12px; font-size: 16px; }
.msg button, .title button { background: var(--violet); border: 0; border-radius: 10px; padding: 9px 22px; font: 700 14px Cinzel, serif; color: #fff; }
.toast { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--violet2); border-radius: 999px; padding: 5px 14px; font: 600 13px Cinzel, serif; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 7; white-space: nowrap; }
.toast.show { opacity: 1; }

/* title */
.title { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at 50% 40%, rgba(60, 25, 110, .55), rgba(8, 4, 16, .92) 70%); z-index: 10; text-align: center; padding-inline: 16px; }
.logo h1 { font: 800 clamp(34px, 8vw, 64px)/1 Cinzel, serif; margin: 10px 0 6px; letter-spacing: .04em; background: linear-gradient(#fff6d8, #f2c75c 55%, #b07a2a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #2a1650) drop-shadow(0 0 22px rgba(130, 71, 229, .6)); text-wrap: balance; }
.logo p { margin: 0; color: var(--dim); font-style: italic; letter-spacing: .08em; }
.gem { display: inline-block; width: 26px; height: 26px; transform: rotate(45deg); background: linear-gradient(135deg, #e3d0ff, #8247e5 60%, #3b1c7a); box-shadow: 0 0 24px #8247e5; border-radius: 4px; }
.title .ghost { background: transparent; border: 1px solid var(--edge); }
.title small { color: var(--dim); max-width: 34ch; }
[hidden] { display: none !important; }

/* phones */
@media (max-width: 600px) {
  .hud.top { top: 6px; left: 6px; right: 6px; }
  .place, .stats { font-size: 11px; padding: 3px 8px; white-space: nowrap; }
  .stats { gap: 8px; flex-wrap: nowrap; }
  .partybar { top: 36px; bottom: auto; left: 6px; right: 6px; justify-content: center; }
  .pc { width: auto; flex: 1 1 0; max-width: 124px; padding: 3px 5px; }
  #automap { top: auto; bottom: 12px; left: 12px; right: auto; width: 104px; height: 104px; }
  #automap.big { width: 200px; height: 200px; }
  #compass { top: auto; bottom: 12px; left: 124px; right: auto; width: 52px; height: 52px; }
  body.mapoff #compass { left: 12px; }
  #automap.big + #compass { left: 220px; right: auto; }
  .abtns { right: 150px; }
  .bmenu { left: 8px; right: 8px; width: auto; }
  .talk { bottom: 8px; }
}

.snd { pointer-events: auto; background: transparent; border: 1px solid var(--edge); border-radius: 999px; padding: 0 8px; font: 600 11px Cinzel, serif; color: var(--dim); }
.snd[aria-pressed="true"] { color: var(--violet2); }

/* ---- milestone 1 (2026-10-18): presence, chat, bag, shop, start form */
.place small { margin-left: 8px; color: var(--dim); font: 400 11px Spectral, serif; letter-spacing: 0; }
.chat { position: absolute; left: 8px; bottom: 76px; width: min(380px, calc(100% - 180px)); z-index: 3; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.chatlog { max-height: 132px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; font-size: 13px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.chatlog p { margin: 0; padding: 1px 6px; background: rgba(12, 6, 26, .55); border-radius: 4px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; }
.chatlog .who { color: var(--gold); font-weight: 600; }
.chatlog .say .who { color: #9fe3b4; }
.chatlog .sys { color: var(--dim); font-style: italic; }
.chatform { display: flex; gap: 4px; pointer-events: auto; opacity: .55; }
.chatform:focus-within { opacity: 1; }
.chatform input { flex: 1; min-width: 0; background: rgba(20, 11, 38, .9); color: var(--ink); border: 1px solid var(--edge); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 13px; }
.chatform button { background: var(--violet); border: 0; border-radius: 8px; padding: 0 10px; font: 600 12px Cinzel, serif; color: #fff; }
.chattoggle { position: absolute; left: 8px; bottom: 12px; z-index: 3; background: var(--panel); border: 1px solid var(--edge); border-radius: 999px; padding: 4px 12px; font: 600 12px Cinzel, serif; color: var(--violet2); }
.panel { position: absolute; right: 12px; top: 48px; width: min(380px, calc(100% - 24px)); max-height: calc(100% - 64px); overflow: auto; background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; z-index: 6; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.panel-head { display: flex; align-items: center; gap: 10px; font: 600 15px Cinzel, serif; color: var(--gold); margin-bottom: 6px; }
.panel-head b { flex: 1; }
.panel .x { background: transparent; border: 0; color: var(--dim); font-size: 16px; }
.panel h3 { font: 600 12px Cinzel, serif; color: var(--violet2); letter-spacing: .06em; text-transform: uppercase; margin: 10px 0 4px; }
.item { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px solid rgba(91, 63, 160, .35); font-size: 14px; }
.item .nm { flex: 1; min-width: 0; }
.item small { color: var(--dim); }
.item button { background: #2a1a4c; border: 1px solid var(--edge); border-radius: 6px; padding: 2px 8px; font: 600 11px Cinzel, serif; }
.item button:disabled { opacity: .4; }
.tag { font: 600 10px Cinzel, serif; border-radius: 4px; padding: 0 4px; border: 1px solid currentColor; }
.r-common { color: #e6e0f2; } .r-uncommon { color: #62d68a; } .r-rare { color: #4fa3ff; } .r-epic { color: #b48cff; } .r-legendary { color: #f2c75c; }
.quest { font-size: 13px; margin: 2px 0; } .quest s { color: var(--dim); }
.say { margin: 0 0 6px; min-height: 1.2em; color: var(--dim); font-style: italic; font-size: 14px; }
.netstate { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); background: #5a1b2b; border: 1px solid var(--hp); border-radius: 999px; padding: 3px 12px; font: 600 12px Cinzel, serif; z-index: 9; }
.start { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.start label { display: flex; flex-direction: column; gap: 4px; font: 600 12px Cinzel, serif; color: var(--dim); letter-spacing: .06em; }
.start input { background: #140b26; color: var(--ink); border: 1px solid var(--edge); border-radius: 8px; padding: 7px 10px; font: 16px Spectral, serif; text-align: center; width: 240px; }
.start button:disabled { opacity: .6; }
.ghostlink { color: var(--violet2); font: 600 13px Cinzel, serif; }
.page { max-width: 560px; margin: 40px auto; padding: 0 16px; overflow: auto; }
.page a { color: var(--violet2); }
@media (max-width: 600px) {
  .chat { bottom: 158px; width: calc(100% - 16px); }
  .chat.closed { display: none; }
  .chatlog { max-height: 72px; }
}

/* ---- passes panel (2026-10-18) */
.panel.wide { width: min(560px, calc(100% - 24px)); }
.item.locked { opacity: .5; }
.promise { margin: 0 0 8px; padding: 6px 10px; border: 1px solid var(--ok); border-radius: 8px; color: #c9f5d6; font-size: 14px; }
.status { margin: 0 0 8px; font-size: 14px; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.tiercard { border: 1px solid var(--edge); border-radius: 10px; padding: 8px 10px; background: rgba(42, 26, 76, .55); font-size: 13px; }
.tiercard.current { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.tiercard h4 { margin: 0; font: 600 15px Cinzel, serif; color: var(--ink); }
.tiercard .price { color: var(--gold); font: 600 13px Cinzel, serif; }
.tiercard .pkg { font-size: 11px; opacity: .8; margin: 0 0 4px; }
.tiercard ul { margin: 6px 0; padding-left: 16px; }
.tiercard .badge { font: 600 10px Cinzel, serif; color: var(--gold); border: 1px solid var(--gold); border-radius: 4px; padding: 0 4px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 4px; border: 1px solid #fff4; }
.isl { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; border-top: 1px solid rgba(91, 63, 160, .35); font-size: 14px; }
.isl input { margin-top: 4px; }
.isl small { color: var(--dim); display: block; }
.buy { display: inline-block; margin-top: 8px; background: var(--violet); color: #fff; border-radius: 8px; padding: 7px 16px; font: 700 13px Cinzel, serif; text-decoration: none; }

/* ---- monster drops (2026-10-19): the loot list on the victory message */
.msg ul.loot { list-style: none; margin: 10px auto 0; padding: 0; text-align: left; display: table; font-size: 15px; }
.msg ul.loot li.gold { color: var(--gold); font-weight: 600; }
.msg ul.loot li { padding: 1px 0; }
.msg ul.loot li::before { content: "\25C6"; margin-right: 6px; font-size: 10px; vertical-align: middle; }
.msg ul.loot small { color: var(--dim); }

/* ---- sign-in and choices (2026-10-19) */
.signinbtn { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; background: #2a1a4c; border: 1px solid var(--violet2); border-radius: 10px; padding: 9px 18px; color: var(--ink); font: 700 14px Cinzel, serif; text-decoration: none; }
.signinbtn small { font: 400 12px Spectral, serif; color: var(--dim); }
.msg .ghostbtn { background: transparent; border: 1px solid var(--edge); border-radius: 10px; padding: 9px 22px; font: 700 14px Cinzel, serif; color: var(--ink); }
.page .onetap { margin: 12px 0 18px; } .page .onetap .buy { display: inline-block; background: var(--violet); color: #fff; border-radius: 10px; padding: 10px 20px; font: 700 15px Cinzel, serif; text-decoration: none; }
.page h3.or { font: 600 14px Cinzel, serif; color: var(--dim); margin: 0 0 8px; }

/* ---- hover stats (2026-10-19) */
.tip { position: absolute; z-index: 8; max-width: 260px; background: var(--panel); border: 1px solid var(--violet2); border-radius: 8px; padding: 6px 9px; font-size: 13px; line-height: 1.35; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.tip b { font: 600 13px Cinzel, serif; color: var(--gold); } .tip small { color: var(--dim); }
.partybar .pc { pointer-events: auto; cursor: help; }

/* ---- the Inventory (2026-10-19): equipment slots, tabs, sort, grid, item card, compare */
.panel.inv { width: min(620px, calc(100% - 24px)); }
/* bestiary (Dallas 2026-10-19) */
.beast { display: grid; grid-template-columns: 64px 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--edge); font-size: 13px; }
.beast canvas { width: 60px; height: 64px; image-rendering: pixelated; grid-row: span 4; }
.beast b { font: 600 14px Cinzel, serif; color: var(--gold); }
.beast .kc { color: var(--dim); font-size: 12px; }
.beast ul { margin: 2px 0 0 16px; padding: 0; }
.beast .locked { color: var(--dim); font-style: italic; font-size: 12px; }
.journal-links { display: flex; gap: 8px; margin: 8px 0; }
.journal-links button { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: rgba(30,18,56,.8); border: 1px solid var(--edge); color: var(--violet2); }
@media (max-width: 700px) { .wideonly { display: none; } }
/* lore codex: a list of titles, one page at a time */
.codexlist { display: grid; gap: 4px; }
.codexlist button { text-align: left; font: 600 13px Cinzel, serif; padding: 6px 10px; border-radius: 8px; background: rgba(30,18,56,.8); border: 1px solid var(--edge); color: var(--gold); }
.codexpage { padding: 6px 2px; }
.codexpage h4 { font: 600 16px Cinzel, serif; color: var(--gold); margin: 0 0 8px; }
.codexpage p { line-height: 1.55; font-size: 14px; }
.codexpage .back { font-size: 12px; padding: 4px 10px; border-radius: 8px; background: rgba(30,18,56,.8); border: 1px solid var(--edge); color: var(--violet2); }
/* camp (Dallas 2026-10-19): the dungeon rest stop. Party, potions, gear, quests on one screen */
.campbtn { position: absolute; left: 50%; transform: translateX(-50%); bottom: 84px; z-index: 4; background: rgba(30,18,56,.9); border: 1px solid var(--gold); color: var(--gold); border-radius: 10px; padding: 8px 16px; font: 600 14px Cinzel, serif; }
.campbtn kbd { font: 11px sans-serif; color: var(--dim); margin-left: 6px; }
.camphero { display: grid; grid-template-columns: 34px 1fr; gap: 4px 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--edge); }
.camphero canvas { width: 30px; height: 26px; image-rendering: pixelated; grid-row: span 2; }
.camphero .bars { display: grid; gap: 3px; font-size: 12px; }
.camphero .bars .bar { height: 7px; }
.camphero .drink { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px; }
.camphero .drink button { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: rgba(30,18,56,.8); border: 1px solid var(--edge); color: var(--violet2); }
.camphero.down { opacity: .55; }
.campgear { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0; font-size: 12px; }
.campgear img { width: 20px; height: 20px; image-rendering: pixelated; }
.campgear button { font-size: 11px; padding: 2px 7px; border-radius: 7px; background: rgba(30,18,56,.8); border: 1px solid var(--edge); color: var(--violet2); }
.campnote { color: var(--dim); font-size: 12px; margin: 6px 0; }
@media (max-width: 600px) { .campbtn { bottom: 176px; } }
.equipment { display: grid; gap: 6px; margin-bottom: 8px; }
.eqhero { display: flex; align-items: center; gap: 6px; background: rgba(42, 26, 76, .45); border: 1px solid var(--edge); border-radius: 10px; padding: 5px 6px; }
.eqwho { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.eqwho canvas { width: 30px; height: 26px; image-rendering: pixelated; }
.eqwho span { display: flex; flex-direction: column; min-width: 0; } .eqwho b { font: 600 13px Cinzel, serif; } .eqwho small { color: var(--dim); font-size: 11.5px; line-height: 1.3; }
.eqslot { width: 44px; height: 44px; flex: 0 0 auto; border: 1px solid var(--edge); border-radius: 8px; display: grid; place-items: center; background: #140b26; }
.eqslot img, .invcell img { width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; }
.eqslot.empty span { font: 600 8.5px Cinzel, serif; color: var(--dim); text-align: center; opacity: .7; }
.eqslot.r-uncommon, .invcell.r-uncommon { border-color: #62d68a; } .eqslot.r-rare, .invcell.r-rare { border-color: #4fa3ff; } .eqslot.r-epic, .invcell.r-epic { border-color: #b48cff; } .eqslot.r-legendary, .invcell.r-legendary { border-color: #f2c75c; }
.dragging .eqslot.dropok { box-shadow: 0 0 0 2px var(--gold); background: #2a1a4c; }
.invbar { display: flex; gap: 6px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 4px 0 6px; }
.invtabs { display: flex; gap: 4px; flex-wrap: wrap; }
.invtab { background: #2a1a4c; border: 1px solid var(--edge); border-radius: 999px; padding: 3px 9px; font: 600 11.5px Cinzel, serif; color: var(--dim); }
.invtab.on { color: var(--gold); border-color: var(--gold); }
.invsort { background: #140b26; color: var(--ink); border: 1px solid var(--edge); border-radius: 8px; padding: 3px 6px; font: 13px Spectral, serif; }
.invgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 5px; }
.invcell { position: relative; aspect-ratio: 1; border: 1px solid var(--edge); border-radius: 8px; background: #140b26; display: grid; place-items: center; padding: 0; }
.invcell.sel { box-shadow: 0 0 0 2px var(--gold); } .invcell.locked { opacity: .45; } .invcell[draggable=true] { cursor: grab; }
.invcell i { position: absolute; font: 700 10.5px Cinzel, serif; font-style: normal; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.invcell i.qty { right: 3px; bottom: 1px; color: #fff; } .invcell i.lv { left: 3px; top: 1px; color: var(--dim); font-size: 9.5px; }
.invcount { color: var(--dim); font-size: 12px; margin: 6px 0 0; }
.invcard { position: relative; border: 1px solid var(--violet2); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; background: rgba(20, 12, 38, .96); font-size: 13.5px; }
.invcard .x { position: absolute; right: 6px; top: 4px; background: transparent; border: 0; color: var(--dim); }
.invacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .invacts button { background: var(--violet); border: 0; border-radius: 8px; padding: 6px 10px; font: 600 12px Cinzel, serif; color: #fff; } .invacts button:disabled { opacity: .4; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .cmpcol { min-width: 0; } .cmphead { color: var(--violet2); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
.cmpdiff { margin-top: 4px; font-size: 12.5px; } .cmpworn + .cmpworn { margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.12); } .cmplvl, .tip small.cmplvl { color: #ffd75e; font-weight: 700; } .cmplvl.down, .tip small.cmplvl.down { color: #ff6b7f; } .up { color: #62d68a; } .down { color: #ff6b7f; } .same { color: var(--dim); }
.tip .cmp { min-width: 300px; } .tip:has(.cmp) { max-width: 380px; }
@media (max-width: 600px) { .invgrid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); } .eqslot { width: 48px; height: 48px; } .invtab { padding: 5px 10px; font-size: 12px; } .panel.inv { top: 40px; max-height: calc(100% - 52px); } }

/* ---- dialogue choices (2026-10-19) */
.choices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; } .choices:empty { display: none; }
.choices button { background: var(--violet); border: 0; border-radius: 8px; padding: 6px 12px; font: 600 13px Cinzel, serif; color: #fff; display: inline-flex; gap: 6px; align-items: center; }
.choices button i { font-style: normal; font-size: 10.5px; border: 1px solid #fff8; border-radius: 4px; padding: 0 4px; opacity: .85; }
@media (max-width: 600px) { .choices button { padding: 9px 14px; } }

/* ---- junk (2026-10-19) */
.invcell.junk img { opacity: .55; } .invcell i.jk { right: 3px; top: 1px; color: #ff9a6b; font-size: 9.5px; }
.invacts .junkbtn { background: #4a2a2a; border: 1px solid #ff9a6b55; }
.selljunk { display: block; width: 100%; margin: 0 0 6px; background: #4a2a2a; border: 1px solid #ff9a6b; border-radius: 8px; padding: 7px 10px; font: 600 12.5px Cinzel, serif; color: #ffd9c9; }

/* ---- the menu (2026-10-21): Graphics, Audio, Controls, Save and Quit; also opened from the title as Settings */
.gamemenu { z-index: 12; left: 50%; right: auto; transform: translateX(-50%); top: 56px; }
.title .settingsbtn { background: transparent; border: 1px solid var(--edge); border-radius: 10px; padding: 7px 18px; font: 600 13px Cinzel, serif; color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.tabs button { background: #2a1a4c; border: 1px solid var(--edge); border-radius: 999px; padding: 5px 12px; font: 600 12.5px Cinzel, serif; color: var(--ink); }
.tabs button.on { background: var(--violet); border-color: var(--violet2); color: #fff; }
.setrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(91, 63, 160, .35); font-size: 14px; }
.setrow > span { flex: 1; } .setrow small { color: var(--dim); display: block; font-size: 12px; }
.setrow input[type=range] { width: min(200px, 45vw); accent-color: #8247e5; }
.setrow output { min-width: 3ch; text-align: right; color: var(--dim); font-size: 12.5px; }
.setrow button, .menuact { background: #2a1a4c; border: 1px solid var(--edge); border-radius: 8px; padding: 5px 12px; font: 600 12.5px Cinzel, serif; color: var(--ink); }
.setrow button.on { background: var(--violet); color: #fff; }
.menuact { display: block; width: 100%; margin-top: 8px; padding: 9px 12px; font-size: 14px; border-color: var(--gold); color: var(--gold); }
.menuact:disabled { opacity: .45; }
.keylist { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 14px; margin: 4px 0; }
.keylist kbd { font: 600 12px sans-serif; color: var(--gold); white-space: nowrap; }
@media (max-width: 600px) { .gamemenu { top: 40px; } }

/* ---- skill milestones (2026-10-21) */
.snd.newskill { color: #1a0f2e; background: var(--gold); border-color: var(--gold); animation: glowpulse 1.6s ease-in-out infinite; }
@keyframes glowpulse { 50% { box-shadow: 0 0 12px rgba(242,199,92,.8); } }
/* unspent skill choices (2026-11-05): a count badge on the Skills and Menu buttons and the Skill Book menu item; a star on hero cards */
.skbadge { display: inline-block; min-width: 16px; height: 16px; margin-left: 4px; padding: 0 4px; border-radius: 8px; background: #e0463c; color: #fff; font: 700 11px/16px system-ui, sans-serif; text-align: center; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
#btnMenu { position: relative; } #btnMenu .skbadge { position: absolute; top: -6px; right: -6px; margin: 0; }
.pc.skillpend { position: relative; } .pc.skillpend::before { content: '\2605'; position: absolute; top: -4px; right: 2px; color: var(--gold); font-size: 13px; text-shadow: 0 0 4px rgba(0,0,0,.8); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .snd.newskill { animation: none; box-shadow: 0 0 8px rgba(242,199,92,.7); } }
.skillhero { padding: 6px 0 8px; border-top: 1px solid var(--edge); }
.skillhead { display: flex; align-items: center; gap: 8px; } .skillhead canvas { width: 30px; height: 26px; image-rendering: pixelated; } .skillhead small { color: var(--dim); }
.skillpick { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.skillopt { text-align: left; background: #2a1a4c; border: 1px solid var(--violet2); border-radius: 10px; padding: 8px 10px; color: var(--ink); display: grid; gap: 3px; }
.skillopt:hover { border-color: var(--gold); } .skillopt b { font: 600 13.5px Cinzel, serif; color: var(--gold); } .skillopt small { color: var(--violet2); font-size: 11.5px; } .skillopt span { font-size: 12.5px; color: var(--dim); }
.skilllist { margin: 0; padding-left: 16px; font-size: 13px; } .skilllist li { margin: 2px 0; } .skilllist small { color: var(--violet2); }

/* ---- the paper doll (2026-10-21): one hero at a time, eleven places laid out like the body */
.dolltabs { display: flex; gap: 6px; margin-bottom: 6px; }
.dolltab { display: flex; align-items: center; gap: 5px; background: #2a1a4c; border: 1px solid var(--edge); border-radius: 999px; padding: 3px 10px 3px 4px; font: 600 12px Cinzel, serif; color: var(--dim); }
.dolltab canvas { width: 24px; height: 20px; image-rendering: pixelated; } .dolltab.on { color: var(--gold); border-color: var(--gold); }
.dollwrap { display: flex; gap: 12px; align-items: flex-start; background: rgba(42, 26, 76, .45); border: 1px solid var(--edge); border-radius: 10px; padding: 8px; }
.doll { display: grid; grid-template-columns: repeat(3, 48px); grid-auto-rows: 48px; gap: 6px; flex: 0 0 auto; }
.doll .eqslot { width: 48px; height: 48px; padding: 0; cursor: pointer; color: var(--ink); }
.doll .eqslot.sel { box-shadow: 0 0 0 2px var(--gold); }
.doll .eqslot.pos-body, .doll .eqslot.pos-head { background: #1b1033; }
.dollface { width: 48px; height: 40px; image-rendering: pixelated; align-self: center; opacity: .9; }
.dollstats { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; } .dollstats b { font: 600 14px Cinzel, serif; color: var(--gold); } .dollstats small { color: var(--dim); margin-bottom: 4px; }
@media (max-width: 600px) { .doll { grid-template-columns: repeat(3, 52px); grid-auto-rows: 52px; } .doll .eqslot { width: 52px; height: 52px; } .dollwrap { flex-wrap: wrap; } }

.msg small.reduced { color: #ff9a6b; }

/* ---- sockets (2026-10-21): marks on gear, filled in the gem's colour */
.invcell i.so, .eqslot i.so { position: absolute; left: 3px; bottom: 2px; display: flex; gap: 2px; }
.eqslot { position: relative; }
i.so b { width: 6px; height: 6px; border-radius: 50%; border: 1px solid #e6e0f2; display: block; }
.invacts .gembtn { background: #1d2a4c; border-color: #4fa3ff; }

/* ---- wear (2026-10-21) */
.doll .eqslot.low { border-color: #ff9a6b; box-shadow: inset 0 0 0 1px #ff9a6b; }
.doll .eqslot.broken img { opacity: .35; filter: grayscale(1); }
.doll .eqslot.broken { border-color: #e5485f; }
i.brk { position: absolute; left: 0; right: 0; bottom: 1px; font: 600 8px Cinzel, serif; color: #ff6b7f; text-align: center; font-style: normal; }
small.low { color: #ff9a6b; } small.broken { color: #ff6b7f; }

/* ---- the Characters hub and the Quest Log (2026-10-21) */
#hubTabs { margin-top: 0; }
.dolltab.pend { box-shadow: 0 0 0 2px var(--gold); }
.sheet { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; margin: 4px 0 6px; } .sheet span { color: var(--dim); }
.questlog .qcard { background: rgba(42, 26, 76, .45); border: 1px solid var(--edge); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.qcard .qhead { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; } .qcard .qhead b { font: 600 14px Cinzel, serif; color: var(--gold); } .qcard .qhead small { color: var(--violet2); }
.qcard .qobj { margin: 6px 0 2px; font-size: 14px; } .qcard .qhint { margin: 2px 0; font-size: 12.5px; color: var(--dim); font-style: italic; } .qcard .qprog { color: var(--dim); font-size: 12px; }
.qcard details, .questlog details.qdone { margin-top: 4px; font-size: 13px; } .questlog summary { cursor: pointer; color: var(--violet2); font: 600 12px Cinzel, serif; }
.qcard details p { margin: 4px 0; line-height: 1.4; } .qcard.done { opacity: .85; }

/* ---- the shop list (2026-10-21): grouped by type, a row per item */
#shopTabs { margin: 4px 0 2px; }
.shopgroup { border-bottom: 1px solid rgba(91, 63, 160, .35); padding-bottom: 2px; }
.shoprow { align-items: flex-start; } .shoprow img { width: 24px; height: 24px; image-rendering: pixelated; flex: 0 0 auto; }
.shoprow .nm small { display: block; color: var(--dim); font-size: 12px; } .shoprow .nm small.fit { display: block; } .shoprow .nm small.junkmark { color: #ff9a6b; }
.shoprow .price { font: 600 12.5px Cinzel, serif; color: var(--gold); white-space: nowrap; padding-top: 2px; }

/* ---- the dungeon floor (2026-10-21), beside the dungeon's name */
.floortag { margin-left: 8px; color: var(--gold); font: 600 12px Cinzel, serif; letter-spacing: .03em; white-space: nowrap; }
.floortag::before { content: '·'; margin-right: 8px; color: var(--dim); }
@media (max-width: 600px) { .floortag { font-size: 11px; margin-left: 6px; } .floortag::before { margin-right: 6px; } .floortag:not([hidden]) ~ #presence { display: none; } } /* phones: the floor matters more than the online count */

/* ---- the top bar on narrow and short screens (2026-10-21): icon buttons with 40 px tap targets; sound, Passes, the clock and the
   shards fold into the Menu (its first row). Labels show on wide screens. */
.hb .ico { display: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hb.newskill .ico { fill: currentColor; stroke: none; }
.menuquick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 4px 0 8px; font: 600 13px Cinzel, serif; color: var(--dim); }
.menuquick .gold { color: var(--gold); } .menuquick .shards { color: var(--violet2); }
.menuquick button { background: #2a1a4c; border: 1px solid var(--edge); border-radius: 8px; padding: 6px 12px; font: 600 12.5px Cinzel, serif; color: var(--ink); min-height: 40px; }
/* wide screens: one row, the place box gives way (ellipsis) before the buttons wrap */
.stats { flex-wrap: nowrap; white-space: nowrap; align-items: center; }
.place { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1000px), (max-height: 500px) {
  .hud.top { align-items: flex-start; }
  .place { min-width: 0; flex: 1 1 auto; max-width: 52%; white-space: normal; line-height: 1.25; }
  .place #place { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .place .floortag { display: block; margin-left: 0; } .place .floortag::before { content: none; }
  .place small { display: none; }
  .stats { flex: 0 0 auto; gap: 4px; align-items: center; padding: 2px 4px; flex-wrap: nowrap; }
  .stats .fold { display: none; }
  .stats .hb { min-width: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; border-radius: 10px; }
  .stats .hb .ico { display: block; } .stats .hb .lbl { display: none; }
  .stats .gold { font-size: 11px; padding: 0 4px; white-space: nowrap; }
}
@media (max-width: 600px) { .partybar { top: 56px; } } /* phones: the party strip sits under the taller top bar */
@media (max-width: 600px) { #automap, #compass { bottom: 56px; } } /* phones: the dungeon map sits above the Chat button */
@media (max-width: 440px) { .stats .gold { display: none; } .place { max-width: none; } } /* small phones: gold moves into the Menu so the place and floor read in full */
@media (max-width: 1000px) and (min-width: 601px), (max-height: 500px) and (min-width: 601px) { #automap, #compass { top: 62px; } } /* the map and compass sit under the taller top bar */

/* ---- the beginner tutorial card (2026-10-22): top centre, under the top bar, never blocking the world */
.tutorial { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); width: min(460px, calc(100% - 24px)); z-index: 7; background: var(--panel); border: 1px solid var(--gold); border-radius: 12px; padding: 8px 12px; box-shadow: 0 8px 30px rgba(0,0,0,.6); font-size: 14px; }
.tutorial .tuthead { display: flex; justify-content: space-between; align-items: baseline; } .tutorial .tuthead b { font: 600 14px Cinzel, serif; color: var(--gold); } .tutorial .tuthead small { color: var(--dim); }
.tutorial p { margin: 4px 0 6px; line-height: 1.4; }
.tutacts { display: flex; flex-wrap: wrap; gap: 6px; } .tutacts button { min-height: 40px; background: var(--violet); border: 0; border-radius: 8px; padding: 6px 12px; font: 600 12.5px Cinzel, serif; color: #fff; }
.tutacts button.ghost { background: transparent; border: 1px solid var(--edge); color: var(--dim); }
.tutorial { pointer-events: none; } .tutorial button { pointer-events: auto; } /* taps on the text reach the world under it */
@media (max-width: 600px) { .tutorial { top: auto; bottom: 230px; padding: 6px 10px; font-size: 12.5px; } .tutorial p { margin: 2px 0 4px; } .tutacts button { min-height: 40px; padding: 4px 10px; } } /* phones: low, above the pad, so the hero and the street ahead stay in view */

/* ---- what changed after a level-up (2026-10-22) */
.lvcard { background: rgba(42, 26, 76, .45); border: 1px solid var(--edge); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.lvhead { display: flex; justify-content: space-between; align-items: baseline; } .lvhead b { font: 600 14px Cinzel, serif; color: var(--gold); } .lvhead span { color: var(--violet2); font: 600 12.5px Cinzel, serif; }
.lvcard ul { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 2px; font-size: 13.5px; }
.lvcard li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; } .lvcard li small { color: var(--dim); font-size: 12px; }
.lvnote { margin: 4px 0; font-size: 12.5px; color: var(--dim); }

/* ---- the combat log in the chat (2026-10-22): its own tag and colour, smaller, hidden with the setting */
.chatlog .combat { color: #d7caf7; font-size: 12px; background: rgba(30, 10, 40, .5); }
.chatlog .combat .tag { color: #ff9a6b; font: 600 10.5px Cinzel, serif; margin-right: 5px; letter-spacing: .03em; }
.chatlog.nocombat .combat { display: none; }
.chatform .chatcombat { opacity: .55; font-size: 11px; } .chatform .chatcombat.on { opacity: 1; }

/* ---- the start screen (2026-10-22): the name, one button, Settings */
.title .textlink { display: block; margin-top: 8px; color: var(--violet2); font-size: 13px; }
#menuBody .signinbtn { margin: 6px 0 10px; }

/* ---- escape the dungeon (2026-10-22): a small button under the top bar, left */
.escbtn { position: absolute; left: 12px; top: 52px; z-index: 4; background: rgba(30,18,56,.85); border: 1px solid var(--edge); color: var(--ink); border-radius: 8px; padding: 6px 12px; font: 600 12.5px Cinzel, serif; min-height: 36px; }
@media (max-width: 600px) { .escbtn { top: 104px; left: 8px; } }

/* ---- the roster (2026-10-22) */
.roster .rostercard { display: grid; grid-template-columns: 30px 1fr; grid-template-areas: 'face name' 'face note' 'act act'; gap: 0 8px; align-items: center; background: rgba(42, 26, 76, .4); border: 1px solid var(--edge); border-radius: 10px; padding: 6px 8px; margin: 4px 0; }
.roster .rostercard canvas { grid-area: face; width: 26px; height: 22px; image-rendering: pixelated; }
.roster .rostercard b { grid-area: name; font: 600 13.5px Cinzel, serif; color: var(--gold); } .roster .rostercard small { grid-area: note; color: var(--dim); }
.roster .rostercard button { grid-area: act; margin-top: 6px; justify-self: start; }
.roster .rostercard.on { border-color: var(--gold); } .roster .rostercard.locked { opacity: .5; filter: grayscale(.7); }
.bacts button.flee { background: #3b1830; border-color: #8a4a6a; }
/* the Skill Book (2026-10-23) */
.sknums { display: block; font-style: normal; font-size: 12px; color: #ffd98a; margin-top: 2px; }
.skillms { margin: 8px 0; }
.skillms > b { display: block; font: 600 13px Cinzel, serif; margin-bottom: 4px; }
.skillopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.skillmini { padding: 6px 8px; border: 1px solid var(--edge); border-radius: 8px; background: #22163d; font-size: 12px; }
.skillmini b { display: block; font-size: 13px; } .skillmini small { display: block; color: var(--dim); } .skillmini span { display: block; }
.skillmini.picked { border-color: #e8c46a; background: #34264f; }
.skillmini.other, .skillms.future .skillmini { opacity: .55; }
.skillms.future > b { color: var(--dim); }
.signinnote { display: block; max-width: 340px; margin: 6px auto 0; font-size: 12px; color: var(--dim); line-height: 1.35; text-align: center; }

/* onboarding (2026-10-23): the start screen intro, How to play, control labels, first-time hints, the online count */
.title .intro { max-width: 420px; margin: 4px auto 14px; padding: 0 16px; text-align: center; font-size: 14px; line-height: 1.45; color: var(--ink); }
.titlebtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.howto #howtoBody h3 { font: 600 14px Cinzel, serif; color: var(--gold); margin: 12px 0 4px; } .howto #howtoBody p { margin: 4px 0; font-size: 14px; line-height: 1.45; }
.dpad3d button { position: relative; padding-bottom: 10px; } .dpad3d button::after { content: attr(data-lbl); position: absolute; left: 0; right: 0; bottom: 2px; font: 600 9px Cinzel, serif; color: var(--dim); letter-spacing: .03em; }
.pad .padlbl { grid-area: 2 / 2; align-self: center; justify-self: center; font: 600 10px Cinzel, serif; color: var(--dim); pointer-events: none; }
.chathead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 2px 4px 4px; font-size: 12px; } .chathead span { color: var(--gold); font-weight: 600; } .chathead small { color: var(--dim); }
.hint { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 40; width: min(420px, calc(100% - 32px)); background: #241640; border: 1px solid var(--gold); border-radius: 12px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0,0,0,.5); font-size: 14px; line-height: 1.45; }
.hint b { color: var(--gold); font-family: Cinzel, serif; } .hint button { margin-top: 8px; }

/* panels and accessibility (2026-10-23, group E) */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.keybind { display: grid; gap: 4px; } .kbrow { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; }
.kbrow kbd { min-width: 64px; text-align: center; padding: 2px 6px; border: 1px solid var(--edge); border-radius: 6px; font: 600 12px Spectral, serif; color: var(--gold); }
.kbrow button, #keysReset { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--edge); background: #2a1a4c; } #keysReset { margin-top: 8px; }
/* text size: windows, menus, chat, battle menu, talk, messages scale; widths shrink so they still fit the screen */
body.text-1 :is(.panel, .talk, .chat, .msg, .hint, .bmenu, .toast, .tutorial, .hud, .partybar) { zoom: 1.15; }
body.text-2 :is(.panel, .talk, .chat, .msg, .hint, .bmenu, .toast, .tutorial, .hud, .partybar) { zoom: 1.3; }
body.text-1 .panel { max-width: calc((100% - 24px) / 1.15); max-height: calc((100% - 64px) / 1.15); } body.text-2 .panel { max-width: calc((100% - 24px) / 1.3); max-height: calc((100% - 64px) / 1.3); }
/* high contrast */
body.hc { --ink: #ffffff; --dim: #e8e8e8; --violet2: #e2d2ff; --edge: #ffffff; --panel: #000000; }
body.hc :is(.panel, .talk, .chat, .msg, .hint, .bmenu, .hud, .partybar) { background: #000 !important; border-color: #fff !important; }
body.hc button { border-color: #fff !important; }
body.hc .skillmini.other, body.hc .skillms.future .skillmini { opacity: .8; }
/* big touch targets on touch screens: at least 44 px to press */
@media (pointer: coarse) {
  button, .signinbtn, a.textlink { min-height: 44px; min-width: 44px; }
  .abtn.small { width: 56px; height: 44px; }
  .chips button, .invtab, .dolltab, #menuTabs button, #hubTabs button, .kbrow button { min-height: 44px; }
}
/* the public pages (2026-10-23, group G) */
body.site { overflow: auto; user-select: text; -webkit-user-select: text; }
.sitehead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--edge); background: #120a22; }
.sitehead .brand { font: 800 18px Cinzel, serif; color: var(--gold); text-decoration: none; margin-right: auto; }
.sitehead nav { display: flex; flex-wrap: wrap; gap: 4px 12px; } .sitehead nav a { color: var(--violet2); text-decoration: none; font: 600 13px Cinzel, serif; padding: 6px 0; } .sitehead nav a[aria-current] { color: var(--gold); }
.sitepage { max-width: 720px; margin: 24px auto 40px; padding: 0 16px; line-height: 1.55; } .sitepage h1 { font: 800 26px Cinzel, serif; color: var(--gold); } .sitepage h2 { font: 600 17px Cinzel, serif; color: var(--violet2); margin: 22px 0 6px; }
.sitepage .date { color: var(--dim); font-size: 13px; margin-top: -4px; } .sitepage ul { padding-left: 20px; } .sitepage .hero { border-top: 1px solid var(--edge); }
.sitepage a.play, .sitefoot a.play { display: inline-block; background: var(--violet); color: #fff; border-radius: 10px; padding: 10px 20px; font: 700 15px Cinzel, serif; text-decoration: none; }
.sitefoot { text-align: center; padding: 20px 16px 32px; border-top: 1px solid var(--edge); } .sitefoot p a { color: var(--violet2); }
.titlefoot { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 12px; padding: 0 16px; font: 600 12px Cinzel, serif; }
.titlefoot a { color: var(--dim); text-decoration: none; padding: 4px 0; } .titlefoot a:hover { color: var(--gold); }
@media (pointer: coarse) { .titlefoot a, .sitehead nav a { min-height: 44px; display: inline-flex; align-items: center; } }
/* the shard tracker in the Quest Log (2026-10-23) */
.shardtrack { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 10px; align-items: center; } .shardtrack > b { width: 100%; font: 600 12px Cinzel, serif; color: var(--violet2); text-transform: uppercase; letter-spacing: .06em; }
.shardtrack .sh { flex: 1 1 22%; min-width: 72px; text-align: center; padding: 4px 2px; border: 1px solid var(--edge); border-radius: 8px; font: 600 11px Cinzel, serif; color: var(--dim); }
.shardtrack .sh small { display: block; font: 400 10px Spectral, serif; } .shardtrack .sh.carried { border-color: #b48cff; color: #e2d2ff; } .shardtrack .sh.restored { border-color: var(--gold); color: var(--gold); background: rgba(242,199,92,.08); }
/* bundle fixes (2026-10-23): no tutorial or tip card over an open window; settings rows stack when narrow or with large text */
body.winopen #tutorial, body.winopen #hint { visibility: hidden; }
.setrow { flex-wrap: wrap; } .setrow > span { min-width: 160px; } .setrow > button { flex: 0 0 auto; }
@media (max-width: 480px) { .setrow > span { flex: 1 1 100%; } }
body.text-1 .setrow > span, body.text-2 .setrow > span { flex: 1 1 100%; }
.panel * { max-width: 100%; } .panel { overflow-x: hidden; } .kbrow { grid-template-columns: minmax(0, 1fr) auto auto; } .kbrow > span { overflow-wrap: anywhere; }
/* tab rows wrap so every hero, section and menu tab stays on screen at 360/390 wide with large text (2026-10-23) */
.dolltabs, #hubTabs, #menuTabs, .tabs, .invtabs, .menuquick { flex-wrap: wrap; } .dolltab { min-width: 0; } .dolltab span { overflow-wrap: anywhere; }
.keylist { grid-template-columns: minmax(0, auto) minmax(0, 1fr); } .keylist kbd { white-space: normal; overflow-wrap: anywhere; } .keylist span { overflow-wrap: anywhere; min-width: 0; }
.kbrow kbd { min-width: 44px; } .panel table { max-width: 100%; }
.dollwrap { min-width: 0; flex-wrap: wrap; } body.text-1 .doll, body.text-2 .doll { grid-template-columns: repeat(3, 44px); grid-auto-rows: 44px; gap: 5px; } body.text-1 .doll .eqslot, body.text-2 .doll .eqslot { width: 44px; height: 44px; } body.text-2 .dollwrap { padding: 6px; gap: 8px; }
.paneltip { margin: 2px 0 8px; padding: 8px 10px; border: 1px solid var(--gold); border-radius: 10px; background: rgba(242,199,92,.08); font-size: 13.5px; line-height: 1.45; } .paneltip b { color: var(--gold); font-family: Cinzel, serif; } .paneltip button { display: block; margin-top: 6px; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--edge); background: #2a1a4c; }
.talk-text .accepted { display: block; margin-top: 6px; color: var(--gold); font-weight: 600; } .choices button.questchoice { border-color: var(--gold); } .choices .qmark { color: var(--gold); }
/* the town map and the dungeon map legend (2026-10-23) */
.townmapwrap { overflow: auto; max-height: 60vh; border: 1px solid var(--edge); border-radius: 8px; background: #120a22; } .townmap { display: block; image-rendering: pixelated; max-width: 100%; height: auto; }
.maplegend, .mapplaces { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--dim); }
.maplegend i, .mapplaces i, .amlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; border: 1px solid #120a22; } .maplegend i.sq { border-radius: 2px; }
.amhint { position: absolute; right: 12px; top: 180px; width: 128px; text-align: center; font: 600 11px Cinzel, serif; color: var(--dim); pointer-events: none; }
.amlegend { position: absolute; right: 12px; top: 310px; width: 256px; display: flex; flex-wrap: wrap; gap: 3px 10px; padding: 6px 8px; background: rgba(10,6,20,.85); border: 1px solid var(--edge); border-radius: 8px; font-size: 11.5px; color: var(--ink); z-index: 5; }
.amlegend i { border-radius: 2px; } .amlegend i.you { background: #e3d0ff; clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; } .amlegend i.ring { background: transparent; border: 2px solid #7fe0ff; border-radius: 50%; } .amlegend i.dot { background: #ff5470; border-radius: 50%; }
@media (max-width: 600px) { .amhint { top: auto; bottom: 118px; left: 12px; right: auto; width: 104px; } .amlegend { top: auto; bottom: 220px; left: 12px; right: auto; width: min(320px, calc(100% - 24px)); } }
/* the empty-bag line spans the whole bag; settings option buttons wrap at 360 px (2026-10-23, playtest bot) */
.invgrid > .say { grid-column: 1 / -1; } .setrow > button { white-space: nowrap; } @media (max-width: 400px) { .setrow { gap: 6px; } .setrow > button { padding: 5px 9px; } }
/* skill ranks (2026-10-30): the points line and the Rank up button in the Skill Book */
.skillpts { font-size: 12.5px; color: var(--dim); margin: 4px 0 8px; } .skillpts.free { color: #ffd98a; }
.rankup { display: inline-block; margin: 4px 0 2px 8px; padding: 3px 9px; font: 600 12px Cinzel, serif; color: var(--gold); background: #2a1a4c; border: 1px solid var(--gold); border-radius: 8px; cursor: pointer; }
.rankup:hover { background: #34264f; }
/* the low-health flash (Dallas 2026-11-05): a dull red wash over a hero's portrait, slow at 25% HP or less, fast at 10% or less
   (shared/party.js lowHealth); a steady tint for players who ask for less motion. The sprites get the same wash in game.js lowTint. */
.pc.lowhp { position: relative; }
.pc.lowhp::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(150, 36, 36, .42); box-shadow: inset 0 0 0 1px rgba(170, 50, 50, .7); pointer-events: none; animation: sov-lowhp 1.6s ease-in-out infinite; }
.pc.lowhp-fast::after { animation-duration: .5s; }
@keyframes sov-lowhp { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pc.lowhp::after { animation: none; opacity: .75; } }
/* the chat log toggle (Dallas 2026-11-05): the Log button on the chat hides or shows the lines (saved with the character); while
   hidden it counts new lines, gold when a system line is among them */
.chathead .chatlogbtn { pointer-events: auto; background: transparent; border: 1px solid var(--edge); border-radius: 999px; padding: 0 8px; font: 600 11px Cinzel, serif; color: var(--violet2); cursor: pointer; }
.chathead .chatlogbtn .badge { display: inline-block; min-width: 14px; margin-left: 4px; padding: 0 4px; border-radius: 999px; background: var(--violet); color: #fff; font: 600 10px system-ui, sans-serif; text-align: center; }
.chathead .chatlogbtn .badge.sys { background: var(--gold); color: #1a0f2e; }
.chat.logoff .chatlog { display: none; }
.chattoggle .badge { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 999px; background: var(--gold); color: #1a0f2e; font: 600 10px system-ui, sans-serif; }
.chathead .chatlogbtn .badge[hidden], .chattoggle .badge[hidden] { display: none; }
/* who is online, on hover or tap (Dallas 2026-11-10) */
#chatOnline.whohover, #presence.whohover { pointer-events: auto; cursor: help; } #chatOnline.whohover:focus-visible, #presence.whohover:focus-visible { outline: 1px dotted var(--gold); }
.tip.wholist { max-height: 70vh; overflow: hidden; } .tip .whonames { margin-top: 2px; } .tip .whonames.cols { columns: 2; column-gap: 14px; } .tip .whonames div { break-inside: avoid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* who can use a piece, in the shop row itself (Dallas 2026-11-10) */
.shoprow .nm small.fit { margin-top: 2px; } .shoprow .nm small.fit .hero { display: inline-block; font-style: normal; font-size: 11.5px; border: 1px solid var(--edge); border-radius: 999px; padding: 0 7px; margin: 2px 3px 0 0; white-space: nowrap; }
.shoprow .nm small.fit .hero.up { border-color: #62d68a; background: rgba(98, 214, 138, .12); font-weight: 600; } .shoprow .nm small.fit .hero.down { border-color: rgba(255, 107, 127, .6); }
.msg .board { text-align: left; max-height: 55vh; overflow: auto; margin-top: 8px; font-size: 14px; line-height: 1.4; } /* a town notice board (2026-11-16) */
/* a room at the inn (2026-11-16) */
.roomwall { background-size: cover; background-position: center; border-radius: 10px; padding: 8px 10px 12px; }
.roomwall h4 { margin: 10px 0 4px; font: 600 14px Cinzel, serif; color: var(--gold); }
.roomwall .heads, .roomwall .shelf { display: flex; flex-wrap: wrap; gap: 6px; }
.roomwall .head, .roomwall .keep { width: 70px; text-align: center; font-size: 11px; line-height: 1.2; }
.roomwall .head canvas { width: 48px; height: 48px; image-rendering: pixelated; display: block; margin: 0 auto 2px; background: rgba(90,60,30,.55); border: 2px solid #6b4a2a; border-radius: 50%; }
.roomwall .head.boss canvas { border-color: var(--gold); }
.roomwall .keep img { width: 32px; height: 32px; image-rendering: pixelated; display: block; margin: 0 auto 2px; }
.roomwall .plaque, .roomwall .shards { font-size: 13px; color: var(--gold); }
/* Continue my hero (2026-11-19, Dallas): a returning player who is not signed in here gets back to the saved hero through
   InstantAdPay's one-tap hand-off. Primary (first, filled) when this browser had a hero; a quiet outline button otherwise. */
.title a.continuebtn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; background: transparent; border: 1px solid var(--edge); border-radius: 10px; padding: 9px 22px; font: 700 14px Cinzel, serif; color: var(--ink); text-decoration: none; }
.title a.continuebtn.primary { order: -1; background: var(--violet); border-color: var(--violet); color: #fff; }
.title .start button.ghost { color: var(--ink); }
.invcell i.nw { right: 2px; bottom: 2px; text-shadow: none; font: 700 9px/1 system-ui, sans-serif; font-style: normal; background: #62d68a; color: #0b1a10; border-radius: 4px; padding: 1px 3px; pointer-events: none; } /* New gear (2026-11-19) */
.panel.howto { z-index: 12; } /* How to play opens over the start screen too (Dallas 2026-11-19: the button did nothing: the panel was under the title, z-index 6 < 10) */
