:root { --bg:#0f1115; --p:#11141a; --card:#171a21; --muted:#8a93a5; --text:#e6ebff; --acc:#8ad7ff; --slot:#212634; --slot-b:#2b3142; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:14px/1.4 system-ui,Segoe UI,Inter,Arial; overflow:hidden; height:100vh; }

/* Иконка у игроков (в списке) */
.battle-icon-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  background: rgba(220, 53, 69, 0.2);
  border: 2px solid #dc3545;
  border-radius: 4px;
  transition: all 0.3s ease;
  animation: battlePulse 2s infinite;
  vertical-align: middle;
  flex-shrink: 0;
  cursor: pointer;
}

.battle-icon-inline:hover {
  background: rgba(220, 53, 69, 0.4);
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(220, 53, 69, 0.6);
}

.battle-icon-inline i {
  font-size: 12px;
  color: #dc3545;
}

/* Имя с иконкой */
.actor-name {
  display: flex;
  align-items: center;
  font-weight: bold;
  color: #ffd700;
  gap: 5px;
}

/* Анимация пульсации */
@keyframes battlePulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
  }
  50% {
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.8);
  }
}
 

/* Модальное окно победы - Pixel Art Style */
#battle-victory-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

#battle-victory-modal:not(.hidden) {
  display: flex;
}

#battle-victory-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
}

#battle-victory-modal .modal-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  width: 90%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 4px solid #0f3460;
  box-shadow: 
    0 0 0 2px #e94560,
    0 0 20px rgba(233, 69, 96, 0.5),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  padding: 40px 30px;
  text-align: center;
  font-family: 'Press Start 2P', monospace, 'Courier New', monospace;
  image-rendering: pixelated;
  animation: victoryPopup 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes victoryPopup {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Заголовок ПОБЕДА */
#battle-victory-modal h2 {
  color: #00ff41;
  font-size: 42px;
  margin-bottom: 30px;
  text-shadow: 
    3px 3px 0 #00aa2b,
    6px 6px 0 rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 255, 65, 0.8);
  animation: victoryPulse 1s ease-in-out infinite;
  letter-spacing: 4px;
}

@keyframes victoryPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Контейнер статистики */
#victory-stats {
  margin: 30px 0;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid #0f3460;
  border-radius: 8px;
  padding: 25px 20px;
}

/* Строки статистики */
#victory-stats > div {
  font-size: 20px;
  margin: 18px 0;
  padding: 12px;
  background: linear-gradient(90deg, transparent 0%, rgba(15, 52, 96, 0.3) 50%, transparent 100%);
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

#victory-stats > div:hover {
  background: linear-gradient(90deg, transparent 0%, rgba(15, 52, 96, 0.6) 50%, transparent 100%);
  border-left-color: #e94560;
  transform: translateX(5px);
}

/* Иконки эмодзи */
#victory-stats > div::before {
  font-size: 28px;
  filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
}

/* Монстры - красный */
#victory-stats > div:nth-child(1) {
  animation: slideInLeft 0.5s ease-out 0.2s both;
}

#victory-monsters-killed {
  color: #e94560;
  font-weight: bold;
  text-shadow: 
    2px 2px 0 #a81c3a,
    0 0 10px rgba(233, 69, 96, 0.8);
}

/* Золото - оранжевый */
#victory-stats > div:nth-child(2) {
  animation: slideInLeft 0.5s ease-out 0.4s both;
}

#victory-gold {
  color: #ffb800;
  font-weight: bold;
  text-shadow: 
    2px 2px 0 #cc9200,
    0 0 10px rgba(255, 184, 0, 0.8);
}

/* Опыт - голубой */
#victory-stats > div:nth-child(3) {
  animation: slideInLeft 0.5s ease-out 0.6s both;
}

#victory-exp {
  color: #00d4ff;
  font-weight: bold;
  text-shadow: 
    2px 2px 0 #0088aa,
    0 0 10px rgba(0, 212, 255, 0.8);
}

@keyframes slideInLeft {
  0% {
    transform: translateX(-50px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Кнопка продолжить */
#btn-victory-ok {
  font-size: 22px;
  padding: 18px 50px;
  margin-top: 30px;
  background: linear-gradient(135deg, #e94560 0%, #d63447 100%);
  color: white;
  border: 3px solid #0f3460;
  box-shadow: 
    0 0 0 2px #e94560,
    0 6px 0 #a81c3a,
    0 8px 20px rgba(233, 69, 96, 0.4);
  font-family: 'Press Start 2P', monospace, 'Courier New', monospace;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  transition: all 0.1s ease;
  animation: buttonBounce 0.8s ease-out 0.8s both;
}

#btn-victory-ok:hover {
  background: linear-gradient(135deg, #ff5573 0%, #e94560 100%);
  transform: translateY(-2px);
  box-shadow: 
    0 0 0 2px #ff5573,
    0 8px 0 #a81c3a,
    0 10px 25px rgba(233, 69, 96, 0.6);
}

#btn-victory-ok:active {
  transform: translateY(4px);
  box-shadow: 
    0 0 0 2px #e94560,
    0 2px 0 #a81c3a,
    0 4px 10px rgba(233, 69, 96, 0.4);
}

@keyframes buttonBounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-10px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-5px); }
}

/* Пиксельные частицы на фоне */
#battle-victory-modal::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(233, 69, 96, 0.03) 2px, rgba(233, 69, 96, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 212, 255, 0.03) 2px, rgba(0, 212, 255, 0.03) 4px);
  pointer-events: none;
  animation: pixelScroll 20s linear infinite;
}

@keyframes pixelScroll {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 100px, 100px 0; }
}

/* Блестящие звёздочки */
#battle-victory-modal h2::before,
#battle-victory-modal h2::after {
  content: '✨';
  position: absolute;
  animation: sparkle 1.5s ease-in-out infinite;
}

#battle-victory-modal h2::before {
  left: -50px;
  animation-delay: 0s;
}

#battle-victory-modal h2::after {
  right: -50px;
  animation-delay: 0.75s;
}

@keyframes sparkle {
  0%, 100% { 
    opacity: 0.3;
    transform: scale(0.8) rotate(0deg);
  }
  50% { 
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  #battle-victory-modal .modal-content {
    padding: 30px 20px;
    width: 95%;
  }
  
  #battle-victory-modal h2 {
    font-size: 28px;
  }
  
  #victory-stats > div {
    font-size: 16px;
  }
  
  #btn-victory-ok {
    font-size: 16px;
    padding: 15px 35px;
  }
}

