/* ─────────────────────────────────────────────────────────────────────────────
   테일즈테일즈 — the HUD: a fixed handheld-style frame.

   ┌──────────────────────────────┬────────┐
   │                              │ map    │
   │      the world (viewport)    │ quests │
   │                              │ bag    │
   ├───────────┬──────────────────┤        │
   │ chat      │ bars · gauge     │ menu   │
   │           │ skills · exp     │        │
   └───────────┴──────────────────┴────────┘

   Frames are pixel 9-slices drawn by frames.js (--fr-brass, --fr-screen,
   --fr-plate): hard edges, flat colours, no blur and no drop shadows. The
   type is Galmuri, a Korean pixel font, at the sizes it was drawn for.
   client.js sets --vpw / --vph (the viewport) and body[data-lay]:
   "full" (desktop), "port" (phone upright) or "land" (phone on its side).
   ───────────────────────────────────────────────────────────────────────────── */
@font-face { font-family: "Galmuri11"; src: url("fonts/Galmuri11.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Galmuri11"; font-weight: 700; src: url("fonts/Galmuri11-Bold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Galmuri9"; src: url("fonts/Galmuri9.woff2") format("woff2"); font-display: swap; }

:root {
  --t9: 9px; --t10: 10px; --t11: 11px; --t12: 12px;   /* text size (keymap.js): body[data-ts] swaps these integer steps */
  --pix: "Galmuri11", var(--font);
  --pix9: "Galmuri9", "Galmuri11", var(--font);
  --side: 288px;
  --dock: 184px;
  --vpw: 100vw;
  --vph: 100vh;
  --face: #211c2a;
  --scr: #120f18;
  --cream: #f3e8cc;
  --b-hi: #f4dfa4; --b-mid: #cf9f55; --b-lo: #7c5326;
  --hp: #d8434c; --hp-hi: #ff8a86; --hp-lo: #7c1c26;
  --mp: #3f70d8; --mp-hi: #8ab4ff; --mp-lo: #1c3474;
}

/* the world and its text live in the viewport only */
body.playing #world, body.playing #text { left: 0; top: 0; }
body.playing #crt, body.playing #crt-frame { right: auto; bottom: auto; width: var(--vpw); height: var(--vph); }

/* ── the kit ── */
.gba { border: calc(14px * var(--fs, 1)) solid transparent; border-image: var(--fr-brass) 14 fill / calc(14px * var(--fs, 1)) / 0 stretch; image-rendering: pixelated; }
.sunk { border: calc(4px * var(--fs, 1)) solid transparent; border-image: var(--fr-screen) 4 fill / calc(4px * var(--fs, 1)) / 0 stretch; image-rendering: pixelated; }
.plate { border: calc(4px * var(--fs, 1)) solid transparent; border-image: var(--fr-plate) 4 fill / calc(4px * var(--fs, 1)) / 0 stretch; color: #2a1806; }
#hud { font-family: var(--pix); font-size: var(--t12); line-height: 1.4; letter-spacing: 0; }
#hud kbd { font: var(--t10)/1 var(--pix9); }
#hud > * { position: fixed; z-index: 5; }

/* chunky raised buttons inside the frame */
#hud .btn, .gbtn {
  font: var(--t12)/1 var(--pix); padding: 4px 8px; color: var(--cream); border-radius: 0;
  background: var(--sf4, #3a3146); border: 2px solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--sf5, #5b4d6c), inset -2px -2px 0 var(--sf2, #1f1a28);
}
#hud .btn:hover, .gbtn:hover { background: var(--sf4h, #463b55); color: var(--tx, #fff6dc); box-shadow: inset 2px 2px 0 var(--sf5, #6c5d80), inset -2px -2px 0 var(--sf2, #1f1a28); }
#hud .btn:active, .gbtn:active { transform: translate(1px, 1px); box-shadow: inset 2px 2px 0 var(--sf2, #1f1a28), inset -2px -2px 0 var(--sf4h, #463b55); }
#hud .btn.gold { color: #2a1806; background: var(--b-mid); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
#hud .btn.gold:hover { background: #dcae62; }
#hud .btn.small { padding: 3px 6px; font-size: var(--t12); }

/* bars: an outline, a three-row fill (highlight, base, shade), a pale trail behind health */
.bar { position: relative; height: 12px; margin-top: 4px; overflow: hidden; padding: 0; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .12s linear; }
.bar i.trail { background: rgba(255, 236, 200, .55); transition: width .5s ease-in .35s; }
.bar b { position: absolute; inset: 0; text-align: center; font: var(--t10)/11px var(--pix9); color: #fff;
  text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
.bar.hp i:not(.trail) { background: linear-gradient(var(--hp-hi) 0 2px, var(--hp) 2px 8px, var(--hp-lo) 8px); }
.bar.mp i { background: linear-gradient(var(--mp-hi) 0 2px, var(--mp) 2px 8px, var(--mp-lo) 8px); }

/* ── the viewport's own frame: a thin dark lip over the world's edge ── */
#vp-frame { left: 0; top: 0; width: var(--vpw); height: var(--vph); pointer-events: none; z-index: 4;
  box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 3px var(--sf4, #4a3a24); }

/* ─────────────────────────── the side column ─────────────────────────── */
#side { right: 0; top: 0; bottom: 0; width: var(--side); display: flex; flex-direction: column; gap: 6px; padding: 0; overflow: hidden; }
#mini { flex: none; display: flex; flex-direction: column; gap: 3px; }
#mini-name { font: 700 var(--t12)/1.2 var(--pix); text-align: center; padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mini .sunk { height: clamp(96px, 20vh, 196px); background: #000; display: flex; }
#mini-cv { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; display: block; }
#mini-info { font: var(--t10)/1.2 var(--pix9); color: var(--tx2, #b8ac90); text-align: center; }

#quest-track { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 6px 4px; font-size: var(--t12); line-height: 1.4; cursor: pointer; scrollbar-width: thin; scrollbar-color: var(--b-lo) transparent; }
#quest-track:empty::before { content: "진행 중인 의뢰가 없습니다"; color: var(--tx3, #6f6680); font-size: var(--t12); }
#quest-track .qh { display: flex; align-items: center; gap: 5px; color: var(--tx-hd, var(--b-hi)); font-weight: 700; padding-bottom: 2px; margin-bottom: 2px; border-bottom: 2px solid var(--sf3, #2c2537); }
#quest-track .qt { margin-top: 3px; color: var(--cream); }
#quest-track .qt small { color: var(--tx-hd2, var(--b-mid)); margin-right: 4px; font: var(--t10) var(--pix9); }
#quest-track .qp { display: flex; align-items: center; gap: 6px; color: var(--tx2, #d8cfb8); font-size: var(--t12); }
#quest-track .qp .bar { flex: 1; height: 6px; margin: 0; background: #000; border: 1px solid #000; }
#quest-track .qp .bar i { background: linear-gradient(#f6dc98 0 1px, #c8a04e 1px); }
#quest-track .done { color: var(--tx-ok, #9af0ae); }

/* docked windows: the bag in the phone drawer, and on a desktop whichever window the side panel shows (windows.js dockPanel) */
.window.docked { position: static; width: auto; max-width: none; max-height: none; flex: none; background: none; border: 0; box-shadow: none; pointer-events: auto; display: flex; flex-direction: column; }
.window.docked > header { height: auto; padding: 0 0 4px; gap: 6px; cursor: default; background: none; border: 0; }
.window.docked > header .t { font: 700 var(--t12)/1.2 var(--pix); letter-spacing: 0; color: #2a1806; padding: 1px 8px; }
body:not([data-lay="full"]) #w-inv.docked > header .x { display: none; }
#inv-gold { display: inline-flex; align-items: center; gap: 3px; font: 700 var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); }
#inv-count { font: var(--t10) var(--pix9); color: var(--tx3, #9a90a8); }
#inv-sort { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; }
#w-inv.docked .body { padding: 0; overflow: visible; }
#inv-grid { --slot: 40px; grid-template-columns: repeat(6, var(--slot)); gap: 2px; justify-content: center; }
#inv-grid .slot { width: var(--slot); height: var(--slot); }
#inv-grid .slot img { left: 3px; top: 3px; }
#inv-detail { margin-top: 4px; padding: 5px 7px; font-size: var(--t12); }
#inv-detail .btns { margin-top: 4px; gap: 3px; display: flex; flex-wrap: wrap; justify-content: flex-end; }
/* the primary (gold) action at the right end, the rest (sell, salvage) away from it */
#inv-detail .btns .gold { order: 1; }
#inv-detail .nm { font-size: var(--t12); }

/* the menu: a grid of plain glyph buttons */
#menu { flex: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding-top: 4px; border-top: 2px solid var(--sf3, #2c2537); }
#menu button { position: relative; height: 36px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: var(--t10)/1 var(--pix9); color: var(--tx2, #d8cfb8); background: var(--sf3-a, var(--sf3, #2a2433)); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf4, #3e344b), inset -2px -2px 0 var(--sf1, #17131d); }
#menu button img.gi { width: 12px; height: 12px; }
#menu button kbd { position: absolute; right: 1px; top: 1px; font-size: var(--t10); color: var(--tx3, #7d7290); display: none; }
#menu button:hover { color: var(--tx-hd, var(--b-hi)); background: var(--sf4, #352d40); }
#menu button.on { color: #2a1806; background: var(--b-mid); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
#menu button.on img.gi { filter: brightness(.25); }
#menu button[data-win="inv"] { display: none; }

/* ───────────────────────────── the dock ───────────────────────────── */
#dock { left: 0; bottom: 0; right: var(--side); height: var(--dock); display: flex; gap: 10px; padding: 2px 22px 2px 26px; box-sizing: border-box; }
#chat { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#chat-tabs { display: flex; gap: 2px; flex: none; }
#chat-tabs button { padding: 2px 8px; font: var(--t12)/1.2 var(--pix); color: var(--tx3, #9a90a8); background: var(--sf3-a, var(--sf3, #2a2433)); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf4, #3e344b); }
#chat-tabs button.on { color: #2a1806; background: var(--b-mid); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px 0 0 var(--b-lo); }
#chat-fold { display: none; margin-left: auto; width: 26px; }
#chat-fold::before { content: "▾"; color: var(--cream); }
body.chat-folded #chat-fold::before { content: "▴"; }
#chat-time { margin-left: auto; }
#chat-time + #chat-fold { margin-left: 0; }
#chat-log.times p::before { content: attr(data-t) " "; color: var(--tx3, #9a90a8); }
#chat-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 2px 6px; font: var(--t12)/1.34 var(--pix); scrollbar-width: thin; scrollbar-color: var(--b-lo) transparent; }
#chat-log p { margin: 0; word-break: break-all; color: var(--tx, #ece4d0); }
#chat-log p.npc { color: var(--tx2, #e8dcb0); } #chat-log p.npc .who { color: var(--tx-gold, #e2c486); } #chat-log p.party .who { color: var(--tx-info, #8fd0ff); }
#talk-more { margin-top: 8px; }
#chat-log .sys { color: var(--tx-hd, var(--b-hi)); }
#chat-log .guide { color: var(--tx-guide, #7ff0d8); }   /* the periodic <Guide> tips (guide.js): mint, apart from the system gold */
#chat-log .loot { color: var(--tx2, #b8c4d4); }
#chat-log .err { color: var(--tx-bad, #ff9a9a); }
#chat-log .guild { color: var(--tx-ok, #9af0ae); }
#chat-log .party { color: var(--tx-info, #9ad8ff); }
#chat-log .whisper { color: var(--tx-pink, #f2b0e4); cursor: pointer; } #chat-log p.whisper .who { color: var(--tx-pink, #e888d4); }
#chat-log .who { color: var(--tx-info, #9ac0e8); }
#chat-log img.emo { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -3px; margin: 0 1px; }
#chat-log[data-tab="party"] p:not(.party), #chat-log[data-tab="guild"] p:not(.guild), #chat-log[data-tab="sys"] p:not(.sys):not(.loot):not(.err) { display: none; }
#chat-form { display: flex; gap: 3px; align-items: center; flex: none; }
#chat-in { flex: 1; min-width: 0; height: 24px; padding: 2px 6px; outline: none; font: var(--t12) var(--pix); color: var(--cream); user-select: text; -webkit-user-select: text;
  background: var(--scr-a, var(--scr)); border: 2px solid var(--ink); border-radius: 0; box-shadow: inset 2px 2px 0 var(--sf0, #07060b); }
#chat-in:focus { border-color: var(--b-mid); }
#chat-emo { width: 24px; height: 24px; flex: none; padding: 0; border-radius: 0;
  background: #2a2433 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'><rect x='4' y='2' width='8' height='12' fill='%23ffd75a'/><rect x='2' y='4' width='12' height='8' fill='%23ffd75a'/><rect x='5' y='6' width='2' height='2' fill='%232b2233'/><rect x='9' y='6' width='2' height='2' fill='%232b2233'/><rect x='5' y='10' width='6' height='1' fill='%232b2233'/></svg>") center / 16px no-repeat;
  border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 #3e344b; }

/* the character, right of the chat: one short status row (portrait, name, slim bars, the potions,
   weapon mastery, the weapon gauge, buffs), the hotbar under it, experience along the bottom.
   The chat takes the rest of the dock: ~52 % at 1280, ~61 % at 1920. */
/* the centre keeps its natural width (min-width: auto = everything in it fits whole); the chat takes what is left */
#center { flex: 0 1 clamp(400px, 41%, 620px); display: flex; flex-direction: column; gap: 4px; justify-content: space-between; }
#status { display: flex; gap: 6px; align-items: center; min-height: 0; }
#status .face { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--sf3-a, var(--sf3, #2a2433)); border: 2px solid var(--ink); border-image: none; box-shadow: inset 0 0 0 1px var(--sf4, #3e344b); }
#st-face { width: 40px; height: 40px; }
/* the unit frame stays short: name and level on one line, two slim bars with snug numbers, then gold & Tales Token aligned in one column */
.st-main { flex: 0 0 184px; min-width: 184px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
#status .row { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; line-height: 1.05; }
#st-name { font: 700 var(--t12) var(--pix); color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#st-lv { flex: none; max-width: 70%; overflow: hidden; text-overflow: ellipsis; color: var(--tx-hd, var(--b-hi)); font: 700 var(--t12) var(--pix); white-space: nowrap; }
#status .meter { display: grid; grid-template-columns: 14px minmax(68px, 1fr) auto; align-items: center; gap: 5px; height: 9px; }
#status .meter em { display: flex; align-items: center; justify-content: center; width: 14px; font: var(--t10)/8px var(--pix9); font-style: normal; color: var(--hp-hi); text-shadow: 1px 1px 0 #000; }
#status .meter.mp em { color: var(--mp-hi); }
#status .meter b { min-width: 38px; font: var(--t10)/8px var(--pix9); font-weight: normal; color: var(--cream); text-align: right; white-space: nowrap; text-shadow: 1px 1px 0 #000; }
#status .bar { position: relative; height: 8px; margin: 0; background: #000; border: 1px solid var(--ink); box-shadow: none; border-radius: 0; }
#status .bar.hp i:not(.trail) { background: linear-gradient(var(--hp-hi) 0 1px, var(--hp) 1px 4px, var(--hp-lo) 4px); }
/* the job level row under the weapon mastery: same size and look as one mastery cell, in brass */
#jr { --wm: #d8aa4a; --wm-hi: #f6dc98; --wm-lo: #8a6a24; flex: 0 0 100%; max-width: 200px; display: grid; grid-template-columns: 20px 1fr; grid-template-rows: 12px 6px; gap: 2px 4px; align-items: center; cursor: help; }
#jr .wi { grid-row: 1 / 3; width: 20px; height: 20px; padding: 1px; box-sizing: border-box; image-rendering: pixelated; background: var(--scr); border: 1px solid var(--b-mid); }
#jr .wt { font: 700 var(--t12)/12px var(--pix); color: var(--wm-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 #000; }
#jr.off { opacity: .5; }
#jr.pop { animation: jb-pop .9s steps(6); }
@keyframes jb-pop { 0%, 40%, 80% { filter: brightness(2.2); } 20%, 60%, 100% { filter: none; } }
#status .bar.mp i { background: linear-gradient(var(--mp-hi) 0 1px, var(--mp) 1px 4px, var(--mp-lo) 4px); }
.st-purse { display: contents; }
#st-gold { position: relative; display: flex; align-items: center; height: 12px; font: 700 var(--t12)/12px var(--pix); color: var(--b-hi); white-space: nowrap; text-shadow: 1px 1px 0 #000; }
#st-gold-n { display: grid; grid-template-columns: 14px auto; align-items: center; gap: 5px; }
#st-gold-n img.gi { width: 12px; height: 12px; justify-self: center; }
#st-ttok { display: flex; align-items: center; height: 12px; font: 700 var(--t10)/12px var(--pix); color: var(--tx-info, #78e6ff); white-space: nowrap; cursor: help; }
#st-ttok-n { display: grid; grid-template-columns: 14px auto auto; align-items: center; gap: 5px; }
#st-ttok-n img.gi { width: 12px; height: 12px; justify-self: center; }
#st-ttok-n .tt-lb { font-style: normal; font-weight: 700; opacity: .9; }
#st-ttok-n .tt-v { font-weight: 700; }
#st-gold-fx { position: absolute; left: 0; top: 0; font: var(--t10)/12px var(--pix9); font-style: normal; color: #ffe9a8; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none; opacity: 0; }
#st-gold-fx.lose { color: var(--tx-bad, #ff9a8a); }
#st-gold-fx.go { animation: gold-pop 1.1s steps(6) forwards; }
@keyframes gold-pop { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: 1; transform: translateY(-6px); } 100% { opacity: 0; transform: translateY(-8px); } }
/* the potions beside the bars they fill (desktop; on a phone they stay on the thumb pad) */
#st-pots { flex: none; display: flex; gap: 2px; }
#st-pots:empty { display: none; }
#st-pots .act { width: 36px; height: 36px; }
#st-pots .act img { width: 32px; height: 32px; margin: 0; }
/* the side of the unit frame never gets narrower than the class gauge, so the gauge always shows whole */
.st-side { flex: 1 1 124px; min-width: 124px; display: flex; flex-wrap: wrap; gap: 3px 4px; align-items: center; align-content: center; }
/* the weapon-passive gauge floats over the field, bottom-centre above the cast bar, like a combo meter (owner) */
#cg-box { position: fixed; left: calc(var(--vpw) / 2); top: calc(var(--vph) - 130px); transform: translateX(-50%); z-index: 7; pointer-events: none; background: rgba(18, 15, 24, .82); line-height: 0; border-width: 2px; border-image-width: 2px; }
#cg-box[hidden] { display: none; }
#cgauge { width: 240px; height: 40px; image-rendering: pixelated; display: block; }
/* job identity trait gauge in unit frame (JOB-03) */
.jt-bar { display: flex; align-items: center; gap: 4px; margin-top: 2px; padding: 1px 4px; background: rgba(16, 13, 24, .75); border: 1px solid #3c344a; font: var(--t10)/12px var(--pix9); cursor: default; }
.jt-bar[hidden] { display: none; }
.jt-bar b { color: var(--jt-c, #ffd468); font-weight: normal; white-space: nowrap; text-shadow: 1px 1px 0 #000; }
.jt-bar #jt-pips { display: flex; gap: 2px; flex: 1; align-items: center; }
.jt-bar #jt-pips i { flex: 1; height: 6px; background: #262130; border: 1px solid #120e18; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.jt-bar #jt-pips i.on { background: var(--jt-c, #ffd468); box-shadow: inset 0 1px 0 var(--jt-c2, #fff); }
.jt-bar.max { border-color: var(--jt-c, #ffd468); box-shadow: 0 0 6px var(--jt-c, #ffd468); }
.jt-bar.max #jt-pips i.on { background: var(--jt-c2, #fff); }
.jt-bar em { font-style: normal; color: #ddd6c8; min-width: 20px; text-align: right; }
.jt-trait { margin: 5px 0; padding: 5px 7px; background: rgba(20, 16, 28, .65); border: 1px solid rgba(255,255,255,.12); border-left: 3px solid var(--jt-c, #ffd468); }
.jt-trait b { color: var(--jt-c, #ffd468); font-size: 11px; }
.jt-trait span { display: inline-block; margin-left: 5px; padding: 0 4px; font-size: 9px; background: rgba(255,255,255,.08); color: #efe7d6; }
.jt-trait p { margin: 3px 0 0; font-size: 10px; line-height: 1.45; color: #d8d0c0; }
#st-buffs { flex: 1 1 60px; display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; max-height: 38px; overflow: hidden; }
#st-buffs:empty { display: none; }
#st-buffs span { display: inline-flex; align-items: center; gap: 2px; padding: 0 3px; height: 18px; font: var(--t10) var(--pix9); color: var(--tx-hd, var(--b-hi)); background: var(--scr-a, var(--scr)); border: 2px solid var(--ink); }
#st-buffs span.bad { color: var(--tx-bad, #ffb0a8); border-color: #5a1c1c; }
#st-buffs span.scr { color: var(--tx-info, #bfe6ff); border-color: #1c3a5a; }
/* weapon mastery at a glance (mastery.js): the weapon in hand, "숙련 Lv.N", a thin bar to the next level;
   a hybrid job shows both weapons. Hover (tap on a phone) lists all six. */
#wm { --wm: #8fe0b4; --wm-hi: #d4ffe4; --wm-lo: #2f7a5c; position: relative; flex: 0 0 100%; display: flex; gap: 6px; min-width: 0; cursor: help; outline: none; }
#wm .wm-c { flex: 1 1 0; min-width: 0; max-width: 200px; display: grid; grid-template-columns: 20px 1fr; grid-template-rows: 12px 6px; gap: 2px 4px; align-items: center; }
#wm .wi { grid-row: 1 / 3; width: 20px; height: 20px; padding: 1px; box-sizing: border-box; image-rendering: pixelated; background: var(--scr); border: 1px solid var(--ink); }
#wm .wm-c.on .wi { border-color: var(--b-mid); }
#wm .wm-c:not(.on) { opacity: .62; }
#wm .wt { font: 700 var(--t12)/12px var(--pix); color: var(--wm-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 #000; }
#wm .wl { font: var(--t10)/12px var(--pix9); font-weight: normal; color: var(--tx2, #c9bfa8); }
#wm .wb, #jr .wb, .wm-tip .wb { position: relative; display: block; height: 6px; background: #000; border: 1px solid var(--ink); }
#wm .wb i, #jr .wb i, .wm-tip .wb i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(var(--wm-hi, #d4ffe4) 0 1px, var(--wm, #8fe0b4) 1px 3px, var(--wm-lo, #2f7a5c) 3px); }
#wm .wm-none { font: var(--t10)/20px var(--pix9); color: var(--tx3, #9a90a8); }
#wm.up .wm-c.on { animation: wm-flash .2s steps(2) 6; }
@keyframes wm-flash { 50% { filter: brightness(1.8) drop-shadow(0 0 0 #fff); } }
#wm .wm-pop { position: absolute; left: 24px; top: -16px; z-index: 3; white-space: nowrap; pointer-events: none; font: 700 var(--t12)/12px var(--pix); font-style: normal; color: #d4ffe4;
  text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; animation: wm-pop 1.6s steps(8) forwards; }
@keyframes wm-pop { 0% { opacity: 1; transform: translateY(4px); } 30% { transform: translateY(-2px); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
/* the hover card */
#tip.wm-tip { width: 232px; }
.wm-tip .wm-job { margin: 1px 0 4px; color: #c9bfa8; }
.wm-tip .wm-job b { color: var(--b-hi); }
.wm-tip .wm-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.wm-tip .wm-r { display: grid; grid-template-columns: 16px 40px 40px 1fr; gap: 5px; align-items: center; padding: 0 2px; color: #9a90a8; }
.wm-tip .wm-r .wi { width: 16px; height: 16px; image-rendering: pixelated; opacity: .6; }
.wm-tip .wm-r.on { color: var(--cream); }
.wm-tip .wm-r.on .wi { opacity: 1; }
.wm-tip .wm-r.hand { background: rgba(207, 159, 85, .16); box-shadow: inset 2px 0 0 var(--b-mid); }
.wm-tip .wm-r .wv { font-weight: 700; color: #d4ffe4; }
.wm-tip .wm-r:not(.on) .wv { color: #a8c8b4; font-weight: normal; }
.wm-tip .wm-next { color: #ffe9a8; }
.wm-tip .wm-next small, .wm-tip .wm-xp { color: #9a90a8; }
.wm-tip .hint { margin-top: 3px; color: #9a90a8; }

/* the hotbar */
#actions { display: flex; align-items: center; justify-content: center; gap: 3px; }
#actions .sep { width: 2px; height: 36px; margin: 0 3px; background: var(--sf4, #3e344b); }
.act {
  position: relative; width: 48px; height: 48px; padding: 0; overflow: hidden; flex: none; border-radius: 0;
  background: var(--scr-a, var(--scr)); border: 2px solid var(--ink); color: var(--cream); font: var(--t10) var(--pix9);
  box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2c2537);
}
.act:hover { border-color: var(--b-mid); }
.act:active, .act.down { transform: translate(1px, 1px); filter: brightness(1.3); }
.act kbd { position: absolute; left: 2px; top: 2px; color: var(--b-hi); text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
.act img { width: 32px; height: 32px; image-rendering: pixelated; display: block; margin: 6px auto 0; pointer-events: none; }
.act .n { position: absolute; right: 2px; bottom: 1px; font: var(--t10) var(--pix9); text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
.act .nm { position: absolute; left: 0; right: 0; bottom: 2px; font: var(--t10) var(--pix9); text-align: center; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none; }
/* the quick slots 1–9: empty until the player drags a skill or an item in (quickslots.js) */
#qslots { display: contents; }
#actions { --act: 38px; position: relative; gap: 1px; }
#actions .act { width: var(--act); height: var(--act); }
#actions .act img { margin-top: calc((var(--act) - 36px) / 2); }
.act.qs img.ic { width: 32px; height: 32px; }
.act.qs .mp { position: absolute; right: 2px; bottom: 1px; font: var(--t10) var(--pix9); color: var(--mp-hi); text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
.act.qs.empty { background: var(--sf1-a, var(--sf1, #1a1622)); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf2, #241e2d); }
.act.qs.empty kbd { left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; color: #4e4560; font-size: var(--t12); }
.act.qs.empty::before { content: ""; position: absolute; inset: 5px; border: 1px dashed var(--sf4, #3a3247); pointer-events: none; }
/* the cooldown: a hard-edged sweep, no soft fade */
.act.qs .cd { position: absolute; inset: 0; pointer-events: none; background: conic-gradient(rgba(6, 4, 10, .8) calc(var(--cd, 0) * 360deg), transparent 0); }
.act.qs .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 var(--t12)/1 var(--pix); font-style: normal; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none; }
.act.qs.locked img.ic { opacity: .22; }
.act.qs.locked::after { content: attr(data-lv); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: var(--t10) var(--pix9); color: var(--tx3, #9a90a8); }
.act.qs.nomp img.ic, .act.qs.none img.ic { filter: grayscale(1) brightness(.6); }
.act.qs.none .n { color: var(--tx-bad, #ff8a7a); }
.act.qs.ult { border-color: var(--rim, #6e4a1c); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2c2537), inset 0 0 0 4px rgba(207, 159, 85, .35); }
/* dragging: the slot under the pointer lights up; picking with a tap makes the whole bar glow */
.act.qs.over { border-color: var(--b-hi); filter: brightness(1.35); }
body.qs-pick .act.qs, body.qs-drag .act.qs { border-color: var(--b-mid); animation: pulse 1s steps(2) infinite; }
#qs-ghost { position: fixed; z-index: 60; width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; opacity: .85; outline: 2px solid var(--b-hi); background: rgba(18, 15, 24, .7); }
body.qs-drag, body.qs-drag * { cursor: grabbing !important; }
.qs-src img { -webkit-user-drag: none; }
/* an item dragged with the warehouse open: where it can land (quickslots.js item-drag, growth.js renderBank) */
body.item-drag #w-bank .pane, body.item-drag #w-inv #inv-grid { outline: 2px dashed var(--b-mid); outline-offset: 1px; }
body.item-drag, body.item-drag * { cursor: grabbing !important; }
#qs-hint { position: absolute; left: 50%; top: -15px; transform: translateX(-50%); padding: 0 6px; white-space: nowrap; pointer-events: none;
  font: var(--t10)/12px var(--pix9); color: var(--tx-hd, var(--b-hi)); background: var(--frame-bg, rgba(18, 15, 24, .9)); border: 1px solid var(--rim, #5a4426); animation: qs-bob 1.2s steps(2) infinite; }
#qs-hint::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -4px; border: 4px solid transparent; border-bottom: 0; border-top-color: var(--rim, #5a4426); }
@keyframes qs-bob { 50% { transform: translate(-50%, -2px); } }
/* the bag and the skill window say which slot a thing sits in */
.slot .qk { position: absolute; right: 2px; top: 1px; font: var(--t10) var(--pix9); color: var(--b-hi); text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none; }
.slot .anc { position: absolute; right: 1px; bottom: 0; font: var(--t9)/9px var(--pix9); color: #ffd36a; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none; }
.slot .qk.equip-ready, #inv-detail .equip-ready { color: var(--tx-ok, #a9ebb3); }
.skill .qs-put { justify-self: end; grid-column: -2 / -1; }
.skill.qs-src { cursor: grab; }
.skill.ult .hd b { color: var(--tx-gold, #e8c27a); }
#actions > .sep:first-child { display: none; }
.act.atk, #actions .act.atk { width: 46px; height: 46px; background: color-mix(in srgb, #3a1c22 var(--hud-pct), transparent); box-shadow: inset 2px 2px 0 #1a0a0e, inset -2px -2px 0 #6a2a30; }
.act.atk img, #actions .act.atk img { width: 32px; height: 32px; margin-top: 4px; }
/* bigger slots where the centre is wide (it is 41 % of the dock: ≥ 520 px from 1580 wide, ≥ 600 from 1760) */
@media (min-width: 1580px) { body[data-lay="full"] #actions { --act: 42px; gap: 3px; } body[data-lay="full"] #actions .act.atk { width: 50px; height: 50px; } body[data-lay="full"] #actions .act.atk img { margin-top: 6px; } }
@media (min-width: 1760px) { body[data-lay="full"] #actions { --act: 46px; } body[data-lay="full"] #actions .act.atk { width: 54px; height: 54px; } body[data-lay="full"] #actions .act img { margin-top: 5px; } body[data-lay="full"] #actions .act.atk img { margin-top: 9px; } body[data-lay="full"] .st-main { flex-basis: 188px; } }
#actions .act.auto img.gi { margin-top: 3px; }
.act.atk .nm { color: #ffd2c4; }
/* the dash (Space): a wind-swept boot, its 4 s cooldown swept like a skill's (hud.js dashTick) */
.act.dash { background: color-mix(in srgb, #1c2a3a var(--hud-pct), transparent); box-shadow: inset 2px 2px 0 #0a121a, inset -2px -2px 0 #2e4c66; }
.act.dash .nm { color: #c4e4ff; }
.act.dash .gl { display: block; margin: 4px auto 0; font: 16px/1 var(--pix); color: #9ad0ff; text-shadow: 1px 1px 0 #000; font-style: normal; pointer-events: none; }
.act.dash .cd { position: absolute; inset: 0; pointer-events: none; background: conic-gradient(rgba(6, 4, 10, .8) calc(var(--cd, 0) * 360deg), transparent 0); }
.act.dash .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 var(--t12)/1 var(--pix); font-style: normal; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none; }
.act.auto img.gi { width: 24px; height: 24px; margin: 8px auto 0; display: block; }
.act.auto.on { border-color: #4ac06a; animation: pulse 1.2s steps(2) infinite; }
.act.auto.on .nm { color: var(--tx-ok, #9af0ae); }
.act.pot img { width: 32px; height: 32px; margin-top: 6px; }
@keyframes pulse { 50% { filter: brightness(1.3); } }

#exp { position: relative; flex: none; height: 12px; background: #000; border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--sf3, #2c2537); }
#exp i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(#f6dc98 0 2px, #c8a04e 2px 7px, var(--rim, #7a5a22) 7px); transition: width .25s; }
#exp b { position: absolute; left: 0; right: 0; top: 0; text-align: center; font: var(--t10)/8px var(--pix9); color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }

/* ───────────────────────── over the viewport ───────────────────────── */
#topleft { left: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; width: 196px; }
#party-hud { display: flex; flex-direction: column; gap: 3px; }
#party-hud:empty { display: none; }
#party-hud .pm { display: grid; grid-template-columns: 14px 1fr; gap: 0 5px; align-items: center; padding: 3px 6px 4px; font-size: var(--t12); background: var(--frame-a, var(--frame-bg, rgba(18, 15, 24, .86))); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--sf4, #4a3a24); }
#party-hud .pm .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--t12); font-weight: 400; }
#party-hud .pm .nm small { color: var(--tx3, #9a90a8); margin-left: 4px; font: var(--t10) var(--pix9); }
#party-hud .pm .bar { grid-column: 1 / -1; height: 6px; margin-top: 2px; background: #000; border: 1px solid #000; }
#party-hud .pm.lead .nm::before { content: "★ "; color: var(--tx-hd, var(--b-hi)); }
#party-hud .pm.away { opacity: .6; }

/* the little floating boxes: same pixel box, no shadows */
#hud .frame { background: var(--frame-a, var(--frame-bg, rgba(24, 20, 31, .94))); border: 2px solid var(--ink); border-radius: 0; box-shadow: inset 0 0 0 2px var(--rim, #5a4426); }

#tut { left: max(212px, calc((var(--vpw) - 360px) / 2)); top: 8px; width: min(360px, calc(var(--vpw) - 220px)); min-width: 0; padding: 6px 10px 7px; z-index: 6; }
#tut .tut-hd { display: flex; align-items: center; gap: 8px; }
#tut #tut-n { font: var(--t10) var(--pix9); color: var(--tx-hd2, var(--b-mid)); white-space: nowrap; }
#tut #tut-title { flex: 1; font-size: var(--t12); font-weight: 700; color: var(--cream); }
#tut .x { position: relative; width: 16px; height: 16px; padding: 0; background: var(--scr); border: 2px solid var(--ink); cursor: pointer; }
#tut .x::before, #tut .x::after { content: ""; position: absolute; left: 2px; right: 2px; top: 5px; height: 2px; background: #b8b2a2; transform: rotate(45deg); }
#tut .x::after { transform: rotate(-45deg); }
/* a first-time hint (hints.js): over the F prompt, over windows (z 36 like the other cues) */
#hint { left: calc(var(--vpw) / 2); transform: translateX(-50%); top: calc(var(--vph) - 176px); width: min(330px, calc(var(--vpw) - 24px)); padding: 6px 10px 7px; z-index: 36; }
#hint .hint-hd { display: flex; align-items: center; gap: 6px; }
#hint .hint-tag { font: var(--t10) var(--pix9); color: #2a1806; background: var(--b-mid); padding: 1px 4px; white-space: nowrap; }
#hint b { flex: 1; font-size: var(--t12); color: var(--cream); }
#hint .x { position: relative; width: 16px; height: 16px; padding: 0; background: var(--scr); border: 2px solid var(--ink); cursor: pointer; }
#hint .x::before, #hint .x::after { content: ""; position: absolute; left: 2px; right: 2px; top: 5px; height: 2px; background: #b8b2a2; transform: rotate(45deg); }
#hint .x::after { transform: rotate(-45deg); }
#hint p { margin: 4px 0 0; font-size: var(--t12); line-height: 1.45; color: var(--tx2, #d8cfb8); }
#hint .btns { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 5px; }
/* an item link in a chat line (windows.js addChat): the rarity colour, the tooltip on hover */
#chat-log .ilink { cursor: help; text-decoration: underline dotted; text-underline-offset: 2px; }
#hint .more { flex: 1; min-width: 0; font: var(--t10) var(--pix9); color: var(--tx-hd2, var(--b-mid)); }
body:not([data-lay="full"]) #hint { top: 64px; }
#tut p { margin: 3px 0 0; font-size: var(--t12); line-height: 1.4; color: var(--tx2, #d8cfb8); }
#tut.pop { animation: tut-pop .35s steps(3); }
@keyframes tut-pop { from { transform: scale(1.06); } to { transform: scale(1); } }

#prompt { left: calc(var(--vpw) / 2); transform: translateX(-50%); top: calc(var(--vph) - 44px); padding: 4px 14px; font: var(--t12) var(--pix); white-space: nowrap; color: var(--cream); }
#prompt b { color: var(--tx-hd, var(--b-hi)); margin-right: 6px; font-weight: 400; }
#invite { left: calc(var(--vpw) / 2); top: 92px; transform: translateX(-50%); padding: 6px 10px; display: flex; gap: 8px; align-items: center; white-space: nowrap; z-index: 15; }
#toasts { left: calc(var(--vpw) / 2); top: 52px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; z-index: 14; }
#toasts p { margin: 0; padding: 3px 12px; white-space: nowrap; font: var(--t12) var(--pix); color: var(--cream); animation: toast 3.2s steps(16) forwards;
  background: var(--frame-a, var(--frame-bg, rgba(24, 20, 31, .94))); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--rim, #5a4426); }
@keyframes toast { 0% { opacity: 0; } 8%, 80% { opacity: 1; } 100% { opacity: 0; } }
#banner { left: calc(var(--vpw) / 2); top: calc(var(--vph) * .24); transform: translateX(-50%); pointer-events: none; white-space: nowrap; animation: banner 2.2s forwards;
  font: 700 24px/1.2 var(--pix); letter-spacing: 2px; color: #fff0c8; text-shadow: 2px 0 0 #2a1806, -2px 0 0 #2a1806, 0 2px 0 #2a1806, 0 -2px 0 #2a1806, 2px 2px 0 #2a1806, 4px 4px 0 rgba(0, 0, 0, .5); }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 12% { opacity: 1; transform: translateX(-50%) scale(1.1); } 22%, 80% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { opacity: 0; } }
/* A06: a retro title card when you step onto a new map (net.js loadMap) */
#areatitle { left: calc(var(--vpw) / 2); top: calc(var(--vph) * .19); transform: translateX(-50%); pointer-events: none; z-index: 36; text-align: center;
  white-space: nowrap; animation: areatitle 2.5s forwards; color: #fff0c8; text-shadow: 2px 0 0 #2a1806, -2px 0 0 #2a1806, 0 2px 0 #2a1806, 0 -2px 0 #2a1806, 3px 3px 0 rgba(0, 0, 0, .5); }
#areatitle b { display: block; font: 700 26px/1.2 var(--pix); letter-spacing: 3px; }
#areatitle small { display: block; margin-top: 4px; font: 400 13px/1.2 var(--pix); letter-spacing: 1px; color: #e8c890; }
#areatitle::before, #areatitle::after { content: ""; display: block; height: 2px; margin: 4px auto; width: 70%; background: linear-gradient(90deg, transparent, #e8c890, transparent); }
@keyframes areatitle { 0% { opacity: 0; transform: translateX(-50%) translateY(-6px); } 16%, 80% { opacity: 1; transform: translateX(-50%) translateY(0); } 100% { opacity: 0; } }
/* L10 포토 모드 (photo.js): the HUD steps aside; only the hint (fading) and the shutter flash remain */
body.photo #hud > *:not(#photo-hint):not(#photo-flash), body.photo #windows, body.photo #tip, body.photo #prompt { visibility: hidden !important; }
#photo-hint { left: calc(var(--vpw) / 2); top: 12px; transform: translateX(-50%); z-index: 40; pointer-events: none; white-space: nowrap;
  padding: 4px 10px; font: 400 12px/1.3 var(--pix); color: #fff0c8; background: rgba(16, 14, 22, .72); border: 1px solid #e8c890; }
#photo-hint.fade { animation: photohint 4s forwards; }
@keyframes photohint { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
#photo-flash { inset: 0; z-index: 41; pointer-events: none; background: #fff; animation: photoflash .4s forwards; }
@keyframes photoflash { 0% { opacity: .85; } 100% { opacity: 0; } }
#streak { left: calc(var(--vpw) / 2); top: 100px; transform: translateX(-50%); z-index: 6; pointer-events: none; text-align: center; }
#streak b { display: block; font: 700 var(--t12) var(--pix); color: #ffe08a; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; font-size: 16px; }
#streak span { font: var(--t10) var(--pix9); color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
#streak > i { display: block; width: 110px; height: 6px; margin: 2px auto 0; background: #000; border: 2px solid #000; overflow: hidden; }
#streak > i > i { display: block; height: 100%; background: #ffc040; }
#streak.pop b { animation: streak-pop .25s steps(3); }
@keyframes streak-pop { from { transform: scale(1.35); } to { transform: scale(1); } }
#cast { position: fixed; left: calc(var(--vpw) / 2); top: calc(var(--vph) - 84px); bottom: auto; transform: translateX(-50%); z-index: 7; width: 200px; text-align: center; pointer-events: none; }
#cast b { display: block; font: var(--t12) var(--pix); color: #ffe08a; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; margin-bottom: 2px; }
#cast > i { display: block; height: 8px; background: #000; border: 2px solid #6a5418; overflow: hidden; }
#cast > i > i { display: block; height: 100%; width: 0; background: #e0a83a; }

/* the emote picker sits over the viewport, next to whichever opened it */
#emotes { display: grid; grid-template-columns: repeat(5, 34px); gap: 3px; padding: 6px; z-index: 12; left: auto; right: calc(100vw - var(--vpw) + 8px); top: auto; bottom: calc(100vh - var(--vph) + 8px); }
#emotes.at-chat { right: auto; left: 8px; }
#emotes button { width: 34px; height: 34px; padding: 0; background: var(--scr); border: 2px solid var(--ink); }
#emotes button:hover { border-color: var(--b-mid); }
#emotes button img { width: 24px; height: 24px; image-rendering: pixelated; display: block; margin: auto; pointer-events: none; }

/* the touch stick and the drawer button (compact layouts only) */
#joy { display: none; width: 112px; height: 112px; border-radius: 50%; background: rgba(18, 15, 24, .55); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px #5a4426; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: #3a3146; border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 #5b4d6c, inset -2px -2px 0 #1f1a28; }
#b-drawer { display: none; }

/* windows open over the viewport and never grow taller than it */
body.playing .window:not(.docked) { max-height: calc(var(--vph) - 8px); border-radius: 0; }
body.playing .window:not(.docked) > .body { min-height: 0; }
body.playing #w-train .body, body.playing #w-skill .body, body.playing #w-shop .body { max-height: none; }
.window { border-radius: 0; }
.window > header .t { font-family: var(--pix); font-weight: 700; font-size: var(--t12); letter-spacing: 0; }

/* ─────────────────── compact: phones and small windows ─────────────────── */
body[data-lay="port"], body[data-lay="land"] { --side: 0px; }
body[data-lay="port"] #menu kbd, body[data-lay="land"] #menu kbd { display: none; }
body[data-lay="port"] #menu button[data-win="inv"], body[data-lay="land"] #menu button[data-win="inv"] { display: none; }

/* the side column becomes a drawer */
body[data-lay="port"] #side, body[data-lay="land"] #side {
  width: 300px; max-width: 86vw; z-index: 16; overflow-y: auto; transform: translateX(105%); transition: transform .18s steps(4);
}
body.drawer #side { transform: none !important; }
/* upright, the drawer is a sheet over the control deck: menu first, then the bag, the quests and the map */
body[data-lay="port"] #side { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; height: var(--dock); transform: translateY(105%); border-width: 10px; border-image-width: 10px; border-image-slice: 14 fill; }
body[data-lay="port"] #menu { order: 1; border-top: 0; padding-top: 0; }
body[data-lay="port"] #w-inv { order: 2; }
body[data-lay="port"] #quest-track { order: 3; }
body[data-lay="port"] #mini { order: 4; }
body[data-lay="port"] #tut { left: 6px; right: 56px; width: auto; min-width: 0; transform: none; top: 66px; }
body[data-lay="port"] #tut.pop { animation: none; }
body[data-lay="port"] #topleft { width: min(220px, calc(100vw - 64px)); }
body[data-lay="land"].drawer #b-drawer { right: calc(min(300px, 86vw) + 4px); }
body[data-lay="land"] #mini .sunk { height: 96px !important; }
body[data-lay="port"] #b-drawer, body[data-lay="land"] #b-drawer {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; z-index: 17;
  right: 6px; top: 6px; width: 44px; height: 44px; padding: 0; font: var(--t10) var(--pix9); color: var(--cream);
  background: var(--sf4-a, var(--sf4, #3a3146)); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf5, #5b4d6c), inset -2px -2px 0 var(--sf2, #1f1a28);
}
#b-drawer i { width: 18px; height: 14px; background: linear-gradient(var(--cream) 0 2px, transparent 2px 6px, var(--cream) 6px 8px, transparent 8px 12px, var(--cream) 12px 14px); }
body.drawer #b-drawer { background: var(--b-mid); color: #2a1806; }
body.drawer #b-drawer i { background: linear-gradient(#2a1806 0 2px, transparent 2px 6px, #2a1806 6px 8px, transparent 8px 12px, #2a1806 12px 14px); }
body[data-lay="port"] #mini .sunk, body[data-lay="land"] #mini .sunk { height: 116px; }
body[data-lay="port"] #quest-track, body[data-lay="land"] #quest-track { flex: none; max-height: 96px; }

/* the phone stood upright: the world on top, a control deck below */
body[data-lay="port"] #dock { right: 0; height: var(--dock); flex-direction: column; gap: 4px; border-width: 10px; border-image-width: 10px; border-image-slice: 14 fill; }
/* upright, the chat floats over the bottom-left of the world, folded with one tap */
body[data-lay="port"] #chat { position: fixed; z-index: 6; left: 4px; bottom: calc(var(--dock) + 4px); width: min(240px, 62vw); background: rgba(18, 15, 24, .72); border: 2px solid var(--ink); padding: 2px; gap: 2px; }
body[data-lay="port"] #chat-log { height: 48px; flex: none; border-width: 2px; font-size: var(--t12); line-height: 1.3; }
body[data-lay="port"] #chat-tabs button { padding: 1px 5px; font: var(--t10)/1.2 var(--pix9); }
body[data-lay="port"] #chat-fold { display: block; padding: 0; }
body[data-lay="port"].chat-folded #chat-log, body[data-lay="port"].chat-folded #chat-form { display: none; }
body.touch #chat-form { display: none; }
body[data-lay="port"] #center { order: 1; flex: none; justify-content: flex-start; }
body[data-lay="port"] #status { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: stretch; }
body[data-lay="port"] .st-main, body[data-lay="land"] .st-main { flex: initial; }
body[data-lay="port"] #wm, body[data-lay="land"] #wm { flex: 1 1 0; }
body[data-lay="port"] #status .bar, body[data-lay="land"] #status .bar { border-width: 2px; }
body[data-lay="port"] #status .face { width: 48px; height: 48px; }
body[data-lay="port"] .st-main, body[data-lay="land"] .st-main { width: auto; gap: 0; }
body[data-lay="port"] #status .meter, body[data-lay="land"] #status .meter { position: relative; display: grid; grid-template-columns: 14px 1fr; align-items: center; gap: 4px; height: auto; margin-top: 3px; }
body[data-lay="port"] #status .bar, body[data-lay="land"] #status .bar { height: 14px; }
body[data-lay="port"] #status .bar.hp i:not(.trail), body[data-lay="land"] #status .bar.hp i:not(.trail) { background: linear-gradient(var(--hp-hi) 0 2px, var(--hp) 2px 8px, var(--hp-lo) 8px); }
body[data-lay="port"] #status .bar.mp i, body[data-lay="land"] #status .bar.mp i { background: linear-gradient(var(--mp-hi) 0 2px, var(--mp) 2px 8px, var(--mp-lo) 8px); }
body[data-lay="port"] #status .meter em, body[data-lay="land"] #status .meter em { position: static; width: 14px; height: 14px; display: flex; align-items: center; justify-content: center; }
body[data-lay="port"] #status .meter b, body[data-lay="land"] #status .meter b { position: absolute; left: 18px; right: 2px; top: 50%; transform: translateY(-50%); z-index: 2; min-width: 0; text-align: center; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
body[data-lay="port"] .st-purse, body[data-lay="land"] .st-purse { display: flex; align-items: center; gap: 5px; margin-top: 3px; min-width: 0; }
body[data-lay="port"] #st-gold, body[data-lay="land"] #st-gold { display: flex; font-size: var(--t10); }
body[data-lay="port"] #st-gold-n, body[data-lay="land"] #st-gold-n { gap: 3px; }
body[data-lay="port"] #st-ttok, body[data-lay="land"] #st-ttok { display: flex; font-size: var(--t10); }
body[data-lay="port"] #st-ttok::before, body[data-lay="land"] #st-ttok::before { content: "/"; margin-right: 5px; color: var(--tx3, #9a90a8); font-weight: normal; }
body[data-lay="port"] #st-ttok-n, body[data-lay="land"] #st-ttok-n { grid-template-columns: 14px auto; gap: 3px; }
body[data-lay="port"] #st-ttok-n .tt-lb, body[data-lay="land"] #st-ttok-n .tt-lb { display: none; }
body[data-lay="port"] .st-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
body[data-lay="port"] #cgauge { width: 120px; height: 20px; }
body[data-lay="port"] #exp { order: -1; }
/* the thumb cluster under the deck: the stick left, attack and skills right */
body[data-lay="port"] #joy, body[data-lay="land"] #joy { display: block; }
body[data-lay="port"] #joy { left: 18px; bottom: calc(16px + var(--safe-b)); z-index: 6; }
/* potions + auto on top, then quick slots 1–9 left-to-right top-to-bottom; dash widened to match attack, attack flush with bottom row */
body[data-lay="port"] #actions {
  position: fixed; right: 10px; bottom: calc(10px + var(--safe-b)); z-index: 6; --act: 44px;
  display: grid; gap: 4px; grid-template-columns: repeat(3, 44px) 64px; grid-template-rows: repeat(4, 44px);
  grid-template-areas: "hp mp au ." "q0 q1 q2 dt" "q3 q4 q5 at" "q6 q7 q8 at"; justify-items: center; align-items: center;
}
body[data-lay="port"] #actions .sep, body[data-lay="land"] #actions .sep { display: none; }
body[data-lay="port"] #actions .act, body[data-lay="land"] #actions .act { width: 44px; height: 44px; }
body[data-lay="port"] #actions .act.dash, body[data-lay="land"] #actions .act.dash { width: 64px; }
body[data-lay="port"] #actions .act.atk, body[data-lay="land"] #actions .act.atk { width: 64px; height: 64px; grid-area: at; align-self: end; }
body[data-lay="port"] #actions .act.atk img, body[data-lay="land"] #actions .act.atk img { width: 40px; height: 40px; margin-top: 8px; }
body[data-lay="port"] #qs-hint, body[data-lay="land"] #qs-hint { top: -16px; left: 0; transform: none; animation: none; }
#b-dash { grid-area: dt; }
#b-hp { grid-area: hp; } #b-mp { grid-area: mp; } #b-auto { grid-area: au; }
#q0 { grid-area: q0; } #q1 { grid-area: q1; } #q2 { grid-area: q2; } #q3 { grid-area: q3; } #q4 { grid-area: q4; } #q5 { grid-area: q5; } #q6 { grid-area: q6; } #q7 { grid-area: q7; } #q8 { grid-area: q8; }
body[data-lay="port"] #emotes, body[data-lay="land"] #emotes { right: auto; left: 50%; transform: translateX(-50%); top: 56px; bottom: auto; }
/* above the chat box (bottom-left) so a long NPC name is never half under it */
body[data-lay="port"] #prompt { left: auto; right: 8px; transform: none; top: calc(var(--vph) - 112px); max-width: calc(100vw - 16px); }
body[data-lay="port"] #b-drawer { top: auto; bottom: calc(var(--dock) + 6px); }

/* the phone on its side: the world fills the screen, the controls float over it */
body[data-lay="land"] #vp-frame { display: none; }
body[data-lay="land"] #dock { display: contents; }
body[data-lay="land"] #center { display: contents; }
body[data-lay="land"] #status { display: grid; align-items: stretch; position: fixed; left: 6px; top: 6px; z-index: 6; width: 226px; grid-template-columns: auto 1fr; gap: 3px 6px; padding: 4px; background: var(--frame-a, var(--frame-bg, rgba(18, 15, 24, .86))); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--rim, #5a4426); }
body[data-lay="land"] #status .face { width: 48px; height: 48px; }
body[data-lay="land"] .st-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
body[data-lay="land"] #cgauge { width: 120px; height: 20px; }
body[data-lay="land"] .st-side #st-buffs { max-width: 96px; }
body[data-lay="land"] #wm { flex: 0.75 1 0; }
body[data-lay="land"] #wm .wl { display: none; }
body[data-lay="land"] #jr { flex: 1.25 1 0; min-width: 0; }   /* give job name + Lv.N room while weapon mastery shows only Lv.N */
body[data-lay="land"] .st-main { min-width: 0; }   /* the desktop 184px floor overflows the 226px frame here and pushes "Lv." out */
body[data-lay="land"] #exp { position: fixed; left: 0; right: 0; bottom: 0; height: 8px; border-width: 1px; z-index: 6; }
body[data-lay="land"] #exp b { display: none; }
body[data-lay="land"] #topleft { top: 112px; width: 180px; }
body[data-lay="land"] #chat { position: fixed; z-index: 6; left: 148px; bottom: calc(12px + var(--safe-b)); width: min(260px, calc(100vw - 470px)); background: rgba(18, 15, 24, .7); border: 2px solid var(--ink); padding: 2px; }
body[data-lay="land"] #chat-log { height: 64px; flex: none; border-width: 2px; }
body[data-lay="land"] #chat-fold { display: block; }
body[data-lay="land"].chat-folded #chat-log { display: none; }
body[data-lay="land"] #chat-tabs button { padding: 1px 5px; font-size: var(--t10); font-family: var(--pix9); }
body[data-lay="land"] #joy { left: 18px; bottom: calc(18px + var(--safe-b)); }
body[data-lay="land"] #actions {
  position: fixed; right: 10px; bottom: calc(14px + var(--safe-b)); z-index: 6; --act: 44px;
  display: grid; gap: 4px; grid-template-columns: repeat(3, 44px) 64px; grid-template-rows: repeat(4, 44px);
  grid-template-areas: "hp mp au ." "q0 q1 q2 dt" "q3 q4 q5 at" "q6 q7 q8 at"; justify-items: center; align-items: center;
}
body[data-lay="land"] #b-drawer { right: 176px; top: 6px; }
/* landscape HUD: minimap pinned top-right, quest tracker directly beneath it, menu button to the minimap's left */
body[data-lay="land"]:not(.drawer) #side {
  transform: none !important; left: auto; right: 6px; top: 6px; bottom: auto;
  width: 164px; max-width: 164px; height: auto; max-height: calc(100dvh - 196px);
  z-index: 6; border: 0; border-image: none; background: none; overflow: visible;
  pointer-events: none; padding: 0; gap: 3px;
}
body[data-lay="land"]:not(.drawer) #side > * { pointer-events: auto; }
body[data-lay="land"]:not(.drawer) #menu,
body[data-lay="land"]:not(.drawer) #w-inv { display: none !important; }
body[data-lay="land"]:not(.drawer) #panel { display: contents; }
body[data-lay="land"]:not(.drawer) #mini { background: none; }
body[data-lay="land"]:not(.drawer) #mini-name { border: 0; border-image: none; padding: 0 3px; color: #ffe9a8; text-shadow: 1px 0 0 #0d0b12, -1px 0 0 #0d0b12, 0 1px 0 #0d0b12, 0 -1px 0 #0d0b12; }
body[data-lay="land"]:not(.drawer) #mini .sunk { height: 78px !important; border: 2px solid #0d0b12; border-image: none; box-shadow: 0 0 0 1px rgba(243, 232, 204, .38); background: #000; }
body[data-lay="land"]:not(.drawer) :is(#mini-xy, #mini-pct, #mini-info) { color: #f3e8cc; text-shadow: 1px 0 0 #0d0b12, -1px 0 0 #0d0b12, 0 1px 0 #0d0b12, 0 -1px 0 #0d0b12; }
body[data-lay="land"]:not(.drawer) #mini-info { display: none; }
body[data-lay="land"]:not(.drawer) #quest-track {
  --cream: #f3e8cc; --tx: #fff6dc; --tx2: #e6dcc0; --tx3: #c4b9a4; --tx-hd: #ffe9a8; --tx-hd2: #e0c07c; --tx-ok: #9af0ae; --ink: #0d0b12; --sf3: rgba(243, 232, 204, .35);
  max-height: min(116px, calc(100dvh - 280px)); overflow-y: auto; border: 0; border-image: none; background: rgba(14, 12, 20, .58);
  padding: 3px 4px; color: var(--cream); text-shadow: 1px 0 0 #0d0b12, -1px 0 0 #0d0b12, 0 1px 0 #0d0b12, 0 -1px 0 #0d0b12; scrollbar-width: none;
}
body[data-lay="land"]:not(.drawer) #quest-track::-webkit-scrollbar { display: none; }
body[data-lay="land"]:not(.drawer) #quest-track:empty { display: none; }
body[data-lay="land"]:not(.drawer) #quest-track .btn { text-shadow: none; }
body[data-lay="land"] #tut { left: 240px; transform: none; top: 6px; width: min(260px, calc(100vw - 470px)); min-width: 0; }
body[data-lay="land"] #tut.pop { animation: none; }
body[data-lay="land"] #prompt { top: auto; bottom: calc(100px + var(--safe-b)); }
body[data-lay="land"] #toasts { top: 60px; }
body.touch kbd { display: none; }

@media (max-height: 640px) { body[data-lay="full"] #mini .sunk { height: 96px; } }

/* ─────────────── windows, tooltips and panels in the same handheld kit ─────────────── */
.window:not(.docked), #dead .frame, .mg.win {
  background: none; box-shadow: none; border-radius: 0;
  border: calc(14px * var(--fs, 1)) solid transparent; border-image: var(--fr-brass) 14 fill / calc(14px * var(--fs, 1)) / 0 stretch; image-rendering: pixelated;
}
.window:not(.docked).top { box-shadow: none; }
/* HUD transparency (설정 > 화면 > HUD 투명도, keymap.js sets --hud-a on :root): floating windows fade as a whole (frame, face and text,
   no blur); hover, a drag (.drag, windows.js) or keyboard / text-input focus makes one opaque again, and body.hud-peek (a moment after
   the setting changes) shows them all see-through. The always-on HUD fades only its panel faces: see "HUD transparency" at the end. */
:root { --hud-a: .9; --hud-pct: calc(var(--hud-a) * 100%); }
.window:not(.docked) { opacity: var(--hud-a); transition: opacity 120ms; }
.window:not(.docked):is(:hover, .drag, :has(:focus-visible)) { opacity: 1; }
body.hud-peek .window:not(.docked) { opacity: var(--hud-a) !important; }
.window, #tip, #dead, #minigame .mg { font-family: var(--pix); font-size: var(--t12); line-height: 1.45; letter-spacing: 0; }
.window > header { height: 26px; padding: 0 0 4px; gap: 6px; background: none; border-bottom: 2px solid var(--sf3, #2c2537); margin: -4px 0 0; }
.window > header .t { color: #2a1806; font: 700 var(--t12)/1.2 var(--pix); padding: 1px 8px; border: calc(4px * var(--fs, 1)) solid transparent; border-image: var(--fr-plate) 4 fill / calc(4px * var(--fs, 1)) / 0 stretch; }
.window > header kbd { font: var(--t10)/1 var(--pix9); padding: 2px 3px; border: 2px solid var(--ink); border-radius: 0; background: var(--scr); color: var(--tx3, #9a90a8); box-shadow: none; }
.window > header .x { width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 0; background: var(--sf4, #3a3146); box-shadow: inset 2px 2px 0 var(--sf5, #5b4d6c), inset -2px -2px 0 var(--sf2, #1f1a28); }
.window > header .x::before, .window > header .x::after { left: 3px; right: 3px; top: 7px; height: 2px; background: var(--cream); }
.window > header .x:hover { background: #8a2e34; box-shadow: inset 2px 2px 0 #b8505a, inset -2px -2px 0 #4a1418; }
/* 분리 / 붙이기 (windows.js setDock): docked = two overlapping squares (pop out), floating = a frame with a bar on its right (dock); a desktop only */
.window > header .pop { margin-left: auto; flex: none; position: relative; box-sizing: border-box; width: 20px; height: 20px; padding: 0; cursor: pointer; border: 2px solid var(--ink); border-radius: 0; background: var(--sf4, #3a3146); box-shadow: inset 2px 2px 0 var(--sf5, #5b4d6c), inset -2px -2px 0 var(--sf2, #1f1a28); }
.window > header .pop + .x { margin-left: 0; }
/* "?" = this content's page in 도움말 (windows.js HELP) */
.window > header .hlp { margin-left: auto; flex: none; box-sizing: border-box; width: 20px; height: 20px; padding: 0; cursor: pointer; font: 700 var(--t12)/16px var(--pix); color: var(--cream); text-align: center;
  border: 2px solid var(--ink); border-radius: 0; background: var(--sf4, #3a3146); box-shadow: inset 2px 2px 0 var(--sf5, #5b4d6c), inset -2px -2px 0 var(--sf2, #1f1a28); }
.window > header .hlp:hover { color: var(--b-hi); }
.window > header .hlp + :is(.pop, .x) { margin-left: 0; }
.window > header .pop::before, .window > header .pop::after { content: ""; position: absolute; box-sizing: border-box; }
.window > header .pop[data-dock="1"]::before { left: 7px; top: 3px; width: 8px; height: 8px; border: 2px solid var(--cream); }
.window > header .pop[data-dock="1"]::after { left: 3px; top: 7px; width: 8px; height: 8px; border: 2px solid var(--cream); background: var(--sf4, #3a3146); }
.window > header .pop[data-dock="0"]::before { left: 3px; top: 4px; width: 10px; height: 8px; border: 2px solid var(--cream); }
.window > header .pop[data-dock="0"]::after { left: 9px; top: 4px; width: 4px; height: 8px; background: var(--cream); }
.window > header .pop:hover { background: var(--b-lo, #7c5326); box-shadow: inset 2px 2px 0 var(--b-mid, #cf9f55), inset -2px -2px 0 var(--b-lo, #4a3014); }
body:not([data-lay="full"]) .window > header .pop, body.playing .window.mini > header .pop { display: none; }
.window .body { padding: 8px 2px 2px; }
.window *, #tip, #tip * { border-radius: 0 !important; }
/* the pixel font only reads cleanly at the sizes it was drawn for: 12px, and 10px for the small cut */
.window small, .window .hint, .window .ds, .window .rar, .window .cmp, .window kbd, .window .pts, .window .mk small,
#tip small, #tip .hint, #tip .rar, #tip .cmp, #tip .ds, #dead .hint { font-family: var(--pix9) !important; font-size: var(--t10) !important; }
.window .nm, #tip .nm, .window .section, .window .q-title, .window h4, .window .stats span, .window .say, .window p,
.window .list .it .tx, .window .skill .hd b, .window .skill p, .window .set-row, #tip, .window .list .rk, .window .dcard .dh, .window .col-cell b { font-family: var(--pix); font-size: var(--t12); }
.window .section, .window .q-title, .window h4, #dead h2 { font-family: var(--pix); font-weight: 700; letter-spacing: 0; color: var(--tx-hd, var(--b-hi)); border-bottom: 2px solid var(--sf3, #2c2537); }
#dead h2 { font-size: 24px; border: 0; }
.window .stats, .window .detail, .window .say, .window .well, .window .list .it, .window .list .rk, .window .skill, .window .pframe, .window .dcard, .window .col-cell, .window .qlist {
  background: var(--scr-a, var(--scr)); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433);
}
.window .list .it img, .window .skill .ic, .window .pframe .cg, .window .col-cell img { border: 2px solid var(--ink); box-shadow: none; background: var(--sf1, #1a1622); }
.window .bar, #tip .bar { background: #000; border: 2px solid var(--ink); box-shadow: none; }

/* buttons everywhere outside the HUD speak the same chunky language */
.window .btn, .window .btns button, .window .list button, .window .pick button, #invite button, #dead .btn, .mg .btn, #tip .btn, .window .tabs button, .window .qlist button.on {
  font: var(--t12)/1.2 var(--pix); padding: 4px 8px; color: var(--cream); border-radius: 0;
  background: var(--sf4, #3a3146); border: 2px solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--sf5, #5b4d6c), inset -2px -2px 0 var(--sf2, #1f1a28);
}
.window .btn:hover, .window .btns button:hover, .window .list button:hover, #invite button:hover, #dead .btn:hover, .mg .btn:hover, #tip .btn:hover { background: var(--sf4h, #463b55); color: var(--tx, #fff6dc); }
.window .btn:active, .window .list button:active, #dead .btn:active, .mg .btn:active, #tip .btn:active { transform: translate(1px, 1px); box-shadow: inset 2px 2px 0 var(--sf2, #1f1a28), inset -2px -2px 0 var(--sf4h, #463b55); }
.window .btn.gold, #dead .btn.gold, #invite .btn.gold, #tip .btn.gold, .mg .btn.gold { color: #2a1806; background: var(--b-mid); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
.window .btn.gold:hover, #dead .btn.gold:hover, #tip .btn.gold:hover { background: #dcae62; color: #2a1806; }
.window .btn.small, #tip .btn.small { padding: 3px 6px; font-size: var(--t12); }
.window .tabs button.on, .window .qlist button.on { color: #2a1806; background: var(--b-mid); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
.window .tabs { border-bottom: 2px solid var(--sf3, #2c2537); }
.window .tabs button { border-bottom: 0; }
.big, .btn.big { font-family: var(--pix) !important; font-size: var(--t12) !important; letter-spacing: 1px !important; padding: 8px 20px !important; }

/* slots: hard pixel wells; rarity is a coloured 2px rim, no glow */
.slot { border-radius: 0; background: var(--scr); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433); }
.slot:hover { border-color: var(--b-mid); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433); }
.slot img { left: 3px; top: 3px; }
#inv-grid .slot img { left: 2px; top: 2px; }
.slot .n, .slot .e { font: var(--t10) var(--pix9); }
.slot.q1 { box-shadow: inset 0 0 0 2px #5a8ae0; }
.slot.q2 { box-shadow: inset 0 0 0 2px #d8b84a; }
.slot.q3 { box-shadow: inset 0 0 0 2px #e8803a; }
.slot.q4 { box-shadow: inset 0 0 0 2px #5fd47a; }
.slot.q5 { box-shadow: inset 0 0 0 2px #d2b48c; }
.slot.sel { box-shadow: inset 0 0 0 2px var(--b-hi); border-color: var(--b-hi); }
.slot.q1.sel, .slot.q2.sel, .slot.q3.sel, .slot.q4.sel, .slot.q5.sel { outline: 0; border-color: var(--b-hi); }
.slot .sk i { border-radius: 0; }

/* the tooltip: a dark screen with a brass rim */
#tip.frame { background: var(--sf1, #18141f); border: 2px solid var(--ink); border-radius: 0; box-shadow: inset 0 0 0 2px var(--rim, #5a4426); padding: 8px 10px 9px; }
#tip .tip-act, #tip .cmp { border-top: 2px solid var(--sf3, #2c2537); }

/* the death panel and the mini-games */
#dead { background: rgba(40, 6, 12, .45); }
#dead-by { margin: 0 0 6px; max-width: 360px; color: var(--tx-bad, #ffb4a0); line-height: 1.45; }
#dead .frame { padding: 10px 16px 12px; }
#minigame .mg header { font: 700 var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); }
#minigame .mg-hint, #minigame .mg-info { font-family: var(--pix); font-size: var(--t12); }

/* side quests from the map editor (sidequests.js): cards under an NPC's lines */
#w-talk .talk-sq { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
#w-talk .sq-card { padding: 6px; border: 2px solid var(--sf3, #2c2537); background: var(--sf1, #1c1824); }
#w-talk .sq-card.st3 { border-color: #4a8a4a; }
#w-talk .sq-card.main-q { border-color: #e8a838; background: linear-gradient(180deg, rgba(84, 52, 22, 0.42), var(--sf1, #1c1824)); box-shadow: inset 0 0 0 1px rgba(255, 214, 112, 0.28); }
#w-talk .sq-card.main-q.st3 { border-color: #ffd05a; }
#w-talk .mq-badge, #talk-mainq .mq-badge { display: inline-block; padding: 1px 6px; margin-right: 5px; font-size: 0.86em; font-weight: 700; color: #fff7dc; background: linear-gradient(180deg, #d84b36, #9c271c); border: 1px solid #ffd46a; border-radius: 3px; text-shadow: 0 1px 1px #2b0d0a; vertical-align: 1px; }
#w-talk .mq-section { display: flex; align-items: center; gap: 4px; color: #ffd46a; }
#w-talk .mq-intro { font-style: italic; color: #d8c7a4; margin: 2px 0 4px; }
#talk-mainq { border-color: #e8a838; }
#w-talk .sq-card .say { margin: 4px 0; }
#w-talk .sq-card .btns { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
#w-talk .sq-choice { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
#w-talk .sq-choice .btn { text-align: left; }
.sq-qitem { margin: 2px 0; color: var(--tx-gold, #e6c36a); }
.sq-time { margin: 2px 0; color: var(--tx-bad, #ff9a6a); }
.sq-steps { margin: 2px 0 6px 18px; padding: 0; }
.sq-steps li { color: var(--tx3, #8c8496); }
.sq-steps li.past { color: var(--tx3, #7fb87f); }
.sq-steps li.now { color: var(--tx-gold, #ffe08a); }
.keep-list { display: flex; flex-direction: column; gap: 6px; }
.keep-row { padding: 6px; border: 2px solid var(--sf3, #2c2537); background: var(--sf1, #1c1824); color: var(--tx3, #8c8496); }
.keep-row.ok { border-color: var(--rim, #8a6a3a); color: inherit; }
.keep-row small { margin-left: 6px; color: var(--tx-gold, #c9a86a); }
.keep-row img.ic { width: 32px; height: 32px; float: left; margin-right: 6px; image-rendering: pixelated; }



/* the sky over the minimap: phase, hour and weather (sky.js) */
#mini .sunk { position: relative; }
#sky { position: absolute; left: 3px; top: 3px; display: flex; align-items: center; gap: 4px; padding: 1px 5px 1px 3px; background: rgba(20, 16, 30, .72); border: 1px solid #5a4a3a; font: var(--t10)/1.2 var(--pix9); color: #f0e0b0; pointer-events: none; white-space: nowrap; }
#sky canvas { width: 12px; height: 12px; image-rendering: pixelated; }
/* songs and toasts by the fire, while you sit */
#jam { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; z-index: 5; }
#jam button { font: var(--t12)/1 var(--pix); color: #f4e4b0; background: #3a2c22; border: 1px solid #c89a5a; padding: 4px 8px; cursor: pointer; }
#jam button:hover { background: #5a4030; }
#jam kbd { font-size: var(--t9); color: #c8b088; margin-left: 3px; }

/* ─────────────────────────── 레이드던전 (dimrift.js) ─────────────────────────── */
#dim-hud { left: calc(var(--vpw) - 292px); top: 8px; width: 280px; z-index: 6 !important; padding: 5px 8px 6px; color: var(--tx, #e8dcff); }
#dim-hud .dim-hd { display: flex; justify-content: space-between; gap: 8px; font: 700 var(--t12)/1.3 var(--pix); }
#dim-hud .dim-hd b { color: var(--tx-pink, #d8b8ff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dim-time { font: 700 var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); }
#dim-time.low { color: var(--tx-bad, #ff7a6a); animation: dim-blink 1s steps(2) infinite; }
@keyframes dim-blink { 50% { color: #fff2a0; } }
.dim-gauge { position: relative; height: 14px; margin-top: 3px; background: var(--sf1, #120c1c); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px #4a2e78; overflow: hidden; }
.dim-gauge i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(#e0c0ff 0 2px, #9a5ae8 2px 8px, #5a2e9a 8px); transition: width .25s linear; }
.dim-gauge span { position: absolute; inset: 0; text-align: center; font: var(--t10)/11px var(--pix9); color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
#dim-hud.boss .dim-gauge i { background: linear-gradient(#ffc0d0 0 2px, #e84a6a 2px 8px, #8a1e3a 8px); }
#dim-hud.clear .dim-gauge i { background: linear-gradient(#fff2b0 0 2px, #e0b03a 2px 8px, var(--rim, #8a5a1e) 8px); }
#dim-team { display: flex; flex-wrap: wrap; gap: 3px 6px; margin-top: 4px; }
.dim-chip { display: inline-flex; align-items: center; gap: 3px; font: var(--t10) var(--pix9); color: var(--tx, #e8dcff); }
.dim-chip b { font-weight: 400; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim-chip.me b { color: var(--tx-hd, var(--b-hi)); }
.dim-chip > i { display: inline-block; width: 28px; height: 5px; background: #000; border: 1px solid var(--ink); }
.dim-chip > i > i { display: block; height: 100%; background: var(--hp); }
.dim-chip.down { opacity: .55; }
.dim-chip.down b { text-decoration: line-through; }
.dim-buff { font: var(--t10) var(--pix9); color: var(--tx-info, #9ac8ff); }
#dim-boss { margin-top: 4px; }
#dim-boss b { display: block; font: 700 var(--t11) var(--pix); color: var(--tx-bad, #ff8aa8); }
.dim-bbar { height: 9px; background: #000; border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px #6a1e3a; overflow: hidden; }
.dim-bbar i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff8a9a 0 2px, #d8243e 2px); transition: width .2s linear; }
#dim-leave { position: absolute; right: -2px; bottom: -24px; font-size: var(--t10) !important; padding: 2px 5px !important; }
#w-dim { width: 356px; }
#w-dim .say { margin: 0 0 8px; line-height: 1.55; }
#w-dim .dim-n { color: var(--tx-hd, var(--b-hi)); }
.dim-btns { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
/* the raid record and the weekly boss challenge (dimrift.js renderKeeper), the stagger gauge (renderHud) */
#dim-pick { margin: 0 0 8px; font: var(--t11) var(--pix); }
#dim-pick .dim-rec { text-align: center; color: var(--tx2, #a898b8); margin-top: 6px; margin-bottom: 2px; }
#dim-pick .dim-chal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 3px 0; }
#dim-pick .dim-step { color: var(--tx2, #a898b8); font-size: 11px; }
#dim-pick .dim-rw { margin-top: 6px; padding: 4px 6px; border-top: 2px solid var(--sf4, #3a3146); font-size: var(--t11); line-height: 1.5; }
#dim-pick .dim-rw em { font-style: normal; color: var(--tx2, #a898b8); }
#dim-pick .dim-rw .got { opacity: .55; }
#dim-pick .dim-chal > span { flex: 1; display: flex; align-items: center; gap: 7px; min-width: 0; }
#dim-pick .dim-row-txt { min-width: 0; }
#dim-pick .dim-boss-face { width: 26px; height: 26px; flex: 0 0 26px; image-rendering: pixelated; object-fit: cover; border: 2px solid var(--ink); background: #22192b; box-shadow: inset 0 0 0 1px #7a5c38; }
#dim-pick .dim-chal em { font-style: normal; color: var(--tx2, #a898b8); }
#dim-stag { margin-top: 3px; }
#dim-stag span { display: block; font: var(--t10) var(--pix); color: var(--tx-gold, #ffd84a); }
#dim-stag.broke span { color: var(--tx-ok, #8affc0); }
.dim-sbar { height: 6px; background: #000; border: 2px solid var(--ink); overflow: hidden; }
.dim-sbar i { display: block; height: 100%; background: #ffd84a; transition: width .2s linear; }
#dim-stag.broke .dim-sbar i { background: #8affc0; }
#w-rc { width: 280px; box-shadow: 0 0 0 2px #7a4ac0; }
#w-rc .rc-hd { display: flex; justify-content: space-between; margin: 0 0 4px; color: var(--tx-pink, #d8b8ff); }
#rc-time { font: 700 var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); }
.rc-bar { height: 6px; background: #000; border: 2px solid var(--ink); margin-bottom: 6px; overflow: hidden; }
.rc-bar i { display: block; height: 100%; background: #b880ff; transition: width 1s linear; }
#rc-list { list-style: none; margin: 0 0 6px; padding: 0; }
#rc-list li { display: flex; align-items: center; gap: 6px; padding: 2px 0; font: var(--t12) var(--pix); }
#rc-list li b { flex: 1; font-weight: 400; }
#rc-list li em { font: var(--t10) var(--pix9); font-style: normal; color: var(--tx2, #a898b8); }
.rc-mark { width: 10px; height: 10px; border: 2px solid var(--ink); background: var(--sf4, #3a3146); }
#rc-list .rc-1 .rc-mark { background: #4ad07a; } #rc-list .rc-1 em { color: var(--tx-ok, #8affb0); }
#rc-list .rc-2 .rc-mark { background: #d84a4a; } #rc-list .rc-2 em { color: var(--tx-bad, #ff9a8a); }
#rc-list .rc-3 { opacity: .55; }
#rc-list .rc-0 .rc-mark { animation: dim-blink 1s steps(2) infinite; background: #e0b03a; }
.rc-wait { margin: 0 0 6px; text-align: center; font: var(--t11) var(--pix9); color: var(--tx2, #a898b8); min-height: 0; }
.rc-wait:empty { display: none; }
body[data-lay="port"] #dim-hud { left: 8px; width: min(280px, calc(100vw - 16px)); top: 56px; }
/* inside a rift the first-steps card steps aside for the rift HUD */
body.in-dim #tut { display: none !important; }

/* ─────────────────── responsive: the docks, the safe zone, small screens ───────────────────
   Desktop ("full") breakpoints — client.js layout() mirrors the first two in JS (sideW, dockH):
     > 1100 wide   side column 288, dock 184–224 (20 % of the height)
     ≤ 1100 wide   side column 256, menu shows glyphs only (titles name them), slots 36, compact unit frame
     ≤ 640 high    dock 160, smaller minimap, the quest list capped lower
   Phones ("port" / "land", chosen by layout() below 900×540 or on touch) keep their own rules
   above; ≤ 860 wide only trims the floating chat there.
   Windows (section.window) live in the safe zone: the viewport (--zone-w × --zone-h, set by
   layout(); never over the side column or the dock), less the strip of folded-window tabs
   (--tabs-h). Header fixed, body scrolls with a pixel scrollbar. Width cap 420 px unless a
   window sets --win-max (wide tables: quests, warehouse, help, wardrobe, collection).
   New windows get all of this for free: a section.window with a header and a .body. */
:root { --zone-w: 100vw; --zone-h: 100vh; --tabs-h: 0px; }

/* the side column: map, quests (capped), the bag (takes the rest, its grid scrolls), the menu */
/* the side panel (desktop): the quest tracker fills it, or one window does in its place (windows.js PANEL) */
#panel { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
body:not([data-lay="full"]) #panel { display: contents; }
body[data-lay="full"] #quest-track { flex: 1 1 0; min-height: 44px; max-height: none; }
body[data-lay="full"] #panel.on > #quest-track { display: none; }
body[data-lay="full"] #panel > .window.docked { flex: 1 1 0; min-height: 0; width: auto; max-width: none; }
body[data-lay="full"] #panel > .window.docked > header { flex: none; min-width: 0; height: auto; margin: 0; padding: 0 0 4px; border-bottom: 2px solid var(--sf3, #2c2537); flex-wrap: nowrap; }
body[data-lay="full"] #panel > .window.docked > header .t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-lay="full"] #panel > .window.docked > .body { flex: 1 1 auto; min-height: 0; padding: 4px 2px 2px; overflow-y: auto; overflow-x: hidden; }
body[data-lay="full"] #w-inv.docked > .body { display: flex; flex-direction: column; overflow: hidden; }
/* the panel is one column wide: two-column windows stack (the quest list over the chosen quest) */
body[data-lay="full"] #panel .qwin { grid-template-columns: 1fr; gap: 6px; min-height: 0; }
body[data-lay="full"] #panel .qlist { max-height: 34vh; }
/* the job tree's legend has no free cells to sit in at this width (the note above the grid says the same) */
body[data-lay="full"] #panel .jt-key { display: none; }
body[data-lay="full"] #inv-grid { flex: 0 1 auto; min-height: 44px; overflow-y: auto; overflow-x: hidden; align-content: start; }
body[data-lay="full"] #inv-detail { flex: none; max-height: 45%; overflow-y: auto; }
#w-inv.docked > header { flex: none; min-width: 0; }
#w-inv.docked > header .t { flex: none; }
/* the 가방 button stands in the menu on a desktop (on a phone the drawer is the bag) */
body[data-lay="full"] #menu button[data-win="inv"] { display: flex; }
#inv-count { white-space: nowrap; }

/* the buffs sit under the party frames on a desktop and a phone on its side (client.js layout moves them into #topleft) */
#topleft > #st-buffs { flex: none; max-height: none; overflow: visible; gap: 2px; }
#topleft > #st-buffs span { background: var(--frame-a, var(--frame-bg, rgba(18, 15, 24, .9))); }

/* the dock: the chat gives way to the centre, never the other way round */
#chat { min-width: 150px; }
#chat-tabs { flex-wrap: nowrap; overflow: hidden; }
#chat-tabs button { flex: none; white-space: nowrap; }

/* grids of slots size from one variable, so small screens can step them down (≤ 560 wide style.css makes them fluid) */
@media (min-width: 561px) {
  .window .grid { --slot: 42px; grid-template-columns: repeat(var(--cols, 6), var(--slot)); }
  .window .grid .slot { width: var(--slot); height: var(--slot); }
  .window .grid .slot img { left: calc((var(--slot) - 36px) / 2); top: calc((var(--slot) - 36px) / 2); }
}
@media (min-width: 561px) and (max-width: 1100px) { body.playing .window .grid { --slot: 38px; gap: 2px; } }

/* ── windows: inside the safe zone, header fixed, body scrolls ── */
body.playing .window:not(.docked) {
  max-width: min(var(--win-max, 420px), calc(var(--zone-w) - 8px));
  max-height: calc(var(--zone-h) - 8px - var(--tabs-h));
}
body.playing .window:not(.docked) > header { flex: none; min-width: 0; }
body.playing .window:not(.docked) > header .t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.playing .window:not(.docked) > .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
#w-quest { --win-max: 580px; } #w-bank { --win-max: 620px; } #w-help { --win-max: 460px; } #w-costume { --win-max: 470px; } #w-collect { --win-max: 440px; }
/* the pixel scrollbar: a dark well, a brass thumb with hard edges, no arrows */
.window .body, .window .body *, #quest-track, #chat-log, #inv-grid, #inv-detail { scrollbar-width: thin; scrollbar-color: var(--b-mid) var(--sf0, #0c0a10); }
.window .body::-webkit-scrollbar, .window .body *::-webkit-scrollbar, #quest-track::-webkit-scrollbar, #chat-log::-webkit-scrollbar, #inv-grid::-webkit-scrollbar, #inv-detail::-webkit-scrollbar { width: 8px; height: 8px; }
.window .body::-webkit-scrollbar-track, .window .body *::-webkit-scrollbar-track, #quest-track::-webkit-scrollbar-track, #chat-log::-webkit-scrollbar-track, #inv-grid::-webkit-scrollbar-track, #inv-detail::-webkit-scrollbar-track { background: var(--sf0, #0c0a10); box-shadow: inset 2px 0 0 var(--sf0, #07060b); }
.window .body::-webkit-scrollbar-thumb, .window .body *::-webkit-scrollbar-thumb, #quest-track::-webkit-scrollbar-thumb, #chat-log::-webkit-scrollbar-thumb, #inv-grid::-webkit-scrollbar-thumb, #inv-detail::-webkit-scrollbar-thumb { background: var(--b-mid); border: 2px solid var(--sf0, #0c0a10); border-radius: 0; box-shadow: inset 1px 1px 0 var(--b-hi), inset -1px -1px 0 var(--b-lo); }
.window .body::-webkit-scrollbar-button, .window .body *::-webkit-scrollbar-button { display: none; }

/* a folded window: just its title, a tab along the bottom-right of the zone; a press unfolds it */
body.playing .window.mini { width: auto !important; max-width: 200px; min-width: 0; z-index: 9 !important; cursor: pointer;
  border: 2px solid var(--ink); border-image: none; background: var(--frame-bg, rgba(24, 20, 31, .96)); box-shadow: inset 0 0 0 2px var(--rim, #5a4426); padding: 2px 3px; }
body.playing .window.mini > .body { display: none; }
body.playing .window.mini > header { height: 22px; margin: 0; padding: 0; border: 0; cursor: pointer; gap: 4px; }
body.playing .window.mini > header kbd { display: none; }
body.playing .window.mini > header .t { padding: 0 6px; }
body.playing .window.mini > header .t::before { content: "▴ "; }
body.playing .window.mini > header .x { width: 18px; height: 18px; }
body.playing .window.mini:hover { box-shadow: inset 0 0 0 2px var(--b-mid); }

/* ── text: Korean words stay whole, a long run still wraps; one-line labels end in an ellipsis ── */
.window, #tip, #tut, #quest-track, #dead-by, #invite, #party-hud { word-break: keep-all; overflow-wrap: break-word; }
#tip, .window .say, .window .q-title, .window .ds, #tut p { overflow-wrap: anywhere; }
#quest-track .qh, #party-hud .pm .nm, #mini-name, .window .list .it .nm, .window .skill .hd b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#toasts p { max-width: calc(var(--vpw) - 24px); white-space: normal; word-break: keep-all; overflow-wrap: anywhere; text-align: center; }
#prompt { max-width: calc(var(--vpw) - 16px); overflow: hidden; text-overflow: ellipsis; }

/* ── ≤ 1100 wide: a narrower side column, glyph-only menu, a compact unit frame and hotbar ── */
@media (max-width: 1100px) {
  body[data-lay="full"] #dock { gap: 6px; }
  body[data-lay="full"] #inv-grid { --slot: 36px; }
  body[data-lay="full"] #inv-grid .slot img { left: 0; top: 0; }
  body[data-lay="full"] #mini .sunk { height: clamp(88px, 17vh, 150px); }
  body[data-lay="full"] #chat-tabs button { padding: 2px 5px; }
  body[data-lay="full"] #status { gap: 4px; }
  body[data-lay="full"] #status .face { width: 38px; height: 38px; }
  body[data-lay="full"] #st-face { width: 34px; height: 34px; }
  body[data-lay="full"] .st-main { flex-basis: 150px; }
  body[data-lay="full"] #actions { --act: 36px; gap: 1px; }
  body[data-lay="full"] #actions .sep { margin: 0 1px; }
  body[data-lay="full"] #actions .act img { margin-top: 0; }
  body[data-lay="full"] #actions .act.atk { width: 42px; height: 42px; }
  body[data-lay="full"] #actions .act.atk img { margin-top: 3px; }
  body[data-lay="full"] #wm { gap: 4px; }
  body[data-lay="full"] #wm .wm-c { max-width: 160px; }
}
/* ── short screens: a shorter dock (client.js dockH), a smaller map, a lower cap on the quest list ── */
@media (max-height: 640px) {
  body[data-lay="full"] #side { gap: 4px; }
  body[data-lay="full"] #mini-info { display: none; }
  body[data-lay="full"] #center { gap: 2px; }
  body[data-lay="full"] #chat { gap: 2px; }
}
/* ── phones (≤ 860 wide): a narrower floating chat and drawer, smaller slots in windows ── */
@media (max-width: 860px) {
  body[data-lay="port"] #chat { width: min(220px, 58vw); }
  body[data-lay="land"] #chat { width: min(240px, calc(100vw - 480px)); min-width: 150px; }
}

/* ─────────────── the radar and the map window (radar.js) ─────────────── */
/* (kept in one block: the radar's frame, its bar, the 지도 menu button, #w-map) */
#mini .sunk { height: clamp(120px, 27vh, 232px); cursor: pointer; }
@media (max-height: 640px) { body[data-lay="full"] #mini .sunk { height: 112px; } }
#mini-cv { object-fit: fill; }
#mini-bar { display: flex; align-items: center; gap: 3px; min-height: 18px; }
#mini-xy { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: var(--t10)/1 var(--pix9); color: var(--tx2, #e8dcb8); white-space: nowrap; padding-left: 2px; }
/* the pinned landscape radar is 164 px wide: the zoom % gives way so −, +, ▾ and 지도 all stay on screen */
body[data-lay="land"]:not(.drawer) :is(#mini-pct, #mini-map kbd) { display: none; }
body[data-lay="land"]:not(.drawer) #mini-bar { gap: 2px; }
body[data-lay="land"]:not(.drawer) #mini-bar .mini-b { padding: 0 3px; }
#mini-pct { font: var(--t10)/1 var(--pix9); color: var(--tx2, #b8a8d8); white-space: nowrap; padding: 0 2px; }
#mini-bar .mini-b { height: 18px; min-width: 20px; padding: 0 5px; font: var(--t12)/1 var(--pix); color: var(--cream); background: var(--sf4, #3a3146); border: 2px solid var(--ink); border-radius: 0;
  box-shadow: inset 1px 1px 0 var(--sf5, #5b4d6c), inset -1px -1px 0 var(--sf2, #1f1a28); cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
#mini-bar .mini-b:hover { background: var(--sf4h, #463b55); color: var(--tx, #fff6dc); }
#mini-bar .mini-b:disabled { opacity: .4; cursor: default; }
#mini-bar #mini-map { color: #2a1806; background: var(--b-mid); box-shadow: inset 1px 1px 0 var(--b-hi), inset -1px -1px 0 var(--b-lo); }
#mini-bar #mini-map kbd { font: var(--t9)/1 var(--pix9); color: #5a3a10; }
#mini-bar #mini-fb { min-width: 18px; padding: 0 3px; }
#mini-bar #mini-fb.on, #mini-bar #mini-fb.some { color: var(--tx-hd, var(--b-hi)); }
#mini-bar #mini-fb.some::after { content: ""; width: 3px; height: 3px; margin-left: 1px; background: #ffb040; }
/* 표시: what the radar draws (radar.js setHide), one chip per kind; a struck chip is hidden */
#mini-fl { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px 0 1px; }
#mini-fl[hidden] { display: none; }
#mini-fl button { flex: 1 1 auto; height: 18px; padding: 0 2px; font: var(--t10)/1 var(--pix9); color: #2a1806; background: var(--b-mid); border: 2px solid var(--ink); border-radius: 0; box-shadow: inset 1px 1px 0 var(--b-hi), inset -1px -1px 0 var(--b-lo); cursor: pointer; }
#mini-fl button.off { color: var(--tx3, #9a90a8); background: var(--sf1, #18141f); box-shadow: none; text-decoration: line-through; }
#mini-fl button i { display: inline-block; width: 5px; height: 5px; margin-right: 2px; border: 1px solid var(--ink); vertical-align: 0; }
/* the quest tracker: ▾ / ▸ fold a section, 고정 keeps the tracker over a side-panel window (hud.js tracker) */
#quest-track .qt-fold { width: 12px; padding: 0; margin: 0 2px 0 0; border: 0; background: none; color: var(--tx-hd2, var(--b-mid)); font: var(--t12)/1 var(--pix); cursor: pointer; vertical-align: 0; }
#quest-track .qt-fold:hover { color: var(--tx, #fff6dc); }
#quest-track .qt.folded { opacity: .8; }
#quest-track .qf { display: none !important; }
#quest-track .qt-pin { float: right; margin: 2px 0 2px 4px; padding: 1px 4px; font-size: var(--t10); }
#quest-track .qt-pin.on { color: #2a1806; background: var(--b-mid); box-shadow: inset 1px 1px 0 var(--b-hi), inset -1px -1px 0 var(--b-lo); }
body:not([data-lay="full"]) #quest-track .qt-pin { display: none; }
body[data-lay="full"] #panel.on.pin > #quest-track { display: block; flex: 0 1 auto; max-height: 32%; margin-bottom: 4px; border-bottom: 2px solid var(--sf3, #2c2537); }
body.touch #mini-bar #mini-map kbd { display: none; }
/* 15 menu buttons: eight to a row */
#menu { grid-template-columns: repeat(8, 1fr); }
#menu button span { white-space: nowrap; letter-spacing: -1px; }

/* a wide window in the safe zone (see the responsive block above): --win-max lifts the 420 px cap */
#w-map { --win-max: 680px; width: min(680px, calc(var(--zone-w) - 8px)); }
#w-map .body { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; }
#map-tabs { display: flex; align-items: center; gap: 3px; margin: 0; }
#map-zoom { margin-left: auto; display: flex; gap: 3px; }
#map-zoom[hidden] { display: none; }
#map-box { height: clamp(150px, calc(var(--zone-h) - var(--tabs-h) - 172px), 470px); background: var(--sf0, #07060c); display: flex; }
#map-box[hidden], #map-legend[hidden], #map-info[hidden] { display: none; }
#map-buildings { padding: 5px 7px; color: var(--tx, #eee0b9); font: 11px var(--pix); }
#map-buildings[hidden] { display: none; }
.map-building-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; margin-bottom: 5px; }
.map-building-head span { color: var(--tx2, #b9ab97); }
#map-building-list { display: flex; flex-wrap: wrap; gap: 4px; max-height: 112px; overflow: auto; padding: 1px 2px 2px 1px; }
#map-building-list button { min-height: 27px; }
#map-cv { width: 100%; height: 100%; display: block; image-rendering: pixelated; touch-action: none; }
#map-info { min-height: 15px; font: var(--t11)/1.3 var(--pix); color: var(--tx2, #e8dcb8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#map-legend { display: flex; flex-wrap: wrap; gap: 2px 9px; font: var(--t10)/1.3 var(--pix9); color: var(--tx2, #b8ac90); }
#map-legend span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
#map-legend img { image-rendering: pixelated; }
body[data-lay="port"] #map-box, body[data-lay="land"] #map-box { height: clamp(150px, calc(100vh - 200px), 420px); }
body[data-lay="port"] #w-map.map-has-buildings #map-box { height: clamp(175px, calc(100dvh - 360px), 340px); }
body[data-lay="land"] #w-map.map-has-buildings #map-box { height: clamp(130px, calc(100dvh - 230px), 260px); }
#w-map.world-chart { --win-max: 900px; width: min(900px, calc(var(--zone-w) - 8px)); }
#w-map.world-chart #map-box { flex: 0 0 auto; height: clamp(250px, calc(var(--zone-h) - var(--tabs-h) - 180px), 555px); background: #5c4638; }
#w-map.world-chart.map-has-detail #map-box { height: clamp(200px, calc(var(--zone-h) - var(--tabs-h) - 264px), 475px); }
#map-region-bar { display: flex; align-items: center; gap: 7px; color: var(--tx, #eee0b9); font: 11px var(--pix); }
#map-world-name { margin-inline-start: auto; color: var(--tx-gold, #f0d7a3); font-size: 13px; white-space: nowrap; }
#map-region-bar[hidden], #map-detail[hidden] { display: none; }
#map-region { max-width: 72%; min-height: 26px; background: var(--sf2, #211b2c); color: var(--tx, #f0e0b6); border: 1px solid var(--sf5, #6c5c49); padding: 2px 6px; }
#map-detail { padding: 6px 8px; flex: 0 0 auto; }
.map-detail-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--tx-gold, #eac880); }
.map-detail-head span { color: var(--tx2, #cfc3a7); font-size: 11px; }
.map-guide { margin: 3px 0 5px; color: var(--tx-ok, #a8ebd3); font-size: 11px; overflow-wrap: anywhere; }
.map-detail-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 8px; color: var(--tx2, #ded2b9); font-size: 11px; }
.map-detail-key { color: var(--tx3, #b3a787); }
.map-detail-buttons { display: flex; gap: 4px; flex-wrap: wrap; }
.map-detail-buttons button { padding: 3px 7px; min-height: 23px; }
.map-fast-travel { align-items: center; padding: 5px 0; margin-bottom: 5px; border-bottom: 1px solid var(--sf5, #665544); color: var(--tx, #eee0b9); font-size: 11px; }
.map-fast-travel button:not(:disabled) { border-color: #d3aa6c; color: var(--tx-gold, #ffdf92); }
.map-fast-travel span { color: var(--tx2, #cfc3a7); }
.res-filters { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 5px; }
.res-list { max-height: min(410px, calc(100dvh - 150px)); padding: 6px 8px; overflow: auto; }
.res-list h4 { margin: 8px 0 3px; color: var(--tx-gold, #eac880); }
.res-list h4:first-child { margin-top: 0; }
.res-row { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 8px; min-height: 40px; padding: 4px 0; border-bottom: 1px solid var(--sf4, #554038); }
.res-row:last-child { border-bottom: 0; }
.res-row small { display: block; color: var(--tx2, #cfc3a7); overflow-wrap: anywhere; }
.res-row button { min-height: 29px; }
body[data-lay="port"] #w-map.world-chart #map-box { height: clamp(280px, calc(100dvh - 250px), 485px); }
body[data-lay="land"] #w-map.world-chart #map-box { height: clamp(175px, calc(100dvh - 120px), 385px); }
body[data-lay="port"] #w-map.world-chart.map-has-detail #map-box { height: clamp(195px, calc(100dvh - 500px), 340px); }
body[data-lay="land"] #w-map.world-chart.map-has-detail #map-box { height: clamp(145px, calc(100dvh - 170px), 270px); }
body[data-lay="port"] #w-map.world-chart .map-detail-buttons { gap: 5px; }
body.touch #map-zoom button, body.touch .map-detail-buttons button { min-height: 32px; }
/* ─────────────────────────── the bag's size and a house of one's own (housing.js) ─────────────────────────── */
/* the bag grows to 100 slots: on a desktop the docked bag scrolls in its column (above); in the
   phone drawer it scrolls past four rows, in the landscape drawer past six */
#inv-grid { overscroll-behavior: contain; }
body[data-lay="port"] #inv-grid { max-height: calc(4 * 42px); overflow-y: auto; overflow-x: hidden; }
body[data-lay="land"] #inv-grid { max-height: calc(6 * 42px); overflow-y: auto; overflow-x: hidden; }
#inv-grow { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
#inv-grow .cap { font: var(--t10) var(--pix9); color: var(--tx2, #c8b896); white-space: nowrap; }
#inv-grow .max { font: var(--t10) var(--pix9); color: var(--tx-ok, #9af0ae); }
#inv-grow .btn { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; font-size: var(--t11) !important; padding: 2px 6px !important; }
#inv-grow .btn img { vertical-align: middle; }
#house-hud { left: 50%; transform: translateX(-50%); top: 8px; z-index: 6 !important; display: flex; align-items: center; gap: 6px; padding: 4px 8px; color: var(--tx-gold, #f4e4b0); max-width: calc(var(--vpw) - 16px); }
#house-hud b { font: 700 var(--t12)/1.3 var(--pix); color: var(--tx-hd, var(--b-hi)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 4px; }
#house-hud .btn { font-size: var(--t11) !important; padding: 2px 7px !important; white-space: nowrap; }
body[data-lay="port"] #house-hud { top: 56px; }
body.in-house #tut { display: none !important; }
#w-house { width: min(400px, calc(100vw - 8px)); }
#w-house .say { margin: 0 0 8px; line-height: 1.55; }
.house-top { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.house-top .btn, .window .deco-up { display: inline-flex; align-items: center; gap: 3px; }
.house-visit { display: flex; flex-wrap: wrap; gap: 4px; }
.house-visit .section { flex-basis: 100%; }
.furn-shop, .deco-placed { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; padding-right: 2px; }
.furn-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; background: var(--sf1, #1c1724); border: 1px solid var(--sf3, #2c2537); cursor: default; }
.furn-row.sel { border-color: var(--b-hi); background: var(--sf3, #2c2336); }
.furn-row img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.furn-row .nm { flex: 1; font: var(--t12) var(--pix); color: var(--tx-gold, #f4e4b0); min-width: 0; }
.furn-row .nm em { font: var(--t10) var(--pix9); font-style: normal; margin-left: 6px; color: var(--tx2, #a898b8); }
.furn-row .nm em.store { color: var(--tx-info, #8ad8ff); } .furn-row .nm em.rest { color: var(--tx-bad, #ffb0c8); }
.furn-row .have { font: var(--t10) var(--pix9); color: var(--tx-ok, #9af0ae); white-space: nowrap; }
.furn-row .btn { font-size: var(--t11) !important; padding: 2px 6px !important; white-space: nowrap; }
.deco-placed .furn-row { cursor: pointer; }
.deco-placed .furn-row img { width: 24px; height: 24px; }
#w-deco { width: min(360px, calc(100vw - 8px)); }
#w-deco .deco-sum { margin: 0 0 4px; font: var(--t11) var(--pix9); color: var(--tx2, #c8b896); }
.deco-grid { grid-template-columns: repeat(6, 42px); max-height: calc(2 * 45px); overflow-y: auto; }
.deco-hand { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; font: var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); }
.deco-hand:empty { display: none; }
.deco-hand .hint { flex-basis: 100%; margin: 0; }
.deco-hand .why { flex-basis: 100%; margin: 0; font: var(--t11) var(--pix9); color: var(--tx-ok, #9af0ae); min-height: 12px; }
.deco-hand .why.bad { color: var(--tx-bad, #ff9a8a); }
.deco-style { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin-bottom: 4px; }
.deco-style .lb { font: var(--t11) var(--pix9); color: var(--tx2, #a898b8); width: 28px; }
.deco-style .btn { font-size: var(--t10) !important; padding: 2px 5px !important; }
.deco-style .btn.on { color: #2a1806; background: var(--b-mid); opacity: 1; }
#w-hstore { width: min(620px, calc(100vw - 8px)); }
#w-hstore .bank-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; font: var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); }
/* ─────────────────────────── life skills: the 생활 window (life.js) ─────────────────────────── */
#w-life { width: min(360px, calc(100vw - 8px)); }
#w-life .life-card .dh b { display: flex; align-items: center; gap: 4px; }
#w-life .life-card .dh .lv { color: var(--tx-hd, var(--b-hi)); font: var(--t12) var(--pix); }
#w-life .life-card .bar { height: 14px; }
#w-life .life-card .df { flex-wrap: wrap; justify-content: space-between; gap: 0 8px; color: var(--tx2, #cfc8b8); }
#w-life .life-card .df small { white-space: nowrap; }
#w-life .life-card .df .next { color: var(--tx2, #a898b8); white-space: nowrap; }
#w-life .life-card.soon { opacity: .55; }
#w-life .life-card.clickable { cursor: pointer; }
#w-life .life-card.clickable:hover { border-color: var(--b-mid); }
#w-life .life-card .fish-tag { margin-left: 4px; font: var(--t10) var(--pix9); color: var(--tx-info, #8ad8ff); }
#w-fish { width: min(360px, calc(100vw - 8px)); }
#w-fish .life-card .dh .lv { color: var(--tx-hd, var(--b-hi)); font: var(--t12) var(--pix); }
#w-fish .life-card .df { flex-wrap: wrap; justify-content: space-between; gap: 0 8px; color: var(--tx2, #cfc8b8); }
#w-fish .life-card .df .next { color: var(--tx-gold, #ffd84a); }
/* ─────────────── jobs and stats (J3): 능력치 tab, 카이, 무기 · 스킬, 전직의 길, 아르센 (statwin.js, jobtree.js) ─────────────── */
/* the EXP bar glows (two steps, no blur) while a point is affordable; it and the mastery strip open their windows */
#exp, #wm { cursor: pointer; }
#wm .wm-c { position: relative; }
#wm .wm-tab { position: absolute; right: 0; top: -1px; font: var(--t9)/1 var(--pix9); padding: 1px 2px; color: var(--tx3, #9a90a8); background: var(--scr); border: 1px solid var(--ink); }
body.touch #wm .wm-tab { display: none; }
#exp.ready { border-color: var(--b-mid); animation: exp-ready 1.2s steps(2) infinite; }
#exp.ready i { background: linear-gradient(#fff4c8 0 2px, #f0c860 2px 7px, #a4782a 7px); }
@keyframes exp-ready { 50% { border-color: var(--b-hi); box-shadow: inset 0 0 0 1px #f4dfa4; } }
.window .tabs button.ready::after { content: " ★"; color: var(--tx-gold, #ffe070); }
.window .tabs button.on.ready::after { color: #7a3a0a; }
#skill-tabs { display: flex; gap: 3px; margin: 0 0 6px; }
#w-char .wr-tabs button.ready::after { content: " ★"; color: var(--tx-gold, #ffe070); }

/* the stat tab */
.statwin { display: flex; flex-direction: column; gap: 5px; }
.statwin[hidden] { display: none; }
.sw-head { font: var(--t12) var(--pix); color: var(--tx2, #e8dcb8); }
.sw-head b { color: var(--tx-hd, var(--b-hi)); }
.sw-head b.xp { color: var(--tx-ok, #9af0ae); }
.sw-hand { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; font: var(--t12) var(--pix); color: var(--tx2, #e8dcb8); }
.sw-hand .wi { width: 16px; height: 16px; image-rendering: pixelated; }
.sw-hand b { color: var(--tx-hd, var(--b-hi)); }
.sw-hand small { flex-basis: 100%; color: var(--tx2, #a898b8); }
.window .sw-away { margin: 0; padding: 3px 6px; color: var(--tx-gold, #ffcf8a); background: var(--sf2, #2a1c14); border: 2px solid var(--rim, #5a3a1a); box-shadow: none; }
.sw-rows { display: flex; flex-direction: column; gap: 2px; }
.sw-row { display: grid; grid-template-columns: 1fr 52px auto; grid-template-rows: auto auto; gap: 0 6px; align-items: center; padding: 3px 6px 3px 4px;
  background: var(--scr); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433); }
.sw-row.hand { border-color: var(--rim, #6e5226); }
.sw-row.lit { border-color: var(--b-mid); background: var(--sf1, #1c1724); }
.sw-row .nm { display: flex; align-items: center; gap: 4px; min-width: 0; }
.sw-row .nm b { font: var(--t12) var(--pix); color: var(--cream); }
.sw-row .gr { font: var(--t10)/1 var(--pix9); padding: 1px 3px; color: #2a1806; background: var(--b-mid); box-shadow: inset 1px 1px 0 var(--b-hi), inset -1px -1px 0 var(--b-lo); }
.sw-row .val { display: flex; align-items: baseline; justify-content: flex-end; gap: 2px; }
.sw-row .val b { font: var(--t12) var(--pix); color: var(--tx-info, #cfe2f6); }
.sw-row .val b.cap1 { color: var(--tx-gold, #ffd27a); }
.sw-row .val b.cap2 { color: var(--tx-bad, #ff9a6a); }
.sw-row .val .pn { font: var(--t10) var(--pix9); font-style: normal; color: var(--tx-ok, #9af0ae); }
.sw-row .pmb { display: flex; gap: 2px; }
.window .sw-row .pmb .btn.pm { width: 22px; height: 20px; padding: 0 !important; font: var(--t12)/1 var(--pix) !important; }
.window .sw-row .pmb .btn.pm:disabled { opacity: .35; }
.sw-row .ef { grid-column: 1 / 3; color: var(--tx2, #a898b8); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-row .nx { justify-self: end; color: var(--tx2, #c8b896); white-space: nowrap; }
.sw-foot { display: flex; align-items: center; gap: 4px; padding: 4px 0 2px; border-top: 2px solid var(--sf3, #2c2537); }
.sw-foot .sum { flex: 1; min-width: 0; font: var(--t12) var(--pix); color: var(--tx2, #e8dcb8); }
.sw-foot .sum b { color: var(--tx-hd, var(--b-hi)); }
.sw-foot .sum b.bad { color: var(--tx-bad, #ff8a7a); }
.window .sw-foot .btn:disabled { opacity: .45; }
.sw-dv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 12px; padding: 5px 8px; background: var(--scr); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433); }
.sw-dv span { display: flex; justify-content: space-between; gap: 6px; font: var(--t12)/1.5 var(--pix); color: var(--tx2, #b8ac90); padding: 0 2px; }
.sw-dv span b { color: var(--tx-info, #cfe2f6); font-weight: 400; }
.sw-dv span.lit { color: #2a1806; background: var(--b-mid); }
.sw-dv span.lit b { color: #2a1806; }
.statwin .hint { margin: 0; }

/* 수련관 카이 */
#w-train { width: min(360px, calc(var(--zone-w) - 8px)); }
.tw-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 6px 0; }
.window .tw-card { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 3px 4px; cursor: pointer; color: var(--cream);
  background: var(--sf3, #2a2433); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf4, #3e344b), inset -2px -2px 0 var(--sf1, #17131d); font: inherit; }
.window .tw-card:hover { background: var(--sf4, #352c42); }
.window .tw-card.on { background: var(--sf4, #4e4030); box-shadow: inset 2px 2px 0 #8a7448, inset -2px -2px 0 var(--sf2, #1f1a28), 0 0 0 2px var(--b-hi); }
.tw-card .wi { width: 32px; height: 32px; image-rendering: pixelated; }
.tw-card b { font: var(--t12) var(--pix); }
.tw-card .st { color: var(--tx-hd, var(--b-hi)); }
.tw-card .fl { color: var(--tx2, #b8ac90); text-align: center; line-height: 1.3; }
.tw-go { display: flex; align-items: center; gap: 6px; font: var(--t10)/1.4 var(--pix9); color: var(--tx2, #c8b896); margin-bottom: 4px; }
.tw-go span { flex: 1; }
.window .tw-go .btn:disabled { opacity: .45; }
.tw-sec { margin-top: 6px; }
.tw-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: var(--t12) var(--pix); color: var(--tx2, #e8dcb8); margin-top: 4px; }
.tw-line .free { color: var(--tx-ok, #9af0ae); }
.tw-line .fee { color: var(--tx-gold, #ffcf8a); }
.window .tw-txt { margin: 4px 0 0; color: var(--tx2, #b8ac90); line-height: 1.45; }
.window .confirm { margin-top: 5px; padding: 5px 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; background: var(--sf2, #2a1c14); border: 2px solid var(--rim, #8a5a2a); }
.window .confirm p { flex-basis: 100%; margin: 0 0 2px; color: var(--tx-gold, #ffe2a8); line-height: 1.45; }
.window .confirm .btn:disabled { opacity: .45; }

/* K: 무기 · 스킬 */
#w-skill { --win-max: 440px; width: min(440px, calc(var(--zone-w) - 8px)); }
.wp-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.window .wp-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 0 6px; align-items: center; padding: 3px 4px; text-align: left; cursor: pointer; color: var(--cream);
  background: var(--scr); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433); font: inherit; }
.window .wp-row:hover { background: var(--sf1, #1c1724); }
.window .wp-row.sel { border-color: var(--b-mid); background: var(--sf2, #221b2b); }
.window .wp-row.hand { box-shadow: inset 0 0 0 2px var(--rim, #6e5226); }
.wp-row .wi { width: 36px; height: 36px; padding: 0; box-sizing: border-box; image-rendering: pixelated; background: var(--sf1, #1a1622); border: 2px solid var(--ink); }
.wp-row.hand .wi { border-color: var(--b-mid); }
.wp-row .mid { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wp-row .t { display: flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.wp-row .t b { font: var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); margin-right: 3px; }
.wp-row .t .lv { font: var(--t12) var(--pix); color: var(--tx-info, #cfe2f6); }
.wp-row .t small { color: var(--tx3, #7a7088); }
.wp-row .tag { font: var(--t10)/1 var(--pix9); font-style: normal; padding: 1px 3px; margin-left: 3px; color: #2a1806; background: var(--b-mid); }
.wp-row .tag.back { background: #8a7aa0; }
.wp-row .tag.job { background: #6ad08a; }
.wp-row .bar { display: block; position: relative; height: 6px; background: #000; border: 1px solid #000; box-shadow: inset 0 0 0 1px var(--sf3, #2c2537); }
.wp-row .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#d4ffe4 0 1px, #8fe0b4 1px 3px, #2f7a5c 3px); }
.wp-row .sc { color: var(--tx2, #a898b8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wp-row .chips { display: flex; gap: 2px; }
.chip { position: relative; width: 22px; height: 22px; display: grid; place-items: center; background: var(--sf1, #1a1622); border: 2px solid var(--ink); }
.chip img { width: 16px; height: 16px; image-rendering: pixelated; }
/* skill chips: the 32×32 skill icons at 1× (skillicons.js) */
.wp-row .chips { grid-column: 2 / -1; }   /* under the name: four 36-px chips do not fit beside it in the side panel */
.chips .chip { width: 36px; height: 36px; }
.chips .chip img { width: 32px; height: 32px; }
.chip.pas { border-color: #3a5a8a; }
.chip.sig { border-color: var(--rim, #7a5a22); }
.chip.off img { filter: grayscale(1) brightness(.45); }
.chip i { position: absolute; right: -1px; bottom: -2px; font: var(--t9)/1 var(--pix9); font-style: normal; color: #f4dfa4; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
.wp-skills .skill { margin-bottom: 4px; }
#tip .hint.ok { color: var(--tx-ok, #9af0ae); }

/* 전직의 길: the tree (absolute nodes over a canvas of 2-px pixel lines) */
.jt-root { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; padding: 3px 6px; margin-bottom: 6px; font: var(--t12) var(--pix); color: #e8dcb8;
  background: #2a2433; border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 #3e344b, inset -2px -2px 0 #17131d; }
.jt-root b { color: var(--b-hi); }
.jt-root.cur { background: var(--b-mid); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
.jt-root.cur b, .jt-root.cur small { color: #2a1806; }
.jt-root small { flex-basis: 100%; color: #b8ac90; }
.jt-progress { display: flex; align-items: center; gap: 5px; width: 100%; color: #d8cbb8; font: 10px var(--pix); margin-top: 5px; }
.jt-progress progress { flex: 1; min-width: 30px; height: 7px; accent-color: #e8ba64; }
.jt-wrap { overflow: hidden; display: flex; justify-content: center; }
.jt-map { position: relative; flex: none; }
.jt-map canvas { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
.window .jt-node { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; cursor: pointer;
  color: #8a8098; background: #1a1622; border: 2px solid #2a2236; box-shadow: inset 2px 2px 0 #2a2433, inset -2px -2px 0 #0c0a10; font: inherit; overflow: hidden; }
.jt-node b { font: var(--t12)/1.1 var(--pix); letter-spacing: -1px; white-space: nowrap; }
.jt-node small { font: var(--t10)/1 var(--pix9); white-space: nowrap; }
.window .jt-node.half { color: #c8b896; border-color: #5a4426; }
.window .jt-node.ok { color: #d4ffe4; border-color: #4ac06a; background: #18301f; animation: pulse 1.2s steps(2) infinite; }
.window .jt-node.cur { color: #2a1806; background: var(--b-mid); border-color: var(--ink); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
.window .jt-node.shut { opacity: .45; }
.window .jt-node.sel { outline: 2px solid var(--b-hi); outline-offset: 0; z-index: 1; }
.window .jt-node:hover { filter: brightness(1.2); }
.jt-wpn { position: absolute; display: grid; grid-template-columns: 16px 1fr; grid-template-rows: 16px 11px 4px; gap: 1px 4px; align-items: center; padding: 1px 4px 2px; box-sizing: border-box;
  background: var(--scr); border: 2px solid #3a3146; }
.jt-wpn .wi { width: 16px; height: 16px; image-rendering: pixelated; }
.jt-wpn b { font: var(--t12)/1 var(--pix); color: #cfe2f6; white-space: nowrap; }
.jt-wpn.ready b { color: #f4d27a; }
.jt-wpn small { grid-column: 1 / -1; text-align: center; font: var(--t10)/1 var(--pix9); color: #e8dcb8; white-space: nowrap; }
.jt-wpn .bar { grid-column: 1 / -1; position: relative; height: 4px; background: #000; }
.jt-wpn .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #8fe0b4; }
.jt-wpn.ready { border-color: #b88a3a; }
.jt-wpn.ready .bar i { background: #f4d27a; }
.jt-wpn.hand { box-shadow: 0 0 0 2px #6e5226; }
/* a job's card (the tree's pick, 아르센's list) */
.jt-card { margin-top: 6px; padding: 5px 7px; background: var(--scr); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 #07060b, inset -2px -2px 0 #2a2433; }
.jt-card.ok { border-color: #4ac06a; }
.jt-card.cur { border-color: var(--b-mid); }
.jt-card .hd { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.jt-card .hd .wi, .jt-need .wi { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: middle; }
.jt-card .hd b { font: var(--t12) var(--pix); color: var(--b-hi); margin-left: 2px; }
.jt-card .hd small { color: #a898b8; }
.jt-card .hd em { margin-left: auto; font: var(--t10)/1 var(--pix9); font-style: normal; padding: 2px 4px; color: #2a1806; background: #8a8098; }
.jt-card .hd em.ok { background: #6ad08a; }
.jt-card .hd em.cur { background: var(--b-mid); }
.jt-card .hd em.half { background: #c8a050; }
.jt-need { display: flex; flex-wrap: wrap; gap: 0 10px; margin-top: 3px; font: var(--t12) var(--pix); }
.jt-need .ok { color: #9af0ae; }
.jt-need .no { color: #ff9a8a; }
.jt-sig { display: grid; grid-template-columns: 38px 1fr; gap: 0 6px; margin-top: 4px; }
.jt-sig .ic { width: 38px; height: 38px; padding: 1px; image-rendering: pixelated; background: #1a1622; border: 2px solid #7a5a22; box-sizing: border-box; }
.jt-sig b { font: var(--t12) var(--pix); color: #e8c27a; }
.jt-sig small { color: #8ab4ff; }
.window .jt-sig p { margin: 1px 0 0; line-height: 1.45; color: #cfc8b8; }
.jt-scale { display: flex; flex-direction: column; margin-top: 4px; font: var(--t12) var(--pix); color: #e8dcb8; }
.jt-scale small { color: #a898b8; }
.jt-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; margin-top: 5px; padding-top: 4px; border-top: 2px solid #2c2537; }
.jt-foot small { color: #c8b896; flex: 1 1 160px; }
.window .jt-foot .btn:disabled { opacity: .45; }
.jt-foot .confirm { flex-basis: 100%; }
/* 전직관 아르센 */
#w-job { width: min(380px, calc(var(--zone-w) - 8px)); }
.jt-near { display: flex; flex-direction: column; gap: 2px; }
.window .jt-near .it { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; padding: 3px 6px; }
.jt-near .tx b { font: var(--t12) var(--pix); color: #c8b896; }
.jt-near .jt-need { margin: 0; }
.jt-more { display: flex; justify-content: flex-end; margin-top: 6px; }

/* 전직의 길: 7 weapons × 2 branches at mastery 30 */
.jt-branches { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.jt-brow { display: grid; grid-template-columns: 82px minmax(0, 1fr) minmax(0, 1fr); gap: 4px; align-items: stretch; }
.jt-bw { display: grid; grid-template-columns: 16px 1fr; grid-template-rows: 14px 10px 4px; gap: 1px 4px; align-items: center; padding: 3px 4px;
  background: var(--scr); border: 2px solid #3a3146; box-sizing: border-box; min-width: 0; }
.jt-bw .wi { width: 16px; height: 16px; grid-row: 1 / 3; image-rendering: pixelated; }
.jt-bw b { font: var(--t10)/1.1 var(--pix); color: #e8dcb8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jt-bw small { font: var(--t10)/1 var(--pix9); color: #9db0c8; white-space: nowrap; }
.jt-bw .bar { grid-column: 1 / -1; position: relative; height: 4px; background: #000; }
.jt-bw .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #8fe0b4; }
.jt-brow.ready .jt-bw { border-color: #b88a3a; }
.jt-brow.ready .jt-bw b, .jt-brow.ready .jt-bw small { color: #f4d27a; }
.jt-brow.ready .jt-bw .bar i { background: #f4d27a; }
.jt-brow.hand .jt-bw { box-shadow: inset 0 0 0 1px #8f6b2a; }
.window .jt-bnode { display: flex; align-items: center; gap: 4px; padding: 3px 4px; min-width: 0; width: 100%; box-sizing: border-box; cursor: pointer; text-align: left;
  color: #c8b896; background: #1e1928; border: 2px solid #3e3450; box-shadow: inset 2px 2px 0 #2e263c, inset -2px -2px 0 #0e0b14; font: inherit; }
.jt-bnode img { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
.jt-bnode b { font: var(--t10)/1.1 var(--pix); letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.jt-bnode small { margin-left: auto; font: var(--t10)/1 var(--pix9); color: #f4d27a; }
.window .jt-bnode.ok { color: #d4ffe4; border-color: #4ac06a; background: #18301f; }
.window .jt-bnode.cur { color: #2a1806; background: var(--b-mid); border-color: var(--ink); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
.window .jt-bnode.cur small { color: #2a1806; }
.window .jt-bnode.shut { opacity: .48; }
.window .jt-bnode.sel { outline: 2px solid var(--b-hi); outline-offset: 0; z-index: 1; }
.window .jt-bnode:hover { filter: brightness(1.18); }

/* legacy grid rules kept for preview compatibility */
.jt-grid { display: grid; grid-template-columns: 30px repeat(var(--weapon-count, 6), minmax(0, 1fr)); grid-template-rows: 34px repeat(var(--weapon-count, 6), 38px); gap: 2px; flex: 1 1 auto; width: 100%; max-width: 402px; box-sizing: border-box; }
.jt-grid .jt-node.long b { letter-spacing: -2px; }
.jt-grid > * { min-width: 0; box-sizing: border-box; }
.window .jt-grid .jt-node { position: relative; }
.window .jt-grid .jt-node.single { border-color: #4a3f5a; background: #221b2b; }
.window .jt-grid .jt-node.mine { box-shadow: inset 0 0 0 1px #6e5226, inset 2px 2px 0 #2a2433; }
.window .jt-grid .jt-node.half { color: #e8dcb8; }
.window .jt-grid .jt-node.ok { border-color: #4ac06a; background: #18301f; }
.window .jt-grid .jt-node.cur { color: #2a1806; background: var(--b-mid); border-color: var(--ink); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
.window .jt-grid .jt-node { justify-content: flex-start; gap: 1px; padding: 3px 0 0; }
.jt-grid .jt-node b { line-height: 12px; }
.jt-grid .jt-node .bars { position: absolute; left: 2px; right: 2px; bottom: 1px; display: flex; gap: 2px; height: 3px; }
.jt-grid .jt-node .bars > i { position: relative; flex: 1; background: #000; }
.jt-grid .jt-node .bars > i > i { position: absolute; left: 0; top: 0; bottom: 0; background: #8fe0b4; }
.jt-grid .jt-node .bars > i.full > i { background: #f4d27a; }
.jt-grid .jt-node.cur .bars { display: none; }
.jt-corner { display: flex; align-items: center; justify-content: center; opacity: .6; }
.jt-h { position: relative; display: grid; align-items: center; background: var(--scr); border: 2px solid #3a3146; }
.jt-h.top { grid-template-columns: 16px 1fr; grid-template-rows: 16px 9px; gap: 0 3px; padding: 1px 3px 5px; overflow: hidden; }
.jt-h.side { grid-template-columns: 1fr; grid-template-rows: 16px 11px; justify-items: center; padding: 1px 1px 5px; }
.jt-h .wi { width: 16px; height: 16px; image-rendering: pixelated; }
.jt-h b { font: var(--t12)/1 var(--pix); color: #cfe2f6; white-space: nowrap; }
.jt-h.side b { font: var(--t10)/1 var(--pix9); }
.jt-h small { grid-column: 1 / -1; text-align: center; font: var(--t10)/1 var(--pix9); color: #e8dcb8; white-space: nowrap; }
.jt-h .bar { position: absolute; left: 2px; right: 2px; bottom: 1px; height: 3px; background: #000; }
.jt-h .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #8fe0b4; }
.jt-h .bar u { position: absolute; top: -1px; bottom: 0; width: 1px; background: #f4d27a; }
.jt-h.half { border-color: #6a5a3a; }
.jt-h.ready { border-color: #b88a3a; }
.jt-h.half b, .jt-h.ready b { color: #f4d27a; }
.jt-h.ready .bar i { background: #f4d27a; }
.jt-h.hand { box-shadow: 0 0 0 2px #6e5226; z-index: 1; }
.jt-h.back { box-shadow: 0 0 0 2px #4a3f5a; }
.jt-key { grid-row: 2 / 4; grid-column: 4 / 8; align-self: start; display: flex; flex-direction: column; gap: 3px; padding: 4px 6px; font: var(--t10)/1.2 var(--pix9); color: #c8b896;
  background: #1a1622; border: 2px dashed #3a3146; }
.jt-key span { display: flex; align-items: center; gap: 4px; }
.jt-key span i { flex: none; width: 8px; height: 8px; border: 2px solid #2a2236; background: #1a1622; }
.jt-key span.single i { border-color: #4a3f5a; background: #221b2b; }
.jt-key small { color: #8a8098; font: inherit; }

/* ─────────────── empty paper-doll slots: what goes there (uiicons.js eq_*, at 2×) and the slot's name ─────────────── */
.doll .slot.empty .ph { align-items: flex-start; padding-top: 1px; }
.doll .slot.empty .ph img.gi { width: 24px; height: 24px; opacity: .3; }
.doll .slot.empty .cap { position: absolute; left: -2px; right: -2px; bottom: -1px; text-align: center; font: var(--t9)/9px var(--pix9); color: var(--b-mid); opacity: .75;
  white-space: nowrap; letter-spacing: -1px; pointer-events: none; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000; }
.doll .slot.empty:hover .ph img.gi { opacity: .5; }
.doll .slot.empty:hover .cap { color: var(--tx-hd, var(--b-hi)); opacity: 1; }
/* ── gathering (gather.js): the "반짝!" prompt over the channel bar, the bar's colour, the 재료 주머니 ── */
#gat-tap { left: calc(var(--vpw) / 2); transform: translateX(-50%); top: calc(var(--vph) - 118px); padding: 5px 16px; z-index: 8;
  font: 13px var(--pix); white-space: nowrap; color: #fff2a0; cursor: pointer; animation: gat-tap .28s steps(2) infinite alternate; }
#gat-tap.good { color: #b8f07a; animation: none; }
@keyframes gat-tap { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.08); } }
#cast.gat > i { border-color: #3e5a22; }
#cast.gat > i > i { background: #8fd060; }
.window .pouch { margin-top: 6px; }
.window .pouch:empty { display: none; }
.window .pouch-hd { display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px 6px; background: var(--sf1, #1a1622); border: 2px solid var(--sf4, #3a3146);
  color: var(--cream); font: var(--t12) var(--pix); cursor: pointer; text-align: left; }
.window .pouch-hd b { font-weight: 400; color: var(--tx-hd, var(--b-hi)); }
.window .pouch-hd span { margin-left: auto; color: var(--tx2, #a898b8); }
.window .pouch-hd::after { content: "▸"; color: var(--tx2, #a898b8); }
.window .pouch-hd.open::after { content: "▾"; }
.window .pouch .hint { margin: 4px 2px 0; }
.window .pouch-grid { --slot: 36px; display: grid; grid-template-columns: repeat(auto-fill, var(--slot)); gap: 2px; margin-top: 4px; justify-content: start; }
.window .pouch-grid .slot { width: var(--slot); height: var(--slot); }
.window .pouch-grid .slot img { left: 2px; top: 2px; }
.window .pouch-grid .slot.full .n { color: var(--tx-bad, #ffb04a); }
/* ── life stations (station.js): the 제작 · 연금 · 요리 window #w-craft ── */
#w-craft { --win-max: 460px; width: min(460px, calc(var(--zone-w) - 8px)); }
#w-craft .st-top { margin-bottom: 6px; }
#w-craft .st-top b { color: var(--tx-hd, var(--b-hi)); font: var(--t12) var(--pix); }
#w-craft .st-list { max-height: min(300px, 40vh); overflow-y: auto; border: 2px solid var(--sf4, #3a3146); background: var(--sf1, #17131d); padding: 2px; }
#w-craft .st-band { margin: 4px 2px 2px; padding: 1px 4px; font: var(--t11) var(--pix); color: var(--tx-hd2, var(--b-mid)); border-bottom: 2px solid var(--sf4, #3a3146); }
#w-craft .st-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border: 2px solid transparent; cursor: pointer; }
#w-craft .st-row:hover { background: var(--sf2, #241e2c); }
#w-craft .st-row.sel { background: var(--sf3, #2e2638); border-color: var(--b-mid); }
#w-craft .st-row > img { width: 32px; height: 32px; image-rendering: pixelated; border: 2px solid var(--ink); background: var(--sf1, #1a1622); flex: none; }
#w-craft .st-row .tx { min-width: 0; flex: 1; }
#w-craft .st-row .nm { display: flex; align-items: center; gap: 4px; font: var(--t12) var(--pix); color: var(--cream); }
#w-craft .st-row .nm b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#w-craft .st-row .nm .lv { margin-left: auto; color: var(--tx2, #a898b8); font-size: var(--t11); }
#w-craft .st-row .nm .tag { padding: 0 3px; font-size: var(--t10); color: #2a1806; background: var(--b-mid); }
#w-craft .st-row .ins { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 1px; font: var(--t11) var(--pix); color: var(--tx2, #cfe8b0); }
#w-craft .st-row .ins .in { display: inline-flex; align-items: center; gap: 1px; }
#w-craft .st-row .ins img { width: 16px; height: 16px; image-rendering: pixelated; }
#w-craft .st-row .ins .short { color: var(--tx-bad, #ff8a7a); }
#w-craft .st-row .ins .fee { margin-left: auto; color: var(--tx-hd, var(--b-hi)); }
#w-craft .st-row .ins .fee.short { color: var(--tx-bad, #ff8a7a); }
#w-craft .st-row .why, #w-craft .st-detail .why { display: block; color: var(--tx-bad, #ff9a8a); font: var(--t11) var(--pix); }
#w-craft .st-row.lock { cursor: default; }
#w-craft .st-row.lock > img, #w-craft .st-row.lock .ins { filter: grayscale(1); opacity: .5; }
#w-craft .st-row.lock .nm { color: var(--tx3, #8a8094); }
#w-craft .st-detail { margin-top: 6px; padding: 6px 8px; }
#w-craft .st-detail small { display: block; color: var(--tx2, #d8d2c2); font: var(--t11) var(--pix); }
#w-craft .st-dh b { font: var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); font-weight: 400; }
#w-craft .st-detail .btns { display: flex; align-items: center; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
#w-craft .st-detail .btns .btn:disabled { opacity: .45; }
#w-craft .st-detail .btns .btn.small { min-width: 22px; }
#w-craft .st-n { min-width: 18px; text-align: center; font: var(--t12) var(--pix); color: var(--cream); }
#w-craft .st-detail .st-bt { display: inline; margin-left: 6px; color: var(--tx2, #a898b8); }

/* ── the 알바 board, delivery and trust (board.js): #w-board, #dl, .rep-badge ── */
#w-board { --win-max: 420px; width: min(420px, calc(var(--zone-w) - 8px)); }
#w-board .body { max-height: min(520px, calc(var(--zone-h) - 48px)); overflow-y: auto; }
.window .jb-card { margin-top: 6px; }
.window .jb-card .dh b { display: flex; align-items: center; gap: 4px; }
.window .jb-card .dh .tag { padding: 0 4px; font: var(--t10) var(--pix); color: #2a1806; background: var(--b-mid); }
.window .jb-card .say { margin: 3px 0; padding: 0; background: none; box-shadow: none; border: 0; font: var(--t12)/1.45 var(--pix); color: var(--cream); }
.window .jb-card .df { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; color: #cfc8b8; font: var(--t11) var(--pix); }
.window .jb-card .df .pay { color: var(--b-hi); }
.window .jb-card .btns { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.window .jb-card .btns .btn:disabled { opacity: .45; }
.window .jb-card .why { color: #ff9a8a; font: var(--t11) var(--pix); }
.window .jb-card .ok { display: block; margin-top: 3px; color: #9af0ae; font: var(--t11) var(--pix); }
.window .jb-card .where { display: block; margin: 2px 0; color: #ffe08a; font: var(--t11)/1.45 var(--pix); }   /* a line-height, or a wrapped line runs into the pay row below */
.window .jb-card .late { display: block; color: #ffb08a; font: var(--t11) var(--pix); }
.window .jb-card .bar { height: 14px; background: #000; border: 1px solid #000; }
.window .jb-card .bar b { line-height: 14px; }
.window .jb-card .bar i { background: linear-gradient(#f6dc98 0 2px, #c8a04e 2px); }
.window .jb-card.on { border-color: var(--b-mid); box-shadow: inset 0 0 0 1px var(--b-hi); }
.window .jb-card.done { opacity: .55; }
.window .rs-card small { display: block; }
#w-board .ds { font: var(--t11) var(--pix); color: var(--tx2, #cfc8b8); }
#w-life .btns { display: flex; gap: 6px; margin: 4px 0; }
/* the 알바 window (board.js renderAlba, Shift+J): the job in hand with its countdown, co-op shifts, trust */
#w-alba .ds { margin: 1px 0; font: var(--t11) var(--pix); color: var(--tx2, #cfc8b8); }
#w-alba .btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
#w-alba .daily-top b { margin-left: auto; color: var(--tx2, #cfc8b8); font: var(--t11) var(--pix); }
#w-alba .trk-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 2px 0; }
#w-alba .trk-row small { color: var(--tx2, #cfc8b8); font: var(--t11)/1.4 var(--pix); }
#w-alba .trk-row small.ok { color: var(--tx-ok, #9af0ae); }
.window .alba-clock { margin: 3px 0; padding: 2px 6px; font: var(--t12) var(--pix); color: var(--tx-gold, #ffe08a); background: var(--sf1, #1a1420); box-shadow: inset 0 0 0 1px #000; }
.window .alba-clock.late, #quest-track .jb-clock.late { color: #ff6a5a; }
#quest-track .jb-clock { color: #ffe08a; font-weight: 700; }
/* trust: tier tag, a bar with marks at the tiers, the number (talk window, shop header, 생활 window) */
.rep-badge { display: flex; align-items: center; gap: 6px; font: var(--t11) var(--pix); color: var(--tx2, #cfc8b8); cursor: help; }
.rep-badge .tier { flex: none; padding: 0 4px; color: var(--tx, #e8e0d0); background: var(--sf4, #3a3146); box-shadow: inset 0 0 0 1px #000; }
.rep-badge.t1 .tier { color: #2a1806; background: #c8a04e; }
.rep-badge.t2 .tier { color: #10240e; background: #8fd060; }
.rep-badge.t3 .tier { color: #2a0a1a; background: #ff9ac8; }
.rep-badge .bar { position: relative; flex: 1; min-width: 60px; height: 6px; margin: 0; background: #000; border: 1px solid #000; overflow: visible; }
.rep-badge .bar i { background: linear-gradient(#ffc8de 0 1px, #e0608e 1px); }
.rep-badge .bar u { position: absolute; top: -2px; bottom: -2px; width: 1px; background: #f4e6c0; opacity: .7; }
.rep-badge small { flex: none; min-width: 44px; text-align: right; }
#talk-rep { margin-bottom: 4px; }
#talk-rep:empty, #shop-rep:empty, #talk-jb:empty { display: none; }
#shop-rep { margin: 2px 0 6px; }
#w-shop .tx small s { color: var(--tx3, #8a8094); }
#w-shop .tx small .deal { color: var(--tx-ok, #9af0ae); font-weight: 400; }
#w-life .rep-list { display: flex; flex-direction: column; gap: 3px; }
#w-life .rep-row { display: flex; align-items: center; gap: 8px; font: var(--t12) var(--pix); }
#w-life .rep-row > b { flex: 0 0 96px; font-weight: 400; color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#w-life .rep-row .rep-badge { flex: 1; }
#prompt.jb b { color: var(--tx-gold, #ffe08a); }
/* the parcel's countdown, just over the cast bar's place */
#dl { position: fixed; left: calc(var(--vpw) / 2); top: calc(var(--vph) - 112px); transform: translateX(-50%); z-index: 7; width: 220px; text-align: center; pointer-events: none; }
#dl b { display: block; font: var(--t12) var(--pix); color: #f0c088; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; margin-bottom: 2px; }
#dl > i { display: block; height: 8px; background: #000; border: 2px solid #6a4418; overflow: hidden; }
#dl > i > i { display: block; height: 100%; width: 100%; background: #d49a58; transition: width .2s linear; }
#dl.late b { color: #ff8a7a; }
#dl.late > i > i { background: #e05a4a; }

/* ── 참 (charms.js): the bag's 참 tab, 참 보드 #w-charm, 주아나 #w-juana ── */
#w-charm { --cc: 38px; }
#w-charm:not(.docked) { --win-max: 300px; width: min(300px, calc(var(--zone-w) - 8px)); }
#w-juana { --win-max: 380px; width: min(380px, calc(var(--zone-w) - 8px)); }
#w-juana .body, #w-charm:not(.docked) .body { max-height: min(680px, calc(var(--zone-h) - 48px)); overflow-y: auto; }
#inv-tabs { margin: 0 0 4px; }
#inv-tabs button { padding: 2px 8px; }
#inv-charms { display: flex; flex-direction: column; gap: 3px; max-height: 300px; overflow-y: auto; }
.cm-card { display: flex; gap: 6px; padding: 4px 5px; background: var(--scr); border: 2px solid var(--ink); border-left: 4px solid var(--cm-grade); cursor: pointer; font: var(--t11)/1.4 var(--pix); color: var(--tx2, #cfc8b8); }
.cm-card:hover, .cm-card.sel { border-top-color: var(--b-mid); border-right-color: var(--b-mid); border-bottom-color: var(--b-mid); }
.cm-card .ic { flex: none; width: 32px; height: 32px; image-rendering: pixelated; }
.cm-card .tx { flex: 1; min-width: 0; }
.cm-card .hd { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cm-card .hd b { font: 700 var(--t12) var(--pix); }
.cm-card .af { color: var(--tx-ok, #9be0a8); } .cm-card .lg { color: var(--cm-grade); } .cm-card .ds { color: var(--tx2, #a8a0b4); }
.cm-tag { flex: none; padding: 0 4px; font: var(--t10)/14px var(--pix); color: #17131d; background: var(--cm-grade); box-shadow: inset 0 0 0 1px #000; white-space: nowrap; }
.cm-level { color: var(--tx2, #cfc8b8); font: var(--t11)/1.4 var(--pix); }
.cm-level.low { color: var(--tx-bad, #ff9a8a); }
.cm-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.cm-fig { flex: none; vertical-align: middle; image-rendering: pixelated; }
.slot.charm::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--cm-grade); }
.window .btn.danger { color: #fff; background: #a83a3a; box-shadow: inset 2px 2px 0 #d86a5a, inset -2px -2px 0 #6a1e24; }
.cm-drag { position: fixed; z-index: 999; width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; opacity: .9; }
/* the board */
.cm-note { margin: 0 0 4px; padding: 2px 6px; font: var(--t11) var(--pix); color: #2a1806; background: var(--b-mid); box-shadow: inset 0 0 0 1px #000; }
.cm-grid { display: grid; gap: 2px; width: max-content; margin: 2px auto 4px; padding: 5px; background: var(--sf1, #17131d); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--rim, #5a4426), 0 0 0 1px #b88a48; touch-action: none; user-select: none; }
.cm-grid.shake { animation: cm-shake .28s steps(4); }
@keyframes cm-shake { 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }
.cm-grid .cc { position: relative; width: var(--cc); height: var(--cc); box-sizing: border-box; background: var(--sf3, #2a2433); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -1px -1px 0 var(--sf4, #3e344b); }
.cm-grid .cc.lock { background: repeating-linear-gradient(45deg, var(--sf1, #1b1722) 0 4px, var(--sf2, #231e2c) 4px 8px); box-shadow: inset 0 0 0 1px var(--sf0, #0c0a10); }
.cm-grid .cc.lock::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 7px; margin: -2px 0 0 -4px; background: var(--sf4, #4a4256); box-shadow: 0 -4px 0 -2px var(--sf1, #1b1722), 0 -4px 0 0 var(--sf4, #4a4256); }
.cm-grid .cc.lock.next { box-shadow: inset 0 0 0 2px #b88a48; }
.cm-grid .cc.lock.next::after { background: #e8c060; box-shadow: 0 -4px 0 -2px var(--sf1, #1b1722), 0 -4px 0 0 #e8c060; }
.cm-grid .cc.on { background: color-mix(in srgb, var(--cm-grade) 34%, var(--sf3, #2a2433)); box-shadow: none; border: 0 solid var(--cm-grade); cursor: grab; margin: -1px; width: calc(var(--cc) + 2px); height: calc(var(--cc) + 2px); z-index: 1; }
.cm-grid .cc.on.et { border-top-width: 3px; } .cm-grid .cc.on.er { border-right-width: 3px; } .cm-grid .cc.on.eb { border-bottom-width: 3px; } .cm-grid .cc.on.el { border-left-width: 3px; }
.cm-grid .cc.on.sel { filter: brightness(1.35); outline: 1px dashed #fff; outline-offset: -5px; }
.cm-grid .cc.on.away { opacity: .35; }
.cm-grid .cc .cm-tile { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; image-rendering: pixelated; pointer-events: none; }
.cm-grid .cc.low .cm-tile { opacity: .5; }
.cm-grid .cc .mk, .cm-chip .mk { position: absolute; right: 1px; bottom: 0; font: var(--t10) var(--pix9); color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none; }
.cm-grid .cc.pend::before { content: ""; position: absolute; inset: 3px; border: 2px dashed #e2c486; animation: cm-blink .5s steps(2) infinite; z-index: 2; }
@keyframes cm-blink { 50% { opacity: .3; } }
.cm-grid .cc.gh::before { content: "✓"; position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-start; justify-content: flex-end; padding: 1px 2px; font: 700 12px var(--pix); color: #dfffe0; text-shadow: 1px 1px #223525; background: linear-gradient(#4ba46c44, #4ba46c44), var(--cm-ghost) center / 32px 32px no-repeat; image-rendering: pixelated; box-shadow: inset 0 0 0 2px #7af09a; animation: none; border: 0; }
.cm-grid .cc.gh.bad::before { content: "✕"; color: #ffe0dc; background-image: linear-gradient(#a7365466, #a7365466), var(--cm-ghost); box-shadow: inset 0 0 0 2px #ff8a7a; }
.cm-bar { display: flex; gap: 4px; justify-content: center; margin: 2px 0; }
.cm-bar .btn:disabled, #w-juana .btn:disabled { opacity: .45; }
.cm-msg { min-height: 16px; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; font: var(--t11) var(--pix); color: var(--tx2, #cfc8b8); text-align: center; }
.cm-msg.err { color: var(--tx-bad, #ff9a8a); }
.cm-tray { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; min-height: 40px; padding: 3px; background: var(--scr); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf0, #07060b); }
.cm-chip { position: relative; display: flex; align-items: center; gap: 3px; height: 36px; padding: 0 4px 0 0; background: var(--sf3, #2a2433); border: 2px solid var(--cm-grade); cursor: grab; touch-action: none; user-select: none; }
.cm-chip.low { cursor: not-allowed; } .cm-chip.low img { opacity: .5; }
.cm-chip.sel { background: var(--sf5, #4a3f5c); box-shadow: 0 0 0 1px #fff; } .cm-chip.away { opacity: .35; }
.cm-chip img { width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; }
.cm-chip .mk { left: 1px; right: auto; }
.cm-tray .hint { margin: 0 4px; }
.cm-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; font: var(--t11)/1.5 var(--pix); color: var(--tx2, #cfc8b8); }
.cm-sum .r { display: flex; gap: 4px; align-items: baseline; min-width: 0; }
.cm-sum .r span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-sum .r b { color: var(--tx-ok, #9be0a8); font-weight: 400; }
.cm-sum .r.wide { grid-column: 1 / -1; }
.cm-sum .r.zero b { color: var(--tx3, #8a8296); }
.cm-lg { padding: 4px 6px; background: var(--scr); border: 2px solid var(--cm-grade); font: var(--t11)/1.45 var(--pix); color: var(--tx2, #cfc8b8); }
.cm-lg.off { border-color: var(--sf5, #6a6274); border-style: dashed; }
.cm-lg .hd { display: flex; align-items: center; gap: 5px; }
.cm-lg .hd img { width: 16px; height: 16px; image-rendering: pixelated; }
.cm-lg .hd b { flex: 1; color: var(--cm-grade); font: 700 var(--t12) var(--pix); } .cm-lg.off .hd b { color: var(--tx2, #a8a0b4); }
.cm-state { padding: 0 4px; color: #17131d; background: #7af09a; } .cm-state.off { background: #ff9a8a; }
#w-charm .err-line, #w-juana .why, .cm-row .why { color: var(--tx-bad, #ff9a8a); font: var(--t11) var(--pix); }
#w-charm .hint, #w-juana .hint { font: var(--t11)/1.4 var(--pix); color: var(--tx2, #a8a0b4); margin: 3px 0; }
/* 주아나 */
.cm-top { display: flex; gap: 8px; align-items: flex-start; }
.cm-top .say { flex: 1; margin: 0; }
.cm-face { flex: none; width: 64px; height: 64px; image-rendering: pixelated; background: var(--sf3, #2a2433); border: 2px solid var(--ink); box-shadow: inset 0 0 0 1px var(--rim, #5a4426); }
.cm-quest .bar { position: relative; height: 14px; margin: 4px 0; background: #000; border: 1px solid #000; }
.cm-quest .bar i { display: block; height: 100%; background: linear-gradient(#f6dc98 0 2px, #c8a04e 2px); }
.cm-quest .bar b { position: absolute; inset: 0; text-align: center; font: var(--t10)/14px var(--pix9); color: #fff; text-shadow: 1px 1px 0 #000; }
.cm-quest .pay { display: block; color: var(--tx-hd, var(--b-hi)); font: var(--t11) var(--pix); }
.cm-quest .say { margin: 3px 0; padding: 0; background: none; border: 0; box-shadow: none; }
#w-juana .btns { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
#w-juana .btns small, #w-juana small.ok { font: var(--t11) var(--pix); color: var(--tx2, #a8a0b4); } #w-juana small.ok { display: block; color: var(--tx-ok, #9af0ae); }
/* ── 장날 상인 (fairmkt.js): #w-fairmkt, one merchant's list; a bought row greys out ── */
#w-fairmkt { --win-max: 420px; width: min(420px, calc(var(--zone-w) - 8px)); }
#w-fairmkt .body { max-height: min(640px, calc(var(--zone-h) - 48px)); overflow-y: auto; }
#w-fairmkt .fm-head { margin: 0 0 6px; }
#w-fairmkt .fm-clock { color: var(--tx-gold, #f3dca6); white-space: nowrap; }
#w-fairmkt .it canvas { width: 32px; height: 32px; flex: none; image-rendering: pixelated; background: var(--sf1, #1a1622); border: 2px solid var(--ink); }
#w-fairmkt .it .nm { display: block; }
#w-fairmkt .it .fm-lg { color: var(--tx-gold, #f3dca6); }
#w-fairmkt .it > button { flex: none; }
#w-fairmkt .it.bought { opacity: .5; filter: grayscale(.85); }
#w-fairmkt .hint { font: var(--t11)/1.4 var(--pix); color: var(--tx2, #a8a0b4); margin: 3px 0; }
.cm-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 3px 0; padding: 3px 5px; background: var(--scr); border: 2px solid var(--ink); font: var(--t11) var(--pix); color: var(--tx2, #cfc8b8); }
.cm-row > img { flex: none; width: 32px; height: 32px; image-rendering: pixelated; }
.cm-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cm-row .tx b { font: 700 var(--t12) var(--pix); color: var(--cream); }
.cm-row .tx small { display: flex; align-items: center; gap: 3px; color: var(--tx2, #a8a0b4); }
.cm-row .tx small img { width: 16px; height: 16px; image-rendering: pixelated; }
.cm-row .cost { color: var(--tx-hd, var(--b-hi)); }
.cm-ask { flex: 1 1 100%; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 4px; background: var(--sf4, #3a3146); box-shadow: inset 0 0 0 1px var(--b-mid); color: var(--cream); }
.cm-ask span { flex: 1; }
.cm-mini { flex: none; display: grid; gap: 1px; padding: 2px; background: var(--sf1, #17131d); }
.cm-mini i { width: 7px; height: 7px; background: var(--sf2, #231e2c); }
.cm-mini i.on { background: var(--sf5, #6a6078); } .cm-mini i.nx { background: #ffd84a; box-shadow: 0 0 0 1px #fff; animation: cm-blink .6s steps(2) infinite; }
.cm-reveal { position: relative; overflow: hidden; display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; margin: 6px 0; padding: 6px; background: var(--scr); border: 2px solid var(--cm-grade); font: var(--t11)/1.45 var(--pix); color: var(--tx2, #cfc8b8); animation: cm-pop .4s steps(4); }
.cm-reveal.g3 { --ray-strength: 45%; box-shadow: 0 0 0 1px #9c4b27, inset 0 0 0 1px #9c4b27; }
.cm-reveal .big { position: relative; flex: none; width: 64px; height: 64px; image-rendering: pixelated; animation: cm-rise .5s steps(5); }
.cm-reveal .tx { position: relative; flex: 1; min-width: 0; }
.cm-reveal .btns { position: relative; flex: 1 1 100%; }
.cm-reveal .ray { position: absolute; left: -12px; top: -12px; width: 100px; height: 100px; background: repeating-conic-gradient(color-mix(in srgb, var(--cm-grade) var(--ray-strength, 22%), transparent) 0 12deg, transparent 12deg 30deg); animation: cm-ray .9s steps(6) 1 forwards; }
.cm-reveal.g3 .ray { animation: cm-ray 2.4s steps(12) infinite; }
@keyframes cm-pop { 0% { filter: brightness(3); } 100% { filter: none; } }
@keyframes cm-rise { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); } }
@keyframes cm-ray { 0% { transform: rotate(0); opacity: 1; } 100% { transform: rotate(60deg); opacity: .5; } }

/* ── job emblems, glyph chips and the detail card (jobicons.js, infocard.js) ──
   A glyph that stands for a word is `.info`: the name on hover, its card (#info) on a click or a tap. */
img.ji { width: 16px; height: 16px; flex: none; image-rendering: pixelated; vertical-align: -4px; }
.info { cursor: help; }
.info:focus-visible { outline: 1px solid var(--b-hi); outline-offset: 1px; }
#info { position: fixed; z-index: 90; width: 252px; max-width: calc(100vw - 8px); padding: 8px 10px 9px; background: var(--sf1, #18141f); border: 2px solid var(--ink); border-radius: 0; box-shadow: inset 0 0 0 2px var(--rim, #7a5c30), 4px 4px 0 rgba(0, 0, 0, .45);
  font: var(--t12)/1.5 var(--pix); color: var(--tx2, #e8dcb8); word-break: keep-all; overflow-wrap: anywhere; }
#info[hidden] { display: none; }
#info header { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 2px solid var(--sf3, #2c2537); }
#info header .ic { width: 32px; height: 32px; flex: none; image-rendering: pixelated; padding: 2px; background: var(--scr); border: 2px solid var(--ink); box-sizing: content-box; cursor: default; }
#info header .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#info header .tt b { font: 700 var(--t12)/1.3 var(--pix); color: var(--tx-hd, var(--b-hi)); }
#info header .tt small { font: var(--t10)/1.3 var(--pix9); color: var(--tx2, #a898b8); }
#info header .x { position: relative; flex: none; align-self: flex-start; width: 20px; height: 20px; padding: 0; cursor: pointer; border: 2px solid var(--ink); background: var(--sf4, #3a3146); box-shadow: inset 2px 2px 0 var(--sf5, #5b4d6c), inset -2px -2px 0 var(--sf2, #1f1a28); }
#info header .x::before, #info header .x::after { content: ""; position: absolute; left: 3px; right: 3px; top: 7px; height: 2px; background: #e8dcb8; transform: rotate(45deg); }
#info header .x::after { transform: rotate(-45deg); }
#info p { margin: 0 0 5px; }
#info .rows { display: flex; flex-direction: column; gap: 1px; margin: 0 0 6px; padding: 4px 6px; background: var(--scr); border: 2px solid var(--ink); }
#info .rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
#info .rows span:first-child { color: var(--tx2, #a898b8); flex: none; }
#info .rows b { color: var(--tx-info, #cfe2f6); font-weight: 400; text-align: right; }
#info p.how { color: var(--tx2, #c8d8b8); }
#info p.how em { display: inline-block; margin-right: 6px; padding: 0 4px; font: var(--t10)/14px var(--pix9); font-style: normal; color: #2a1806; background: var(--b-mid); }
#info .btn { display: block; width: 100%; margin-top: 2px; padding: 4px 6px; cursor: pointer; font: var(--t12) var(--pix); color: #2a1806; background: var(--b-mid); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
#info .btn:hover { background: #dcae62; }
/* a sum of gold: the coin, then the number */
.coin { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: var(--tx-hd, var(--b-hi)); vertical-align: bottom; }
.coin img.gi { width: 12px; height: 12px; flex: none; }
.coin b { font-weight: 400; color: inherit; }
.coin.deal { color: var(--tx-ok, #9af0ae); }
.coin.short { color: var(--tx-bad, #ff8a7a); }
.coin.ink { color: #2a1806; }
.coin.ink img.gi { filter: brightness(.3); }
.coin.purse { margin-left: auto; }
/* the unit frame: the emblem before the name, glyphs before the bars */
#st-job { flex: none; display: flex; align-self: center; margin-right: -2px; }
#status .row #st-name { flex: 1 1 auto; }
#st-job img.ji { vertical-align: 0; margin: -2px 0; }
#status .meter em { display: flex; white-space: nowrap; overflow: visible; align-items: center; justify-content: center; }
#status .meter em img.gi { width: 12px; height: 12px; image-rendering: pixelated; margin-top: -2px; }
#st-gold.info { width: max-content; }
/* the tracker: a kind glyph in place of the word */
#quest-track .qt img.gi { width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; }
/* the bag header */
#inv-count { display: inline-flex; align-items: center; gap: 3px; }
#inv-count img.gi { width: 12px; height: 12px; }
#inv-count.full { color: var(--tx-bad, #ff8a7a); }
/* rows of people */
#party-hud .pm { grid-template-columns: 16px 1fr; }
.pframe .cg img.ji, .window .list .it .cg img.ji { vertical-align: 0; }
.window .list .it .cg { flex: none; display: flex; }
.window .list .rk img.ji { margin-right: -2px; }
#chat-log .who img.ji { margin-right: 2px; }
#char-title img.ji { vertical-align: 0; }
.sv-ct span img.ji { margin-right: 4px; }
/* the sheets: readable icon + Korean label + right-aligned bold value cards */
.window .stats { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.char-ap-banner {
  width: 100%; padding: 4px 8px; cursor: pointer; text-align: center;
  font: var(--t11) var(--pix); color: #ffe488;
  background: linear-gradient(180deg, #3a2a14 0%, #24190c 100%);
  border: 1px solid var(--b-mid); box-shadow: inset 1px 1px 0 rgba(255, 228, 136, 0.25);
}
.char-ap-banner:hover { filter: brightness(1.15); }
.window .stats .grp {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px 6px;
  padding: 5px 6px 6px; background: var(--scr);
  border: 2px solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433);
}
.window .stats .grp.six { grid-template-columns: repeat(3, 1fr); gap: 3px 5px; }
.window .stats .grp h4 {
  grid-column: 1 / -1; margin: 0 0 2px; padding-bottom: 2px;
  font: var(--t10) var(--pix); color: var(--tx-hd, var(--b-hi));
  border-bottom: 1px solid rgba(212, 178, 108, 0.22); letter-spacing: 0.5px;
}
.window .stats .grp span.chip, .sw-dv span.chip {
  display: flex; align-items: center; justify-content: flex-start; gap: 4px;
  min-width: 0; width: auto; height: auto; padding: 2px 5px;
  background: rgba(110, 82, 38, 0.08); border: 1px solid rgba(110, 82, 38, 0.22);
  cursor: pointer;
}
.window .stats .grp span.chip img.gi, .sw-dv span.chip img.gi { width: 12px; height: 12px; flex: none; }
.window .stats .grp span.chip .lbl, .sw-dv span.chip .lbl {
  font: var(--t10) var(--pix); color: #5c452d;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.window .stats .grp span.chip b, .sw-dv span.chip b {
  margin-left: auto; font: var(--t11) var(--pix); color: #24160b; white-space: nowrap;
}
.window .stats .grp span.chip:hover, .sw-dv span.chip:hover, .sw-row .nm.info:hover {
  background: rgba(207, 159, 85, 0.25); border-color: rgba(154, 108, 42, 0.55);
}
.sw-dv { grid-template-columns: repeat(2, 1fr); gap: 3px 6px; }
.element-sheet {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px 6px;
  padding: 5px 6px; background: var(--scr); border: 2px solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433);
}
.element-sheet .el-cell {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 2px 5px; background: rgba(110, 82, 38, 0.08); border: 1px solid rgba(110, 82, 38, 0.2);
}
.element-sheet .el-nm { font: var(--t10) var(--pix); white-space: nowrap; text-shadow: 0 1px 0 rgba(255,255,255,0.45); }
.element-sheet .el-v { font: var(--t10) var(--pix); color: #2b1d12; white-space: nowrap; }
.sw-head { display: flex; align-items: center; gap: 6px; }
.sw-head .xpn { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; }
.sw-row { grid-template-columns: 1fr auto 34px auto; grid-template-rows: auto; }
.sw-row .nx { order: 1; }
.sw-row .val { order: 2; }
.sw-row .pmb { order: 3; }
/* 전직의 길 */
.jt-grid .jt-node img.ji { display: block; margin: 1px auto 2px; }
.window .jt-grid .jt-node.shut { opacity: .7; }
.jt-root img.ji, .jt-card .hd img.ji, .jt-near img.ji { vertical-align: 0; }
.jt-card .hd img.ji { width: 32px; height: 32px; margin-right: 4px; }
/* phones: the card is as wide as the screen allows and the glyphs are finger-sized targets */
body.touch #info { width: min(300px, calc(100vw - 16px)); font-size: 13px; }
body.touch .window .stats .grp span.chip, body.touch .sw-dv span.chip { min-height: 24px; }
/* the attack buttons: the glyph alone (the name and the key are the tooltip) */
body[data-lay="full"] #actions .act .nm { display: none; }
/* the desktop menu: the 12 px glyph (1:1, no blur) over its word in Galmuri 9 at the size it was drawn for;
   the full name and the key are the hover tooltip (hud.js setupHud) */
body[data-lay="full"] #menu button { height: 32px; gap: 3px; }
body[data-lay="full"] #menu button span { font: 9px/1 var(--pix9); letter-spacing: 0; }
#menu button { min-width: 0; overflow: hidden; }
#tip.mn-tip { width: max-content; max-width: 240px; padding: 5px 8px 6px; }
@media (max-width: 1100px) { body[data-lay="full"] #menu { grid-template-columns: repeat(6, 1fr); } }

/* friends and blocks in the party window (win_social.js friendBox), the weekly book (win_world.js renderWeek) */
.window .list.friends .online { flex: none; width: 10px; font-size: var(--t10); color: var(--tx3, #6c6478); }
.window .list.friends .online.on { color: var(--tx-ok, #8fe07a); }
.window .list .it.off { opacity: .72; }
.window .friend-add { display: flex; gap: 4px; margin: 4px 0 2px; }
.window .friend-add input { flex: 1 1 auto; min-width: 0; font: var(--t12)/1.2 var(--pix); }
.window .week-boxes { display: grid; grid-template-columns: 1fr; gap: 2px; }
.window .week-boxes .dcard { padding: 3px 6px; }
.window .week-boxes .dcard .dh b { font-size: var(--t11); }
.window .hint.gold { color: var(--tx-gold, #f0d080); }
.window .pity { color: var(--tx-gold, #e2c486); }

/* 글자 크기 (설정): integer px steps so the pixel font stays crisp; the canvas world is not scaled */
body[data-ts="s"] { --t9: 8px; --t10: 9px; --t11: 10px; --t12: 11px; }
body[data-ts="l"] { --t9: 11px; --t10: 12px; --t11: 13px; --t12: 14px; }
.seg { display: inline-flex; gap: 2px; margin-left: auto; }
.seg .btn.on { background: var(--b-mid); color: #2a1806; }
#keys-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; max-height: 190px; overflow-y: auto; padding: 4px 6px; margin: 2px 0 4px; background: var(--scr); border: 2px solid var(--ink); scrollbar-width: thin; }
#keys-list .kg { grid-column: 1 / -1; color: var(--tx-hd2, var(--b-mid)); margin-top: 3px; }
#keys-list .kr { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
#keys-list .kr .btn { min-width: 64px; text-align: center; }
#keys-list .kr .btn.cap { background: var(--b-mid); color: #2a1806; }
body.touch .set-keys { display: none !important; }
#w-settings .set-row { flex-wrap: wrap; }
/* 화면 · 소리 · 조작 · 게임 (windows.js setTab): the rows of the other tabs are hidden */
#w-settings .body > [data-sec][hidden] { display: none !important; }
#set-tabs { display: flex; gap: 2px; margin-bottom: 4px; }
#set-tabs button { flex: 1 1 0; }
/* a slider row stays one line in the side panel: the label, the slider filling what is left, the value */
#w-settings .set-row:has(.vol) { flex-wrap: nowrap; }
#w-settings .set-row:has(.vol) > span:first-child { flex: 0 0 auto; }
#w-settings .set-row input.vol { width: auto; flex: 1 1 70px; min-width: 50px; }
#w-settings .set-row .pct { width: auto; min-width: 26px; }

/* UI cleanup (K window, 전직의 길, 아르센): the picked weapon opens in place, skills are one line, the job card has its own slot above the table */
.wp-list .wp-skills { margin: 0 0 4px 10px; }
.wp-list .wp-skills .skill { margin-bottom: 3px; padding: 4px 6px; grid-template-columns: 44px minmax(0, 1fr); row-gap: 2px; align-items: start; }
.wp-list .wp-skills .skill .ic { grid-row: 1 / 4; }
.wp-list .wp-skills .skill .hd { grid-column: 2; }
.wp-list .wp-skills .skill .sk-enh { padding: 0 3px; font: 700 var(--t10)/13px var(--pix9); color: var(--tx2, #c8bfa8); background: var(--scr-a, rgba(18, 15, 24, .35)); border: 1px solid var(--rim, #6e5a3a); }
.wp-list .wp-skills .skill .sk-enh.up { color: var(--tx-gold, #ffe07a); border-color: var(--b-mid); }
.wp-list .wp-skills .skill .sk-meta { grid-column: 2; }
:is(.wp-list .wp-skills .skill, .jt-sig) .sk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font: var(--t10)/1.25 var(--pix9); color: var(--tx2, #c9bfa8); }
:is(.wp-list .wp-skills .skill, .jt-sig) .sk-meta .mp { color: var(--tx-info, #78c8ff); }
:is(.wp-list .wp-skills .skill, .jt-sig) .sk-meta .sk-pow { color: var(--tx-hd, var(--b-hi)); font-weight: 700; }
:is(.wp-list .wp-skills .skill, .jt-sig) .sk-meta .sk-pow.up { color: var(--tx-gold, #ffe07a); }
:is(.wp-list .wp-skills .skill, .jt-sig) .sk-meta .sk-req { opacity: .85; }
.wp-list .wp-skills .skill .sk-desc { grid-column: 1 / -1; }
:is(.wp-list .wp-skills .skill, .jt-sig) .sk-desc { min-width: 0; margin: 3px 0 1px; padding: 4px 6px; white-space: normal; overflow-wrap: anywhere; background: var(--scr-a, rgba(18, 15, 24, .28)); border-top: 1px dashed var(--rim, #6e5a3a); }
:is(.wp-list .wp-skills .skill, .jt-sig) .sk-desc[hidden] { display: none; }
.window :is(.wp-list .wp-skills .skill, .jt-sig) .sk-desc p { margin: 0; }
.sk-meta .sk-cd { display: inline-flex; align-items: center; gap: 2px; }
.sk-meta .sk-cd img.gi { width: 12px; height: 12px; image-rendering: pixelated; }
.jt-sig .sk-meta .sk-more { margin-left: auto; padding: 1px 6px; font-size: var(--t10); }
.wp-list .wp-skills .skill .sk-foot { grid-column: 2; display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 1px; }
.wp-list .wp-skills .skill .sk-more { padding: 1px 6px; font-size: var(--t10); }
.wp-list .wp-skills .skill .qs-put { grid-column: auto; padding: 1px 6px; font-size: var(--t10); }
.wp-list .wp-skills .skill .qs-put:disabled { opacity: .4; }
.window .wp-row:not(.sel) .sc { display: none; }
.wp-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin: 4px 0 0; font: var(--t10)/1.3 var(--pix9); color: var(--tx2, #a898b8); }
.wp-legend .chip { width: 20px; height: 20px; }
.wp-legend .chip img { width: 16px; height: 16px; image-rendering: auto; }
.wp-legend kbd { font: inherit; padding: 0 3px; color: var(--tx-hd, var(--b-hi)); border: 1px solid var(--rim, #5a4426); }
.jt-slot { height: 196px; overflow-y: auto; overflow-x: hidden; margin-bottom: 6px; }
.jt-slot .jt-card { margin-top: 0; }
body[data-lay="full"] #panel .jt-h.top { grid-template-columns: 1fr; grid-template-rows: 16px 11px; justify-items: center; padding: 1px 1px 5px; }
body[data-lay="full"] #panel .jt-h.top small { display: none; }
.jt-grid .jt-node small { font: var(--t12)/1 var(--pix); }
.jt-top { padding: 5px 7px; background: var(--scr); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 #07060b, inset -2px -2px 0 #2a2433; }
.jt-top .hd { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.jt-top .hd b { font: var(--t12) var(--pix); color: var(--b-hi); }
.jt-top .hd small { color: #a898b8; }
.jt-top .jt-progress { margin-top: 4px; }
.jt-fold { margin-top: 6px; }
.jt-fold summary { cursor: pointer; padding: 2px 4px; font: var(--t12) var(--pix); color: #c8b896; }
.window .jt-fold .it { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; padding: 2px 6px; }
.jt-fold .jt-need { margin: 0; }
/* the docked panel is short: root note hidden, card slot and table rows tighter so the picked cell and its card fit together */
body[data-lay="full"] #panel .jt-slot { height: 116px; }
body[data-lay="full"] #panel .jt-root { margin-bottom: 4px; }
body[data-lay="full"] #panel .jt-root > small { display: none; }
body[data-lay="full"] #panel .jt-grid { grid-template-rows: 28px repeat(var(--weapon-count, 7), 28px); }
body[data-lay="full"] #panel .jt-grid .jt-node { padding-top: 1px; }
body[data-lay="full"] #panel .jt-grid .jt-node img.ji { margin: 0 auto; }

/* 스킬 칸 (loadout.js), 전직관 초기화 (jobtree.js), 보스 전리품 (trophies.js) */
.skill.off { opacity: .5; }
.lo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 4px 0; }
.lo-row > b, .lo-pool > b { flex: 0 0 100%; font: var(--t12) var(--pix); color: var(--tx2, #c8b896); }
.lo-slot, .lo-chip { display: inline-flex; align-items: center; gap: 3px; min-width: 52px; min-height: 36px; padding: 2px 4px; background: var(--sf2, #231d30); border: 2px solid var(--sf4, #3a3150); color: var(--tx2, #a8a0b4); font: var(--t11) var(--pix); cursor: pointer; }
.lo-slot.full, .lo-chip { color: var(--tx, #e8dcc0); }
.lo-slot.sel { border-color: #ffd84a; }
.lo-slot .ic, .lo-chip .ic { width: 32px; height: 32px; image-rendering: pixelated; }
.lo-chip.used { opacity: .4; cursor: default; }
.lo-pool { display: flex; flex-wrap: wrap; gap: 3px; margin: 6px 0; padding: 4px; border: 2px solid var(--sf3, #2c2537); }
.lo-bar { display: flex; gap: 4px; margin-top: 6px; }
.jt-reset { margin: 4px 0; } .jt-reset small { color: #c8b896; }
#trophy-body .hint { font: var(--t11)/1.4 var(--pix); color: var(--tx2, #a8a0b4); margin: 3px 0; }
.tr-sum { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; padding: 4px; border: 2px solid var(--sf3, #2c2537); font: var(--t11) var(--pix); }
.tr-row { display: flex; flex-direction: column; padding: 3px 5px; margin: 2px 0; background: var(--sf1, #1c1726); border-left: 3px solid var(--sf4, #3a3150); opacity: .5; font: var(--t12) var(--pix); }
.tr-row.on { opacity: 1; border-left-color: #ffd84a; background: var(--sf3, #2a2236); }
.tr-row small { color: var(--tx2, #c8b896); }
/* ── 협동 아르바이트 (coop.js): the shift's line at the top, the lobby card, the report card ── */
#coop-hud { left: calc(var(--vpw) / 2); transform: translateX(-50%); top: 8px; z-index: 6; padding: 4px 10px 5px; max-width: calc(var(--vpw) - 40px);
  font: var(--t12)/1.35 var(--pix); color: #f4ecd0; text-align: center; }
#coop-hud .ch-l { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
#coop-hud.compact-job .ch-l { white-space: pre-line; word-break: keep-all; text-align: center; }
#hud #apt-pickup, #hud #diner-prompt, #hud #forge-prompt, #hud #library-prompt {
  left: calc(var(--vpw) / 2); bottom: calc(100dvh - var(--vph) + 100px);
  transform: translateX(-50%); white-space: nowrap; z-index: 7; pointer-events: auto;
}
#hud #apt-pickup:active, #hud #diner-prompt:active, #hud #forge-prompt:active, #hud #library-prompt:active { transform: translateX(-50%); }
#hud #apt-pickup:not([hidden]), #hud #diner-prompt:not([hidden]), #hud #forge-prompt:not([hidden]), #hud #library-prompt:not([hidden]) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px 6px 7px;
  min-height: 38px; font-size: 14px;
}
#hud #forge-prompt:disabled {
  opacity: 1; color: #f6e4c4; background: #292131; border-color: #a7875d; cursor: default;
}
#hud #apt-pickup kbd, #hud #diner-prompt kbd, #hud #forge-prompt kbd, #hud #library-prompt kbd, #hud #coop-guide kbd {
  display: inline-grid; place-items: center; width: 25px; height: 25px; flex: none;
  color: #fff0b8; background: #302436; border: 1px solid #18121e; box-shadow: inset 0 -2px #15101b;
  font-size: 16px;
}
#hud #diner-menu {
  left: calc(var(--vpw) / 2); top: calc(var(--vph) / 2); transform: translate(-50%, -50%);
  z-index: 15; width: min(324px, calc(var(--vpw) - 20px)); padding: 9px;
  box-sizing: border-box; color: #fff1d2; background: #251f2e;
}
#diner-menu header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
#diner-menu h2 { margin: 0; font-size: 16px; }
#diner-menu .cd-recipes { display: grid; gap: 4px; }
#hud #diner-menu .cd-recipe { display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: center; text-align: left; }
#hud #diner-menu .cd-recipe[aria-pressed="true"] { color: #fff3cd; background: #564236; outline: 1px solid #eac26d; }
#diner-menu canvas { width: 30px; height: 24px; image-rendering: pixelated; }
#diner-menu p { margin: 6px 0 0; color: #e2cebb; }
#hud #forge-rhythm {
  left: calc(var(--vpw) / 2); top: calc(var(--vph) * .70);
  transform: translate(-50%, -50%); z-index: 12;
  width: min(492px, calc(var(--vpw) - 20px)); padding: 8px 10px;
  box-sizing: border-box; color: #fff0c9; background: #251e2d;
}
#forge-rhythm header, #forge-rhythm .fr-buttons { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
#forge-rhythm .fr-track { position: relative; height: 26px; margin: 6px 0; border: 2px solid #654a43; background: #15111c; overflow: hidden; }
#forge-rhythm .fr-window { position: absolute; left: 24%; top: 0; bottom: 0; width: var(--window); transform: translateX(-50%); background: #635131; border-inline: 1px solid #f7ce85; }
#forge-rhythm .fr-track i { position: absolute; left: var(--note); top: 50%; width: 8px; height: 8px; transform: translate(-50%, -50%) rotate(45deg); background: #fff0b1; box-shadow: 0 0 0 2px #805238; }
#forge-rhythm[data-flash="good"] .fr-window { background: #7d9b55; }
#forge-rhythm[data-flash="miss"] .fr-window { background: #b85451; }
#forge-rhythm .fr-pair { margin: 0 0 6px; color: #ead6af; text-align: center; }
#coop-hud .ch-g { height: 3px; margin: 3px 0; background: #2a2418; }
#coop-hud .ch-g > i { display: block; height: 100%; width: 0; background: #e8c050; }
#coop-hud .ch-b { display: flex; gap: 6px; justify-content: center; }
#coop-hud.fever { color: #ffe080; box-shadow: 0 0 0 2px #c84a2a; }
#coop-hud.messy .ch-l { color: #ff9a80; }
#coop-card { left: calc(var(--vpw) / 2); transform: translateX(-50%); top: calc(var(--vph) - 230px); width: 300px; z-index: 6; padding: 6px 10px 8px;
  font: var(--t12)/1.4 var(--pix); color: #f4ecd0; }
#coop-card b { color: #ffe080; }
#coop-card p { margin: 3px 0; }
#coop-card .cc-day { color: #b8f07a; }
#coop-res { left: calc(var(--vpw) / 2); top: calc(var(--vph) / 2); transform: translate(-50%, -50%); width: 260px; z-index: 40; padding: 8px 12px 10px;
  font: var(--t12)/1.4 var(--pix); color: #f4ecd0; text-align: center; }
#hud #coop-res { background: #211b2b; }
#coop-res .cr-g { font: 700 40px/1 var(--pix); color: #c8c0a0; }
#coop-res .cr-g.g4 { color: #ffd040; }
#coop-res .cr-g.g3 { color: #b8f07a; }
#coop-res table { width: 100%; margin: 4px 0; }
#coop-res td { padding: 0 3px; }
#coop-res td:last-child { color: #ff9a80; }
#coop-res .cr-cut, #coop-res .cr-note { color: #a89c80; }
#coop-briefing {
  left: calc(var(--vpw) / 2); top: clamp(12px, calc(var(--vph) * .09), 72px);
  transform: translateX(-50%); z-index: 40;
  width: min(612px, calc(var(--vpw) - 20px)); box-sizing: border-box; padding: 10px 12px;
  color: #f7ebd7; word-break: keep-all; pointer-events: none;
}
#hud #coop-briefing { background: #211b2b; }
#coop-briefing header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#coop-briefing h2 { margin: 0; font-size: clamp(14px, 3.8vw, 19px); color: #fff2cf; }
#coop-briefing header span { background: #513c2c; color: #ffe298; white-space: nowrap; padding: 3px 7px; }
#coop-briefing header b { font-size: 17px; font-variant-numeric: tabular-nums; }
#coop-briefing p { margin: 0; }
#coop-briefing .cb-goal { margin: 6px 0 7px; color: #f4cc8a; }
#coop-briefing .cb-roles { display: grid; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); align-items: stretch; }
#coop-briefing .cb-role { display: flex; align-items: center; gap: 7px; border: 1px solid #50435b; background: #30273a; padding: 5px; }
#coop-briefing .cb-mine { border-color: #ffd681; background: #483348; }
#coop-briefing canvas { width: 80px; height: 64px; flex: none; image-rendering: pixelated; }
#coop-briefing h3 { margin: 0 0 2px; font-size: var(--t12); color: #fff1cf; }
#coop-briefing .cb-mine h3 { color: #ffe298; }
#coop-briefing .cb-link { align-self: center; text-align: center; color: #e8b970; }
#coop-briefing .cb-keys { margin-top: 7px; color: #dbccdf; }
#coop-briefing footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 7px; }
#coop-briefing footer .cb-keys { margin: 0; }
#coop-briefing footer .btn { flex: none; pointer-events: auto; }
#coop-card .cc-buttons { display: flex; justify-content: center; gap: 6px; align-items: center; flex-wrap: wrap; }
#hud #coop-guide {
  left: calc(var(--vpw) / 2); top: calc(var(--vph) / 2); transform: translate(-50%, -50%); z-index: 43;
  width: min(550px, calc(var(--vpw) - 16px)); max-height: calc(var(--vph) - 16px); box-sizing: border-box;
  padding: 10px 12px; color: #fff1d4; background: #211b2b;
}
#coop-guide:not([hidden]) { display: flex; flex-direction: column; }
#coop-guide header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
#coop-guide h2 { margin: 0; font-size: clamp(15px, 4vw, 20px); color: #ffe1a1; }
#coop-guide header .btn { flex: none; }
#coop-guide .cgd-body { min-height: 0; overflow-y: auto; padding-right: 3px; }
#coop-guide .cgd-key { display: flex; gap: 8px; align-items: center; padding: 7px; background: #392e42; }
#coop-guide p { margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
#coop-guide ol { margin: 8px 0 0; padding-left: 25px; }
#coop-guide li { padding: 5px 0 6px 3px; border-bottom: 1px solid #493b51; }
#coop-guide li:last-child { border-bottom: 0; }
#coop-guide li::marker, #coop-guide li b { color: #f3ce86; }
#coop-guide li p { margin-top: 3px; font-size: 13px; line-height: 1.55; }
@media (max-width: 500px) {
  #coop-briefing { padding: 8px 9px; }
  #coop-briefing .cb-role { flex-direction: column; align-items: flex-start; gap: 2px; }
  #coop-briefing canvas { width: 40px; height: 32px; }
}
@media (max-height: 320px) {
  #coop-briefing { top: 8px; }
  #coop-briefing canvas { width: 40px; height: 32px; }
}

#coop-pipes { inset: 0; z-index: 8; display: grid; place-items: center; padding: 6px; color: #f3e5c8; background: #15111cbd;
  font: var(--t12)/1.35 var(--pix); }
#coop-pipes[hidden] { display: none; }
#coop-pipe-panel { width: min(850px, 100%); min-height: 0; max-height: calc(100dvh - 12px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px; overflow: auto; padding: 8px 12px; }
#coop-pipes .cp-head, #coop-pipes .cp-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#coop-pipes .cp-head h2 { margin: 0; color: #ffe19a; font-size: var(--t13, 14px); line-height: 1.35; }
#coop-pipes .cp-head p { margin: 2px 0 0; color: #adbac2; }
#coop-pipe-time { color: #fff0ae; font: var(--t18, 20px)/1 var(--pix); font-variant-numeric: tabular-nums; }
#coop-pipes.cp-danger .cp-head p, #coop-pipes.cp-danger #coop-pipe-time { color: #ffba9f; }
#coop-pipes .cp-main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(148px, 170px); gap: 12px; }
#coop-pipes .cp-map { min-width: 0; }
#coop-pipes .cp-map-title { display: flex; width: min(100%, calc(100dvh - 156px)); margin: 0 auto 3px; color: #ebc09c; }
#coop-pipes .cp-map-title span { flex: 1; text-align: center; }
#coop-pipes .cp-map-title span + span { color: #b4d5cf; border-left: 1px dashed #9f9272; }
#coop-pipes .cp-view { box-sizing: content-box; width: min(100% - 4px, 100dvh - 156px); aspect-ratio: 1; margin: 0 auto;
  border: 2px solid #877669; background: #302b39; }
#coop-pipe-board { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; image-rendering: pixelated; }
#coop-pipe-board:focus-visible { outline: 2px solid #ffe29a; outline-offset: 2px; }
#coop-pipes .cp-side { min-width: 0; display: flex; flex-direction: column; gap: 7px; align-self: start; }
#coop-pipes .cp-hand { display: flex; align-items: center; gap: 6px; padding: 4px; background: #231e2c; border: 1px solid #54445c; }
#coop-pipes .cp-hand canvas { width: 36px; height: 36px; flex: none; image-rendering: pixelated; }
#coop-pipes .cp-hand b, #coop-pipes .cp-hand span { display: block; }
#coop-pipe-role { color: #ffe29a; }
#coop-pipe-held { color: #f8d9ad; }
#coop-pipe-crew { list-style: none; display: grid; gap: 3px; margin: 0; padding: 0; }
#coop-pipe-crew li { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 2px 4px; border-left: 2px solid #bd8b6c; background: #292331; }
#coop-pipe-crew li.cp-drain { border-left-color: #89b8ae; }
#coop-pipe-crew li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#coop-pipe-crew canvas { width: 21px; height: 21px; image-rendering: pixelated; }
#coop-pipes .cp-tip { margin: 0; color: #c3b9b3; }
#coop-pipes .cp-zoom, #coop-pipes .cp-controls > div { display: flex; gap: 4px; }
#coop-pipes .cp-controls > div { flex: none; }
#coop-pipes .cp-controls output { color: #e2d5c4; overflow-wrap: anywhere; }
#coop-pipes .btn { min-height: 34px; }
#coop-pipes .btn:disabled { opacity: .46; }
#w-board .cp-offer { border-color: #987347; }
@media (max-width: 570px) {
  #coop-pipe-panel { padding: 6px 7px; gap: 5px; }
  #coop-pipes .cp-main { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  #coop-pipes .cp-view { width: min(100% - 4px, 100dvh - 207px); }
  #coop-pipes .cp-map-title { width: min(100%, 100dvh - 207px); }
  #coop-pipes .cp-side { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 4px; }
  #coop-pipes .cp-hand { gap: 3px; padding: 2px; }
  #coop-pipes .cp-hand canvas { width: 27px; height: 27px; }
  #coop-pipes .cp-tip { display: none; }
  #coop-pipe-crew { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
  #coop-pipe-crew li { padding: 1px 2px; }
  #coop-pipe-crew canvas { width: 16px; height: 16px; flex: none; }
  #coop-pipes .cp-zoom .btn { min-width: 29px; padding-inline: 3px; }
}
@media (orientation: landscape) and (max-height: 480px) {
  #coop-pipe-panel { width: min(660px, 100%); }
  #coop-pipes .cp-main { grid-template-columns: minmax(0, 1fr) minmax(110px, 145px); }
  #coop-pipes .cp-view { width: min(100% - 4px, 100dvh - 117px); }
  #coop-pipes .cp-map-title { width: min(100%, 100dvh - 117px); }
  #coop-pipes .cp-side { display: flex; }
}
/* 추적 (track.js): the [추적] buttons and the "추적 중" line; quest and job rows keep their buttons on the right */
.window .jb-card .btns, #w-talk .sq-card .btns, #w-juana .cm-quest .btns, #quest-body .qdetail .btns { justify-content: flex-end; }
#daily-body .df .trk { margin-left: auto; }
/* the main action (수락 · 완료 · 받기, gold) is the rightmost button of a row, after 추적, as in 일일 의뢰; the death panel too */
.window .jb-card .btns .btn.gold, #w-talk .sq-card .btns .btn.gold, #w-juana .cm-quest .btns .btn.gold, #quest-body .btns .btn.gold, #dead .dead-btns .btn.gold { order: 1; }
.window .jb-card .btns .why, #w-talk .sq-card .btns .ds, #w-juana .cm-quest .btns small, #quest-body .qdetail .btns .ds { order: -1; margin-right: auto; }
.window .trk-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 3px; font: var(--t11) var(--pix); color: var(--tx2, #cfc8b8); }
.window .trk-row > small { margin-right: auto; }
#quest-track .trk, #tut .trk { float: right; margin-left: 4px; padding: 0 4px; font: var(--t10)/14px var(--pix); }
#track-ind { left: calc(var(--vpw) / 2); transform: translateX(-50%); top: calc(var(--vph) - 80px); z-index: 7; display: flex; align-items: center; gap: 8px; padding: 3px 6px 3px 12px;
  font: var(--t12) var(--pix); color: var(--tx-gold, #ffe08a); white-space: nowrap; }
#track-ind[hidden] { display: none; }

/* ── player to player: the menu beside a player, 따라가기, a request, the trade window, 가위바위보 (pmenu.js, sxwin.js) ── */
#pmenu { position: absolute; z-index: 30; display: flex; flex-direction: column; min-width: 104px; padding: 4px; font: var(--t12) var(--pix); }
#pmenu[hidden], #sx-ask[hidden], #rps[hidden], #follow-ind[hidden] { display: none; }
#pmenu .pm-h { color: var(--tx-hd, var(--b-hi)); font-weight: 700; padding: 1px 6px 3px; border-bottom: 2px solid var(--rim, #5a4426); margin-bottom: 2px; white-space: nowrap; }
#pmenu .pm-i { all: unset; display: block; padding: 3px 8px; color: var(--tx, #fff6dc); cursor: pointer; white-space: nowrap; font: var(--t12) var(--pix); }
#pmenu .pm-i:hover, #pmenu .pm-i:focus-visible { background: var(--sf4h, #463b55); }
#pmenu .pm-i.off { color: var(--tx3, #7d7488); }
#pmenu .pm-sub { display: flex; flex-direction: column; margin: 0 0 0 10px; border-left: 2px solid var(--rim, #5a4426); }
#pmenu .pm-sub[hidden] { display: none; }
#follow-ind { left: calc(var(--vpw) / 2); transform: translateX(-50%); top: calc(var(--vph) - 108px); z-index: 7; display: flex; align-items: center; gap: 8px; padding: 3px 6px 3px 12px;
  font: var(--t12) var(--pix); color: var(--tx-ok, #9be05a); white-space: nowrap; }
#sx-ask { left: calc(var(--vpw) / 2); top: 128px; transform: translateX(-50%); padding: 6px 10px; display: flex; gap: 8px; align-items: center; white-space: nowrap; z-index: 15; font: var(--t12) var(--pix); color: var(--tx, #fff6dc); }
#sx-ask button, #rps .btn { font: var(--t12) var(--pix); color: var(--tx, #fff6dc); background: var(--sf3, #2f2838); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf4h, #463b55), inset -2px -2px 0 var(--sf2, #1f1a28); padding: 2px 8px; cursor: pointer; }
#sx-ask button.gold, #rps .btn.gold { color: #2a1806; background: var(--b-mid); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
#rps { left: calc(var(--vpw) / 2); top: 28%; transform: translateX(-50%); z-index: 16; padding: 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; font: var(--t12) var(--pix); color: var(--tx, #fff6dc); min-width: 260px; }
#rps .rps-h { color: var(--tx-hd, var(--b-hi)); font-weight: 700; }
#rps .rps-bar { display: block; width: 100%; height: 6px; background: var(--sf2, #1f1a28); border: 2px solid var(--ink); }
#rps .rps-bar i { display: block; height: 100%; background: #ffd36a; }
#rps .rps-row { display: flex; align-items: center; gap: 14px; }
#rps .rps-me, #rps .rps-them { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 96px; }
#rps .rps-hand { width: 72px; height: 72px; image-rendering: pixelated; }
#rps .rps-pick .rps-hand { width: 36px; height: 36px; display: block; margin: 0 auto 2px; }
#rps .rps-vs { color: var(--tx-bad, #ff8a6a); }
#rps .rps-pick, #rps .btns { display: flex; gap: 6px; }
#rps .rps-pick kbd { font: var(--t10) var(--pix9); color: var(--tx-hd, var(--b-hi)); }
#rps .rps-res { font: 700 var(--t16, 16px) var(--pix); }
#rps .rps-res.win { color: var(--tx-ok, #9be05a); } #rps .rps-res.lose { color: var(--tx-bad, #ff8a7a); } #rps .rps-res.draw { color: var(--tx2, #c8c8d8); }
#rps .hint { color: var(--tx2, #b9aec8); margin: 0; }
#w-trade { width: 430px; max-width: calc(100vw - 8px); }
#trade-body .tr-sides { display: flex; gap: 8px; }
#trade-body .tr-side { flex: 1; border: 2px solid var(--sf4, #3a3146); padding: 4px; }
#trade-body .tr-side.locked { border-color: #9be05a; }
#trade-body .tr-name { color: var(--tx-hd, var(--b-hi)); font-weight: 700; }
#trade-body .tr-grid, #trade-body .tr-bag { --slot: 36px; grid-template-columns: repeat(4, var(--slot)); justify-content: start; gap: 2px; }
#trade-body .tr-bag { grid-template-columns: repeat(auto-fill, var(--slot)); max-height: 160px; overflow-y: auto; }
#trade-body .slot { width: var(--slot); height: var(--slot); }
#trade-body .slot.empty { cursor: default; opacity: .5; }
#trade-body .slot.off { opacity: .35; }
#trade-body .tr-gold { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
#trade-body .tr-gold input { width: 90px; font: var(--t12) var(--pix); color: var(--tx, #fff6dc); background: var(--sf2, #1f1a28); border: 2px solid var(--ink); padding: 1px 4px; }
#trade-body .tr-st { color: var(--tx2, #b9aec8); }
#trade-body .tr-side.locked .tr-st { color: var(--tx-ok, #9be05a); }
#trade-body .btns { display: flex; gap: 6px; margin-top: 6px; }

/* ─────────── HUD colour themes (설정 → HUD 색상; keymap.js sets body[data-hud], frames.js redraws) ───────────
   Every HUD colour is a role variable whose fallback is the original brass look, so the default theme
   ("brass", 기본 황동) defines nothing. A theme sets the roles on the HUD containers only, so the title
   screen keeps its own look. Roles: --face panel · --scr sunken screen · --frame-bg small framed boxes ·
   --ink / --fr-ink outlines · --b-hi/-mid/-lo/-sh/-w/-m brass bevel (frames, plates, gold buttons) ·
   --sf0…--sf5 surfaces from the deepest shadow to a button's highlight (--sf4 button, --sf4h hover) ·
   --rim inner brass rims · --cream/--tx/--tx2/--tx3 body → muted text · --tx-hd/--tx-hd2 titles ·
   --tx-gold/-ok/-bad/-info/-pink accents (+ style.css --text --muted --gold --gold-hi --line --well).
   Rarity, quest-mark, job, mastery and HP/MP colours are never themed: they carry meaning. */
:is(#hud, #tip, #windows, #dead, #info, #mirror) { --fr-brass: var(--frt-brass); --fr-screen: var(--frt-screen); --fr-plate: var(--frt-plate); }
/* body sets its colour from the default --text, so the HUD containers re-read it in their theme (zero specificity: any own rule wins) */
:where(#hud, #tip, #windows, #dead, #info, #mirror) { color: var(--text); }

/* ─────────── HUD transparency (설정 → HUD 투명도; --hud-a / --hud-pct on :root, keymap.js) ───────────
   The always-on HUD (side column, dock, hotbar, bars' panels, chat, cards over the world, docked windows) fades only its panel
   FACES; icons, bar fills, cooldowns, outlines and text stay crisp. frames.js draws --frt-brass-a / --frt-screen-a (the 9-slices with a
   see-through face), and #hud gets the -a colours below (the themed sunken screen / surfaces / small boxes at --hud-a) for the inner fills.
   Opaque on purpose: the minimap block (#mini), minigames, the death overlay and tooltips (outside #hud). Floating windows use
   plain opacity instead (see .window:not(.docked) above). Where #hud's panels sit outside the world (a desktop's side column and dock)
   the face shows the page behind it; over the world (the cards at the top left, the phone layouts) the world shows through. */
#hud {
  --fr-brass: var(--frt-brass-a); --fr-screen: var(--frt-screen-a);
  --scr-a: color-mix(in srgb, var(--scr) var(--hud-pct), transparent);
  --sf1-a: color-mix(in srgb, var(--sf1, #1a1622) var(--hud-pct), transparent);
  --sf3-a: color-mix(in srgb, var(--sf3, #2a2433) var(--hud-pct), transparent);
  --sf4-a: color-mix(in srgb, var(--sf4, #3a3146) var(--hud-pct), transparent);
  --frame-a: color-mix(in srgb, var(--frame-bg, rgba(24, 20, 31, .94)) var(--hud-pct), transparent);
}
#hud :is(#mini, #minigame) { --fr-brass: var(--frt-brass); --fr-screen: var(--frt-screen); }
#mini { background: var(--face); }

/* (UX pass 2, theme audit) the selected quest's tag (새 의뢰 · 진행 중) on its gold row: dark like the row's text */
.window .qlist button.on small { color: #5a3a10; }
/* light themes: a meaning colour set inline for a dark panel (rarity names in tooltips, the wardrobe and chat links,
   job colours) keeps its hue and gets an ink outline, so a 일반 white or 희귀 yellow name reads on cream */
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(#tip, #windows, #hud) [style^="color"] { text-shadow: 1px 0 var(--ink), -1px 0 var(--ink), 0 1px var(--ink), 0 -1px var(--ink); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(#tip, #windows, #hud) [style^="color"] small { text-shadow: none; }
/* 베이지 리넨: pale linen panels, walnut ink */
body[data-hud="linen"] :is(#hud, #tip, #windows, #dead, #info, #mirror) {
  --face: #efe5cf; --scr: #e4d7bb; --frame-bg: rgba(239, 229, 207, .97); --ink: #3b2b1c; --fr-ink: #3b2b1c;
  --b-hi: #fbf1d8; --b-mid: #c9a878; --b-lo: #8c6a44; --b-sh: #5e4429; --b-w: #fffaf0; --b-m: #e2c898;
  --sf0: #8c7456; --sf1: #e2d4b6; --sf2: #b9a07a; --sf3: #d3c3a0; --sf4: #f4ebd6; --sf4h: #fbf5e6; --sf5: #fffbf2; --rim: #a88a5e;
  --cream: #3b2a1a; --tx: #3b2a1a; --tx2: #554230; --tx3: #6a563e; --tx-hd: #74480e; --tx-hd2: #80561e;
  --tx-gold: #7c5206; --tx-ok: #2c6a32; --tx-bad: #a3302a; --tx-info: #2c578a; --tx-pink: #8e3479; --tx-violet: #6a3aa8; --tx-guide: #0c7466;
  --text: #3b2a1a; --muted: #6a563e; --gold: #74480e; --gold-hi: #5a3608; --line: rgba(110, 80, 40, .35); --line-hi: rgba(110, 80, 40, .7); --well: #e4d7bb;
}
/* 모래 크림: warm sand and cream, caramel brass */
body[data-hud="sand"] :is(#hud, #tip, #windows, #dead, #info, #mirror) {
  --face: #f2e3c2; --scr: #e8d4aa; --frame-bg: rgba(242, 227, 194, .97); --ink: #43301a; --fr-ink: #43301a;
  --b-hi: #fff3cf; --b-mid: #d4a85e; --b-lo: #9a6a32; --b-sh: #6a4420; --b-w: #fffbe8; --b-m: #ecc77e;
  --sf0: #957448; --sf1: #e5d0a2; --sf2: #c4a26a; --sf3: #dbc592; --sf4: #f7eaca; --sf4h: #fff5dc; --sf5: #fffbea; --rim: #b08a50;
  --cream: #422d15; --tx: #422d15; --tx2: #5a4020; --tx3: #6e5430; --tx-hd: #84440a; --tx-hd2: #8e5618;
  --tx-gold: #7e5000; --tx-ok: #2e6a2c; --tx-bad: #a52e22; --tx-info: #2a5688; --tx-pink: #8c3274; --tx-violet: #68359f; --tx-guide: #0c6e60;
  --text: #422d15; --muted: #6e5430; --gold: #84440a; --gold-hi: #5e3204; --line: rgba(120, 80, 30, .35); --line-hi: rgba(120, 80, 30, .7); --well: #e8d4aa;
}
/* 올리브 차: sage-beige panels, olive bronze */
body[data-hud="olive"] :is(#hud, #tip, #windows, #dead, #info, #mirror) {
  --face: #e5e4cd; --scr: #d6d7ba; --frame-bg: rgba(229, 228, 205, .97); --ink: #2f3322; --fr-ink: #2f3322;
  --b-hi: #f4f2d8; --b-mid: #aaa66e; --b-lo: #6c6b3e; --b-sh: #474827; --b-w: #fdfdf0; --b-m: #ccc890;
  --sf0: #7a7b58; --sf1: #d3d4b4; --sf2: #a8a984; --sf3: #c6c8a4; --sf4: #efefdc; --sf4h: #f7f7ea; --sf5: #fdfdf4; --rim: #8f8e62;
  --cream: #2c3020; --tx: #2c3020; --tx2: #434832; --tx3: #565b42; --tx-hd: #5a560e; --tx-hd2: #66641e;
  --tx-gold: #6a5606; --tx-ok: #2a642a; --tx-bad: #993224; --tx-info: #2a5678; --tx-pink: #82326a; --tx-violet: #623494; --tx-guide: #0a6656;
  --text: #2c3020; --muted: #565b42; --gold: #5a560e; --gold-hi: #424008; --line: rgba(80, 84, 40, .35); --line-hi: rgba(80, 84, 40, .7); --well: #d6d7ba;
}
/* 밤 모카: dark roast brown for night play, beige text, copper brass */
body[data-hud="mocha"] :is(#hud, #tip, #windows, #dead, #info, #mirror) {
  --face: #2c221b; --scr: #1d1712; --frame-bg: rgba(44, 34, 27, .95); --ink: #0e0a07; --fr-ink: #0e0a07;
  --b-hi: #e8c9a0; --b-mid: #b5865a; --b-lo: #6f4c30; --b-sh: #45301e; --b-w: #f8e6cc; --b-m: #d0a678;
  --sf0: #0a0705; --sf1: #1a140f; --sf2: #241c16; --sf3: #3a2e24; --sf4: #4a3a2d; --sf4h: #574535; --sf5: #66513e; --rim: #6a4e32;
  --cream: #eadcc2; --tx: #f2e6cf; --tx2: #cdbb9c; --tx3: #bcaa8e; --tx-hd: #ecc888; --tx-hd2: #d0a26a;
  --text: #eadcc2; --muted: #bcaa8e; --gold: #ecc888; --gold-hi: #fbe8c4; --well: #1d1712;
}
/* 고대비: near-black panels, bright cream text, bold brass borders */
body[data-hud="contrast"] :is(#hud, #tip, #windows, #dead, #info, #mirror) {
  --face: #101010; --scr: #000; --frame-bg: rgba(12, 12, 12, .98); --ink: #000; --fr-ink: #000;
  --b-hi: #fff2c0; --b-mid: #e0b040; --b-lo: #8a6410; --b-sh: #4a3608; --b-w: #fff; --b-m: #ffd870;
  --sf0: #000; --sf1: #060606; --sf2: #000; --sf3: #5a5a5a; --sf4: #262626; --sf4h: #3c3c3c; --sf5: #707070; --rim: #e0b040;
  --cream: #fffbea; --tx: #fff; --tx2: #f2e8d0; --tx3: #dcd0b4; --tx-hd: #ffd860; --tx-hd2: #ffc848;
  --tx-gold: #ffe070; --tx-ok: #7dffa0; --tx-bad: #ff9088; --tx-info: #9ad4ff; --tx-pink: #ffa8ec;
  --text: #fffbea; --muted: #dcd0b4; --gold: #ffd860; --gold-hi: #fff2c0; --well: #000;
}
/* light themes: names drawn in their rarity colour get an ink outline; text made for a dark face drops its black shadow */
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(.nm, .tx, #chat-log p)[style*="color"] {
  text-shadow: 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 1px 0 var(--ink), 0 -1px 0 var(--ink);
}
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(#menu button img.gi, .doll .slot.empty .ph img.gi) { filter: brightness(.3); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"])[data-lay="full"] #status .meter b { text-shadow: none; }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"])[data-lay="full"] #st-gold { color: var(--tx-hd); text-shadow: none; }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(#wm, #jr) .wt { color: color-mix(in srgb, var(--wm-lo), var(--ink) 30%); text-shadow: none; }
/* light themes: text drawn pale for the dark panels reads from the theme inks instead (same meaning, darker shade) */
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(
  .wm-tip .wm-job, .jt-progress, .jt-wpn small, .jt-h small, .jt-scale, .jt-foot small, .jt-near .tx b, .jt-fold summary, .jt-reset small,
  .window .jt-sig p, .window .jb-card .df, #mirror .mr-msg) { color: var(--tx2); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(
  .wm-tip .wm-r, .wm-tip .wm-next small, .wm-tip .wm-xp, .wm-tip .hint, .jt-card .hd small, .jt-scale small, .jt-top .hd small,
  .buddy-contact small, .buddy-line small) { color: var(--tx3); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(.wm-tip .wm-r .wv, .wm-tip .wm-r:not(.on) .wv, .jt-need .ok, .window .jb-card .ok) { color: var(--tx-ok); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(.jt-need .no, .window .jb-card .why, .window .jb-card .late, .window .alba-clock.late, #quest-track .jb-clock.late) { color: var(--tx-bad); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(.wm-tip .wm-next, .jt-wpn.ready b, .jt-h.half b, .jt-h.ready b, .jt-sig b, .window .jb-card .where, #quest-track .jb-clock,
  #w-talk > header .talk-role, #w-talk .talk-mn, #w-talk .sq-card .q-title, #w-talk .sq-card .q-reward) { color: var(--tx-gold); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(.window .mp, #tip .mp, .jt-sig small) { color: var(--tx-info); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) .doll .slot.empty .cap { color: var(--tx3); opacity: 1; }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(.wm-tip .wm-job b, .jt-card .hd b, .jt-top .hd b, .window .jb-card .df .pay) { color: var(--tx-hd); }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(.jt-wpn b, .jt-h b, .jt-sig small, #w-talk .sq-card .q-next, #quest-track .qnext) { color: var(--tx-info); }
/* key letters on the light slots, the phone button's key and the tracker's buttons (the dark Spc / X buttons keep theirs) */
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) :is(.act:not(#b-dash, #b-atk) kbd, #phone-btn kbd) { color: var(--tx); text-shadow: none; }
body:is([data-hud="linen"], [data-hud="sand"], [data-hud="olive"]) #quest-track .btn { color: #3b2a1a; }   /* #quest-track sets a pale --tx for its text over the world */

/* ── UX pass 2026-11-15 (docs/design/ux-audit-2026-11-15.md) ── */
/* notices and prompts draw over the windows (21–35, windows.js front), under the minigame (40) and the tooltip (80) */
#toasts, #banner, #prompt, #dl, #cast, #invite, #sx-ask { z-index: 36; }
/* above the first-time tip (#hint, 36) that opens with it */
#pmenu { z-index: 37; }
/* the yes/no box (windows.js ask): over the windows, in the middle of the play view */
#ask { left: calc(var(--vpw) / 2); top: calc(var(--vph) * .36); transform: translateX(-50%); z-index: 37; width: min(300px, calc(var(--vpw) - 24px)); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font: var(--t12)/1.5 var(--pix); color: var(--cream); }
#ask[hidden] { display: none; }
#ask p { margin: 0; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
#ask label { display: flex; align-items: center; gap: 6px; font: var(--t10) var(--pix9); color: var(--tx2, #c8b896); cursor: pointer; }
#ask label[hidden] { display: none; }
#ask .btns { display: flex; justify-content: flex-end; gap: 8px; }
#ask .btn { min-height: 28px; padding: 3px 10px; }
#ask-qty { display: flex; align-items: center; gap: 4px; }
#ask-qty[hidden] { display: none; }
#ask-qty .btn { min-width: 28px; min-height: 28px; padding: 0 6px; }
#ask-qty input { width: 64px; height: 26px; box-sizing: border-box; padding: 0 6px; text-align: right; font: var(--t12) var(--pix); color: var(--cream); background: var(--scr, #0c0a10); border: 2px solid var(--ink); border-radius: 0; }
#ask-qty input { appearance: textfield; -moz-appearance: textfield; }
#ask-qty input::-webkit-inner-spin-button, #ask-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
#ask-qty .note { margin-left: auto; font: var(--t12) var(--pix); color: var(--tx-gold, #ffe08a); white-space: nowrap; }
#ask .btn kbd, #inv-detail .btns kbd { margin-left: 5px; font: var(--t10) var(--pix9); opacity: .7; }
/* the target frame under the party frames (hud.js targetFrame): name, an HP bar with its %, the traits by name */
#tgt { padding: 4px 8px 5px; font: var(--t12)/1.35 var(--pix); color: var(--cream); pointer-events: auto; }
#tgt[hidden] { display: none; }
#tgt .tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tgt .tb { position: relative; height: 10px; margin-top: 3px; background: #000; border: 2px solid var(--ink); }
#tgt .tb i { position: absolute; left: 0; top: 0; bottom: 0; background: #d8404c; transition: width .15s linear; }
#tgt .tb b { position: absolute; right: 3px; top: -3px; font: var(--t10)/14px var(--pix9); font-weight: 400; color: #fff; text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; }
#tgt .tt { display: flex; flex-wrap: wrap; gap: 2px 6px; margin-top: 3px; font: var(--t10) var(--pix9); color: var(--tx2, #c8b896); }
#tgt .tt[hidden] { display: none; }
#tgt .tt span { display: inline-flex; align-items: center; gap: 2px; cursor: help; }
#tgt .tt img { width: 12px; height: 12px; image-rendering: pixelated; }
#tgt .te { margin-top: 3px; font: var(--t10) var(--pix9); }
#tgt .te:empty, .element-statuses:empty { display: none; }
.element-statuses { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.element-status { display: inline-flex; align-items: center; gap: 2px; padding: 1px 3px; border: 1px solid var(--element-color); background: #191521; color: #f8f1e6; font: var(--t10) var(--pix9); white-space: nowrap; }
.element-status img { width: 12px; height: 12px; image-rendering: pixelated; }
.element-sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 6px; padding: 5px 6px; font-size: var(--t11); }
.element-sheet .el-cell { min-width: 0; }
.element-sheet span { min-width: 0; }
.sk-bar-info { margin: 2px 0 6px; padding: 3px 6px; font: var(--t10) var(--pix9); color: var(--tx2, #cfc3a7); background: rgba(18, 15, 26, 0.45); border: 1px solid var(--sf3, #3a3146); }
.sk-foot .sk-eq.on { color: #2a1806; background: var(--b-mid); }
.skill-elements { display: inline-flex; flex-wrap: wrap; gap: 2px 4px; }
.skill-element { padding: 0 3px; border: 1px solid currentColor; white-space: nowrap; }
.skill-armor-pen { white-space: nowrap; }
.col-cell .col-elements { text-align: center; white-space: normal; line-height: 1.35; }
/* potion buttons: amber count when 2 or fewer, red and greyed when none (hud.js hotbar) */
.act.pot.low .n { color: #ffbe4a; }
.act.pot.none .n { color: #ff7a6a; }
.act.pot.none img { filter: grayscale(1) brightness(.7); }
/* 새로 얻음 in the bag (win_char.js trackNew): a bright gold rim and a crisp crimson NEW corner badge */
.slot.new { border-color: #ffcf5c; animation: slot-new 1.4s steps(4) infinite alternate; }
@keyframes slot-new { from { box-shadow: inset 0 0 0 2px rgba(255, 207, 92, .25); } to { box-shadow: inset 0 0 0 2px rgba(255, 207, 92, .85); } }
.slot .nw {
  position: absolute; left: -2px; top: -2px; padding: 1px 3px 1px 4px;
  font: 700 8px/9px var(--pix9); letter-spacing: .6px; color: #ffffff;
  background: linear-gradient(180deg, #ff5e4d 0%, #d42236 100%);
  border: 1px solid #ffe48a; outline: 1px solid #240d14;
  text-shadow: 1px 1px 0 #4a0a16;
  box-shadow: 0 1px 0 rgba(24, 10, 18, .75), inset 0 1px 0 rgba(255, 245, 210, .55);
  pointer-events: none; z-index: 2;
  animation: nw-pulse 1.4s ease-in-out infinite alternate;
}
@keyframes nw-pulse { from { filter: brightness(1); } to { filter: brightness(1.18); } }
/* the loot feed (events.js lootLine): the play view's lower right, newest at the bottom, over the scene only */
#loot { left: calc(var(--vpw) - 10px); top: calc(var(--vph) - 162px); height: 110px; transform: translateX(-100%); z-index: 6; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; gap: 1px; pointer-events: none; }
#loot p { margin: 0; max-width: min(260px, calc(var(--vpw) * .4)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--t12)/1.35 var(--pix); text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; animation: loot 4s steps(20) forwards; }
@keyframes loot { 0% { opacity: 0; transform: translateX(10px); } 6% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
body[data-lay="port"] #loot, body[data-lay="land"] #loot { top: 60px; height: 84px; }   /* under the menu button, clear of the touch quick slots */

/* ─────────── item tooltip (items.js itemTip): Diablo-style cards, dark whatever the HUD theme ───────────
   One card per piece: a frame and a title in the rarity colour (--rc), sections split by divider lines, the
   stats in a name/value column. A gear piece's card is followed by the worn piece's own card under a
   [장착 중] banner (a ring: both rings); the row wraps into a column when the screen is narrow. */
#tip.cards { width: max-content; max-width: calc(100vw - 8px); max-height: calc(100vh - 8px); padding: 2px; overflow-y: auto; scrollbar-width: none; background: none; border: 0; box-shadow: none; }
.tcards { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.tcard {
  --tb: calc(var(--t12) + 1px); --tn: calc(var(--t12) + 2px);
  box-sizing: border-box; flex: none; width: 244px; max-width: 100%; padding: 8px 10px 9px;
  font: var(--tb)/1.5 var(--pix); letter-spacing: 0; text-align: left; color: #f0e6d0;
  background: rgba(13, 10, 19, .93); border: 2px solid var(--rc, #6b5a3c); outline: 2px solid #07050a;
  word-break: keep-all; overflow-wrap: anywhere;
}
body[data-hud="contrast"] .tcard { background: rgba(0, 0, 0, .97); }
#inv-detail .tcard { flex: 1 1 100%; width: auto; }   /* the phone pane: the card fills the pane, a worn piece's card stacks under it */
.tcard .tc-sec + .tc-sec { margin-top: 6px; padding-top: 6px; border-top: 2px solid color-mix(in srgb, var(--rc, #6b5a3c) 45%, #000); }
.tcard .tc-eq { margin: -8px -10px 7px; padding: 2px 10px; display: flex; justify-content: space-between; align-items: baseline; font: 700 var(--tb)/1.4 var(--pix); color: #2a1806; background: var(--b-mid, #cf9f55); }
.tcard .tc-eq small { color: #4a3414; }
.tcard .tc-nm { font: 700 var(--tn)/1.35 var(--pix); color: var(--rc, #d8d4c8); }
.tcard .tc-sub { display: flex; justify-content: space-between; gap: 8px; margin-top: 1px; font: var(--t11)/1.4 var(--pix); color: #a99c86; }
.tcard .tc-sub > :first-child { color: var(--rc, #a99c86); }
.tcard .tc-il { color: #d8ccb4; }
.tcard .tc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tcard .tc-row b { flex: none; font-weight: 700; text-align: right; }
.tcard .tc-row.base { color: #e8dcc0; }
.tcard .tc-row.base b { color: #fff; font-size: var(--tn); }
.tcard .tc-row.af { color: #8fb8ff; }
.tcard .tc-tag { margin-right: 5px; padding: 1px 3px; font: 700 var(--t10)/1 var(--pix9); font-style: normal; vertical-align: 1px; color: #2a1d0c; background: #d2b48c; }
.tcard .tc-note { margin-top: 2px; font: var(--t11)/1.4 var(--pix); color: #a99c86; }
.tcard .tc-ds { margin-top: 3px; color: #cfc4ac; }
.tcard .tc-lg { margin: 0 -4px; padding: 0 4px 0 6px; color: #f6dca8; background: rgba(210, 180, 140, .16); box-shadow: inset 2px 0 0 #d2b48c; }
.tcard .tc-dead { margin: 0 -4px; padding: 0 4px 0 6px; font: var(--t11)/1.4 var(--pix); color: #7d7566; }
.tcard .tc-st { color: #8fe8a8; }
.tcard .tc-so { color: #b9ae98; }
.tcard .tc-socket { display: flex; align-items: flex-start; gap: 6px; padding: 3px 5px; margin-top: 3px; background: #28212e; border-left: 2px solid #8b7451; }
.tcard .tc-socket.locked { border-left-color: #57515f; background: #201b25; color: #a29aaa; }
.tcard .tc-socket-mark { flex: none; width: 12px; text-align: center; }
.tcard .tc-socket-label { flex: 1; min-width: 0; }
.tcard .tc-socket-label > b { font-weight: 400; }
.tcard .tc-rune-set .tc-note { margin-top: 5px; }
#smith-list .smith-actions { display: grid; gap: 3px; flex: none; }
#smith-list .smith-socket { color: var(--tx-hd2, #e1c599); }
.tcard .tc-req { color: #bfb39b; }
.tcard .tc-req.bad { color: #ff6f5e; font-weight: 700; }
.tcard .tc-err { font-size: var(--t11); color: #ff9a8a; }
.tcard .tc-gold { color: #ffd84a; }
.tcard .tc-hint { margin-top: 2px; font: var(--t10)/1.4 var(--pix9); color: #9a8f7c; }
.tcard .tc-cmp { margin-bottom: 1px; font: 700 var(--t11)/1.4 var(--pix); color: #cdbf9f; }
.tcard .tc-dls { display: flex; flex-wrap: wrap; gap: 0 10px; }
.tcard .tc-d { font: var(--t11)/1.45 var(--pix); color: #a99c86; }
.tcard .tc-d.up { color: #8ff0a6; }
.tcard .tc-d.dn { color: #ff9f8f; }
/* ── 아이템도감 (dex.js): a note, the filters, one card per 접두사. #dex-body is a size container: a wide (floating) window puts the
   filters in a left column, the docked side panel (and a phone) stacks them over the list. Colours come from the theme variables. ── */
#w-dex { width: 540px; --win-max: 540px; }   /* floating on a phone: wide enough for the left filter column (a desktop: 600 px, end of this file) */
#dex-body { container-type: inline-size; font: var(--t12)/1.4 var(--pix); }
.dx-note { margin: 0 0 5px; padding: 2px 6px; background: var(--sf1, #1c1726); border: 2px solid var(--sf3, #2c2537); }
#dex-body .dx-note p { margin: 1px 0; font: var(--t10)/1.4 var(--pix9); color: var(--tx2, #c8b896); }
#dex-body .dx-note p::before { content: "◆ "; color: var(--b-mid, #cf9f55); }
.dx-side { display: flex; flex-direction: column; gap: 4px; margin-bottom: 5px; }
.dx-tabs { margin: 0; }
.dx-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.dx-lb { font: var(--t11) var(--pix); color: var(--tx3, #9a90a8); margin-right: 2px; }
.dx-chip { padding: 3px 6px; font: var(--t11)/1.2 var(--pix); color: var(--tx2, #a8a0b4); background: var(--sf2, #231d30); border: 2px solid var(--ink);
  box-shadow: inset 2px 2px 0 var(--sf4, #3a3150), inset -2px -2px 0 var(--sf1, #17131d); cursor: pointer; }
.dx-chip:hover { color: var(--tx, #fff6dc); background: var(--sf3, #2a2433); }
.dx-chip.on { color: #2a1806; background: var(--b-mid); box-shadow: inset 2px 2px 0 var(--b-hi), inset -2px -2px 0 var(--b-lo); }
.dx-chip[hidden] { display: none; }
.dx-q { flex: none; width: 100%; min-width: 0; box-sizing: border-box; padding: 2px 6px; font: var(--t12)/1.3 var(--pix); color: var(--cream); outline: none; user-select: text; -webkit-user-select: text;
  background: var(--scr); border: 2px solid var(--ink); box-shadow: inset 2px 2px 0 var(--sf0, #07060b), inset -2px -2px 0 var(--sf3, #2a2433); }
.dx-q:focus { border-color: var(--b-mid); }
.dx-bar { display: flex; align-items: center; gap: 4px; }
.dx-bar .dx-n { margin-right: auto; }
.dx-n { white-space: nowrap; font: 700 var(--t12) var(--pix); color: var(--tx-hd, var(--b-hi)); }
.dx-card { margin: 0 0 4px; padding: 3px 6px 5px 7px; background: var(--sf1, #1c1726); border: 2px solid var(--sf3, #2c2537); border-left: 4px solid var(--dc, #6b5a3c); }
.dx-card.O { --dc: var(--tx-bad, #ff8a86); } .dx-card.D { --dc: var(--tx-info, #8ab4ff); } .dx-card.U { --dc: var(--tx-ok, #8ff0a6); }
.dx-card.worn { background: var(--sf3, #2a2236); border-color: var(--b-lo, #7c5326); border-left-color: var(--dc, #6b5a3c); }
.dx-card.off { opacity: .5; }
.dx-top { display: flex; align-items: center; gap: 5px; }
.dx-nm { font: 700 var(--t12)/1.3 var(--pix); color: var(--dc, var(--tx, #e8dcc0)); }
.dx-cat { font: var(--t10)/1 var(--pix9); color: var(--tx3, #9a90a8); }
.dx-rate { margin-left: auto; min-width: 14px; padding: 2px 3px; text-align: center; font: 700 var(--t10)/1 var(--pix9); border: 2px solid var(--ink); cursor: help; }
.dx-rate.rS { color: var(--tx2, #c8c0d4); background: var(--sf4, #3a3146); }
.dx-rate.rM { color: var(--cream, #f3e8cc); background: var(--b-lo, #7c5326); }
.dx-rate.rL { color: #2a1806; background: var(--b-mid, #cf9f55); }
.dx-tag { padding: 1px 4px; font: 700 var(--t10)/1.2 var(--pix9); border: 2px solid var(--ink); }
.dx-tag.on { color: #2a1806; background: var(--b-mid, #cf9f55); }
.dx-tag.off { color: var(--tx3, #9a90a8); background: var(--sf2, #231d30); }
#dex-body .dx-ds { margin: 2px 0 3px; font: var(--t12)/1.4 var(--pix); color: var(--tx, #e8dcc0); }
.dx-dead { margin: -1px 0 3px; font: var(--t11)/1.4 var(--pix); color: var(--tx3, #7d7566); }
.dx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.dx-slot { padding: 1px 4px; font: var(--t10)/1.3 var(--pix9); color: var(--tx2, #a8a0b4); background: var(--sf2, #231d30); border: 2px solid var(--sf3, #2c2537); }
.dx-ex { margin-left: auto; font: var(--t10)/1.3 var(--pix9); color: var(--tx3, #8c8496); }
.dx-sep { margin: 8px 0 4px; padding-top: 4px; border-top: 2px solid var(--sf3, #2c2537); font: var(--t11) var(--pix); color: var(--tx3, #9a90a8); }
#dex-body .dx-none { margin: 10px 0; text-align: center; color: var(--tx3, #9a90a8); }
.dx-more { display: flex; flex-direction: column; gap: 4px; }
.dx-more[hidden] { display: none; }
@container (min-width: 440px) {
  .dx-more[hidden] { display: flex; }   /* the wide window has room: the filters stay open */
  .dx-main { display: grid; grid-template-columns: 138px minmax(0, 1fr); gap: 8px; align-items: start; }
  .dx-side { position: sticky; top: 0; margin: 0; }
  .dx-tabs { flex-direction: column; }
  .dx-tabs button { text-align: left; }
}

/* ── desktop: the windows that float by default (windows.js FLOATS), or that the player popped out of the side panel, get their own width
   (--fw) and stop at ~70% of the viewport height, the body scrolling; the safe zone keeps them off the dock (hotbar, chat) and the side column.
   The 아이템도감 is one fixed roomy size, so its filters never make it jump. A phone and the docked panel keep their old sizes. ── */
body[data-lay="full"].playing :is(#w-skill, #w-life, #w-alba, #w-charm, #w-trophy, #w-rank, #w-achieve, #w-collect, #w-dex, #w-settings, #w-help, #w-char, #w-quest, #w-party, #w-guild, #w-daily, #w-week):not(.docked) {
  --win-h: min(max(70vh, 360px), calc(var(--zone-h) - 8px - var(--tabs-h)));
  --win-max: var(--fw, 420px); width: min(var(--fw, 420px), calc(var(--zone-w) - 8px)); max-height: var(--win-h);
}
#w-skill { --fw: 460px; } #w-life { --fw: 400px; } #w-alba { --fw: 380px; } #w-charm { --fw: 320px; } #w-trophy { --fw: 400px; } #w-rank { --fw: 340px; }
#w-achieve { --fw: 480px; } #w-collect { --fw: 520px; } #w-dex { --fw: 600px; } #w-settings { --fw: 420px; } #w-help { --fw: 520px; }
#w-char { --fw: 360px; } #w-quest { --fw: 580px; } #w-party { --fw: 310px; } #w-guild { --fw: 310px; } #w-daily { --fw: 360px; } #w-week { --fw: 380px; }
#w-buddy { --fw: 340px; }
#w-buddy .buddy-body { display: grid; align-content: start; gap: 10px; }
.buddy-contact, .buddy-compose { display: flex; align-items: center; gap: 8px; }
.buddy-contact { justify-content: space-between; }
.buddy-contact small { display: block; margin-top: 4px; color: #d6bbca; }
.buddy-contact button, .buddy-compose button { flex: 0 0 auto; }
.buddy-ai { padding: 7px 8px; background: rgba(36, 26, 44, 0.55); border: 1px solid #8b647e; border-radius: 6px; display: grid; gap: 6px; }
.buddy-ai-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.buddy-ai-head span { font-weight: 700; color: #ffe0a8; font-size: var(--t12); }
.buddy-ai-head small { color: #d6bbca; font-size: var(--t10); text-align: right; }
.buddy-ai-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.buddy-ai-btns button { padding: 4px 2px; font-size: var(--t11); }
.buddy-ai-btns button.on { background: #c98f3a; color: #1b1208; border-color: #ffe29a; font-weight: 700; }
.buddy-messages { height: clamp(105px, 23vh, 185px); overflow-y: auto; padding: 8px; }
.buddy-line { width: fit-content; max-width: 90%; margin-bottom: 9px; overflow-wrap: anywhere; }
.buddy-line small { color: #d6bbca; }
.buddy-line p { margin: 3px 0 0; padding: 7px 9px; background: #44364e; color: #fff4f7; border-radius: 7px 7px 7px 2px; }
.buddy-line.outgoing { margin-left: auto; text-align: right; }
.buddy-line.outgoing p { background: #773f5a; border-radius: 7px 7px 2px 7px; text-align: left; }
.buddy-label { display: block; margin-bottom: 4px; }
.buddy-job-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.buddy-job-row .buddy-label { margin: 0; flex: 0 0 auto; }
.buddy-job-row select { flex: 1 1 auto; min-width: 0; }
.buddy-compose input { flex: 1 1 0; min-width: 0; padding: 6px 7px; color: #fff4f7; background: #282232; border: 1px solid #8b647e; font: inherit; }
#buddy-cooldown { margin: 6px 0 2px; }
body[data-lay="full"].playing #w-dex:not(.docked) { height: var(--win-h); }

/* ── 도움말 (help.js, helptext.js): a search box over a topic list and the text. The list is a column when the window is wide
   (the floating one), a row of chips when it is not (the docked side panel, a phone). The chips and the search box are the
   아이템도감's (.dx-chip, .dx-q); colours come from the theme variables, the four mark colours are the NPC marks' (overlay.js). ── */
#help-body { container-type: inline-size; font: var(--t12)/1.5 var(--pix); }
#help-body .dx-q { margin-bottom: 5px; }
.hp-nav { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.hp-t { text-align: left; }
.hp-text h3 { margin: 0 0 4px; font: 700 var(--t12)/1.4 var(--pix); color: var(--tx-hd, var(--b-hi)); }
.hp-s { margin: 0 0 5px; padding: 3px 6px 4px; background: var(--sf1, #1c1726); border: 2px solid var(--sf3, #2c2537); border-left: 4px solid var(--b-mid, #cf9f55); }
.hp-s h4 { margin: 0 0 2px; font: 700 var(--t12)/1.4 var(--pix); color: var(--tx-gold, #e2c486); }
.hp-s h4 small { margin-right: 5px; padding: 1px 4px; color: var(--tx3, #9a90a8); background: var(--sf2, #231d30); border: 2px solid var(--sf3, #2c2537); }
.hp-l { margin: 1px 0; padding-left: 12px; text-indent: -12px; color: var(--tx, #e8dcc0); word-break: keep-all; overflow-wrap: anywhere; }
.hp-l::before { content: "◆"; display: inline-block; width: 12px; text-indent: 0; color: var(--b-mid, #cf9f55); font-size: var(--t10); }
.hp-l.hit { background: var(--sf3, #2a2433); box-shadow: 0 0 0 2px var(--sf3, #2a2433); }
.hp-l b { color: var(--tx-hd, var(--b-hi)); font-weight: 700; }
.hp-l b.hp-y { color: var(--tx-gold, #ffe070); } .hp-l b.hp-b { color: var(--tx-info, #7ab8ff); }
.hp-l b.hp-g { color: var(--tx-ok, #5ee07a); } .hp-l b.hp-p { color: var(--tx-violet, #c77dff); }
.hp-k { display: inline-block; min-width: 14px; margin: 0 1px; padding: 1px 3px; text-align: center; text-indent: 0; font: 700 var(--t10)/1.2 var(--pix9); color: var(--tx-hd, var(--b-hi)); background: var(--scr); border: 2px solid var(--ink); }
@container (min-width: 440px) {
  .hp-main { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 8px; align-items: start; }
  .hp-nav { position: sticky; top: 0; flex-direction: column; margin: 0; }
}

/* 잡템 일괄 판매 (win_shop.js) */
#shop-junk { display: flex; gap: 6px; margin-top: 6px; }
#shop-junk .btn { flex: 1 1 0; }

/* 일일 아르바이트 window (alba.js) */
#alba-play { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; background: rgba(8, 6, 14, .72); }
#alba-play[hidden] { display: none; }
#alba-play .ap-box { --ap-acc: #d9a441; width: min(clamp(560px, 66vh, 780px), 96vw); max-height: 96vh; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; background: linear-gradient(#fbf0d2, #ecd9a8); border: 3px solid #b98a3e; border-radius: 6px; box-shadow: 0 0 0 2px #3a2a18, inset 0 0 0 2px #fff4cf, 0 8px 28px rgba(40,24,8,.5); color: #3a2a18; position: relative; }
#alba-play.fever .ap-box { box-shadow: 0 0 0 2px #000, 0 0 24px 4px #ff8a2a; }
#alba-play.fever .ap-box::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border: 4px solid #ffb02a; box-shadow: inset 0 0 28px #ff7a20; animation: ap-fever .43s ease-in-out infinite alternate; will-change: opacity; }
#alba-play .ap-fev { position: absolute; left: 0; right: 0; top: -6px; height: 4px; background: linear-gradient(90deg, #ff2a6a, #ffb02a); transform-origin: 0 50%; transform: scaleX(0); }
#alba-play .ap-how { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); width: min(420px, 88%); padding: 10px 14px; text-align: left; background: rgba(255, 246, 218, .96); border: 3px solid #b98a3a; box-shadow: 0 0 0 2px #000, 0 6px 0 rgba(0,0,0,.35); color: #4a3418; animation: ap-how .3s ease-out both; }
#alba-play .ap-how b { display: block; margin-bottom: 4px; font: 700 var(--t12)/1.3 var(--pix); color: #8a4a12; }
#alba-play .ap-how p { margin: 3px 0; font: 400 var(--t11)/1.4 var(--pix); } #alba-play .ap-how p::before { content: "· "; }
#alba-play .ap-how .ap-how-main { font: 700 var(--t12)/1.4 var(--pix); color: #2e6a3a; } #alba-play .ap-how .ap-how-main::before { content: "▶ "; }
#alba-play .ap-pops.how .ap-word.count { top: 82%; }
#alba-play .ap-stamp { display: inline-block; animation: ap-stamp .42s cubic-bezier(.2, 1.4, .4, 1) both; }
#alba-play .ap-res p, #alba-play .ap-res .ap-btns { animation: ap-in .28s ease-out both; animation-delay: calc(var(--i, 8) * 80ms + 380ms); }
#alba-play .ap-res.slam { animation: ap-slam .3s ease-out; }
@keyframes ap-fever { from { opacity: .3; } to { opacity: 1; } }
@keyframes ap-fevbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes ap-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes ap-how { from { opacity: 0; transform: translate(-50%, -10px); } }
@keyframes ap-stamp { 0% { opacity: 0; transform: scale(3.4) rotate(-22deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(-6deg); } }
@keyframes ap-slam { 0%, 100% { transform: translate(-50%, -50%); } 30% { transform: translate(-50%, -49%) scale(1.02); } }
@keyframes ap-shine { 0%, 55% { transform: translateX(-130%); } 100% { transform: translateX(330%); } }
.window .jb-card.hot { position: relative; overflow: hidden; border-color: #ff9a3a; }
.window .jb-card.hot::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; pointer-events: none; background: linear-gradient(100deg, transparent, rgba(255, 224, 150, .3), transparent); animation: ap-shine 3.2s ease-in-out infinite; will-change: transform; }
@media (orientation: portrait) and (max-width: 560px) { #alba-play .ap-hint::after { content: " · 📱 화면을 가로로 돌리면 버튼이 커져요"; color: #c0560a; } }
#alba-play .ap-head { display: flex; align-items: baseline; gap: 10px; font: 700 var(--t12)/1.2 var(--pix); color: #4a3418; padding: 2px 6px 4px; border-bottom: 2px solid #c9a762; }
#alba-play .ap-title { flex: 1 1 auto; color: #8a4a12; font-size: 1.1em; text-shadow: 0 1px 0 #fff4cf; }
#alba-play .ap-time { min-width: 3.5em; text-align: right; color: #3a2a18; } #alba-play .ap-combo { color: #d4520a; min-width: 6em; } #alba-play .ap-score { color: #2e6a3a; }
/* score feedback (alba.js scorePop/banner): big +N / −N over the board, a counting score, a jolt on a lost heart */
#alba-play .ap-score { display: inline-block; min-width: 5.5em; text-align: right; font-size: 1.35em; color: #1f7a3a; text-shadow: 0 1px 0 #fff4cf; transform-origin: 100% 60%; }
#alba-play .ap-score.bump { animation: ap-bump .28s ease-out; } #alba-play .ap-score.drop { animation: ap-drop .4s ease-out; }
#alba-play .ap-combo { display: inline-block; } #alba-play .ap-combo.bump { animation: ap-bump .2s ease-out; }
#alba-play .ap-mul { margin-left: .3em; padding: 0 .35em; border-radius: 3px; background: #d4520a; color: #fff6da; font-size: .95em; }
#alba-play.fever .ap-mul { background: #ff2a6a; box-shadow: 0 0 6px #ffb040; }
#alba-play .ap-pops { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
#alba-play .ap-pop { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: 900 30px/1 var(--pix); color: #ffe24a; -webkit-text-stroke: 2px #3a2208; paint-order: stroke fill; text-shadow: 0 3px 0 #3a2208, 0 0 12px rgba(255,200,60,.7); animation: ap-pop 1.1s cubic-bezier(.2,.9,.3,1) forwards; will-change: transform, opacity; }
#alba-play .ap-pop.t1 { font-size: 38px; } #alba-play .ap-pop.t2 { font-size: 48px; color: #fff07a; } #alba-play .ap-pop.t3 { font-size: 60px; color: #fff; text-shadow: 0 3px 0 #3a2208, 0 0 18px #ffb020, 0 0 34px #ff7a20; }
#alba-play .ap-pop small { margin-left: .2em; font-size: .5em; color: #ffb04a; vertical-align: .35em; }
#alba-play .ap-pop.neg { color: #ff5a4a; -webkit-text-stroke-color: #3a0a08; text-shadow: 0 3px 0 #3a0a08, 0 0 12px rgba(255,60,40,.7); animation-name: ap-neg; }
#alba-play .ap-banner { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); padding: 10px 26px; white-space: nowrap; font: 900 34px/1 var(--pix); color: #fff; -webkit-text-stroke: 2px #4a1a08; paint-order: stroke fill; background: linear-gradient(90deg, transparent, rgba(255,110,30,.9) 18%, rgba(255,60,90,.9) 82%, transparent); animation: ap-banner 1.6s ease-out forwards; }
#alba-play .ap-banner.grade { top: 22%; font-size: 30px; background: linear-gradient(90deg, transparent, rgba(40,150,80,.9) 18%, rgba(30,120,170,.9) 82%, transparent); }
#alba-play .ap-banner.g4 { background: linear-gradient(90deg, transparent, rgba(230,160,16,.95) 18%, rgba(255,110,40,.95) 82%, transparent); }
#alba-play .ap-word { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); font: 900 72px/1 var(--pix); color: #fff; -webkit-text-stroke: 3px #3a2208; paint-order: stroke fill; text-shadow: 0 4px 0 #3a2208; animation: ap-pop .9s cubic-bezier(.2,.9,.3,1) forwards; will-change: transform, opacity; }
#alba-play .ap-word.go { color: #ffe24a; } #alba-play .ap-word.heal { top: 30%; font-size: 34px; color: #ff6a8a; -webkit-text-stroke-color: #4a0a1a; }
#alba-play .ap-banner.rush { background: linear-gradient(90deg, transparent, rgba(60,120,255,.9) 18%, rgba(140,60,255,.9) 82%, transparent); }
#alba-play .ap-box.shake { animation: ap-shake .3s linear; }
#alba-play .ap-box.hurt { animation: ap-shake .4s linear; }
#alba-play .ap-box.hurt .ap-board { animation: ap-hurt .5s ease-out; }
#alba-play .ap-time.lost { animation: ap-drop .5s ease-out; } #alba-play .ap-time { display: inline-block; } #alba-play .ap-time.bump { animation: ap-bump .4s ease-out; }
@keyframes ap-pop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.35); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.35); } 26% { transform: translate(-50%, -55%) scale(1); } 70% { opacity: 1; transform: translate(-50%, -110%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -160%) scale(.9); } }
@keyframes ap-neg { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); } 12% { opacity: 1; transform: translate(-56%, -50%) scale(1.1); } 22% { transform: translate(-44%, -50%) scale(1.1); } 32% { transform: translate(-50%, -50%) scale(1); } 70% { opacity: 1; transform: translate(-50%, -30%); } 100% { opacity: 0; transform: translate(-50%, 0%) scale(.9); } }
@keyframes ap-banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(.95); } 20% { transform: translate(-50%, -50%) scale(1.05); } 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }
@keyframes ap-bump { 0% { transform: scale(1); } 35% { transform: scale(1.3); color: #e8a010; } 100% { transform: scale(1); } }
@keyframes ap-drop { 0%, 100% { transform: none; } 20% { transform: translateX(-4px); color: #d8301a; } 40% { transform: translateX(4px); color: #d8301a; } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes ap-shake { 0%, 100% { transform: none; } 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(3px, 0); } }
@keyframes ap-hurt { 0% { box-shadow: inset 0 0 0 2px #5a5284, inset 0 0 60px 20px rgba(255,40,30,.85); } 100% { box-shadow: inset 0 0 0 2px #5a5284, inset 0 0 0 0 rgba(255,40,30,0); } }
@keyframes ap-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #alba-play.fever .ap-box::after, .window .jb-card.hot::after, #alba-play .ap-stamp, #alba-play .ap-res.slam { animation: none; } }
@media (prefers-reduced-motion: reduce) { #alba-play .ap-pop, #alba-play .ap-banner, #alba-play .ap-word { animation-name: ap-fade; } #alba-play .ap-box.shake, #alba-play .ap-box.hurt { animation: none; } }
#alba-play .ap-stage { width: auto; max-width: 100%; height: auto; max-height: 17vh; align-self: center; aspect-ratio: 4 / 1; image-rendering: pixelated; border: 2px solid #3a2a18; box-shadow: 0 0 0 2px #d9b665; background: #cfe8f8; }
#alba-play .ap-bar { position: relative; height: 12px; background: #fff6da; border: 2px solid #3a2a18; border-radius: 2px; margin: 4px 0 8px; }
#alba-play .ap-fill { display: block; height: 100%; width: 0; background: var(--ap-acc); transition: width .12s linear; }
#alba-play .ap-mark { position: absolute; top: 12px; transform: translateX(-50%); font: 700 10px/1 var(--pix); color: #6a5230; white-space: nowrap; }
#alba-play .ap-mark.on { color: #1f7a3a; text-shadow: 0 0 4px #9af0a0; } #alba-play .ap-mark.next { color: #c0560a; } #alba-play .ap-mark.bump { animation: ap-bump .5s ease-out; }
#alba-play .ap-hint { font: 400 var(--t11)/1.3 var(--pix); color: #6a5230; min-height: 1.3em; }
#alba-play .ap-board { position: relative; flex: 1 1 auto; min-height: 200px; overflow: auto; display: flex; justify-content: center; align-items: flex-start; background: #3d3760; border: 2px solid #3a2a18; box-shadow: inset 0 0 0 2px #5a5284; touch-action: none; user-select: none; }
#alba-play .ap-host { width: 100%; display: flex; justify-content: center; }
#alba-play .ap-host canvas { max-width: 100%; image-rendering: pixelated; touch-action: none; }
#alba-play .ap-res { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, 90vw); padding: 14px; text-align: center; background: linear-gradient(#fff6da, #f0dfae); border: 3px solid #b98a3e; box-shadow: 0 0 0 2px #3a2a18, inset 0 0 0 2px #fffbe8, 0 6px 22px rgba(40,24,8,.55); color: #3a2a18; z-index: 2; }
#alba-play .ap-res p { margin: 4px 0; font: 400 var(--t12)/1.4 var(--pix); }
#alba-play.down .ap-board { filter: grayscale(1) brightness(.55); pointer-events: none; }
#alba-play.down .ap-hint { color: #c0402a; }
#alba-play .ap-res .ap-rec { color: #c0560a; font-weight: 700; }
#alba-play .ap-btns { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
#alba-play .ap-stamp { font: 900 56px/1 var(--pix); margin: 4px 0 8px; color: #8a8a96; text-shadow: 0 2px 0 #fff4cf; }
#alba-play .ap-stamp.g1 { color: #b4783a; } #alba-play .ap-stamp.g2 { color: #3a8ad0; } #alba-play .ap-stamp.g3 { color: #2ea85a; } #alba-play .ap-stamp.g4 { color: #e8a010; text-shadow: 0 0 10px #ffd060, 0 2px 0 #fff4cf; }
body.alba-open #game { pointer-events: none; }

/* ─────────────────── talk close-up (talkcam.js): the HUD steps back, slim letterbox bars, no vignette ─────────────────── */

body.talkcam #w-talk { z-index: 60; }
body.talkcam #hud > * { transition: opacity .3s ease-out; }
body.talkq #hud > * { opacity: 0 !important; pointer-events: none !important; }
body.talkq #windows > .window:not(#w-talk), body.talkq #tip { opacity: 0; pointer-events: none; }
body.talkq #w-talk { left: 50% !important; top: auto !important; bottom: 11vh; transform: translateX(-50%); width: min(94vw, 1180px) !important; max-height: 76vh !important; }
body.talkq #w-talk .talk-main { max-height: calc(76vh - 64px); }
body.talkq #w-talk .talk-vn { gap: 12px; }
body::before, body::after { content: ""; position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 50; pointer-events: none; transition: height .35s ease-out; }
body::before { top: 0; } body::after { bottom: 0; }
body.talkq::before, body.talkq::after { height: 9vh; }
@media (prefers-reduced-motion: reduce) { body.talkcam #hud > *, body::before, body::after { transition: none; } }

/* ─────────────────── a boss fight's opening (bossintro.js): wide letterbox, red WARNING, name, epithet ─────────────────── */
/* the fight has begun: the bars go under the HUD (z 5) so health and skills stay in sight */
body.bossintro::before, body.bossintro::after { height: 13vh; z-index: 4; }
/* the title sits in the scene just above the bottom panel, under the boss the camera holds */
#boss-intro { position: fixed; left: 0; right: 0; top: 57%; z-index: 55; text-align: center; pointer-events: none; opacity: 0; transform: translateY(8px); transition: opacity .35s ease-out, transform .35s ease-out; text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000; }
body.bossintro #boss-intro { opacity: 1; transform: none; transition-delay: .25s; }
#boss-intro .bi-warn { display: inline-block; padding: 2px 18px; font: 700 30px/1.1 var(--pix); letter-spacing: .35em; color: #ff3022; border-top: 2px solid #ff3022; border-bottom: 2px solid #ff3022; animation: bi-blink .6s steps(2, jump-none) infinite; }
#boss-intro .bi-name { margin-top: 10px; font: 700 34px/1.15 var(--pix); color: #fff3e0; }
#boss-intro .bi-sub { margin-top: 4px; font: 18px/1.2 var(--pix); color: #ffb0a0; }
@keyframes bi-blink { 50% { color: #8a1008; border-color: #8a1008; } }
@media (prefers-reduced-motion: reduce) { #boss-intro, #boss-intro .bi-warn { transition: none; animation: none; } }

/* ─────────────────── talk window, visual-novel style (talkui.js): wide box low-centre, portrait beside the text ─────────────────── */
#w-talk { left: 50% !important; top: auto !important; bottom: 5vh; transform: translateX(-50%); width: clamp(560px, 66vw, 1180px) !important; max-width: 97vw; max-height: 56vh !important; z-index: 60; }
#w-talk > header { padding: 4px 10px; }
#w-talk > header .t { font-size: calc(var(--t12) * 1.7); letter-spacing: 1px; }
#w-talk > header .talk-role { margin-left: 10px; font-size: calc(var(--t12) * 1.1); color: #e2c486; opacity: .85; }
#w-talk .talk-vn { position: relative; display: flex; align-items: flex-start; gap: 16px; padding: 12px 14px; min-height: 0; }
#w-talk .talk-port { flex: none; padding: 6px; border: 3px solid #b08a3a; background: linear-gradient(#3a3350, #1c1824); box-shadow: inset 0 0 0 2px #2b2233, 3px 3px 0 #0008; }
#w-talk .talk-port canvas { display: block; image-rendering: pixelated; }
#w-talk .talk-main { flex: 1; min-width: 0; max-height: calc(56vh - 64px); overflow-y: auto; }
#w-talk .say { font-size: calc(var(--t12) * 1.5); line-height: 1.65; min-height: 3.3em; margin: 0 0 8px; cursor: pointer; white-space: pre-line; }
#w-talk .hint { font-size: calc(var(--t12) * 1.1); }
#w-talk .btn { font-size: calc(var(--t12) * 1.25); padding: 8px 16px; margin-right: 8px; }
#w-talk .sq-card .btn { margin-right: 0; }
#w-talk .talk-sq { max-height: none; overflow: visible; margin-top: 10px; gap: 10px; }
#w-talk[data-mode="quest"] .talk-sq { margin-top: 0; }
#w-talk .sq-card { padding: 12px 14px; }
#w-talk .sq-card .q-title { font-size: calc(var(--t12) * 1.55); color: #ffd27a; }
#w-talk .sq-card .say { font-size: calc(var(--t12) * 1.45); line-height: 1.55; min-height: 0; max-height: calc(3 * 1.55em + 18px); overflow-y: auto; padding: 8px 10px; }
#w-talk .sq-card .q-goal, #w-talk .sq-card .qp { font-size: calc(var(--t12) * 1.35); }
#w-talk .sq-card .q-next { font-size: calc(var(--t12) * 1.2); color: #9ad8ff; margin-top: 2px; }
#w-talk .sq-card .q-reward { font-size: calc(var(--t12) * 1.3); color: #f5d88a; margin-top: 6px; }
#w-talk .sq-card .btn.gold { padding: 10px 22px; font-size: calc(var(--t12) * 1.4); }
#w-talk .sq-choice .btn { width: 100%; padding: 10px 14px; }
#w-talk .section { font-size: calc(var(--t12) * 1.3); margin-top: 0; }
#quest-track .qnext { color: #9ad8ff; }
body:is([data-lay="port"], [data-lay="land"]) #w-talk .talk-vn { gap: 8px; padding: 8px 10px; }
body:is([data-lay="port"], [data-lay="land"]) #w-talk .talk-port { padding: 3px; border-width: 2px; }
body:is([data-lay="port"], [data-lay="land"]) #w-talk .talk-port canvas { max-width: 76px; max-height: 84px; object-fit: contain; }
body:is([data-lay="port"], [data-lay="land"]) #w-talk .talk-mn { font-size: var(--t10); margin-top: 2px; }
@media (max-width: 640px), (max-height: 420px) { #w-talk { width: 97vw !important; bottom: 2vh; } #w-talk .talk-port, #w-talk .talk-me { display: none !important; } #w-talk .say { font-size: calc(var(--t12) * 1.25); } }
body.talkcam #prompt { display: none; }
#w-talk:not(.docked) { opacity: 1; }
#w-talk .talk-port { align-self: center; }
#w-talk .talk-me { display: none; text-align: center; }
body.talkq #w-talk .talk-me[data-ok="1"] { display: block; }
#w-talk .talk-mn { margin-top: 4px; font-size: calc(var(--t12) * 1.1); color: #e2c486; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* quest rewards with item icons (sidequests.js rewardRow) */
.rw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.rw-row .rw-h { opacity: .8; }
.rw-row .rw-chip { display: inline-flex; align-items: center; gap: 3px; background: rgba(0,0,0,.28); border: 1px solid rgba(245,216,138,.3); padding: 1px 5px; }
.rw-row .rw-chip img { width: 16px; height: 16px; image-rendering: pixelated; }

/* the talk window's pages (actions.js talkShow): the menu, the chat, the quests */
#w-talk .talk-menu { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#w-talk[data-mode="home"] .talk-sq, #w-talk[data-mode="home"] .talk-jb, #w-talk[data-mode="home"] #talk-more { display: none; }
#w-talk[data-mode="chat"] .talk-menu, #w-talk[data-mode="chat"] .talk-sq, #w-talk[data-mode="chat"] .talk-jb { display: none; }
#w-talk[data-mode="quest"] .talk-menu, #w-talk[data-mode="quest"] #talk-more, #w-talk[data-mode="quest"] #talk-rep, #w-talk[data-mode="quest"] #talk-where, #w-talk[data-mode="quest"] #talk-text { display: none; }
#w-talk[data-mode="quest"] .talk-main { display: flex; flex-direction: column; }
#w-talk[data-mode="quest"] #talk-end { position: absolute; left: 10px; bottom: 8px; z-index: 2; order: 99; align-self: flex-start; margin: 0; padding: 6px 9px; font-size: calc(var(--t12) * 1.05); }
#w-talk[data-mode="quest"] .talk-port:not(.talk-me) { margin-bottom: 34px; }
@media (max-width: 640px), (max-height: 420px) { #w-talk[data-mode="quest"] #talk-end { position: static; margin-top: 8px; } }

/* see-through talk (owner 2026-11-19): the talk and quest windows show the world through their faces and inner boxes
   (frames.js --frt-brass-see, --see-a), the text and buttons stay solid; they never fade as a whole */
#windows :is(#w-talk, #w-quest) {
  --fr-brass: var(--frt-brass-see); --fr-screen: var(--frt-screen-see);
  --scr-a: color-mix(in srgb, var(--scr, #120f18) calc(var(--see-a, .74) * 100%), transparent);
  --sf1-see: color-mix(in srgb, var(--sf1, #1c1824) calc(var(--see-a, .74) * 100%), transparent);
}
#windows :is(#w-talk, #w-quest):not(.docked) { opacity: 1; }
#w-talk .sq-card { background: var(--sf1-see); }

/* window ornaments (owner 2026-11-20: woodland ivy vines hugging all 4 HUD & window borders, phone UI untouched):
   top vines sit lower to drape over & soften the brass frame; bottom corners carry trimmer matching ivy clusters */
.window:not(.docked)::before, .window:not(.docked)::after {
  content: ""; position: absolute; pointer-events: none; z-index: 3; image-rendering: pixelated; background-repeat: no-repeat;
}
.window:not(.docked)::before {
  left: -26px; top: -22px; bottom: -16px; width: 58px;
  background-image: url("assets/ui/vine_tl.png"), url("assets/ui/vine_bl.png");
  background-position: left top, left bottom;
  background-size: 58px 35px, 46px 28px;
}
.window:not(.docked)::after {
  right: -26px; top: -22px; bottom: -16px; width: 52px;
  background-image: url("assets/ui/vine_tr.png"), url("assets/ui/vine_br.png");
  background-position: right top, right bottom;
  background-size: 52px 35px, 42px 28px;
}
/* bottom HUD bar: all 4 corners + slim centered top garland draped right across the top brass bar */
body:not([data-lay="land"]) #dock::before, body:not([data-lay="land"]) #dock::after {
  content: ""; position: absolute; pointer-events: none; z-index: 3; image-rendering: pixelated; background-repeat: no-repeat;
}
body:not([data-lay="land"]) #dock::before {
  left: -8px; top: -13px; bottom: -5px; width: 76px;
  background-image: url("assets/ui/vine_tl.png"), url("assets/ui/vine_bl.png");
  background-position: left top, left bottom;
  background-size: 72px 44px, 56px 34px;
}
body:not([data-lay="land"]) #dock::after {
  left: 0; right: -8px; top: -13px; bottom: -5px;
  background-image: url("assets/ui/vine_top.png"), url("assets/ui/vine_tr.png"), url("assets/ui/vine_br.png");
  background-position: center top, right top, right bottom;
  background-size: 136px 18px, 64px 44px, 50px 34px;
}
/* desktop right side panel: delicate hanging ivy tendril along the top-right edge (phone drawer untouched) */
body[data-lay="full"] #side::after {
  content: ""; position: absolute; right: -2px; top: 2px; width: 26px; height: 60px;
  pointer-events: none; z-index: 4; image-rendering: pixelated;
  background: url("assets/ui/vine_hang.png") no-repeat 0 0 / 100% 100%;
}

/* Lunelsha Epilogue Ending Credits modal (QST-03) */
.ending-overlay {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12, 10, 22, 0.82); padding: 16px;
}
.ending-card {
  max-width: 480px; width: 100%; padding: 24px 26px;
  background: linear-gradient(180deg, #211a2c 0%, #161220 100%);
  border: 2px solid #d4a84e; box-shadow: 0 0 0 3px #2e2418, 0 14px 40px rgba(0, 0, 0, 0.7);
  color: #f4ebd8; text-align: center;
}
.ending-tag { font-size: 11px; letter-spacing: 2px; color: #e2b85c; margin-bottom: 6px; }
.ending-title { margin: 0 0 4px; font-size: 22px; color: #ffe7a8; text-shadow: 0 2px 0 #2e1e10; }
.ending-sub { margin: 0 0 16px; font-size: 12px; color: #b8b0c8; }
.ending-body {
  white-space: pre-line; text-align: left; line-height: 1.75; font-size: 13px;
  background: rgba(10, 8, 18, 0.55); border: 1px solid rgba(212, 168, 78, 0.35);
  padding: 14px 16px; margin-bottom: 14px; color: #ebe2d2;
}
.ending-foot { font-size: 11px; color: #a89c84; margin-bottom: 14px; }

/* Laputa-style silent tapestry opening cinematic & 11s Willow Plaza camera pan (intro.js) */
body.introcam #hud > *, body.introcam #windows > .window, body.introcam #tip, body.introcam #prompt {
  opacity: 0 !important; pointer-events: none !important; transition: opacity .8s ease-out;
}
body.introcam::before, body.introcam::after { height: 9vh; transition: height .8s ease-out; }
.intro-overlay {
  position: fixed; inset: 0; z-index: 980; background: #07060a; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.intro-stage {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  box-shadow: inset 0 9vh 0 #050408, inset 0 -9vh 0 #050408;
}
.intro-plate {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; will-change: transform, opacity;
  filter: contrast(1.04) saturate(0.95);
}
.intro-grain {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(8, 5, 14, 0.55) 100%);
  box-shadow: inset 0 9vh 0 #050408, inset 0 -9vh 0 #050408;
}
.intro-spores { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; transition: opacity 1.2s ease; }
.intro-spores.on { opacity: 1; }
.intro-spores i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #d85078; box-shadow: 0 0 8px 2px rgba(176, 48, 120, 0.8);
  animation: introSpore 4.2s linear infinite;
}
@keyframes introSpore {
  0% { transform: translate(0, 12px) scale(0.6); opacity: 0; }
  25% { opacity: 0.9; }
  80% { opacity: 0.7; }
  100% { transform: translate(-40px, -90px) scale(1.2); opacity: 0; }
}
.intro-fade {
  position: fixed; inset: 0; z-index: 970; pointer-events: none;
  background: rgba(6, 5, 10, 1);
  display: flex; align-items: center; justify-content: center;
}
.intro-title {
  position: relative; text-align: center; opacity: 0; will-change: transform, opacity;
  padding: 28px 54px 30px; pointer-events: none; user-select: none;
}
.intro-title-halo {
  position: absolute; inset: -18px -40px; z-index: -1; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(24, 16, 32, 0.56) 0%, rgba(44, 28, 16, 0.24) 48%, transparent 74%);
  filter: blur(8px);
}
.intro-title-sparks { position: absolute; inset: -10px -24px; pointer-events: none; }
.intro-title-sparks i {
  position: absolute; width: 4px; height: 4px; background: #fff4c2;
  box-shadow: 0 0 8px 2px rgba(255, 214, 118, 0.9);
  transform: rotate(45deg);
  animation: introSpark 3.4s ease-in-out infinite;
}
@keyframes introSpark {
  0%, 100% { opacity: 0.15; transform: rotate(45deg) scale(0.6) translateY(4px); }
  50% { opacity: 1; transform: rotate(45deg) scale(1.25) translateY(-6px); }
}
.intro-title-crest {
  margin-bottom: 10px; font: 700 clamp(12px, 1.5vw, 17px)/1 var(--pix);
  letter-spacing: 0.32em; text-indent: 0.32em; color: #f6d584;
  text-shadow: 0 2px 0 #3a220c, 0 0 14px rgba(255, 216, 120, 0.85);
}
.intro-title-main {
  position: relative; margin: 0; font: 700 clamp(42px, 7.6vw, 92px)/1.06 var(--pix);
  letter-spacing: 0.18em; text-indent: 0.18em;
  color: #fff3cf;
  text-shadow:
    0 3px 0 #7a4b18,
    0 6px 0 #3a200b,
    0 9px 0 #1b0e06,
    0 0 30px rgba(255, 206, 102, 0.78),
    0 14px 36px rgba(8, 5, 14, 0.9);
}
.intro-title-main::after {
  content: attr(data-text); position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 250, 224, 0.95) 48%, rgba(255, 216, 120, 0.55) 56%, transparent 78%);
  background-size: 240% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
  animation: introShimmer 4.2s ease-in-out infinite;
}
@keyframes introShimmer {
  0% { background-position: 140% 0; }
  65%, 100% { background-position: -120% 0; }
}
.intro-title-rule {
  position: relative; width: clamp(200px, 34vw, 420px); height: 2px; margin: 18px auto 16px;
  background: linear-gradient(90deg, transparent, #d49e46 18%, #fff4cc 50%, #d49e46 82%, transparent);
  box-shadow: 0 0 14px rgba(255, 214, 120, 0.7), 0 4px 0 -1px rgba(212, 158, 70, 0.35);
}
.intro-title-gem {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%);
  font: 700 14px/1 var(--pix); color: #fff6d2;
  text-shadow: 0 0 10px #ffd26a, 0 2px 0 #3a200b;
}
.intro-title-sub {
  margin: 0; font: 700 clamp(17px, 2.5vw, 30px)/1.4 var(--pix);
  letter-spacing: 0.24em; text-indent: 0.24em;
  color: #fae8c2;
  text-shadow:
    0 2px 0 #3a200b,
    0 4px 0 #180d06,
    0 0 16px rgba(255, 212, 128, 0.45),
    0 6px 20px rgba(8, 5, 14, 0.94);
}
.intro-skip {
  position: fixed; right: 18px; bottom: 22px; z-index: 990; pointer-events: auto;
  padding: 5px 12px; font: 11px var(--pix); color: rgba(244, 232, 200, 0.65);
  background: rgba(16, 12, 24, 0.55); border: 1px solid rgba(212, 178, 108, 0.35);
  cursor: pointer; transition: opacity .2s, color .2s, border-color .2s;
}
.intro-skip:hover { color: #ffe8a8; border-color: #e2b85c; background: rgba(24, 18, 36, 0.85); }

/* ── I02 item lock, I04 enchant pool, I05/I10 dex milestones & rune sets, I06 8-element bars, I09 bank filter ── */
.slot .lk { position: absolute; left: 2px; top: 1px; font-size: 9px; line-height: 1; text-shadow: 0 1px 2px #000; pointer-events: none; z-index: 2; }
.tc-lock { color: #ffd478; font-weight: 700; margin-bottom: 2px; }
.enc-pool-box { margin: 4px 0 8px; padding: 6px 8px; background: var(--sf1, #1c1726); border: 1px solid var(--sf3, #332a42); display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.enc-pool-cat { display: flex; flex-direction: column; gap: 3px; }
.enc-pool-cat > b { font-size: var(--t10); color: var(--tx-gold, #e2c486); border-bottom: 1px solid var(--sf3, #2c2537); padding-bottom: 2px; }
.enc-pool-it { display: flex; flex-wrap: wrap; gap: 4px; font-size: var(--t10); line-height: 1.35; }
.enc-pool-it .nm { color: #ffe090; font-weight: 700; }
.enc-pool-it .ds { color: var(--tx2, #c8bece); }
.el-bars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; margin-top: 4px; }
.el-row { padding: 3px 5px; background: var(--sf1, #1c1726); border: 1px solid var(--sf3, #2c2537); }
.el-hd { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--t10); margin-bottom: 2px; }
.el-hd span { color: var(--tx3, #a89eb4); font-size: 9px; }
.el-meters { display: flex; flex-direction: column; gap: 2px; }
.el-tr { height: 4px; background: rgba(0,0,0,.45); overflow: hidden; }
.el-fl { height: 100%; min-width: 0; }
.bank-filter { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 6px; }
.bank-filter .tabs { display: flex; flex-wrap: wrap; gap: 3px; }
.bank-q { width: 100%; box-sizing: border-box; padding: 4px 6px; font: var(--t11)/1.3 var(--pix); color: var(--tx, #e8dcc0); background: var(--scr, #120f18); border: 2px solid var(--sf3, #2c2537); }
.dx-mode { margin-bottom: 6px; }
.dx-ms { margin-bottom: 6px; padding: 6px 8px; background: var(--sf1, #1c1726); border: 1px solid var(--sf3, #2c2537); }
.dx-ms-hd { font: 700 var(--t11)/1.3 var(--pix); color: var(--tx-gold, #e2c486); margin-bottom: 4px; }
.dx-ms-tr { height: 6px; background: rgba(0,0,0,.45); border: 1px solid var(--sf3, #2c2537); margin-bottom: 5px; overflow: hidden; }
.dx-ms-fl { height: 100%; background: linear-gradient(90deg, #cf9f55, #ffe070); }
.dx-ms-row { display: flex; flex-wrap: wrap; gap: 4px; }
.dx-ms-btn { flex: 1 1 0; padding: 3px 6px; font: 700 var(--t10)/1.2 var(--pix); color: var(--tx3, #9a90a8); background: var(--sf2, #231d30); border: 1px solid var(--sf3, #2c2537); cursor: default; }
.dx-ms-btn.ready { color: #1a1206; background: #f0c050; border-color: #ffe288; cursor: pointer; }
.dx-ms-btn.done { color: #7ce696; border-color: #366a44; background: rgba(46,120,66,.22); }
.dx-tag.got { color: #7ad8ff; border-color: #3a6a8a; background: rgba(60,130,180,.18); }
.dx-tag.new { color: #1b1206; background: #ffe066; border-color: #fff2a8; animation: u08-pulse 1.2s ease-in-out infinite; }

/* ── U01~U09: mobile zoom touch layout, tracker collapse, buff bars, qs flash & radial, tip scroll, npc pill, NEW dot ── */
.qt-tools { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 4px; }
#quest-track.all-folded > :not(.qt-tools) { display: none; }
#st-buffs .bf-chip { position: relative; overflow: hidden; padding-bottom: 4px; }
#st-buffs .bf-bar { position: absolute; left: 0; bottom: 0; height: 2px; pointer-events: none; transition: width .25s linear; }
.act.qs.ready-flash { animation: qs-ready .45s ease-out; }
@keyframes qs-ready { 0% { box-shadow: 0 0 0 2px #fff6b0, 0 0 14px 4px #ffd24a; } 100% { box-shadow: none; } }
#qs-radial { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 960; width: 220px; padding: 10px; background: var(--sf1, #1c1726); border: 2px solid var(--b-mid, #cf9f55); box-shadow: 0 0 0 2px #0a0810, 0 8px 26px rgba(0,0,0,.72); text-align: center; }
.qsr-hd { font: 700 var(--t11)/1.3 var(--pix); color: var(--tx-gold, #ffe070); margin-bottom: 8px; }
.qsr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.qsr-btn { min-height: 40px; font: 700 14px/1 var(--pix); color: var(--tx, #f0e4c8); background: var(--sf2, #252035); border: 2px solid var(--sf3, #3a324c); cursor: pointer; }
.qsr-btn.used { border-color: var(--b-mid, #cf9f55); color: #ffe48a; }
.qsr-x { width: 100%; }
#tip { overflow-y: auto; overscroll-behavior: contain; }
#npc-pill { position: fixed; transform: translate(-50%, -100%); z-index: 42; padding: 4px 10px; font: 700 var(--t11)/1.2 var(--pix); color: #fff4cc; background: rgba(24, 18, 34, .92); border: 2px solid #d4a64a; box-shadow: 0 2px 0 #120d1a, 0 4px 12px rgba(0,0,0,.55); cursor: pointer; white-space: nowrap; }
#npc-pill:hover, #npc-pill:active { background: #342646; border-color: #ffe280; color: #ffffff; }
#menu button.has-new { position: relative; }
#menu button.has-new::after { content: ""; position: absolute; right: 3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: #ffdf5a; box-shadow: 0 0 6px #ffbe3c; animation: u08-pulse 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes u08-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
/* U01: mobile / 175% zoom touch optimization for bag & smith */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  #w-inv .slot { min-width: 42px; min-height: 42px; }
  #w-inv .bag-acts, #shop-junk, #w-smith .btns { display: flex; flex-wrap: wrap; gap: 6px; }
  #w-inv .bag-acts .btn, #shop-junk .btn, #w-smith .btn { min-height: 36px; padding: 6px 10px; flex: 1 1 auto; }
  #w-smith .tabs, #w-inv .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #w-smith .tabs button, #w-inv .tabs button { flex: 0 0 auto; min-height: 34px; padding: 6px 10px; }
  #npc-pill { padding: 7px 14px; font-size: 13px; }
}
