/* =========================================
   MMORPG UI — Minimalist Clean Theme
   ========================================= */

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

.hidden {
  display: none !important;
}

:root {
  --ui-scale: 1;
  --bg: rgba(13, 27, 42, 0.85);
  --bg-solid: rgba(13, 27, 42, 0.96);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --text: #e0e0e0;
  --text-dim: #8b949e;
  --text-muted: rgba(255,255,255,0.3);
  --accent: #4fc3f7;
  --accent-dim: #0288d1;
  --hp: #e53935;
  --hp-light: #ff5252;
  --mp: #2ecc71;
  --mp-light: #52e88a;
  --exp: #f39c12;
  --exp-light: #f1c40f;
  --red: #e74c3c;
  --gold: #ffd700;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
}

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

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: url('/assets/cursor-sword.svg') 1 1, auto;
}

#gameCanvas {
  cursor: url('/assets/cursor-sword.svg') 1 1, auto;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
}

/* =========================================
   UI OVERLAY
   ========================================= */
#ui-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* =========================================
   GAME MENU (top-left hamburger)
   ========================================= */
#game-menu {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 100;
  pointer-events: auto;
}

#game-menu-btn {
  width: 34px; height: 34px;
  background: rgba(13,27,42,0.9);
  border: 2px solid rgba(79,195,247,0.2);
  border-radius: 3px;
  color: #8b949e;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  box-shadow: var(--shadow-sm);
}

#game-menu-btn:hover {
  background: rgba(56,142,184,0.3);
  border-color: rgba(79,195,247,0.5);
}

#game-menu-dropdown {
  position: absolute;
  top: 38px; left: 0;
  min-width: 200px;
  background: rgba(13, 27, 42, 0.96);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.menu-option {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font);
}

.menu-option:hover {
  background: rgba(79,195,247,0.15);
}

.menu-option + .menu-option {
  border-top: 2px solid rgba(255,255,255,0.06);
}

/* =========================================
   PLAYER INFO (top-left) — Fantasy HUD
   ========================================= */
#player-info {
  position: absolute;
  top: 0; left: 0;
  width: 297px;
  aspect-ratio: 1536 / 1024;
  pointer-events: auto;
  z-index: 40;
}

/* Frame image = foreground overlay, pointer-events none so bars can't be clicked */
#hud-frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 3;
  pointer-events: none;
  user-select: none;
}

/* Player name & level — positioned above HP bar */
#player-details {
  position: absolute;
  z-index: 4;
  top: 17.5%;
  left: 47%;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
  pointer-events: none;
}

#player-name {
  font-size: 9px;
  font-weight: 700;
  color: #e8d5a3;
  display: inline;
  letter-spacing: 0.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Cinzel', serif;
  text-shadow: 0 1px 2px rgba(0,0,0,1), 0 0 6px rgba(0,0,0,0.7), 1px 1px 0 rgba(60,40,10,0.6);
}

#player-subtitle {
  font-size: 7px;
  font-weight: 600;
  color: #c9a84c;
  letter-spacing: 0.5px;
  white-space: nowrap;
  font-family: 'Cinzel', serif;
  text-shadow: 0 1px 2px rgba(0,0,0,1), 1px 1px 0 rgba(60,40,10,0.6);
}

/* Bars — positioned behind the frame image, aligned to transparent cutout slots */
.hud-bar {
  position: absolute;
  z-index: 1;
  overflow: hidden;
  border-radius: 2px;
}

/* HP bar slot */
#hp-bar {
  top: 25.5%;
  left: 52%;
  width: 43%;
  height: 8.6%;
  background: rgba(0,0,0,0.7);
}

/* MP bar slot */
#mp-bar {
  top: 40.5%;
  left: 52%;
  width: 43%;
  height: 8.6%;
  background: rgba(0,0,0,0.7);
}

/* XP bar slot */
#xp-hud-bar {
  top: 55%;
  left: 52%;
  width: 43%;
  height: 8.6%;
  background: rgba(0,0,0,0.7);
}

#hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #e53935 0%, #b71c1c 50%, #991a1a 100%);
  transition: width 0.3s;
}

#mp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #2ecc71 0%, #27ae60 50%, #1e8449 100%);
  transition: width 0.3s;
}

#xp-hud-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(180deg, #fdd835 0%, #f9a825 50%, #f57f17 100%);
  transition: width 0.4s ease;
}

.pi-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,1);
  pointer-events: none;
  letter-spacing: 0.3px;
}

/* =========================================
   TOP-RIGHT INFO
   ========================================= */
#online-count {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--bg-solid);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 5px 10px;
  color: #ffd700;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
  text-shadow: 0 0 4px rgba(255,215,0,0.4);
}

#ping-display {
  position: absolute;
  top: 35px; right: 10px;
  background: var(--bg-solid);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 3px 8px;
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  backdrop-filter: blur(16px);
}

#fps-counter {
  position: absolute;
  top: 56px; right: 10px;
  background: var(--bg-solid);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 3px 8px;
  color: #ffd700;
  font-size: 10px;
  font-weight: 600;
  backdrop-filter: blur(16px);
  text-shadow: 0 0 4px rgba(255,215,0,0.4);
}

/* =========================================
   MINIMAP
   ========================================= */
#minimap-container {
  position: absolute;
  top: 0px;
  right: 20px;
  width: 323px;
  aspect-ratio: 1536 / 1024;
  z-index: 40;
  pointer-events: none;
}
#minimap-frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 3;
  pointer-events: none;
}
#minimap {
  position: absolute;
  z-index: 1;
  left: 21.5%;
  top: 11%;
  width: 55.7%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  image-rendering: auto;
  background: rgba(13,27,42,0.85);
}

/* =========================================
   COORDINATES
   ========================================= */
#coordinates {
  position: absolute;
  top: 1px; left: 1px;
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 0 0 4px 0;
}

/* =========================================
   CHAT
   ========================================= */
#chat-container {
  position: absolute;
  bottom: 72px; left: 10px;
  width: 440px;
  aspect-ratio: 1536 / 1024;
  z-index: 20;
  pointer-events: auto;
}
#chat-frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
}
#chat-content {
  position: absolute;
  z-index: 3;
  top: 13%;
  left: 8%;
  right: 5%;
  bottom: 16%;
  display: flex;
  flex-direction: column;
}

#chat-tabs {
  display: flex;
  gap: 2px;
  padding: 0 2px;
  background: none;
  border: none;
  border-bottom: none;
}

.chat-tab {
  flex: 1;
  padding: 4px 0;
  background: transparent;
  border: none;
  color: transparent;
  font-size: 10px;
  font-family: 'Cinzel', serif;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.chat-tab:hover {
  color: transparent;
}

.chat-tab.active {
  color: transparent;
  background: transparent;
  border-bottom-color: transparent;
}

#chat-messages {
  flex: 1;
  overflow-y: hidden;
  background: none;
  border: none;
  padding: 6px 8px;
  font-size: 14px;
  color: #3b2e1a;
  scrollbar-width: thin;
  scrollbar-color: rgba(100,80,50,0.3) transparent;
}

#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: rgba(180,150,100,0.25); border-radius: 4px; }

.chat-msg {
  margin-bottom: 3px;
  word-wrap: break-word;
  line-height: 1.4;
}

.chat-msg .name {
  font-weight: 600;
  color: #1a5276;
}

.chat-msg.system {
  color: #7d6608;
  font-size: 13px;
}

.chat-msg.ch-local .name { color: #1a5276; }
.chat-msg.ch-global .name { color: #7d3c00; }
.chat-msg.ch-party .name { color: #1e7e34; }
.chat-msg.ch-trade .name { color: #856404; }
.chat-msg.ch-local::before { content: '[Local] '; color: #1a5276; font-size: 12px; }
.chat-msg.ch-global::before { content: '[Global] '; color: #7d3c00; font-size: 12px; }
.chat-msg.ch-party::before { content: '[Grupo] '; color: #1e7e34; font-size: 12px; }
.chat-msg.ch-trade::before { content: '[Trade] '; color: #856404; font-size: 12px; }
.chat-msg.ch-system::before { content: '[System] '; color: #7d6608; font-size: 12px; }

/* Chat item links */
.chat-item-link {
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
  transition: filter 0.15s;
}
.chat-item-link:hover {
  filter: brightness(1.3);
  text-decoration: underline wavy;
}

/* Clickable player names in chat */
.chat-name-clickable {
  cursor: pointer;
  transition: filter 0.15s;
}
.chat-name-clickable:hover {
  filter: brightness(1.3);
  text-decoration: underline;
}

/* Item context menu (reuse player context menu styling) */
#item-context-menu {
  position: absolute;
  z-index: 9999;
  background: rgba(13,27,42,0.96);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 4px 0;
  min-width: 140px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

/* Chat name context menu */
#chat-name-context-menu {
  position: absolute;
  z-index: 9999;
  background: rgba(13,27,42,0.96);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 4px 0;
  min-width: 160px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

#chat-input {
  width: calc(100% - 115px);
  margin-left: 31px;
  margin-top: 14px;
  padding: 6px 10px;
  border: none;
  border-top: 1px solid rgba(100,80,50,0.3);
  border-radius: 0;
  background: rgba(255,245,220,0.3);
  color: #3b2e1a;
  font-size: 12px;
  font-family: var(--font);
  outline: none;
  transition: background 0.2s;
}

#chat-input:focus {
  background: rgba(255,245,220,0.5);
}

#chat-input::placeholder {
  color: rgba(80,60,30,0.4);
  font-size: 11px;
}

#chat-send-btn {
  position: absolute;
  z-index: 4;
  bottom: 14%;
  right: 5%;
  width: 50px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  pointer-events: auto;
}

/* =========================================
   SKILL BAR
   ========================================= */
#skill-bar-container {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 558px;
  aspect-ratio: 1536 / 253;
  z-index: 30;
}
#skill-bar-frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 3;
  pointer-events: none;
}
#skill-bar {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 4px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
}

.skill-slot {
  position: relative;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  overflow: hidden;
}
.skill-slot:nth-child(1) { left: -14px; }
.skill-slot:nth-child(2) { left: -13px; }
.skill-slot:nth-child(3) { left: -13px; }
.skill-slot:nth-child(4) { left: -13px; }
.skill-slot:nth-child(5) { left: -12px; }
.skill-slot:nth-child(6) { left: -14px; }
.skill-slot:nth-child(7) { left: -14px; }
.skill-slot:nth-child(8) { left: -14px; }
.skill-slot:nth-child(9) { left: -14px; }
.skill-slot:nth-child(10) { left: -14px; }

.skill-slot:hover {
  background: transparent;
  border-color: transparent;
}

.skill-slot:active, .skill-slot.pressed {
  transform: scale(0.93);
  background: rgba(201,168,76,0.3);
}

.skill-icon {
  font-size: 15px;
  color: #8b949e;
  pointer-events: none;
  line-height: 1;
  font-weight: 600;
  font-family: var(--font);
}

.skill-key {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  font-family: 'Cinzel', serif;
  color: rgba(232,213,163,0.5);
  font-weight: 600;
  pointer-events: none;
}

.skill-cooldown {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 0%;
  background: rgba(0,0,0,0.55);
  pointer-events: none;
  transition: height 0.1s linear;
}

.skill-slot.on-cooldown .skill-cooldown {
  height: 100%;
}

.skill-icon-img {
  width: 28px;
  height: 28px;
  pointer-events: none;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.skill-cd-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 3px #000, 0 0 6px #000;
  pointer-events: none;
  z-index: 3;
}

.skill-slot[title] {
  cursor: pointer;
}

.skill-slot.on-cooldown {
  opacity: 0.7;
}

/* =========================================
   PLAYER CONTEXT MENU
   ========================================= */
#player-context-menu {
  position: absolute;
  z-index: 9999;
  background: rgba(13,27,42,0.96);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 4px 0;
  min-width: 160px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.ctx-option {
  padding: 6px 14px;
  font-size: 11px;
  color: #e0e0e0;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}

.ctx-option:hover {
  background: rgba(79,195,247,0.2);
  color: #4fc3f7;
}

/* =========================================
   PARTY INVITE POPUP
   ========================================= */
#party-invite-popup {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: rgba(13,27,42,0.96);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 14px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: fadeInDown 0.25s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#party-invite-text {
  font-size: 12px;
  color: #e0e0e0;
  margin-bottom: 10px;
}

#party-invite-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.party-btn {
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 600;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.12s;
}

.party-btn.accept {
  background: rgba(63,185,80,0.2);
  color: #3fb950;
  border-color: #2a5a20;
}

.party-btn.accept:hover {
  background: rgba(63,185,80,0.3);
}

.party-btn.decline {
  background: rgba(248,81,73,0.15);
  color: #f85149;
  border-color: #5a2020;
}

.party-btn.decline:hover {
  background: rgba(248,81,73,0.25);
}

/* =========================================
   TRADE INVITE POPUP
   ========================================= */
#trade-invite-popup {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  background: rgba(13,27,42,0.96);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 14px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  animation: fadeInDown 0.2s ease;
  min-width: 220px;
}

#trade-invite-text {
  color: #e0e0e0;
  font-size: 12px;
  margin-bottom: 10px;
}

#trade-invite-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* =========================================
   TRADE WINDOW
   ========================================= */
#trade-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, 94vw);
  z-index: 80;
}

.trade-body {
  padding: 8px !important;
}

.trade-columns {
  display: flex;
  gap: 8px;
}

.trade-column {
  flex: 1;
  background: rgba(13,27,42,0.5);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 6px;
}

.trade-col-header {
  font-size: 10px;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  padding-bottom: 4px;
  border-bottom: 2px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}

.trade-slots {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.trade-slot {
  width: 36px;
  height: 36px;
  background: #0d1117;
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: background 0.12s;
}

.trade-slot:hover {
  background: rgba(79,195,247,0.15);
}

.trade-slot.has-item {
  border-color: rgba(176,176,176,0.4);
}

.trade-slot[data-rarity="uncommon"] { border: 2px solid #4fc34f; box-shadow: 0 0 4px rgba(79,195,79,0.4); }
.trade-slot[data-rarity="rare"] { border: 2px solid #3d9eff; box-shadow: 0 0 5px rgba(61,158,255,0.5); }
.trade-slot[data-rarity="epic"] { border: 2px solid #c76bff; box-shadow: 0 0 6px rgba(199,107,255,0.5); }
.trade-slot[data-rarity="legendary"] { border: 2px solid #ff9f00; box-shadow: 0 0 8px rgba(255,159,0,0.6); }
.trade-slot[data-rarity="mythic"] { border: 2px solid #ff4444; box-shadow: 0 0 8px rgba(255,68,68,0.6); }

.trade-slot img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: auto;
}

.trade-slot .item-count {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 8px;
  color: #fff;
  text-shadow: 0 0 3px #000;
}

.trade-gold-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 2px 2px;
  font-size: 11px;
  color: #ffd700;
}

.trade-gold-input {
  width: 80px;
  background: rgba(13,27,42,0.8);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  color: #ffd700;
  font-size: 11px;
  padding: 3px 6px;
  outline: none;
}

.trade-gold-input:focus {
  background: rgba(13,27,42,0.95);
  border-color: rgba(255,255,255,0.08);
}

.trade-gold-display {
  color: #ffd700;
  font-weight: 600;
}

.trade-status {
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  padding: 4px 0;
  min-height: 18px;
}

.trade-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding-top: 4px;
}

.trade-btn {
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.08);
  cursor: pointer;
  background: rgba(13,27,42,0.8);
  color: #e0e0e0;
  transition: background 0.12s;
}

.trade-btn:hover {
  background: rgba(79,195,247,0.15);
}

.trade-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.trade-btn.confirm {
  color: #ffb347;
}

.trade-btn.confirm:hover:not(:disabled) {
  background: rgba(255,179,71,0.15);
}

.trade-btn.confirm.active {
  background: rgba(255,179,71,0.25);
}

.trade-btn.accept {
  color: #3fb950;
}

.trade-btn.accept:hover:not(:disabled) {
  background: rgba(63,185,80,0.15);
}

.trade-btn.accept.active {
  background: rgba(63,185,80,0.25);
}

.trade-btn.cancel {
  color: #f85149;
}

.trade-btn.cancel:hover {
  background: rgba(248,81,73,0.15);
}

.trade-partner-col {
  opacity: 0.9;
}

/* Drag-over highlight for trade slots */
.trade-slot.drag-over {
  border-color: var(--accent);
  background: rgba(91,155,213,0.2);
  box-shadow: 0 0 6px rgba(91,155,213,0.3);
}

/* Inventory slot drag state */
.inv-slot.dragging-to-trade {
  opacity: 0.4;
}

/* =========================================
   PARTY FRAME
   ========================================= */
#party-frame {
  position: absolute;
  top: 90px;
  left: 10px;
  z-index: 25;
  background: rgba(13,27,42,0.93);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 0;
  min-width: 155px;
  box-shadow: var(--shadow-sm);
}

#party-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-bottom: 2px solid rgba(255,255,255,0.06);
  font-size: 10px;
  font-weight: 600;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#party-leave-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.12s;
}

