/* ???????????????????????????????????????????
   Seyerdin Online - Custom Styles
   ??????????????????????????????????????????? */

/* ?? Global ?? */
.seyerdin-body {
  background: #0d0d1a;
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.seyerdin-game-body {
  background: #000;
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
}

/* ?? Home page ?? */
.seyerdin-home {
  background: radial-gradient(ellipse at center, #1a1a2e 0%, #0d0d1a 70%);
}
.home-bg-overlay {
  position: fixed;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect width="1" height="1" fill="rgba(255,255,255,0.03)"/></svg>');
  pointer-events: none;
  z-index: 0;
}
.game-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 2px 2px 4px rgba(0,0,0,0.8);
  letter-spacing: 2px;
}
@media (max-width: 576px) {
  .game-title {
    font-size: 1.8rem;
  }
}

/* ?? Cards ?? */
.card.bg-dark .nav-tabs .nav-link {
  border-color: transparent;
  color: #aaa;
}
.card.bg-dark .nav-tabs .nav-link.active {
  background: #343a40;
  border-color: #6c757d #6c757d #343a40;
  color: #fff;
}

/* ?? Character Select ?? */
.char-card {
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid #444;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
}
.char-card:hover {
  background: #2a2a3a;
  border-color: #ffd700;
}
.char-card .char-name {
  font-weight: 600;
  color: #ffd700;
}
.char-card .char-info {
  font-size: 0.8rem;
  color: #aaa;
}

/* ?? Game Layout (Odyssey-style fixed frame) ?? */
.game-layout {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  overflow: hidden;
}
.game-top {
  flex: 1 1 0;
  display: flex;
  min-height: 0;
  position: relative;
}
.game-map-area {
  flex: 1 1 0;
  position: relative;
  background: #111;
  border: 1px solid #2a2a2a;
  min-width: 0;
}
.game-map-canvas {
  width: 100%;
  height: 100%;
}
.game-map-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* Right panel area: button column */
.game-right-panel {
  flex: 0 0 auto;
  display: flex;
  background: #0e0e0e;
}

/* Mini-map overlay - draggable panel */
.game-minimap-overlay {
  position: absolute;
  top: 10px;
  right: 90px;
  width: 350px;
  max-width: calc(100% - 100px);
  max-height: 70vh;
  padding: 12px;
  z-index: 60;
  overflow: visible;
  background: #1a1a2e;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Player info panel */
#playerInfoPanel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  z-index: 50;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.player-info-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.player-info-details {
  color: #ccc;
  font-size: 0.9rem;
}

.player-info-details > div {
  margin: 8px 0;
}

.player-info-desc {
  margin-top: 15px;
  padding: 10px;
  background: #222;
  border-radius: 4px;
  font-style: italic;
  color: #aaa;
}

#minimapCanvas {
  border: none;
  background: #000;
}

/* Side panel overlay - floats over the map, anchored to left of btn column */
.game-side-overlay {
  position: absolute;
  top: 0;
  right: 84px;
  width: 260px;
  max-width: calc(100% - 90px);
  height: 100%;
  max-height: calc(100vh - 142px);
  padding: 4px;
  z-index: 50;
  overflow-y: auto;
}

/* Options panel overlay - wider and shorter, centered on screen */
.game-options-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  max-width: calc(100% - 40px);
  max-height: 60vh;
  padding: 12px;
  z-index: 60;
  overflow-y: auto;
  background: #1a1a2e;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Inventory panel overlay - smaller, on right side, draggable */
