:root {
  --ink: #efe6d2; --dim: #b3a88f; --muted: #7d7462;
  --panel: rgba(20, 18, 24, 0.86); --panel-solid: #17151b; --edge: #5a4a2e; --gold: #e2b65a; --gold-dim: #9c7a35;
  --hp: #c2413a; --hp-dark: #5e1b18; --xp: #6d4fc4; --mob: #a83228;
  --serif: Georgia, 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0c10; color: var(--ink); font: 14px/1.4 var(--sans); user-select: none; }
canvas#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: crosshair; background: transparent; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }

/* Login */
.screen { position: fixed; inset: 0; display: grid; place-items: center start; padding: 24px 5vw; z-index: 50; overflow: auto; background: #0d0c10; isolation: isolate; }
.screen::before { content: ''; position: fixed; inset: -2%; z-index: -2; background: url('login-bg.jpg') center 40% / cover no-repeat; animation: drift 40s ease-in-out infinite alternate; }
.screen::after { content: ''; position: fixed; inset: 0; z-index: -1; background:
  linear-gradient(270deg, rgba(10,9,14,0) 55%, rgba(10,9,14,.18) 80%, rgba(10,9,14,.3) 100%),
  linear-gradient(0deg, rgba(10,9,14,.25) 0%, rgba(10,9,14,0) 25%); }
@keyframes drift { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.09) translate(-1.2%, -0.8%); } }
@media (prefers-reduced-motion: reduce) { .screen::before { animation: none; } }
.screen .login-card { width: min(500px, 100%); background: rgba(18, 16, 22, .22); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); box-shadow: 0 0 0 1px rgba(226,182,90,.35), 0 20px 60px rgba(0,0,0,.25); border-color: rgba(226,182,90,.5); }
.screen .login-card, .screen .login-card label, .screen .login-card .cls-title, .screen .login-card .hint, .screen .login-card .tag { text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 10px rgba(0,0,0,.6); }
.screen .login-card label, .screen .login-card .cls-title { color: #efe6d2; }
.screen .login-card .hint { color: #d8cfbb; }
.screen input { background: rgba(10, 9, 14, .35); border-color: rgba(226,182,90,.35); }
.screen input::placeholder { color: rgba(239,230,210,.7); }
.screen .cls { background: rgba(10, 9, 14, .28); border-color: rgba(226,182,90,.3); }
.screen .cls small { color: #e6dcc6; }
.screen .cls.sel { background: rgba(60, 44, 16, .45); border-color: var(--gold); }
.screen .btn.primary { background: rgba(42, 34, 20, .55); }
@media (max-width: 900px) { .screen { place-items: center; padding: 16px; } .screen::after { background: rgba(10,9,14,.25); } }
.login-card { width: min(560px, 100%); background: var(--panel-solid); border: 1px solid var(--edge); box-shadow: 0 0 0 4px #0d0c10, 0 0 0 5px var(--gold-dim), 0 30px 80px rgba(0,0,0,.6); padding: 28px 28px 20px; border-radius: 4px; }
.crest { text-align: center; color: var(--gold); font-size: 28px; }
h1 { font-family: var(--serif); font-weight: normal; letter-spacing: .06em; text-align: center; margin: 4px 0 2px; font-size: 30px; color: var(--gold); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.tag { text-align: center; color: var(--dim); margin: 0 0 20px; font-style: italic; font-family: var(--serif); }
label { display: block; color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; background: #0f0e12; border: 1px solid #3a3326; color: var(--ink); font: 15px var(--sans); border-radius: 3px; outline: none; user-select: text; }
input:focus { border-color: var(--gold-dim); }
.cls-title { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 4px 0 6px; }
.cls-title span { text-transform: none; letter-spacing: 0; color: var(--muted); }
.classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.cls { border: 1px solid #3a3326; background: #0f0e12; border-radius: 3px; padding: 10px; cursor: pointer; text-align: left; }
.cls canvas { display: block; margin: 0 auto 4px; }
.cls b { display: block; font-family: var(--serif); font-size: 16px; font-weight: normal; text-align: center; }
.cls small { display: block; color: var(--dim); font-size: 11.5px; line-height: 1.35; margin-top: 4px; }
.cls.sel { border-color: var(--gold); background: #1f1a12; }
.btn { cursor: pointer; border: 1px solid var(--gold-dim); background: #2a2214; color: var(--gold); padding: 8px 14px; border-radius: 3px; }
.btn:hover { background: #3a2e18; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { width: 100%; padding: 12px; font-family: var(--serif); font-size: 17px; letter-spacing: .05em; }
.err { color: #ff8a7a; min-height: 20px; margin-top: 8px; text-align: center; }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 8px 0 0; }
@media (max-width: 520px) { .classes { grid-template-columns: 1fr; } }

/* HUD */
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui .panel, #ui #chat, #ui #bar, #ui .window { pointer-events: auto; }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.ph { font-family: var(--serif); color: var(--gold); font-size: 13px; letter-spacing: .04em; margin-bottom: 4px; }
.ph span { color: var(--muted); font-family: var(--sans); font-size: 11px; }
#topLeft { position: absolute; left: 12px; top: 12px; width: 250px; padding: 10px; }
.me-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-family: var(--serif); font-size: 15px; }
.lvl { color: var(--gold); font-size: 12px; font-family: var(--sans); }
.bar { position: relative; height: 16px; background: #0b0a0d; border: 1px solid #2c2620; border-radius: 2px; margin-bottom: 5px; overflow: hidden; }
.bar > div { position: absolute; inset: 0 auto 0 0; transition: width .15s; }
.bar.hp > div { background: linear-gradient(#d65a50, var(--hp) 50%, #8f2c26); }
.bar.mob > div { background: linear-gradient(#c24a3e, var(--mob) 50%, #6b1e18); }
.bar.xp { height: 9px; } .bar.xp > div { background: linear-gradient(#8a6ce0, var(--xp)); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 15px; text-shadow: 0 1px 2px #000; }
.bar.xp span { font-size: 9px; line-height: 8px; }
.gold-row { display: flex; align-items: center; gap: 6px; color: var(--gold); font-size: 13px; }
.coin { width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe7a0, #d4a03a 60%, #8a6420); display: inline-block; }
#targetFrame { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 280px; padding: 8px 10px; }
#zoneBanner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-family: var(--serif); font-size: 34px; color: var(--gold); text-shadow: 0 2px 12px #000, 0 0 2px #000; opacity: 0; transition: opacity .8s; letter-spacing: .06em; white-space: nowrap; }
#zoneBanner.show { opacity: 1; }
#zoneBanner small { display: block; font-size: 15px; color: var(--ink); letter-spacing: .04em; text-align: center; margin-top: 2px; }
#zoneBanner small.disc { color: #9fe0ff; font-size: 13px; text-transform: uppercase; letter-spacing: .2em; margin: 0 0 2px; }
#topRight { position: absolute; right: 12px; top: 12px; width: 204px; display: flex; flex-direction: column; gap: 8px; }
.mm { padding: 5px; } .mm canvas { display: block; width: 192px; height: 144px; image-rendering: pixelated; border-radius: 2px; }
#zoneName { text-align: center; font-family: var(--serif); color: var(--dim); font-size: 12px; margin-top: 3px; }
#questBox, #lbBox { padding: 8px 10px; font-size: 12.5px; }
#questText { color: var(--ink); }
#questText .prog { color: var(--gold); }
#questText .sub { color: var(--muted); font-size: 11.5px; }
#lb { margin: 0; padding-left: 18px; color: var(--dim); font-size: 12px; }
#lb li.me { color: var(--gold); }
#lb .c { color: var(--muted); }

#chat { position: absolute; left: 12px; bottom: 12px; width: min(380px, 40vw); }
#chatLog { height: 170px; overflow-y: auto; padding: 6px 8px; font-size: 12.5px; background: linear-gradient(transparent, rgba(10,9,12,.65) 20%); border-radius: 4px 4px 0 0; scrollbar-width: thin; text-shadow: 0 1px 2px #000; }
#chatLog div { margin: 1px 0; word-wrap: break-word; }
#chatLog .sys { color: #d8c27a; font-style: italic; }
#chatLog .who { font-weight: 600; }
#chatIn { margin: 0; background: rgba(10,9,12,.8); border-color: #2c2620; font-size: 13px; padding: 7px 9px; }

#bar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; padding: 6px; background: var(--panel); border: 1px solid var(--edge); border-radius: 5px; }
.slot { position: relative; width: 52px; height: 52px; background: radial-gradient(circle at 50% 35%, #2c2533, #121016); border: 1px solid #4a3e2a; border-radius: 4px; cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.slot:hover { border-color: var(--gold); }
.slot.small { width: 40px; }
.slot .ico { font-size: 24px; color: var(--ink); font-variant-emoji: text; }
.slot .key { position: absolute; left: 3px; top: 1px; font-size: 10px; color: var(--dim); }
.slot .count { position: absolute; right: 3px; bottom: 1px; font-size: 11px; color: var(--ink); text-shadow: 0 1px 2px #000; }
.slot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,.72) calc(var(--p, 0) * 1turn), transparent 0); pointer-events: none; }
.slot .cd span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 600; text-shadow: 0 1px 3px #000; }
.slot.flash { box-shadow: inset 0 0 12px var(--gold); }
#tooltip { position: absolute; max-width: 240px; padding: 8px 10px; background: var(--panel-solid); border: 1px solid var(--edge); border-radius: 3px; font-size: 12.5px; pointer-events: none; z-index: 30; }
#tooltip b { color: var(--gold); font-family: var(--serif); font-weight: normal; font-size: 14px; }
#tooltip .m { color: var(--muted); font-size: 11.5px; }

.window { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 140px); overflow: auto; padding: 0 14px 14px; z-index: 20; }
.wh { display: flex; justify-content: space-between; align-items: center; font-family: var(--serif); color: var(--gold); font-size: 17px; padding: 10px 0 8px; border-bottom: 1px solid #3a3326; margin-bottom: 10px; position: sticky; top: 0; background: var(--panel-solid); }
.x { background: none; border: none; color: var(--dim); font-size: 22px; cursor: pointer; line-height: 1; }
#inv { left: auto; right: 228px; top: 12px; transform: none; width: 340px; }
.eq { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.eqslot { border: 1px solid #3a3326; border-radius: 3px; padding: 6px 8px; background: #0f0e12; cursor: pointer; min-height: 46px; }
.eqslot .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.eqslot .v { font-size: 13px; }
.stats { display: flex; gap: 12px; color: var(--dim); font-size: 12px; margin-bottom: 8px; }
.stats b { color: var(--ink); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.cell { aspect-ratio: 1; border: 1px solid #2f2920; background: #0f0e12; border-radius: 3px; position: relative; cursor: pointer; display: grid; place-items: center; }
.cell:hover { border-color: var(--gold-dim); }
.cell canvas { width: 36px; height: 36px; }
.cell .n { position: absolute; right: 3px; bottom: 1px; font-size: 11px; text-shadow: 0 1px 2px #000; }
.note { color: var(--muted); font-size: 11px; margin-top: 8px; }
.q-reward { color: var(--gold); font-size: 13px; margin: 8px 0; }
.dlg-text { font-family: var(--serif); font-size: 15px; line-height: 1.5; margin: 4px 0 12px; }
.shoprow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #241f19; }
.shoprow canvas { width: 30px; height: 30px; flex: none; }
.shoprow .nm { flex: 1; }
.shoprow .nm small { display: block; color: var(--muted); font-size: 11px; }
.shoprow .btn { padding: 4px 10px; font-size: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.tabs .btn.on { background: var(--gold-dim); color: #140f08; }
.helpbody p { margin: 0 0 9px; color: var(--dim); } .helpbody b { color: var(--ink); }
#death { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(40, 0, 0, .45); text-align: center; pointer-events: none; }
#death h2 { font-family: var(--serif); font-weight: normal; color: #ff9a8a; font-size: 38px; margin: 0 0 6px; text-shadow: 0 2px 10px #000; }
#death p { color: var(--ink); margin: 4px; text-shadow: 0 1px 4px #000; }
#death .btn { pointer-events: auto; margin-top: 10px; }
@media (max-width: 760px) { #topRight { width: 150px; } .mm canvas { width: 140px; height: 105px; } #lbBox { display: none; } #topLeft { width: 190px; } #inv { right: 50%; top: 50%; transform: translate(50%, -54%); } #chat { width: 46vw; } #chatLog { height: 110px; } }

#help .seg { vertical-align: middle; margin-left: 8px; } #help .seg button { padding: 4px 10px; font-size: 12px; }
/* Character builder */
#builder { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center start; padding: 16px 5vw; cursor: grab; }
#builder:active { cursor: grabbing; }
.bpanel { width: min(500px, 100%); max-height: calc(100vh - 32px); overflow: auto; cursor: default; padding: 20px 24px 16px; border: 1px solid rgba(226,182,90,.5); border-radius: 4px;
  background: rgba(18, 16, 22, .58); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 20px 60px rgba(0,0,0,.35); scrollbar-width: thin; }
.bpanel h1 { font-size: 26px; }
.bpanel .tag { margin-bottom: 12px; }
.bsec { margin-bottom: 12px; }
.bh { color: var(--ink); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; text-shadow: 0 1px 3px #000; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.opts.three { grid-template-columns: repeat(3, 1fr); }
.opt { text-align: left; cursor: pointer; padding: 8px 10px; border: 1px solid rgba(226,182,90,.28); background: rgba(10,9,14,.4); border-radius: 3px; color: var(--ink); font: inherit; }
.opt:hover { border-color: var(--gold-dim); }
.opt.sel { border-color: var(--gold); background: rgba(60,44,16,.55); }
.opt b { display: block; font: normal 15px var(--serif); }
.opt small { display: block; color: #d8cfbb; font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
.opt em { display: block; color: var(--gold); font-style: normal; font-size: 11px; margin-top: 3px; }
.seg { display: inline-flex; border: 1px solid rgba(226,182,90,.35); border-radius: 3px; overflow: hidden; }
.seg button { cursor: pointer; padding: 7px 18px; background: rgba(10,9,14,.4); border: 0; color: var(--ink); font: inherit; }
.seg button + button { border-left: 1px solid rgba(226,182,90,.35); }
.seg button.sel { background: rgba(60,44,16,.65); color: var(--gold); }
.looks { display: grid; grid-template-columns: auto 1fr; gap: 20px; }
.sw { display: flex; flex-wrap: wrap; gap: 6px; }
.sw button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0,0,0,.5); cursor: pointer; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.sw button.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(226,182,90,.45); }
.bstats { display: flex; gap: 14px; color: #d8cfbb; font-size: 12.5px; padding: 8px 10px; background: rgba(10,9,14,.4); border-radius: 3px; margin-bottom: 12px; }
.bstats b { color: var(--ink); }
.bbtns { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.bbtns .btn.primary { width: auto; }
.bhint { position: fixed; right: 24px; bottom: 18px; color: var(--ink); font-size: 12px; text-shadow: 0 1px 3px #000; pointer-events: none; opacity: .85; }
@media (max-width: 900px) { #builder { place-items: end center; padding: 10px; } .bpanel { max-height: 62vh; } .opts.three { grid-template-columns: 1fr; } .bhint { top: 14px; bottom: auto; } }

/* Controller support */
.padfocus { outline: 3px solid #f2c94c !important; outline-offset: 2px; box-shadow: 0 0 14px rgba(242,201,76,.75) !important; }
i.g, .key.g { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; font: 700 10px/1 var(--sans); font-style: normal; color: #fff; background: #3a3a44; text-shadow: none; vertical-align: middle; margin-right: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.gA { background: #3aa54a !important; } .gB { background: #d0393b !important; } .gX { background: #2f6fd0 !important; } .gY { background: #d8a92a !important; color: #1a1408 !important; }
.gLB, .gRB, .gLT, .gRT, .gV, .gM, .gS { background: #4a4a58 !important; border-radius: 5px !important; }
.slot .key.g { position: absolute; left: 2px; top: 2px; margin: 0; min-width: 16px; height: 16px; font-size: 9px; }
#padHint { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 14px; padding: 6px 12px; border-radius: 16px; background: rgba(20,18,24,.72); border: 1px solid var(--edge); color: var(--ink); font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 60; }
#padHint.top { position: fixed; top: 14px; bottom: auto; }
#padHint span { display: inline-flex; align-items: center; }
.ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.ctrl .ch { font-family: var(--serif); color: var(--gold); font-size: 14px; margin-bottom: 4px; }
.ctrl p { font-size: 12px; margin: 0 0 5px; }
#help.window { width: min(640px, calc(100vw - 32px)); }
@media (max-width: 700px) { .ctrl { grid-template-columns: 1fr; } }

/* Crown Store */
.crown-row { display: inline-flex; align-items: center; gap: 5px; color: #9fd8ff; font-size: 13px; margin-left: 10px; transition: transform .2s; }
.crown-row.pulse { transform: scale(1.35); color: #fff; }
.gem { width: 11px; height: 11px; display: inline-block; transform: rotate(45deg); background: linear-gradient(135deg, #e8f8ff, #59b8f0 55%, #1f5a9a); box-shadow: 0 0 6px rgba(120, 200, 255, .6); }
.gem.big { width: 18px; height: 18px; margin: 0 8px 0 6px; flex: none; }
#boost { margin-top: 4px; font-size: 12px; color: #ffd86a; text-shadow: 0 1px 2px #000; }
#store.window { width: min(440px, calc(100vw - 32px)); }
.shoprow .m { color: var(--muted); font-size: 11px; }
.shoprow .btn.on { background: var(--gold-dim); color: #140f08; }
.shoprow.pack .btn { min-width: 76px; font-weight: 600; }
.shoprow .tag { color: #9fd8ff; }
.store-msg { font-size: 12.5px; color: var(--dim); background: #0f0e12; border: 1px solid #2f2920; border-radius: 3px; padding: 7px 9px; margin-bottom: 8px; }
.store-msg.test { color: #ffcf6a; border-color: #7a5a1a; }
.store-msg .ok { color: #7dff8a; } .store-msg .bad { color: #ff8a7a; } .store-msg a { color: var(--gold); }

/* world map and waystones */
#worldmap.window { width: min(1800px, calc(100vw - 24px), calc((100vh - 170px) * 2.222 + 30px)); max-height: calc(100vh - 20px); }
#mmBox { cursor: pointer; } #mmBox:hover { border-color: #c8963a; } .mm-hint { font-size: 10px; color: var(--muted); text-align: center; margin-top: 1px; opacity: .75; } #mmBox:hover .mm-hint { color: var(--gold); opacity: 1; }
#wmCanvas { cursor: zoom-out; }
#wmCanvas { width: 100%; height: auto; display: block; border: 1px solid #3a3326; border-radius: 3px; image-rendering: pixelated; }
.ways .ph { margin-top: 8px; }

/* the Bestiary book */
#bestiary.window { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
#bookFrame { width: 100%; height: min(440px, calc(100vh - 220px)); border: 1px solid #3a3326; border-radius: 3px; background: #14121a; display: block; }
.booknav { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.booknav span { flex: 1; text-align: center; color: var(--dim); font-size: 13px; }

.modenote { text-align: center; color: var(--dim); font-size: 12px; margin-top: 6px; min-height: 1em; }
#hquestText:not(:empty) { margin-top: 8px; padding-top: 7px; border-top: 1px solid #3a3326; }

/* Halloween event items in the Crown Store */
.event-head { margin: 4px 0 8px; padding: 9px 12px; border: 1px solid #ff8a2a; border-radius: 4px; background: linear-gradient(90deg, rgba(255,122,30,.22), rgba(150,60,220,.18)); color: #ffb45a; font-family: var(--serif); font-size: 15px; letter-spacing: .03em; }
.event-head small { display: block; color: #e8d8f0; font-family: var(--sans); font-size: 12px; letter-spacing: 0; margin-top: 2px; }
.event-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: #ff7a1e; color: #1a0e14; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 2px; }

/* game owners: glowing gold names in chat and the hero list */
.gm { color: #ffd24a !important; font-weight: 700; text-shadow: 0 0 6px rgba(255,190,40,.9), 0 0 14px rgba(255,170,20,.6) !important; animation: gmglow 2s ease-in-out infinite; }
@keyframes gmglow { 50% { text-shadow: 0 0 10px rgba(255,210,70,1), 0 0 22px rgba(255,170,20,.85); } }
.gmbadge { display: inline-block; padding: 0 5px; border-radius: 3px; background: #ffb81e; color: #2a1400 !important; font: 800 9.5px system-ui, sans-serif; letter-spacing: .04em; vertical-align: 1px; box-shadow: 0 0 8px rgba(255,190,40,.8); text-shadow: none; }
.gmline { background: linear-gradient(90deg, rgba(255,184,30,.14), rgba(255,184,30,0)); border-radius: 3px; }

/* shop categories and upgrade hints */
.shopcats { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 8px; }
.chip { border: 1px solid #4a3f2c; background: #16141a; color: var(--dim); border-radius: 12px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--gold-dim); }
.chip.on { background: rgba(226,182,90,.18); color: var(--gold); border-color: var(--gold); }
.shoprow .up { color: #7ad86a; font-weight: 600; }
.shoprow .bad { color: #d86a5a; }
.eqslot .v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* awards */
#awards.window { width: min(520px, calc(100vw - 32px)); }
.aw-head { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 0 6px; color: var(--dim); }
.aw-head b { color: var(--ink); }
.aw-pts { color: var(--gold); font-family: var(--serif); font-size: 17px; } .aw-pts span { color: var(--muted); font-size: 12px; }
.aw-bar, .aw-prog { position: relative; height: 6px; background: #0f0e12; border: 1px solid #3a3326; border-radius: 4px; overflow: hidden; margin-bottom: 10px; }
.aw-bar i, .aw-prog i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #9c7a35, #e2b65a); }
.aw-title { margin: -2px 0 10px; font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 8px; } .aw-title b { color: #e8c87a; font-family: var(--serif); font-style: italic; }
.chip .m { color: var(--muted); font-size: 10.5px; }
.aw-list { display: flex; flex-direction: column; gap: 6px; }
.aw { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid #2e2920; border-radius: 4px; background: #121015; opacity: .82; }
.aw.done { opacity: 1; border-color: #6a5528; background: linear-gradient(90deg, rgba(226,182,90,.12), rgba(226,182,90,.02)); }
.aw-ico { font-size: 22px; width: 30px; text-align: center; filter: grayscale(1) brightness(.7); } .aw.done .aw-ico { filter: drop-shadow(0 0 6px rgba(255,200,80,.7)); }
.aw-main { flex: 1; min-width: 0; }
.aw-nm { color: var(--ink); font-weight: 600; } .aw.done .aw-nm { color: var(--gold); }
.aw-desc { color: var(--dim); font-size: 12px; margin-bottom: 3px; }
.aw-prog { height: 13px; margin: 3px 0 3px; } .aw-prog span { position: relative; display: block; text-align: center; font-size: 9.5px; line-height: 12px; color: #fff; text-shadow: 0 1px 2px #000; }
.aw-rw { font-size: 11px; color: #a8946a; }
.aw .btn { flex: none; font-size: 12px; padding: 4px 9px; }
#awardToast { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 70; display: flex; gap: 12px; align-items: center; padding: 10px 18px 10px 14px; min-width: 300px; max-width: calc(100vw - 32px);
  background: linear-gradient(180deg, rgba(40,30,12,.95), rgba(20,16,10,.95)); border: 1px solid #e2b65a; border-radius: 6px; box-shadow: 0 0 0 3px rgba(0,0,0,.5), 0 0 28px rgba(226,182,90,.45); pointer-events: none; }
#awardToast.show { animation: awIn .5s cubic-bezier(.2,1.4,.4,1) both, awOut .6s ease 4.6s both; }
@keyframes awIn { from { opacity: 0; transform: translate(-50%, -18px) scale(.9); } }
@keyframes awOut { to { opacity: 0; transform: translate(-50%, -10px); } }
#awardToast .at-ico { font-size: 30px; filter: drop-shadow(0 0 8px rgba(255,200,80,.9)); }
#awardToast .at-k { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #c8a868; }
#awardToast .at-nm { font-family: var(--serif); font-size: 19px; color: #ffd98a; }
#awardToast .at-d { font-size: 12px; color: #e8dcc0; }

/* fishing & cooking */
#actHint { position: fixed; left: 50%; bottom: 98px; transform: translateX(-50%); z-index: 40; padding: 6px 14px; border-radius: 16px; background: rgba(16,14,20,.82); border: 1px solid #5a4a2e; color: var(--ink); font-size: 13px; pointer-events: auto; cursor: pointer; white-space: nowrap; }
#actHint span { color: var(--muted); margin-left: 8px; font-size: 11.5px; }
#actHint b.bite { color: #ffdc5a; animation: bitePulse .35s ease-in-out infinite alternate; }
@keyframes bitePulse { to { color: #ff8a3a; } }
#fishGame { position: fixed; right: max(16px, calc(50% - 340px)); top: 50%; transform: translateY(-50%); z-index: 60; width: 150px; padding: 10px; text-align: center; pointer-events: auto; user-select: none; }
#fishGame canvas { display: block; margin: 6px auto; width: 110px; height: 300px; }
#fishGame .fg-title { font-family: var(--serif); color: var(--gold); font-size: 15px; }
#fishGame .fg-hint { font-size: 11px; color: var(--dim); line-height: 1.35; }
#buff { margin-top: 4px; font-size: 12px; color: #ffc88a; cursor: default; }
#cook.window { width: min(560px, calc(100vw - 32px)); }
.sk-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; color: var(--dim); } .sk-row b { color: var(--gold); } .aw-bar.sk { flex: 1; margin: 0; }
.ck-only { display: flex; gap: 6px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 12.5px; margin-bottom: 8px; color: var(--dim); } .ck-only input { width: auto; margin: 0; }
.ck-list { display: flex; flex-direction: column; gap: 6px; }
.ck { display: flex; gap: 10px; align-items: center; padding: 7px 9px; border: 1px solid #2e2920; border-radius: 4px; background: #121015; }
.ck.ready { border-color: #5a6a30; background: linear-gradient(90deg, rgba(140,200,80,.09), rgba(0,0,0,0)); }
.ck-ico canvas { width: 30px; height: 30px; } .ck-main { flex: 1; min-width: 0; } .ck-nm { color: var(--ink); font-weight: 600; } .ck-nm .bad { color: #d86a5a; font-weight: 400; font-size: 11.5px; margin-left: 6px; }
.ck-ing { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; } .ing { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #1e1a14; border: 1px solid #3a3326; } .ing.ok { color: #9ad87a; border-color: #4a6a30; } .ing.no { color: #c88a7a; }
.ck-fx { font-size: 11px; color: #a8946a; } .ck-btns { display: flex; flex-direction: column; gap: 4px; } .ck-btns .btn { padding: 3px 10px; font-size: 12px; }
/* sound controls in the help window */
.sndRow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sndRow label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: .9; }
.sndRow input[type=range] { width: 110px; accent-color: var(--gold); }
/* the forge: crafting window, skill bars, and the chopping/mining progress bar */
#craft.window { width: min(600px, calc(100vw - 32px)); }
#craft .sk-row { flex-wrap: wrap; gap: 6px 14px; }
.sk-mini { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; flex: 1; min-width: 150px; } .sk-mini .aw-bar.sk { min-width: 50px; }
.cr-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.cr-tabs button { padding: 3px 9px; font-size: 12px; border-radius: 12px; border: 1px solid #3a3326; background: #1a1612; color: var(--dim); cursor: pointer; }
.cr-tabs button.sel { border-color: #c8963a; color: var(--gold); background: #2a2216; }
#actHint .gbar { display: inline-block; width: 90px; height: 7px; margin: 0 4px 0 6px; vertical-align: middle; background: #2a2420; border-radius: 4px; overflow: hidden; }
#actHint .gbar i { display: block; height: 100%; background: linear-gradient(90deg, #8ad85a, #d8e870); }
#actHint .bad { color: #e8806a; }
/* fishing: Marlo the Angler */
.angler-hi { font-size: 12px; font-style: italic; color: #bcd8ee; margin: 0 0 8px; }
.shoprow .trade { color: #9fd8ff; }
#invGrid .cell.baited { box-shadow: inset 0 0 0 2px #5ac8ff; }
.ck.locked { opacity: .55; }
.ck-book { margin: 10px 0 4px; font-weight: 600; color: var(--gold, #e8c070); font-size: 13px; }
/* durability and repair */
.cell .cdur { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; background: rgba(0,0,0,.6); border-radius: 2px; overflow: hidden; }
.cell .cdur i { display: block; height: 100%; }
#invGrid .cell.broken canvas { filter: grayscale(1) brightness(.6); }
#invGrid .cell.broken { box-shadow: inset 0 0 0 2px #c0392b; }
.eqslot.broken { border-color: #c0392b; }
.eqslot .eq-dur { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.dur-bar { display: inline-block; width: 64px; height: 5px; background: #2a2420; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.dur-bar i { display: block; height: 100%; }
.dur-n { font-size: 10px; color: var(--muted); margin-left: 4px; }
.dur-n.bad { color: #ff7a6a; font-weight: 700; }
.rp-all { display: flex; justify-content: flex-end; margin: 8px 0 2px; }
/* the Colosseum's Champions board */
.champ-btn { float: right; padding: 2px 8px; font-size: 11px; margin-top: -2px; }
#champs.window { width: min(640px, calc(100vw - 24px)); }
#champsBody { max-height: min(70vh, 640px); overflow-y: auto; }
table.champs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.champs th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; border-bottom: 1px solid #3a3326; }
table.champs td { padding: 5px 6px; border-bottom: 1px solid #241f19; }
table.champs td small { display: block; color: var(--muted); font-size: 10px; }
table.champs tr.me td { background: rgba(255, 211, 74, .1); }
table.champs tr.top1 td b { color: #ffd34a; } table.champs tr.top2 td b { color: #d8dce4; } table.champs tr.top3 td b { color: #e0a070; }

/* elements */
.el-tag { font-weight: 600; font-size: 0.92em; text-shadow: 0 0 6px rgba(0,0,0,.6); }
#targetFrame .el-tag { margin-left: auto; margin-right: 8px; font-size: 12px; }
#targetFrame .el-tag.strong::after { content: ' ▲'; color: #7dff8a; }
#targetFrame .el-tag.weak::after { content: ' ▼'; color: #ff7a6a; }
.el-tabs button { border-bottom: 2px solid var(--elc); }
.el-tabs button.sel { background: color-mix(in srgb, var(--elc) 35%, transparent); }
.el-tiers button { font-size: 11px; padding: 3px 6px; }
.el-hint { margin: 4px 0 6px; }

/* clans */
.window.clan-win { left: 12px; top: 128px; transform: none; width: min(370px, calc(100vw - 24px)); max-height: calc(100vh - 250px); }
.flag-cv { display: inline-block; vertical-align: middle; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.cl-head { display: flex; gap: 10px; align-items: center; margin: 4px 0 10px; }
.cl-name { font-family: var(--serif); font-size: 17px; color: var(--gold); }
.cl-tag { color: var(--dim); font-size: 13px; }
.cl-motto { font-style: italic; color: #d8cfb8; font-size: 12px; }
.cl-meta { color: var(--dim); font-size: 11px; margin-top: 2px; }
.cl-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 10px 0 4px; }
.cl-log { height: 210px; overflow-y: auto; background: rgba(0,0,0,.28); border: 1px solid #3a3326; border-radius: 6px; padding: 6px 8px; font-size: 12.5px; line-height: 1.45; }
.cl-line b { color: #9fd0ff; }
.cl-line.sys { color: #c8b88a; font-style: italic; }
.cl-t { color: #6a6458; font-size: 10.5px; }
.cl-form { display: flex; gap: 6px; margin-top: 8px; }
.cl-form input { flex: 1; min-width: 0; background: #14110d; border: 1px solid #3a3326; color: #eee; border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px; }
.cl-form input.cl-tag-in { flex: 0 0 64px; text-transform: uppercase; }
.cl-inv { display: flex; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid #2a251c; font-size: 13px; }
.cl-inv span:nth-child(2) { flex: 1; }
.cl-mem { max-height: 230px; overflow-y: auto; }
.cl-mrow { display: flex; gap: 5px; align-items: center; padding: 4px 2px; border-bottom: 1px solid #2a251c; font-size: 13px; }
.cl-mrow .btn { padding: 2px 7px; font-size: 12px; }
.cl-mrow .btn.bad, .btn.bad { color: #ff8a7a; }
.cl-mn { flex: 1; }
.cl-mn small { display: block; color: var(--dim); font-size: 11px; }
.cl-mrow .dot { width: 8px; height: 8px; border-radius: 50%; background: #4a4438; flex: none; }
.cl-mrow .dot.on { background: #6ad86a; box-shadow: 0 0 5px #6ad86a; }
.cl-flag-ed #clFlagBig { text-align: center; margin: 6px 0; }
.cl-opts { display: flex; flex-wrap: wrap; gap: 4px; }
.cl-opts button { padding: 2px; border: 1px solid #3a3326; background: #1a1612; border-radius: 4px; cursor: pointer; line-height: 0; }
.cl-opts button.sel, .cl-sw button.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.cl-sw { display: flex; flex-wrap: wrap; gap: 4px; }
.cl-sw button { width: 20px; height: 20px; border-radius: 4px; border: 1px solid rgba(0,0,0,.6); cursor: pointer; }
#clanTop.window { width: min(620px, calc(100vw - 32px)); }
table.champs.clans td.fl { width: 36px; }
table.champs.clans small { display: block; color: var(--dim); font-style: italic; }

/* the Arcanum: the school window, and the school spells on the action bar */
#bar .slot.spell { border-color: var(--sc, #b48cff); box-shadow: inset 0 0 10px color-mix(in srgb, var(--sc, #b48cff) 35%, transparent); }
.window.arc-win { width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 120px); overflow-y: auto; }
.arc-school { border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent); border-left: 3px solid var(--sc); border-radius: 8px; padding: 8px 10px; margin: 8px 0; background: color-mix(in srgb, var(--sc) 7%, transparent); }
.arc-school.mine { background: color-mix(in srgb, var(--sc) 15%, transparent); }
.arc-head { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.arc-head b { color: var(--sc); }
.arc-ico { font-size: 18px; }
.arc-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; background: var(--sc); color: #111; border-radius: 4px; padding: 1px 5px; }
.arc-blurb { text-align: left; margin: 3px 0 4px; }
.arc-sp { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.06); }
.arc-sp.known .arc-si { box-shadow: 0 0 8px var(--sc); }
.arc-k { font-size: 10px; color: var(--dim); width: 10px; }
.arc-si { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 6px; background: rgba(0,0,0,.35); border: 1px solid var(--sc); font-size: 16px; }
.arc-st { flex: 1; font-size: 12px; line-height: 1.35; }
.arc-d { color: var(--muted); }
.arc-ok { color: #8fe38a; font-size: 12px; }
.arc-cost { font-size: 12px; }
.arc-sp .btn { padding: 4px 9px; font-size: 12px; }
.arc-act { margin-top: 6px; text-align: right; }
.arc-win .m { color: var(--muted); font-size: 11px; }
.window.arc-win.war { border-color: #8a3a2a; }
.window.arc-win.war .wh { color: #ffb08a; }
.window.arc-win.holy { border-color: #d8b040; }
.window.arc-win.holy .wh { color: #ffe8a8; }
#bar .slot .key.gcombo { font-size: 8px; letter-spacing: 0; background: rgba(0,0,0,.55); border-radius: 3px; padding: 0 2px; }
#bar .slot.locked { opacity: .45; border-style: dashed; }
#bar .slot.locked .ico { font-size: 14px; filter: grayscale(1); }
.window.arc-win.wild { border-color: #5a8a3a; }
.window.arc-win.wild .wh { color: #c8e8a0; }

/* the mailbox */
.window.mail-win { width: min(470px, calc(100vw - 24px)); max-height: calc(100vh - 120px); }
#bar .slot .badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #d0393b; color: #fff; font-size: 10px; line-height: 16px; text-align: center; font-weight: 700; box-shadow: 0 0 0 2px rgba(0,0,0,.6); }
.ml-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 8px; }
.ml-tabs .tab { flex: 1 1 auto; padding: 5px 8px; font-size: 12px; border-radius: 6px; border: 1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.25); color: var(--muted); cursor: pointer; }
.ml-tabs .tab.on { background: rgba(216,176,64,.18); color: #ffe8a8; border-color: rgba(216,176,64,.5); }
.ml-msg { font-size: 12px; margin: 0 0 6px; }
.ml-msg .ok { color: #8fe38a; }
.ml-list { display: flex; flex-direction: column; gap: 3px; }
.ml-row { display: grid; grid-template-columns: 10px 1fr auto; grid-template-areas: "dot who when" "dot subj subj" "dot prev prev"; column-gap: 8px; padding: 6px 8px; border-radius: 6px; background: rgba(0,0,0,.22); cursor: pointer; border: 1px solid transparent; }
.ml-row:hover, .ml-row.padfocus { border-color: rgba(216,176,64,.5); background: rgba(216,176,64,.08); }
.ml-row .ml-open { display: none; }
.ml-dot { grid-area: dot; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; }
.ml-row.unread .ml-dot { background: #5ab8ff; box-shadow: 0 0 6px #5ab8ff; }
.ml-who { grid-area: who; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-row.unread .ml-who, .ml-row.unread .ml-subj { color: #fff; font-weight: 700; }
.ml-when { grid-area: when; font-size: 11px; color: var(--dim); }
.ml-subj { grid-area: subj; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-prev { grid-area: prev; font-size: 11.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-clan { color: #8ac8ff; font-weight: 600; }
.ml-letter .ml-head { border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 6px; margin-bottom: 8px; }
.ml-letter .ml-head b { font-size: 15px; }
.ml-letter .m { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.ml-text { font-size: 13.5px; line-height: 1.5; white-space: normal; word-wrap: break-word; background: rgba(240,228,200,.06); border-radius: 6px; padding: 10px; min-height: 60px; max-height: 40vh; overflow: auto; }
.ml-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ml-acts .btn, .ml-foot .btn, .ml-brow .btn, .ml-inline .btn { padding: 4px 10px; font-size: 12px; }
.ml-block { margin-left: auto; color: #ff9a9a; }
.ml-form { display: flex; flex-direction: column; gap: 8px; }
.ml-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.ml-form label.ml-chk { flex-direction: row; align-items: center; gap: 6px; font-size: 12.5px; color: #8ac8ff; }
.ml-form input:not([type=checkbox]), .ml-form textarea { width: 100%; box-sizing: border-box; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.15); border-radius: 6px; color: #fff; padding: 7px 8px; font: inherit; font-size: 13px; }
.ml-form textarea { resize: vertical; min-height: 110px; }
.ml-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ml-foot .m { margin-left: auto; color: var(--dim); font-size: 11px; }
.ml-form .ml-foot .m { margin-left: 0; margin-right: auto; }
.ml-inline { flex-direction: row; margin-bottom: 8px; }
.ml-brow { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; border-radius: 6px; background: rgba(0,0,0,.22); }
.ml-left { text-align: left; }
.ml-inline .btn, .ml-acts .btn { white-space: nowrap; }

/* the Saorise Chronicle */
.st-hud { margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
.st-hud:empty { display: none; }
.st-ch { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #c8a868; margin-top: 2px; }
.st-text { font-style: italic; line-height: 1.5; }
.st-obj { margin: 8px 0; padding: 7px 9px; border-radius: 6px; background: rgba(255,211,74,.08); border-left: 3px solid #d8b040; font-size: 12.5px; }
.st-got { color: #8fe38a !important; }
.st-hr { border: 0; border-top: 1px solid rgba(255,255,255,.12); margin: 12px 0; }
.st-end { text-align: center; color: #ffe08a; font-weight: 700; margin: 10px 0; letter-spacing: .03em; }
.st-other { margin-left: 8px; opacity: .85; }
.window.story-win { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 110px); }
.st-prog { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin: 6px 0 8px; }
.st-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.st-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c8a040, #ffe08a); }
.st-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.st-chip { font-size: 11px; padding: 3px 7px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.25); color: var(--muted); cursor: pointer; }
.st-chip.fin { color: #c8e8a8; }
.st-chip.on { background: rgba(216,176,64,.22); color: #ffe8a8; border-color: rgba(216,176,64,.6); }
.st-chip:disabled { opacity: .45; cursor: default; }
.st-entry { margin: 8px 0 12px; padding-left: 10px; border-left: 2px solid rgba(216,176,64,.35); }
.st-entry.cur { border-left-color: #ffd34a; }
.st-title { font-weight: 700; color: #ffe8a8; margin-bottom: 2px; }
.st-who { margin: 6px 0 0; font-size: 11.5px; color: #c8a868; font-weight: 600; }
.st-entry .st-text { margin: 2px 0; font-size: 13px; }

/* ======================= the mobile version ======================= */
.modesw { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 2px; font-size: 13px; color: var(--muted); }
.modesw button { padding: 6px 12px; border-radius: 16px; border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.3); color: var(--muted); font: inherit; cursor: pointer; }
.modesw button.on { background: rgba(216,176,64,.25); border-color: #d8b040; color: #ffe8a8; font-weight: 700; }
#mJoy, #mAct, #mTop, #mSheet, #mOrient { display: none; }
body.mobile #mJoy, body.mobile #mAct, body.mobile #mTop { display: flex; pointer-events: auto; }
body.mobile #mSheet:not(.hidden) { display: flex; pointer-events: auto; }
body.mobile #mOrient:not(.hidden) { display: flex; pointer-events: auto; }
body.mobile { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.mobile #game, body.mobile #gl, #mJoy, .mbtn, body.mobile #bar { touch-action: none; }
body.mobile .bpanel { touch-action: pan-y; -webkit-overflow-scrolling: touch; }
body.mobile .window, body.mobile #mSheet .msheet-in, body.mobile #chatLog { touch-action: pan-y; -webkit-overflow-scrolling: touch; }
body.mobile input, body.mobile textarea { -webkit-user-select: text; user-select: text; font-size: 16px; }
#mJoy { position: fixed; left: calc(18px + env(safe-area-inset-left)); bottom: calc(18px + env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.08), rgba(0,0,0,.35)); border: 2px solid rgba(255,255,255,.22); align-items: center; justify-content: center; z-index: 30; }
#mJoy.on { border-color: rgba(255,211,74,.6); }
#mJoyKnob { width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f4e8c8, #a88a52); box-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none; }
#mAct { position: fixed; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); width: 170px; height: 150px; z-index: 30; }
.mbtn { border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: radial-gradient(circle at 40% 35%, rgba(70,60,52,.95), rgba(24,20,18,.95)); color: #f4e8c8; font-size: 22px; width: 56px; height: 56px; display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0,0,0,.6); padding: 0; cursor: pointer; }
.mbtn.down, .mbtn:active { transform: scale(.92); border-color: #ffd34a; }
.mbtn.big { width: 84px; height: 84px; font-size: 36px; border-color: rgba(255,120,90,.6); background: radial-gradient(circle at 40% 35%, #a83a2a, #4a140c); }
.mbtn.sm { width: 44px; height: 44px; font-size: 19px; }
#mAct #mAttack { position: absolute; right: 0; bottom: 0; }
#mAct #mTalk { position: absolute; right: 96px; bottom: 0; }
#mAct #mTarget { position: absolute; right: 80px; bottom: 66px; }
#mTop { position: fixed; left: calc(12px + env(safe-area-inset-left)); top: 112px; gap: 8px; z-index: 30; }
#mSheet { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); align-items: center; justify-content: center; }
.msheet-in { background: var(--panel, #1c1814); border: 1px solid var(--edge, #5a4a32); border-radius: 12px; padding: 12px; width: min(460px, 94vw); max-height: 92vh; overflow: auto; text-align: center; }
.msheet-h { display: flex; justify-content: space-between; align-items: center; font-family: Georgia, serif; font-size: 17px; color: #ffe8a8; margin-bottom: 8px; }
.msheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.msheet-grid button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.3); color: #f4e8c8; font-size: 22px; cursor: pointer; }
.msheet-grid button span { font-size: 11.5px; color: var(--muted); }
#mOrient { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 55; background: rgba(20,16,12,.92); border: 1px solid #d8b040; border-radius: 12px; padding: 14px 16px; color: #ffe8a8; font-size: 15px; gap: 10px; align-items: center; max-width: 80vw; }
/* the HUD, compacted */
body.mobile #bar { bottom: calc(10px + env(safe-area-inset-bottom)); gap: 5px; padding: 5px; max-width: calc(100vw - 360px); flex-wrap: wrap; justify-content: center; }
body.mobile #bar .slot.small { display: none; }
body.mobile #bar .slot { width: 50px; height: 50px; }
body.mobile #bar .slot .ico { font-size: 22px; }
body.mobile #padHint { display: none !important; }
body.mobile #topLeft { width: 180px; padding: 6px 8px; font-size: 12px; }
body.mobile #topLeft .bar { height: 14px; }
body.mobile #topRight { width: 168px; }
body.mobile .mm canvas { width: 150px; height: 112px; }
body.mobile .mm-hint { display: none; }
body.mobile #lbBox { display: none; }
body.mobile #questBox { font-size: 11px; max-height: 34vh; overflow: auto; padding: 6px 8px; }
body.mobile #targetFrame { width: 220px; top: 8px; }
body.mobile #chat { left: calc(12px + env(safe-area-inset-left)); bottom: calc(160px + env(safe-area-inset-bottom)); width: min(300px, 38vw); }
body.mobile #chatLog { max-height: 64px; font-size: 11px; opacity: .85; }
body.mobile #chatIn { display: none; }
body.mobile #chat.mopen { bottom: 50%; transform: translateY(50%); width: min(420px, 70vw); z-index: 40; background: rgba(20,16,12,.92); border-radius: 8px; padding: 6px; }
body.mobile #chat.mopen #chatLog { max-height: 40vh; opacity: 1; }
body.mobile #chat.mopen #chatIn { display: block; }
body.mobile .window { max-height: calc(100vh - 24px); max-width: 96vw; }
body.mobile #worldmap.window, body.mobile #worldmap { max-width: 98vw; }
body.mobile #tooltip { display: none !important; }
@media (max-height: 430px) { body.mobile #topRight { width: 150px; } body.mobile .mm canvas { width: 130px; height: 96px; } body.mobile #questBox { max-height: 24vh; } body.mobile #mTop { top: 104px; } body.mobile #chat { bottom: calc(150px + env(safe-area-inset-bottom)); } body.mobile #mJoy { width: 116px; height: 116px; } }
@media (orientation: portrait) { body.mobile #bar { max-width: calc(100vw - 24px); bottom: calc(176px + env(safe-area-inset-bottom)); } body.mobile #topRight { width: 140px; } body.mobile #questBox { max-height: 22vh; } body.mobile #chat { bottom: calc(250px + env(safe-area-inset-bottom)); } }

/* the Terms of Service: the builder's checkbox, and the agreement screen for existing heroes */
.tosrow { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 4px; font-size: 13.5px; line-height: 1.4; color: var(--muted, #b8ad98); cursor: pointer; text-align: left; font-family: system-ui, sans-serif; }
.tosrow input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: #d8b040; cursor: pointer; }
.tosrow a, .tos-link a, .tos-p a { color: #f0c870; }
.tosrow.need { color: #ffb0a0; animation: tosShake .35s; }
@keyframes tosShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tos-link { margin-top: 4px !important; }
.tos-card { max-width: 460px; }
.tos-p { font-size: 14px; line-height: 1.55; text-align: left; font-family: system-ui, sans-serif; color: #e8dcc4; }
#tosGate .bbtns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
#tosGate .btn[disabled] { opacity: .45; cursor: not-allowed; }
.tosrow, .tosrow span { text-transform: none !important; letter-spacing: normal !important; font-weight: normal; }

#bookLock { position: absolute; left: 14px; right: 14px; top: 46px; bottom: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; background: rgba(10,8,12,.85); color: #f0e0b8; border-radius: 6px; padding: 20px; font-size: 14px; }
#bookLock .bl-ico { font-size: 44px; }
#bookLock b { font-family: Georgia, serif; font-size: 18px; color: #ffe8a8; }
#bookLock span { color: #b8ad98; max-width: 360px; }

/* the installable app */
#appRow { margin: 12px 0 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#appRow small { color: var(--muted, #b8ad98); font-size: 12px; font-family: system-ui, sans-serif; }
#appBtn { padding: 8px 18px; }
#appHelp { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(226,182,90,.4); border-radius: 6px; background: rgba(0,0,0,.35); text-align: left; font-family: system-ui, sans-serif; font-size: 14px; color: #e8dcc4; }
#appHelp b { color: #ffe8a8; }
#appHelp ol { margin: 6px 0; padding-left: 20px; }
#appHelp li { margin: 3px 0; }
#appHelp small { display: block; color: #b8ad98; margin: 4px 0 8px; }
.ios-share { display: inline-block; padding: 0 5px; border: 1px solid #b8ad98; border-radius: 4px; font-size: 12px; }
html.as-app body { overscroll-behavior: none; }
html.as-app #topLeft { margin-top: env(safe-area-inset-top); }

/* the intro movie */
#intro { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity .45s; cursor: pointer; }
#intro.fade { opacity: 0; }
#introVid { width: 100%; height: 100%; object-fit: contain; background: #000; }
.intro-btn { position: absolute; z-index: 2; font: 600 15px system-ui, sans-serif; color: #f4e8c8; background: rgba(20,16,12,.62); border: 1px solid rgba(226,182,90,.7); border-radius: 22px; padding: 9px 18px; cursor: pointer; letter-spacing: .03em; backdrop-filter: blur(4px); }
.intro-btn:hover { background: rgba(226,182,90,.25); }
#introSkip { right: calc(22px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom)); }
#introSound { left: calc(22px + env(safe-area-inset-left)); bottom: calc(24px + env(safe-area-inset-bottom)); }
#introBar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.12); }
#introBar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c8963a, #ffe08a); }
.intro-link { margin: 6px 0 0 !important; }
.linkbtn { background: none; border: 0; padding: 0; color: #f0c870; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Hearthvale homesteads ---------- */
#homeBuild { position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); width: min(760px, calc(100vw - 24px)); padding: 8px 10px; z-index: 12; }
body.building #bar { opacity: .35; pointer-events: none; }
.hb-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hb-title { color: var(--gold); font-weight: 700; }
#hbInfo { color: #cfc6b4; font-size: 13px; } .gold-ic { color: #ffd34a; }
.hb-top .btn { padding: 5px 9px; font-size: 13px; } .hb-top .btn.on { background: #6a2a22; color: #ffd8c8; border-color: #c85a4a; }
.hb-top .k, .hw-btns .k { font-style: normal; opacity: .6; font-size: 11px; margin-left: 3px; }
.hb-cats { display: flex; gap: 5px; margin: 7px 0 6px; flex-wrap: wrap; } .hb-cats .btn { padding: 4px 9px; font-size: 12px; } .hb-cats .btn.on { background: var(--gold-dim); color: #140f08; }
.hb-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.hb-piece { flex: 0 0 auto; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border: 1px solid #3a3226; background: #0f0e12; color: #e8dcc4; border-radius: 4px; cursor: pointer; font: inherit; }
.hb-piece .ic { font-size: 22px; line-height: 1.1; } .hb-piece b { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.15; } .hb-piece small { font-size: 11px; color: #ffd34a; }
.hb-piece.sel, .hb-piece.padfocus { border-color: #ffd34a; background: #2a2214; box-shadow: 0 0 0 1px #ffd34a inset; }
.hb-hint { font-size: 12px; color: #a89c86; margin-top: 4px; }
.window.home-win { width: min(470px, calc(100vw - 24px)); }
.hw-pitch { text-align: center; padding: 6px 4px 10px; } .hw-pitch p { color: #cfc6b4; font-size: 14px; margin: 8px 0; } .hw-big { font-size: 46px; }
.btn.gold { background: linear-gradient(#e2b65a, #a8802e); color: #1a1208; font-weight: 700; border-color: #ffd98a; }
.hw-mine { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; flex-wrap: wrap; } .hw-mine small { display: block; color: #a89c86; font-size: 12px; }
.hw-btns { display: flex; gap: 6px; }
.hw-set { display: flex; align-items: center; gap: 6px; margin: 6px 0; flex-wrap: wrap; } .hw-set > span { width: 64px; color: #a89c86; font-size: 13px; }
.hw-roof { width: 26px; height: 26px; border-radius: 4px; border: 2px solid #2a2418; cursor: pointer; } .hw-roof.on, .hw-roof.padfocus { border-color: #ffd34a; }
.btn.sm { padding: 4px 8px; font-size: 12px; } .hw-set .btn.on { background: var(--gold-dim); color: #140f08; }
.hw-head { margin: 12px 0 6px; color: var(--gold); font-weight: 700; border-top: 1px solid #2f2920; padding-top: 10px; }
.hw-visit { display: flex; gap: 6px; } .hw-visit input { flex: 1; min-width: 0; }
.hw-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; } .hw-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 6px; background: #14121a; border-radius: 3px; } .hw-row small { color: #a89c86; }
.window.vault-win { width: min(470px, calc(100vw - 24px)); }
.vault-win .grid { grid-template-columns: repeat(8, 1fr); } .vh { margin: 8px 0 5px; color: var(--gold); font-weight: 700; } .vh small { color: #a89c86; font-weight: 400; margin-left: 6px; }
body.mobile #homeBuild { bottom: calc(10px + env(safe-area-inset-bottom)); left: 50%; width: min(620px, calc(100vw - 300px)); padding: 6px; }
body.mobile.building #mAct, body.mobile.building #bar { display: none; }
@media (orientation: portrait) { body.mobile #homeBuild { width: calc(100vw - 16px); bottom: calc(170px + env(safe-area-inset-bottom)); } }
body.mobile #homeBuild .hb-hint, body.mobile #homeBuild .hb-top .k, body.mobile .hb-title { display: none; }
body.mobile .hb-piece { width: 70px; padding: 4px 2px; } body.mobile .hb-piece .ic { font-size: 17px; } body.mobile .hb-piece b { font-size: 10px; }
body.mobile .hb-cats { margin: 4px 0; } body.mobile .hb-cats .btn { padding: 3px 7px; font-size: 11px; } body.mobile .hb-top .btn { padding: 4px 8px; font-size: 12px; }
body.mobile #hbInfo { font-size: 11px; }
body.mobile .vault-win .grid { grid-template-columns: repeat(10, 1fr); gap: 3px; }

#netInfo { font-size: 11px; color: #8f8676; text-align: center; min-height: 13px; } #netInfo.bad { color: #ff8a6a; font-weight: 700; }
.window.furn-win { width: min(560px, calc(100vw - 24px)); }
.fw-top { display: flex; gap: 10px; align-items: center; padding: 4px 0 8px; } .fw-mabel { font-size: 34px; } .fw-top small { display: block; color: #cfc6b4; font-size: 12.5px; font-style: italic; }
.fw-info { display: flex; justify-content: space-between; color: #e8dcc4; font-size: 13px; padding: 4px 2px 6px; border-bottom: 1px solid #2f2920; }
.fw-cats { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; } .fw-cats .btn.on { background: var(--gold-dim); color: #140f08; }
.fw-list { max-height: min(52vh, 460px); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 3px; scrollbar-width: thin; }
.fw-row { display: flex; align-items: center; gap: 8px; padding: 6px 7px; background: #14121a; border: 1px solid #241f18; border-radius: 4px; }
.fw-ic { font-size: 24px; width: 32px; text-align: center; flex: 0 0 auto; } .fw-txt { flex: 1; min-width: 0; } .fw-txt b { font-size: 13.5px; } .fw-txt small { display: block; color: #a89c86; font-size: 11.5px; }
.fw-buy { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; } .fw-price { color: #ffd34a; font-size: 13px; font-weight: 700; } .fw-price.poor { color: #c86a5a; }
.fw-own { color: #9ad89a; font-size: 11px; min-height: 12px; } .fw-btns { display: flex; gap: 4px; } .fw-btns .btn[disabled] { opacity: .4; cursor: default; }
.hb-piece.st small { color: #9ad89a; } .hb-piece.st.none { opacity: .55; } .hb-piece.st.none small { color: #c8a878; }
body.mobile .fw-list { max-height: 48vh; } body.mobile .fw-txt small { display: none; }