#party-leave-btn:hover {
  color: #f85149;
}

#party-members {
  padding: 4px 0;
}

.party-member {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  transition: background 0.1s;
  position: relative;
}

.party-member:hover {
  background: rgba(79,195,247,0.1);
}

.party-member-leader {
  font-size: 10px;
  color: #f0883e;
  flex-shrink: 0;
}

.party-member-info {
  flex: 1;
  min-width: 0;
}

.party-member-name {
  font-size: 11px;
  color: #e0e0e0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.party-member-name.is-leader {
  color: #f0883e;
}

.party-member-bars {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 1px;
}

.party-member-hp-bar, .party-member-mp-bar {
  height: 4px;
  border-radius: 1px;
  overflow: hidden;
  background: rgba(13,27,42,0.8);
}

.party-member-hp-fill {
  height: 100%;
  background: #3fb950;
  transition: width 0.3s;
  border-radius: 4px;
}

.party-member-mp-fill {
  height: 100%;
  background: #52e88a;
  transition: width 0.3s;
  border-radius: 4px;
}

.party-member-level {
  font-size: 9px;
  color: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.party-member-kick {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(56,142,184,0.3);
  font-size: 12px;
  cursor: pointer;
  display: none;
  padding: 0 2px;
}

.party-member:hover .party-member-kick {
  display: block;
}

.party-member-kick:hover {
  color: #f85149;
}

/* =========================================
   SIDE MENU (vertical icon buttons)
   ========================================= */
#side-menu {
  position: absolute;
  bottom: 10px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 30;
  pointer-events: auto;
}

.side-menu-btn {
  position: relative;
  width: 92px;
  height: 92px;
  background: none;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #e8d5a3;
  transition: all 0.15s;
  padding: 0;
  outline: none;
}

.side-menu-btn img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}

.side-menu-btn svg {
  pointer-events: none;
}

.side-menu-btn:hover {
  transform: scale(1.12);
  filter: brightness(1.3);
  transform: scale(1.08);
}

.side-menu-btn.active {
  filter: brightness(1.4);
  transform: scale(1.08);
}

/* =========================================
   GAME WINDOWS
   ========================================= */
.game-window {
  position: absolute;
  z-index: 50;
  background: rgba(13,27,42,0.94);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  min-width: 270px;
  user-select: none;
  animation: windowOpen 0.15s ease-out;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 8px rgba(56,142,184,0.1);
}

@keyframes windowOpen {
  from { opacity: 0; transform: scale(calc(var(--ui-scale, 1) * 0.95)) translateY(6px); }
  to { opacity: 1; transform: scale(var(--ui-scale, 1)) translateY(0); }
}

.game-window.hidden {
  display: none;
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 2px solid rgba(255,255,255,0.06);
  cursor: move;
}

.window-title {
  color: #4fc3f7;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: var(--font);
}

.window-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 18px;
  cursor: pointer;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.12s;
}

.window-close:hover {
  background: rgba(224,85,85,0.2);
  color: var(--red);
}

.window-body {
  padding: 12px 14px;
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.06) transparent;
}

.window-body::-webkit-scrollbar { width: 4px; }
.window-body::-webkit-scrollbar-track { background: transparent; }
.window-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 4px; }

/* =========================================
   CHARACTER WINDOW
   ========================================= */
#character-window {
  top: 10px; left: 30px;
  width: 1500px;
  aspect-ratio: 1536 / 1024;
  overflow: clip;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

#char-frame-img {
  position: absolute;
  top: -25px;
  left: -15px;
  width: calc(100% + 30px);
  height: calc(100% + 50px);
  object-fit: fill;
  z-index: 0;
  pointer-events: none;
}

.window-frame-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 0;
  pointer-events: none;
}

/* Windows with frame images need relative positioning and content above frame */
.game-window:has(.window-frame-img) {
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  overflow: hidden;
}

.game-window:has(.window-frame-img) .window-header,
.game-window:has(.window-frame-img) .window-body {
  position: relative;
  z-index: 2;
}

#character-window .window-header {
  position: relative;
  z-index: 2;
  border-bottom: none;
  padding: 14px 24px 4px;
  margin-top: 80px;
  transform: scale(0.80);
  transform-origin: top center;
}

#character-window .window-title {
  color: #3b2e1a;
  text-shadow: 0 1px 2px rgba(255,245,220,0.5);
}

#character-window .window-close {
  color: rgba(60,40,20,0.5);
  font-size: 72px;
  width: 88px;
  height: 88px;
}
#character-window .window-close:hover {
  color: #8b0000;
  background: rgba(139,0,0,0.1);
}

#character-window .window-body {
  position: relative;
  z-index: 2;
  overflow: visible;
  padding: 4px 32px 16px;
  margin-top: 45px;
  transform: scale(0.80);
  transform-origin: top center;
}

#char-name-display {
  text-align: center;
  color: #3b2e1a;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font);
  margin-bottom: 1px;
  text-shadow: 0 1px 2px rgba(255,245,220,0.4);
}

#char-level-display {
  text-align: center;
  color: #5a4630;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

#char-bars { margin-bottom: 8px; }

.char-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}

.bar-label {
  width: 30px;
  font-size: 11px;
  font-weight: 700;
  color: #5a4630;
  text-align: right;
  text-shadow: 0 1px 2px rgba(255,245,220,0.3);
}

.char-bar {
  flex: 1;
  height: 14px;
  background: rgba(60,45,25,0.25);
  border: 1px solid rgba(100,80,50,0.3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.char-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.hp-bar-fill { background: linear-gradient(90deg, var(--hp), var(--hp-light)); }
.mp-bar-fill { background: linear-gradient(90deg, var(--mp), var(--mp-light)); }
.exp-bar-fill { background: linear-gradient(90deg, var(--exp), var(--exp-light)); }

.bar-text {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 4px rgba(0,0,0,0.5);
}

/* ── Equipment Layout: Slots around silhouette ── */
#char-content-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 6px;
}
#char-equip-section {
  flex: 0 0 280px;
  width: 280px;
  min-width: 0;
}
#char-equip-layout {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 6px;
  padding: 8px 4px;
  background: rgba(60,45,25,0.15);
  border: 1px solid rgba(100,80,50,0.2);
  border-radius: var(--radius);
  position: relative;
}

.equip-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

.equip-col .equip-slot {
  width: 53px;
  min-height: 53px;
  padding: 3px;
}

#char-silhouette {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  position: relative;
}

#char-silhouette-svg {
  width: 100%;
  max-width: 120px;
  height: auto;
  opacity: 0.5;
  filter: drop-shadow(0 0 8px rgba(100,80,50,0.15));
}

/* Bottom equipment row - full width above content row */
#char-equip-bottom {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 6px;
  padding: 6px;
  background: rgba(60,45,25,0.15);
  border: 1px solid rgba(100,80,50,0.2);
  border-radius: var(--radius);
}

#char-equip-bottom .equip-slot {
  min-height: 48px;
  padding: 3px 2px;
  overflow: hidden;
  min-width: 0;
}

/* Equipment slot base */
.equip-slot {
  background: rgba(60,45,25,0.2);
  border: 2px solid rgba(100,80,50,0.25);
  border-radius: var(--radius-sm);
  padding: 5px 2px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

.equip-slot:hover {
  background: rgba(180,150,80,0.2);
  border-color: rgba(180,150,80,0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(180,150,80,0.15);
}

.equip-slot .equip-placeholder {
  font-size: 20px;
  opacity: 0.2;
  line-height: 1;
}

.equip-slot.equipped .equip-placeholder {
  opacity: 1;
}

.equip-slot .equip-name {
  font-size: 7px;
  color: rgba(60,40,20,0.5);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  max-width: 100%;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
}

.equip-item-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: auto;
}

/* Stats - compact grid */
#char-stats {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  padding: 8px 10px;
  background: rgba(60,45,25,0.12);
  border-radius: var(--radius);
  border: 1px solid rgba(100,80,50,0.2);
  align-self: stretch;
  overflow: visible;
}

.stat-section-title {
  grid-column: 1 / -1;
  font-size: 17px;
  color: #7d3c00;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 0 2px;
  border-bottom: 1px solid rgba(100,80,50,0.3);
  margin-bottom: 1px;
  text-shadow: 0 1px 2px rgba(255,245,220,0.3);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 4px;
  border-radius: 3px;
  transition: background 0.15s;
}
.stat-row:hover {
  background: rgba(180,150,80,0.1);
}

.stat-name {
  font-size: 17px;
  color: #5a4630;
  font-weight: 600;
}

/* Attribute tooltip on hover */
.stat-attr-tip {
  cursor: help;
  position: relative;
  border-bottom: 1px dotted #a08050;
}
.stat-attr-tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  background: rgba(30, 20, 10, 0.95);
  color: #f0e6c8;
  font-size: 12px;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 5px;
  border: 1px solid rgba(180,140,40,0.5);
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.stat-val {
  font-size: 17px;
  color: #3b2e1a;
  font-weight: 700;
}
.stat-val.stat-positive { color: #2e7d32; }
.stat-val.stat-pct { color: #6a1b9a; }

/* Stat point allocation */
#stat-points-bar {
  background: linear-gradient(135deg, rgba(180,140,40,0.2), rgba(160,120,30,0.15));
  border: 2px solid rgba(180,140,40,0.4);
  border-radius: 5px;
  padding: 4px 8px;
  margin-bottom: 6px;
  text-align: center;
  font-size: 11px;
  color: #7d5a00;
  animation: statPointsPulse 2s ease-in-out infinite;
}
#stat-points-bar.hidden { display:none; }
@keyframes statPointsPulse {
  0%,100% { border-color: rgba(180,140,40,0.4); }
  50% { border-color: rgba(180,140,40,0.7); }
}
#stat-points-bar b { color: #b8860b; font-size: 13px; }

.stat-add-btn {
  background: rgba(46,125,50,0.15);
  border: 2px solid rgba(46,125,50,0.35);
  color: #2e7d32;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.stat-add-btn:hover {
  background: rgba(46,125,50,0.3);
  border-color: #2e7d32;
  transform: scale(1.1);
}
.stat-add-btn.hidden { display:none; }

/* Legacy equipment styles (kept for compatibility) */
.equip-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.equip-grid-20 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

/* =========================================
   INVENTORY WINDOW
   ========================================= */
#inventory-window {
  top: 100px; right: 50px; left: auto;
  width: 640px;
  aspect-ratio: 1536 / 1024;
  overflow: clip;
  transform-origin: top right;
  animation: none;
}

#inventory-window .window-header {
  position: relative;
  z-index: 10;
  cursor: move;
  padding: 18px 20px 14px 60px;
  border-bottom: none;
  min-height: 40px;
  width: 100%;
  box-sizing: border-box;
}

#inventory-window .window-title {
  color: transparent;
  pointer-events: none;
}

#inventory-window .window-close {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 20;
  color: rgba(120,80,30,0.8);
  font-size: 22px;
  font-weight: 700;
  width: 26px;
  height: 26px;
  background: rgba(200,170,100,0.3);
  border: 1px solid rgba(160,120,40,0.4);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}

#inventory-window .window-close:hover {
  background: rgba(180,60,60,0.4);
  color: #c0392b;
  border-color: rgba(180,60,60,0.5);
}

#inventory-window .window-body {
  overflow: visible !important;
  max-height: none !important;
  padding: 12px 8px 10px;
  scrollbar-width: none;
}

/* ---- Skills Window ---- */
#skills-window {
  top: 30px; left: 50px; right: auto;
  width: 700px !important;
  min-width: 700px !important;
  height: 467px !important;
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  animation: none;
  position: absolute;
}

#skills-window .window-frame-img {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill;
  z-index: 1 !important;
  pointer-events: none;
}

#skills-window .window-header {
  position: absolute !important;
  top: 0; left: 0; right: 0;
  z-index: 5 !important;
  cursor: move;
  padding: 10px 16px 4px 50px;
  border-bottom: none !important;
  background: transparent !important;
  min-height: 30px;
}

#skills-window .window-title {
  color: transparent !important;
  pointer-events: none;
  font-size: 0;
}

#skills-window .window-close {
  position: absolute;
  top: 8px;
  right: 20px;
  z-index: 20 !important;
  color: rgba(120,80,30,0.9);
  font-size: 20px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  background: rgba(200,170,100,0.4);
  border: 1px solid rgba(160,120,40,0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}

#skills-window .window-close:hover {
  background: rgba(180,60,60,0.4);
  color: #c0392b;
  border-color: rgba(180,60,60,0.5);
}

#skills-window .window-body {
  position: absolute !important;
  top: 95px; left: 75px; right: 75px; bottom: 65px;
  z-index: 5 !important;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent !important;
  max-height: none !important;
  padding: 10px;
  scrollbar-width: none;
}

#skills-window .window-body::-webkit-scrollbar { width: 0; }

#skills-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 3-column layout for skill categories */
.skills-columns {
  display: flex;
  gap: 8px;
  width: 100%;
}

.skills-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.skills-col-header {
  font-size: 10px;
  font-weight: 700;
  color: #3b2e1a;
  text-align: center;
  padding: 3px 4px;
  border-bottom: 1px solid rgba(100,70,30,0.5);
  margin-bottom: 2px;
  background: rgba(120,80,20,0.12);
  border-radius: 3px 3px 0 0;
}

.skill-list-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  background: rgba(80,50,20,0.45);
  border: 1px solid rgba(160,120,40,0.35);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
}

.skill-list-row:hover {
  background: rgba(100,70,30,0.6);
  border-color: rgba(200,160,60,0.5);
}

.skill-list-row.selected {
  background: rgba(120,80,20,0.65);
  border-color: rgba(220,180,60,0.6);
}

.skill-list-icon {
  font-size: 12px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.skill-list-name {
  font-size: 9px;
  font-weight: 600;
  color: #3b2e1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}

/* Tooltip on hover (skill tree rows) */
.skill-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,10,5,0.97);
  color: #e8d8b0;
  border: 1px solid rgba(200,160,60,0.7);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.7);
  min-width: 180px;
}

