/* Midnight Blue with Blue Accents and Red Death Save Fails */
:root {
  --accent: #3b82f6;           /* Subtle blue for general accents */
  --accent-light: #dbeafe;     /* Lighter blue for gradients */
  --accent-dark: #1e40af;      /* Darker blue for hover */
  --panel-bg: #232a3d;
  --input-bg: #1a2130;
  --input-border: #3b82f6;
  --success: #85b635;          /* Green for success */
  --fail: #ef4444;             /* Red for fail (death saves) */
}

body {
  font-family: 'Merriweather', 'Georgia', serif;
  margin: 20px;
  background: linear-gradient(135deg, #141a2e 0%, #232a3d 100%);
  color: #e0e6f0;
}

h2, h3, label, th, td, button {
  color: #e0e6f0;
  letter-spacing: 1px;
}

input, textarea, select {
  background: var(--input-bg);
  color: #e0e6f0;
  border: 2px solid var(--input-border);
  border-radius: 8px;
  padding: 7px;
  transition: border 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 4px #0a1a0e33;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 8px var(--accent);
}

button {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #232a3d;
  border: 2px solid var(--accent);
  border-radius: 8px;
  padding: 8px 18px;
  margin-top: 16px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px #0a1a0e33;
  transition: background 0.2s, border 0.2s, color 0.2s;
}

button:hover {
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: var(--panel-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px #0a1a0e33;
}

th, td {
  border: 1.5px solid var(--accent);
  padding: 12px;
  text-align: left;
  background: var(--panel-bg);
}

#statForm td, #statForm th {
  border-bottom: 1.5px solid var(--accent) !important;
}

.spell, .card, #inventoryList, #spellsList {
  background: var(--panel-bg);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
  box-shadow: 0 2px 8px #0a1a0e33;
}
 #notesList {
  background: var(--panel-bg);
  border-radius: 18px;
  /* padding: 18px; */
  margin-top: 18px;
  box-shadow: 0 4px 24px #0a1a0e33;
 }

/* Death Save Boxes: blue border by default, green for success, red for fail */
.ds-box {
  width: 30px;
  height: 30px;
  border: 2px solid var(--accent);
  border-radius: 7px;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  cursor: pointer;
  transition: border 0.2s, background 0.2s, color 0.2s;
  user-select: none;
  box-shadow: 0 1px 4px #0a1a0e33;
}
.ds-box.checked-success {
  background: #1e2e1e;
  border-color: #fff;
  color: #ef4444; /* Red heart */
  box-shadow: 0 0 8px #fff8;
}
.ds-box.checked-fail {
  background: #2e1e1e;
  border-color: #ef4444;
  color: #fff; /* White skull */
  text-shadow: 0 0 2px #ef4444, 0 0 6px #ef4444;
}

.spell-slot-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #232a3d 100%);
  border: 2px solid #3b82f6;
  box-shadow: 0 2px 8px #1e40af44;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  font-size: 1.2em;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  position: relative;
}
.spell-slot-box.used {
  background: linear-gradient(135deg, #232a3d 60%, #1a2130 100%);
  border-color: #6b7280;
  opacity: 0.6;
}
.spell-slot-box::after {
  content: "";
  display: block;
  width: 70%;
  height: 30%;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  position: absolute;
  top: 4px;
  left: 6px;
  pointer-events: none;
}

.spell-slot-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #232a3d;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 8px #3b82f655;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  position: relative;
}
.spell-slot-circle.used {
  background: #1a2130;
  border-color: #1e40af;
  color: #3b82f6;
  opacity: 0.7;
}
.spell-slot-circle.used::after {
  content: "✖";
  color: #ef4444;
  font-size: 1.2em;
  position: absolute;
  left: 7px;
  top: 3px;
}

.spell-slot-pill {
  width: 40px;
  height: 22px;
  border-radius: 12px;
  background: #232a3d;
  border: 2px solid #3b82f6;
  box-shadow: inset 0 1px 4px #1e40af33;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  position: relative;
}
.spell-slot-pill.used {
  background: #3b82f6;
  color: #fff;
  border-color: #1e40af;
}
.spell-slot-pill.used::after {
  content: "✔";
  color: #fff;
  font-size: 1em;
  position: absolute;
  left: 12px;
  top: 2px;
}

.spell-slot-rune {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #232a3d;
  border: 2px solid #3b82f6;
  box-shadow: 0 0 10px #3b82f688;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  font-size: 1.3em;
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border 0.2s, color 0.2s;
  color: #3b82f6;
}
.spell-slot-rune::before {
  content: "ᚦ";
  font-family: 'serif';
  font-size: 1.1em;
  opacity: 0.3;
  color: #3b82f6;
  position: absolute;
}
.spell-slot-rune.used {
  background: #1e2e4a;
  border-color: #54a540;
  color: #ffe066;
}
.spell-slot-rune.used::before {
  content: "✶";
  font-size: 1.2em;
  opacity: 0.8;
  color: #22c55e; /* Green accent */
}

