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

.panel-stats {
  padding-bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.panel-stats-footer {
  margin-top: auto;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.45);
  border-top: 1px solid var(--borderGothic);
  display: flex;
  gap: 0.4rem;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.panel-stats-footer .btn-mode-toggle,
.panel-stats-footer .btn-compendium-trigger {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  padding: 0.35rem 0.3rem;
  white-space: nowrap;
}

/* Character Identity */
.char-identity {
  padding: 0.5rem 0.75rem 0.25rem 0.75rem;
  text-align: center;
}
.char-name {
  display: block;
  font-family: var(--fontHeading);
  font-size: 1.2rem;
  color: var(--textPrimary);
}
.char-level {
  color: var(--accentGold);
  font-size: 0.8rem;
}
.char-race-class {
  text-align: center;
  color: var(--textMuted);
  font-size: 0.75rem;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}

/* Character Description Bio */
.char-desc-block {
  margin: 0 0.6rem 0.5rem 0.6rem;
  padding: 0.35rem 0.55rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--borderGothic);
  border-radius: 4px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.char-desc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.25);
  padding-bottom: 0.15rem;
}

.char-desc-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--accentGold);
  font-weight: bold;
}

.btn-edit-desc {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #d4af37;
  font-size: 0.65rem;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit-desc:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #fff;
  border-color: #d4af37;
}

.char-desc-text {
  font-size: 0.72rem;
  line-height: 1.25;
  color: #cbd5e1;
  font-style: italic;
  margin: 0;
  word-wrap: break-word;
}

/* Stat Bars */
.stat-bar-row {
  padding: 0.25rem 0.65rem;
}
.stat-bar-row label {
  display: block;
  font-size: 0.72rem;
  color: var(--textMuted);
  margin-bottom: 0.1rem;
}
.bar-track {
  width: 100%;
  height: 14px;
  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.68rem;
  line-height: 12px;
  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.3rem;
  padding: 0.5rem 0.65rem;
  border-top: 1px solid var(--borderGothic);
  margin-top: 0.4rem;
}
.stat-item {
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.3);
  padding: 0.2rem 0.4rem;
  border: 1px solid rgba(255,255,255,0.05);
  font-size: 0.75rem;
}
.stat-lbl { color: var(--textMuted); }
.stat-val { color: var(--textPrimary); font-weight: bold; }

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

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