/* Global skill tooltip (skill bar hover) */
#skill-tooltip-global {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: rgba(15,10,5,0.97);
  color: #e8d8b0;
  border: 1px solid rgba(200,160,60,0.7);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.6;
  min-width: 200px;
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.8);
  font-family: -apple-system, 'Segoe UI', sans-serif;
}
#skill-tooltip-global.hidden { display: none; }
#skill-tooltip-global .stt-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 2px;
}
#skill-tooltip-global .stt-type {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  display: inline-block;
}
#skill-tooltip-global .stt-type.active { background: rgba(200,80,40,0.4); color: #ff9966; }
#skill-tooltip-global .stt-type.buff { background: rgba(60,140,200,0.4); color: #66bbff; }
#skill-tooltip-global .stt-type.passive { background: rgba(60,180,80,0.4); color: #66ff88; }
#skill-tooltip-global .stt-desc {
  font-size: 10px;
  color: #c8b890;
  font-style: italic;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(200,160,60,0.2);
  padding-bottom: 6px;
}
#skill-tooltip-global .stt-stats {
  font-size: 10px;
  color: #d8c8a0;
}
#skill-tooltip-global .stt-stats div {
  margin: 2px 0;
}
#skill-tooltip-global .stt-stats .stt-label {
  color: #a09070;
  margin-right: 4px;
}
#skill-tooltip-global .stt-stats .stt-val {
  color: #fff;
  font-weight: 600;
}
#skill-tooltip-global .stt-stats .stt-val.dmg { color: #ff6644; }
#skill-tooltip-global .stt-stats .stt-val.mana { color: #44aaff; }
#skill-tooltip-global .stt-stats .stt-val.cd { color: #ffcc44; }
#skill-tooltip-global .stt-level {
  font-size: 9px;
  color: #a09070;
  margin-top: 6px;
  border-top: 1px solid rgba(200,160,60,0.2);
  padding-top: 4px;
}
#skill-tooltip-global .stt-next {
  font-size: 9px;
  color: #88cc88;
  margin-top: 2px;
}

.skill-assign-hint {
  display: none;
  font-size: 9px;
  color: var(--gold);
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(56,142,184,0.15);
  border-radius: 4px;
  text-align: center;
}

.skill-assign-hint.active {
  display: block;
}

/* ── Inventory Filter Panel ── */
#inv-filter-toggle {
  position: absolute;
  top: 8px;
  right: 42px;
  z-index: 20;
  color: rgba(200,170,100,0.9);
  font-size: 14px;
  width: 26px;
  height: 26px;
  background: rgba(200,170,100,0.15);
  border: 1px solid rgba(160,120,40,0.4);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
#inv-filter-toggle:hover {
  background: rgba(200,170,100,0.35);
  border-color: rgba(200,170,100,0.6);
}
#inv-filter-toggle.active {
  background: rgba(200,170,100,0.4);
  border-color: rgba(200,170,100,0.7);
  box-shadow: 0 0 6px rgba(200,170,100,0.3);
}

#inv-filter-panel {
  position: relative;
  z-index: 15;
  background: rgba(30,22,12,0.92);
  border-bottom: 1px solid rgba(160,120,40,0.35);
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(4px);
  top: 260px;
  margin-bottom: -4px;
}
#inv-filter-panel.hidden { display: none; }

.inv-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.inv-filter-label {
  color: #c8a030;
  font-size: 10px;
  font-weight: 600;
  min-width: 58px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.inv-filter-checks {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.inv-filter-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 480px;
}
.inv-fchk {
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: all 0.12s;
  font-size: 9px;
  font-weight: 600;
}
.inv-fchk:hover {
  background: rgba(200,170,100,0.15);
  border-color: rgba(200,170,100,0.3);
}
.inv-fchk input[type="checkbox"] {
  display: none;
}
.inv-fchk.checked {
  background: rgba(200,170,100,0.25);
  border-color: rgba(200,170,100,0.5);
  box-shadow: 0 0 4px rgba(200,170,100,0.2);
}
.inv-filter-num {
  width: 36px;
  height: 20px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(160,120,40,0.4);
  border-radius: 3px;
  color: #e8c878;
  font-size: 11px;
  text-align: center;
  outline: none;
}
.inv-filter-num:focus {
  border-color: rgba(200,170,100,0.7);
}
.inv-filter-btn {
  padding: 2px 10px;
  font-size: 9px;
  font-weight: 600;
  background: rgba(180,60,60,0.3);
  border: 1px solid rgba(180,60,60,0.5);
  color: #ff8866;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s;
}
.inv-filter-btn:hover {
  background: rgba(180,60,60,0.5);
}

.inv-slot.inv-filtered-out {
  opacity: 0.12;
  pointer-events: none;
  filter: grayscale(100%);
}

#inventory-gold {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 8px;
  background: transparent;
  border: none;
  position: relative;
  top: 270px;
  margin-top: -5px;
  margin-bottom: 4px;
  font-size: 10px;
  color: #e8c878;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  transform: translateX(-68px);
}

#gold-amount {
  font-weight: 700;
  font-size: 16px;
  color: #c8a030;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

#inventory-grid {
  display: grid;
  grid-template-columns: repeat(15, 32px);
  grid-auto-rows: 32px;
  gap: 2px;
  margin: 0 auto;
  width: fit-content;
  max-height: 236px;
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateY(-5px) translateX(7px);
  scrollbar-width: thin;
  scrollbar-color: rgba(160,120,50,0.6) rgba(0,0,0,0.15);
}

.inv-slot {
  width: 32px;
  height: 32px;
  background: linear-gradient(145deg, rgba(180,150,100,0.35), rgba(120,90,50,0.5));
  border: 1px solid rgba(160,120,50,0.5);
  border-top-color: rgba(200,170,100,0.5);
  border-left-color: rgba(200,170,100,0.4);
  border-bottom-color: rgba(90,60,20,0.6);
  border-right-color: rgba(90,60,20,0.5);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
  font-size: 11px;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255,230,150,0.12), inset 0 -1px 2px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
}

.inv-slot:hover {
  background: linear-gradient(145deg, rgba(220,190,130,0.5), rgba(160,120,60,0.6));
  border-color: rgba(220,180,80,0.7);
  box-shadow: inset 0 1px 1px rgba(255,230,150,0.2), inset 0 -1px 2px rgba(0,0,0,0.2), 0 0 5px rgba(200,160,60,0.3);
}

.inv-slot.has-item {
  border-color: rgba(160,120,40,0.35);
}

.inv-slot[data-rarity="common"].has-item { border: 2px solid #a0a0a0; }
.inv-slot[data-rarity="uncommon"].has-item { border: 2px solid #4fc34f; box-shadow: 0 0 5px rgba(79,195,79,0.4), inset 0 0 4px rgba(79,195,79,0.15); }
.inv-slot[data-rarity="rare"].has-item { border: 2px solid #3d9eff; box-shadow: 0 0 6px rgba(61,158,255,0.5), inset 0 0 4px rgba(61,158,255,0.15); }
.inv-slot[data-rarity="epic"].has-item { border: 2px solid #c76bff; box-shadow: 0 0 8px rgba(199,107,255,0.5), inset 0 0 5px rgba(199,107,255,0.2); }
.inv-slot[data-rarity="legendary"].has-item { border: 2px solid #ff9f00; box-shadow: 0 0 10px rgba(255,159,0,0.6), 0 0 20px rgba(255,159,0,0.2), inset 0 0 6px rgba(255,159,0,0.2); }
.inv-slot[data-rarity="mythic"].has-item { border: 2px solid #ff4444; box-shadow: 0 0 10px rgba(255,68,68,0.6), 0 0 20px rgba(255,68,68,0.25), inset 0 0 6px rgba(255,68,68,0.2); }

.inv-item-icon {
  width: 85%;
  height: 85%;
  object-fit: contain;
  pointer-events: none;
  image-rendering: auto;
}

.inv-item-emoji {
  font-size: 20px;
  pointer-events: none;
}

.inv-slot .item-count {
  position: absolute;
  bottom: 1px; right: 3px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Equipment slot styling */
.equip-slot.equipped {
  border-color: rgba(79,195,247,0.25);
}
.equip-slot[data-rarity="uncommon"].equipped { border: 2px solid #4fc34f; box-shadow: 0 0 5px rgba(79,195,79,0.4); }
.equip-slot[data-rarity="rare"].equipped { border: 2px solid #3d9eff; box-shadow: 0 0 6px rgba(61,158,255,0.5); }
.equip-slot[data-rarity="epic"].equipped { border: 2px solid #c76bff; box-shadow: 0 0 8px rgba(199,107,255,0.5); }
.equip-slot[data-rarity="legendary"].equipped { border: 2px solid #ff9f00; box-shadow: 0 0 10px rgba(255,159,0,0.6), 0 0 20px rgba(255,159,0,0.2); }
.equip-slot[data-rarity="mythic"].equipped { border: 2px solid #ff4444; box-shadow: 0 0 10px rgba(255,68,68,0.6), 0 0 20px rgba(255,68,68,0.25); }

.equip-item-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  image-rendering: auto;
}

/* Global Rich Tooltip (positioned in JS) */
.item-tooltip-global {
  position: fixed;
  z-index: 200;
  background: rgba(13,27,42,0.96);
  border: 2px solid rgba(79,195,247,0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 160px;
  max-width: 260px;
  pointer-events: none;
  backdrop-filter: blur(16px);
  font-family: inherit;
  box-shadow: 0 6px 30px rgba(0,0,0,0.6), 0 0 8px rgba(56,142,184,0.1);
}
.item-tooltip-global.hidden { display: none; }

.tt-header {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
}
.tt-rarity {
  font-size: 10px;
  opacity: 0.8;
  margin-bottom: 4px;
  text-transform: capitalize;
}
.tt-type {
  font-size: 10px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 2px;
}
.tt-equip-slot {
  font-size: 10px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 6px;
}
.tt-stats {
  border-top: 2px solid rgba(79,195,247,0.2);
  padding-top: 5px;
  margin-bottom: 5px;
}
.tt-stat {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  line-height: 1.6;
}
.tt-stat-label {
  color: rgba(255,255,255,0.85);
}
.tt-stat-val {
  font-weight: 600;
  color: #ffffff;
}
/* ── Stat Grade Badges ── */
.tt-grade-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 900;
  padding: 0 3px;
  border-radius: 3px;
  margin-left: 3px;
  letter-spacing: 0.5px;
  vertical-align: middle;
  line-height: 14px;
  color: #1a1a2e;
}
.tt-grade-d {
  background: #6b7280;
  color: #ccc;
  text-shadow: none;
}
.tt-grade-c {
  background: #22c55e;
  color: #0a2e14;
  text-shadow: 0 0 2px rgba(34,197,94,0.4);
}
.tt-grade-b {
  background: #3b82f6;
  color: #0a1a3e;
  text-shadow: 0 0 2px rgba(59,130,246,0.4);
}
.tt-grade-a {
  background: #a855f7;
  color: #1a0a2e;
  text-shadow: 0 0 2px rgba(168,85,247,0.4);
  box-shadow: 0 0 4px rgba(168,85,247,0.3);
}
.tt-grade-s {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  text-shadow: 0 0 2px rgba(255,215,0,0.5);
  box-shadow: 0 0 5px rgba(255,215,0,0.4);
  animation: gradeSPulse 2s ease-in-out infinite;
}
.tt-grade-ss {
  background: linear-gradient(135deg, #ff4444, #ff0080, #ff4444);
  background-size: 200% 200%;
  color: #fff;
  text-shadow: 0 0 4px rgba(255,0,128,0.8);
  box-shadow: 0 0 6px rgba(255,0,128,0.5);
  animation: gradeSSPulse 1.5s ease-in-out infinite, gradeSSShift 3s ease-in-out infinite;
}
@keyframes gradeSPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255,215,0,0.4); }
  50% { box-shadow: 0 0 8px rgba(255,215,0,0.8); }
}
@keyframes gradeSSPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255,0,128,0.5); }
  50% { box-shadow: 0 0 12px rgba(255,0,128,0.9); }
}
@keyframes gradeSSShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.tt-reqs {
  font-size: 10px;
  color: #ffb74d;
  margin-top: 4px;
  border-top: 2px solid rgba(56,142,184,0.15);
  padding-top: 4px;
}
.tt-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
  font-style: italic;
}
.tt-qty {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  margin-top: 3px;
}
.tt-hint {
  font-size: 9px;
  color: rgba(255,255,255,0.45);
  margin-top: 6px;
  border-top: 2px solid rgba(56,142,184,0.1);
  padding-top: 4px;
  text-align: center;
}

/* Comparison tooltip styles */
.tt-stat-up {
  color: #4fc34f;
  font-size: 10px;
  font-weight: bold;
  margin-left: 2px;
}
.tt-stat-down {
  color: #ff4444;
  font-size: 10px;
  font-weight: bold;
  margin-left: 2px;
}
.tt-comparison-divider {
  border-top: 1px dashed rgba(56,142,184,0.4);
  margin: 6px 0;
}
.tt-comparison-header {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 4px;
  font-weight: bold;
}
.tt-eq-stats .tt-stat-val {
  color: #ccc !important;
}

/* Auction sell slot drag hover */
.auction-sell-slot.drag-hover {
  border-color: #4fc3f7 !important;
  background: rgba(79, 195, 247, 0.15) !important;
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.4);
}

/* =========================================
   LOADING SCREEN
   ========================================= */
/* ── Reconnect Overlay ── */
#reconnect-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
#reconnect-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
#reconnect-content {
  text-align: center;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
}
#reconnect-spinner {
  width: 48px; height: 48px;
  margin: 0 auto 18px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #ffcc00;
  border-radius: 50%;
  animation: reconnect-spin 0.8s linear infinite;
}
@keyframes reconnect-spin {
  to { transform: rotate(360deg); }
}
#reconnect-title {
  font-size: 16px;
  color: #ff6b6b;
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(255,107,107,0.6);
}
#reconnect-text {
  font-size: 11px;
  color: #ccc;
  margin-bottom: 8px;
}
#reconnect-timer {
  font-size: 10px;
  color: #ffcc00;
}

#reconnect-bar-container {
  width: 220px;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  margin: 10px auto 6px;
  overflow: hidden;
}
#reconnect-bar-container.hidden { display: none; }
#reconnect-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ffcc00, #ff9500);
  border-radius: 4px;
  transition: width 0.3s ease;
}

#loading-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url('/gui/background.png') center center / cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: opacity 0.6s ease;
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

#loading-content {
  text-align: center;
  width: 320px;
}

#loading-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

#loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(240,215,140,0.15);
  border-top: 3px solid #f0d78c;
  border-radius: 50%;
  animation: loadingSpin 1s linear infinite;
}

@keyframes loadingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#loading-text {
  color: #f0d78c;
  font-size: 20px;
  font-family: 'Cinzel', 'Georgia', serif;
  font-weight: 500;
  margin-bottom: 20px;
  letter-spacing: 2px;
  text-shadow: 0 0 15px rgba(240,215,140,0.4), 0 2px 6px rgba(0,0,0,0.8);
}

#loading-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(240,215,140,0.2);
}

#loading-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #b8860b, #f0d78c, #b8860b);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(240,215,140,0.4);
}

/* =========================================
   PRELOADER SCREEN
   ========================================= */
#preloader-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0a0e14;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 250;
  transition: opacity 0.6s ease;
}
#preloader-screen.hidden {
  opacity: 0;
  pointer-events: none;
}
#preloader-content {
  text-align: center;
  width: 320px;
}
#preloader-title {
  font-size: 52px;
  color: #f0d78c;
  text-shadow: 0 0 20px rgba(240,215,140,0.5), 0 2px 8px rgba(0,0,0,0.8);
  font-family: 'Cinzel', 'Georgia', serif;
  margin: 0 0 30px 0;
  letter-spacing: 6px;
  animation: preloaderGlow 2.5s ease-in-out infinite;
}
@keyframes preloaderGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(240,215,140,0.3), 0 2px 8px rgba(0,0,0,0.8); }
  50% { text-shadow: 0 0 30px rgba(240,215,140,0.7), 0 2px 12px rgba(0,0,0,0.8); }
}
#preloader-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(240,215,140,0.2);
}
#preloader-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #b8860b, #f0d78c, #b8860b);
  border-radius: 4px;
  transition: width 0.15s ease;
  box-shadow: 0 0 8px rgba(240,215,140,0.4);
}
#preloader-text {
  font-size: 14px;
  color: #8a8470;
  font-family: 'Cinzel', 'Georgia', serif;
  margin: 14px 0 0 0;
  letter-spacing: 2px;
}

/* =========================================
   AUTH & CHARACTER SELECT SCREENS
   ========================================= */