/* плавающая кнопка рюкзака */
.bag-btn { position:fixed; right:18px; bottom:18px; z-index:50; font-size:20px; padding:10px 12px; border-radius:12px; border:1px solid #2a3146; background:#1b2233; color:#e6ebff; cursor:pointer; box-shadow:0 6px 24px rgba(0,0,0,.35); }

.wrap { display:grid; grid-template-rows: 460px 1fr; height:100vh; overflow:hidden; max-width:1920px; margin:0 auto; }

/* ===== STAGE (top, больше) ===== */
.panel { background:var(--card); border:1px solid #242a39; border-radius:12px; padding:12px; }
.stage { margin:12px;position: relative; }
.stage-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:10px; }
.loc-row { display:flex; align-items:center; gap:10px; }
.loc-name { font-weight:700; font-size:18px; }
.loc-count { padding:2px 8px; border-radius:999px; background:#202636; border:1px solid #2a314a; color:#cfe2ff; font-size:12px; }
.loc-sub { color:#9ab4e5; margin-top:4px; font-size:12px; }
.stage-actions button { margin-left:6px; }

.stage-canvas { height: 94%; border-radius: 12px; background: linear-gradient(180deg, #121726, #0f141f); border: 1px dashed #2a3146; position: absolute; overflow: hidden; width: 98.8%; }
.stage-overlay { position:absolute; left:50%; transform:translateX(-50%); padding:6px 10px; border-radius:8px; background:#0e1422d0; border:1px solid #2a3146; color:#e6ebff; font-size:12px; }
.stage-overlay.top { top:10px; }
.stage-overlay.bottom { bottom:10px; }

/* ===== GRID BELOW - НОВОЕ РАСПРЕДЕЛЕНИЕ: 25% / 50% / 25% ===== */
.cols { display:grid; grid-template-columns: 25% 50% 23.7%; gap:12px; padding:0 12px 12px; }
.left-col, .center-col, .right-col { display:flex; flex-direction:column; gap:12px; }

/* hero/equip - убираем, так как теперь только в модале */

.equipment { margin-top:10px; display:flex; flex-direction:column; gap:8px; }
.equipment-row { display:flex; justify-content:center; gap:8px; }
.equipment-row.head-row, .equipment-row.legs-row, .equipment-row.boots-row { justify-content:center; }
.equipment-row.shoulders-row, .equipment-row.body-row { justify-content:space-between; }
.equipment-row.rings-row { justify-content:space-between; }

.rings-left, .rings-right { display:flex; gap:6px; }
.ring-slot { width:40px !important; height:40px !important; font-size:10px; }

.slot { height:90px; width:90px; border-radius:8px; background:var(--slot); border:1px dashed var(--slot-b); display:flex; align-items:center; justify-content:center; color:#9fb1d6; position:relative; font-size:11px; }
.slot.drag-over { outline:2px solid var(--acc); }

/* ===== МОДАЛ ПЕРСОНАЖА (БОЛЬШАЯ ВЕРСИЯ) ===== */
.modal.hidden { display:none; }
.modal { position:fixed; inset:0; z-index:60; display:grid; place-items:center; }
.modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,.55); }
.modal-card { position:relative; width:min(1200px, 96vw); max-height:90vh; overflow:auto; background:var(--card); border:1px solid #2a3146; border-radius:14px; padding:20px; box-shadow:0 30px 80px rgba(0,0,0,.45); }
.modal-card.large { width:min(1600px, 98vw); max-height:95vh; }
.modal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.modal-head h3 { margin:0; font-size:24px; }
.modal-head .close { padding:8px 12px; border-radius:8px; border:1px solid #2a3146; background:#1e2536; color:#e6ebff; cursor:pointer; }

/* Модал описания класса — Pixel UI/UX */
.modal-card.class-info-card {
  width: min(520px, 92vw);
  background: var(--card);
  border: 4px solid #c9a227;
  box-shadow:
    0 0 0 2px #1a1a2e,
    6px 6px 0 0 rgba(0, 0, 0, 0.5),
    0 0 20px rgba(201, 162, 39, 0.25);
  image-rendering: pixelated;
}
.class-info-icon-wrap {
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}
.class-info-icon {
  max-width: 240px;
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
  border: 3px solid #ffd700;
  box-shadow:
    0 0 0 2px #1a1a2e,
    4px 4px 0 0 rgba(0, 0, 0, 0.4);
}
.class-info-head {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 12px;
}
.class-info-title {
  width: 100%;
  text-align: center;
  font-size: 1.5rem;
  color: var(--text);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
  margin: 0;
}
.class-info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(180, 50, 50, 0.9);
  border: 2px solid #b03030;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}
.class-info-close:hover {
  background: rgba(200, 60, 60, 1);
}
.class-info-body { display: flex; flex-direction: column; gap: 16px; }
.class-info-section { margin: 0; }
.class-info-section-title {
  margin: 0 0 6px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--acc);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}
.class-info-description {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}
.class-info-skills {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}
.class-info-requirements {
  margin: 0;
  color: #8f8;
}

/* Модал подтверждения выбора 1-го класса */
.confirm-class-text {
  margin: 0 0 1rem 0;
  color: var(--text, #f0e6d8);
  line-height: 1.5;
}
.confirm-class-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-confirm-class {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid;
  font-family: inherit;
}
.btn-confirm-class.btn-yes {
  background: rgba(40, 80, 40, 0.9);
  border-color: #4a8;
  color: #fff;
}
.btn-confirm-class.btn-yes:hover {
  background: rgba(50, 100, 50, 1);
}
.btn-confirm-class.btn-no {
  background: rgba(60, 40, 40, 0.9);
  border-color: #a55;
  color: #f0e6d8;
}
.btn-confirm-class.btn-no:hover {
  background: rgba(80, 50, 50, 1);
}

/* Основная структура модала: 25% / 35% / 40% */
.modal-body.large-layout { display:grid; grid-template-columns: 25% 35% 40%; gap:24px; min-height:600px; }

/* ===== ЗАГОЛОВОК МОДАЛА С АВАТАРОМ ===== */
.modal-head-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border: 3px solid #ffd700;
  background: #1a1a2e;
  overflow: hidden;
  box-shadow: 
    0 0 0 2px #000,
    4px 4px 0 0 rgba(0,0,0,0.4);
  image-rendering: pixelated;
  cursor: pointer;
  transition: all 0.2s ease;
}
.profile-avatar:hover {
  border-color: #fff;
  box-shadow: 
    0 0 0 2px #000,
    0 0 8px 2px #ffd700,
    0 0 16px 4px rgba(255, 215, 0, 0.5),
    4px 4px 0 0 rgba(0,0,0,0.4);
  transform: scale(1.05);
}
.profile-avatar:active {
  transform: scale(0.98);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Модальное окно информации о персонаже */
.avatar-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-details-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}
.avatar-details-card {
  position: relative;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  border: 4px solid #ffd700;
  box-shadow: 
    0 0 0 2px #000,
    0 0 20px rgba(255, 215, 0, 0.3),
    8px 8px 0 0 rgba(0,0,0,0.5);
  width: 380px;
  max-height: 80vh;
  overflow-y: auto;
  image-rendering: pixelated;
}
.avatar-details-header {
  position: relative;
  padding: 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,215,0,0.1) 0%, transparent 100%);
  border-bottom: 2px solid #333;
}
.avatar-details-header .close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: 2px solid #666;
  color: #999;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.avatar-details-header .close:hover {
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.avatar-details-portrait {
  width: 120px;
  height: 120px;
  margin: 0 auto 15px;
  border: 4px solid #ffd700;
  background: #0a0a14;
  box-shadow: 
    0 0 0 2px #000,
    0 0 15px rgba(255, 215, 0, 0.4);
  image-rendering: pixelated;
}
.avatar-details-portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.avatar-details-name {
  font-size: 20px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 5px;
}
.avatar-details-race {
  font-size: 14px;
  color: #8ad7ff;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.avatar-details-body {
  padding: 20px;
}
.avatar-detail-section {
  margin-bottom: 20px;
}
.avatar-detail-section h4 {
  font-size: 12px;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #333;
}
.avatar-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2a2a3e;
  border-left: 3px solid #ffd700;
}
.avatar-detail-item .label {
  color: #8a93a5;
  font-size: 13px;
}
.avatar-detail-item .value {
  color: #e6ebff;
  font-weight: bold;
  font-size: 13px;
}
.avatar-detail-item .value.bonus {
  color: #4ade80;
}
.avatar-bio-section {
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #2a2a3e;
  font-size: 13px;
  color: #b0b8c8;
  line-height: 1.6;
  font-style: italic;
  min-height: 60px;
}

.profile-head-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-head-name {
  color: #ffd700;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 2px 2px 0 #000;
  font-family: 'Courier New', monospace;
}

.profile-head-race {
  color: #9ab4e5;
  font-size: 12px;
}
.profile-head-class {
  color: #c9a227;
  font-size: 12px;
  margin-top: 2px;
  text-shadow: 1px 1px 0 #000;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== ПРОФИЛЬ (25%) ===== */
.profile-section { display:flex; flex-direction:column; gap:20px; }

.profile-stats h4 { margin:0 0 12px 0; color:#e6ebff; font-size:16px; border-bottom:1px solid #2a3146; padding-bottom:6px; margin-top:20px; }
.profile-stats h4:first-child { margin-top:0; }

.stat-grid { display:flex; flex-direction:column; gap:8px; }
.stat-row { display:flex; justify-content:space-between; align-items:center; padding:6px 0; }
.stat-row span:first-child { color:#9ab4e5; font-size:13px; }
.stat-row span:last-child { color:#e6ebff; font-weight:600; }
.profile-class-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.profile-class-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
}
.stat-row-class .profile-class-wrap span { color:#e6ebff; font-weight:600; }

/* ===== ВЕС: ДВЕ ПОЛОСКИ ===== */
.weight-section { display:flex; flex-direction:column; gap:6px; padding:6px 0; }
.weight-row { display:flex; align-items:center; gap:8px; }
.weight-label { color:#9ab4e5; font-size:12px; min-width:95px; }
.weight-bar-container {
  flex:1; height:10px; background:#1a1f2e; border-radius:5px;
  overflow:hidden; border:1px solid #2a3040;
}
.weight-bar {
  height:100%; width:0%; border-radius:5px;
  transition: width 0.3s ease, background 0.3s ease;
  background:#2ecc71;
}
.weight-bar.warning { background:#f39c12; }
.weight-bar.danger { background:#e74c3c; }
.weight-text { color:#e6ebff; font-size:11px; min-width:80px; text-align:right; white-space:nowrap; }

/* ===== СИЛУЭТ ПЕРСОНАЖА (35%) ===== */
.character-section { display:flex; justify-content:center; align-items:center; }

.character-silhouette { position:relative; width:250px; height:450px; }

.warrior-silhouette { position:absolute; top:0; left:50%; transform:translateX(-50%); z-index:1; opacity:0.6; }
.warrior-silhouette img { display:block; filter:sepia(1) hue-rotate(200deg) brightness(0.4) contrast(1.2); }

.character-body { position:absolute; top:0; left:0; width:100%; height:100%; z-index:2; }

/* Позиционирование слотов экипировки */
.char-slot.head-slot { position:absolute; top:15px; left:50%; transform:translateX(-50%); }
.char-slot.shoulders-slot { position:absolute; top:15%; left:50%; transform:translateX(-50%); display:flex; gap:60px; }
.char-slot.body-slot { position:absolute; top:26%; left:50%; transform:translateX(-50%); display:flex; gap:15px; align-items:center; }
.char-slot.legs-slot { position:absolute; top:44%; left:50%; transform:translateX(-50%); }
.char-slot.boots-slot { position:absolute; top:60%; left:50%; transform:translateX(-50%); }
.char-slot.rings-slot { position:absolute;     bottom: 18%; left:50%; transform:translateX(-50%); display:flex; gap:8px; }

.char-slot .slot { opacity: 0.8;width:50px; height:50px; border-radius:8px; background:var(--slot); border:1px dashed var(--slot-b); display:flex; align-items:center; justify-content:center; color:#9fb1d6; position:relative; font-size:16px; overflow:hidden; }
.char-slot .slot.has-item { border:1px solid var(--acc); background:rgba(30, 144, 255, 0.15); }

.shoulder-slot, .ring-slot { width:40px !important; height:40px !important; }
.hand-slot { width:45px !important; height:45px !important; }
.body-slot-center { width:60px !important; height:60px !important; }

.char-slot .slot.drag-over { outline:2px solid var(--acc); }

/* ===== ИНВЕНТАРЬ (40%) ===== */
.inventory-section { max-width: 93%;display:flex; flex-direction:column; }

.inventory-header { display:flex; align-items:center; gap:8px; margin-bottom:16px; flex-wrap: wrap; }
.inventory-header h4 { margin:0; color:#e6ebff; font-size:16px; flex-shrink:0; }
.inv-actions { margin-left: auto; display:flex; gap:6px; align-items:center; }
.inv-actions button { padding:5px 10px; border-radius:8px; border:1px solid #2a3146; background:#1e2536; color:#e6ebff; cursor:pointer; font-size:12px; transition: background .2s; }
.inv-actions button:hover { background:#28314a; }
.inv-actions #btn-delete-item { color:#ff7676; }
.inv-actions #btn-delete-item:hover { background:#2a1520; }

.sort-dropdown-wrap { position: relative; display: inline-block; }
.sort-dropdown { position:absolute; top:calc(100% + 4px); right:0; z-index:999; min-width:160px; background:#1a2036; border:1px solid #3a4a6a; border-radius:8px; padding:4px 0; box-shadow:0 6px 24px rgba(0,0,0,.7); pointer-events:auto; }
.sort-dropdown.hidden { display:none !important; }
.sort-dropdown button { display:block; width:100%; text-align:left; padding:8px 14px; border:none; background:none; color:#e6ebff; font-size:13px; cursor:pointer; white-space:nowrap; }
.sort-dropdown button:hover { background:#28314a; border-radius:4px; }

.inv-footer-zones { display:flex; gap:8px; margin-top:6px; }
.trash, .disassemble-zone { flex:1; padding:10px; text-align:center; border:1px dashed #3a425a; border-radius:10px; cursor:pointer; font-size:13px; transition: all .2s; }
.trash { color:#ffb1b1; background:#1a0f14; }
.trash.drag-over { outline:2px solid #ff7676; background:#2a1020; }
.disassemble-zone { color:#b1d4ff; background:#0f141a; }
.disassemble-zone.drag-over { outline:2px solid #76b0ff; background:#102030; }

.grid.delete-mode .slot { cursor: crosshair; }
.grid.delete-mode .slot .item { outline: 1px dashed #ff5555; opacity: 0.85; }
.grid.delete-mode .slot .item:hover { outline: 2px solid #ff4444; opacity: 1; background: linear-gradient(180deg, #3a2020, #2a1515); }

/* Контейнер для скроллинга инвентаря */
.inventory-scroll-container {
  max-height: 450px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  margin-bottom: 10px;
}

.inventory-scroll-container::-webkit-scrollbar {
  width: 8px;
}

.inventory-scroll-container::-webkit-scrollbar-track {
  background: #1a1f2e;
  border-radius: 4px;
}

.inventory-scroll-container::-webkit-scrollbar-thumb {
  background: #3a4a6a;
  border-radius: 4px;
}

.inventory-scroll-container::-webkit-scrollbar-thumb:hover {
  background: #4a5a8a;
}

.grid.large-grid { display:grid; grid-template-columns: repeat(5, 1fr); gap:4px; margin-bottom:0; }
.grid .slot { height:90px; width:90px; }

/* Log header with date nav */
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.log-header h2 {
  margin: 0;
  font-size: 12px;
  color: #9ab4e5;
  flex: 1;
  text-align: center;
}
.log-nav-btn {
  background: #1b2233;
  border: 1px solid #2a3146;
  color: #8ad7ff;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s;
}
.log-nav-btn:hover { background: #2a3350; }
.log-nav-btn:disabled { opacity: 0.3; cursor: default; }

/* журнал - ПОЛНАЯ ВЫСОТА с новыми событиями сверху */
.log .log-body { 
  height:460px; 
  overflow-y:auto; 
  background:#0f1320; 
  border:1px solid #20273b; 
  border-radius:8px; 
  padding:8px;
  display:flex;
  flex-direction:column;
}
.log .line { 
  color:#b9c7ea; 
  margin:4px 0; 
  padding:6px 8px;
  border-bottom:1px solid rgba(42, 49, 70, 0.3);
  border-radius:4px;
  background:rgba(15, 19, 32, 0.5);
  position:relative;
}
.log-time { color: #5a6b8a; font-size: 11px; margin-right: 4px; }
.log .line:first-child {
  border-bottom:2px solid rgba(138, 215, 255, 0.5);
  background:rgba(138, 215, 255, 0.1);
  color:#e6ebff;
}
.log .line:last-child {
  border-bottom:none;
  opacity:0.7;
}
.log .line::before {
  content:"▶";
  color:#8ad7ff;
  margin-right:6px;
  font-size:10px;
}
.log .line:first-child::before {
  content:"🆕";
  margin-right:4px;
}
.log .line:hover {
  background:rgba(42, 49, 70, 0.4);
}

/* Кнопка настроек */
.settings-btn {
  position: fixed;
  right: 18px;
  bottom: 8%;
  z-index: 50;
  width: 55px;
  height: 55px;
  font-size: 22px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid #2a3146;
  background: #1b2233;
  color: #a0aec0;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  background: #252d42;
  color: #e6ebff;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(100, 120, 200, 0.3);
}
/* чат — компактный */
.chat.compact .chat-body { height:480px; overflow:auto; background:#0f1320; border:1px solid #20273b; border-radius:8px; padding:10px; }
.chat .msg { margin:6px 0; }
.chat .msg .author { color:#9fc3ff; font-weight:600; margin-right:6px; }
.chat-input { margin-top:8px; display:flex; gap:6px; }
.chat-input input { flex:1; padding:10px; background:#0e1422; border:1px solid #28324a; border-radius:8px; color:#e6ebff; }
.chat-input button { padding:10px 14px; border-radius:8px; border:1px solid #2a3146; background:#1e2536; color:#e6ebff; cursor:pointer; }

/* актёры (список со скроллом) */
.actors-panel .actors-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.actors-panel .actors-count { background:#202636; border:1px solid #2a314a; border-radius:999px; padding:2px 8px; font-size:12px; color:#cfe2ff; }
.actors-list { display:flex; flex-direction:column; gap:8px; max-height:520px; overflow:auto; }
.actor-card { background:#121826; border:1px solid #202a40; border-radius:10px; padding:8px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.actor-card:hover { background: #172033; border-color: #2d4a7a; box-shadow: 0 0 8px rgba(45,74,122,0.4); }
.actor-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.actor-name { font-weight:600; display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.actor-class-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}
.actor-tags { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.tag { font-size:11px; padding:2px 6px; border-radius:999px; border:1px solid #2a314a; background:#1c2435; color:#cfe2ff; }
.tag-combat { color:#dc3545; border-color:#dc3545; background:rgba(220,53,69,0.15); font-weight:bold; }
.actor-actions { display:flex; gap:6px; margin-top:6px; flex-wrap:wrap; }
.actor-actions button { padding:6px 8px; border-radius:8px; border:1px solid #2a3146; background:#1e2536; color:#e6ebff; cursor:pointer; }

.hint { color:var(--muted); font-size:12px; }

/* ===== ПРЕДМЕТЫ ===== */
.item { width:100%; height:100%; display:flex; align-items:center; justify-content:center; border-radius:8px; background:linear-gradient(180deg, #2a3142, #1c2230); border:1px solid #2f3750; cursor:grab; position:relative; }
.item:active { cursor:grabbing; }
.item .name { font-size:12px; color:#d8e2ff; text-align:center; padding:0 4px; }
.item .qty { position:absolute; right:6px; bottom:4px; font-size:12px; color:#cfe2ff; background:#0f1524; padding:1px 6px; border-radius:10px; border:1px solid #28324a; }
.item i.ra { font-size:20px; }

/* tooltip */
.tooltip { position:fixed; pointer-events:none; background:#0e1422; color:#e6ebff; border:1px solid #2a3146; padding:6px 8px; border-radius:8px; font-size:12px; z-index:100; max-width:260px; }
/* Предмет в слоте */
.slot .item {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Иконка предмета - 90% размера слота */
.slot .item i.ra {
  font-size: 90%;
  width: 90%;
  height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Изображение предмета вместо иконки */
.slot .item img {
  width: 98%;
  height: 98%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Кнопка [i] информации */
.slot .item .info-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffd700;
  border: 1px solid #ffd700;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.slot .item .info-btn:hover {
  background: rgba(255, 215, 0, 0.3);
}

/* Кнопка экипировки [⚔] */
.slot .item .equip-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(46, 204, 113, 0.8);
  color: #fff;
  border: 1px solid #27ae60;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}

.slot:hover .item .equip-btn {
  opacity: 1;
}

.slot .item .equip-btn:hover {
  background: rgba(39, 174, 96, 1);
  transform: scale(1.1);
}

/* Кнопка информации [i] на экипировке */
.slot.equip .item .info-btn.equip-info {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffd700;
  border: 1px solid #ffd700;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}

.slot.equip:hover .item .info-btn.equip-info {
  opacity: 1;
}

.slot.equip .item .info-btn.equip-info:hover {
  background: rgba(255, 215, 0, 0.3);
}

/* Кнопка снятия экипировки [✖] */
.slot.equip .item .unequip-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background: rgba(231, 76, 60, 0.8);
  color: #fff;
  border: 1px solid #c0392b;
  border-radius: 3px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}

.slot.equip:hover .item .unequip-btn {
  opacity: 1;
}

.slot.equip .item .unequip-btn:hover {
  background: rgba(192, 57, 43, 1);
  transform: scale(1.1);
}

/* Призрачный слот (для двуручного оружия) */
.slot.equip.ghost-item {
  border: 1px dashed #f39c12 !important;
  background: rgba(243, 156, 18, 0.1) !important;
}

.slot.equip .item.ghost {
  opacity: 0.4;
  filter: grayscale(30%);
  cursor: not-allowed;
}

.slot.equip .item.ghost img {
  opacity: 0.5;
}

.slot.equip .item .ghost-label {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 12px;
  background: rgba(0,0,0,0.7);
  border-radius: 3px;
  padding: 1px 3px;
}

/* ===== ТУЛТИП ПРЕДМЕТОВ (при наведении) ===== */
.item-tooltip {
  position: fixed;
  z-index: 100000;
  width: 220px;
  background: linear-gradient(180deg, #1a1f2e 0%, #0f1318 100%);
  border: 2px solid #3a4a6a;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  pointer-events: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #e6ebff;
}

.item-tooltip.hidden {
  display: none;
}

.item-tooltip .tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.item-tooltip .tooltip-item-name {
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  flex: 1;
}

.item-tooltip .tooltip-rarity {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.item-tooltip .tooltip-rarity.common { background: #555; color: #ccc; }
.item-tooltip .tooltip-rarity.uncommon { background: #1e8449; color: #7dcea0; }
.item-tooltip .tooltip-rarity.rare { background: #1a5276; color: #5dade2; }
.item-tooltip .tooltip-rarity.epic { background: #6c3483; color: #bb8fce; }
.item-tooltip .tooltip-rarity.legendary { background: #b9770e; color: #f9e79f; }

.item-tooltip .tooltip-icon-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.item-tooltip .tooltip-icon {
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.4);
  border: 1px solid #3a4a6a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-tooltip .tooltip-icon img {
  max-width: 42px;
  max-height: 42px;
  image-rendering: pixelated;
}

.item-tooltip .tooltip-quick-stats {
  flex: 1;
}

.item-tooltip .tooltip-type {
  color: #8899aa;
  margin-bottom: 4px;
}

.item-tooltip .tooltip-handed {
  font-size: 10px;
}

.item-tooltip .tooltip-handed.two-handed { color: #f39c12; }
.item-tooltip .tooltip-handed.one-handed { color: #3498db; }

.item-tooltip .tooltip-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #3a4a6a, transparent);
  margin: 8px 0;
}

.item-tooltip .tooltip-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-tooltip .tooltip-stat-row {
  display: flex;
  justify-content: space-between;
}

.item-tooltip .tooltip-stat-row.hidden {
  display: none;
}

.item-tooltip .stat-label {
  color: #8899aa;
}

.item-tooltip .stat-value {
  color: #5dade2;
  font-weight: bold;
}

.item-tooltip .tooltip-description {
  color: #aabbcc;
  font-size: 8px;
  line-height: 1.4;
  font-style: italic;
}

/* Toast уведомления */
.game-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  border: 2px solid #444;
}

.game-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.game-toast.success {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.9);
}

.game-toast.error {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.9);
}

.game-toast.info {
  border-color: #3498db;
  background: rgba(52, 152, 219, 0.9);
}

/* Количество предметов */
.slot .item .qty {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 4px;
  font-size: 10px;
  border-radius: 3px;
}

/* Убираем название предмета */
.slot .item .name {
  display: none;
}
/* Модальное окно информации о предмете */
.modal-card.medium {
  width: 500px;
  max-width: 90vw;
}

.item-info-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.item-info-icon {
  text-align: center;
  padding: 20px;
  background: #1a1a2e;
  border: 2px solid #4a4a6a;
  border-radius: 4px;
}

.item-info-icon #item-icon-display {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2d2d44;
  border: 2px solid #4a4a6a;
  border-radius: 4px;
}

.item-info-icon #item-icon-display img {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

.item-info-icon #item-icon-display i {
  font-size: 80px;
  color: #ffd700;
}

.item-info-section {
  background: #1a1a2e;
  border: 2px solid #4a4a6a;
  border-radius: 4px;
  padding: 15px;
}

.item-info-section h4 {
  color: #ffd700;
  margin-bottom: 10px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #2d2d44;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: #b8b8d0;
  font-weight: bold;
}

.info-row span:last-child {
  color: #fff;
  font-weight: bold;
}

.item-description {
  color: #b8b8d0;
  line-height: 1.6;
  padding: 10px;
  background: #0d0d1a;
  border-radius: 4px;
  font-style: italic;
}

/* Цвета качества */
.quality-common { color: #fff; }
.quality-uncommon { color: #1eff00; }
.quality-rare { color: #0070dd; }
.quality-epic { color: #a335ee; }
.quality-legendary { color: #ff8000; }

/* Типы атак и магия */
.attack-types {
  color: #f39c12 !important;
}

.magic-elements {
  color: #9b59b6 !important;
}

.magic-spec {
  color: #1abc9c !important;
}

/* Кнопка тестового боя */
.combat-test-btn {
    position: fixed;
    bottom: 22%;
    right: 1.2%;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #c9a227;
    background: rgba(80, 30, 30, 0.85);
    color: #ffd700;
    cursor: pointer;
    font-size: 20px;
    z-index: 9999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.combat-test-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 0 15px rgba(255, 60, 60, 0.5);
    background: rgba(120, 40, 40, 0.95);
}

/*  Modal map */
.world-btn {
    position: fixed;
    bottom: 15%;
    right: 1.2%;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 31%);
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-size: 20px;
    z-index: 9999;
    transition: all 0.3s ease;
}

.world-btn:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.world-btn:active {
  transform: scale(0.95);
}
/* Модал карты мира */
/* Модал карты мира */
.world-map-card {
  width: 90%;
  max-width: 700px;
  height: 75vh;
  background: #1a1f2e;
  border: 3px solid #2c3e50;
}

.world-map-body {
    padding: 0px;
    overflow: hidden;
    height: calc(52vh - 0px);
    background: #0f1419;
}

.locations-grid {
  display: grid;
  gap: 6px;
  justify-content: center;
  padding: 10px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Пиксельная карточка локации */
.location-card {
  width: 90px;
  height: 90px;
  background: #2c3e50;
  border: 2px solid #34495e;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  image-rendering: pixelated;
}

.location-card:hover {
  transform: scale(1.05);
  border-color: #667eea;
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
  z-index: 10;
}

.location-card-icon {
  font-size: 32px;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.location-card-name {
  font-size: 9px;
  font-weight: bold;
  color: #ecf0f1;
  text-align: center;
  line-height: 1.1;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.location-card-coords {
  font-size: 8px;
  color: #667eea;
  text-align: center;
  margin-top: 2px;
  font-family: 'Courier New', monospace;
}

/* Текущая локация (зелёная) */
.location-card.current {
  border-color: #2ecc71;
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
}

/* Заблокированная локация */
.location-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
  background: #1a1f2e;
}

.location-card.locked:hover {
  transform: none;
  border-color: #34495e;
  box-shadow: none;
}

/* Пустая клетка */
.location-card.empty {
  background: rgba(26, 31, 46, 0.3);
  border: 1px dashed #2c3e50;
  cursor: default;
}

.location-card.empty:hover {
  transform: none;
  box-shadow: none;
}
/* END MODAL MAP */

.location-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-button {
  background: rgba(100, 100, 200, 0.8);
  border: 2px solid #fff;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.info-button:hover {
  background: rgba(120, 120, 220, 1);
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(100, 100, 200, 0.5);
}

/* =====================================================
   TRADE MODAL - Новый UI с квадратными иконками
   ===================================================== */

/* Контейнер торговли - две панели */
.trade-container {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  width: 80vw;
  height: 70vh;
  max-width: 1200px;
}

/* Основная панель (товары) */
.trade-main-panel {
  flex: 1;
  background: linear-gradient(135deg, #12121f 0%, #0a0a12 100%);
  border: 2px solid #333;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Заголовок */
.trade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #12121f 100%);
  border-bottom: 2px solid #ffd700;
}

.trade-title {
  font-size: 18px;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px 2px #000;
}

.trade-gold-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #ffd700;
}

.trade-gold-display .gold-icon { font-size: 16px; }
.trade-gold-display span:last-child {
  color: #ffd700;
  font-weight: bold;
  font-size: 16px;
}

.trade-close-btn {
  background: rgba(255, 50, 50, 0.2);
  border: 1px solid #ff4444;
  color: #ff6666;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}
.trade-close-btn:hover {
  background: #ff4444;
  color: #fff;
}

/* Табы */
.trade-tabs {
  display: flex;
  background: #0a0a12;
  border-bottom: 1px solid #333;
}

.trade-tab {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}
.trade-tab:hover { color: #fff; background: rgba(255, 215, 0, 0.05); }
.trade-tab.active {
  color: #ffd700;
  border-bottom-color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

/* Категории */
.trade-categories {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid #222;
  flex-wrap: wrap;
}

.category-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #333;
  border-radius: 16px;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.category-btn:hover { border-color: #ffd700; color: #fff; }
.category-btn.active {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
  color: #ffd700;
}

/* Панели */
.trade-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.trade-panel.active { display: flex; }

/* Сетка предметов - КВАДРАТЫ */
.trade-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  align-content: start;
}

.trade-items-grid::-webkit-scrollbar { width: 6px; }
.trade-items-grid::-webkit-scrollbar-track { background: #0a0a12; }
.trade-items-grid::-webkit-scrollbar-thumb { background: #ffd700; border-radius: 3px; }

/* Слот предмета - квадратный */
.trade-item-slot {
  position: relative;
  aspect-ratio: 1;
  min-width: 100px;
  background: linear-gradient(135deg, #1a1a2e 0%, #12121f 100%);
  border: 2px solid #333;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.trade-item-slot:hover {
  border-color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.trade-item-slot.selected {
  border-color: #ffd700;
  background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5), inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.trade-item-slot.cannot-afford {
  opacity: 0.4;
  border-color: #ff4444;
}

/* Иконка предмета */
.trade-item-slot .item-icon {
  width: 85%;
  height: 85%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trade-item-slot .item-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Цена на слоте */
.trade-item-slot .item-price {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.8);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 2px;
}
.trade-item-slot .item-price.sell { color: #2ecc71; }
.gold-mini { font-size: 10px; }

/* Количество */
.trade-item-slot .item-quantity {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.8);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  color: #fff;
}

/* Бейджи статов */
.trade-item-slot .item-stat-badge {
  position: absolute;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  color: #fff;
}
.trade-item-slot .item-stat-badge.defense {
  top: 2px;
  left: 2px;
  background: rgba(0, 100, 200, 0.9);
}
.trade-item-slot .item-stat-badge.damage {
  top: 2px;
  left: 2px;
  background: rgba(200, 50, 50, 0.9);
}

/* Пустое состояние */
.trade-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #555;
  font-style: italic;
}

/* ===== ПАНЕЛЬ ДЕТАЛЕЙ (справа) ===== */
.trade-details-panel {
  width: 280px;
  background: linear-gradient(135deg, #12121f 0%, #0a0a12 100%);
  border: 2px solid #333;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #12121f 100%);
  border-bottom: 2px solid #555;
  color: #fff;
  font-weight: bold;
}

.details-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 14px;
}
.details-close:hover { color: #fff; }

.details-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.details-empty {
  text-align: center;
  color: #555;
  padding: 40px 20px;
  font-style: italic;
}

/* Детали предмета */
.details-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.details-icon {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  background: linear-gradient(135deg, #1a1a2e 0%, #12121f 100%);
  border: 3px solid #ffd700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.1);
}
.details-icon img {
  max-width: 140px;
  max-height: 140px;
  image-rendering: pixelated;
}

.details-name {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
}
.details-name.common { color: #fff; }
.details-name.uncommon { color: #2ecc71; }
.details-name.rare { color: #3498db; }
.details-name.epic { color: #9b59b6; }
.details-name.legendary { color: #f39c12; }

.details-description {
  text-align: center;
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.details-type {
  text-align: center;
  font-size: 11px;
  color: #666;
  margin-top: -8px;
}

.details-weight {
  text-align: center;
  font-size: 11px;
  color: #777;
  padding: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.price-value.cant-afford {
  color: #ff4444 !important;
  text-decoration: line-through;
}

.details-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #555;
}

.details-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.details-stats {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: #ccc;
  border-bottom: 1px solid #222;
}
.stat-row:last-child { border-bottom: none; }
.stat-row span:last-child { color: #2ecc71; font-weight: bold; }

.details-requirements {
  background: rgba(100, 0, 0, 0.2);
  border: 1px solid #442;
  border-radius: 6px;
  padding: 10px;
}
.req-title { color: #ff8888; font-size: 12px; margin-bottom: 6px; }
.req-row { font-size: 12px; color: #cc8888; padding: 2px 0; }

.details-price {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #553;
  border-radius: 6px;
  padding: 10px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}
.price-row.buy { color: #ff8888; }
.price-row.sell { color: #88ff88; }
.price-row.sell-all { color: #88ff88; font-size: 11px; }
.price-value { font-weight: bold; }

/* Кнопки действий */
.details-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.action-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn.buy-btn {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: #fff;
}
.action-btn.buy-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}
.action-btn.buy-btn:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
}

.action-btn.sell-btn {
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  color: #fff;
}
.action-btn.sell-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}

.action-btn.sell-all-btn {
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
  color: #fff;
}
.action-btn.sell-all-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

/* Toast сообщения */
.trade-toast {
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-size: 12px;
  animation: fadeIn 0.3s;
}
.trade-toast.success { background: rgba(46, 204, 113, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }
.trade-toast.error { background: rgba(231, 76, 60, 0.2); color: #e74c3c; border: 1px solid #e74c3c; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Мобильная адаптация */
@media (max-width: 800px) {
  .trade-container {
    flex-direction: column;
    width: 95vw;
    height: 90vh;
  }
  .trade-details-panel {
    width: 100%;
    height: 200px;
  }
  .trade-items-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }
  .trade-item-slot {
    min-width: 80px;
  }
}

/* =====================================================
   СИСТЕМА ОПЫТА И УРОВНЕЙ
   ===================================================== */

/* Кликабельная строка уровня */
.stat-row-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.stat-row-clickable:hover {
  background: rgba(30, 144, 255, 0.2);
  color: #5dade2;
}

/* Мигающий индикатор + */
.level-up-indicator {
  color: #f1c40f;
  font-weight: bold;
  font-size: 14px;
  margin-left: 4px;
  animation: blink-glow 1s ease-in-out infinite;
}

.level-up-indicator.hidden {
  display: none;
}

@keyframes blink-glow {
  0%, 100% { 
    opacity: 1; 
    text-shadow: 0 0 8px #f1c40f, 0 0 12px #f39c12;
  }
  50% { 
    opacity: 0.3;
    text-shadow: none;
  }
}

/* Модал опыта — увеличен по ширине, компактный по высоте */
.xp-modal {
  position: relative;
  z-index: 10;
  width: 880px;
  max-width: 98vw;
  max-height: 80vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #2a3548 0%, #1e2636 100%);
  border: 6px solid #4a6a8a;
  border-radius: 28px;
  padding: 6px;
  font-family: 'Press Start 2P', monospace;
  color: #f0f4ff;
  box-shadow: 0 0 60px rgba(100, 150, 200, 0.3);
}

.xp-modal .modal-close {
  position: absolute;
  width: 31px;
  height: 30px;
  font-size: 23px;
  top: 1%;
  right: 12px;
  border-radius: 6px;
  color: red;
}

/* Вкладки */
.xp-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  margin-top: 45px;
  border-bottom: 3px solid #4a6a8a;
  padding-bottom: 6px;
}

.xp-tab {
  flex: 1;
  padding: 6px 8px;
  background: transparent;
  border: 3px solid #3a5a7a;
  border-radius: 10px 10px 0 0;
  color: #8899aa;
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.xp-tab:hover {
  background: rgba(90, 140, 200, 0.2);
  color: #aabbcc;
}

.xp-tab.active {
  background: linear-gradient(180deg, #3a5a7a 0%, #2a4a6a 100%);
  border-color: #5a8aba;
  color: #f0f4ff;
}

.xp-tab.has-points {
  animation: tab-glow 1.5s ease-in-out infinite;
  border-color: #f1c40f;
}

@keyframes tab-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(241, 196, 15, 0.3); }
  50% { box-shadow: 0 0 12px rgba(241, 196, 15, 0.6); }
}

.xp-tab-content {
  display: none;
}

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

/* Специальный backdrop для XP модала - прозрачнее */
.xp-backdrop {
  background: rgba(0, 0, 0, 0.4) !important;
}

/* Заголовок распределения */
.xp-distribute-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(241, 196, 15, 0.15);
  border: 3px solid #f1c40f;
  border-radius: 14px;
}

.xp-distribute-title {
  font-size: 19px;
  color: #f1c40f;
}

.xp-distribute-available {
  font-size: 50px;
  color: #f1c40f;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.xp-distribute-available.empty {
  color: #666;
  text-shadow: none;
}

/* Вкладка Навыки */
.xp-skills-points-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: rgba(46, 204, 113, 0.12);
  border: 2px solid #2ecc71;
  border-radius: 10px;
  font-size: 21px;
  color: #bdc3c7;
}
.xp-skills-points-row strong {
  color: #2ecc71;
  font-size: 28px;
}
.xp-skills-type-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.xp-skill-type-tab {
  flex: 1;
  padding: 6px 10px;
  border-radius: 10px;
  border: 3px solid #2a3146;
  background: #1e2536;
  color: #8899aa;
  font-size: 19px;
  cursor: pointer;
}
.xp-skill-type-tab:hover {
  border-color: #3a4558;
  color: #cfe2ff;
}
.xp-skill-type-tab.active {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}
.xp-skills-hint {
  color: #8899aa;
  font-size: 19px;
  margin-bottom: 12px;
}
.xp-skills-hint.hidden {
  display: none;
}
.xp-skills-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
}
.xp-skill-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  background: #1e2536;
  border: 2px solid #2a3146;
  border-radius: 10px;
  gap: 6px;
}
.xp-skill-class-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 1;
}
.xp-skill-class-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
}
.xp-skill-class-label {
  font-size: 9px;
  color: #8899aa;
  text-align: center;
  line-height: 1.2;
  max-width: 70px;
}
.xp-skill-row.learned {
  border-color: #2ecc71;
  border-width: 3px;
  background: rgba(46, 204, 113, 0.22);
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.25);
}
.xp-skill-icon-wrap {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.xp-skill-icon {
  width: 140px;
  height: 140px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 12px;
  position: relative;
  z-index: 0;
}
.xp-skill-icon-wrap .xp-skill-icon[style*="visibility: hidden"] {
  width: 0;
  height: 0;
  overflow: hidden;
}
.xp-skill-info {
  width: 100%;
  text-align: center;
  min-width: 0;
}
.xp-skill-name {
  font-weight: 600;
  color: #e6ebff;
  font-size: 21px;
}
.xp-skill-desc {
  font-size: 17px;
  color: #8899aa;
  margin-top: 4px;
  text-align: center;
}
.xp-skill-learned-label {
  color: #2ecc71;
  font-size: 17px;
}
.xp-skill-learn-btn {
  padding: 8px 22px;
  border-radius: 10px;
  border: 2px solid #2ecc71;
  background: transparent;
  color: #2ecc71;
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
}
.xp-skill-learn-btn:hover:not(:disabled) {
  background: rgba(46, 204, 113, 0.2);
}
.xp-skill-learn-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== PANEL MASTERY TABS (main inventory screen) ===== */
.panel-mastery-tabs {
  display: flex;
  gap: 2px;
  margin: 8px 0 6px 0;
  border-bottom: 2px solid #3a4a5a;
  padding-bottom: 4px;
}
.panel-mastery-tab {
  flex: 1;
  padding: 5px 2px;
  background: transparent;
  border: 2px solid #2a3a4a;
  border-radius: 6px 6px 0 0;
  color: #6a7a8a;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.panel-mastery-tab:hover {
  background: rgba(90, 140, 200, 0.15);
  color: #8a9aaa;
}
.panel-mastery-tab.active {
  background: #2a3a4a;
  color: #f1c40f;
  border-color: #f1c40f;
}
.panel-mastery-content {
  display: none;
  height: 220px;
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: #1a2232 #0d1117;
}
.panel-mastery-content::-webkit-scrollbar { width: 4px; }
.panel-mastery-content::-webkit-scrollbar-track { background: #0d1117; }
.panel-mastery-content::-webkit-scrollbar-thumb { background: #1a2232; border-radius: 2px; }
.panel-mastery-content::-webkit-scrollbar-thumb:hover { background: #2a3242; }
.panel-mastery-content.active {
  display: block;
}
.panel-mastery-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1a2232 #0d1117;
}
.panel-mastery-list::-webkit-scrollbar { width: 4px; }
.panel-mastery-list::-webkit-scrollbar-track { background: #0d1117; }
.panel-mastery-list::-webkit-scrollbar-thumb { background: #1a2232; border-radius: 2px; }
.panel-mastery-list::-webkit-scrollbar-thumb:hover { background: #2a3242; }
.pm-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: #1a2232;
  border: 1px solid #2a3146;
  border-radius: 6px;
}
.pm-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.pm-info {
  flex: 1;
  min-width: 0;
}
.pm-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.pm-name {
  font-size: 11px;
  color: #c0ccdd;
}
.pm-lvl {
  font-size: 11px;
  font-weight: 700;
  color: #f1c40f;
}
.pm-bar-wrap {
  width: 100%;
  height: 6px;
  background: #0d1117;
  border-radius: 3px;
  overflow: hidden;
}
.pm-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}
.pm-bar.weapon { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.pm-bar.armor  { background: linear-gradient(90deg, #3498db, #2980b9); }
.pm-bar.shield { background: linear-gradient(90deg, #f39c12, #e67e22); }
.pm-bonus {
  font-size: 11px;
  color: #2ecc71;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 36px;
  text-align: right;
}

/* ===== MASTERY TAB ===== */
.mastery-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.mastery-subtab {
  flex: 1;
  padding: 8px 6px;
  border: 2px solid #3a4a5a;
  border-radius: 8px;
  background: #1a2332;
  color: #8899aa;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.mastery-subtab.active {
  background: #2a3a4a;
  color: #f1c40f;
  border-color: #f1c40f;
}
.mastery-subtab:hover:not(.active) {
  background: #253040;
  border-color: #5a6a7a;
}
.mastery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
}
.mastery-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #1e2536;
  border: 2px solid #2a3146;
  border-radius: 10px;
  transition: border-color 0.2s;
}
.mastery-row:hover {
  border-color: #4a5a6a;
}
.mastery-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.mastery-info {
  flex: 1;
  min-width: 0;
}
.mastery-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.mastery-name {
  font-size: 16px;
  font-weight: 600;
  color: #e6ebff;
}
.mastery-level {
  font-size: 18px;
  font-weight: 700;
  color: #f1c40f;
  text-shadow: 1px 1px 0 #000;
}
.mastery-bar-wrap {
  width: 100%;
  height: 12px;
  background: #0d1117;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #2a3146;
}
.mastery-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
}
.mastery-bar.weapon { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.mastery-bar.armor { background: linear-gradient(90deg, #3498db, #2980b9); }
.mastery-bar.shield { background: linear-gradient(90deg, #f39c12, #e67e22); }
.mastery-xp-text {
  font-size: 11px;
  color: #6a7a8a;
  margin-top: 2px;
  text-align: right;
}
.mastery-bonus {
  font-size: 14px;
  color: #2ecc71;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 55px;
  text-align: right;
}

/* Кнопка сброса */
.xp-btn-reset {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  cursor: pointer;
  border: 3px solid #7f8c8d;
  background: #2a3548;
  color: #bdc3c7;
}

.xp-btn-reset:hover {
  background: #3a4558;
  border-color: #95a5a6;
}

.xp-modal-title {
  text-align: center;
  font-size: 21px;
  color: #f1c40f;
  margin: 0 0 8px 0;
  text-shadow: 2px 2px 0 #000;
}

/* Отображение уровня */
.xp-level-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.xp-level-label {
  font-size: 19px;
  color: #8899aa;
  text-transform: uppercase;
}

.xp-level-value {
  font-size: 82px;
  color: #f1c40f;
  text-shadow: 3px 3px 0 #000, 0 0 20px rgba(241, 196, 15, 0.5);
}

/* Прогресс бар */
.xp-progress-section {
  margin-bottom: 10px;
}

.xp-progress-bar-container {
  position: relative;
  height: 44px;
  background: #1e2636;
  border: 3px solid #4a6a8a;
  border-radius: 10px;
  overflow: hidden;
}

.xp-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
  transition: width 0.5s ease;
}

.xp-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 17px;
  color: #fff;
  text-shadow: 1px 1px 0 #000;
  white-space: nowrap;
}

.xp-progress-details {
  text-align: center;
  margin-top: 6px;
  font-size: 16px;
  color: #8899aa;
}

.xp-progress-details strong {
  color: #5dade2;
}

/* Статистика XP */
.xp-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.xp-stat-box {
  background: rgba(40, 60, 90, 0.4);
  border: 3px solid #4a6a8a;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
}

.xp-stat-label {
  display: block;
  font-size: 14px;
  color: #8899aa;
  margin-bottom: 6px;
}

.xp-stat-value {
  font-size: 29px;
  color: #5dade2;
}

/* Секция очков */
.xp-points-section {
  border-top: 3px solid #4a6a8a;
  padding-top: 8px;
  margin-top: 8px;
}

.xp-points-section h4 {
  font-size: 19px;
  color: #f39c12;
  margin: 0 0 8px 0;
  text-align: center;
}

.xp-points-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.xp-point-box {
  background: rgba(241, 196, 15, 0.1);
  border: 3px solid #f1c40f;
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
}

.xp-point-box.has-points {
  animation: pulse-gold 2s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 5px rgba(241, 196, 15, 0.3); }
  50% { box-shadow: 0 0 15px rgba(241, 196, 15, 0.6); }
}

.xp-point-label {
  display: block;
  font-size: 14px;
  color: #f1c40f;
  margin-bottom: 6px;
}

.xp-point-value {
  font-size: 38px;
  color: #f1c40f;
  font-weight: bold;
}

.xp-distribute-btn {
  width: 100%;
  padding: 10px 12px;
  background: linear-gradient(180deg, #f39c12 0%, #d68910 100%);
  border: 3px solid #f1c40f;
  border-radius: 10px;
  color: #000;
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.xp-distribute-btn:hover {
  background: linear-gradient(180deg, #f1c40f 0%, #f39c12 100%);
  transform: translateY(-2px);
}

.xp-distribute-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Панель распределения */
.xp-distribute-panel {
  border-top: 2px solid #4a6a8a;
  padding-top: 8px;
  margin-top: 8px;
}

.xp-distribute-panel.hidden {
  display: none;
}

.xp-distribute-panel h4 {
  font-size: 16px;
  color: #5dade2;
  margin: 0 0 8px 0;
  text-align: center;
}

.xp-distribute-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.xp-distribute-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(40, 60, 90, 0.3);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 17px;
  cursor: help;
  transition: background 0.2s;
}

.xp-distribute-row:hover {
  background: rgba(60, 100, 140, 0.4);
}

.xp-stat-name {
  flex: 1;
  min-width: 140px;
}

.xp-stat-current {
  min-width: 90px;
  text-align: center;
  color: #5dade2;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 12px;
  border-radius: 10px;
  margin-right: 12px;
  font-size: 19px;
  white-space: nowrap;
}

.xp-distribute-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xp-btn-minus, .xp-btn-plus {
  width: 44px;
  height: 44px;
  border: 3px solid #5a7a9a;
  border-radius: 10px;
  background: #2a3a5a;
  color: #f0f4ff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xp-btn-minus:hover, .xp-btn-plus:hover {
  background: #3a4a6a;
  border-color: #7dcdff;
}

.xp-btn-plus:disabled, .xp-btn-minus:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.xp-distribute-value {
  min-width: 40px;
  text-align: center;
  color: #2ecc71;
  font-weight: bold;
  font-size: 21px;
}

.xp-distribute-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.xp-btn-cancel, .xp-btn-confirm {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 15px;
  cursor: pointer;
  border: 3px solid;
}

.xp-btn-cancel {
  background: #1a1f2e;
  border-color: #e74c3c;
  color: #e74c3c;
}

.xp-btn-cancel:hover {
  background: rgba(231, 76, 60, 0.2);
}

.xp-btn-confirm {
  background: linear-gradient(180deg, #27ae60 0%, #1e8449 100%);
  border-color: #2ecc71;
  color: #fff;
}

.xp-btn-confirm:hover {
  background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
}

.xp-btn-confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =====================================================
   МОДАЛ НАСТРОЕК (на весь экран / канвас)
   ===================================================== */

.settings-modal-full {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-modal-full.hidden {
  display: none;
}

.settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.settings-modal-content {
  position: relative;
  z-index: 10;
  width: 90vw;
  max-width: 900px;
  height: 85vh;
  max-height: 700px;
  background: linear-gradient(180deg, #1e2636 0%, #151a24 100%);
  border: 2px solid #3a4a6a;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  font-family: 'Press Start 2P', monospace;
  color: #e6ebff;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.settings-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #e6ebff;
  font-size: 24px;
  cursor: pointer;
  border-radius: 8px;
  line-height: 1;
}

.settings-modal-close:hover {
  background: rgba(231, 76, 60, 0.4);
  color: #fff;
}

.settings-title {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #f1c40f;
  text-align: center;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #3a4a6a;
}

.settings-tab {
  padding: 10px 14px;
  background: transparent;
  border: 1px solid #3a4a6a;
  border-radius: 8px;
  color: #8899aa;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-tab:hover {
  background: rgba(90, 140, 200, 0.2);
  color: #b0c4e0;
}

.settings-tab.active {
  background: rgba(90, 140, 200, 0.35);
  border-color: #5a8aba;
  color: #fff;
}

.settings-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.settings-panel {
  display: none;
  padding: 16px 0;
}

.settings-panel.active {
  display: block;
}

.settings-panel h3 {
  font-size: 14px;
  color: #5dade2;
  margin: 0 0 16px 0;
}

.settings-panel-inner {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #2a3146;
  border-radius: 10px;
  padding: 16px;
}

.settings-placeholder {
  color: #667788;
  font-size: 11px;
  margin: 0;
}

/* ===== QUESTS TAB ===== */
.quests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quest-card {
  background: rgba(0,0,0,0.35);
  border: 1px solid #3a4a5e;
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color .2s;
}
.quest-card.active {
  border-color: #d4a017;
}
.quest-card.completed {
  border-color: #3a7a3a;
  opacity: .7;
}
.quest-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.quest-status-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.quest-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #e8d5a3;
}
.quest-card.completed .quest-title {
  color: #7a9a7a;
  text-decoration: line-through;
}
.quest-description {
  font-size: 11px;
  color: #99aabb;
  margin-bottom: 8px;
  line-height: 1.5;
}
.quest-objectives {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.quest-objective {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #bbccdd;
}
.quest-objective.done {
  color: #5cb85c;
}
.quest-obj-check {
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.quest-obj-progress {
  color: #d4a017;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  margin-left: auto;
}
.quest-empty {
  color: #667788;
  font-size: 11px;
  text-align: center;
  padding: 20px 0;
}

.settings-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 11px;
  color: #aabbcc;
  cursor: pointer;
}

.settings-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.settings-label input[type="range"] {
  flex: 1;
  max-width: 200px;
}

.settings-notepad {
  width: 100%;
  min-height: 280px;
  padding: 16px;
  background: #0f1318;
  border: 1px solid #2a3146;
  border-radius: 8px;
  color: #e6ebff;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
}

.settings-notepad:focus {
  outline: none;
  border-color: #5a8aba;
}

#settings-character-info .settings-char-line {
  margin: 8px 0;
  font-size: 13px;
  color: #94a3b8;
}

#settings-canvas-character-bio::placeholder,
#settings-canvas-character-name::placeholder,
#settings-canvas-character-city::placeholder {
  color: #64748b;
}

/* Контейнер полей инфа персонажа — привязан к канвасу (%), поля не смещаются */
.settings-character-fields-wrap {
  display: block;
  overflow: hidden;
  pointer-events: none;
}
.settings-character-fields-content {
  pointer-events: none;
}
.settings-character-fields-wrap input,
.settings-character-fields-wrap textarea {
  pointer-events: auto;
}
.settings-character-name-input {
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  border: 1px solid #64748b;
  border-radius: 4px;
  padding: 6px 12px;
  font: 16px system-ui, Segoe UI, Inter, Arial, sans-serif;
  outline: none;
  caret-color: #e2e8f0;
  resize: none;
}
.settings-character-name-input:focus {
  border-color: #94a3b8;
}
.settings-character-name-input::placeholder {
  color: #64748b;
}
.settings-character-bio-textarea {
  background: rgba(15, 23, 42, 0.6);
  color: #e2e8f0;
  border: 1px solid #64748b;
  border-radius: 4px;
  padding: 12px 15px;
  font: 15px system-ui, Segoe UI, Inter, Arial, sans-serif;
  line-height: 1.6;
  resize: none;
  outline: none;
  caret-color: #e2e8f0;
}
.settings-character-bio-textarea:focus {
  border-color: #94a3b8;
}
.settings-character-bio-textarea::placeholder {
  color: #64748b;
}

/* Combat styles moved to css/combat.css */

/* ===================== MINIGAME OVERLAY ===================== */
.minigame-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .75);
  animation: mg-fade-in .3s ease;
}
@keyframes mg-fade-in {
  from { opacity: 0 }
  to   { opacity: 1 }
}

.minigame-modal {
  background: linear-gradient(145deg, #1a1a2e, #16213e);
  border: 3px solid #e2b714;
  border-radius: 6px;
  box-shadow: 0 0 30px rgba(226, 183, 20, .35), inset 0 0 30px rgba(0,0,0,.4);
  width: min(420px, 90vw);
  padding: 0;
  font-family: 'Press Start 2P', monospace;
  color: #e2e8f0;
  image-rendering: pixelated;
  animation: mg-pop .35s cubic-bezier(.17,.67,.35,1.2);
}
@keyframes mg-pop {
  from { transform: scale(.85); opacity: 0 }
  to   { transform: scale(1);   opacity: 1 }
}

.minigame-header {
  background: linear-gradient(90deg, #e2b714, #f0c040);
  color: #1a1a2e;
  text-align: center;
  font-size: 13px;
  padding: 12px 16px;
  letter-spacing: 1px;
  border-bottom: 2px solid #c9a30e;
}

.minigame-body {
  padding: 20px 18px;
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}
.minigame-body p { margin: 0 0 10px; }
.minigame-hint {
  color: #94a3b8;
  font-size: 8px;
  margin-top: 10px;
}

.minigame-footer {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 0 18px 18px;
}

.minigame-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 10px 18px;
  border: 2px solid;
  border-radius: 4px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.minigame-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.minigame-btn:active {
  transform: translateY(0);
}

.minigame-btn-skip {
  background: #334155;
  color: #cbd5e1;
  border-color: #64748b;
}
.minigame-btn-skip:hover {
  background: #475569;
}

.minigame-btn-descend {
  background: linear-gradient(135deg, #065f46, #047857);
  color: #d1fae5;
  border-color: #34d399;
}
.minigame-btn-descend:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 0 15px rgba(52, 211, 153, .4);
}

.staircase-modal .minigame-header {
  background: linear-gradient(90deg, #059669, #34d399);
}

/* ===================== CURRENCY BAR ===================== */
.currency-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: 12px;
  flex-shrink: 0;
}
.currency-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-family: 'Press Start 2P', monospace;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(255,255,255,.08);
}
.cur-icon {
  font-size: 11px;
  line-height: 1;
}
.cur-val {
  min-width: 18px;
  text-align: right;
}
.currency-item.copper  .cur-val { color: #cd7f32; }
.currency-item.silver  .cur-val { color: #c0c0c0; }
.currency-item.gold    .cur-val { color: #ffd700; }
.currency-item.platinum .cur-val { color: #e5e4e2; text-shadow: 0 0 4px rgba(173,216,230,.5); }

/* ===================== TROPHY ITEMS ===================== */
.trophy-item {
  border: 1px solid rgba(234, 179, 8, .5) !important;
  box-shadow: inset 0 0 6px rgba(234, 179, 8, .15);
}
.trophy-badge {
  position: absolute;
  top: 1px;
  left: 1px;
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.8));
}

/* ===================== TUTORIAL OVERLAY ===================== */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 99000;
  pointer-events: all;
  opacity: 0;
  transition: opacity .4s ease;
}
.tutorial-overlay.visible { opacity: 1; }

.tutorial-highlight {
  position: fixed;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.72);
  z-index: 99001;
  pointer-events: none;
  transition: top .35s ease, left .35s ease, width .35s ease, height .35s ease, opacity .3s;
  opacity: 0;
  border: 2px solid rgba(255,215,0,.6);
}
.tutorial-highlight.visible { opacity: 1; }

.tutorial-dialog {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99010;
  display: flex;
  gap: 0;
  max-width: 720px;
  width: 94vw;
  min-height: 220px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border: 2px solid #ffd700;
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(255,215,0,.18), inset 0 0 30px rgba(0,0,0,.3);
  font-family: 'Press Start 2P', monospace;
  image-rendering: pixelated;
  overflow: hidden;
}
.tutorial-dialog-enter {
  animation: tutDialogPop .35s ease;
}
@keyframes tutDialogPop {
  0%  { transform: translateX(-50%) scale(.92); opacity:.6; }
  100%{ transform: translateX(-50%) scale(1);   opacity:1; }
}

/* NPC Portrait */
.tutorial-npc-portrait {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(180deg, #0d1b3e 0%, #162447 100%);
  border-right: 2px solid #ffd700;
  overflow: hidden;
}
.tutorial-npc-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: opacity .2s ease;
  image-rendering: pixelated;
}

/* Dialog body */
.tutorial-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 12px;
  min-height: 160px;
}
.tutorial-title {
  color: #ffd700;
  font-size: 11px;
  margin-bottom: 10px;
  text-shadow: 0 0 6px rgba(255,215,0,.4);
}
.tutorial-text {
  color: #d0d8f0;
  font-size: 9px;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 12px;
}
.tutorial-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tutorial-btn-next {
  margin-left: auto;
  padding: 8px 22px;
  background: linear-gradient(180deg, #ffd700, #e6a800);
  color: #1a1a2e;
  border: 2px solid #b8860b;
  border-radius: 3px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  cursor: pointer;
  text-transform: uppercase;
  transition: transform .15s, box-shadow .15s;
}
.tutorial-btn-next:hover {
  transform: scale(1.06);
  box-shadow: 0 0 12px rgba(255,215,0,.5);
}
.tutorial-btn-skip {
  padding: 6px 14px;
  background: transparent;
  color: #6a6a8e;
  border: 1px solid #3a3a5e;
  border-radius: 3px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.tutorial-btn-skip:hover {
  color: #aaa;
  border-color: #666;
}

/* Step dots */
.tutorial-step-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.tutorial-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #2a2a4e;
  border: 1px solid #4a4a6e;
  transition: background .3s, border-color .3s;
}
.tutorial-dot.active {
  background: #ffd700;
  border-color: #ffd700;
  box-shadow: 0 0 6px rgba(255,215,0,.5);
}

/* Replay button in settings */
.tutorial-replay-btn {
  margin-top: 14px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #2a2a4e, #1a1a2e);
  color: #ffd700;
  border: 1px solid #ffd700;
  border-radius: 3px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
.tutorial-replay-btn:hover {
  background: linear-gradient(180deg, #3a3a5e, #2a2a3e);
  box-shadow: 0 0 10px rgba(255,215,0,.3);
}

/* Responsive */
@media (max-width: 600px) {
  .tutorial-npc-portrait { width: 90px; }
  .tutorial-dialog { bottom: 16px; min-height: 180px; }
  .tutorial-title { font-size: 9px; }
  .tutorial-text { font-size: 8px; }
}

/* ==========================================
   TITLE SYSTEM
   ========================================== */

.profile-head-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  cursor: pointer;
  display: inline-block;
  line-height: 1.4;
  transition: opacity .2s;
}
.profile-head-title:hover {
  opacity: 0.75;
}
.profile-head-title:empty {
  display: none;
}

/* Title select modal */
.title-select-card {
  max-width: 860px;
  width: 96%;
}
.title-select-card .modal-head h3 {
  font-size: 16px;
}
.title-select-body {
  padding: 20px 24px;
  max-height: 600px;
  overflow-y: auto;
}
.title-select-body::-webkit-scrollbar { width: 6px; }
.title-select-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 3px; }
.title-select-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.title-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.title-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 10px 14px;
  background: rgba(30,30,60,0.7);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: all .2s;
  min-height: 90px;
  text-align: center;
}
.title-cell:hover {
  background: rgba(50,50,90,0.8);
  border-color: rgba(255,215,0,0.4);
  box-shadow: 0 0 10px rgba(255,215,0,0.15);
}
.title-cell.active {
  border-color: #ffd700;
  background: rgba(255,215,0,0.1);
  box-shadow: 0 0 12px rgba(255,215,0,0.3);
}
.title-cell.locked {
  opacity: 0.3;
  cursor: default;
  filter: grayscale(0.7);
}
.title-cell.locked:hover {
  background: rgba(30,30,60,0.7);
  border-color: rgba(255,255,255,0.08);
  box-shadow: none;
}

.title-cell-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: 6px;
}
.title-cell-desc {
  font-size: 12px;
  color: #aaa;
  line-height: 1.4;
  word-break: break-word;
}

.title-cell-tooltip {
  display: none;
  position: fixed;
  background: rgba(10,10,30,0.97);
  border: 1px solid rgba(255,215,0,0.5);
  border-radius: 6px;
  padding: 12px 16px;
  min-width: 220px;
  max-width: 320px;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.title-cell-tooltip.visible {
  display: block;
}
.title-tooltip-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  margin-bottom: 8px;
}
.title-tooltip-desc {
  font-size: 14px;
  color: #ccc;
  line-height: 1.5;
}
.title-tooltip-rarity {
  font-size: 12px;
  margin-top: 8px;
  text-transform: uppercase;
  font-weight: bold;
}

.title-rarity-common { color: #95a5a6; }
.title-rarity-uncommon { color: #2ecc71; }
.title-rarity-rare { color: #3498db; }
.title-rarity-epic { color: #9b59b6; }
.title-rarity-legendary { color: #f39c12; }

.title-info-banner {
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 5px;
  padding: 10px 14px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #aaa;
  line-height: 1.5;
  text-align: center;
}

.title-cell-bonus {
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.3;
}
.title-cell-bonus.visible-bonus {
  color: #2ecc71;
}
.title-cell-bonus.hidden-bonus {
  color: #e67e22;
  font-style: italic;
}
.title-cell-bonus.locked-bonus {
  color: #555;
  font-size: 14px;
  letter-spacing: 3px;
}
