/* Lanternshore — UI chrome. The world itself renders crisp & chunky;
   the chrome around it is soft, dark glass with warm lantern accents. */

:root {
  --ink: #eae4d6;
  --ink-dim: #b9b2a2;
  --glow: #ffc66a;
  --glass: rgba(16, 14, 26, 0.78);
  --line: rgba(255, 198, 106, 0.25);
  --pixel: 'Press Start 2P', monospace;
  --body: 'Nunito', system-ui, sans-serif;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --gold: #d8b46a;
  --gold-soft: rgba(216, 180, 106, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #0b0a14;
  font-family: var(--body);
  color: var(--ink);
}

#screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }

#topbar {
  position: absolute;
  top: 12px; left: 14px; right: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* enlarged map overlay */
#bigmap {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(82vw, 82vh); height: min(82vw, 82vh);
  image-rendering: pixelated; z-index: 8; pointer-events: none;
  background: rgba(8,8,16,.82); border: 2px solid var(--gold-soft); border-radius: 12px;
  box-shadow: 0 20px 70px rgba(0,0,0,.6), inset 0 0 40px rgba(255,198,106,.06);
}
#bigmap.hidden { display: none; }

#orecount {
  align-self: center;
  font-size: 14px; font-weight: 800; color: var(--ink);
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
}

#wallet {
  align-self: center;
  display: flex; align-items: center; gap: 7px; line-height: 1;
  font-size: 20px; font-weight: 800; color: #fff;
  background: transparent; border: none;
  border-radius: 0; padding: 2px 4px;
}
#wallet.hidden { display: none; }
/* the gem image, enlarged + vertically centred, no dark border/halo */
#walletico { height: 40px; width: auto; display: block; image-rendering: auto; align-self: center; }
#wallet .walx { color: #fff; font-weight: 700; font-size: 14px; opacity: .8; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
#wallet b { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.75); }
#orecount b { color: #8fd0ff; }

/* ---- CORE on-chain token chip (next to the gem wallet) ---- */
#corebar { align-self: center; display: flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: 16px; font-weight: 800; padding: 3px 11px 3px 9px;
  background: linear-gradient(180deg, rgba(40,30,64,.66), rgba(22,16,38,.66));
  border: 1px solid rgba(168,134,255,.55); border-radius: 999px;
  box-shadow: 0 0 10px rgba(150,110,255,.22); user-select: none; }
#corebar.hidden { display: none; }
#corebar:hover { border-color: rgba(196,170,255,.85); box-shadow: 0 0 14px rgba(168,134,255,.4); }
#coreglyph { color: #c8aaff; font-size: 15px; text-shadow: 0 0 6px rgba(168,134,255,.85); }
#corebar .walx { color: #cbbdf0; font-weight: 700; font-size: 12px; opacity: .8; }
#corebar b { color: #efe8ff; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
#coretag { color: #b9a4f0; font-size: 10px; font-weight: 800; letter-spacing: .08em; opacity: .85; margin-left: 1px; }

/* ---- pet / mount chip (bottom-left) ---- */
#petchip { position: fixed; left: 12px; bottom: 12px; z-index: 30; display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 5px 12px 5px 6px; background: linear-gradient(180deg, rgba(28,34,52,.74), rgba(16,20,34,.74));
  border: 1px solid rgba(150,180,224,.4); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.4); user-select: none; }
#petchip.hidden { display: none; }
#petchip:hover { border-color: rgba(180,205,244,.7); }
#petchip.mounted { border-color: rgba(126,224,150,.75); box-shadow: 0 0 12px rgba(110,224,140,.3); }
/* ---- structure placement hint banner (top-center) ---- */
#placehint { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 40; pointer-events: none;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #eafff0; white-space: nowrap;
  background: linear-gradient(180deg, rgba(28,52,36,.92), rgba(18,34,24,.92)); border: 1px solid rgba(124,255,138,.55);
  box-shadow: 0 4px 18px rgba(0,0,0,.45), 0 0 18px rgba(124,255,138,.25); }
#placehint.hidden { display: none; }

#petchip.away { opacity: .5; }
#petchip.away:hover { opacity: .8; }
#peticon { width: 36px; height: 36px; image-rendering: pixelated; }
#petchip .petmeta { display: flex; flex-direction: column; line-height: 1.1; }
#petname { color: #eaf1ff; font-size: 13px; font-weight: 800; }
#petstate { color: #9fb6d8; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
#petchip.mounted #petstate { color: #8df2a3; }
#petcycle { margin-left: 2px; background: rgba(255,255,255,.08); border: 1px solid rgba(150,180,224,.4); color: #cfe; border-radius: 7px; font-size: 13px; line-height: 1; padding: 3px 6px; cursor: pointer; }
#petcycle.hidden { display: none; }
#petcycle:hover { background: rgba(255,255,255,.16); }