#auth-screen, #charselect-screen, #register-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #0d1117 0%, #111d2e 50%, #0d1117 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  transition: opacity 0.4s;
}

/* ===== Updates Panel on Login Screen ===== */
#updates-panel {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  max-height: 70vh;
  background: rgba(13,17,23,0.92);
  border: 2px solid rgba(180,140,60,0.35);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  z-index: 201;
  overflow: hidden;
}

#updates-header {
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #f0c040;
  background: rgba(180,140,60,0.15);
  border-bottom: 1px solid rgba(180,140,60,0.25);
  cursor: pointer;
  user-select: none;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#updates-header:hover {
  background: rgba(180,140,60,0.25);
}

#updates-toggle-icon {
  font-size: 10px;
  transition: transform 0.2s;
}

#updates-panel.collapsed #updates-toggle-icon {
  transform: rotate(-90deg);
}

#updates-panel.collapsed #updates-body {
  display: none;
}

#updates-body {
  overflow-y: auto;
  padding: 8px 12px;
  flex: 1;
}

#updates-body::-webkit-scrollbar {
  width: 5px;
}
#updates-body::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.2);
}
#updates-body::-webkit-scrollbar-thumb {
  background: rgba(180,140,60,0.4);
  border-radius: 3px;
}

.update-entry {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.update-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.update-version {
  font-size: 13px;
  font-weight: 700;
  color: #4fc3f7;
  margin-bottom: 4px;
}

.update-date {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  font-weight: 400;
  margin-left: 6px;
}

.update-entry ul {
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
}

.update-entry li {
  font-size: 11px;
  color: rgba(240,230,210,0.85);
  line-height: 1.5;
  margin-bottom: 2px;
}

.update-entry li b {
  color: #e8d5a3;
}

@media (max-width: 1100px) {
  #updates-panel {
    position: absolute;
    right: 10px;
    bottom: 10px;
    top: auto;
    transform: none;
    width: 280px;
    max-height: 40vh;
  }
}

#auth-screen.hidden, #charselect-screen.hidden, #register-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

#auth-screen,
#register-screen,
#charselect-screen {
  background: url('/gui/background.png') center center / cover no-repeat;
}

#auth-box, #charselect-box, #register-box {
  position: relative;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  min-width: 650px;
  max-width: 750px;
  width: 90%;
  aspect-ratio: 1536 / 1024;
  backdrop-filter: none;
  box-shadow: none;
}

#register-frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  pointer-events: none;
}

#register-box-content {
  position: relative;
  z-index: 1;
  padding: 20px 120px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

#charselect-frame-img {
  position: absolute;
  inset: 0;
  width: 165%;
  height: 165%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  z-index: 0;
  pointer-events: none;
}

#charselect-box-content {
  position: relative;
  z-index: 1;
  padding: 80px 120px 70px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

#char-list {
  margin: 0 auto 8px;
  width: 58%;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

/* Fantasy scrollbar for char list */
#char-list::-webkit-scrollbar {
  width: 6px;
}
#char-list::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}
#char-list::-webkit-scrollbar-thumb {
  background: rgba(180,140,60,0.5);
  border-radius: 3px;
}
#char-list::-webkit-scrollbar-thumb:hover {
  background: rgba(212,160,23,0.7);
}

#register-box-content input,
#register-box-content .auth-btn,
#register-box-content .auth-switch {
  width: 70%;
  max-width: 320px;
}

#register-title {
  text-align: center;
  color: transparent;
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 20px 0;
  letter-spacing: 2px;
  text-shadow: none;
  pointer-events: none;
  user-select: none;
}

#register-screen input {
  display: block;
  width: 100%;
  padding: 6px 14px;
  margin-bottom: 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #f5e6c8;
  caret-color: #f5e6c8;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: none;
  box-sizing: border-box;
}

#register-screen input:focus {
  color: #f5e6c8;
  background: transparent;
  border: none;
}

#register-screen input::placeholder {
  color: transparent;
}

#register-screen #reg-password2 {
  margin-top: 10px;
  transform: translateY(10px);
}

#register-screen #reg-password {
  transform: translateY(4px);
}

#register-screen #reg-username {
  transform: translateY(-5px);
}

#auth-frame-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 0;
  pointer-events: none;
}

#auth-box-content {
  position: relative;
  z-index: 1;
  padding: 20px 120px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  box-sizing: border-box;
}

#auth-box-content input,
#auth-box-content .auth-btn,
#auth-box-content .auth-switch {
  width: 70%;
  max-width: 320px;
}

#auth-screen #login-username {
  margin-bottom: 21px;
}

#auth-screen #login-password {
  transform: translateY(-5px);
}

#auth-box-content #btn-login {
  padding-left: 22px;
  padding-right: 32px;
  max-width: none;
  width: calc(70% + 125px);
  margin-left: -30px;
  margin-top: 13px;
}

#login-form .auth-switch {
  margin-left: 25px;
}

#register-form .auth-switch {
  transform: translateY(10px);
  white-space: nowrap;
}

#auth-title {
  text-align: center;
  color: transparent;
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 20px 0;
  letter-spacing: 2px;
  text-shadow: none;
  pointer-events: none;
  user-select: none;
}

#auth-screen input, #charselect-screen input {
  display: block;
  width: 100%;
  padding: 6px 14px;
  margin-bottom: 8px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #f5e6c8;
  caret-color: #f5e6c8;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: none;
  box-sizing: border-box;
}

#auth-screen input:focus, #charselect-screen input:focus {
  color: #f5e6c8;
  background: transparent;
  border: none;
}

#auth-screen input::placeholder, #charselect-screen input::placeholder {
  color: transparent;
}

.auth-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: transparent;
  color: transparent;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: none;
  font-family: inherit;
  text-shadow: none;
}

.auth-btn:hover {
  background: transparent;
  transform: none;
}

.auth-btn:active {
  transform: translateY(0);
}

.auth-btn.btn-secondary {
  background: rgba(100,80,50,0.15);
  color: #5a4630;
  margin-top: 6px;
}

.auth-btn.btn-secondary:hover {
  background: rgba(100,80,50,0.25);
  color: #3b2e1a;
}

.auth-btn.btn-new-char {
  background: rgba(100,80,50,0.15);
  color: #8b6914;
  border: none;
  border-bottom: 2px dashed rgba(180,140,60,0.5);
}

.auth-btn.btn-new-char:hover {
  background: rgba(100,80,50,0.25);
}

.auth-switch {
  text-align: center;
  color: #5a4630;
  font-size: 13px;
  margin-top: 14px;
}

.auth-switch a {
  color: #8b6914;
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-msg {
  background: rgba(204, 48, 48, 0.15);
  border: 2px solid rgba(204, 48, 48, 0.3);
  color: #991a1a;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 12px;
  text-align: center;
}

.auth-msg.hidden {
  display: none;
}

#char-create-form {
  position: relative;
  margin: 0 auto;
  width: 58%;
  padding-bottom: 140px;
  box-sizing: border-box;
}

#char-create-form.hidden {
  display: none;
}

#char-create-form:not(.hidden) + #btn-show-create {
  display: none;
}

#char-create-form #new-char-name,
#char-create-form #class-selector {
  width: 100%;
}

#char-create-form #btn-create-char,
#char-create-form #btn-cancel-create {
  width: 250px;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
}

#char-create-form #btn-create-char {
  position: absolute;
  bottom: -147px;
  width: 560px;
  max-width: none;
  color: transparent !important;
  text-shadow: none;
}

#char-create-form #btn-cancel-create {
  position: absolute;
  bottom: -316px;
}

#btn-show-create,
#btn-logout {
  width: 58%;
  margin-left: auto;
  margin-right: auto;
}

#btn-show-create {
  margin-top: auto;
  color: transparent !important;
  text-shadow: none;
}

#btn-logout {
  margin-top: 188px;
}

/* Character create form */
#char-create-form {
  margin-bottom: 12px;
}

#char-create-form #new-char-name {
  margin-bottom: 10px;
  transform: translateY(322px);
}

#char-create-form #class-selector {
  margin-bottom: 8px;
}

#char-create-form #class-selector > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #5a4020;
  text-shadow: 0 1px 0 rgba(255,255,255,0.3);
  margin-bottom: 6px;
}

#char-create-form #class-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#char-create-form .class-opt {
  flex: 1 1 calc(50% - 3px);
  min-width: 120px;
  padding: 8px 10px;
  border: 2px solid rgba(180,140,60,0.5);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(50,35,10,0.85) 0%, rgba(70,50,20,0.75) 100%);
  color: #f5e6c8;
  cursor: pointer;
  text-align: center;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

#char-create-form .class-opt:hover {
  border-color: rgba(212,160,23,0.7);
  background: linear-gradient(135deg, rgba(70,50,15,0.9) 0%, rgba(90,65,25,0.8) 100%);
}

#char-create-form .class-opt.selected {
  border-color: rgba(212,160,23,0.95);
  background: linear-gradient(135deg, rgba(80,55,10,0.9) 0%, rgba(100,70,20,0.85) 100%);
  box-shadow: 0 0 8px rgba(212,160,23,0.3), 0 2px 4px rgba(0,0,0,0.4);
}

#char-create-form .class-opt-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: #f5e6c8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

#char-create-form .class-opt.selected .class-opt-name {
  color: #ffd866;
}

#char-create-form .class-opt-stats {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.2;
  color: rgba(220,200,160,0.9);
  text-shadow: 0 1px 1px rgba(0,0,0,0.5);
}

.char-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 5px;
  background: linear-gradient(135deg, rgba(60,40,15,0.75) 0%, rgba(90,60,20,0.6) 100%);
  border: 1px solid rgba(180,140,60,0.4);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.char-card:hover {
  background: linear-gradient(135deg, rgba(80,55,20,0.85) 0%, rgba(120,80,25,0.7) 100%);
  border-color: rgba(212,160,23,0.7);
  box-shadow: 0 2px 8px rgba(180,140,60,0.25);
}

.char-card-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, rgba(212,160,23,0.3), rgba(180,140,60,0.15));
  border: 1px solid rgba(212,160,23,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: #f5e6c8;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.char-card-info {
  flex: 1;
  min-width: 0;
}

.char-card-name {
  color: #f5e6c8;
  font-weight: 600;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-card-details {
  color: rgba(210,190,150,0.75);
  font-size: 10px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-card-arrow {
  color: rgba(180,140,60,0.6);
  font-size: 14px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.char-card:hover .char-card-arrow {
  color: rgba(212,160,23,0.9);
}

/* =========================================
   XP BAR
   ========================================= */
#xp-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(13,27,42,0.9);
  z-index: 35;
  overflow: hidden;
}

#xp-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--exp), var(--exp-light));
  transition: width 0.4s ease;
}

#xp-bar-text {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #ccc;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

#xp-bar-container:hover #xp-bar-text {
  opacity: 1;
}

#xp-bar-container:hover {
  height: 8px;
}

/* Guild button — now in #side-menu */

/* =========================================
   GUILD WINDOW
   ========================================= */
#guild-window {
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  animation: none;
}

#guild-window .window-body {
  transform: translate(115px, 150px) scale(0.8);
  transform-origin: top left;
}

#guild-window .window-header {
  position: absolute !important;
  top: 0; left: 0; right: 0;
  z-index: 5 !important;
  cursor: move;
  padding: 10px 16px 4px 50px;
  border-bottom: none !important;
  background: transparent !important;
  min-height: 30px;
}

#guild-window .window-title {
  color: transparent !important;
  pointer-events: none;
  font-size: 0;
}

#guild-window .window-close {
  position: absolute;
  top: 10px;
  right: 22px;
  z-index: 20 !important;
  color: rgba(120,80,30,0.9);
  font-size: 22px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  background: rgba(200,170,100,0.4);
  border: 1px solid rgba(160,120,40,0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}

#guild-window .window-close:hover {
  background: rgba(180,60,60,0.4);
  color: #c0392b;
  border-color: rgba(180,60,60,0.5);
}

#guild-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
  border-bottom: 2px solid rgba(120,85,30,0.4);
  padding-bottom: 6px;
}
.guild-tab {
  flex: 1;
  padding: 8px 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #5a4a2e;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  font-family: var(--font);
}
.guild-tab:hover {
  color: #3b2e1a;
  background: rgba(120,85,30,0.1);
}
.guild-tab.active {
  color: #6b4c1a;
  border-bottom-color: #8a6a20;
  background: rgba(138,106,32,0.08);
}
.guild-tab-content {
  display: none;
}
.guild-tab-content.active {
  display: block;
}

/* Guild List */
#guild-list-container {
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(138,106,32,0.3) transparent;
}
.guild-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(200,180,140,0.3);
  border: 2px solid rgba(138,106,32,0.25);
  border-radius: 4px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.12s;
}
.guild-list-item:hover {
  background: rgba(200,180,140,0.5);
  border-color: rgba(138,106,32,0.45);
}
.guild-list-banner {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 2px solid rgba(138,106,32,0.35);
  image-rendering: auto;
  background: rgba(245,235,210,0.7);
  flex-shrink: 0;
}
.guild-list-info {
  flex: 1;
  min-width: 0;
}
.guild-list-name {
  color: #4a3518;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guild-list-meta {
  color: #6a5a3e;
  font-size: 12px;
  margin-top: 2px;
}
.guild-list-btn {
  padding: 5px 12px;
  background: rgba(120,85,30,0.25);
  border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px;
  color: #4a3518;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.12s;
  flex-shrink: 0;
}
.guild-list-btn:hover {
  background: rgba(120,85,30,0.4);
  border-color: rgba(138,106,32,0.6);
}

/* My Guild */
#guild-my-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px;
  background: rgba(200,180,140,0.35);
  border-radius: 4px;
  border: 2px solid rgba(138,106,32,0.3);
}
#guild-my-banner {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  border: 2px solid rgba(138,106,32,0.35);
  image-rendering: auto;
  background: rgba(245,235,210,0.7);
}
#guild-my-name {
  color: #3b2810;
  font-weight: 700;
  font-size: 16px;
  text-shadow: 0 1px 0 rgba(255,245,220,0.4);
}
#guild-my-level, #guild-my-members-count {
  color: #6a5a3e;
  font-size: 12px;
  margin-top: 2px;
}
#guild-my-announcement-section {
  padding: 8px 10px;
  background: rgba(200,180,140,0.25);
  border-radius: 4px;
  border: 2px solid rgba(138,106,32,0.2);
  margin-bottom: 8px;
}
#guild-my-announcement-section label {
  color: #5a4a2e;
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
#guild-my-announcement-text {
  color: #3b2e1a;
  font-size: 13px;
  min-height: 16px;
  word-break: break-word;
}
#guild-ann-edit {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
#guild-ann-input {
  flex: 1;
  background: rgba(245,235,210,0.7);
  border: 2px solid rgba(138,106,32,0.35);
  border-radius: 4px;
  color: #3b2e1a;
  padding: 5px 8px;
  font-size: 12px;
  font-family: var(--font);
  outline: none;
}
#guild-my-rank {
  color: #5a4a2e;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 4px 8px;
}

