:root {
    --navbar-height: 56px;
}

/* Full-screen mood image for login, register, character creation */
body.auth-mood-bg {
    background-color: #0a0f1a;
    position: relative;
}

body.auth-mood-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("mood_bg_roof.8b33a30aa8f9.jpg");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.55;
}

body.auth-mood-bg > main {
    position: relative;
    z-index: 1;
}

body {
    /* text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5); */
}

.nav-character-progress {
  min-width: 4rem;
}

.has-nav main {
  padding-top: var(--navbar-height);
}

main::before {
    content: '';
    position: fixed;
    inset: 0;
    box-shadow: inset 0 0 5rem rgba(0, 0, 0, .5);
    pointer-events: none;
    z-index: 1025; /* below Bootstrap's fixed navbar (1030) so nav dropdowns render on top */
}

.has-nav main::before {
    inset: var(--navbar-height) 0 0 0;
}

.bottom-nav-bar {
  z-index: 1030;
  min-height: var(--navbar-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.has-bottom-nav main::before {
  inset: var(--navbar-height) 0 var(--navbar-height) 0;
}

/* Full-bleed location backdrop (below fixed navbar; content stacks above) */
@keyframes fade-in-animation {
  from {
      opacity: 0;
  }
  to {
      opacity: 1;
  }
}

.world-node-bg {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  bottom: var(--navbar-height);
  z-index: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  animation: fade-in-animation 1s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .world-node-bg {
      animation: none;
      opacity: 1;
  }
  .world-overlay {
    animation: none;
    opacity: 1;
  }
}

.world-node-content {
  position: relative;
  z-index: 1;
  /* Space for fixed bottom nav bar on location page */
  padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
}

/* World shell overlay — covers node content between top and bottom bars */
.world-overlay {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  bottom: var(--navbar-height);
  z-index: 10;
  overflow-y: auto;
  animation: fade-in-animation 0.3s ease-out forwards;
}

/* Cytoscape world map (overlay fragment) */
.world-map-cy {
  touch-action: none;
}

.world-overlay > #overlay-body {
  min-height: 100%;
}

.world-map-overlay .world-map-cy {
  flex: 1 1 auto;
  min-height: 0;
}

#django-messages {
  position: relative;
  z-index: 2;
}

.text-purple {
  color: var(--bs-purple);
}

.text-orange{
  color: var(--bs-orange);
}

/* Rarity border colors — suffix matches Rarity.value (e.g. rarity-common) */
.rarity-common    { border-color: rgba(255, 255, 255, 0.65) !important; }
.rarity-uncommon  { border-color: var(--bs-success) !important; }
.rarity-rare      { border-color: var(--bs-primary) !important; }
.rarity-epic      { border-color: #a855f7 !important; }
.rarity-legendary { border-color: var(--bs-warning) !important; }

/* Item shop table rows — clickable for buy/sell */
tr[data-sell-url],
tr[data-buy-url] {
  cursor: pointer;
}

/* Unaffordable shop items — not clickable */
tr.item-shop-unaffordable {
  cursor: default;
  opacity: 0.85;
}

/* Wider dropdown for equip picker (item squares) */
.dropdown-menu-equip-picker {
  min-width: 200px;
}

/* Item square — fixed-size tile; layout/positioning via Bootstrap utilities */
.item-square {
    width: 50px;
    height: 50px;
    border-color: rgba(255, 255, 255, 0.15);
    border-style: solid;
}

.item-square .item-icon-weapon {
    max-width: 45px;
    max-height: 45px;
    object-fit: contain;
}

/* Talisman slot-specific corner radius — visual cue for slot position (1–6 in 2x3 grid) */
.item-square.talisman-slot-1 { border-radius: 1.6rem 0.25rem 0.25rem 0.25rem; }
.item-square.talisman-slot-2 { border-radius: 1.6rem 1.6rem 0.25rem 0.25rem; }
.item-square.talisman-slot-3 { border-radius: 0.25rem 1.6rem 0.25rem 0.25rem; }
.item-square.talisman-slot-4 { border-radius: 0.25rem 0.25rem 0.25rem 1.6rem; }
.item-square.talisman-slot-5 { border-radius: 0.25rem 0.25rem 1.6rem 1.6rem; }
.item-square.talisman-slot-6 { border-radius: 0.25rem 0.25rem 1.6rem 0.25rem; }

#battle-log {
  max-height: 8rem;
  overflow-y: auto;
}

/* Floating combat cues (damage/heal/barrier/keywords on combatant cards) */
/* Above main::before vignette (z-index 1025) so floaters stay visible */
.combatant-cue-host {
  z-index: 1035;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.25rem;
}

.combat-cue-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
  margin-bottom: 0.1rem;
  animation: combatCueFloat 3.15s ease-out forwards;
}

@keyframes combatCueFloat {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-2.75rem);
  }
}

.ability-category.active {
  background-color: var(--bs-secondary-bg) !important;
  border-color: var(--bs-secondary-bg) !important;
}