:root {
  --bronze: #a07a3c; --bronze2: #e0b866; --bronze3: #5a4120; --ink: #1a120a; --parch: #ead9b0; --parch2: #d8c08a;
  --text: #f1e6cc; --muted: #b9a888; --hp1: #3fae3a; --hp2: #1f6b1c; --mp1: #3a7fe0; --mp2: #1a3f8a; --red: #c8352d; --gold: #f2c14e;
  --serif: 'Cinzel', Georgia, serif; --sans: 'Alegreya Sans', 'Segoe UI', sans-serif;
  --frame-bg: linear-gradient(180deg, rgba(32,24,16,.93), rgba(18,13,8,.93));
  --frame-border: 2px solid var(--bronze);
  --frame-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255,220,150,.18), inset 0 0 18px rgba(0,0,0,.6), 0 6px 18px rgba(0,0,0,.55);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c0905; font-family: var(--sans); color: var(--text); -webkit-tap-highlight-color: transparent; user-select: none; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: var(--sans); cursor: pointer; color: var(--text); }
input { font-family: var(--sans); }
a { color: var(--bronze2); }
.frame { background: var(--frame-bg); border: var(--frame-border); border-radius: 6px; box-shadow: var(--frame-shadow); }
.btn { font-family: var(--serif); font-weight: 700; letter-spacing: .5px; font-size: 15px; padding: 9px 18px; border-radius: 4px; border: 1px solid #000; color: #f6e7c4; text-decoration: none; display: inline-block; text-align: center;
  background: linear-gradient(180deg, #7a1f18, #4a0f0b); box-shadow: inset 0 1px 0 rgba(255,200,150,.35), inset 0 0 0 1px #b5823a, 0 2px 4px rgba(0,0,0,.6); text-shadow: 0 1px 2px #000; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, #e9c46a, #a87a26); color: #2a1a06; text-shadow: 0 1px 0 rgba(255,240,200,.6); box-shadow: inset 0 1px 0 rgba(255,250,220,.7), inset 0 0 0 1px #6a4a12, 0 2px 6px rgba(0,0,0,.6); }
.btn.ghost { background: linear-gradient(180deg, #3a2c1c, #22190f); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; filter: grayscale(.6); }
.err { color: #ff8a7a; min-height: 1.2em; margin: 8px 0 0; font-size: 14px; }
.title-word { font-family: var(--serif); font-weight: 900; letter-spacing: 6px; font-size: 44px; margin: 10px 0 2px; color: #f2d48a; text-shadow: 0 2px 0 #5a3a12, 0 0 24px rgba(242,193,78,.45), 0 4px 10px #000; }

/* ---- screens ---- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; z-index: 50; padding: 16px; }
#loading { background: radial-gradient(ellipse at 50% 35%, #2a1f12, #0b0805 70%); text-align: center; }
.load-crest { width: min(420px, 80vw); height: auto; aspect-ratio: 1; object-fit: cover; object-position: center; border-radius: 8px; clip-path: inset(30% 0 30% 0); margin: -10% 0; filter: drop-shadow(0 6px 16px rgba(0,0,0,.8)); }
.load-sub { font-family: var(--serif); color: var(--bronze2); letter-spacing: 2px; margin: 4px 0 14px; }
.load-bar { width: min(420px, 80vw); height: 10px; border: 1px solid var(--bronze); background: #120c06; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px #000; }
.load-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a87a26, #f2c14e); transition: width .3s; }
.load-lore { max-width: 560px; color: var(--muted); font-style: italic; margin-top: 18px; line-height: 1.5; min-height: 3em; }
#title { background: linear-gradient(180deg, rgba(10,7,4,.15), rgba(10,7,4,.7)); overflow: auto; justify-content: flex-start; padding-top: 4vh; }
.title-wrap { width: min(560px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.title-banner { width: 100%; border: 2px solid var(--bronze); border-radius: 6px; box-shadow: var(--frame-shadow); display: block; }
.title-card { width: 100%; padding: 18px 22px; text-align: center; }
.lore-intro { font-size: 16px; line-height: 1.55; color: #e8dcc0; margin: 0 0 16px; font-style: italic; }
.title-card .btn.gold { width: 100%; font-size: 17px; padding: 12px; }
.or { margin: 14px 0 8px; font-size: 13px; color: var(--muted); font-family: var(--serif); letter-spacing: 1px; }
#guest-form { display: flex; gap: 8px; }
#guest-form input, .window input { flex: 1; min-width: 0; padding: 10px 12px; font-size: 16px; border-radius: 4px; border: 1px solid var(--bronze3); background: #f6ecd2; color: #2a1a0c; box-shadow: inset 0 2px 4px rgba(0,0,0,.25); outline: none; }
.coin-row { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.buy-soon { font-family: var(--serif); font-weight: 700; padding: 8px 14px; border-radius: 4px; background: linear-gradient(180deg, #2f6a3a, #1a3f20); border: 1px solid #000; box-shadow: inset 0 0 0 1px #6fbf6a; color: #e6ffd8; font-size: 14px; }
.buy-soon em { font-style: normal; font-size: 11px; background: #f2c14e; color: #2a1a06; padding: 1px 6px; border-radius: 3px; margin-left: 6px; }
.buy-soon.small { padding: 3px 8px; font-size: 11px; }
.buy-soon.small em { font-size: 9px; }
.fine { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
.create-card { width: min(860px, 100%); padding: 18px 22px; max-height: 100%; overflow: auto; text-align: center; }
.create-card h2 { font-family: var(--serif); color: #f2d48a; margin: 0 0 10px; letter-spacing: 2px; }
.create-card h3 { font-family: var(--serif); color: var(--bronze2); font-size: 15px; margin: 12px 0 8px; text-align: left; letter-spacing: 1px; }
.create-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.pick-list { display: grid; gap: 8px; }
.pick { display: flex; gap: 10px; align-items: center; text-align: left; padding: 9px 11px; border-radius: 4px; border: 1px solid #000; background: linear-gradient(180deg, #2e2416, #1c150c); box-shadow: inset 0 0 0 1px var(--bronze3); }
.pick.on { box-shadow: inset 0 0 0 2px var(--bronze2), 0 0 12px rgba(242,193,78,.35); background: linear-gradient(180deg, #4a3a1f, #2a1f10); }
.pick b { font-family: var(--serif); font-size: 15px; display: block; }
.pick small { color: var(--muted); font-size: 13px; }
.pick .ico { width: 42px; height: 42px; flex-shrink: 0; border-radius: 4px; background: #0f0b07; border: 1px solid var(--bronze3); display: grid; place-items: center; overflow: hidden; }
.pick .ico img { width: 100%; height: 100%; }
.create-preview canvas { width: 100%; max-width: 360px; aspect-ratio: 420 / 520; border: 1px solid var(--bronze3); border-radius: 4px; background: radial-gradient(ellipse at 50% 30%, #3a2c1a, #120c06); }
.create-preview p { color: #e0d2b0; font-size: 14px; min-height: 3em; }
.create-card > .btn.gold { min-width: 260px; font-size: 17px; margin-top: 8px; }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.unit { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; width: 300px; height: 78px; }
.unit.target { left: 326px; }
.unit-portrait { position: relative; width: 78px; height: 78px; border-radius: 50%; border: 3px solid var(--bronze); box-shadow: 0 0 0 2px #000, inset 0 0 12px rgba(0,0,0,.8), 0 4px 10px rgba(0,0,0,.6); background: radial-gradient(circle at 50% 35%, #4a3a26, #120c06); overflow: hidden; z-index: 2; flex-shrink: 0; }
.unit-portrait img { width: 100%; height: 100%; object-fit: cover; }
.lvl-badge { position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); font-family: var(--serif); font-size: 12px; font-weight: 700; background: #120c06; border: 1px solid var(--bronze2); border-radius: 8px; padding: 0 6px; color: var(--gold); }
.unit-body { margin-left: -18px; padding: 6px 10px 7px 26px; flex: 1; background: var(--frame-bg); border: var(--frame-border); border-radius: 0 6px 6px 0; box-shadow: var(--frame-shadow); }
.unit.target.elite .unit-portrait { border-color: var(--gold); box-shadow: 0 0 0 2px #000, 0 0 14px rgba(242,193,78,.6); }
.unit-name { font-family: var(--serif); font-weight: 700; font-size: 14px; color: #f6e7c4; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-name.hostile { color: #ff9a8a; }
.unit-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.bar { position: relative; height: 15px; margin-top: 4px; background: #0a0705; border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(160,122,60,.5); border-radius: 2px; overflow: hidden; }
.bar.mp { height: 11px; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 100%; transition: width .25s; }
.bar.hp i { background: linear-gradient(180deg, #6fe060, var(--hp1) 45%, var(--hp2)); }
.bar.hp i.low { background: linear-gradient(180deg, #ff8a6a, var(--red) 45%, #6a120c); }
.bar.mp i { background: linear-gradient(180deg, #8ab8ff, var(--mp1) 45%, var(--mp2)); }
.bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.boss-bar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(460px, 50vw); text-align: center; }
.boss-name { font-family: var(--serif); font-weight: 900; color: #9fd0ff; letter-spacing: 3px; text-shadow: 0 2px 4px #000; }
.boss-bar .bar { height: 18px; border: 1px solid var(--bronze2); }
.boss-bar .bar i { background: linear-gradient(180deg, #6ab0ff, #2a5ad8 50%, #102a6a); }
#mm-wrap { position: absolute; top: 10px; right: 12px; width: 220px; display: flex; flex-direction: column; align-items: center; }
.zone-banner { font-family: var(--serif); font-weight: 700; font-size: 14px; letter-spacing: 1px; color: #f2d48a; padding: 3px 14px; background: var(--frame-bg); border: 1px solid var(--bronze); border-radius: 3px; box-shadow: var(--frame-shadow); margin-bottom: 6px; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.mm-ring { width: 196px; height: 196px; border-radius: 50%; padding: 6px; background: conic-gradient(from 0deg, #c89a4a, #6a4a1e, #e0b866, #6a4a1e, #c89a4a, #6a4a1e, #e0b866, #6a4a1e, #c89a4a); box-shadow: 0 0 0 2px #000, 0 6px 16px rgba(0,0,0,.6); }
#minimap { width: 100%; height: 100%; border-radius: 50%; display: block; background: #2a2a1a; cursor: pointer; box-shadow: inset 0 0 10px #000; }
.mm-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; width: 100%; }
.mbtn { font-family: var(--serif); font-size: 11px; font-weight: 700; padding: 6px 0; border: 1px solid #000; border-radius: 3px; background: linear-gradient(180deg, #3a2c1c, #1c150c); box-shadow: inset 0 0 0 1px var(--bronze3); color: #f0dfb8; }
.mbtn:hover { box-shadow: inset 0 0 0 1px var(--bronze2); }
.coin-mini { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.mini-x { font-size: 13px; text-decoration: none; color: #f0dfb8; background: #1c150c; border: 1px solid var(--bronze3); border-radius: 3px; padding: 2px 7px; }
.tracker { position: absolute; right: 14px; top: 360px; width: 240px; font-size: 13px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.tracker h4 { font-family: var(--serif); color: #f2d48a; margin: 10px 0 2px; font-size: 13px; letter-spacing: .5px; }
.tracker .obj { color: #f0e6d0; padding-left: 8px; }
.tracker .obj.done { color: #8fe08a; }
.tracker .hint { color: var(--muted); font-size: 12px; padding-left: 8px; font-style: italic; }
.online { position: absolute; left: 14px; top: 98px; font-size: 12px; color: var(--muted); text-shadow: 0 1px 2px #000; }
#chat { position: absolute; left: 12px; bottom: 12px; width: min(380px, calc(100% - 24px)); background: rgba(10,7,4,.5); border: 1px solid rgba(160,122,60,.5); border-radius: 4px; padding: 4px; }
.chat-tabs { display: flex; gap: 2px; margin-bottom: 3px; }
.chat-tabs button { font-family: var(--serif); font-size: 11px; padding: 2px 10px; border: 1px solid #000; border-radius: 3px 3px 0 0; background: #1c150c; color: var(--muted); }
.chat-tabs button.on { color: #f2d48a; background: #3a2c1c; }
#chat-log { height: 132px; overflow-y: auto; font-size: 13px; line-height: 1.35; padding: 0 4px; scrollbar-width: thin; }
#chat-log div { text-shadow: 0 1px 2px #000; }
#chat-log .sys { color: #ffd479; } #chat-log .whale { color: #9fd0ff; font-weight: 700; } #chat-log .cmb { color: #e0cfaa; } #chat-log .cmb.out { color: #ffffff; } #chat-log .cmb.in { color: #ff9a8a; } #chat-log .loot { color: #8fe08a; }
#chat-log b { color: #9fd0ff; }
#chat-input { width: 100%; margin-top: 4px; padding: 6px 8px; font-size: 13px; border: 1px solid var(--bronze3); border-radius: 3px; background: rgba(0,0,0,.55); color: var(--text); outline: none; }
#actionbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 8px 12px 6px; }
#actionbar { background: linear-gradient(180deg, rgba(44,32,20,.95), rgba(20,14,8,.95)); border: 2px solid var(--bronze); border-radius: 8px; box-shadow: var(--frame-shadow); }
.ab-top { display: flex; gap: 14px; justify-content: center; font-size: 12px; font-weight: 700; margin-bottom: 6px; text-shadow: 0 1px 2px #000; }
.gold-t { color: var(--gold); } .bank-t { color: #8fe08a; } .carry-t { color: #9fd0ff; }
.ab-slots { display: flex; gap: 6px; }
.slot { position: relative; width: 58px; height: 58px; border-radius: 5px; border: 1px solid #000; background: radial-gradient(circle at 50% 35%, #3a2c1c, #120c06); box-shadow: inset 0 0 0 2px var(--bronze3), 0 2px 4px rgba(0,0,0,.7); display: grid; place-items: center; overflow: hidden; }
.slot svg { width: 38px; height: 38px; filter: drop-shadow(0 2px 2px #000); }
.slot .key { position: absolute; top: 2px; left: 4px; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.slot .cnt { position: absolute; bottom: 2px; right: 4px; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.slot .mana { position: absolute; bottom: 2px; left: 4px; font-size: 10px; font-weight: 800; color: #9fc8ff; text-shadow: 0 1px 2px #000; }
.slot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0,0,0,.72) var(--p, 0%), transparent 0); display: grid; place-items: center; font-weight: 800; font-size: 16px; text-shadow: 0 1px 3px #000; }
.slot.locked { filter: grayscale(1) brightness(.45); }
.slot.locked::after { content: attr(data-lvl); position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.slot.oom svg { filter: grayscale(.4) brightness(.6) drop-shadow(0 0 0 #000); }
.slot.oom { box-shadow: inset 0 0 0 2px #2a4a8a; }
.slot.auto { box-shadow: inset 0 0 0 2px var(--gold), 0 0 10px rgba(242,193,78,.5); }
.slot.press { transform: scale(.94); }
.slot.potion { margin-left: 10px; }
.xp-bar { position: relative; height: 9px; margin-top: 7px; background: #0a0705; border: 1px solid #000; box-shadow: inset 0 0 0 1px rgba(160,122,60,.5); border-radius: 2px; overflow: hidden; }
.xp-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #d58aff, #7a3fc0); width: 0; transition: width .4s; }
.xp-bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.interact { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); font-family: var(--serif); font-weight: 700; padding: 8px 16px; background: var(--frame-bg); border: 1px solid var(--bronze); border-radius: 4px; box-shadow: var(--frame-shadow); cursor: pointer; white-space: nowrap; }
.interact b { color: var(--gold); }
.joy { position: absolute; left: 24px; bottom: 200px; width: 120px; height: 120px; border-radius: 50%; background: rgba(0,0,0,.25); border: 2px solid rgba(224,184,102,.5); }
.joy i { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px; border-radius: 50%; background: rgba(224,184,102,.55); }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.np { position: absolute; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; }
.np .nm { font-family: var(--serif); font-weight: 700; font-size: 12px; text-shadow: 0 1px 2px #000, 0 0 4px #000; color: #ffd0c8; }
.np.hero .nm { color: #a8d8ff; } .np.me .nm { color: #ffffff; } .np.npc .nm { color: #9fe89a; } .np.elite .nm { color: #ffcf6b; } .np.boss .nm { color: #9fd0ff; font-size: 15px; }
.np .ttl { font-family: var(--sans); font-size: 10px; color: #d6c8a8; text-shadow: 0 1px 2px #000; }
.np .hpb { width: 64px; height: 6px; margin: 2px auto 0; background: #0a0705; border: 1px solid #000; }
.np .hpb i { display: block; height: 100%; background: linear-gradient(180deg, #ff6a5a, #9a1f18); }
.np.tg .nm { text-decoration: underline; text-decoration-color: var(--gold); }
.np .mark { font-family: var(--serif); font-weight: 900; font-size: 30px; color: #ffd23a; text-shadow: 0 0 6px #000, 0 2px 0 #7a5200; line-height: 1; }
.np .mark.q { color: #ffd23a; } .np .mark.ready { color: #ffd23a; } .np .mark.grey { color: #9a9a9a; }
.np .bub { background: rgba(250,240,215,.95); color: #2a1a0c; font-size: 12px; padding: 3px 8px; border-radius: 6px; margin-bottom: 3px; max-width: 220px; white-space: normal; }
.ft { position: absolute; transform: translate(-50%, -50%); font-weight: 800; font-size: 20px; pointer-events: none; text-shadow: 0 2px 2px #000, 0 0 4px #000; white-space: nowrap; }
.ft.me { color: #ffffff; } .ft.crit { color: #ffd23a; font-size: 28px; } .ft.hurt { color: #ff5a4a; } .ft.heal { color: #6fe060; } .ft.xp { color: #d58aff; font-size: 15px; } .ft.dot { color: #8fe08a; font-size: 16px; }

/* ---- windows ---- */
.window { position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; padding: 18px 22px; }
.parchment { color: #2a1a0c; background: radial-gradient(ellipse at 30% 20%, #f6e9c6, #e2cc98 60%, #cfb37a); border: 3px solid #6a4a20; border-radius: 6px; box-shadow: 0 0 0 2px #1a1008, inset 0 0 40px rgba(120,80,30,.45), 0 10px 30px rgba(0,0,0,.7); }
.parchment h2 { font-family: var(--serif); font-weight: 900; color: #4a2a0a; margin: 0 0 6px; letter-spacing: .5px; }
.parchment h3 { font-family: var(--serif); color: #5a3510; margin: 14px 0 6px; font-size: 16px; border-bottom: 1px solid rgba(90,53,16,.4); padding-bottom: 3px; }
.parchment p { line-height: 1.55; font-size: 15px; margin: 6px 0; }
.parchment .btn { margin: 4px 4px 0 0; }
.window .x { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #000; background: linear-gradient(180deg, #7a1f18, #4a0f0b); color: #f6e7c4; font-weight: 800; box-shadow: inset 0 0 0 1px #b5823a; }
.npc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.npc-head img { width: 72px; height: 72px; border-radius: 50%; border: 3px solid #6a4a20; background: radial-gradient(circle, #f6e9c6, #b89a60); }
.npc-role { font-style: italic; color: #6a4a20; }
.obj-box { background: rgba(90,53,16,.1); border: 1px solid rgba(90,53,16,.35); border-radius: 4px; padding: 8px 10px; margin: 8px 0; }
.rew { display: flex; gap: 14px; flex-wrap: wrap; font-weight: 800; }
.rew .xp { color: #6a2a9a; } .rew .gd { color: #8a5a00; } .rew .mm { color: #1a6a2a; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 6px 0; background: rgba(90,53,16,.1); border: 1px solid rgba(90,53,16,.35); border-radius: 4px; flex-wrap: wrap; }
.row-item .info { flex: 1; min-width: 160px; }
.tier-0 { color: #4a4a4a; } .tier-1 { color: #1a5ab8; } .tier-2 { color: #7a2ab8; } .tier-3 { color: #b8650a; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; }
.stat-grid div { background: rgba(90,53,16,.1); border: 1px solid rgba(90,53,16,.3); border-radius: 4px; padding: 6px 8px; font-size: 13px; }
.stat-grid b { display: block; font-size: 18px; font-family: var(--serif); }
.big-map { width: 100%; aspect-ratio: 1; border: 2px solid #6a4a20; border-radius: 4px; display: block; image-rendering: auto; }
.note-box { background: rgba(26,106,42,.12); border: 1px dashed #1a6a2a; border-radius: 4px; padding: 8px 10px; font-size: 14px; margin: 8px 0; }
.dead { position: fixed; inset: 0; z-index: 55; background: radial-gradient(ellipse, rgba(60,0,0,.25), rgba(0,0,0,.75)); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dead h2 { font-family: var(--serif); font-size: 42px; color: #d8423a; letter-spacing: 3px; text-shadow: 0 3px 8px #000; margin: 0; }
.dead p { color: #e8d8b8; }
#toasts { position: fixed; left: 50%; top: 120px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; width: min(560px, calc(100% - 24px)); }
.toast { font-family: var(--serif); font-weight: 700; font-size: 16px; text-align: center; color: #f6e7c4; text-shadow: 0 2px 3px #000, 0 0 6px #000; animation: fade 4s forwards; }
.toast.gold { color: #ffd23a; } .toast.green { color: #8fe08a; } .toast.red { color: #ff8a7a; } .toast.blue { color: #9fd0ff; }
@keyframes fade { 0% { opacity: 0; transform: translateY(6px); } 8%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.big-note { position: fixed; left: 50%; top: 26%; transform: translate(-50%, -50%); z-index: 65; font-family: var(--serif); font-weight: 900; font-size: 34px; color: #ffd23a; text-shadow: 0 3px 0 #5a3a00, 0 0 20px rgba(0,0,0,.9); text-align: center; pointer-events: none; animation: fade 3.6s forwards; }
.big-note small { display: block; font-size: 18px; color: #f6e7c4; font-weight: 700; }
.tip { position: fixed; z-index: 80; max-width: 260px; padding: 8px 10px; font-size: 13px; background: rgba(14,10,6,.96); border: 1px solid var(--bronze); border-radius: 4px; pointer-events: none; box-shadow: var(--frame-shadow); }
.tip b { font-family: var(--serif); color: #f2d48a; }

@media (max-width: 760px) {
  .unit { width: 230px; height: 62px; transform-origin: top left; }
  .unit-portrait { width: 62px; height: 62px; }
  .unit.target { left: 12px; top: 84px; }
  .online { top: 152px; }
  #mm-wrap { width: 132px; }
  .mm-ring { width: 124px; height: 124px; padding: 4px; }
  .mm-btns { grid-template-columns: repeat(2, 1fr); }
  .mbtn { font-size: 10px; padding: 4px 0; }
  .zone-banner { font-size: 11px; padding: 2px 8px; }
  .tracker { display: none; }
  #chat { width: calc(100% - 24px); bottom: auto; top: 200px; background: transparent; border: 0; }
  #chat-log { height: 64px; font-size: 11px; }
  #chat-form, .chat-tabs { display: none; }
  .slot { width: 50px; height: 50px; } .slot svg { width: 30px; height: 30px; }
  #actionbar { padding: 6px 8px 4px; }
  .interact { bottom: 140px; }
  .create-grid { grid-template-columns: 1fr; }
  .title-word { font-size: 30px; }
  .boss-bar { top: 200px; }
}

/* ===================== photo-real UI materials ===================== */
:root {
  --leather: linear-gradient(180deg, rgba(26,18,11,.78), rgba(10,7,4,.9)), url(/assets/tex/brown_leather_diff.jpg) center / 260px;
  --metal: linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.35)), url(/assets/tex/metal_plate_diff.jpg) center / 220px;
  --gilt: linear-gradient(135deg, #fbe7a8 0%, #b8862e 18%, #6e4a14 34%, #f0cf7a 50%, #7a5418 66%, #d9ae58 82%, #5a3a0e 100%);
  --paper: linear-gradient(180deg, rgba(246,232,196,.86), rgba(222,196,142,.9)), url(/assets/tex/white_plaster_rough_01_diff.jpg) center / 420px;
}
.frame, .unit-body, .zone-banner, #actionbar, .interact, .door-card, #chat, .tip, .window:not(.parchment), .pick, .boss-bar .bar {
  background: var(--leather) padding-box, var(--gilt) border-box !important;
  border: 2px solid transparent !important;
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255,230,170,.25), inset 0 0 24px rgba(0,0,0,.7), 0 8px 22px rgba(0,0,0,.65) !important;
}
#actionbar { border-width: 3px !important; border-radius: 10px; }
#chat { opacity: .94; }
.unit-portrait, .mm-ring {
  background-image: var(--gilt) !important; padding: 4px; border: 0 !important;
  box-shadow: 0 0 0 1px #000, 0 6px 16px rgba(0,0,0,.7), inset 0 2px 3px rgba(255,240,200,.6), inset 0 -2px 4px rgba(0,0,0,.6) !important;
}
.unit-portrait img { border-radius: 50%; background: radial-gradient(circle at 50% 35%, #4a3a26, #0c0805); box-shadow: inset 0 0 14px #000; }
#minimap { box-shadow: inset 0 0 18px #000, 0 0 0 2px #000; }
.lvl-badge { background: var(--leather) padding-box, var(--gilt) border-box; border: 2px solid transparent; font-size: 13px; padding: 0 7px; }
.bar { background: linear-gradient(180deg, #050403, #1a120a); border: 1px solid #000; box-shadow: inset 0 2px 4px #000, 0 0 0 1px rgba(200,160,90,.55); border-radius: 3px; }
.bar i::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 45%; background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0)); }
.bar.hp i { background: linear-gradient(180deg, #8cf07a, #2fa82a 40%, #126a10 100%); box-shadow: inset 0 -1px 2px rgba(0,0,0,.5); }
.bar.mp i { background: linear-gradient(180deg, #9cc8ff, #2f72e0 40%, #0e2c7a 100%); }
.xp-bar i { background: linear-gradient(180deg, #e8b0ff, #9a4fe0 45%, #4a1a8a); }
.slot { background: radial-gradient(circle at 50% 30%, rgba(60,46,30,.9), rgba(8,6,4,.95)), url(/assets/tex/metal_plate_diff.jpg) center / 120px; border: 2px solid transparent;
  background-clip: padding-box; box-shadow: 0 0 0 2px #000, 0 0 0 4px #8a6428, 0 0 0 5px #000, inset 0 0 12px #000, 0 3px 6px rgba(0,0,0,.8); }
.slot::before { content: ''; position: absolute; inset: 0; border-radius: 4px; background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,0) 45%); pointer-events: none; }
.slot.auto { box-shadow: 0 0 0 2px #000, 0 0 0 4px #f2c14e, 0 0 14px rgba(242,193,78,.8), inset 0 0 12px #000 !important; }
.ab-slots { gap: 12px; padding: 4px 6px; }
.mbtn, .btn.ghost, .chat-tabs button {
  background: var(--metal) padding-box, linear-gradient(180deg, #d8b060, #5a3a10) border-box !important;
  border: 1px solid transparent !important; color: #f6e7c4; text-shadow: 0 1px 2px #000;
  box-shadow: 0 0 0 1px #000, inset 0 1px 0 rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.6) !important;
}
.btn { background: linear-gradient(180deg, rgba(150,30,22,.85), rgba(70,10,8,.95)), url(/assets/tex/brown_leather_diff.jpg) center / 200px; border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255,200,150,.35), inset 0 0 0 1px #c8963e, 0 3px 8px rgba(0,0,0,.7); }
.btn.gold { background: linear-gradient(180deg, rgba(255,232,160,.92), rgba(196,140,40,.92) 55%, rgba(120,80,16,.95)), url(/assets/tex/metal_plate_diff.jpg) center / 200px; color: #2a1a06; }
.parchment {
  background: var(--paper) !important; color: #2a1a0c;
  border: 3px solid transparent !important; background-clip: padding-box !important;
  box-shadow: 0 0 0 3px #3a2410, 0 0 0 5px #c89a48, 0 0 0 6px #1a1008, inset 0 0 60px rgba(110,70,20,.55), 0 14px 40px rgba(0,0,0,.75) !important;
}
.parchment h2 { text-shadow: 0 1px 0 rgba(255,240,200,.6); }
.parchment .obj-box, .parchment .row-item, .parchment .stat-grid div { background: rgba(120,80,30,.1); border-color: rgba(90,53,16,.45); box-shadow: inset 0 1px 3px rgba(90,53,16,.25); }
.window .x { background: var(--metal) padding-box, var(--gilt) border-box; border: 2px solid transparent; }
.zone-banner { font-size: 15px; letter-spacing: 1.5px; padding: 4px 18px; }
.title-card .btn.gold, .create-card > .btn.gold { font-size: 18px; letter-spacing: 1px; }
.title-word { background: linear-gradient(180deg, #fff4cc 0%, #f2c14e 45%, #9a6a18 55%, #f6d27a 100%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 #2a1a06) drop-shadow(0 6px 14px rgba(0,0,0,.8)); }
.np .nm { font-size: 13px; letter-spacing: .3px; }
.np .hpb { height: 7px; border: 1px solid #000; box-shadow: 0 0 0 1px rgba(200,160,90,.6); }
.np .hpb i { background: linear-gradient(180deg, #ff8a7a, #c8261a 50%, #6a0c06); }
.ft { font-family: var(--serif); }
#loading { background: radial-gradient(ellipse at 50% 40%, rgba(40,28,14,.7), rgba(6,4,2,.97)), url(/assets/tex/brown_leather_diff.jpg) center / 400px; }
.load-bar { height: 12px; background: #050302; box-shadow: 0 0 0 1px #000, 0 0 0 3px #8a6428, 0 0 0 4px #000; border: 0; }
.load-bar i { background: linear-gradient(180deg, #ffe9a8, #d8a038 45%, #7a4e10); box-shadow: 0 0 12px rgba(242,193,78,.7); }

/* $MMRPG contract address + buy link */
.ca-box { display: flex; align-items: center; gap: 8px; width: min(520px, 100%); margin: 14px auto 0; padding: 6px 6px 6px 12px; border-radius: 4px;
  background: var(--leather) padding-box, var(--gilt) border-box; border: 2px solid transparent; box-shadow: 0 0 0 1px #000, 0 4px 12px rgba(0,0,0,.6); }
.title-card .ca-box { margin: 0 0 10px; }
.ca-tag { font: 700 12px var(--serif); color: var(--gold); white-space: nowrap; letter-spacing: .5px; }
.ca-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #f6e7c4; text-align: left; }
.ca-copy { font: 700 12px var(--serif); padding: 6px 12px; border-radius: 3px; border: 1px solid #000; color: #2a1a06; cursor: pointer;
  background: linear-gradient(180deg, #ffe7a0, #c68c28 55%, #7a5010); box-shadow: inset 0 1px 0 rgba(255,250,220,.7); }
.buy-link { display: inline-block; margin-top: 10px; padding: 9px 20px; border-radius: 4px; text-decoration: none; font: 700 15px var(--serif); color: #eaffdf;
  background: linear-gradient(180deg, #4aa35a, #1f5a28); border: 1px solid #000; box-shadow: inset 0 1px 0 rgba(200,255,200,.4), inset 0 0 0 1px #8fd88a, 0 3px 8px rgba(0,0,0,.6); }
.buy-link.wide { display: block; margin: 0 0 14px; }
a.buy-soon.small { text-decoration: none; cursor: pointer; }
.mini-x.ca-copy { padding: 2px 7px; font-size: 11px; color: #2a1a06; }
