* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  background: #d2b48c;
  color: #3b2a1a;
  padding: 20px;
}

.sheet {
  max-width: 780px;
  margin: 0 auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2px;
  background: #f5e6c8;
}

th, td {
  border: 1px solid #8b7355;
  padding: 4px 6px;
  text-align: center;
}

th {
  background: #c4a265;
  font-weight: bold;
}

/* Header row */
.header-table td {
  background: #f5e6c8;
  font-weight: bold;
  white-space: nowrap;
}

.header-table input,
.header-table select {
  width: 100%;
  border: none;
  background: transparent;
  color: #3b2a1a;
  font-size: 13px;
  padding: 2px;
  outline: none;
}

.header-table input[type="number"] {
  width: 60px;
}

/* Stats table */
.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  background: #f5e6c8;
}

.stats-table td:first-child {
  text-align: left;
  font-weight: bold;
}

.stats-table input[type="number"] {
  width: 48px;
  text-align: center;
  border: 1px solid #8b7355;
  background: #faf3e6;
  color: #3b2a1a;
  font-size: 13px;
  padding: 2px;
}

.stats-table input[type="number"]:read-only {
  background: #efe0c6;
}

.final-stat, .final-mod {
  font-weight: bold;
  display: inline-block;
  min-width: 28px;
}

.final-mod {
  color: #6b3410;
}

.stats-table tfoot td {
  text-align: right;
  background: #f5e6c8;
  border: 1px solid #8b7355;
}

#rollAll {
  padding: 3px 12px;
  background: #8b4513;
  color: #f5e6c8;
  border: 1px solid #6b3410;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
}

#rollAll:hover {
  background: #6b3410;
}

.action-btn {
  padding: 4px 12px;
  background: #8b4513;
  color: #f5e6c8;
  border: 1px solid #6b3410;
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  margin: 0 4px;
}

.action-btn:hover {
  background: #6b3410;
}

/* Background table */
.bg-table td {
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.3;
}

.bg-table td:first-child {
  width: 20px;
  text-align: center;
}

.bg-table th:nth-child(2),
.bg-table td:nth-child(2) {
  font-weight: bold;
  white-space: nowrap;
}

.bg-table th:nth-child(3),
.bg-table td:nth-child(3) {
  width: 150px;
}

.bg-table th:nth-child(4),
.bg-table td:nth-child(4) {
  white-space: nowrap;
}

.bg-table th:nth-child(5),
.bg-table td:nth-child(5) {
  width: 120px;
}

.bg-table input {
  width: 100%;
  border: none;
  background: transparent;
  color: #3b2a1a;
  font-size: 13px;
  padding: 4px 6px;
  outline: none;
}

/* Skills tables */
.skills-table {
  table-layout: fixed;
}

.skills-table td {
  padding: 3px 6px;
  white-space: nowrap;
  text-align: left;
  font-weight: bold;
  width: 33.33%;
}

#skillsTable tbody tr:last-child td {
  font-weight: normal;
}

.skills-table td label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.skills-table td label input[type="checkbox"] {
  flex-shrink: 0;
}

.skill-val {
  width: 36px;
  flex-shrink: 0;
  margin-left: auto;
  text-align: center;
  border: 1px solid #8b7355;
  background: #faf3e6;
  color: #3b2a1a;
  font-size: 13px;
  padding: 1px;
}

input[type="checkbox"] {
  accent-color: #8b4513;
}

.class-info {
  margin-top: 16px;
  padding: 12px;
  background: #f5e6c8;
  border: 1px solid #8b7355;
  font-size: 13px;
  line-height: 1.5;
}

.class-info h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #6b3410;
}

.class-info div {
  margin-bottom: 10px;
}

.adventurer-options {
  margin-top: 16px;
}

.adventurer-table td {
  text-align: left;
  padding: 6px;
}

.adventurer-table td:nth-child(2) {
  font-size: 60%;
}

.foci-section {
  margin-top: 16px;
}

.foci-table td {
  text-align: left;
  padding: 6px;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.4;
}

.foci-table td:first-child {
  width: 20px;
  text-align: center;
}

.foci-table td:nth-child(2) {
  font-weight: bold;
  white-space: nowrap;
  width: 100px;
}

.foci-table td:nth-child(3) {
  width: 200px;
}

.foci-table thead tr:nth-child(2) th {
  background: #f5e6c8;
  font-weight: normal;
  font-style: italic;
  text-align: left;
  padding: 6px;
}

.rules-section {
  margin-top: 16px;
  padding: 12px;
  background: #f5e6c8;
  border: 1px solid #8b7355;
}

.rules-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: #6b3410;
}

.rules-section ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.rules-section li {
  margin-bottom: 8px;
  font-size: 13px;
}

.weapons-section {
  margin-top: 16px;
}

.weapons-table {
  width: 100%;
  border-collapse: collapse;
  background: #f5e6c8;
}

.weapons-table th,
.weapons-table td {
  border: 1px solid #8b7355;
  padding: 6px;
  text-align: center;
  font-size: 12px;
}

.weapons-table th {
  background: #c4a265;
  font-weight: bold;
}

.weapons-table td:first-child {
  text-align: left;
  font-weight: bold;
}

.weapons-table td:has(input[type="checkbox"]) {
  text-align: center;
  font-weight: normal;
  width: 20px;
}

.weapons-table tfoot td {
  background: #f5e6c8;
  padding: 8px;
}

/* Stats and Saves Container */
.stats-saves-container {
  display: flex;
  gap: 10px;
  margin-bottom: 2px;
}

.stats-table-div {
  width: 60%;
}

.saves-support {
  width: 35%;
  background: #f5e6c8;
  border: 1px solid #8b7355;
  padding: 6px;
}

.saves-support h3 {
  margin: 0 0 5px;
  font-size: 14px;
  color: #6b3410;
  text-align: center;
}

.saves-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  margin: 0;
}

.saves-table td {
  padding: 3px;
  border: 1px solid #8b7355;
  background: #faf3e6;
}

.saves-table td:first-child {
  text-align: left;
  width: 35%;
}

.saves-table td:nth-child(2) {
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  width: 20%;
}

.saves-table td:nth-child(3) {
  text-align: left;
  width: 45%;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  margin: 5px 0 0 0;
}

.info-table td {
  padding: 3px;
  border: 1px solid #8b7355;
  background: #faf3e6;
}

.info-table td:first-child {
  text-align: left;
  width: 30%;
}

.info-table td:nth-child(2) {
  text-align: left;
  width: 70%;
}

.info-table input[type="text"] {
  width: 100%;
  border: none;
  background: transparent;
  color: #3b2a1a;
  font-size: 12px;
  padding: 2px;
  outline: none;

}