.spell-slot {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin: 0 4px;
  border-radius: 50%;
  background: #23243a;
  border: 2px solid #66d9ef;
  box-sizing: border-box;
  vertical-align: middle;
}
.spell-slot.used {
  background: #66d9ef;
  border-color: #66d9ef;
  opacity: 0.5;
}

.ds-progress-bar {
  width: 100px;
  height: 16px;
  background: #222;
  border: 2px solid #444;
  border-radius: 8px;
  margin: 4px 0;
  overflow: hidden;
}
.ds-progress-success {
  height: 100%;
  background: #2ecc40;
  transition: width 0.2s;
}
.ds-progress-fail {
  height: 100%;
  background: #c0392b;
  transition: width 0.2s;
}

.ds-icon-row {
  display: flex;
  gap: 6px;
}
.ds-icon {
  font-size: 1.5em;
  opacity: 0.32;
  margin: 0 3px;
  transition: opacity 0.2s, transform 0.15s, filter 0.2s;
  border-radius: 8px;
  padding: 2px 4px;
}
.ds-icon.filled {
  opacity: 1;
}
.ds-icon:hover {
  opacity: 0.75;
  transform: scale(1.1);
}

.ds-icon.success {
  filter: grayscale(0.3);
}

.ds-icon.success.filled {
  filter: grayscale(0) drop-shadow(0 0 6px #3b82f6aa);
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.ds-icon.fail {
  filter: grayscale(0.35);
}

.ds-icon.fail.filled {
  filter: grayscale(0) drop-shadow(0 0 6px #7f1d1daa);
  background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%);
}

.ds-dot-row {
  display: flex;
  gap: 8px;
}
.ds-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #444;
  border: 1px solid #888;
  cursor: pointer;
}
.ds-dot.filled {
  background: #2ecc40;
}
.ds-dot.fail {
  background: #c0392b;
}

.death-save-lock {
  pointer-events: none !important;
  opacity: 0.4 !important;
  filter: grayscale(0.8) blur(1px);
  user-select: none !important;
}

#deathSavesTitleBar.death-save-active {
  background: linear-gradient(90deg, #2a1a1d 0%, #232a3d 100%);
  border: 2px solid #ff2d55;
  border-radius: 12px;
  box-shadow: 0 0 14px #ff2d5566;
  padding: 8px 12px;
}

#deathSavesTitleBar.death-save-active > span {
  color: #ffb3c1;
  text-shadow: 0 0 8px #ff2d55aa;
}

#deathSavesTitleBar.death-save-active .ds-icon {
  opacity: 0.9;
}

#deathSavesTitleBar.death-save-active .ds-icon.filled {
  filter: drop-shadow(0 0 6px #ff2d5599);
}

#incapacitatedModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 9999;
  background: rgba(20,24,40,0.85);
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
#incapacitatedModal[style*="display: flex"] {
  display: flex !important;
  opacity: 1;
}

#deathModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.85);
  align-items: center; justify-content: center;
  z-index: 1000;
}
#deathModal .death-modal-content {
  background: linear-gradient(135deg, #2a1a1d 0%, #232a3d 100%);
  border: 4px solid #ff2d55;
  box-shadow: 0 0 32px 8px #ff2d5588, 0 0 0 4px #232a3d;
  padding: 44px 36px;
  border-radius: 22px;
  text-align: center;
  max-width: 95vw;
  min-width: 320px;
}
#deathModal h2 {
  color: #ff2d55;
  font-size: 2em;
  margin-bottom: 20px;
  text-shadow: 0 2px 12px #ff2d55cc, 0 0 2px #fff;
  letter-spacing: 1.5px;
}
#deathModal p {
  color: #fff;
  font-size: 1.15em;
  margin-bottom: 32px;
  text-shadow: 0 1px 8px #232a3d;
}
#deathModal .death-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 24px;
}

#deathModal button {
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  font-weight: bold;
  font-size: 1.15em;
  letter-spacing: 1px;
  cursor: pointer;
  transition: 
    background 0.2s, 
    color 0.2s, 
    border 0.2s, 
    box-shadow 0.2s, 
    transform 0.15s;
  box-shadow: 0 2px 12px #ff2d5522;
  outline: none;
}

#deathModal #reviveBtn {
  background: rgba(255,255,255,0.10);
  color: #ff2d55;
  border: 2.5px solid #ff2d55;
  box-shadow: 0 0 0 0 #ff2d55;
  backdrop-filter: blur(2px);
  text-shadow: 0 1px 8px #fff4;
}
#deathModal #reviveBtn:hover, #deathModal #reviveBtn:focus {
  background: #ff2d5522;
  color: #c00;
  border-color: #c00;
  box-shadow: 0 0 12px 2px #ff2d55aa;
  transform: translateY(-2px) scale(1.04);
}