.environment-hud {
  padding: 0.5rem 0.65rem;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--borderGothic);
  border-bottom: 1px solid var(--borderGothic);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.env-row {
  font-size: 0.76rem;
  color: var(--textPrimary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.env-time {
  color: var(--accentGold);
  font-weight: bold;
}

.env-weather {
  color: #00ffcc;
}

.env-moon {
  color: var(--accentMana);
  font-style: italic;
}

.env-date {
  font-size: 0.7rem;
  color: var(--textMuted);
  border-top: 1px dashed rgba(212, 175, 55, 0.2);
  padding-top: 0.2rem;
  margin-top: 0.1rem;
}

/* Map Panel */
.panel-right {
  overflow-y: auto;
}
.map-container {
  padding: 0.65rem;
  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: 0.55rem 0.75rem;
  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.merchant      { color: var(--accentGold); }
.nearby-entity.npc           { color: var(--accentMana); }
.nearby-entity.hostile       { color: var(--accentCrimson); }

/* Player title tiers in Nearby panel */
.nearby-entity.player-ascended {
  color: #f4a261;
  text-shadow: 0 0 5px rgba(244, 162, 97, 0.4);
}
.nearby-entity.player-builder {
  color: #4ecdc4;
}
.nearby-entity.player-demigod {
  color: #c084fc;
}
.nearby-entity.player-god {
  color: var(--accentGold);
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.7);
  animation: god-shimmer 2s ease-in-out infinite;
}
@keyframes god-shimmer {
  0%, 100% { text-shadow: 0 0 4px rgba(212,175,55,0.5); }
  50%       { text-shadow: 0 0 12px rgba(212,175,55,1), 0 0 20px rgba(255,200,0,0.4); }
}

/* Level badge and title label in nearby entries */
.nearby-level {
  font-size: 0.72rem;
  opacity: 0.65;
  font-family: var(--fontMono);
  margin-right: 2px;
  min-width: 32px;
  display: inline-block;
}
.nearby-title {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-right: 2px;
}


/* Equipment */
.equipment-slots {
  padding: 0.4rem 0.65rem;
}
.eq-slot {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px dotted rgba(255,255,255,0.1);
  font-size: 0.78rem;
}
.eq-slot span {
  color: var(--accentGold);
  text-align: right;
  max-width: 160px;
  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);
}

.gender-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.gender-card {
  padding: 0.75rem 1rem;
  background: var(--bgSurface);
  border: 1px solid var(--borderGothic);
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}
.gender-card h4 {
  font-family: var(--fontHeading);
  font-size: 1rem;
  color: var(--textPrimary);
  margin: 0;
}
.gender-card:hover, .gender-card.selected {
  border-color: var(--accentGold);
  background: rgba(212, 175, 55, 0.12);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
  transform: translateY(-2px);
}
.gender-card.selected h4 {
  color: var(--accentGold);
}

.gender-detail {
  padding: 1rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--borderGothic);
  border-radius: 4px;
  min-height: 80px;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 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);
}
.deity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.deity-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;
}
.deity-card h4 {
  font-family: var(--fontHeading);
  color: var(--textPrimary);
  margin-bottom: 0.3rem;
}
.deity-card .deity-portfolio {
  font-size: 0.75rem;
  color: var(--textMuted);
  display: block;
}
.deity-card:hover, .deity-card.selected {
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
  transform: translateY(-2px);
}
.deity-card.selected h4 {
  color: #00ffff;
}
.deity-detail {
  margin-top: 1.25rem;
  padding: 1.25rem;
  background: rgba(10, 12, 16, 0.85);
  border: 1px solid var(--borderGothic);
  border-left: 4px solid #00ffff;
  border-radius: 4px;
}
.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;
}

/* ═══════════════════════════════════════
   QUEST JOURNAL PANEL
   ═══════════════════════════════════════ */
.quest-journal {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 300px;
  overflow-y: auto;
}

.quest-empty {
  color: var(--textMuted);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
  font-style: italic;
}

.quest-section-header {
  font-size: 0.75rem;
  color: var(--accentGold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  margin-top: 0.5rem;
}

.quest-section-done {
  color: var(--textMuted);
  border-bottom-color: rgba(150, 150, 150, 0.2);
}

.quest-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-left: 3px solid var(--accentGold);
  border-radius: 3px;
  padding: 0.5rem;
  transition: border-color 0.2s;
}

.quest-card:hover {
  border-color: rgba(212, 175, 55, 0.4);
}

.quest-card-done {
  border-left-color: var(--textMuted);
  opacity: 0.6;
}

.quest-name {
  font-size: 0.85rem;
  color: var(--accentGold);
  font-family: var(--fontHeading);
  margin-bottom: 0.25rem;
}

.quest-name.quest-ready {
  color: #7fff7f;
  animation: quest-pulse 1.5s ease-in-out infinite;
}

@keyframes quest-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.quest-name-done {
  font-size: 0.8rem;
  color: var(--textMuted);
}