/* ---- the visitor "Stable" button on the plot panel (warm barn-wood look) ---- */
.plotforges .stablebtn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; box-sizing: border-box;
  min-height: 30px; line-height: 1; font-weight: 800; font-size: 12px; letter-spacing: .2px; color: #ffe7c2;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; border: 1px solid #b9824e;
  background: linear-gradient(180deg, #8a5a32, #6d4324); box-shadow: 0 2px 0 #3a2414, inset 0 1px 0 rgba(255,220,170,.25); }
.plotforges .stablebtn:hover { background: linear-gradient(180deg, #a06a3c, #7d4e2a); box-shadow: 0 2px 0 #3a2414, 0 0 16px rgba(214,150,80,.5); }
.plotforges .stablebtn:active { transform: translateY(1px); box-shadow: 0 1px 0 #3a2414; }

/* ---- pet stable feed panel (modal overlay) ---- */
#stablepanel { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 60;
  background: rgba(6,10,20,.5); backdrop-filter: blur(2px); pointer-events: auto; }
#stablepanel.hidden { display: none; }
.stablecard { width: 274px; padding: 14px 16px 16px; background: linear-gradient(180deg, rgba(40,30,52,.98), rgba(24,18,34,.98));
  border: 1px solid rgba(190,130,80,.55); border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,.6); color: #eee; }
.stablehead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.stablehead b { font-size: 16px; color: #d8c6ff; }
#stableclose { background: none; border: none; color: #9a90b8; font-size: 16px; cursor: pointer; padding: 2px 6px; }
#stableclose:hover { color: #fff; }
.stablepet { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
#stableicon { width: 56px; height: 56px; image-rendering: pixelated; background: rgba(0,0,0,.25); border-radius: 10px; }
.stablemeta { display: flex; flex-direction: column; line-height: 1.25; }
.stablemeta b { font-size: 15px; color: #f0e9ff; }
.stablemeta span { font-size: 12px; color: #b9a4f0; }
.stablemeta .stablesub { color: #8df2a3; font-size: 11px; }
.stablebar { height: 9px; background: rgba(0,0,0,.4); border-radius: 6px; overflow: hidden; border: 1px solid rgba(168,134,255,.3); }
.stablebar i { display: block; height: 100%; background: linear-gradient(90deg, #a886ff, #c9a6ff); border-radius: 6px; transition: width .25s; }
.stableprog { text-align: center; font-size: 12px; color: #cbbdf0; margin: 5px 0 4px; }
.stablehint { font-size: 12px; color: #b8b0cc; text-align: center; margin: 6px 0 0; }
.stablehint.dim { color: #8a82a0; opacity: .8; }
#feedbtn { width: 100%; margin-top: 10px; padding: 9px; font-size: 14px; font-weight: 800; border-radius: 9px; cursor: pointer;
  background: linear-gradient(180deg, #7b54d8, #5e3aa0); border: 1px solid rgba(196,170,255,.6); color: #fff; }
#feedbtn:hover:not([disabled]) { filter: brightness(1.12); }
#feedbtn[disabled] { opacity: .5; cursor: default; }

/* ---- fragment counters (Celestial + Verdant → fuse into a gem) ---- */
#fragbar { align-self: center; display: flex; gap: 8px; }
#fragbar.hidden { display: none; }
.fragchip { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 800; padding: 2px 9px 2px 5px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 999px; }
.fragchip .fragico { width: 20px; height: 20px; image-rendering: pixelated; }
.fragchip.cel { color: #aef0ff; border-color: rgba(120,200,232,.5); }
.fragchip.ver { color: #8df2a3; border-color: rgba(95,224,122,.5); }
.fragchip b { text-shadow: 0 1px 2px rgba(0,0,0,.7); }

/* ---- the fuse bench in the satchel (warm gold, matching the game) ---- */
#invfrags { margin: 7px 0 3px; }
.fusecard {
  background: linear-gradient(180deg, rgba(46,34,22,.55), rgba(20,16,26,.66));
  border: 1px solid var(--gold-soft); border-radius: 12px; padding: 9px 12px 11px;
  box-shadow: inset 0 0 26px rgba(255,198,106,.07), 0 2px 8px rgba(0,0,0,.35);
}
.fusehd {
  font-family: var(--pixel); font-size: 8px; letter-spacing: 1.5px; color: var(--gold);
  text-align: center; opacity: .8; margin-bottom: 10px; text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.fragcounts { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-dim); margin-bottom: 11px; }
.fragcount { display: inline-flex; align-items: center; gap: 4px; }
.fragcount img, .fragcount canvas { image-rendering: pixelated; filter: drop-shadow(0 0 5px rgba(255,255,255,.16)); }
.fragcount .fragtxt b { margin-left: 3px; font-size: 14px; }
.fragcount.cel .fragtxt b { color: #aef0ff; } .fragcount.ver .fragtxt b { color: #8df2a3; }
.fragcount.gemres .gemres-ic { height: 30px; width: auto; }
.fuseop { font-family: var(--pixel); font-size: 9px; color: var(--gold-soft); padding: 0 1px; }
.forgebtn {
  display: block; width: 100%; cursor: pointer; font-family: 'Nunito', sans-serif;
  font-weight: 800; font-size: 14px; letter-spacing: .3px; color: #3a2410;
  padding: 9px 12px; border-radius: 10px; border: 2px solid #2e2430;
  background: linear-gradient(180deg, #ffe7a6 0%, #f0b24e 55%, #e09b34 100%);
  box-shadow: 0 3px 0 #2e2430, 0 0 14px rgba(255,198,106,.32); transition: transform .05s, box-shadow .12s, filter .12s;
}
.forgebtn b { color: #2a1a08; }
.forgebtn:hover:not(:disabled) { background: linear-gradient(180deg, #fff1c4, #f5bd5e, #e8a53e); box-shadow: 0 3px 0 #2e2430, 0 0 22px rgba(255,214,128,.6); }
.forgebtn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #2e2430, 0 0 14px rgba(255,198,106,.4); }
.forgebtn:disabled { cursor: default; filter: grayscale(.55) brightness(.66); box-shadow: 0 3px 0 #2e2430; }
.forgebtn.forging { animation: forgeflash .5s ease; }
@keyframes forgeflash { 0% { filter: brightness(1); } 40% { filter: brightness(1.9) saturate(1.4); box-shadow: 0 3px 0 #2e2430, 0 0 30px rgba(255,235,150,.9); } 100% { filter: brightness(1); } }

/* ---- world2 farm-plot panel ---- */
#plotpanel { position: absolute; transform: translate(-50%, -100%); z-index: 30; pointer-events: auto; }
#plotpanel.hidden { display: none; }
.plotcard { min-width: 168px; background: rgba(14,20,34,.94); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; box-shadow: 0 6px 20px rgba(0,0,0,.5); text-align: center; }
.plotowner { display: block; font-size: 13px; margin-bottom: 2px; }
.plotready { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.plotready b { color: #8df2a3; }
.plotcut { color: #79c4ff; }
.plotbtns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: stretch; }
.plotbtns button { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 30px; line-height: 1;
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(40,52,76,.7); color: var(--ink); cursor: pointer; }
.plotbtns button.pri { background: linear-gradient(180deg, #3a7d49, #2c5f39); color: #eafff0; border-color: #4a9a5e; font-weight: 700; }
.plotbtns button:disabled { opacity: .4; cursor: default; }

#hearts {
  height: 26px;
  width: 200px;
  image-rendering: pixelated;
  align-self: center;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.5));
}

#banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--pixel);
  font-size: 16px;
  color: var(--glow);
  text-shadow: 0 3px 0 rgba(0,0,0,.7), 0 0 18px rgba(255,198,106,.5);
  background: rgba(16,14,26,.72);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 24px;
  white-space: nowrap;
  animation: bannerin .25s ease-out;
}
@keyframes bannerin { from { transform: translateX(-50%) scale(.8); opacity: 0; } }

#miniwrap { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
/* live player count — perf-HUD format (mono), but white. Small under the minimap; enlarged under the big map */
#playercount, #playercountbig {
  font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #fff; background: rgba(0, 0, 0, 0.34);
  padding: 1px 6px; border-radius: 4px; letter-spacing: 0.3px;
  pointer-events: none; white-space: nowrap;
}
#playercount.hidden, #playercountbig.hidden { display: none; }
#playercountbig {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(50% + min(82vw, 82vh) / 2 + 8px);
  font-size: 14px; padding: 3px 12px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.45); z-index: 8;
}
#minimap {
  width: 168px; height: 117px;
  image-rendering: pixelated;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0b1a2a;
  opacity: .92;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
}

/* unread-DM notifier — sender's face + count, click to read the next one */
#dmnotify {
  position: absolute;
  top: 140px; right: 14px;
  pointer-events: auto;
  width: 58px; height: 58px;
  padding: 0;
  background: var(--glass); border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0,0,0,.45);
  cursor: pointer;
  animation: dmpop .3s ease-out, dmpulse 1.8s ease-in-out infinite;
}
#dmnotify:hover { transform: scale(1.08); }
#dmnotify.hidden { display: none; }
#dmnotifyava {
  width: 52px; height: 52px;
  image-rendering: pixelated;
  border-radius: 50%;
  display: block;
  margin: 2px;
}
#dmnotifybadge {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 21px; height: 21px;
  padding: 0 5px;
  box-sizing: border-box;
  background: #e7493b; color: #fff;
  font-size: 12px; font-weight: 800; line-height: 19px;
  text-align: center;
  border-radius: 999px;
  border: 2px solid rgba(16,14,26,.92);
}
@keyframes dmpop { from { transform: scale(.5); opacity: 0; } }
@keyframes dmpulse { 0%,100% { box-shadow: 0 4px 16px rgba(0,0,0,.45); } 50% { box-shadow: 0 4px 16px rgba(0,0,0,.45), 0 0 14px 2px rgba(231,73,59,.7); } }


#charpick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.skinarrow {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1;
  color: var(--gold-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
  user-select: none;
  transition: color .18s, transform .12s;
}
.skinarrow:hover { color: var(--gold); transform: scale(1.15); }
.skinarrow:active { transform: scale(0.95); }
/* gender toggle (title) + profile gender icon — ♂ blue / ♀ pink */
#genderpick { display: flex; gap: 10px; justify-content: center; margin: 8px 0 2px; }
.genbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.05); font-size: 21px; font-weight: 800; line-height: 1; cursor: pointer; opacity: .45; transition: opacity .15s, box-shadow .15s; }
.genbtn.male { color: #5b9bff; }
.genbtn.female { color: #ff7eb6; }
.genbtn.on { opacity: 1; border-color: currentColor; box-shadow: 0 0 11px -2px currentColor; background: rgba(255,255,255,.1); }
.genbtn:hover { opacity: .85; }
.profgender { font-size: 19px; font-weight: 800; line-height: 1; }
.profgender.male { color: #5b9bff; }
.profgender.female { color: #ff7eb6; }
.profgender.editable { cursor: pointer; padding: 0 3px; border-radius: 5px; }
.profgender.editable:hover { background: rgba(255,255,255,.12); }
#perf {
  position: absolute;
  left: 14px; bottom: 3px;
  font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #bfe0c4;
  background: rgba(0, 0, 0, 0.34);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  pointer-events: none;
  z-index: 60;
  white-space: nowrap;
}
#chatlog {
  position: absolute;
  left: 14px; bottom: 64px;
  width: min(380px, 60vw);
  max-height: 34vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent, black 14%);
}
#chatlog::-webkit-scrollbar { display: none; }

.msg {
  font-size: 13.5px;
  line-height: 1.35;
  background: var(--glass);
  border-radius: 10px;
  padding: 5px 10px;
  width: fit-content;
  max-width: 100%;
  word-wrap: break-word;
  animation: msgin .18s ease-out;
}
.msg b { margin-right: 5px; }
.msg.sys { color: var(--ink-dim); font-style: italic; background: rgba(16,14,26,.5); }
@keyframes msgin { from { transform: translateY(6px); opacity: 0; } }

#chatform {
  position: absolute;
  left: 14px; bottom: 18px;
  width: min(380px, 60vw);
  pointer-events: auto;
}
#chatinput {
  width: 100%;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--glow);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 0 3px rgba(255,198,106,.12), 0 6px 20px rgba(0,0,0,.45);
}


/* ---------- title screen ---------- */
#title {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 110%, rgba(255,170,80,.14), transparent 55%);
}

#titlecard {
  width: min(384px, calc(100vw - 32px));
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(216,180,106,.10), transparent 60%),
    linear-gradient(180deg, rgba(24,21,33,.93), rgba(13,11,20,.95));
  border: 1px solid var(--gold-soft);
  border-radius: 16px;
  padding: 34px 34px 30px;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 90px rgba(0,0,0,.66), inset 0 1px 0 rgba(255,255,255,.05);
}

#logo {
  display: block;
  width: min(258px, 80%);
  margin: 2px auto 0;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.5));
}

/* elegant tracked subtitle flanked by gold hairlines (no plain text) */
.tag {
  font-family: var(--serif);
  font-size: 14px; font-weight: 500;
  letter-spacing: 5px; text-transform: uppercase;
  color: var(--gold);
  margin: 12px 0 20px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.tag::before, .tag::after {
  content: ''; height: 1px; width: 38px;
}
.tag::before { background: linear-gradient(90deg, transparent, var(--gold-soft)); }
.tag::after { background: linear-gradient(90deg, var(--gold-soft), transparent); }

#preview {
  width: 172px; height: 144px;
  image-rendering: pixelated;
  background: transparent;   /* no backdrop — just the character + its gold glow */
}

#looks { margin: 12px 0 4px; display: flex; flex-direction: column; gap: 5px; }

/* class picker — accent-coloured emblem cards (title screen + profile) */
#classpick { margin: 12px 0 2px; display: flex; flex-direction: column; gap: 8px; }
.classcards { display: flex; gap: 8px; justify-content: center; }
.classcard {
  --acc: #9fb0c8;
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 4px 9px; border-radius: 13px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1.5px solid rgba(255,255,255,.12); color: #cdd5e2;
  font: inherit; font-weight: 800; transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
.classcard .ccemblem {
  font-size: 22px; line-height: 1; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));   /* no circle ring/background — just the emblem */
}
.classcard .ccname { font-size: 12px; letter-spacing: .3px; }
.classcard:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--acc) 70%, transparent); color: #fff; }
.classcard.on {
  border-color: var(--acc); color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 24%, transparent), color-mix(in srgb, var(--acc) 6%, transparent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--acc) 40%, transparent), 0 6px 18px color-mix(in srgb, var(--acc) 28%, transparent);
}
.classcard:disabled { opacity: .55; cursor: default; }
.classblurb { font-size: 11px; line-height: 1.4; color: #98a2b4; text-align: center; min-height: 32px; padding: 0 6px; }
/* read-only class badge on another player's profile */
.classbadge {
  --acc: #9fb0c8; display: inline-flex; align-items: center; gap: 7px; margin: 2px auto;
  padding: 5px 14px 5px 6px; border-radius: 999px; font-weight: 800; font-size: 12px; color: #eaf0f8;
  background: color-mix(in srgb, var(--acc) 14%, rgba(255,255,255,.03)); border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent);
}
.classbadge .ccemblem { font-size: 16px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }   /* no circle ring/background — just the emblem (matches .classcard) */
#profclass { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.profgear { display: flex; gap: 6px; justify-content: center; margin: 2px 0 8px; }
.profgear.bare { opacity: .8; }
.profgearcell { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 9px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); cursor: default; }
.profgearcell.empty { color: rgba(255,255,255,.20); font-size: 15px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }

.lookrow {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  gap: 6px;
}
.lookrow button {
  height: 26px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.lookrow button:hover { background: rgba(255,198,106,.22); }
.lookrow .lab {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.lookrow .lab i {
  width: 13px; height: 13px;
  border-radius: 4px;
  display: inline-block;
  border: 1px solid rgba(0,0,0,.4);
}

#name {
  width: 100%;
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 1px;
  text-align: center;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gold-soft);
  border-radius: 0;
  padding: 8px 4px 6px;
  outline: none;
  transition: border-color .22s;
}
#name::placeholder { color: rgba(216,180,106,.4); font-style: italic; letter-spacing: 3px; font-size: 16px; }
#name:focus { border-bottom-color: var(--gold); }

.btnrow { display: flex; gap: 8px; margin-top: 22px; }
.btnrow button {
  flex: 1;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 5px;
  text-transform: uppercase;
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  transition: all .24s ease;
}
#dice { display: none; }
#play {
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold-soft);
}
#play:hover {
  color: #19140b;
  background: linear-gradient(180deg, #e8cb88, var(--gold));
  border-color: var(--gold);
  box-shadow: 0 8px 26px rgba(216,180,106,.28);
}

#connectwallet {
  width: 100%;
  margin-top: 12px;
  padding: 9px;
  font-family: var(--serif); font-weight: 600; font-size: 14px; letter-spacing: 1px;
  color: #d9d2ee;
  background: rgba(118, 100, 196, 0.16);
  border: 1px solid rgba(150, 130, 220, 0.42);
  border-radius: 9px;
  cursor: pointer;
  transition: all .2s ease;
}
#connectwallet:hover { background: rgba(118, 100, 196, 0.28); color: #fff; }
#connectwallet.connected { color: #cdf23a; border-color: rgba(180, 220, 60, .5); background: rgba(150, 190, 40, .15); }
#walletaddr { margin: 7px 0 0; font-size: 12px; color: #b9e07a; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#walletaddr.hidden { display: none; }

#err { margin-top: 10px; font-size: 13px; color: #ff9b8a; }

/* ---------- disconnect ---------- */
#dc {
  position: fixed; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 7, 16, .7);
  backdrop-filter: blur(3px);
}
.dccard {
  text-align: center;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 36px;
}
.dccard h2 { font-size: 17px; margin-bottom: 16px; }
.dccard button {
  font-family: var(--body);
  font-weight: 800;
  font-size: 14px;
  border: none;
  border-radius: 10px;
  padding: 10px 22px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffd98c, #f0a542);
  color: #3a2410;
}

/* ---------- dojo sparring queue (retro) ---------- */
#sparbar {
  position: absolute;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  pointer-events: auto;
}
#sparbar.hidden { display: none; }
.sparwager { display: inline-flex; align-items: center; gap: 6px; font-family: var(--pixel); font-size: 8px; letter-spacing: .5px; color: var(--gold); background: rgba(16,14,26,.7); padding: 5px 9px; border-radius: 7px; border: 1px solid var(--line); }
.sparwager .betinp { width: 78px; padding: 4px 7px; font-size: 12px; }
#sparwagercur { font-size: 13px; line-height: 1; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink); cursor: pointer; }
#sparwagercur:hover { border-color: var(--gold-soft); }
/* wager-confirm card */
#sparpending { position: fixed; left: 50%; top: 38%; transform: translate(-50%,-50%); z-index: 40; pointer-events: auto; }
#sparpending.hidden { display: none; }
.spcard { width: min(360px, calc(100vw - 28px)); background: rgba(14,20,34,.96); border: 2px solid var(--glow); border-radius: 14px; padding: 16px 18px; box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 30px rgba(255,198,106,.2); text-align: center; }
.sptitle { font-family: var(--pixel); font-size: 11px; color: var(--glow); letter-spacing: 1px; margin-bottom: 10px; }
.spbody { font-size: 14.5px; color: var(--ink); line-height: 1.5; }
.spbody b { color: #ffe7a6; }
.spsub { font-size: 12px; color: var(--ink-dim); }
.sprow { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.sprow button { font-family: var(--pixel); font-size: 9px; letter-spacing: .5px; padding: 10px 14px; border-radius: 9px; border: 1px solid var(--line); background: rgba(40,52,76,.7); color: var(--ink); cursor: pointer; }
.sprow button.pri { background: linear-gradient(180deg,#3a7d49,#2c5f39); border-color: #4a9a5e; color: #eafff0; }
.sprow button:hover { transform: translateY(-1px); }
#queuestatus {
  font-family: var(--pixel);
  font-size: 8.5px; letter-spacing: .5px;
  color: var(--ink-dim);
  text-shadow: 0 2px 0 rgba(0,0,0,.6);
  background: rgba(16,14,26,.6);
  padding: 5px 10px; border-radius: 6px;
}
/* a pixel-art sword stamped onto the button via layered gradients */
#queuebtn {
  --blade: #e9eef7; --edge: #b9c2d4; --hilt: #d8b04a; --grip: #7a4a22;
  position: relative;
  font-family: var(--pixel);
  font-size: 10px; letter-spacing: 1px;
  color: #2a1c0c;
  padding: 12px 20px 12px 40px;
  cursor: pointer;
  image-rendering: pixelated;
  background:
    /* katana blade */
    linear-gradient(var(--edge),var(--edge)) 14px 11px/3px 13px no-repeat,
    linear-gradient(var(--blade),var(--blade)) 16px 9px/3px 15px no-repeat,
    /* tip */
    linear-gradient(var(--blade),var(--blade)) 16px 6px/3px 3px no-repeat,
    /* guard */
    linear-gradient(var(--hilt),var(--hilt)) 12px 23px/11px 3px no-repeat,
    /* grip */
    linear-gradient(var(--grip),var(--grip)) 16px 26px/3px 7px no-repeat,
    linear-gradient(180deg,#ffe39a,#f0a93f);
  color: #3a2410;
  border: 2px solid #2e2430;
  border-radius: 4px;
  box-shadow: 0 4px 0 #2e2430, 0 7px 14px rgba(0,0,0,.4);
  transition: transform .06s, box-shadow .06s;
}
#queuebtn:hover { filter: brightness(1.06); }
#queuebtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2e2430, 0 3px 8px rgba(0,0,0,.4); }
#queuebtn.queued {
  background: linear-gradient(180deg,#3a3550,#2a2640);
  color: #e7e1d4;
  border-color: #15121e;
  box-shadow: 0 4px 0 #15121e, 0 7px 14px rgba(0,0,0,.4);
}

/* ---------- settings (gear) ---------- */
#gear {
  position: absolute;
  right: 14px; bottom: 16px;
  pointer-events: auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--glow);
  font-size: 19px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: transform .15s ease, filter .15s ease;
}
#gear:hover { filter: brightness(1.15); transform: rotate(40deg); }

#settings {
  position: absolute;
  right: 14px; bottom: 64px;
  pointer-events: auto;
}
.setcard {
  width: 260px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 50px rgba(0,0,0,.55);
}
.setcard h3 {
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--glow);
  letter-spacing: 1px;
}
.setcard h3 span { color: #7ec8e8; }
.settag { font-size: 12px; color: var(--ink-dim); margin: 6px 0 12px; }
.setrow {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.5px; font-weight: 700;
  padding: 7px 0;
  border-top: 1px solid rgba(255,255,255,.07);
}
.setrow b { color: var(--glow); }
.setrow button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.08);
  color: var(--ink);
  font-weight: 800; font-size: 12.5px;
  border-radius: 8px; padding: 4px 12px; cursor: pointer;
}
.setrow button.off { color: #6a6376; }
.setrow button.bindkey { min-width: 58px; font-family: ui-monospace, Menlo, monospace; }
.setrow button.bindkey.binding { color: var(--glow); border-color: var(--glow); animation: dmpop .3s ease; }
.setrow.setrow-controls button { font-size: 11px; padding: 3px 9px; }
#bindlist { max-height: 232px; overflow-y: auto; margin: 2px -4px 0; padding: 0 4px; }
#bindlist .setrow { font-size: 12.5px; padding: 5px 0; }
#bindlist .setrow span { color: var(--ink-dim); font-weight: 700; }
.sethint { font-size: 11.5px; line-height: 1.5; color: var(--ink-dim); margin: 12px 0; }
#setclose {
  width: 100%;
  border: none; border-radius: 9px;
  background: rgba(255,255,255,.1); color: var(--ink);
  font-family: var(--body); font-weight: 800; font-size: 13px;
  padding: 9px; cursor: pointer;
}
#setclose:hover { background: rgba(255,198,106,.2); }

