/* ===================== */
/* BODY / BACKGROUND */
/* ===================== */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: white;
  background-image: url('your-background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ================= NAV BAR ================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(14px, 1.3vw, 18px) clamp(30px, 2.9vw, 40px);
  background: linear-gradient(to right, #3b0000, #1a0000);
}

.nav-left {
  display: flex;
  gap: clamp(8px, 0.7vw, 10px);
  align-items: center;
}

.nav-logo {
  height: clamp(30px, 2.6vw, 36px);
}

.brand-sub {
  font-size: clamp(12px, 1vw, 14px);
  opacity: 0.85;
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-link {
  margin-left: clamp(14px, 1.3vw, 18px);
  color: white;
  text-decoration: none;
  padding: clamp(5px, 0.4vw, 6px) clamp(10px, 0.9vw, 12px);
  border-radius: 6px;
  font-size: clamp(13px, 1vw, 15px);
  transition: background-color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background-color: rgba(255,255,255,0.15);
}

/* ================= DROPDOWN ================= */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: white;
  font-size: clamp(18px, 1.6vw, 22px);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}

.dropdown-toggle:hover {
  background-color: rgba(255,255,255,0.15);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: linear-gradient(to bottom, #2a2a2a, #1c1c1c);
  border-radius: 8px;
  width: clamp(190px, 16vw, 220px);
  display: none;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 1000;
  padding: 4px 0;
}

.dropdown-category {
  padding: clamp(10px, 0.9vw, 12px) clamp(14px, 1.2vw, 16px);
  font-size: clamp(10px, 0.85vw, 11px);
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
}

.dropdown-item {
  display: grid;
  grid-template-columns: clamp(28px, 2.3vw, 32px) 1fr;
  align-items: center;
  gap: clamp(10px, 0.9vw, 12px);
  padding: clamp(12px, 1vw, 14px) clamp(14px, 1.2vw, 16px);
  color: white;
  text-decoration: none;
  font-size: clamp(12px, 1vw, 14px);
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background-color: rgba(255,255,255,0.1);
}

.icon-box {
  width: clamp(24px, 2vw, 28px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.icon-box img {
  width: clamp(19px, 1.6vw, 22px);
  height: clamp(19px, 1.6vw, 22px);
  object-fit: contain;
}

.item-text { white-space: nowrap; }

.dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 8px 0;
}

.mobile-only-section,
.mobile-only { display: none; }

@media (max-width: 900px) {
  .mobile-only-section, .mobile-only { display: block; }
  .nav-right > .nav-link { display: none; }
}

/* ===================== */
/* PAGE HEADER */
/* ===================== */
.legacy-header {
  text-align: center;
  padding: 40px 20px 20px;
}

.legacy-header h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.legacy-header p {
  font-size: 16px;
  opacity: 0.85;
}

/* ===================== */
/* LOADING STATE */
/* ===================== */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 70px 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #ff0000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-state p { font-size: 15px; opacity: 0.7; }

/* ===================== */
/* CARD CONTAINER */
/* ===================== */
#card-container {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 auto;
  max-width: 1100px;
  box-sizing: border-box;
  width: 100%;
}

#card-container .loading-state { grid-column: 1 / -1; }

/* ===================== */
/* CARD DESIGN */
/* ===================== */
.card {
  background-color: #1e1e1e;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 20px rgba(0,0,0,0.7);
}

.card-banner { height: 2px; width: 100%; flex-shrink: 0; }

.card-image-box {
  background-color: #141414;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.skin-image { max-width: 100%; max-height: 70px; object-fit: contain; }

.card-category-badge {
  position: absolute;
  top: 5px; right: 5px;
  font-size: 8px; font-weight: 700;
  padding: 1px 5px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.card-identity {
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.skin-name {
  margin: 0;
  font-size: 13px; font-weight: 700;
  line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-value-row { display: flex; align-items: baseline; gap: 5px; }
.value-number { font-size: 15px; font-weight: 800; color: #ffffff; line-height: 1; }
.value-sub { font-size: 11px; color: rgba(255,255,255,0.4); }

.card-stats-pill {
  margin: 10px 10px 0;
  background-color: #141414;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 5px;
}

.card-stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }
.card-stat-label { color: rgba(255,255,255,0.45); font-weight: 400; }
.card-stat-value { font-weight: 700; color: white; }

.card-index-row {
  margin: 8px 10px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; padding: 0 2px;
}

.card-index-label { color: rgba(255,255,255,0.45); font-weight: 400; }

.card-index-value {
  font-weight: 700; color: white;
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 2px; justify-content: flex-end; max-width: 70%;
}

.index-value-icon { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }

.card-updated-wrap { padding: 0 10px 10px; }

.card-updated-strip {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 5px 10px;
  background: #252525; border-radius: 20px;
}

.card-updated-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; flex-shrink: 0;
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.6);
}

.card-updated-text {
  font-size: 9px; font-weight: 600;
  color: rgba(255, 255, 255, 0.45); letter-spacing: 0.2px;
}

.card-footer {
  margin-top: 10px;
  padding: 7px 12px;
  background: #181818;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
}

.card-footer-label { color: rgba(255,255,255,0.4); }
.card-footer-value { color: #FFFFFF; font-weight: 700; }

/* ===================== */
/* MODAL OVERLAY */
/* ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== */
/* LEGACY MODAL PIECES (edit panel, index builder) */
/* ===================== */
.modal-container {
  display: flex; justify-content: center; gap: 16px;
  max-width: 920px; width: 100%; height: 400px;
  align-items: center; animation: slideIn 0.3s ease;
}

.modal-container--large { max-width: 1180px; height: 460px; }

.modal-skin-card {
  background-color: #1e1e1e; border-radius: 12px;
  padding: 0; text-align: left; width: 200px; flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  overflow: hidden; display: flex; flex-direction: column;
  gap: 0; height: 80%; box-sizing: border-box;
}

.modal-panel {
  background-color: #1f1f1f; border-radius: 12px; flex: 1;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  display: flex; flex-direction: column;
  overflow: hidden; height: 100%; box-sizing: border-box;
}

.modal-header-new {
  padding: 16px 20px 14px; position: relative;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}

.modal-header-name { font-size: 19px; font-weight: 800; position: relative; z-index: 1; margin: 0; }

.modal-close {
  position: relative; font-size: 22px; cursor: pointer;
  color: white; opacity: 0.7; transition: opacity 0.2s; z-index: 10; line-height: 1;
}
.modal-close:hover { opacity: 1; }

.modal-body-split { display: flex; flex: 1; min-height: 0; overflow: hidden; }

.modal-content-area { flex: 1; overflow-y: auto; min-width: 0; min-height: 0; }

.modal-pane { display: none; flex-direction: column; gap: 12px; padding: 14px 16px; box-sizing: border-box; }
.modal-pane.active { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.modal-info-item {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 7px; padding: 8px 10px;
}

.modal-info-lbl {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.3); margin-bottom: 3px;
}

.modal-info-val { font-size: 12px; font-weight: 600; color: white; }

/* ===================== */
/* SEARCH BAR */
/* ===================== */
.search-container {
  margin: 20px auto 10px;
  display: flex; justify-content: center;
  max-width: 500px; width: 100%; min-width: 0;
}

.search-container input {
  flex: 1; min-width: 0;
  padding: 11px 14px;
  border: none; border-radius: 30px 0 0 30px;
  background-color: #2a2a2a; color: white;
  font-size: 14px; outline: none;
}

.search-container input::placeholder { color: rgba(255,255,255,0.6); }
.search-container input:focus { box-shadow: 0 0 6px rgba(255,80,80,0.7); }

.search-btn {
  padding: 0 14px; border: none;
  background-color: #1f1f1f; border-radius: 0 30px 30px 0;
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.search-btn:hover { background-color: #3b0000; }
.search-btn img { width: 16px; height: 16px; filter: invert(1); }

/* ===================== */
/* EDITOR TOGGLE */
/* ===================== */
#editor-toggle-wrap {
  position: fixed; top: 70px; left: 16px;
  z-index: 9999; display: none; align-items: center; gap: 10px;
  background: rgba(20,20,20,0.95); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 30px; padding: 8px 14px;
  backdrop-filter: blur(8px); box-shadow: 0 4px 20px rgba(0,0,0,0.7);
  transition: border-color 0.3s;
}

#editor-toggle-wrap.edit-mode-active {
  border-color: rgba(192,57,43,0.6);
  box-shadow: 0 4px 20px rgba(192,57,43,0.3);
}

.editor-toggle-label {
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}

.editor-toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.editor-toggle-switch input { opacity: 0; width: 0; height: 0; }

.editor-toggle-slider {
  position: absolute; inset: 0; background: #333;
  border-radius: 22px; cursor: pointer; transition: background 0.25s;
}

.editor-toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  background: white; border-radius: 50%; transition: transform 0.25s;
}

.editor-toggle-switch input:checked + .editor-toggle-slider { background: linear-gradient(135deg, #c0392b, #7a0000); }
.editor-toggle-switch input:checked + .editor-toggle-slider::before { transform: translateX(18px); }

/* ===================== */
/* EDIT PANEL */
/* ===================== */
.edit-panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px;
}

.edit-panel {
  background: linear-gradient(to bottom, #242424, #1a1a1a);
  border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.9); border: 1px solid rgba(255,80,80,0.2);
  animation: slideIn 0.25s ease;
}

.edit-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
}

.edit-panel-title { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255,255,255,0.8); }

.edit-panel-img { width: 36px; height: 36px; object-fit: contain; background: rgba(255,255,255,0.05); border-radius: 6px; }

.edit-panel-close { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 20px; cursor: pointer; padding: 0 4px; transition: color 0.2s; }
.edit-panel-close:hover { color: white; }

.edit-panel-body { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.edit-field-group { display: flex; flex-direction: column; gap: 6px; }
.edit-field-wide { grid-column: 1 / -1; }

.edit-field-group label {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.edit-field-group input,
.edit-field-group textarea,
.edit-field-group select {
  background: #2a2a2a; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px; color: white; font-size: 14px; padding: 9px 12px;
  outline: none; transition: border-color 0.2s; font-family: inherit; resize: vertical;
}

.edit-field-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px; cursor: pointer;
}

.edit-field-group select option { background: #2a2a2a; color: white; }

.edit-field-group input:focus,
.edit-field-group textarea:focus,
.edit-field-group select:focus { border-color: rgba(192,57,43,0.6); box-shadow: 0 0 0 2px rgba(192,57,43,0.15); }

.edit-panel-footer { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08); }

.edit-panel-status { flex: 1; font-size: 13px; }
.status-ok  { color: #4caf50; }
.status-err { color: #ff5555; }
.status-warn { color: #ffa500; }

.edit-panel-cancel {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: white; padding: 8px 16px; border-radius: 7px; font-size: 13px; cursor: pointer; transition: background 0.2s;
}

.edit-panel-cancel:hover { background: rgba(255,255,255,0.13); }

.edit-panel-apply {
  background: linear-gradient(135deg, #3b0000, #5a0000); border: 1px solid rgba(255,80,80,0.35);
  color: white; padding: 8px 20px; border-radius: 7px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.2s;
}

.edit-panel-apply:hover { background: linear-gradient(135deg, #5a0000, #7a0000); }
.edit-panel-apply:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===================== */
/* INDEX VALUE DISPLAY */
/* ===================== */
.index-value-display {
  margin-top: 6px; padding: 8px 10px;
  background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px; font-size: 13px; color: rgba(255,255,255,0.75);
  min-height: 36px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}

.index-value-builder-btn {
  background: linear-gradient(135deg, #1a1a2e, #2a2a4a);
  border: 1px solid rgba(88,101,242,0.4); color: rgba(255,255,255,0.85);
  padding: 8px 14px; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.2s, border-color 0.2s; font-family: inherit;
}

.index-value-builder-btn:hover { background: linear-gradient(135deg, #2a2a4a, #3a3a6a); border-color: rgba(88,101,242,0.7); }

/* ===================== */
/* INDEX VALUE BUILDER MODAL */
/* ===================== */
#index-builder-modal { z-index: 1100; }

#index-builder-modal .modal-content {
  background: linear-gradient(to bottom, #242424, #1a1a1a);
  border-radius: 14px; width: 100%; max-width: 680px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.9); border: 1px solid rgba(88,101,242,0.25);
  animation: slideIn 0.25s ease; display: flex; flex-direction: column;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
}

.modal-header h2 { margin: 0; font-size: 16px; color: white; }

.modal-header .modal-close {
  position: static; font-size: 24px; cursor: pointer;
  color: rgba(255,255,255,0.5); line-height: 1; transition: color 0.2s;
}

.modal-header .modal-close:hover { color: white; }

.index-builder-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }

.index-preview-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; min-height: 52px;
}

.empty-preview { margin: 0; font-size: 13px; color: rgba(255,255,255,0.3); font-style: italic; }

.preview-item {
  display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px; padding: 4px 8px; font-size: 13px; color: white;
}

.preview-sign { font-size: 14px; color: #f0c040; }
.preview-icon { width: 24px; height: 24px; object-fit: contain; border-radius: 4px; }
.preview-plus { font-size: 16px; color: rgba(255,255,255,0.4); font-weight: 700; }

.index-builder-section { display: flex; flex-direction: column; gap: 10px; }

.index-builder-section h3 {
  margin: 0; font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px;
}

.item-search-bar { position: relative; display: flex; align-items: center; }

.item-search-bar input {
  width: 100%; padding: 9px 36px 9px 12px; background: #2a2a2a;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: white;
  font-size: 13px; outline: none; font-family: inherit; transition: border-color 0.2s; box-sizing: border-box;
}

.item-search-bar input:focus { border-color: rgba(88,101,242,0.5); }

.item-search-bar .search-icon {
  position: absolute; right: 10px; font-size: 14px;
  pointer-events: none; color: rgba(255,255,255,0.4);
}

.items-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px; max-height: 240px; overflow-y: auto; padding: 4px 2px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.items-grid::-webkit-scrollbar { width: 5px; }
.items-grid::-webkit-scrollbar-track { background: transparent; }
.items-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.item-card {
  background: #222; border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
  padding: 8px 6px; text-align: center; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}

.item-card:hover { background: #2e2e2e; border-color: rgba(255,255,255,0.18); transform: translateY(-1px); }

.item-card.selected {
  background: rgba(88,101,242,0.2); border-color: rgba(88,101,242,0.6);
  box-shadow: 0 0 8px rgba(88,101,242,0.3);
}

.item-card-image { width: 48px; height: 48px; object-fit: contain; border-radius: 4px; }

.item-card-name {
  font-size: 10px; color: rgba(255,255,255,0.7); line-height: 1.2;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.no-items-found { grid-column: 1 / -1; text-align: center; padding: 20px; color: rgba(255,255,255,0.3); font-size: 13px; }

.index-controls-section { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.index-control-group { display: flex; flex-direction: column; gap: 8px; }

.index-control-group label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; }

.index-control-group input[type="number"] {
  width: 80px; background: #2a2a2a; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px; color: white; font-size: 14px; padding: 8px 10px;
  outline: none; font-family: inherit; transition: border-color 0.2s;
}

.index-control-group input[type="number"]:focus { border-color: rgba(88,101,242,0.5); }

.sign-buttons { display: flex; gap: 6px; }

.sign-btn {
  background: #2a2a2a; border: 1px solid rgba(255,255,255,0.1); border-radius: 7px;
  color: rgba(255,255,255,0.7); font-size: 16px; width: 38px; height: 36px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s; padding: 0; font-family: inherit;
}

.sign-btn:hover { background: #3a3a3a; color: white; border-color: rgba(255,255,255,0.2); }

.sign-btn.active { background: linear-gradient(135deg, #5865F2, #7289DA); border-color: transparent; color: white; box-shadow: 0 0 8px rgba(88,101,242,0.4); }

.sign-btn[data-sign=""] { font-size: 11px; width: auto; padding: 0 10px; font-weight: 600; }

.index-builder-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; flex-wrap: wrap; }

.btn-primary {
  background: linear-gradient(135deg, #3b0000, #5a0000); border: 1px solid rgba(255,80,80,0.35);
  color: white; padding: 9px 20px; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background 0.2s; font-family: inherit;
}

.btn-primary:hover { background: linear-gradient(135deg, #5a0000, #7a0000); }

.btn-secondary {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8); padding: 9px 16px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: background 0.2s; font-family: inherit;
}

.btn-secondary:hover { background: rgba(255,255,255,0.12); color: white; }

/* ===================== */
/* VL CONTROLS ROW */
/* ===================== */
.vl-controls {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 20px auto 0; max-width: 700px; width: 100%; padding: 0 12px; box-sizing: border-box;
}

.vl-filter-btn {
  background: #2a2a2a; border: 1px solid rgba(255,255,255,0.1); color: white;
  padding: 0 14px; border-radius: 30px; font-size: 14px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 6px; white-space: nowrap; height: 44px; flex-shrink: 0;
}

.vl-filter-btn:hover, .vl-filter-btn.active { background: #3a3a3a; border-color: rgba(255,0,0,0.4); }

.vl-filter-btn.active { background: linear-gradient(135deg, #3b0000, #5a0000); border-color: rgba(255,80,80,0.5); }

.vl-filter-icon { font-size: 15px; }

.vl-controls .search-container { margin: 0; flex: 1; min-width: 0; max-width: none; }

.vl-filter-menu {
  background: #2a2a2a; border-bottom: 1px solid rgba(255,255,255,0.08);
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease;
}

.vl-filter-menu.active { max-height: 200px; padding: 18px 0; }

.vl-filter-content {
  display: flex; align-items: flex-end; gap: 20px;
  max-width: 700px; margin: 0 auto; padding: 0 20px; flex-wrap: wrap;
}

.vl-filter-section { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 140px; }

.vl-filter-section label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px; }

.vl-filter-section select {
  background: #1f1f1f; border: 1px solid rgba(255,255,255,0.1); color: white;
  padding: 9px 32px 9px 12px; border-radius: 8px; font-size: 13px; outline: none; cursor: pointer;
  transition: border-color 0.2s; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.4)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; font-family: inherit;
}

.vl-filter-section select option { background: #2a2a2a; }
.vl-filter-section select:focus { border-color: rgba(192,57,43,0.6); box-shadow: 0 0 0 2px rgba(192,57,43,0.15); }

.vl-clear-btn {
  background: rgba(255,0,0,0.15); border: 1px solid rgba(255,0,0,0.25); color: #ff8080;
  padding: 9px 18px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; white-space: nowrap; align-self: flex-end; font-family: inherit; height: 36px;
}

.vl-clear-btn:hover { background: rgba(255,0,0,0.25); border-color: rgba(255,0,0,0.45); color: #ffaaaa; }

/* ===================== */
/* GUIDE BUTTON */
/* ===================== */
.vl-guide-btn {
  background: #2a2a2a; border: 1px solid rgba(255,255,255,0.1); color: white;
  padding: 0 14px; border-radius: 30px; font-size: 14px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 6px; white-space: nowrap; height: 44px; flex-shrink: 0;
}

.vl-guide-btn:hover, .vl-guide-btn.active { background: #3a3a3a; border-color: rgba(255,255,255,0.25); }

/* ===================== */
/* GUIDE MODAL */
/* ===================== */
.guide-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1200; padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}

.guide-overlay.active { opacity: 1; pointer-events: all; }

.guide-book {
  background: linear-gradient(to bottom, #242424, #1c1c1c);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; width: 100%;
  max-width: 480px; max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.9); overflow: hidden;
}

.guide-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); flex-shrink: 0;
}

.guide-title { font-size: 16px; font-weight: 700; color: white; }

.guide-close {
  background: none; border: none; color: rgba(255,255,255,0.5); font-size: 20px; cursor: pointer;
  padding: 2px 6px; border-radius: 6px; transition: color 0.2s, background 0.2s; line-height: 1;
}

.guide-close:hover { color: white; background: rgba(255,255,255,0.1); }

.guide-body {
  overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.guide-body::-webkit-scrollbar { width: 5px; }
.guide-body::-webkit-scrollbar-track { background: transparent; }
.guide-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.guide-intro { margin: 0; font-size: 13px; color: rgba(255,255,255,0.5); line-height: 1.5; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.06); }

.guide-list { display: flex; flex-direction: column; gap: 12px; }

.guide-item { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 12px 14px; }

.guide-item-title { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.guide-item-desc { font-size: 13px; color: rgba(255,255,255,0.65); line-height: 1.55; }

.guide-back {
  background: none; border: none; color: rgba(255,255,255,0.5); font-size: 20px; cursor: pointer;
  padding: 2px 8px; border-radius: 6px; transition: color 0.2s, background 0.2s; line-height: 1; display: none;
}

.guide-back:hover { color: white; background: rgba(255,255,255,0.1); }

.guide-nav-item { cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.guide-nav-item:hover { background: rgba(255,255,255,0.06); border-color: rgba(88,101,242,0.4); transform: translateY(-1px); }
.guide-nav-title { color: #60A5FA !important; }

.guide-click-hint { margin: -8px 0 4px; font-size: 12px; color: rgba(88,101,242,0.8); font-style: italic; }

.guide-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; color: rgba(255,255,255,0.65);
  line-height: 1.5; margin-top: 4px;
}

.guide-note-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ===================== */
/* INDEX BUILDER TOOLBAR */
/* ===================== */
.index-skin-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.index-skin-toolbar h3 { margin: 0; }
.index-sort-toggle { display: flex; gap: 4px; }

.index-sort-btn {
  background: #2a2a2a; border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.6);
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s; font-family: inherit; white-space: nowrap;
}

.index-sort-btn:hover { background: #3a3a3a; color: white; border-color: rgba(255,255,255,0.2); }
.index-sort-btn.active { background: linear-gradient(135deg, #3b0000, #5a0000); border-color: rgba(255,80,80,0.45); color: white; }

/* ===================== */
/* COIN ICON */
/* ===================== */
.coin-icon-small { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }

/* ===================== */
/* INDEX VALUE TOOLTIP */
/* ===================== */
.index-img-wrap {
  position: relative; display: inline-flex; align-items: center; justify-content: center; cursor: default;
}

.index-img-wrap::after {
  content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) scale(0.9); background: #1a1a1a; color: #fff;
  font-size: 11px; font-weight: 600; white-space: nowrap; padding: 4px 8px;
  border-radius: 6px; border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.7); pointer-events: none; opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease; z-index: 9999; letter-spacing: 0.2px;
}

.index-img-wrap::before {
  content: ''; position: absolute; bottom: calc(100% + 1px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: rgba(255,255,255,0.15);
  pointer-events: none; opacity: 0; transition: opacity 0.15s ease; z-index: 9999;
}

@media (hover: hover) and (pointer: fine) {
  .index-img-wrap:hover::after, .index-img-wrap:hover::before { opacity: 1; transform: translateX(-50%) scale(1); }
}

.index-img-wrap.tooltip-visible::after,
.index-img-wrap.tooltip-visible::before { opacity: 1; transform: translateX(-50%) scale(1); }

/* ===================== */
/* SKELETON ANIMATION */
/* ===================== */
.skeleton-block {
  background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; flex-shrink: 0;
}

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===================== */
/* RESPONSIVE (non-modal) */
/* ===================== */
@media (max-width: 900px) {
  #card-container { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  #card-container { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px; gap: 10px; }
}

@media (max-width: 600px) {
  #card-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edit-panel-body { grid-template-columns: 1fr; }
  .edit-field-wide { grid-column: 1; }
  #editor-toggle-wrap { top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); }
  #index-builder-modal .modal-content { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 95vh; }
  .index-controls-section { flex-direction: column; gap: 12px; }
  .sign-buttons { flex-wrap: wrap; }
  .index-builder-actions { justify-content: stretch; }
  .index-builder-actions .btn-primary, .index-builder-actions .btn-secondary { flex: 1; text-align: center; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); max-height: 180px; }
  .vl-controls { max-width: 100%; padding: 0 10px; gap: 6px; }
  .vl-filter-text { display: none; }
  .vl-filter-btn, .vl-guide-btn { padding: 0 12px; height: 40px; min-width: 40px; justify-content: center; }
  .vl-filter-content { flex-direction: column; align-items: stretch; }
  .vl-filter-section { min-width: unset; }
  .vl-clear-btn { width: 100%; text-align: center; }
  .guide-overlay { align-items: flex-end; padding: 0; }
  .guide-book { max-height: 90vh; max-width: 100%; border-radius: 16px 16px 0 0; }
  .search-container { max-width: 100%; }
}

@media (max-width: 480px) {
  #card-container { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; gap: 8px; }
  .card-image-box { height: 75px; }
  .value-number { font-size: 18px; }
  .vl-filter-btn, .vl-guide-btn { padding: 0 10px; height: 38px; }
  .search-container input { font-size: 13px; padding: 10px 10px; }
}

/* ============================================================ */
/* NEW MODAL — nm-* styles                                     */
/* ============================================================ */

@keyframes nmSlideIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes nmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===================== */
/* MODAL WRAPPER         */
/* ===================== */
.nm-modal-wrap {
  display: flex;
  width: 100%;
  max-width: 1020px;
  max-height: 88vh;
  height: 72vh;           /* ← give it a fixed height so flex children fill it */
  animation: nmSlideIn 0.25s ease;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,0.9);
  background: #181818;
}

.nm-modal-wrap--mobile {
  max-width: 100%;
  max-height: 92vh;
  height: 72vh;
  border-radius: 16px 16px 0 0;
}

/* ===================== */
/* LEFT PANEL            */
/* ===================== */
.nm-left-card {
  width: 210px;
  flex-shrink: 0;
  background: #181818;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.07);
  overflow-y: auto;
  scrollbar-width: none;
}
.nm-left-card::-webkit-scrollbar { display: none; }

.nm-card-imgbox {
  background: #1a0808;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  min-height: 180px;
  max-height: 210px;
}

.nm-card-img { width: 70%; height: 70%; object-fit: contain; }

.nm-card-badge {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap;
}

.nm-card-identity {
  padding: 12px 14px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.nm-card-name {
  font-size: 14px; font-weight: 800;
  line-height: 1.2; margin-bottom: 8px;
  word-break: break-word;
}

.nm-card-valueline { display: flex; align-items: baseline; gap: 5px; }
.nm-card-value { font-size: 22px; font-weight: 900; color: white; letter-spacing: -0.5px; }
.nm-card-valuelabel { font-size: 11px; color: rgba(255,255,255,0.35); }

.nm-card-stats {
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 7px;
  flex-shrink: 0;
}

.nm-stat-row { display: flex; justify-content: space-between; align-items: center; }
.nm-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.38); font-weight: 400; }
.nm-stat-val { font-size: 11px; font-weight: 700; color: white; }

.nm-card-est {
  padding: 8px 14px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.06); margin-top: 8px; flex-shrink: 0;
}

.nm-est-val { font-weight: 700; color: white; font-size: 11px; }

/* ===================== */
/* RIGHT AREA            */
/* ===================== */
.nm-right {
  flex: 1;
  min-width: 0;
  background: #181818;
  display: flex;
  overflow: hidden;
}

/* ===================== */
/* BODY SPLIT            */
/* ===================== */
.nm-body-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ===================== */
/* CONTENT AREA          */
/* ─ flex column so pane-scroll grows and bottomnav sticks to bottom */
/* ===================== */
.nm-content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* scrollable inner for panes */
.nm-pane-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.nm-pane-scroll::-webkit-scrollbar { width: 4px; }
.nm-pane-scroll::-webkit-scrollbar-track { background: transparent; }
.nm-pane-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ===================== */
/* PANES                 */
/* ===================== */
.nm-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 10px 18px 18px;
  box-sizing: border-box;
}

.nm-pane--active { display: flex; animation: nmFadeIn 0.18s ease; }

/* ===================== */
/* CLOSE BUTTON          */
/* ===================== */
.nm-close {
  position: static;
  background: rgba(30,30,30,0.95); border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.65); width: 28px; height: 28px;
  border-radius: 50%; font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s; padding: 0; line-height: 1; flex-shrink: 0;
}

.nm-close:hover { background: rgba(70,70,70,0.98); color: white; }

/* ===================== */
/* TOPBAR                */
/* ===================== */
.nm-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px 0;
  flex-shrink: 0;
}

/* ===================== */
/* DESKTOP BOTTOM NAV    */
/* Sits at the bottom of .nm-content-area, always visible */
/* ===================== */
.nm-bottomnav {
  display: flex;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.10);
  background: #111111;
  /* Ensure it's never squished or hidden */
  min-height: 52px;
}

.nm-bottomnav-item {
  flex: 1;
  background: none;
  border: none;
  border-top: 3px solid transparent;
  color: rgba(255,255,255,0.32);
  font-size: 11px;
  font-weight: 600;
  padding: 10px 4px 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-top-color 0.15s;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.nm-bottomnav-item:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.03); }
.nm-bottomnav-item--active { color: white; background: rgba(255,255,255,0.04); }

.nm-bottomnav-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  opacity: 0.55;
}

.nm-bottomnav-item--active .nm-bottomnav-icon,
.nm-bottomnav-item:hover .nm-bottomnav-icon { opacity: 1; }

.nm-bottomnav-label {
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ===================== */
/* CHART SECTION         */
/* ===================== */
.nm-chart-section { flex-shrink: 0; }

.nm-chart-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}

.nm-chart-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.8px; }

.nm-chart-ranges { display: flex; gap: 4px; }

.nm-range-btn {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.35); padding: 3px 11px; border-radius: 20px;
  font-size: 10px; font-weight: 700; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s; font-family: inherit; letter-spacing: 0.3px;
}

.nm-range-btn:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.75); }

.nm-range-active { background: rgba(255,255,255,0.13) !important; border-color: rgba(255,255,255,0.22) !important; color: white !important; }

.nm-chart-wrap { width: 100%; height: 160px; position: relative; flex-shrink: 0; }
.nm-chart-canvas { display: block; width: 100%; height: 100%; border-radius: 6px; }

/* ===================== */
/* CHART TOOLTIP         */
/* ===================== */
.chart-tooltip {
  position: absolute; transform: translateX(-50%);
  background: #222; border: 1px solid rgba(255,255,255,0.13);
  border-radius: 8px; padding: 5px 10px; pointer-events: auto; display: none;
  flex-direction: column; align-items: center; gap: 2px; z-index: 20;
  white-space: nowrap; box-shadow: 0 4px 16px rgba(0,0,0,0.65);
}

.chart-tooltip-val  { font-size: 13px; font-weight: 800; line-height: 1; }
.chart-tooltip-date { font-size: 9px; color: rgba(255,255,255,0.38); }

/* ===================== */
/* META ROW              */
/* ===================== */
.nm-meta-row {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.nm-meta-item {
  flex: 1;
  min-width: 110px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 9px 11px;
}

.nm-meta-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 4px;
  display: block;
}

.nm-meta-value {
  font-size: 12px;
  font-weight: 700;
  color: white;
}

/* ===================== */
/* DESCRIPTION           */
/* ===================== */
.nm-desc-section { flex-shrink: 0; }

.nm-desc-text {
  font-size: 12px; line-height: 1.7;
  color: rgba(255,255,255,0.55);
}

/* ===================== */
/* VIEW PANE             */
/* ===================== */
.nm-view-carousel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; flex: 1; min-height: 200px; }

.nm-view-img {
  max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px;
  background: rgba(0,0,0,0.2); transition: opacity 0.15s ease; display: block;
}

.nm-view-angle-label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.8px; }

.nm-dpad-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.nm-dpad-grid { display: grid; grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(3, 36px); gap: 4px; }

.nm-dpad-btn {
  width: 36px; height: 36px; background: #2a2a2a; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: rgba(255,255,255,0.65); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.1s, color 0.15s; padding: 0; line-height: 1;
}

.nm-dpad-btn:hover { background: #3a3a3a; color: white; border-color: rgba(255,255,255,0.2); }

.nm-dpad-btn.nm-dpad-selected,
.nm-dpad-btn.nm-dpad-flash {
  background: linear-gradient(135deg, #c0392b, #7a0000); border-color: transparent; color: white;
  box-shadow: 0 0 8px rgba(192,57,43,0.45);
}

.nm-dpad-center { background: #222; font-size: 12px; color: rgba(255,255,255,0.35); }
.nm-dpad-center:hover { background: #333; color: rgba(255,255,255,0.7); }
.nm-dpad-diag { font-size: 15px; color: rgba(255,255,255,0.42); }
.nm-dpad-sub { font-size: 9px; color: rgba(255,255,255,0.2); text-transform: uppercase; letter-spacing: 0.5px; }

/* ===================== */
/* ANIMATION PANE        */
/* ===================== */
.nm-anim-wrap { display: flex; align-items: center; justify-content: center; flex: 1; padding: 8px 0; }
.nm-anim-video { max-width: 100%; max-height: 280px; border-radius: 10px; background: #000; display: block; }

/* ===================== */
/* NO DATA               */
/* ===================== */
.nm-no-data {
  display: flex; align-items: center; justify-content: center; flex: 1;
  min-height: 120px; font-size: 13px; color: rgba(255,255,255,0.25); text-align: center; padding: 20px;
}

/* ===================== */
/* MOBILE TAB BAR        */
/* ===================== */
.nm-tabnav {
  display: flex; flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.08); background: #141414;
}

.nm-tabitem {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.35); font-size: 12px; font-weight: 600;
  padding: 11px 4px; cursor: pointer; transition: color 0.15s, background 0.15s;
  font-family: inherit; text-align: center; letter-spacing: 0.2px;
}

.nm-tabitem:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }
.nm-tabitem--active { color: white; background: rgba(255,255,255,0.04); }

/* ============================================================ */
/* HOARDS SIDEBAR                                              */
/* ============================================================ */

.nm-hoards-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #111111;
  border-left: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 500px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.nm-hoards-sidebar::-webkit-scrollbar { width: 4px; }
.nm-hoards-sidebar::-webkit-scrollbar-track { background: transparent; }
.nm-hoards-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ===================== */
/* HOARDS PANEL          */
/* ===================== */
.nm-hoards-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 12px;
  min-height: 0;
}

.nm-hoards-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
  flex-shrink: 0;
}

.nm-hoards-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.nm-hoards-title {
  font-size: 11px;
  font-weight: 800;
  color: white;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nm-hoards-count-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ===================== */
/* HOARDS TABLE          */
/* ===================== */
.nm-hoards-table-wrap {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.nm-hoards-table-wrap::-webkit-scrollbar { display: none; }

.nm-hoards-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.nm-hoards-table thead tr {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hoard-th-rank {
  width: 40px;
  text-align: left;
  padding: 0 6px 7px 0;
  font-size: 9px; font-weight: 700;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase; letter-spacing: 0.6px;
}

.hoard-th-player {
  text-align: left;
  padding: 0 4px 7px;
  font-size: 9px; font-weight: 700;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase; letter-spacing: 0.6px;
}

.hoard-th-qty {
  width: 48px;
  text-align: right;
  padding: 0 0 7px 4px;
  font-size: 9px; font-weight: 700;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase; letter-spacing: 0.6px;
}

.hoard-table-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.12s;
}

.hoard-table-row:hover { background: rgba(255,255,255,0.03); }
.hoard-table-row:last-child { border-bottom: none; }

.hoard-table-row.hoard-row--rank-1 { background: rgba(255,215,0,0.04); }
.hoard-table-row.hoard-row--rank-2 { background: rgba(192,192,192,0.03); }
.hoard-table-row.hoard-row--rank-3 { background: rgba(205,127,50,0.03); }

.hoard-td-rank { padding: 8px 6px 8px 0; vertical-align: middle; width: 40px; }
.hoard-rank-num { font-size: 12px; font-weight: 700; line-height: 1; }
.hoard-td-player { padding: 8px 4px; vertical-align: middle; }

.hoard-player-cell {
  display: flex; align-items: center; gap: 7px; min-width: 0;
}

.hoard-avatar {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}

.hoard-avatar-anon {
  background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.08);
}

.hoard-username {
  font-size: 11px; font-weight: 600; color: white;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}

.hoard-anon { color: rgba(255,255,255,0.3); font-style: italic; }

.hoard-td-qty { padding: 8px 0 8px 4px; text-align: right; vertical-align: middle; width: 48px; }
.hoard-qty-val { font-size: 12px; font-weight: 800; letter-spacing: 0.2px; }

.hoard-skeleton-row td { padding: 8px 4px; }

.nm-hoards-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 28px 10px; color: rgba(255,255,255,0.25); font-size: 12px; text-align: center;
}

.nm-hoards-empty-icon { font-size: 22px; opacity: 0.4; }

.nm-hoards-footer {
  margin-top: 12px; text-align: center;
  font-size: 9px; color: rgba(255,255,255,0.18); font-style: italic; letter-spacing: 0.2px; flex-shrink: 0;
}

/* ============================================================ */
/* RENTING STRIP — bottom of info pane                        */
/* ============================================================ */

/* ── Subheader label ── */
.nm-renting-subheader {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.30);
  margin-bottom: 6px;
}

.nm-renting-container {
  flex-shrink: 0;
  margin-top: 2px;
}

.nm-renting-strip {
  background: #141414;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
}

.nm-renting-strip--loading { opacity: 0.7; }

.nm-renting-strip--empty {
  background: transparent;
  border-color: rgba(255,255,255,0.05);
}

.nm-renting-strip-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  flex-wrap: nowrap;
  min-width: 0;
}

.nm-rent-skin-cell {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.nm-rent-img {
  width: 36px; height: 36px; object-fit: contain;
  background: rgba(255,255,255,0.04); border-radius: 6px; padding: 3px;
  border: 1px solid rgba(255,255,255,0.07); flex-shrink: 0;
}

.nm-rent-skin-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.nm-rent-skin-name {
  font-size: 12px; font-weight: 700; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; display: block;
}

.nm-rent-skin-type {
  font-size: 9px; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 0.4px;
}

.nm-rent-price {
  font-size: 13px; font-weight: 800; color: #FFD700;
  display: flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap;
}

.nm-rent-durations {
  display: flex; gap: 3px; align-items: center;
  flex: 1; min-width: 0; flex-wrap: wrap;
}

.nm-rent-dur-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; white-space: nowrap;
}

.nm-rent-dur-badge--on {
  background: rgba(76, 175, 80, 0.13); border: 1px solid rgba(76, 175, 80, 0.28); color: #81C784;
}

.nm-rent-dur-badge--off {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); color: rgba(255,255,255,0.2);
}

.nm-rent-view-btn {
  background: #8B0000; border: none; color: white;
  padding: 7px 14px; border-radius: 6px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background 0.2s; white-space: nowrap; flex-shrink: 0;
  text-decoration: none; display: inline-flex; align-items: center;
}

.nm-rent-view-btn:hover { background: #a80000; }

.nm-renting-unavailable {
  font-size: 11px; color: rgba(255,255,255,0.2);
  font-style: italic; width: 100%; text-align: center; padding: 8px 0;
}

/* ============================================================ */
/* VALUE HISTORY LOGS PANEL                                    */
/* ============================================================ */

.history-logs-panel {
  max-width: 520px;
  max-height: 85vh;
}

/* Info bar explaining the feature */
.history-logs-info-bar {
  background: rgba(76,175,80,0.07);
  border-bottom: 1px solid rgba(76,175,80,0.15);
  padding: 10px 20px;
  flex-shrink: 0;
}

.history-logs-info-text {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
}

/* Scrollable list */
.history-logs-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  max-height: 420px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.history-logs-list::-webkit-scrollbar { width: 4px; }
.history-logs-list::-webkit-scrollbar-track { background: transparent; }
.history-logs-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

/* Loading inside list */
.history-logs-loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 40px 0; font-size: 13px; color: rgba(255,255,255,0.35);
}

/* Empty state */
.history-logs-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 20px; color: rgba(255,255,255,0.25); font-size: 13px; text-align: center;
}

/* Each log row */
.history-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.history-log-row:hover { background: rgba(255,255,255,0.055); }

/* Marked-for-deletion state */
.history-log-row--deleted {
  opacity: 0.45;
  background: rgba(255, 50, 50, 0.06);
  border-color: rgba(255, 80, 80, 0.2);
  text-decoration: line-through;
  text-decoration-color: rgba(255,80,80,0.5);
}

.history-log-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.history-log-value {
  font-size: 14px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.history-log-date {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Delete / undo button */
.history-log-delete-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.45);
  width: 28px; height: 28px;
  border-radius: 6px; font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  padding: 0; flex-shrink: 0; line-height: 1;
}

.history-log-delete-btn:hover {
  background: rgba(255,80,80,0.15);
  border-color: rgba(255,80,80,0.4);
  color: #ff8080;
}

/* Active (marked) state — shows undo arrow */
.history-log-delete-btn--active {
  background: rgba(255,80,80,0.18);
  border-color: rgba(255,80,80,0.45);
  color: #ff6060;
}

.history-log-delete-btn--active:hover {
  background: rgba(76,175,80,0.15);
  border-color: rgba(76,175,80,0.4);
  color: #81C784;
}

/* ===================== */
/* RESPONSIVE (modal)    */
/* ===================== */
@media (max-width: 899px) {
  .nm-left-card { display: none; }
  .nm-hoards-sidebar { display: none; }
  .nm-bottomnav { display: none; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .nm-modal-wrap {
    max-width: 100%; max-height: 62vh; height: 62vh;
    border-radius: 16px 16px 0 0; box-shadow: none;
  }

  .nm-right { flex-direction: column; overflow: hidden; max-height: 92vh; }
  .nm-body-split { flex: 1; min-height: 0; }
  .nm-content-area { flex: 1; overflow-y: auto; }
  .nm-close { right: 12px; }
  .nm-chart-wrap { height: 130px; }
  .nm-pane { padding: 42px 14px 14px; }
  .nm-renting-strip-inner { flex-wrap: wrap; gap: 8px; }
  .nm-rent-skin-name { max-width: 140px; }
}

@media (max-width: 600px) {
  .nm-chart-wrap { height: 120px; }
  .nm-pane { padding: 38px 12px 12px; gap: 10px; }
  .nm-view-img { max-height: 150px; }
  .nm-dpad-grid { grid-template-columns: repeat(3, 32px); grid-template-rows: repeat(3, 32px); }
  .nm-dpad-btn { width: 32px; height: 32px; font-size: 15px; }
  .nm-anim-video { max-height: 200px; }
  .nm-renting-strip-inner { flex-wrap: wrap; }
  .nm-rent-durations { flex-wrap: wrap; }

  .history-logs-panel { max-width: 100%; border-radius: 16px 16px 0 0; }
  .history-log-info { flex-direction: column; gap: 2px; }
}

/* ============================================================ */
/* MOBILE HOARDS PANE                                          */
/* ============================================================ */

.nm-hoards-pane-inner {
  width: 100%;
}

.nm-hoards-pane-inner .nm-hoards-panel {
  width: 100%;
  padding: 0;
}

.nm-hoards-pane-inner .nm-hoards-header {
  padding-bottom: 12px;
  margin-bottom: 12px;
}

/* Slightly larger rows for the full-width list view */
.nm-hoards-pane-inner .hoard-table-row td {
  padding: 11px 6px;
}

.nm-hoards-pane-inner .hoard-avatar {
  width: 34px;
  height: 34px;
}

.nm-hoards-pane-inner .hoard-username {
  font-size: 13px;
}

.nm-hoards-pane-inner .hoard-qty-val {
  font-size: 14px;
}

.nm-hoards-pane-inner .hoard-rank-num {
  font-size: 14px;
}

.nm-hoards-pane-inner .nm-hoards-title {
  font-size: 13px;
}

/* Remove the fixed max-height so the full list scrolls naturally with the pane */
.nm-hoards-pane-inner .nm-hoards-table-wrap {
  overflow-y: visible;
  max-height: none;
}

/* Stretch the table to fill available width */
.nm-hoards-pane-inner .nm-hoards-table {
  width: 100%;
}

/* Column widths slightly wider on mobile for readability */
.nm-hoards-pane-inner .hoard-th-qty,
.nm-hoards-pane-inner .hoard-td-qty {
  width: 60px;
}

.nm-hoards-pane-inner .hoard-th-rank,
.nm-hoards-pane-inner .hoard-td-rank {
  width: 44px;
}

/* Placeholder state before data loads */
.nm-hoards-pane-placeholder .nm-hoards-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ===================== */
/* CARD EDIT BUTTON      */
/* ===================== */
.card-edit-btn-wrap {
  padding: 0 10px 10px;
  position: relative;
  z-index: 2;
}

.card-edit-btn {
  width: 100%;
  background: linear-gradient(135deg, #3b0000, #5a0000);
  border: 1px solid rgba(255, 80, 80, 0.35);
  color: white;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

.card-edit-btn:hover {
  background: linear-gradient(135deg, #5a0000, #7a0000);
}

/* ===================== */
/* CHART TOOLTIP DELETE  */
/* ===================== */
.chart-tooltip-delete {
  background: #8B0000;
  border: none;
  color: white;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 2px;
  transition: background 0.2s;
  pointer-events: auto;
}

.chart-tooltip-delete:hover { background: #a80000; }
.chart-tooltip-delete:disabled { opacity: 0.5; cursor: not-allowed; }