#deathModal #confirmDeathBtn {
  background: linear-gradient(90deg, #ff2d55 60%, #c00 100%);
  color: rgba(255,255,255,0.22);
  border: 2.5px solid #ff2d55;
  box-shadow: 0 4px 16px #ff2d5555;
  text-shadow: 0 1px 8px #c004;
}
#deathModal #confirmDeathBtn:hover, #deathModal #confirmDeathBtn:focus {
  background: linear-gradient(90deg, #c00 60%, #ff2d55 100%);
  border-color: #c00;
  color: #ffffff;
  box-shadow: 0 0 18px 4px #ff2d55cc;
  transform: translateY(-2px) scale(1.07);
}

/* #TempHP {
  border: 2px solid #ff2d55;
  background: #2a1a1d;
  color: #fff;
} */
#takeDamageBtn {
  background: linear-gradient(90deg, #ff2d55 0%, #c0392b 100%);
  color: #fff;
  border: 2px solid #ff2d55;
  border-radius: 8px;
  padding: 6px 12px;   /* Smaller padding */
  font-weight: bold;
  font-size: 0.95em;   /* Smaller font */
  box-shadow: 0 2px 8px #ff2d5522;
  margin-left: 8px;
  margin-top: 0;
  letter-spacing: 1px;
  transition: background 0.2s, color 0.2s, border 0.2s, transform 0.15s;
}

#takeDamageBtn:hover, #takeDamageBtn:focus {
  background: linear-gradient(90deg, #c0392b 0%, #ff2d55 100%);
  color: #fff;
  border-color: #c0392b;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 12px 2px #ff2d55cc;
}

#weaponsList {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.weapon-card {
  background: #232a3d;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 0;
  width: 260px;      /* Fixed width for grid cards */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.weapon-card strong {
  font-size: 1.1em;
}
.weapon-card button {
  background: #ff2d55;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  margin-top: 6px;
  font-weight: bold;
  cursor: pointer;
  align-self: flex-end;
}

.weapon-card button:hover {
  background: #c0392b;
}

.section {
  border: 2px solid #3b82f6;
  border-radius: 14px;
  margin-bottom: 24px;
  background: #232a3d;
  box-shadow: 0 2px 12px #3b82f655;
  padding: 0;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #232a3d 80%, #3b82f6 100%);
  padding: 14px 20px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  color: #e0e6f0;
  border-bottom: 2px solid #3b82f6;
}

.section-content {
  padding: 18px 20px;
  display: block;
}
.section-collapsed .section-content {
  display: none;
}

.section-toggle-icon {
  font-size: 1.2em;
  margin-left: 12px;
}

.condition-btn {
  background: #232a3d;
  color: #e0e6f0;
  border: 2px solid #3b82f6;
  border-radius: 8px;
  padding: 6px 16px;
  margin: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, border 0.2s, color 0.2s;
  box-shadow: 0 1px 4px #0a1a0e33;
}
.condition-btn.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}
.condition-btn:hover {
  background: #1e253a;
  border-color: #1e40af;
  color: #fff;
}

.inspiration-btn {
  background: #232a3d;
  color: #e0e6f0;
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 6px 16px;
  margin: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, border 0.2s, color 0.2s;
  box-shadow: 0 1px 4px #0a1a0e33;
}

.inspiration-btn.active {
  background: #ffd700;
  color: #2a2b2c;
  border-color: #ffd700;
}
.inspiration-btn:hover {
  background: #fce66c;
  border-color: #fce66c;
  color: #2a2b2c;
}

.combat-grid-cell {
  width: 44px;
  height: 44px;
  background: #1e2540;
  border: 1px solid #3b82f622;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  color: #fff;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.combat-grid-cell:hover {
  background: #2a3356;
  border-color: #3b82f644;
}
.combat-grid-cell.selected {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
  background: #2a3356;
}
#combatGrid {
  background: transparent;
  border-radius: 0;
  padding: 0;
}
#deathSaveOverlay, #incapacitatedModal, #deathModal, #addCharacterModal, #gridPickerModal {
  display: none;
  pointer-events: none;
}
#deathSaveOverlay.active, #incapacitatedModal.active, #deathModal.active, #addCharacterModal.active, #gridPickerModal.active {
  display: flex;
  pointer-events: auto;
}

#gridPickerModal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 9999;
  background: rgba(14, 18, 32, 0.88);
  align-items: center;
  justify-content: center;
}

.picker-title {
  color: #93c5fd;
  margin: 0 0 14px;
  font-size: 1em;
  letter-spacing: 1px;
  text-align: center;
}

#pickerOptions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
  max-height: 200px;
  overflow-y: auto;
}

.picker-initials-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}
.picker-initials-row input {
  width: 60px;
  font-size: 1.1em;
  text-align: center;
  padding: 5px;
  text-transform: uppercase;
}

.picker-btn-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.picker-btn-row button {
  margin: 0;
  padding: 7px 14px;
  font-size: 0.85em;
  letter-spacing: 0;
}