.quest-desc {
  font-size: 0.75rem;
  color: var(--textMuted);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.quest-progress-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.quest-bar-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8B6914, var(--accentGold));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.quest-progress-label {
  font-size: 0.7rem;
  color: var(--textMuted);
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.quest-rewards {
  font-size: 0.72rem;
  color: #a0a090;
}

/* ═══════════════════════════════════════
   EQUIPMENT RARITY COLORS
   ═══════════════════════════════════════ */
.rarity-common  { color: #bbb; }
.rarity-magic   { color: #6699ff; }
.rarity-rare    { color: #ffdd44; }
.rarity-epic    { color: #dd88ff; }
.rarity-legendary { color: #ff8c00; text-shadow: 0 0 8px #ff8c00; }

/* ═══════════════════════════════════════
   RACE CHARACTER CREATION PORTRAITS
   ═══════════════════════════════════════ */
.race-portraits {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  gap: 2rem;
  margin: 1.2rem 0;
  padding: 1.2rem 1.5rem 0.6rem;
  background: radial-gradient(ellipse at center bottom, rgba(212, 175, 55, 0.15) 0%, rgba(0, 0, 0, 0.35) 70%, transparent 100%);
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 8px;
  position: relative;
}

.race-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.race-portrait-img {
  height: 160px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  border: none !important;
  background: transparent !important;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 15px rgba(212, 175, 55, 0.25));
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
}

.race-portrait-img:hover {
  transform: translateY(-6px) scale(1.06);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 1)) drop-shadow(0 0 25px rgba(212, 175, 55, 0.6)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

.race-portrait span {
  font-size: 0.8rem;
  color: var(--accentGold);
  font-family: var(--fontHeading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.5);
  padding: 0.2rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.25);
}

/* ═══════════════════════════════════════
   DEITY PORTRAITS
   ═══════════════════════════════════════ */
.deity-portrait-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  padding: 1.2rem 1.5rem 0.6rem;
  background: radial-gradient(ellipse at center bottom, rgba(0, 220, 255, 0.15) 0%, rgba(0, 0, 0, 0.35) 70%, transparent 100%);
  border-bottom: 1px solid rgba(0, 220, 255, 0.25);
  border-top: 1px solid rgba(0, 220, 255, 0.15);
  border-radius: 8px;
}

.deity-portrait-img {
  height: 160px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  border: none !important;
  background: transparent !important;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 18px rgba(0, 220, 255, 0.3));
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
}

.deity-portrait-img:hover {
  transform: translateY(-6px) scale(1.06);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 1)) drop-shadow(0 0 25px rgba(0, 220, 255, 0.6)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

/* ═══════════════════════════════════════
   THEMED FANTASY PROFILE FRAME
   ═══════════════════════════════════════ */
.fantasy-profile-frame {
  position: relative;
  width: 150px;
  height: 150px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: url('/img/frame_profile.png') no-repeat center center / contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 15px rgba(0, 220, 255, 0.25));
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fantasy-profile-frame:hover {
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 25px rgba(0, 220, 255, 0.55));
  transform: scale(1.04);
}

.fantasy-profile-frame img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  border-radius: 4px;
}

/* ═══════════════════════════════════════
   INTERACTIVE HELP COMPENDIUM MODAL
   ═══════════════════════════════════════ */
.btn-compendium-trigger {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--accentGold);
  color: var(--accentGold);
  font-family: var(--fontHeading);
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-compendium-trigger:hover {
  background: rgba(212, 175, 55, 0.35);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.compendium-modal {
  max-width: 1120px;
  width: 92vw;
  height: 88vh;
  max-height: 88vh;
  background: rgba(12, 14, 18, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--borderGothic);
  border-top: 3px solid var(--accentGold);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
  padding: 1.5rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.compendium-header {
  flex-shrink: 0;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 0.75rem;
}

.compendium-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.compendium-header-icon {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4));
}

.compendium-title {
  font-family: var(--fontHeading);
  color: var(--accentGold);
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

.compendium-subtitle {
  font-family: var(--fontLore);
  color: var(--textMuted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
  font-style: italic;
}

/* Search Controls */
.compendium-controls {
  flex-shrink: 0;
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.compendium-search-wrap {
  flex: 1;
  min-width: 260px;
  position: relative;
  display: flex;
  align-items: center;
}

.compendium-search-wrap .search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--textMuted);
  pointer-events: none;
  font-size: 0.9rem;
}

.compendium-search-wrap input {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--borderGothic);
  color: var(--textPrimary);
  padding: 0.55rem 0.75rem 0.55rem 2.2rem;
  font-family: var(--fontMono);
  font-size: 0.88rem;
  border-radius: 4px;
  outline: none;
}

