* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
html {
  height: 100%;
  margin: 0;
  font-family: 'Arial', sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(to bottom, #0b132b, #1c2541);
  background-attachment: fixed;
  background-size: cover;
  background-repeat: no-repeat;
  color: #fff;
}

.container {
  width: calc(100%-250);
  max-width: 800px;
  margin-top: 20px;

  text-align: center;
}

#instructions {
  position: fixed;
  top: 140px;
  left: 20px;
  width: 250px;
  background-color: #1c1f33;
  border: 1px solid #3a506b;
  border-radius: 8px;
  padding: 15px;
  color: #c0d6df;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

#instructions h4 {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 10px;
  text-transform: uppercase;
}

#instructions ul {
  list-style: disc;
  padding-left: 20px;
}

#instructions li {
  margin-bottom: 8px;
  line-height: 1.5;
  font-size: 0.9rem;
}

#initiative-list {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  border: 2px solid #3a506b;
  box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  overflow: hidden;
  background: #1b1f38;
}

#initiative-list th,
#initiative-list td {
  padding: 15px;
  text-align: center;
  vertical-align: middle;
  border: 2px solid #2f3b4c;
}

#initiative-list th {
  background: linear-gradient(to bottom, #3a506b, #5bc0be);
  color: #fff;
  font-weight: bold;
  font-size: 1.2rem;
  text-transform: uppercase;
}

#initiative-list td {
  background: #1c1f33;
  color: #c0d6df;
}

#initiative-list tbody tr:hover {
  background: rgba(91, 192, 190, 0.2);
  transition: background-color 0.3s ease;
}

[contenteditable="true"] {
  cursor: text;
  outline: none;
  color: #fff;
  font-size: 1.3rem;
  font-weight: bold;
  text-align: center;
  padding: 8px;
  border: 2px solid #5bc0be;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  position: relative;
}

[contenteditable="true"]:focus {
  background-color: #3a3f5c;
  box-shadow: 0 4px 10px rgba(108, 99, 255, 0.5);
  cursor: text;
  caret-color: #fff;
  transform: scale(1.07);
}

[contenteditable][data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #aaa;    
    font-size: 0.9rem;
    font-style: italic;
    font-weight: normal;
    text-shadow: none;
    pointer-events: none;
}

.hit-points {
  border: 2px solid #6c63ff;
  padding: 5px;
  border-radius: 5px;
  min-width: 40px;
  text-align: center;
  background-color: #1c1f33;
  color: #fff;
}

.max-hit-points {
  border: 2px solid #9f96aa;
  padding: 5px;
  border-radius: 5px;
  min-width: 40px;
  text-align: center;
  background-color: #1c1f33;
  color: #fff;
}

.damage-value {
  border: 2px solid #ff6347;
  padding: 5px;
  border-radius: 5px;
  background-color: #1c1f33;
  color: #fff;
}

.increase-btn,
.decrease-btn,
.stun-btn,
.delete-btn {
  text-shadow: 1px 1px 0 black;
  padding: 5px 12px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
  margin: 5px;
}

.increase-btn {
  background: #17d9a7;
}

.decrease-btn {
  background: #ff5376;
}

.stun-btn {
  margin-top: 0.6rem;
  padding: 10px 12px;
  background: #6c63ff;
}

.delete-btn {
  padding: 22px 12px;
  background: #ff2e63;
}

.increase-btn:hover {
  background: #13b889;
  box-shadow: 0px 6px 12px rgba(23, 217, 167, 0.5);
}

.decrease-btn:hover {
  background: #d92f4d;
  box-shadow: 0px 6px 12px rgba(255, 83, 118, 0.5);
}

.stun-btn:hover {
  background: #5145d3;
  box-shadow: 0px 6px 12px rgba(108, 99, 255, 0.5);
}

.delete-btn:hover {
  background: #c12751;
  box-shadow: 0px 6px 12px rgba(255, 46, 99, 0.5);
}

.damage-btn,
.heal-btn {
  text-shadow: 1px 1px 0 black;
  padding: 5px 12px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
  margin: 5px;
}

.heal-btn {
  background: #17d9a7;
}

.damage-btn {
  background: #ff5376;
}

.heal-btn:hover {
  background: #13b889;
  box-shadow: 0px 6px 12px rgba(23, 217, 167, 0.5);
}

.damage-btn:hover {
  background: #d92f4d;
  box-shadow: 0px 6px 12px rgba(255, 83, 118, 0.5);
}

#initiative-list .initiative-cell.highlight {
  background: linear-gradient(to right, #6c63ff, #3a506b);
  color: #fff;
  transition: background 0.3s ease, color 0.3s ease;
}

#next-turn-btn {
  text-shadow: 1px 1px 0 black;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(to right, #6c63ff, #17d9a7);
  border: none;
  border-radius: 8px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.5);
}

#add-combatant-btn {
  text-shadow: 1px 1px 0 black;
  margin-top: 10px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(to right, #6c63ff, #17d9a7);
  border: none;
  border-radius: 8px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.5);
}

#add-combatant-btn:hover,
#next-turn-btn:hover {
  background: linear-gradient(to right, #5145d3, #13b889);
  box-shadow: 0px 8px 20px rgba(108, 99, 255, 0.6);
}

#clear-all-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(to right, #ff5376, #ff2e63);
  border: none;
  border-radius: 8px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.5);
}

#clear-all-btn:hover {
  background: linear-gradient(to right, #d92f4d, #c12751);
  box-shadow: 0px 8px 20px rgba(255, 83, 118, 0.6);
}

#clear-all-btn,
#delete-all-btn {
  text-shadow: 1px 1px 0 black;
  display: block;
  margin-top: 3rem;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(to right, #ff5376, #ff2e63);
  border: none;
  border-radius: 8px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.5);
}