/* Guild Members List */
#guild-members-list {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(138,106,32,0.3) transparent;
  margin-bottom: 8px;
}
.guild-member-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 2px solid rgba(138,106,32,0.15);
  font-size: 13px;
}
.guild-member-row:last-child { border-bottom: none; }
.guild-member-name {
  flex: 1;
  color: #3b2e1a;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guild-member-rank {
  color: #6a5a3e;
  font-size: 12px;
  min-width: 60px;
  text-align: right;
}
.guild-member-rank.rank-leader { color: #8a6a20; font-weight: 700; }
.guild-member-rank.rank-vice { color: #4a7a3e; font-weight: 600; }
.guild-member-rank.rank-oficial { color: #5a6a2e; font-weight: 600; }
.guild-member-level {
  color: #6a5a3e;
  font-size: 12px;
  min-width: 36px;
}
.guild-member-actions {
  display: flex;
  gap: 3px;
}
.guild-member-btn {
  background: none;
  border: none;
  border-radius: 4px;
  color: #5a4a2e;
  font-size: 11px;
  padding: 2px 6px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.12s;
}
.guild-member-btn:hover { color: #3b2e1a; background: rgba(120,85,30,0.15); }
.guild-member-btn.kick:hover { color: #8b2020; background: rgba(204,48,48,0.1); }

/* Guild Actions */
#guild-my-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.guild-action-btn {
  padding: 8px 16px;
  background: rgba(120,85,30,0.25);
  border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px;
  color: #4a3518;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: all 0.12s;
}
.guild-action-btn:hover {
  background: rgba(120,85,30,0.4);
  border-color: rgba(138,106,32,0.6);
  color: #3b2810;
}
.guild-action-btn.danger {
  background: rgba(204,48,48,0.08);
  color: var(--red);
  border-color: rgba(204,48,48,0.15);
}
.guild-action-btn.danger:hover {
  background: rgba(204,48,48,0.18);
  border-color: rgba(204,48,48,0.3);
}
.guild-small-btn {
  padding: 4px 12px;
  background: rgba(120,85,30,0.15);
  border: 2px solid rgba(138,106,32,0.35);
  border-radius: 4px;
  color: #4a3518;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: all 0.12s;
}
.guild-small-btn:hover {
  background: rgba(120,85,30,0.3);
  border-color: rgba(138,106,32,0.5);
}

/* Create Guild */
#guild-create-form label {
  display: block;
  color: #3b2e1a;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  margin-top: 10px;
  text-shadow: 0 1px 0 rgba(255,245,220,0.4);
}
#guild-create-form label:first-child { margin-top: 0; }
#guild-create-name {
  width: 100%;
  background: rgba(245,235,210,0.7);
  border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px;
  color: #3b2e1a;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  box-sizing: border-box;
}
#guild-create-name:focus {
  background: rgba(245,235,210,0.9);
  border-color: rgba(138,106,32,0.7);
  box-shadow: 0 0 4px rgba(138,106,32,0.3);
}
#guild-create-btn {
  width: 100%;
  margin-top: 10px;
}

/* Banner Designer */
#guild-banner-designer {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  padding: 10px;
  background: rgba(200,180,140,0.3);
  border-radius: 4px;
  border: 2px solid rgba(138,106,32,0.3);
}
#guild-banner-canvas {
  border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px;
  image-rendering: pixelated;
  cursor: crosshair;
  background: rgba(245,235,210,0.85);
  width: 128px;
  height: 128px;
}
#guild-banner-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
#guild-banner-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.banner-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid rgba(138,106,32,0.3);
  cursor: pointer;
  transition: transform 0.1s;
}
.banner-color:hover { transform: scale(1.15); }
.banner-color.active {
  border-color: #6b4c1a;
  box-shadow: 0 0 4px rgba(138,106,32,0.5);
  transform: scale(1.15);
}
#guild-banner-shapes {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.banner-tool {
  width: 28px;
  height: 28px;
  background: rgba(200,180,140,0.2);
  border: 2px solid rgba(138,106,32,0.25);
  border-radius: 4px;
  color: #3b2e1a;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.banner-tool:hover { background: rgba(120,85,30,0.2); }
.banner-tool.active {
  background: rgba(120,85,30,0.3);
  box-shadow: 0 0 0 1px #6b4c1a;
}

/* Guild Invite Popup */
#guild-invite-popup {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(13,27,42,0.96);
  border: 2px solid rgba(79,195,247,0.25);
  border-radius: var(--radius);
  padding: 16px 20px;
  z-index: 100;
  text-align: center;
  min-width: 220px;
  box-shadow: 0 0 20px rgba(56,142,184,0.15);
}
#guild-invite-text {
  color: var(--text);
  font-size: 12px;
  margin-bottom: 10px;
}
#guild-invite-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Guild name tag on players */
.guild-tag {
  color: var(--gold);
  font-size: 9px;
}

/* Ranking button — now in #side-menu */

/* =========================================
   RANKING WINDOW
   ========================================= */
#ranking-window {
  top: 30px; left: calc(50% - 500px);
  width: 1000px !important;
  min-width: 1000px !important;
  height: 667px !important;
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  animation: none;
  position: absolute;
}

#ranking-window .window-frame-img {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill;
  z-index: 1 !important;
  pointer-events: none;
}

#ranking-window .window-header {
  position: absolute !important;
  top: 0; left: 0; right: 0;
  z-index: 5 !important;
  cursor: move;
  padding: 10px 16px 4px 50px;
  border-bottom: none !important;
  background: transparent !important;
  min-height: 30px;
}

#ranking-window .window-title {
  color: transparent !important;
  pointer-events: none;
  font-size: 0;
}

#ranking-window .window-close {
  position: absolute;
  top: 8px;
  right: 20px;
  z-index: 20 !important;
  color: rgba(120,80,30,0.9);
  font-size: 20px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  background: rgba(200,170,100,0.4);
  border: 1px solid rgba(160,120,40,0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}

#ranking-window .window-close:hover {
  background: rgba(180,60,60,0.4);
  color: #c0392b;
  border-color: rgba(180,60,60,0.5);
}

#ranking-window .window-body {
  position: absolute !important;
  top: 8.2%; left: 6.5%; right: 15.5%; bottom: 8.2%;
  transform: translate(7.7%, 13.5%);
  z-index: 5 !important;
  overflow-y: hidden;
  overflow-x: hidden;
  background: transparent !important;
  max-height: none !important;
  padding: 10px;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
}

#ranking-window .window-body::-webkit-scrollbar { width: 0; }

#ranking-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(100,70,30,0.4);
  padding-bottom: 4px;
}
.ranking-tab {
  flex: 1;
  padding: 4px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: #6a5a3e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all 0.15s;
}
.ranking-tab:hover { color: #5a3a10; }
.ranking-tab.active {
  color: #3b2e1a;
  border-bottom-color: #8a6a20;
  background: none;
}
#ranking-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.ranking-row {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(100,70,30,0.2);
  font-size: 11px;
  gap: 6px;
}
.ranking-row:hover {
  background: rgba(120,80,20,0.15);
}
.ranking-row.header {
  font-weight: 700;
  color: #5a4a2e;
  border-bottom: 1px solid rgba(100,70,30,0.4);
  font-size: 10px;
}
.ranking-pos {
  width: 24px;
  text-align: center;
  font-weight: 700;
  color: #6a5a3e;
}
.ranking-pos.top1 { color: #b8860b; font-size: 13px; }
.ranking-pos.top2 { color: #808080; font-size: 12px; }
.ranking-pos.top3 { color: #8b4513; font-size: 12px; }
.ranking-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #3b2e1a;
}
.ranking-guild {
  width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5a3a10;
  font-size: 10px;
}
.ranking-value {
  width: 60px;
  text-align: right;
  font-weight: 700;
  color: #4a6a8a;
}
.ranking-value.gold-val {
  color: #8a6a20;
}
#ranking-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 0 2px;
  margin-top: 8px;
  position: static;
  transform: translateY(-160px);
}
.ranking-page-btn {
  background: rgba(110,70,20,0.65);
  border: 1px solid rgba(85,55,18,0.85);
  color: #f6e3b4;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(40,25,8,0.7);
  transition: all 0.15s;
}
.ranking-page-btn:hover {
  background: rgba(130,85,25,0.82);
  border-color: rgba(95,60,20,0.95);
  color: #ffefc8;
}
.ranking-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#ranking-page-info {
  color: #5a4a2e;
  font-size: 10px;
}

/* Refine button — now in #side-menu */

/* =========================================
   REFINE WINDOW
   ========================================= */
#refine-level-info {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
#refine-level-info span {
  color: #cc88ff;
  font-weight: 700;
}
#refine-exp-bar {
  width: 100%;
  height: 6px;
  background: rgba(13,27,42,0.7);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 2px solid rgba(56,142,184,0.15);
}
#refine-exp-fill {
  height: 100%;
  background: linear-gradient(90deg, #9944cc, #bb77ff);
  border-radius: 4px;
  width: 0%;
  transition: width 0.4s ease;
}
#refine-slots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}
.refine-slot {
  width: 52px;
  height: 52px;
  background: rgba(13,27,42,0.7);
  border: 2px dashed rgba(79,195,247,0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  font-size: 11px;
  color: rgba(255,255,255,0.08);
}
.refine-slot:hover {
  border-color: rgba(79,195,247,0.3);
  background: rgba(56,142,184,0.1);
}
.refine-slot.item-slot {
  width: 62px;
  height: 62px;
  border-color: rgba(56,142,184,0.4);
  border-style: solid;
  border-width: 2px;
  border-radius: 4px;
}
.refine-slot.item-slot:hover {
  border-color: rgba(79,195,247,0.6);
}
.refine-slot.filled {
  border-style: solid;
  border-color: rgba(79,195,247,0.5);
  background: rgba(56,142,184,0.1);
}
.refine-slot .slot-icon {
  width: 40px;
  height: 40px;
  image-rendering: auto;
}
.refine-slot.item-slot .slot-icon {
  width: 48px;
  height: 48px;
}
.refine-slot .slot-clear {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: var(--red);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.refine-action-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, rgba(79,195,247,0.5), rgba(79,195,247,0.5));
  border: 2px solid rgba(79,195,247,0.3);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  margin-top: 8px;
}
.refine-action-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(79,195,247,0.6), rgba(79,195,247,0.65));
  border-color: rgba(79,195,247,0.6);
  transform: scale(1.02);
}
.refine-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#refine-result {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  animation: refineFlash 0.5s ease;
}
#refine-result.success {
  background: rgba(76,175,80,0.12);
  border: 2px solid rgba(76,175,80,0.2);
  color: #7df07d;
}
#refine-result.fail {
  background: rgba(204,48,48,0.12);
  border: 2px solid rgba(204,48,48,0.2);
  color: #991a1a;
}
@keyframes refineFlash {
  0% { transform: scale(0.95); opacity: 0; }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}

/* Pet button — now in #side-menu */

/* =========================================
   PET WINDOW
   ========================================= */
#pet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(79,195,247,0.2);
}
#pet-icon-display {
  width: 52px;
  height: 52px;
  background: rgba(56,142,184,0.15);
  border: 2px solid rgba(56,142,184,0.3);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
#pet-icon-display img {
  width: 40px;
  height: 40px;
  image-rendering: auto;
}
#pet-exp-bar {
  width: 100%;
  height: 8px;
  background: rgba(13,27,42,0.7);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
  border: 2px solid rgba(56,142,184,0.15);
}
#pet-exp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--exp), var(--exp-light));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.pet-stat-title {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  margin-top: 10px;
}
#pet-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 12px;
}
.pet-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 4px;
}
.pet-stat-row:hover {
  background: rgba(56,142,184,0.1);
}
.pet-stat-name {
  color: rgba(255,255,255,0.35);
}
.pet-stat-val {
  color: var(--gold);
  font-weight: 600;
}
.pet-action-btn {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, rgba(79,195,247,0.3), rgba(79,195,247,0.4));
  border: 2px solid rgba(56,142,184,0.4);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.pet-action-btn:hover {
  background: linear-gradient(135deg, rgba(79,195,247,0.5), rgba(79,195,247,0.55));
  border-color: rgba(79,195,247,0.5);
  transform: scale(1.02);
}
.pet-action-btn.danger {
  background: rgba(204,48,48,0.12);
  color: #991a1a;
  border-color: rgba(204,48,48,0.2);
}
.pet-action-btn.danger:hover {
  background: rgba(204,48,48,0.2);
  border-color: rgba(204,48,48,0.3);
}
#pet-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.pet-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(13,27,42,0.7);
  border: 2px solid rgba(56,142,184,0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}
.pet-list-item:hover {
  background: rgba(56,142,184,0.15);
  border-color: rgba(79,195,247,0.2);
}
.pet-list-item.active {
  background: rgba(79,195,247,0.2);
  border-color: rgba(56,142,184,0.4);
}
.pet-list-icon {
  width: 36px;
  height: 36px;
  background: rgba(56,142,184,0.15);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.pet-list-icon img {
  width: 28px;
  height: 28px;
  image-rendering: auto;
}
.pet-list-info {
  flex: 1;
  min-width: 0;
}
.pet-list-name {
  font-size: 12px;
  font-weight: 600;
  color: #f0f0f0;
}
.pet-list-level {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
}
.pet-list-activate {
  padding: 4px 10px;
  background: rgba(56,142,184,0.3);
  border: 2px solid rgba(79,195,247,0.2);
  border-radius: 4px;
  color: var(--gold);
  font-size: 10px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: all 0.15s;
}
.pet-list-activate:hover {
  background: rgba(79,195,247,0.25);
  border-color: rgba(79,195,247,0.3);
}

/* Shop button — now in #side-menu */

/* =========================================
   SHOP SETUP & BROWSE WINDOWS
   ========================================= */
.shop-stat-title {
  font-size: 11px;
  color: var(--gold);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.shop-slot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.shop-slot-item {
  width: 44px;
  height: 44px;
  background: rgba(13,27,42,0.7);
  border: 1px dashed rgba(79,195,247,0.2);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  position: relative;
}
.shop-slot-item:hover {
  border-color: rgba(79,195,247,0.3);
  background: rgba(56,142,184,0.1);
}
.shop-slot-row.drag-over .shop-slot-item {
  border-color: rgba(79,195,247,0.6);
  background: rgba(79,195,247,0.2);
  box-shadow: 0 0 8px rgba(79,195,247,0.25);
}
.shop-slot-row.drag-over {
  background: rgba(56,142,184,0.08);
  border-radius: 4px;
}
.shop-slot-item.filled {
  border-style: solid;
  border-color: rgba(79,195,247,0.25);
  background: rgba(56,142,184,0.1);
}
.shop-slot-item img {
  width: 32px;
  height: 32px;
  image-rendering: auto;
}
.shop-slot-empty {
  font-size: 18px;
  color: rgba(79,195,247,0.25);
}
.shop-slot-name {
  flex: 1;
  font-size: 11px;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-price-input {
  width: 80px;
  padding: 5px 6px;
  background: rgba(13,27,42,0.7);
  border: 2px solid rgba(79,195,247,0.2);
  border-radius: 4px;
  color: var(--gold);
  font-size: 12px;
  font-family: var(--font);
  text-align: right;
}
.shop-price-input::placeholder {
  color: rgba(56,142,184,0.4);
}
.shop-slot-clear {
  width: 22px;
  height: 22px;
  background: rgba(204,48,48,0.12);
  border: 2px solid rgba(204,48,48,0.15);
  border-radius: 4px;
  color: #991a1a;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  font-family: var(--font);
}
.shop-slot-clear:hover {
  background: rgba(204,48,48,0.25);
  border-color: rgba(204,48,48,0.3);
}
.shop-action-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, rgba(79,195,247,0.3), rgba(79,195,247,0.4));
  border: 2px solid rgba(56,142,184,0.4);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  margin-top: 10px;
}
.shop-action-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(79,195,247,0.5), rgba(79,195,247,0.55));
  border-color: rgba(79,195,247,0.5);
  transform: scale(1.02);
}
.shop-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.shop-action-btn.danger {
  background: rgba(204,48,48,0.12);
  color: #991a1a;
  border-color: rgba(204,48,48,0.2);
}
.shop-action-btn.danger:hover {
  background: rgba(204,48,48,0.2);
  border-color: rgba(204,48,48,0.3);
}