.compendium-search-wrap input:focus {
  border-color: var(--accentGold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.compendium-class-filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.compendium-class-filter-wrap label {
  font-family: var(--fontHeading);
  color: var(--accentGold);
  font-size: 0.82rem;
}

.compendium-class-filter-wrap select {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--borderGothic);
  color: var(--textPrimary);
  padding: 0.5rem 0.75rem;
  font-family: var(--fontHeading);
  font-size: 0.85rem;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

/* Category Tabs - Clean Wrap Grid */
.compendium-tabs {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.compendium-tab-btn {
  background: rgba(18, 22, 28, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--textMuted);
  font-family: var(--fontHeading);
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 1 auto;
}

.compendium-tab-btn:hover {
  color: var(--textPrimary);
  border-color: var(--accentGold);
  background: rgba(212, 175, 55, 0.1);
}

.compendium-tab-btn.active {
  background: rgba(212, 175, 55, 0.22);
  color: var(--accentGold);
  border-color: var(--accentGold);
  font-weight: bold;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

/* Distinct Staff Tabs styling */
.compendium-tab-btn.staff-tab {
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(30, 15, 45, 0.6);
  color: #d8b4fe;
}

.compendium-tab-btn.staff-tab:hover {
  border-color: #c084fc;
  background: rgba(168, 85, 247, 0.2);
  color: #fff;
}

.compendium-tab-btn.staff-tab.active {
  background: rgba(168, 85, 247, 0.3);
  border-color: #c084fc;
  color: #f3e8ff;
  font-weight: bold;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

/* Cards List — Scrollable Container */
.compendium-cards {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.5rem;
}

.compendium-cards::-webkit-scrollbar {
  width: 8px;
}

.compendium-cards::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
}

.compendium-cards::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.5);
}

.compendium-cards::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.65);
}