.btn-move {
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
}
.btn-move:hover {
  background: linear-gradient(90deg, #1d4ed8 0%, #1e40af 100%) !important;
}

/* Active turn token glow on battle map */
.combat-grid-cell.active-turn {
  background: #252b1a;
  outline: 2px solid #ffd700;
  outline-offset: -2px;
  animation: active-turn-pulse 1.6s ease-in-out infinite;
}
@keyframes active-turn-pulse {
  0%, 100% { box-shadow: 0 0 6px #ffd70055; }
  50% { box-shadow: 0 0 18px #ffd700bb, inset 0 0 8px #ffd70022; }
}
.combat-grid-cell.active-turn.selected {
  outline-color: #3b82f6;
  animation: none;
}

.picker-icon.selected {
  border: 2px solid #3b82f6;
  border-radius: 8px;
  background: #232a3d;
  box-shadow: 0 0 8px #3b82f6;
}

.section-collapsed .combat-layout {
  display: none;
}

#deathModal,
#deathModal *,
#incapacitatedModal,
#incapacitatedModal * {
  pointer-events: auto !important;
  user-select: auto !important;
}

.inventory-item {
  display: flex;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #23243a;
}
.inventory-item span:first-child {
  flex: 1;
  font-weight: 500;
}
.inventory-item span:nth-child(2) {
  flex: 0 0 60px;
  text-align: center;
  color: #66d9ef;
}
.inventory-item span:nth-child(3) {
  flex: 2;
  color: #aaa;
  font-size: 0.95em;
  margin-left: 12px;
}
.inventory-item button.deleteInventoryBtn {
  background: #ff2d55;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 8px;
}

#addCharacterModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(20,24,40,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
#addCharacterModal .modal-content {
  background: #232a3d;
  border: 3px solid #3b82f6;
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 8px 32px #000a;
  text-align: center;
  max-width: 90vw;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.stat-block {
  background: var(--panel-bg, #232a3d);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px #0a1a0e33;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.stat-block label {
  font-weight: bold;
  margin-bottom: 4px;
}
.stat-block input[type="number"] {
  width: 100%;
  margin-bottom: 4px;
  box-sizing: border-box;
}
.stat-mod {
  font-size: 1.1em;
  font-weight: bold;
  color: #dbeafe;
}

/* ===== COMBAT SECTION REDESIGN ===== */

.combat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 820px) {
  .combat-layout {
    grid-template-columns: 1fr;
  }
}

.combat-panel {
  background: #1a2130;
  border: 1.5px solid #3b82f633;
  border-radius: 12px;
  overflow: hidden;
}

.combat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #1e253a 0%, #232a3d 100%);
  border-bottom: 1.5px solid #3b82f633;
  padding: 10px 14px;
  font-weight: bold;
  font-size: 0.95em;
  color: #93c5fd;
  letter-spacing: 0.5px;
  flex-wrap: wrap;
  gap: 8px;
}

.round-badge {
  background: #3b82f611;
  border: 1.5px solid #3b82f655;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.85em;
  color: #93c5fd;
  font-weight: bold;
  white-space: nowrap;
}

/* Initiative add form */
.initiative-add-form {
  display: flex;
  gap: 5px;
  padding: 10px 12px;
  border-bottom: 1px solid #3b82f618;
  flex-wrap: wrap;
  align-items: center;
}
.initiative-add-form input {
  margin: 0;
  padding: 5px 8px;
  font-size: 0.88em;
}
.initiative-add-form input[type="text"] {
  flex: 1;
  min-width: 70px;
}
.initiative-add-form input[type="number"] {
  width: 50px;
}
.initiative-add-form button {
  margin: 0;
  padding: 5px 10px;
  font-size: 0.85em;
  letter-spacing: 0;
}

/* Initiative controls bar */
.initiative-controls {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #3b82f618;
}
.initiative-controls button {
  margin: 0;
  padding: 6px 12px;
  font-size: 0.85em;
  letter-spacing: 0;
}
#nextTurnBtn {
  flex: 1;
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  border-color: #2563eb;
  color: #fff;
}
#nextTurnBtn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
#clearInitiativeBtn {
  background: #1a2130;
  border: 1.5px solid #ef444440;
  color: #ef4444;
  border-radius: 8px;
}
#clearInitiativeBtn:hover {
  background: #2a1a1d;
  border-color: #ef4444;
  color: #ef4444;
}