/* Browse window items */
.shop-browse-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(13,27,42,0.7);
  border: 2px solid rgba(56,142,184,0.1);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: all 0.15s;
}
.shop-browse-item:hover {
  background: rgba(56,142,184,0.15);
  border-color: rgba(79,195,247,0.2);
}
.shop-browse-item.sold {
  opacity: 0.35;
  pointer-events: none;
}
.shop-browse-icon {
  width: 38px;
  height: 38px;
  background: rgba(56,142,184,0.1);
  border: 2px solid rgba(79,195,247,0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shop-browse-icon img {
  width: 28px;
  height: 28px;
  image-rendering: auto;
}
.shop-browse-info {
  flex: 1;
  min-width: 0;
}
.shop-browse-name {
  font-size: 12px;
  font-weight: 600;
  color: #f0f0f0;
}
.shop-browse-detail {
  font-size: 10px;
  color: rgba(255,255,255,0.08);
}
.shop-browse-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}
.shop-buy-btn {
  padding: 5px 12px;
  background: rgba(56,142,184,0.3);
  border: 2px solid rgba(79,195,247,0.2);
  border-radius: 4px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
}
.shop-buy-btn:hover {
  background: rgba(79,195,247,0.25);
  border-color: rgba(79,195,247,0.3);
}

/* =========================================
   VIEW PLAYER INFO WINDOW
   ========================================= */
#vp-avatar {
  text-align: center;
  margin-bottom: 6px;
}
#vp-avatar-circle {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(56,142,184,0.15);
  border: 2px solid rgba(79,195,247,0.2);
}
#vp-name {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #f0f0f0;
}
#vp-class-level {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
#vp-stats.vp-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 12px;
  margin: 8px 0;
}
.vp-equip {
  cursor: default !important;
  pointer-events: auto;
}
.vp-equip:hover {
  transform: none !important;
}

/* ======================== */
/* CASH SHOP                */
/* ======================== */
/* Cash shop & boat & auction buttons — now in #side-menu */

/* ── Auction House Window ── */
#auction-window {
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  animation: none;
}

#auction-window .window-frame-img {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill;
  z-index: 1 !important;
  pointer-events: none;
}

#auction-window .window-header {
  position: absolute !important;
  top: 0; left: 0; right: 0;
  z-index: 5 !important;
  cursor: move;
  padding: 10px 16px 4px 50px;
  border-bottom: none !important;
  background: transparent !important;
  min-height: 30px;
}

#auction-window .window-title {
  color: transparent !important;
  pointer-events: none;
  font-size: 0;
}

#auction-window .window-close {
  position: absolute;
  top: 10px;
  right: 22px;
  z-index: 20 !important;
  color: rgba(120,80,30,0.9);
  font-size: 22px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  background: rgba(200,170,100,0.4);
  border: 1px solid rgba(160,120,40,0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}

#auction-window .window-close:hover {
  background: rgba(180,60,60,0.4);
  color: #c0392b;
  border-color: rgba(180,60,60,0.5);
}

#auction-window .window-body {
  position: absolute !important;
  top: 44px; left: 52px; right: 84px; bottom: 44px;
  transform: translate(100px, 100px) scale(0.85);
  transform-origin: top left;
  z-index: 5 !important;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent !important;
  max-height: none !important;
  padding: 0;
  scrollbar-width: none;
}

#auction-window .window-body::-webkit-scrollbar { width: 0; }

#auction-tabs {
  display: flex;
  border-bottom: 2px solid rgba(120,85,30,0.4);
  background: rgba(200,180,140,0.15);
}
.auction-tab {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #5a4a2e;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.auction-tab:hover {
  color: #3b2e1a;
  background: rgba(120,85,30,0.1);
}
.auction-tab.active {
  color: #6b4c1a;
  border-bottom-color: #8a6a20;
  background: rgba(138,106,32,0.08);
}
.auction-tab-content {
  display: none;
}
.auction-tab-content.active {
  display: block;
}

/* ── Buy Tab Layout: sidebar + results ── */
#auction-buy-layout {
  display: flex;
  height: 520px;
}

/* Category sidebar */
#auction-categories {
  width: 120px;
  flex-shrink: 0;
  background: rgba(200,180,140,0.25);
  border-right: 2px solid rgba(138,106,32,0.25);
  padding: 6px 0;
  overflow-y: auto;
}
.auc-cat {
  padding: 8px 12px;
  font-size: 17px;
  color: #5a4a2e;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.auc-cat:hover {
  color: #3b2e1a;
  background: rgba(120,85,30,0.12);
}
.auc-cat.active {
  color: #4a3518;
  background: rgba(138,106,32,0.12);
  border-left-color: #8a6a20;
  font-weight: 700;
}

/* Results panel */
#auction-results-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Search bar */
#auction-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(200,180,140,0.15);
  border-bottom: 2px solid rgba(138,106,32,0.2);
}
.auc-search-label {
  font-size: 17px;
  color: #5a4a2e;
  font-weight: 700;
  white-space: nowrap;
}
#auction-search-input {
  flex: 1;
  background: rgba(245,235,210,0.7);
  color: #3b2e1a;
  border: 2px solid rgba(138,106,32,0.35);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 17px;
  outline: none;
}
#auction-search-input:focus {
  border-color: rgba(138,106,32,0.6);
  background: rgba(245,235,210,0.9);
}
#auction-search-btn,
#auction-reset-btn {
  background: rgba(120,85,30,0.2);
  color: #4a3518;
  border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px;
  padding: 5px 14px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 700;
}
#auction-search-btn:hover {
  background: rgba(120,85,30,0.35);
  border-color: rgba(138,106,32,0.6);
}
#auction-reset-btn {
  color: #8b2020;
  border-color: rgba(180,60,60,0.35);
}
#auction-reset-btn:hover {
  background: rgba(180,60,60,0.15);
  border-color: rgba(180,60,60,0.5);
}

/* Table header */
#auction-table-header {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: rgba(200,180,140,0.2);
  border-bottom: 2px solid rgba(138,106,32,0.25);
  font-size: 17px;
  font-weight: 700;
  color: #4a3518;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  gap: 6px;
}
.ath-icon { width: 36px; flex-shrink: 0; }
.ath-name { flex: 2; min-width: 0; }
.ath-type { width: 80px; flex-shrink: 0; text-align: center; }
.ath-seller { width: 90px; flex-shrink: 0; text-align: center; }
.ath-price { width: 100px; flex-shrink: 0; text-align: right; }
.ath-action { width: 70px; flex-shrink: 0; text-align: center; }

/* Listings grid */
#auction-listings-grid,
#auction-my-listings-grid,
#auction-sold-grid {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(138,106,32,0.3) transparent;
}

.auction-listing-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(138,106,32,0.12);
  transition: background 0.12s;
  cursor: default;
}
.auction-listing-row:nth-child(even) {
  background: rgba(200,180,140,0.1);
}
.auction-listing-row:hover {
  background: rgba(200,180,140,0.25);
}
.auction-listing-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: rgba(245,235,210,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  flex-shrink: 0;
  border: 1px solid rgba(138,106,32,0.25);
}
.auction-listing-icon img {
  width: 30px;
  height: 30px;
  image-rendering: auto;
}
.auction-listing-info {
  flex: 2;
  min-width: 0;
}
.auction-listing-name {
  font-size: 17px;
  font-weight: 700;
  color: #3b2e1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auction-listing-name .enh {
  color: #2e7d32;
  margin-left: 2px;
}
.auction-listing-meta {
  font-size: 14px;
  color: #6a5a3e;
}
.auction-listing-stats {
  font-size: 14px;
  color: #4a6a3a;
}
.auction-listing-type {
  width: 80px;
  flex-shrink: 0;
  font-size: 16px;
  color: #6a5a3e;
  text-align: center;
  text-transform: capitalize;
}
.auction-listing-seller {
  width: 90px;
  flex-shrink: 0;
  font-size: 16px;
  color: #5a4a2e;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auction-listing-price {
  width: 100px;
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
}
.auction-listing-price .price-val {
  color: #8a6a20;
  font-weight: 700;
  font-size: 18px;
}
.auction-listing-price .price-fee {
  font-size: 13px;
  color: #8a7a5e;
}
.auction-listing-actions {
  width: 70px;
  flex-shrink: 0;
  text-align: center;
}
.auction-buy-btn,
.auction-cancel-btn,
.auction-claim-btn {
  padding: 5px 12px;
  border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 700;
}
.auction-buy-btn {
  background: rgba(120,85,30,0.2);
  color: #4a3518;
}
.auction-buy-btn:hover {
  background: rgba(120,85,30,0.35);
  border-color: rgba(138,106,32,0.6);
}
.auction-cancel-btn {
  background: rgba(180,60,60,0.1);
  color: #8b2020;
  border-color: rgba(180,60,60,0.35);
}
.auction-cancel-btn:hover {
  background: rgba(180,60,60,0.2);
  border-color: rgba(180,60,60,0.5);
}
.auction-claim-btn {
  background: rgba(120,85,30,0.2);
  color: #4a3518;
}
.auction-claim-btn:hover {
  background: rgba(120,85,30,0.35);
  border-color: rgba(138,106,32,0.6);
}

/* Pagination */
#auction-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 10px;
  transform: translateY(-25px);
  border-top: 2px solid rgba(138,106,32,0.2);
  background: rgba(200,180,140,0.1);
}
#auction-pagination button {
  background: rgba(120,85,30,0.2);
  color: #4a3518;
  border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px;
  padding: 5px 14px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
}
#auction-pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}
#auction-pagination button:not(:disabled):hover {
  background: rgba(120,85,30,0.35);
  border-color: rgba(138,106,32,0.6);
}
#auction-page-info {
  font-size: 16px;
  color: #5a4a2e;
  font-weight: 600;
}

/* Sell layout */
#auction-sell-layout {
  padding: 12px;
}
#auction-sell-info {
  font-size: 14px;
  color: #8b949e;
  margin-bottom: 8px;
}

/* Sell form */
#auction-sell-form {
  background: rgba(200,180,140,0.2);
  border: 2px solid rgba(138,106,32,0.25);
  border-radius: var(--radius);
  padding: 12px;
}
#auction-sell-count {
  font-size: 16px;
  color: #6a5a3e;
  margin-top: 8px;
}
.auction-sell-slot {
  background: rgba(245,235,210,0.5);
  border: 2px dashed rgba(138,106,32,0.35);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  color: #6a5a3e;
  font-size: 17px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auction-sell-slot:hover {
  background: rgba(200,180,140,0.35);
  border-color: rgba(138,106,32,0.55);
}
.auction-sell-slot.has-item {
  border-style: solid;
  border-color: #8a6a20;
  color: #3b2e1a;
}
#auction-sell-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
#auction-sell-price-row label {
  font-size: 17px;
  color: #4a3518;
  font-weight: 700;
}
#auction-sell-price {
  flex: 1;
  background: rgba(245,235,210,0.7);
  color: #3b2e1a;
  border: 2px solid rgba(138,106,32,0.35);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 17px;
  outline: none;
}
#auction-sell-price:focus {
  background: rgba(245,235,210,0.9);
  border-color: rgba(138,106,32,0.6);
}
#auction-sell-fee-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  color: #6a5a3e;
  margin-top: 6px;
}
.auction-action-btn {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: linear-gradient(135deg, rgba(138,106,32,0.3), rgba(120,85,30,0.45));
  color: #4a3518;
  border: 2px solid rgba(138,106,32,0.5);
  border-radius: 4px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auction-action-btn:hover {
  background: linear-gradient(135deg, rgba(138,106,32,0.5), rgba(120,85,30,0.6));
  border-color: rgba(138,106,32,0.7);
}

/* Sold items */
#auction-sold-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(138,106,32,0.2);
  font-size: 17px;
  color: #5a4a2e;
}
.auction-sold-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(138,106,32,0.12);
  transition: background 0.12s;
}
.auction-sold-row:nth-child(even) {
  background: rgba(200,180,140,0.1);
}
.auction-sold-row:hover {
  background: rgba(200,180,140,0.25);
}
.auction-sold-info {
  flex: 1;
}
.auction-sold-name {
  font-size: 17px;
  color: #3b2e1a;
}
.auction-sold-buyer {
  font-size: 14px;
  color: #6a5a3e;
}
.auction-sold-gold {
  color: #8a6a20;
  font-weight: bold;
  font-size: 18px;
  margin-right: 8px;
}

/* Item picker overlay for auction sell */
#auction-item-picker {
  display: none;
  position: absolute;
  top: 40px;
  left: 10px;
  right: 10px;
  background: rgba(245,235,210,0.97);
  border: 2px solid #8a6a20;
  border-radius: var(--radius);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  padding: 6px;
  backdrop-filter: blur(16px);
}
#auction-item-picker.show {
  display: block;
}
.auction-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 17px;
  color: #3b2e1a;
  transition: background 0.15s;
}
.auction-picker-item:hover {
  background: rgba(138,106,32,0.15);
}
.auction-picker-item img {
  width: 28px;
  height: 28px;
  image-rendering: auto;
}
.auction-picker-stats {
  margin-left: auto;
  font-size: 14px;
  color: #4a6a3a;
  white-space: nowrap;
}

/* Auto combat & sell buttons — now in #side-menu */
#autocombat-btn.active {
  background: rgba(201,168,76,0.3);
  border-color: rgba(201,168,76,0.7);
  box-shadow: 0 0 8px rgba(201,168,76,0.3);
  animation: ac-pulse 1.5s infinite;
}
@keyframes ac-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(201,168,76,0.3); }
  50% { box-shadow: 0 0 16px rgba(201,168,76,0.6); }
}
#boat-btn.active {
  background: rgba(201,168,76,0.3);
  border-color: rgba(201,168,76,0.7);
  box-shadow: 0 0 8px rgba(201,168,76,0.3);
}

/* ── Auto Combat Window ── */
#autocombat-window {
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  animation: none;
}

#autocombat-window .window-frame-img {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill;
  z-index: 1 !important;
  pointer-events: none;
}

#autocombat-window .window-header {
  position: absolute !important;
  top: 0; left: 0; right: 0;
  z-index: 5 !important;
  cursor: move;
  padding: 10px 16px 4px 50px;
  border-bottom: none !important;
  background: transparent !important;
  min-height: 30px;
}

#autocombat-window .window-title {
  color: transparent !important;
  pointer-events: none;
  font-size: 0;
}

#autocombat-window .window-close {
  position: absolute;
  top: 10px;
  right: 22px;
  z-index: 20 !important;
  color: rgba(120,80,30,0.9);
  font-size: 22px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  background: rgba(200,170,100,0.4);
  border: 1px solid rgba(160,120,40,0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}

#autocombat-window .window-close:hover {
  background: rgba(180,60,60,0.4);
  color: #c0392b;
  border-color: rgba(180,60,60,0.5);
}

#autocombat-window .window-body {
  position: absolute !important;
  top: 45px; left: 50px; right: 50px; bottom: 40px;
  transform: translate(105px, 70px) scale(0.7);
  transform-origin: top left;
  z-index: 5 !important;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent !important;
  max-height: none !important;
  padding: 8px;
  scrollbar-width: none;
}

#autocombat-window .window-body::-webkit-scrollbar { width: 0; }

/* Two-column layout */
#ac-columns {
  display: flex;
  gap: 12px;
  height: 100%;
}
.ac-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ac-drop-section {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  max-height: 190px;
}
.ac-drop-section #ac-drop-log {
  flex: 1;
  overflow-y: auto;
  max-height: 140px;
}

#ac-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ac-toggle-btn {
  padding: 6px 16px;
  border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}