.compendium-card {
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.compendium-card:hover {
  border-color: rgba(212, 175, 55, 0.5);
}

.card-header {
  padding: 0.75rem 1rem;
  background: rgba(20, 25, 32, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-title {
  font-family: var(--fontHeading);
  color: var(--accentGold);
  font-size: 0.95rem;
  margin: 0;
}

.card-badges {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-family: var(--fontMono);
}

.badge-unlocked {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.badge-lock {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-class {
  background: rgba(0, 220, 255, 0.12);
  color: var(--accentCyan);
  border: 1px solid rgba(0, 220, 255, 0.3);
}

.badge-staff {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.card-arrow {
  color: var(--textMuted);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.compendium-card.expanded .card-arrow {
  transform: rotate(180deg);
  color: var(--accentGold);
}

.card-body {
  display: none;
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 12, 16, 0.7);
  font-size: 0.85rem;
  line-height: 1.5;
}

.compendium-card.expanded .card-body {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

.info-row {
  margin-bottom: 0.4rem;
}

.info-row code {
  background: rgba(0, 0, 0, 0.6);
  color: var(--accentGold);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  font-family: var(--fontMono);
}

.highlight-cyan {
  color: var(--accentCyan);
  font-family: var(--fontMono);
}

.info-desc {
  color: var(--textPrimary);
  margin-top: 0.4rem;
}

.info-mechanics {
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border-left: 3px solid var(--accentCyan);
  color: #cbd5e1;
  font-size: 0.82rem;
  border-radius: 0 4px 4px 0;
}

.compendium-footer {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.compendium-footer .hint-text {
  font-size: 0.78rem;
  color: var(--textMuted);
}

.compendium-footer kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: var(--fontMono);
  color: var(--accentGold);
}

.compendium-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--textMuted);
}

.compendium-empty .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN WEBGUI CENTER TERMINAL PANEL LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.panel-terminal {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: var(--bgPanel);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(12, 14, 18, 0.95);
  border-bottom: 1px solid var(--borderGothic);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 10;
  flex-shrink: 0;
}

.room-name {
  font-family: var(--fontHeading);
  font-size: 1.15rem;
  color: var(--accentGold);
  letter-spacing: 0.05em;
}

.zone-name {
  font-family: var(--fontLore);
  font-size: 0.85rem;
  color: var(--accentAurora);
  font-style: italic;
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-family: var(--fontMono);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--textPrimary);
  word-break: break-word;
  white-space: pre-wrap;
  scrollbar-width: thin;
  position: relative;
}

.input-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.85rem;
  background: rgba(10, 12, 16, 0.95);
  border-top: 1px solid var(--borderGothic);
  flex-shrink: 0;
  z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AETHELGAARD — FANTASY AMBIENT MUSIC PLAYER STYLES
   Gothic dark fantasy aesthetic with gold accents, track artwork, glassmorphism
   ═══════════════════════════════════════════════════════════════════════════ */

.fantasy-music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Cinzel', serif;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Collapsed Floating Trigger Pill */
.fmp-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 18, 28, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #d4af37;
  padding: 8px 16px;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.2);
  transition: all 0.25s ease;
}

.fmp-toggle-btn:hover {
  background: rgba(24, 28, 44, 0.95);
  border-color: #f3e5ab;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8), 0 0 18px rgba(212, 175, 55, 0.4);
  transform: translateY(-2px);
}

.fmp-disc-icon {
  font-size: 1.1rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.fmp-disc-icon.spinning {
  animation: fmp-spin 4s linear infinite;
}

@keyframes fmp-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fmp-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Player Box Container */
.fmp-box {
  width: 320px;
  background: linear-gradient(145deg, rgba(14, 17, 26, 0.95), rgba(8, 10, 16, 0.98));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(212, 175, 55, 0.6);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), inset 0 0 15px rgba(212, 175, 55, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 1;
  transform: scale(1) translateY(0);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Collapsed State */
.fantasy-music-player.collapsed .fmp-box {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85) translateY(20px);
  position: absolute;
  bottom: 0;
  right: 0;
}

.fantasy-music-player.collapsed .fmp-toggle-btn {
  display: flex;
}

.fantasy-music-player:not(.collapsed) .fmp-toggle-btn {
  display: none;
}

/* Header & Artwork */
.fmp-header {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.fmp-artwork {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.fmp-meta {
  flex: 1;
  min-width: 0;
}

.fmp-header-subtitle {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: rgba(212, 175, 55, 0.8);
  font-weight: 600;
}

.fmp-track-title {
  font-size: 0.85rem;
  color: #f1f5f9;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.fmp-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.fmp-close-btn:hover {
  color: #d4af37;
}

/* Track Selector */
.fmp-select {
  width: 100%;
  background: rgba(20, 24, 38, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #cbd5e1;
  padding: 5px 8px;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
}

.fmp-select:focus {
  border-color: #d4af37;
}

/* Progress Bar */
.fmp-progress-container {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  margin-top: 2px;
}

.fmp-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37, #f3e5ab);
  border-radius: 3px;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
  transition: width 0.1s linear;
}

.fmp-time-display {
  display: flex;
  justify-content: space-between;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Controls */
.fmp-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
}

.fmp-btn {
  background: rgba(30, 36, 56, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #e2e8f0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.fmp-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: #d4af37;
  transform: scale(1.08);
}

.fmp-btn-main {
  width: 38px;
  height: 38px;
  font-size: 1rem;
  background: rgba(212, 175, 55, 0.2);
  border-color: #d4af37;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.fmp-btn-main:hover {
  background: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

.fmp-btn-sub.active {
  background: rgba(212, 175, 55, 0.3);
  border-color: #d4af37;
}

/* Volume Wrap */
.fmp-volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 18, 28, 0.5);
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fmp-vol-icon {
  font-size: 0.75rem;
}

.fmp-vol-slider {
  width: 55px;
  accent-color: #d4af37;
  cursor: pointer;
}