/* Initiative list */
#initiativeList {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 400px;
  overflow-y: auto;
}
.initiative-entry {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid #3b82f610;
  gap: 8px;
  transition: background 0.15s;
  position: relative;
}
.initiative-entry:last-child {
  border-bottom: none;
}
.initiative-entry:hover {
  background: #232a3d88;
}
.initiative-entry.active {
  background: linear-gradient(90deg, #3b82f618 0%, #1a2130 100%);
  border-left: 3px solid #3b82f6;
  padding-left: 11px;
}
.init-badge {
  background: #3b82f611;
  border: 1.5px solid #3b82f644;
  border-radius: 6px;
  color: #93c5fd;
  font-weight: bold;
  font-size: 0.95em;
  min-width: 34px;
  text-align: center;
  padding: 2px 6px;
  flex-shrink: 0;
}
.initiative-entry.active .init-badge {
  background: #3b82f622;
  border-color: #3b82f6;
  color: #60a5fa;
}
.init-name {
  flex: 1;
  font-weight: 600;
  color: #e0e6f0;
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.initiative-entry.active .init-name {
  color: #93c5fd;
}
.init-hp {
  color: #85b635;
  font-size: 0.85em;
  font-weight: bold;
  flex-shrink: 0;
}
.init-remove-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: #6b728066;
  cursor: pointer;
  font-size: 0.9em;
  padding: 0 3px;
  margin: 0 !important;
  margin-top: 0 !important;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}
.init-remove-btn:hover {
  color: #ef4444 !important;
  background: none !important;
  border: none !important;
}

.init-icon-btn {
  background: #1e2540;
  border: 1.5px solid #3b82f622;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15em;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0 !important;
  margin-top: 0 !important;
  padding: 0;
  transition: border-color 0.15s, background 0.15s;
  box-shadow: none !important;
  color: #e0e6f0;
  line-height: 1;
}
.init-icon-btn:hover {
  border-color: #3b82f655 !important;
  background: #252d44 !important;
  color: #e0e6f0 !important;
}
.initiative-entry.active .init-icon-btn {
  border-color: #ffd70044;
  background: #252318;
}
.init-empty {
  padding: 22px 14px;
  color: #6b7280;
  font-size: 0.88em;
  text-align: center;
  font-style: italic;
}

/* Battle Map panel */
.grid-controls-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.grid-controls-bar label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82em;
  color: #93c5fd;
}
.grid-controls-bar input[type="number"] {
  width: 42px;
  padding: 3px 5px;
  font-size: 0.85em;
  margin: 0;
}
.grid-controls-bar button {
  margin: 0;
  padding: 4px 10px;
  font-size: 0.8em;
  letter-spacing: 0;
}
.combat-grid-wrapper {
  padding: 10px 12px 14px;
  overflow-x: auto;
}

/* Grid coordinate labels */
.grid-col-labels {
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
}
.grid-corner {
  width: 22px;
  flex-shrink: 0;
}
.grid-col-label {
  width: 44px;
  text-align: center;
  font-size: 0.7em;
  color: #3b82f677;
  font-weight: bold;
  letter-spacing: 0;
  flex-shrink: 0;
}
.grid-row {
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
  align-items: center;
}
.grid-row-label {
  width: 22px;
  text-align: right;
  font-size: 0.7em;
  color: #3b82f677;
  font-weight: bold;
  padding-right: 4px;
  flex-shrink: 0;
}

/* Picker modal (cleaned up from inline styles) */
.picker-modal-inner {
  background: #232a3d;
  border: 2px solid #3b82f6;
  border-radius: 16px;
  padding: 24px 22px;
  box-shadow: 0 8px 32px #000c;
  text-align: center;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.picker-modal-inner input[type="text"] {
  font-size: 1.1em;
}
.picker-modal-inner button {
  margin: 0;
}

/* Utility button variants used in picker */
.btn-danger {
  background: linear-gradient(90deg, #ff2d55 0%, #c0392b 100%) !important;
  border-color: #ff2d55 !important;
  color: #fff !important;
}
.btn-danger:hover {
  background: linear-gradient(90deg, #c0392b 0%, #ff2d55 100%) !important;
}
.btn-neutral {
  background: #2d3148 !important;
  border-color: #444 !important;
  color: #e0e6f0 !important;
}
.btn-neutral:hover {
  background: #383f5a !important;
  color: #fff !important;
}

/* =====================================================================
   WEAPON CARDS
   ===================================================================== */
.weapon-no-weapons {
  color: #888;
  padding: 8px 4px;
  font-style: italic;
  font-size: 0.9em;
}
.weapon-card {
  background: #232a3d;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 0.92em;
}
.weapon-card strong {
  color: #d0ddf5;
  font-size: 1em;
}
.weapon-damage {
  color: #85b635;
  margin-left: 6px;
  font-weight: 600;
}
.weapon-card div {
  color: #8899bb;
  margin-top: 3px;
}
.weapon-card div span {
  color: #c0cde8;
}
.deleteWeaponBtn {
  background: #ff2d55;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  margin-top: 6px;
  cursor: pointer;
  font-size: 0.85em;
  transition: background 0.15s;
}
.deleteWeaponBtn:hover {
  background: #cc1a3e;
}
.token-initials {
  font-size: 0.65em;
  font-weight: bold;
  letter-spacing: -0.5px;
}

/* =====================================================================
   SPELL SLOTS — new pip layout
   ===================================================================== */
.slots-section {
  margin-bottom: 20px;
}
.slots-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.slots-controls button {
  padding: 6px 14px;
  border-radius: 8px;
  background: #2a2f4a;
  border: 1px solid #3b82f6;
  color: #a9c4f7;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.slots-controls button:hover {
  background: #3b82f6;
  color: #fff;
}

.slot-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slot-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.slot-level-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 70px;
}
.slot-level-num {
  font-size: 0.82em;
  color: #8899cc;
  font-weight: 600;
  white-space: nowrap;
}
.slot-remaining-badge {
  font-size: 0.75em;
  background: #1e3a5f;
  color: #66b2ff;
  border-radius: 20px;
  padding: 1px 7px;
  font-weight: 700;
  white-space: nowrap;
}
.slot-remaining-badge.depleted {
  background: #3a1a1a;
  color: #ff6b6b;
}
.slot-pips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.slot-pip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #3b82f6;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  padding: 0;
  flex-shrink: 0;
  position: relative;
}
.slot-pip:hover {
  background: rgba(59,130,246,0.25);
  transform: scale(1.15);
}
.slot-pip.used {
  background: #3b82f6;
  border-color: #2563eb;
}
.slot-pip.used::after {
  content: '×';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  line-height: 1;
  color: #fff;
  pointer-events: none;
}

/* =====================================================================
   SPELL LIST — vertical card layout
   ===================================================================== */
.spell-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.spell-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spell-toolbar input {
  width: 100%;
  max-width: 340px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #3b4a70;
  background: #1a1f35;
  color: #e0e6f0;
  font-size: 0.95em;
}
.spell-toolbar input:focus {
  outline: none;
  border-color: #3b82f6;
}
#spellLevelFilterBar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.spell-filter-btn {
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid #3b4a70;
  background: #1e2440;
  color: #8899cc;
  font-size: 0.82em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.spell-filter-btn:hover {
  border-color: #3b82f6;
  color: #c0d4ff;
}
.spell-filter-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  font-weight: 700;
}