.ac-toggle-btn {
  background: rgba(120,85,30,0.2);
  color: #4a3518;
}
.ac-toggle-btn:hover {
  background: rgba(120,85,30,0.35);
  border-color: rgba(138,106,32,0.6);
}
.ac-toggle-btn.ac-stop {
  background: rgba(180,60,60,0.15);
  color: #8b2020;
  border-color: rgba(180,60,60,0.35);
}
.ac-toggle-btn.ac-stop:hover {
  background: rgba(180,60,60,0.25);
  border-color: rgba(180,60,60,0.5);
}
.ac-status-off { color: #8b2020; font-size: 17px; }
.ac-status-on  { color: #2e7d32; font-size: 17px; font-weight: bold; }

.ac-section {
  background: rgba(200,180,140,0.2);
  border: 2px solid rgba(138,106,32,0.25);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 6px;
}
.ac-section-title {
  font-size: 17px;
  color: #6b4c1a;
  font-weight: bold;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ac-toggle-btn {
  font-size: 14px;
  color: #6b4c1a;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(200,180,140,0.25);
  border: 1px solid rgba(138,106,32,0.3);
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
}
.ac-toggle-btn:hover {
  background: rgba(200,180,140,0.4);
  border-color: rgba(138,106,32,0.5);
}
#ac-skills-panel {
  max-height: 160px;
  overflow-y: auto;
  margin-top: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(138,106,32,0.4) transparent;
}
.ac-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  color: #3b2e1a;
  cursor: pointer;
  padding: 2px 0;
}
.ac-checkbox input[type="checkbox"] {
  accent-color: #8a6a20;
  cursor: pointer;
}

/* Skill checkboxes */
.ac-skill-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  border-radius: 4px;
  transition: background 0.15s;
}
.ac-skill-item:hover {
  background: rgba(138,106,32,0.1);
}
.ac-skill-item label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  color: #3b2e1a;
  cursor: pointer;
  flex: 1;
}
.ac-skill-item input[type="checkbox"] {
  accent-color: #8a6a20;
  cursor: pointer;
}
.ac-skill-icon {
  width: 20px;
  height: 20px;
  image-rendering: auto;
  border-radius: 4px;
}
.ac-skill-cd {
  font-size: 14px;
  color: #6a5a3e;
}

/* Stats */
#ac-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
}
.ac-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  padding: 2px 0;
}
.ac-stat-label {
  color: #6a5a3e;
}
.ac-stat-row span:last-child {
  color: #3b2e1a;
  font-weight: bold;
}
#ac-stat-exp { color: #2e5a8a !important; }
#ac-stat-gold { color: #8a6a20 !important; }
#ac-stat-kills { color: #8b2020 !important; }
#ac-stat-items { color: #2e7d32 !important; }
#ac-stat-expmin { color: #2e5a8a !important; }
#ac-stat-goldmin { color: #8a6a20 !important; }

/* Drop log */
#ac-drop-log {
  max-height: 100px;
  overflow-y: auto;
  font-size: 16px;
}
.ac-log-entry {
  padding: 2px 0;
  border-bottom: 1px solid rgba(138,106,32,0.15);
  color: #3b2e1a;
  display: flex;
  justify-content: space-between;
}
.ac-log-entry .ac-log-time {
  color: #6a5a3e;
  font-size: 14px;
}
.ac-log-entry .ac-log-item {
  color: #2e7d32;
}
.ac-log-entry .ac-log-gold {
  color: #8a6a20;
}
.ac-log-entry .ac-log-exp {
  color: #2e5a8a;
}

/* ── Shop Setup Window ── */
#shop-setup-window {
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  animation: none;
}

#shop-setup-window .window-frame-img {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill;
  z-index: 1 !important;
  pointer-events: none;
}

#shop-setup-window .window-header {
  position: absolute !important;
  top: 0; left: 0; right: 0;
  z-index: 5 !important;
  cursor: move;
  padding: 10px 16px 4px 50px;
  border-bottom: none !important;
  background: transparent !important;
  min-height: 30px;
}

#shop-setup-window .window-title {
  color: transparent !important;
  pointer-events: none;
  font-size: 0;
}

#shop-setup-window .window-close {
  position: absolute;
  top: 10px;
  right: 22px;
  z-index: 20 !important;
  color: rgba(120,80,30,0.9);
  font-size: 22px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  background: rgba(200,170,100,0.4);
  border: 1px solid rgba(160,120,40,0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}

#shop-setup-window .window-close:hover {
  background: rgba(180,60,60,0.4);
  color: #c0392b;
  border-color: rgba(180,60,60,0.5);
}

#shop-setup-window .window-body {
  position: absolute !important;
  top: 55px; left: 65px; right: 155px; bottom: 55px;
  transform: translate(60px, 75px);
  transform-origin: top left;
  z-index: 5 !important;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent !important;
  max-height: none !important;
  padding: 12px;
  scrollbar-width: none;
}

#shop-setup-window .window-body::-webkit-scrollbar { width: 0; }

#cashshop-window .window-body {
  max-height: 500px;
  overflow-y: auto;
}

.cs-cat-btn {
  background: rgba(13,27,42,0.7);
  color: rgba(255,255,255,0.35);
  border: 2px solid rgba(56,142,184,0.15);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}
.cs-cat-btn:hover {
  background: rgba(56,142,184,0.15);
  color: var(--text);
  border-color: rgba(79,195,247,0.2);
}
.cs-cat-btn.active {
  background: rgba(56,142,184,0.3);
  color: var(--gold);
  border-color: rgba(56,142,184,0.4);
}

#cs-items-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs-shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(13,27,42,0.7);
  border: 2px solid rgba(56,142,184,0.1);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: background 0.2s, border-color 0.2s;
}
.cs-shop-item:hover {
  background: rgba(56,142,184,0.15);
  border-color: rgba(79,195,247,0.2);
}
.cs-shop-item.cs-featured {
  background: rgba(56,142,184,0.1);
  border-color: rgba(79,195,247,0.2);
}
.cs-featured-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 14px;
}
.cs-shop-item {
  position: relative;
}

.cs-item-icon-wrap {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: rgba(13,27,42,0.7);
  border: 2px solid rgba(79,195,247,0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cs-item-icon {
  width: 40px;
  height: 40px;
  image-rendering: auto;
  object-fit: contain;
}
.cs-item-icon-placeholder {
  font-size: 24px;
}

.cs-item-info {
  flex: 1;
  min-width: 0;
}
.cs-item-name {
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-item-type {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-top: 1px;
}
.cs-item-qty {
  font-size: 10px;
  color: #70aaff;
}
.cs-item-stats {
  font-size: 10px;
  color: #50cc60;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-item-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.08);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cs-item-buy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 70px;
}
.cs-item-price {
  font-weight: bold;
  color: var(--gold);
  font-size: 13px;
  white-space: nowrap;
}
.cs-buy-btn {
  background: linear-gradient(135deg, rgba(79,195,247,0.3), rgba(79,195,247,0.45));
  color: var(--gold);
  border: 2px solid rgba(79,195,247,0.25);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  transition: all 0.2s;
}
.cs-buy-btn:hover {
  background: linear-gradient(135deg, rgba(79,195,247,0.5), rgba(79,195,247,0.6));
  border-color: rgba(79,195,247,0.5);
  transform: scale(1.05);
}

/* =========================================
   SELL ITEMS WINDOW
   ========================================= */
#sell-window {
  overflow: visible !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  animation: none;
  z-index: 1050;
}

#sell-window .window-frame-img {
  position: absolute !important;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: fill;
  z-index: 1 !important;
  pointer-events: none;
}

#sell-window .window-header {
  position: absolute !important;
  top: 0; left: 0; right: 0;
  z-index: 5 !important;
  cursor: move;
  padding: 10px 16px 4px 50px;
  border-bottom: none !important;
  background: transparent !important;
  min-height: 30px;
}

#sell-window .window-title {
  color: transparent !important;
  pointer-events: none;
  font-size: 0;
}

#sell-window .window-close {
  position: absolute;
  top: 10px;
  right: 22px;
  z-index: 20 !important;
  color: rgba(120,80,30,0.9);
  font-size: 22px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  background: rgba(200,170,100,0.4);
  border: 1px solid rgba(160,120,40,0.5);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
}

#sell-window .window-close:hover {
  background: rgba(180,60,60,0.4);
  color: #c0392b;
  border-color: rgba(180,60,60,0.5);
}

#sell-window .window-body {
  position: absolute !important;
  top: 55px; left: 65px; right: 155px; bottom: 55px;
  transform: translate(60px, 75px);
  transform-origin: top left;
  z-index: 5 !important;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent !important;
  max-height: none !important;
  padding: 12px;
  scrollbar-width: none;
}

#sell-window .window-body::-webkit-scrollbar { width: 0; }
#sell-info {
  text-align: center; font-size: 14px; color: #5a4a2e;
  padding: 8px 10px; margin-bottom: 8px;
  background: rgba(200,180,140,0.2); border-radius: 4px;
  border: 2px solid rgba(138,106,32,0.25);
}
#sell-drop-zone {
  padding: 18px 10px;
  border: 2px dashed rgba(138,106,32,0.35);
  border-radius: 6px;
  text-align: center;
  color: #6a5a3e;
  font-size: 14px;
  margin-bottom: 6px;
  transition: all 0.2s;
  background: rgba(200,180,140,0.1);
}
#sell-drop-zone.drag-over {
  border-color: rgba(138,106,32,0.6);
  background: rgba(200,180,140,0.3);
  color: #4a3518;
  box-shadow: inset 0 0 12px rgba(138,106,32,0.15);
}
#sell-items-list {
  display: flex; flex-direction: column; gap: 3px;
  max-height: 150px; overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(138,106,32,0.4) transparent;
}
.sell-item-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  background: rgba(200,180,140,0.15);
  border: 2px solid rgba(138,106,32,0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.sell-item-row:hover {
  background: rgba(200,180,140,0.3);
  border-color: rgba(138,106,32,0.4);
}
.sell-item-icon {
  width: 32px; height: 32px;
  background: rgba(245,235,210,0.6); border: 1px solid rgba(138,106,32,0.25);
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.sell-item-icon img {
  max-width: 100%; max-height: 100%; image-rendering: auto;
}
.sell-item-info {
  flex: 1; min-width: 0;
}
.sell-item-name {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sell-item-name.rarity-comum { color: #ccc; }
.sell-item-name.rarity-incomum { color: #30d050; }
.sell-item-name.rarity-raro { color: #4080ff; }
.sell-item-name.rarity-epico { color: #b040e0; }
.sell-item-name.rarity-lendario { color: #ff8c00; }
.sell-item-detail {
  font-size: 12px; color: #6a5a3e;
}
.sell-item-price {
  font-size: 13px; color: #8a6a20; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.sell-item-remove {
  width: 18px; height: 18px; border: none; border-radius: 3px;
  background: rgba(180,40,40,0.4); color: #ff6060;
  font-size: 13px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.15s;
}
.sell-item-remove:hover {
  background: rgba(200,40,40,0.7); color: #fff;
}
#sell-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; margin-top: 8px;
  background: rgba(200,180,140,0.2); border-radius: 4px;
  border: 2px solid rgba(138,106,32,0.25);
  font-size: 14px; color: #3b2e1a;
}
#sell-total-gold {
  color: #8a6a20; font-size: 16px;
}
#sell-actions {
  display: flex; gap: 6px;
}
.sell-action-btn {
  padding: 5px 12px; border: 2px solid rgba(138,106,32,0.4);
  border-radius: 4px; cursor: pointer; font-size: 13px;
  font-weight: 700; transition: all 0.2s;
  background: linear-gradient(135deg, rgba(120,85,30,0.2), rgba(120,85,30,0.3));
  color: #4a3518;
}
.sell-action-btn:hover {
  background: linear-gradient(135deg, rgba(120,85,30,0.35), rgba(138,106,32,0.4));
  border-color: rgba(138,106,32,0.6);
  color: #3b2e1a;
}
.sell-action-btn.sell-clear {
  background: linear-gradient(135deg, rgba(180,60,60,0.1), rgba(180,60,60,0.15));
  border-color: rgba(180,60,60,0.35); color: #8b2020;
}
.sell-action-btn.sell-clear:hover {
  background: linear-gradient(135deg, rgba(180,60,60,0.2), rgba(180,60,60,0.3));
  color: #a02020;
}
.sell-action-btn.sell-confirm {
  background: linear-gradient(135deg, rgba(46,125,50,0.2), rgba(46,125,50,0.3));
  border-color: rgba(46,125,50,0.4); color: #2e5a1a;
}
.sell-action-btn.sell-confirm:hover {
  background: linear-gradient(135deg, rgba(46,125,50,0.35), rgba(46,125,50,0.45));
  color: #1a4010;
}

/* ── Sell Rarity Quick-Add Bar ── */
#sell-rarity-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  margin-bottom: 4px;
  background: rgba(200,180,140,0.12);
  border: 1px solid rgba(138,106,32,0.2);
  border-radius: 4px;
  flex-wrap: wrap;
}
.sell-rarity-label {
  font-size: 10px;
  color: #6a5a3e;
  font-weight: 600;
  margin-right: 4px;
}
.sell-rarity-btn {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0,0,0,0.15);
  border: 1px solid;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
}
.sell-rarity-btn:hover {
  background: rgba(0,0,0,0.3);
  transform: scale(1.05);
}
.sell-rarity-btn:active {
  transform: scale(0.95);
}

/* ── Sell Advanced Filter ── */
#sell-filter-bar {
  margin-bottom: 4px;
}
.sell-filter-toggle-btn {
  width: 100%;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(200,180,140,0.12);
  border: 1px solid rgba(138,106,32,0.25);
  border-radius: 4px;
  color: #6a5a3e;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.sell-filter-toggle-btn:hover {
  background: rgba(200,180,140,0.25);
}
.sell-filter-toggle-btn.active {
  background: rgba(200,180,140,0.25);
  border-color: rgba(138,106,32,0.4);
}
#sell-filter-panel {
  background: rgba(30,22,12,0.85);
  border: 1px solid rgba(138,106,32,0.3);
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#sell-filter-panel.hidden { display: none; }
.sell-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sell-filter-label {
  color: #c8a030;
  font-size: 10px;
  font-weight: 600;
  min-width: 70px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}
.sell-filter-checks {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.sell-filter-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 480px;
}
.sell-fchk {
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: all 0.12s;
  font-size: 9px;
  font-weight: 600;
}
.sell-fchk:hover {
  background: rgba(200,170,100,0.15);
  border-color: rgba(200,170,100,0.3);
}
.sell-fchk input[type="checkbox"] {
  display: none;
}
.sell-fchk.checked {
  background: rgba(200,170,100,0.25);
  border-color: rgba(200,170,100,0.5);
  box-shadow: 0 0 4px rgba(200,170,100,0.2);
}
.sell-filter-num {
  width: 36px;
  height: 20px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(160,120,40,0.4);
  border-radius: 3px;
  color: #e8c878;
  font-size: 11px;
  text-align: center;
  outline: none;
}
.sell-filter-num:focus {
  border-color: rgba(200,170,100,0.7);
}
.sell-filter-clear-btn {
  padding: 3px 10px;
  font-size: 9px;
  font-weight: 600;
  background: rgba(180,60,60,0.2);
  border: 1px solid rgba(180,60,60,0.4);
  color: #ff8866;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s;
}
.sell-filter-clear-btn:hover {
  background: rgba(180,60,60,0.4);
}

/* =========================================
   SIDE-BY-SIDE COMPARISON TOOLTIP
   ========================================= */
.item-tooltip-global.tt-comparison-mode {
  max-width: 520px !important;
  min-width: 380px !important;
  padding: 10px !important;
}
.tt-compare-container {
  display: flex;
  gap: 0;
}
.tt-panel {
  flex: 1;
  padding: 4px 8px;
  min-width: 150px;
}
.tt-compare-sep {
  width: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0 6px;
  flex-shrink: 0;
}
.tt-panel-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 6px;
  text-align: center;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.tt-panel-icon {
  text-align: center;
  margin-bottom: 4px;
}
.tt-panel-img {
  width: 32px;
  height: 32px;
  image-rendering: auto;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.3);
  padding: 2px;
}
.tt-panel .tt-header {
  font-size: 11px !important;
  text-align: center;
  margin-bottom: 1px;
}
.tt-panel .tt-rarity {
  text-align: center;
  font-size: 9px;
  margin-bottom: 4px;
}
.tt-panel .tt-stats {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 4px;
  margin-bottom: 0;
}
.tt-panel .tt-stat {
  font-size: 10px;
  line-height: 1.5;
}
.tt-panel .tt-stat-label {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
}
.tt-panel .tt-stat-val {
  font-size: 10px;
  color: #ffffff;
}
.tt-compare-reqs {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.1);
}


/* =========================================
   SIDE-BY-SIDE COMPARISON TOOLTIP
   ========================================= */