#clear-all-btn:hover,
#delete-all-btn:hover {
  background: linear-gradient(to right, #d92f4d, #c12751);
  box-shadow: 0px 8px 20px rgba(255, 83, 118, 0.6);
}

#initiative-list .initiative-cell.incapacitated {
  background: linear-gradient(to right, #ff2e63, #ff5376);
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  transition: background 0.3s ease, color 0.3s ease;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: #1c1f33;
  border: 1px solid #3a506b;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.7);
  color: #c0d6df;
}

.modal.hidden {
  display: none;
}

.modal-content label {
  display: block;
  margin: 10px 0;
}

.modal-content input {
  margin-left: 10px;
  padding: 5px;
  border: 1px solid #3a506b;
  border-radius: 5px;
}

#mass-add-btn {
  text-shadow: 1px 1px 0 black;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(to right, #6c63ff, #17d9a7);
  border: none;
  border-radius: 8px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.5);
}

#mass-add-btn:hover {
  background: linear-gradient(to right, #5145d3, #13b889);
  box-shadow: 0px 8px 20px rgba(108, 99, 255, 0.6);
}

#mass-add-submit-btn,
#mass-add-cancel-btn {
  margin: 10px 5px;
  padding: 10px 20px;
  background: #5bc0be;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

#mass-add-cancel-btn {
  background: #ff2e63;
}

#sticky-bar {
  position: sticky;
  top: 0;
  height: 100px;
  z-index: 1000;
  background: #1c1f33;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #3a506b;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.5);
}

#sticky-bar span {
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
}

#close-instructions-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff5376;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#close-instructions-btn:hover {
  background: #d92f4d;
  box-shadow: 0px 6px 12px rgba(255, 83, 118, 0.5);
}

.hit-points-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hp-separator {
  font-size: 1.3rem;
  font-weight: bold;
  color: #fff;
}

.hp-input {
  width: 115px;
  padding: 6px;
  text-align: center;
  border-radius: 5px;
  background-color: #2a2d43;
  color: #fff;
  border: 2px solid #6c63ff;
  font-size: 1.3rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: border-color 0.3s ease, background-color 0.3s ease;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hp-input::placeholder {
  color: #aaa;
  font-size: 0.9rem;
  font-style: italic;
  font-weight: normal;
  text-shadow: none;
}

.hp-input:focus {
  background-color: #3a3f5c;
  box-shadow: 0 4px 10px rgba(108, 99, 255, 0.5);
  outline: none;
}

.confirm-hp-btn {
  margin-top: 5px;
  padding: 5px 10px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  background: #6c63ff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.confirm-hp-btn:hover {
  background: #5145d3;
}

#help-btn {
  display: none;
  position: fixed;
  top: 200px;
  left: 20px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #6c63ff;
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

#help-btn:hover {
  background: #5145d3;
  box-shadow: 0px 6px 12px rgba(108, 99, 255, 0.5);
}

#reset-turn-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: white;
  margin-left: 8px;
  padding: 2px;
  transition: transform 0.2s ease;
}

#reset-turn-btn:hover {
  transform: rotate(180deg);
}

.reset-pressed {
  background-color: #ff5376 !important;
  transition: background-color 0.3s ease-in-out;
}

.action-btn {
  text-shadow: 1px 1px 0 black;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(to right, #6c63ff, #17d9a7);
  border: none;
  border-radius: 8px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.5);
}

.action-btn:hover {
  background: linear-gradient(to right, #5145d3, #13b889);
  box-shadow: 0px 8px 20px rgba(108, 99, 255, 0.6);
}

#player-list-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

.saved-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding: 10px;
  background: #2a2d4a;
  border-radius: 8px;
}

.saved-player-info {
  flex-grow: 1;
  color: #fff;
}

#player-list-close-btn {
  display: block;
  margin: 20px auto 0;
}

.delete-saved-player-btn {
  background: #ff2e63;
  color: white;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
}

.delete-saved-player-btn:hover {
  background: #d92f4d;
  box-shadow: 0px 6px 12px rgba(255, 83, 118, 0.5);
}

.load-player-btn {
  padding: 8px 16px;
  background: #17d9a7;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
}

.load-player-btn:hover {
  background: #13b889;
  box-shadow: 0px 6px 12px rgba(23, 217, 167, 0.5);
}

.save-player-btn {
  text-shadow: 1px 1px 0 black;
  padding: 18px 10px;
  font-size: 0.9rem;
  font-weight: bold;
  color: #fff;
  background: #17d9a7;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
  margin: 5px;
  width: 80%;
}

.save-player-btn:hover {
  background: #13b889;
  box-shadow: 0px 6px 12px rgba(23, 217, 167, 0.5);
}

.save-player-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
  box-shadow: none;
}

.save-player-btn:disabled:hover {
  background: #6c63ff;
  box-shadow: none;
}

#player-list-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  background: #1c1f33;
  border: 1px solid #3a506b;
  border-radius: 10px;
  padding: 20px;
  min-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.7);
}

.saved-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  padding: 10px;
  background: #2a2d4a;
  border-radius: 8px;
}

.saved-player-info {
  flex-grow: 1;
  color: #fff;
}

#player-list-close-btn {
  display: block;
  margin: 20px auto 0;
}

.modal.hidden {
  display: none;
}

.save-to-list-btn {
  margin-top: 5px;
  margin-bottom: 5px;
  padding: 5px 10px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.save-to-list-btn:hover {
  background: #45a049;
}

.reset-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 10px;
}

.reset-text {
  color: #c0d6df;
  font-size: 10px;
  margin-left: 8px;
}