/* Add-spell bar */
.spell-add-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.spell-add-toggle-btn {
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 8px;
  background: #1e2440;
  border: 1px dashed #3b82f6;
  color: #7aafff;
  font-size: 0.9em;
  cursor: pointer;
  transition: background 0.15s;
}
.spell-add-toggle-btn:hover { background: #263055; }
.spell-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.spell-add-form.hidden { display: none; }
.spell-add-form input {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #3b4a70;
  background: #1a1f35;
  color: #e0e6f0;
  font-size: 0.9em;
}
.spell-add-form input[type="number"] { width: 70px; }
.spell-add-form button {
  padding: 5px 14px;
  border-radius: 6px;
}

/* Spell list table layout */
.spell-list-header {
  display: grid;
  grid-template-columns: 28px 1fr 110px 80px;
  gap: 8px;
  padding: 5px 10px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #3d5080;
  border-bottom: 1px solid #1e2640;
  margin-bottom: 2px;
}
.slh-lv  { text-align: center; }
.slh-actions { text-align: right; }

.spell-row {
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  transition: background 0.1s;
}
.spell-row.alt .spell-row-main { background: #141929; }
.spell-row.alt .spell-row-main:hover { background: #1a2240; }
.spell-row.expanded { background: #101523; }
.spell-row.concentrating .spell-row-main {
  border-left: 2px solid #7c5cbf;
}

.spell-row-main {
  display: grid;
  grid-template-columns: 28px 1fr 110px 18px 80px;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
  border-radius: 6px;
}
.spell-row-main:hover { background: #1e2645; }

.spell-row-name {
  font-weight: 500;
  font-size: 0.93em;
  color: #c8d6f0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.spell-row-type {
  font-size: 0.75em;
  color: #5a7298;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spell-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.spell-cast-btn-placeholder {
  display: inline-block;
  width: 24px;
}

.spell-level-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2a4a8a;
  color: #7eb3ff;
  font-size: 0.78em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.spell-level-badge.cantrip {
  background: #2a3a6a;
  color: #a78bfa;
}
.spell-conc-dot {
  font-size: 0.68em;
  background: #3b1f6a;
  color: #c4a0ff;
  border-radius: 10px;
  padding: 2px 6px;
  font-weight: 700;
  flex-shrink: 0;
  text-align: center;
}
.spell-conc-dot.invisible {
  visibility: hidden;
}
.spell-prep-btn {
  background: none;
  border: none;
  color: #5570a0;
  font-size: 1em;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.spell-prep-btn:hover { color: #fbbf24; }
.spell-prep-btn.active { color: #fbbf24; }
.spell-cast-btn {
  background: none;
  border: none;
  font-size: 1em;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.spell-cast-btn:hover { opacity: 1; }
.spell-expand-arrow {
  color: #445577;
  font-size: 0.8em;
}

/* Spell expand panel */
.spell-expand-panel {
  border-top: 1px solid #1c2540;
  padding: 14px 14px 12px;
  background: #0f1322;
  border-radius: 0 0 8px 8px;
  margin: 0 2px 4px;
}
.spell-edit-form { width: 100%; }
.spell-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .spell-edit-grid { grid-template-columns: 1fr; }
}
.spell-edit-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spell-edit-col label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8em;
  color: #7a8aaa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.spell-edit-col input,
.spell-edit-col select,
.spell-edit-col textarea {
  background: #1a1f35;
  border: 1px solid #2d3a5a;
  border-radius: 6px;
  color: #d0ddf5;
  padding: 5px 9px;
  font-size: 0.92em;
  resize: vertical;
}
.spell-edit-col input:focus,
.spell-edit-col select:focus,
.spell-edit-col textarea:focus {
  outline: none;
  border-color: #3b82f6;
}
.spell-toggle-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-size: 0.85em !important;
  color: #c4a0ff !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.spell-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.spell-edit-actions button { flex: 1; min-width: 80px; }
.btn-cast {
  background: linear-gradient(90deg, #1a3a7a, #2a5acc) !important;
  border-color: #3b82f6 !important;
  color: #a9ccff !important;
}
.btn-cast:hover {
  background: linear-gradient(90deg, #2248aa, #3b6ee0) !important;
  color: #fff !important;
}

.spell-empty {
  color: #4a5a7a;
  padding: 24px;
  text-align: center;
  font-style: italic;
}

/* =====================================================================
   MODAL — generic overlay/panel classes
   ===================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-panel {
  background: #1a1f35;
  border: 1px solid #2d3a5a;
  border-radius: 14px;
  padding: 24px 28px 20px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
.modal-header { margin-bottom: 14px; }
.modal-title {
  font-size: 1.05em;
  font-weight: 700;
  color: #c0d4ff;
  margin: 0 0 2px 0;
}
.modal-subtitle {
  font-size: 0.82em;
  color: #5570a0;
}
.modal-hint {
  font-size: 0.78em;
  color: #4a5a78;
  margin-bottom: 10px;
}
.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}
.custom-slot-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.custom-slot-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.78em;
  color: #7a8aaa;
}
.custom-slot-input {
  width: 44px;
  text-align: center;
  padding: 5px 4px;
  border-radius: 6px;
  border: 1px solid #2d3a5a;
  background: #141929;
  color: #d0ddf5;
  font-size: 0.95em;
}
.custom-slot-input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* =====================================================================
   CAST TOAST
   ===================================================================== */
.cast-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1e2d50;
  color: #7aafff;
  border: 1px solid #3b82f6;
  border-radius: 24px;
  padding: 9px 22px;
  font-size: 0.92em;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 9999;
  white-space: nowrap;
}
.cast-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.cast-toast.error {
  background: #2d1a1a;
  color: #ff8a8a;
  border-color: #cc3333;
}

/* =====================================================================
   AUTH PAGES
   ===================================================================== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 560px);
  background: rgba(26, 33, 48, 0.94);
  border: 2px solid var(--accent);
  border-radius: 22px;
  padding: 32px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.auth-card.auth-card-narrow {
  width: min(100%, 520px);
}

.auth-eyebrow {
  margin: 0 0 8px;
  color: #9fbefc;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
}

.auth-copy {
  margin: 0;
  color: #d7e3fb;
  line-height: 1.6;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #172033;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.auth-button:hover {
  color: #fff;
  background: var(--accent-dark);
}

.auth-button.auth-button-secondary {
  background: transparent;
  color: #cfe0ff;
}

.auth-panel {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(159, 190, 252, 0.28);
}

.auth-panel-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.auth-list {
  margin: 0;
  padding-left: 18px;
  color: #d7e3fb;
  line-height: 1.6;
}

/* =====================================================================
   PHASE 3 STYLE HARDENING (replace template inline styles)
   ===================================================================== */
.ds-clickable { cursor: pointer; }

.note-card {
  margin-bottom: 18px;
  padding: 22px 18px 16px 28px;
  font-family: 'Pirata One', 'Segoe UI', serif;
  font-size: 1.08em;
  line-height: 1.7;
  background: #181926;
  border: 2px solid #c2b280;
  color: #f6e7c1;
  box-shadow: 0 4px 24px #23243a;
  border-radius: 18px;
  position: relative;
}
.note-edit-area {
  width: 96%;
  font-size: 1.08em;
  line-height: 1.6;
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px solid #c2b280;
  background: #23243a;
  color: #f6e7c1;
  margin-bottom: 10px;
  resize: vertical;
  box-shadow: 0 2px 8px #c2b28044 inset;
}
.note-actions-row { margin-top: 4px; }
.note-save-btn {
  margin-right: 8px;
  padding: 6px 16px;
  border-radius: 6px;
  background: #66d9ef;
  color: #23243a;
  border: none;
  font-weight: bold;
}
.note-delete-btn {
  padding: 6px 16px;
  border-radius: 6px;
  background: #3a3a3a;
  color: #ff6b6b;
  border: none;
  font-weight: bold;
}

.inventory-item-row {
  margin-bottom: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  background: linear-gradient(90deg,#232323 80%,#2d2d2d 100%);
  border: 1.5px solid #444;
  box-shadow: 0 2px 6px #181818;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.inventory-item-main { flex: 1; min-width: 120px; }
.inventory-item-name { color: #ffcc66; }
.inventory-item-desc { color: #bfc9d1; }
.inventory-item-tools { display: flex; align-items: center; gap: 6px; }
.inventory-item-qty-label { color: #66d9ef; }
.inventory-item-qty-input {
  width: 48px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #555;
  background: #292929;
  color: #eee;
}
.inventory-icon-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 1.2em;
  cursor: pointer;
}
.inventory-remove-btn { margin-left: 10px; }

.inventory-edit-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
}
.inventory-edit-name { flex: 0 0 1; min-width: 80px; }
.inventory-edit-qty { flex: 0 0 0.5; min-width: 50px; }
.inventory-edit-desc { flex: 2; min-width: 120px; resize: none; height: 40px; }
.inventory-edit-save { flex: 0 0 0.7; min-width: 80px; height: 40px; }

.add-char-inline-modal-content {
  background: #232a3d;
  border: 3px solid #3b82f6;
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
.add-char-inline-modal-input {
  margin-bottom: 12px;
  width: 80%;
  padding: 8px;
}
.add-char-inline-modal-confirm { margin-right: 8px; }

/* =====================================================================
   STATIC HTML STYLE MIGRATION (index.html)
   ===================================================================== */
.title-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.title-left { flex: 1; display: flex; align-items: center; }
.title-main { margin: 0; }
.title-deathsaves {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.title-deathsaves-label { font-weight: bold; margin-bottom: 4px; }
.title-deathsaves-boxes { display: flex; gap: 6px; }
.title-right { flex: 1; display: flex; align-items: center; justify-content: flex-end; }
.level-display { font-size: 1.1em; }
.title-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #eee;
  font-size: 1.2em;
  margin-left: 8px;
}
.title-edit-section {
  display: none;
  align-items: center;
  margin-bottom: 10px;
}
.tracker-title-input { font-size: 1.2em; width: 40%; }
.title-level-label { margin-left: 12px; color: #eee; }
.level-input { width: 60px; margin-left: 4px; }
.title-save-btn { margin-left: 8px; }
.title-cancel-btn { margin-left: 4px; }
.active-character {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.character-selector { margin-bottom: 12px; }
.character-selector-label { color: #eee; }
.new-char-input { display: none; margin-left: 8px; }
.new-char-btn { display: none; }

.char-info-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
}
.char-info-field { flex: 1; }
.char-info-save-btn { flex-basis: 100px; }

.stats-form { margin-bottom: 16px; }
.stats-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
}
.save-stats-btn { padding: 8px 24px; }
.damage-input-row { display: flex; gap: 8px; }
.damage-input { width: 100px; }

.add-weapon-form {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.weapon-field-120 { width: 120px; }
.weapon-field-90 { width: 90px; }
.weapon-field-80 { width: 80px; }

.add-item-form { display: flex; gap: 8px; align-items: flex-start; }
.item-name-field { flex: 0 0 1; min-width: 80px; }
.item-qty-field { flex: 0 0 0.5; min-width: 50px; }
.item-desc-field { flex: 2; min-width: 120px; resize: none; height: 40px; }
.add-item-btn { flex: 0 0 0.7; min-width: 80px; height: 40px; }

.new-note-textarea { width: 100%; }
.notes-scroll-window {
  max-height: 320px;
  overflow-y: auto;
  border-radius: 14px;
  box-shadow: 0 2px 12px #23243a44;
  background: transparent;
  margin-bottom: 16px;
}

.incapacitated-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: rgba(20,24,40,0.85);
  align-items: center;
  justify-content: center;
}
.incapacitated-modal-content {
  background: #232a3d;
  border: 3px solid #85b635;
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 8px 32px #000a;
  text-align: center;
  max-width: 90vw;
}
.incapacitated-modal-title { color: #85b635; margin-bottom: 18px; }
.incapacitated-modal-text { color: #e0e6f0; margin-bottom: 24px; }
.incapacitated-modal-btn {
  background: #85b635;
  color: #232a3d;
  font-size: 1.2em;
  padding: 10px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.add-character-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(20,24,40,0.85);
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.add-character-modal-content {
  background: #232a3d;
  border: 3px solid #3b82f6;
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 8px 32px #000a;
  text-align: center;
  max-width: 90vw;
}
.add-character-modal-title { color: #3b82f6; margin-bottom: 18px; }
.add-character-modal-text { color: #e0e6f0; margin-bottom: 24px; }
.new-char-modal-input {
  font-size: 1.2em;
  padding: 8px;
  border-radius: 8px;
  border: 2px solid #3b82f6;
  margin-bottom: 18px;
}
.confirm-add-char-modal-btn {
  background: #3b82f6;
  color: #232a3d;
  font-size: 1.2em;
  padding: 10px 32px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.picker-initials-label {
  color: #93c5fd;
  font-size: 0.85em;
}
