/* Aethermoor — interface. Paper and wood: cream cards in dark-wood frames, brass where it matters, a rounded hand, ink you
   can read by lamplight. Everything is drawn with gradients and shadows — no image files — and the wood and the paper get
   their tooth from two tiny inline SVGs (--grain, --planks). */
:root {
  --paper: #fff8e8; --paper2: #f6ead0; --paper3: #ecdcb8; --line: #e0cba0; --line2: #c9ad7c;
  --wood: #8b5e3c; --wood2: #6f4a2e; --wood3: #4f3422; --wood-light: #b98a5e;
  --ink: #4a3628; --ink2: #7a6450; --muted: #9a846c; --night: #3a2c3a;
  --leaf: #6fb34a; --leaf2: #5a9a3a; --berry: #e8685a; --berry2: #c94f44; --honey: #f2b53a; --honey2: #d9962a; --sky: #4f9fd8; --plum: #8a5fc8;
  --gold: #b9801c; --gold2: #a06a10; --gold-dark: #8a6a2a; --brass: #e6b654; --brass2: #a8761e;
  --hp: #7ccf5a; --hp-dark: #58a83c; --mana: #5aa8e8; --rage: #ee7a6a; --energy: #f2c244; --xp: #b78ae8; --rested: #6ab4ea;
  --text: var(--ink); --danger: #d2493c; --good: #3f9a4a;
  --frame: var(--paper); --frame-border: var(--wood2);
  --round: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT", "Nunito", "Quicksand", "Varela Round", "Avenir Next", "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  --serif: var(--round); --sans: var(--round);
  --shadow: 0 4px 0 rgba(58, 38, 24, 0.5), 0 12px 26px rgba(40, 26, 16, 0.32);
  --shadow-sm: 0 3px 0 rgba(58, 38, 24, 0.45), 0 6px 14px rgba(40, 26, 16, 0.25);
  --outline: 0 1px 0 #3a2c3a, 0 -1px 0 #3a2c3a, 1px 0 0 #3a2c3a, -1px 0 0 #3a2c3a, 0 2px 0 rgba(58, 44, 58, 0.6);
  --lip: inset 0 0 0 2px rgba(255, 253, 245, 0.92), inset 0 -5px 0 rgba(139, 94, 60, 0.1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .46 0 0 0 0 .32 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --planks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='64'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .42' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .07 0 0 0 0 .03 0 0 0 .55 -.12'/%3E%3C/filter%3E%3Crect width='220' height='64' filter='url(%23w)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #bfe3f5; color: var(--ink); font-family: var(--round); font-size: 14px; user-select: none; -webkit-user-select: none; -webkit-font-smoothing: antialiased; }
canvas#game { position: fixed; inset: 0; display: block; outline: none; }
button { font-family: var(--round); cursor: pointer; }
input, select, textarea { font-family: var(--round); color: var(--ink); }
.hidden { display: none !important; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
::-webkit-scrollbar { width: 12px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: var(--line2); border: 3px solid var(--paper); border-radius: 8px; }

/* ---------- cards ---------- */
.frame { background: var(--grain) var(--paper); border: 3px solid var(--wood2); border-radius: 16px; box-shadow: var(--lip), var(--shadow); position: relative; }
.wooden { background: var(--planks), linear-gradient(#9a6a44, #7a5032); border: 3px solid var(--wood3); box-shadow: inset 0 2px 0 rgba(255, 236, 200, 0.22), inset 0 -4px 0 rgba(0, 0, 0, 0.22), var(--shadow); }
.gold-title { color: var(--wood2); font-weight: 800; letter-spacing: 0.2px; }
.btn { background: linear-gradient(#fffdf6, var(--paper2)); border: 2px solid var(--wood2); border-bottom-width: 4px; color: var(--ink); padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 800; transition: transform 0.06s, filter 0.12s; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.8); }
.btn svg.ic { margin-right: 6px; }
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; filter: none; }
.btn.small { padding: 3px 11px; font-size: 12px; border-bottom-width: 3px; }
.btn.small svg.ic { width: 13px; height: 13px; margin-right: 4px; }
.btn.on { background: linear-gradient(#a3754c, var(--wood)); border-color: var(--wood3); color: #fff4dc; box-shadow: inset 0 2px 0 rgba(255, 236, 200, 0.3); }
.btn.danger { border-color: #8e2f28; color: #fff; background: linear-gradient(#f0806f, var(--berry2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.btn.primary { background: linear-gradient(#8ccf62, var(--leaf2)); border-color: #3c7426; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45); }
.btn.big { font-size: 17px; padding: 11px 26px; border-bottom-width: 5px; letter-spacing: 0.2px; }
.btn.big svg.ic { width: 18px; height: 18px; }
.muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--danger); } .gold { color: var(--gold); font-weight: 700; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #3a2c3a; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
svg.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- bars: a dark trough, a glossy fill, and a pale ghost that lingers where the fill just was ---------- */
.bar { height: 16px; background: #43323a; border: 2px solid var(--wood3); border-radius: 999px; overflow: hidden; position: relative; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.28); }
.bar > i { display: block; position: relative; height: 100%; width: 0; background: var(--honey); border-radius: 999px; transition: width 0.15s; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.16), inset 0 3px 0 rgba(255, 255, 255, 0.38); }
.bar > u { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: rgba(255, 244, 220, 0.6); border-radius: 999px; transition: width 0.7s 0.3s ease-out; }
.bar > b { position: absolute; inset: 0; font-size: 10px; line-height: 12px; text-align: center; color: #fff; font-weight: 800; text-shadow: var(--outline); letter-spacing: 0.2px; }
/* inside a window a bar sits on paper, not on the world: a soft trough instead of a dark one */
.win .bar, #loading .bar { background: var(--paper3); border-color: var(--line2); box-shadow: inset 0 2px 0 rgba(139, 94, 60, 0.2); }

/* ---------- the front door: title, motes, the card, the strip along the bottom ---------- */
#loading, #menu-screen { position: fixed; inset: 0; background: linear-gradient(#8fd0f4 0%, #c8ecfb 46%, #a9db7a 46%, #86c45c 100%); display: flex; flex-direction: column; align-items: center; z-index: 50; overflow: hidden; }
#loading { justify-content: space-between; padding: 9vh 0 8vh; }
#menu-screen { z-index: 40; justify-content: center; gap: 18px; padding: 18px 0 46px; }
canvas.backdrop { position: absolute; inset: -3%; width: 106%; height: 106%; image-rendering: pixelated; object-fit: cover; animation: drift 46s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.07) translate(-1.4%, 1%); } }
#loading::before, #menu-screen::before { content: ""; position: absolute; inset: 0; z-index: 1; background: radial-gradient(ellipse at 50% 42%, rgba(255, 248, 232, 0) 38%, rgba(40, 26, 30, 0.5) 100%), linear-gradient(180deg, rgba(40, 26, 30, 0.28), rgba(40, 26, 30, 0) 30%, rgba(40, 26, 30, 0) 70%, rgba(40, 26, 30, 0.45)); }
.motes { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.motes i { position: absolute; bottom: -12px; background: #fff6d0; opacity: 0; box-shadow: 0 0 8px 2px rgba(255, 236, 170, 0.55); animation: mote linear infinite; }
@keyframes mote { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 12% { opacity: 0.85; } 80% { opacity: 0.6; } 100% { transform: translate(60px, -104vh) rotate(200deg); opacity: 0; } }

.logo { position: relative; z-index: 2; text-align: center; color: #fff4dc; flex-shrink: 0; }
.logo svg.ic { width: 44px; height: 44px; color: var(--brass); stroke-width: 1.8; filter: drop-shadow(0 3px 0 #4f3422) drop-shadow(0 6px 10px rgba(40, 26, 16, 0.5)); animation: twinkle 5s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(45deg) scale(1.12); } }
.logo h1 { margin: 2px 0 0; font-size: clamp(40px, 6.2vw, 78px); line-height: 1; font-weight: 900; letter-spacing: 0.09em; padding-left: 0.09em; color: #fff4dc;
  text-shadow: 0 1px 0 #f0d8a8, 0 2px 0 #d9a860, 0 3px 0 #b98a5e, 0 4px 0 #8b5e3c, 0 5px 0 #6f4a2e, 0 6px 0 #4f3422, 0 7px 0 #3a2c3a, 0 12px 18px rgba(30, 18, 12, 0.6); }
.logo p { margin: 12px 0 0; font-size: 14px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: #ffe9b8; text-shadow: var(--outline); }
.logo p::before, .logo p::after { content: ""; display: inline-block; width: 34px; height: 3px; margin: 0 12px; vertical-align: 4px; border-radius: 2px; background: var(--brass); box-shadow: var(--outline); }
#menu-screen.making .menu-logo { display: none; }

#loading .box { position: relative; z-index: 2; width: min(580px, 90vw); text-align: center; background: var(--grain) var(--paper); border: 3px solid var(--wood2); border-radius: 20px; padding: 16px 24px 14px; box-shadow: var(--lip), var(--shadow); }
#loading .bar { height: 20px; }
#loading .bar > i { background: linear-gradient(90deg, var(--honey2), var(--honey)); }
#loading .tip { margin-top: 10px; font-size: 13px; color: var(--ink2); min-height: 36px; line-height: 1.45; }
#loading .status { margin-top: 9px; font-size: 12px; color: var(--gold); font-weight: 800; letter-spacing: 0.3px; }

.menu-box { position: relative; z-index: 2; width: min(720px, 94vw); max-height: 100%; min-height: 0; overflow: auto; padding: 22px 28px 24px; flex-shrink: 1; }
#menu-screen.making .menu-box { width: min(1180px, 96vw); padding: 18px 20px; }
.menu-box h1 { margin: 0; font-size: 34px; color: var(--wood2); letter-spacing: 2px; text-align: center; font-weight: 900; }
.menu-box h2 { margin: 18px 0 8px; font-size: 17px; color: var(--wood2); font-weight: 900; display: flex; align-items: center; gap: 9px; }
.menu-box h2 small { font-size: 12px; font-weight: 700; color: var(--muted); }
.menu-box h2 .step { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(var(--brass), var(--honey2)); border: 2px solid var(--wood3); color: #3a2414; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.menu-box .sub { text-align: center; color: var(--ink2); margin-bottom: 14px; }
.menu-box .sub.lead { font-size: 15px; font-weight: 700; font-style: italic; color: var(--wood); margin: 0 0 16px; }
.menu-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.menu-actions .btn { font-size: 15px; padding: 9px 22px; }
.menu-actions .btn.big { font-size: 17px; padding: 11px 28px; }
.menu-note { color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; margin-top: 18px; padding-top: 12px; border-top: 2px dashed var(--line); }
.menu-foot { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; pointer-events: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 13px; border-radius: 999px; background: rgba(58, 44, 58, 0.72); color: #fff4dc; font-size: 12px; font-weight: 700; border: 2px solid rgba(255, 244, 220, 0.25); backdrop-filter: blur(3px); }
.pill b { color: #ffe08a; } .pill.ver { opacity: 0.75; } .pill svg.ic { width: 14px; height: 14px; }

/* the character you left at the door */
.save-card { display: flex; align-items: center; gap: 18px; padding: 12px 18px 12px 12px; border: 3px solid var(--line2); border-radius: 18px; background: linear-gradient(#fffefa, #fff6e0); box-shadow: inset 0 -4px 0 rgba(139, 94, 60, 0.08); }
.save-card .stand { width: 132px; height: 148px; flex-shrink: 0; border-radius: 14px; border: 3px solid var(--wood2); overflow: hidden; background: radial-gradient(circle at 50% 38%, #fff8d8 0%, #cdeaf8 46%, #a9d8f2 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), var(--shadow-sm); }
.save-card canvas.preview { width: 100%; height: 100%; display: block; }
.save-card .who { flex: 1; min-width: 0; }
.save-card .who > b { display: block; color: var(--wood2); font-size: 24px; font-weight: 900; line-height: 1.15; }
.save-card .who .cls { display: block; color: var(--ink2); font-size: 13px; font-weight: 800; margin-top: 4px; }
.save-card .facts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.save-card .facts span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--ink); background: var(--paper2); border: 2px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 7px; }
.save-card .facts svg.ic { width: 13px; height: 13px; color: var(--wood); }
.save-card .btn.big { flex-shrink: 0; }

/* making an adventurer: the figure on the left, everything about them on the right */
.make { display: grid; grid-template-columns: 330px 1fr; gap: 20px; align-items: start; }
.make-left { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.stage { position: relative; height: min(440px, 52vh); border-radius: 18px; border: 3px solid var(--wood2); overflow: hidden; background: radial-gradient(circle at 50% 30%, #fffbe0 0%, #d6effa 40%, #a6d6f0 100%); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75), var(--shadow-sm); }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 14px; box-shadow: inset 0 -40px 50px -30px rgba(79, 52, 34, 0.35); }
.stage canvas.preview { width: 100%; height: 100%; object-fit: contain; display: block; }
.stage-tools { position: absolute; bottom: 9px; left: 9px; display: flex; gap: 5px; z-index: 2; }
.stage-hint { position: absolute; right: 10px; bottom: 8px; z-index: 2; font-size: 11px; font-weight: 800; color: rgba(79, 52, 34, 0.6); pointer-events: none; }
.stage-hint svg.ic { width: 12px; height: 12px; margin-right: 4px; }
.make-who { text-align: center; font-size: 15px; color: var(--wood2); }
.make-who b { font-weight: 900; margin-right: 6px; } .make-who .chip { font-size: 13px; padding: 2px 12px; }
.make-left .menu-actions { margin-top: 2px; flex-wrap: nowrap; } .make-left .menu-actions .btn.big { flex: 1; padding: 11px 12px; }
.make-right { min-width: 0; min-height: min(640px, 78vh); display: flex; flex-direction: column; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stepb { display: flex; align-items: center; gap: 10px; text-align: left; padding: 7px 12px; border-radius: 14px; border: 3px solid var(--line2); border-bottom-width: 5px; background: linear-gradient(#fffdf6, var(--paper2)); color: var(--ink2); transition: transform 0.08s; }
.stepb:hover { transform: translateY(-1px); border-color: var(--wood-light); }
.stepb .step { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: #fff; border: 2px solid var(--line2); color: var(--ink2); font-size: 14px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.stepb .sl { min-width: 0; } .stepb b { display: block; font-size: 15px; font-weight: 900; color: var(--wood2); line-height: 1.15; }
.stepb small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepb.on { background: var(--planks), linear-gradient(#9a6a44, #7a5032); border-color: var(--wood3); box-shadow: inset 0 2px 0 rgba(255, 236, 200, 0.25); }
.stepb.on b { color: #fff4dc; text-shadow: 0 2px 0 rgba(58, 38, 24, 0.6); } .stepb.on small { color: #f0d8b0; }
.stepb.on .step { background: linear-gradient(#ffdf8a, var(--brass)); border-color: var(--wood3); color: #3a2414; }
.pane { flex: 1; display: flex; flex-direction: column; }
.pane-lead { font-size: 13px; color: var(--ink2); margin: 0 2px 10px; line-height: 1.45; }
.pane-next { margin-top: auto; padding-top: 12px; display: flex; justify-content: flex-end; }
.pane-next .btn svg.ic { margin: 0 0 0 6px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice { border: 3px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; background: #fffefa; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; position: relative; }
.choice:hover { border-color: var(--wood-light); transform: translateY(-2px); }
.choice.selected { border-color: var(--leaf2); box-shadow: 0 0 0 4px rgba(111, 179, 74, 0.28); background: #fbfff4; }
.choice.selected::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--leaf); border: 2px solid #3c7426; color: #fff; font-size: 13px; font-weight: 900; line-height: 18px; text-align: center; }
.choice img, .choice canvas { width: 100%; height: 210px; object-fit: contain; display: block; background: linear-gradient(#bfe6fa 0%, #e8f6d8 78%, #a9db7a 78%); }
.choice canvas.pix { height: 96px; object-fit: cover; image-rendering: pixelated; }
.choice .body { padding: 9px 12px 11px; }
.choice .name { color: var(--wood2); font-weight: 900; font-size: 16px; }
.choice .desc { color: var(--ink2); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.choice ul { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: var(--ink); line-height: 1.45; }
.choice-grid .choice canvas.pix { height: 118px; }
.choice-grid .choice .medal { position: absolute; left: 12px; top: 92px; }
.choice-grid .choice .body { padding-top: 26px; }
.faction-grid .choice canvas.pix { height: 132px; }
.medal { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; border: 3px solid var(--wood3); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.18); }
.medal svg.ic { width: 25px; height: 25px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }
.medal.warrior { background: linear-gradient(#f08a6a, #cf4f3e); } .medal.ranger { background: linear-gradient(#8ccf62, #4f9436); } .medal.mage { background: linear-gradient(#a98be8, #6e4fc0); }
.faction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.faction-grid .choice .name .chip { font-size: 14px; padding: 2px 12px; }
.faction-grid .creed { font-style: italic; color: var(--gold); margin-top: 5px; font-weight: 700; }
.name-row { display: flex; gap: 6px; align-items: center; justify-content: center; }
.name-row input { flex: 1; min-width: 0; font-size: 17px; padding: 8px 14px; background: #fff; border: 3px solid var(--wood2); color: var(--ink); border-radius: 999px; text-align: center; font-weight: 800; outline: none; user-select: text; -webkit-user-select: text; box-shadow: inset 0 3px 0 rgba(139, 94, 60, 0.12); }
.name-row input:focus { border-color: var(--leaf2); box-shadow: 0 0 0 4px rgba(111, 179, 74, 0.25); }
.name-row input::placeholder { color: var(--line2); font-weight: 700; }
.name-row .btn.small { padding: 8px 10px; } .name-row .btn.small svg.ic { margin: 0; width: 16px; height: 16px; }

/* the looking-glass (js/ui/looks.js) */
.lk { border: 3px solid var(--line); border-radius: 16px; background: #fffefa; padding: 10px 12px 4px; }
.lk-tabs { align-items: center; }
.lk-tabs .lk-rnd { margin-left: auto; }
.lk-row { padding: 9px 0 10px; border-bottom: 2px dotted var(--line); }
.lk-row:last-child { border-bottom: 0; }
.lk-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.lk-h b { font-size: 13px; font-weight: 900; color: var(--wood2); }
.lk-v { font-size: 12px; font-weight: 700; color: var(--muted); }
.lk-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.lk-sw { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 2px var(--line2), inset 0 -5px 0 rgba(0, 0, 0, 0.16), inset 0 4px 0 rgba(255, 255, 255, 0.3); transition: transform 0.08s; position: relative; }
.lk-sw:hover { transform: scale(1.12); }
.lk-sw.on { box-shadow: 0 0 0 3px var(--leaf2), 0 0 0 6px rgba(111, 179, 74, 0.28), inset 0 -5px 0 rgba(0, 0, 0, 0.16); transform: scale(1.08); }
.lk-sw.own::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.85); }
.lk-tile { padding: 5px 14px; border-radius: 999px; border: 2px solid var(--line2); border-bottom-width: 3px; background: #fff; color: var(--ink2); font-size: 12px; font-weight: 800; }
.lk-tile:hover { border-color: var(--wood-light); color: var(--ink); }
.lk-tile.on { background: linear-gradient(#a3754c, var(--wood)); border-color: var(--wood3); color: #fff4dc; }
.lk-thumb { width: 70px; padding: 0 0 3px; border-radius: 13px; border: 3px solid var(--line); background: #fff; overflow: hidden; transition: transform 0.08s, border-color 0.12s; }
.lk-thumb img { display: block; width: 100%; aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, #fffbe0, #cfeaf8 70%); }
.lk-thumb span { display: block; font-size: 10px; font-weight: 800; color: var(--ink2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 3px; }
.lk-thumb:hover { transform: translateY(-2px); border-color: var(--wood-light); }
.lk-thumb.on { border-color: var(--leaf2); box-shadow: 0 0 0 3px rgba(111, 179, 74, 0.28); } .lk-thumb.on span { color: var(--leaf2); }
.mirror { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: start; }
.mirror .stage { height: 270px; position: sticky; top: 0; }
.mirror .lk { padding-top: 8px; }

/* ---------- HUD: you, and whoever you are looking at ---------- */
.unit { position: absolute; top: 14px; display: flex; align-items: center; min-width: 286px; filter: drop-shadow(0 4px 0 rgba(58, 38, 24, 0.45)) drop-shadow(0 8px 12px rgba(40, 26, 16, 0.25)); }
#player-frame { left: 14px; }
#target-frame { left: 322px; }
.unit .portrait { width: 76px; height: 76px; border-radius: 22px; border: 3px solid var(--wood3); background: radial-gradient(circle at 50% 35%, #fffbe0, #bfe3f5 75%); position: relative; z-index: 2; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--wood); box-shadow: inset 0 0 0 3px var(--brass), inset 0 0 0 4px rgba(79, 52, 34, 0.5); }
.unit .portrait img { width: calc(100% - 6px); height: calc(100% - 6px); border-radius: 16px; object-fit: cover; display: block; }
.unit .portrait svg.ic { width: 34px; height: 34px; }
.unit .portrait .ico { display: flex; }
#player-frame .portrait { cursor: pointer; }
.unit .portrait .lv { position: absolute; right: -9px; bottom: -7px; min-width: 28px; height: 28px; padding: 0 5px; border-radius: 999px; background: linear-gradient(#ffdf8a, var(--brass) 55%, var(--honey2)); border: 3px solid var(--wood3); color: #3a2414; font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7); }
#target-frame .portrait { background: radial-gradient(circle at 50% 35%, #fff0e0, #f4b8a8 80%); box-shadow: inset 0 0 0 3px #e8685a, inset 0 0 0 4px rgba(79, 52, 34, 0.5); color: var(--berry2); }
#target-frame.boss .portrait { box-shadow: inset 0 0 0 3px #ff9a3a, inset 0 0 0 4px rgba(79, 52, 34, 0.5), 0 0 0 3px rgba(255, 154, 58, 0.45); }
.unit .info { flex: 1; min-width: 0; margin-left: -20px; padding: 6px 12px 8px 30px; background: var(--grain) var(--paper); border: 3px solid var(--wood2); border-radius: 6px 18px 18px 6px; box-shadow: var(--lip); }
.unit .name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; white-space: nowrap; }
.unit .name b { color: var(--ink); font-weight: 900; overflow: hidden; text-overflow: ellipsis; }
.unit .name .lvl { color: var(--muted); font-size: 11px; font-weight: 800; flex-shrink: 0; }
.unit .name .lvl.grey { color: #9a9a9a; } .unit .name .lvl.green { color: #3f9a4a; } .unit .name .lvl.yellow { color: #b9801c; } .unit .name .lvl.orange { color: #d9731a; } .unit .name .lvl.red { color: #d2493c; }
.unit .bar { height: 17px; margin-top: 4px; }
.unit .bar.res { height: 13px; margin-top: 3px; } .unit .bar.res > b { font-size: 9px; line-height: 9px; }
.unit .bar.hp > i { background: linear-gradient(90deg, var(--hp-dark), var(--hp)); }
.unit .bar.hp.low > i { background: linear-gradient(90deg, #c0392b, var(--berry)); animation: lowhp 0.9s ease-in-out infinite; }
@keyframes lowhp { 50% { filter: brightness(1.35); } }
.unit .bar.res > i { background: linear-gradient(90deg, #3f86c8, var(--mana)); }
.unit .bar.res.rage > i { background: linear-gradient(90deg, #d0523f, var(--rage)); }
.unit .bar.res.energy > i { background: linear-gradient(90deg, #d9a21e, var(--energy)); }
.unit .bar.enemy-hp > i { background: linear-gradient(90deg, var(--berry2), var(--berry)); }
.unit .bar > b { font-size: 10px; line-height: 13px; }
.unit .note { font-size: 11px; margin-top: 3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.unit .buffs { position: absolute; left: 84px; top: 100%; display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; width: 220px; }
.buff { width: 26px; height: 26px; border: 2px solid var(--wood3); border-radius: 9px; background: linear-gradient(#fffdf6, var(--paper2)); color: var(--wood2); display: flex; align-items: center; justify-content: center; font-size: 10px; position: relative; margin-bottom: 11px; box-shadow: inset 0 -3px 0 rgba(139, 94, 60, 0.18); }
.buff svg.ic { width: 14px; height: 14px; }
.buff .t { position: absolute; bottom: -14px; font-size: 9px; color: #fff; text-shadow: var(--outline); width: 100%; text-align: center; font-weight: 800; }
#target-frame.hidden { display: none; }

/* ---------- HUD: where and when ---------- */
#topright { position: absolute; top: 14px; right: 14px; width: 236px; display: flex; flex-direction: column; align-items: stretch; }
#zone-info { position: relative; z-index: 2; margin: 0 16px -10px; padding: 5px 10px 7px; text-align: center; border-radius: 14px; background: var(--planks), linear-gradient(#9a6a44, #7a5032); border: 3px solid var(--wood3); box-shadow: inset 0 2px 0 rgba(255, 236, 200, 0.25), inset 0 -3px 0 rgba(0, 0, 0, 0.2), var(--shadow-sm); }
#zone-info .zone { color: #fff4dc; font-weight: 900; font-size: 15px; letter-spacing: 0.3px; text-shadow: 0 2px 0 rgba(58, 38, 24, 0.7); }
#zone-info .sub { font-size: 11px; margin-top: 2px; }
#minimap { width: 236px; height: 236px; border-radius: 26px; border: 5px solid var(--wood2); background: #9ad4f0; overflow: hidden; position: relative; box-shadow: 0 0 0 2px var(--wood3), var(--shadow); }
#minimap canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#minimap::after { content: ""; position: absolute; inset: 0; border-radius: 20px; pointer-events: none; box-shadow: inset 0 0 0 2px var(--brass), inset 0 0 0 3px rgba(79, 52, 34, 0.55), inset 0 0 22px rgba(40, 26, 16, 0.4); }
#clock { position: relative; z-index: 2; align-self: center; margin-top: -15px; display: flex; gap: 10px; align-items: center; padding: 3px 14px 4px; font-size: 12px; border-radius: 999px; background: var(--grain) var(--paper); border: 3px solid var(--wood2); box-shadow: var(--lip), var(--shadow-sm); white-space: nowrap; }
#clock .time { color: var(--ink); font-weight: 900; font-size: 15px; font-variant-numeric: tabular-nums; }
#clock .w { display: flex; align-items: center; gap: 3px; color: var(--ink2); font-size: 11px; font-weight: 700; white-space: nowrap; }
#clock .w svg.ic { width: 14px; height: 14px; color: var(--honey2); }
#events { margin-top: 8px; padding: 5px 12px 6px; font-size: 11px; border-radius: 12px; background: rgba(58, 44, 58, 0.62); color: #f6ead0; border: 2px solid rgba(255, 244, 220, 0.2); }
#events .ev { display: flex; gap: 6px; align-items: center; color: #ffd873; margin: 2px 0; font-weight: 800; }
#events .ev small { color: #d8c8b0; font-weight: 400; margin-left: auto; }
#events .muted { color: #d8c8b0; text-align: center; font-style: italic; }

/* ---------- HUD: hotbar ---------- */
#bottom { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; max-width: 98vw; }
#actionbar { position: relative; display: flex; flex-direction: column; padding: 0 16px 10px; border-radius: 24px; background: var(--planks), linear-gradient(#9a6a44, #74492c); border: 3px solid var(--wood3); box-shadow: inset 0 2px 0 rgba(255, 236, 200, 0.25), inset 0 -5px 0 rgba(0, 0, 0, 0.25), var(--shadow); }
#actionbar::before, #actionbar::after { content: ""; position: absolute; top: 50%; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe9a8, var(--brass) 45%, var(--brass2)); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
#actionbar::before { left: 4px; } #actionbar::after { right: 4px; }
#xpbar { height: 13px; margin: 8px 0 8px; background: #3a2a30; border: 2px solid var(--wood3); border-radius: 999px; position: relative; overflow: hidden; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 236, 200, 0.2); }
#xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #8a5fc8, var(--xp)); width: 0; border-radius: 999px; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.18); transition: width 0.3s; }
#xpbar u { position: absolute; top: 0; left: 0; height: 100%; background: rgba(106, 180, 234, 0.55); width: 0; }
#xpbar::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 2px), rgba(30, 18, 12, 0.55) calc(10% - 2px), rgba(30, 18, 12, 0.55) 10%); pointer-events: none; }
#xpbar b { position: absolute; inset: 0; z-index: 1; font-size: 9px; line-height: 9px; text-align: center; color: #fff; font-weight: 800; text-shadow: var(--outline); letter-spacing: 0.2px; }
#slots { display: flex; gap: 6px; align-items: flex-end; justify-content: center; }
.slot { width: 46px; height: 46px; border: 3px solid var(--line2); border-radius: 12px; background: linear-gradient(#fffdf6, var(--paper2)); position: relative; color: var(--wood2); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.08s; box-shadow: inset 0 -3px 0 rgba(139, 94, 60, 0.14); }
.slot:hover { border-color: var(--honey); transform: translateY(-2px); }
.slot svg.ic { width: 25px; height: 25px; }
.slot .key { position: absolute; top: -8px; left: -6px; min-width: 18px; height: 17px; padding: 0 4px; border-radius: 6px; background: linear-gradient(#ffdf8a, var(--brass)); border: 2px solid var(--wood3); font-size: 10px; line-height: 13px; text-align: center; color: #3a2414; font-weight: 900; z-index: 2; }
.slot .cnt { position: absolute; bottom: 0; right: 3px; font-size: 11px; color: var(--ink); font-weight: 800; text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 -1px 0 #fff; }
.slot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(40, 26, 18, 0.8) calc(var(--p, 1) * 360deg), rgba(40, 26, 18, 0.28) 0); display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; border-radius: 9px; font-weight: 900; text-shadow: var(--outline); }
.slot.nores { filter: saturate(0.25) brightness(0.78); }
.slot.empty { opacity: 0.65; }
.slot .cost { position: absolute; bottom: 0; left: 4px; font-size: 9px; color: var(--muted); font-weight: 700; }
#slots .slot { width: 52px; height: 52px; border-radius: 14px; border-color: var(--wood3); color: #fff; background: linear-gradient(#b9a894, #8a7866); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -5px 0 rgba(0, 0, 0, 0.2), 0 2px 0 rgba(0, 0, 0, 0.35); }
#slots .slot:hover { border-color: var(--wood3); filter: brightness(1.12); transform: translateY(-3px); }
#slots .slot svg.ic { width: 27px; height: 27px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
#slots .slot .cost { color: #fff; font-size: 10px; font-weight: 900; text-shadow: var(--outline); left: 5px; bottom: 1px; }
#slots .slot .cnt { color: #fff; font-size: 12px; font-weight: 900; text-shadow: var(--outline); right: 5px; bottom: 1px; }
#slots .slot.t-strike { background: linear-gradient(#f59a72, #d2503a); } #slots .slot.t-control { background: linear-gradient(#7cc4f0, #3f86c8); } #slots .slot.t-bane { background: linear-gradient(#9bd36c, #4f9436); }
#slots .slot.t-buff { background: linear-gradient(#ffd166, #d9962a); } #slots .slot.t-heal { background: linear-gradient(#8fe0a8, #3f9a5e); } #slots .slot.t-move { background: linear-gradient(#7fdcd2, #2f8f8a); }
#slots .slot.t-ward { background: linear-gradient(#b99af0, #6e4fc0); } #slots .slot.t-item { background: linear-gradient(#fffdf6, #ead9b4); color: var(--wood2); }
#slots .slot.t-item svg.ic { filter: none; } #slots .slot.t-item .cnt { color: var(--ink); text-shadow: 0 1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 -1px 0 #fff; }
#slots .slot.ready { animation: ready 0.5s ease-out; }
@keyframes ready { 0% { box-shadow: 0 0 0 0 rgba(255, 233, 168, 0.95), inset 0 3px 0 rgba(255, 255, 255, 0.35); filter: brightness(1.6); } 100% { box-shadow: 0 0 0 14px rgba(255, 233, 168, 0), inset 0 3px 0 rgba(255, 255, 255, 0.35); filter: none; } }

/* the satchel of windows, bottom right */
#menubar { position: absolute; right: 14px; bottom: 12px; display: grid; grid-template-columns: repeat(7, 36px); gap: 5px; padding: 8px 9px 10px; border-radius: 18px; background: var(--planks), linear-gradient(#9a6a44, #74492c); border: 3px solid var(--wood3); box-shadow: inset 0 2px 0 rgba(255, 236, 200, 0.25), inset 0 -4px 0 rgba(0, 0, 0, 0.25), var(--shadow); }
.mbtn { width: 36px; height: 36px; border: 2px solid var(--wood3); border-radius: 11px; background: linear-gradient(#fffdf6, var(--paper3)); color: var(--wood2); display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; transition: transform 0.08s; box-shadow: inset 0 -3px 0 rgba(139, 94, 60, 0.22), 0 2px 0 rgba(0, 0, 0, 0.3); }
.mbtn:hover { background: #fff; color: var(--berry2); transform: translateY(-2px); }
.mbtn svg.ic { width: 18px; height: 18px; }
.mbtn .k { position: absolute; right: -4px; bottom: -5px; min-width: 14px; height: 13px; padding: 0 3px; border-radius: 5px; background: var(--wood3); color: #ffe9b8; font-size: 8px; line-height: 13px; font-weight: 900; text-align: center; }
.mbtn .dot { position: absolute; top: -5px; right: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--berry); border: 2px solid #fff8e8; animation: atkPulse 1.2s ease-in-out infinite; }
#castbar { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); width: 320px; text-align: center; }
#castbar .bar { height: 18px; } #castbar .bar > i { background: linear-gradient(90deg, var(--honey2), var(--honey)); transition: none; }
#castbar .lbl { display: inline-block; font-size: 12px; color: #fff; margin-bottom: 4px; font-weight: 800; text-shadow: var(--outline); }
#prompt { position: absolute; left: 50%; bottom: 184px; transform: translateX(-50%); padding: 5px 16px 5px 6px; border-radius: 999px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 8px; pointer-events: none; white-space: nowrap; animation: promptIn 0.18s ease-out; }
#prompt .kbd { font-size: 12px; padding: 2px 8px; }
@keyframes promptIn { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- HUD: chronicle ---------- */
#chat { position: absolute; left: 14px; bottom: 14px; width: 400px; height: 176px; padding: 7px 10px 6px; display: flex; flex-direction: column; background: rgba(255, 248, 232, 0.84); transition: background 0.2s; }
#chat:hover { background: rgba(255, 248, 232, 0.96); }
#chat .tabs { display: flex; gap: 6px; margin-bottom: 4px; padding: 0; border: none; }
#chat .tabs span { font-size: 11px; color: var(--muted); cursor: pointer; padding: 1px 9px; border-radius: 999px; border: none; background: transparent; }
#chat .tabs span.on { color: #fff4dc; background: var(--wood); font-weight: 800; }
#chatlog { flex: 1; overflow-y: auto; font-size: 12px; line-height: 1.45; }
#chatlog p { margin: 0 0 1px; }
#chatlog .system, .system { color: #8a6a1c; } #chatlog .combat, .combat { color: #c0502a; } #chatlog .loot, .loot { color: #3f8a3a; } #chatlog .quest, .quest { color: #a0760c; font-weight: 700; } #chatlog .level, .level { color: #a03ab0; font-weight: 700; } #chatlog .zone, .zone { color: #2b74c9; } #chatlog .death, .death { color: #c0392b; } #chatlog .boss, .boss { color: #d9731a; font-weight: 800; } #chatlog .achievement, .achievement, #chatlog .title { color: #a0760c; font-weight: 700; } #chatlog .talent, .talent { color: #a03ab0; } #chatlog .mastery, .mastery { color: #8a6a1c; } #chatlog .daily, .daily { color: #3f8a3a; } #chatlog .travel, .travel, #chatlog .adventure, .adventure { color: #2b74c9; } #chatlog .npc, .npc { color: var(--ink); }
#chatlog .npc b { color: var(--wood2); }

/* ---------- HUD: quest notes ---------- */
#tracker { position: relative; margin: 18px 4px 0; font-size: 12px; background: #fffdf2; border: 2px solid var(--line2); border-radius: 4px 4px 14px 4px; padding: 12px 12px 6px; box-shadow: 0 2px 0 rgba(74, 54, 40, 0.2), 0 8px 16px rgba(74, 54, 40, 0.25); transform: rotate(0.7deg); background-image: repeating-linear-gradient(transparent, transparent 19px, rgba(201, 173, 124, 0.22) 19px, rgba(201, 173, 124, 0.22) 20px); }
#tracker:empty { display: none; }
#tracker::before { content: ""; position: absolute; top: -8px; left: 50%; width: 52px; height: 16px; margin-left: -26px; background: rgba(242, 181, 58, 0.8); border-radius: 2px; transform: rotate(-2deg); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12); }
#tracker h4 { margin: 0 0 6px; color: var(--wood2); font-size: 13px; font-weight: 900; display: flex; align-items: center; gap: 6px; }
#tracker h4 svg.ic { width: 14px; height: 14px; }
#tracker .q { margin-bottom: 8px; }
#tracker .q .qn { color: var(--ink); font-weight: 800; }
#tracker .q .o { color: var(--ink2); padding-left: 16px; position: relative; }
#tracker .q .o::before { content: ""; position: absolute; left: 2px; top: 3px; width: 8px; height: 8px; border: 2px solid var(--line2); border-radius: 3px; background: #fff; }
#tracker .q .o.done { color: var(--muted); text-decoration: line-through; }
#tracker .q .o.done::before { background: var(--leaf); border-color: var(--leaf2); }

/* ---------- floating text, messages, banners ---------- */
#floaters { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ft { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 17px; text-shadow: var(--outline); white-space: nowrap; animation: ftUp 1.3s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; pointer-events: none; font-family: var(--round); }
.ft.dmg { color: #fff; } .ft.crit { color: #ffd84a; font-size: 26px; animation-duration: 1.5s; } .ft.miss { color: #dcd6e6; font-size: 14px; } .ft.heal { color: #a6f58a; } .ft.xp { color: #d8b8ff; font-size: 14px; } .ft.loot { color: #ffd84a; font-size: 14px; } .ft.enemyDmg { color: #ff8a7a; } .ft.gather { color: #fff0b8; font-size: 14px; } .ft.status { color: #a8dcff; font-size: 14px; } .ft.absorb { color: #d8c4ff; font-size: 14px; }
@keyframes ftUp { 0% { opacity: 0; margin-top: 14px; transform: translate(-50%, -50%) scale(0.5); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); } 26% { transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; margin-top: -64px; } }
#msg { position: absolute; left: 50%; top: 28%; transform: translateX(-50%); color: #fff; font-size: 17px; font-weight: 800; text-shadow: var(--outline); pointer-events: none; opacity: 0; transition: opacity 0.2s; text-align: center; }
#zone-banner { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; white-space: nowrap; }
#zone-banner .z { font-size: 44px; color: #fff4dc; letter-spacing: 2px; font-weight: 900; text-shadow: 0 2px 0 #3a2c3a, 0 -2px 0 #3a2c3a, 2px 0 0 #3a2c3a, -2px 0 0 #3a2c3a, 2px 2px 0 #3a2c3a, -2px 2px 0 #3a2c3a, 2px -2px 0 #3a2c3a, -2px -2px 0 #3a2c3a, 0 5px 0 #3a2c3a, 0 9px 14px rgba(30, 18, 12, 0.5); }
#zone-banner .rule { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; color: var(--brass); }
#zone-banner .rule::before, #zone-banner .rule::after { content: ""; width: 90px; height: 4px; border-radius: 2px; background: var(--brass); box-shadow: var(--outline); }
#zone-banner .rule svg.ic { width: 20px; height: 20px; filter: drop-shadow(0 2px 0 #3a2c3a); }
#zone-banner .r { margin-top: 8px; }
#zone-banner.show { animation: banner 4s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 12px) scale(0.92); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.03); } 18% { transform: translate(-50%, 0) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
#toasts { position: absolute; left: 50%; top: 104px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 7px 22px 8px 9px; text-align: left; animation: toastIn 4.5s ease-out forwards; border-radius: 999px; }
.toast .ti { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(#b9a894, #8a7866); border: 2px solid var(--wood3); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.toast .ti svg.ic { width: 18px; height: 18px; }
.toast .t { color: var(--ink); font-size: 15px; font-weight: 900; }
.toast .s { color: var(--ink2); font-size: 12px; }
.toast.levelup { border-color: #6e4fc0; } .toast.levelup .t { color: #7a3ab8; } .toast.levelup .ti { background: linear-gradient(#b99af0, #6e4fc0); }
.toast.ach { border-color: var(--brass2); } .toast.ach .t { color: var(--gold2); } .toast.ach .ti { background: linear-gradient(#ffd166, #d9962a); }
.toast.boss { border-color: #b8501a; } .toast.boss .t { color: #d9731a; font-size: 18px; } .toast.boss .ti { background: linear-gradient(#f59a72, #d2503a); }
@keyframes toastIn { 0% { opacity: 0; transform: translateY(-12px) scale(0.9); } 6% { opacity: 1; transform: translateY(0) scale(1.04); } 10% { transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }
#flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
#death { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(58, 44, 58, 0.35), rgba(30, 18, 24, 0.78)); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
#death h2 { color: #fff4dc; font-size: 46px; margin: 0; font-weight: 900; letter-spacing: 2px; text-shadow: 0 2px 0 #3a2c3a, 0 -2px 0 #3a2c3a, 2px 0 0 #3a2c3a, -2px 0 0 #3a2c3a, 0 6px 0 #3a2c3a, 0 10px 16px rgba(0, 0, 0, 0.5); }
#death p { max-width: 520px; text-align: center; color: var(--ink); font-size: 15px; line-height: 1.5; background: var(--grain) var(--paper); border: 3px solid var(--wood2); border-radius: 16px; padding: 14px 20px; margin: 0; box-shadow: var(--lip), var(--shadow); }
#vignette { display: none; }

/* ---------- nameplates ---------- */
#plates { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.plate { position: absolute; transform: translate(-50%, -100%); text-align: center; pointer-events: none; white-space: nowrap; font-weight: 800; }
.plate .n { font-size: 12px; text-shadow: var(--outline); color: #ffb4a8; }
.plate.npc .n { color: #fff3c4; } .plate.node .n { color: #e4ffb0; } .plate.friendly .n { color: #b8f5a8; }
.plate .t { font-size: 10px; color: #f0e8d8; text-shadow: var(--outline); font-weight: 700; }
.plate .hp { width: 70px; height: 9px; background: #3a2c3a; border: 2px solid #3a2c3a; border-radius: 999px; margin: 2px auto 0; overflow: hidden; }
.plate .hp i { display: block; height: 100%; background: linear-gradient(var(--berry), var(--berry2)); border-radius: 999px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.plate.target .n { color: #fff; font-size: 13px; } .plate.target .hp { width: 92px; height: 11px; border-color: #ffd84a; }
.plate.boss .n { color: #ffb070; font-size: 14px; }
.plate .lvl { font-size: 10px; color: #f0e8d8; }

/* ---------- tooltip ---------- */
#tooltip { position: fixed; z-index: 1000; max-width: 300px; padding: 9px 13px 10px; font-size: 12px; line-height: 1.45; pointer-events: none; border-radius: 12px; border-width: 2px; border-color: var(--wood3); box-shadow: var(--lip), 0 3px 0 rgba(58, 38, 24, 0.5), 0 10px 22px rgba(40, 26, 16, 0.4); }
#tooltip .tt-name { font-size: 14px; font-weight: 900; }
#tooltip .tt-sub { color: var(--muted); font-weight: 700; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 2px dotted var(--line); }
#tooltip .tt-stat { color: var(--ink); } #tooltip .tt-req { color: var(--danger); } #tooltip .tt-req.ok { color: var(--good); } #tooltip .tt-mod { color: var(--good); } #tooltip .tt-flavour { color: var(--gold); font-style: italic; margin-top: 4px; } #tooltip .tt-val { color: var(--muted); margin-top: 3px; }

/* ---------- windows ---------- */
.win { position: absolute; display: flex; flex-direction: column; min-width: 340px; max-width: 96vw; max-height: 90vh; z-index: 20; animation: winIn 0.16s ease-out; border-color: var(--wood3); }
@keyframes winIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.win .hd { display: flex; align-items: center; gap: 10px; padding: 8px 10px 9px 16px; cursor: move; background: var(--planks), linear-gradient(#9a6a44, #7a5032); border-radius: 12px 12px 0 0; margin: -1px -1px 0; border-bottom: 3px solid var(--wood3); box-shadow: inset 0 2px 0 rgba(255, 236, 200, 0.25); position: relative; z-index: 1; }
.win .hd .title { flex: 1; color: #fff4dc; font-weight: 900; font-size: 16px; letter-spacing: 0.4px; text-shadow: 0 2px 0 rgba(58, 38, 24, 0.7); display: flex; align-items: center; gap: 8px; }
.win .hd > svg.ic { width: 19px; height: 19px; flex-shrink: 0; color: #ffd873; filter: drop-shadow(0 2px 0 rgba(58, 38, 24, 0.8)); }
.win .hd .x { width: 26px; height: 26px; border: 2px solid var(--wood3); border-radius: 50%; background: linear-gradient(#f0806f, var(--berry2)); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; font-weight: 900; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4); transition: transform 0.08s; }
.win .hd .x:hover { filter: brightness(1.12); transform: scale(1.1); }
.win .bd { flex: 1; overflow: auto; padding: 12px 14px; }
.win .ft { position: static; transform: none; animation: none; text-shadow: none; font-weight: normal; font-size: 13px; padding: 8px 12px; border-top: 2px solid var(--line); display: flex; gap: 8px; align-items: center; white-space: normal; color: var(--ink); }
.tabs { display: flex; gap: 4px; padding: 0 0 8px; border-bottom: 2px dashed var(--line); flex-wrap: wrap; }
.tabs span { padding: 4px 13px; cursor: pointer; color: var(--ink2); border: 2px solid var(--line2); border-bottom-width: 3px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #fff; }
.tabs span.on { color: #fff4dc; background: linear-gradient(#a3754c, var(--wood)); border-color: var(--wood3); }
.tabs span:hover { border-color: var(--wood-light); }
h3.sec { margin: 12px 0 6px; font-size: 13px; color: var(--wood); font-weight: 800; border-bottom: 2px dashed var(--line); padding-bottom: 3px; }
h3.sec:first-child { margin-top: 0; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 2px solid transparent; border-radius: 12px; }
.list-row:hover { background: #fff; border-color: var(--line); }
.list-row .ico, .recipe .ico { width: 34px; height: 34px; border: 2px solid var(--line2); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--wood); flex-shrink: 0; }
.list-row .ico svg.ic, .recipe .ico svg.ic { width: 19px; height: 19px; }
.list-row .txt { flex: 1; min-width: 0; }
.list-row .txt b { display: block; }
.list-row .txt small { color: var(--muted); display: block; }
.list-row.locked { opacity: 0.55; }

/* bags */
.bag { display: grid; grid-template-columns: repeat(8, 46px); gap: 5px; }
.bag .slot { cursor: pointer; }
.slot.q1 { border-color: var(--line2); } .slot.q2 { border-color: #6fbf6a; background: #f3fbee; } .slot.q3 { border-color: #5aa8e8; background: #eef6fd; } .slot.q4 { border-color: #a97ae0; background: #f6f0fd; } .slot.q5 { border-color: #f09a3a; background: #fef4e6; }
.inv-filters { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.inv-filters span { font-size: 11px; padding: 2px 10px; border: 2px solid var(--line); border-radius: 999px; cursor: pointer; color: var(--ink2); background: #fff; font-weight: 700; }
.inv-filters span.on { color: #fff; border-color: var(--wood2); background: var(--wood); }
.purse { display: flex; align-items: center; gap: 6px; color: var(--gold); font-weight: 800; }

/* character sheet */
.paperdoll { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: start; }
.paperdoll .col { display: flex; flex-direction: column; gap: 6px; }
.paperdoll .model { text-align: center; }
.paperdoll .model img, .paperdoll .model canvas.preview { width: 100%; max-width: 230px; height: 258px; object-fit: contain; border: 3px solid var(--line); border-radius: 16px; background: linear-gradient(#bfe6fa 0%, #e8f6d8 70%, #a9db7a 70%); }
.eq { width: 52px; height: 52px; }
.eq .lbl { position: absolute; bottom: -12px; font-size: 9px; color: var(--muted); width: 100%; text-align: center; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; font-size: 13px; }
.stats div { display: flex; justify-content: space-between; border-bottom: 2px dotted var(--line); padding: 3px 0; }
.stats div span:last-child { color: var(--wood2); font-weight: 800; }

/* skills */
.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 14px; }
.skill { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 12px; cursor: pointer; }
.skill:hover { background: #fff; }
.skill .ico { width: 28px; height: 28px; color: var(--wood); display: flex; align-items: center; justify-content: center; }
.skill .ico svg.ic { width: 20px; height: 20px; }
.skill .nm { flex: 1; font-size: 13px; font-weight: 700; }
.skill .nm small { color: var(--muted); display: block; font-size: 10px; font-weight: 400; }
.skill .lv { font-weight: 800; color: var(--wood2); min-width: 30px; text-align: right; }
.skill .lv.mastered { color: var(--honey2); }
.skill .bar { width: 90px; height: 10px; }
.skill .bar > i { background: var(--leaf); }
.skill.mastered .bar > i { background: var(--honey); }

/* talents */
.trees { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tree { border: 2px solid var(--line); border-radius: 14px; padding: 8px; background: #fff; }
.tree h4 { margin: 0 0 6px; color: var(--wood2); text-align: center; font-size: 14px; font-weight: 800; }
.tree h4 small { display: block; color: var(--muted); font-weight: normal; font-size: 11px; }
.talent { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 10px; cursor: pointer; }
.talent:hover { background: var(--paper2); }
.talent .rk { width: 36px; height: 36px; border: 3px solid var(--line2); border-radius: 10px; background: var(--paper); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--wood2); font-size: 13px; flex-shrink: 0; }
.talent.max .rk { border-color: var(--honey2); background: #fff2cc; color: var(--gold2); }
.talent.locked .rk { opacity: 0.4; }
.talent .tn { font-size: 12px; font-weight: 700; } .talent .tn small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; }

/* quests */
.quest-cols { display: grid; grid-template-columns: 240px 1fr; gap: 12px; min-height: 380px; }
.quest-list { border-right: 2px dashed var(--line); padding-right: 8px; overflow: auto; max-height: 60vh; }
.quest-list .qi { padding: 5px 10px; cursor: pointer; border-radius: 10px; font-size: 13px; color: var(--ink); font-weight: 700; }
.quest-list .qi:hover, .quest-list .qi.on { background: #fff; color: var(--wood2); }
.quest-list .qi small { color: var(--muted); font-size: 10px; display: block; font-weight: 400; }
.quest-list .qi.story small { color: var(--plum); }
.parchment { background: #fffdf4; color: var(--ink); border: 2px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.55; background-image: repeating-linear-gradient(transparent, transparent 25px, rgba(201, 173, 124, 0.18) 25px, rgba(201, 173, 124, 0.18) 26px); }
.parchment h2 { margin: 0 0 6px; color: var(--wood2); font-size: 19px; font-weight: 800; }
.parchment h3 { margin: 12px 0 4px; font-size: 13px; color: var(--wood); border-bottom: 2px dashed var(--line); font-weight: 800; }
.parchment .obj { margin: 2px 0; }
.parchment .obj.done { color: var(--good); }
.parchment .obj.done::before { content: "✓ "; }
.parchment .tag { display: inline-block; font-size: 10px; padding: 1px 8px; border-radius: 999px; background: var(--wood-light); color: #fff; margin-right: 4px; font-weight: 700; }
.parchment .tag.story { background: var(--plum); } .parchment .tag.faction { background: var(--sky); } .parchment .tag.class { background: var(--berry); }
.parchment .rw { display: flex; gap: 10px; flex-wrap: wrap; }
.parchment p { margin: 6px 0; }

/* workshop */
.recipe-grid { display: grid; grid-template-columns: 1fr; gap: 3px; }
.recipe { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; padding: 5px 8px; border: 2px solid transparent; border-radius: 12px; font-size: 13px; }
.recipe:hover { border-color: var(--line); background: #fff; }
.recipe.locked { opacity: 0.5; }
.recipe .ins { font-size: 11px; color: var(--muted); }
.recipe .ins .no { color: var(--danger); }
.recipe .qty { display: flex; gap: 3px; align-items: center; }
.recipe .qty input { width: 48px; padding: 3px; background: #fff; border: 2px solid var(--line2); color: var(--ink); border-radius: 8px; font-size: 12px; text-align: center; }
.ws-progress { margin-top: 8px; }
.ws-progress .bar { height: 14px; } .ws-progress .bar > i { background: var(--honey); }

/* vendor */
.vendor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.vendor-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 12px; cursor: pointer; border: 2px solid transparent; }
.vendor-item:hover { border-color: var(--line); background: #fff; }
.vendor-item .price { color: var(--gold); font-size: 12px; white-space: nowrap; font-weight: 800; }
.vendor-item .nm { flex: 1; font-size: 13px; font-weight: 700; }
.vendor-item .nm small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; }
.qty-row { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.qty-row input[type=range] { flex: 1; accent-color: var(--leaf); }
.qty-row input[type=number] { width: 70px; padding: 4px; background: #fff; border: 2px solid var(--line2); color: var(--ink); border-radius: 8px; }

/* talking to people */
#dialog { position: absolute; left: 50%; bottom: 190px; transform: translateX(-50%); width: min(560px, 92vw); padding: 22px 18px 14px; animation: winIn 0.16s ease-out; }
#dialog .who { position: absolute; top: -16px; left: 18px; background: var(--wood); color: #fff4dc; font-weight: 800; font-size: 14px; padding: 4px 14px; border-radius: 999px; border: 3px solid var(--wood2); }
#dialog .who small { color: #f0d8b0; font-weight: 400; margin-left: 8px; font-size: 11px; }
#dialog .say { color: var(--ink); margin: 2px 0 12px; line-height: 1.55; font-size: 14px; }
#dialog .opts { display: flex; flex-direction: column; gap: 5px; }
#dialog .opt { padding: 6px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; background: #fff; font-weight: 700; transition: transform 0.06s; }
#dialog .opt:hover { border-color: var(--leaf); transform: translateX(3px); }
#dialog .opt .mk { font-weight: 800; width: 18px; text-align: center; color: var(--muted); }
#dialog .opt .mk.avail { color: var(--honey2); } #dialog .opt .mk.done { color: var(--good); } #dialog .opt .mk.active { color: var(--muted); }

/* library */
.lib-cols { display: grid; grid-template-columns: 220px 1fr; gap: 12px; min-height: 400px; }
.lib-nav { border-right: 2px dashed var(--line); padding-right: 8px; max-height: 65vh; overflow: auto; }
.lib-nav h5 { margin: 8px 0 3px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.lib-nav .pg { display: block; padding: 3px 10px; cursor: pointer; border-radius: 8px; font-size: 13px; }
.lib-nav .pg:hover, .lib-nav .pg.on { background: #fff; color: var(--wood2); font-weight: 700; }
.lib-page { max-height: 65vh; overflow: auto; font-size: 14px; line-height: 1.6; }
.lib-page h1 { font-size: 21px; margin: 0 0 8px; color: var(--wood2); }
.lib-page h2 { font-size: 16px; margin: 14px 0 4px; color: var(--wood2); border-bottom: 2px dashed var(--line); }
.lib-page h3 { font-size: 14px; margin: 10px 0 3px; color: var(--wood); }
.lib-page table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 13px; }
.lib-page th, .lib-page td { border: 1px solid var(--line2); padding: 3px 8px; text-align: left; }
.lib-page th { background: var(--paper2); }
.lib-page a.wl { color: #2b74c9; cursor: pointer; text-decoration: underline; }
.lib-page a.wl.broken { color: var(--danger); }
.lib-page blockquote { margin: 8px 0; padding: 6px 12px; border-left: 4px solid var(--honey); background: #fff6dc; border-radius: 0 8px 8px 0; }
.lib-page code { background: var(--paper2); padding: 0 4px; border-radius: 4px; }

/* map */
#mapcanvas { width: 100%; max-width: 900px; aspect-ratio: 10 / 7; display: block; border: 4px solid var(--wood); border-radius: 14px; background: #9ad4f0; cursor: crosshair; image-rendering: pixelated; }
.map-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--ink2); margin-top: 8px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; border: 1px solid rgba(58, 44, 58, 0.5); }

/* achievements */
.ach { display: flex; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 12px; }
.ach.locked { opacity: 0.5; }
.ach .ico { width: 34px; height: 34px; border: 2px solid var(--honey2); border-radius: 50%; background: #fff2cc; display: flex; align-items: center; justify-content: center; color: var(--gold2); flex-shrink: 0; }
.ach.locked .ico { border-color: var(--line2); background: #fff; color: var(--muted); }
.ach .ico svg.ic { width: 18px; height: 18px; }
.ach b { display: block; font-size: 13px; } .ach small { color: var(--muted); }

/* settings */
.setting { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 2px dotted var(--line); font-size: 13px; }
.setting label { color: var(--ink); font-weight: 700; }
.setting label small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.setting input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--leaf); }
.setting select { padding: 3px 8px; border: 2px solid var(--line2); border-radius: 999px; background: #fff; font-weight: 700; }
.kbd { font-family: var(--round); font-size: 11px; background: #fff; border: 2px solid var(--line2); border-bottom-width: 3px; border-radius: 7px; padding: 0 6px; color: var(--ink); font-weight: 800; white-space: nowrap; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 12px; align-items: center; }
.help-grid .kbd { justify-self: start; }
.savebox { width: 100%; height: 80px; margin-top: 8px; background: #fff; color: var(--ink2); border: 2px solid var(--line2); border-radius: 10px; font-size: 10px; padding: 6px; }

/* away summary / daily */
.summary { font-size: 13px; }
.summary li { margin: 3px 0; }
#help-hint { position: absolute; left: 50%; bottom: 236px; transform: translateX(-50%); font-size: 12px; color: #fff; font-weight: 700; text-shadow: var(--outline); pointer-events: none; text-align: center; max-width: min(640px, 60vw); line-height: 1.7; background: rgba(58, 44, 58, 0.42); padding: 4px 16px; border-radius: 16px; }
#help-hint:empty { display: none; }
#help-hint b { color: #ffe9a8; }

/* ---------- online: the front door ---------- */
.auth-card { max-width: 440px; margin: 6px auto 0; background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.auth-card.wide { max-width: 640px; }
.auth-card h2 { margin: 14px 0 6px; }
.fld { display: block; margin-bottom: 9px; }
.fld span { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 800; color: var(--wood); margin-bottom: 3px; }
.fld span small { font-weight: 400; color: var(--muted); font-size: 11px; }
.fld input { width: 100%; font-size: 15px; padding: 7px 13px; background: var(--paper); border: 3px solid var(--line2); border-radius: 999px; outline: none; font-weight: 700; user-select: text; -webkit-user-select: text; }
.fld input:focus { border-color: var(--leaf); background: #fff; }
.fld-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; margin: 4px 0 2px; cursor: pointer; }
.chk small { color: var(--muted); font-weight: 400; }
.chk input { width: 17px; height: 17px; accent-color: var(--leaf); }
.auth-err { background: #fde4dc; border: 2px solid #e8a898; color: #8a2a1a; border-radius: 12px; padding: 7px 12px; font-size: 13px; font-weight: 700; margin-top: 10px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--ink2); margin-top: 16px; }
.auth-foot a { color: #2b74c9; cursor: pointer; text-decoration: underline; }
pre.cfg { background: #3a2c3a; color: #ffe9a8; border-radius: 12px; padding: 12px; font-size: 11px; overflow: auto; max-height: 220px; user-select: text; -webkit-user-select: text; margin-top: 12px; }
code { background: var(--paper2); padding: 0 4px; border-radius: 4px; }

/* ---------- online: who is about ---------- */
#netinfo { margin-top: 8px; border-width: 2px; box-shadow: var(--lip), var(--shadow-sm); padding: 3px 12px; font-size: 11px; border-radius: 999px; display: flex; align-items: center; gap: 6px; justify-content: center; cursor: pointer; color: var(--ink2); }
#netinfo .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 2px rgba(111, 179, 74, 0.25); }
#netinfo.down { border-color: var(--berry2); color: var(--berry2); font-weight: 800; }
#netinfo.down .dot { background: var(--berry); box-shadow: none; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }
.plate.player .n { color: #bfe6ff; font-size: 13px; }
.plate.player.friend .n { color: #b8f5a8; }
.plate.player.admin .n { color: #ffd84a; }
.plate .say { display: inline-block; max-width: 230px; white-space: normal; background: var(--paper); color: var(--ink); border: 2px solid #3a2c3a; border-radius: 12px; padding: 3px 10px; font-size: 12px; font-weight: 700; line-height: 1.3; margin-bottom: 5px; position: relative; text-shadow: none; animation: sayIn 0.18s ease-out; }
.plate .say::after { content: ""; position: absolute; left: 50%; bottom: -7px; margin-left: -5px; border: 5px solid transparent; border-top-color: #3a2c3a; border-bottom: 0; }
@keyframes sayIn { from { opacity: 0; transform: translateY(6px) scale(0.9); } to { opacity: 1; transform: none; } }

/* ---------- online: chat ---------- */
#chat.online { height: 214px; }
#chatlog { user-select: text; -webkit-user-select: text; }
#chatlog.f-said p.told, #chatlog.f-told p.said { display: none; }
#chatlog .tag { display: inline-block; font-size: 9px; font-weight: 800; padding: 0 6px; border-radius: 999px; color: #fff; vertical-align: 1px; text-transform: uppercase; letter-spacing: 0.4px; background: var(--muted); }
#chatlog .tag.t-global { background: var(--sky); } #chatlog .tag.t-zone { background: var(--leaf2); } #chatlog .tag.t-friends { background: var(--plum); } #chatlog .tag.t-whisper { background: var(--berry); } #chatlog .tag.t-system, #chatlog .tag.t-gift { background: var(--honey2); } #chatlog .tag.t-loot { background: var(--leaf2); }
#chatlog p.said { color: var(--ink); }
#chatlog p.c-whisper { color: #a8324a; } #chatlog p.c-friends { color: #5d3fa0; } #chatlog p.c-zone { color: #2f6a1e; } #chatlog p.c-emote { color: #8a6a1c; } #chatlog p.c-note { color: var(--ink2); }
#chatlog p.c-announce { background: #fff2cc; border: 2px solid var(--honey); border-radius: 10px; padding: 3px 8px; margin: 3px 0; color: #6a4a08; }
#chatlog a.who { font-weight: 800; color: var(--wood2); cursor: pointer; }
#chatlog a.who:hover { text-decoration: underline; color: var(--sky); }
#chatlog b.me { color: var(--wood); }
#chatbar { display: flex; gap: 5px; margin-top: 4px; }
#chatbar .chan { border: 0; border-radius: 999px; padding: 0 11px; font-size: 11px; font-weight: 800; color: #fff; background: var(--sky); height: 25px; white-space: nowrap; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
#chatbar .chan.zone { background: var(--leaf2); } #chatbar .chan.friends { background: var(--plum); } #chatbar .chan.whisper { background: var(--berry); }
#chatbar input { flex: 1; min-width: 0; height: 25px; border: 2px solid var(--line2); border-radius: 999px; padding: 0 11px; font-size: 12px; background: rgba(255, 255, 255, 0.7); outline: none; user-select: text; -webkit-user-select: text; }
#chat.typing { background: var(--paper); } #chat.typing #chatbar input { border-color: var(--leaf); background: #fff; }
#announce { position: absolute; left: 50%; top: 58px; transform: translate(-50%, -140%); opacity: 0; pointer-events: none; transition: transform 0.45s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.3s; z-index: 60; width: min(720px, 92vw); }
#announce.show { transform: translate(-50%, 0); opacity: 1; }
#announce .ribbon { display: flex; align-items: center; gap: 12px; background: var(--honey); border: 3px solid #3a2c3a; border-radius: 16px; padding: 10px 18px; box-shadow: 0 5px 0 rgba(58, 44, 58, 0.45), 0 14px 30px rgba(58, 44, 58, 0.35); color: #3a2c3a; }
#announce .ribbon svg.ic { width: 30px; height: 30px; flex-shrink: 0; animation: ring 0.9s ease-in-out 3; }
#announce small { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; opacity: 0.7; }
#announce b { font-size: 18px; font-weight: 900; line-height: 1.25; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-16deg); } 75% { transform: rotate(16deg); } }

/* ---------- online: people, trades, the admin desk ---------- */
#pmenu { position: fixed; z-index: 900; width: 190px; padding: 8px; display: flex; flex-direction: column; gap: 4px; border-width: 2px; animation: winIn 0.12s ease-out; }
#pmenu .hd { padding: 2px 6px 6px; border-bottom: 2px dashed var(--line); margin-bottom: 2px; }
#pmenu .hd b { display: block; color: var(--wood2); } #pmenu .hd small { color: var(--muted); font-size: 11px; }
#pmenu .btn { text-align: left; display: flex; align-items: center; gap: 8px; }
#modal { position: fixed; inset: 0; background: rgba(58, 44, 58, 0.5); display: flex; align-items: center; justify-content: center; z-index: 950; }
#modal .card { width: min(440px, 90vw); padding: 20px 24px; text-align: center; animation: winIn 0.16s ease-out; }
#modal h2 { margin: 0 0 8px; color: var(--wood2); font-weight: 900; } #modal p { margin: 0 0 16px; line-height: 1.5; color: var(--ink); }
.list-row .ico.on { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(111, 179, 74, 0.2); } .list-row .ico.off { opacity: 0.5; }
.list-row.person .btn { flex-shrink: 0; } .list-row.on { background: #fff; border-color: var(--wood-light); }
.ico-lg { width: 44px; height: 44px; border-radius: 14px; border: 3px solid var(--line2); background: #fff; display: flex; align-items: center; justify-content: center; color: var(--wood); } .ico-lg svg.ic { width: 24px; height: 24px; }
.profile { display: grid; grid-template-columns: 180px 1fr; gap: 14px; }
.profile canvas.preview { width: 100%; height: 220px; border: 3px solid var(--line); border-radius: 16px; background: linear-gradient(#bfe6fa 0%, #e8f6d8 70%, #a9db7a 70%); }
.skill-grid.mini { grid-template-columns: repeat(4, 1fr); gap: 2px 8px; } .skill-grid.mini .skill { cursor: default; padding: 2px 4px; } .skill-grid.mini .nm { font-size: 11px; } .skill-grid.mini .ico { width: 20px; height: 20px; } .skill-grid.mini .ico svg.ic { width: 15px; height: 15px; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trade-cols .side { border: 3px solid var(--line); border-radius: 14px; padding: 8px 10px; background: #fff; min-height: 128px; transition: border-color 0.15s, background 0.15s; }
.trade-cols .side.ready { border-color: var(--leaf); background: #f3fbee; }
.trade-cols h4 { margin: 0 0 6px; font-size: 13px; color: var(--wood2); font-weight: 800; }
.bag.offer { grid-template-columns: repeat(5, 46px); margin-top: 6px; min-height: 46px; }
.trade-state { margin-top: 8px; text-align: center; font-weight: 800; color: var(--wood); background: var(--paper2); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.bag.lockedbag { opacity: 0.45; pointer-events: none; }
.pwform { display: flex; gap: 6px; flex-wrap: wrap; } .pwform input, .admin-detail input, .admin-detail select, .mod-form input, .mod-form select { padding: 4px 10px; border: 2px solid var(--line2); border-radius: 999px; background: #fff; font-size: 12px; user-select: text; -webkit-user-select: text; } .pwform input { flex: 1; min-width: 140px; }
.admin-cols { display: grid; grid-template-columns: 290px 1fr; gap: 12px; min-height: 380px; }
.admin-list { border-right: 2px dashed var(--line); padding-right: 8px; max-height: 62vh; overflow: auto; } .admin-list .arow { cursor: pointer; padding: 4px 6px; }
.admin-detail { max-height: 62vh; overflow: auto; }
.grant .row { margin-bottom: 5px; flex-wrap: wrap; } .grant .lbl { width: 76px; font-size: 12px; font-weight: 800; color: var(--wood); } .grant input[type=number] { width: 110px; } .grant .g-item { flex: 1; min-width: 140px; }


/* ---------- the basic attack, and a controller in hand ---------- */
#slots .slot.atk { width: 62px; height: 62px; border-radius: 18px; background: linear-gradient(#f58a78, #c9402f); color: #fff; }
#slots .slot.atk svg.ic { width: 33px; height: 33px; }
#slots .slot.atk.on { background: linear-gradient(#ffb09a, #e0503c); border-color: #3a2c3a; animation: atkPulse 1.1s ease-in-out infinite; }
.slot.atk .sweep { position: absolute; left: 7px; right: 7px; bottom: 5px; height: 6px; background: rgba(58, 44, 58, 0.45); border-radius: 999px; overflow: hidden; }
.slot.atk .sweep i { display: block; height: 100%; width: 0; background: #ffe27a; border-radius: 999px; }
.slot-gap { width: 3px; align-self: stretch; margin: 6px 3px; background: rgba(58, 38, 24, 0.45); border-radius: 2px; box-shadow: 1px 0 0 rgba(255, 236, 200, 0.2); }
@keyframes atkPulse { 50% { box-shadow: 0 0 0 6px rgba(232, 104, 90, 0.35); } }
.padkey { background: #3a2c3a !important; color: #fff8e8 !important; border-color: #3a2c3a !important; border-radius: 999px !important; letter-spacing: 0.3px; }
.slot .key.padkey { font-size: 8px; left: 50%; transform: translateX(-50%); top: -10px; white-space: nowrap; padding: 0 5px; }
.padfocus { outline: 4px solid var(--honey) !important; outline-offset: 2px; box-shadow: 0 0 0 8px rgba(242, 181, 58, 0.3) !important; position: relative; z-index: 5; }
body.pad #help-hint { display: none; }

/* responsive */
/* On narrower screens the chronicle climbs above the hotbar instead of hiding behind it, and the satchel folds up */
@media (max-width: 1500px) { #chat { width: 320px; height: 132px; bottom: 126px; } #chat.online { height: 176px; } #help-hint { max-width: min(560px, 46vw); } }
@media (max-width: 1280px) { #menubar { grid-template-columns: repeat(4, 34px); } .mbtn { width: 34px; height: 34px; } }
@media (max-width: 1000px) { .make { grid-template-columns: 1fr; } .make-left { position: static; } .stage { height: 300px; } .choice-grid { grid-template-columns: 1fr; } #menubar { grid-template-columns: repeat(2, 32px); padding: 6px; bottom: 96px; } .mbtn { width: 32px; height: 32px; } .mbtn .k { display: none; } }
@media (max-width: 800px) { #target-frame { left: 14px; top: 104px; } .unit { min-width: 240px; } .unit .portrait { width: 62px; height: 62px; border-radius: 18px; } #topright { width: 168px; } #minimap { width: 168px; height: 168px; } #zone-info { margin: 0 8px -14px; } #clock .w { display: none; } #slots .slot { width: 40px; height: 40px; border-radius: 11px; } #slots .slot.atk { width: 48px; height: 48px; } #slots { gap: 4px; } #actionbar { padding: 0 10px 8px; } .bag { grid-template-columns: repeat(6, 46px); } .quest-cols, .lib-cols, .admin-cols, .profile, .fld-grid, .faction-grid, .mirror { grid-template-columns: 1fr; } .save-card { flex-wrap: wrap; justify-content: center; text-align: center; } .save-card .facts { justify-content: center; } .logo p::before, .logo p::after { display: none; } }
@media (max-height: 760px) { #menu-screen { gap: 8px; padding-top: 8px; } .logo svg.ic { width: 30px; height: 30px; } .logo h1 { font-size: clamp(30px, 4.6vw, 52px); } .logo p { margin-top: 8px; font-size: 12px; } #tracker { max-height: 170px; overflow: hidden; } }