.game-inventory-overlay {
  position: absolute;
  top: 10px;
  right: 90px;
  width: 420px;
  max-width: calc(100% - 100px);
  max-height: 70vh;
  padding: 12px;
  z-index: 60;
  overflow: visible;
  background: #1a1a2e;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Storage panel - sits to the right of inventory panel */
.storage-panel-overlay {
  position: absolute;
  top: 10px;
  right: 520px;
  width: 380px;
  max-width: calc(100% - 530px);
  height: auto;
  max-height: 60vh;
  padding: 12px;
  z-index: 50;
  overflow: visible;
  background: #1a1a2e;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-btn-column {
  display: flex;
  flex-direction: column;
  width: 80px;
  padding: 4px 2px;
  gap: 2px;
  background: #0e0e0e;
  border-left: 1px solid #2a2a2a;
}
.game-nav-btn {
  background: #1a1a2e;
  color: #8cf;
  border: 1px solid #334;
  border-radius: 3px;
  padding: 6px 4px;
  font-size: 0.7rem;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.game-nav-btn:hover {
  background: #2a2a4e;
  color: #fff;
  border-color: #66aaff;
}
.game-nav-btn:active {
  background: #3a3a5e;
}
.game-nav-btn.admin-btn {
  color: #ffd700;
  border-color: #665500;
  background: #1a1a10;
}
.game-nav-btn.admin-btn:hover {
  background: #2a2a20;
  border-color: #ffd700;
}

/* Chat area at bottom */
.game-chat-area {
  flex: 0 0 auto;
  height: 140px;
  background: #0c0c0c;
  border-top: 1px solid #2a2a2a;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
}
.game-chat-area .chat-log {
  flex: 1 1 0;
  overflow-y: auto;
  font-size: 0.78rem;
  min-height: 0;
}

/* ?? Spell Hotbar ?? */
.spell-hotbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 2px;
  background: #0a0a0a;
  border-top: 1px solid #2a2a2a;
  border-bottom: 1px solid #2a2a2a;
  padding: 3px 4px;
}
.hotbar-slot {
  position: relative;
  width: 40px;
  height: 40px;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}
.hotbar-slot:hover { border-color: #888; }
.hotbar-slot.hotbar-active { border-color: #ffcc44; box-shadow: 0 0 6px rgba(255,204,68,0.4); }
.hotbar-slot.hotbar-cooldown { opacity: 0.45; }
.hotbar-key {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 0.55rem;
  font-weight: 700;
  color: #999;
  pointer-events: none;
  z-index: 1;
}
.hotbar-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  pointer-events: none;
}
.hotbar-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.5rem;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  line-height: 1;
  padding: 0 1px;
}

/* Hotbar right-click context menu */
.hotbar-ctx-menu {
  position: fixed;
  z-index: 9999;
  background: #1a1a2e;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 4px 0;
  min-width: 140px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.hotbar-ctx-title {
  padding: 2px 10px 4px;
  font-size: 0.7rem;
  color: #ffcc44;
  font-weight: 600;
  border-bottom: 1px solid #333;
}
.hotbar-ctx-item {
  padding: 3px 10px;
  font-size: 0.72rem;
  color: #ddd;
  cursor: pointer;
}
.hotbar-ctx-item:hover { background: #2a2a4e; color: #fff; }
.hotbar-ctx-key { float: right; color: #888; font-size: 0.65rem; }
.hotbar-ctx-remove { color: #ff6666; border-top: 1px solid #333; margin-top: 2px; padding-top: 5px; }
.hotbar-ctx-remove:hover { background: #3a1a1a; }

/* Map name label (Odyssey-style brackets) */
.map-name-label {
  font-size: 0.8rem;
  text-shadow: 1px 1px 2px #000;
}

/* ?? Game HUD ?? */
.hud-vitals-compact {
  width: 186px;
}
.hud-label-sm {
  width: 24px;
  text-align: right;
  font-weight: 600;
  font-size: 0.75rem;
}
.hud-val-sm {
  width: 52px;
  text-align: left;
  font-size: 0.7rem;
  font-family: monospace;
}
.hud-bar-sm {
  height: 10px;
  background: #222 !important;
}
.hud-action-btn {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

/* ?? Chat ?? */
.chat-log {
  scrollbar-width: thin;
  scrollbar-color: #555 #222;
}
.chat-log::-webkit-scrollbar {
  width: 6px;
}
.chat-log::-webkit-scrollbar-track {
  background: #222;
}
.chat-log::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}
.chat-msg-system {
  color: #ffcc00;
  font-style: italic;
}
.chat-msg-global {
  color: #66ccff;
}
.chat-msg-player {
  color: #fff;
}
.chat-msg-sender {
  font-weight: 600;
  color: #ffd700;
}

/* ?? D-Pad (mobile) ?? */
.dpad-btn {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
}

/* ?? Options Tabs ?? */
.opt-tabs {
  border-bottom: 1px solid #444;
  padding-bottom: 0;
}
.opt-tab {
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  color: #888;
  font-size: 0.7rem;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 3px 3px 0 0;
  margin-bottom: -1px;
  transition: color 0.15s, background 0.15s;
}
.opt-tab:hover {
  color: #ccc;
  background: #1a1a2e;
}
.opt-tab.active {
  color: #fff;
  background: #1a1a2e;
  border-color: #444 #444 #1a1a2e;
}
.opt-tab-content {
  font-size: 0.78rem;
}

/* ?? Controls Remap ?? */
.controls-list {
  max-height: 260px;
  overflow-y: auto;
}
.ctrl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  border-bottom: 1px solid #2a2a2a;
}
.ctrl-row:last-child {
  border-bottom: none;
}
.ctrl-label {
  color: #ffd700;
  font-size: 0.72rem;
}
.ctrl-key-btn {
  background: #1a1a2e;
  color: #8cf;
  border: 1px solid #334;
  border-radius: 3px;
  padding: 2px 10px;
  font-size: 0.7rem;
  min-width: 48px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.ctrl-key-btn:hover {
  border-color: #66aaff;
  color: #fff;
}
.ctrl-key-btn.listening {
  border-color: #ffd700;
  color: #ffd700;
  animation: pulse-border 0.6s infinite alternate;
}
@keyframes pulse-border {
  from { border-color: #ffd700; }
  to { border-color: #886800; }
}

/* ?? Side panels ?? */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  border-bottom: 1px solid #333;
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-name {
  color: #aaa;
}
.stat-value {
  font-weight: 600;
  color: #ffd700;
}
.inv-slot {
  width: 40px;
  height: 40px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #1a1a2e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 2px;
  font-size: 0.7rem;
  color: #888;
  transition: border-color 0.15s;
}
.inv-slot:hover {
  border-color: #ffd700;
}
.inv-slot.occupied {
  background: #2a2a3a;
  color: #fff;
  border-color: #666;
}

/* ?? Inventory Grid (4 col 5 row) ?? */
.inv-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 6px;
}
.inv-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 6px;
}
.inv-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #1a1a2e;
  padding: 2px;
  position: relative;
  font-size: 0.72rem;
  color: #888;
}
.inv-cell.occupied {
  background: #22223a;
  border-color: #555;
  color: #ddd;
}
.inv-cell.occupied:hover {
  border-color: #ffd700;
}
.inv-cell.occupied.selected {
  border-color: #ffd700;
  background: #2e2a10;
  box-shadow: 0 0 0 1px #ffd700;
}
.inv-cell .inv-cell-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 1px;
}
.inv-cell .inv-cell-btns {
  display: flex;
  gap: 2px;
  justify-content: center;
}
.inv-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 3px;
  background: #111;
  image-rendering: pixelated;
}
.inv-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  max-width: 100%;
  text-align: center;
}
.inv-empty {
  color: #444;
  font-size: 0.65rem;
}
.inv-btn {
  background: none;
  border: 1px solid #555;
  border-radius: 3px;
  cursor: pointer;
  padding: 0px 4px;
  font-size: 0.65rem;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.inv-btn.inv-equip {
  color: #6c6;
}
.inv-btn.inv-equip:hover {
  background: #243;
  border-color: #6c6;
  color: #8f8;
}
.inv-btn.inv-drop {
  color: #c66;
}
.inv-btn.inv-drop:hover {
  background: #422;
  border-color: #c66;
  color: #f88;
}

/* ?? Item Detail Box ?? */
.inv-detail {
  min-height: 52px;
  background: #111120;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 5px;
  font-size: 0.75rem;
  color: #ccc;
}
.inv-detail-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 1px;
}
.inv-detail-type {
  font-size: 0.65rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.inv-detail-desc {
  color: #ccc;
  font-size: 0.73rem;
  line-height: 1.35;
  white-space: pre-wrap;
}
.inv-detail-val {
  color: #8af;
  font-size: 0.7rem;
  margin-top: 3px;
}
.inv-detail-empty {
  color: #555;
  font-size: 0.7rem;
  font-style: italic;
}
.inv-detail-mods {
  color: #7f7;
  font-size: 0.7rem;
  margin-top: 3px;
}

/* ?? Equipment Bar ?? */
.eq-label {
  font-size: 0.72rem;
  color: #ffd700;
  font-weight: 600;
  margin-bottom: 3px;
  border-top: 1px solid #444;
  padding-top: 4px;
}
.eq-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}
.eq-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #1a1a2e;
  padding: 2px;
  position: relative;
}
.eq-slot.occupied {
  background: #2a2230;
  border-color: #765;
}
.eq-slot.occupied:hover {
  border-color: #ffd700;
}
.eq-slot-label {
  font-size: 0.58rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}
.eq-empty {
  color: #333;
  font-size: 1.1rem;
}
.eq-unequip {
  background: none;
  border: 1px solid #555;
  border-radius: 3px;
  color: #ca6;
  cursor: pointer;
  padding: 0px 4px;
  font-size: 0.6rem;
  margin-top: 1px;
  transition: background 0.15s, border-color 0.15s;
}
.eq-unequip:hover {
  background: #432;
  border-color: #ca6;
  color: #fc8;
}

/* ?? Skill Tree Panel ?? */
.sk-header {
  font-size: 0.78rem;
  color: #aaa;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #333;
}
.sk-sp { font-weight: 700; color: #888; }
.sk-sp-avail { color: #ffd700; }

.sk-group-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #888;
  margin: 8px 0 3px;
  padding-bottom: 2px;
  border-bottom: 1px solid #2a2a3a;
}
.sk-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.sk-card {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: #161626;
  border: 1px solid #2a2a3a;
  border-radius: 5px;
  padding: 5px 6px;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.sk-card:hover { background: #1e1e32; border-color: var(--sk-color, #555); }
.sk-card.sk-locked { opacity: 0.52; }
.sk-card.sk-maxed { border-color: #444; }
.sk-card.sk-learned { border-left: 2px solid var(--sk-color, #888); }
.sk-card.sk-available { border-left: 2px solid #333; }

.sk-icon-wrap {
  flex-shrink: 0;
  position: relative;
  width: 32px;
  height: 32px;
}
.sk-thumb {
  display: block;
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  border-radius: 4px;
}
.sk-icon-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  box-shadow: 0 0 0 1px #000;
}
.sk-icon-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  border-radius: 4px;
  font-size: 0.9rem;
  color: #888;
}

.sk-info { flex: 1; min-width: 0; }
.sk-name {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sk-prog-wrap {
  height: 3px;
  background: #2a2a3a;
  border-radius: 2px;
  margin-bottom: 2px;
  overflow: hidden;
}
.sk-prog-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}
.sk-level-text {
  font-size: 0.65rem;
  color: #888;
  margin-bottom: 2px;
}
.sk-mana { color: #66aaff; }
.sk-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}
.sk-req-item {
  font-size: 0.62rem;
  color: #c66;
  background: #2a1010;
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.6;
}
.sk-desc {
  font-size: 0.68rem;
  color: #999;
  margin-top: 3px;
  line-height: 1.3;
  display: none;
}
.sk-card:hover .sk-desc { display: block; }

.sk-train-btn {
  flex-shrink: 0;
  align-self: center;
  width: 24px;
  height: 24px;
  background: #1a2a1a;
  border: 1px solid #4a8;
  border-radius: 4px;
  color: #6c6;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.sk-train-btn:hover { background: #243; border-color: #8f8; color: #8f8; }

/* ?? Class select grid ?? */
#classSelectGrid .btn-outline-warning {
  font-size: 0.8rem;
  padding: 0.4rem;
  text-align: left;
}
#classSelectGrid .btn-outline-warning small {
  font-size: 0.65rem;
  display: block;
  white-space: normal;
}
#classSelectGrid .btn-check:checked + .btn-outline-warning {
  background: rgba(255, 193, 7, 0.15);
}

/* ?? PixiJS canvas fill ?? */
#pixiContainer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ?? Responsive: stack on small screens ?? */
@media (max-width: 767px) {
  .game-top {
    flex-direction: column;
  }
  .game-map-area {
    flex: 1 1 auto;
    min-height: 300px;
  }
  .game-right-panel {
    flex-direction: row-reverse;
    border-top: 1px solid #2a2a2a;
  }
  .game-btn-column {
    flex-direction: row;
    flex-wrap: wrap;
    width: auto;
    flex: 1;
    border-left: none;
    border-top: none;
  }
  .game-nav-btn {
    flex: 1 1 auto;
    min-width: 60px;
  }
  .game-side-overlay {
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 50vh;
  }
  .game-chat-area {
    height: 120px;
  }
}

/* ?? NPC Dialog bubble ?? */
.npc-portrait {
  border: 1px solid #554400;
  border-radius: 4px;
  background: #1a1a2e;
}

.npc-dialog {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 30;
  pointer-events: auto;
  background: rgba(10, 10, 20, 0.94);
  border: 1px solid #886600;
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 220px;
  max-width: 320px;
  color: #eee;
  box-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

/* ?? Shop panel items ?? */
.shop-item-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shop-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  transition: background 0.1s;
}
.shop-item-row:hover {
  background: rgba(255,200,50,0.08);
}
.shop-item-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  image-rendering: pixelated;
  border-radius: 3px;
  background: #111;
}
.shop-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shop-item-name {
  font-size: 0.8rem;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-item-price {
  font-size: 0.72rem;
  color: #ffcc44;
}
.btn-xs {
  padding: 1px 7px;
  font-size: 0.72rem;
  border-radius: 3px;
}

/* ================================================================
   Script Editor Overlay
   ================================================================ */
.script-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.script-editor-inner {
  display: flex;
  flex-direction: column;
  width: 96vw;
  height: 92vh;
  max-width: 1400px;
  background: #1e1e2e;
  border: 1px solid #44475a;
  border-radius: 6px;
  overflow: hidden;
}
.script-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #181825;
  border-bottom: 1px solid #44475a;
  flex-shrink: 0;
}
.script-editor-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.script-editor-sidebar {
  width: 200px;
  min-width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #181825;
  border-right: 1px solid #44475a;
  padding: 6px;
  overflow: hidden;
}
.script-list-panel {
  flex: 1;
  overflow-y: auto;
  margin-top: 2px;
}
.script-list-item {
  padding: 4px 6px;
  font-size: 0.78rem;
  color: #cdd6f4;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.script-list-item:hover { background: #313244; }
.script-list-item.active { background: #45475a; color: #f1fa8c; }
.script-editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 6px 8px;
}
.script-cm-wrap {
  flex: 1;
  overflow: hidden;
  border: 1px solid #44475a;
  border-radius: 4px;
}
.script-cm-wrap .CodeMirror {
  height: 100%;
  font-size: 0.85rem;
  font-family: 'Consolas', 'Fira Code', monospace;
}
.script-cm-fallback {
  width: 100%;
  height: 100%;
  background: #282a36;
  color: #f8f8f2;
  border: none;
  outline: none;
  resize: none;
  padding: 8px;
  font-size: 0.85rem;
  font-family: 'Consolas', 'Fira Code', monospace;
}
.script-editor-footer {
  padding: 4px 10px;
  background: #181825;
  border-top: 1px solid #44475a;
  font-size: 0.72rem;
  color: #6272a4;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
