/* Guildmaster UI — dark slate, deep blue headers, antique gold. All drawn in CSS/SVG. */
:root {
  --bg: #0b0c0f;
  --ink: #0d0f13;
  --ink-2: #14171d;
  --ink-3: #1b1f27;
  --line: #2a2e37;
  --line-soft: #ffffff14;
  --gold: #d2a044;
  --gold-hi: #f3c969;
  --gold-lo: #6d5120;
  --parch: #ece3cc;
  --text: #d6d2c6;
  --muted: #8d897c;
  --blue: #2a7be0;
  --blue-hi: #6fbcff;
  --blue-deep: #0d2a57;
  --red: #c7402f;
  --green: #45d39a;
  --common: #b8b8b8;
  --uncommon: #57c56f;
  --rare: #c066ea;
  --serif: 'Cinzel', 'Trajan Pro', Georgia, 'Times New Roman', serif;
  --sans: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --bar-h: 56px;
  --tab-h: 0px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font: 15px/1.4 var(--sans); -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: var(--cur-mouseon), pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: var(--cur-normal), default; }
/* Tales of Pirates cursors (js/cursors.js sets the --cur-* variables) */
html, body { cursor: var(--cur-normal), default; }
button:active:not(:disabled), [data-tip]:active, [data-hov]:active { cursor: var(--cur-mouseclick), pointer; }
input:not([type=range]):not([type=checkbox]):not([type=radio]):not([type=button]), textarea, [contenteditable] { cursor: text; }
#scene.npc-hover { cursor: var(--cur-chat), pointer; }
body.holdwalk, body.holdwalk * { cursor: var(--cur-land), move !important; } /* holding left-click to walk: TOP's boots */
input { font: inherit; color: inherit; }
.ic { display: block; flex: none; }
.serif { font-family: var(--serif); letter-spacing: .18em; text-transform: uppercase; }
.num { font-family: var(--serif); font-variant-numeric: lining-nums; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 45%, #000a 100%); }

/* ---------- World overlay: health bars, floating numbers ---------- */
.ebar { position: absolute; left: -27px; top: 0; width: 54px; display: flex; align-items: center; gap: 3px; will-change: transform; }
.ebar span { font: 600 10px var(--sans); color: var(--parch); width: 14px; height: 14px; line-height: 14px; text-align: center; background: #000b; border: 1px solid var(--gold-lo); }
.ebar b { flex: 1; height: 5px; background: #000c; border: 1px solid #000; }
.ebar i { display: block; height: 100%; background: linear-gradient(#e3564a, #a52a22); }
.ebar.elite span { border-color: var(--gold-hi); color: var(--gold-hi); }
.ebar.mine i { background: linear-gradient(var(--gold-hi), var(--gold)); }
.floater { position: absolute; transform: translate(-50%, -50%); font: 700 15px var(--sans); color: #fff; text-shadow: 0 1px 0 #000, 0 0 6px #000; animation: floatUp .9s ease-out forwards; white-space: nowrap; }
.floater.big { font-size: 21px; color: var(--gold-hi); }
.floater.hurt { color: #ff6b5c; }
.floater.xp { color: #9fd0ff; font-size: 13px; }
.floater.ore { color: #f0a85a; font-size: 13px; }
.floater.lvl { font: 700 20px var(--serif); letter-spacing: .2em; color: var(--gold-hi); }
@keyframes floatUp { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -46px; } }

/* ---------- Top bar ---------- */
#topbar { position: fixed; left: 0; right: 0; top: 0; height: var(--bar-h); display: flex; align-items: stretch; background: var(--noise), linear-gradient(#0a0b0ef2, #0a0b0ed9); border-bottom: 1px solid var(--line); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 18px 0 14px; min-width: 0; flex: 1 1 0; }
.brand svg { flex: none; }
.brand .name { font: 600 14px var(--serif); letter-spacing: .16em; text-transform: uppercase; color: var(--parch); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabs { display: flex; flex: none; }
.tab { position: relative; width: clamp(108px, 11.5vw, 150px); border-left: 1px solid var(--line); font: 500 13px var(--serif); letter-spacing: .28em; text-transform: uppercase; color: #a9a495; transition: color .15s; }
.tab:last-child { border-right: 1px solid var(--line); }
.tab:hover { color: var(--parch); }
.tab kbd { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); font: 600 11px var(--sans); letter-spacing: 0; color: var(--parch); background: #0a0b0e; border: 1px solid #8a8678; border-radius: 4px; min-width: 18px; height: 18px; line-height: 16px; z-index: 1; }
.tab.on { color: #fff; background: radial-gradient(ellipse 70% 90% at 50% 110%, #2a8cffcc, #1257b055 45%, transparent 72%); }
.tab.on::after { content: ''; position: absolute; left: 8%; right: 8%; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--blue-hi), transparent); box-shadow: 0 0 12px 2px #3fa9ff; }
.tab .ic { display: none; }
.res { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 0 16px; flex: 1 1 0; }
.res div { display: flex; align-items: center; gap: 6px; font: 600 15px var(--serif); color: var(--parch); }

/* ---------- Member plate (HUD) ---------- */
#hud { position: fixed; left: 14px; top: calc(var(--bar-h) + 22px); width: 290px; z-index: 10; }
.plate { display: flex; gap: 14px; align-items: center; padding: 12px 14px 12px 16px; background: var(--noise), linear-gradient(90deg, #0c0e12f0, #0c0e12b0); border: 1px solid var(--line); box-shadow: inset 0 0 0 3px #0a0b0e, inset 0 0 0 4px var(--line-soft); }
.diamond { flex: none; width: 40px; height: 40px; transform: rotate(45deg); display: grid; place-items: center; background: linear-gradient(135deg, #1a1c22, #0a0b0e); border: 1px solid var(--gold); box-shadow: inset 0 0 0 2px #0a0b0e, inset 0 0 0 3px var(--gold-lo); margin: 6px; }
.diamond > * { transform: rotate(-45deg); font: 600 18px var(--serif); color: var(--parch); }
.plate .who { flex: 1; min-width: 0; }
.plate .nm { font: 600 15px var(--serif); letter-spacing: .08em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate .sub { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate .sub b { color: var(--gold-hi); font-weight: 500; }
.meter { position: relative; height: 12px; background: #000c; border: 1px solid #000; outline: 1px solid var(--line-soft); }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(#d8483c, #8f211b); transition: width .15s linear; }
.meter span { position: absolute; inset: 0; font: 600 10px/11px var(--sans); text-align: center; color: #fff; text-shadow: 0 1px 1px #000; }
.meter.thin { height: 5px; margin-top: 4px; }
.meter.gold i { background: linear-gradient(var(--gold-hi), var(--gold)); }
.meter.blue i { background: linear-gradient(#5fb0ff, #1f62c4); }

.orders { margin-top: 8px; display: flex; gap: 8px; align-items: stretch; }
.seg { flex: 1; display: flex; background: #0a0b0ee6; border: 1px solid var(--gold-lo); padding: 2px; }
.seg button { flex: 1; height: 38px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; color: #a9a495; }
.seg button.on { color: #fff; background: var(--noise), linear-gradient(#7a5a1c, #b58628 60%, #8a651e); box-shadow: inset 0 0 0 1px var(--gold-hi); }
.threat { display: flex; align-items: center; background: #0a0b0ee6; border: 1px solid var(--line); }
.threat button { width: 30px; height: 42px; color: var(--parch); font-size: 16px; }
.threat button:disabled { color: #4a4a48; }
.threat div { min-width: 44px; text-align: center; line-height: 1.1; }
.threat small { display: block; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.threat b { font: 600 15px var(--serif); color: var(--gold-hi); }
.skillchip { margin-top: 8px; display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: #0a0b0ed9; border: 1px solid var(--line); font-size: 13px; }
.skillchip .lbl { flex: 1; color: var(--parch); }
.skillchip .lbl small { display: block; color: var(--muted); font-size: 11.5px; }
.skillchip .meter { width: 70px; }
.skillchip.locked .lbl { color: var(--muted); }

/* ---------- XP strip ---------- */
#xpbar { position: fixed; left: 0; right: 0; bottom: var(--tab-h); height: 7px; background: #000d; border-top: 1px solid var(--line); z-index: 15; background-image: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), #ffffff22 calc(10% - 1px), #ffffff22 10%); }
#xpbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a87a22, var(--gold-hi)); transition: width .3s; mix-blend-mode: screen; }
#xpbar .diamond { position: absolute; left: 10px; bottom: 8px; width: 28px; height: 28px; margin: 0; }
#xpbar .diamond > * { font-size: 13px; }

/* ---------- Panel window ---------- */
#panel { position: fixed; right: 16px; top: calc(var(--bar-h) + 22px); bottom: 26px; width: 440px; display: none; flex-direction: column; z-index: 12; background: var(--noise), linear-gradient(#11141af7, #0b0d11f7); border: 1px solid #323743; box-shadow: 0 24px 70px #000c, inset 0 0 0 4px #0a0b0e, inset 0 0 0 5px var(--line-soft); }
#panel.open { display: flex; animation: panelIn .18s ease-out; }
@keyframes panelIn { from { opacity: 0; transform: translateX(14px); } }
.phead { flex: none; margin: 5px 5px 0; padding: 16px 18px 14px; display: flex; align-items: baseline; gap: 12px; background: var(--noise), linear-gradient(180deg, #17407e, #0d2447 70%, #0b1a33); border-bottom: 1px solid #3f79c6; box-shadow: 0 6px 18px -8px #2a8cff88; }
.phead h2 { flex: 1; margin: 0; font: 500 20px var(--serif); letter-spacing: .3em; text-transform: uppercase; color: #fff; }
.phead .meta { font: 600 15px var(--serif); color: var(--parch); }
.phead .meta small { color: #a9b8d0; font-size: 12px; }
/* Close buttons: a diamond (a square turned 45 degrees) with the X drawn as two bars crossing at its exact middle (a plus,
   turned with the diamond). Any text inside (some windows put a "x" there) is hidden: a glyph never sits quite centred,
   and turned with the diamond it showed as a stray "+". */
.x { position: relative; flex: none; width: 30px; height: 30px; padding: 0 !important; transform: rotate(45deg); border: 1px solid var(--gold); background: #0a0b0e !important; display: block; align-self: center; font-size: 0 !important; color: transparent !important; overflow: hidden; --xcol: var(--parch); }
.x::before, .x::after { content: ''; position: absolute; left: 50%; top: 50%; background: var(--xcol); border-radius: 1px; transform: translate(-50%, -50%); }
.x::before { width: 52%; height: 2px; }
.x::after { width: 2px; height: 52%; }
.x:hover { background: #2a2110 !important; --xcol: #fff; }
.pbody { flex: 1; overflow-y: auto; padding: 16px 18px 18px; scrollbar-width: thin; scrollbar-color: var(--gold) #15171c; }
.pbody::-webkit-scrollbar { width: 8px; }
.pbody::-webkit-scrollbar-thumb { background: var(--gold); }
.pbody::-webkit-scrollbar-track { background: #15171c; }
.pfoot { flex: none; margin: 0 18px; padding: 12px 0 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; font: 600 15px var(--serif); color: var(--parch); }
.pfoot div { display: flex; align-items: center; gap: 6px; }
.pfoot .sp { flex: 1; }

.cat { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 10px; padding-bottom: 5px; border-bottom: 1px solid var(--line); font: 500 13px var(--serif); letter-spacing: .24em; text-transform: uppercase; color: var(--parch); }
.cat:first-child { margin-top: 0; }
.cat small { margin-left: auto; font: 500 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
.note { color: var(--muted); font-size: 13.5px; margin: 0 0 6px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }

/* ---------- Item slots ---------- */
.slots { display: flex; flex-wrap: wrap; gap: 8px; min-height: 56px; }
.slot { position: relative; width: 56px; height: 56px; display: grid; place-items: center; background: linear-gradient(#20242c, #111318); border: 1px solid #3a3f4a; }
.slot:hover { border-color: var(--parch); }
.slot.r-uncommon { background: linear-gradient(#1f4a2c, #12261a); border-color: var(--uncommon); }
.slot.r-rare { background: linear-gradient(#4a1f5c, #24122c); border-color: var(--rare); }
.slot.round { background: radial-gradient(circle at 50% 40%, #252932, transparent 68%); border-color: transparent; }
.slot.round:hover { border-color: #3a3f4a; }
.slot .pips { position: absolute; left: 4px; top: 2px; font: italic 700 9px var(--sans); letter-spacing: 1px; color: #e9e3d2; }
.slot .ct { position: absolute; right: 3px; bottom: 0; font: 600 15px var(--serif); color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.slot .eq { position: absolute; right: -4px; top: -4px; width: 12px; height: 12px; transform: rotate(45deg); background: var(--gold-hi); border: 1px solid #000; }
.slot.empty { border-style: dashed; color: #4d5059; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.slot.zero { opacity: .35; }
.slot.big { width: 72px; height: 72px; }

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 20px; font-size: 15px; color: #fff; background: var(--noise), linear-gradient(#7a5a1c, #b58628 55%, #8a651e); border: 1px solid var(--gold-hi); white-space: nowrap; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--noise), #1a1d23; border-color: #4a4f5a; color: var(--parch); }
.btn.danger { background: var(--noise), linear-gradient(#5a1710, #7d2217); border-color: #e0503c; color: #ff8c7d; }
.btn.primary { min-height: 52px; padding: 0 34px; font: 600 15px var(--serif); letter-spacing: .3em; text-transform: uppercase; background: var(--noise), radial-gradient(ellipse at 50% 120%, #3f9bff, #1554b8 55%, #0d2f73); border: 1px solid #8cc6ff; box-shadow: 0 0 0 3px #0a0b0e, 0 0 0 4px #4d7fc0, 0 0 26px #1e6fe066; margin: 4px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn:disabled, .btn.primary:disabled { background: var(--noise), #1d2026; border-color: #3a3e47; color: #686a70; box-shadow: none; filter: none; transform: none; }
.btn.primary:disabled { box-shadow: 0 0 0 3px #0a0b0e, 0 0 0 4px #33363d; }

/* ---------- Character sheet ---------- */
.sheet { display: flex; gap: 18px; align-items: flex-start; }
.gearcol { display: flex; flex-direction: column; gap: 10px; }
.gearcol small { display: block; text-align: center; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.gs { display: flex; align-items: center; gap: 8px; }
.gs b { font: 500 40px/1 var(--serif); color: #fff; }
.gs span { font-size: 13px; line-height: 1.15; color: var(--parch); }
.stats { margin-top: 10px; display: grid; grid-template-columns: auto auto 1fr; gap: 3px 12px; font-size: 14.5px; }
.stats .k { color: #c9c4b6; letter-spacing: .08em; }
.stats .v { font-weight: 700; color: #fff; }
.stats .x2 { color: var(--green); font-size: 12.5px; align-self: center; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #ffffff0d; }
.row:last-child { border-bottom: 0; }
.row .info { flex: 1; min-width: 0; }
.row .t { color: #fff; font-weight: 600; }
.row .t em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.row .d { font-size: 13px; color: var(--muted); }
.row .d b { color: var(--parch); font-weight: 600; }
.row .d .ok { color: var(--green); }
.row .d .no { color: #ff7b6b; }
.row .acts { display: flex; gap: 6px; flex: none; }
.row.locked { opacity: .55; }
.tag { display: inline-block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 1px; }

.job { padding: 12px 14px; background: #0a0b0ecc; border: 1px solid var(--line); margin-bottom: 4px; }
.job .top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.job .top .info { flex: 1; }
.job .idle { color: var(--muted); font-size: 13.5px; }

/* ---------- Tooltip card ---------- */
#tip { position: fixed; inset: 0; z-index: 55; display: none; } /* the full item card: over the floating windows (stall, trade, 46-50) */
#tip.open { display: block; }
.tipcard { position: absolute; display: flex; width: 560px; max-width: calc(100vw - 24px); box-shadow: 0 20px 60px #000d; border: 1px solid #3a3e47; background: #000; }
.tipcard .main { flex: 1.5; min-width: 0; }
.tiphead { display: flex; gap: 12px; align-items: stretch; padding: 6px; background: var(--noise), linear-gradient(100deg, #3a3d44, #24262b); }
.tiphead.r-uncommon { background: var(--noise), linear-gradient(100deg, #2b7a43, #164526); }
.tiphead.r-rare { background: var(--noise), linear-gradient(100deg, #8a2fb0, #4a1a66); }
.tiphead .slot { width: 76px; height: 76px; border-color: #ffffff55; background: #0006; }
.tiphead .tt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 6px 2px 0; }
.tiphead h3 { margin: 0; font: 500 18px/1.2 var(--serif); letter-spacing: .16em; text-transform: uppercase; color: #fff; }
.tiphead .line { display: flex; justify-content: space-between; font: 500 13px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: #ece3ccd9; }
.tiphead .line span:last-child { font: 400 14px var(--sans); letter-spacing: 0; text-transform: none; }
.tipbody { padding: 12px 16px 16px; font-size: 15px; }
.tipbody .gs { margin-bottom: 4px; }
.tipbody p { margin: 1px 0; color: var(--parch); }
.tipbody p b { color: #fff; }
.tipbody .flavor { margin: 12px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #e6c877; font-style: italic; }
.tipbody .req { color: var(--green); }
.tipbody .req.no { color: #ff7b6b; }
.tipacts { flex: 1; background: var(--noise), linear-gradient(#22252b, #17191e); border-left: 1px solid #3a3e47; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tipacts h4 { margin: 2px 0 6px; font: 500 12px var(--serif); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.tipacts .btn { width: 100%; }
.tipacts small { color: var(--muted); font-size: 12.5px; }

/* ---------- Toasts (minor notification) ---------- */
#toasts { position: fixed; left: 0; right: 0; top: calc(var(--bar-h) + 26px); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 30; }
.toast { min-width: min(520px, 88vw); padding: 9px 40px; text-align: center; font: 500 14px var(--serif); letter-spacing: .3em; text-transform: uppercase; color: var(--parch); background: linear-gradient(90deg, transparent, #0a0b0ef0 18%, #0a0b0ef0 82%, transparent); border-top: 1px solid; border-bottom: 1px solid; border-image: linear-gradient(90deg, transparent, #8a7a52, transparent) 1; animation: toast 3.2s forwards; }
.toast.gold { color: var(--gold-hi); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 8%, 82% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- Full screens: create guild / recruit / away ---------- */
#screen { position: fixed; inset: 0; z-index: 50; display: none; overflow-y: auto; background: radial-gradient(ellipse at 50% 40%, #0a0b0e99, #0a0b0ef2 80%); }
#screen.open { display: block; }
#screen.modal { background: #000a; }
.stage { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; }
.stage h1 { margin: 0; font: 400 clamp(22px, 4vw, 34px) var(--serif); letter-spacing: .34em; text-transform: uppercase; color: #fff; text-align: center; text-indent: .34em; }
.stage .lede { margin: 10px 0 24px; max-width: 560px; text-align: center; color: var(--parch); font-size: 15.5px; }
.rule { width: min(440px, 80vw); height: 1px; margin-top: 14px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.win { background: var(--noise), linear-gradient(#11141af5, #0b0d11f5); border: 1px solid #323743; box-shadow: 0 24px 70px #000c, inset 0 0 0 4px #0a0b0e, inset 0 0 0 5px var(--line-soft); padding: 5px; }
.winbar { padding: 12px 18px; background: var(--noise), linear-gradient(180deg, #17407e, #0d2447 70%, #0b1a33); border-bottom: 1px solid #3f79c6; font: 500 13px var(--serif); letter-spacing: .28em; text-transform: uppercase; color: #fff; }

.creator { display: grid; grid-template-columns: auto auto; gap: 30px; padding: 24px 26px 26px; }
.creator h5 { margin: 0 0 10px; font: 500 11.5px var(--serif); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); text-align: center; }
.emgrid { display: grid; grid-template-columns: repeat(4, 60px); gap: 6px; padding: 8px; background: #0a0b0e; border: 1px solid var(--line); }
.emgrid button { height: 60px; display: grid; place-items: center; color: #b6b0a0; border: 1px solid transparent; }
.emgrid button:hover { color: #fff; }
.emgrid button.on { color: #fff; border-color: var(--parch); background: #ffffff12; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-top: 10px; padding: 8px; background: #0a0b0e; border: 1px solid var(--line); }
.swatches button { aspect-ratio: 1; min-height: 26px; border: 1px solid #000; }
.swatches button.on { outline: 2px solid #fff; outline-offset: 1px; }
.preview { display: flex; flex-direction: column; align-items: center; width: 250px; }
.preview svg { filter: drop-shadow(0 8px 18px #000a); }
.field { width: 100%; height: 44px; margin: 6px 0 14px; padding: 0 12px; background: #0a0b0e; border: 1px solid var(--gold-lo); outline: 0; text-align: center; font-size: 16px; color: #fff; }
.field:focus { border-color: var(--gold-hi); }
.btnrow { display: flex; gap: 10px; margin-top: 14px; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 290px)); gap: 18px; width: 100%; justify-content: center; }
.card { display: flex; flex-direction: column; background: var(--noise), linear-gradient(#12151bf7, #0b0d11f7); border: 1px solid #323743; box-shadow: 0 18px 50px #000b, inset 0 0 0 4px #0a0b0e, inset 0 0 0 5px var(--line-soft); padding: 5px; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-4px); border-color: var(--gold); }
.card .top { display: flex; align-items: center; gap: 6px; padding: 12px 14px; background: var(--noise), linear-gradient(100deg, var(--c), #0d1017 130%); border-bottom: 1px solid #ffffff30; }
.card .top .nm { font: 600 16px var(--serif); letter-spacing: .08em; color: #fff; }
.card .top .cl { font-size: 13px; color: #ffffffd0; }
.card .mid { padding: 16px 16px 6px; flex: 1; }
.statbar { display: grid; grid-template-columns: 38px 34px 1fr; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 13.5px; }
.statbar .k { color: #c9c4b6; letter-spacing: .08em; }
.statbar .v { font-weight: 700; color: #fff; text-align: right; }
.statbar b { height: 5px; background: #000; border: 1px solid #000; outline: 1px solid var(--line-soft); }
.statbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-lo), var(--gold-hi)); }
.card .trait { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--parch); }
.card .trait b { color: var(--gold-hi); font-weight: 600; }
.card .trait small { display: block; color: var(--muted); margin-top: 6px; }
.card .bot { padding: 10px 10px 12px; display: grid; }

.away { width: min(440px, 100%); }
.away .inner { padding: 20px 24px 22px; text-align: center; }
.away ul { list-style: none; margin: 14px 0 18px; padding: 0; text-align: left; }
.away li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #ffffff0d; color: var(--parch); }
.away li b { color: #fff; font: 600 16px var(--serif); }
.crestbig { display: flex; gap: 18px; align-items: center; margin-bottom: 6px; }
.crestbig h3 { margin: 0 0 4px; font: 500 18px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: #fff; }

#tabbar { display: none; }
#nogl { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 5; color: var(--muted); font-size: 13px; text-align: center; display: none; }

@media (max-width: 1280px) { .tab { font-size: 11.5px; letter-spacing: .16em; } }

/* ---------- Phones and narrow windows: bottom tab bar + sheet ---------- */
@media (max-width: 900px) {
  :root { --bar-h: 48px; --tab-h: 62px; }
  .tabs { display: none; }
  .brand { padding-right: 8px; }
  .res { flex: none; }
  .brand .name { font-size: 12.5px; }
  .res { gap: 11px; padding: 0 12px; }
  .res div { font-size: 14px; }
  #hud { left: 8px; right: 8px; top: calc(var(--bar-h) + 8px); width: auto; max-width: 420px; }
  .plate { padding: 8px 10px; gap: 8px; }
  .skillchip { display: none; }
  .seg button, .threat button { height: 46px; }
  .threat button { width: 40px; }
  #tabbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tab-h); display: flex; z-index: 20; background: var(--noise), #0a0b0ef7; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  #tabbar .tab { flex: 1; width: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 9px; letter-spacing: .05em; border-left: 0; }
  #tabbar .tab .ic { display: block; opacity: .75; }
  #tabbar .tab.on .ic { opacity: 1; }
  #tabbar .tab.on::after { top: -1px; bottom: auto; }
  #tabbar .tab.on { background: radial-gradient(ellipse 80% 90% at 50% -10%, #2a8cffcc, #1257b055 45%, transparent 72%); }
  .tab kbd { display: none; }
  #panel { left: 0; right: 0; top: auto; bottom: calc(var(--tab-h) + 7px); width: auto; height: min(52vh, 520px); border-left: 0; border-right: 0; }
  @keyframes panelIn { from { opacity: 0; transform: translateY(16px); } }
  .phead { padding: 12px 14px 11px; }
  .phead h2 { font-size: 16px; }
  .pbody { padding: 14px; }
  .pfoot { margin: 0 14px; }
  #toasts { top: auto; bottom: calc(var(--tab-h) + 22px); }
  .toast { font-size: 12px; letter-spacing: .2em; padding: 8px 20px; }
  .tipcard { flex-direction: column; left: 12px !important; right: 12px; top: auto !important; bottom: calc(var(--tab-h) + 16px); width: auto; max-height: calc(100vh - var(--tab-h) - 40px); overflow-y: auto; }
  .tipacts { border-left: 0; border-top: 1px solid #3a3e47; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tipacts h4 { display: none; }
  .tipacts .btn { width: auto; flex: 1; min-height: 46px; }
  .tipacts small { flex-basis: 100%; }
  .stage { justify-content: flex-start; padding: 22px 12px 30px; }
  .creator { grid-template-columns: 1fr; gap: 20px; padding: 18px 14px; justify-items: center; }
  .emgrid { grid-template-columns: repeat(4, minmax(0, 64px)); }
  .cards { grid-template-columns: minmax(0, 420px); gap: 12px; }
  .card .mid { padding: 12px 14px 4px; }
  .btn { min-height: 46px; }
  .btn.sm { min-height: 44px; }
  .slot { width: 60px; height: 60px; }
}
@media (max-width: 380px) { .cols { grid-template-columns: 1fr; } .res .hide-xs { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition: none !important; } }


.topnum { position: absolute; left: 0; top: 0; display: flex; pointer-events: none; will-change: transform, opacity; z-index: 3; }
/* TOP's font effect strips (assets/pirates, from texture/effect): 12 cells, one unit wide and 1.4 high per digit */
.topnum i { flex: none; width: 1em; height: 1.4em; background: url('../assets/pirates/subblood.png') 0 0 / 1200% 100% no-repeat; }
.topnum.main i { background-image: url('../assets/pirates/subblood2.png'); }
.topnum.add i { background-image: url('../assets/pirates/addblood.png'); }
.topnum.add.main i { background-image: url('../assets/pirates/addblood2.png'); }
.topnum.miss { width: 4em; height: 2em; background: url('../assets/pirates/submiss.png') center / 100% 100% no-repeat; }
.topnum.miss.main { background-image: url('../assets/pirates/submiss2.png'); }

/* ---------- World map ---------- */
#map { position: fixed; left: 0; right: 0; top: var(--bar-h); bottom: calc(var(--tab-h) + 7px); z-index: 8; display: none; overflow: hidden; background: #7c918d; }
#map.open { display: block; }
#map::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: var(--noise); background-size: 180px; mix-blend-mode: multiply; filter: invert(1); opacity: .9; }
.pins, .me { z-index: 2; }
#map::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 140px 30px #0b0c0fcc, inset 0 0 0 1px #000; }
.mapstage { position: absolute; inset: 0; display: grid; place-items: center; }
.mapwrap { position: relative; width: min(100vw, calc(100vh - var(--bar-h) - var(--tab-h) - 7px)); aspect-ratio: 1; }
.mapart { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
/* the map's close-up detail: just the 512 px squares in view (js/ui.js mapTiles), over the picture, under the pins */
.maptiles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; isolation: isolate; } /* its own layer: the squares' z-index (their level) stays inside it, under every pin and mark */
.maptiles img { position: absolute; display: block; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.road { stroke: #ecd27a; stroke-width: 2.6; transition: stroke .2s, stroke-width .2s; }
.road.closed { stroke-dasharray: 2 12; opacity: .55; }
.road.route { stroke: #fff6c8; stroke-width: 4; filter: drop-shadow(0 0 5px #ffd76a); }
.maptitle { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 2; padding: 7px 46px; white-space: nowrap; font: 500 14px var(--serif); letter-spacing: .34em; text-indent: .34em; text-transform: uppercase; color: var(--parch); background: linear-gradient(90deg, transparent, #0a0b0ee6 20%, #0a0b0ee6 80%, transparent); border-top: 1px solid; border-bottom: 1px solid; border-image: linear-gradient(90deg, transparent, #8a7a52, transparent) 1; pointer-events: none; }
.pins { position: absolute; inset: 0; pointer-events: none; } /* only its own pins take clicks: NPC icons and quest marks under it stay pressable */
.pins .pin { pointer-events: auto; }
.pin { position: absolute; transform: translate(-50%, -17px); display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 48px; padding: 0 4px 4px; z-index: 1; }
.pin .pd { width: 30px; height: 30px; margin: 2px; transform: rotate(45deg); display: grid; place-items: center; background: linear-gradient(135deg, #1d2027, #0a0b0e); border: 1px solid var(--gold); box-shadow: 0 0 0 2px #0a0b0e, 0 0 0 3px var(--gold-lo), 0 4px 10px #000a; transition: transform .15s; }
.pin .pd .ic { transform: rotate(-45deg); }
.pin .pl { padding: 2px 8px 3px; font: 600 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: #fff; background: #0b0c0fd9; border: 1px solid #ffffff26; white-space: nowrap; text-align: center; line-height: 1.25; }
.pin .pl small { display: block; font: 500 10.5px var(--sans); letter-spacing: .04em; text-transform: none; color: var(--gold-hi); }
.pin.city { transform: translate(-50%, -22px); z-index: 2; }
.pin.city .pd { width: 40px; height: 40px; border-color: var(--gold-hi); }
.pin.city .pl { font-size: 12.5px; }
.pin:hover .pd { transform: rotate(45deg) scale(1.12); }
.pin.here .pd { border-color: var(--blue-hi); box-shadow: 0 0 0 2px #0a0b0e, 0 0 0 3px #3f79c6, 0 0 18px 4px #3fa9ff; }
.pin.sel .pd { background: linear-gradient(135deg, #b58628, #7a5a1c); border-color: #fff; }
.pin.locked .pd { border-color: #6a6a66; box-shadow: 0 0 0 2px #0a0b0e, 0 0 0 3px #3a3a38; }
.pin.locked .pl { color: #b9b5a8; }
.pin.locked .pl small { color: #f0a85a; }
.pin.soon { opacity: .8; }
.me { position: absolute; width: 0; height: 0; z-index: 3; pointer-events: none; }
.me i { position: absolute; left: -9px; top: -52px; width: 18px; height: 18px; transform: rotate(45deg); border: 2px solid #fff; box-shadow: 0 0 0 2px #0a0b0e, 0 3px 8px #000c; animation: mePulse 1.6s ease-out infinite; transition: top .25s; }
.me.moving i { top: -9px; }
@keyframes mePulse { 0% { outline: 2px solid #ffffffcc; outline-offset: 0; } 100% { outline: 2px solid #ffffff00; outline-offset: 12px; } }

#placecard { position: absolute; left: 14px; bottom: 18px; width: 320px; z-index: 4; }
.placecard .winbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px 9px 16px; font-size: 14px; }
.placecard .x { width: 24px; height: 24px; margin: 4px; }
.placecard .inner { padding: 12px 14px 14px; display: grid; gap: 10px; }
.placecard p { margin: 0; font-size: 13.5px; color: var(--parch); }
.ptype { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ptype b { color: var(--blue-hi); font-weight: 600; }
.pfacts { display: flex; gap: 18px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pfacts small { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pfacts b { font: 600 15px var(--serif); color: #fff; }
.placecard .btn.primary { margin: 4px; min-height: 46px; }

.where { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 12px; text-align: left; background: var(--noise), #0a0b0ee6; border: 1px solid var(--gold-lo); }
.where:hover { border-color: var(--gold-hi); }
.where div { flex: 1; min-width: 0; line-height: 1.15; }
.where small { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.where b { font: 600 14px var(--serif); letter-spacing: .06em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.where span { font-size: 12px; color: var(--gold-hi); white-space: nowrap; }
.meter.trip { margin-top: 6px; }
.stations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.placecard .stations { margin-top: 0; }
.stn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 8px; min-height: 64px; background: var(--noise), #0a0b0ee6; border: 1px solid var(--line); text-align: center; }
.stn:hover { border-color: var(--gold-hi); background: var(--noise), #1c170c; }
.stn b { font: 600 11.5px var(--serif); letter-spacing: .08em; color: #fff; }
.stn small { font-size: 10.5px; color: var(--muted); line-height: 1.15; }
.note.warn { color: #f0a85a; padding: 8px 10px; border: 1px solid #6b4a1e; background: #2a1d0a99; margin-bottom: 12px; }

@media (max-width: 900px) {
  .mapstage { place-items: start center; padding-top: 150px; }
  .maptitle { display: none; }
  #placecard { left: 8px; right: 8px; bottom: 8px; width: auto; }
  .pin .pl { font-size: 9.5px; letter-spacing: .08em; padding: 1px 5px 2px; }
  .pin .pl small { font-size: 9.5px; }
  .pin.city .pl { font-size: 10.5px; }
  .pin .pd { width: 26px; height: 26px; }
  .pin.city .pd { width: 34px; height: 34px; }
  .stn small { display: none; }
  .stn { min-height: 54px; }
}

@media (max-width: 900px) {
  /* With the map open the place card already lists the stations, so keep the HUD short. */
  #map.open ~ #hud .stations, #map.open ~ #hud .skillchip { display: none; }
  .placecard .inner { grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; padding: 10px 12px 12px; }
  .placecard .ptype, .placecard p, .placecard .stations { grid-column: 1 / -1; }
  .placecard p { font-size: 12.5px; }
  .placecard .pfacts { border: 0; padding: 0; }
  .placecard .btn { min-height: 44px; padding: 0 22px; }
}

/* ---------- Login, character select, character creation ---------- */
#screen.clear { background: linear-gradient(90deg, #0a0b0ecc 0, #0a0b0e55 34%, transparent 60%); pointer-events: none; overflow: hidden; }
#screen.clear .charsel > * { pointer-events: auto; }
.login h1 { font-size: clamp(30px, 6vw, 54px); letter-spacing: .3em; text-indent: .3em; }
.loginbox { width: min(400px, 100%); }
.loginbox .inner { display: grid; gap: 12px; padding: 18px 20px 20px; }
.loginbox label { display: grid; gap: 5px; font: 500 11.5px var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.loginbox .field { margin: 0; text-align: left; font: 400 16px var(--sans); letter-spacing: 0; text-transform: none; }
.loginbox .note { margin: 4px 0 0; font-size: 12.5px; }
.loginbox label.remember { display: flex; align-items: center; gap: 9px; cursor: pointer; letter-spacing: .14em; user-select: none; }
.loginbox label.remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold-hi); cursor: pointer; }
.charsel { position: absolute; inset: var(--bar-h) 0 0 0; }
.cs-left { position: absolute; left: 22px; top: 22px; bottom: 22px; width: 350px; display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin; }
.cs-left h1 { margin: 6px 0 16px; font: 400 21px var(--serif); letter-spacing: .34em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 10px #000; }
.cs-left .win { padding: 5px 5px 12px; }
.cs-head { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 8px; background: var(--noise), linear-gradient(180deg, #17407e, #0d2447 70%, #0b1a33); border-bottom: 1px solid #3f79c6; }
.cs-head small { display: block; font: 500 10.5px var(--serif); letter-spacing: .2em; text-transform: uppercase; color: #a9b8d0; }
.cs-head b { font: 600 14px var(--serif); letter-spacing: .06em; color: #fff; }
.cs-sec { margin: 12px 9px 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); font: 500 12px var(--serif); letter-spacing: .24em; text-transform: uppercase; color: var(--parch); }
.cs-sec:first-child { margin-top: 8px; }
.cs-list { display: grid; gap: 6px; padding: 0 8px; }
.cs-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 12px 6px 8px; text-align: left; background: var(--noise), #15181ecc; border: 1px solid var(--line); border-left: 3px solid transparent; }
.cs-row:hover { border-color: #4a4f5a; }
.cs-row.on { background: var(--noise), linear-gradient(100deg, #2b4a78, #1a2740); border-color: #5d8fd0; border-left-color: var(--blue-hi); }
.cs-row .diamond { width: 34px; height: 34px; }
.cs-row .diamond > * { font-size: 15px; }
.cs-row .who { min-width: 0; }
.cs-row .nm { font: 600 15px var(--sans); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-row .cl { font-size: 12.5px; color: #b9c2d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-row.new { border-style: dashed; color: var(--parch); }
.cs-row.new .nm { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; color: var(--parch); }
.cs-row .plus { width: 34px; height: 34px; margin: 6px; display: grid; place-items: center; border: 1px solid #6a6a66; border-radius: 50%; font-size: 20px; color: var(--parch); }
.cs-row .swatch { width: 14px; height: 40px; margin: 0 6px 0 4px; background: var(--c); border: 1px solid #ffffff40; }
.cs-left .btnrow { margin: 12px 8px 0; }
.cs-left .btnrow .btn { flex: 1; }
.cs-stats { margin: 10px 12px 0; }
.cs-stats .note { margin: 8px 0 0; font-size: 12.5px; }
.cs-stats .note b { color: var(--gold-hi); font-weight: 600; }
.cs-traits, .cs-classes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 8px; }
.cs-traits button, .cs-classes button { display: grid; gap: 1px; min-height: 48px; padding: 6px 10px; text-align: left; background: var(--noise), #15181ecc; border: 1px solid var(--line); }
.cs-traits button b, .cs-classes button b { font: 600 13.5px var(--sans); color: #fff; }
.cs-traits button small, .cs-classes button small { font-size: 12px; color: var(--muted); }
.cs-traits button.on, .cs-classes button.on { background: var(--noise), linear-gradient(#7a5a1c, #a67a22); border-color: var(--gold-hi); }
.cs-traits button.on small, .cs-classes button.on small { color: #fff3cf; }
.cs-bodies { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 8px; }
.cs-bodies button { min-height: 44px; padding: 6px 4px; background: var(--noise), #15181ecc; border: 1px solid var(--line); border-bottom: 3px solid var(--c); }
.cs-bodies button b { font: 600 13.5px var(--sans); color: #fff; }
.cs-bodies button.on { background: var(--noise), linear-gradient(#7a5a1c, #a67a22); border-color: var(--gold-hi); border-bottom-color: var(--c); }
.cs-blurb { margin: 6px 12px 0; font-size: 12.5px; }
.cs-step { display: grid; grid-template-columns: 1fr 44px 64px 44px; align-items: center; gap: 6px; padding: 0 8px; margin-bottom: 6px; }
.cs-step .k { font-size: 13px; color: var(--muted); }
.cs-step b { text-align: center; font: 600 13.5px var(--sans); color: #fff; }
.cs-step .btn { min-height: 36px; padding: 0; font-size: 18px; }
.cs-colors { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; padding: 0 8px; margin-bottom: 6px; }
.cs-colors .k { font-size: 13px; color: var(--muted); }
.cs-colors div { display: flex; gap: 5px; }
.cs-colors button { width: 24px; height: 24px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid var(--line); }
.cs-colors button.on { border-color: var(--gold-hi); box-shadow: 0 0 0 2px #0008, 0 0 8px var(--gold-hi); }
.cs-classes button { border-left: 3px solid var(--c); }
.cs-classes button:disabled { opacity: .38; cursor: var(--cur-forbid), not-allowed; }
.cs-name { display: flex; gap: 6px; padding: 0 8px; }
.cs-name .field { margin: 0; flex: 1; min-width: 0; text-align: left; }
.cs-play { position: absolute; right: 30px; bottom: 34px; display: flex; align-items: center; gap: 12px; }
.btn.primary.big { min-width: 250px; min-height: 64px; font-size: 17px; }

@media (max-width: 900px) {
  #screen.clear { background: linear-gradient(180deg, #0a0b0ecc 0, #0a0b0e66 45%, transparent 70%); overflow-y: auto; }
  .cs-left { position: static; width: auto; margin: 12px 10px 0; max-height: calc(100% - 100px); }
  .cs-left h1 { font-size: 16px; margin: 4px 0 10px; }
  .cs-play { left: 10px; right: 10px; bottom: 14px; }
  .cs-play .btn.primary.big { flex: 1; min-width: 0; min-height: 56px; }
  .cs-row { min-height: 54px; }
}

.tipacts small.warn { color: #f0a85a; }

/* ---------- Quests and the quest giver ---------- */
.npcplate { position: absolute; left: 0; top: 0; margin-left: -70px; width: 140px; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: auto; will-change: transform; }
.npcplate b { font: 700 30px/1 var(--serif); color: var(--gold-hi); text-shadow: 0 0 10px #f3c96999, 0 2px 0 #000; animation: bob 1.4s ease-in-out infinite; }
.npcplate.ready b { color: #7fd8ff; text-shadow: 0 0 10px #3fa9ffaa, 0 2px 0 #000; }
.npcplate span { padding: 2px 9px 3px; font: 600 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: #fff; background: #0b0c0fd9; border: 1px solid var(--gold-lo); white-space: nowrap; }
.npcplate:hover span { border-color: var(--gold-hi); }
@keyframes bob { 50% { transform: translateY(-5px); } }
.where.npc { margin-top: 8px; width: 100%; }
.qmark { flex: none; width: 26px; height: 26px; display: grid; place-items: center; font: 700 19px/1 var(--serif); color: var(--gold-hi); border: 1px solid var(--gold); background: #0a0b0e; transform: rotate(45deg); margin: 0 4px; }
.qmark i { font-style: normal; transform: rotate(-45deg); }
.where .qmark { color: var(--gold-hi); font-size: 19px; }
.qmark.ready { color: #7fd8ff; border-color: #3f79c6; }
.qmark.none { color: #6a6a66; border-color: #3a3a38; }
.npcsay { margin: 0 0 14px; padding: 10px 14px; font-style: italic; color: #e6c877; background: #0a0b0ecc; border-left: 2px solid var(--gold); }
.qcard { padding: 12px 14px; margin-bottom: 10px; background: var(--noise), #0a0b0ecc; border: 1px solid var(--line); border-left: 3px solid var(--gold-lo); }
.qcard.ready { border-left-color: #6fbcff; background: var(--noise), #0d1a2ccc; }
.qcard.available { border-left-color: var(--gold-hi); }
.qcard h4 { margin: 0 0 6px; font: 600 15px var(--serif); letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.qcard p { margin: 0 0 10px; font-size: 13.5px; color: var(--parch); }
.qgoal { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: #c9c4b6; }
.qgoal b { color: #fff; font: 600 14px var(--serif); white-space: nowrap; }
.qfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.qfoot em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.qfoot em.ok { color: #7fd8ff; }
.qrew { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--parch); }
.qrew span { display: inline-flex; align-items: center; gap: 4px; }
.qrew b { color: #fff; }

/* ---------- Quest flags on the map, quest progress over the action ---------- */
.pin .pq { position: absolute; left: calc(50% + 30px); top: -12px; font: 700 28px/1 var(--serif); color: var(--gold-hi); text-shadow: 0 0 10px #f3c969, 0 2px 0 #000, 0 0 3px #000; animation: bob 1.4s ease-in-out infinite; pointer-events: none; }
.pin .pq.ready { color: #7fd8ff; text-shadow: 0 0 10px #3fa9ff, 0 2px 0 #000, 0 0 3px #000; }
.pin .pgoal { display: block; margin-top: 1px; font: 600 10.5px var(--sans); font-style: normal; letter-spacing: .04em; text-transform: none; color: #0b0c0f; background: var(--gold-hi); padding: 0 5px; }
.floater.quest { font: 600 15px var(--serif); letter-spacing: .08em; color: var(--gold-hi); padding: 3px 10px; background: #0b0c0fd9; border: 1px solid var(--gold-lo); text-shadow: none; animation-duration: 1.7s; }
.floater.quest.done { color: #7fd8ff; border-color: #3f79c6; }
.floater.note { font: 600 14px var(--sans); color: #ffd9a0; padding: 3px 10px; background: #0b0c0fd9; border: 1px solid #6a5233; text-shadow: none; animation: noteUp 2.4s ease-out forwards; } /* a message over a node */
@keyframes noteUp { 0% { opacity: 0; margin-top: 6px; } 10% { opacity: 1; margin-top: 0; } 80% { opacity: 1; margin-top: -10px; } 100% { opacity: 0; margin-top: -16px; } }
@keyframes floatFade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  /* Without this the global reduced-motion rule ends floating text in 0.01s, so it is never seen. Fade in place instead of rising. */
  .floater { animation: floatFade .9s forwards !important; }
  .floater.quest { animation-duration: 1.7s !important; }
  .floater.note { animation-duration: 2.4s !important; } /* a message over a node: long enough to read */
}

/* ---------- Gain feed: what was just earned ---------- */
#feed { position: fixed; left: 22px; bottom: 44px; z-index: 9; width: 250px; pointer-events: none; display: flex; flex-direction: column; }
.gain { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 6px; border-top: 1px solid #ffffff33; text-shadow: 0 1px 3px #000, 0 0 8px #000; animation: gainIn .25s ease-out; }
.gain:first-child { border-top: 0; }
.gain b { font: 500 21px var(--serif); color: #fff; min-width: 46px; }
.gain span { font: 500 17px var(--sans); color: #fff; white-space: nowrap; }
.gring { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#e8762b calc(var(--f) * 360deg), #ffffff30 0); box-shadow: 0 0 0 1px #000a, 0 2px 8px #000a; }
.gring i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #14161b; border: 1px solid #ffffff55; font: 600 16px var(--serif); font-style: normal; color: #fff; text-shadow: none; }
.gicon { position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #2c313bcc, #0b0c0f99 70%); }
.gicon small { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); font: 600 12.5px var(--serif); color: #fff; }
@keyframes gainIn { from { opacity: 0; transform: translateX(-10px); } }
@media (max-width: 900px) {
  #feed { left: 10px; bottom: calc(var(--tab-h) + 70px); width: 210px; }
  .gain { height: 46px; gap: 9px; }
  .gain b { font-size: 18px; min-width: 38px; }
  .gain span { font-size: 15px; }
  .gring, .gicon { width: 38px; height: 38px; }
  .gring i { width: 31px; height: 31px; font-size: 14px; }
}

/* ---------- Player nameplate, gain feed in the world, quest targets ---------- */
.nameplate { position: absolute; left: 0; top: 0; margin: -34px 0 0 -90px; width: 180px; display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; will-change: transform; }
.nameplate > div { display: flex; align-items: center; justify-content: center; gap: 7px; }
.nameplate u { display: block; width: 74px; height: 6px; background: #000c; border: 1px solid #000; outline: 1px solid #ffffff2e; text-decoration: none; }
.nameplate u em { display: block; height: 100%; background: linear-gradient(#58d27a, #2a8f49); }
.nameplate u.low em { background: linear-gradient(#e3564a, #a52a22); }
.nameplate i { flex: none; width: 19px; height: 19px; transform: rotate(45deg); display: grid; place-items: center; background: #0b0c0f; border: 1px solid var(--gold); }
.nameplate i b { transform: rotate(-45deg); font: 600 11px/1 var(--serif); color: #fff; }
.nameplate span { font: 600 12.5px var(--serif); letter-spacing: .1em; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px #000, 0 0 6px #000, 0 0 2px #000; }
#feed.world { left: 0; top: 0; bottom: auto; width: auto; will-change: transform; }
#feed.world .gain { height: 40px; gap: 8px; padding: 0 4px; border-top-color: #ffffff26; }
#feed.world .gain b { font-size: 17px; min-width: 34px; }
#feed.world .gain span { font-size: 14.5px; }
#feed.world .gring, #feed.world .gicon { width: 34px; height: 34px; }
#feed.world .gring i { width: 27px; height: 27px; font-size: 13px; }
#feed.world .gicon .ic { width: 26px; height: 26px; }
#feed.world .gicon small { font-size: 11px; bottom: -6px; }
.ebar.quest::before { content: '!'; position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 1px; font: 700 20px/1 var(--serif); color: var(--gold-hi); text-shadow: 0 0 8px #f3c969, 0 2px 0 #000, 0 0 3px #000; }

/* ---------- Smooth experience fills (the widths are animated from JS) ---------- */
#xpbar i { transition: none; position: relative; }
#xpbar i::after { content: ''; position: absolute; right: 0; top: -3px; bottom: -3px; width: 0; }
#xpbar i.filling { filter: brightness(1.35); box-shadow: 0 0 12px 1px #f3c969aa; }
#xpbar i.filling::after { width: 3px; background: #fff7d6; box-shadow: 0 0 10px 3px #ffe9a3; }
.gring.filling { box-shadow: 0 0 0 1px #000a, 0 0 12px 2px #e8762bcc; }

/* Back sits beside Create/Play: same height (including Create's outer ring) and the same lettering. */
.cs-play .btn.ghost { min-height: 72px; padding: 0 30px; font: 600 15px var(--serif); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; }
@media (max-width: 900px) { .cs-play .btn.ghost { min-height: 64px; padding: 0 20px; } }

/* ---------- Station buttons over the attendants in the city ---------- */
.npcplate.st { gap: 0; }
.npcplate.st span { padding: 4px 12px 4px; font-size: 11.5px; border-color: var(--gold); background: var(--noise), linear-gradient(#3a2c10f2, #15120af2); box-shadow: 0 3px 10px #000a; }
.npcplate.st small { margin-top: 2px; font: 500 11px var(--sans); color: #e9dfc6; text-shadow: 0 1px 2px #000, 0 0 5px #000; white-space: nowrap; }
.npcplate.st:hover span, .npcplate:hover span { border-color: #fff; color: var(--gold-hi); }
#scene { cursor: var(--cur-normal), default; }

/* ---------- Class mentor ---------- */
.ccard { border-left-color: var(--c); }
.ccard h4 { display: flex; align-items: baseline; gap: 10px; }
.ccard h4 small { font: 500 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
.ccard .cstats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-bottom: 4px; }
.ccard .cstats .statbar { margin-bottom: 4px; grid-template-columns: 34px 28px 1fr; }
.ccard p b { color: var(--gold-hi); font-weight: 600; }
.ctrial { margin: 2px 0 8px; padding: 8px 10px; background: #0a0b0e99; border-left: 2px solid var(--gold-lo); font-size: 13px; }
.ctrial b { display: block; font: 600 12px var(--serif); letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 2px; }
.ctrial span { font-style: italic; color: #e6c877; }
.cbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.ccard.done { border-left-width: 3px; }

/* ---------- Equipped column beside the inventory ---------- */
.pside { position: absolute; right: calc(100% + 14px); top: 0; width: 196px; padding: 12px 12px 14px; background: var(--noise), linear-gradient(#11141af2, #0b0d11e6); border: 1px solid #323743; box-shadow: 0 18px 50px #000b, inset 0 0 0 3px #0a0b0e, inset 0 0 0 4px var(--line-soft); }
.pside h3 { margin: 0 0 10px; font: 500 13px var(--serif); letter-spacing: .26em; text-transform: uppercase; color: var(--parch); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.eqgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; margin-bottom: 12px; }
.eqslot { display: grid; justify-items: center; gap: 3px; min-width: 0; }
.eqslot small { max-width: 100%; font-size: 10.5px; line-height: 1.15; text-align: center; color: #c9c4b6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eqslot.soon { opacity: .55; }
.eqslot .slot.empty { font-size: 9.5px; }
.pside .gs b { font-size: 34px; }
.pside .stats { margin-top: 8px; font-size: 14px; }
.pside .note.warn { margin: 12px 0 0; font-size: 12px; padding: 6px 8px; }
@media (max-width: 900px) {
  /* On a phone the column becomes a strip under the header. */
  #panel { display: none; }
  #panel.open { display: flex; }
  .phead { order: 0; } .pside { order: 1; } .pbody { order: 2; } .pfoot { order: 3; }
  .pside { position: static; width: auto; margin: 0 5px; padding: 8px 10px; border-width: 0 0 1px; box-shadow: none; display: flex; align-items: center; gap: 12px; overflow-x: auto; }
  .pside h3 { display: none; }
  .eqgrid { display: flex; gap: 6px; margin: 0; }
  .eqslot small, .eqslot.soon { display: none; }
  .eqslot .slot.big { width: 52px; height: 52px; }
  .pside .gs b { font-size: 26px; }
  .pside .stats { margin: 0; font-size: 12.5px; gap: 0 8px; }
  .pside .note.warn { display: none; }
}

/* ---------- Attributes and combat stats ---------- */
.cat small.pts { color: var(--gold-hi); font-weight: 600; }
.attrs { display: grid; gap: 4px; }
.attr { display: grid; grid-template-columns: 40px 34px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px 7px 10px; background: var(--noise), #0a0b0ecc; border: 1px solid var(--line); }
.attr > b { font: 600 13px var(--serif); letter-spacing: .14em; color: var(--gold-hi); }
.attr > .num { font-size: 20px; font-weight: 600; color: #fff; text-align: right; }
.attr .t { font-size: 14px; font-weight: 600; color: #fff; }
.attr .d { font-size: 12px; color: var(--muted); line-height: 1.25; }
.attr .plus { width: 34px; height: 34px; display: grid; place-items: center; font: 600 20px/1 var(--sans); color: #fff; background: var(--noise), linear-gradient(#7a5a1c, #b58628 55%, #8a651e); border: 1px solid var(--gold-hi); }
.attr .plus:hover { filter: brightness(1.2); }
.attr .plus:disabled { background: #1d2026; border-color: #3a3e47; color: #55575c; filter: none; }
.attrs + .note { margin: 8px 0 0; font-size: 12.5px; }
.substats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.substats > div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid #ffffff0d; font-size: 13.5px; }
.substats span { color: #c9c4b6; }
.substats b { color: #fff; font-weight: 700; white-space: nowrap; }
.substats .main b { color: var(--gold-hi); }
.tab.due::before { content: ''; position: absolute; right: 12px; top: 12px; width: 8px; height: 8px; transform: rotate(45deg); background: var(--gold-hi); box-shadow: 0 0 8px #f3c969; }
@media (max-width: 900px) { .attr .plus { width: 44px; height: 44px; } .substats { grid-template-columns: 1fr; } #tabbar .tab.due::before { right: 22%; top: 8px; } }

/* ---------- Map zoom and pan ---------- */
#map { touch-action: none; }
.mapstage, #map.panning .mapstage { cursor: var(--cur-normal), default; } /* TOP's plain cursor on the world map, panning too */
.mapwrap { --inv: 1; transform-origin: 50% 50%; }
.pin { transform-origin: 50% 17px; transform: translate(-50%, -17px) scale(var(--inv)); }
.pin.city { transform-origin: 50% 22px; transform: translate(-50%, -22px) scale(var(--inv)); }
.me { transform: scale(var(--inv)); }
.mapctl { position: absolute; right: 16px; bottom: 18px; z-index: 4; display: grid; gap: 6px; }
.mapctl button { width: 40px; height: 40px; display: grid; place-items: center; font: 600 20px/1 var(--sans); color: var(--parch); background: var(--noise), #0b0c0fe6; border: 1px solid var(--gold-lo); }
.mapctl button:hover { border-color: var(--gold-hi); color: #fff; }
@media (max-width: 900px) { .mapctl { right: 8px; bottom: auto; top: 150px; } .mapctl button { width: 44px; height: 44px; } }

/* ---------- Skill hotbar ---------- */
#hotbar { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 11; display: flex; gap: 10px; }
#map.open ~ #hotbar { display: none !important; }
.hslot { position: relative; width: 58px; height: 58px; display: grid; place-items: center; background: var(--noise), linear-gradient(#3a2418, #1b110b); border: 1px solid #8a6a3a; box-shadow: inset 0 0 0 2px #0a0b0e, inset 0 0 0 3px #ffffff14, 0 4px 12px #000a; }
button.hslot:hover { border-color: var(--gold-hi); }
.hslot.skill.ready { border-color: var(--gold-hi); box-shadow: inset 0 0 0 2px #0a0b0e, inset 0 0 0 3px #f3c96955, 0 0 14px #f3c96966; }
/* Not enough SP (mana) to cast it: the icon greyed right out, with a blue mana drop over it */
.hslot.skill.nosp > img, .hslot.skill.nosp > svg { filter: grayscale(1) brightness(0.45); }
.hslot.skill.noweapon > img, .hslot.skill.noweapon > svg { filter: grayscale(1) brightness(0.45); } /* not the weapon it takes (TOP's item_need): greyed */
.hslot.skill.nosp::after { content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -9px 0 0 -10px; pointer-events: none;
  border-radius: 0 50% 50% 50%; transform: rotate(45deg); /* a square with three round corners, turned: a teardrop, point up */
  background: radial-gradient(circle at 62% 62%, #bfe6ff 0 14%, #4aa8ff 32%, #1554c8 78%, #0b2f7a 100%);
  box-shadow: 0 0 0 1px #06173d, 0 0 8px #3f9dffcc, 0 2px 4px #000c; }
.hslot kbd { position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); min-width: 20px; height: 20px; padding: 0 4px; font: 700 12px/18px var(--sans); text-align: center; color: #111; background: #e9e3d2; border: 1px solid #000; border-radius: 4px; z-index: 2; }
.hslot .cd { position: absolute; inset: 3px; pointer-events: none; background: conic-gradient(#000000b8 calc(var(--cd, 0) * 360deg), transparent 0); }
.hslot > img.ic { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: cover; } /* TOP icons fill the slot edge to edge (inside its frame) */
.hslot b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 20px var(--serif); color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; }
.hslot .auto { position: absolute; right: -6px; top: -8px; padding: 1px 5px; font: 700 9px/13px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #8d897c; background: #0b0c0f; border: 1px solid #4a4f5a; z-index: 2; }
.hslot .auto.on { color: #111; background: var(--gold-hi); border-color: #000; }
.hslot.locked { background: var(--noise), linear-gradient(#22252b, #121418); border-color: #4a4f5a; gap: 0; align-content: center; }
.hslot.locked small { font: 600 10.5px var(--sans); color: #a9a495; margin-top: -2px; }
.hslot.empty { background: #0b0c0f99; border-color: #3a3e47; box-shadow: inset 0 0 0 2px #0a0b0e; }
.hslot.empty kbd, .hslot.locked kbd { background: #8d897c; }
@media (max-width: 900px) {
  #hotbar { bottom: calc(var(--tab-h) + 24px); gap: 8px; }
  .hslot { width: 52px; height: 52px; }
  .hslot kbd { display: none; }
  #toasts { bottom: calc(var(--tab-h) + 92px); }
}

/* Nothing in the game is meant to be highlighted by a stray drag; text fields still work normally. */
body { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }

/* ---------- Defeat dialog, campfire rest ---------- */
#death { position: fixed; inset: 0; z-index: 45; display: none; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 50%, #2a0a0888, #0a0b0ee6 75%); }
#death.open { display: grid; }
.deathbox { width: min(420px, 100%); }
.deathbox .winbar { background: var(--noise), linear-gradient(180deg, #7a1f17, #3d100c 70%, #260a08); border-bottom-color: #c7402f; }
.deathbox .inner { display: grid; gap: 10px; padding: 20px 22px 20px; text-align: center; }
.deathbox h2 { margin: 0; font: 400 24px var(--serif); letter-spacing: .26em; text-indent: .26em; text-transform: uppercase; color: #fff; }
.deathbox p { margin: 0; color: var(--parch); }
.deathbox .btn.primary { margin: 8px 4px 2px; }
.deathbox small { color: var(--muted); font-size: 12.5px; }
.deathbox small b { color: var(--parch); }
.where.rest { margin-top: 8px; width: 100%; }

/* ---------- Skill tooltip (same card as items) ---------- */
#skilltip { position: fixed; z-index: 70; display: none; pointer-events: none; width: 340px; max-width: calc(100vw - 16px); }
#skilltip.open { display: block; }
#skilltip .tipcard { position: static; width: auto; max-width: none; flex-direction: column; left: auto !important; top: auto !important; right: auto; bottom: auto; max-height: none; }
.tipstatus { padding: 8px 12px; font-size: 14px; color: #fff; border-bottom: 1px solid #3a3e47; }
.tipstatus .bad { color: #ff7b6b; }
.tipbody .bonuses { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tipbody p.bonus { color: #5fb8ff; }
.tipbody .gs span { font-size: 13px; line-height: 1.15; }

/* ---------- The left-hand status block is retired: the world carries its own buttons and nameplate ---------- */
#hud { display: none !important; }
@media (max-width: 900px) { .mapstage { padding-top: 16px; } .mapctl { top: 16px; } }

/* ---------- Quest marks: large, glowing, bobbing (the motion comes from --bob / --pulse, set every frame) ---------- */
.npcplate b { font-size: 46px; line-height: 1; margin-bottom: 4px; animation: none; transform: translateY(var(--bob, 0)) scale(var(--pulse, 1)); transform-origin: 50% 80%;
  color: #ffd95a; text-shadow: 0 0 6px #fff3b0, 0 0 18px #f3c969, 0 0 34px #e8962bcc, 0 3px 0 #3a2a00, 0 0 3px #000; }
.npcplate.ready b { color: #9fe4ff; text-shadow: 0 0 6px #e6f8ff, 0 0 18px #3fa9ff, 0 0 34px #1f6fe0cc, 0 3px 0 #06243f, 0 0 3px #000; }
.ebar.quest::before { font-size: 28px; animation: none; transform: translateX(-50%) translateY(var(--bob, 0)) scale(var(--pulse, 1)); transform-origin: 50% 80%; color: #ffd95a; text-shadow: 0 0 6px #fff3b0, 0 0 16px #f3c969, 0 2px 0 #3a2a00, 0 0 3px #000; }
.pin .pq { font-size: 34px; animation: none; transform: translateY(var(--bob, 0)) scale(var(--pulse, 1)); transform-origin: 50% 80%; color: #ffd95a; text-shadow: 0 0 6px #fff3b0, 0 0 16px #f3c969, 0 2px 0 #3a2a00, 0 0 3px #000; }
.pin .pq.ready { color: #9fe4ff; text-shadow: 0 0 6px #e6f8ff, 0 0 16px #3fa9ff, 0 2px 0 #06243f, 0 0 3px #000; }

/* ---------- Training Hall: skills and talents ---------- */
.subtabs { display: flex; margin: 0 0 14px; border-bottom: 1px solid #3f79c6; }
.subtabs button { flex: 1; height: 40px; font: 500 12.5px var(--serif); letter-spacing: .22em; text-transform: uppercase; color: #a9a495; border: 1px solid transparent; border-bottom: 0; }
.subtabs button.on { color: #fff; background: var(--noise), linear-gradient(180deg, #17407e, #0d2447); border-color: #3f79c6; }
.subtabs button i { display: inline-block; min-width: 18px; margin-left: 8px; padding: 0 5px; font: 700 11px/18px var(--sans); letter-spacing: 0; font-style: normal; color: #111; background: var(--gold-hi); border-radius: 9px; }
.loadout { display: flex; gap: 14px; justify-content: center; padding: 6px 0 18px; }
.lslot { display: grid; justify-items: center; gap: 14px; width: 92px; }
.lslot small { font-size: 11.5px; color: #c9c4b6; text-align: center; line-height: 1.2; }
.skrow .slot { width: 48px; height: 48px; flex: none; }
.skrow:not(.known) .slot { opacity: .6; }
.skrow .d { color: #c9c4b6; }
.skrow em.no { font-style: normal; font-size: 12.5px; color: #ff7b6b; white-space: nowrap; }
.slotbtns { display: flex; gap: 4px; }
.slotbtns button { width: 30px; height: 34px; font: 700 13px var(--sans); color: #a9a495; background: #15181e; border: 1px solid #3a3e47; }
.slotbtns button:hover { border-color: var(--gold-hi); color: #fff; }
.slotbtns button.on { color: #111; background: var(--gold-hi); border-color: #000; }
.slotbtns button:disabled { opacity: .45; }
.tree { display: grid; gap: 4px; margin-bottom: 4px; }
.tnode { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 7px 8px 7px 8px; background: var(--noise), #0a0b0ecc; border: 1px solid var(--line); border-left: 3px solid #3a3e47; }
.tnode.has { border-left-color: var(--gold); }
.tnode.max { border-left-color: var(--gold-hi); background: var(--noise), #1c170ccc; }
.tnode.locked { opacity: .55; }
.tnode .trank { font: 500 13px var(--serif); color: var(--muted); text-align: center; }
.tnode .trank b { font-size: 19px; color: #fff; }
.tnode.has .trank b { color: var(--gold-hi); }
.tnode .t { font-size: 14px; font-weight: 600; color: #fff; }
.tnode .t em { font-style: normal; font-weight: 500; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-hi); margin-left: 8px; }
.tnode .d { font-size: 12.5px; color: #c9c4b6; line-height: 1.3; }
.tnode .d.no { color: #f0a85a; }
.tnode .nxt { color: #7fd8a0; }
.tnode .plus { width: 34px; height: 34px; display: grid; place-items: center; font: 600 20px/1 var(--sans); color: #fff; background: var(--noise), linear-gradient(#7a5a1c, #b58628 55%, #8a651e); border: 1px solid var(--gold-hi); }
.tnode .plus:disabled { background: #1d2026; border-color: #3a3e47; color: #55575c; }
.note b.ptsb { color: var(--gold-hi); }
.hslot.active { border-color: #7fd8ff; box-shadow: inset 0 0 0 2px #0a0b0e, inset 0 0 0 3px #7fd8ff88, 0 0 16px #3fa9ffaa; }
.floater.heal { color: #6fe39a; font-size: 16px; }
@media (max-width: 900px) { .tnode .plus { width: 44px; height: 44px; } .slotbtns button { width: 38px; height: 40px; } }

/* =====================================================================
   Phones. Touch behaviour first, then the portrait fixes, then a phone
   held sideways (which gets the wide layout back, scaled down).
   ===================================================================== */
html, body { overscroll-behavior: none; touch-action: manipulation; }
#scene { touch-action: none; }
.pbody, #screen, .cs-left { touch-action: pan-y; -webkit-overflow-scrolling: touch; }
@supports (height: 100dvh) {
  .mapwrap { width: min(100vw, calc(100dvh - var(--bar-h) - var(--tab-h) - 7px)); }
}

/* The Town button: phones only (the square does not fit on a narrow screen). */
#townbtn { display: none; }
.townrow { width: 100%; text-align: left; padding: 10px 6px; min-height: 58px; }
.townrow .qmark { font-size: 19px; }
.townrow .go { flex: none; padding: 6px 14px; font: 600 12px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: #fff; border: 1px solid var(--gold-hi); background: var(--noise), linear-gradient(#7a5a1c, #b58628 55%, #8a651e); }

@media (max-width: 900px) {
  #townbtn { position: fixed; left: 10px; top: calc(var(--bar-h) + 10px); z-index: 11; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 12px; font: 600 12.5px var(--serif); letter-spacing: .16em; text-transform: uppercase; color: #fff; background: var(--noise), #0b0c0fe6; border: 1px solid var(--gold-lo); }
  #townbtn b { font: 700 22px/1 var(--serif); color: #ffd95a; text-shadow: 0 0 10px #f3c969; }
  #townbtn b.ready { color: #9fe4ff; text-shadow: 0 0 10px #3fa9ff; }
  /* Panel header: keep the title and its note on one line. */
  .phead { gap: 8px; align-items: center; }
  .phead h2 { font-size: 15px; letter-spacing: .2em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .phead .meta { font-size: 12.5px; white-space: nowrap; flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
  .x { width: 34px; height: 34px; margin: 0 6px; }
  /* The level badge would sit on top of an open sheet. */
  #panel.open ~ #xpbar .diamond { display: none; }
  #panel { height: min(58vh, 560px); }
  @supports (height: 100dvh) { #panel { height: min(58dvh, 560px); } }
  .mapstage { place-items: center; padding-top: 0; }
  .mapctl { top: 12px; }
  .pin .pl { font-size: 10.5px; }
  .cols { gap: 0 14px; }
  .loadout { gap: 8px; }
  .lslot { width: 84px; }
  .row .acts { flex-wrap: wrap; justify-content: flex-end; }
  .skrow { flex-wrap: wrap; }
  .skrow .info { flex: 1 1 60%; }
  .skrow .acts { flex: 1 1 100%; justify-content: flex-start; padding-left: 60px; }
  .cs-traits button { min-height: 52px; }
  .deathbox h2 { font-size: 20px; }
  .npcplate span { font-size: 10px; padding: 2px 7px; }
  .npcplate.st small { font-size: 10px; }
  .nameplate span { font-size: 11.5px; }
  #skilltip { width: min(340px, calc(100vw - 16px)); }
}
@media (max-width: 380px) {
  #tabbar .tab { font-size: 8px; }
  .hslot { width: 48px; height: 48px; }
  .attr { grid-template-columns: 34px 28px 1fr auto; gap: 8px; }
}

/* A phone on its side: short and wide. Use the top tabs and a side panel, as on a desktop, but smaller. */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 560px) {
  :root { --bar-h: 40px; --tab-h: 0px; }
  #tabbar { display: none !important; }
  .tabs { display: flex; }
  .tab { width: clamp(78px, 13vw, 110px); font-size: 10px; letter-spacing: .1em; display: block; }
  .tab .ic, .tab kbd { display: none; }
  .tab.on::after { top: auto; bottom: -1px; }
  .brand { flex: 0 1 auto; max-width: 22vw; }
  .res { flex: 1; }
  #panel { left: auto; right: 6px; top: calc(var(--bar-h) + 6px); bottom: 12px; width: min(400px, 52vw); height: auto; border: 1px solid #323743; }
  @keyframes panelIn { from { opacity: 0; transform: translateX(14px); } }
  .pside { order: 1; }
  #hotbar { bottom: 14px; }
  .hslot { width: 46px; height: 46px; }
  #toasts { top: calc(var(--bar-h) + 8px); bottom: auto; }
  #feed { bottom: 20px; }
  #placecard { left: 8px; right: auto; bottom: 14px; width: 290px; }
  .placecard .inner { grid-template-columns: 1fr; }
  .mapctl { top: auto; bottom: 14px; right: 8px; }
  #townbtn { top: calc(var(--bar-h) + 6px); min-height: 38px; }
  #panel.open ~ #xpbar .diamond { display: grid; }
  .stage { padding: 12px; }
  .login h1 { font-size: 24px; }
  .stage .lede { margin: 6px 0 10px; font-size: 13.5px; }
  .charsel { inset: var(--bar-h) 0 0 0; }
  .cs-left { position: absolute; left: 10px; top: 8px; bottom: 8px; width: 300px; margin: 0; max-height: none; }
  .cs-play { left: auto; right: 12px; bottom: 12px; }
  .cs-play .btn.primary.big { flex: none; min-width: 180px; min-height: 50px; }
  .cs-play .btn.ghost { min-height: 58px; }
  #screen.clear { background: linear-gradient(90deg, #0a0b0ecc 0, #0a0b0e55 40%, transparent 65%); }
  .tipcard { flex-direction: row; left: 8px !important; right: auto; top: calc(var(--bar-h) + 8px) !important; bottom: auto; width: min(520px, calc(100vw - 16px)); max-height: calc(100vh - var(--bar-h) - 20px); }
  .tipacts { border-left: 1px solid #3a3e47; border-top: 0; flex-direction: column; }
  #skilltip .tipcard { flex-direction: column; }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 560px) {
  #panel.open ~ #hotbar { left: 24%; } /* keep the hotbar clear of the side panel */
}

/* ---------- Map as a bitmap: moving it is now just sliding a picture ---------- */
img.mapart { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.maproads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mapwrap { will-change: transform; }
#map::before { display: none; } /* the blended grain layer was repainted on every move */

#hotbar.off { visibility: hidden; pointer-events: none; } /* still measured, so the vitals can take its place */
[data-tip] { cursor: var(--cur-mouseon), help; }
button[data-tip] { cursor: var(--cur-mouseon), pointer; }

/* ---------- Character creation on a phone: model on top, a compact sheet underneath ---------- */
@media (max-width: 900px) and (orientation: portrait), (max-width: 900px) and (min-height: 561px) {
  .charsel.create .cs-left { position: absolute; left: 8px; right: 8px; top: auto; bottom: 84px; width: auto; margin: 0; max-height: 46vh; overflow-y: auto; }
  .charsel.create h1 { display: none; }
  .charsel.create .win { padding: 4px 4px 10px; }
  .charsel.create .cs-sec { margin: 8px 8px 6px; padding-bottom: 3px; font-size: 10.5px; }
  .charsel.create .cs-list { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .charsel.create .cs-row { min-height: 46px; padding: 4px 6px; gap: 6px; justify-content: center; border-left-width: 1px; }
  .charsel.create .cs-row.on { border-left-width: 1px; }
  .charsel.create .cs-row .cl, .charsel.create .cs-stats { display: none; }
  .charsel.create .cs-row .swatch { width: 10px; height: 24px; margin: 0; }
  .charsel.create .cs-row .nm { font-size: 14px; }
  .charsel.create .cs-traits, .charsel.create .cs-classes { gap: 5px; }
  .charsel.create .cs-traits button, .charsel.create .cs-classes button { min-height: 44px; padding: 4px 8px; }
  .charsel.create .cs-traits button b { font-size: 13px; }
  .charsel.create .cs-traits button small { font-size: 11px; }
  .charsel.create .cs-name .field { height: 44px; }
  .charsel.create .cs-name .btn { min-height: 44px; }
  #screen.clear:has(.charsel.create) { background: linear-gradient(0deg, #0a0b0ecc 0, #0a0b0e55 50%, transparent 72%); overflow: hidden; }
}

/* ---------- Quests tab badge: a quest is finished and waiting to be handed in ---------- */
.tab.qready { color: #cfefff; }
.tab.qready::before { content: attr(data-ready); position: absolute; right: 10px; top: 6px; z-index: 2; min-width: 20px; height: 20px; padding: 0 4px; display: grid; place-items: center;
  font: 700 14px/1 var(--serif); letter-spacing: 0; color: #06243f; background: #9fe4ff; border: 1px solid #06243f; border-radius: 10px;
  box-shadow: 0 0 10px 2px #3fa9ffcc; transform: scale(var(--pulse, 1)); }
@media (max-width: 900px) { #tabbar .tab.qready::before { right: 18%; top: 4px; } }

/* The map picture never spills outside its square now, so the moving layer stays a sensible size on phones. */
.mapart { overflow: hidden; }

#errbar { position: fixed; left: 8px; right: 8px; top: 8px; z-index: 99; padding: 10px 12px; font: 500 13px/1.35 var(--sans); color: #fff; background: #7d2217f2; border: 1px solid #e0503c; -webkit-user-select: text; user-select: text; }

/* Quests tab: the same small gold diamond as the Character tab uses, in place of the blue badge. */
.tab.qready { color: inherit; }
.tab.qready.on { color: #fff; }
.tab.qready::before { content: ''; position: absolute; right: 12px; top: 12px; z-index: auto; min-width: 0; width: 8px; height: 8px; padding: 0; display: block;
  background: var(--gold-hi); border: 0; border-radius: 0; box-shadow: 0 0 8px #f3c969; transform: rotate(45deg); }
@media (max-width: 900px) { #tabbar .tab.qready::before { right: 22%; top: 8px; } }

/* ---------- Carry weight, Trader, Bank ---------- */
.wbar { margin: 0 0 14px; padding: 9px 12px 10px; background: var(--noise), #0a0b0ecc; border: 1px solid var(--line); }
.wbar .wtop { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wbar .wtop b { font: 600 16px var(--serif); letter-spacing: 0; color: #fff; text-transform: none; }
.wbar .wtop small { font-size: 12.5px; color: #a9a495; }
.wbar p { margin: 8px 0 0; font-size: 12.5px; color: #ff9a86; }
.wbar.near .meter i { background: linear-gradient(#ffb04a, #c7821b); }
.wbar.full { border-color: #c7402f; }
.wbar.full .meter i { background: linear-gradient(#e3564a, #a52a22); }
.wbar.full .wtop b { color: #ff9a86; }
.itrow .slot { width: 48px; height: 48px; flex: none; }
.itrow .acts { gap: 5px; }
.note.keep { margin: -4px 0 6px 60px; font-size: 12px; color: var(--gold-hi); }
.tab.full { color: #ff9a86; }
.tab.full::after { content: 'FULL'; position: absolute; left: 50%; top: 3px; transform: translateX(-50%); font: 700 8.5px/1 var(--sans); letter-spacing: .14em; color: #fff; background: #a52a22; padding: 2px 5px; bottom: auto; height: auto; box-shadow: none; right: auto; }
.tab.full.on::after { content: 'FULL'; }

/* Sharp map when zoomed: the layer is only kept "ready to move" during a drag or zoom (set from JS). */
.mapwrap { will-change: auto; }
img.mapart { image-rendering: auto; }
/* The loot rows fall back to the corner while the map is open, where they covered the place card. Hide them there. */
#map.open ~ #feed { display: none; }

/* A station that is out of view: a quieter signpost at the screen edge showing how far away it is. */
.npcplate.st.far { opacity: .78; }
.npcplate.st.far span { font-size: 9.5px; padding: 3px 8px; letter-spacing: .1em; }
.npcplate.st.far small { font-size: 10px; color: var(--gold-hi); }
.npcplate.st.far:hover { opacity: 1; }

/* Companion: its name over its head, the Tame slot on the hotbar, and a monster's ability under its bar. */
.petplate { position: absolute; left: 0; top: 0; margin: -8px 0 0 -70px; width: 140px; text-align: center; font: 600 10.5px var(--sans); letter-spacing: .04em; color: #cfe8c4; text-shadow: 0 1px 2px #000, 0 0 5px #000; pointer-events: none; white-space: nowrap; will-change: transform; }
.hslot.tame { margin-left: 10px; background: var(--noise), linear-gradient(#1f3320, #0e170f); border-color: #5f8a4a; }
.hslot.tame.active { border-color: #9fd08a; box-shadow: inset 0 0 0 2px #0a0b0e, inset 0 0 0 3px #9fd08a88, 0 0 16px #6fbf5aaa; }
.ebar small { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 3px; font: 600 10px var(--sans); letter-spacing: .04em; color: #f3e6c4; text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; }

/* The Town list is the way to find stations on every screen size now, not only on phones. */
@media (min-width: 901px) {
  #townbtn { position: fixed; left: 14px; top: calc(var(--bar-h) + 12px); z-index: 11; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px; font: 600 12.5px var(--serif); letter-spacing: .16em; text-transform: uppercase; color: #fff; background: var(--noise), #0b0c0fe6; border: 1px solid var(--gold-lo); cursor: var(--cur-mouseon), pointer; }
  #townbtn:hover { border-color: var(--gold-hi); }
  #townbtn b { font: 700 22px/1 var(--serif); color: #ffd95a; text-shadow: 0 0 10px #f3c969; }
  #townbtn b.ready { color: #9fe4ff; text-shadow: 0 0 10px #3fa9ff; }
}

/* ---------- Banners: one event, one banner; clear of an open sheet on phones ---------- */
.toast small { display: block; margin-top: 3px; font: 500 11.5px var(--sans); letter-spacing: .12em; color: var(--parch); opacity: .85; }
@media (max-width: 900px) {
  #toasts.sheet { top: 6px; bottom: auto; } /* over the title bar: the strip of world above the sheet is kept for the character */
}

/* ---------- Nine equipment slots: a 3 x 3 sheet beside the inventory ---------- */
.eqgrid { grid-template-columns: repeat(3, 1fr); gap: 8px 4px; }
.eqslot .slot.big { width: 54px; height: 54px; }
.eqslot .slot.big .ic { width: 36px; height: 36px; }
.eqslot .slot.big.empty .ic { width: 26px; height: 26px; }
.eqslot small { font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; color: #9a968a; }
@media (max-width: 900px) {
  .pside { align-items: center; overflow-x: visible; gap: 10px; }
  .eqgrid { display: grid; grid-template-columns: repeat(5, 44px); gap: 4px; flex: none; }
  .eqslot .slot.big { width: 44px; height: 44px; }
  .eqslot .slot.big .ic { width: 30px; height: 30px; }
  .eqslot .slot.big.empty .ic { width: 22px; height: 22px; }
  .pside .gs { display: none; }
  .pside .stats { flex: 1; min-width: 0; }
}
/* Arrow count on the Hunter's basic attack */
.hslot .ammo { position: absolute; right: 3px; top: 2px; font: 700 11px var(--sans); color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.hslot .ammo.low { color: #ffd95a; }
.hslot .ammo.out { color: #ff7b6b; }

/* ---------- Notifications live in the top bar ---------- */
#toasts, #toasts.sheet { top: 0; bottom: auto; left: 0; right: 0; height: var(--bar-h); flex-direction: row; align-items: stretch; gap: 0; z-index: 30; }
.toast { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 14px; overflow: hidden; animation: none; opacity: 1;
  font-size: 12px; letter-spacing: .14em; line-height: 1.2; background: var(--noise), #0a0b0e; border: 0; border-bottom: 1px solid #8a7a52; border-image: none; }
.toast.gold { border-bottom-color: var(--gold-hi); }
.toast span { max-width: 100%; text-align: center; }
.toast small { margin-top: 2px; font-size: 10.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 901px) {
  /* The tabs sit in the middle of the bar: notifications take the space to their left. */
  #toasts, #toasts.sheet { right: auto; width: calc((100vw - 5 * clamp(108px, 11.5vw, 150px)) / 2); }
  .toast { align-items: flex-start; padding: 0 12px 0 16px; background: none; border-bottom: 0; font-size: 12.5px; }
  .toast span, .toast small { text-align: left; }
}

/* ---------- Gems ---------- */
.slot .gpips { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); display: flex; gap: 3px; pointer-events: none; }
.slot .gpips i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid #000a; box-shadow: 0 0 6px currentColor; }
.slot:has(.gpips) { box-shadow: inset 0 0 12px -2px var(--glow, #fff6); }
.sockets { margin: 8px 0; padding: 8px 10px; background: #0a0b0e99; border: 1px solid var(--line-soft); }
.sockets h5 { margin: 0 0 6px; font: 500 11.5px var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--parch); display: flex; justify-content: space-between; }
.sockets h5 small { letter-spacing: 0; color: #9a968a; }
.socket { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; color: #e6e1d2; }
.socket small { display: block; color: var(--green); font-size: 12px; }
.socket.empty { color: #6d6a62; font-style: italic; }
.gembtn { display: flex; align-items: center; gap: 8px; text-align: left; text-transform: none; letter-spacing: .02em; font-family: var(--sans); font-size: 13px; }
.gembtn small { display: block; font-size: 11px; opacity: .8; margin: 0; }
.attr .num .gemplus { display: block; font: 600 10px var(--sans); color: var(--green); white-space: nowrap; }

/* ---------- Sea route and the boat on the map ---------- */
.road.sea { stroke: #f4fbff; stroke-width: 3; stroke-dasharray: 3 9; opacity: .9; }
.road.sea.route { stroke: #ffffff; stroke-width: 4.5; filter: drop-shadow(0 0 5px #9fe4ff); }
.me .boat { position: absolute; left: -17px; top: -26px; display: none; filter: drop-shadow(0 2px 3px #000a); }
.me.sea i { display: none; }
.me.sea .boat { display: block; }

/* ---------- Notice: a lasting red warning in the bar while something is stopping the character ---------- */
.toast.notice { color: #ff8a78; border-bottom-color: #d8432f; }
.toast.notice span { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.toast.notice b { flex: none; padding: 2px 7px 1px; font: 700 10.5px var(--sans); letter-spacing: .16em; color: #fff; background: #c8321f; border-radius: 2px; box-shadow: 0 0 0 0 #ff4a3a88; animation: noticePulse 1.8s ease-in-out infinite; }
.toast.notice small { color: #ffb4a6; opacity: 1; animation: noticeText 1.8s ease-in-out infinite; }
@keyframes noticePulse { 0%, 100% { box-shadow: 0 0 0 0 #ff4a3a00; background: #b52a18; } 50% { box-shadow: 0 0 10px 2px #ff4a3a99; background: #e23c26; } }
@keyframes noticeText { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@media (max-width: 900px) { .toast.notice { background: var(--noise), linear-gradient(#2a0d0a, #140707); } }
/* Asked for on purpose: this one gentle pulse keeps running even where other motion is switched off. */
@media (prefers-reduced-motion: reduce) { .toast.notice b, .toast.notice small { animation-duration: 1.8s !important; animation-iteration-count: infinite !important; } }

/* ---------- Vitals: effects over a resource bar over the health bar, centred above the hotbar ---------- */
#vitals { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); width: min(400px, calc(100vw - 110px)); z-index: 11; display: grid; gap: 4px; pointer-events: none; }
#vitals .fx { display: flex; justify-content: center; gap: 6px; min-height: 0; margin-bottom: 4px; }
#vitals .fxi { pointer-events: auto; width: 38px; padding: 4px 0 2px; display: grid; justify-items: center; gap: 1px; background: #0a0b0ee6; border: 1px solid #8a7a52; border-radius: 3px; box-shadow: 0 3px 8px #000a; }
#vitals .fxi.bad { border-color: #d8432f; background: #1c0907e6; }
#vitals .fxi small { min-height: 13px; font: 700 11px/13px var(--sans); color: #fff; }
#vitals .vbar { position: relative; overflow: hidden; background: #000000b0; border: 1px solid #000; box-shadow: 0 0 0 1px #ffffff1c, 0 3px 10px #000a; pointer-events: auto; }
#vitals .vbar i, #vitals .vbar u { position: absolute; left: 0; top: 0; bottom: 0; display: block; width: 0; text-decoration: none; }
#vitals .vbar > span { position: relative; display: block; text-align: center; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#vitals .rsc { height: 15px; }
#vitals .rsc i { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c) 45%, color-mix(in srgb, var(--c) 70%, #000)); }
#vitals .rsc > span { font: 600 11px/13px var(--sans); color: #fff; opacity: .92; }
#vitals .hp { height: 28px; }
#vitals .hp i { background: linear-gradient(180deg, #e0382c, #b3171a 50%, #7e0d12); box-shadow: inset 0 1px 0 #ff8a7a66; }
#vitals .hp u { background: #ffd9c9; opacity: .75; }
#vitals .hp em { position: absolute; left: 12px; top: 0; font: 700 20px/26px var(--sans); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
#vitals .hp > span { font: 500 15px/26px var(--sans); color: #ffd6d0; }
#vitals .hp b { font-weight: 700; color: #fff; }
#vitals.low .hp { box-shadow: 0 0 0 1px #ff5a4a, 0 0 14px 2px #ff3a2a99; }
@media (max-width: 900px) {
  #vitals { width: min(300px, calc(100vw - 96px)); gap: 3px; }
  #vitals .hp { height: 22px; } #vitals .hp > span { font-size: 13px; line-height: 20px; } #vitals .hp em { font-size: 17px; line-height: 20px; left: 8px; }
  #vitals .rsc { height: 12px; } #vitals .rsc > span { font-size: 10px; line-height: 10px; }
  #vitals .fxi { width: 34px; }
}

/* ---------- Experience bar: twenty separate segments, grey warming to gold; put away with the map open ---------- */
#map.open ~ #xpbar { display: none !important; }
#xpbar { height: 6px; background: #000000cc; background-image: none; border-top: 0; }
#xpbar i { mix-blend-mode: normal; background: linear-gradient(90deg, #8e908d, #a8a195 35%, #c9a56a 70%, #f3c969) 0 0 / 100vw 100% no-repeat; }
#xpbar::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(5% - 3px), #000 calc(5% - 3px), #000 5%); }
#xpbar .diamond { z-index: 1; }

#vitals .fxi { cursor: var(--cur-mouseon), help; }
#vitals .fxi:hover { border-color: var(--gold-hi); }

.tipbody .gs b #fxtip-t { font: inherit; line-height: inherit; letter-spacing: inherit; text-transform: none; color: inherit; }

/* The skinning switch on the hotbar */
.hslot.toggle.offed { background: var(--noise), linear-gradient(#22252b, #121418); border-color: #4a4f5a; }
.hslot.toggle .auto { pointer-events: none; }

/* The facts strip in the map card must stay inside the card */
.placecard .inner { min-width: 0; }
.placecard .inner > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.placecard .pfacts { flex-wrap: wrap; }
.placecard .inner { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .placecard .inner { grid-template-columns: minmax(0, 1fr) auto; } }

/* The dungeon boss's bar */
.ebar.boss small { color: #ff8a6a; font-weight: 700; letter-spacing: .08em; }
.ebar.boss b { width: 96px; }
.ebar.boss { width: 110px; left: -55px; }
.ebar.boss b { width: auto; height: 7px; }

/* Trades: the level line at a station, the forge's four tabs, the grid on the character sheet */
.row.trow { background: #0d0f13cc; border: 1px solid var(--gold-lo); margin-bottom: 8px; }
.row.trow .t em { color: var(--gold-hi); font-style: normal; }
.row.trow .meter { margin: 5px 0 4px; }
.row.locked { opacity: .62; }
.row .d.lockd { color: #e0a07a; display: flex; align-items: center; gap: 5px; }
.subtabs.four { flex-wrap: wrap; }
.subtabs.four button { flex: 1 1 45%; min-width: 0; font-size: 13px; }
.subtabs button i.lv { font-style: normal; margin-left: 6px; padding: 0 6px; border-radius: 9px; background: #0006; color: var(--gold-hi); font-size: 11px; }
.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tcell { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 2px 7px; padding: 7px 9px; background: #0d0f13cc; border: 1px solid #2c2a25; font-size: 13px; }
.tcell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d9d3c2; }
.tcell b { color: var(--gold-hi); }
.tcell .meter { grid-column: 1 / -1; }
.tcell.none { opacity: .55; }
.subtabs.four button { letter-spacing: .06em; height: 36px; }

/* The Fishing / Salvaging switch, out at sea */
#seamode { position: fixed; left: 50%; top: 78px; transform: translateX(-50%); width: min(340px, calc(100vw - 24px)); z-index: 30; display: none; }
#seamode.open { display: flex; }
#seamode button span { font: 500 13px var(--serif); letter-spacing: .14em; text-transform: uppercase; }
#seamode button.cant:not(.on) { opacity: .6; }

/* Durability: a thin bar on the slot, amber when low, the whole slot greyed when broken */
.slot .dur { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; background: #000a; pointer-events: none; }
.slot .dur i { display: block; height: 100%; background: #7fd07a; }
.slot.worn .dur i { background: #e0a030; }
.slot.broken { filter: grayscale(1) brightness(.6); box-shadow: inset 0 0 0 2px #c9483a; }
.slot.broken .dur i { background: #c9483a; }
.durline { color: #a9a495; }
.durline.low { color: #e0a030; }
.durline.broken { color: #e86a5a; }

/* Dialogue: one line from them, then a short list of what you can do */
.opts { display: grid; gap: 6px; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; text-align: left; background: #0d0f13cc; border: 1px solid #2c2a25; color: #e9e3d2; font-size: 14.5px; }
.opt:hover:not(:disabled) { border-color: var(--gold); background: #171a20; }
.opt:disabled { opacity: .5; }
.opt i { font: 600 11px var(--serif); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: #8fb8e8; min-width: 54px; }
.opt.q i { color: var(--gold-hi); }
.opt span { flex: 1; min-width: 0; }
.opt em { font-style: normal; font-weight: 700; color: var(--gold-hi); }
.opt.ready em { color: #7fd8ff; }
.opt.dim { opacity: .6; }
.opt.leave i { color: #a9a495; }
.backbtn { margin-bottom: 12px; }
/* Reward squares */
.qrew { gap: 6px; }
.rsq { position: relative; width: 42px; height: 42px; display: inline-grid !important; place-items: center; background: linear-gradient(#20242c, #111318); border: 1px solid var(--gold-lo); cursor: var(--cur-mouseon), pointer; }
.rsq:hover { border-color: var(--gold-hi); }
.rsq b { position: absolute; right: 3px; bottom: 0; font: 600 12px var(--serif); color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.xpi { font: 700 13px var(--serif); font-style: normal; color: #7fd8ff; letter-spacing: .04em; }
.xpi.big { font-size: 22px; }
.rsq .xpi { transform: translateY(-5px); font-size: 11px; }
/* Shop squares */
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, 62px); gap: 8px; margin-bottom: 12px; }
.slot.sq { width: 62px; height: 62px; padding-bottom: 12px; cursor: var(--cur-mouseon), pointer; }
.slot.sq:disabled { opacity: .5; cursor: var(--cur-normal), default; }
.slot.sq.sel { border-color: var(--gold-hi); box-shadow: 0 0 0 1px var(--gold-hi), 0 0 10px #f3c96966; }
.slot.sq .price { position: absolute; left: 0; right: 0; bottom: 1px; text-align: center; font: 600 11px var(--sans); color: #f3c969; }
.slot.sq.poor .price { color: #e86a5a; }
.slot.sq .up { position: absolute; right: 3px; top: 1px; font-size: 13px; line-height: 1; color: #5fe08a; text-shadow: 0 0 4px #000; }
.slot.sq .dur { bottom: 15px; }
.pick { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #0a0b0ef2; border: 1px solid var(--gold-lo); }
.pick.none { color: #8d897c; font-size: 13px; justify-content: center; }

/* Quests button: the same '?' the quest giver wears, when something is ready to hand in */
.tab.qready::before { content: '?'; right: 14px; top: 4px; width: auto; height: auto; background: none; box-shadow: none; font: 700 19px/1 var(--serif); color: var(--gold-hi); text-shadow: 0 0 8px #f3c969, 0 1px 2px #000; transform: scale(var(--pulse, 1)); }
@media (max-width: 900px) { #tabbar .tab.qready::before { right: 20%; top: 2px; } }
/* Inventory: a green arrow on anything better than what you wear (or that fills an empty slot), and on the Inventory button while there is one */
.slot .up { position: absolute; right: 3px; top: 1px; font-size: 13px; line-height: 1; color: #5fe08a; text-shadow: 0 0 4px #000, 0 0 6px #1d6a3a; pointer-events: none; }
.tab.upg::before { content: '▲'; position: absolute; right: 14px; top: 6px; font-size: 13px; line-height: 1; color: #5fe08a; text-shadow: 0 0 6px #2fa860, 0 1px 2px #000; }
@media (max-width: 900px) { #tabbar .tab.upg::before { right: 22%; top: 4px; } }

/* Anything that is an item can be tapped for its card */
[data-tip], [data-hov] { cursor: var(--cur-mouseon), pointer; }
.ing { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; white-space: nowrap; }
.ing svg, .ing img { flex: none; }

/* A quest whose task is done: the task struck through, and the step that is left */
.qgoal.done span { color: #8d897c; text-decoration: line-through; }
.qgoal.done b { color: #5fe08a; }
.qgoal.next span { color: var(--gold-hi); font-weight: 600; }
.pirate-catalog { width: min(580px, 96vw); max-height: 90dvh; padding: 0; border: 1px solid var(--gold); background: #14161b; color: var(--parch); }
.pirate-catalog[open] { display: flex; flex-direction: column; }
.pirate-catalog::backdrop { background: #090a0cc9; }
.catalog-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px; }
.catalog-tools input,.catalog-tools select { min-width: 0; background: #24262c; color: var(--parch); border: 1px solid var(--line); padding: 7px; }
.catalog-list { overflow: auto; padding: 0 12px; }
.catalog-list .ic { object-fit: contain; }

/* ---------- Sound control (js/audio.js): a speaker at the right end of the top bar, with a small mixer ---------- */
#topbar { padding-right: 52px; }
/* frames a second and latency (js/ui.js #topstats): just left of the sound button; each dot's colour says how it feels */
#topstats { position: fixed; top: 0; right: 52px; height: var(--bar-h); z-index: 60; display: flex; align-items: stretch; }
#fps, #ping { display: flex; align-items: center; gap: 5px; padding: 0 10px; border-left: 1px solid var(--line); font: 600 13px var(--sans); color: var(--parch); pointer-events: auto; cursor: default; white-space: nowrap; }
#fps b { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; } /* the number does not jostle as it changes */
#ping[hidden] { display: none; }
#fps i, #ping i { width: 8px; height: 8px; border-radius: 50%; background: #6fd05a; box-shadow: 0 0 6px currentColor; color: #6fd05a; }
#fps small, #ping small { font-weight: 500; font-size: 11px; color: var(--muted); }
#fps.ok i, #ping.ok i { background: #e8c547; color: #e8c547; } #fps.slow i, #ping.slow i { background: #f08a3c; color: #f08a3c; } #fps.bad i, #ping.bad i { background: #e2463a; color: #e2463a; }
#fps.bad b, #ping.bad b { color: #ff8a7b; }
#topbar { padding-right: 140px; } /* room for the sound button and frames a second */
body:has(#ping:not([hidden])) #topbar { padding-right: 215px; } /* and the latency */
#sound { position: fixed; top: 0; right: 0; height: var(--bar-h); width: 52px; z-index: 60; display: flex; align-items: center; justify-content: center; }
#sound .sndbtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-2); color: var(--gold-hi); cursor: var(--cur-mouseon), pointer; padding: 0; }
#sound .sndbtn:hover { border-color: var(--gold-lo); }
#sound .sndbtn.off { color: var(--muted); }
#sound .sndpop { display: none; position: absolute; top: calc(var(--bar-h) + 6px); right: 8px; width: 260px; max-width: calc(100vw - 16px); padding: 12px 14px 14px; background: var(--noise), linear-gradient(#11141af7, #0b0d11f7); border: 1px solid #323743; box-shadow: 0 18px 50px #000c, inset 0 0 0 1px var(--line-soft); }
#sound.open .sndpop { display: block; }
#sound .sndhead { display: flex; align-items: center; justify-content: space-between; font: 600 14px var(--serif); color: var(--parch); letter-spacing: .04em; margin-bottom: 8px; }
#sound .sndmute { font: 600 12px var(--sans); color: var(--text); background: var(--ink-3); border: 1px solid var(--line); padding: 4px 10px; cursor: var(--cur-mouseon), pointer; }
#sound label { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 6px 0; }
#sound input[type=range] { width: 100%; accent-color: var(--gold); }
#sound select { width: 100%; background: var(--ink-3); color: var(--text); border: 1px solid var(--line); padding: 4px 6px; font: 13px var(--sans); }

/* Loot on the ground: its name, on hover or while Shift is held (js/view.js). */
.droplabel { position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; padding: 2px 7px; font: 600 12px/16px var(--sans); color: #f1ead8; background: #0a0b0ec8; border: 1px solid #00000080; border-radius: 3px; text-shadow: 0 1px 2px #000; }
.droplabel.gold { color: #ffd76a; }

/* ---------- Minimap: top right, area name over it, TOP coordinates under it (js/minimap.js) ---------- */
#minimap { position: fixed; right: 16px; top: calc(var(--bar-h) + 14px); z-index: 11; width: 186px; padding: 4px; background: var(--noise), #0b0c0fe8; border: 1px solid var(--gold-lo); box-shadow: 0 10px 30px #000a, inset 0 0 0 3px #0a0b0e, inset 0 0 0 4px var(--line-soft); }
#minimap.mm-off, #mmshow.mm-off, #map.open ~ #minimap, #panel.open ~ #minimap, #map.open ~ #mmshow, #panel.open ~ #mmshow { display: none !important; }
#minimap .mm-name { padding: 3px 6px 5px; font: 600 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-hi); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#minimap .mm-view { position: relative; }
#minimap canvas { display: block; width: 176px; height: 176px; border: 1px solid #000; outline: 1px solid var(--gold-lo); cursor: var(--cur-mouseon), pointer; }
#minimap .mm-xy { padding: 5px 0 2px; font: 600 12.5px var(--sans); letter-spacing: .08em; color: var(--parch); text-align: center; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
#minimap .mm-zoom { position: absolute; right: 4px; bottom: 4px; display: flex; flex-direction: column; gap: 3px; }
#minimap .mm-zoom button, #minimap .mm-fold { width: 22px; height: 22px; display: grid; place-items: center; font: 700 14px/1 var(--sans); color: var(--parch); background: #0b0c0fd9; border: 1px solid var(--gold-lo); }
#minimap .mm-fold { position: absolute; right: 4px; top: 4px; display: none; }
#mmshow { display: none; }
@media (max-width: 900px) {
  #minimap { right: 8px; top: calc(var(--bar-h) + 8px); width: 138px; padding: 3px; }
  #minimap canvas { width: 130px; height: 130px; }
  #minimap .mm-name { font-size: 10px; letter-spacing: .1em; padding: 2px 4px 4px; }
  #minimap .mm-xy { font-size: 11.5px; }
  #minimap .mm-zoom button, #minimap .mm-fold { width: 28px; height: 28px; }
  #minimap .mm-fold { display: grid; }
  #minimap.folded { display: none; }
  #mmshow.on { position: fixed; right: 8px; top: calc(var(--bar-h) + 8px); z-index: 11; width: 46px; height: 46px; display: grid; place-items: center; background: var(--noise), #0b0c0fe8; border: 1px solid var(--gold-lo); box-shadow: 0 6px 18px #000a; }
}

/* Argent's original NPCs (js/ui.js pTopNpc): TOP's dialogue, mission pages and the quest log. */
.npcsay.top { font-style: normal; line-height: 1.5; }
.mname { margin: 6px 0 4px; font: 600 15px/1.3 var(--serif, serif); color: #f1ead8; }
.mdesp { margin: 4px 0; color: #d8d0bb; line-height: 1.45; }
.mneed { display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; margin: 3px 0; background: #ffffff0d; border-radius: 3px; }
.mneed.done b { color: var(--green, #7fd07a); }
.mprizes { display: flex; flex-wrap: wrap; gap: 6px; }
.mprize { padding: 5px 9px; background: #ffffff0f; border: 1px solid #ffffff22; border-radius: 3px; color: #f1ead8; }
.mprize.pick { cursor: pointer; } .mprize.sel { border-color: #f3c969; background: #f3c96922; }
.qcard.top { padding: 8px 10px; margin: 6px 0; background: #ffffff08; border: 1px solid #ffffff18; border-radius: 4px; }
.qcard.top .t { font-weight: 600; margin-bottom: 4px; } .qcard.top .d { color: #cfc7b0; margin: 3px 0; line-height: 1.4; }

/* Trading with an NPC: your pack beside their goods, drag between them (js/ui.js pTopNpc shop). */
.pside .shopgrid.pack { grid-template-columns: repeat(3, 52px); gap: 6px; max-height: 52vh; overflow-x: hidden; overflow-y: auto; min-height: 60px; }
.pside .shopgrid.pack .slot { width: 52px; height: 52px; }
.shopgrid[data-drop] { border-radius: 4px; transition: box-shadow .12s, background .12s; }
.shopgrid[data-drop].over { box-shadow: 0 0 0 2px #f3c969 inset; background: #f3c96914; }
.slot .cnt { position: absolute; right: 3px; bottom: 1px; font: 700 11px/13px var(--sans); color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.slot.nosell { opacity: .45; }
.slot.dragging { opacity: .35; }
.pside .dragnote { margin: 8px 0 0; font-size: 11.5px; color: #a8a090; }

/* Selling part of a stack (js/ui.js): how many, the whole stack by default. */
.pfoot .sellask { display: block; flex: 1; width: 100%; font: 500 14px/1.35 var(--sans); }
.pfoot .sellask .t, .pfoot .sellask .d { display: block; }
.pfoot .sellask .btnrow { display: flex; gap: 8px; }
.pfoot .sellask .btnrow .btn { flex: 1; }
.sellask .t { font-weight: 600; margin-bottom: 6px; color: #f1ead8; }
.sellask .row2 { display: flex; gap: 6px; align-items: center; }
.pfoot .sellask input { flex: 1; min-width: 0; font: 600 17px/1 var(--sans); color: #fff; text-align: center; padding: 7px 8px; }
.sellask .d { margin: 5px 0 8px; font-size: 12px; color: #a8a090; }
.invtools { gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.btn.gm { border-color: #c8763a; color: #ffb36b; }
/* The world map's picture is TOP's own art now (js/map.js M.bitmap): the old drawn overlay (roads, trails, hamlets, ridges,
   compass) is hidden. visibility, not display, so a boat trip can still measure its way along the road paths (M.memberPos). */
.maproads { visibility: hidden; }
#scene.atk-hover { cursor: var(--cur-attack), crosshair; } /* over a monster: TOP's attack cursor (js/ui.js) */
/* A shop: the NPC's goods in the panel on the left, your pack to its right (js/ui.js p.sideRight), and the whole panel /
   the whole pack column take a drop (sell / buy). */
@media (min-width: 901px) {
  #panel.sideright { right: calc(16px + 318px + 14px); }
  .pside.right { right: auto; left: calc(100% + 14px); width: 318px; } /* a shop: your pack five squares wide */
  .pside.right .shopgrid.pack { grid-template-columns: repeat(5, 52px); max-height: 66vh; }
}
/* The pack's scrollbar: a thin dark-gold line, barely there until the pointer is over it (no browser-grey bar). */
.pside .shopgrid.pack, .mqlist { scrollbar-width: thin; scrollbar-color: #4a3f26 transparent; }
.pside .shopgrid.pack:hover, .mqlist:hover { scrollbar-color: var(--gold) transparent; }
.pside .shopgrid.pack::-webkit-scrollbar, .mqlist::-webkit-scrollbar { width: 5px; }
.pside .shopgrid.pack::-webkit-scrollbar-track, .mqlist::-webkit-scrollbar-track { background: transparent; }
.pside .shopgrid.pack::-webkit-scrollbar-thumb, .mqlist::-webkit-scrollbar-thumb { background: #4a3f26; border-radius: 3px; }
.pside .shopgrid.pack:hover::-webkit-scrollbar-thumb, .mqlist:hover::-webkit-scrollbar-thumb { background: var(--gold); }
#panel[data-drop].over { box-shadow: 0 24px 70px #000c, inset 0 0 0 2px #f3c969, inset 0 0 0 4px #0a0b0e; }
#panel[data-drop].over .pbody { background: #f3c9690c; }
.pside[data-drop].over { box-shadow: 0 18px 50px #000b, inset 0 0 0 2px #f3c969; background: var(--noise), linear-gradient(#1d1a12f2, #0b0d11e6); }
@media (max-width: 900px) { #panel.sideright .pside { order: 3; } } /* phones: the pack goes under the goods */
/* ---------- World map: quest marks (js/ui.js renderQuestMarks) and the walk-to flag ---------- */
.qpins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* NPC icons on the M map (TOP's minimap marks): a click walks you to them; the name shows on hover */
.npcpins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* your party on the M map: a green dot with the name over it, the same size at any zoom */
.ppins { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ppin { position: absolute; width: 0; height: 0; transform: scale(var(--inv)); }
.ppin i { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #3df06a; border: 2px solid #000; box-shadow: 0 0 0 2px #3df06a66, 0 0 8px #3df06a; }
.ppin span { position: absolute; left: 0; bottom: 10px; transform: translateX(-50%); white-space: nowrap; padding: 2px 7px; font: 700 13px var(--sans); color: #8ff0a6; background: #0b0c0fe6; border: 1px solid #3df06a88; text-shadow: 0 1px 2px #000; }
.npcpin { position: absolute; pointer-events: auto; padding: 0; background: none; border: 0; cursor: pointer; transform: translate(-50%, -50%) scale(var(--inv)); transform-origin: 50% 50%; }
.npcpin img { display: block; width: 18px; height: 18px; image-rendering: pixelated; filter: drop-shadow(0 0 1px #000) drop-shadow(0 1px 2px #000a); transition: transform .12s; }
.npcpin span { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 3px); display: none; font: 600 10.5px var(--sans); color: #fff; white-space: nowrap; padding: 1px 6px; background: #0b0c0fe0; border: 1px solid var(--gold-lo); pointer-events: none; }
.npcpin:hover, .npcpin:focus-visible { z-index: 3; }
.npcpin:hover img, .npcpin:focus-visible img { transform: scale(1.35); }
.npcpin:hover span, .npcpin:focus-visible span { display: block; }
.mapother .npcpins { z-index: 1; }
.mapfilt { position: absolute; left: 16px; bottom: 18px; z-index: 6; min-width: 132px; font: 500 12.5px var(--sans); color: var(--parch); background: var(--noise), #0b0c0fe6; border: 1px solid var(--gold-lo); box-shadow: 0 10px 30px #0009; }
.mapfilt .mf-head { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 10px; font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--parch); background: none; border: 0; cursor: pointer; }
.mapfilt .mf-head i { margin-left: auto; font-style: normal; opacity: .7; }
.mapfilt img { width: 14px; height: 14px; image-rendering: pixelated; flex: none; }
.mapfilt .mf-list { display: grid; gap: 2px; padding: 2px 10px 9px; border-top: 1px solid #323743; }
.mapfilt label { display: flex; align-items: center; gap: 7px; padding: 3px 0; cursor: pointer; white-space: nowrap; }
.mapfilt input { margin: 0; accent-color: #f3c969; }
.mapfilt .mf-all { display: flex; gap: 6px; padding-top: 5px; }
.mapfilt .mf-all button { flex: 1; padding: 3px 0; font: 600 11px var(--sans); color: var(--parch); background: #1a1d24; border: 1px solid #323743; cursor: pointer; }
.mapfilt .mf-head:hover, .mapfilt .mf-all button:hover { color: #fff; }
.mapfilt .mf-all button:hover { border-color: var(--gold-hi); }
@media (max-width: 900px) { .mapfilt { left: 8px; bottom: 10px; } .npcpin img { width: 22px; height: 22px; } }
.qpins button { position: absolute; pointer-events: auto; padding: 0; background: none; border: 0; }
.qnpc { transform: translate(-50%, -100%) scale(var(--inv)); transform-origin: 50% 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qnpc b { width: 24px; height: 24px; display: grid; place-items: center; font: 700 17px/1 var(--serif); color: #1a1205; background: radial-gradient(circle at 40% 35%, #ffe9a0, #f3c969 55%, #b07a1c); border: 2px solid #1a1205; border-radius: 50%; box-shadow: 0 0 0 2px #f3c96966, 0 0 14px #f3c969aa; animation: qbob 1.6s ease-in-out infinite; }
.qnpc.delivery b { background: radial-gradient(circle at 40% 35%, #d8f4ff, #7fd8ff 55%, #2c7fb0); box-shadow: 0 0 0 2px #7fd8ff66, 0 0 14px #7fd8ffaa; }
.qnpc.pending b { background: #8d897c; box-shadow: none; animation: none; color: #222; }
.qnpc span { font: 600 10.5px var(--sans); color: #fff; white-space: nowrap; padding: 1px 6px; background: #0b0c0fd0; border: 1px solid #f3c96955; }
.qarea { transform: translate(-50%, -50%); width: var(--d); aspect-ratio: 1; border-radius: 50%; }
.qarea i { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed #ff6a4a; background: radial-gradient(circle, #ff5a3a33, #ff5a3a10 70%); animation: qpulse 2s ease-in-out infinite; }
.qarea.loot i { border-color: #f3c969; background: radial-gradient(circle, #f3c96933, #f3c96910 70%); }
.qarea span { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 4px) scale(var(--inv)); transform-origin: 50% 0; font: 600 10.5px var(--sans); color: #fff; white-space: nowrap; padding: 2px 7px; background: #0b0c0fd9; border: 1px solid #ff6a4a88; }
.qarea.loot span { border-color: #f3c96988; }
.qpins button:hover span { background: #1d1a12; border-color: var(--gold-hi); }
.mapgo { position: absolute; width: 0; height: 0; z-index: 3; pointer-events: none; display: none; }
.mapgo.on { display: block; }
.mapgo::before { content: ''; position: absolute; left: -9px; top: -9px; width: 14px; height: 14px; transform: scale(var(--inv)); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px #0008, 0 0 10px #fff; animation: qpulse 1.2s ease-in-out infinite; }
@keyframes qbob { 50% { transform: translateY(-3px); } }
@keyframes qpulse { 50% { opacity: .55; } }
/* A monster a tracked quest wants (js/view.js .ebar.quest): TOP's gold "!" over its name. */
.ebar.quest::before { content: '!'; position: absolute; left: 50%; bottom: calc(100% + 15px); transform: translateX(-50%); font: 700 24px/1 var(--serif); color: #ffd84a; text-shadow: 0 0 2px #000, 0 2px 3px #000, 0 0 10px #ffb40099; animation: qbang 1.4s ease-in-out infinite; pointer-events: none; }
.ebar.quest small { color: #ffe27a; }
@keyframes qbang { 50% { transform: translate(-50%, -4px); } }
/* ---------- World map: the quest log on the right (js/ui.js renderQuestLog) ---------- */
.mapql { position: absolute; right: 16px; top: 14px; z-index: 5; width: 300px; max-height: calc(100% - 200px); display: flex; flex-direction: column; background: var(--noise), linear-gradient(#11141af2, #0b0d11ec); border: 1px solid #323743; box-shadow: 0 18px 50px #000b, inset 0 0 0 3px #0a0b0e, inset 0 0 0 4px var(--line-soft); }
.mapql.folded { width: auto; }
.mqhead { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.mapql.folded .mqhead { border-bottom: 0; }
.mqhead b { font: 500 13px var(--serif); letter-spacing: .26em; text-transform: uppercase; color: var(--parch); }
.mqhead small { min-width: 20px; padding: 1px 6px; text-align: center; font: 700 11px var(--sans); color: #1a1205; background: var(--gold-hi); }
.mqhead i { margin-left: auto; font-style: normal; color: var(--gold); }
.mqlist { overflow-y: auto; padding: 6px 8px 10px; }
.mq { padding: 8px 8px 9px; border-bottom: 1px solid #ffffff10; }
.mq:last-child { border-bottom: 0; }
.mq.off { opacity: .5; }
.mqt { display: flex; align-items: flex-start; gap: 8px; }
.mqtrk { flex: none; width: 20px; height: 20px; display: grid; place-items: center; font: 14px/1 var(--sans); color: #8d897c; }
.mqtrk.on { color: var(--gold-hi); text-shadow: 0 0 6px #f3c96988; }
.mqn { flex: 1; text-align: left; font: 600 13px var(--sans); color: #f3e6c4; line-height: 1.3; }
.mqn:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--gold-lo); }
.mq.ready .mqn { color: #9fe0ff; }
.mqneed { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 0 28px; font: 500 12px var(--sans); color: #cfc7b0; }
.mqneed b { color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.mqneed.done { color: #7f9a74; } .mqneed.done b { color: var(--green, #7fd07a); }
.mqneed.turn { color: #9fe0ff; } .mqneed.turn b { color: #9fe0ff; }
.mqd { margin: 6px 0 0 28px; font: 400 12px/1.45 var(--sans); color: #b9b2a0; }
.mqd.hint { color: #e9d9a6; }
.mqprize { margin: 6px 0 0 28px; font: 600 11.5px var(--sans); color: var(--gold-hi); }
.mqbtns { display: flex; gap: 6px; margin: 8px 0 0 28px; }
.mqbtns .btn { padding: 4px 10px; font-size: 11.5px; }
@media (max-width: 900px) { .mapql { right: 64px; left: 8px; top: 8px; width: auto; max-height: 48%; } .mapql.folded { left: auto; } }
/* F to interact (js/ui.js fHint): a small prompt above the hotbar and bars when someone is in reach */
#fhint { position: fixed; left: 50%; bottom: 196px; transform: translateX(-50%); z-index: 12; display: none; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; font: 600 13px var(--sans); color: #f3e6c4; background: #0b0c0fd9; border: 1px solid var(--gold-lo); pointer-events: none; white-space: nowrap; }
#fhint.on { display: flex; }
#fhint kbd { display: grid; place-items: center; width: 22px; height: 22px; font: 700 13px var(--sans); color: #1a1205; background: var(--gold-hi); border-radius: 3px; box-shadow: 0 2px 0 #8a6a1c; }
@media (max-width: 900px) { #fhint { display: none !important; } } /* phones: tap the person instead */
.qcard .qbtns { margin-top: 8px; gap: 6px; flex-wrap: wrap; } /* the Quests (L) panel: Go there / Show on map / Abandon */
.qcard .mneed.turn { color: #9fe0ff; } .qcard .mneed.turn b { color: #9fe0ff; }
/* Quest groups as in TOP's quest tree (js/ui.js questGrouped): Story Quest, Normal Quest, Guild Quest */
.qgroup { margin: 0 0 6px; }
.qgh { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; text-align: left; font: 600 11.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--parch); border-bottom: 1px solid var(--line); }
.qgh i { width: 10px; font-style: normal; color: var(--gold); }
.qgh small { margin-left: auto; min-width: 20px; padding: 1px 6px; text-align: center; letter-spacing: 0; font: 700 11px var(--sans); color: #1a1205; background: var(--gold); }
.qgroup.story .qgh span { color: #ffd84a; }
.qgroup.story .qgh small { background: #ffd84a; }
.qgroup.guild .qgh span { color: #9fd08a; }
.qgh:hover { background: #ffffff08; }
.qgroup .qcard { margin-top: 8px; }
.qtag { margin-left: 8px; padding: 1px 6px; font: 700 9.5px var(--sans); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: #1a1205; background: #7fd8ff; vertical-align: 2px; }
/* "Throw away?" when an item is dragged out of the pack onto the world */
.discard .row2 { display: flex; gap: 6px; align-items: center; margin: 14px 0 4px; }
.discard input { flex: 1; min-width: 0; font: 600 17px/1 var(--sans); color: #fff; text-align: center; padding: 7px 8px; }
.discard .note { margin: 8px 0 0; font-size: 12px; color: #a8a090; }
.discard .btnrow { display: flex; gap: 8px; margin-top: 16px; }
.discard .btnrow .btn { flex: 1; }
#scene.drop-over, #scene.over { outline: 2px dashed #ffd76a88; outline-offset: -6px; }
/* ---------- The Esc menu (js/ui.js escRender): Resume, Options, Keybinds, Switch character, Log out ---------- */
#escmenu { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; background: #05060899; backdrop-filter: blur(2px); }
#escmenu.open { display: grid; }
#escmenu .ewin { width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 22px 22px 20px; background: var(--noise), linear-gradient(#141821f7, #0b0d11f7); border: 1px solid #3a3f4b; box-shadow: 0 30px 80px #000d, inset 0 0 0 4px #0a0b0e, inset 0 0 0 5px var(--line-soft); scrollbar-width: thin; scrollbar-color: #4a3f26 transparent; }
#escmenu .ewin.options, #escmenu .ewin.keys { width: min(460px, calc(100vw - 32px)); }
#escmenu h2 { margin: 0 0 4px; text-align: center; font: 500 18px var(--serif); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; color: var(--parch); }
#escmenu .esub { margin: 0 0 14px; text-align: center; font: 500 12.5px var(--sans); color: #a8a090; }
#escmenu .elist { display: grid; gap: 8px; margin-top: 14px; }
#escmenu .elist.row { grid-auto-flow: column; }
#escmenu .elist .btn { width: 100%; justify-content: center; }
#escmenu .btn.danger { color: #ff9a88; border-color: #7a2f26; }
#escmenu .ecat { margin: 16px 0 6px; padding-bottom: 4px; font: 600 11px var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); border-bottom: 1px solid var(--line); }
#escmenu .erow { display: flex; align-items: center; gap: 12px; padding: 6px 2px; font: 500 13px var(--sans); color: #e6dcc2; }
#escmenu .erow > span { flex: 1; }
#escmenu .erow input[type=range] { width: 160px; accent-color: var(--gold); }
#escmenu .erow b { width: 30px; text-align: right; font: 600 12px var(--sans); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
#escmenu .erow input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); }
#escmenu .erow select { max-width: 200px; font: 500 12.5px var(--sans); color: #e6dcc2; background: #0b0c0f; border: 1px solid var(--gold-lo); padding: 4px 6px; }
#escmenu .ekeys .erow { border-bottom: 1px solid #ffffff0a; }
#escmenu .kbtn { min-width: 92px; padding: 5px 10px; font: 700 12.5px var(--sans); color: #1a1205; background: var(--gold-hi); border-radius: 3px; box-shadow: 0 2px 0 #8a6a1c; }
#escmenu .kbtn.wait { color: #fff; background: #3a2f18; box-shadow: 0 0 0 1px var(--gold-hi), 0 0 12px #f3c96955; animation: noticePulse 1.2s ease-in-out infinite; }
#escmenu .erow.fixed { opacity: .65; }
#escmenu .erow.fixed kbd { min-width: 92px; text-align: center; padding: 4px 8px; font: 600 12px var(--sans); color: #cfc7b0; border: 1px solid #4a4f5a; }
body.noqbang .ebar.quest::before { display: none; } /* Options: no "!" over quest monsters */

/* ===== Online play (js/online-ui.js) ===== */
#online[hidden] { display: none; }
.nameplate.other { pointer-events: auto; cursor: var(--cur-mouseon), pointer; }
.nameplate.other span { color: #cfe6ff; }
.nameplate.other.party span { color: #8ff0a6; }
.nameplate.other.duel span { color: #ff8a7a; }
/* chat: bottom right; folds down to its input bar */
#chat { position: fixed; left: 16px; bottom: 96px; z-index: 12; width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; }
#chatlog { max-height: 190px; overflow-y: auto; padding: 8px 10px; background: #0b0c0fcc; border: 1px solid var(--line); font: 500 13px/1.35 var(--sans); color: var(--parch); }
#chatlog:empty { display: none; }
#chat:not(.collapsed) #chatlog { display: block; min-height: 120px; } /* open: the log shows (even before anyone has said anything), as TOP's chat window does */
#chat.collapsed #chatlog { max-height: 64px; opacity: .85; -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%); }
#chatlog p { margin: 0 0 2px; overflow-wrap: anywhere; }
#chatlog b { font-weight: 700; cursor: var(--cur-mouseon), pointer; }
#chatlog .ch-say b { color: #fff; }
#chatlog .ch-world b { color: #ffd76a; }
#chatlog .ch-party b { color: #8ff0a6; }
#chatlog .ch-party { color: #c8f5d3; }
#chatlog .ch-whisper, #chatlog .ch-whisper b { color: #e7a6ff; }
#chatlog .ch-system { color: #9fb7c9; font-style: italic; }
#chatbar { display: flex; gap: 4px; }
#chatbar input { flex: 1; min-width: 0; padding: 7px 9px; font: 500 14px var(--sans); color: #fff; background: #0b0c0fe6; border: 1px solid var(--line); }
#chatbar input:focus { border-color: var(--gold); outline: none; }
#chatbar button { padding: 0 10px; font: 600 12px var(--serif); color: var(--gold-hi); background: #0b0c0fe6; border: 1px solid var(--line); }
#socialbtn { position: fixed; right: 16px; top: 192px; z-index: 11; }
#marketbtn { position: fixed; right: 92px; top: 192px; z-index: 11; }
/* invitations: top centre */
#invites { position: fixed; left: 50%; top: calc(var(--bar-h, 34px) + 14px); transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.invite { position: relative; overflow: hidden; padding: 10px 12px 12px; background: var(--noise), #0b0c0ff2; border: 1px solid var(--gold-lo); box-shadow: 0 6px 24px #000a; }
.invite p { margin: 0 0 8px; font: 500 14px var(--sans); color: var(--parch); }
.invite p b { color: #fff; }
.invite .btnrow { display: flex; gap: 8px; }
.invite .btnrow .btn { flex: 1; }
.invite i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gold); transition: width .5s linear; }
/* the menu on another player */
#pmenu { position: fixed; z-index: 45; width: 200px; padding: 6px; background: var(--noise), #0b0c0ff7; border: 1px solid var(--gold-lo); box-shadow: 0 8px 26px #000b; display: flex; flex-direction: column; }
#pmenu[hidden] { display: none; }
#pmenu h4 { margin: 2px 6px 6px; font: 600 13px var(--serif); letter-spacing: .08em; color: var(--gold-hi); }
#pmenu button { text-align: left; padding: 8px 10px; font: 500 14px var(--sans); color: var(--parch); border-top: 1px solid #ffffff0d; }
#pmenu button:hover { background: #ffffff0f; color: #fff; }
/* the Social window */
#social { position: fixed; right: 16px; top: calc(var(--bar-h, 34px) + 50px); z-index: 30; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 200px); display: flex; flex-direction: column; }
#social[hidden], #tradewin[hidden], #duelbar[hidden], #partyframe[hidden] { display: none; }
#social .winbar, #tradewin .winbar { display: flex; justify-content: space-between; align-items: center; }
#social .winbar .x, #tradewin .winbar .x { font-size: 18px; color: var(--parch); padding: 0 6px; }
#social .inner { overflow-y: auto; padding: 10px 12px 14px; }
#social .subtabs { display: flex; gap: 2px; padding: 6px 8px 0; }
#social .subtabs button { flex: 1; padding: 7px 4px; font: 600 11px var(--serif); letter-spacing: .1em; text-transform: uppercase; color: #a8a090; border-bottom: 2px solid transparent; }
#social .subtabs button.on { color: var(--gold-hi); border-color: var(--gold); }
.srow { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px solid #ffffff0d; font: 500 14px var(--sans); color: var(--parch); }
.srow b { color: #fff; }
.srow small { color: #a8a090; }
.srow em { color: var(--gold-hi); font-style: normal; font-size: 12px; }
.srow .sacts { margin-left: auto; display: flex; gap: 4px; }
.srow .dot { width: 8px; height: 8px; border-radius: 50%; background: #58d27a; flex: none; }
.srow .dot.off { background: #555; }
.sadd { display: flex; gap: 6px; margin-bottom: 8px; }
.sadd input { flex: 1; min-width: 0; }
#social .rep { font: 500 14px var(--sans); color: var(--parch); }
#social .rep b { color: var(--gold-hi); font: 600 18px var(--serif); }
#social .cat { margin: 12px 0 2px; font: 600 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
#social .note, #tradewin .note { font-size: 12px; color: #a8a090; }
/* the party frame: top left, under the town button */
#partyframe { position: fixed; left: 14px; top: calc(var(--bar-h, 34px) + 64px); z-index: 11; display: flex; flex-direction: column; gap: 7px; width: 230px; }
.pmem { padding: 7px 10px 8px; background: #0b0c0fd9; border: 1px solid var(--line); cursor: var(--cur-mouseon), pointer; font: 600 15px var(--sans); color: var(--parch); }
.pmem b { color: #8ff0a6; margin-right: 8px; }
.pmem > small { color: #a8a090; font-size: 13px; }
.pmem u, .dside u { display: block; height: 5px; margin-top: 4px; background: #000c; border: 1px solid #000; text-decoration: none; }
.pmem u { position: relative; height: 14px; margin-top: 5px; }
.pmem u span { position: absolute; inset: 0; font: 600 10px/12px var(--sans); text-align: center; color: #fff; text-shadow: 0 1px 2px #000; }
.pmem u em, .dside u em { display: block; height: 100%; background: linear-gradient(#58d27a, #2a8f49); }
/* their buffs and debuffs, under the health bar */
.pbf { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.pbf i { position: relative; display: block; width: 22px; height: 22px; border: 1px solid #6a5320; background: #000a; }
.pbf i.bad { border-color: #b2352a; }
.pbf i svg, .pbf i img { display: block; width: 20px; height: 20px; }
.pbf i small { position: absolute; left: 0; right: 0; bottom: -1px; font: 600 9px/1 var(--sans); text-align: center; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
/* the trade window: in the middle */
#tradewin { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 46; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto; }
/* TOP's frmPlayertrade: their grid, their gold and checks, your grid, your gold, Confirm / Trade / Cancel; your pack beside */
#tradewin .tbody { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 12px 14px 6px; }
.tform { display: flex; flex-direction: column; gap: 6px; width: 222px; }
.tstrip { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px; }
.tlab { font: 600 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.tname { font: 600 13px var(--sans); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tstrip small { font: 500 12px var(--sans); color: var(--gold-hi); }
.tgrid { display: grid; grid-template-columns: repeat(4, 50px); gap: 4px; padding: 7px; background: #00000040; border: 1px solid #ffffff14; }
.tgrid.locked { border-color: var(--gold-lo); box-shadow: inset 0 0 0 1px #f3c96933; }
.tcell { position: relative; padding: 0; background: none; border: 0; }
.tcell .tsq { position: relative; width: 50px; height: 50px; display: grid; place-items: center; background: linear-gradient(#20242c, #111318); border: 1px solid var(--gold-lo); box-shadow: inset 0 0 0 2px #0a0b0e; color: #a8a090; }
.tcell.empty .tsq { opacity: .45; }
.tcell .tct { position: absolute; right: 3px; bottom: 2px; font: 700 11px var(--sans); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
button.tcell:hover .tsq { border-color: var(--gold-hi); }
.tcell.r-uncommon .tsq { background: linear-gradient(#1f4a2c, #12261a); border-color: var(--uncommon); } .tcell.r-rare .tsq { background: linear-gradient(#4a1f5c, #24122c); border-color: var(--rare); }
.tgrow { display: flex; align-items: center; gap: 8px; }
.tgrow .tlab { flex: 0 0 auto; }
.tgbox { flex: 1; min-width: 0; height: 30px; padding: 0 8px; display: flex; align-items: center; justify-content: flex-end; font: 600 14px var(--sans); font-variant-numeric: tabular-nums; color: var(--gold-hi); background: #0a0b0e; border: 1px solid #ffffff1f; text-align: right; }
input.tgbox { width: 100%; }
.tcoin { display: grid; place-items: center; width: 28px; height: 28px; background: #ffffff0a; border: 1px solid var(--gold-lo); }
.tchks { display: flex; gap: 10px; }
.tchk { display: inline-flex; align-items: center; gap: 5px; font: 500 12px var(--sans); color: #a8a090; }
.tchk u { width: 12px; height: 12px; border: 1px solid #ffffff40; background: #0a0b0e; text-decoration: none; }
.tchk.on { color: #8ff0a6; }
.tchk.on u { background: #8ff0a6; border-color: #8ff0a6; box-shadow: 0 0 6px #8ff0a688; }
.tbtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.tbtns .btn { padding-left: 4px; padding-right: 4px; }
.tbtns .btn.on { border-color: #8ff0a6; color: #8ff0a6; }
.tside { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tpack { display: grid; grid-template-columns: repeat(auto-fill, 50px); gap: 4px; align-content: start; max-height: 372px; overflow-y: auto; padding: 7px; background: #00000040; border: 1px solid #ffffff14; }
.tqty { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 500 13px var(--sans); color: var(--parch); }
.tqty input { width: 90px; }
#tradewin .tnote { padding: 0 14px 12px; margin: 0; }
/* the duel bar: top centre */
#duelbar { position: fixed; left: 50%; top: calc(var(--bar-h, 34px) + 12px); transform: translateX(-50%); z-index: 35; width: min(440px, calc(100vw - 24px)); padding: 8px 14px 10px; background: var(--noise), #120708f2; border: 1px solid #a23a2e; text-align: center; }
#duelbar h4 { margin: 0 0 6px; font: 700 15px var(--serif); letter-spacing: .14em; color: #ffb0a4; text-transform: uppercase; }
.dsides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; text-align: left; margin-bottom: 6px; }
.dside b { font: 600 13px var(--serif); color: #fff; }
.dside small { font: 500 11px var(--sans); color: #a8a090; }
@media (max-width: 760px) {
  #chat { left: 10px; bottom: calc(var(--tab-h, 56px) + 136px); width: calc(100vw - 20px); }
  #chat.collapsed #chatlog { max-height: 44px; }
  #socialbtn { right: 10px; top: 244px; }
  #marketbtn { right: 84px; top: 244px; }
  #partyframe { left: 8px; top: calc(var(--bar-h, 34px) + 56px); width: 180px; }
  .pmem { font-size: 13px; }
  #tradewin .tbody { grid-template-columns: 1fr; } .tform { width: auto; align-items: stretch; } .tgrid { justify-content: center; }
}

/* ===== Aiming a skill, safe areas, the Sit button (js/ui.js) ===== */
body.aiming #scene, body.aiming #scene * { cursor: var(--cur-skill), crosshair !important; }
.hslot.aiming { outline: 2px solid var(--gold-hi); outline-offset: 2px; box-shadow: 0 0 0 4px #f3c96955, 0 0 18px #f3c969aa; animation: aimpulse 1s ease-in-out infinite; }
@keyframes aimpulse { 50% { box-shadow: 0 0 0 6px #f3c96933, 0 0 26px #f3c969dd; } }
/* in Argent (a safe area) the hotbar and bars show too: the tab on the bottom edge (#hudtoggle) hides them anywhere */
.hslot, [data-tip] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } /* holding for a tooltip must not select text or open the phone's menu */
/* the Sit button: touch screens and narrow windows, bottom left */
#sitbtn { display: none; position: fixed; left: 10px; bottom: calc(var(--tab-h, 62px) + 134px); z-index: 13; width: 54px; height: 54px; border-radius: 50%; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--gold-hi); background: var(--noise), #0b0c0fe6; border: 1px solid var(--gold-lo); box-shadow: 0 4px 14px #000a; font: 600 9px var(--serif); letter-spacing: .12em; text-transform: uppercase; }
#sitbtn.on { color: #0b0c0f; background: linear-gradient(#f3c969, #d2a044); border-color: #f3c969; }
@media (hover: none), (max-width: 900px) {
  body.inplay #sitbtn { display: flex; }
  body.inplay #chat { left: 74px; width: calc(100vw - 84px); } /* beside the Sit button */
}
#map.open ~ #sitbtn { display: none !important; }

/* the floating buttons never sit on top of the map, a phone's full-screen panel, or a dialog */
body.mapopen #sitbtn, body.mapopen #chat, body.mapopen #socialbtn, body.mapopen #marketbtn, body.mapopen #dbbtn, body.mapopen #partyframe,
body.dialogopen #sitbtn, body.dialogopen #chat, body.dialogopen #socialbtn, body.dialogopen #marketbtn, body.dialogopen #dbbtn { display: none !important; }
@media (max-width: 900px) { body.panelopen #sitbtn, body.panelopen #chat, body.panelopen #socialbtn, body.panelopen #marketbtn, body.panelopen #dbbtn, body.panelopen #partyframe { display: none !important; } }
/* they sit under the minimap, so with it folded away (a phone) or switched off they go too (js/ui.js) */
body.mmgone #socialbtn, body.mmgone #marketbtn, body.mmgone #dbbtn { display: none !important; }

/* ===== Ships: the shipwright's window, the harbour's list, the sailing bar (js/sailing.js) ===== */
.yard h4 { margin: 4px 0 2px; font: 600 15px var(--serif); letter-spacing: .08em; color: var(--gold-hi); }
.yard .note { margin: 0 0 10px; font-size: 12px; color: #a8a090; }
.yslot { display: grid; grid-template-columns: 82px 30px 1fr 30px 70px; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #ffffff0d; font: 500 14px var(--sans); color: var(--parch); }
.yslot .k { font: 600 11px var(--serif); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.yslot b { color: #fff; text-align: center; }
.yslot small { color: #a8a090; text-align: right; }
.yslot .btn.sm { padding: 2px 0; min-width: 0; }
.ystats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin: 12px 0; }
.srow2 { display: flex; justify-content: space-between; font: 500 13px var(--sans); color: #a8a090; padding: 3px 0; }
.srow2 b { color: #fff; }
.yname { display: flex; flex-direction: column; gap: 4px; font: 600 11px var(--serif); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.boatrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #ffffff0d; }
.boatrow .info { flex: 1; min-width: 0; font: 500 13px var(--sans); color: var(--parch); }
.boatrow .info b { display: block; color: #fff; font-size: 15px; }
.boatrow .info small { color: #a8a090; }
.boatrow.dead .info b { color: #ff8a7a; }
.boatrow u, #sailbar u { display: block; height: 6px; margin: 5px 0 3px; background: #000c; border: 1px solid #000; text-decoration: none; }
.boatrow u em, #sailbar u.hp em { display: block; height: 100%; background: linear-gradient(#58d27a, #2a8f49); }
#sailbar u.sp em { display: block; height: 100%; background: linear-gradient(#5cb4ff, #2a6fbf); }
.boatrow .nums { font-size: 11px; color: #a8a090; }
#sailbar { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 12; width: min(420px, calc(100vw - 24px)); padding: 10px 14px 12px; background: var(--noise), #0b0c0ff0; border: 1px solid var(--gold-lo); box-shadow: 0 6px 22px #000a; }
#sailbar[hidden] { display: none; }
#sailbar > b { font: 600 14px var(--serif); letter-spacing: .1em; color: var(--gold-hi); }
#sailbar .sb { display: grid; grid-template-columns: 40px 1fr 92px; align-items: center; gap: 8px; font: 500 12px var(--sans); color: #a8a090; }
#sailbar .sb small { text-align: right; color: var(--parch); }
#sailbar .btn { width: 100%; margin-top: 8px; }
#sailbar .note { margin: 6px 0 0; font-size: 12px; color: #a8a090; }
@media (max-width: 900px) { #sailbar { bottom: calc(var(--tab-h, 62px) + 16px); } }
body.mapopen #sailbar { display: none !important; }

/* ===== Another of TOP's maps on the M map (js/ui.js otherMap): Magical Ocean, Deep Blue ===== */
.mapother { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: #071a33; }
.mapother[hidden] { display: none; }
.mapother .mo-wrap { position: relative; height: min(92vh, 92vw); max-width: 92vw; aspect-ratio: 1; }
.mapother img { width: 100%; height: 100%; display: block; }
.mapother .mo-me { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; border: 2px solid #000; box-shadow: 0 0 0 3px #f3c969aa; }
.mapother .mo-town { position: absolute; transform: translate(-50%, -140%); padding: 2px 6px; font: 600 11px var(--serif); letter-spacing: .08em; color: #f3e4bd; background: #0b0c0fd0; border: 1px solid var(--gold-lo); white-space: nowrap; pointer-events: none; }
.mapother .maptitle { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); }

/* ===== Player stalls (js/stall.js): Set Stall, your stall, someone else's ===== */
.stallwin { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 46; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow-y: auto; }
.stallwin[hidden], #stallpill[hidden] { display: none; }
#stallwin.stallwin { left: 16px; transform: translateY(-50%); width: min(520px, calc(100vw - 24px)); }
.stallwin .winbar { display: flex; justify-content: space-between; align-items: center; }
.stallwin .winbar .x { font-size: 18px; color: var(--parch); padding: 0 6px; }
.stallwin .inner { padding: 12px 14px 14px; }
.stallwin h5 { margin: 12px 0 6px; font: 600 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.stallwin .note { font-size: 12px; color: #a8a090; }
.stallwin .yname input { margin-top: 2px; }
.strow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #ffffff0d; }
.strow .sti { flex: 0 0 34px; display: flex; justify-content: center; }
.strow .stnm { flex: 1; min-width: 0; display: flex; flex-direction: column; font: 500 14px var(--sans); color: #fff; }
.strow .stnm small { font-size: 11px; color: #a8a090; }
.strow label { display: flex; flex-direction: column; gap: 2px; font: 600 10px var(--serif); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); width: 92px; }
.strow label input, .strow .stqty { width: 100%; padding: 4px 6px; }
.strow .stqty { width: 64px; }
.strow .stq { font: 500 13px var(--sans); color: var(--parch); }
.strow .stp { display: flex; align-items: center; gap: 4px; font: 600 13px var(--sans); color: #f3d27a; white-space: nowrap; }
.strow .stp small { font-weight: 400; color: #a8a090; margin-left: 2px; }
.strow .x { width: 20px; height: 20px; --xcol: #ff8a7a; } /* remove from the stall */
.stsale { margin: 2px 0; font-size: 12px; color: #9ee6a8; }
#stallpill { position: fixed; left: 16px; top: 50%; z-index: 30; }
/* A stall's sign over the name: TOP's booth board (assets/top/ui/boothname_*.png, cut from texture/ui/BoothName.png as the
   client's face.lua does: a 15 px cap each side and a 1 px middle stretched to the name, 34 px tall; the name in black,
   at least 40 px wide (UIHeadSay.cpp _RenderShop). */
.stallsign { box-sizing: content-box; height: 34px; min-width: 40px; padding: 0 14px; margin-bottom: 2px; line-height: 34px; font: 600 12px var(--sans); color: #000; text-align: center; white-space: nowrap;
  background: url(../assets/top/ui/boothname_l.png) left top / 15px 34px no-repeat, url(../assets/top/ui/boothname_r.png) right top / 15px 34px no-repeat, url(../assets/top/ui/boothname_m.png) 15px 0 / calc(100% - 30px) 34px no-repeat; image-rendering: auto; }
@media (max-width: 900px) { #stallwin.stallwin { left: 50%; transform: translate(-50%, -50%); } .strow { flex-wrap: wrap; } .strow label { width: 84px; } }
body.mapopen .stallwin, body.mapopen #stallpill { display: none !important; }
.stallwin input[type=number] { -moz-appearance: textfield; appearance: textfield; text-align: right; }
.stallwin input[type=number]::-webkit-inner-spin-button, .stallwin input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.strow label { width: 110px; }
.strow .stnm b { font: 600 14px var(--sans); color: #fff; }
.stallwin .note .ic, .stallwin .stp .ic { display: inline-block; vertical-align: -2px; }

/* TOP's timed zones under the minimap (js/portals.js): open (green), closing (amber), or when they open next */
#minimap .mm-events { display: grid; gap: 2px; padding: 4px 2px 1px; border-top: 1px solid var(--line-soft); margin-top: 3px; }
#minimap .mme { display: grid; grid-template-columns: 26px 1fr auto; align-items: baseline; gap: 4px; padding: 1px 4px; font: 600 11px var(--sans); color: var(--parch); font-variant-numeric: tabular-nums; }
#minimap .mme b { font: 700 11px var(--serif); letter-spacing: .06em; color: var(--gold-hi); }
#minimap .mme span { color: #9a9488; font-weight: 500; }
#minimap .mme i { font-style: normal; }
#minimap .mme.open { background: #1d3b2366; }
#minimap .mme.open span, #minimap .mme.open i { color: #8ff0a6; }
#minimap .mme.live span, #minimap .mme.live i { color: #f3c969; }
#minimap .mme.here { outline: 1px solid var(--gold-lo); }
#minimap .mme-leave { margin: 3px 2px 1px; padding: 3px 4px; font: 600 11px var(--sans); color: var(--parch); background: #3a1d1dcc; border: 1px solid #8a4a3a; cursor: pointer; }
@media (max-width: 700px) { #minimap .mme { font-size: 10px; grid-template-columns: 22px 1fr auto; padding: 0 2px; } #minimap .mme span { display: none; } #minimap .mme { grid-template-columns: 24px 1fr; } }
.droplabel.portallabel { color: #ffd59a; border-color: #8a5a2a; } .droplabel.portallabel.ev { color: #bfe0ff; border-color: #3a6a9a; }
#scene.camturn, body.camturn #scene { cursor: grabbing; }

#pmenu button.pk { color: #ff8a7a; }

#chatlog .ch-guild b { color: #b9a6ff; } #chatlog .ch-guild { color: #ddd3ff; }
#chatlog .ch-trade b { color: #f2a65a; } #chatlog .ch-trade { color: #f7d2ad; }
.nameplate .guildtag { font: 600 10px var(--sans); color: #b9a6ff; letter-spacing: .04em; text-align: center; text-shadow: 0 1px 2px #000; }

/* TOP's Lucky Chance slot machine (js/lottery.js) */
#lotterywin { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 40; width: min(320px, calc(100vw - 32px)); padding: 10px 12px; background: var(--noise), #0b0c0ff0; border: 1px solid var(--gold-lo); box-shadow: 0 14px 40px #000c; }
#lotterywin[hidden] { display: none; }
#lotterywin .winbar { display: flex; justify-content: space-between; align-items: center; font: 600 13px var(--serif); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-hi); margin-bottom: 6px; }
#lotterywin .winbar .x { font-size: 18px; color: var(--parch); padding: 0 6px; background: none; border: 0; }
.lt-grid { display: grid; gap: 4px; margin: 8px 0; }
.lt-row { display: grid; grid-template-columns: 54px repeat(3, 1fr); gap: 4px; align-items: center; }
.lt-bet { font: 600 11px var(--sans); color: var(--parch); display: flex; gap: 4px; align-items: center; }
.lt-cell { height: 46px; display: grid; place-items: center; background: #15171cd0; border: 1px solid var(--line-soft); }
.lt-cell.on { border-color: var(--gold-lo); background: #1d2028; }
.lt-cell i { font-style: normal; color: #6b665c; font: 700 16px var(--serif); }
.lt-res { text-align: center; font: 600 13px var(--sans); color: var(--gold-hi); margin: 4px 0; }

/* A shop on a phone (js/ui.js pTopNpc shop, p.sideRight): the NPC's goods first and filling the panel, your pack a short
   strip under them (it had the whole panel and pushed the goods out of sight). Tap or drag between them as before. */
@media (max-width: 900px) {
  #panel.sideright .pbody { order: 1; flex: 1 1 0; min-height: 110px; overflow-y: auto; } /* the goods scroll in what is left */
  #panel.sideright .pside.right { order: 2; display: block; overflow: visible; margin: 0; padding: 6px 10px 8px; border-width: 1px 0 0; border-style: solid; border-color: var(--line); }
  #panel.sideright .pside.right h3 { display: block; margin: 0 0 6px; padding: 0; border: 0; font-size: 11px; letter-spacing: .2em; }
  #panel.sideright .pside.right { flex: none; }
  #panel.sideright .pside.right .shopgrid.pack { grid-template-columns: repeat(auto-fill, 44px); gap: 5px; max-height: 98px; width: 100%; }
  #panel.sideright .pside.right .shopgrid.pack .slot { width: 44px; height: 44px; }
  #panel.sideright .pside.right .dragnote { display: none; } /* on a phone: tap a square, then its Buy / Sell button below */
  #panel.sideright .pfoot { order: 3; flex: none; }
}

/* The loading screen (index.html #boot, js/loading.js): the game's download, then the world round you as it streams in */
#boot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #13202e 0%, #07090c 70%); transition: opacity .5s; }
#boot.gone { opacity: 0; pointer-events: none; }
#boot.hide { display: none; }
#boot .boot-in { width: min(420px, calc(100vw - 48px)); text-align: center; }
#boot h1 { margin: 0 0 18px; font: 600 clamp(22px, 5vw, 34px) var(--serif, serif); letter-spacing: .18em; text-transform: uppercase; color: #f3c969; text-shadow: 0 2px 12px #000; }
#boot p { margin: 8px 0; font: 500 14px var(--sans, sans-serif); color: #cfc7b0; letter-spacing: .04em; }
#boot #boot-num { font-size: 12.5px; color: #9a9488; font-variant-numeric: tabular-nums; }
#boot .boot-bar { height: 10px; background: #0b0c0f; border: 1px solid #6b5a33; box-shadow: inset 0 0 0 2px #0b0c0f; overflow: hidden; }
#boot .boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a4802e, #f3c969); transition: width .25s; }

/* TOP's item mall (js/mall.js) */
/* ---------- The Item Mall (js/mall.js): a store screen under the top bar ---------- */
#mallscreen { --mx-navy: #0d1824; --mx-navy2: #132233; --mx-edge: #2c4560; --mx-edge-hi: #5d86ad; --mx-blue: #4aa8ff; --mx-text: #e8e3d6; --mx-dim: #9fb0c0;
  position: fixed; left: 0; right: 0; top: var(--bar-h); bottom: var(--tab-h); z-index: 18; display: flex; flex-direction: column; padding: 20px clamp(10px, 4vw, 70px) 0;
  background: radial-gradient(ellipse at 50% 0%, #0c1a2acc, #04070bf0 70%); backdrop-filter: blur(3px); }
#mallscreen[hidden] { display: none; }
#mallscreen .mx-frame { flex: 1; min-height: 0; width: 100%; max-width: 1560px; margin: 0 auto; display: grid; grid-template-columns: 300px 1fr; gap: 28px; padding: 26px 30px 24px;
  background: var(--noise), linear-gradient(160deg, #142538f2, #0a131df5 60%, #0c1622f5); border: 1px solid var(--mx-edge); box-shadow: 0 30px 80px #000c, inset 0 0 0 4px #070c12, inset 0 0 0 5px #ffffff0d, inset 0 0 120px #00000080; }
/* the left: search, filter, sort, categories */
#mallscreen .mx-side { display: flex; flex-direction: column; gap: 18px; min-height: 0; }
#mallscreen .mx-tools { display: flex; gap: 6px; }
#mallscreen .mx-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; color: var(--mx-dim); background: #05090ecc; border: 1px solid #6d5120; box-shadow: inset 0 1px 6px #000; }
#mallscreen .mx-search:focus-within { border-color: var(--gold-hi); color: var(--parch); }
#mallscreen .mx-search input { flex: 1; min-width: 0; height: 100%; font: 500 15px var(--sans); color: var(--mx-text); background: none; border: 0; outline: 0; }
#mallscreen .mx-search input::placeholder { color: #8e98a2; }
#mallscreen .mx-tool { flex: none; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; color: var(--gold-hi); background: #05090ecc; border: 1px solid #6d5120; }
#mallscreen .mx-tool:hover { border-color: var(--gold-hi); }
#mallscreen .mx-tool.on { color: #0a0b0e; background: linear-gradient(#f3c969, #b58628); border-color: var(--gold-hi); }
#mallscreen .mx-cats { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; scrollbar-width: thin; scrollbar-color: var(--mx-edge-hi) transparent; }
#mallscreen .mx-cat { position: relative; flex: none; display: flex; align-items: center; height: 52px; padding: 0 18px 0 24px; text-align: left; font: 500 17px var(--sans); color: #d6d9dc;
  background: var(--noise), linear-gradient(90deg, #1a2a3bd9, #111d29d9); border: 0; border-left: 4px solid transparent; box-shadow: inset 0 -1px 0 #ffffff08; }
#mallscreen .mx-cat:hover { color: #fff; background: var(--noise), linear-gradient(90deg, #22384ed9, #152435d9); }
#mallscreen .mx-cat.on { color: #fff; border-left-color: #7cc4ff; background: var(--noise), linear-gradient(90deg, #2c78c4, #1d4f86 55%, #183c63); box-shadow: inset 0 0 18px #6ec0ff33; }
#mallscreen .mx-dia { position: absolute; left: -8px; top: 50%; width: 14px; height: 14px; margin-top: -7px; transform: rotate(45deg); background: #0a0b0e; border: 2px solid var(--gold-hi); box-shadow: 0 0 6px #f3c96988; }
#mallscreen .mx-dia::after { content: ''; position: absolute; inset: 3px; background: var(--gold-hi); }
#mallscreen .mx-cat.on .mx-dia { left: -10px; }
/* the right: a heading with the crystals, then cards */
#mallscreen .mx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#mallscreen .mx-head { flex: none; display: flex; align-items: center; gap: 16px; min-height: 48px; margin-bottom: 16px; }
#mallscreen .mx-head h1 { margin: 0; font: 500 30px var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--mx-text); text-shadow: 0 2px 8px #000; white-space: nowrap; }
#mallscreen .mx-count { font: 500 13px var(--sans); color: var(--mx-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mallscreen .mx-purse { margin-left: auto; flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 0 0 12px; background: #05090ee6; border: 1px solid var(--gold); box-shadow: inset 0 0 0 1px #000; }
#mallscreen .mx-purse b { min-width: 72px; font: 500 22px var(--serif); letter-spacing: .06em; color: #fff; }
#mallscreen .mx-purse button { width: 40px; height: 38px; padding: 0; font: 300 26px/1 var(--sans); color: #fff; background: #ffffff12; border: 0; border-left: 1px solid var(--gold-lo); }
#mallscreen .mx-purse button:hover { background: #ffffff22; }
#mallscreen .mx-chips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
#mallscreen .mx-chips button { height: 32px; padding: 0 14px; font: 600 12px var(--serif); letter-spacing: .16em; text-transform: uppercase; color: #b9c4cf; background: #0b141ecc; border: 1px solid var(--mx-edge); }
#mallscreen .mx-chips button:hover { color: #fff; border-color: var(--mx-edge-hi); }
#mallscreen .mx-chips button.on { color: #fff; border-color: #7cc4ff; background: linear-gradient(#245d97, #173c63); box-shadow: 0 0 10px #3fa9ff55; }
#mallscreen .mx-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 6px 6px 2px; scrollbar-width: thin; scrollbar-color: var(--mx-edge-hi) transparent; }
#mallscreen .mx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px; }
#mallscreen .mx-grid.feat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#mallscreen .mx-none { margin: 30px 0; font-size: 15px; color: var(--mx-dim); }
/* a card: the art, a title in spaced capitals, what it is, a rule, the price */
#mallscreen .mx-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 330px; padding: 0; overflow: hidden; text-align: left; color: var(--mx-text);
  background: var(--noise), radial-gradient(ellipse at 50% 35%, #29425e, #0f1b28 70%); border: 1px solid var(--mx-edge); box-shadow: inset 0 0 0 1px #00000080, inset 0 0 40px #000a; transition: border-color .15s, box-shadow .15s; }
#mallscreen .mx-card.big { grid-column: span 2; min-height: 340px; }
#mallscreen .mx-card:hover, #mallscreen .mx-card:focus-visible { border-color: #e8eef4; box-shadow: inset 0 0 0 1px #00000080, inset 0 0 40px #000a, 0 0 0 1px #ffffff55, 0 0 22px #6ec0ff33; outline: 0; }
#mallscreen .mx-card.off { filter: grayscale(.8); opacity: .55; }
#mallscreen .mx-art { position: absolute; inset: 0 0 112px; display: grid; place-items: center; }
#mallscreen .mx-card.big .mx-art { inset: 0 0 20px 40%; }
#mallscreen .mx-shot { position: absolute; left: 0; right: 0; bottom: -112px; width: 100%; height: calc(100% + 112px); object-fit: contain; object-position: 50% 30%; z-index: 1; opacity: 0; transition: opacity .3s; }
#mallscreen .mx-shot[src] { opacity: 1; }
#mallscreen .mx-card.big .mx-shot { bottom: -20px; height: calc(100% + 20px); object-position: 50% 0; }
#mallscreen .mx-shot[src] + .mx-ghost { opacity: 0; }
#mallscreen .mx-icons { display: grid; gap: 6px; filter: drop-shadow(0 6px 12px #000c); }
#mallscreen .mx-icons.n2, #mallscreen .mx-icons.n3, #mallscreen .mx-icons.n4 { grid-template-columns: 1fr 1fr; }
#mallscreen .mx-icons i { display: grid; place-items: center; padding: 6px; background: radial-gradient(circle, #ffffff1c, transparent 70%); }
#mallscreen .mx-icons .ic { image-rendering: auto; }
#mallscreen .mx-icons.n1 .ic { width: 96px; height: 96px; } #mallscreen .mx-icons.n2 .ic, #mallscreen .mx-icons.n3 .ic, #mallscreen .mx-icons.n4 .ic { width: 64px; height: 64px; }
#mallscreen .mx-card.big .mx-icons.n1 .ic, #mallscreen .mx-bigart .mx-icons.n1 .ic { width: 128px; height: 128px; } #mallscreen .mx-ghost .ic { width: 48px !important; height: 48px !important; }
#mallscreen .mx-ghost { transition: opacity .3s; opacity: .6; }
#mallscreen .mx-tryon { position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid #dff3ffcc; border-radius: 50%; background: #0a1520b3; box-shadow: 0 0 10px #6ec0ff55; }
#mallscreen .mx-text { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 3px; padding: 46px 22px 16px; background: linear-gradient(transparent, #0a121cdd 38%, #0a121cf5); }
#mallscreen .mx-text b { font: 500 16px/1.25 var(--serif); letter-spacing: .16em; text-transform: uppercase; color: #f1ece0; text-shadow: 0 2px 4px #000; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#mallscreen .mx-card.big .mx-text b { font-size: 19px; }
#mallscreen .mx-text small { font: 500 13.5px var(--sans); color: var(--mx-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mallscreen .mx-rule { display: block; height: 1px; margin: 8px 0 7px; background: linear-gradient(90deg, #ffffff40, #ffffff14); }
#mallscreen .mx-price { display: flex; align-items: center; gap: 8px; font: 500 23px var(--serif); letter-spacing: .06em; color: #fff; }
/* a pack opened: your character in it on the left, what it is and Purchase on the right */
#mallscreen .mx-back { flex: none; height: 38px; padding: 0 16px; font: 600 13px var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--parch); background: #0b141ecc; border: 1px solid var(--mx-edge); }
#mallscreen .mx-back:hover { color: #fff; border-color: var(--mx-edge-hi); }
#mallscreen .mx-path { font: 500 13px var(--serif); letter-spacing: .16em; text-transform: uppercase; color: var(--mx-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mallscreen .mx-detail { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr); gap: 28px; }
#mallscreen .mx-dstage { position: relative; min-height: 0; display: flex; border: 1px solid var(--mx-edge); background: var(--noise), radial-gradient(ellipse 45% 7% at 50% 90%, #000000aa, transparent 70%), radial-gradient(ellipse at 50% 35%, #2d4867, #0d1824 72%); box-shadow: inset 0 0 0 1px #000, inset 0 0 60px #000b; }
#mallscreen .mx-stage { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; }
#mallscreen .mx-stage canvas { flex: 1; min-height: 0; width: 100%; display: block; cursor: grab; touch-action: none; }
#mallscreen .mx-stage canvas.grab { cursor: grabbing; }
#mallscreen .mx-stagemsg { position: absolute; left: 0; right: 0; top: 45%; margin: 0; text-align: center; font-size: 14px; color: var(--mx-dim); }
#mallscreen .mx-stagebar { flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px 14px; }
#mallscreen .mx-stagebar small { flex: 1; text-align: center; font-size: 12.5px; color: var(--mx-dim); }
#mallscreen .mx-rot { width: 44px; height: 44px; padding: 0; font: 400 22px/1 var(--sans); color: var(--gold-hi); background: #05090ecc; border: 1px solid #6d5120; touch-action: none; user-select: none; }
#mallscreen .mx-rot:hover { border-color: var(--gold-hi); } #mallscreen .mx-rot:active { background: #2a2416; }
#mallscreen .mx-bigart { flex: 1; display: grid; place-items: center; }
#mallscreen .mx-bigart .mx-icons i { padding: 18px; }
#mallscreen .mx-dinfo { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 4px 4px 4px 0; }
#mallscreen .mx-kicker { font: 500 12px var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi); }
#mallscreen .mx-dinfo h2 { margin: 6px 0 6px; font: 500 30px/1.15 var(--serif); letter-spacing: .14em; text-transform: uppercase; color: #f1ece0; }
#mallscreen .mx-desc { margin: 0; font-size: 15px; line-height: 1.45; color: var(--mx-dim); }
#mallscreen .mx-dinfo .mx-rule { margin: 18px 0 14px; }
#mallscreen .mx-dinfo h4 { margin: 0 0 10px; font: 500 12.5px var(--serif); letter-spacing: .24em; text-transform: uppercase; color: var(--parch); }
#mallscreen .mx-items { display: grid; gap: 8px; }
#mallscreen .mx-item { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 6px; background: #0a131dcc; border: 1px solid #ffffff10; }
#mallscreen .mx-slot { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: #05090e; border: 1px solid var(--gold-lo); box-shadow: inset 0 0 0 2px #05090e, inset 0 0 0 3px #ffffff0d; }
#mallscreen .mx-item b { font: 600 14px var(--sans); color: var(--mx-text); }
#mallscreen .mx-item small { color: var(--gold-hi); font-weight: 700; }
#mallscreen .mx-item em { display: block; font: 600 11px var(--sans); font-style: normal; letter-spacing: .06em; color: #8fd0ff; }
#mallscreen .mx-buyrow { display: flex; align-items: center; gap: 18px; margin-top: auto; padding-top: 22px; }
#mallscreen .mx-dprice { display: flex; align-items: center; gap: 10px; font: 500 32px var(--serif); letter-spacing: .05em; color: #fff; }
#mallscreen .mx-btn { flex: 1; height: 50px; padding: 0 20px; font: 600 15px var(--serif); letter-spacing: .26em; text-transform: uppercase; color: #fff; border: 1px solid; }
#mallscreen .mx-btn.gold { color: #1a1205; background: var(--noise), linear-gradient(#f0c766, #c79630 55%, #a8781e); border-color: #ffe39a; box-shadow: 0 0 0 3px #05090e, 0 0 0 4px #8a6a28; }
#mallscreen .mx-btn.gold:hover { filter: brightness(1.1); }
#mallscreen .mx-btn.gold.ask { color: #fff; background: var(--noise), linear-gradient(#3f9bff, #1554b8 60%, #0d2f73); border-color: #8cc6ff; box-shadow: 0 0 0 3px #05090e, 0 0 0 4px #4d7fc0, 0 0 20px #1e6fe066; }
#mallscreen .mx-btn:disabled { color: #8e8a80; background: #1a1d23; border-color: #4a4f5a; box-shadow: 0 0 0 3px #05090e, 0 0 0 4px #2a2e37; filter: none; cursor: default; }
#mallscreen .mx-note { margin: 10px 0 0; font-size: 13px; color: var(--mx-dim); }
#mallscreen .mx-note.warn { color: #ff8c7d; }
#mallscreen .mx-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 1560px; margin: 0 auto; padding: 12px 4px 14px; font-size: 13px; color: var(--mx-dim); }
#mallscreen .mx-keys { display: flex; align-items: center; gap: 8px; font: 500 15px var(--sans); color: var(--parch); }
#mallscreen .mx-keys kbd { padding: 2px 7px; font: 600 12px var(--sans); color: var(--parch); background: #0a0b0e; border: 1px solid #8a8678; border-radius: 4px; }
@media (max-width: 1280px) { #mallscreen .mx-grid.feat { grid-template-columns: repeat(2, minmax(0, 1fr)); } #mallscreen .mx-card.big { grid-column: span 2; } }
@media (max-width: 900px) {
  #mallscreen { padding: 8px 8px 0; }
  #mallscreen .mx-frame { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: 12px; }
  #mallscreen .mx-side { min-width: 0; }
  #mallscreen .mx-side { gap: 10px; }
  #mallscreen .mx-cats { flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 4px; padding-bottom: 2px; }
  #mallscreen .mx-cat { height: 38px; padding: 0 14px; font-size: 14px; white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  #mallscreen .mx-cat.on { border-bottom-color: #7cc4ff; }
  #mallscreen .mx-dia { display: none; }
  #mallscreen .mx-head { flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
  #mallscreen .mx-head h1 { font-size: 21px; }
  #mallscreen .mx-count { order: 3; flex-basis: 100%; }
  #mallscreen .mx-grid, #mallscreen .mx-grid.feat { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #mallscreen .mx-card { min-height: 250px; }
  #mallscreen .mx-art { bottom: 96px; }
  #mallscreen .mx-text { padding: 30px 12px 10px; }
  #mallscreen .mx-text b, #mallscreen .mx-card.big .mx-text b { font-size: 13px; letter-spacing: .1em; }
  #mallscreen .mx-price { font-size: 18px; }
  #mallscreen .mx-detail { display: block; overflow-y: auto; }
  #mallscreen .mx-dstage { height: 420px; margin-bottom: 16px; }
  #mallscreen .mx-detail.flat .mx-dstage { height: 180px; }
  #mallscreen .mx-dinfo h2 { font-size: 22px; }
  #mallscreen .mx-foot span:first-child { display: none; }
}
/* a row of five tabs (the smith's windows): tighter letters, so the words do not run together */
.subtabs button:first-child:nth-last-child(n+5), .subtabs button:first-child:nth-last-child(n+5) ~ button { letter-spacing: .06em; font-size: 11.5px; padding: 0 2px; min-width: 0; }


/* a place in an NPC's or a quest's words (js/ui.js topText): click it to walk there */
.goto { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.goto::after { content: '\279C'; display: inline-block; margin-left: 3px; font-size: .8em; opacity: .7; }
.goto:hover { color: #ffd76a; text-decoration-style: solid; }

/* following another player (js/online-ui.js) */
#followbar { position: fixed; left: 50%; top: calc(var(--bar-h, 34px) + 12px); transform: translateX(-50%); z-index: 14; display: flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 14px; font: 500 13px var(--sans); color: #e8e0c8; background: var(--noise), #0b0c0fe0; border: 1px solid var(--gold-lo); border-radius: 18px; box-shadow: 0 4px 14px #000a; }
#followbar b { color: var(--gold-hi); font-weight: 600; }
#followbar button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--gold-lo); background: transparent; color: var(--gold-hi); cursor: pointer; line-height: 1; }
#followbar[hidden] { display: none; }
#pmenu button small { opacity: .55; margin-left: 6px; font-size: 10px; }

/* on a phone the chat starts folded to just its button (js/online-ui.js); a dot on it when something new came in */
@media (hover: none), (max-width: 900px) {
  #chat.collapsed { width: auto !important; right: auto !important; }
  #chat.collapsed #chatlog, #chat.collapsed #chatch, #chat.collapsed #chatin { display: none; }
  #chat.collapsed #chatbar { background: none; border: 0; padding: 0; }
}
#chattog { position: relative; }
#chattog.unread::after { content: ''; position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: #ff6b5a; box-shadow: 0 0 0 2px #0b0c0f; }

/* a Say bubble over a player's name (js/view.js V.bubble) */
.nameplate .bubble { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); max-width: 220px; width: max-content; padding: 6px 10px;
  font: 500 12.5px/1.35 var(--sans); color: #1b1712; background: #f5ecd6; border: 1px solid #b89a5e; border-radius: 9px; box-shadow: 0 3px 10px #0008;
  white-space: normal; overflow-wrap: anywhere; text-align: center; transition: opacity .5s; }
.nameplate .bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #f5ecd6; }
.nameplate .bubble.out { opacity: 0; }

/* the portal timers under the minimap fold to a heading (js/portals.js); folded by default */
#minimap .mme-head { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 6px; margin-top: 4px; background: #ffffff08; border: 1px solid var(--line-soft); color: #cfc7b0;
  font: 600 10px var(--serif); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
#minimap .mme-head span { flex: 1; text-align: left; }
#minimap .mme-head em { font: 600 10px var(--sans); letter-spacing: 0; text-transform: none; color: #7fd88f; font-style: normal; }
#minimap .mme-head i { font-style: normal; color: var(--gold-hi); }
#minimap .mme-head:hover { background: #ffffff12; }

/* another map's picture zooms and pans (js/ui.js otherMap): the marks keep their size */
.mapother { overflow: hidden; touch-action: none; cursor: grab; }
.mapother .mo-view { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.mapother .mo-wrap { transform-origin: 50% 50%; will-change: transform; --inv: 1; }
.mapother .mo-me { transform: scale(var(--inv)); }
.mapother .mo-town { transform: translate(-50%, -140%) scale(var(--inv)); transform-origin: 50% 100%; }
.mapother .mo-ctl { position: absolute; right: 14px; bottom: 14px; z-index: 2; display: flex; flex-direction: column; gap: 4px; }
/* ---------- Hotbar rows, items on the bar, drag and drop (js/ui.js renderHotbar) ---------- */
#hotbar { flex-direction: column; align-items: center; }
#hotbar .hbrow { display: flex; gap: inherit; justify-content: center; }
#hotbar.two .hbrow.extra .hslot { opacity: .95; }
.hslot.item .cnt { position: absolute; right: 3px; bottom: 14px; font: 700 11px var(--sans); color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.hslot.item.zero { filter: grayscale(1) brightness(.6); }
.hslot[data-drop="hb"].over, .lslot .hslot[data-drop="hb"].over { box-shadow: 0 0 0 2px #f3c969, 0 0 14px #f3c96988; border-color: var(--gold-hi); }
.hslot.dragging, .skrow.dragging { opacity: .45; }
.skrow.dragskill { cursor: var(--cur-drag), grab; }
.slotbtns.hbput { flex-wrap: wrap; margin: 4px 0 2px; }

/* a TOP mission's rewards: the quest squares (js/ui.js topPrizes); a choose-one square lights up when picked */
.mprizes { gap: 6px; }
.rsq.pick { padding: 0; }
.rsq.pick.sel { border-color: #f3c969; box-shadow: 0 0 0 1px #f3c969, 0 0 10px #f3c96955; background: linear-gradient(#3a3220, #1a160c); }
.mqprize { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mqprize .rsqs { display: flex; flex-wrap: wrap; gap: 5px; }
.mqprize .rsq { width: 34px; height: 34px; }
/* ---------- A stall as a grid (js/stall.js): 3 x 4 cells, the item's square and its price under it ---------- */
.stgrid { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px 10px; justify-content: center; margin: 6px 0 10px; }
.stcell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; background: none; border: 0; }
.stcell .stsq { position: relative; width: 56px; height: 56px; display: grid; place-items: center; background: linear-gradient(#20242c, #111318); border: 1px solid var(--gold-lo); box-shadow: inset 0 0 0 2px #0a0b0e; }
.stcell .stct { position: absolute; right: 3px; bottom: 2px; font: 700 11px var(--sans); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.stcell .stpr { min-height: 16px; font: 700 12px var(--sans); color: var(--gold-hi); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stcell .stpr.unset { color: #ff8a7a; font-weight: 600; }
button.stcell:hover .stsq { border-color: var(--gold-hi); }
.stcell.sel .stsq { border-color: var(--gold-hi); box-shadow: inset 0 0 0 2px #0a0b0e, 0 0 0 2px #f3c96966, 0 0 12px #f3c96955; }
.stcell.empty .stsq { opacity: .55; }
.stcell.locked .stsq { opacity: .3; background: repeating-linear-gradient(45deg, #15171c 0 6px, #0d0e11 6px 12px); }
.stcell.locked .stpr { color: #6f6b60; font-weight: 500; font-size: 11px; }
.stedit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; padding: 8px 10px; background: #0b0c0f99; border: 1px solid #ffffff12; }
.stedit .stnm { flex: 1; min-width: 110px; display: flex; flex-direction: column; }
.stedit label { display: flex; flex-direction: column; gap: 2px; font: 600 11px var(--sans); color: #a8a090; }
.stedit .field { width: 90px; }
.stedit .x { width: 22px; height: 22px; --xcol: #ff8a7a; }
/* TOP's MISS sprite (js/view.js missMark): orange (submiss2) for your blows and those at you, blue (submiss) between others */
/* Windows can be moved by their title bar (js/ui.js initWindowDrag); double-click it to put the window back */
@media (min-width: 901px) { .winbar, #panel .phead { cursor: var(--cur-drag), move; user-select: none; } .win.moving, #panel.moving { opacity: .92; box-shadow: 0 30px 90px #000e; } }
/* The stall's pack (js/stall.js setupHtml): the same squares as the stall grid, icon and count, its card on hover */
.stpack { display: grid; grid-template-columns: repeat(auto-fill, 58px); gap: 8px; justify-content: start; max-height: 220px; overflow-y: auto; padding: 2px 2px 6px; scrollbar-width: thin; scrollbar-color: #4a3f26 transparent; }
.stpack .stcell .stsq { width: 54px; height: 54px; }
/* A game master (server/game.js presence gm, js/view.js gmBadge): a gold GM badge over the nameplate, the name in gold */
.gmbadge { align-self: center; margin-bottom: 2px; padding: 1px 8px 0; font: 700 11px/16px var(--serif); letter-spacing: .18em; text-indent: .18em; color: #1a1205; background: linear-gradient(#ffe79a, #f3c969 55%, #b07a1c); border: 1px solid #1a1205; box-shadow: 0 0 0 1px #f3c96988, 0 0 10px #f3c96999; text-shadow: 0 1px 0 #fff6; }
.nameplate.gm > div:not([class]) span, .oplate.gm > div:not([class]) span { color: #ffd84a; text-shadow: 0 1px 2px #000, 0 0 6px #f3c96988; }
/* a stacked item's sell price: each, or (Shift held) the whole stack */
.sellline .all { display: none; }
body.shift .sellline .each { display: none; }
body.shift .sellline .all { display: inline; color: var(--gold, #f3c969); }
/* the tab on the bottom edge that hides or shows the hotbar and the health bars */
#hudtoggle { display: none; position: fixed; left: 50%; bottom: calc(var(--tab-h, 0px) + 7px); transform: translateX(-50%); z-index: 16; width: 52px; height: 17px; padding: 0; align-items: center; justify-content: center; background: #0a0b0ee6; color: #c9b88a; border: 1px solid #8a7a52; border-bottom: 0; border-radius: 6px 6px 0 0; cursor: pointer; box-shadow: 0 -2px 8px #0008; }
#hudtoggle:hover { color: #f3c969; border-color: #c9a56a; }
#hudtoggle svg { transition: transform .2s; }
body.inplay #hudtoggle { display: flex; }
body.hudoff #hudtoggle svg { transform: rotate(180deg); }
body.hudoff #hotbar, body.hudoff #vitals, body.hudoff #vitals * { visibility: hidden !important; pointer-events: none !important; }
/* the worn fairy beside the health and SP bars (TOP's pet frame), and its card */
#vitals .fairyhud { position: absolute; right: calc(100% + 10px); bottom: 0; width: 172px; display: flex; gap: 6px; align-items: center; padding: 4px 6px 4px 4px; background: #0a0b0ee6; border: 1px solid #8a7a52; border-radius: 4px; box-shadow: 0 3px 10px #000a; color: #fff; cursor: pointer; pointer-events: auto; text-align: left; }
#vitals .fairyhud:hover { border-color: #c9a56a; }
#vitals .fairyhud.tired .fport { filter: grayscale(1) brightness(.7); }
.fairyhud .fport { position: relative; flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: #15171d; border: 1px solid #5a4f36; border-radius: 3px; }
.fairyhud .fport b { position: absolute; right: -4px; bottom: -5px; min-width: 18px; padding: 0 3px; font: 700 11px/16px var(--sans); text-align: center; color: #1a1408; background: #f3c969; border-radius: 8px; }
.fairyhud .fport em { position: absolute; left: -4px; top: -6px; padding: 0 3px; font: 700 9px/13px var(--sans); font-style: normal; color: #fff; background: #7a3fbf; border-radius: 6px; }
.fairyhud .fbars { flex: 1; min-width: 0; display: grid; gap: 3px; }
.fairyhud .fname { font: 600 11px/13px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e9dfc6; }
.fairyhud .fbar { position: relative; height: 10px; overflow: hidden; background: #000000b0; border: 1px solid #000; }
.fairyhud .fbar i { position: absolute; left: 0; top: 0; bottom: 0; }
.fairyhud .fbar.st i { background: linear-gradient(#7ad35a, #3f8f2c); }
.fairyhud .fbar.gr i { background: linear-gradient(#6fb6ff, #2f6fbf); }
.fairyhud .fbar small { position: relative; display: block; font: 600 8px/10px var(--sans); text-align: center; text-shadow: 0 1px 2px #000; }
@media (max-width: 900px) { #vitals .fairyhud { width: 48px; padding: 3px; right: calc(100% + 6px); } .fairyhud .fbars .fname, .fairyhud .fbar small { display: none; } .fairyhud .fport { width: 36px; height: 36px; } .fairyhud .fbars { position: absolute; left: 3px; right: 3px; bottom: -8px; } .fairyhud .fbar { height: 4px; } }
.fcbar { position: relative; height: 16px; margin: 6px 0; overflow: hidden; background: #000000b0; border: 1px solid #000; }
.fcbar i { position: absolute; left: 0; top: 0; bottom: 0; }
.fcbar.st i { background: linear-gradient(#7ad35a, #3f8f2c); } .fcbar.gr i { background: linear-gradient(#6fb6ff, #2f6fbf); }
.fcbar span { position: relative; display: block; font: 600 11px/16px var(--sans); text-align: center; color: #fff; text-shadow: 0 1px 2px #000; }
.fpts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 8px 0; }
.fpts div { display: grid; justify-items: center; padding: 4px 0; background: #ffffff0d; border: 1px solid #ffffff14; border-radius: 3px; }
.fpts b { font-size: 16px; color: #f3c969; } .fpts small { font-size: 10px; letter-spacing: .08em; opacity: .8; }
.fskills { margin: 4px 0 0; padding-left: 18px; } .fskills .none { list-style: none; margin-left: -18px; opacity: .7; }
.fmarry { display: grid; gap: 6px; margin: 4px 0; } .fmarry label { display: grid; gap: 2px; font-size: 11px; opacity: .9; }
.fmarry select { padding: 4px; background: #0d0f14; color: #e9dfc6; border: 1px solid #5a4f36; border-radius: 3px; font: inherit; font-size: 12px; }
/* the chat's command list, while typing "/" (js/online-ui.js) */
#chatcmds { max-height: 230px; overflow-y: auto; scrollbar-width: none; background: #0a0b0ef2; border: 1px solid #8a7a52; border-radius: 4px; box-shadow: 0 4px 14px #000b; padding: 3px; }
#chatcmds[hidden] { display: none; }
#chatcmds .cc { display: grid; grid-template-columns: auto 1fr auto; column-gap: 6px; align-items: baseline; padding: 4px 7px; border-radius: 3px; cursor: pointer; font-size: 12px; color: #e9dfc6; }
#chatcmds .cc b { color: #f3c969; } #chatcmds .cc i { font-style: normal; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chatcmds .cc em { font-style: normal; font: 700 9px/14px var(--sans); padding: 0 5px; color: #1a1408; background: #f3c969; border-radius: 3px; }
#chatcmds .cc small { grid-column: 1 / -1; opacity: .65; font-size: 11px; }
#chatcmds .cc.sel, #chatcmds .cc:hover { background: #ffffff14; }

/* a fairy's card (js/ui.js tipGear): TOP's five points, then Stamina and Growth, then its skills, each block set apart */
.fairytip { padding: 6px 0; border-bottom: 1px solid #ffffff14; }
.fairytip p { margin: 2px 0; }
.fairytip b { color: #f3e6c4; font-weight: 600; }
.fairytip p.no, .fairytip p.no b { color: #ff7b6b; }
/* TOP's blueprints (js/lifecraft.js): recipes on the card, and the making game */
.bplist { display: grid; gap: 8px; margin: 6px 0; }
.bprow { display: grid; gap: 4px; padding: 6px 8px; background: #ffffff0a; border: 1px solid #ffffff14; border-radius: 4px; }
.bpprod { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; } .bpprod small { grid-column: 2; opacity: .7; font-size: 11px; }
.bpmats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; } .bpmats span { display: inline-flex; align-items: center; gap: 3px; }
.bpmats .ok b { color: #9fd08a; } .bpmats .no b { color: #ff7b6b; }
.bprow .warn { color: #ffb37b; font-size: 11px; }
/* TOP's making windows (js/ui.js pLife): the original's 305 x 480 forms, every part placed as there, in this game's look */
.lfhead { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 8px; font-size: 12px; color: var(--muted); }
.lfhead b { color: var(--gold-hi); font-weight: 600; } .lfhead span { display: inline-flex; align-items: center; gap: 4px; }
.lfstage { position: relative; width: 100%; max-width: 340px; margin: 0 auto; aspect-ratio: 305 / 480; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 34%, #2a2416 0%, #15161b 55%, #0d0f13 100%); box-shadow: inset 0 0 0 1px #ffffff08, inset 0 0 40px #000a; }
.lfstage.crafting { background: radial-gradient(ellipse at 50% 40%, #2c1c14 0%, #16141a 55%, #0d0f13 100%); }
.lfstage.cooking { background: radial-gradient(ellipse at 50% 34%, #2c2014 0%, #17151a 55%, #0d0f13 100%); }
.lfthreads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lfthreads line { stroke: var(--gold-lo); stroke-width: 1.2; stroke-dasharray: 3 4; opacity: .8; }
.lfthreads circle { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: .45; }
.lfslot { position: absolute; width: 15.5%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; padding: 0; cursor: default;
  background: linear-gradient(#20242c, #111318); border: 1px solid #3a3f4a; border-radius: 5px; color: var(--text); box-shadow: 0 2px 6px #000a; }
.lfslot[data-act] { cursor: pointer; } .lfslot[data-act]:hover { border-color: var(--gold-hi); }
.lfslot.empty { border-style: dashed; background: #0d0f13cc; }
.lfslot.short { border-color: #a5463a; } .lfslot.ghost svg, .lfslot.ghost img { opacity: .35; filter: grayscale(1); }
.lfslot.product { width: 19%; border-color: var(--gold); background: radial-gradient(circle at 50% 40%, #3a3020, #14161b 70%); }
.lfslot.product.done { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 18px #f3c96988; animation: lfglow 1.2s ease-out; }
.lfslot.product.failed { border-color: #a5463a; box-shadow: 0 0 14px #a5463a66; }
.lfslot.pulse { animation: lfpulse 1.6s ease-in-out infinite; }
.lfslot .lfcap { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; white-space: nowrap; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: #8d897cbb; pointer-events: none; }
.lfslot .lfct { position: absolute; right: 2px; bottom: 0; font: 600 11px var(--sans); text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.lfslot .lfct.ok { color: #9fd08a; } .lfslot .lfct.no { color: #ff7b6b; }
.lfslot .lfpip { position: absolute; left: 3px; top: 1px; font: italic 700 9px var(--sans); color: #e9e3d2; text-shadow: 0 1px 2px #000; }
.lfslot .lfplus { font: 300 26px/1 var(--sans); color: var(--gold); font-style: normal; }
.lfbar { position: absolute; height: 2.9%; background: #07080a; border: 1px solid #000; border-radius: 3px; box-shadow: inset 0 0 0 1px #ffffff10; overflow: hidden; }
.lfbar b { display: block; height: 100%; background: linear-gradient(#8ee07a, #3f9c3a); box-shadow: 0 0 8px #6fd05a88; }
.lfstage.cooking .lfbar b { background: linear-gradient(90deg, #c0392b, #e8a33a 50%, #6fd05a); }
.lfstage .btn.lfbtn { position: absolute; height: 5.42%; min-height: 0; padding: 0; font-size: 12px; line-height: 1; } /* 26 px of 480, as the original's */
.lfgrade { position: absolute; font: 600 22px var(--serif); color: var(--gold-hi); text-shadow: 0 2px 6px #000; letter-spacing: .04em; }
.lfgrade.ok { color: #f3c969; } .lfgrade.no { color: #ff7b6b; }
.lfqty { position: absolute; display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.lfqty b { min-width: 22px; padding: 1px 4px; text-align: center; color: var(--text); background: #07080a; border: 1px solid var(--line); border-radius: 3px; }
.lfarrow { padding: 0 4px; font-size: 10px; color: var(--gold-hi); background: none; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.lfarrow:disabled { opacity: .35; cursor: default; }
.lfdie { position: absolute; aspect-ratio: 1; display: grid; place-items: center; font-size: 34px; line-height: 1; color: #f6f1e2; text-shadow: 0 2px 4px #000; }
.lfdie.big { color: #f3c969; } .lfdie.small { color: #9ec4ff; }
.lfsum { position: absolute; font-size: 12px; text-align: center; color: var(--text); }
.lfheat { position: absolute; height: 2.4%; border: 1px solid #000; border-radius: 3px;
  background: linear-gradient(90deg, #1f2a3a, #3a6a8a 45%, #f3a040 68%, #ffde7a 75%, #c0392b 80.5%, #5a1a1a); }
.lfheat em { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px #fff; }
.lfheat i { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 0 1px #000, 0 0 6px #fff; }
.lfheatnum { position: absolute; font: 600 13px var(--sans); color: var(--gold-hi); text-shadow: 0 1px 2px #000; }
.lfstatus { margin: 8px 0 4px; text-align: center; font-size: 12px; color: var(--muted); } .lfstatus.ok { color: #9fd08a; } .lfstatus.no { color: #ffb37b; }
.lfpick { display: flex; gap: 8px; width: 100%; margin: 4px 0; padding: 6px 8px; text-align: left; color: var(--text); background: #ffffff0a; border: 1px solid #ffffff14; border-radius: 4px; cursor: pointer; }
.lfpick:hover, .lfpick.on { border-color: var(--gold); } .lfpick span { display: grid; gap: 1px; } .lfpick small { opacity: .75; font-size: 11px; } .lfpick .warn { color: #ffb37b; opacity: 1; }
@keyframes lfpulse { 50% { border-color: var(--gold-hi); box-shadow: 0 0 12px #f3c96955; } }
@keyframes lfglow { from { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 40px #f3c969; } }
/* a blueprint's own slot: the blueprint, its product in the corner, its level */
.bpslot { position: relative; } .bpslot .bpicon { position: absolute; left: 2px; bottom: 2px; width: 20px; height: 20px; display: grid; place-items: center; background: #0d0f14d9; border: 1px solid #5a4f36; border-radius: 3px; }
.invtools .btn.on { border-color: #c9a56a; color: #f3c969; }
/* ---- guild emblems, titles, red names and enemies on nameplates (js/view.js guildTag / titleTag) ---- */
.nameplate .guildtag .emb { display: inline-block; margin-right: 4px; padding: 0 4px; font: 800 9px/13px var(--sans); color: #fff; border-radius: 3px; text-shadow: 0 1px 1px #0008; box-shadow: 0 0 0 1px #0009; vertical-align: 1px; }
.nameplate .titletag { font: italic 600 10px var(--serif); color: #ffd98a; letter-spacing: .06em; text-align: center; text-shadow: 0 1px 2px #000; }
.nameplate.red > div:not([class]) { color: #ff5a4a !important; }
.nameplate.war .guildtag { color: #ff8a6a; }
.nameplate.war .guildtag::after { content: ' ⚔'; color: #ff6a4a; }
/* ---- the social window's new parts: guild treasury, ranks, rankings ---- */
#social .subtabs { flex-wrap: wrap; }
#social .subtabs button { letter-spacing: .04em; min-width: 52px; }
#social .gbar { height: 6px; margin: 4px 0 8px; background: #000c; border: 1px solid #000; }
#social .gbar em { display: block; height: 100%; background: linear-gradient(#b9a6ff, #6a54c8); }
#social .gform { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
#social .gform input, #social .gform select { flex: 1 1 90px; min-width: 0; }
#social .gform input[type=color] { flex: 0 0 38px; height: 30px; padding: 0; }
#social .rk { font-size: 11px; padding: 1px 6px; border: 1px solid #ffffff22; color: #cfc6b0; }
#social .rk.leader { color: var(--gold-hi); border-color: var(--gold-lo); }
#social .rk.officer { color: #b9d8ff; border-color: #3f79c6; }
#social .emb { display: inline-block; padding: 0 5px; font: 800 10px/15px var(--sans); color: #fff; border-radius: 3px; margin-right: 6px; }
#social .boards { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
#social .boards button { padding: 4px 8px; font: 600 11px var(--sans); color: #a8a090; border: 1px solid #ffffff1a; }
#social .boards button.on { color: var(--gold-hi); border-color: var(--gold); }
#social table.rank { width: 100%; border-collapse: collapse; font: 500 13px var(--sans); color: var(--parch); }
#social table.rank td { padding: 4px 3px; border-bottom: 1px solid #ffffff0d; }
#social table.rank td.n { color: var(--gold-hi); width: 26px; }
#social table.rank tr.mine td { color: #fff; background: #ffffff0a; }
#social .titles { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; }
#social .titles button { padding: 4px 8px; font: italic 600 12px var(--serif); color: #ffd98a; border: 1px solid #ffffff1a; }
#social .titles button.on { border-color: var(--gold); background: #ffffff0f; }
#announce { position: fixed; left: 50%; top: calc(var(--bar-h, 34px) + 70px); transform: translateX(-50%); z-index: 60; max-width: min(720px, calc(100vw - 32px)); padding: 10px 22px; font: 700 16px var(--serif); letter-spacing: .06em; color: #ffe79a; text-align: center; background: var(--noise), #120d04f2; border: 1px solid var(--gold); box-shadow: 0 8px 30px #000c; pointer-events: none; transition: opacity .6s; }
#announce small { display: block; font: 500 11px var(--sans); color: #b9a98a; letter-spacing: .1em; }
/* ---- the Market: every open stall (js/stall.js openSearch) ---- */
#stallsearch.stallwin { width: min(600px, calc(100vw - 24px)); }
.mkst { padding: 8px 2px 10px; border-bottom: 1px solid #ffffff12; }
.mkhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font: 500 14px var(--sans); color: var(--parch); }
.mkhead b { color: #fff; font: 600 15px var(--serif); }
.mkhead small { color: #a8a090; }
.mkhead .sacts { margin-left: auto; }
.mkgoods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mkg { display: flex; flex-direction: column; align-items: center; width: 48px; }
.mkg .stsq { position: relative; width: 38px; height: 38px; display: grid; place-items: center; background: #ffffff0a; border: 1px solid var(--line); }
.mkg .stpr { font: 600 10.5px var(--sans); color: var(--gold-hi); margin-top: 2px; max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mkg .stct { position: absolute; right: 1px; bottom: 0; font: 700 10px var(--sans); color: #fff; text-shadow: 0 1px 2px #000; font-style: normal; }
/* an armour family's set bonus in a gear tooltip (js/sets.js) */
.setline { color: #9a937f; font-size: 12.5px; }
.setline span.on, .setline.on { color: #8ff0a6; }
.setline.on span:not(.on) { color: #7d786a; } /* a tier not reached yet (3 / 4 worn: the 4-piece line): grey, though the set itself is on */

/* curses over a foe's health bar (js/view.js drawFx): the icon of what laid each one, and the seconds it has left */
.efx { position: absolute; left: 50%; bottom: calc(100% + 16px); transform: translateX(-50%); display: flex; gap: 2px; pointer-events: none; }
.efx span { position: relative; width: 18px; height: 18px; border: 1px solid #000; box-shadow: 0 0 0 1px #c0392b99, 0 1px 3px #000; background: #000; }
.efx img { display: block; width: 100%; height: 100%; }
.efx em { position: absolute; left: 0; right: 0; bottom: -1px; font: 700 9px/1 var(--sans); font-style: normal; text-align: center; color: #fff; text-shadow: 0 0 2px #000, 0 1px 1px #000, 1px 0 1px #000, -1px 0 1px #000; }
.ebar.quest .efx { bottom: calc(100% + 40px); }
.nameplate .efx { bottom: calc(100% + 4px); }

/* The player's own marks on the M map (right-click) and the panel to make one */
.umarks { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.umark { position: absolute; transform: translate(-50%, -16px) scale(var(--inv)); transform-origin: 50% 16px; /* the icon's own middle on the spot (the name hangs below) */ display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: auto; cursor: context-menu; }
.umark .ui { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #0b0c0fe6; border: 2px solid #f3c969; box-shadow: 0 0 0 2px #0008, 0 2px 6px #000a; }
.umark em { font: 600 11px var(--sans); font-style: normal; color: #fff; white-space: nowrap; padding: 1px 6px; background: #0b0c0fd9; border-radius: 3px; text-shadow: 0 1px 0 #000; }
.markpanel { position: absolute; z-index: 40; width: 262px; }
.markpanel .inner { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.mkicons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.mkicons button { display: grid; place-items: center; height: 36px; background: #15171c; border: 1px solid #3a3d44; border-radius: 4px; cursor: pointer; }
.mkicons button.on { border-color: var(--gold-hi); box-shadow: 0 0 0 1px var(--gold-hi), 0 0 8px #f3c96966; background: #22201a; }
.markpanel input { width: 100%; box-sizing: border-box; padding: 6px 8px; font: 13px var(--sans); color: var(--parch); background: #0b0c0f; border: 1px solid #3a3d44; border-radius: 4px; }
.mkacts { display: flex; gap: 6px; }
.slot .lockmark { position: absolute; left: 2px; top: 2px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; background: #0b0c0fe0; box-shadow: 0 0 0 1px #6a5233; pointer-events: none; z-index: 2; } /* a locked item */
/* The bank as TOP's vault: the vault on the left (the panel's side column), your pack on the right, both in the
   Inventory's groups; squares are dragged from one to the other */
.pside[data-drop="vault"].over, .bankpack.over { box-shadow: inset 0 0 0 2px var(--gold-hi), 0 0 14px #f3c96955; border-radius: 4px; }
.vaultbox { min-height: 260px; }
.vaultbox.off, .bankpack.off { opacity: .55; pointer-events: none; }
.vaultempty { display: grid; place-items: center; min-height: 220px; border: 1px dashed #3a3d44; border-radius: 6px; text-align: center; padding: 12px; }
.bankpack { min-height: 120px; }
.banktip { margin: 6px 0 2px; font-size: 12px; }
.pside h3 small { font: 500 11px var(--sans); letter-spacing: 0; text-transform: none; color: #8f8a7c; margin-left: 6px; }
.bsq { cursor: grab; }
.bsq.dragging { opacity: .4; }
/* Gear the character cannot wear (level, class...): a red veil over the square */
.slot .nowear { position: absolute; inset: 0; border-radius: inherit; background: #c9302c55; box-shadow: inset 0 0 0 2px #d8443a; z-index: 1; }
/* The bank's vault: fifteen squares a row */
.pside.vaultside { width: auto; }
.pside.vaultside .vaultbox { max-height: 78vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #4a3f26 transparent; }
.pside.vaultside .slots { display: grid; grid-template-columns: repeat(15, 42px); gap: 4px; min-height: 0; }
.pside.vaultside .slots .slot { width: 42px; height: 42px; }
.pside.vaultside .vaultempty { width: 686px; }
/* A shop: your pack in the Inventory's groups */
.pside .packgroups { max-height: 66vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #4a3f26 transparent; }
.pside .packgroups .slots { gap: 6px; min-height: 0; }
.pside .packgroups .slot { width: 52px; height: 52px; }
.pside .packgroups .cat { margin-top: 8px; }
.pside .packgroups .cat:first-child { margin-top: 0; }
/* TOP's feeding cursor: fairy food picked from the pack, waiting for a fairy to be clicked */
body.feeding, body.feeding * { cursor: url(../assets/top/cursor/feed.png) 3 3, pointer !important; }
/* TOP's faces over a head (Ctrl+0..9): two frames side by side, flicking between them */
.nameplate .headface { position: absolute; bottom: calc(100% + 30px); left: 50%; width: 50px; height: 50px; margin-left: -25px; background: no-repeat 0 0 / 200% 100%; animation: headface .36s steps(1) infinite; transition: opacity .4s; pointer-events: none; }
.nameplate .headface.out { opacity: 0; }
@keyframes headface { 0% { background-position: 0 0; } 50% { background-position: 100% 0; } }
/* TOP's mid-screen text (a quest counting a kill or an item): bold red, a third of the way down, fading over 3 s */
#midtext { position: fixed; left: 50%; top: 33%; transform: translate(-50%, -50%); z-index: 60; pointer-events: none; white-space: nowrap; opacity: 0;
  font: 700 20px var(--sans); letter-spacing: .02em; color: rgb(240, 16, 0); text-shadow: 0 0 3px #000, 0 1px 2px #000, 0 0 8px #0009; }
/* The Skills page: each skill is its icon and its hotbar buttons; hovering the row shows the skill's card */
.skrow.icononly { justify-content: space-between; cursor: help; }
.skrow.icononly .acts { margin-left: auto; }
.skrow.icononly .slot { flex: none; display: grid; place-items: center; width: 56px; height: 56px; }
.skrow.icononly .info { flex: 1; min-width: 0; }
.skrow.icononly .info .t { font-size: 14.5px; }
.skrow.icononly .info .d { font-size: 12px; margin-top: 2px; }
.skrow:not(.known) .info .t { color: #a9a495; }
.skassign { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.skassign kbd { min-width: 20px; height: 20px; padding: 0 4px; font: 700 12px/18px var(--sans); text-align: center; color: #111; background: var(--gold-hi); border: 1px solid #000; border-radius: 4px; }
.slotbtns button.x { color: #c9c4b6; margin-left: 4px; }
/* TOP's guild list (frmConAsk in Client/scripts/lua/forms/NPC.lua): its own art and its own places, in pixels */
#glwin { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 47; width: 525px; height: 274px; background: url(../assets/top/ui/guildlist.png) 0 0 / 525px 274px no-repeat; font: 12px/1 Arial, Helvetica, sans-serif; color: #000; user-select: none; }
#glwin[hidden] { display: none; }
#glwin .gl-drag { position: absolute; left: 0; top: 0; width: 500px; height: 22px; cursor: move; }
#glwin .gl-title { position: absolute; left: 8px; top: 5px; font: bold 12px Arial, Helvetica, sans-serif; color: #000; text-shadow: 0 0 2px #fff, 0 0 2px #fff; pointer-events: none; }
#glwin button { position: absolute; padding: 0; border: 0; background-color: transparent; cursor: pointer; }
#glwin .gl-x { left: 506px; top: 3px; width: 14px; height: 14px; background: url(../assets/top/ui/PublicC.png) -116px -175px; }
#glwin .gl-x:hover { background-position: -130px -175px; }
#glwin .gl-sort { top: 37px; height: 26px; background-image: url(../assets/top/ui/SysBotton4.png); }
#glwin .gl-s-name { left: 14px; width: 102px; background-position: -24px -173px; }
#glwin .gl-s-name:hover { background-position: -126px -173px; }
#glwin .gl-s-n { left: 306px; width: 37px; background-position: -24px -200px; }
#glwin .gl-s-n:hover { background-position: -61px -200px; }
#glwin .gl-s-exp { left: 343px; width: 66px; background-position: -24px -228px; }
#glwin .gl-s-exp:hover { background-position: -90px -228px; }
#glwin .gl-apply { left: 220px; top: 250px; width: 41px; height: 19px; background: url(../assets/top/ui/SysBotton4.png) 0 0; }
#glwin .gl-apply:hover { background-position: -41px 0; }
#glwin .gl-apply:active { background-position: -82px 0; }
#glwin .gl-apply:disabled { background-position: -123px 0; cursor: default; }
#glwin .gl-no { left: 265px; top: 250px; width: 41px; height: 19px; background: url(../assets/top/ui/PublicC.png) 0 -20px; }
#glwin .gl-no:hover { background-position: -41px -20px; }
#glwin .gl-no:active { background-position: -82px -20px; }
#glwin .gl-list { position: absolute; left: 12px; top: 65px; width: 510px; height: 178px; overflow-y: auto; scrollbar-width: thin; }
#glwin .gl-row { display: grid; grid-template-columns: 102px 188px 38px 67px 101px; height: 17px; align-items: center; cursor: pointer; }
#glwin .gl-row span { padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#glwin .gl-row span:nth-child(3), #glwin .gl-row span:nth-child(4) { text-align: center; }
#glwin .gl-row:hover { background: #4aa0ff26; }
#glwin .gl-row.sel { background: #3d8cff59; }
#glwin .gl-none { margin: 70px 0 0; text-align: center; color: #335; }
@media (max-width: 560px) { #glwin { transform: translate(-50%, -50%) scale(.66); } }
/* A help message from TOP's scripts (HelpInfo: the first-login guide, quest hints): mid-screen, in the game's window look */
#helpbox { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 60; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 80px); display: flex; flex-direction: column; animation: hbIn .18s ease-out; }
#helpbox[hidden] { display: none; }
#helpbox .winbar { display: flex; align-items: center; gap: 10px; cursor: move; user-select: none; }
#helpbox .winbar span { flex: 1; }
#helpbox .hb-n { font: 500 11px var(--sans); letter-spacing: .08em; text-transform: none; color: #a9c4ea; }
#helpbox .x { font-size: 18px; line-height: 1; color: var(--parch); padding: 0 4px; cursor: pointer; }
#helpbox .hb-text { overflow-y: auto; padding: 16px 20px 6px; font: 500 13.5px/1.6 var(--sans); color: #e6dcc2; scrollbar-width: thin; scrollbar-color: #4a3f26 transparent; }
#helpbox .hb-text p { margin: 0 0 10px; }
#helpbox .hb-text p:first-child { font: 500 16px var(--serif); letter-spacing: .06em; color: var(--gold-hi); }
#helpbox .hb-foot { display: flex; justify-content: center; gap: 10px; padding: 8px 20px 16px; }
#helpbox .hb-foot .btn[hidden] { display: none; }
#helpbox .hb-foot .btn { min-width: 120px; justify-content: center; }
@keyframes hbIn { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
/* The sit hint (js/ui.js tickSitHint): a new character out of SP is shown their own character sitting down */
#sithint { position: fixed; left: 50%; top: 50%; z-index: 75; width: 290px; padding: 16px 18px 12px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: opacity .25s, transform .25s;
  background: linear-gradient(180deg, #1b2230f2, #0d0f13f5); border: 1px solid var(--gold-lo); border-radius: 6px; box-shadow: 0 10px 34px #000a, inset 0 0 0 1px #ffffff0a; color: var(--text); font: 14px/1.4 var(--sans); text-align: center; pointer-events: auto; }
#sithint.open { opacity: 1; transform: translate(-50%, -50%); }
#sithint .sh-x { position: absolute; top: 4px; right: 6px; width: 24px; height: 24px; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
#sithint .sh-x:hover { color: var(--parch); }
#sithint .sh-head { font: 700 19px var(--serif); letter-spacing: .06em; color: #8fc8ff; text-shadow: 0 0 10px #2a7be088; }
#sithint.done .sh-head { color: var(--green); text-shadow: 0 0 10px #45d39a66; }
#sithint .sh-stage { position: relative; height: 210px; margin: 8px 0 6px; border-radius: 4px; overflow: hidden; background: radial-gradient(ellipse at 50% 80%, #2a7be033, transparent 62%), radial-gradient(ellipse at 50% 92%, #45d39a22, transparent 45%); }
#sithint canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#sithint .sh-motes { position: absolute; inset: 0; pointer-events: none; }
#sithint .sh-motes i { position: absolute; bottom: 14%; width: 6px; height: 6px; border-radius: 50%; opacity: 0; animation: shMote 2.8s ease-out infinite; }
#sithint .sh-motes i:nth-child(odd) { background: #6fbcff; box-shadow: 0 0 8px #6fbcff; }
#sithint .sh-motes i:nth-child(even) { background: #45d39a; box-shadow: 0 0 8px #45d39a; }
#sithint .sh-motes i:nth-child(1) { left: 30%; animation-delay: 1.0s; } #sithint .sh-motes i:nth-child(2) { left: 40%; animation-delay: 1.4s; }
#sithint .sh-motes i:nth-child(3) { left: 52%; animation-delay: 1.8s; } #sithint .sh-motes i:nth-child(4) { left: 62%; animation-delay: 2.2s; }
#sithint .sh-motes i:nth-child(5) { left: 35%; animation-delay: 2.6s; } #sithint .sh-motes i:nth-child(6) { left: 57%; animation-delay: 3.0s; }
#sithint .sh-motes i:nth-child(7) { left: 46%; animation-delay: 3.4s; } #sithint .sh-motes i:nth-child(8) { left: 68%; animation-delay: 3.8s; }
@keyframes shMote { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: .9; } 100% { opacity: 0; transform: translateY(-110px) scale(1.1); } }
#sithint .sh-bars { display: grid; gap: 4px; margin: 0 6px 8px; }
#sithint .sh-bar { position: relative; height: 12px; border-radius: 2px; background: #0008; border: 1px solid #ffffff1a; overflow: hidden; }
#sithint .sh-bar b { position: absolute; inset: 0 auto 0 0; width: 8%; animation: shFill 7s linear infinite; }
#sithint .sh-bar.hp b { background: linear-gradient(180deg, #e0604c, #a3281a); animation-name: shFillHp; }
#sithint .sh-bar.sp b { background: linear-gradient(180deg, #5aa8ff, #1d58b8); }
#sithint .sh-bar span { position: absolute; inset: 0; font: 700 9px/12px var(--sans); letter-spacing: .14em; color: #fffc; }
@keyframes shFill { 0%, 14% { width: 6%; } 92%, 100% { width: 100%; } }
@keyframes shFillHp { 0%, 14% { width: 42%; } 80%, 100% { width: 100%; } }
#sithint .sh-text { margin: 0; font: 600 18px var(--sans); color: var(--parch); }
#sithint kbd { display: inline-block; min-width: 34px; padding: 2px 7px; margin: 0 2px; font: 700 13px var(--sans); color: #1a1408; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-radius: 3px; box-shadow: 0 2px 0 var(--gold-lo); animation: shKey 1.4s ease-in-out infinite; }
@keyframes shKey { 50% { transform: translateY(1px); box-shadow: 0 1px 0 var(--gold-lo), 0 0 12px #f3c96988; } }
#sithint .sh-sub { margin: 6px 0 12px; font-size: 13px; color: var(--muted); }
#sithint .sh-btns { display: flex; gap: 6px; }
#sithint .sh-btns button { flex: 1; padding: 9px 0; border-radius: 3px; border: 1px solid var(--line); background: var(--ink-3); color: var(--text); font: 600 14px var(--sans); cursor: pointer; }
#sithint .sh-btns button:hover { border-color: var(--gold-lo); color: var(--parch); }
#sithint .sh-btns .sh-sit { background: linear-gradient(180deg, #2a7be0, #17519c); border-color: #3d8ff0; color: #fff; }
#sithint.done .sh-btns, #sithint.done .sh-sub, #sithint.done .sh-never { visibility: hidden; }
#sithint .sh-never { margin-top: 8px; border: 0; background: none; color: var(--muted); font: 12px var(--sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
#sithint .sh-never:hover { color: var(--parch); }
@media (max-width: 600px) { #sithint { width: min(290px, calc(100vw - 32px)); } #sithint .sh-stage { height: 170px; } }
.nameplate .pbuffs { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 170px; }
.nameplate .pbuffs i { position: relative; display: block; transform: none; flex: none; width: 20px; height: 20px; border: 1px solid #6a5320; background: #000b; cursor: help; }
.nameplate .pbuffs i.bad { border-color: #b2352a; }
.nameplate .pbuffs i svg, .nameplate .pbuffs i img { display: block; width: 18px; height: 18px; }
.nameplate .pbuffs i small { position: absolute; left: -2px; right: -2px; bottom: -2px; font: 600 8.5px/1 var(--sans); text-align: center; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; letter-spacing: 0; }
.pbf i { cursor: help; }

/* ---- the Database: items, monsters, NPCs, resources (js/codex.js) ---- */
.dbwin { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 46; width: min(620px, calc(100vw - 24px)); height: min(760px, calc(100vh - 40px)); display: flex; flex-direction: column; }
.dbwin[hidden], #dbbtn[hidden] { display: none; }
#dbbtn { position: fixed; right: 168px; top: 192px; z-index: 11; }
.dbwin .winbar { display: flex; justify-content: space-between; align-items: center; flex: none; }
.dbwin .winbar .x { font-size: 18px; color: var(--parch); padding: 0 6px; }
.dbsearch { position: relative; flex: none; padding: 10px 14px 6px; }
.dbsearch .field { width: 100%; box-sizing: border-box; font-size: 16px; text-align: left; padding-left: 12px; }
.dbsugs { position: absolute; left: 14px; right: 14px; top: calc(100% - 4px); z-index: 3; max-height: 60vh; overflow-y: auto; background: #0d0f13f7; border: 1px solid var(--gold-lo); box-shadow: 0 14px 34px #000c; }
.dbsugs[hidden] { display: none; }
.dbsug, .dbrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; text-align: left; background: none; border: 0; border-bottom: 1px solid #ffffff0d; color: var(--parch); cursor: var(--cur-mouseon), pointer; }
.dbsug.on, .dbsug:hover, .dbrow:hover { background: #f3c96914; }
.dbsug u { text-decoration: none; color: var(--gold-hi); }
.dbsugnone { padding: 10px; color: #a8a090; font-size: 13px; }
.dbi { flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: #ffffff0a; border: 1px solid var(--line); }
.dbsug .dbi { width: 28px; height: 28px; }
.dbn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dbn b { font: 600 14px var(--sans); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbn small { font-size: 12px; color: #a8a090; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dbk { flex: none; font: 600 10px var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border: 1px solid var(--line); color: #c9c4b6; }
.dbk.item { color: #8fc7ff; border-color: #8fc7ff55; } .dbk.mob { color: #ff8a6b; border-color: #ff8a6b55; } .dbk.npc { color: #f3c969; border-color: #f3c96955; } .dbk.res { color: #8ff0a6; border-color: #8ff0a655; }
.dbwin .inner { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 14px; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.dbwin .note { font-size: 12.5px; color: #a8a090; }
.dbwin h5 { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 6px; font: 600 11px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.dbwin h5 span { font: 500 11px var(--sans); letter-spacing: 0; text-transform: none; color: #8d8676; }
.dbintro { display: flex; gap: 12px; padding: 14px 4px; } .dbintro b { font: 600 16px var(--serif); color: #fff; } .dbintro p { margin: 6px 0; font-size: 13.5px; color: var(--parch); line-height: 1.45; } .dbintro small { color: #a8a090; }
.dbchips, .dbtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.dbchips button, .dbtabs button { padding: 4px 10px; font: 600 12px var(--sans); color: var(--parch); background: #ffffff08; border: 1px solid var(--line); }
.dbchips button.on, .dbtabs button.on { color: #111; background: var(--gold-hi); border-color: var(--gold-hi); }
.dbnav { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 8px; }
.dbhead { display: flex; gap: 12px; align-items: flex-start; }
.dbbig { flex: none; width: 60px; height: 60px; display: grid; place-items: center; background: linear-gradient(#20242c, #111318); border: 1px solid var(--gold-lo); box-shadow: inset 0 0 0 2px #0a0b0e; }
.dbhead h4 { margin: 0; font: 600 18px var(--serif); color: #fff; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dbhead small { color: #a8a090; font-size: 12.5px; } .dbhead p { margin: 6px 0 0; font-size: 13px; color: var(--parch); }
.dblv { font: 700 11px var(--sans); padding: 1px 5px; border: 1px solid currentColor; }
.dblv.green { color: #8ff0a6; } .dblv.yellow { color: #f3e069; } .dblv.orange { color: #ffae5c; } .dblv.red { color: #ff6b5c; }
.dbstats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 10px; }
.dbstats div { padding: 5px 4px; text-align: center; background: #ffffff08; border: 1px solid var(--line); } .dbstats small { display: block; font-size: 10.5px; color: #a8a090; } .dbstats b { font: 600 13px var(--sans); color: #fff; font-variant-numeric: tabular-nums; }
.dbpc { flex: none; min-width: 58px; text-align: right; font: 700 14px var(--sans); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.dbpr { flex: none; display: flex; align-items: center; gap: 4px; font: 600 13px var(--sans); color: var(--gold-hi); }
.dbmore { width: 100%; padding: 8px; margin-top: 4px; font: 600 12.5px var(--sans); color: var(--gold-hi); background: #ffffff06; border: 1px dashed var(--line); }
.dbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.dbcell { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px; background: none; border: 0; color: var(--parch); cursor: var(--cur-mouseon), pointer; }
.dbcell .dbsq { position: relative; width: 48px; height: 48px; display: grid; place-items: center; background: linear-gradient(#20242c, #111318); border: 1px solid var(--gold-lo); }
.dbcell:hover .dbsq { border-color: var(--gold-hi); }
.dbcell.quest .dbsq { border-color: #8fc7ff; }
.dbch { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font: 700 10.5px var(--sans); font-style: normal; color: #fff; background: #000b; text-shadow: 0 1px 2px #000; }
.dbcell small { width: 100%; font-size: 11px; line-height: 1.2; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dbcell em { font: 600 11px var(--sans); font-style: normal; color: var(--gold-hi); }
.dbmap { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 10px auto 6px; overflow: hidden; background: #0b1418; border: 1px solid var(--gold-lo); }
.dbmapin { position: absolute; }
.dbmapin img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: .9; }
.dbspot { position: absolute; width: max(14px, var(--d)); aspect-ratio: 1; transform: translate(-50%, -50%); padding: 0; background: #ff6b5c33; border: 2px solid #ff6b5c; border-radius: 50%; box-shadow: 0 0 8px #ff6b5c88; cursor: var(--cur-mouseon), pointer; }
.dbspot.fix { width: 12px; background: #f3c969; border: 2px solid #1a1206; box-shadow: 0 0 8px #f3c969aa; }
.dbspot:hover { border-color: #fff; }
.dbme { position: absolute; width: 10px; height: 10px; transform: translate(-50%, -50%); background: #6fdcff; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 10px #6fdcff; }
.dbmapname { position: absolute; left: 6px; top: 4px; font: 600 11px var(--serif); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-hi); text-shadow: 0 1px 3px #000; }
.dbmapacts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .dbmapacts small { color: #8d8676; font-size: 11.5px; }
.dbregs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; margin-top: 8px; }
.dbreg { display: flex; flex-direction: column; padding: 5px 8px; text-align: left; color: var(--parch); background: #ffffff06; border: 1px solid var(--line); cursor: var(--cur-mouseon), pointer; }
.dbreg b { font: 600 13px var(--sans); color: #fff; } .dbreg small { font-size: 11.5px; color: #a8a090; }
.dbreg:hover { border-color: var(--gold-lo); }
body.mapopen .dbwin { display: none !important; }
@media (max-width: 900px) {
  .dbwin { width: calc(100vw - 12px); height: calc(100dvh - var(--bar-h, 34px) - 16px); top: calc(var(--bar-h, 34px) + 8px); transform: translateX(-50%); }
  .dbstats { grid-template-columns: repeat(3, 1fr); }
  .dbsug, .dbrow { min-height: 48px; }
  .dbmap { width: min(100%, 40vh); }
  .dbmapacts .btn { min-height: 40px; }
}
