/* STARFALL ONLINE — v2.5 pixel-art skin.
   Loaded after style.css. Every window, message box and HUD frame gets a stepped pixel border
   (ink outline → gold rim → inner bevel) drawn with hard box-shadows, so layouts are unchanged.
   Inventory slots get bevelled "gem sockets" with grade-coloured corner brackets. */
:root {
  --px-ink: #0b0816;
  --px-rim-hi: #f4d67e;
  --px-rim: #d29c3e;
  --px-rim-lo: #7c5520;
  --px-bg: #1a1531;
  --px-bg2: #231c40;
  --px-head: #2d2456;
  --px-head-hi: #4a3d8a;
  --px-bevel-hi: rgba(255, 255, 255, .07);
  --px-bevel-lo: rgba(0, 0, 0, .38);
  --px-dither: repeating-conic-gradient(rgba(255, 255, 255, .022) 0 25%, transparent 0 50%) 0 0 / 4px 4px;
  --px-frame:
    inset 2px 2px 0 0 var(--px-bevel-hi), inset -2px -2px 0 0 var(--px-bevel-lo),
    0 -3px 0 0 var(--px-rim-hi), 0 3px 0 0 var(--px-rim-lo), -3px 0 0 0 var(--px-rim), 3px 0 0 0 var(--px-rim-lo),
    0 -6px 0 0 var(--px-ink), 0 6px 0 0 var(--px-ink), -6px 0 0 0 var(--px-ink), 6px 0 0 0 var(--px-ink),
    -3px -3px 0 0 var(--px-ink), 3px -3px 0 0 var(--px-ink), -3px 3px 0 0 var(--px-ink), 3px 3px 0 0 var(--px-ink),
    8px 10px 0 0 rgba(0, 0, 0, .32);
  /* slimmer frame for small HUD boxes and message boxes */
  --px-frame-sm:
    inset 1px 1px 0 0 var(--px-bevel-hi), inset -1px -1px 0 0 var(--px-bevel-lo),
    0 -2px 0 0 #8f7440, 0 2px 0 0 #4d3a1c, -2px 0 0 0 #7a6236, 2px 0 0 0 #4d3a1c,
    0 -4px 0 0 var(--px-ink), 0 4px 0 0 var(--px-ink), -4px 0 0 0 var(--px-ink), 4px 0 0 0 var(--px-ink),
    -2px -2px 0 0 var(--px-ink), 2px -2px 0 0 var(--px-ink), -2px 2px 0 0 var(--px-ink), 2px 2px 0 0 var(--px-ink),
    4px 6px 0 0 rgba(0, 0, 0, .28);
  --radius: 0px;
}

