body {
  border: 10px solid black;
  padding: 10px;
}

.section {
  margin-bottom: 20px;
}

h2 {
  margin-bottom: 10px;
}

table {
  margin-top: 10px;
}

label {
  display: block;
  margin-bottom: 5px;
}

.character-info {
  margin-right: 20px;
}

#top-section {
  display: flex;
  gap: 20px;
}

#top-section > div {
  flex: 1;
}

#bottom-section {
  display: flex;
  gap: 20px;
  margin-top: 40px;
}

#bottom-section > div {
  flex: 1;
}

/* Hit points and related */
.hp-flex,
#ability-scores,
.skills-flex,
.initiative-proficiency-flex,
.class-level-flex {
  display: flex;
}

#hit-points-current {
  margin-right: 20px;
}

.square-input {
  width: 35px;
  height: 30px;
  text-align: center;
}

/* Ability scores spacing */
.ability-margin {
  margin-right: 120px;
}

.ability-padding {
  padding-right: 20px;
}

/* Weapons styling */
.weapon-padding {
  padding-top: 22px;
}

label[for="hit-points-current"],
label[for="initiative-modifier"],
label[for="level-1"],
label[for="level-2"] {
  margin-right: 20px;
}

.initiative-proficiency-margin {
  margin-top: 37px;
}

#skills {
  padding-top: 20px;
}

.skills-padding {
  padding-right: 33px;
}

/* Weapon name inputs styled like others */
#weapon1-name,
#weapon2-name,
#weapon3-name {
  width: 80px;
  height: 30px;
  padding: 0 5px;
  font-size: 14px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  font-family: inherit;
  display: block;
  margin: 0 auto;
}

/* Override to ensure 100% width inside weapon-padding th */
.weapon-padding input[type="text"] {
  width: 100% !important;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 3px;
}

/* Inventory section styling */
#inventory-section {
  margin-top: 20px;
}

.inventory-container {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Currency inputs row */
.inventory-currency {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 220px;
}

.inventory-currency label {
  margin-right: 5px;
  white-space: nowrap;
}

.inventory-currency input[type="number"] {
  width: 70px;
  padding: 5px;
  font-size: 1rem;
}

/* Inventory items container */
.inventory-items {
  flex-grow: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
}

/* Label row for "Item" and "Equipped Gear" */
.inventory-items > label {
  font-weight: bold;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  padding-right: 35px;
}

/* Each inventory item row */
.inventory-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

/* Text inputs for items */
.inventory-row input[type="text"] {
  flex-grow: 1;
  max-width: 80%; /* reduced from 150% */
  padding: 4px 6px; /* slightly less padding */
  font-size: 0.9rem; /* slightly smaller font */
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Checkboxes for equipped */
.inventory-row input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

#bottom-section {
  display: flex;
  gap: 2rem; /* spacing between left and right columns */
}

.left-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem; /* space between Ability Scores + Saving Throws and Skills */
}

.right-column {
  flex: 1;
}

/* Preserve your existing styles, e.g.: */
.ability-flex {
  margin-bottom: 1rem;
}

.skills-flex {
  display: flex;
  gap: 2rem;
}

/* Optional: control table widths or responsive tweaks */
#ability-scores table,
#skills table {
  width: 100%;
  border-collapse: collapse;
}

/* Adjust inputs and spacing as needed */
input.square-input {
  width: 3rem;
  text-align: center;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.controls-container {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.save-container,
.load-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#saved-characters-select {
  padding: 0.25rem;
}
