body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: inherit; /* <— new: inherit from body */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed; /* optional */
  opacity: 0.25;
  pointer-events: none;
}
video#bgvid {
  position: fixed;
  inset: 0;
  object-fit: cover;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  /* opacity: 0.25; */
  pointer-events: none;
}
#bgimg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  z-index: -2;
  pointer-events: none;
  display: none;
}
body {
  margin: 0;
  font-family: sans-serif;
  background: #1c1c1c;
  color: white;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
#initiative-bar {
  display: flex;
  align-items: end;
  padding-block: 0.75rem;
  padding-inline: 2rem;
  background-color: #2a2a2a;
  gap: 1rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-padding-inline: 2rem;
  scroll-snap-type: x mandatory;
  box-sizing: border-box;
}
.combatant {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 190px;
  padding: 0.5rem 0.25rem;
  background: #333;
  border-radius: 10px;
  transition: box-shadow 0.3s, border-color 0.3s;
  border: 2px solid transparent;
  position: relative;
  cursor: grab;
  scroll-snap-align: start;
  flex-shrink: 0;
}
.portrait {
  width: 180px;
  height: 256px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.active {
  border-color: gold;
  box-shadow: 0 0 12px gold;
}
.name-label {
  font-size: 0.85rem;
  text-align: center;
  word-break: break-word;
  height: 3.3em;
  line-height: 1.1em;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-wrap: pretty;
}
.name-input {
  width: 100%;
  background: #222;
  border: 1px solid #444;
  color: white;
  padding: 2px 4px;
  font-size: 0.85rem;
  border-radius: 4px;
  text-align: center;
  height: 3.3em;
  line-height: 1.1em;
  overflow: hidden;
}
#controls {
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
button {
  background: #444;
  border: none;
  padding: 0.4rem 0.75rem;
  color: white;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
}
.remove-btn {
  position: absolute;
  top: 2px;
  right: 4px;
  background: #900;
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
  z-index: 2;
}
#dm-controls { display: none; }

input[type=number] {
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid #666;
  color: white;
  font-size: 0.85rem;
  text-align: center;
  width: 2.5em;
  padding: 0;
  margin: 0;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dropdown {
  display: inline-block;
  position: relative;
}

.dropbtn {
  background-color: #333;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #2a2a2a;
  min-width: 140px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.5);
  z-index: 1;
  border: 1px solid #444;
  border-radius: 6px;
}

.dropdown-content button {
  display: block;
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  color: white;
  text-align: left;
  cursor: pointer;
}

.dropdown-content button:hover {
  background-color: #444;
}

.dropdown.show .dropdown-content {
  display: block;
}


/*MODAL STYLE*/
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* semi-transparent dark backdrop */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* make sure it's on top */
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: rgba(0, 0, 0, 0.8); 
  color: #c0baba;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

.close-btn:hover {
  color: #000;
}
