:root {
  --bg: #0c1220; --bg2: #121a2e; --panel: rgba(16, 23, 40, 0.92); --panel2: #1a2440; --line: #2c3a5e; --gold: #ffcf5a; --gold2: #c9a24a; --gold3: #6b5320;
  --text: #f3ead4; --muted: #9aa6c0; --green: #5be38a; --red: #ff5d6c; --violet: #b48cff; --blue: #4ca8ff; --orange: #ffa63c;
  --serif: 'Cinzel', Georgia, serif; --sans: 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-tap-highlight-color: transparent; }
body { overflow-x: hidden; }
body.ingame { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
a { color: var(--gold); }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.g { color: var(--green); } .r { color: var(--red); } .v { color: var(--violet); } .b { color: var(--blue); } .p { color: #c06bff; } .o { color: var(--orange); } .y { color: var(--gold); }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; background: var(--bg2); font: 700 12px var(--sans); color: var(--text); text-align: center; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; image-rendering: pixelated; }

/* ---------- loading ---------- */
.loading { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--bg); transition: opacity .5s; }
.loading.out { opacity: 0; pointer-events: none; }
.loading div { text-align: center; }
.loading b { display: block; font: 900 40px var(--serif); color: var(--gold); letter-spacing: 2px; text-shadow: 0 3px 0 var(--gold3); }
.loading span { color: var(--muted); }

/* ---------- landing ---------- */
#landing { position: relative; z-index: 1; min-height: 100vh; background: linear-gradient(180deg, rgba(12,18,32,.15) 0%, rgba(12,18,32,.55) 55vh, var(--bg) 100vh); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(10,15,28,.82); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(201,162,74,.25); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font: 900 19px var(--serif); letter-spacing: 1px; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.brand b { color: var(--gold); }
.ticker { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); min-width: 0; }
.ticker-in { display: flex; gap: 28px; width: max-content; animation: tick 50s linear infinite; font: 800 12px var(--sans); letter-spacing: 1px; color: var(--muted); }
.ticker-in b { color: var(--text); margin-left: 6px; }
@keyframes tick { to { transform: translateX(-50%); } }
.pill { display: flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); font: 800 13px var(--sans); white-space: nowrap; }
.pill b { color: var(--green); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); display: grid; place-items: center; }
.icon-btn.off { opacity: .45; }
.page { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: start; padding: 42px 0 26px; min-height: calc(100vh - 60px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 800 12px var(--sans); letter-spacing: 1.5px; color: var(--gold); background: rgba(12,18,32,.7); padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(201,162,74,.35); margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
h1 { font: 900 clamp(48px, 8.5vw, 104px)/0.95 var(--serif); margin: 18px 0 6px; letter-spacing: 2px; color: #fff4d6; text-shadow: 0 4px 0 var(--gold3), 0 10px 40px rgba(0,0,0,.6); }
h1 span { color: var(--gold); }
.tag { font: 700 clamp(18px, 2.4vw, 26px) var(--serif); margin: 0 0 14px; color: var(--text); text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.tag em { color: var(--violet); font-style: normal; }
.lede { max-width: 600px; color: #d5dcec; font-size: 16px; text-shadow: 0 1px 8px rgba(0,0,0,.9); background: rgba(12,18,32,.45); padding: 12px 14px; border-radius: 12px; }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; max-width: 620px; }
.statrow div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.statrow span { display: block; font: 800 10px var(--sans); letter-spacing: 1.2px; color: var(--muted); }
.statrow b { font: 900 20px var(--sans); }
.earn { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 620px; }
.earn div { background: linear-gradient(160deg, rgba(40,32,12,.85), rgba(16,23,40,.92)); border: 1px solid rgba(201,162,74,.45); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.earn i { font-style: normal; font-size: 28px; grid-row: span 2; }
.earn b { font: 900 18px var(--sans); color: var(--green); }
.earn small { color: var(--muted); font-size: 12px; line-height: 1.3; }

.play { background: var(--panel); border: 1px solid rgba(201,162,74,.45); border-radius: 18px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05); position: sticky; top: 76px; }
.lbl { font: 800 12px var(--sans); letter-spacing: 1.4px; color: var(--gold); text-transform: uppercase; margin: 4px 0 8px; }
.row { display: flex; gap: 8px; }
input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--text); font: 700 15px var(--sans); outline: none; }
input:focus { border-color: var(--gold2); }
.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 10px 16px; font-weight: 800; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.phantom { width: 100%; margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #ab9ff2; color: #1c1240; border: 0; }
.btn.phantom svg { width: 20px; height: 20px; }
.err { color: #ff8b9d; min-height: 0; margin: 6px 0 0; font-size: 13px; }
.err a { color: #ffd6dd; }
.who { display: flex; align-items: center; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin-bottom: 12px; }
.ava { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; color: #1b1405; }
.who-t { flex: 1; font-size: 14px; }
.who-t em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }
.link { background: none; border: 0; color: var(--gold); font-weight: 800; text-decoration: underline; }
.classes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cls { background: var(--bg2); border: 2px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; transition: transform .15s, border-color .15s; }
.cls:hover { transform: translateY(-2px); }
.cls.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(255,207,90,.14), var(--bg2)); }
.cls i { font-style: normal; font-size: 26px; display: block; }
.cls b { display: block; font: 700 13px var(--serif); margin-top: 2px; }
.cls small { color: var(--muted); font-size: 11px; }
.cls-desc { font-size: 13px; color: #c9d1e4; margin: 8px 0 4px; min-height: 38px; }
.cls-skills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.cls-skills span { font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; }
.faces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.face { padding: 6px 4px 4px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.face small { font: 900 11px var(--sans); letter-spacing: 1px; color: var(--muted); }
.face.on small { color: var(--gold); }
.face canvas { width: 100%; height: 100%; border-radius: 6px; image-rendering: pixelated; }
.face.on { border-color: var(--gold); }
.mychar { display: flex; gap: 12px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.mychar canvas { width: 64px; height: 64px; border-radius: 12px; image-rendering: pixelated; border: 2px solid var(--gold2); }
.mychar .mc-t b { font: 700 18px var(--serif); display: block; }
.mychar .mc-t span { color: var(--muted); font-size: 13px; }
.mychar .mc-faces { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.mychar .mc-faces canvas { width: 26px; height: 26px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.mychar .mc-faces canvas.on { border-color: var(--gold); }
.enter-btn { width: 100%; margin: 14px 0 12px; border: 0; border-radius: 14px; padding: 14px; background: linear-gradient(180deg, #ffe08a, #e2a52c 60%, #b77a14); color: #2a1a02; box-shadow: 0 5px 0 #6b4a0c, 0 12px 30px rgba(255,190,60,.25); display: flex; flex-direction: column; align-items: center; transition: transform .1s, filter .15s; }
.enter-btn span { font: 900 22px var(--serif); letter-spacing: 2px; }
.enter-btn small { font: 800 11px var(--sans); letter-spacing: 1px; opacity: .75; text-transform: uppercase; }
.enter-btn:hover { filter: brightness(1.07); }
.enter-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #6b4a0c; }
.enter-btn:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.enter-btn.sm { margin: 10px 0 0; padding: 10px; }
.enter-btn.sm span { font-size: 16px; }
.bank { display: flex; gap: 10px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.bank div { flex: 1; }
.bank span { display: block; font: 800 10px var(--sans); letter-spacing: 1.2px; color: var(--muted); }
.bank b { font: 900 16px var(--sans); }
#bank-bal { color: var(--green); }
.fine { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.band { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 10px 0 30px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
h2 { font: 700 20px var(--serif); margin: 0 0 12px; color: #fff4d6; }
h2 span { font: 900 11px var(--sans); background: var(--red); color: #fff; padding: 2px 7px; border-radius: 6px; vertical-align: middle; margin-right: 6px; letter-spacing: 1px; }
.feed, .board { list-style: none; margin: 0; padding: 0; }
.feed li, .board li { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid rgba(44,58,94,.6); font-size: 14px; min-width: 0; }
.feed li:last-child, .board li:last-child { border: 0; }
.feed .t, .board .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .ago { color: var(--muted); font-size: 12px; }
.board { counter-reset: n; }
.board li::before { counter-increment: n; content: counter(n); width: 22px; height: 22px; border-radius: 6px; background: var(--bg2); display: grid; place-items: center; font: 900 12px var(--sans); color: var(--gold); flex: none; }
.board li.muted::before { display: none; }
.board .c { color: var(--green); font-weight: 900; }
.board canvas, .feed canvas { width: 24px; height: 24px; border-radius: 6px; image-rendering: pixelated; flex: none; }

.zones, .how, .controls { margin: 0 0 30px; }
.zone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.zone-grid div { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--zc); border-radius: 14px; padding: 12px 14px; }
.zone-grid b { font: 700 17px var(--serif); }
.zone-grid em { font-style: normal; float: right; font: 800 12px var(--sans); color: var(--zc); }
.zone-grid p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.steps div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.steps div > b { font: 900 13px var(--sans); color: var(--gold); }
.steps h3 { font: 700 18px var(--serif); margin: 2px 0 6px; }
.steps p { margin: 0; color: #c3cbdf; font-size: 14px; }
.ctl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ctl div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.foot { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; color: var(--muted); font-size: 13px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
#hud button, #hud input, #hud .quest, #hud .skillbar, #hud .chat.open, #hud .joy, #hud canvas#minimap, #hud .dead { pointer-events: auto; }
.bar { position: relative; height: 16px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.15); border-radius: 6px; overflow: hidden; }
.bar i { position: absolute; inset: 0; width: 100%; background: linear-gradient(180deg, #7cf29e, #2fb35e); transition: width .15s; }
.bar.enemy i { background: linear-gradient(180deg, #ff8a8a, #d33a3a); }
.bar span { position: relative; display: block; text-align: center; font: 900 11px/14px var(--sans); text-shadow: 0 1px 2px #000; }
.pframe { position: absolute; left: 12px; top: 12px; display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid rgba(201,162,74,.5); border-radius: 14px; padding: 8px 12px 8px 8px; width: 290px; }
.pframe canvas { width: 52px; height: 52px; border-radius: 10px; border: 2px solid var(--gold2); image-rendering: pixelated; flex: none; }
.pf-r { flex: 1; min-width: 0; }
.pf-name { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.pf-name b { font: 700 15px var(--serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv { background: var(--gold); color: #2a1a02; font: 900 11px var(--sans); border-radius: 6px; padding: 0 6px; flex: none; }
.pw { margin-left: auto; font-size: 12px; color: var(--gold); white-space: nowrap; }
.buffs { display: flex; gap: 4px; margin-top: 4px; min-height: 0; }
.buffs span { font-size: 12px; background: rgba(0,0,0,.5); border-radius: 6px; padding: 0 5px; }
.tframe { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); width: 300px; background: var(--panel); border: 1px solid rgba(255,93,108,.5); border-radius: 12px; padding: 8px 10px; }
.tframe.friendly { border-color: rgba(76,168,255,.5); }
.tframe.friendly .bar i { background: linear-gradient(180deg, #8ad0ff, #2f7fd3); }
.tf-name { display: flex; gap: 6px; align-items: center; margin-bottom: 5px; font-size: 14px; }
.tf-name b { font: 700 14px var(--serif); }
.tf-name em { margin-left: auto; font-style: normal; font: 900 10px var(--sans); color: var(--gold); letter-spacing: 1px; }
.mapbox { position: absolute; right: 12px; top: 12px; width: 180px; text-align: center; }
#minimap { width: 180px; height: 180px; border-radius: 50%; border: 3px solid var(--gold2); box-shadow: 0 6px 20px rgba(0,0,0,.5); background: #142030; display: block; }
.zone-name { margin-top: 6px; font: 700 14px var(--serif); text-shadow: 0 2px 4px #000; }
.zone-name.pvp { color: var(--red); }
.boss-pill { display: inline-block; margin-top: 4px; background: var(--panel); border: 1px solid rgba(180,140,255,.5); border-radius: 999px; padding: 2px 10px; font: 800 12px var(--sans); }
.boss-pill.up { background: #3b1f70; color: #fff; animation: pulse 1s infinite; }
.quest { position: absolute; left: 12px; top: 110px; width: 250px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.q-h { font: 900 11px var(--sans); letter-spacing: 1.4px; color: var(--gold); display: flex; }
.q-h span { margin-left: auto; color: var(--muted); }
.q-t { font: 700 15px var(--serif); margin: 2px 0 6px; }
.q-bar { height: 6px; background: rgba(0,0,0,.5); border-radius: 3px; overflow: hidden; }
.q-bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s; }
.q-r { font-size: 12px; color: var(--muted); margin-top: 5px; }
.q-btns { display: flex; gap: 6px; margin-top: 7px; }
.q-btns button { flex: 1; border: 1px solid var(--gold2); background: rgba(255,207,90,.12); border-radius: 8px; padding: 4px; font: 900 12px var(--sans); color: var(--gold); }
.q-btns button + button { flex: none; border-color: var(--line); background: none; color: var(--muted); font-weight: 700; }
.q-btns button.on { background: var(--gold); color: #2a1a02; }
.purse { position: absolute; right: 12px; top: 250px; display: flex; flex-direction: column; gap: 4px; width: 180px; }
.purse div { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; }
.purse span { font: 800 10px var(--sans); letter-spacing: 1px; color: var(--muted); }
.purse b { font: 900 14px var(--sans); color: var(--green); }
.purse b.gold { color: var(--gold); }
.purse .hot { border-color: var(--green); box-shadow: 0 0 14px rgba(91,227,138,.4); }
.skillbar { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 8px; align-items: flex-end; }
.sk { position: relative; width: 58px; height: 58px; border-radius: 14px; border: 2px solid var(--gold2); background: radial-gradient(circle at 50% 35%, #2a3658, #121a2e); display: grid; place-items: center; font-size: 26px; box-shadow: 0 4px 0 rgba(0,0,0,.4); overflow: hidden; padding: 0; }
.sk .k { position: absolute; left: 4px; top: 1px; font: 900 11px var(--sans); color: var(--gold); }
.sk .n { position: absolute; right: 4px; bottom: 1px; font: 900 11px var(--sans); }
.sk .cd { position: absolute; inset: 0; background: rgba(0,0,0,.65); transform-origin: bottom; transform: scaleY(0); }
.sk .cdt { position: absolute; inset: 0; display: grid; place-items: center; font: 900 17px var(--sans); text-shadow: 0 2px 2px #000; }
.sk.locked { filter: grayscale(1); opacity: .5; }
.sk.locked .cdt { font-size: 11px; }
.sk.flash { animation: skf .25s; }
@keyframes skf { 50% { transform: scale(.9); filter: brightness(1.6); } }
.sk.auto { width: 66px; height: 66px; font: 900 13px var(--sans); letter-spacing: 1px; color: var(--muted); border-color: var(--line); }
.sk.auto.on { color: #2a1a02; background: linear-gradient(180deg, #ffe08a, #e2a52c); border-color: #fff3c8; box-shadow: 0 0 20px rgba(255,207,90,.6); }
.sk.pot { width: 50px; height: 50px; font-size: 22px; }
.xpbar { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: rgba(0,0,0,.6); }
.xpbar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #8a5cff, #c79bff); transition: width .3s; }
.xpbar span { position: relative; display: block; text-align: center; font: 900 10px/14px var(--sans); text-shadow: 0 1px 2px #000; }
.side-btns { position: absolute; right: 12px; bottom: 26px; display: flex; flex-direction: column; gap: 6px; }
.side-btns button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; position: relative; }
.side-btns small { position: absolute; right: 3px; bottom: 0; font: 900 9px var(--sans); color: var(--gold); }
.npc-hint { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--gold2); border-radius: 10px; padding: 6px 12px; font: 800 14px var(--sans); pointer-events: auto; cursor: pointer; }
#hud .dmg-layer, #hud .labels { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
#hud > div:not(.labels):not(.dmg-layer), #hud > button { z-index: 1; }
.dmg { position: absolute; font: 900 18px var(--sans); color: #fff; text-shadow: 0 2px 0 #000, 0 0 6px rgba(0,0,0,.8); white-space: nowrap; transform: translate(-50%, -50%); will-change: transform; }
.dmg.crit { color: var(--gold); font-size: 26px; }
.dmg.me { color: var(--red); }
.dmg.heal { color: var(--green); }
.dmg.xp { color: var(--violet); font-size: 15px; }
.dmg.gold { color: var(--gold); font-size: 15px; }
.lbl3d { position: absolute; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; font: 800 12px var(--sans); text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.lbl3d .nm { display: block; }
.lbl3d .nm .l { color: var(--gold); margin-right: 4px; }
.lbl3d.mob .nm { color: #ffd1d1; }
.lbl3d.mob.elite .nm { color: var(--orange); }
.lbl3d.mob.boss .nm { color: var(--violet); font-size: 15px; }
.lbl3d.hero .nm { color: #cfe6ff; }
.lbl3d.hero.me .nm { color: var(--green); }
.lbl3d.hero.bot .nm { color: #b9c4dc; }
.lbl3d.npc .nm { color: var(--gold); font-size: 13px; }
.lbl3d .role { display: block; color: var(--muted); font-size: 11px; }
.lbl3d .hb { display: block; width: 60px; height: 6px; margin: 2px auto 0; background: rgba(0,0,0,.7); border-radius: 3px; overflow: hidden; }
.lbl3d .hb i { display: block; height: 100%; background: #e23d3d; }
.lbl3d.hero .hb i { background: #3fd37a; }
.lbl3d.boss .hb { width: 140px; height: 9px; }
.lbl3d .bub { display: block; max-width: 220px; white-space: normal; background: #fff; color: #111; text-shadow: none; font: 700 12px var(--sans); border-radius: 10px; padding: 4px 8px; margin-bottom: 3px; }
.lbl3d.sel .nm { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.bigmsg { position: absolute; left: 50%; top: 26%; transform: translate(-50%, -50%) scale(.6); opacity: 0; font: 900 clamp(30px, 6vw, 60px) var(--serif); color: var(--gold); text-shadow: 0 4px 0 var(--gold3), 0 0 30px rgba(0,0,0,.7); text-align: center; transition: transform .25s, opacity .25s; white-space: nowrap; }
.bigmsg small { display: block; font: 800 16px var(--sans); color: var(--text); letter-spacing: 1px; }
.bigmsg.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.bigmsg.red { color: var(--red); }
.bigmsg.violet { color: var(--violet); }
.notes { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; width: min(560px, 90vw); }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; font: 800 14px var(--sans); text-align: center; transition: opacity .5s, transform .5s; }
.note.gold { border-color: var(--gold); color: var(--gold); }
.note.green { border-color: var(--green); color: var(--green); }
.note.red { border-color: var(--red); color: #ffb1b9; }
.note.boss { border-color: var(--violet); color: #e2d2ff; background: rgba(59,31,112,.9); font-size: 16px; }
.note.out { opacity: 0; transform: translateY(-10px); }
.chat { position: absolute; left: 12px; bottom: 26px; width: 340px; }
.chat-log { max-height: 170px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; font-size: 13px; mask-image: linear-gradient(180deg, transparent, #000 30%); }
.chat.open .chat-log { overflow-y: auto; background: rgba(10,15,28,.75); border-radius: 10px; padding: 6px; mask-image: none; }
.chat-log div { text-shadow: 0 1px 2px #000; }
.chat-log b { color: var(--gold); }
.chat-log .sys b { color: var(--violet); }
.chat-form input { width: 100%; margin-top: 6px; padding: 8px 10px; font-size: 14px; }
.chat-btn { position: absolute; left: 12px; bottom: 210px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.joy { position: absolute; left: 24px; bottom: 40px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.18); touch-action: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: rgba(255,207,90,.5); border: 2px solid rgba(255,255,255,.5); }
.dead { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(60,0,10,.45), rgba(0,0,0,.75)); }
.dead-card { text-align: center; background: var(--panel); border: 1px solid var(--red); border-radius: 18px; padding: 22px 26px; width: min(360px, 90vw); }
.dead h2 { color: var(--red); font-size: 26px; margin: 0 0 6px; }
.touch-only { display: none; }
body.touch .touch-only { display: block; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(4,8,16,.7); padding: 16px; }
.modal-card { position: relative; width: min(440px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid rgba(201,162,74,.6); border-radius: 18px; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.modal-card.wide { width: min(720px, 100%); }
.modal-card h3 { font: 700 21px var(--serif); margin: 0 0 12px; color: var(--gold); }
.modal-card h4 { margin: 16px 0 6px; font: 700 15px var(--serif); }
.x { position: absolute; right: 12px; top: 12px; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); }
.w-bal { display: flex; align-items: baseline; gap: 10px; background: var(--bg2); border-radius: 12px; padding: 10px 12px; flex-wrap: wrap; }
.w-bal b { font: 900 26px var(--sans); color: var(--green); }
.w-bal span, .w-bal small { color: var(--muted); }
.wh { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.st { font: 900 11px var(--sans); text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--bg2); }
.st.paid { color: var(--green); } .st.pending { color: var(--gold); } .st.rejected { color: var(--red); }
.ch-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.ch-stats div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(44,58,94,.6); font-size: 14px; }
.ch-stats b { font-weight: 900; }
.gear { background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--tc); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.gear .gn { font: 700 16px var(--serif); color: var(--tc); }
.gear .gt { font: 800 11px var(--sans); color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.gear .gs { font-size: 14px; margin: 4px 0 8px; }
.gear button { width: 100%; border: 1px solid var(--gold2); background: rgba(255,207,90,.12); color: var(--gold); border-radius: 10px; padding: 8px; font: 900 13px var(--sans); }
.gear button:disabled { opacity: .45; cursor: not-allowed; }
.gear.flash-ok { animation: gok .7s; }
.gear.flash-bad { animation: gbad .7s; }
@keyframes gok { 30% { box-shadow: 0 0 0 3px var(--gold), 0 0 30px var(--gold); } }
@keyframes gbad { 30% { box-shadow: 0 0 0 3px var(--red); transform: translateX(-4px); } 60% { transform: translateX(4px); } }
.shop-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.shop-row button { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; font-weight: 800; }
.shop-row button i { display: block; font-style: normal; font-size: 24px; }
.shop-row button small { display: block; color: var(--gold); }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel); border: 1px solid var(--gold2); border-radius: 12px; padding: 10px 16px; font-weight: 800; box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; min-height: 0; }
  .play { position: static; }
  .band, .zone-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .ctl { grid-template-columns: 1fr 1fr; }
  .ticker { display: none; }
  .brand { flex: 1; }
}
@media (max-width: 560px) {
  .statrow { grid-template-columns: 1fr 1fr; }
  .earn { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }

  .ch-grid { grid-template-columns: 1fr; }
  .pill { display: none; }
}
/* the HUD on phones / short screens */
@media (max-width: 760px), (max-height: 520px) {
  .pframe { width: 210px; padding: 5px 8px 5px 5px; gap: 6px; left: 8px; top: 8px; }
  .pframe canvas { width: 38px; height: 38px; }
  .pf-name b { font-size: 13px; }
  .bar { height: 13px; }
  .bar span { font-size: 9px; line-height: 11px; }
  .tframe { width: 210px; top: 58px; left: 8px; transform: none; padding: 4px 8px; }
  .tframe:not(.hidden) ~ .quest { top: 112px; }
  .mapbox { width: 108px; right: 8px; top: 8px; }
  #minimap { width: 108px; height: 108px; }
  .zone-name { font-size: 11px; }
  .boss-pill { font-size: 10px; padding: 1px 6px; }
  .quest { top: 62px; left: 8px; width: 170px; padding: 6px 8px; }
  .q-t { font-size: 12px; }
  .q-r { display: none; }
  .purse { top: 168px; right: 8px; width: 108px; }
  .purse div { padding: 2px 6px; }
  .purse span { font-size: 8px; }
  .purse b { font-size: 11px; }
  .chat { width: 230px; bottom: 190px; left: 8px; }
  .chat-log { max-height: 90px; font-size: 11px; }
  .notes { top: 120px; }
  .note { font-size: 12px; }
  .side-btns { top: 250px; bottom: auto; right: 8px; }
  .side-btns button { width: 36px; height: 36px; font-size: 16px; }
  .npc-hint { bottom: 200px; }
}
body.touch .skillbar { left: auto; right: 14px; transform: none; bottom: 26px; display: grid; grid-template-columns: repeat(3, auto); gap: 8px; }
body.touch .sk { width: 56px; height: 56px; }
body.touch .sk.auto { width: 56px; height: 56px; font-size: 11px; }
body.touch .sk.pot { width: 56px; height: 56px; }
body.touch .chat { bottom: 200px; }
.tf-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 760px), (max-height: 520px) { .tf-name { font-size: 12px; margin-bottom: 3px; } .tf-name b { font-size: 12px; } .tframe:not(.hidden) ~ .quest { top: 116px; } }
.x-btn svg, .x-side svg { width: 16px; height: 16px; }
.x-follow { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: #000; border: 1px solid #333; color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; }
.x-follow svg { width: 16px; height: 16px; flex: none; }
.x-follow b { color: var(--gold); }
.side-btns .x-side { width: 44px; height: 44px; border-radius: 12px; border: 1px solid #333; background: #000; color: #fff; display: grid; place-items: center; pointer-events: auto; }
@media (max-width: 760px), (max-height: 520px) { .side-btns .x-side { width: 36px; height: 36px; } }

/* ---------- logo + banner ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 0 2px rgba(255,207,90,.5), 0 4px 12px rgba(0,0,0,.5); }
.banner { position: relative; margin: 40px 0 12px 22px; max-width: 640px; border-radius: 20px; padding: 5px; background: linear-gradient(135deg, #ffe08a, #c9a24a 40%, #6b4a0c 70%, #ffcf5a); box-shadow: 0 6px 0 #3d2a06, 0 22px 60px rgba(0,0,0,.55), 0 0 60px rgba(255,207,90,.18); animation: bannerIn .8s cubic-bezier(.2,.9,.3,1.2) both; }
.banner-img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 16px; image-rendering: pixelated; }
.banner-crest { position: absolute; left: -26px; top: -28px; width: 104px; height: 104px; border-radius: 22px; border: 3px solid #ffe08a; box-shadow: 0 8px 0 #3d2a06, 0 14px 30px rgba(0,0,0,.5), 0 0 30px rgba(255,207,90,.45); animation: crestBob 3.2s ease-in-out infinite; image-rendering: pixelated; }
.banner-shine { position: absolute; inset: 5px; border-radius: 16px; overflow: hidden; pointer-events: none; }
.banner-shine::after { content: ''; position: absolute; top: 0; bottom: 0; width: 30%; left: -40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); animation: shine 5s ease-in-out 1s infinite; }
@keyframes crestBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-7px) rotate(3deg); } }
@keyframes shine { 0% { left: -40%; } 30%, 100% { left: 130%; } }
@keyframes bannerIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.loading img { width: 120px; height: 120px; border-radius: 26px; display: block; margin: 0 auto 12px; box-shadow: 0 0 40px rgba(255,207,90,.4); animation: crestBob 2s ease-in-out infinite; }
.foot-crest { width: 48px; height: 48px; border-radius: 12px; }
@media (max-width: 560px) {
  .banner { margin: 46px 0 10px 12px; border-radius: 16px; padding: 4px; }
  .banner-img { border-radius: 12px; }
  .banner-crest { width: 70px; height: 70px; left: -14px; top: -26px; border-radius: 16px; }
}

/* ---------- $MEMERPG on Pump.fun ---------- */
.buy-btn { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 10px; background: linear-gradient(180deg, #6bff9e, #22c55e); color: #052e16; font: 900 13px var(--sans); text-decoration: none; white-space: nowrap; box-shadow: 0 3px 0 #14743a; }
.buy-btn svg, .buy-card svg { width: 18px; height: 18px; flex: none; }
.buy-btn:hover, .buy-card:hover { filter: brightness(1.08); }
.buy-card { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 12px; padding: 11px 12px; border-radius: 12px; background: linear-gradient(180deg, #6bff9e, #22c55e); color: #052e16; text-decoration: none; font: 800 15px var(--sans); box-shadow: 0 4px 0 #14743a; }
.buy-card b { font-weight: 900; }
.ca-copy { width: 100%; display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--bg); border: 2px dashed var(--line); font-size: 13px; color: var(--text); }
.ca-copy .ca-l { font: 900 11px var(--sans); color: var(--green); letter-spacing: 1px; }
.ca-copy .ca-v { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.ca-copy .ca-c { color: var(--gold); font-size: 12px; font-weight: 800; border: 1px solid var(--gold2); border-radius: 6px; padding: 1px 8px; }
.ca-copy:hover { border-color: var(--green); }
.ca-inline { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12px; text-decoration: underline dotted; word-break: break-all; }
@media (max-width: 560px) { .buy-btn span { display: none; } .buy-btn { padding: 0 9px; } }
.hero > * { min-width: 0; }