/* ---------- player profile card ---------- */
#profile, #dm {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,7,16,.55);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}
.profcard {
  position: relative;
  width: 324px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,198,106,.16), transparent 60%),
    var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0 22px 20px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 80px rgba(0,0,0,.65);
}
/* a banner strip behind the avatar */
.profcard::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 86px;
  background: linear-gradient(180deg, rgba(126,200,232,.22), rgba(255,198,106,.10) 70%, transparent);
  border-bottom: 1px solid rgba(255,198,106,.18);
}
#profava {
  position: relative;
  width: 92px; height: 92px;
  margin-top: 26px;
  image-rendering: pixelated;
  border-radius: 50%;
  border: 3px solid var(--glow);
  background: #1a2236;
  box-shadow: 0 6px 20px rgba(0,0,0,.5), 0 0 0 4px rgba(16,14,26,.7);
}
#profname {
  position: relative;
  font-family: var(--pixel);
  font-size: 14px; color: var(--ink);
  margin: 12px 0 6px; word-break: break-word;
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
}
.profrank {
  display: inline-block;
  font-family: var(--pixel); font-size: 8px; letter-spacing: 1px;
  color: #2a1c0c;
  background: linear-gradient(180deg,#ffe39a,#f0a93f);
  padding: 5px 12px; border-radius: 999px;
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
  margin-bottom: 16px;
}
/* the big win–loss record */
.profrecord { margin: 2px 0 14px; }
.profrecord b {
  display: block; font-family: var(--pixel); font-size: 22px;
  color: var(--ink); letter-spacing: 2px;
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
}
.profrecord span { font-size: 10.5px; color: var(--ink-dim); font-weight: 800; letter-spacing: .5px; }
/* Legend title pill on the profile card */
.proftitle {
  display: inline-block; margin: 2px auto 4px; padding: 2px 10px; border-radius: 999px;
  font-family: var(--pixel); font-size: 10px; letter-spacing: .3px;
  border: 1px solid currentColor; text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.proftitle.elo { color: #ff8f8f; box-shadow: 0 0 10px rgba(255,52,52,.5); }
.proftitle.dragon { color: #ffd24a; box-shadow: 0 0 10px rgba(255,176,32,.5); }
/* item hover tooltip (equip slots, satchel, trade) */
#itemtip {
  position: fixed; z-index: 9999; pointer-events: none;
  max-width: 220px; padding: 8px 10px; border-radius: 10px;
  background: rgba(20,14,30,.96); border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  font-size: 11.5px; line-height: 1.5; color: #f3eee2;
}
#itemtip b { font-family: var(--pixel); font-size: 12px; }
#itemtip .tiprar { color: var(--ink-dim); font-weight: 800; text-transform: uppercase; font-size: 9.5px; letter-spacing: .3px; }
#itemtip .tipstat { color: #9fe7ff; font-weight: 800; }
#itemtip .tipbound { color: #dcccff; }
#itemtip .tipset { color: #ffd24a; }
/* worn-gear strip inside each trade offer */
.offerworn { display: flex; gap: 5px; justify-content: center; margin-top: 6px; }
.offerworn-label { font-size: 8.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-dim); text-align: center; margin-top: 8px; font-weight: 800; }
.worncell { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: rgba(255,255,255,.05); }
.worncell.empty { color: rgba(255,255,255,.22); font-size: 14px; }
.profstats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 7px;
  margin: 4px 0 12px;
}
.profstats > div {
  flex: 1 1 56px;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px; padding: 9px 2px 8px;
  transition: transform .12s, border-color .12s;
}
.profstats > div:hover { transform: translateY(-1px); border-color: var(--gold-soft); }
.profstats b { display: block; font-family: var(--pixel); font-size: 12.5px; color: var(--glow); text-shadow: 0 1px 3px rgba(80,200,255,.25); }
.profstats span { font-size: 9px; color: var(--ink-dim); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; display: block; }
/* bio block */
.profbio {
  text-align: left;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 14px;
}
.profbiolabel {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ink-dim); margin-bottom: 5px;
}
.profbiolabel button {
  border: none; background: rgba(255,198,106,.16); color: var(--glow);
  font-size: 10px; font-weight: 800; border-radius: 6px; padding: 3px 9px; cursor: pointer;
  text-transform: uppercase; letter-spacing: .5px;
}
#profbiotext { font-size: 13px; line-height: 1.45; color: var(--ink); word-wrap: break-word; min-height: 18px; }
#profbiotext.empty { color: var(--ink-dim); font-style: italic; }
#profbioinput {
  width: 100%; height: 56px; resize: none;
  font-family: var(--body); font-size: 13px; color: var(--ink);
  background: rgba(0,0,0,.25); border: 1px solid var(--glow); border-radius: 8px;
  padding: 7px 9px; outline: none; margin-top: 4px;
}
#profbiosave {
  margin-top: 6px; width: 100%;
  border: none; border-radius: 8px; cursor: pointer;
  background: rgba(255,198,106,.2); color: var(--ink);
  font-family: var(--body); font-weight: 800; font-size: 12.5px; padding: 7px;
}
#profdm {
  width: 100%;
  border: 2px solid #2e2430; border-radius: 11px;
  background: linear-gradient(180deg, #ffd98c, #f0a542);
  color: #3a2410; font-family: var(--body); font-weight: 800; font-size: 14px;
  padding: 11px; cursor: pointer;
  box-shadow: 0 4px 0 #2e2430;
  transition: transform .06s, box-shadow .06s;
}
#profdm:active { transform: translateY(3px); box-shadow: 0 1px 0 #2e2430; }
#profclose, .dmhead button {
  position: absolute; top: 10px; right: 12px;
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--ink-dim);
  font-size: 16px; cursor: pointer; line-height: 1;
}
#profclose:hover { color: var(--ink); }

/* ---------- direct messages ---------- */
.dmcard {
  width: min(380px, calc(100vw - 32px));
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 22px 70px rgba(0,0,0,.6);
}
.dmhead {
  position: relative;
  display: flex; align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.dmhead b { color: var(--glow); }
.dmhead button { position: static; margin-left: auto; }
#dmlog {
  height: 46vh; max-height: 360px;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  scrollbar-width: thin;
}
#dmlog .dmmsg {
  font-size: 13.5px; line-height: 1.35;
  padding: 7px 11px; border-radius: 12px;
  max-width: 80%; width: fit-content;
  word-wrap: break-word;
}
#dmlog .dmmsg.me { align-self: flex-end; background: rgba(255,198,106,.18); }
#dmlog .dmmsg.them { align-self: flex-start; background: rgba(255,255,255,.08); }
#dmform { padding: 10px 12px; border-top: 1px solid var(--line); }
#dminput {
  width: 100%;
  font-family: var(--body); font-size: 14px; font-weight: 600;
  color: var(--ink);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--glow);
  border-radius: 10px; padding: 9px 12px; outline: none;
}

/* ============================================================
   World 3 — boss bar, HUD buttons, satchel/market/trade panels
   ============================================================ */
#bossbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px)); pointer-events: none; z-index: 6;
  text-align: center;
}
/* on narrow screens the centred boss bar reaches the top-left hearts — drop it below the HUD row */
@media (max-width: 620px) { #bossbar { top: 56px; } }
.bossrow { margin-bottom: 7px; }
.bossrow:last-child { margin-bottom: 0; }
.bosslabel {
  font-family: var(--pixel); font-size: 9px; color: #eaf3ff;
  letter-spacing: 1px; text-shadow: 0 2px 0 rgba(0,0,0,.6); margin-bottom: 5px;
}
.bosstrack {
  height: 13px; border-radius: 8px; overflow: hidden;
  background: rgba(10,14,26,.72); border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 6px 22px rgba(0,0,0,.5);
}
.bossfill {
  height: 100%; width: 100%;
  background: linear-gradient(180deg, #ff8db0, #d83a6a);   /* default (single-boss); 2b heads get per-head gradients from JS */
  transition: width .18s ease-out;
}
.bossrow.bossdead .bossfill { background: #3a4257; }
/* an ENRAGED surviving head: its bar pulses red-hot and its label glows */
.bossrow.enraged .bosstrack { border-color: rgba(255,90,90,.9); box-shadow: 0 0 14px rgba(255,60,60,.6); animation: bossEnrage 0.7s ease-in-out infinite; }
.bossrow.enraged .bosslabel { color: #ff9a8a; text-shadow: 0 0 8px rgba(255,60,60,.7); }
@keyframes bossEnrage { 0%,100% { box-shadow: 0 0 10px rgba(255,60,60,.45); } 50% { box-shadow: 0 0 18px rgba(255,60,60,.85); } }


/* shared modal scrim for the three new panels */
#inventory, #market, #trade {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8,7,16,.55); backdrop-filter: blur(3px); z-index: 30; pointer-events: auto;
}
.invcard {
  width: min(360px, calc(100vw - 28px)); max-height: calc(100vh - 60px); overflow-y: auto;
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; backdrop-filter: blur(12px); box-shadow: 0 22px 70px rgba(0,0,0,.6);
  animation: dmpop .18s ease-out;
}
.invcard.wide { width: min(440px, calc(100vw - 28px)); }
.invhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.invhead b { font-family: var(--pixel); font-size: 12px; color: var(--glow); letter-spacing: 1px; }
.invhead button { width: 26px; height: 26px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.08); color: var(--ink-dim); font-size: 17px; cursor: pointer; }
.invhead button:hover { background: rgba(255,255,255,.16); color: var(--ink); }
.invhead .headtools { display: flex; align-items: center; gap: 9px; }
/* a clean gold pill used to toggle between the satchel and your profile */
.paneltoggle { width: auto !important; height: auto !important; border-radius: 999px !important;
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12px; letter-spacing: .3px;
  padding: 5px 13px !important; cursor: pointer; color: #3a2410 !important;
  border: 1px solid #2e2430 !important; background: linear-gradient(180deg, #ffe7a6, #f0b24e) !important;
  box-shadow: 0 2px 0 #2e2430; transition: transform .05s, background .12s; }
.paneltoggle:hover { background: linear-gradient(180deg, #fff1c4, #f5bd5e) !important; color: #2a1a08 !important; }
.paneltoggle:active { transform: translateY(1px); box-shadow: 0 1px 0 #2e2430; }
.paneltoggle.hidden { display: none; }
/* the Satchel toggle in the profile sits top-left, mirroring the close X top-right */
.profback { position: absolute; top: 10px; left: 12px; z-index: 3; }

.geargrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.gearslot {
  aspect-ratio: 1; border-radius: 11px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05); display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; position: relative;
}
.gearslot canvas { image-rendering: pixelated; width: 80%; height: 80%; object-fit: contain; }
.gearslot.empty { color: var(--ink-dim); font-size: 10px; font-weight: 800; cursor: default;
  border-style: dashed; text-transform: uppercase; letter-spacing: .5px; }
.gearslot:not(.empty):hover { box-shadow: 0 0 0 2px var(--glow) inset; }

.invstats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  font-size: 12px; color: var(--ink-dim); font-weight: 800; padding: 6px 0 10px;
  border-bottom: 1px solid rgba(255,255,255,.07); margin-bottom: 10px; }
.invstats span { color: var(--ink); }
/* trade-up forge modal */
#forge { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6,10,20,.62); z-index: 60; pointer-events: auto; }
#forge.hidden { display: none; }
.forgecard { width: min(560px, 93vw); max-height: 86vh; overflow-y: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; backdrop-filter: blur(10px); box-shadow: 0 16px 50px rgba(0,0,0,.55); }
.forgecard h3 { font-family: var(--pixel); font-size: 13px; letter-spacing: 1px; margin-bottom: 8px; }
.forgerecipe { font-size: 12px; color: var(--ink-dim); line-height: 1.5; margin-bottom: 8px; }
.forgefill { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.forgefillb { border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); font-weight: 800; font-size: 11px; border-radius: 8px; padding: 3px 9px; cursor: pointer; }
.forgechips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; max-height: 40vh; overflow-y: auto; padding: 4px; background: rgba(0,0,0,.18); border-radius: 10px; }
.forgechip { border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 8px; padding: 2px; cursor: pointer; line-height: 0; }
.forgechip.on { outline: 2px solid var(--glow); outline-offset: -1px; box-shadow: 0 0 8px rgba(126,224,255,.5); }
.forgestatus { font-size: 13px; font-weight: 700; color: var(--ink); text-align: center; padding: 8px 0; }
.forgebtns { display: flex; gap: 10px; }
.forgebtns button { flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink); font-weight: 800; border-radius: 9px; padding: 8px; cursor: pointer; }
.forgebtns button.pri { background: var(--glow); color: #06121f; }
.forgebtns button:disabled { opacity: .45; cursor: default; }
.forgenote { font-size: 10.5px; color: var(--ink-dim); margin-top: 8px; text-align: center; }
.plotforges, .plottools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: center; align-items: stretch; }
/* every plot-panel action button shares one height + pill shape so each row reads as a tidy, centered cluster
   (override the forge-MODAL .forgebtn rule's display:block/width:100% — here they must be auto-width inline pills) */
.plotforges .forgebtn, .plottools button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: auto; min-height: 30px; box-sizing: border-box; line-height: 1;
  border: 1px solid var(--line); background: rgba(255,255,255,.07); color: var(--ink);
  font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 12px; letter-spacing: .2px;
  border-radius: 8px; padding: 6px 11px; cursor: pointer; box-shadow: none; transition: background .12s, box-shadow .12s, transform .05s; }
.plotforges .forgebtn { background: rgba(201,169,255,.16); border-color: #c9a9ff66; color: #ece3ff; }
.plotforges .forgebtn:hover:not(:disabled) { background: rgba(201,169,255,.30); box-shadow: 0 0 12px rgba(201,169,255,.38); }
.plottools button:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.plotforges .forgebtn:active:not(:disabled), .plottools button:active:not(:disabled) { transform: translateY(1px); }
.plottools button:disabled { opacity: .5; cursor: default; }
.plottools button small { color: var(--ink-dim); font-weight: 700; }
/* forge-deed merchant panel (shown in the shop) */
#shoppanel { position: absolute; right: 14px; bottom: 64px; pointer-events: auto; }
#shoppanel.hidden { display: none; }
.shopcard { width: 260px; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(10px); box-shadow: 0 16px 50px rgba(0,0,0,.5); }
.shoptitle { color: #e8c66a; font-weight: 800; font-size: 14px; }
.shopsub { font-size: 11.5px; color: var(--ink-dim); line-height: 1.5; margin: 6px 0 10px; }
.deedbuy { display: block; width: 100%; margin-top: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: var(--ink); font-weight: 800; font-size: 12.5px; border-radius: 9px; padding: 8px; cursor: pointer; }
.deedbuy:hover { background: rgba(232,198,106,.18); border-color: #e8c66a66; }
/* effusion bonuses — a full-width row of coloured chips under the gear stats */
.invstats .effurow { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.invstats .effuchip { color: inherit; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.05);
  border: 1px solid currentColor; border-radius: 7px; padding: 1px 7px; opacity: .92; }

.invtabs { display: flex; gap: 6px; margin-bottom: 10px; }
.invtabs button { flex: 1; padding: 6px 0; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--ink-dim);
  font-weight: 800; font-size: 12px; }
.invtabs button.on { background: rgba(255,198,106,.18); color: var(--glow); border-color: var(--gold-soft); }

.invlist { display: flex; flex-direction: column; gap: 7px; max-height: 46vh; overflow-y: auto; }
.itemrow { display: flex; flex-direction: column; gap: 9px; padding: 10px 11px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); }
.itemtop { display: flex; align-items: center; justify-content: center; gap: 10px; }
.itemic { image-rendering: pixelated; width: 40px; height: 40px; flex: 0 0 auto; }
/* special legendaries (Concentration Bow, rez Amulet) — a constant, subtle WHITE glow (no pulse) */
.itemglow { filter: drop-shadow(0 0 1px rgba(255,255,255,.7)) drop-shadow(0 0 3px rgba(225,235,255,.4)); }
.itemmeta { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.3; }
.itemmeta b { font-size: 14px; }
.itemmeta span { font-size: 11px; color: var(--ink-dim); }
.mktseller { font-size: 10px !important; color: #8fd0ff !important; }
.itemacts { display: flex; gap: 6px; align-items: stretch; justify-content: center; }
.itemacts button { flex: 1 1 0; min-width: 0; text-align: center; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink);
  font-weight: 800; border-radius: 8px; padding: 6px 6px; font-size: 12px; cursor: pointer; }
.itemacts button:hover { background: rgba(255,198,106,.2); }
.itemacts button.pri { border: 2px solid #2e2430; background: linear-gradient(180deg,#ffd98c,#f0a542);
  color: #3a2410; box-shadow: 0 3px 0 #2e2430; }
.itemacts button.pri:active { transform: translateY(2px); box-shadow: 0 1px 0 #2e2430; }
.itemacts button.off { opacity: .42; pointer-events: none; cursor: default; }   /* maxed effusion — can't consume past the cap */
.itemacts button.danger { color: #ffb4a8; border-color: rgba(220,90,70,.5); }
.itemacts button.danger:hover { background: rgba(220,70,55,.22); color: #ffd2c9; }
.itemacts button.danger.on { background: #b5352a; border-color: #e0604a; color: #fff; box-shadow: 0 0 0 1px rgba(224,96,74,.6); }
.sellrow .priceinp { width: 56px; background: rgba(255,255,255,.07); border: 1px solid var(--glow);
  border-radius: 8px; color: var(--ink); padding: 4px 6px; font-weight: 800; }
.sellrow .mktnet { font-size: 10px; color: var(--ink-dim); align-self: center; white-space: nowrap; }   /* net after the 8.5% fee */
.invempty { color: var(--ink-dim); font-size: 12px; text-align: center; padding: 22px 8px; line-height: 1.5; }
.invhint { font-size: 10.5px; color: var(--ink-dim); margin-top: 12px; line-height: 1.45;
  border-top: 1px solid rgba(255,255,255,.07); padding-top: 10px; }

.profbtns { display: flex; gap: 8px; }
.profbtns button { flex: 1; }
#proftrade { border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink);
  font-weight: 800; border-radius: 11px; padding: 9px 0; cursor: pointer; }
#proftrade:hover { background: rgba(255,198,106,.2); }

/* trade window */
.tradecols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tradebox { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px; padding: 9px; min-height: 92px; }
.offerhead { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 6px; }
.offerhead b { color: var(--glow); font-weight: 800; }
.offerhead span { color: var(--ink-dim); }
.offergrid { display: flex; flex-wrap: wrap; gap: 4px; min-height: 34px; }
.offergrid canvas { image-rendering: pixelated; width: 30px; height: 30px; border-radius: 5px; }
.offercoin { margin-top: 6px; font-weight: 800; color: #cdf23a; font-size: 12px; }
.traderow { font-size: 12px; color: var(--ink-dim); margin-bottom: 8px; }
.traderow input { width: 80px; background: rgba(255,255,255,.07); border: 1px solid var(--glow);
  border-radius: 8px; color: var(--ink); padding: 5px 8px; font-weight: 800; margin-left: 6px; }
.tradebaglabel { font-size: 10.5px; color: var(--ink-dim); margin-bottom: 6px; }
.tradebag { display: flex; flex-wrap: wrap; gap: 5px; max-height: 110px; overflow-y: auto; margin-bottom: 10px; }
.tradechip { padding: 3px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.05); cursor: pointer; line-height: 0; }
.tradechip canvas { image-rendering: pixelated; width: 30px; height: 30px; }
.tradechip.on { box-shadow: 0 0 0 2px var(--glow) inset; background: rgba(255,198,106,.18); }
.tradechip.bound { opacity: .42; cursor: not-allowed; filter: grayscale(.4); }
em.bound { font-style: normal; color: #dcccff; font-weight: 800; letter-spacing: .2px; }
.tradestatus { font-size: 11px; color: var(--ink-dim); text-align: center; margin-bottom: 10px; }
.tradebtns { display: flex; gap: 8px; }
.tradebtns button { flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.08);
  color: var(--ink); font-weight: 800; border-radius: 10px; padding: 9px 0; cursor: pointer; }
.tradebtns button.pri { border: 2px solid #2e2430; background: linear-gradient(180deg,#ffd98c,#f0a542);
  color: #3a2410; box-shadow: 0 3px 0 #2e2430; }
.tradebtns button:disabled { opacity: .45; cursor: not-allowed; }

/* cloud-gate entry confirmation */
#cloudconfirm, #sailconfirm, #w4confirm, #w5confirm, #w6confirm, #w7confirm, #w8confirm, #w9confirm {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8,7,16,.55); backdrop-filter: blur(3px); z-index: 32; pointer-events: auto;
}
#cloudconfirm.hidden, #sailconfirm.hidden, #w4confirm.hidden, #w5confirm.hidden, #w6confirm.hidden, #w7confirm.hidden, #w8confirm.hidden, #w9confirm.hidden { display: none; }
.confirmcard.empyrean { border-color: rgba(255,225,138,.6); box-shadow: 0 22px 70px rgba(0,0,0,.65), inset 0 0 50px rgba(255,210,90,.16); }
.confirmcard.empyrean h3 { color: #ffe98a; }
#shopbuyamulet {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 30;
  padding: 10px 18px; border-radius: 12px; border: 1px solid rgba(124,255,138,.5);
  background: rgba(18,30,20,.92); color: #b6ffc4; font-weight: 800; font-size: 13px; cursor: pointer;
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
}
#shopbuyamulet.hidden { display: none; }
#shopbuyamulet:hover { background: rgba(28,46,32,.96); }
.confirmcard {
  width: min(360px, calc(100vw - 28px));
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px; backdrop-filter: blur(12px); box-shadow: 0 22px 70px rgba(0,0,0,.6);
  text-align: center; animation: dmpop .18s ease-out;
}
.confirmcard.infernal { border-color: rgba(255,106,42,.55); box-shadow: 0 22px 70px rgba(0,0,0,.65), inset 0 0 44px rgba(255,90,28,.09); }
.confirmcard.infernal h3 { color: #ff8a4a; }
.confirmcard.cosmic { border-color: rgba(150,106,255,.55); box-shadow: 0 22px 70px rgba(0,0,0,.65), inset 0 0 44px rgba(110,72,200,.12); }
.confirmcard.cosmic h3 { color: #b79bff; }
.confirmcard.tempest { border-color: rgba(106,168,255,.55); box-shadow: 0 22px 70px rgba(0,0,0,.65), inset 0 0 44px rgba(72,130,210,.12); }
.confirmcard.tempest h3 { color: #8fc0ff; }
.confirmcard.stardust { border-color: rgba(216,224,238,.6); box-shadow: 0 22px 70px rgba(0,0,0,.65), inset 0 0 44px rgba(200,210,235,.14); }
.confirmcard.stardust h3 { color: #e6ecf6; }
.confirmcard.atlantis { border-color: rgba(63,224,208,.55); box-shadow: 0 22px 70px rgba(0,0,0,.65), inset 0 0 46px rgba(40,150,180,.16); }
.confirmcard.atlantis h3 { color: #5fe3d6; }
.confirmcard h3 { font-family: var(--pixel); font-size: 13px; color: var(--glow); letter-spacing: 1px; margin-bottom: 12px; }
.confirmcard p { font-size: 13px; color: var(--ink-dim); line-height: 1.5; margin-bottom: 10px; }
.confirmcard p b { color: var(--ink); }
.confirmbal b { color: #cdf23a !important; }
.confirmbtns { display: flex; gap: 8px; margin-top: 14px; }
.confirmbtns button { flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.08);
  color: var(--ink); font-weight: 800; border-radius: 11px; padding: 10px 0; cursor: pointer; font-size: 13px; }
.confirmbtns button.pri { border: 2px solid #2e2430; background: linear-gradient(180deg,#ffd98c,#f0a542);
  color: #3a2410; box-shadow: 0 3px 0 #2e2430; }
.confirmbtns button.pri:active { transform: translateY(2px); box-shadow: 0 1px 0 #2e2430; }
.confirmbtns button:disabled { opacity: .45; cursor: not-allowed; }

/* loot-bag popover — floats above a dropped bag you're standing near */
#lootbag {
  position: absolute; transform: translate(-50%, -100%);
  pointer-events: auto; z-index: 24; width: 168px;
}
#lootbag.hidden { display: none; }
.lootcard {
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 10px 10px; backdrop-filter: blur(10px); box-shadow: 0 12px 34px rgba(0,0,0,.55);
  text-align: center; animation: dmpop .14s ease-out;
}
.lootcard::after {   /* little pointer toward the bag below */
  content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: var(--line); border-bottom: 0;
}
#loottitle { font-family: var(--pixel); font-size: 9px; letter-spacing: .5px; display: block; margin-bottom: 8px; }
.lootslots { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.lootslot {
  width: 46px; height: 60px; padding: 3px; border-radius: 9px;
  border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06);
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
}
.lootslot:hover { background: rgba(255,198,106,.18); }
.lootslot canvas { image-rendering: pixelated; width: 38px; height: 38px; }
.lootname { font-size: 8px; font-weight: 800; line-height: 1.05; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lootdetail { font-size: 10px; color: var(--ink-dim); margin: 8px 0 6px; line-height: 1.3; min-height: 13px; }
.lootdetail b { font-size: 11px; }
#loottakeall {
  width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink);
  font-weight: 800; border-radius: 8px; padding: 5px 0; cursor: pointer; font-size: 11px;
}
#loottakeall:hover { background: rgba(255,198,106,.2); }

/* gem reward slot inside a loot bag */
.lootslot.gemslot { border-color: #cdf23a; }
.lootslot .gemic { image-rendering: pixelated; height: 34px; width: auto; display: block; }

/* Fortune Hall casino */
#casino {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8,7,16,.55); backdrop-filter: blur(3px); z-index: 30; pointer-events: auto;
}
.casinobal { text-align: center; font-size: 13px; color: var(--ink-dim); margin-bottom: 12px; }
.casinobal b { color: #cdf23a; }
.casinogames { display: flex; flex-direction: column; gap: 10px; }
.cgame { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 11px 12px; }
.cgtitle { font-weight: 800; color: var(--glow); font-size: 14px; margin-bottom: 2px; }
.cgdesc { font-size: 11px; color: var(--ink-dim); margin-bottom: 8px; line-height: 1.35; }
.cgdesc b { color: var(--ink); }
.cgrow { display: flex; gap: 6px; align-items: center; }
.betinp { width: 66px; background: rgba(255,255,255,.07); border: 1px solid var(--glow); border-radius: 8px; color: var(--ink); padding: 6px 8px; font-weight: 800; }
.cgrow button { border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink); font-weight: 800; border-radius: 8px; padding: 6px 13px; cursor: pointer; font-size: 12px; }
.cgrow button:hover { background: rgba(255,198,106,.2); }
.cgrow button.pri { border: 2px solid #2e2430; background: linear-gradient(180deg,#ffd98c,#f0a542); color: #3a2410; box-shadow: 0 3px 0 #2e2430; }
.cgrow button.pri:active { transform: translateY(2px); box-shadow: 0 1px 0 #2e2430; }
.cgres { margin-top: 8px; font-size: 12px; color: var(--ink); min-height: 16px; }
.cgreels, .cgslots { font-size: 13px; letter-spacing: .5px; font-weight: 800; color: var(--glow); }
.cgwin { color: #cdf23a; font-weight: 800; }
.cglose { color: #e7886f; font-weight: 700; }
.cgspin { color: #cdaaff; font-weight: 800; }

/* ---- CORE gacha spinner — WIDE, retro-pixel window ---- */
#casino.gachamode .casinocard { width: min(680px, calc(100vw - 22px)); max-height: calc(100vh - 44px); overflow-y: auto;
  background: #160f28; border-radius: 0; padding: 14px 16px 16px;
  border: 3px solid #b48cff; box-shadow: 0 0 0 3px #2a1f42, 0 0 0 7px #6d3ad6, 0 0 0 9px #110a20, 0 12px 46px rgba(0,0,0,.7);
  image-rendering: pixelated; }
#casino.gachamode .invhead b { font-family: var(--pixel); font-size: 12px; color: #e8d8ff; letter-spacing: .5px; }
#casino.gachamode .casinobal { display: none; }
/* the gacha game body becomes a 2-column layout: the machine on the left, the prize board on the right */
#cgame-gacha { background: none; border: none; padding: 2px 0 0; display: flex; gap: 16px; align-items: flex-start; }
.gachaleft { display: flex; flex-direction: column; align-items: center; flex: 0 0 266px; }
.gacharight { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#casino.gachamode #gachacanvas { display: block; image-rendering: pixelated; border: 3px solid #6d3ad6 !important; border-radius: 0 !important; margin: 0 !important; width: 264px !important; height: 210px !important;
  background: radial-gradient(circle at 50% 45%, rgba(60,36,108,.6), rgba(12,7,22,.88)) !important; box-shadow: inset 0 0 0 2px #2a1f42 !important; }
#gachares { text-align: center; font-family: var(--pixel); font-size: 8.5px; line-height: 1.7; margin-top: 10px; min-height: 30px; color: #cdaaff; }
.gacharow { display: flex; flex-direction: column; align-items: center; gap: 9px; width: 100%; margin-top: 10px; }
.gachabalwrap { font-family: var(--pixel); font-size: 9px; color: #b9a4f0; }
.gachabalwrap b { color: #cdf23a; }
.gachapullbtn { font-family: var(--pixel) !important; border: none !important; border-radius: 0 !important; width: 100%;
  background: #7e4ad6 !important; color: #fff !important; box-shadow: 0 4px 0 #46277e, inset 0 2px 0 #b48cff !important;
  font-size: 11px !important; padding: 11px 14px !important; image-rendering: pixelated; }
.gachapullbtn:hover { background: #8f5ae6 !important; }
.gachapullbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #46277e !important; }
.gachapullbtn:disabled { opacity: .42; filter: grayscale(.5); cursor: default; transform: none; box-shadow: 0 4px 0 #46277e, inset 0 2px 0 #b48cff !important; }
.gachaboard { font-family: var(--pixel); font-size: 9px; color: #ffd86a; text-align: center; margin: 2px 0 9px; }
.gachagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 7px; align-items: start; align-content: start; }
.gtile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 3px 5px; border: 2px solid #555; border-radius: 0; background: #0d0a1a; }
/* override the high-specificity #casino canvas{width:288px} rule that was blowing these up */
#casino .gtcv { width: 44px !important; height: 44px !important; min-width: 0 !important; margin: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; image-rendering: pixelated; }
.gtsw { width: 40px; height: 40px; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 18px; line-height: 1; color: #1a1226; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.gthat { background: rgba(0,0,0,.2) !important; }
/* gem prize: the actual gem icon × the amount */
.gtgemwrap { display: flex; align-items: center; justify-content: center; gap: 4px; height: 44px; }
.gtgemic { height: 32px; width: auto; image-rendering: pixelated; }   /* coin.png is 11×30 — keep its aspect, never force square */
.gtgemwrap b { font-family: var(--pixel); font-size: 10px; color: #cdf23a; }
.gtname { font-size: 9px; color: #d9d2ec; text-align: center; line-height: 1.1; }
.gtodds { font-family: var(--pixel); font-size: 7px; color: #b6a8d8; }

/* on-screen trade request (replaces the browser confirm popup) */
#tradereq { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 70; pointer-events: auto; }
#tradereq.hidden { display: none; }
.trqcard { display: flex; flex-direction: column; gap: 9px; padding: 13px 16px; min-width: 220px;
  background: linear-gradient(180deg, rgba(28,24,40,.97), rgba(18,15,28,.97)); border: 1px solid rgba(150,180,224,.5);
  border-radius: 13px; box-shadow: 0 12px 36px rgba(0,0,0,.55); }
.trqmsg { text-align: center; font-size: 14px; color: #e8eefb; }
.trqmsg b { color: #79c4ff; }
.trqbtns { display: flex; gap: 8px; justify-content: center; }
.trqbtns button { border: 1px solid var(--line); background: rgba(255,255,255,.08); color: var(--ink); font-weight: 800; border-radius: 9px; padding: 7px 16px; cursor: pointer; font-size: 13px; }
.trqbtns button:hover { background: rgba(255,255,255,.16); }
.trqbtns button.pri { border: none; background: linear-gradient(180deg, #6cd07f, #3da757); color: #06210f; }
.trqbtns button.pri:hover { filter: brightness(1.08); }

/* floating "Press S" prompt over a casino table */
#interactprompt {
  position: absolute; transform: translate(-50%, -100%);
  pointer-events: none; z-index: 22; white-space: nowrap;
  background: var(--glass); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; font-size: 11px; font-weight: 800; color: var(--glow);
  backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0,0,0,.5);
  animation: dmpop .14s ease-out;
}
#interactprompt.hidden { display: none; }
/* tutorial signpost lesson — a wider parchment panel (the small "Press S" prompt restyled) */
#interactprompt.tutsign {
  white-space: normal; max-width: 248px; text-align: center; line-height: 1.45;
  font-size: 11px; font-weight: 700; color: #fff4dc; letter-spacing: .2px;
  background: linear-gradient(180deg, rgba(64,44,24,.94), rgba(44,30,16,.94));
  border: 1px solid rgba(210,168,110,.55); border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,225,170,.10);
}
#interactprompt.tutsign b { color: #ffe39a; }

/* casino — tailored animated game windows */
.casinocard { width: min(300px, calc(100vw - 28px)); }
#casino .cgame { text-align: center; }
#casino canvas { display: block; margin: 8px auto 10px; image-rendering: pixelated; border-radius: 10px; background: rgba(0,0,0,.25); }
#casino .cgrow { justify-content: center; align-items: center; gap: 8px; margin-top: 4px; }
#casino .cgrow label { font-size: 12px; color: var(--ink-dim); font-weight: 800; }
#casino .cgres { text-align: center; min-height: 18px; font-size: 13px; margin: 2px 0 8px; color: var(--ink); }
#casino .cgres b { color: var(--glow); }
.cgspin { color: var(--glow); font-weight: 800; letter-spacing: 3px; }
.cgrow button:disabled { opacity: .5; cursor: not-allowed; }

/* Fortune Hall — a chunky pixel casino cabinet, themed & larger */
.casinocard {
  width: min(344px, calc(100vw - 22px));
  background: linear-gradient(180deg, #2a1730 0%, #1a1020 100%);
  border: 3px solid #e0b84a;
  border-radius: 5px;
  backdrop-filter: none;
  box-shadow: 0 0 0 3px #2e2430, 0 0 0 6px #8a1f2e, 0 0 0 9px #2e2430, 0 18px 54px rgba(0,0,0,.72);
  padding: 16px 18px 18px;
  image-rendering: pixelated;
}
#casinotitle { font-family: var(--pixel); font-size: 12px; color: #ffd23a; letter-spacing: 1px; text-shadow: 0 2px 0 #8a1f2e; }
#casino .invhead { border-bottom: 2px solid #8a1f2e; padding-bottom: 10px; margin-bottom: 10px; }
#casino .invhead button { background: #8a1f2e; color: #ffe9b0; }
#casino .invhead button:hover { background: #b32a3d; }
#casino .casinobal { color: #d8c8a0; font-weight: 800; }
#casino .casinobal b { color: #ffe066; }
#casino canvas { width: min(288px, calc(100vw - 56px)); height: auto; box-shadow: 0 0 0 2px #2e2430, 0 6px 18px rgba(0,0,0,.5); background: #120b1a; }
#casino .cgres { font-family: var(--body); font-weight: 700; color: #e8e0d0; font-size: 13.5px; }
#casino .cgres b { color: #ffe066; }
#casino .cgrow label { color: #d0c4a8; }
#casino .betinp { border-color: #e0b84a; background: rgba(0,0,0,.35); }
#casino .cgrow button { border: 2px solid #2e2430; font-weight: 800; }
#casino .cgrow button.pri { background: linear-gradient(180deg, #ffe06a, #e0a02a); color: #3a2410; box-shadow: 0 3px 0 #2e2430; }
#casino .cgrow button:not(.pri) { background: #3a2740; color: #ffe9b0; }
#casino .cgrow button:not(.pri):hover { background: #54374f; }
.cgwin { color: #7dff8a; }
.cglose { color: #ff8f7a; }

/* ---- aesthetic scrollbars: a slim gilded thumb on a dark-glass track, matching the UI theme.
   (#chatlog keeps its own hidden scrollbar — id-specific rules win over these.) ---- */
* { scrollbar-width: thin; scrollbar-color: var(--gold-soft) rgba(0, 0, 0, 0.22); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.22); border-radius: 10px; }
::-webkit-scrollbar-thumb {
  border-radius: 10px; border: 2px solid transparent; background-clip: content-box;
  background-color: var(--gold);
  background-image: linear-gradient(180deg, rgba(255, 226, 150, 0.65), rgba(150, 116, 60, 0.55));
  box-shadow: inset 0 0 0 1px rgba(255, 210, 130, 0.45);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--glow);
  background-image: linear-gradient(180deg, rgba(255, 240, 190, 0.85), rgba(216, 180, 106, 0.7));
}
::-webkit-scrollbar-thumb:active { background-color: var(--glow); }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- Wardrobe (cosmetics shop panel) + profile outfit selector ---- */
#wardrobe { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); z-index: 60; pointer-events: auto; }
#wardrobe.hidden { display: none; }
.wdrcard { background: #1e2128; border: 1px solid #3a3f49; border-radius: 14px; padding: 20px 22px; width: 350px; max-width: 92vw; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,.55); }
.wdrcard h3 { margin: 0 0 4px; color: #e8e4d8; font-size: 17px; }
.wdrsub { margin: 0 0 14px; font-size: 11.5px; line-height: 1.45; color: #9a958a; }
#wdrclose { position: absolute; top: 9px; right: 13px; background: none; border: none; color: #9a958a; font-size: 21px; cursor: pointer; line-height: 1; }
.wdrlist { display: flex; flex-direction: column; gap: 7px; }
.wdrrow { display: flex; align-items: center; gap: 11px; }
.wdrsw { width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.wdrname { flex: 1; font-size: 13px; color: #e8e4d8; }
.wdrworn { font-size: 11px; color: #c8a24a; font-weight: 800; }
.wdrbuy, .wdrwear { font-size: 12px; padding: 5px 11px; border-radius: 7px; border: 1px solid #3a3f49; background: #262a32; color: #e8e4d8; cursor: pointer; }
.wdrwear:hover, .wdrbuy:hover { border-color: #c8a24a; }
.profcosmetics { margin: 4px 0 8px; }
.profcoslabel { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: #9a958a; margin-bottom: 4px; text-align: center; }
.profcosrow { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.profcossw { width: 24px; height: 24px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1; color: #cfc9bd; }
.profcossw.on { border-color: #c8a24a; }

/* ============================ Worldsmith Terminal ============================ */
#worldsmith { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,7,16,.55); backdrop-filter: blur(3px); z-index: 30; pointer-events: auto; }
#worldsmith.hidden { display: none; }
.wscard { width: min(560px, calc(100vw - 22px)); max-height: calc(100vh - 44px); overflow-y: auto;
  background: #160f28; border-radius: 0; padding: 12px 14px 14px; image-rendering: pixelated;
  border: 3px solid #b48cff; box-shadow: 0 0 0 3px #2a1f42, 0 0 0 7px #6d3ad6, 0 0 0 9px #110a20, 0 12px 46px rgba(0,0,0,.7); }
.wscard .invhead b { font-family: var(--pixel); font-size: 11px; color: #e8d8ff; letter-spacing: .5px; }
.wstabs { display: flex; gap: 6px; margin: 8px 0 10px; }
.wstab { flex: 1; font-family: var(--pixel); font-size: 9px; letter-spacing: 1px; color: #b9a9e0; cursor: pointer;
  padding: 8px 6px; border: 2px solid #3a2f5a; background: #1d1436; border-radius: 0; }
.wstab.on { color: #fff; background: #4a2da0; border-color: #b48cff; box-shadow: inset 0 0 0 1px #2a1f42; }
.wstab:hover:not(.on) { border-color: #6d3ad6; }
/* --- FORGE form --- */
.wsintro { font-size: 12px; line-height: 1.5; color: #cbbce6; margin-bottom: 10px; }
.wsintro b { color: #ffe7a6; }
#wsprompt { width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px; font-family: 'Nunito', sans-serif; font-size: 13px;
  background: #0f0a1e; color: #ece3ff; border: 2px solid #4a3a78; border-radius: 6px; padding: 8px 10px; }
#wsprompt:focus { outline: none; border-color: #b48cff; }
.wscount2 { text-align: right; font-size: 10px; color: #8f82b3; margin: 2px 0 8px; }
.wsdiffrow { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 9px; }
.wsdifflbl { font-size: 11px; color: #b9a9e0; font-weight: 800; margin-right: 2px; }
.wsdiff { width: 30px; height: 30px; font-family: var(--pixel); font-size: 10px; color: #cbbce6; cursor: pointer;
  border: 2px solid #3a2f5a; background: #1d1436; border-radius: 0; }
.wsdiff.on { color: #fff; background: #6d3ad6; border-color: #d9c4ff; }
.wsdifffee { margin-left: auto; font-size: 12px; color: #cbbce6; }
.wsdifffee b { color: #ffe7a6; }
.wscostline { font-size: 11.5px; color: #b9a9e0; margin-bottom: 11px; }
.wscostline b { color: #ffe7a6; }
.wsbtn { font-family: var(--pixel); font-size: 9px; letter-spacing: .5px; color: #e8d8ff; cursor: pointer;
  padding: 9px 12px; border: 2px solid #6d3ad6; background: #2a1f42; border-radius: 0; line-height: 1.4; }
.wsbtn:hover:not(:disabled) { background: #3a2a5e; border-color: #b48cff; }
.wsbtn:disabled { opacity: .5; cursor: default; }
.wsbtn.pri { background: linear-gradient(180deg, #7d4ad6, #5a2da0); border-color: #d9c4ff; color: #fff; }
.wsbtn.pri:hover:not(:disabled) { background: linear-gradient(180deg, #8f5ae6, #6a3ab0); }
.wsbtn.on { background: #4a2da0; border-color: #ffe7a6; color: #ffe7a6; }
#wsforgebtn { width: 100%; }
/* --- forging progress --- */
.wsforging { text-align: center; padding: 8px 4px; }
.wsbig { font-family: var(--pixel); font-size: 12px; color: #ffe7a6; line-height: 1.6; margin-bottom: 12px; }
.wsbar { height: 16px; background: #0f0a1e; border: 2px solid #4a3a78; border-radius: 0; overflow: hidden; margin: 4px 0 8px; }
.wsbarfill { height: 100%; background: linear-gradient(90deg, #6d3ad6, #b48cff); transition: width .3s; box-shadow: 0 0 12px rgba(180,140,255,.6); animation: wssheen 1.4s linear infinite; }
@keyframes wssheen { 0% { filter: brightness(1); } 50% { filter: brightness(1.35); } 100% { filter: brightness(1); } }
.wsstage { font-size: 12px; color: #d9c4ff; font-weight: 800; margin-bottom: 8px; }
.wsnote { font-size: 11px; color: #9a8fc0; line-height: 1.5; }
/* --- success / founder-item choice --- */
.wssuccess { text-align: center; }
.wssub { font-size: 12px; color: #cbbce6; margin-bottom: 12px; }
.wschoosehd, .wsclaimhd { font-size: 11px; color: #ffd96b; font-weight: 800; margin: 8px 0 6px; }
.wschoices { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.wschoice { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 110px; cursor: pointer;
  padding: 8px 4px; border: 2px solid #4a3a78; background: #1d1436; border-radius: 0; color: #ece3ff; }
.wschoice:hover:not(:disabled) { border-color: #dcccff; background: #271a47; }
.wschoice:disabled { opacity: .45; cursor: default; }
.wschoiceic { image-rendering: pixelated; }
.wschoicename { font-size: 11px; font-weight: 800; color: #dcccff; line-height: 1.2; }
.wschoiceslot { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: #8f82b3; }
/* --- WORLDS list --- */
.wsempty { text-align: center; font-size: 12px; color: #9a8fc0; line-height: 1.7; padding: 24px 8px; }
.wslist { display: flex; flex-direction: column; gap: 9px; }
.wsrow { border: 2px solid #3a2f5a; background: #1a1130; border-radius: 0; padding: 9px 10px; }
.wsrowtop { display: flex; align-items: center; gap: 7px; }
.wsrowname { font-size: 13px; color: #ffe7a6; flex: 1; min-width: 0; }
.wschip { font-family: var(--pixel); font-size: 8px; padding: 3px 5px; border: 1px solid #6d3ad6; color: #d9c4ff; background: #2a1f42; }
.wsrowcd { font-size: 10px; color: #9a8fc0; white-space: nowrap; }
.wsrowmeta { font-size: 11px; color: #b9a9e0; margin: 3px 0 6px; }
.wstally { height: 7px; background: #5a2a2a; border-radius: 0; overflow: hidden; margin-bottom: 3px; }
.wstallykeep { height: 100%; background: #4a9a5e; }
.wstallylbl { font-size: 10px; color: #9a8fc0; margin-bottom: 7px; }
.wsrowbtns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wsrowbtns .wsenter { flex: 1; min-width: 120px; }
.wsvotegate { font-size: 10px; color: #8f82b3; font-style: italic; }
@media (max-width: 520px) {
  .wschoice { width: calc(50% - 6px); }
  .wsrowbtns { flex-direction: column; align-items: stretch; }
  .wsrowbtns .wsenter, .wsrowbtns .wsvote { width: 100%; }
}

/* ---- Hall of Legends — golden shrine leaderboards (red & gold temple theme) ---- */
#legendsboard {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(12,4,6,.6); backdrop-filter: blur(3px); z-index: 32; pointer-events: auto;
}
#legendsboard .lbcard {
  position: relative; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px); overflow-y: auto;
  background: linear-gradient(180deg,#2a0d12,#1a0710); border-radius: 14px; padding: 18px 18px 16px;
  border: 2px solid #e7b24a; box-shadow: 0 0 0 3px #5a1822, 0 0 0 6px #2a0a10, 0 16px 50px rgba(0,0,0,.7);
}
#legendsboard .lbclose {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 50%; border: none;
  background: #7a1f2b; color: #ffe9b0; font-size: 18px; line-height: 1; cursor: pointer;
}
#legendsboard .lbclose:hover { background: #a82d3c; }
.lbtitle { font-family: var(--pixel, monospace); font-size: 15px; text-align: center; letter-spacing: 1px;
  color: #ffd86a; text-shadow: 0 2px 0 #6a1420; margin-bottom: 13px; }
.lbtabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.lbtab { border: 1px solid #6a3340; background: rgba(255,255,255,.05); color: #e8c8a0; font-weight: 800;
  border-radius: 8px; padding: 6px 11px; cursor: pointer; font-size: 12px; }
.lbtab:hover { background: rgba(255,198,106,.18); }
.lbtab.on { border: 1px solid #ffd86a; background: linear-gradient(180deg,#ffd98c,#e0a13e); color: #3a1208; box-shadow: 0 2px 0 #6a1420; }
.lbsub { text-align: center; font-size: 12px; color: #d8b89a; margin-bottom: 13px; min-height: 16px; }
.lbrows { display: flex; flex-direction: column; gap: 5px; }
.lbrow { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 9px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,216,106,.1); }
.lbrow.top { background: linear-gradient(90deg, rgba(255,216,106,.14), rgba(255,255,255,.03)); border-color: rgba(255,216,106,.32); }
.lbrank { font-weight: 900; color: #ffd86a; min-width: 22px; text-align: center; font-size: 15px; }
.lbname { font-weight: 800; color: #fff2dc; min-width: 92px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbdetail { font-size: 12px; color: #e8c8a0; margin-left: auto; text-align: right; }
.lbdetail b { color: #ffe680; }
.lbgear { color: #cdaaff; }
.lbempty { text-align: center; color: #c8a890; font-size: 13px; padding: 22px 8px; }
