/* Side Panels (Stats & Right Panel) */
.panel-header {
  font-size: 1.1rem;
  color: var(--accentGold);
  padding: 1rem;
  border-bottom: 1px solid var(--borderGothic);
  text-align: center;
  letter-spacing: 0.1em;
  background: rgba(0,0,0,0.2);
}

.panel-stats {
  padding-bottom: 1rem;
  overflow-y: auto;
}

/* Character Identity */
.char-identity {
  padding: 1rem;
  text-align: center;
}
.char-name {
  display: block;
  font-family: var(--fontHeading);
  font-size: 1.5rem;
  color: var(--textPrimary);
}
.char-level {
  color: var(--accentGold);
  font-size: 0.9rem;
}
.char-race-class {
  text-align: center;
  color: var(--textMuted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

/* Stat Bars */
.stat-bar-row {
  padding: 0.5rem 1rem;
}
.stat-bar-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--textMuted);
  margin-bottom: 0.2rem;
}
.bar-track {
  width: 100%;
  height: 18px;
  background: #000;
  border: 1px solid var(--borderGothic);
  position: relative;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.3s ease-out;
}
.bar-hp { background: linear-gradient(90deg, #500, var(--accentCrimson)); }
.bar-mana { background: linear-gradient(90deg, #004, var(--accentMana)); }
.bar-resource { background: linear-gradient(90deg, #630, #f80); } /* default orange */
.bar-xp { background: linear-gradient(90deg, #031, #284); }

.bar-text {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  text-align: center;
  font-size: 0.75rem;
  line-height: 16px;
  color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
}

/* Stat Block */
.stat-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--borderGothic);
  margin-top: 1rem;
}
.stat-item {
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.3);
  padding: 0.3rem 0.5rem;
  border: 1px solid rgba(255,255,255,0.05);
}
.stat-lbl { color: var(--textMuted); }
.stat-val { color: var(--textPrimary); font-weight: bold; }

/* Gold Display */
.gold-display {
  text-align: center;
  padding: 1rem;
  font-size: 1.1rem;
  border-top: 1px solid var(--borderGothic);
  border-bottom: 1px solid var(--borderGothic);
}
.gold-icon { color: var(--accentGold); }

/* Status Effects */
.status-effects {
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.effect-chip {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  background: rgba(20, 20, 50, 0.5);
  border: 1px solid var(--accentMana);
  border-radius: 2px;
}

.moon-display {
  text-align: center;
  padding: 1rem;
  color: var(--textMuted);
  font-family: var(--fontLore);
}

/* Map Panel */
.panel-right {
  overflow-y: auto;
}
.map-container {
  padding: 1rem;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--borderGothic);
}
.map-canvas {
  background: #000;
  border: 2px solid var(--borderGothic);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

/* Nearby List */
.nearby-list {
  padding: 1rem;
  border-bottom: 1px solid var(--borderGothic);
}
.nearby-entity {
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
}
.nearby-entity.player { color: var(--textPrimary); }
.nearby-entity.npc { color: var(--accentMana); }
.nearby-entity.hostile { color: var(--accentCrimson); }

/* Equipment */
.equipment-slots {
  padding: 1rem;
}
.eq-slot {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dotted rgba(255,255,255,0.1);
  font-size: 0.85rem;
}
.eq-slot span {
  color: var(--accentGold);
  text-align: right;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Char Create Specific */
.selection-section {
  margin-bottom: 2rem;
}
.selection-section h3 {
  font-family: var(--fontHeading);
  color: var(--accentGold);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--borderGothic);
  padding-bottom: 0.4rem;
}
.carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}
.race-card {
  min-width: 130px;
  padding: 0.8rem 1rem;
  background: var(--bgSurface);
  border: 1px solid var(--borderGothic);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 4px;
}
.race-card h4 {
  font-family: var(--fontHeading);
  color: var(--textPrimary);
  margin-bottom: 0.3rem;
}
.race-card:hover, .race-card.selected {
  border-color: var(--accentGold);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.25);
  transform: translateY(-2px);
}
.race-card.selected h4 {
  color: var(--accentGold);
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}
.class-card {
  padding: 0.8rem 1rem;
  background: var(--bgSurface);
  border: 1px solid var(--borderGothic);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 4px;
}
.class-card h4 {
  font-family: var(--fontHeading);
  color: var(--textPrimary);
  margin-bottom: 0.3rem;
}
.class-card .class-role {
  font-size: 0.75rem;
  color: var(--textMuted);
  display: block;
}
.class-card:hover, .class-card.selected {
  border-color: var(--accentCrimson);
  background: rgba(220, 20, 60, 0.1);
  box-shadow: 0 0 15px rgba(220, 20, 60, 0.25);
  transform: translateY(-2px);
}
.class-card.selected h4 {
  color: #ff6666;
}
.class-card.disabled {
  opacity: 0.35;
  filter: grayscale(80%);
  cursor: not-allowed;
  border-color: rgba(220, 20, 60, 0.4);
  background: rgba(10, 10, 15, 0.6);
}
.class-card.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: rgba(220, 20, 60, 0.4);
  background: rgba(10, 10, 15, 0.6);
}
.class-card .lock-tag {
  font-size: 0.7rem;
  color: #ff6666;
  margin-top: 0.2rem;
  font-weight: bold;
}

/* Racial Traits & Class Details */
.race-detail, .class-detail {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(10, 12, 16, 0.85);
  border: 1px solid var(--borderGothic);
  border-left: 4px solid var(--accentGold);
  border-radius: 4px;
}
.class-detail {
  border-left-color: var(--accentCrimson);
}
.detail-header {
  font-size: 1.4rem;
  color: var(--accentGold);
  font-family: var(--fontHeading);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detail-desc {
  color: var(--textPrimary);
  line-height: 1.5;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.detail-lore {
  font-family: var(--fontLore);
  color: var(--textMuted);
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.4;
  font-size: 0.9rem;
  border-left: 2px solid rgba(212, 175, 55, 0.3);
  padding-left: 0.75rem;
}
.traits-section, .branches-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.traits-heading, .branches-heading {
  font-family: var(--fontHeading);
  color: var(--accentGold);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.branches-heading {
  color: var(--accentCrimson);
}
.traits-grid, .branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.trait-card, .branch-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.25);
  padding: 0.75rem;
  border-radius: 3px;
  transition: border-color 0.2s;
}
.trait-card:hover {
  border-color: var(--accentGold);
  background: rgba(212, 175, 55, 0.05);
}
.branch-card {
  border-color: rgba(220, 20, 60, 0.25);
}
.branch-card:hover {
  border-color: var(--accentCrimson);
  background: rgba(220, 20, 60, 0.05);
}
.trait-name {
  font-weight: bold;
  color: var(--accentAurora);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.branch-name {
  font-weight: bold;
  color: var(--accentGold);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.trait-desc, .branch-desc {
  font-size: 0.8rem;
  color: var(--textMuted);
  line-height: 1.3;
}
.class-restriction-warning {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(220, 20, 60, 0.15);
  border: 1px solid var(--accentCrimson);
  color: #ff9999;
  font-size: 0.85rem;
  border-radius: 3px;
}
.badge-role {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: rgba(220, 20, 60, 0.3);
  border: 1px solid var(--accentCrimson);
  color: #fff;
  border-radius: 2px;
  font-family: sans-serif;
  text-transform: uppercase;
}
.class-sub {
  font-size: 0.85rem;
  color: var(--textMuted);
  margin-bottom: 0.75rem;
}

.stat-preview {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bgPanel);
  border: 1px solid var(--borderGothic);
  border-radius: 4px;
}