/* ============================================================ windows */
#panels .panel, .card, #npc-dialog, #modal .modal-card {
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--px-dither), linear-gradient(var(--px-bg2), var(--px-bg));
  box-shadow: var(--px-frame);
}
#panels .panel { max-height: calc(100vh - 160px); }
.panel-head {
  border-radius: 0;
  padding: 7px 10px 9px 30px;
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 4px),
    linear-gradient(var(--px-head-hi) 0 2px, var(--px-head) 2px calc(100% - 4px), var(--px-rim-lo) calc(100% - 4px) calc(100% - 3px), var(--px-ink) calc(100% - 3px));
  color: var(--px-rim-hi);
  letter-spacing: .3px;
  text-shadow: 2px 2px 0 var(--px-ink);
}
/* pixel star gem on the title bar */
.panel-head::before {
  content: '';
  position: absolute; left: 10px; top: 50%; width: 12px; height: 12px; margin-top: -7px;
  background:
    linear-gradient(#fff6c8, #fff6c8) 5px 0 / 2px 12px no-repeat,
    linear-gradient(#fff6c8, #fff6c8) 0 5px / 12px 2px no-repeat,
    linear-gradient(var(--px-rim-hi), var(--px-rim-hi)) 3px 3px / 6px 6px no-repeat;
  filter: drop-shadow(1px 1px 0 var(--px-ink));
  image-rendering: pixelated;
}
.panel-x {
  width: 24px; height: 24px; border: 0; border-radius: 0; padding: 0;
  background: #a3312f; color: #fff1f1; font-weight: 800; font-size: 13px; line-height: 24px;
  box-shadow: inset 0 -3px 0 0 #5c1515, inset 0 2px 0 0 #e56b62, 0 0 0 2px var(--px-ink);
  text-shadow: 1px 1px 0 var(--px-ink);
}
.panel-x:hover { background: #c2413c; }
.panel-x:active { transform: translateY(2px); box-shadow: inset 0 2px 0 0 #5c1515, 0 0 0 2px var(--px-ink); }
.panel-body { scrollbar-width: thin; }

.section-title {
  border-bottom: 0;
  padding: 3px 8px 5px;
  background: linear-gradient(90deg, rgba(210, 156, 62, .22), transparent 80%);
  box-shadow: inset 3px 0 0 0 var(--px-rim), inset 0 -2px 0 0 rgba(210, 156, 62, .25);
  text-shadow: 1px 1px 0 var(--px-ink);
}
.list-row, .npc-q, .attr-row {
  border: 0; border-radius: 0;
  background: rgba(10, 8, 22, .55);
  box-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, .04), inset -1px -1px 0 0 rgba(0, 0, 0, .4), 0 0 0 2px #120e24;
}
.npc-q { box-shadow: inset 3px 0 0 0 #4b5563, 0 0 0 2px #120e24; border-left: 0; }
.npc-q.avail { box-shadow: inset 3px 0 0 0 #fde047, 0 0 0 2px #120e24; }
.npc-q.complete { box-shadow: inset 3px 0 0 0 var(--ok), 0 0 0 2px #120e24; }
.npc-q.active { box-shadow: inset 3px 0 0 0 #60a5fa, 0 0 0 2px #120e24; }

/* ============================================================ buttons & inputs */
.btn {
  border: 0; border-radius: 0;
  background: #40357a; color: #f3f0ff;
  box-shadow: inset 0 -3px 0 0 #231b4d, inset 0 2px 0 0 #6d5fc4, 0 0 0 2px var(--px-ink);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .65);
  transition: none;
}
.btn:hover { background: #4f4296; filter: none; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 0 #231b4d, 0 0 0 2px var(--px-ink); }
.btn-gold { background: #e3a93c; color: #2a1500; text-shadow: 1px 1px 0 rgba(255, 240, 200, .55); box-shadow: inset 0 -3px 0 0 #9c6515, inset 0 2px 0 0 #fbe38f, 0 0 0 2px #2a1500; }
.btn-gold:hover { background: #f0b94a; }
.btn-gold:active { box-shadow: inset 0 2px 0 0 #9c6515, 0 0 0 2px #2a1500; }
.btn-danger { background: #b23434; box-shadow: inset 0 -3px 0 0 #641515, inset 0 2px 0 0 #e7736b, 0 0 0 2px var(--px-ink); }
.btn-danger:hover { background: #c64040; }
.btn-xs { border-radius: 0; }
.btn:disabled, .btn[disabled] { filter: grayscale(.7) brightness(.8); cursor: not-allowed; }

.tab {
  border: 0; border-radius: 0;
  background: #221c3f; color: #b9b2d9;
  box-shadow: inset 0 -2px 0 0 #140f2b, inset 0 2px 0 0 #372e63, 0 0 0 2px var(--px-ink);
}
.tab:hover { color: #fff; background: #2b2450; }
.tab.active {
  background: #574aa5; color: #fff7d6;
  box-shadow: inset 0 -3px 0 0 #2e2670, inset 0 2px 0 0 #8e80e0, 0 0 0 2px var(--px-ink), 0 -3px 0 0 var(--px-rim-hi);
  border: 0;
  text-shadow: 1px 1px 0 var(--px-ink);
}
.tab .dot { border-radius: 0; box-shadow: 0 0 0 1px var(--px-ink); }

input:not([type=checkbox]):not([type=range]), select, textarea {
  border: 0 !important; border-radius: 0 !important;
  background: #0e0b1d !important;
  box-shadow: inset 2px 2px 0 0 #05040b, inset -2px -2px 0 0 #2d2654, 0 0 0 2px var(--px-ink);
}
input:not([type=checkbox]):not([type=range]):focus, select:focus, textarea:focus {
  box-shadow: inset 2px 2px 0 0 #05040b, inset -2px -2px 0 0 #2d2654, 0 0 0 2px var(--px-rim-hi) !important;
}
kbd { border-radius: 0; border: 0; background: #2a2452; box-shadow: inset 0 -2px 0 0 #120e24, 0 0 0 1px var(--px-ink); }

/* pixel scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0c0a19; box-shadow: inset 2px 0 0 0 #05040b; }
::-webkit-scrollbar-thumb { background: #4a3f86; box-shadow: inset 2px 2px 0 0 #6d5fc4, inset -2px -2px 0 0 #2a2250; }
::-webkit-scrollbar-thumb:hover { background: #5a4ea0; }
::-webkit-scrollbar-corner { background: #0c0a19; }

/* ============================================================ message boxes */
#chat {
  border: 0 !important; border-radius: 0 !important;
  background: var(--px-dither), rgba(16, 12, 32, .88);
  box-shadow: var(--px-frame-sm);
}
.chat-tabs { padding: 5px 6px 0; background: linear-gradient(transparent calc(100% - 2px), #2b2352 calc(100% - 2px)); }
.chat-tabs button { border-radius: 0; padding: 3px 7px; }
.chat-tabs button.active { background: #3b3170; color: #fff7d6; box-shadow: inset 0 2px 0 0 #6d5fc4, 0 -2px 0 0 var(--px-rim); text-shadow: 1px 1px 0 var(--px-ink); }
#chat-form { border-radius: 0; background: rgba(0, 0, 0, .35); box-shadow: inset 0 2px 0 0 #2b2352; gap: 6px; padding: 6px; }
#chat-ch, #chat-to, #chat-input { border-radius: 0 !important; }
#chat-log { scrollbar-width: thin; }
#chat-open-btn {
  border: 0; border-radius: 0;
  background: #1d1737; box-shadow: var(--px-frame-sm);
}

.toast {
  border: 0; border-radius: 0;
  background: var(--px-dither), rgba(18, 14, 36, .95);
  box-shadow: inset 5px 0 0 0 #8b7ff0, var(--px-frame-sm);
  padding: 8px 16px 8px 20px;
  text-shadow: 1px 1px 0 var(--px-ink);
}
.toast.error { box-shadow: inset 5px 0 0 0 var(--bad), var(--px-frame-sm); }
.toast.levelup { box-shadow: inset 5px 0 0 0 var(--px-rim-hi), var(--px-frame-sm); }
.toast.quest, .toast.success { box-shadow: inset 5px 0 0 0 var(--ok), var(--px-frame-sm); color: #d1fadf; }
.toast.death { box-shadow: inset 5px 0 0 0 #6b7280, var(--px-frame-sm); }

.prompt {
  border: 0 !important; border-radius: 0;
  background: var(--px-dither), linear-gradient(var(--px-bg2), var(--px-bg));
  box-shadow: inset 0 3px 0 0 #8b7ff0, var(--px-frame-sm);
  overflow: visible;
}
.prompt.duel, .prompt.war { box-shadow: inset 0 3px 0 0 #f87171, var(--px-frame-sm); }
.prompt.guild { box-shadow: inset 0 3px 0 0 #60a5fa, var(--px-frame-sm); }
.prompt-timer { height: 3px; }

#tooltip, #item-pop, #ctx-menu {
  border: 0; border-radius: 0;
  background: var(--px-dither), rgba(14, 11, 30, .97);
  box-shadow: var(--px-frame-sm);
}
#ctx-menu button { border-radius: 0; }
#ctx-menu button:hover { background: #3b3170; box-shadow: inset 3px 0 0 0 var(--px-rim-hi); }

#npc-dialog { border: 0 !important; }
.npc-portrait canvas {
  border: 0; border-radius: 0;
  background: radial-gradient(circle, #3b2f80, #151232);
  box-shadow: inset 0 0 0 2px #2d2456, 0 0 0 2px var(--px-rim), 0 0 0 4px var(--px-ink);
}
.npc-name { text-shadow: 2px 2px 0 var(--px-ink); }
.npc-talk {
  font-style: normal;
  background: rgba(8, 6, 18, .55);
  padding: 8px 10px 8px 12px;
  box-shadow: inset 3px 0 0 0 var(--px-rim), 0 0 0 2px #120e24;
  position: relative;
}

.loot-item {
  border: 0; border-radius: 0;
  background: rgba(14, 11, 30, .9);
  box-shadow: inset 3px 0 0 0 var(--px-rim), 0 0 0 2px var(--px-ink);
}

#modal { background: rgba(4, 3, 10, .66); }
#conn-lost .card, .death-card { border-radius: 0 !important; }

/* ============================================================ HUD frames */
.hud-box, #minimap-box, #skillbar, #quickbar, #quest-tracker, #bot-panel {
  border: 0 !important; border-radius: 0 !important;
  box-shadow: var(--px-frame-sm);
}
#quest-tracker { background: var(--px-dither), rgba(14, 11, 30, .8); }
#minimap { border-radius: 0 !important; box-shadow: 0 0 0 2px var(--px-ink), 0 0 0 3px #4a3d8a; }
#menubar {
  border: 0; border-radius: 0;
  background: var(--px-dither), var(--px-bg);
  box-shadow: var(--px-frame-sm);
  gap: 6px; padding: 7px;
}
#menubar button {
  border: 0; border-radius: 0;
  background: #282149;
  box-shadow: inset 0 -3px 0 0 #140f2b, inset 0 2px 0 0 #43397a, 0 0 0 2px var(--px-ink);
}
#menubar button:hover { background: #3a3170; border: 0; box-shadow: inset 0 -3px 0 0 #1d1640, inset 0 2px 0 0 #6d5fc4, 0 0 0 2px var(--px-rim-hi); }
#menubar button:active { transform: translateY(2px); }
#menubar button span { text-shadow: 1px 1px 0 var(--px-ink); }

.bar, #expbar { border: 0 !important; border-radius: 0 !important; box-shadow: inset 0 2px 0 0 rgba(0, 0, 0, .5), 0 0 0 2px var(--px-ink); }
.bar.hp > div { background: linear-gradient(#ffb0a3 0 2px, #e2554c 2px calc(100% - 2px), #9c2c28 calc(100% - 2px)); }
.bar.mp > div { background: linear-gradient(#a8ecf2 0 2px, #2fa3b3 2px calc(100% - 2px), #1b6873 calc(100% - 2px)); }
.bar.exp > div, #expfill { background: linear-gradient(#d1f5b8 0 2px, #6bb47e 2px calc(100% - 2px), #3d7550 calc(100% - 2px)); }
.bar > span, #exptxt { text-shadow: 1px 1px 0 var(--px-ink), -1px -1px 0 var(--px-ink), 1px -1px 0 var(--px-ink), -1px 1px 0 var(--px-ink); }

/* ============================================================ premium inventory slots */
.slot {
  --gc: #57507e;          /* grade colour: corner brackets */
  --gr: #2a2250;          /* grade ring */
  --gg: transparent;      /* inner glow */
  border: 0; border-radius: 0;
  background:
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0) 50%, transparent 62%) 150% 0 / 260% 100% no-repeat,
    radial-gradient(circle at 50% 42%, rgba(165, 145, 255, .12), transparent 64%),
    linear-gradient(#1c1736, #0c0a1a);
  box-shadow: inset 0 0 12px 0 var(--gg), inset 2px 2px 0 0 #06050d, inset -2px -2px 0 0 #322a5e, 0 0 0 2px var(--gr), 0 0 0 4px var(--px-ink);
  transition: none;
}
.slot::before {
  content: ''; position: absolute; inset: 3px; pointer-events: none; z-index: 1;
  background:
    linear-gradient(var(--gc), var(--gc)) left top / 7px 2px no-repeat,
    linear-gradient(var(--gc), var(--gc)) left top / 2px 7px no-repeat,
    linear-gradient(var(--gc), var(--gc)) right top / 7px 2px no-repeat,
    linear-gradient(var(--gc), var(--gc)) right top / 2px 7px no-repeat,
    linear-gradient(var(--gc), var(--gc)) left bottom / 7px 2px no-repeat,
    linear-gradient(var(--gc), var(--gc)) left bottom / 2px 7px no-repeat,
    linear-gradient(var(--gc), var(--gc)) right bottom / 7px 2px no-repeat,
    linear-gradient(var(--gc), var(--gc)) right bottom / 2px 7px no-repeat;
}
.slot img { position: relative; z-index: 2; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, .55)); image-rendering: pixelated; }
.slot.empty { opacity: 1; --gc: #2c2650; background: var(--px-dither), linear-gradient(#141029, #0b0917); }
.slot:hover { filter: brightness(1.18); --gr: var(--px-rim-hi); }
.slot.sel { outline: 0; --gr: #fde047; box-shadow: inset 0 0 12px 0 rgba(253, 224, 71, .35), inset 2px 2px 0 0 #06050d, inset -2px -2px 0 0 #322a5e, 0 0 0 2px #fde047, 0 0 0 4px var(--px-ink); }
.slot.g0 { --gc: #9ca0b8; --gr: #3b3658; }
.slot.g1 { --gc: #4ade80; --gr: #1c5a36; --gg: rgba(74, 222, 128, .22); }
.slot.g2 { --gc: #60a5fa; --gr: #1e4585; --gg: rgba(96, 165, 250, .3); }
.slot.g3 { --gc: #d8b4fe; --gr: #6b2fb3; --gg: rgba(192, 132, 252, .38); animation: px-shine 3.2s linear infinite; }
.slot.g4 { --gc: #fdba74; --gr: #b4530f; --gg: rgba(251, 146, 60, .45); animation: px-shine 2.4s linear infinite, px-leg 1.2s steps(2) infinite; }
.slot.g5 { --gc: #ffd1dc; --gr: #d1143f; --gg: rgba(255, 42, 95, .5); animation: px-shine 1.8s linear infinite, px-god 2.4s steps(6) infinite; }
.slot.g3, .slot.g4, .slot.g5 {
  background:
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .26) 50%, transparent 62%) 150% 0 / 260% 100% no-repeat,
    radial-gradient(circle at 50% 42%, rgba(165, 145, 255, .14), transparent 64%),
    linear-gradient(#211a40, #0e0b1f);
}
.slot.cant::after { border-radius: 0; z-index: 3; background: repeating-linear-gradient(45deg, rgba(185, 28, 28, .32) 0 3px, rgba(185, 28, 28, .14) 3px 6px); }
.slot .plus, .slot .qty {
  z-index: 4;
  font-family: 'Press Start 2P', monospace; font-size: 7px; font-weight: 400; letter-spacing: -.3px;
  text-shadow: 1px 0 0 var(--px-ink), -1px 0 0 var(--px-ink), 0 1px 0 var(--px-ink), 0 -1px 0 var(--px-ink), 1px 1px 0 var(--px-ink);
}
.slot .plus { top: 3px; right: 3px; color: #fde047; }
.slot .qty { bottom: 3px; right: 3px; color: #fff; }
.slot-label { position: relative; z-index: 2; color: #6a6296; font-weight: 700; text-shadow: 1px 1px 0 var(--px-ink); }
@keyframes px-shine { from { background-position: 150% 0, 0 0, 0 0; } to { background-position: -60% 0, 0 0, 0 0; } }
@keyframes px-leg { 50% { --gc: #fff1d6; } }
@keyframes px-god { 0% { --gc: #ff8fab; } 33% { --gc: #fde68a; } 66% { --gc: #a5f3fc; } 100% { --gc: #ff8fab; } }

.bag-grid, .smith-grid { gap: 9px; padding: 9px; background: var(--px-dither), #0b0918; box-shadow: inset 3px 3px 0 0 #05040b, inset -3px -3px 0 0 #221c40, 0 0 0 2px var(--px-ink); }
.pd-grid { border: 0; border-radius: 0; gap: 9px; box-shadow: inset 3px 3px 0 0 #05040b, inset -3px -3px 0 0 #2a2250, 0 0 0 2px var(--px-rim-lo), 0 0 0 4px var(--px-ink); }
.char-head canvas { border: 0; border-radius: 0; box-shadow: 0 0 0 2px var(--px-rim-lo), 0 0 0 4px var(--px-ink); }
.qs-preview .slot { width: 40px; height: 40px; }

/* ============================================================ warp transition card */
#warp-card {
  position: fixed; inset: 0; z-index: 11000; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(40, 30, 80, .55), rgba(4, 3, 10, .92) 70%);
  pointer-events: none; opacity: 1; transition: opacity .55s steps(6);
}
#warp-card.out { opacity: 0; }
#warp-card .wc-box {
  width: min(420px, 90vw); padding: 16px 18px 14px; text-align: center;
  background: var(--px-dither), linear-gradient(var(--px-bg2), var(--px-bg));
  box-shadow: var(--px-frame);
  animation: wc-pop .35s steps(5);
}
#warp-card .wc-kicker { font-family: 'Press Start 2P', monospace; font-size: 9px; color: #c4b5fd; letter-spacing: 2px; text-shadow: 1px 1px 0 var(--px-ink); }
#warp-card .wc-name { font-family: 'Kanit'; font-size: 26px; font-weight: 700; color: var(--px-rim-hi); margin: 6px 0 2px; text-shadow: 3px 3px 0 var(--px-ink); }
#warp-card .wc-en { font-family: 'Press Start 2P', monospace; font-size: 9px; color: #a5b4fc; letter-spacing: 1px; }
#warp-card .wc-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0 12px; }
#warp-card .wc-chip { font-size: 12px; font-weight: 700; padding: 3px 9px; background: #120e24; box-shadow: inset 0 2px 0 0 #2d2456, 0 0 0 2px var(--px-ink); color: #e9e5ff; }
#warp-card .wc-chip.safe { color: #bbf7d0; } #warp-card .wc-chip.pvp { color: #fecaca; }
#warp-card canvas { width: 240px; max-width: 70vw; height: auto; background: #05050c; box-shadow: 0 0 0 2px var(--px-rim-lo), 0 0 0 4px var(--px-ink); image-rendering: pixelated; }
#warp-card .wc-legend { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-size: 11px; color: #c9c3e8; margin-top: 10px; }
#warp-card .wc-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; box-shadow: 0 0 0 1px var(--px-ink); vertical-align: 0; }
#warp-card .wc-bar { height: 8px; margin-top: 12px; background: #0c0a19; box-shadow: inset 0 2px 0 0 #05040b, 0 0 0 2px var(--px-ink); overflow: hidden; }
#warp-card .wc-bar > div { height: 100%; width: 0; background: repeating-linear-gradient(90deg, #f4d67e 0 6px, #d29c3e 6px 12px); animation: wc-load 1.1s steps(12) forwards; }
@keyframes wc-pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wc-load { to { width: 100%; } }

@media (max-width: 540px) {
  #panels .panel, .card, #npc-dialog, #modal .modal-card { box-shadow: var(--px-frame-sm); }
  #warp-card .wc-name { font-size: 21px; }
  #warp-card canvas { width: 200px; }
}
@media (max-height: 620px) {
  #warp-card .wc-box { padding: 10px 14px 10px; }
  #warp-card .wc-name { font-size: 19px; margin: 3px 0 0; }
  #warp-card .wc-chips { margin: 6px 0 8px; gap: 6px; }
  #warp-card .wc-chip { font-size: 11px; padding: 2px 7px; }
  #warp-card canvas { width: min(170px, 38vh); }
  #warp-card .wc-legend { display: none; }
  #warp-card .wc-bar { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .slot.g3, .slot.g4, .slot.g5 { animation: none; }
  #warp-card .wc-box, #warp-card .wc-bar > div { animation-duration: .01s; }
}

/* ============================================================ quick sell & trade helpers (v2.5.1) */
.qs-safe { display: inline-block; margin-top: 4px; color: #bbf7d0; font-weight: 700; }
.qs-kept { margin: 8px 0 2px; padding: 6px 8px; background: rgba(10, 8, 22, .55); box-shadow: inset 3px 0 0 0 #64748b, 0 0 0 2px #120e24; }
.qs-kept summary { cursor: pointer; font-size: 12px; font-weight: 700; color: #cbd5e1; }
.qs-kept-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; max-height: 170px; overflow-y: auto; padding: 2px 4px; }
.qs-kept-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.qs-kept-row .slot { width: 32px; height: 32px; cursor: default; }
.qs-kept-row .slot img { width: 24px; height: 24px; }
.qs-kept-row small { color: #fca5a5; font-weight: 700; white-space: nowrap; }
.slot.in-trade { --gr: #fbbf24; }
.slot.in-trade::after {
  content: '🤝'; position: absolute; left: 2px; top: 1px; z-index: 5; font-size: 12px; line-height: 1;
  filter: drop-shadow(1px 1px 0 #0b0816);
}
.slot.in-trade img { opacity: .55; }
.trade-side { border: 0; border-radius: 0; background: rgba(10, 8, 22, .55); box-shadow: inset 2px 2px 0 0 #05040b, inset -2px -2px 0 0 #2a2250, 0 0 0 2px var(--px-ink); }
.my-side { box-shadow: inset 0 3px 0 0 #60a5fa, inset -2px -2px 0 0 #2a2250, 0 0 0 2px var(--px-ink); }
.other-side { box-shadow: inset 0 3px 0 0 var(--px-rim), inset -2px -2px 0 0 #2a2250, 0 0 0 2px var(--px-ink); }
.trade-side-title { border-bottom: 0; box-shadow: 0 2px 0 0 rgba(210, 156, 62, .25); text-shadow: 1px 1px 0 var(--px-ink); }
.trade-gold-row input { border-radius: 0 !important; }
.trade-status-badge { border-radius: 0; box-shadow: 0 0 0 2px var(--px-ink); text-shadow: 1px 1px 0 var(--px-ink); }
.trade-offer-cell .slot { width: 46px; height: 46px; }

/* ============================================================ gem sockets (v2.6) */
.slot .sockets { position: absolute; left: 3px; bottom: 3px; z-index: 4; display: flex; gap: 2px; }
.slot .sockets i { width: 5px; height: 5px; background: #0b0816; box-shadow: 0 0 0 1px #6b6590; }
.tt-gem { font-weight: 700; text-shadow: 1px 1px 0 #0b0816; }
.gem-sockets { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.gem-socket { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(10, 8, 22, .55); box-shadow: inset 3px 0 0 0 #6b6590, 0 0 0 2px #120e24; }
.gem-socket.full { box-shadow: inset 3px 0 0 0 var(--px-rim-hi), 0 0 0 2px #120e24; }
.gem-socket img { width: 26px; height: 26px; image-rendering: pixelated; }
.gem-socket span { flex: 1; font-weight: 700; }
.gem-socket select { flex: 1; min-width: 0; padding: 4px 6px; font-size: 12px; }
.gem-hole { flex: 0 0 22px !important; height: 22px; background: radial-gradient(circle, #1e1b3a 40%, #05040b 70%); box-shadow: inset 2px 2px 0 0 #000, 0 0 0 2px #3b3170; }
.gem-bag { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gem-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 7px 2px 3px; background: #120e24; box-shadow: 0 0 0 2px #0b0816; }
.gem-chip img { width: 18px; height: 18px; }
.gem-chip.none { opacity: .45; }

/* ============================================================ season pass (v2.6) */
.pass-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pass-season { font-family: 'Kanit'; font-size: 17px; font-weight: 700; color: var(--px-rim-hi); text-shadow: 2px 2px 0 var(--px-ink); }
.pass-tier { text-align: center; min-width: 64px; padding: 4px 8px; background: #120e24; box-shadow: inset 0 2px 0 0 #2d2456, 0 0 0 2px var(--px-rim), 0 0 0 4px var(--px-ink); }
.pass-tier b { display: block; font-family: 'Press Start 2P', monospace; font-size: 18px; color: #7dd3fc; text-shadow: 2px 2px 0 var(--px-ink); }
.pass-tier small { font-size: 10px; color: var(--dim); }
.pass-bar { position: relative; height: 18px; background: #0c0a19; box-shadow: inset 0 2px 0 0 #05040b, 0 0 0 2px var(--px-ink); }
.pass-bar > div { height: 100%; background: repeating-linear-gradient(90deg, #38bdf8 0 8px, #0ea5e9 8px 16px); }
.pass-bar > span { position: absolute; inset: 0; text-align: center; font-size: 11px; font-weight: 700; line-height: 18px; text-shadow: 1px 1px 0 var(--px-ink), -1px -1px 0 var(--px-ink); }
.pass-missions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.pass-m { display: grid; grid-template-columns: 26px 1fr auto auto; align-items: center; gap: 8px; padding: 5px 8px; background: rgba(10, 8, 22, .55); box-shadow: inset 3px 0 0 0 #38bdf8, 0 0 0 2px #120e24; }
.pass-m.done { box-shadow: inset 3px 0 0 0 var(--ok), 0 0 0 2px #120e24; opacity: .75; }
.pm-ico { font-size: 16px; text-align: center; }
.pm-main b { font-size: 12px; }
.pm-n { font-size: 11px; font-weight: 700; min-width: 48px; text-align: right; }
.pm-xp { font-size: 11px; color: #7dd3fc; font-weight: 700; }
.pass-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; max-height: 280px; overflow-y: auto; padding: 4px 4px 6px; }
.pass-t { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: stretch; padding: 6px; min-height: 92px; background: #120e24; box-shadow: inset 0 2px 0 0 #231c40, 0 0 0 2px var(--px-ink); opacity: .7; }
.pass-t.open { opacity: 1; box-shadow: inset 0 2px 0 0 #231c40, 0 0 0 2px var(--px-rim-hi), 0 0 0 4px var(--px-ink); }
.pass-t.got { opacity: .55; }
.pass-t.big { background: linear-gradient(#2a1f52, #120e24); }
.pt-n { font-family: 'Press Start 2P', monospace; font-size: 10px; color: var(--px-rim-hi); }
.pt-r { display: flex; flex-wrap: wrap; gap: 3px 6px; font-size: 11px; flex: 1; }
.pt-r span { display: inline-flex; align-items: center; gap: 2px; }
.pt-r img { width: 18px; height: 18px; }
.pass-title { color: #7dd3fc; font-weight: 700; }
.pt-s { text-align: center; font-size: 12px; }

.mm-btn.on { background: #574aa5 !important; box-shadow: 0 0 0 2px var(--px-rim-hi) !important; }

/* ============================================================ item lock (v2.7) */
.slot .lock-pin { position: absolute; left: 2px; top: 1px; z-index: 5; font-size: 10px; line-height: 1; filter: drop-shadow(1px 1px 0 #0b0816); }
.slot.locked { --gr: #94a3b8; }

/* ============================================================ premium pixel menu (v2.7) */
#menubar button {
  --grp: #94a3b8;
  border: 0 !important; border-radius: 0 !important;
  background: linear-gradient(#2e2656, #1a1534) !important;
  box-shadow: inset 0 2px 0 0 rgba(255, 255, 255, .09), inset 0 -4px 0 0 rgba(0, 0, 0, .45), 0 0 0 2px var(--px-ink) !important;
  transition: transform .08s steps(2), filter .1s;
}
#menubar button[data-group="hero"] { --grp: #f4d67e; }
#menubar button[data-group="play"] { --grp: #c084fc; }
#menubar button[data-group="social"] { --grp: #60a5fa; }
#menubar button[data-group="vip"] { --grp: #f472b6; }
#menubar button[data-group="sys"] { --grp: #94a3b8; }
#menubar button::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 2px; height: 2px; background: var(--grp); opacity: .75; }
#menubar button img.mi { width: 24px; height: 24px; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 #0b0816); pointer-events: none; }
#menubar button:hover { transform: translateY(-2px); background: linear-gradient(#40357a, #241d48) !important; box-shadow: inset 0 2px 0 0 rgba(255, 255, 255, .14), inset 0 -4px 0 0 rgba(0, 0, 0, .45), 0 0 0 2px var(--grp) !important; }
#menubar button:hover img.mi { filter: drop-shadow(1px 1px 0 #0b0816) brightness(1.15); }
#menubar button:active { transform: translateY(1px); }
#menubar button.open { background: linear-gradient(#5b4aa8, #2d2456) !important; box-shadow: inset 0 0 0 1px var(--grp), inset 0 -4px 0 0 rgba(0, 0, 0, .35), 0 0 0 2px var(--px-ink) !important; }
#menubar button.open::after { opacity: 1; height: 3px; }
#menubar button span { color: #d9d4f5 !important; font-weight: 700; text-shadow: 1px 1px 0 var(--px-ink); }
@media (max-width: 900px) { #menubar button img.mi { width: 20px; height: 20px; } }
@media (max-width: 540px) { #menubar button img.mi { width: 18px; height: 18px; } }
#hud.mobile-nav-open #menubar button img.mi { width: 24px; height: 24px; }

/* ============================================================ pixel world map (v2.7) */
.wm2 { display: flex; flex-direction: column; gap: 12px; }
.wm-route { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 10px 6px 12px; background: var(--px-dither), #0b0918; box-shadow: inset 3px 3px 0 0 #05040b, inset -3px -3px 0 0 #221c40, 0 0 0 2px var(--px-ink); scrollbar-width: thin; }
.wm-link { flex: 0 0 18px; height: 4px; background: repeating-linear-gradient(90deg, #d29c3e 0 4px, transparent 4px 8px); }
.wm-node { position: relative; flex: 0 0 auto; width: 82px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px 5px; border: 0; cursor: pointer; color: var(--text); background: #1a1531; box-shadow: inset 0 2px 0 0 #2d2456, inset 0 -3px 0 0 #0f0c20, 0 0 0 2px var(--px-ink); transition: transform .08s steps(2); }
.wm-node canvas { width: 60px; height: 60px; image-rendering: pixelated; box-shadow: 0 0 0 2px #0b0816, 0 0 0 3px #3b3170; }
.wm-node:hover { transform: translateY(-2px); background: #251e45; }
.wm-node.sel { background: #3b3170; box-shadow: inset 0 2px 0 0 #6d5fc4, inset 0 -3px 0 0 #1d1640, 0 0 0 2px var(--px-rim-hi), 0 0 0 4px var(--px-ink); }
.wm-node.here canvas { box-shadow: 0 0 0 2px #0b0816, 0 0 0 3px #fde047; }
.wm-node.lock canvas { filter: grayscale(.85) brightness(.55); }
.wm-node.rec:not(.sel) { box-shadow: inset 0 2px 0 0 #2d2456, inset 0 -3px 0 0 #0f0c20, 0 0 0 2px #38bdf8; }
.wm-nname { font-size: 10.5px; font-weight: 700; line-height: 1.15; text-align: center; text-shadow: 1px 1px 0 var(--px-ink); max-width: 76px; }
.wm-nlv { font-family: 'Press Start 2P', monospace; font-size: 6.5px; color: #a5b4fc; }
.wm-pin, .wm-lock, .wm-star { position: absolute; top: 2px; right: 3px; font-size: 13px; font-style: normal; filter: drop-shadow(1px 1px 0 #0b0816); }
.wm-star { color: #38bdf8; font-size: 15px; }
.wm-card { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: start; padding: 10px; background: rgba(10, 8, 22, .55); box-shadow: inset 3px 0 0 0 var(--px-rim), 0 0 0 2px #120e24; }
.wm-big { width: 200px; height: 200px; image-rendering: pixelated; box-shadow: 0 0 0 2px var(--px-rim-lo), 0 0 0 4px var(--px-ink); }
.wm-title { font-family: 'Kanit'; font-size: 19px; font-weight: 700; color: var(--px-rim-hi); text-shadow: 2px 2px 0 var(--px-ink); }
.wm-title small { display: block; font-family: 'Press Start 2P', monospace; font-size: 8px; color: #a5b4fc; letter-spacing: 1px; margin-top: 2px; }
.wm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.wm-chips span { font-size: 11.5px; font-weight: 700; padding: 2px 8px; background: #120e24; box-shadow: inset 0 2px 0 0 #2d2456, 0 0 0 2px var(--px-ink); }
.wm-chips .safe { color: #bbf7d0; } .wm-chips .pvp { color: #fecaca; } .wm-chips .rec { color: #7dd3fc; }
.wm-boss { font-size: 12px; margin-bottom: 8px; color: #fca5a5; }
.wm-mobs2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; max-height: 170px; overflow-y: auto; padding: 2px; }
.wm-mob { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; padding: 3px 6px 3px 3px; background: #120e24; box-shadow: 0 0 0 2px #0b0816; }
.wm-mob img { grid-row: span 2; width: 30px; height: 30px; image-rendering: pixelated; }
.wm-mob b { font-size: 11px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-mob small { font-size: 10px; color: var(--dim); }
.wm-mob.boss { box-shadow: 0 0 0 2px #7f1d1d; } .wm-mob.boss b { color: #fca5a5; }
.wm-mob.elite b { color: #fdba74; }
.wm-act { margin-top: 10px; }
@media (max-width: 640px) {
  .wm-card { grid-template-columns: 1fr; }
  .wm-big { width: 160px; height: 160px; justify-self: center; }
}

/* ============================================================ game logo + daily login gifts (v2.7.1) */
.logo-emblem { display: block; width: 96px; height: 96px; margin: 0 auto -6px; image-rendering: pixelated; filter: drop-shadow(0 0 18px rgba(253, 224, 71, .45)); animation: sf-bob 3s ease-in-out infinite; }
@keyframes sf-bob { 50% { transform: translateY(-6px); } }
.sf-logo { display: flex; align-items: center; justify-content: center; gap: 12px; }
.sf-emblem { width: 64px; height: 64px; image-rendering: pixelated; filter: drop-shadow(0 0 10px rgba(253, 224, 71, .55)); animation: sf-bob 3s ease-in-out infinite; }
.sf-words { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.sf-words b { font-family: 'Press Start 2P', monospace; font-size: 26px; font-weight: 400; color: #fde68a; letter-spacing: 2px; text-shadow: 0 3px 0 #b45309, 3px 3px 0 #1a1026, 0 0 18px rgba(251, 191, 36, .55); }
.sf-words span { font-family: 'Press Start 2P', monospace; font-size: 12px; color: #c4b5fd; letter-spacing: 9px; margin-top: 7px; text-shadow: 2px 2px 0 #1a1026; }
.sf-words i { font-family: 'Kanit'; font-style: normal; font-size: 13px; color: #fef3c7; margin-top: 6px; letter-spacing: 1px; text-shadow: 1px 1px 0 #1a1026; }
.sf-logo.sm .sf-emblem { width: 40px; height: 40px; } .sf-logo.sm .sf-words b { font-size: 16px; } .sf-logo.sm .sf-words span { font-size: 8px; letter-spacing: 6px; }

.lg-wrap { display: flex; flex-direction: column; gap: 10px; }
.lg-banner { position: relative; overflow: hidden; padding: 14px 12px 10px; text-align: center; background: radial-gradient(ellipse at 50% 120%, rgba(124, 58, 237, .55), transparent 60%), linear-gradient(#0b0820, #1c1242); box-shadow: inset 0 0 0 2px #3b3170, 0 0 0 2px var(--px-ink); }
.lg-banner .tw { position: absolute; width: 3px; height: 3px; background: #fff; box-shadow: 0 0 6px #fff; animation: lg-tw 2.2s steps(2) infinite; }
@keyframes lg-tw { 50% { opacity: .15; } }
.lg-title { margin-top: 10px; font-family: 'Kanit'; font-size: 17px; font-weight: 700; color: #fff7d6; text-shadow: 2px 2px 0 var(--px-ink); }
.lg-title small { display: block; font-family: 'Press Start 2P', monospace; font-size: 8px; color: #a5b4fc; letter-spacing: 2px; margin-top: 4px; font-weight: 400; }
.lg-stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lg-stats span { font-size: 12px; padding: 3px 10px; background: #120e24; box-shadow: inset 0 2px 0 0 #2d2456, 0 0 0 2px var(--px-ink); }
.lg-stats b { color: var(--px-rim-hi); }
.lg-track { position: relative; padding-top: 6px; }
.lg-line { height: 6px; margin: 0 4px 10px; background: #0c0a19; box-shadow: inset 0 2px 0 0 #05040b, 0 0 0 2px var(--px-ink); }
.lg-line > div { height: 100%; background: repeating-linear-gradient(90deg, #f4d67e 0 6px, #d29c3e 6px 12px); }
.lg-grid { display: grid; grid-template-columns: repeat(6, 1fr) 1.5fr; gap: 8px; }
.lg-day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 4px 8px; min-height: 150px; text-align: center; background: linear-gradient(#231c40, #151129); box-shadow: inset 0 2px 0 0 #3b3170, inset 0 -3px 0 0 #0b0918, 0 0 0 2px var(--px-ink); }
.lg-n { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-family: 'Press Start 2P', monospace; font-size: 8px; color: #fde68a; text-shadow: 1px 1px 0 var(--px-ink); white-space: nowrap; }
.lg-main { position: relative; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(165, 145, 255, .18), transparent 70%); }
.lg-main img { width: 44px; height: 44px; image-rendering: pixelated; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, .6)); }
.lg-coin { font-size: 30px; }
.lg-q { position: absolute; right: -4px; bottom: -2px; font-family: 'Press Start 2P', monospace; font-size: 8px; color: #fff; text-shadow: 1px 0 0 #0b0816, -1px 0 0 #0b0816, 0 1px 0 #0b0816, 0 -1px 0 #0b0816; }
.lg-gold { font-size: 12px; font-weight: 700; color: #fde68a; }
.lg-dia { font-size: 12px; font-weight: 700; color: #7dd3fc; }
.lg-extra { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; font-size: 10.5px; color: #d9d4f5; }
.lg-extra img { width: 16px; height: 16px; vertical-align: middle; }
.lg-day.future { opacity: .72; }
.lg-day.today { background: linear-gradient(#4a3d8a, #241d48); box-shadow: inset 0 2px 0 0 #8e80e0, inset 0 -3px 0 0 #1d1640, 0 0 0 2px var(--px-rim-hi), 0 0 0 4px var(--px-ink), 0 0 18px rgba(250, 204, 21, .45); animation: lg-glow 1.4s steps(4) infinite; }
.lg-day.today .lg-main img { animation: sf-bob 1.2s steps(3) infinite; }
@keyframes lg-glow { 50% { box-shadow: inset 0 2px 0 0 #8e80e0, inset 0 -3px 0 0 #1d1640, 0 0 0 2px #fff1b8, 0 0 0 4px var(--px-ink), 0 0 26px rgba(250, 204, 21, .7); } }
.lg-today { margin-top: auto; font-size: 11px; font-weight: 700; padding: 2px 8px; color: #2a1500; background: #f4d67e; box-shadow: 0 0 0 2px var(--px-ink); }
.lg-day.claimed .lg-main, .lg-day.claimed .lg-gold, .lg-day.claimed .lg-extra, .lg-day.claimed .lg-dia { opacity: .45; }
.lg-stamp { position: absolute; top: 46px; left: 50%; transform: translateX(-50%) rotate(-14deg); padding: 3px 7px; font-family: 'Kanit'; font-size: 13px; font-weight: 700; color: #bbf7d0; border: 2px solid #4ade80; background: rgba(6, 40, 20, .85); box-shadow: 0 0 0 2px var(--px-ink); white-space: nowrap; text-shadow: 1px 1px 0 var(--px-ink); }
.lg-day.stamped .lg-stamp { animation: lg-stamp .45s steps(4); }
@keyframes lg-stamp { from { transform: translateX(-50%) rotate(-14deg) scale(2.2); opacity: 0; } to { transform: translateX(-50%) rotate(-14deg) scale(1); opacity: 1; } }
.lg-day.big { background: radial-gradient(circle at 50% 40%, rgba(250, 204, 21, .22), transparent 65%), linear-gradient(#3a2560, #1a1034); }
.lg-day.big .lg-main { width: 64px; height: 64px; } .lg-day.big .lg-main img { width: 56px; height: 56px; }
.lg-ribbon { position: absolute; top: 18px; right: -4px; padding: 2px 7px; font-size: 10px; font-weight: 700; color: #fff; background: #dc2626; box-shadow: 0 0 0 2px var(--px-ink); transform: rotate(8deg); }
.lg-act { display: flex; justify-content: center; }
.lg-claim { min-width: 280px; position: relative; overflow: hidden; }
.lg-claim.shine::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40px; left: -60px; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent); animation: lg-shine 2.4s linear infinite; }
@keyframes lg-shine { to { left: 120%; } }
.lg-note { text-align: center; }
@media (max-width: 640px) {
  .lg-grid { grid-template-columns: repeat(4, 1fr); }
  .lg-day.big { grid-column: span 2; }
  .sf-words b { font-size: 18px; } .sf-emblem { width: 48px; height: 48px; }
  .lg-claim { min-width: 0; width: 100%; }
}