.item-tooltip-global.tt-comparison-mode {
  max-width: 520px !important;
  min-width: 380px !important;
  padding: 10px !important;
}
.tt-compare-reqs {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* =========================================
   RESPONSIVE UI SCALING
   ========================================= */
#game-menu,
#player-info,
#party-frame,
#coordinates {
  transform: scale(var(--ui-scale, 1));
  transform-origin: top left;
}

#online-count,
#ping-display,
#fps-counter,
#minimap-container {
  transform: scale(var(--ui-scale, 1));
  transform-origin: top right;
}

#chat-container {
  transform: scale(var(--ui-scale, 1));
  transform-origin: bottom left;
}

#skill-bar-container {
  transform: translateX(-50%) scale(var(--ui-scale, 1));
  transform-origin: center bottom;
}

#side-menu {
  transform: scale(var(--ui-scale, 1));
  transform-origin: bottom right;
}

.game-window {
  transform: scale(var(--ui-scale, 1));
  transform-origin: top left;
}

/* === DISABLED FEATURES === */
#refine-btn,
#pet-btn,
#shop-btn,
#cashshop-btn,
#refine-window,
#pet-window,
#shop-setup-window,
#cashshop-window {
  display: none !important;
}

/* ========================
   ADMIN PANEL STYLES
   ======================== */

#admin-panel {
  position: fixed;
  top: 80px;
  left: calc(50% - 240px);
  width: 480px;
  max-height: 80vh;
  z-index: 10000;
  border: 2px solid #d4a843;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a1208 0%, #2a1f0e 50%, #1a1208 100%);
  box-shadow: 0 0 30px rgba(212, 168, 67, 0.3), inset 0 0 20px rgba(0,0,0,0.5);
  overflow: hidden;
  transform: none !important;
}

#admin-panel .window-header {
  background: linear-gradient(90deg, #8B6914, #d4a843, #8B6914);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #d4a843;
  cursor: move;
}

#admin-panel .window-title {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.admin-body {
  padding: 0;
  overflow-y: auto;
  max-height: calc(80vh - 40px);
}

.admin-tabs {
  display: flex;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid #5a4a2a;
  flex-wrap: wrap;
}

.admin-tab {
  flex: 1;
  padding: 8px 6px;
  background: transparent;
  border: none;
  color: #c9a96e;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 70px;
}

.admin-tab:hover {
  background: rgba(212, 168, 67, 0.15);
  color: #fff;
}

.admin-tab.active {
  background: rgba(212, 168, 67, 0.25);
  color: #ffd700;
  border-bottom: 2px solid #ffd700;
}

.admin-tab-content {
  display: none;
  padding: 12px;
}

.admin-tab-content.active {
  display: block;
}

.admin-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(90, 74, 42, 0.4);
}

.admin-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.admin-section h4 {
  color: #d4a843;
  font-size: 12px;
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.admin-input {
  flex: 1;
  padding: 6px 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid #5a4a2a;
  border-radius: 4px;
  color: #e8d5a3;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.admin-input:focus {
  border-color: #d4a843;
}

.admin-input.small {
  max-width: 70px;
  flex: 0 0 70px;
}

.admin-input.wide {
  flex: 2;
}

.admin-btn {
  padding: 6px 14px;
  background: linear-gradient(180deg, #8B6914, #6b4f0e);
  border: 1px solid #d4a843;
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.admin-btn:hover {
  background: linear-gradient(180deg, #a07818, #8B6914);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.4);
}

.admin-btn.red {
  background: linear-gradient(180deg, #8B1414, #6b0e0e);
  border-color: #d44343;
}

.admin-btn.red:hover {
  background: linear-gradient(180deg, #a01818, #8B1414);
  box-shadow: 0 0 8px rgba(212, 67, 67, 0.4);
}

.admin-btn.green {
  background: linear-gradient(180deg, #148B14, #0e6b0e);
  border-color: #43d443;
}

.admin-btn.green:hover {
  background: linear-gradient(180deg, #18a018, #148B14);
  box-shadow: 0 0 8px rgba(67, 212, 67, 0.4);
}

.admin-btn.gold {
  background: linear-gradient(180deg, #d4a843, #8B6914);
  border-color: #ffd700;
  color: #1a1208;
}

.admin-btn.gold:hover {
  background: linear-gradient(180deg, #ffd700, #d4a843);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.admin-btn.full {
  width: 100%;
  margin-bottom: 8px;
}

.admin-list {
  max-height: 350px;
  overflow-y: auto;
  margin-top: 8px;
}

.admin-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(90, 74, 42, 0.3);
  border-radius: 3px;
  margin-bottom: 3px;
  font-size: 11px;
  color: #e8d5a3;
}

.admin-list-item:hover {
  background: rgba(212, 168, 67, 0.1);
}

.admin-list-item .item-name {
  color: #ffd700;
  font-weight: 600;
}

.admin-list-item .item-info {
  color: #999;
  font-size: 10px;
}

.admin-list-item .admin-btn {
  padding: 3px 8px;
  font-size: 10px;
}

/* admin button removed - use F9 */

/* === BROADCAST OVERLAY === */
#admin-broadcast-overlay {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  padding: 18px 50px;
  background: linear-gradient(180deg, rgba(30, 20, 5, 0.92) 0%, rgba(50, 35, 10, 0.92) 100%);
  border: 2px solid #ffd700;
  border-radius: 12px;
  color: #ffd700;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.6), 0 2px 6px rgba(0,0,0,0.8);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.05);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  max-width: 80vw;
  white-space: pre-wrap;
  word-break: break-word;
}

#admin-broadcast-overlay.broadcast-show {
  opacity: 1;
  animation: broadcastPulse 2s ease-in-out infinite;
}

#admin-broadcast-overlay.broadcast-hide {
  opacity: 0;
  transition: opacity 1.5s ease;
}

@keyframes broadcastPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.05); }
  50% { box-shadow: 0 0 60px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.1); }
}

/* ===== Boss HP Bar ===== */
#boss-hp-bar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  width: 420px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#boss-hp-bar.hidden { display: none; }

#boss-hp-bar-name {
  font: 700 15px 'Cinzel', serif;
  color: #ff2222;
  text-shadow: 0 0 8px rgba(255,34,34,0.7), 0 1px 3px rgba(0,0,0,0.9);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

#boss-hp-bar-track {
  position: relative;
  width: 100%;
  height: 22px;
  background: linear-gradient(180deg, rgba(20,0,0,0.85) 0%, rgba(40,5,5,0.9) 100%);
  border: 2px solid #aa1111;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(255,34,34,0.3), inset 0 1px 3px rgba(0,0,0,0.6);
}

#boss-hp-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #cc0000, #ff3333 40%, #ff5555 80%, #cc0000);
  transition: width 0.3s ease;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.3);
}

#boss-hp-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 12px 'Inter', sans-serif;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
}

/* Boss kill announcement */
#boss-kill-announce {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99998;
  padding: 14px 40px;
  background: linear-gradient(180deg, rgba(60,5,5,0.92), rgba(30,0,0,0.95));
  border: 2px solid #ff3333;
  border-radius: 10px;
  color: #ff4444;
  font: 700 20px 'Cinzel', serif;
  text-align: center;
  text-shadow: 0 0 14px rgba(255,50,50,0.7), 0 2px 6px rgba(0,0,0,0.8);
  box-shadow: 0 0 40px rgba(255,50,50,0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
#boss-kill-announce.show {
  opacity: 1;
  animation: bossKillPulse 1.5s ease-in-out infinite;
}
@keyframes bossKillPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(255,50,50,0.4); }
  50% { box-shadow: 0 0 70px rgba(255,50,50,0.7); }
}

/* ===== Boss DPS Ranking ===== */
#boss-dps-ranking {
  position: fixed;
  top: 70px;
  right: 420px;
  z-index: 850;
  width: 240px;
  background: linear-gradient(180deg, rgba(15,0,0,0.88), rgba(25,5,5,0.92));
  border: 1px solid #881111;
  border-radius: 8px;
  padding: 8px 10px;
  pointer-events: none;
  transition: opacity 0.4s ease;
  box-shadow: 0 0 16px rgba(255,34,34,0.2);
}
#boss-dps-ranking.hidden { display: none; }

#boss-dps-title {
  font: 700 13px 'Cinzel', serif;
  color: #ff4444;
  text-align: center;
  margin-bottom: 6px;
  text-shadow: 0 0 6px rgba(255,50,50,0.5);
  border-bottom: 1px solid rgba(255,50,50,0.3);
  padding-bottom: 4px;
}

.boss-dps-row {
  display: flex;
  align-items: center;
  padding: 2px 0;
  font: 600 11px 'Inter', sans-serif;
  color: #ccc;
}
.boss-dps-row.my-row {
  color: #ffdd44;
  text-shadow: 0 0 4px rgba(255,221,68,0.4);
}

.boss-dps-rank {
  width: 22px;
  text-align: center;
  font-weight: 700;
  flex-shrink: 0;
}
.boss-dps-rank.rank-1 { color: #ffd700; }
.boss-dps-rank.rank-2 { color: #c0c0c0; }
.boss-dps-rank.rank-3 { color: #cd7f32; }

.boss-dps-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}

.boss-dps-dmg {
  width: 65px;
  text-align: right;
  font-size: 10px;
  color: #ff8888;
  flex-shrink: 0;
}

.boss-dps-drop {
  width: 35px;
  text-align: right;
  font-size: 10px;
  color: #88ff88;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════
   STORAGE (WAREHOUSE) WINDOW
   ═══════════════════════════════════════ */

#storage-window {
  z-index: 50;
  width: 390px;
  background: linear-gradient(180deg, #1a1207 0%, #2a1c0e 40%, #1e1409 100%);
  border: 3px solid #8b6914;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.7), inset 0 1px 0 rgba(200,160,60,0.15), 0 0 40px rgba(139,105,20,0.15);
  overflow: hidden;
}
#storage-window::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 6px;
  border: 1px solid rgba(200,160,60,0.08);
  pointer-events: none;
  z-index: 0;
}
#storage-window .window-frame-img { display: none; }
#storage-window .window-header {
  position: relative;
  z-index: 10;
  cursor: move;
  padding: 10px 14px 8px;
  background: linear-gradient(180deg, #3d2a0f, #2a1c0e);
  border-bottom: 2px solid #8b6914;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  min-height: unset;
}
#storage-window .window-title {
  color: #ffe0a0;
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8), 0 0 8px rgba(240,180,40,0.3);
  pointer-events: none;
}
#storage-window .window-close {
  position: absolute;
  top: 7px;
  right: 10px;
  z-index: 20;
  color: #c0a060;
  font-size: 18px;
  font-weight: 700;
  width: 24px;
  height: 24px;
  background: linear-gradient(180deg, rgba(80,50,15,0.8), rgba(50,30,10,0.9));
  border: 1px solid #8b6914;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
}
#storage-window .window-close:hover {
  background: linear-gradient(180deg, rgba(160,40,40,0.7), rgba(120,25,25,0.8));
  color: #ff6b6b;
  border-color: #c0392b;
}
#storage-window .window-body {
  padding: 8px 12px 12px;
  position: relative;
  z-index: 1;
}

#storage-pages {
  display: flex;
  gap: 3px;
  margin-bottom: 6px;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(139,105,20,0.3);
}
#storage-slot-count {
  margin-left: auto;
  color: #ffe0a0;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  opacity: 0.85;
}
.storage-page-tab {
  padding: 5px 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #eed8a0;
  background: linear-gradient(180deg, #3d2a0f, #2a1c0e);
  border: 1px solid rgba(139,105,20,0.6);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.storage-page-tab:hover:not(.locked) {
  background: linear-gradient(180deg, #5a3d15, #3d2a0f);
  color: #FFD700;
  border-color: #b8941a;
}
.storage-page-tab.active {
  background: linear-gradient(180deg, #6b4a18, #4a3210);
  color: #FFD700;
  border-color: #d4a820;
  box-shadow: 0 0 6px rgba(255,200,60,0.25), inset 0 1px 0 rgba(255,220,100,0.15);
}
.storage-page-tab.locked {
  color: #887750;
  background: linear-gradient(180deg, #1e150a, #150f06);
  border-color: rgba(80,60,20,0.4);
  cursor: not-allowed;
  opacity: 0.6;
}

#storage-grid {
  display: grid;
  grid-template-columns: repeat(10, 32px);
  grid-auto-rows: 32px;
  gap: 2px;
  margin: 0 auto;
  width: fit-content;
  padding: 6px;
  background: linear-gradient(145deg, rgba(30,22,10,0.6), rgba(15,10,5,0.8));
  border: 1px solid rgba(139,105,20,0.25);
  border-radius: 4px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}

.storage-slot {
  width: 32px;
  height: 32px;
  background: linear-gradient(145deg, rgba(180,150,100,0.35), rgba(120,90,50,0.5));
  border: 1px solid rgba(160,120,50,0.5);
  border-top-color: rgba(200,170,100,0.5);
  border-left-color: rgba(200,170,100,0.4);
  border-bottom-color: rgba(90,60,20,0.6);
  border-right-color: rgba(90,60,20,0.5);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
  font-size: 11px;
  overflow: hidden;
  box-shadow: inset 0 1px 1px rgba(255,230,150,0.12), inset 0 -1px 2px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
}
.storage-slot:hover {
  background: linear-gradient(145deg, rgba(220,190,130,0.5), rgba(160,120,60,0.6));
  border-color: rgba(220,180,80,0.7);
  box-shadow: inset 0 1px 1px rgba(255,230,150,0.2), inset 0 -1px 2px rgba(0,0,0,0.2), 0 0 5px rgba(200,160,60,0.3);
}
.storage-slot.drag-over {
  background: linear-gradient(145deg, rgba(100,200,100,0.3), rgba(60,150,60,0.4));
  border-color: rgba(100,220,100,0.6);
  box-shadow: 0 0 8px rgba(100,200,100,0.4);
}
.storage-slot.has-item {
  border-color: rgba(160,120,40,0.35);
}
.storage-slot[data-rarity="common"].has-item { border: 2px solid #a0a0a0; }
.storage-slot[data-rarity="uncommon"].has-item { border: 2px solid #4fc34f; box-shadow: 0 0 5px rgba(79,195,79,0.4), inset 0 0 4px rgba(79,195,79,0.15); }
.storage-slot[data-rarity="rare"].has-item { border: 2px solid #3d9eff; box-shadow: 0 0 6px rgba(61,158,255,0.5), inset 0 0 4px rgba(61,158,255,0.15); }
.storage-slot[data-rarity="epic"].has-item { border: 2px solid #c76bff; box-shadow: 0 0 8px rgba(199,107,255,0.5), inset 0 0 5px rgba(199,107,255,0.2); }
.storage-slot[data-rarity="legendary"].has-item { border: 2px solid #ff9f00; box-shadow: 0 0 10px rgba(255,159,0,0.6), 0 0 20px rgba(255,159,0,0.2), inset 0 0 6px rgba(255,159,0,0.2); }
.storage-slot[data-rarity="mythic"].has-item { border: 2px solid #ff4444; box-shadow: 0 0 10px rgba(255,68,68,0.6), 0 0 20px rgba(255,68,68,0.25), inset 0 0 6px rgba(255,68,68,0.2); }

.storage-slot .inv-icon {
  width: 85%;
  height: 85%;
  object-fit: contain;
  image-rendering: auto;
  pointer-events: none;
}
.storage-slot .inv-item-emoji {
  font-size: 20px;
  pointer-events: none;
}
.storage-slot .inv-qty {
  position: absolute;
  bottom: 0;
  right: 1px;
  font-size: 8px;
  color: #fff;
  text-shadow: 0 0 3px #000, 1px 1px 1px #000;
  pointer-events: none;
}
.storage-slot .inv-enhance {
  position: absolute;
  top: 0;
  left: 1px;
  font-size: 8px;
  color: #ffdd44;
  text-shadow: 0 0 3px #000, 1px 1px 1px #000;
  pointer-events: none;
}