/* ============================================ */
/*  ВОЙНА ПОДЗЕМЕЛИЙ — FANTASY EDITION v2       */
/* ============================================ */

:root {
  --bg-abyss: #05080f;
  --bg-dungeon: #0c1119;
  --bg-stone: #141c2b;
  --bg-parchment: #1a2438;
  --bg-card: #1e2a42;
  --bg-card-hover: #263350;
  --bg-equip: #16203a;
  --text-glow: #f0e6d3;
  --text-bright: #e8dcc8;
  --text-normal: #b8a98e;
  --text-dim: #7a6f5f;
  --text-ancient: #5c5244;
  --gold: #d4a017;
  --gold-bright: #f5c842;
  --gold-dim: #8b6914;
  --light-primary: #4a90d9;
  --dark-primary: #8b3a9f;
  --hp: #c0392b;
  --hp-glow: #e74c3c;
  --xp: #8e44ad;
  --xp-glow: #a569bd;
  --energy: #f39c12;
  --energy-glow: #f1c40f;
  --rarity-common: #8e8e8e;
  --rarity-uncommon: #2ecc71;
  --rarity-rare: #3498db;
  --rarity-epic: #9b59b6;
  --rarity-legendary: #f39c12;
  --border-rune: rgba(212,160,23,0.25);
  --border-stone: rgba(255,255,255,0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-abyss);
  color: var(--text-bright);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== LOADING ===== */
.loading-screen {
  position: fixed; inset: 0; background: var(--bg-abyss);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 1000; transition: opacity 0.8s ease, visibility 0.8s;
}
.loading-screen.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-portal { position: relative; width: 120px; height: 120px; margin-bottom: 24px; }
.loading-ring { position: absolute; inset: 0; border: 3px solid transparent; border-top-color: var(--gold); border-radius: 50%; animation: portalSpin 2s linear infinite; }
.loading-ring:nth-child(2) { inset: 12px; border-top-color: var(--gold-dim); animation-duration: 3s; animation-direction: reverse; }
@keyframes portalSpin { to { transform: rotate(360deg); } }
.loading-emblem { position: absolute; inset: 30px; display: flex; align-items: center; justify-content: center; font-size: 36px; animation: emblemPulse 2s ease-in-out infinite; }
@keyframes emblemPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.loading-title { font-family: 'Cinzel Decorative', serif; font-size: 20px; font-weight: 700; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-align: center; letter-spacing: 2px; margin-bottom: 6px; }
.loading-subtitle { font-family: 'Cinzel', serif; font-size: 11px; color: var(--text-dim); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 24px; }
.loading-rune-bar { width: 200px; height: 4px; background: var(--bg-stone); border-radius: 2px; overflow: hidden; border: 1px solid var(--border-rune); }
.loading-rune-fill { height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 2px; width: 0%; transition: width 0.4s ease; }
.loading-hint { font-family: 'Cinzel', serif; font-size: 11px; color: var(--text-ancient); margin-top: 14px; cursor: pointer; }

/* ===== APP ===== */
.app { position: relative; z-index: 1; padding-bottom: env(safe-area-inset-bottom); }
.app.hidden { display: none !important; }

/* ===== HEADER ===== */
.ornate-header {
  position: relative; background: linear-gradient(180deg, var(--bg-stone) 0%, var(--bg-dungeon) 100%);
  border-bottom: 2px solid var(--border-rune); padding: 12px 16px; overflow: hidden;
}
.ornate-header::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(212,160,23,0.08) 0%, transparent 60%); pointer-events: none; }
.char-row { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.char-frame {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--gold); background: var(--bg-parchment);
  display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
  box-shadow: 0 0 12px rgba(212,160,23,0.2), inset 0 0 12px rgba(0,0,0,0.3);
  overflow: hidden;
}
.char-frame img.vk-photo {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
}
.char-details { flex: 1; min-width: 0; }
.char-name { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; color: var(--text-glow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-subtitle { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.char-level-badge { font-family: 'Cinzel', serif; font-size: 10px; font-weight: 700; color: var(--gold); background: rgba(212,160,23,0.15); border: 1px solid rgba(212,160,23,0.3); padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.char-gold-display { display: flex; align-items: center; gap: 5px; background: linear-gradient(135deg, rgba(212,160,23,0.12), rgba(212,160,23,0.05)); border: 1px solid rgba(212,160,23,0.25); padding: 6px 12px; border-radius: 18px; flex-shrink: 0; }
.gold-icon { font-size: 16px; }
.gold-amount { font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700; color: var(--gold-bright); }

/* ===== TASK252 — CHARACTER HEADER: full-value bars + action buttons ===== */
/* Row 1: header with avatar/name/level/gold (already .ornate-header) */
/* Row 2: full-width bars with complete numbers + thin progress */
/* Row 3: action buttons side-by-side */
/* Row 4: secondary links (appearance, hero advisor) */

.char-bars-section {
  padding: 4px 12px 6px;
  background: var(--bg-dungeon);
  border-bottom: 1px solid var(--border-stone);
}
.char-bar-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 3px;
}
.char-bar-row:last-child { margin-bottom: 0; }
.char-bar-icon { font-size: 12px; width: 16px; text-align: center; flex-shrink: 0; }
.char-bar-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.char-bar-numbers {
  font-family: 'Cinzel', serif; font-size: 11px; color: var(--text-normal);
  white-space: nowrap; /* NO ellipsis — full values always visible */
}
.char-bar-track {
  height: 4px; background: rgba(0,0,0,0.5); border-radius: 2px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.03);
}
.char-bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.hp-fill { background: linear-gradient(90deg, #8b1a1a, #c44, #e66); }
.energy-fill { background: linear-gradient(90deg, #7d5a00, #da3, #fc5); }
.xp-fill { background: linear-gradient(90deg, #5b2c6f, #a3c, #c5e); }

/* Action buttons row */
.char-actions-row {
  display: flex; gap: 8px; padding: 4px 12px;
  background: var(--bg-dungeon); border-bottom: 1px solid var(--border-stone);
}
.char-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 8px; border-radius: 6px; text-decoration: none; cursor: pointer;
  transition: background 0.15s; border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}
.char-action-btn:hover { background: rgba(255,255,255,0.07); text-decoration: none; }
.char-action-btn:active { background: rgba(255,255,255,0.1); }
.guide-action { border-color: rgba(212,160,23,0.15); background: rgba(212,160,23,0.05); }
.guide-action:hover { background: rgba(212,160,23,0.12); }
.skills-action { border-color: rgba(155,127,212,0.15); background: rgba(155,127,212,0.05); }
.skills-action:hover { background: rgba(155,127,212,0.12); }
.char-action-icon { font-size: 14px; flex-shrink: 0; }
.char-action-label { font-size: 12px; font-weight: 600; color: var(--text-glow); white-space: nowrap; }

/* Secondary links row */
.char-secondary-links {
  display: flex; gap: 12px; padding: 3px 12px 5px;
  background: var(--bg-dungeon); border-bottom: 1px solid var(--border-stone);
}
.char-secondary-link {
  font-size: 11px; text-decoration: none; cursor: pointer; white-space: nowrap;
  color: var(--text-dim);
}
.char-secondary-link:hover { color: var(--text-glow); text-decoration: underline; }

/* ===== BARS (legacy — kept for JS compatibility, section removed from HTML) ===== */
.fantasy-bars { display: none; }
/* TASK249 compact-header-block legacy — replaced by TASK252 */
.compact-header-block { display: none; }

/* ===== STATS GEMS ===== */
.stats-gems { display: flex; justify-content: space-around; padding: 6px 10px; background: var(--bg-dungeon); border-bottom: 1px solid var(--border-rune); }
.gem { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 42px; max-width: 80px; overflow: hidden; }
.gem-icon { font-size: 15px; }
.gem-value { font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700; color: var(--text-glow); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.gem-label { font-size: 8px; color: var(--text-ancient); text-transform: uppercase; letter-spacing: 1px; }

/* ===== NAV TABS ===== */
.nav-tabs { display: flex; background: var(--bg-stone); border-bottom: 2px solid var(--border-rune); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  flex: 0 0 auto; min-width: 56px; padding: 8px 6px; border: none; background: transparent; color: var(--text-dim);
  font-family: 'Cinzel', serif; font-size: 9px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: all 0.2s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-tab.active { color: var(--gold-bright); background: rgba(212,160,23,0.08); }
.nav-tab-icon { font-size: 16px; }

/* TASK244 — Small guide icon button in header */
.guide-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px; text-decoration: none;
  font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0;
  background: rgba(212,160,23,0.1); border: 1px solid rgba(212,160,23,0.2);
  transition: background 0.15s;
}
.guide-icon-btn:hover { background: rgba(212,160,23,0.2); text-decoration: none; }
.guide-icon-btn:active { background: rgba(212,160,23,0.3); }

/* ===== TAB PANELS ===== */
.tab-content { padding: 0; }
.tab-panel { display: none; padding: 12px; }
.tab-panel.active { display: block; }

/* ===== SECTION HEADERS ===== */
.section-header {
  font-family: 'Cinzel', serif; font-size: 13px; font-weight: 700; color: var(--gold);
  letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border-rune);
  display: flex; align-items: center; gap: 8px;
}
.section-header .count { font-size: 10px; color: var(--text-dim); font-weight: 400; }

/* ===== EQUIP SLOTS ===== */
.equip-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.equip-slot {
  background: linear-gradient(135deg, var(--bg-equip), var(--bg-parchment));
  border: 1px solid var(--border-rune); border-radius: var(--radius-sm);
  padding: 8px; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
}
.equip-slot:active { background: var(--bg-card-hover); transform: scale(0.98); }
.equip-slot.full-width { grid-column: 1 / -1; }
.slot-inner { display: flex; align-items: center; gap: 8px; }
.slot-frame { font-size: 20px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); border-radius: 6px; flex-shrink: 0; }
.slot-info { flex: 1; min-width: 0; }
.slot-label { font-size: 9px; color: var(--text-ancient); text-transform: uppercase; letter-spacing: 1px; }
.slot-item-name { font-family: 'Cinzel', serif; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-item-name.filled { color: var(--text-glow); }
.slot-level { font-size: 8px; color: var(--gold); margin-top: 1px; }
.slot-bonuses { font-size: 9px; color: var(--text-dim); margin-top: 2px; }
.ring-pair { display: flex; gap: 6px; }
.ring-pair .equip-slot { flex: 1; }

/* ===== BOOK SLOTS ===== */
.character-layout { display: flex; align-items: flex-start; gap: 12px; }
.character-figure-col { flex: 0 0 230px; min-width: 0; }
.character-info-col { flex: 1; min-width: 0; }
.character-info-col .info-section:first-of-type { margin-top: 0; }
.book-slots-section { margin-top: 14px; }
.character-info-col .book-slots-section { margin-top: 0; }
.book-slots-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.book-slots-info { font-size: 10px; color: var(--text-dim); }
.book-buy-slot-btn {
  font-size: 9px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--gold-dim);
  background: rgba(212,160,23,0.1); color: var(--gold); font-family: 'Cinzel', serif; cursor: pointer;
}
.book-buy-slot-btn:active { background: rgba(212,160,23,0.2); }
.book-slots-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.book-slot-card {
  background: linear-gradient(135deg, rgba(139,58,159,0.08), var(--bg-parchment));
  border: 1px solid rgba(139,58,159,0.2); border-radius: var(--radius-sm); padding: 8px;
  cursor: pointer; transition: all 0.2s;
}
.book-slot-card:active { transform: scale(0.98); }
.book-slot-card.equipped { border-color: rgba(139,58,159,0.5); }
.book-slot-inner { display: flex; align-items: center; gap: 6px; }
.book-slot-icon { font-size: 18px; }
.book-slot-info { flex: 1; min-width: 0; }
.book-slot-label { font-size: 8px; color: var(--text-ancient); text-transform: uppercase; letter-spacing: 1px; }
.book-slot-name { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-slot-name.filled { color: #c44dff; }
.book-slot-level { font-size: 8px; color: var(--gold-dim); margin-top: 1px; }
.book-upgrade-btn {
  font-size: 10px; padding: 6px 10px; min-height: 28px; border-radius: 8px; border: 1px solid rgba(139,58,159,0.3);
  background: rgba(139,58,159,0.1); color: #c44dff; cursor: pointer; margin-top: 4px;
}
.book-upgrade-btn:active { background: rgba(139,58,159,0.2); }
.book-effect-card {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(212,160,23,0.18);
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
}
.book-effect-card.upgrade { border-color: rgba(139,58,159,0.35); background: rgba(139,58,159,0.10); }
.book-effect-title { font-size: 10px; color: var(--gold); font-family: 'Cinzel', serif; margin-bottom: 5px; letter-spacing: 0.5px; }
.book-effect-text { font-size: 11px; color: var(--text-normal); line-height: 1.45; }
.book-effect-row { font-size: 11px; color: var(--text-normal); padding: 2px 0; line-height: 1.35; }

/* ===== INVENTORY ITEMS ===== */
.filter-runes { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
.filter-runes::-webkit-scrollbar { display: none; }
.rune-btn {
  padding: 5px 10px; border-radius: 16px; border: 1px solid var(--border-rune); background: transparent;
  color: var(--text-dim); font-size: 10px; font-family: 'Cinzel', serif; cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.rune-btn.active { background: rgba(212,160,23,0.15); border-color: var(--gold); color: var(--gold-bright); }
.items-scroll { max-height: 60vh; overflow-y: auto; }
.item-scroll {
  display: flex; align-items: center; gap: 10px; padding: 12px 10px; margin-bottom: 6px;
  background: var(--bg-card); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s;
  border-left: 3px solid transparent; min-height: 56px;
}
.item-scroll[data-rarity="common"] { border-left-color: var(--rarity-common); }
.item-scroll[data-rarity="uncommon"] { border-left-color: var(--rarity-uncommon); }
.item-scroll[data-rarity="rare"] { border-left-color: var(--rarity-rare); }
.item-scroll[data-rarity="epic"] { border-left-color: var(--rarity-epic); }
.item-scroll[data-rarity="legendary"] { border-left-color: var(--rarity-legendary); }
.item-scroll.equipped { background: rgba(212,160,23,0.08); }
.item-scroll:active { background: var(--bg-card-hover); }
.item-icon { width: 48px; height: 48px; text-align: center; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(0,0,0,0.25); }
.item-name { flex: 1; font-size: 12px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-rarity-label { font-size: 9px; padding: 1px 6px; border-radius: 8px; white-space: nowrap; }
.item-rarity-label.common { background: rgba(142,142,142,0.15); color: var(--rarity-common); }
.item-rarity-label.uncommon { background: rgba(46,204,113,0.15); color: var(--rarity-uncommon); }
.item-rarity-label.rare { background: rgba(52,152,219,0.15); color: var(--rarity-rare); }
.item-rarity-label.epic { background: rgba(155,89,182,0.15); color: var(--rarity-epic); }
.item-rarity-label.legendary { background: rgba(243,156,18,0.15); color: var(--rarity-legendary); }
.item-bonus { font-size: 9px; color: var(--text-dim); margin-left: 4px; }
.item-qty { font-size: 9px; color: var(--gold); margin-left: 4px; }
.item-book-level { font-size: 9px; color: #c44dff; margin-left: 4px; }

/* ===== SHOP ===== */
.shop-header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.shop-gold { display: flex; align-items: center; gap: 4px; font-family: 'Cinzel', serif; font-size: 14px; color: var(--gold-bright); }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 65vh; overflow-y: auto; }
.shop-card {
  background: var(--bg-card); border: 1px solid var(--border-rune); border-radius: var(--radius-sm);
  padding: 10px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.shop-card:active { background: var(--bg-card-hover); transform: scale(0.97); }
.item-price-tag { font-family: 'Cinzel', serif; font-size: 12px; color: var(--gold); margin-top: 4px; }
.item-min-level { font-size: 9px; color: var(--text-ancient); margin-top: 2px; }

/* ===== CHARACTER DETAILS ===== */
.info-section { margin-top: 12px; background: var(--bg-card); border-radius: var(--radius-sm); padding: 10px; border: 1px solid var(--border-stone); }
.info-section h3 { font-family: 'Cinzel', serif; font-size: 11px; color: var(--gold); margin-bottom: 6px; letter-spacing: 1px; }
.info-row { display: flex; justify-content: space-between; font-size: 11px; padding: 3px 0; color: var(--text-normal); }

@media (max-width: 430px) {
  .character-layout { gap: 8px; }
  .character-figure-col { flex-basis: 220px; }
  .character-info-col .section-header { font-size: 10px; padding: 7px 8px; }
  .character-info-col .book-slots-grid { grid-template-columns: 1fr; }
  .character-info-col .book-slot-card { padding: 6px; }
  /* TASK252 — small phone adjustments */
  .char-bar-numbers { font-size: 10px; }
  .char-action-label { font-size: 11px; }
  .char-name { font-size: 13px; }
  .char-frame { width: 42px; height: 42px; font-size: 22px; }
  .gold-amount { font-size: 12px; }
  .char-gold-display { padding: 5px 10px; }
}

@media (max-width: 360px) {
  .character-layout { flex-direction: column; }
  .character-figure-col { flex-basis: auto; width: 100%; }
  .character-info-col { width: 100%; }
  .character-info-col .book-slots-grid { grid-template-columns: repeat(2, 1fr); }
  /* TASK252 — ultra-small screens */
  .char-bar-numbers { font-size: 9px; }
  .char-action-label { font-size: 10px; }
  .char-action-icon { font-size: 13px; }
  .char-action-btn { padding: 6px 4px; }
  .char-name { font-size: 12px; }
  .char-frame { width: 38px; height: 38px; font-size: 20px; }
  .gold-amount { font-size: 11px; }
  .char-gold-display { padding: 4px 8px; }
  .char-secondary-link { font-size: 10px; }
}

/* ===== MODALS ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; display: flex; align-items: flex-end; justify-content: center; transition: opacity 0.2s; }
.modal-overlay.hidden { display: none; }
.modal-scroll { background: var(--bg-stone); border-radius: 16px 16px 0 0; width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto; padding: 16px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-title { font-family: 'Cinzel', serif; font-size: 15px; font-weight: 700; color: var(--text-glow); }
.modal-close-btn { background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn { padding: 8px 16px; border-radius: var(--radius-sm); border: none; font-family: 'Cinzel', serif; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn:active { transform: scale(0.96); }
.btn-gold { background: linear-gradient(135deg, var(--gold-dim), var(--gold)); color: var(--bg-abyss); }
.btn-rune { background: var(--bg-card); border: 1px solid var(--border-rune); color: var(--text-normal); }
/* EQUIPMENT-LEVEL-SSOT: locked under-level equip button (non-actionable, no mutation sent) */
.btn-locked { background: var(--bg-card); border: 1px solid var(--border-rune); color: var(--text-dim); opacity: 0.65; cursor: not-allowed; }
.btn-locked:active { transform: none; }
.btn-sm { padding: 8px 14px; font-size: 11px; min-height: 32px; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg-card); color: var(--text-glow); padding: 10px 20px; border-radius: 20px; border: 1px solid var(--border-rune); font-size: 12px; z-index: 200; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 30px; color: var(--text-ancient); }
.empty-rune { font-size: 40px; margin-bottom: 8px; opacity: 0.5; }
.empty-text { font-family: 'Cinzel', serif; font-size: 13px; }

/* ===== FACTION THEME ===== */
body.faction-dark .ornate-header::before { background: radial-gradient(ellipse at 50% 0%, rgba(139,58,159,0.1) 0%, transparent 60%); }
body.faction-light .ornate-header::before { background: radial-gradient(ellipse at 50% 0%, rgba(74,144,217,0.1) 0%, transparent 60%); }

/* ===== SPECIALIZATION ===== */
.spec-current-card { display:flex; align-items:center; gap:12px; background:linear-gradient(135deg,rgba(212,160,23,0.12),var(--bg-card)); border:1px solid var(--border-rune); border-radius:var(--radius); padding:14px; margin-bottom:12px; }
.spec-current-icon { font-size:36px; width:50px; height:50px; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,0.3); border-radius:12px; flex-shrink:0; }
.spec-current-info { flex:1; }
.spec-current-name { font-family:'Cinzel',serif; font-size:16px; font-weight:700; color:var(--gold-bright); }
.spec-current-desc { font-size:11px; color:var(--text-normal); margin-top:3px; }
.spec-detail-grid { display:grid; grid-template-columns:1fr; gap:6px; }
.spec-detail-box { background:var(--bg-card); border:1px solid var(--border-stone); border-radius:var(--radius-sm); padding:10px; }
.spec-detail-label { font-family:'Cinzel',serif; font-size:10px; color:var(--gold); letter-spacing:1px; text-transform:uppercase; margin-bottom:4px; }
.spec-detail-value { font-size:12px; color:var(--text-normal); }
.spec-detail-cooldown { font-size:9px; color:var(--text-dim); margin-top:3px; }
.spec-choose-banner { text-align:center; padding:16px; background:linear-gradient(135deg,rgba(212,160,23,0.08),rgba(139,58,159,0.08)); border:1px solid var(--border-rune); border-radius:var(--radius); margin-bottom:16px; }
.spec-choose-icon { font-size:40px; margin-bottom:6px; }
.spec-choose-text { font-family:'Cinzel',serif; font-size:16px; font-weight:700; color:var(--gold-bright); }
.spec-choose-sub { font-size:11px; color:var(--text-dim); margin-top:4px; }
.spec-category { margin-bottom:14px; }
.spec-category-header { font-family:'Cinzel',serif; font-size:13px; font-weight:700; color:var(--gold); margin-bottom:8px; display:flex; align-items:baseline; gap:8px; }
.spec-category-desc { font-size:10px; color:var(--text-dim); font-weight:400; }
.spec-cards-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:6px; }
.spec-card { background:var(--bg-card); border:1px solid var(--border-rune); border-radius:var(--radius-sm); padding:10px; text-align:center; cursor:pointer; transition:all 0.2s; }
.spec-card:active { background:var(--bg-card-hover); transform:scale(0.97); }
.spec-card-icon { font-size:24px; margin-bottom:4px; }
.spec-card-name { font-family:'Cinzel',serif; font-size:11px; font-weight:700; color:var(--text-glow); margin-bottom:4px; }
.spec-card-desc { font-size:9px; color:var(--text-dim); line-height:1.3; margin-bottom:4px; }
.spec-card-bonus { font-size:9px; color:var(--gold-dim); }
.spec-locked { text-align:center; padding:30px 16px; }
.spec-locked-icon { font-size:48px; opacity:0.5; margin-bottom:10px; }
.spec-locked-text { font-family:'Cinzel',serif; font-size:14px; color:var(--text-normal); }
.spec-locked-sub { font-size:11px; color:var(--text-dim); margin-top:4px; }
.spec-locked-progress { width:200px; height:6px; background:rgba(0,0,0,0.4); border-radius:3px; margin:12px auto 0; overflow:hidden; }
.spec-locked-bar { height:100%; background:linear-gradient(90deg,var(--gold-dim),var(--gold)); border-radius:3px; transition:width 0.5s ease; }

  
/* ===== CSS ITEM TYPE ICONS ===== */
.item-type-icon {
  width: 48px; height: 48px; border-radius: 8px; position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.item-type-icon.icon-sm { width: 32px; height: 32px; border-radius: 6px; }
.item-type-icon.icon-lg { width: 80px; height: 80px; border-radius: 12px; }

/* Weapon — silver/steel blade with golden hilt */
.type-weapon {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(180,180,200,0.3);
  box-shadow: 0 0 8px rgba(180,180,200,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-weapon::before {
  content: ''; position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 55%;
  background: linear-gradient(180deg, #e8e8f0, #a0a0b8, #c0c0d0);
  border-radius: 2px 2px 1px 1px;
  box-shadow: 0 0 6px rgba(200,200,220,0.4);
}
.type-weapon::after {
  content: ''; position: absolute;
  bottom: 10px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 4px;
  background: linear-gradient(90deg, #8b6914, #d4a017, #f5c842, #d4a017, #8b6914);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(212,160,23,0.5);
}
.type-weapon.icon-sm::before { width: 3px; top: 4px; height: 50%; }
.type-weapon.icon-sm::after { width: 10px; height: 3px; bottom: 6px; }
.type-weapon.icon-lg::before { width: 6px; top: 10px; height: 55%; }
.type-weapon.icon-lg::after { width: 26px; height: 6px; bottom: 16px; }

/* Chest — metallic breastplate */
.type-chest {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(140,160,180,0.3);
  box-shadow: 0 0 8px rgba(140,160,180,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-chest::before {
  content: ''; position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 28px;
  background: linear-gradient(180deg, #708090, #4a5a6a, #607080);
  border-radius: 4px 4px 2px 2px;
  border-top: 2px solid #8a9aaa;
  box-shadow: 0 0 8px rgba(112,128,144,0.4);
}
.type-chest::after {
  content: ''; position: absolute;
  top: 16px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px;
  background: radial-gradient(circle, var(--gold-bright), var(--gold-dim));
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold);
}
.type-chest.icon-sm::before { width: 16px; height: 18px; top: 5px; }
.type-chest.icon-sm::after { width: 4px; height: 4px; top: 10px; }
.type-chest.icon-lg::before { width: 40px; height: 46px; top: 12px; }
.type-chest.icon-lg::after { width: 10px; height: 10px; top: 26px; }

/* Helmet — steel helm with visor */
.type-helmet {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(140,160,180,0.3);
  box-shadow: 0 0 8px rgba(140,160,180,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-helmet::before {
  content: ''; position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 20px;
  background: linear-gradient(180deg, #8a9aaa, #5a6a7a, #6a7a8a);
  border-radius: 8px 8px 2px 2px;
  border-top: 2px solid #b0c0d0;
  box-shadow: 0 0 6px rgba(138,154,170,0.4);
}
.type-helmet::after {
  content: ''; position: absolute;
  bottom: 10px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 6px;
  background: linear-gradient(180deg, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
  border-radius: 1px;
  box-shadow: 0 -1px 4px rgba(100,120,140,0.3);
}
.type-helmet.icon-sm::before { width: 17px; height: 13px; top: 4px; }
.type-helmet.icon-sm::after { width: 9px; height: 4px; bottom: 6px; }
.type-helmet.icon-lg::before { width: 44px; height: 34px; top: 10px; }
.type-helmet.icon-lg::after { width: 24px; height: 10px; bottom: 16px; }

/* Gloves — gauntlets */
.type-gloves {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(160,120,80,0.3);
  box-shadow: 0 0 8px rgba(160,120,80,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-gloves::before {
  content: ''; position: absolute;
  top: 10px; left: 9px;
  width: 12px; height: 18px;
  background: linear-gradient(180deg, #8a7060, #5a4030, #6a5040);
  border-radius: 3px 3px 5px 5px;
  box-shadow: 6px 0 0 0 #7a6050, 6px 0 0 0 linear-gradient(180deg, #8a7060, #5a4030);
}
.type-gloves::after {
  content: ''; position: absolute;
  top: 10px; right: 9px;
  width: 12px; height: 18px;
  background: linear-gradient(180deg, #8a7060, #5a4030, #6a5040);
  border-radius: 3px 3px 5px 5px;
}
.type-gloves.icon-sm::before { width: 8px; height: 12px; top: 6px; left: 5px; }
.type-gloves.icon-sm::after { width: 8px; height: 12px; top: 6px; right: 5px; }
.type-gloves.icon-lg::before { width: 20px; height: 30px; top: 16px; left: 14px; }
.type-gloves.icon-lg::after { width: 20px; height: 30px; top: 16px; right: 14px; }

/* Ring — golden ring with gem */
.type-ring {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(212,160,23,0.3);
  box-shadow: 0 0 8px rgba(212,160,23,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-ring::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 22px; height: 22px;
  border: 3px solid transparent;
  border-top-color: var(--gold-bright);
  border-bottom-color: var(--gold-dim);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(245,200,66,0.4);
}
.type-ring::after {
  content: ''; position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px;
  background: radial-gradient(circle at 30% 30%, #ff6688, #cc3366, #8b1a3a);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255,102,136,0.5);
}
.type-ring.icon-sm::before { width: 14px; height: 14px; border-width: 2px; }
.type-ring.icon-sm::after { width: 5px; height: 5px; top: 4px; }
.type-ring.icon-lg::before { width: 38px; height: 38px; border-width: 4px; }
.type-ring.icon-lg::after { width: 14px; height: 14px; top: 12px; }

/* Necklace — pendant on chain */
.type-necklace {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(139,58,159,0.3);
  box-shadow: 0 0 8px rgba(139,58,159,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-necklace::before {
  content: ''; position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 14px;
  border: 2px solid var(--gold);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 0 6px rgba(212,160,23,0.3);
}
.type-necklace::after {
  content: ''; position: absolute;
  bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 12px; height: 14px;
  background: linear-gradient(180deg, #9b59b6, #6a3090);
  border-radius: 2px 2px 6px 6px;
  border-top: 2px solid var(--gold);
  box-shadow: 0 0 10px rgba(155,89,182,0.5);
}
.type-necklace.icon-sm::before { width: 18px; height: 9px; top: 4px; border-width: 1.5px; }
.type-necklace.icon-sm::after { width: 8px; height: 9px; bottom: 4px; }
.type-necklace.icon-lg::before { width: 46px; height: 22px; top: 10px; border-width: 3px; }
.type-necklace.icon-lg::after { width: 20px; height: 22px; bottom: 12px; }

/* Armor — same as chest, alias */
.type-armor {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(140,160,180,0.3);
  box-shadow: 0 0 8px rgba(140,160,180,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-armor::before {
  content: ''; position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  width: 24px; height: 28px;
  background: linear-gradient(180deg, #708090, #4a5a6a, #607080);
  border-radius: 4px 4px 2px 2px;
  border-top: 2px solid #8a9aaa;
  box-shadow: 0 0 8px rgba(112,128,144,0.4);
}
.type-armor::after {
  content: ''; position: absolute;
  top: 16px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px;
  background: radial-gradient(circle, var(--gold-bright), var(--gold-dim));
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold);
}

/* Accessory — same as ring, alias */
.type-accessory {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(212,160,23,0.3);
  box-shadow: 0 0 8px rgba(212,160,23,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-accessory::before {
  content: ''; position: absolute;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 22px; height: 22px;
  border: 3px solid transparent;
  border-top-color: var(--gold-bright);
  border-bottom-color: var(--gold-dim);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(245,200,66,0.4);
}
.type-accessory::after {
  content: ''; position: absolute;
  top: 8px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px;
  background: radial-gradient(circle at 30% 30%, #44ddff, #2299cc, #1a6688);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(68,221,255,0.5);
}

/* Potion — glowing flask */
.type-potion {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(231,76,60,0.3);
  box-shadow: 0 0 8px rgba(231,76,60,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-potion::before {
  content: ''; position: absolute;
  top: 5px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px;
  background: linear-gradient(180deg, #8a9aaa, #5a6a7a);
  border-radius: 2px 2px 0 0;
  border-top: 1px solid #aab0c0;
}
.type-potion::after {
  content: ''; position: absolute;
  bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 24px;
  background: linear-gradient(180deg, rgba(231,76,60,0.3), rgba(192,57,43,0.8));
  border-radius: 0 0 10px 10px;
  border: 1px solid rgba(231,76,60,0.4);
  border-top: none;
  box-shadow: 0 0 12px rgba(231,76,60,0.4), inset 0 -4px 8px rgba(231,76,60,0.3);
}
.type-potion.icon-sm::before { width: 5px; height: 5px; top: 3px; }
.type-potion.icon-sm::after { width: 13px; height: 16px; bottom: 3px; }
.type-potion.icon-lg::before { width: 14px; height: 12px; top: 8px; }
.type-potion.icon-lg::after { width: 34px; height: 40px; bottom: 8px; border-radius: 0 0 16px 16px; }

/* Book / Skill_book — magical tome with glowing runes */
.type-book, .type-skill_book {
  background: linear-gradient(135deg, #1e1030 0%, #0c1119 100%);
  border: 1px solid rgba(155,89,182,0.4);
  box-shadow: 0 0 10px rgba(155,89,182,0.2), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-book::before, .type-skill_book::before {
  content: ''; position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 30px;
  background: linear-gradient(180deg, #3a2060, #2a1848, #1a1030);
  border: 1px solid rgba(155,89,182,0.5);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(155,89,182,0.3);
}
.type-book::after, .type-skill_book::after {
  content: '✦'; position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  font-size: 14px; color: #c44dff;
  text-shadow: 0 0 8px #c44dff, 0 0 16px rgba(196,77,255,0.5);
  animation: runeGlow 2s ease-in-out infinite;
}
@keyframes runeGlow { 0%,100%{opacity:0.7;transform:translateX(-50%) scale(1)} 50%{opacity:1;transform:translateX(-50%) scale(1.15)} }
.type-book.icon-sm::before, .type-skill_book.icon-sm::before { width: 17px; height: 20px; top: 4px; }
.type-book.icon-sm::after, .type-skill_book.icon-sm::after { font-size: 9px; top: 9px; }
.type-book.icon-lg::before, .type-skill_book.icon-lg::before { width: 44px; height: 50px; top: 10px; }
.type-book.icon-lg::after, .type-skill_book.icon-lg::after { font-size: 22px; top: 24px; }

/* Scroll — parchment scroll */
.type-scroll {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(210,180,130,0.3);
  box-shadow: 0 0 8px rgba(210,180,130,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-scroll::before {
  content: ''; position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px;
  background: radial-gradient(circle, #c4a868, #8a7040);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(196,168,104,0.4);
}
.type-scroll::after {
  content: ''; position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 24px;
  background: linear-gradient(180deg, #d4b878, #c4a868, #b49858);
  border-radius: 1px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.2);
  border-left: 1px solid rgba(0,0,0,0.15);
  border-right: 1px solid rgba(0,0,0,0.15);
}
.type-scroll.icon-sm::before { width: 4px; height: 4px; top: 3px; }
.type-scroll.icon-sm::after { width: 12px; height: 16px; top: 7px; }
.type-scroll.icon-lg::before { width: 10px; height: 10px; top: 10px; }
.type-scroll.icon-lg::after { width: 30px; height: 40px; top: 20px; }

/* Trophy — trophy cup */
.type-trophy {
  background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
  border: 1px solid rgba(245,200,66,0.3);
  box-shadow: 0 0 8px rgba(245,200,66,0.15), inset 0 0 15px rgba(0,0,0,0.5);
}
.type-trophy::before {
  content: ''; position: absolute;
  top: 6px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 16px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold), var(--gold-dim));
  border-radius: 2px 2px 8px 8px;
  box-shadow: 0 0 10px rgba(245,200,66,0.4);
}
.type-trophy::after {
  content: ''; position: absolute;
  bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 10px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  box-shadow: 6px 8px 0 0 var(--gold-dim);
}
.type-trophy.icon-sm::before { width: 13px; height: 10px; top: 4px; }
.type-trophy.icon-sm::after { width: 3px; height: 7px; bottom: 4px; }
.type-trophy.icon-lg::before { width: 34px; height: 28px; top: 10px; }
.type-trophy.icon-lg::after { width: 6px; height: 16px; bottom: 12px; }

/* ===== ITEM-ICON OVERRIDE FOR CSS ICONS ===== */
.slot-frame { width: 36px; height: 36px; font-size: 20px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); border-radius: 6px; flex-shrink: 0; overflow: hidden; }

/* ===== FILTER BTN SMALL ICONS ===== */
.filter-icon { display: inline-block; width: 18px; height: 18px; border-radius: 3px; vertical-align: middle; position: relative; }
.filter-icon.type-weapon { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(180,180,200,0.2); }
.filter-icon.type-weapon::before { content:''; position:absolute; top:3px; left:50%; transform:translateX(-50%); width:2px; height:55%; background:linear-gradient(180deg,#e8e8f0,#a0a0b8); border-radius:1px; }
.filter-icon.type-weapon::after { content:''; position:absolute; bottom:2px; left:50%; transform:translateX(-50%); width:8px; height:2px; background:linear-gradient(90deg,#8b6914,#d4a017,#f5c842,#d4a017,#8b6914); border-radius:1px; }
.filter-icon.type-chest, .filter-icon.type-armor { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(140,160,180,0.2); }
.filter-icon.type-chest::before, .filter-icon.type-armor::before { content:''; position:absolute; top:3px; left:50%; transform:translateX(-50%); width:10px; height:12px; background:linear-gradient(180deg,#708090,#4a5a6a); border-radius:2px 2px 1px 1px; }
.filter-icon.type-helmet { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(140,160,180,0.2); }
.filter-icon.type-helmet::before { content:''; position:absolute; top:2px; left:50%; transform:translateX(-50%); width:12px; height:8px; background:linear-gradient(180deg,#8a9aaa,#5a6a7a); border-radius:4px 4px 1px 1px; }
.filter-icon.type-gloves { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(160,120,80,0.2); }
.filter-icon.type-gloves::before { content:''; position:absolute; top:4px; left:3px; width:5px; height:8px; background:#7a6050; border-radius:1px 1px 2px 2px; box-shadow:6px 0 0 0 #6a5040; }
.filter-icon.type-ring, .filter-icon.type-accessory { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(212,160,23,0.2); }
.filter-icon.type-ring::before, .filter-icon.type-accessory::before { content:''; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:10px; height:10px; border:2px solid transparent; border-top-color:var(--gold-bright); border-bottom-color:var(--gold-dim); border-radius:50%; }
.filter-icon.type-necklace { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(139,58,159,0.2); }
.filter-icon.type-necklace::before { content:''; position:absolute; top:2px; left:50%; transform:translateX(-50%); width:12px; height:5px; border:1.5px solid var(--gold); border-bottom:none; border-radius:10px 10px 0 0; }
.filter-icon.type-potion { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(231,76,60,0.2); }
.filter-icon.type-potion::after { content:''; position:absolute; bottom:2px; left:50%; transform:translateX(-50%); width:8px; height:10px; background:linear-gradient(180deg,rgba(231,76,60,0.3),rgba(192,57,43,0.8)); border-radius:0 0 5px 5px; }
.filter-icon.type-scroll { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(210,180,130,0.2); }
.filter-icon.type-scroll::after { content:''; position:absolute; top:4px; left:50%; transform:translateX(-50%); width:7px; height:10px; background:linear-gradient(180deg,#d4b878,#b49858); border-radius:1px; }
.filter-icon.type-skill_book, .filter-icon.type-book { background: linear-gradient(135deg, #1e1030, #0c1119); border: 1px solid rgba(155,89,182,0.3); }
.filter-icon.type-skill_book::after, .filter-icon.type-book::after { content:'✦'; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:9px; color:#c44dff; text-shadow:0 0 4px #c44dff; }
.filter-icon.type-trophy { background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(245,200,66,0.2); }
.filter-icon.type-trophy::before { content:''; position:absolute; top:2px; left:50%; transform:translateX(-50%); width:8px; height:7px; background:linear-gradient(180deg,var(--gold-bright),var(--gold)); border-radius:1px 1px 4px 4px; }

/* ===== EQUIP SLOT ICON MAP ===== */
.slot-type-weapon { width: 36px; height: 36px; border-radius: 6px; position: relative; background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(180,180,200,0.3); overflow: hidden; flex-shrink: 0; }
.slot-type-weapon::before { content:''; position:absolute; top:4px; left:50%; transform:translateX(-50%); width:3px; height:55%; background:linear-gradient(180deg,#e8e8f0,#a0a0b8); border-radius:1px; }
.slot-type-weapon::after { content:''; position:absolute; bottom:6px; left:50%; transform:translateX(-50%); width:14px; height:3px; background:linear-gradient(90deg,#8b6914,#d4a017,#f5c842,#d4a017,#8b6914); border-radius:1px; }
.slot-type-chest { width: 36px; height: 36px; border-radius: 6px; position: relative; background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(140,160,180,0.3); overflow: hidden; flex-shrink: 0; }
.slot-type-chest::before { content:''; position:absolute; top:5px; left:50%; transform:translateX(-50%); width:18px; height:20px; background:linear-gradient(180deg,#708090,#4a5a6a); border-radius:3px 3px 1px 1px; }
.slot-type-chest::after { content:''; position:absolute; top:11px; left:50%; transform:translateX(-50%); width:5px; height:5px; background:radial-gradient(circle,var(--gold-bright),var(--gold-dim)); border-radius:50%; }
.slot-type-helmet { width: 36px; height: 36px; border-radius: 6px; position: relative; background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(140,160,180,0.3); overflow: hidden; flex-shrink: 0; }
.slot-type-helmet::before { content:''; position:absolute; top:4px; left:50%; transform:translateX(-50%); width:20px; height:14px; background:linear-gradient(180deg,#8a9aaa,#5a6a7a); border-radius:6px 6px 1px 1px; }
.slot-type-helmet::after { content:''; position:absolute; bottom:7px; left:50%; transform:translateX(-50%); width:10px; height:5px; background:rgba(0,0,0,0.7); border-radius:1px; }
.slot-type-gloves { width: 36px; height: 36px; border-radius: 6px; position: relative; background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(160,120,80,0.3); overflow: hidden; flex-shrink: 0; }
.slot-type-gloves::before { content:''; position:absolute; top:6px; left:6px; width:9px; height:14px; background:linear-gradient(180deg,#8a7060,#5a4030); border-radius:2px 2px 4px 4px; box-shadow:7px 0 0 0 #6a5040; }
.slot-type-ring { width: 36px; height: 36px; border-radius: 6px; position: relative; background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(212,160,23,0.3); overflow: hidden; flex-shrink: 0; }
.slot-type-ring::before { content:''; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:16px; height:16px; border:2.5px solid transparent; border-top-color:var(--gold-bright); border-bottom-color:var(--gold-dim); border-radius:50%; box-shadow:0 0 6px rgba(245,200,66,0.3); }
.slot-type-ring::after { content:''; position:absolute; top:5px; left:50%; transform:translateX(-50%); width:6px; height:6px; background:radial-gradient(circle at 30% 30%,#ff6688,#cc3366); border-radius:50%; }
.slot-type-necklace { width: 36px; height: 36px; border-radius: 6px; position: relative; background: linear-gradient(180deg, #2a2a3e, #1a1a2e); border: 1px solid rgba(139,58,159,0.3); overflow: hidden; flex-shrink: 0; }
.slot-type-necklace::before { content:''; position:absolute; top:4px; left:50%; transform:translateX(-50%); width:20px; height:9px; border:1.5px solid var(--gold); border-bottom:none; border-radius:14px 14px 0 0; }
.slot-type-necklace::after { content:''; position:absolute; bottom:5px; left:50%; transform:translateX(-50%); width:8px; height:10px; background:linear-gradient(180deg,#9b59b6,#6a3090); border-radius:1px 1px 4px 4px; border-top:1.5px solid var(--gold); }

/* ===== BOOK SLOT STYLING ===== */
.book-slot-type-icon { width: 32px; height: 32px; border-radius: 6px; position: relative; background: linear-gradient(135deg, #1e1030, #0c1119); border: 1px solid rgba(155,89,182,0.3); overflow: hidden; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.book-slot-type-icon::before { content:''; position:absolute; top:3px; left:50%; transform:translateX(-50%); width:17px; height:20px; background:linear-gradient(180deg,#3a2060,#2a1848); border:1px solid rgba(155,89,182,0.4); border-radius:1px; }
.book-slot-type-icon::after { content:'✦'; position:absolute; top:8px; left:50%; transform:translateX(-50%); font-size:9px; color:#c44dff; text-shadow:0 0 6px #c44dff; animation:runeGlow 2s ease-in-out infinite; }
.book-slot-type-icon.empty-slot::after { content:'?'; color:var(--text-ancient); text-shadow:none; animation:none; font-size:12px; top:50%; transform:translate(-50%,-50%); }


/* ============================================ */
/*  HOME TAB                                    */
/* ============================================ */

#tab-home { padding-top: 4px; }

.home-hero {
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-parchment) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.home-hero-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-equip), var(--bg-dungeon));
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; flex-shrink: 0; overflow: hidden;
  box-shadow: 0 0 12px rgba(212,160,23,0.3);
}
.home-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.home-hero-info { flex: 1; min-width: 0; }
.home-hero-name {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 18px;
  color: var(--text-glow); letter-spacing: .5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-hero-sub { font-size: 12px; color: var(--text-normal); margin-top: 2px; }
.home-xp { margin-top: 8px; }
.home-xp-track {
  height: 6px; background: var(--bg-dungeon);
  border-radius: 4px; overflow: hidden;
  border: 1px solid rgba(212,160,23,0.2);
}
.home-xp-track .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  box-shadow: 0 0 8px rgba(245,200,66,0.5);
  transition: width .4s ease;
}
.home-xp-value { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.home-bars {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.home-bar-card {
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.15);
  border-radius: 10px;
  padding: 9px 10px;
  position: relative;
}
.home-bar-label { font-size: 12px; color: var(--text-normal); margin-bottom: 6px; font-weight: 500; }
.home-bar-track {
  height: 8px; background: var(--bg-dungeon);
  border-radius: 5px; overflow: hidden;
  border: 1px solid rgba(0,0,0,0.5);
}
.home-bar-track .fill {
  height: 100%; transition: width .4s ease;
  box-shadow: 0 0 6px rgba(255,255,255,0.15) inset;
}
.home-bar-value { font-size: 11px; color: var(--text-dim); margin-top: 4px; text-align: right; font-variant-numeric: tabular-nums; }

.home-bar-card.hp       .fill { background: linear-gradient(90deg, #a02030, #d43050); }
.home-bar-card.energy   .fill { background: linear-gradient(90deg, #2060a0, #4090d0); }
.home-bar-card.mana     .fill { background: linear-gradient(90deg, #5a2c9e, #9b59b6); }
.home-bar-card.satiety  .fill { background: linear-gradient(90deg, #8b5a2b, #d4a017); }
.home-bar-card.injuries .fill { background: linear-gradient(90deg, #5a0000, #c0392b); }
.home-bar-card.camo     .fill { background: linear-gradient(90deg, #3a3a3a, #6e6e6e); }

.home-bar-card.crit { box-shadow: 0 0 10px rgba(196,80,60,0.35); border-color: rgba(196,80,60,0.4); }
.home-bar-card.warn { border-color: rgba(212,160,23,0.35); }

.home-chips {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 14px;
}
.home-chip {
  display: flex; gap: 10px; align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.15);
  border-radius: 10px;
  padding: 9px 11px;
}
.home-chip .chip-icon { font-size: 22px; flex-shrink: 0; }
.home-chip .chip-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.home-chip .chip-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.home-chip .chip-value {
  font-size: 13px; color: var(--text-bright); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-chip.karma { grid-column: span 2; }
.home-chip.karma .karma-track {
  position: relative; height: 4px; margin-top: 4px;
  background: linear-gradient(90deg, #c0392b 0%, #b8a98e 50%, #6bc06b 100%);
  border-radius: 3px; opacity: .7;
}
.home-chip.karma .karma-dot {
  position: absolute; top: -3px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--bg-parchment);
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(0,0,0,0.6);
}

.home-daily {
  display: flex; gap: 12px; align-items: center;
  background: linear-gradient(135deg, rgba(212,160,23,0.18), rgba(139,105,20,0.1));
  border: 1px solid var(--gold);
  border-radius: 10px; padding: 10px 12px;
  box-shadow: 0 0 14px rgba(212,160,23,0.18);
}
.home-daily .home-daily-text { flex: 1; font-size: 13px; color: var(--text-glow); }
.home-daily .home-daily-text b { color: var(--gold-bright); }

/* ============================================ */
/*  PVP / GUILD / MAIL / LEADERBOARD TABS       */
/* ============================================ */

.mail-badge {
  display: inline-block;
  background: #c0392b; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 9px;
  padding: 0 5px; margin-left: 3px;
  line-height: 16px; vertical-align: top;
  box-shadow: 0 0 6px rgba(192,57,43,0.5);
}
.mail-badge.hidden { display: none; }

.pvp-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px;
}
.pvp-stat {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.15);
  border-radius: 10px;
  padding: 10px 12px;
}
.pvp-stat .ps-label { font-size: 12px; color: var(--text-dim); }
.pvp-stat .ps-value { font-size: 16px; font-weight: 700; color: var(--text-bright); font-variant-numeric: tabular-nums; }
.pvp-stat .ps-win { color: #6bc06b; }
.pvp-stat .ps-loss { color: #c0392b; }

.pvp-history {
  display: flex; flex-direction: column; gap: 6px;
}
.pvp-row {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.1);
  border-left: 3px solid transparent;
  border-radius: 8px; padding: 8px 11px;
  font-size: 12px;
}
.pvp-row.w { border-left-color: #6bc06b; }
.pvp-row.l { border-left-color: #c0392b; }
.pvp-row .pvp-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.05); color: var(--text-normal);
  text-transform: uppercase; letter-spacing: .4px;
}
.pvp-row.w .pvp-badge { background: rgba(107,192,107,0.15); color: #6bc06b; }
.pvp-row.l .pvp-badge { background: rgba(192,57,43,0.15); color: #c0392b; }
.pvp-row .pvp-opp { flex: 1; color: var(--text-bright); }
.pvp-row .pvp-delta { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.lb-tabs {
  display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap;
}
.lb-tab {
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: 8px; padding: 6px 12px;
  font-size: 12px; cursor: pointer; font-family: inherit;
  transition: all .2s;
}
.lb-tab.active {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--bg-dungeon); border-color: var(--gold-bright);
  font-weight: 700;
}
.lb-list {
  display: flex; flex-direction: column; gap: 5px;
}
.lb-row {
  display: flex; gap: 10px; align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.1);
  border-radius: 9px; padding: 8px 11px;
}
.lb-row.mine { border-color: var(--gold); background: linear-gradient(90deg, rgba(212,160,23,0.12), var(--bg-card) 70%); }
.lb-rank {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--bg-dungeon); color: var(--text-dim);
  border: 1px solid rgba(212,160,23,0.2);
}
.lb-rank.r1 { background: linear-gradient(135deg, #ffd700, #b8860b); color: #2b1810; border-color: #ffd700; }
.lb-rank.r2 { background: linear-gradient(135deg, #c0c0c0, #808080); color: #1a1a1a; border-color: #c0c0c0; }
.lb-rank.r3 { background: linear-gradient(135deg, #cd7f32, #8b5a2b); color: #fff; border-color: #cd7f32; }
.lb-main { flex: 1; min-width: 0; }
.lb-name { font-size: 13px; font-weight: 600; color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-sub { font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.lb-value { font-size: 12px; font-weight: 600; color: var(--gold-bright); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-empty { padding: 20px; text-align: center; color: var(--text-dim); font-size: 13px; }

.guild-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-parchment));
  border: 1px solid var(--gold-dim);
  border-radius: 12px; padding: 14px; margin-bottom: 4px;
}
.guild-name { font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700; color: var(--gold-bright); }
.guild-name .guild-tag { font-size: 12px; color: var(--text-dim); font-family: inherit; }
.guild-sub { font-size: 12px; color: var(--text-normal); margin-top: 3px; }
.guild-motto { font-style: italic; font-size: 12px; color: var(--text-dim); margin-top: 6px; border-top: 1px dashed rgba(212,160,23,0.15); padding-top: 6px; }
.guild-tasks { display: flex; flex-direction: column; gap: 5px; }
.guild-task {
  display: flex; justify-content: space-between;
  background: var(--bg-card); border: 1px solid rgba(212,160,23,0.1);
  border-radius: 8px; padding: 8px 11px; font-size: 12px;
}
.guild-task .gt-name { color: var(--text-bright); }
.guild-task .gt-progress { color: var(--gold-bright); font-variant-numeric: tabular-nums; }

.empty-card {
  text-align: center;
  background: var(--bg-card);
  border: 1px dashed rgba(212,160,23,0.25);
  border-radius: 14px; padding: 28px 18px;
}
.empty-icon { font-size: 44px; margin-bottom: 8px; }
.empty-title { font-family: 'Cinzel', serif; font-size: 16px; color: var(--text-bright); margin-bottom: 6px; }
.empty-text { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.empty-text code { background: var(--bg-dungeon); padding: 1px 5px; border-radius: 3px; color: var(--gold-bright); }

.mail-actions { display: flex; gap: 6px; margin-bottom: 8px; }
.mail-list { display: flex; flex-direction: column; gap: 6px; }
.mail-item {
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.15);
  border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 5px;
}
.mail-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); }
.mail-from { color: var(--text-normal); }
.mail-msg { font-size: 12px; color: var(--text-bright); }
.mail-reward { font-size: 12px; color: var(--gold-bright); font-weight: 600; }
.mail-claim { align-self: flex-end; padding: 5px 12px; font-size: 11px; }

.tab-note {
  margin-top: 12px; padding: 9px 11px;
  background: rgba(212,160,23,0.06);
  border-left: 3px solid var(--gold-dim);
  border-radius: 6px;
  font-size: 11px; color: var(--text-dim); line-height: 1.5;
}
.tab-note code { background: var(--bg-dungeon); padding: 1px 5px; border-radius: 3px; color: var(--gold-bright); }

/* ============================================ */
/*  FACTION THEMES                              */
/* ============================================ */

body.faction-dark {
  --gold: #b8860b;
  --gold-bright: #d4a017;
  --gold-dim: #8b5a00;
  --bg-parchment: #1f1624;
  --bg-card: #241a2f;
  --bg-card-hover: #2e2240;
  --bg-equip: #1a1229;
  --accent-hue: 280deg;
}
body.faction-dark .home-hero,
body.faction-dark .guild-card {
  background: linear-gradient(135deg, #241a2f 0%, #2d1f3d 100%);
  border-color: rgba(184,134,11,0.35);
  box-shadow: 0 4px 20px rgba(90,30,130,0.25);
}
body.faction-dark .home-hero-avatar {
  border-color: #b8860b;
  box-shadow: 0 0 14px rgba(120,60,160,0.45);
}
body.faction-dark .loading-title,
body.faction-dark .home-hero-name,
body.faction-dark .guild-name {
  background: linear-gradient(135deg, #d4a017, #9b59b6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
body.faction-dark .nav-tab.active {
  color: #e0b0ff;
  background: linear-gradient(180deg, rgba(155,89,182,0.15), rgba(184,134,11,0.1));
  box-shadow: inset 0 -2px 0 #b8860b;
}

body.faction-light {
  --gold: #d4af37;
  --gold-bright: #fff1a8;
  --gold-dim: #b8941f;
  --bg-abyss: #0a1220;
  --bg-dungeon: #121b2c;
  --bg-stone: #1a2540;
  --bg-parchment: #1f2e4a;
  --bg-card: #243450;
  --bg-card-hover: #2d3f5c;
  --bg-equip: #1b2840;
  --text-glow: #f5f0e0;
  --accent-hue: 200deg;
}
body.faction-light .home-hero,
body.faction-light .guild-card {
  background: linear-gradient(135deg, #243450 0%, #2e4468 100%);
  border-color: rgba(212,175,55,0.45);
  box-shadow: 0 4px 20px rgba(100,150,200,0.25);
}
body.faction-light .home-hero-avatar {
  border-color: #d4af37;
  box-shadow: 0 0 14px rgba(120,180,230,0.5);
}
body.faction-light .loading-title,
body.faction-light .home-hero-name,
body.faction-light .guild-name {
  background: linear-gradient(135deg, #fff1a8, #87ceeb);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
body.faction-light .nav-tab.active {
  color: #b8e0ff;
  background: linear-gradient(180deg, rgba(135,206,235,0.15), rgba(212,175,55,0.1));
  box-shadow: inset 0 -2px 0 #d4af37;
}

/* ============================================ */
/*  ANIMATIONS                                  */
/* ============================================ */

@keyframes barShimmer {
  0% { background-position: -120px 0; }
  100% { background-position: 120px 0; }
}

.home-bar-track .fill,
.home-xp-track .fill {
  position: relative; overflow: hidden;
}
.home-bar-track .fill::after,
.home-xp-track .fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  background-size: 120px 100%; background-repeat: no-repeat;
  animation: barShimmer 2.5s linear infinite;
  pointer-events: none;
}

@keyframes levelUpPop {
  0%   { transform: translate(-50%, 0) scale(.6); opacity: 0; }
  30%  { transform: translate(-50%, -20px) scale(1.25); opacity: 1; }
  70%  { transform: translate(-50%, -40px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -80px) scale(1); opacity: 0; }
}

.level-up-toast {
  position: fixed; left: 50%; top: 30%;
  transform: translate(-50%, 0);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #2b1810;
  font-family: 'Cinzel Decorative', serif;
  font-weight: 700; font-size: 22px;
  padding: 14px 28px; border-radius: 14px;
  box-shadow: 0 0 30px rgba(245,200,66,0.7), 0 0 60px rgba(212,160,23,0.4);
  z-index: 10000;
  animation: levelUpPop 2.5s ease-out forwards;
  white-space: nowrap;
  pointer-events: none;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-panel.active > * {
  animation: tabFadeIn .28s ease-out;
}

@keyframes coinPulse {
  0%, 100% { transform: scale(1); text-shadow: 0 0 6px rgba(245,200,66,0.4); }
  50%      { transform: scale(1.14); text-shadow: 0 0 12px rgba(245,200,66,0.9); }
}
.gold-amount.pulse { animation: coinPulse .5s ease-out; }

@keyframes toastSlideIn {
  from { transform: translate(-50%, 80px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}
@keyframes toastSlideOut {
  to { transform: translate(-50%, 80px); opacity: 0; }
}

/* ============================================ */
/*  PULL-TO-REFRESH                             */
/* ============================================ */

.ptr-indicator {
  position: fixed; top: 6px; left: 50%;
  transform: translateX(-50%) translateY(-60px);
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--gold);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  z-index: 9999;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.ptr-indicator.ready {
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  color: #2b1810;
  border-color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(245,200,66,0.6);
}
.ptr-indicator.ready .ptr-spinner { animation: ptrSpin .8s linear infinite; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

/* ============================================ */
/*  SVG SPRITE UTILITY                          */
/* ============================================ */

.svg-icon {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.12em;
  fill: currentColor;
  flex-shrink: 0;
}
.svg-icon-lg { width: 1.4em; height: 1.4em; vertical-align: -0.25em; }
.svg-icon-gold { color: var(--gold-bright); }
.svg-icon-sec { color: var(--gold); }

/* Section header / chip icon: prefer SVG when class set */
.section-header .svg-icon,
.chip-icon .svg-icon,
.lb-value .svg-icon { filter: drop-shadow(0 0 2px rgba(245,200,66,0.45)); }

/* ============================================ */
/*  CHARACTER SILHOUETTE FIGURE                 */
/* ============================================ */

.equip-figure {
  position: relative;
  width: 100%;
  max-width: 230px;
  margin: 4px 0 10px;
  aspect-ratio: 200 / 400;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(212,160,23,0.10), transparent 70%),
    linear-gradient(180deg, var(--bg-parchment), var(--bg-card) 60%, var(--bg-stone));
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.35);
}
.fig-inner {
  position: absolute; inset: 0;
}
.fig-body {
  position: absolute;
  inset: -5% -4% -4%;
  width: 108%;
  height: 109%;
  color: var(--text-normal);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  pointer-events: none;
  opacity: .65;
}
body.faction-dark .fig-body { color: #9b59b6; opacity: .55; }
body.faction-light .fig-body { color: #87ceeb; opacity: .55; }

.fig-slot {
  position: absolute;
  width: 44px;
  transform: translate(-50%, -50%);
  text-align: center;
  cursor: pointer;
  user-select: none;
  z-index: 2;
  transition: transform .15s ease;
}
.fig-slot:active { transform: translate(-50%, -50%) scale(.92); }
.fig-slot-frame {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bg-equip), var(--bg-card));
  border: 2px solid rgba(212,160,23,0.35);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,0.55);
}
.fig-slot-frame img {
  width: 35px; height: 35px; border-radius: 8px;
  object-fit: cover;
}
.fig-slot-emoji { font-size: 17px; opacity: .4; }
.fig-slot.empty .fig-slot-frame {
  border-style: dashed;
  border-color: rgba(212,160,23,0.20);
  background: rgba(0,0,0,0.25);
}
.fig-slot-label {
  font-family: 'Cinzel', serif;
  font-size: 7px; letter-spacing: .25px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.fig-slot-bonuses {
  font-size: 7px;
  color: var(--gold-bright);
  text-shadow: 0 0 4px rgba(0,0,0,0.8);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Rarity glow */
.fig-slot.rar-common .fig-slot-frame { border-color: #8e8e8e; }
.fig-slot.rar-uncommon .fig-slot-frame { border-color: #2ecc71; box-shadow: 0 0 10px rgba(46,204,113,0.4), 0 3px 10px rgba(0,0,0,0.55); }
.fig-slot.rar-rare .fig-slot-frame { border-color: #3498db; box-shadow: 0 0 12px rgba(52,152,219,0.5), 0 3px 10px rgba(0,0,0,0.55); }
.fig-slot.rar-epic .fig-slot-frame { border-color: #9b59b6; box-shadow: 0 0 14px rgba(155,89,182,0.6), 0 3px 10px rgba(0,0,0,0.55); }
.fig-slot.rar-legendary .fig-slot-frame {
  border-color: #f39c12;
  box-shadow: 0 0 18px rgba(243,156,18,0.8), 0 0 36px rgba(243,156,18,0.3), 0 3px 10px rgba(0,0,0,0.55);
  animation: legendaryPulse 2.2s ease-in-out infinite;
}
@keyframes legendaryPulse {
  0%, 100% { box-shadow: 0 0 18px rgba(243,156,18,0.7), 0 0 30px rgba(243,156,18,0.25), 0 3px 10px rgba(0,0,0,0.55); }
  50%      { box-shadow: 0 0 24px rgba(243,156,18,0.95), 0 0 45px rgba(243,156,18,0.4), 0 3px 10px rgba(0,0,0,0.55); }
}

/* Stats summary card in corner */
.fig-summary {
  position: absolute;
  top: 8px; right: 6px;
  background: rgba(10,15,25,0.78);
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 8px;
  padding: 5px 7px;
  display: flex; flex-direction: column; gap: 3px;
  backdrop-filter: blur(4px);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 3;
}
.fig-sum-row {
  display: flex; align-items: center; gap: 4px;
}

/* ============================================ */
/*  INVENTORY TOOLBAR                           */
/* ============================================ */

.inv-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 10px 4px;
  align-items: center;
}
.inv-search {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-bright);
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.inv-search::placeholder { color: var(--text-ancient); }
.inv-search:focus { border-color: var(--gold); }
.inv-sort {
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12px;
  color: var(--text-bright);
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.inv-bulk {
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  transition: all .15s;
}
.inv-bulk:active { transform: scale(0.93); border-color: var(--gold); }

/* ============================================ */
/*  COMPARE DIFF + BULK SELL MODAL              */
/* ============================================ */

.diff { font-size: 10px; font-weight: 700; margin-left: 4px; font-variant-numeric: tabular-nums; }
.diff.pos { color: #2ecc71; }
.diff.neg { color: #e74c3c; }
.compare-note {
  margin-top: 8px; padding: 6px 10px;
  background: rgba(212,160,23,0.08);
  border-left: 3px solid var(--gold-dim);
  border-radius: 5px;
  font-size: 11px; color: var(--text-normal);
}
.bulk-opts { display: flex; flex-direction: column; gap: 6px; }
.bulk-opt {
  text-align: left !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
}
.bulk-opt:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================ */
/*  SHOP: ROTATION BANNER + TABS + NEW BADGE    */
/* ============================================ */

.shop-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, rgba(212,160,23,0.12), rgba(212,160,23,0.03));
  border: 1px solid rgba(212,160,23,0.28);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0 10px 8px;
  font-size: 12px;
  color: var(--text-bright);
  box-shadow: inset 0 0 12px rgba(212,160,23,0.06);
}
.shop-banner .sb-icon { margin-right: 5px; }
.shop-banner .sb-text b { color: var(--gold-bright); font-family: 'Cinzel', serif; }
.shop-banner .sb-right {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.shop-banner .sb-right b {
  color: var(--gold-bright);
  letter-spacing: .5px;
}

.shop-tabs {
  display: flex; gap: 4px; padding: 4px 10px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab {
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: 8px;
  padding: 5px 9px 5px 8px;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
  transition: all .15s;
  flex-shrink: 0;
}
.shop-tab .stt-emoji { font-size: 13px; }
.shop-tab .stt-count {
  font-size: 10px; padding: 1px 5px; border-radius: 8px;
  background: rgba(212,160,23,0.12); color: var(--gold);
  min-width: 16px; text-align: center;
}
.shop-tab.active {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--bg-dungeon);
  border-color: var(--gold-bright);
  font-weight: 700;
}
.shop-tab.active .stt-count { background: rgba(0,0,0,0.2); color: var(--bg-abyss); }

.shop-new-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: linear-gradient(135deg, #e74c3c, #ff6b6b);
  color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
  letter-spacing: .5px;
  box-shadow: 0 0 10px rgba(231,76,60,0.6);
  animation: newBadgePulse 1.8s ease-in-out infinite;
  z-index: 3;
}
@keyframes newBadgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px rgba(231,76,60,0.6); }
  50%      { transform: scale(1.08); box-shadow: 0 0 16px rgba(231,76,60,0.9); }
}

.shop-card { position: relative; }
.shop-card.poor {
  opacity: .6;
  filter: grayscale(.4);
}
.shop-card.poor .item-price-tag { color: #e74c3c; }
.shop-img {
  width: 48px; height: 48px;
  border-radius: 8px; object-fit: cover;
  margin: 0 auto 4px;
  display: block;
}
.item-price-after {
  font-size: 9px;
  margin-top: 2px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============================================ */
/*  AUCTION: SUBTABS + FILTERS + CARDS + STATS  */
/* ============================================ */

.auc-subtabs {
  display: flex; gap: 4px; padding: 8px 10px 4px;
  border-bottom: 1px solid rgba(212,160,23,0.15);
}
.auc-subtab {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: 8px 8px 0 0;
  padding: 8px 4px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all .15s;
}
.auc-subtab.active {
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  color: var(--bg-dungeon);
  border-color: var(--gold-bright);
  font-weight: 700;
}
.auc-filters {
  display: flex; gap: 6px; padding: 8px 10px;
  flex-wrap: wrap;
}
.auc-filters select {
  flex: 1;
  min-width: 90px;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-bright);
  font-family: inherit;
  cursor: pointer;
}

.auc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 6px 10px;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: 10px;
  position: relative;
  transition: transform .1s;
}
.auc-card[data-rarity="uncommon"]  { border-color: rgba(46,204,113,0.4); }
.auc-card[data-rarity="rare"]      { border-color: rgba(52,152,219,0.4); }
.auc-card[data-rarity="epic"]      { border-color: rgba(196,77,255,0.5); }
.auc-card[data-rarity="legendary"] { border-color: rgba(243,156,18,0.6); box-shadow: 0 0 12px rgba(243,156,18,0.25); }
.auc-card .auc-main { flex: 1; min-width: 0; }
.auc-card .auc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.auc-card .auc-head .item-name { font-size: 13px; font-weight: 600; }
.auc-card .auc-bon { font-size: 10px; color: var(--text-normal); margin-bottom: 2px; }
.auc-card .auc-meta { font-size: 10px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.auc-card .auc-meta b { color: var(--gold-bright); }

.auc-stats {
  display: flex; gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
}
.auc-st {
  flex: 1;
  min-width: 60px;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 8px;
  padding: 7px 4px;
  text-align: center;
}
.auc-st .ast-val {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}
.auc-st .ast-lbl {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: .5px;
}

/* ============================================ */
/*  SPEC TREE (visual graph)                    */
/* ============================================ */

.spec-status {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  margin: 6px 10px 10px;
  background: linear-gradient(135deg, var(--bg-parchment), var(--bg-card));
  border: 1px solid rgba(212,160,23,0.3);
  border-radius: 12px;
  box-shadow: inset 0 0 14px rgba(0,0,0,0.3);
}
.spec-status.chosen { border-color: var(--gold); box-shadow: 0 0 14px rgba(212,160,23,0.25); }
.spec-status.ready { border-color: rgba(243,156,18,0.5); }
.spec-status.locked { opacity: .7; }
.spec-status-icon {
  font-size: 30px;
  min-width: 44px; text-align: center;
  filter: drop-shadow(0 0 8px rgba(212,160,23,0.3));
}
.spec-status-body { flex: 1; min-width: 0; }
.spec-status-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.spec-status-name {
  font-family: 'Cinzel', serif;
  font-size: 15px; font-weight: 700;
  color: var(--gold-bright);
}
.spec-status-stats { font-size: 11px; color: var(--text-normal); margin-top: 2px; }
.spec-locked-bar-wrap {
  height: 5px; background: rgba(0,0,0,0.5); border-radius: 3px;
  margin-top: 5px; overflow: hidden;
}
.spec-locked-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  border-radius: 3px;
  transition: width .3s;
}

.spec-tree-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 6px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(212,160,23,0.08), transparent 70%),
    linear-gradient(180deg, var(--bg-parchment), var(--bg-stone));
  border: 1px solid rgba(212,160,23,0.2);
  border-radius: 14px;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}
.spec-tree-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}
.spec-link {
  fill: none;
  stroke-width: 2;
  opacity: .4;
  stroke-dasharray: 4 4;
}
.spec-link.active {
  opacity: 1;
  stroke-width: 3;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 4px currentColor);
  animation: specLinkPulse 1.8s ease-in-out infinite;
}
@keyframes specLinkPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

.spec-cat circle { transition: all .2s; }
.spec-cat.active circle {
  filter: drop-shadow(0 0 8px currentColor);
}
.spec-cat-label {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: .3px;
  pointer-events: none;
}

.spec-node {
  cursor: pointer;
  transition: transform .15s;
}
.spec-node circle {
  transition: all .2s;
}
.spec-node:active { transform-origin: center; }
.spec-node:hover circle {
  stroke-width: 3;
  filter: drop-shadow(0 0 6px currentColor);
}
.spec-node.active circle {
  stroke-width: 3;
  filter: drop-shadow(0 0 14px var(--gold-bright));
  animation: specNodePulse 2s ease-in-out infinite;
}
@keyframes specNodePulse {
  0%, 100% { filter: drop-shadow(0 0 10px currentColor); }
  50% { filter: drop-shadow(0 0 18px currentColor); }
}
.spec-node.locked circle { opacity: .3; }
.spec-node.locked text { opacity: .4; }
.spec-node.dim circle { opacity: .5; }
.spec-node.dim { cursor: not-allowed; }
.spec-root circle { filter: drop-shadow(0 0 12px rgba(212,160,23,0.5)); }
.spec-root.active circle {
  animation: specRootPulse 2.4s ease-in-out infinite;
}
@keyframes specRootPulse {
  0%, 100% { filter: drop-shadow(0 0 10px var(--gold-bright)); }
  50% { filter: drop-shadow(0 0 20px var(--gold-bright)); }
}

.spec-legend {
  display: flex; justify-content: center; gap: 16px;
  padding: 8px 10px 14px;
  font-size: 11px;
  color: var(--text-dim);
}
.spec-leg-item { display: flex; align-items: center; gap: 5px; }
.spec-leg-item .dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 4px currentColor;
}

/* ============================================ */
/*  HEADER-EXTRA (compact bars/chips/daily)     */
/* ============================================ */

.header-extra {
  padding: 4px 10px 8px;
  border-bottom: 1px solid rgba(212,160,23,0.12);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.15));
}
.mini-bars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin-bottom: 6px;
}
.mini-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.mini-bar-label { color: var(--text-normal); white-space: nowrap; }
.mini-bar-track {
  height: 5px;
  background: rgba(0,0,0,0.55);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(212,160,23,0.12);
}
.mini-bar-track .fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}
.mini-bar-value { color: var(--text-dim); font-size: 9px; }
/* TASK711: over-limit pool highlight (mana above natural max — earned via arena waves) */
.mini-bar.over .mini-bar-value { color: #d4a017; }
.mini-bar.over .mini-bar-value .over-limit { font-weight: 700; }
.mini-bar.mana     .fill { background: linear-gradient(90deg, #5a2c9e, #9b59b6); }
.mini-bar.satiety  .fill { background: linear-gradient(90deg, #8b5a2b, #d4a017); }
.mini-bar.injuries .fill { background: linear-gradient(90deg, #5a0000, #c0392b); }
.mini-bar.camo     .fill { background: linear-gradient(90deg, #3a3a3a, #6e6e6e); }
.mini-bar.crit .mini-bar-track { box-shadow: 0 0 6px rgba(196,80,60,0.5); }

.mini-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mini-chips::-webkit-scrollbar { display: none; }
.mini-chip {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid rgba(212,160,23,0.22);
  border-radius: 12px;
  padding: 4px 9px;
  font-size: 10px;
  color: var(--text-normal);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mini-chip b { color: var(--gold-bright); font-weight: 700; }
.mini-chip.karma { padding-right: 4px; }
.karma-mini-track {
  width: 36px; height: 5px;
  background: rgba(0,0,0,0.55);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  margin-left: 4px;
}
.karma-mini-dot {
  position: absolute;
  width: 7px; height: 7px;
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px currentColor;
}

.header-daily {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  margin-top: 6px;
  background: linear-gradient(90deg, rgba(212,160,23,0.15), rgba(212,160,23,0.05));
  border: 1px solid rgba(212,160,23,0.35);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-bright);
  box-shadow: inset 0 0 10px rgba(212,160,23,0.08);
  animation: dailyPulse 2.5s ease-in-out infinite;
}
@keyframes dailyPulse {
  0%, 100% { box-shadow: inset 0 0 10px rgba(212,160,23,0.08); }
  50% { box-shadow: inset 0 0 16px rgba(212,160,23,0.18); }
}
.header-daily b { color: var(--gold-bright); }
.btn-sm { padding: 8px 14px; font-size: 11px; min-height: 32px; }

/* ============================================ */
/*  SHOP (crystal packs) + MERCHANT             */
/* ============================================ */
.shop-balances { display: flex; align-items: center; gap: 8px; }
.shop-balance-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-weight: 700; font-size: 12px;
  background: linear-gradient(135deg, rgba(108,92,231,0.25), rgba(108,92,231,0.08));
  border: 1px solid rgba(108,92,231,0.5);
  color: #c9b8ff;
}
.shop-balance-pill.crystal b { color: #b8a8ff; }
.btn-crystal {
  background: linear-gradient(135deg, #6c5ce7, #8b7cf6);
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 2px 8px rgba(108,92,231,0.4);
}
.shop-intro {
  padding: 8px 12px; margin: 6px 0;
  font-size: 11px; color: var(--text-dim);
  font-style: italic;
  border-left: 3px solid #6c5ce7;
  background: rgba(108,92,231,0.05);
  border-radius: 0 6px 6px 0;
}
.shop-packs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px 0 30px;
}
.pack-card {
  position: relative;
  padding: 12px 10px 10px;
  background: linear-gradient(180deg, var(--bg-card), rgba(0,0,0,0.25));
  border: 1px solid rgba(212,160,23,0.25);
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pack-card:active { transform: scale(0.97); }
.pack-card:hover { border-color: rgba(212,160,23,0.6); box-shadow: 0 4px 14px rgba(212,160,23,0.2); }
.pack-card.pack-poor { opacity: 0.7; }
.pack-card.pack-disabled { opacity: 0.45; cursor: not-allowed; }
.pack-icon { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.pack-name { font-family: Cinzel, serif; font-size: 12px; color: var(--gold); margin-bottom: 4px; line-height: 1.2; }
.pack-desc { font-size: 10px; color: var(--text-dim); line-height: 1.3; min-height: 38px; margin-bottom: 6px; }
.pack-price { font-size: 14px; font-weight: 700; color: #b8a8ff; margin-top: 4px; }
.pack-price b { color: #d9c9ff; }
.pack-afford { font-size: 10px; margin-top: 2px; font-weight: 600; }
.pack-afford.ok  { color: #2ecc71; }
.pack-afford.bad { color: #e74c3c; }
.pack-badge {
  position: absolute; top: 6px; right: 6px;
  background: linear-gradient(135deg, #ff6b6b, #f39c12);
  color: #fff; font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  text-transform: uppercase;
}
.pack-disabled-label {
  font-size: 10px; color: #888; margin-top: 4px;
  font-style: italic;
}

/* Merchant modal */
.merchant-modal { padding: 4px 0; }
.merchant-title {
  font-family: Cinzel, serif;
  font-size: 20px; color: var(--gold-bright);
  text-align: center; margin-bottom: 6px;
}
.merchant-subtitle {
  font-size: 11px; color: var(--text-dim);
  font-style: italic; text-align: center;
  margin-bottom: 10px; line-height: 1.35;
}
.merchant-balance {
  text-align: center; font-size: 13px;
  color: #c9b8ff; margin-bottom: 8px;
}
.merchant-balance b { color: #d9c9ff; font-size: 16px; }
.merchant-note {
  font-size: 10px; color: #f39c12;
  background: rgba(243,156,18,0.08);
  border: 1px solid rgba(243,156,18,0.3);
  padding: 6px 10px; border-radius: 6px;
  margin-bottom: 10px; line-height: 1.35;
}
.merchant-packs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.merchant-pack {
  padding: 10px 8px; text-align: center;
  background: linear-gradient(180deg, rgba(108,92,231,0.1), rgba(108,92,231,0.02));
  border: 1px solid rgba(108,92,231,0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.merchant-pack:active { transform: scale(0.96); }
.merchant-pack:hover {
  border-color: #8b7cf6;
  box-shadow: 0 4px 12px rgba(108,92,231,0.3);
}
.merchant-pack .mp-crystals { font-size: 14px; color: #d9c9ff; margin-bottom: 2px; }
.merchant-pack .mp-crystals b { color: #fff; font-size: 17px; }
.merchant-pack .mp-rub { font-size: 13px; color: var(--gold); font-weight: 700; }
.merchant-pack .mp-bonus {
  display: inline-block; margin-top: 4px;
  font-size: 10px; color: #2ecc71; font-weight: 700;
  background: rgba(46,204,113,0.15);
  padding: 1px 6px; border-radius: 4px;
}
.merchant-foot { text-align: center; }

/* Pack result modal */
.pack-result-modal { padding: 4px 0; text-align: center; }
.pack-result-title {
  font-family: Cinzel, serif;
  font-size: 22px; color: var(--gold-bright);
  margin-bottom: 10px;
  animation: specNodePulse 1.6s ease-in-out infinite;
}
.pack-result-list {
  margin: 10px 0;
  text-align: left;
  background: rgba(0,0,0,0.25);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(212,160,23,0.2);
}
.pack-reward-row {
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px dashed rgba(255,255,255,0.07);
}
.pack-reward-row:last-child { border-bottom: 0; }
.pack-result-foot {
  font-size: 12px; color: var(--text-dim);
  margin: 8px 0 12px;
}
.pack-result-foot b { color: #d9c9ff; }

/* Manual mode modal */
.merchant-manual { padding: 4px 0; text-align: center; }
.merchant-manual .mm-title {
  font-family: Cinzel, serif; font-size: 16px;
  color: var(--gold-bright); margin-bottom: 8px;
}
.merchant-manual .mm-text { font-size: 12px; line-height: 1.45; margin-bottom: 10px; }
.merchant-manual .mm-ids {
  font-size: 11px; background: rgba(0,0,0,0.25);
  padding: 8px 12px; border-radius: 6px;
  margin-bottom: 10px; color: var(--gold);
  font-family: monospace;
}
.merchant-manual .mm-ids b { color: var(--gold-bright); }
.merchant-manual .mm-hint {
  font-size: 10px; color: var(--text-dim);
  font-style: italic; margin-bottom: 12px;
}
.merchant-pack.merchant-pack-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}
.merchant-pack.merchant-pack-disabled:hover {
  border-color: rgba(108,92,231,0.4);
  box-shadow: none;
}
/* ===== AUCTION REDESIGN 01 — Dark Fantasy Marketplace UI ===== */
/* Additive CSS — ported verbatim from the AUCTION REDESIGN 01 change-set into the LOADED app.css (style.css is not referenced by index.html). Does NOT replace existing rules. Variables resolved to the app.css theme (--text-normal/--text-dim). */
/* All new classes prefixed with .auc-r- to avoid collisions. */

:root {
  --auc-r-bg: #0d1220;
  --auc-r-card: #162035;
  --auc-r-card-hover: #1e2a44;
  --auc-r-border: #2a3a5c;
  --auc-r-accent: #6366f1;
  --auc-r-gold: #f59e0b;
  --auc-r-glow: rgba(99, 102, 241, 0.15);
  --auc-r-success: #22c55e;
  --auc-r-danger: #ef4444;
  --auc-r-timer-urgent: #ef4444;
  --auc-r-timer-normal: #64748b;
  --auc-r-radius: 10px;
  --auc-r-radius-sm: 6px;
}

/* Tabs */
.auc-r-tabs { display:flex; gap:4px; padding:4px; background:var(--auc-r-bg); border-radius:var(--auc-r-radius); margin-bottom:12px; overflow-x:auto; }
.auc-r-tab { flex:1 1 auto; padding:8px 12px; border:none; background:transparent; color:var(--text-normal); font-size:12px; font-weight:600; border-radius:var(--auc-r-radius-sm); cursor:pointer; transition:all .2s; white-space:nowrap; text-align:center; }
.auc-r-tab.active { background:var(--auc-r-accent); color:white; box-shadow:0 2px 8px var(--auc-r-glow); }
.auc-r-tab:not(.active):active { background:var(--auc-r-card-hover); }

/* Filters */
.auc-r-filters { display:flex; gap:6px; margin-bottom:10px; }
.auc-r-filters select { flex:1; padding:7px 10px; background:var(--auc-r-card); color:var(--text-normal); border:1px solid var(--auc-r-border); border-radius:var(--auc-r-radius-sm); font-size:12px; }

/* Lot card */
.auc-r-card { display:flex; align-items:center; gap:10px; padding:10px; background:var(--auc-r-card); border-radius:var(--auc-r-radius); border:1px solid var(--auc-r-border); border-left:3px solid var(--rarity-rare); margin-bottom:8px; transition:all .15s; }
.auc-r-card:active { background:var(--auc-r-card-hover); transform:scale(.99); }
.auc-r-card[data-rarity="common"] { border-left-color:var(--rarity-common); }
.auc-r-card[data-rarity="uncommon"] { border-left-color:var(--rarity-uncommon); }
.auc-r-card[data-rarity="rare"] { border-left-color:var(--rarity-rare); }
.auc-r-card[data-rarity="epic"] { border-left-color:var(--rarity-epic); }
.auc-r-card[data-rarity="legendary"] { border-left-color:var(--rarity-legendary); }
.auc-r-card[data-rarity="mystical"] { border-left-color:#ff0066; }
.auc-r-card.compact { padding:8px; opacity:.75; }

/* Icon */
.auc-r-icon { width:48px; height:48px; border-radius:var(--auc-r-radius-sm); flex-shrink:0; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:24px; background:rgba(0,0,0,.3); }
.auc-r-icon img { width:100%; height:100%; object-fit:cover; }
.auc-r-card.compact .auc-r-icon { width:36px; height:36px; font-size:18px; }

/* Main content */
.auc-r-main { flex:1; min-width:0; }
.auc-r-head { display:flex; align-items:baseline; gap:6px; margin-bottom:2px; }
.auc-r-name { font-size:13px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.auc-r-rarity { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; opacity:.8; }
.auc-r-bon { font-size:11px; color:var(--text-normal); margin-bottom:4px; }
.auc-r-meta { display:flex; align-items:center; gap:8px; font-size:11px; color:var(--text-dim); flex-wrap:wrap; }

/* Price */
.auc-r-price { font-size:15px; font-weight:800; color:var(--auc-r-gold); white-space:nowrap; }

/* Timer */
.auc-r-timer { font-size:11px; color:var(--auc-r-timer-normal); font-weight:600; }
.auc-r-timer.urgent { color:var(--auc-r-timer-urgent); animation:auc-r-pulse 1.5s ease-in-out infinite; }
@keyframes auc-r-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* Badges */
.auc-r-badge { display:inline-flex; align-items:center; gap:3px; padding:2px 8px; border-radius:20px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.3px; }
.auc-r-badge.leading { background:rgba(34,197,94,.15); color:var(--auc-r-success); }
.auc-r-badge.outbid { background:rgba(239,68,68,.15); color:var(--auc-r-danger); }
.auc-r-badge.mine { background:rgba(99,102,241,.15); color:var(--auc-r-accent); }
.auc-r-badge.sold { background:rgba(245,158,11,.15); color:var(--auc-r-gold); }
.auc-r-badge.ended { background:rgba(100,116,139,.15); color:var(--text-dim); }

/* Buttons */
.auc-r-btn { padding:8px 14px; border:none; border-radius:var(--auc-r-radius-sm); font-size:12px; font-weight:700; cursor:pointer; transition:all .15s; white-space:nowrap; }
.auc-r-btn-primary { background:var(--auc-r-gold); color:#000; }
.auc-r-btn-primary:active { transform:scale(.97); }
.auc-r-btn-primary[disabled] { opacity:.5; }
.auc-r-btn-secondary { background:var(--auc-r-card-hover); color:var(--text-normal); border:1px solid var(--auc-r-border); }
.auc-r-btn-danger { background:rgba(239,68,68,.15); color:var(--auc-r-danger); border:1px solid rgba(239,68,68,.3); }

/* Empty states */
.auc-r-empty { text-align:center; padding:40px 20px; color:var(--text-dim); }
.auc-r-empty-icon { font-size:48px; margin-bottom:12px; opacity:.3; }
.auc-r-empty-text { font-size:14px; margin-bottom:4px; }
.auc-r-empty-hint { font-size:12px; color:var(--text-dim); }

/* Section divider */
.auc-r-section { font-size:11px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.5px; margin:12px 0 6px; padding-bottom:4px; border-bottom:1px solid var(--auc-r-border); }

/* Wallet bar */
.auc-r-wallet { display:flex; gap:12px; padding:8px 12px; background:var(--auc-r-bg); border-radius:var(--auc-r-radius-sm); margin-bottom:10px; font-size:12px; }
.auc-r-wallet-item { display:flex; align-items:center; gap:4px; }
.auc-r-wallet-item b { color:var(--auc-r-gold); }

/* Sell form */
.auc-r-sell-form { display:flex; flex-direction:column; gap:10px; }
.auc-r-field { display:flex; flex-direction:column; gap:4px; }
.auc-r-label { font-size:11px; color:var(--text-dim); font-weight:600; }
.auc-r-input { padding:10px 12px; background:var(--auc-r-card); color:var(--text-normal); border:1px solid var(--auc-r-border); border-radius:var(--auc-r-radius-sm); font-size:14px; width:100%; box-sizing:border-box; }

/* Skeleton loading */
.auc-r-skeleton { background:var(--auc-r-card); border-radius:var(--auc-r-radius); padding:10px; margin-bottom:8px; display:flex; gap:10px; animation:auc-r-shimmer 1.5s ease-in-out infinite; }
.auc-r-skeleton-icon { width:48px; height:48px; border-radius:var(--auc-r-radius-sm); background:rgba(255,255,255,.05); }
.auc-r-skeleton-lines { flex:1; display:flex; flex-direction:column; gap:6px; }
.auc-r-skeleton-line { height:12px; border-radius:4px; background:rgba(255,255,255,.05); }
.auc-r-skeleton-line.short { width:60%; }
@keyframes auc-r-shimmer { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ============================================================
   CHARACTER SKILLS VIEW (P0_04) — internal character screen.
   Rendered by js/features/reference.js from /api/character/reference.
   ============================================================ */
.skills-header { display:flex; align-items:center; gap:8px; padding:10px 16px 4px; }
.skills-back-btn { flex:0 0 auto; padding:7px 12px; border:1px solid var(--border-rune); background:var(--bg-stone); color:var(--text-normal); border-radius:8px; font-size:12px; cursor:pointer; font-family:inherit; }
.skills-back-btn:active { background:var(--gold-dim); color:var(--text-glow); }
.skills-title { font-family:Cinzel,serif; font-size:14px; font-weight:600; color:var(--text-bright); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.skills-chips { display:flex; gap:6px; overflow-x:auto; -webkit-overflow-scrolling:touch; padding:8px 16px 6px; scrollbar-width:none; }
.skills-chips::-webkit-scrollbar { display:none; }
.skills-chip { flex:0 0 auto; white-space:nowrap; padding:6px 11px; border:1px solid var(--border-rune); background:var(--bg-stone); color:var(--text-normal); border-radius:16px; font-size:11px; cursor:pointer; font-family:inherit; }
.skills-chip.active { background:var(--gold-dim); color:var(--text-glow); border-color:var(--gold); }
.skills-content { display:flex; flex-direction:column; gap:8px; padding:6px 16px 24px; }
.skills-card { background:var(--bg-card); border:1px solid var(--border-rune); border-radius:12px; padding:12px; }
.skills-card.active { border-color:var(--gold); box-shadow:0 0 8px rgba(212,160,23,0.15); }
.skills-card.equipped { border-color:rgba(46,204,113,0.4); }
.skills-card.locked { opacity:0.65; }
.skills-card-head { display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.skills-emoji { font-size:18px; flex:0 0 auto; }
.skills-card-name { font-family:Cinzel,serif; font-size:14px; font-weight:600; color:var(--text-bright); flex:1; min-width:0; }
.skills-card-rarity { font-size:10px; padding:2px 6px; border-radius:4px; background:rgba(255,255,255,0.08); flex:0 0 auto; }
.skills-card-source { font-size:10px; color:var(--text-dim); margin-bottom:4px; }
.skills-card-desc { font-size:12px; line-height:1.5; color:var(--text-bright); margin-bottom:6px; }
/* MINIAPP_ABILITY_MECHANIC_WARNINGS_14: compact ⚠ block for non-obvious ability
 * mechanics (50% miss, self-debuff, always-crit, etc.). Sourced from
 * ability-registry.js `mechanicWarning` field — rendered ONLY when present.
 * Distinguished from .skills-card-desc (lore) and .skills-card-effect (book
 * effect line) by amber color + left border + smaller font. Mobile-clean:
 * full-width, no float, wraps long warnings. */
.skills-card-warning { font-size:12px; line-height:1.45; color:#e8a747; background:rgba(232,167,71,0.08); border-left:2px solid #e8a747; padding:4px 8px; margin-bottom:6px; border-radius:0 4px 4px 0; }
.skills-card-effect { font-size:11px; line-height:1.45; color:#c9b37e; margin-bottom:4px; }
.skills-card-stats { font-size:11px; color:var(--text-normal); line-height:1.4; }
.skills-badge { display:inline-block; font-size:10px; padding:2px 8px; border-radius:4px; margin-top:6px; }
.active-badge { background:rgba(46,204,113,0.15); color:#2ecc71; }
.equipped-badge { background:rgba(46,204,113,0.15); color:#2ecc71; }
.locked-badge { background:rgba(192,57,43,0.15); color:#c0392b; }
.skills-state { text-align:center; padding:28px 16px; color:var(--text-dim); }
.skills-state-icon { font-size:26px; margin-bottom:8px; }
.skills-state-text { font-size:12px; line-height:1.55; color:var(--text-normal); }
.skills-retry-btn { margin-top:12px; padding:8px 18px; border:1px solid var(--border-rune); background:var(--bg-stone); color:var(--text-normal); border-radius:8px; font-size:12px; cursor:pointer; font-family:inherit; }

/* ============================================================
   MINIAPP_HERO_IMPROVEMENT_ADVISOR_07 — «💡 Усилить героя»
   Экран-советник внутри вкладки «Персонаж» (sibling of .character-layout).
   Стили повторяют язык существующего MiniApp (skills-*, тёмная тема).
   ============================================================ */

/* Внутренний экран (переиспользует .skills-header/.skills-back-btn) */
#hero-advisor-view {
  padding-bottom: 90px;
}

.hero-advisor-content {
  padding: 12px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Карточка рекомендации */
.hero-advice-card {
  background: linear-gradient(160deg, rgba(46, 40, 76, 0.55), rgba(30, 28, 54, 0.85));
  border: 1px solid rgba(155, 127, 212, 0.35);
  border-radius: 14px;
  padding: 12px 12px 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.hero-advice-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hero-advice-icon {
  font-size: 22px;
  line-height: 1.2;
  flex: 0 0 auto;
}

.hero-advice-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: #e8e4f5;
  word-break: break-word;
}

/* Кнопка перехода на существующий экран */
.hero-advice-btn {
  margin-top: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(232, 184, 75, 0.55);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(232, 184, 75, 0.22), rgba(232, 184, 75, 0.10));
  color: #f5d78e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.hero-advice-btn:active {
  background: rgba(232, 184, 75, 0.32);
}

/* Хорошее состояние (recommendations = 0) */
.hero-advice-good .hero-advice-good-title {
  font-size: 15px;
  font-weight: 700;
  color: #9fe3a1;
  margin: 6px 0 4px;
}

/* Бейдж-счётчик рядом с записью в шапке: «💡 Усилить героя · 3» */
#hero-advice-badge {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 9px;
  background: linear-gradient(180deg, #f0c96a, #d9a63c);
  color: #241c07;
  font-size: 10.5px;
  font-weight: 800;
  vertical-align: 1px;
}

/* ============================================================
   COMBAT_TECHNIQUE_LOADOUT_3 (GLM3) — «Боевой набор приёмов» section
   Lives on the existing «Способности и приёмы» (Skills) screen, above
   the chip filter. Mobile-first, no drag&drop, simple swap-chooser UX.
   ============================================================ */
.loadout-section {
  margin: 0 0 12px;
  padding: 12px;
  background: linear-gradient(180deg, var(--bg-parchment), var(--bg-card));
  border: 1px solid var(--border-rune);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.loadout-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-glow);
  letter-spacing: 0.3px;
}
.loadout-subtitle {
  font-size: 12px;
  color: var(--text-normal);
  margin-top: -6px;
}
.loadout-slots {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.loadout-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-stone);
  border: 1px solid var(--border-stone);
  border-radius: 8px;
}
.loadout-slot-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-dim);
  color: var(--text-glow);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
}
.loadout-slot-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
}
.loadout-slot-name.empty {
  color: var(--text-ancient);
  font-style: italic;
  font-weight: 400;
}
.loadout-emoji {
  font-size: 14px;
}
.loadout-blocked {
  padding: 8px 10px;
  background: rgba(192, 57, 43, 0.16);
  border: 1px solid rgba(192, 57, 43, 0.4);
  border-radius: 8px;
  color: #f3b6b0;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}
.loadout-swap-chooser {
  padding: 10px;
  background: var(--bg-stone);
  border: 1px solid var(--gold);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.loadout-swap-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
}
.loadout-swap-hint {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: -2px;
}
.loadout-swap-btn {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-rune);
  color: var(--text-bright);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.loadout-swap-btn:active {
  background: var(--gold-dim);
  color: var(--text-glow);
}
.loadout-swap-cancel {
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-stone);
  color: var(--text-dim);
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
}
.loadout-pool-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-normal);
  margin-top: 2px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.loadout-pool-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.loadout-pool-card {
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-stone);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.loadout-pool-card.selected {
  border-color: rgba(46, 204, 113, 0.45);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.06), var(--bg-card));
}
.loadout-pool-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.loadout-pool-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-bright);
}
.loadout-badge.chosen {
  padding: 2px 7px;
  background: rgba(46, 204, 113, 0.22);
  color: #b6f0c1;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
}
.loadout-pool-desc {
  font-size: 12px;
  color: var(--text-normal);
  line-height: 1.4;
}
.loadout-pool-stats {
  font-size: 11.5px;
  color: var(--text-dim);
}
.loadout-pool-restriction {
  font-size: 11.5px;
  color: #f5c46b;
  line-height: 1.35;
}
.loadout-pool-btn {
  margin-top: 4px;
  padding: 7px 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.loadout-pool-btn:active:not(:disabled) {
  background: var(--gold-dim);
  color: var(--text-glow);
}
.loadout-pool-btn.chosen {
  background: rgba(46, 204, 113, 0.18);
  border-color: rgba(46, 204, 113, 0.45);
  color: #b6f0c1;
  cursor: default;
}
.loadout-pool-btn.disabled {
  background: var(--bg-stone);
  border-color: var(--border-stone);
  color: var(--text-ancient);
  cursor: not-allowed;
  opacity: 0.7;
}

/* ============================================================
   MINIAPP_TECHNIQUE_EDIT_DUPLICATE_CARDS_FIX_28 (GLM3)
   ------------------------------------------------------------
   The canonical technique cards (the regular .skills-card list rendered
   by renderSkills()) are REUSED for editing — no separate pool card list
   inside the loadout section. In EDIT mode the canonical cards get a
   `.loadout-card` modifier (added by buildCard() when loadoutCtx is
   passed) + a `.loadout-card-btn` control button appended to the card
   body. CSS mirrors the previous .loadout-pool-card / .loadout-pool-btn
   styling so the visual identity is preserved, but the markup lives on
   the canonical .skills-card element instead of a separate pool card.
   ============================================================ */
.skills-card.loadout-card.loadout-card-selected {
  border-color: rgba(46, 204, 113, 0.45);
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.06), var(--bg-card));
}
.loadout-card-btn {
  margin-top: 8px;
  padding: 7px 10px;
  background: var(--bg-card-hover);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: center;
}
.loadout-card-btn:active:not(:disabled) {
  background: var(--gold-dim);
  color: var(--text-glow);
}
.loadout-card-btn.chosen {
  background: rgba(46, 204, 113, 0.18);
  border-color: rgba(46, 204, 113, 0.45);
  color: #b6f0c1;
  cursor: default;
}
.loadout-card-btn.disabled {
  background: var(--bg-stone);
  border-color: var(--border-stone);
  color: var(--text-ancient);
  cursor: not-allowed;
  opacity: 0.7;
}
/* The chosen badge (✓ Выбран) lives in the canonical card head in EDIT
   mode — same style as the pool-card badge. */
.skills-card.loadout-card .loadout-badge.chosen {
  padding: 2px 7px;
  background: rgba(46, 204, 113, 0.22);
  color: #b6f0c1;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 700;
}

/* Toast for save success/failure — body-level floating element. */
.loadout-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  background: var(--bg-abyss);
  border: 1px solid var(--gold);
  color: var(--text-glow);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms, transform 200ms;
  z-index: 10000;
  max-width: 80vw;
  text-align: center;
}
.loadout-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* Inner cards block — wraps the filtered cards list so the loadout section
   (when present, only on the «Приёмы» chip) sits cleanly above it. No
   inner chip strip — the OUTER #skills-chips is the single canonical
   chip strip (MINIAPP_TECHNIQUE_LOADOUT_UX_CLEANUP_18). */
.skills-cards-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skills-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* MINIAPP_TECHNIQUE_LOADOUT_UX_CLEANUP_18 (GLM3): the «Изменить набор» /
   «Готово» toggle button. Compact, clear call-to-action that switches the
   loadout section between NORMAL (read-only) and EDIT (swap controls)
   mode. */
.loadout-edit-toggle {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-card-hover);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0.2px;
}
.loadout-edit-toggle:active {
  background: var(--gold-dim);
  color: var(--text-glow);
}
.loadout-edit-toggle.exit {
  background: rgba(46, 204, 113, 0.16);
  border-color: rgba(46, 204, 113, 0.55);
  color: #b6f0c1;
}
.loadout-edit-toggle.exit:active {
  background: rgba(46, 204, 113, 0.28);
}


/* ===== ARMOR_SET_UI_RESTORE_101: блок «Сеты» на экране персонажа ===== */
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0 2px; }
.set-row .set-name { font-size: 12px; color: var(--text, #ddd); }
.set-row .set-count { font-size: 11px; color: var(--text-dim, #888); }
.set-row.active .set-name { color: var(--gold, #e8c46a); }
.set-row.active .set-count { color: var(--gold, #e8c46a); }
.set-bonus-line { font-size: 11px; color: var(--text-dim, #999); padding-bottom: 4px; }
.set-bonus-line.dim { opacity: 0.75; }

/* ===== TASK597 — MOBILE SINGLE-COLUMN CHARACTER LAYOUT (GLM2) =====
   Owner TASK597 §3: one full-width column on phones; two columns only on wide
   screens. Stacks Экипировка above Книги/Сеты/Прогресс/Бои (owner order §3).
   Pure layout change — colors, card styling and navigation untouched. */
@media (max-width: 768px) {
  .character-layout { flex-direction: column; gap: 14px; }
  .character-figure-col { flex-basis: auto; width: 100%; }
  .character-info-col { width: 100%; }
  .equip-figure { margin-left: auto; margin-right: auto; }
}
/* ===== TASK597 mobile layout end ===== */

/* TASK272 — Equip preview modal styles */
.equip-preview { display: flex; flex-direction: column; gap: 10px; }
.preview-section {
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.preview-warning {
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.15);
}
.preview-gain {
  background: rgba(46, 204, 113, 0.08);
  border-color: rgba(46, 204, 113, 0.15);
}
.preview-info {
  background: rgba(52, 152, 219, 0.08);
  border-color: rgba(52, 152, 219, 0.15);
}
.preview-section-title {
  font-family: 'Cinzel', serif; font-size: 12px; font-weight: 600;
  margin-bottom: 4px; color: var(--text-glow, #d4d4e0);
}
.preview-item {
  font-size: 13px; padding: 3px 0; color: var(--text-normal, #b4b4c0);
}
.preview-reason {
  font-size: 11px; color: var(--text-dim, #8a8a9a);
}
.preview-stat {
  font-size: 13px; padding: 2px 0;
}

/* ============================================================ */
/* TASK669-REV1 — PROGRESSION UI + DESKTOP ADAPTATION            */
/* ============================================================ */

/* ===== «Развитие героя» (Character tab) ===== */
.progression-section { margin-top: 14px; }
.progression-refresh-btn {
  margin-left: auto; background: rgba(212,160,23,0.1); color: var(--gold);
  border: 1px solid rgba(212,160,23,0.25); border-radius: 6px;
  width: 26px; height: 22px; font-size: 13px; line-height: 1; cursor: pointer;
}
.progression-refresh-btn:active { background: rgba(212,160,23,0.22); }
.progression-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 10px; }
.progression-stat {
  background: var(--bg-equip); border: 1px solid var(--border-stone);
  border-radius: var(--radius-sm); padding: 7px 4px; text-align: center;
}
.progression-stat-icon { font-size: 14px; line-height: 1.2; }
.progression-stat-value { font-family: 'Cinzel', serif; font-size: 14px; font-weight: 700; color: var(--text-glow); }
.progression-stat-bonus { font-size: 10px; color: var(--rarity-uncommon); line-height: 1.2; }
.progression-stat-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.progression-card {
  background: var(--bg-equip); border: 1px solid var(--border-stone);
  border-radius: var(--radius-sm); padding: 10px; margin-top: 8px;
}
.progression-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.progression-card-title { font-family: 'Cinzel', serif; font-size: 12px; font-weight: 700; color: var(--text-glow); }
.progression-avail { font-size: 12px; font-weight: 700; color: var(--gold-bright); white-space: nowrap; }
.progression-avail.zero { color: var(--text-dim); font-weight: 400; }
.progression-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; line-height: 1.45; }
.progression-hint.accent { color: var(--gold); }
.progression-allocs { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.progression-alloc-chip {
  font-size: 10px; color: var(--text-normal); background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-stone); border-radius: 10px; padding: 2px 8px;
}
.progression-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.progression-btn {
  background: linear-gradient(135deg, rgba(212,160,23,0.16), rgba(212,160,23,0.07));
  border: 1px solid var(--border-rune); border-radius: var(--radius-sm);
  color: var(--text-bright); font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 600; padding: 9px 6px; cursor: pointer; transition: all 0.15s;
}
.progression-btn:hover { background: linear-gradient(135deg, rgba(212,160,23,0.26), rgba(212,160,23,0.12)); }
.progression-btn:active { transform: scale(0.97); }
.progression-btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.progression-btn.secondary {
  background: rgba(255,255,255,0.05); border-color: var(--border-stone);
  color: var(--text-normal); padding: 7px 12px; white-space: nowrap; flex-shrink: 0;
}
.progression-btn.ghost { background: transparent; border-color: var(--border-stone); color: var(--text-dim); }
.progression-confirm {
  margin-top: 8px; padding: 10px; border: 1px solid var(--border-rune);
  border-radius: var(--radius-sm); background: rgba(212,160,23,0.06);
}
.progression-confirm-text { color: var(--text-bright); font-size: 12px; line-height: 1.5; }
.progression-confirm-actions { display: flex; gap: 6px; margin-top: 8px; }
.progression-confirm-actions .progression-btn { flex: 1; }
.progression-reset-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-stone);
}
.progression-reset-row:first-of-type { border-top: 0; margin-top: 6px; padding-top: 0; }
.progression-reset-title { font-size: 12px; color: var(--text-bright); font-weight: 600; }
.progression-price { font-size: 11px; color: var(--text-normal); margin-top: 2px; line-height: 1.4; }
.progression-error { color: var(--hp-glow); font-size: 11px; margin-top: 6px; line-height: 1.4; }

/* ===== DESKTOP ADAPTATION (>768px) — TASK669-REV1 §5 =====
   Mobile layout (≤768px) is UNTOUCHED. Goals: readable text, comfortable
   buttons, content-based max width (no arbitrary 860px), no stretching,
   stable inside the VK desktop iframe. */
@media (min-width: 769px) {
  /* Content width: two-column character layout (250px figure + ~640px info
     + 32px gap + panel padding) ≈ 980px — anything wider stretches rows
     unreadably; anything narrower cramps the figure. */
  .app { max-width: 1020px; margin-left: auto; margin-right: auto; }
  .ornate-header { padding: 14px 24px; }
  .char-secondary-link { font-size: 12.5px; }

  /* Header gems: centered row, larger values */
  .stats-gems { justify-content: center; gap: 16px; padding: 8px 16px; }
  .gem { min-width: 66px; max-width: 110px; gap: 2px; }
  .gem-value { font-size: 16px; }
  .gem-label { font-size: 10px; }

  /* Navigation: centered, no scroll strip, comfortable tap/click targets */
  .nav-tabs { justify-content: center; gap: 6px; overflow-x: visible; padding: 0 12px; }
  .nav-tab { padding: 10px 16px; font-size: 11px; }
  .nav-tab-icon { font-size: 18px; }

  /* Panels: more air, readable rows */
  .tab-panel { padding: 16px 20px 22px; }
  .section-header { font-size: 15px; }
  .info-section { padding: 12px 14px; }
  .info-row { font-size: 13px; padding: 4px 0; }
  .set-row { font-size: 13px; }
  .set-bonus-line { font-size: 12px; }
  .book-slot-name { font-size: 12px; }
  .book-slot-label { font-size: 10px; }

  /* Character: centered two-column layout by real content width */
  .character-layout { gap: 32px; justify-content: center; }
  .character-figure-col { flex: 0 0 250px; }
  .equip-figure { max-width: 250px; margin-left: auto; margin-right: auto; }
  .character-info-col { flex: 0 1 640px; }

  /* Progression: single row of 6 stat chips, 3-column action grid */
  .progression-stats { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .progression-stat-value { font-size: 15px; }
  .progression-stat-label { font-size: 10px; }
  .progression-card { padding: 12px 14px; }
  .progression-card-title { font-size: 13.5px; }
  .progression-avail { font-size: 13px; }
  .progression-hint { font-size: 12.5px; }
  .progression-alloc-chip { font-size: 11.5px; }
  .progression-btns { grid-template-columns: repeat(3, 1fr); }
  .progression-btn { font-size: 13px; padding: 10px 8px; }
  .progression-confirm-text { font-size: 13px; }
  .progression-reset-title { font-size: 13px; }
  .progression-price { font-size: 12px; }
  .progression-error { font-size: 12px; }
}
/* TASK724-PART-A — progression.css — Mobile-first responsive styles for the new
   «📈 Развитие героя» section. Targets 320/360/390/430 px breakpoints.
   Adds visual distinction: stat tiles are NOT buttons; buttons are obvious;
   disabled states are clearly marked; the dangerous-action section is
   visually isolated. */

/* === Section header === */
.pg-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 8px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 2px solid var(--pg-border, #2a2a3a);
  margin-bottom: 10px;
}
.pg-refresh-btn {
  background: transparent;
  border: 1px solid var(--pg-border, #2a2a3a);
  color: var(--pg-text-muted, #888);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
}
.pg-refresh-btn:active { background: rgba(255,255,255,0.05); }

/* === Stat tiles (INFORMATIONAL — NOT buttons) === */
.pg-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 6px;
}
.pg-stat-tile {
  background: var(--pg-tile-bg, #1a1a2e);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  /* Explicitly NOT a button */
  cursor: default;
  user-select: none;
  border: 1px solid transparent;
  transition: none;
}
.pg-stat-tile:hover, .pg-stat-tile:active {
  background: var(--pg-tile-bg, #1a1a2e); /* no visual change — info only */
}
.pg-stat-icon { font-size: 18px; line-height: 1; }
.pg-stat-value {
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
}
.pg-stat-bonus {
  display: inline-block;
  font-size: 11px;
  color: var(--pg-bonus-color, #4ade80);
  margin-left: 2px;
}
.pg-stat-label {
  font-size: 11px;
  color: var(--pg-text-muted, #888);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === "What to do next" hint banner === */
.pg-next-steps {
  display: flex;
  gap: 8px;
  background: var(--pg-hint-bg, #2a1f3a);
  border-left: 3px solid var(--pg-hint-accent, #a78bfa);
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}
.pg-next-steps-icon { font-size: 16px; line-height: 1.5; }
.pg-next-steps-text > div { margin-bottom: 4px; }
.pg-next-steps-text > div:last-child { margin-bottom: 0; }

/* === Card (general) === */
.pg-card {
  background: var(--pg-card-bg, #1a1a2e);
  border: 1px solid var(--pg-card-border, #2a2a3a);
  border-radius: 10px;
  padding: 12px;
  margin: 10px 0;
}
.pg-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--pg-border, #2a2a3a);
}
.pg-card-title {
  font-size: 15px;
  font-weight: 600;
}
.pg-avail {
  font-size: 13px;
  color: var(--pg-avail-color, #4ade80);
  font-weight: 600;
}
.pg-avail.zero {
  color: var(--pg-avail-zero, #888);
  font-weight: 400;
}

/* === Wisdom CTA banner (prominent — not buried hint) === */
.pg-wisdom-cta {
  background: var(--pg-cta-bg, #3a2f1a);
  border: 1px solid var(--pg-cta-border, #fbbf24);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}
.pg-wisdom-cta b { color: var(--pg-cta-accent, #fbbf24); }
.pg-hint {
  font-size: 12px;
  color: var(--pg-text-muted, #888);
  line-height: 1.5;
  margin: 6px 0;
}

/* === Guardian "no points" card (clear, not broken-looking) === */
.pg-no-points {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--pg-no-points-bg, rgba(125,125,125,0.08));
  border: 1px dashed var(--pg-no-points-border, #444);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}
.pg-no-points-icon { font-size: 28px; opacity: 0.7; }
.pg-no-points-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--pg-text, #ccc);
}

/* === Allocation chips (history of allocated points) === */
.pg-allocs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.pg-alloc-chip {
  background: var(--pg-chip-bg, #2a2a3e);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--pg-chip-text, #aaa);
}

/* === Reset rows === */
.pg-reset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--pg-border, #2a2a3a);
}
.pg-reset-row:last-child { border-bottom: none; }
/* TASK837-REV2: separator between allocation area and the reset row inside a block */
.pg-reset-sep { height: 1px; margin: 10px 0 2px; background: var(--pg-border, #2a2a3a); opacity: .6; }
.pg-reset-row.blocked .pg-reset-info { opacity: 0.7; }
.pg-reset-info { flex: 1 1 auto; min-width: 0; }
.pg-reset-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.pg-price { font-size: 12px; color: var(--pg-text-muted, #888); }
.pg-price b { color: var(--pg-text, #ccc); }

/* === Buttons (clear primary/secondary/danger/ghost) === */
.pg-btns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.pg-btn {
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px; /* mobile tap target */
  transition: opacity 0.15s, transform 0.05s;
}
.pg-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.pg-btn:active:not(:disabled) { transform: scale(0.98); }
.pg-btn.primary {
  background: var(--pg-primary, #4ade80);
  color: #0f0f1f;
}
.pg-btn.secondary {
  background: var(--pg-secondary, #2a2a4e);
  color: var(--pg-text, #ccc);
  border: 1px solid var(--pg-border, #3a3a5e);
}
.pg-btn.ghost {
  background: transparent;
  color: var(--pg-text-muted, #888);
  border: 1px solid var(--pg-border, #2a2a3a);
}
.pg-btn.danger {
  background: var(--pg-danger, #ef4444);
  color: #fff;
}

/* === Confirm panels (inline) === */
.pg-confirm {
  background: var(--pg-confirm-bg, rgba(255,255,255,0.04));
  border: 1px solid var(--pg-border, #2a2a3a);
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
}
.pg-confirm-text {
  font-size: 13px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.pg-confirm-actions {
  display: flex;
  gap: 8px;
}
.pg-confirm-actions .pg-btn { flex: 1 1 0; min-width: 0; }
.pg-error {
  color: var(--pg-error-text, #f87171);
  font-size: 12px;
  margin-top: 8px;
}

/* === Dangerous-actions section (visually isolated) === */
.pg-card.pg-danger {
  border-color: var(--pg-danger-border, #7f1d1d);
  background: var(--pg-danger-bg, rgba(127,29,29,0.05));
}
.pg-reset-price-summary {
  background: var(--pg-summary-bg, rgba(239,68,68,0.08));
  border: 1px solid var(--pg-danger-border, #7f1d1d);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 13px;
}
.pg-reset-price-summary b { color: var(--pg-danger, #ef4444); }
.pg-reset-blocker {
  background: rgba(239,68,68,0.12);
  border-radius: 6px;
  padding: 8px 10px;
  margin: 8px 0;
  font-size: 12px;
  color: var(--pg-error-text, #f87171);
}

/* === Confirmation modal (2-step for full reset) === */
.pg-confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 12px;
}
.pg-confirm-modal-box {
  background: var(--pg-modal-bg, #1a1a2e);
  border-radius: 12px;
  padding: 16px;
  max-width: 360px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--pg-border, #2a2a3a);
}
.pg-confirm-modal-box.pg-danger-modal {
  border-color: var(--pg-danger, #ef4444);
}
.pg-confirm-modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}
.pg-confirm-modal-section {
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.pg-confirm-modal-list {
  font-size: 12px;
  line-height: 1.6;
  margin: 8px 0 12px 16px;
  color: var(--pg-text-muted, #888);
}
.pg-confirm-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--pg-border, #2a2a3a);
  background: var(--pg-input-bg, #0f0f1f);
  color: var(--pg-text, #ccc);
  font-size: 14px;
  margin: 8px 0;
}

/* === State (loading/error) === */
.pg-state {
  padding: 30px 12px;
  text-align: center;
}
.pg-state-text {
  font-size: 14px;
  color: var(--pg-text-muted, #888);
  margin-bottom: 12px;
}

/* === Responsive breakpoints === */
@media (max-width: 430px) {
  .pg-section-header { font-size: 17px; padding: 12px 10px 6px; }
  .pg-stats { gap: 5px; padding: 6px 4px; }
  .pg-stat-tile { padding: 6px 3px; }
  .pg-stat-icon { font-size: 16px; }
  .pg-stat-value { font-size: 15px; }
  .pg-stat-label { font-size: 10px; }
  .pg-card { padding: 10px; margin: 8px 0; }
  .pg-confirm-actions { flex-direction: column; }
  .pg-confirm-actions .pg-btn { width: 100%; }
  .pg-confirm-modal-box { padding: 14px; max-width: 100%; }
}

@media (max-width: 390px) {
  .pg-btns { grid-template-columns: 1fr; }
  .pg-stat-icon { font-size: 15px; }
  .pg-stat-value { font-size: 14px; }
  .pg-stat-label { font-size: 10px; letter-spacing: 0.3px; }
  .pg-reset-row { flex-direction: column; align-items: stretch; }
  .pg-reset-row .pg-btn { width: 100%; margin-top: 6px; }
  .pg-confirm-modal-title { font-size: 16px; }
  .pg-confirm-modal-section { font-size: 12px; }
  .pg-confirm-modal-list { font-size: 11px; margin-left: 12px; }
}

@media (max-width: 360px) {
  .pg-section-header { font-size: 16px; padding: 10px 8px 4px; }
  .pg-section-header .pg-refresh-btn { min-width: 32px; min-height: 32px; padding: 2px 8px; }
  .pg-stats { gap: 4px; padding: 4px 2px; }
  .pg-stat-tile { padding: 5px 2px; }
  .pg-stat-icon { font-size: 14px; }
  .pg-stat-value { font-size: 13px; }
  .pg-stat-bonus { font-size: 10px; }
  .pg-stat-label { font-size: 9px; letter-spacing: 0.2px; }
  .pg-card { padding: 8px; }
  .pg-card-head { margin-bottom: 8px; padding-bottom: 6px; }
  .pg-card-title { font-size: 14px; }
  .pg-avail { font-size: 12px; }
  .pg-btn { padding: 10px 12px; font-size: 13px; min-height: 40px; }
  .pg-confirm-modal-box { padding: 12px; border-radius: 10px; }
  .pg-confirm-modal-title { font-size: 15px; }
  .pg-confirm-input { font-size: 13px; padding: 8px; }
  .pg-next-steps { font-size: 12px; padding: 8px 10px; }
  .pg-next-steps-icon { font-size: 14px; }
  .pg-no-points { padding: 10px; gap: 8px; }
  .pg-no-points-icon { font-size: 24px; }
  .pg-no-points-text { font-size: 12px; }
  .pg-wisdom-cta { font-size: 12px; padding: 8px 10px; }
}

@media (max-width: 320px) {
  .pg-section-header { font-size: 15px; padding: 8px 6px 4px; }
  .pg-stats { gap: 3px; padding: 3px 1px; grid-template-columns: repeat(2, 1fr); }
  .pg-stat-tile { padding: 4px 1px; }
  .pg-stat-icon { font-size: 13px; }
  .pg-stat-value { font-size: 12px; }
  .pg-stat-bonus { font-size: 9px; }
  .pg-stat-label { font-size: 8px; }
  .pg-card { padding: 6px; margin: 6px 0; border-radius: 8px; }
  .pg-card-head { margin-bottom: 6px; padding-bottom: 4px; }
  .pg-card-title { font-size: 13px; }
  .pg-avail { font-size: 11px; }
  .pg-btn { padding: 9px 8px; font-size: 12px; min-height: 38px; }
  .pg-confirm-actions { gap: 6px; }
  .pg-confirm-modal-box { padding: 10px; border-radius: 8px; }
  .pg-confirm-modal-title { font-size: 14px; }
  .pg-confirm-modal-section { font-size: 11px; }
  .pg-confirm-modal-list { font-size: 10px; margin-left: 10px; }
  .pg-confirm-input { font-size: 12px; padding: 8px; }
  .pg-next-steps { font-size: 11px; padding: 6px 8px; gap: 6px; }
  .pg-next-steps-icon { font-size: 13px; }
  .pg-no-points { padding: 8px; gap: 6px; }
  .pg-no-points-icon { font-size: 20px; }
  .pg-no-points-text { font-size: 11px; }
  .pg-wisdom-cta { font-size: 11px; padding: 6px 8px; }
  .pg-hint { font-size: 11px; }
  .pg-reset-title { font-size: 12px; }
  .pg-price { font-size: 11px; }
  .pg-alloc-chip { font-size: 10px; padding: 2px 6px; }
}

/* ===== TASK935: Guardian points entry point (near character stats) ===== */
.pg-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--pg-border, #2a2f3a);
  border-radius: 12px;
  background: var(--pg-card-bg, #171b24);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pg-entry:active { opacity: 0.85; }
.pg-entry-icon { font-size: 18px; }
.pg-entry-text { font-weight: 600; font-size: 14px; }
.pg-entry-badge {
  margin-left: auto;
  font-size: 12px;
  color: var(--pg-avail-color, #4ade80);
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.pg-entry-badge-hot {
  color: #0b0f16;
  background: var(--pg-avail-color, #4ade80);
  border-color: var(--pg-avail-color, #4ade80);
  font-weight: 700;
}
.pg-entry-go { font-size: 12px; opacity: 0.75; white-space: nowrap; }
.pg-entry-hot { border-color: var(--pg-avail-color, #4ade80); box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.35); }
.pg-entry-flash { animation: pgEntryFlash 1.4s ease-out; }
@keyframes pgEntryFlash {
  0% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.55); }
  100% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0); }
}
