/* Magnus Archives Character Sheet - Main Styles */

/* 1. Consolidate root variables */
:root {
  /* Colors */
  --color-primary: #317e30;
  --color-bg-dark: #111;
  --color-bg-medium: #1c1c1c;
  --color-bg-light: #222;
  --color-text: #eee;
  --color-text-muted: #aaa;
  --color-border: #333;
  --color-danger: #d32f2f;

  /* Spacing */
  --spacing-sm: 8px;
  --spacing-md: 15px;
  --spacing-lg: 20px;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
}

body {
  font-family: "Segoe UI", sans-serif;
  background-color: var(--color-bg-dark);
  color: var(--color-text);
  padding: var(--spacing-lg);
  max-width: 800px;
  margin: 0 auto;
}

main {
  padding: 20px;
}

/* ==================== HEADER & TITLE ==================== */

.header-image {
  width: 100%;
  max-width: 800px;
  height: auto;
  display: block;
  margin: 0 auto 30px auto;
  border: 3px solid #317e30;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(49, 126, 48, 0.4);
}

h1 {
  font-family: "libre baskerville", serif;
  color: #4caf50;
  text-align: center;
  font-size: 1.5em;
  margin: 20px 0;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(76, 175, 80, 0.8), 0 0 40px rgba(49, 126, 48, 0.5);
  font-weight: 700;
  position: relative;
}

h1::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #4caf50, transparent);
  box-shadow: 0 0 10px #4caf50;
}

h2 {
  color: #4caf50;
  font-family: "Libre Baskerville", serif;
  font-size: 1.5em;
  margin: 20px 0 15px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 2px solid #317e30;
  padding-bottom: 10px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

h3 {
  color: #66bb6a;
  font-size: 1.2em;
  margin: 15px 0 10px 0;

  letter-spacing: 1px;
}

.section {
  background: #1c1c1c;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 0 8px #000;
}

label {
  display: inline-block;
  min-width: 130px;
}

input,
select {
  background: #222;
  color: #eee;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 4px 6px;
}

.text-section {
  margin-top: 20px;
}

.text-section textarea {
  width: 100%;
  min-height: 150px;
  background: #222;
  color: #eee;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 10px;
  font-family: inherit;
  resize: vertical;
  margin-top: 8px;
}

.text-section label {
  display: block;
  color: #aaa;
  margin-bottom: 5px;
}

/* ==================== CHARACTER IDENTITY SECTION ==================== */

.character-identity-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 0;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
  transition: all 0.3s ease;
}

/* Hide the entire section when confirmed */
.character-identity-section.confirmed {
  display: none;
}

.character-identity-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

.character-identity-section > h2 {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 20px 25px;
  margin: 0;
  color: #4caf50;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  border: none;
  border-bottom: 2px solid #317e30;
}

.character-identity {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.identity-fields {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.identity-field {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 10px;
  transition: all 0.3s ease;
}

.identity-field:hover {
  border-color: #317e30;
  box-shadow: 0 4px 12px rgba(49, 126, 48, 0.2);
}

.identity-field:focus-within {
  border-color: #4caf50;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.3);
  background: #222;
}

.identity-field label {
  color: #888;
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin: 0;
  text-align: right;
}

.identity-field label .required {
  color: #ff6666;
  margin-left: 4px;
}

.identity-field input,
.identity-field select {
  width: calc(100%-20px);
  padding: 12px 15px;
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 4px;
  color: #fff;
  font-size: 1em;
  transition: all 0.2s ease;
  font-family: inherit;
  margin: 0;
}

.identity-field input:focus,
.identity-field select:focus {
  outline: none;
  border-color: #4caf50;
  background: #333;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.identity-field input::placeholder {
  color: #555;
  font-style: italic;
}

.identity-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234caf50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.identity-field select option {
  background: #2a2a2a;
  color: #fff;
  padding: 8px;
}

/* Character Statement Preview (before confirmation) */
.character-statement-preview {
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  margin-top: 10px;
}

.character-statement-preview p {
  color: #888;
  font-size: 0.9em;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.character-statement-preview .statement-text {
  color: #ddd;
  font-size: 1.2em;
  line-height: 1.6;
  margin: 0;
  font-weight: 500;
}

.character-statement-preview .statement-text strong {
  color: #4caf50;
}

.character-statement-preview .statement-text .incomplete {
  color: #666;
  font-style: italic;
}

/* Confirm Button */
.identity-confirm-section {
  background: #1a1a1a;
  border-top: 2px solid #317e30;
  padding: 20px 25px;
  margin: 0;
}

.confirm-identity-btn {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border: 2px solid #4caf50;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 3px 10px rgba(49, 126, 48, 0.3);
}

.confirm-identity-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.confirm-identity-btn:active:not(:disabled) {
  transform: translateY(0);
}

.confirm-identity-btn:disabled {
  background: #555;
  border-color: #666;
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.confirm-identity-btn:disabled:hover {
  transform: none;
}

/* Info Box */
.identity-info-box {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 6px;
  padding: 15px 20px;
}

.identity-info-box p {
  margin: 0;
  color: #ddd;
  font-size: 0.9em;
  line-height: 1.6;
  text-align: center;
}

.identity-info-box strong {
  color: #4caf50;
}

/* Responsive Design */
@media (max-width: 768px) {
  .character-identity-section > h2 {
    padding: 15px 20px;
    font-size: 1.1em;
    letter-spacing: 1.5px;
  }

  .character-identity {
    padding: 20px;
  }

  .identity-field {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .identity-field label {
    text-align: left;
  }

  .identity-field input,
  .identity-field select {
    padding: 10px 12px;
    font-size: 0.95em;
  }

  .character-statement-preview .statement-text {
    font-size: 1em;
  }

  .identity-confirm-section {
    padding: 5px 10px;
  }

  .confirm-identity-btn {
    padding: 12px 15px;
    font-size: 1em;
    letter-spacing: 1px;
  }
}

.confirm-identity-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.confirm-identity-btn:active:not(:disabled) {
  transform: translateY(0);
}

.confirm-identity-btn:disabled {
  background: #555;
  border-color: #666;
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.confirm-identity-btn:disabled:hover {
  transform: none;
}

/* Info Box */
.identity-info-box {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 6px;
  padding: 15px 20px;
}

.identity-info-box p {
  margin: 0;
  color: #ddd;
  font-size: 0.9em;
  line-height: 1.6;
  text-align: center;
}

.identity-info-box strong {
  color: #4caf50;
}

/* Hide identity fields when confirmed (from old CSS) */
.identity-fields.hidden {
  display: none !important;
}

.character-options {
  transition: opacity 0.3s ease-out;
}

.character-options.hidden {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .character-identity-section > h2 {
    padding: 15px 20px;
    font-size: 1.1em;
    letter-spacing: 1.5px;
  }

  .character-identity {
    padding: 20px;
  }

  .identity-field {
    padding: 12px;
  }

  .identity-field input,
  .identity-field select {
    padding: 10px 12px;
    font-size: 1em;
  }

  .character-statement-preview .statement-text {
    font-size: 1em;
  }

  .identity-confirm-section {
    padding: 15px 20px;
    margin: 0 -20px -20px -20px;
  }

  .confirm-identity-btn {
    padding: 12px 15px;
    font-size: 1em;
    letter-spacing: 1px;
  }
}

/* Remove old character identity styles */
.character-identity:not(.character-identity-section .character-identity) {
  display: none;
}

.identity-field:not(.character-identity-section .identity-field) {
  display: none;
}

/* Normal Character Statement (Green) */
.character-statement-showcase {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 12px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.character-statement-showcase::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

/* Remove the header styles since we're not using it */
.character-statement-header {
  display: none;
}

.character-statement-content {
  background: radial-gradient(circle at center, #0d1a0d 0%, #000 100%);
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 30px;
  box-shadow: inset 0 0 30px rgba(49, 126, 48, 0.2);
}

.character-statement-text {
  color: #ddd;
  font-size: 1.3em;
  line-height: 1.8;
  text-align: center;
  margin: 0;
  font-weight: 500;
}

.character-statement-text strong {
  color: #4caf50;
  font-size: 1.1em;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

/* Avatar Character Statement (Red/Black) */
.character-statement-showcase.avatar-mode {
  background: linear-gradient(135deg, #1a0000 0%, #0d0000 100%);
  border-color: #8b0000;
  box-shadow: 0 8px 30px rgba(139, 0, 0, 0.5);
}

.character-statement-showcase.avatar-mode::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    #8b0000 20%,
    #ff0000 50%,
    #8b0000 80%,
    transparent 100%
  );
}

.character-statement-showcase.avatar-mode .character-statement-content {
  text-align: center;
  background: radial-gradient(circle at center, #1a0000 0%, #000 100%);
  border-color: #8b0000;
  box-shadow: inset 0 0 30px rgba(139, 0, 0, 0.3);
}

.character-statement-showcase.avatar-mode .character-statement-text strong {
  color: #ff4444;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

/* Avatar Badge */
.avatar-badge {
  display: block;
  background: #8b0000;
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 20px;
  width: fit-content;

  box-shadow: 0 0 20px rgba(139, 0, 0, 0.6);
  animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.6);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.9);
  }
}

/* Hide old character statement box */
.character-statement-box.confirmed {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .character-statement-showcase {
    padding: 20px;
  }

  .character-statement-content {
    padding: 20px;
  }

  .character-statement-text {
    font-size: 1.1em;
  }

  .character-statement-header h3 {
    font-size: 1em;
    letter-spacing: 2px;
  }
}

/* ==================== EQUIPMENT TABLES STYLING ==================== */

/* Equipment Info Collapsible */
.equipment-info-details {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  margin-bottom: 15px;
  overflow: hidden;
}

.equipment-info-summary {
  cursor: pointer;
  padding: 15px 20px;
  background: #2a2a2a;
  color: #4caf50;
  font-weight: 600;
  font-size: 1.05em;
  text-transform: uppercase;
  letter-spacing: 1px;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.equipment-info-summary::-webkit-details-marker {
  display: none;
}

.equipment-info-summary::before {
  content: "▶";
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.9em;
}

.equipment-info-details[open] .equipment-info-summary::before {
  transform: rotate(90deg);
}

.equipment-info-summary:hover {
  background: #333;
  color: #66bb6a;
}

.info-icon {
  font-size: 1.2em;
}

.equipment-info-content {
  padding: 20px;
  color: #ddd;
  line-height: 1.6;
  background: #1a1a1a;
}

.info-subsection {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

.info-subsection:last-child {
  margin-bottom: 0;
}

.info-subsection h4 {
  color: #4caf50;
  margin: 0 0 12px 0;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.info-subsection p {
  margin: 10px 0;
  font-size: 0.95em;
}

.info-subsection p:first-of-type {
  margin-top: 0;
}

.info-subsection p:last-child {
  margin-bottom: 0;
}

.info-subsection ul {
  margin: 10px 0;
  padding-left: 25px;
}

.info-subsection li {
  margin-bottom: 8px;
}

.info-subsection li:last-child {
  margin-bottom: 0;
}

.weapon-warning {
  background: #2a1a1a;
  padding: 12px;
  border-left: 3px solid #f44336;
  border-radius: 4px;
  margin-top: 15px !important;
}

/* Hide old equipment info section styles */
#equipmentInfoSection {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  .equipment-info-summary {
    padding: 12px 15px;
    font-size: 0.95em;
  }

  .equipment-info-content {
    padding: 15px;
  }

  .info-subsection {
    padding: 12px;
  }

  .info-subsection h4 {
    font-size: 1em;
  }
}

.equipment-table-container {
  margin-top: 10px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
  overflow: hidden;
}

.equipment-table-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

/* View Toggle Buttons */
.equipment-table-container .view-toggle-btn {
  padding: 6px 12px;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  color: #888;
  border: 2px solid #444;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85em;
}

.equipment-table-container .view-toggle-btn:hover {
  background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
  color: #4caf50;
  border-color: #317e30;
  transform: translateY(-1px);
}

.equipment-table-container .view-toggle-btn.active {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border-color: #4caf50;
  box-shadow: 0 0 15px rgba(49, 126, 48, 0.5);
}

/* Equipment Table */
.equipment-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}

.equipment-table thead {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  border-bottom: 2px solid #317e30;
}

.equipment-table th {
  color: #4caf50;
  padding: 15px 12px;
  text-align: left;
  font-weight: bold;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #317e30;
  text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.equipment-table tbody tr {
  border-bottom: 1px solid #333;
  transition: all 0.2s ease;
  background: #1a1a1a;
}

.equipment-table tbody tr:hover {
  background: #222;
  box-shadow: 0 2px 8px rgba(49, 126, 48, 0.2);
}

.equipment-table tbody tr:last-child {
  border-bottom: none;
}

/* Selected/Owned items styling */
.equipment-table tbody tr[style*="rgba(76, 175, 80, 0.1)"] {
  background: rgba(49, 126, 48, 0.15) !important;
  border-left: 3px solid #4caf50;
}

.equipment-table tbody tr[style*="rgba(76, 175, 80, 0.1)"]:hover {
  background: rgba(49, 126, 48, 0.25) !important;
}

.equipment-table td {
  padding: 12px;
  vertical-align: middle;
  color: #ddd;
  border-bottom: 1px solid #2a2a2a;
}

/* Input Fields */
.equipment-table input[type="text"],
.equipment-table select {
  width: 100%;
  background: #2a2a2a;
  border: 2px solid #317e30;
  color: #fff;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.equipment-table input[type="text"]:focus,
.equipment-table select:focus {
  outline: none;
  border-color: #4caf50;
  background: #333;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.equipment-table input[type="text"]::placeholder {
  color: #555;
  font-style: italic;
}

.equipment-table textarea {
  width: 100%;
  min-height: 30px;
  background: #2a2a2a;
  border: 2px solid #317e30;
  color: #fff;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.8em;
  resize: vertical;
  font-family: inherit;
  transition: all 0.2s ease;
}

.equipment-table textarea:focus {
  outline: none;
  border-color: #4caf50;
  background: #333;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.equipment-table select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234caf50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 20px;
}

.equipment-table select option {
  background: #2a2a2a;
  color: #fff;
}

/* Remove Equipment Button */
.remove-equipment-btn,
.remove-skill-btn {
  background: linear-gradient(135deg, #8b0000 0%, #660000 100%);
  color: white;
  border: 2px solid #aa0000;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8em;
  font-weight: bold;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.remove-equipment-btn:hover,
.remove-skill-btn:hover {
  background: linear-gradient(135deg, #aa0000 0%, #8b0000 100%);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(170, 0, 0, 0.5);
}

.remove-equipment-btn:active,
.remove-skill-btn:active {
  transform: scale(0.9);
}

/* Add Equipment Button */
.add-equipment-btn {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border: 2px solid #4caf50;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.7em;
  font-weight: bold;
  margin-top: 15px;
  width: 100%;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 10px rgba(49, 126, 48, 0.3);
}

.add-equipment-btn:hover {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.add-equipment-btn:active {
  transform: translateY(0);
}

/* Primary Button in Equipment Tables */
.equipment-table .button.primary-button {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border: 2px solid #4caf50;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7em;
  font-weight: bold;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.equipment-table .button.primary-button:hover {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.equipment-table .button.primary-button:active {
  transform: scale(0.9);
}

/* Checkmark for owned items */
.equipment-table td[style*="color: #4CAF50"] {
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
  font-size: 1em;
}

/* Equipment Info Section */
#equipmentInfoSection {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 0;
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
}

#equipmentInfoSection::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

#equipmentInfoSection > div:first-child {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 10px;
  border-bottom: 2px solid #317e30;
}

#equipmentInfoSection h2 {
  margin: 0;
  border: none;
  padding: 0;
}

#equipmentInfoToggle {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border: 2px solid #4caf50;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

#equipmentInfoToggle:hover {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

#equipmentInfoContent {
  padding: 10px;
}

#equipmentInfoContent > div {
  margin-bottom: 15px;
}

#equipmentInfoContent h4 {
  color: #4caf50;
  margin-top: 0;
  margin-bottom: 10px;
  text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
  .equipment-table th,
  .equipment-table td {
    padding: 8px 6px;
    font-size: 0.85em;
  }

  .equipment-table-container {
    padding: 15px;
  }

  .add-equipment-btn {
    font-size: 0.9em;
    padding: 10px 15px;
  }

  .equipment-table .button.primary-button {
    padding: 5px 10px;
    font-size: 0.8em;
  }
}

/* Remove text-shadow from equipment table value cells */
.equipment-table td[style*="color:"] {
  text-shadow: none !important;
}

/* Also remove from any bold text in tables */
.equipment-table td {
  text-shadow: none;
}

/* Make sure table text is consistent */
.equipment-table tbody td {
  text-shadow: none;
}

/* Keep existing equipment-custom-field styling */
.equipment-custom-field {
  font-style: italic;
  color: #888;
}

/* ==================== BACKGROUND SECTION ==================== */

.background-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 0;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
}

.background-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

.background-header {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 20px 25px;
  border-bottom: 2px solid #317e30;
}

.background-header h2 {
  margin: 0;
  color: #4caf50;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  border: none;
  padding: 0;
}

.background-content {
  padding: 25px;
  background: #1a1a1a;
}

.background-text-wrapper {
  position: relative;
}

.background-textarea {
  width: calc(100% - 40px);
  min-height: 200px;
  background: #000;
  border: 2px solid #317e30;
  border-radius: 6px;
  padding: 20px;
  color: #ddd;
  font-size: 1em;
  line-height: 1.8;
  resize: vertical;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 20px rgba(49, 126, 48, 0.2);
}

.background-textarea:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: inset 0 0 20px rgba(49, 126, 48, 0.3),
    0 0 15px rgba(76, 175, 80, 0.4);
  background: #0a0a0a;
}

.background-textarea::placeholder {
  color: #555;
  font-style: italic;
}

.background-char-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(49, 126, 48, 0.9);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.5px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.background-info {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.background-info p {
  margin: 0;
  color: #888;
  font-size: 0.9em;
  line-height: 1.6;
  text-align: center;
}

.background-info strong {
  color: #4caf50;
}

/* Optional: Add tips section */
.background-tips {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  margin-top: 15px;
  overflow: hidden;
}

.background-tips-header {
  cursor: pointer;
  padding: 12px 20px;
  background: #2a2a2a;
  color: #4caf50;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.9em;
  user-select: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.background-tips-header::before {
  content: "▶";
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.9em;
}

.background-tips[open] .background-tips-header::before {
  transform: rotate(90deg);
}

.background-tips-header:hover {
  background: #333;
  color: #5bc55b;
}

.background-tips-content {
  padding: 20px;
  color: #ddd;
  line-height: 1.6;
}

.background-tips-content ul {
  margin: 10px 0;
  padding-left: 25px;
}

.background-tips-content li {
  margin-bottom: 8px;
}

.background-tips-content li:last-child {
  margin-bottom: 0;
}

.background-tips-content strong {
  color: #4caf50;
}

/* Responsive Design */
@media (max-width: 768px) {
  .background-section {
    margin: 15px 0;
  }

  .background-header {
    padding: 15px 20px;
  }

  .background-header h2 {
    font-size: 1.1em;
    letter-spacing: 1.5px;
  }

  .background-content {
    padding: 20px;
  }

  .background-textarea {
    min-height: 180px;
    padding: 15px;
    font-size: 0.95em;
  }

  .background-char-count {
    font-size: 0.7em;
    padding: 3px 8px;
  }
}

/* ==================== CONNECTIONS SECTION ==================== */

.connections-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 0;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
}

.connections-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

.connections-section > h2 {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 20px 25px;
  margin: 0;
  color: #4caf50;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  border: none;
  border-bottom: 2px solid #317e30;
}

.connections-content {
  padding: 25px;
}

/* Connections Filter Bar */
.connections-filter-bar {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.connections-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.connections-filter-group label {
  color: #888;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.connections-filter-group input,
.connections-filter-group select {
  padding: 10px 12px;
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 4px;
  color: #fff;
  font-size: 0.95em;
  transition: all 0.2s ease;
}

.connections-filter-group input:focus,
.connections-filter-group select:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.connections-filter-group select {
  cursor: pointer;
}

.connections-filter-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.clear-connections-filter-btn {
  padding: 10px 20px;
  background: #444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.clear-connections-filter-btn:hover {
  background: #555;
  transform: translateY(-1px);
}

/* Connections List */
.connections-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.connection-card {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.connection-card:hover {
  border-color: #317e30;
  box-shadow: 0 4px 12px rgba(49, 126, 48, 0.2);
  transform: translateY(-2px);
}

/* Card Header */
.connection-card-header {
  background: #2a2a2a;
  padding: 15px;
  border-bottom: 2px solid #444;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 15px;
  align-items: center;
}

.connection-name-field,
.connection-affiliation-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.connection-field-label {
  color: #666;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.connection-name-input,
.connection-affiliation-input {
  width: 100%;
  padding: 8px 12px;
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 4px;
  color: #fff;
  font-size: 1em;
  font-weight: 600;
  transition: all 0.2s ease;
}

.connection-name-input {
  color: #4caf50;
}

.connection-affiliation-input {
  color: #2196f3;
}

.connection-name-input:focus,
.connection-affiliation-input:focus {
  outline: none;
  border-color: #317e30;
  box-shadow: 0 0 8px rgba(49, 126, 48, 0.3);
  background: #222;
}

.connection-name-input::placeholder,
.connection-affiliation-input::placeholder {
  color: #555;
}

/* Remove Button */
.remove-connection-btn {
  padding: 8px 16px;
  background: #d32f2f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: bold;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  align-self: center;
}

.remove-connection-btn:hover {
  background: #f44336;
  transform: scale(1.05);
}

.remove-connection-btn:active {
  transform: scale(0.95);
}

/* Card Body */
.connection-card-body {
  padding: 15px;
}

.connection-info-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.connection-info-textarea {
  width: calc(100% - 28px);
  min-height: 80px;
  padding: 12px;
  background: #000;
  border: 2px solid #317e30;
  border-radius: 4px;
  color: #ddd;
  font-size: 0.95em;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 10px rgba(49, 126, 48, 0.1);
}

.connection-info-textarea:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: inset 0 0 15px rgba(49, 126, 48, 0.2),
    0 0 10px rgba(76, 175, 80, 0.3);
  background: #0a0a0a;
}

.connection-info-textarea::placeholder {
  color: #555;
  font-style: italic;
}

/* Empty State */
.connections-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-style: italic;
}

.connections-empty p {
  margin: 0 0 20px 0;
  font-size: 1.1em;
}

/* Add Connection Button */
.add-connection-btn {
  width: 100%;
  padding: 15px 20px;
  background: #317e30;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 15px;
}

.add-connection-btn:hover {
  background: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.add-connection-btn:active {
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
  .connections-section > h2 {
    padding: 15px 20px;
    font-size: 1.1em;
    letter-spacing: 1.5px;
  }

  .connections-content {
    padding: 20px;
  }

  .connections-filter-bar {
    flex-direction: column;
    padding: 12px;
  }

  .connections-filter-group {
    width: 100%;
    min-width: auto;
  }

  .connections-filter-actions {
    width: 100%;
  }

  .clear-connections-filter-btn {
    width: 100%;
  }

  .connection-card-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .connection-card-body {
    padding: 12px;
  }

  .connection-info-textarea {
    min-height: 100px;
  }
}

/* Remove old connections table styles */
.connections-table-container {
  display: none;
}

.connections-table {
  display: none;
}

/* ==================== CHARACTER ARCS SECTION ==================== */

.character-arcs-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 0;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
}

.character-arcs-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

.character-arcs-section > h2 {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 20px 25px;
  margin: 0;
  color: #4caf50;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  border: none;
  border-bottom: 2px solid #317e30;
}

.character-arc-info {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 6px;
  padding: 15px 20px;
  margin: 20px 25px 20px 25px;
}

.arc-info-text {
  margin: 0;
  color: #ddd;
  text-align: center;
  font-size: 0.95em;
  line-height: 1.6;
}

.arc-info-text strong {
  color: #4caf50;
}

.character-arc-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 25px 25px 25px;
}

/* Arc Selection Row */
.arc-selection-row,
.arc-description-row,
.arc-notes-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arc-selection-row label,
.arc-description-row label,
.arc-notes-row label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
}

#characterArcSelect {
  width: 100%;
  padding: 12px 15px;
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 6px;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.2s ease;
}

#characterArcSelect:hover {
  border-color: #4caf50;
}

#characterArcSelect:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
  background: #333;
}

#characterArcDescription {
  width: calc(100% - 35px);
  min-height: 120px;
  padding: 15px;
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 6px;
  color: #ddd;
  font-size: 0.95em;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
}

#characterArcNotes {
  width: calc(100% - 35px);
  min-height: 150px;
  padding: 15px;
  background: #000;
  border: 2px solid #317e30;
  border-radius: 6px;
  color: #fff;
  font-size: 0.95em;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 20px rgba(49, 126, 48, 0.2);
}

#characterArcNotes:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: inset 0 0 20px rgba(49, 126, 48, 0.3),
    0 0 15px rgba(76, 175, 80, 0.4);
  background: #0a0a0a;
}

#characterArcNotes::placeholder {
  color: #555;
  font-style: italic;
}

/* Arc Status Display */
.arc-status-display {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 20px;
  background: #000;
  border: 2px solid #317e30;
  border-radius: 6px;
  box-shadow: inset 0 0 20px rgba(49, 126, 48, 0.2);
}

.arc-status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 15px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 4px;
}

.arc-status-label {
  color: #888;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.arc-status-value {
  color: #4caf50;
  font-size: 1.8em;
  font-weight: bold;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
  text-align: center;
  line-height: 1;
}

/* Arc Action Buttons */
.arc-action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.arc-action-buttons .button {
  padding: 15px 20px;
  font-size: 1em;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
}

.arc-action-buttons .primary-button {
  background: #317e30;
  color: white;
  border: 2px solid #4caf50;
  box-shadow: 0 3px 10px rgba(49, 126, 48, 0.3);
}

.arc-action-buttons .primary-button:hover {
  background: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.arc-action-buttons .primary-button:active {
  transform: translateY(0);
}

.success-button {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  border: 2px solid #66bb6a;
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.success-button:hover {
  background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 187, 106, 0.5);
}

.success-button:active {
  transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
  .character-arcs-section > h2 {
    padding: 15px 20px;
    font-size: 1.1em;
    letter-spacing: 1.5px;
  }

  .character-arc-info {
    margin: 15px 20px;
    padding: 12px 15px;
  }

  .arc-info-text {
    font-size: 0.9em;
  }

  .character-arc-container {
    padding: 0 20px 20px 20px;
    gap: 15px;
  }

  #characterArcSelect {
    padding: 10px 12px;
    font-size: 0.95em;
  }

  #characterArcDescription {
    min-height: 100px;
    padding: 12px;
    font-size: 0.9em;
  }

  #characterArcNotes {
    min-height: 120px;
    padding: 12px;
    font-size: 0.9em;
  }

  .arc-status-display {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 15px;
  }

  .arc-status-item {
    padding: 12px;
  }

  .arc-status-value {
    font-size: 1.5em;
  }

  .arc-action-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .arc-action-buttons .button {
    padding: 12px 15px;
    font-size: 0.95em;
  }
}

/*  ====================   STATS SECTION  ====================  > */

.stats-grid-redesigned {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-box-redesigned {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(49, 126, 48, 0.2);
}

.stat-box-redesigned::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  opacity: 0.5;
}

.stat-box-redesigned:hover {
  border-color: #4caf50;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  transform: translateY(-2px);
}

.stat-box-redesigned:hover::before {
  opacity: 1;
  animation: shimmer 2s infinite;
}

/* Stat Header */
.stat-header {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 2px solid #317e30;
}

.stat-header h3 {
  font-size: 1.3em;
  color: #4caf50;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.stat-icon {
  display: none;
}

/* Stat Values Display */
.stat-values-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid #444;
}

.stat-value-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.stat-value-label {
  color: #888;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.stat-value-number {
  font-size: 2.2em;
  font-weight: bold;
  font-family: "Courier New", monospace;
  line-height: 1;
  text-shadow: 0 0 15px rgba(76, 175, 80, 0.8), 0 0 30px rgba(76, 175, 80, 0.4);
}

.stat-value-number.current {
  color: #4caf50;
}

.stat-value-number.max {
  color: #66bb6a;
}

.stat-divider {
  font-size: 2em;
  color: #666;
  font-weight: bold;
  margin: 0 3px;
}

/* Edge Display */
.stat-edge-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #000;
  border: 2px solid #317e30;
  border-radius: 6px;
  margin-top: 12px;
}

.edge-label {
  color: #888;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.edge-value {
  font-size: 1.5em;
  font-weight: bold;
  color: #ffd700;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  min-width: 30px;
  text-align: center;
}

/* Individual Stat Colors */
.might-stat {
  border-color: #c62828;
}

.might-stat:hover {
  border-color: #f44336;
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.3);
}

.might-stat .stat-header h3 {
  color: #f44336;
  text-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

.might-stat .stat-value-number.current {
  color: #f44336;
  text-shadow: 0 0 15px rgba(244, 67, 54, 0.8), 0 0 30px rgba(244, 67, 54, 0.4);
}

.speed-stat {
  border-color: #1976d2;
}

.speed-stat:hover {
  border-color: #2196f3;
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
}

.speed-stat .stat-header h3 {
  color: #2196f3;
  text-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

.speed-stat .stat-value-number.current {
  color: #2196f3;
  text-shadow: 0 0 15px rgba(33, 150, 243, 0.8),
    0 0 30px rgba(33, 150, 243, 0.4);
}

.intellect-stat {
  border-color: #7b1fa2;
}

.intellect-stat:hover {
  border-color: #9c27b0;
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.3);
}

.intellect-stat .stat-header h3 {
  color: #9c27b0;
  text-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

.intellect-stat .stat-value-number.current {
  color: #9c27b0;
  text-shadow: 0 0 15px rgba(156, 39, 176, 0.8),
    0 0 30px rgba(156, 39, 176, 0.4);
}

/* Stat Allocation Section */
.stat-allocation {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 25px;
  margin-top: 30px;
}

.stat-allocation h3 {
  color: #317e30;
  margin: 0 0 20px 0;
  font-size: 1.3em;
  text-align: center;
}

.points-remaining {
  text-align: center;
  font-size: 1.2em;
  color: #ddd;
  margin-bottom: 25px;
  padding: 15px;
  background: #1a1a1a;
  border-radius: 6px;
  border: 2px solid #317e30;
}

.points-remaining span {
  color: #4caf50;
  font-size: 1.5em;
  font-weight: bold;
  font-family: "Courier New", monospace;
}

.stat-allocate {
  display: grid;
  grid-template-columns: 120px 80px 1fr;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  margin-bottom: 15px;
  transition: all 0.2s ease;
}

.stat-allocate:hover {
  border-color: #317e30;
  background: #222;
}

.stat-allocate > span:first-child {
  color: #888;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-allocate > span:nth-child(2) {
  color: #4caf50;
  font-size: 1.8em;
  font-weight: bold;
  font-family: "Courier New", monospace;
  text-align: center;
}

.stat-allocate > div {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.stat-allocate button {
  background: #317e30;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 50px;
}

.stat-allocate button:hover {
  background: #4caf50;
  transform: scale(1.05);
}

.stat-allocate button:active {
  transform: scale(0.95);
}

.confirm-stats-button {
  width: 100%;
  padding: 15px;
  background: #317e30;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.confirm-stats-button:hover:not(:disabled) {
  background: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.confirm-stats-button:disabled {
  background: #555;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .stats-grid-redesigned {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid-redesigned {
    grid-template-columns: 1fr;
  }

  .stat-box-redesigned {
    padding: 18px;
  }

  .stat-header h3 {
    font-size: 1.2em;
  }

  .stat-value-number {
    font-size: 2em;
  }

  .edge-value {
    font-size: 1.3em;
  }

  .stat-allocate {
    grid-template-columns: 100px 60px 1fr;
    gap: 10px;
    padding: 12px;
  }

  .stat-allocate > span:nth-child(2) {
    font-size: 1.5em;
  }

  .stat-allocate button {
    padding: 8px 15px;
    font-size: 1em;
    min-width: 40px;
  }
}

/* Keep the old stat-box display: none for backwards compatibility */
.stat-box {
  display: none;
}

/* ==================== POOL ALLOCATION UI ==================== */

.pool-allocation-ui {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 0;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
}

.pool-allocation-ui::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

/* Pool Allocation Header */
.pool-allocation-header {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 15px 20px;
  text-align: center;
  border-bottom: 2px solid #317e30;
}

.pool-allocation-header h3 {
  margin: 0 0 8px 0;
  color: #4caf50;
  font-size: 1.2em;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.pool-allocation-header p {
  margin: 0;
  color: #ddd;
  font-size: 0.9em;
  line-height: 1.4;
}

.pool-allocation-header strong {
  color: #4caf50;
  font-size: 1em;
}

/* Points Remaining Display */
.pool-points-remaining {
  background: #000;
  border: 2px solid #317e30;
  border-radius: 6px;
  padding: 12px;
  margin: 15px 20px;
  text-align: center;
  box-shadow: inset 0 0 15px rgba(49, 126, 48, 0.3),
    0 0 20px rgba(49, 126, 48, 0.2);
}

.pool-points-remaining .points-label {
  color: #888;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
  display: block;
}

.pool-points-remaining .points-value {
  font-size: 2.5em;
  font-weight: bold;
  color: #4caf50;
  font-family: "Courier New", monospace;
  line-height: 1;
  text-shadow: 0 0 15px rgba(76, 175, 80, 1), 0 0 30px rgba(76, 175, 80, 0.7),
    0 0 45px rgba(76, 175, 80, 0.4), 2px 2px 4px rgba(0, 0, 0, 1);
}

/* Pool Allocation Grid */
.pool-allocation-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 20px;
}

/* Individual Pool Card */
.pool-allocation-card {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 12px 15px;
  transition: all 0.3s ease;
}

.pool-allocation-card:hover {
  border-color: #317e30;
  box-shadow: 0 4px 12px rgba(49, 126, 48, 0.2);
  transform: translateY(-2px);
}

.pool-allocation-card.might-pool {
  border-left: 3px solid #f44336;
}

.pool-allocation-card.speed-pool {
  border-left: 3px solid #2196f3;
}

.pool-allocation-card.intellect-pool {
  border-left: 3px solid #9c27b0;
}

/* Card Header */
.pool-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #333;
}

.pool-card-header label {
  color: #ddd;
  font-size: 1em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pool-card-header .pool-allocated {
  color: #4caf50;
  font-size: 1.5em;
  font-weight: bold;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

/* Stat Colors */
.pool-allocation-card.might-pool .pool-card-header label {
  color: #f44336;
}

.pool-allocation-card.speed-pool .pool-card-header label {
  color: #2196f3;
}

.pool-allocation-card.intellect-pool .pool-card-header label {
  color: #9c27b0;
}

/* Card Controls */
.pool-card-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.pool-adjust-btn {
  background: #317e30;
  color: white;
  border: 2px solid #4caf50;
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 50px;
  box-shadow: 0 2px 6px rgba(49, 126, 48, 0.3);
}

.pool-adjust-btn:hover {
  background: #4caf50;
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.5);
}

.pool-adjust-btn:active {
  transform: scale(0.95);
}

.pool-adjust-btn:disabled {
  background: #555;
  border-color: #666;
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.pool-adjust-btn:disabled:hover {
  transform: none;
}

/* Confirm Button */
.pool-allocation-footer {
  background: #1a1a1a;
  padding: 15px 20px;
  border-top: 2px solid #317e30;
}

.pool-confirm-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border: 2px solid #4caf50;
  border-radius: 6px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 3px 10px rgba(49, 126, 48, 0.3);
}

.pool-confirm-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.pool-confirm-btn:active:not(:disabled) {
  transform: translateY(0);
}

.pool-confirm-btn:disabled {
  background: #555;
  border-color: #666;
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.pool-confirm-btn:disabled:hover {
  transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .pool-allocation-header {
    padding: 12px 15px;
  }

  .pool-allocation-header h3 {
    font-size: 1em;
  }

  .pool-allocation-header p {
    font-size: 0.85em;
  }

  .pool-points-remaining {
    margin: 12px 15px;
    padding: 10px;
  }

  .pool-points-remaining .points-value {
    font-size: 2em;
  }

  .pool-allocation-grid {
    padding: 12px 15px;
    gap: 8px;
  }

  .pool-allocation-card {
    padding: 10px 12px;
  }

  .pool-card-header label {
    font-size: 0.9em;
  }

  .pool-card-header .pool-allocated {
    font-size: 1.3em;
  }

  .pool-adjust-btn {
    padding: 6px 15px;
    font-size: 1.1em;
    min-width: 45px;
  }

  .pool-allocation-footer {
    padding: 12px 15px;
  }

  .pool-confirm-btn {
    padding: 10px;
    font-size: 0.9em;
  }
}

.button,
.confirm-button,
.stress-button,
.advancement-button {
  /* Common button styles */
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button {
  background: #444;
  color: #eee;
  padding: 6px 10px;
  margin: 3px;
}

.button:hover {
  background: #666;
}

/* Damage Track Container */
.damage-track-container {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 25px;
}

/* Current State Display */

.damage-track-container h3 {
  font-family: "Libre Baskerville", serif;
  color: #317e30;
  margin: 0 0 15px 0;
  text-align: center;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.damage-state-display {
  background: #000;
  border: 3px solid #317e30;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: inset 0 0 20px rgba(49, 126, 48, 0.3),
    0 0 30px rgba(49, 126, 48, 0.2);
}

.damage-state-label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.damage-state-value {
  font-size: 3.5em;
  font-weight: bold;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1;
  text-shadow: 0 0 15px currentColor, 0 0 30px currentColor,
    3px 3px 6px rgba(0, 0, 0, 1);
}

/* State Colors */
.damage-state-value.hale {
  color: #4caf50;
}

.damage-state-value.hurt {
  color: #ffa500;
}

.damage-state-value.impaired {
  color: #ff9800;
}

.damage-state-value.debilitated {
  color: #ff5722;
}

.damage-state-value.dead {
  color: #f44336;
}

/* Navigation Controls */
.damage-navigation {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.damage-nav-button {
  flex: 1;
  background: #317e30;
  border: none;
  color: white;
  padding: 15px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.damage-nav-button:hover {
  background: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.damage-nav-button:active {
  transform: translateY(0);
}

.damage-nav-button.prev::before {
  content: "";
  margin-right: 8px;
}

.damage-nav-button.next::after {
  content: "";
  margin-left: 8px;
}

/* Description Box */
.damage-description-box {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  color: #ddd;
  font-size: 1.1em;
  line-height: 1.6;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Quick State Selection */
.damage-quick-select {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.damage-quick-label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-align: center;
}

.damage-quick-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.damage-quick-btn {
  background: #555;
  border: 2px solid #555;
  color: #ddd;
  padding: 10px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95em;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 110px;
}

.damage-quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.damage-quick-btn.active {
  border-width: 3px;
  box-shadow: 0 0 20px currentColor;
}

/* Individual button colors */
.hale-btn.active {
  background: #4caf50;
  border-color: #4caf50;
  color: white;
}

.hurt-btn.active {
  background: #ffa500;
  border-color: #ffa500;
  color: white;
}

.impaired-btn.active {
  background: #ff9800;
  border-color: #ff9800;
  color: white;
}

.debilitated-btn.active {
  background: #ff5722;
  border-color: #ff5722;
  color: white;
}

.dead-btn.active {
  background: #f44336;
  border-color: #f44336;
  color: white;
}

/* Hover states for inactive buttons */
.hale-btn:hover:not(.active) {
  background: #4caf50;
  border-color: #4caf50;
  color: white;
  opacity: 0.8;
}

.hurt-btn:hover:not(.active) {
  background: #ffa500;
  border-color: #ffa500;
  color: white;
  opacity: 0.8;
}

.impaired-btn:hover:not(.active) {
  background: #ff9800;
  border-color: #ff9800;
  color: white;
  opacity: 0.8;
}

.debilitated-btn:hover:not(.active) {
  background: #ff5722;
  border-color: #ff5722;
  color: white;
  opacity: 0.8;
}

.dead-btn:hover:not(.active) {
  background: #f44336;
  border-color: #f44336;
  color: white;
  opacity: 0.8;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .damage-state-value {
    font-size: 2.5em;
  }

  .damage-nav-button {
    padding: 12px 15px;
    font-size: 1em;
  }

  .damage-quick-buttons {
    gap: 5px;
  }

  .damage-quick-btn {
    padding: 8px 12px;
    font-size: 0.85em;
    min-width: 90px;
  }
}

/* ==================== RECOVERY SECTION ==================== */

.recovery-container {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 25px;
}

.recovery-overview {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  margin-bottom: 30px;
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 20px;
}

.recovery-formula-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.recovery-formula-main {
  text-align: center;
}

.recovery-formula-main label {
  display: block;
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.formula-display {
  font-size: 2.5em;
  font-weight: bold;
  color: #4caf50;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  margin-bottom: 8px;
}

.formula-display span {
  color: #ffd700;
}

.formula-breakdown {
  color: #888;
  font-size: 0.95em;
}

.formula-breakdown span {
  color: #4caf50;
  font-weight: bold;
}

/* Recovery Rules Compact */
.recovery-rules-compact {
  margin-top: 10px;
}

.recovery-rules-details {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
}

.recovery-rules-details summary {
  cursor: pointer;
  padding: 10px 15px;
  color: #4caf50;
  font-weight: 500;
  list-style: none;
  user-select: none;
}

.recovery-rules-details summary::-webkit-details-marker {
  display: none;
}

.recovery-rules-details summary::before {
  content: "▶ ";
  display: inline-block;
  transition: transform 0.2s;
}

.recovery-rules-details[open] summary::before {
  transform: rotate(90deg);
}

.recovery-rules-details summary:hover {
  background: #333;
}

.recovery-rules-content {
  padding: 15px;
  border-top: 1px solid #444;
  color: #ddd;
  line-height: 1.6;
}

.recovery-rules-content ul {
  margin: 0;
  padding-left: 20px;
}

.recovery-rules-content li {
  margin-bottom: 8px;
}

.recovery-rules-content li:last-child {
  margin-bottom: 0;
}

/* Recovery Status Section */
.recovery-status-section {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 2px solid #444;
  padding-left: 20px;
}

.recovery-status-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.recovery-status-item label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.recovery-status-item .status-value {
  color: #4caf50;
  font-size: 2em;
  font-weight: bold;
  font-family: "Courier New", monospace;
}

/* Recovery Rolls Section */
.recovery-rolls-section {
  margin-bottom: 20px;
}

.recovery-rolls-section h3 {
  color: #317e30;
  font-size: 1.2em;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #317e30;
}

.recovery-rolls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

/* Recovery Card - Keep existing styles */
.recovery-card {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.recovery-card:hover {
  border-color: #317e30;
  box-shadow: 0 4px 15px rgba(49, 126, 48, 0.2);
}

.recovery-card.used {
  opacity: 0.6;
  border-color: #666;
}

.recovery-card.used:hover {
  border-color: #666;
  box-shadow: none;
}

/* Card Header */
.recovery-card-header {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #317e30;
}

.recovery-card-title {
  font-size: 1.1em;
  font-weight: bold;
  color: #fff;
}

.recovery-status {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recovery-status.available {
  background: #317e30;
  color: white;
}

.recovery-status.used {
  background: #666;
  color: #ccc;
}

/* Card Body */
.recovery-card-body {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recovery-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #333;
}

.recovery-detail:last-child {
  border-bottom: none;
}

.detail-label {
  color: #888;
  font-size: 0.9em;
  font-weight: 500;
}

.detail-value {
  color: #ddd;
  font-size: 0.95em;
}

.detail-value.stress-benefit {
  color: #4caf50;
  font-weight: 500;
}

/* Card Footer */
.recovery-card-footer {
  padding: 15px;
  border-top: 2px solid #444;
}

.recovery-use-btn {
  width: 100%;
  background: #317e30;
  border: none;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.recovery-use-btn:hover {
  background: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.recovery-use-btn:active {
  transform: translateY(0);
}

.recovery-use-btn:disabled {
  background: #555;
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
}

.recovery-use-btn:disabled:hover {
  transform: none;
  box-shadow: none;
  background: #555;
}

/* Used State */
.recovery-card.used .recovery-use-btn {
  background: #555;
  color: #888;
}

.recovery-card.used .recovery-use-btn::before {
  content: "✓ ";
}

.recovery-card.used .recovery-use-btn:hover {
  background: #555;
  transform: none;
  box-shadow: none;
}

/* Recovery Actions */
.recovery-actions {
  margin-bottom: 20px;
  text-align: center;
}

.recovery-reset-btn {
  background: #ff9800;
  border: none;
  color: white;
  padding: 12px 30px;
  border-radius: 6px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.recovery-reset-btn:hover {
  background: #ffa726;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.recovery-reset-btn:active {
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .recovery-rolls-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .recovery-overview {
    grid-template-columns: 1fr;
  }

  .recovery-status-section {
    border-left: none;
    border-top: 2px solid #444;
    padding-left: 0;
    padding-top: 20px;
    margin-top: 15px;
  }

  .recovery-rolls-grid {
    grid-template-columns: 1fr;
  }

  .formula-display {
    font-size: 2em;
  }
}

/* ==================== RECOVERY DISTRIBUTION MODAL ==================== */

.dice-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10001;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.dice-modal-content-compact {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  max-width: 650px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 50px rgba(49, 126, 48, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

.dice-modal-header {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 20px 25px;
  border-bottom: 2px solid #317e30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px 10px 0 0;
}

.dice-modal-header h2 {
  margin: 0;
  color: #4caf50;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dice-modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 2em;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.dice-modal-close:hover {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
}

.dice-modal-body-compact {
  padding: 25px;
  color: #ddd;
}

/* Recovery Adjust Buttons */
.recovery-adjust-btn {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border: 2px solid #4caf50;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}

.recovery-adjust-btn:hover {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.recovery-adjust-btn:active {
  transform: scale(0.98);
}

/* Scrollbar styling for modal */
.dice-modal-content-compact::-webkit-scrollbar {
  width: 10px;
}

.dice-modal-content-compact::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 10px;
}

.dice-modal-content-compact::-webkit-scrollbar-thumb {
  background: #317e30;
  border-radius: 10px;
}

.dice-modal-content-compact::-webkit-scrollbar-thumb:hover {
  background: #4caf50;
}

.primary-button {
  background: #317e30;
  color: white;
  border: 2px solid #317e30;
}

.primary-button:hover {
  background: #3a9539;
  transform: translateY(-2px);
}

.secondary-button {
  background: #444;
  color: white;
  border: 2px solid #666;
}

.secondary-button:hover {
  background: #555;
  border-color: #777;
}

.tier-xp-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ==================== EFFORT SECTION ==================== */

.effort-section {
  background: #1a1a1a;
}

.effort-container {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 25px;
}

.effort-display-box {
  background: #000;
  border: 3px solid #317e30;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: inset 0 0 20px rgba(49, 126, 48, 0.3),
    0 0 30px rgba(49, 126, 48, 0.2);
}

.effort-label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.effort-value {
  font-size: 5em;
  font-weight: bold;
  color: #4caf50;
  line-height: 1;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 20px rgba(76, 175, 80, 1), 0 0 40px rgba(76, 175, 80, 0.7),
    0 0 60px rgba(76, 175, 80, 0.4), 3px 3px 6px rgba(0, 0, 0, 1);
}

.effort-info-box {
  margin-top: 20px;
}

.effort-details {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  overflow: hidden;
}

.effort-details summary {
  cursor: pointer;
  padding: 15px 20px;
  color: #4caf50;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  list-style: none;
  user-select: none;
  background: #2a2a2a;
  border-bottom: 2px solid #444;
  transition: all 0.2s ease;
}

.effort-details summary::-webkit-details-marker {
  display: none;
}

.effort-details summary::before {
  content: "▶ ";
  display: inline-block;
  transition: transform 0.2s;
  margin-right: 8px;
}

.effort-details[open] summary::before {
  transform: rotate(90deg);
}

.effort-details summary:hover {
  background: #333;
  color: #5bc55b;
}

.effort-details-content {
  padding: 20px;
  color: #ddd;
  line-height: 1.6;
}

.effort-details-content ul {
  margin: 0;
  padding-left: 25px;
}

.effort-details-content li {
  margin-bottom: 10px;
}

.effort-details-content li:last-child {
  margin-bottom: 0;
}

.effort-details-content li strong {
  color: #4caf50;
}

/* Remove old effort styles */
.effort-display,
.effort-description {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .effort-container {
    padding: 20px;
  }

  .effort-display-box {
    padding: 20px;
  }

  .effort-value {
    font-size: 3.5em;
  }

  .effort-label {
    font-size: 0.85em;
  }
}

/* ==================== TIER SHOWCASE SECTION ==================== */

.tier-showcase-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
  overflow: hidden;
}

.tier-showcase-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.tier-showcase-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Main Tier Display */
.tier-main-display {
  text-align: center;
  padding: 30px 60px;
  background: radial-gradient(circle at center, #0d1a0d 0%, #000 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(49, 126, 48, 0.5),
    inset 0 0 30px rgba(49, 126, 48, 0.2);
  min-width: 300px;
}

.tier-label {
  color: #4caf50;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 600;
  margin-bottom: 15px;
  text-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
}

.tier-number-large {
  font-size: 8em;
  font-weight: bold;
  color: #4caf50;
  line-height: 1;
  font-family: "Georgia", serif;
  text-shadow: 0 0 30px rgba(76, 175, 80, 1), 0 0 60px rgba(76, 175, 80, 0.6),
    0 0 90px rgba(76, 175, 80, 0.3), 0 6px 12px rgba(0, 0, 0, 1);
  position: relative;
  animation: tierGlow 2s ease-in-out infinite alternate;
}

@keyframes tierGlow {
  from {
    text-shadow: 0 0 30px rgba(76, 175, 80, 0.8),
      0 0 60px rgba(76, 175, 80, 0.4), 0 6px 12px rgba(0, 0, 0, 1);
  }
  to {
    text-shadow: 0 0 40px rgba(76, 175, 80, 1), 0 0 80px rgba(76, 175, 80, 0.8),
      0 0 120px rgba(76, 175, 80, 0.5), 0 6px 12px rgba(0, 0, 0, 1);
  }
}

.tier-subtitle {
  color: #666;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 15px;
  font-weight: 500;
  text-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Remove the old tier-info-panel and tier-details styles */
.tier-info-panel,
.tier-details {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tier-showcase-section {
    padding: 20px;
  }

  .tier-main-display {
    padding: 20px 40px;
    min-width: 250px;
  }

  .tier-number-large {
    font-size: 5em;
  }

  .tier-label {
    font-size: 0.85em;
    letter-spacing: 3px;
  }

  .tier-subtitle {
    font-size: 0.75em;
    letter-spacing: 2px;
  }
}

/* ==================== ADVANCEMENT SECTION  ==================== */

.advancement-section {
  background: #1a1a1a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.advancement-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.advancement-stat-box {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 15px;
  text-align: center;
}

.advancement-stat-box label {
  display: block;
  font-size: 0.9em;
  color: #888;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.advancement-stat-box .stat-value {
  font-size: 1.8em;
  font-weight: bold;
  color: #317e30;
}

.xp-input-wrapper input {
  width: 100%;
  padding: 8px;
  font-size: 1.5em;
  text-align: center;
  background: #1a1a1a;
  border: 1px solid #317e30;
  border-radius: 4px;
  color: #317e30;
  font-weight: bold;
}

.xp-quick-add {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 30px;
}

.xp-quick-add h3 {
  margin: 0 0 15px 0;
  color: #ddd;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.xp-buttons {
  display: flex;
  gap: 10px;
}

.xp-btn {
  flex: 1;
  padding: 10px;
  background: #317e30;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.xp-btn:hover {
  background: #3a9539;
  transform: translateY(-2px);
}

.advancements-category {
  margin: 30px 0;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #317e30;
  color: #ddd;
}

.category-icon {
  font-size: 1.2em;
}

.category-note {
  font-size: 0.8em;
  color: #888;
  font-weight: normal;
  margin-left: auto;
}

.advancements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.advancement-card {
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.3s ease;
}

.advancement-card:hover {
  border-color: #317e30;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(49, 126, 48, 0.3);
}

.advancement-card.purchased {
  border-color: #317e30;
  background: #1e3a1e;
}

.advancement-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.advancement-header h4 {
  margin: 0;
  color: #ddd;
  font-size: 1.1em;
}

.advancement-cost {
  background: #317e30;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
}

.advancement-description {
  color: #aaa;
  font-size: 0.9em;
  line-height: 1.5;
  margin: 10px 0 15px 0;
  min-height: 60px;
}

.advancement-description em {
  color: #888;
  font-size: 0.85em;
}

.advancement-purchase-btn {
  width: 100%;
  padding: 10px;
  background: #317e30;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1em;
}

.advancement-purchase-btn:hover:not(:disabled) {
  background: #3a9539;
}

.advancement-purchase-btn:disabled {
  background: #555;
  cursor: not-allowed;
  opacity: 0.6;
}

.advancement-purchase-btn.purchased {
  background: #555;
  cursor: default;
}

.advancement-purchase-btn.purchased::before {
  content: "✓ ";
}

.equipment-section {
  margin: 10px 0;
}

.equipment-list {
  width: 100%;
  min-height: 100px;
  background: #222;
  color: #eee;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 10px;
  font-family: inherit;
  resize: vertical;
  margin-top: 8px;
}

.equipment-list::placeholder {
  color: #666;
}

.stress-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stress-box,
.supernatural-stress-box {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 20px;
}

.stress-box h3 {
  font-family: "Libre Baskerville", serif;
  color: #317e30;
  margin: 0 0 15px 0;
  text-align: center;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Enhanced stress value display */
.stress-value-display {
  background: #000;
  border: 3px solid #317e30;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: inset 0 0 20px rgba(49, 126, 48, 0.3),
    0 0 30px rgba(49, 126, 48, 0.2);
}

.stress-value-display .stress-number {
  font-size: 4em;
  font-weight: bold;
  color: #4caf50;
  text-shadow: 0 0 15px rgba(76, 175, 80, 1), 0 0 30px rgba(76, 175, 80, 0.7),
    0 0 45px rgba(76, 175, 80, 0.5), 3px 3px 6px rgba(0, 0, 0, 1);
  line-height: 1;
  display: block;
  margin-bottom: 10px;
  font-family: "Courier New", monospace;
}

.stress-value-display .stress-label {
  font-size: 0.9em;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Stress level display */
.stress-level-display {
  background: #1a1a1a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  margin-bottom: 20px;
}

.stress-level-display .level-label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.stress-level-display .level-number {
  font-size: 2.5em;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5),
    2px 2px 4px rgba(0, 0, 0, 0.9);
  line-height: 1;
  display: block;
  font-family: "Courier New", monospace;
}

/* Stress controls horizontal layout */
.stress-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.stress-button {
  background: #317e30;
  border: none;
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
  transition: all 0.2s ease;
  min-width: 45px;
}

.stress-button:hover {
  background: #4caf50;
  transform: scale(1.05);
}

.stress-button:active {
  transform: scale(0.95);
}

/* Keep the old stress display for backward compatibility but hide it */
.stress-display {
  display: none;
}

/* Compact details/summary styling */
.info-details {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #444;
}

.info-details summary {
  cursor: pointer;
  color: #4caf50;
  font-weight: bold;
  padding: 10px;
  background: #1a1a1a;
  border-radius: 6px;
  user-select: none;
  transition: all 0.2s ease;
}

.info-details summary:hover {
  background: #2a2a2a;
  color: #5bc55b;
}

.info-details[open] summary {
  margin-bottom: 10px;
  border-bottom: 2px solid #317e30;
}

.info-content {
  padding: 15px;
  background: #1a1a1a;
  border-radius: 6px;
  margin-top: 10px;
}

.info-content ul {
  margin: 0;
  padding-left: 20px;
  color: #ddd;
  line-height: 1.8;
}

.info-content ul li {
  margin-bottom: 8px;
}

.info-content ul li strong {
  color: #4caf50;
}

.stress-display {
  background: #1a1a1a;
  padding: 10px 20px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.stress-display span {
  font-size: 1.5em;
  font-weight: bold;
  color: #eee;
}

.stress-display label {
  font-size: 0.9em;
  color: #888;
}

.stress-level {
  text-align: center;
  margin-top: 10px;
  padding: 10px;
  background: #1a1a1a;
  border-radius: 6px;
}

.stress-level label {
  color: #888;
  margin-right: 10px;
}

.stress-level span {
  font-size: 1.2em;
  font-weight: bold;
  color: #317e30;
}

.supernatural-stress-display {
  font-size: 2em;
  margin: 15px 0;
  padding: 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 5px;
  background: #1a1a1a;
  border: 3px solid #8b0000;
  min-width: 120px;
}

.supernatural-stress-display span {
  font-size: 2.5em;
  font-weight: bold;
  color: #ff4444;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.8), 0 0 20px rgba(255, 68, 68, 0.5),
    2px 2px 4px rgba(0, 0, 0, 0.9);
  line-height: 1;
}

.supernatural-stress-display label {
  color: #888;
  font-size: 0.4em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: 5px;
}

.supernatural-stress-box {
  background: #2a2a2a;
  border: 2px solid #8b0000;
  border-radius: 8px;
  padding: 20px;
}

.supernatural-stress-box h3 {
  font-family: "Libre Baskerville", serif;
  color: #ff4444;
  margin: 0 0 15px 0;
  text-align: center;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.supernatural-stress-value-display {
  background: #000;
  border: 3px solid #8b0000;
  border-radius: 8px;
  padding: 25px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: inset 0 0 20px rgba(139, 0, 0, 0.3), 0 0 30px rgba(139, 0, 0, 0.2);
}

.supernatural-stress-value-display .stress-number {
  font-size: 4em;
  font-weight: bold;
  color: #ff0000;
  line-height: 1;
  display: block;
  margin-bottom: 10px;
  font-family: "Courier New", monospace;
  transition: all 0.5s ease;
  /* Default glow (0 stress) */
  text-shadow: 0 0 15px rgba(255, 0, 0, 0.3), 0 0 30px rgba(255, 0, 0, 0.2),
    0 0 45px rgba(255, 0, 0, 0.1), 3px 3px 6px rgba(0, 0, 0, 1);
}

/* Supernatural Stress Level-based Glow Classes */
.supernatural-stress-value-display .stress-number.stress-0 {
  text-shadow: 0 0 15px rgba(255, 0, 0, 0.3), 0 0 30px rgba(255, 0, 0, 0.2),
    0 0 45px rgba(255, 0, 0, 0.1), 3px 3px 6px rgba(0, 0, 0, 1);
}

.supernatural-stress-value-display .stress-number.stress-1-2 {
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.4), 0 0 40px rgba(255, 0, 0, 0.3),
    0 0 60px rgba(255, 0, 0, 0.2), 3px 3px 6px rgba(0, 0, 0, 1);
}

.supernatural-stress-value-display .stress-number.stress-3-4 {
  text-shadow: 0 0 25px rgba(255, 0, 0, 0.5), 0 0 50px rgba(255, 0, 0, 0.4),
    0 0 75px rgba(255, 0, 0, 0.3), 3px 3px 6px rgba(0, 0, 0, 1);
  animation: pulse-ominous 3s ease-in-out infinite;
}

.supernatural-stress-value-display .stress-number.stress-5-6 {
  text-shadow: 0 0 30px rgba(255, 0, 0, 0.6), 0 0 60px rgba(255, 0, 0, 0.5),
    0 0 90px rgba(255, 0, 0, 0.4), 3px 3px 6px rgba(0, 0, 0, 1);
  animation: pulse-ominous 2s ease-in-out infinite;
}

.supernatural-stress-value-display .stress-number.stress-7-8 {
  text-shadow: 0 0 40px rgba(255, 0, 0, 0.8), 0 0 80px rgba(255, 0, 0, 0.7),
    0 0 120px rgba(255, 0, 0, 0.6), 0 0 160px rgba(139, 0, 0, 0.4),
    3px 3px 6px rgba(0, 0, 0, 1);
  animation: pulse-ominous 1s ease-in-out infinite, flicker 0.3s infinite;
}

.supernatural-stress-value-display .stress-number.stress-9 {
  color: #ff0000;
  text-shadow: 0 0 50px rgba(255, 0, 0, 1), 0 0 100px rgba(255, 0, 0, 0.9),
    0 0 150px rgba(255, 0, 0, 0.8), 0 0 200px rgba(139, 0, 0, 0.6),
    0 0 250px rgba(139, 0, 0, 0.4), 3px 3px 6px rgba(0, 0, 0, 1);
  animation: pulse-ominous 1.5s ease-in-out infinite, flicker 0.2s infinite,
    shake-subtle 0.7s infinite;
}

.supernatural-stress-value-display .stress-number.stress-10 {
  color: #ff0000;
  text-shadow: 0 0 60px rgba(255, 0, 0, 1), 0 0 120px rgba(255, 0, 0, 1),
    0 0 180px rgba(255, 0, 0, 0.9), 0 0 240px rgba(139, 0, 0, 0.8),
    0 0 300px rgba(139, 0, 0, 0.6), 0 0 360px rgba(139, 0, 0, 0.4),
    3px 3px 6px rgba(0, 0, 0, 1);
  animation: pulse-ominous 1s ease-in-out infinite, flicker 0.2s infinite,
    shake-subtle 0.4s infinite;
}

/* Ominous pulsing animation */
@keyframes pulse-ominous {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.05);
    filter: brightness(1.2);
  }
}

/* Flicker effect for high stress */
@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.95;
  }
}

/* Subtle shake for maximum stress */
@keyframes shake-subtle {
  0%,
  100% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(-1px) translateY(1px);
  }
  50% {
    transform: translateX(1px) translateY(-1px);
  }
  75% {
    transform: translateX(-1px) translateY(-1px);
  }
}

.supernatural-stress-value-display .stress-label {
  font-size: 0.9em;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Make the entire display box more ominous at high stress */
.supernatural-stress-value-display.high-stress {
  box-shadow: inset 0 0 30px rgba(139, 0, 0, 0.5), 0 0 50px rgba(139, 0, 0, 0.4);
  animation: box-pulse 2s ease-in-out infinite;
}

@keyframes box-pulse {
  0%,
  100% {
    border-color: #8b0000;
  }
  50% {
    border-color: #ff0000;
  }
}

.stress-section,
.supernatural-stress-section {
  background: #1a1a1a;
  /*border: 2px solid #8B0000;*/
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
  border: 1px solid #333;
}

.supernatural-stress-warning {
  color: #888;
  font-style: italic;
  font-size: 0.9em;
  margin-bottom: 15px;
  text-align: center;
}

.supernatural-stress-button {
  background: #622;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  cursor: pointer;
  width: 100%;
  margin-top: 0;
}

.supernatural-stress-button:hover {
  background: #833;
}

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.summary-card {
  background: #222;
  border: 1px solid #317e30;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.summary-card h3 {
  color: #317e30;
  margin: 0 0 10px 0;
  font-size: 0.95em;
}

.summary-count {
  font-size: 2.5em;
  font-weight: bold;
  color: #317e30;
  margin: 10px 0;
}

.summary-label {
  color: #aaa;
  font-size: 0.9em;
  margin: 0;
}

/* Skills Table */
.skills-table-container {
  margin-top: 15px;
  overflow-x: auto;
}

.skills-table {
  width: 100%;
  border-collapse: collapse;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

.skills-table thead {
  background: #222;
  border-bottom: 2px solid #317e30;
}

.skills-table th {
  color: #317e30;
  padding: 12px;
  text-align: left;
  font-weight: bold;
  font-size: 0.95em;
}

.skills-table tbody tr {
  border-bottom: 1px solid #333;
  transition: background-color 0.2s ease;
}

.skills-table tbody tr:hover {
  background: #222;
}

.skills-table tbody tr:last-child {
  border-bottom: none;
}

.skills-table td {
  padding: 12px;
  color: #ddd;
}

.skills-table select,
.skills-table input {
  background: #222;
  color: #eee;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 0.9em;
  width: 100%;
  cursor: pointer;
}

.skills-table select:focus,
.skills-table input:focus {
  outline: none;
  border-color: #317e30;
  box-shadow: 0 0 5px rgba(49, 126, 48, 0.3);
}

.skills-table .remove-skill-btn {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  width: 100%;
}

.skills-table .remove-skill-btn:hover {
  background: #f44336;
}

.add-skill-btn {
  background: #317e30;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 15px;
  font-size: 0.95em;
  font-weight: bold;
}

.add-skill-btn:hover {
  background: #3c963b;
}

/* ==================== TYPE ABILITIES TABLE STYLING ==================== */

.type-abilities-section {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 20px;
}

.type-abilities-filter {
  background: #1a1a1a;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #444;
  margin-bottom: 20px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  color: #888;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.filter-group select {
  width: 100%;
  padding: 8px 12px;
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 4px;
  color: #fff;
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-group select:hover {
  border-color: #317e30;
}

.filter-group select:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.filter-actions button {
  padding: 8px 16px;
  background: #444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s ease;
}

.filter-actions button:hover {
  background: #555;
  transform: translateY(-1px);
}

.filter-actions .clear-filters-btn {
  background: #666;
}

.filter-actions .clear-filters-btn:hover {
  background: #777;
}

/* View Toggle Buttons */
.filter-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 15px;
  border-top: 1px solid #333;
  margin-top: 15px;
}

.filter-buttons span {
  color: #ddd;
  font-weight: 500;
}

.filter-btn {
  padding: 8px 16px;
  background: #1a1a1a;
  border: 2px solid #444;
  color: #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95em;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: #2a2a2a;
  border-color: #317e30;
}

.filter-btn.active {
  background: #317e30;
  border-color: #4caf50;
  color: #fff;
  font-weight: 500;
}

/* Type Abilities Cards */
.type-abilities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-ability-card {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.type-ability-card:hover {
  border-color: #317e30;
  box-shadow: 0 4px 12px rgba(49, 126, 48, 0.2);
}

.type-ability-card.selected-ability {
  border-color: #317e30;
  background: rgba(49, 126, 48, 0.1);
  box-shadow: 0 0 15px rgba(49, 126, 48, 0.3);
}

/* Card Header */
.type-ability-header {
  display: grid;
  grid-template-columns: 50px 1fr auto auto auto auto;
  gap: 15px;
  align-items: center;
  padding: 12px 15px;
  background: #2a2a2a;
  border-bottom: 1px solid #444;
}

.ability-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ability-toggle-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: #444;
  border: 2px solid #666;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  color: #888;
}

.ability-toggle-btn:hover {
  background: #555;
  border-color: #777;
  transform: scale(1.05);
}

.ability-toggle-btn.selected {
  background: #317e30;
  border-color: #4caf50;
  color: white;
}

.ability-toggle-btn.selected::after {
  content: "✓";
}

.ability-toggle-btn:disabled {
  background: #333;
  border-color: #444;
  cursor: not-allowed;
  opacity: 0.5;
}

.ability-toggle-btn:disabled:hover {
  transform: none;
}

.ability-name-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ability-name {
  color: #fff;
  font-weight: 600;
  font-size: 1.05em;
}

.supernatural-ability-name {
  color: #b19cd9;
  font-weight: bold;
}

.ability-tier-badge,
.ability-stat-badge,
.ability-points-badge,
.ability-stress-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.badge-label {
  font-size: 0.7em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-value {
  font-weight: 600;
  font-size: 0.95em;
  color: #ddd;
}

.ability-tier-badge .badge-value {
  color: #ffd700;
}

.ability-stat-badge .badge-value {
  color: #4caf50;
}

.ability-points-badge .badge-value {
  color: #2196f3;
}

.ability-stress-badge .badge-value {
  color: #ff6666;
}

/* Card Body - Description */
.type-ability-description {
  padding: 15px;
  color: #ddd;
  line-height: 1.6;
  font-size: 0.95em;
  background: #1a1a1a;
}

.type-ability-description p {
  margin: 0;
}

/* Empty State */
.type-abilities-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
}

/* Ability Counter */
#typeAbilityCounter {
  background: #1a1a1a;
  border: 2px solid #317e30;
  border-radius: 6px;
  padding: 12px 20px;
  margin-bottom: 15px;
  text-align: center;
  font-size: 1.1em;
  font-weight: 600;
  color: #4caf50;
}

/* Responsive Design */
@media (max-width: 768px) {
  .type-ability-header {
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }

  .ability-tier-badge,
  .ability-stat-badge,
  .ability-points-badge,
  .ability-stress-badge {
    display: none;
  }

  .ability-name-cell::after {
    content: attr(data-meta);
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    flex-direction: column;
  }

  .filter-actions button {
    width: 100%;
  }
}

/* Remove old table styles for type abilities */
.type-abilities-table {
  display: none;
}

/* ==================== FOCUS ABILITIES STYLING ==================== */

.focus-abilities-section {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 20px;
}

/* Tier Headers */
.focus-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: #1a1a1a;
  border: 2px solid #317e30;
  border-radius: 6px;
  margin-bottom: 12px;
  margin-top: 20px;
}

.focus-tier-header:first-child {
  margin-top: 0;
}

.focus-tier-header h3 {
  margin: 0;
  color: #4caf50;
  font-size: 1.2em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tier-rule {
  color: #888;
  font-size: 0.9em;
  font-style: italic;
}

/* Focus Abilities List */
.focus-abilities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.focus-ability-card {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.focus-ability-card:hover {
  border-color: #317e30;
  box-shadow: 0 4px 12px rgba(49, 126, 48, 0.2);
}

.focus-ability-card.selected-ability {
  border-color: #317e30;
  background: rgba(49, 126, 48, 0.1);
  box-shadow: 0 0 15px rgba(49, 126, 48, 0.3);
}

/* Card Header */
.focus-ability-header {
  display: grid;
  grid-template-columns: 100px 1fr auto auto auto;
  gap: 15px;
  align-items: center;
  padding: 12px 15px;
  background: #2a2a2a;
  border-bottom: 1px solid #444;
}

/* Status Badges */
.ability-status-badge {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ability-status-badge.auto-gained {
  background: #4caf50;
  color: white;
}

.ability-status-badge.chosen {
  background: #2196f3;
  color: white;
}

.ability-status-badge.extra {
  background: #ffd700;
  color: #000;
}

.ability-status-badge.unavailable {
  background: #555;
  color: #888;
}

/* Choice Buttons */
.ability-choice-btn,
.ability-extra-btn {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ability-choice-btn {
  background: #317e30;
  color: white;
}

.ability-choice-btn:hover {
  background: #4caf50;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.ability-extra-btn {
  background: #ffd700;
  color: #000;
  font-size: 0.75em;
  padding: 6px 8px;
}

.ability-extra-btn:hover {
  background: #ffed4e;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* Card Description */
.focus-ability-description {
  padding: 15px;
  color: #ddd;
  line-height: 1.6;
  font-size: 0.95em;
  background: #1a1a1a;
}

.focus-ability-description p {
  margin: 0;
}

/* Empty State */
.focus-abilities-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .focus-ability-header {
    grid-template-columns: 90px 1fr;
    gap: 10px;
  }

  .ability-tier-badge,
  .ability-stat-badge,
  .ability-points-badge {
    display: none;
  }

  .ability-name-cell::after {
    content: attr(data-meta);
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
  }

  .focus-tier-header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .ability-choice-btn,
  .ability-extra-btn {
    font-size: 0.75em;
    padding: 6px 8px;
  }
}

/* ==================== CYPHER SECTION HEADER ==================== */

.cypher-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 2px solid #317e30;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(49, 126, 48, 0.2);
}

.draw-cypher-btn {
  padding: 15px 40px;
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border: 2px solid #4caf50;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 4px 12px rgba(49, 126, 48, 0.3);
  order: 1; /* Left side */
}

.draw-cypher-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  border-color: #66bb6a;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

.draw-cypher-btn:active:not(:disabled) {
  transform: translateY(-1px);
}

.draw-cypher-btn:disabled {
  background: #555;
  border-color: #666;
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.draw-cypher-btn:disabled:hover {
  transform: none;
}

.cypher-slots-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  order: 2; /* Right side */
}

.cypher-slots-label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.cypher-slots-numbers {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cypher-slots-used {
  font-size: 2.5em;
  font-weight: bold;
  color: #4caf50;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
}

.cypher-slots-separator {
  font-size: 2em;
  color: #666;
  font-weight: bold;
}

.cypher-slots-total {
  font-size: 2.5em;
  font-weight: bold;
  color: #66bb6a;
  font-family: "Courier New", monospace;
  text-shadow: 0 0 10px rgba(102, 187, 106, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
  .cypher-section-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .draw-cypher-btn {
    width: 100%;
    padding: 15px 30px;
    order: 2; /* Move button below slots on mobile */
  }

  .cypher-slots-display {
    order: 1; /* Move slots above button on mobile */
    width: 100%;
  }

  .cypher-slots-numbers {
    font-size: 1.2em;
  }
}

/* ==================== CYPHER CARD STYLING ==================== */

.cyphers-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 15px;
  background: transparent;
  border: none;
}

.cyphers-table thead {
  background: transparent;
  border: none;
}

.cyphers-table thead th {
  display: none;
}

.cypher-card-row {
  border: none;
}

.cypher-card-row:hover {
  background: transparent;
}

.cypher-card-cell {
  padding: 0 !important;
  border: none !important;
}

/* Cypher Card */
.cypher-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(49, 126, 48, 0.3);
  transition: all 0.3s ease;
}

.cypher-card:hover {
  border-color: #4caf50;
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  transform: translateY(-2px);
}

/* Card Header */
.cypher-card-header {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 20px;
  text-align: center;
  border-bottom: 2px solid #317e30;
}

.cypher-name {
  margin: 0;
  color: #4caf50;
  font-size: 1.5em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Card Meta (Action and Level) */
.cypher-card-meta {
  background: #000;
  padding: 12px 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  border-bottom: 1px solid #317e30;
}

.cypher-action,
.cypher-level {
  color: #ddd;
  font-size: 1em;
  font-weight: 500;
}

.cypher-action {
  color: #4caf50;
}

.cypher-level {
  color: #ffd700;
  font-weight: bold;
}

.cypher-divider {
  color: #666;
  font-size: 1.2em;
}

/* Card Effect */
.cypher-card-effect {
  padding: 25px 30px;
  color: #ddd;
  font-size: 1.05em;
  line-height: 1.7;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card Footer */
.cypher-card-footer {
  background: #1a1a1a;
  padding: 15px 20px;
  text-align: center;
  border-top: 2px solid #317e30;
}

.use-cypher-btn {
  width: 100%;
  max-width: 400px;
  padding: 12px 20px;
  background: #317e30;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.use-cypher-btn:hover {
  background: #4caf50;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

.use-cypher-btn:active {
  transform: translateY(0);
}

/* Empty Cypher Card */
.cypher-card-empty {
  background: #1a1a1a;
  border: 2px dashed #444;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cypher-card-empty:hover {
  border-color: #555;
  box-shadow: none;
  transform: none;
}

.cypher-empty-content {
  text-align: center;
  padding: 40px 20px;
}

.cypher-empty-text {
  color: #666;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
  .cypher-card-header {
    padding: 15px;
  }

  .cypher-name {
    font-size: 1.2em;
    letter-spacing: 1px;
  }

  .cypher-card-meta {
    padding: 10px 15px;
    font-size: 0.9em;
  }

  .cypher-card-effect {
    padding: 20px;
    font-size: 0.95em;
  }

  .cypher-card-footer {
    padding: 12px 15px;
  }

  .use-cypher-btn {
    font-size: 0.9em;
    padding: 10px 15px;
  }
}

/* ==================== TAB NAVIGATION ==================== */

.tab-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-content: center;
  gap: 0;
  margin-bottom: 30px;
  padding: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 2px solid #317e30;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.tab-button {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  color: #888;
  border: none;
  border-right: 1px solid #444;
  padding: 14px 10px;
  font-family: "libre baskerville", serif;
  font-size: 0.8em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Remove right border from last button in each row */
.tab-button:nth-child(4n) {
  border-right: none;
}

/* Add bottom border to first row */
.tab-button:nth-child(-n + 4) {
  border-bottom: 1px solid #444;
}

.tab-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(49, 126, 48, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.tab-button:hover::before {
  left: 100%;
}

.tab-button:hover {
  color: #4caf50;
  background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
  z-index: 1;
}

.tab-button.active {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: #fff;
  box-shadow: inset 0 0 10px rgba(76, 175, 80, 0.3);
  z-index: 2;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: #4caf50;
  box-shadow: 0 0 10px #4caf50;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .tab-button {
    padding: 12px 8px;
    font-size: 0.75em;
  }
}

@media (max-width: 768px) {
  .tab-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Adjust borders for 2-column layout */
  .tab-button:nth-child(4n) {
    border-right: 1px solid #444;
  }

  .tab-button:nth-child(2n) {
    border-right: none;
  }

  .tab-button:nth-child(-n + 4) {
    border-bottom: 1px solid #444;
  }

  .tab-button:nth-child(n + 3) {
    border-bottom: 1px solid #444;
  }

  .tab-button:nth-child(n + 7) {
    border-bottom: none;
  }

  .tab-button {
    padding: 14px 10px;
    font-size: 0.75em;
  }
}

@media (max-width: 480px) {
  .tab-buttons {
    grid-template-columns: 1fr;
  }

  .tab-button {
    border-right: none;
    border-bottom: 1px solid #444;
  }

  .tab-button:last-child {
    border-bottom: none;
  }
}

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-in;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== AVATAR TAB SPECIAL STYLING ==================== */

.tab-button[data-tab="avatar"] {
  background: linear-gradient(135deg, #2a1a1a 0%, #1a0d0d 100%);
  border-right: 1px solid #661111;
  color: #aa4444;
}

.tab-button[data-tab="avatar"]::before {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(170, 68, 68, 0.3),
    transparent
  );
}

.tab-button[data-tab="avatar"]:hover {
  color: #ff4444;
  border-color: #aa3333;
  background: linear-gradient(135deg, #3a1a1a 0%, #2a0d0d 100%);
  box-shadow: 0 4px 12px rgba(170, 68, 68, 0.3);
}

.tab-button[data-tab="avatar"].active {
  background: linear-gradient(135deg, #7e3030 0%, #652828 100%);
  color: #fff;
  border-color: #ff4444;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.6),
    inset 0 0 10px rgba(255, 68, 68, 0.3);
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

.tab-button[data-tab="avatar"].active::after {
  background: #ff4444;
  box-shadow: 0 0 10px #ff4444, 0 0 20px rgba(255, 68, 68, 0.5);
}

/* Add a subtle pulsing effect when active */
.tab-button[data-tab="avatar"].active {
  animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.6),
      inset 0 0 10px rgba(255, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.8),
      inset 0 0 15px rgba(255, 68, 68, 0.4);
  }
}

/* Optional: Add a "corrupted" icon or effect */

.tab-button[data-tab="avatar"]:hover::after,
.tab-button[data-tab="avatar"].active::after {
  opacity: 1;
}

/* ==================== 3D DICE ROLLER MODAL ==================== */

.dice-roller-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.dice-roller-container {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  max-width: 800px;
  width: 85%;
  max-height: 85vh; /* Reduced from 90vh */
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(49, 126, 48, 0.5);
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dice-roller-header {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 15px 20px;
  border-bottom: 2px solid #317e30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.dice-roller-header h2 {
  margin: 0;
  color: #4caf50;
  font-size: 1.3em;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.dice-close-button {
  background: none;
  border: none;
  color: #888;
  font-size: 2em;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.dice-close-button:hover {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
}

.dice-roller-content {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dice-canvas-container {
  width: 100%;
  height: 450px;
  background: #000 url("magnusbackground.jpg") center center;
  background-size: cover;
  border-bottom: 2px solid #317e30;
  position: relative;
  flex-shrink: 0;
}

/* Add overlay to darken background slightly for better dice visibility */
.dice-canvas-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 0;
}

.dice-canvas-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  position: relative;
  z-index: 1;
}

.dice-result-area {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  padding: 20px;
}

/* Make buttons constrained width */
.dice-result-area > .dice-button {
  width: 100%;
  max-width: 400px;
  padding: 12px;
  font-size: 1.1em;
}

#manualInputRow {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  max-width: 400px;
  margin: 0 auto;
}

#manualInputRow span {
  color: #888;
  font-size: 0.9em;
  white-space: nowrap;
}

#manualInputRow input {
  width: 70px;
  padding: 8px;
  background: #1a1a1a;
  border: 2px solid #317e30;
  border-radius: 4px;
  color: white;
  font-size: 1em;
  text-align: center;
  font-family: "Courier New", monospace;
}

#manualInputRow input:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

#manualInputRow button {
  padding: 8px 16px;
  background: #555;
  color: white;
  border: 2px solid #666;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
}

#manualInputRow button:hover {
  background: #666;
  transform: translateY(-1px);
}

#diceResult {
  display: none;
  font-size: 1.8em;
  color: #4caf50;
  text-align: center;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
  padding: 12px;
  background: #2a2a2a;
  border-radius: 6px;
  border: 2px solid #317e30;
}

#diceResult.critical-success {
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 1);
  animation: pulse 1s infinite;
  border-color: #ffd700;
}

#diceResult.critical-failure {
  color: #ff1744;
  text-shadow: 0 0 20px rgba(255, 23, 68, 1);
  animation: shake 0.5s;
  border-color: #ff1744;
}

.dice-button {
  padding: 12px 25px;
  font-size: 1em;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid;
  flex: 1;
  max-width: 180px;
  min-width: 120px;
}

#rollDiceButton {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border-color: #4caf50;
  box-shadow: 0 3px 10px rgba(49, 126, 48, 0.3);
}

#rollDiceButton:hover:not(:disabled) {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

#rollDiceButton:disabled {
  background: #555;
  border-color: #666;
  color: #888;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

#rerollDiceButton {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  color: white;
  border-color: #ffb74d;
  box-shadow: 0 3px 10px rgba(255, 152, 0, 0.3);
}

#rerollDiceButton:hover {
  background: linear-gradient(135deg, #ffb74d 0%, #ff9800 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 183, 77, 0.5);
}

#acceptDiceButton {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
  color: white;
  border-color: #66bb6a;
  box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

#acceptDiceButton:hover {
  background: linear-gradient(135deg, #66bb6a 0%, #4caf50 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 187, 106, 0.5);
}

#closeDiceButton {
  background: linear-gradient(135deg, #555 0%, #444 100%);
  color: white;
  border-color: #666;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

#closeDiceButton:hover {
  background: linear-gradient(135deg, #666 0%, #555 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .dice-roller-container {
    width: 95%;
    max-height: 90vh;
  }

  .dice-canvas-container {
    height: 300px;
  }

  /*.dice-button-group {
    flex-direction: column;
  }*/

  .dice-button {
    max-width: none;
    min-width: auto;
  }
}

@media (max-height: 700px) {
  .dice-canvas-container {
    height: 300px;
  }

  .dice-result-area {
    padding: 15px;
    gap: 10px;
  }

  #diceResult {
    font-size: 1.5em;
    padding: 10px;
  }

  .dice-button {
    padding: 10px 20px;
    font-size: 0.9em;
  }
}

/* ==================== CALCULATORS TAB ==================== */

/* ==================== QUICK DICE ROLLS STYLING ==================== */

.quick-dice-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 3px solid #317e30;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 8px 30px rgba(49, 126, 48, 0.3);
  position: relative;
  overflow: hidden;
}

.quick-dice-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #317e30 20%,
    #4caf50 50%,
    #317e30 80%,
    transparent 100%
  );
  animation: shimmer 3s infinite;
}

.quick-dice-section h2 {
  margin: 0 0 10px 0;
  color: #4caf50;
  font-size: 1.5em;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
  border: none;
  padding: 0;
}

.quick-dice-description {
  color: #888;
  font-size: 0.95em;
  margin: 0 0 25px 0;
  text-align: center;
  line-height: 1.6;
}

.quick-dice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}

.quick-dice-card {
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.quick-dice-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(49, 126, 48, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.quick-dice-card:hover::before {
  left: 100%;
}

.quick-dice-card:hover {
  border-color: #317e30;
  box-shadow: 0 6px 20px rgba(49, 126, 48, 0.4);
  transform: translateY(-5px);
}

.quick-dice-icon {
  font-size: 3.5em;
  animation: dice-float 3s ease-in-out infinite;
}

@keyframes dice-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

.quick-dice-card:hover .quick-dice-icon {
  animation: dice-spin 0.6s ease-in-out;
}

@keyframes dice-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.quick-dice-label {
  color: #4caf50;
  font-size: 1.4em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.quick-dice-info {
  color: #666;
  font-size: 0.9em;
  font-style: italic;
  margin-bottom: 8px;
}

.quick-dice-btn {
  width: 100%;
  padding: 15px 25px;
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border: 2px solid #4caf50;
  border-radius: 6px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 3px 10px rgba(49, 126, 48, 0.3);
}

.quick-dice-btn:hover {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.quick-dice-btn:active {
  transform: translateY(0);
}

/* Specific dice styling */
.d6-card {
  border-color: #2196f3;
}

.d6-card:hover {
  border-color: #42a5f5;
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
}

.d6-card .quick-dice-label {
  color: #2196f3;
  text-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

.d6-card .quick-dice-btn {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  border-color: #2196f3;
}

.d6-card .quick-dice-btn:hover {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.d20-card {
  border-color: #9c27b0;
}

.d20-card:hover {
  border-color: #ab47bc;
  box-shadow: 0 6px 20px rgba(156, 39, 176, 0.4);
}

.d20-card .quick-dice-label {
  color: #9c27b0;
  text-shadow: 0 0 10px rgba(156, 39, 176, 0.5);
}

.d20-card .quick-dice-btn {
  background: linear-gradient(135deg, #7b1fa2 0%, #6a1b9a 100%);
  border-color: #9c27b0;
}

.d20-card .quick-dice-btn:hover {
  background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
  .quick-dice-section {
    padding: 20px;
  }

  .quick-dice-section h2 {
    font-size: 1.3em;
  }

  .quick-dice-grid {
    grid-template-columns: 1fr;
    max-width: 350px;
  }

  .quick-dice-card {
    padding: 20px;
  }

  .quick-dice-icon {
    font-size: 3em;
  }

  .quick-dice-label {
    font-size: 1.2em;
  }

  .quick-dice-btn {
    padding: 12px 20px;
    font-size: 1em;
  }
}

/* Manual Dice Roll Section */
.manual-roll-divider {
  color: #666;
  font-size: 0.85em;
  margin: 15px 0 10px 0;
  text-align: center;
  font-weight: 500;
}

.manual-roll-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manual-roll-label {
  color: #888;
  font-size: 0.85em;
  text-align: center;
}

.manual-roll-input {
  width: 100%;
  padding: 10px;
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 4px;
  color: white;
  font-size: 1.1em;
  text-align: center;
  transition: all 0.2s ease;
}

.manual-roll-input:focus {
  outline: none;
  border-color: #4caf50;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
}

.manual-roll-input::placeholder {
  color: #555;
}

.manual-roll-btn {
  width: 100%;
  padding: 10px 15px;
  background: linear-gradient(135deg, #555 0%, #444 100%);
  color: white;
  border: 2px solid #666;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.manual-roll-btn:hover {
  background: linear-gradient(135deg, #666 0%, #555 100%);
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.manual-roll-btn:active {
  transform: translateY(0);
}

/* ==================== COLLAPSIBLE CALCULATORS ==================== */

.calculator-collapsible {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.calculator-collapsible:hover {
  border-color: #4caf50;
  box-shadow: 0 4px 15px rgba(49, 126, 48, 0.2);
}

.calculator-collapsible[open] {
  border-color: #4caf50;
  box-shadow: 0 4px 15px rgba(49, 126, 48, 0.3);
}

.calculator-summary {
  cursor: pointer;
  padding: 20px;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  color: #4caf50;
  font-size: 1.2em;
  font-weight: bold;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.calculator-summary::-webkit-details-marker {
  display: none;
}

.calculator-summary::before {
  content: "▶";
  display: inline-block;
  font-size: 1em;
  transition: transform 0.3s ease;
  color: #4caf50;
  width: 20px;
  text-align: center;
}

.calculator-collapsible[open] .calculator-summary::before {
  transform: rotate(90deg);
}

.calculator-summary:hover {
  background: linear-gradient(135deg, #333 0%, #222 100%);
  color: #5bc55b;
  border-bottom-color: #4caf50;
}

.calculator-icon {
  font-size: 1.3em;
  display: inline-block;
  width: 30px;
  text-align: center;
}

.calculator-collapsible[open] .calculator-summary {
  border-bottom-color: #317e30;
  margin-bottom: 20px;
}

/* Adjust calculator-section padding when inside collapsible */
.calculator-collapsible .calculator-section {
  padding: 0 20px 20px 20px;
  background: transparent;
  border: none;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .calculator-summary {
    padding: 15px;
    font-size: 1em;
  }

  .calculator-icon {
    font-size: 1.1em;
    width: 25px;
  }

  .calculator-collapsible .calculator-section {
    padding: 0 10px 15px 10px;
  }
}

.calculator-section {
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
}

.calculator-section h3 {
  font-family: "Libre Baskerville", serif;
  color: #317e30;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.5em;
}

.calculator-container {
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 20px;
}

.calculator-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.calculator-table tr {
  border-bottom: 1px solid #333;
}

.calculator-table tr:last-child {
  border-bottom: none;
}

.calculator-label {
  padding: 12px;
  color: #888;
  font-weight: bold;
  width: 30%;
  vertical-align: middle;
}

.calculator-input {
  padding: 12px;
  width: 35%;
}

.calculator-input select,
.calculator-input input {
  width: 100%;
  padding: 8px;
  background: #2a2a2a;
  border: 2px solid #317e30;
  border-radius: 4px;
  color: #fff;
  font-size: 1em;
}

.calculator-input input[type="number"] {
  text-align: center;
}

.calculator-info {
  padding: 12px;
  color: #888;
  font-size: 0.9em;
  width: 35%;
}

.calculator-result-row {
  background: #252525;
}

.calculator-result-row .calculator-label {
  color: #317e30;
  font-size: 1.1em;
}

.calculator-display {
  padding: 12px;
  color: #fff;
  font-size: 1.2em;
  font-weight: bold;
}

.calculator-display .target-number {
  color: #317e30;
  font-size: 1.5em;
}

.calculator-action {
  padding: 20px 12px;
  text-align: center;
}

.calculator-roll-btn {
  width: 100%;
  padding: 15px;
  font-size: 1.2em;
  font-weight: bold;
}

.calculator-roll-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dice-result {
  color: #ff6666;
  font-size: 2em;
  font-weight: bold;
}

/* Result Boxes */
.calculator-results {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.result-box {
  background: #252525;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 20px;
}

.result-box h4 {
  color: #317e30;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.result-box p {
  color: #fff;
  font-size: 1.1em;
  line-height: 1.6;
  margin: 0;
}

.result-box.success {
  border-color: #317e30;
  background: #1a2a1a;
}

.result-box.failure {
  border-color: #8b0000;
  background: #2a1a1a;
}

.result-box.critical {
  border-color: #ffd700;
  background: #2a2a1a;
}

.placeholder-text {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

/* Responsive */
@media (max-width: 900px) {
  .calculator-results .calculator-table {
    font-size: 0.9em;
  }

  .calculator-label,
  .calculator-input,
  .calculator-info {
    display: block;
    width: 100%;
  }

  .calculator-table tr {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 10px 0;
  }
}

.calculator-confirm-section {
  margin-top: 15px;
  padding: 15px;
  background: #2a2a2a;
  border-radius: 6px;
}

.calculator-confirm-btn {
  width: 100%; /* Full width */
  padding: 15px;
  font-size: 1.2em;
  font-weight: bold;
  background: #317e30;
}

.calculator-confirm-btn:hover {
  background: #3c963b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(49, 126, 48, 0.4);
}

/* ==================== AVATAR TAB STYLING ==================== */

/* Password Overlay */
.avatar-password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-password-container {
  background: #1a1a1a;
  border: 3px solid #8b0000;
  border-radius: 12px;
  padding: 40px;
  max-width: 600px;
  text-align: center;
  box-shadow: 0 0 30px rgba(139, 0, 0, 0.6);
}

.avatar-password-container h2 {
  color: #ff4444;
  font-size: 2em;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.avatar-warning-text {
  color: #ddd;
  font-size: 1.1em;
  line-height: 1.8;
  margin-bottom: 30px;
}

.avatar-warning-text strong {
  color: #ff4444;
}

.avatar-password-input-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.avatar-password-input-section label {
  color: #888;
  font-size: 0.9em;
}

.avatar-password-input-section input {
  padding: 15px;
  font-size: 1.2em;
  background: #2a2a2a;
  border: 2px solid #8b0000;
  border-radius: 6px;
  color: #fff;
  text-align: center;
}

.avatar-password-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.avatar-password-buttons .button {
  padding: 15px;
  font-size: 1em;
  font-weight: bold;
}

/* Secondary Button Style */
.secondary-button {
  background: #444;
  color: white;
  border: 2px solid #666;
}

.secondary-button:hover {
  background: #555;
  border-color: #777;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(68, 68, 68, 0.4);
}

@media (max-width: 600px) {
  .avatar-password-buttons {
    grid-template-columns: 1fr;
  }
}

/* Warning Boxes */
.avatar-warning-box {
  background: #2a1a1a;
  border: 3px solid #8b0000;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
}

.avatar-warning-box h3 {
  color: #ff4444;
  margin-top: 0;
  text-align: center;
}

.avatar-warning-box p {
  color: #ddd;
  line-height: 1.8;
  margin-bottom: 15px;
  text-align: center;
}

.avatar-warning-box strong {
  color: #ff6666;
}

.avatar-final-warning {
  text-align: center;
  font-size: 1.1em;
  color: #ff4444 !important;
  margin-top: 20px;
}

/* Entity Selection */
.entity-selection-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.entity-selection-section label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#entitySelect {
  width: 100%;
  padding: 15px;
  background: #2a2a2a;
  border: 2px solid #8b0000;
  border-radius: 6px;
  color: #fff;
  font-size: 1.1em;
}

.entity-description-box {
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 15px;
}

.entity-description-box textarea {
  width: 100%;
  min-height: 120px;
  background: transparent;
  border: none;
  color: #ddd;
  font-size: 1.2em;
  line-height: 1.6;
  resize: vertical;
  text-align: center;
}

.confirm-entity-btn {
  width: 100%;
  padding: 20px;
  font-size: 1.2em;
  font-weight: bold;
}

/* Danger Button */
.danger-button {
  background: #8b0000;
  color: white;
  border: 2px solid #660000;
}

.danger-button:hover {
  background: #660000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.6);
}

/* Committed State */

/* Avatar Header with Tarot Card */
.avatar-header-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.avatar-tarot-card {
  position: sticky;
  top: 20px;
  align-self: start;
}

.avatar-tarot-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 3px solid #8b0000;
  box-shadow: 0 4px 20px rgba(139, 0, 0, 0.5);
  display: block;
}

.avatar-header-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Responsive layout for tarot card */
@media (max-width: 900px) {
  .avatar-header-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .avatar-tarot-card {
    position: relative;
    top: 0;
    max-width: 300px;
    margin: 0 auto;
  }
}

.avatar-committed-box {
  background: #1a1a2a;
  border: 3px solid #8b0000;
  border-radius: 8px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.3);
}

.avatar-commitment-text {
  color: #ff6666;
  font-size: 1.1em;
  line-height: 1.8;
  text-align: center;
  font-style: italic;
}

.avatar-statement-box {
  background: #2a2a2a;
  border: 2px solid #ff4444;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.avatar-statement-box h3 {
  color: #f44444;
  margin-top: 0;
}

.avatar-statement-box p {
  color: #ddd;
  font-size: 1.1em;
  line-height: 1.6;
}

/* Avatar Powers Section */
.avatar-power-info {
  background: #2a2a2a;
  border: 2px solid #444;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.avatar-power-section h2 {
  font-family: "Libre Baskerville", serif;
  color: #ff4444;
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
}

.avatar-power-info p {
  color: #ddd;
  margin: 0;
  line-height: 1.6;
}

.avatar-power-info strong {
  color: #ff4444;
}

.selected-power-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2a2a2a;
  border: 2px solid #8b0000;
  border-radius: 6px;
  padding: 15px 20px;
  margin-bottom: 20px;
}

.selected-power-item {
  display: flex;
  gap: 10px;
  align-items: center;
}

.selected-power-label {
  color: #888;
  font-size: 0.9em;
  text-transform: uppercase;
}

.selected-power-value {
  color: #ff6666;
  font-size: 1.2em;
  font-weight: bold;
}

/* Avatar Powers Table */
.avatar-powers-table-container {
  overflow-x: auto;
  margin-top: 20px;
}

/* ==================== AVATAR POWERS STYLING ==================== */

.avatar-powers-section {
  background: #2a1a1a;
  border: 2px solid #8b0000;
  border-radius: 8px;
  padding: 20px;
}

/* Avatar Powers Cards */
.avatar-powers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.avatar-power-card {
  background: #1a1a1a;
  border: 2px solid #661111;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.avatar-power-card:hover {
  border-color: #8b0000;
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.3);
}

.avatar-power-card.selected-power {
  border-color: #ff4444;
  background: rgba(139, 0, 0, 0.1);
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
}

/* Card Header */
.avatar-power-header {
  display: grid;
  grid-template-columns: 50px 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 15px;
  background: #2a1a1a;
  border-bottom: 1px solid #661111;
}

.power-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.power-toggle-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: #444;
  border: 2px solid #666;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  color: #888;
}

.power-toggle-btn:hover {
  background: #555;
  border-color: #777;
  transform: scale(1.05);
}

.power-toggle-btn.selected {
  background: #8b0000;
  border-color: #ff4444;
  color: white;
}

.power-toggle-btn.selected::after {
  content: "✓";
}

.power-toggle-btn.universal {
  background: #333;
  border-color: #555;
  cursor: default;
}

.power-toggle-btn.universal::after {
  content: "⚡";
  color: #ffd700;
}

.power-toggle-btn:disabled {
  background: #333;
  border-color: #444;
  cursor: not-allowed;
  opacity: 0.5;
}

.power-toggle-btn:disabled:hover {
  transform: none;
}

.power-name-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.power-name {
  color: #fff;
  font-weight: 600;
  font-size: 1.05em;
}

.universal-power-name {
  color: #ffd700;
  font-weight: bold;
}

.entity-power-name {
  color: #ff6666;
  font-weight: bold;
}

.power-cost-badge,
.power-stress-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.badge-label {
  font-size: 0.7em;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-value {
  font-weight: 600;
  font-size: 0.95em;
  color: #ddd;
}

.power-cost-badge .badge-value {
  color: #9c27b0;
}

.power-stress-badge .badge-value {
  color: #ff6666;
}

/* Compact Use Power Button in Header */
.use-power-btn-compact {
  padding: 8px 16px;
  background: linear-gradient(135deg, #7e3030 0%, #652828 100%);
  color: white;
  border: 2px solid #ff4444;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(139, 0, 0, 0.3);
}

.use-power-btn-compact:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b0000 0%, #7e3030 100%);
  border-color: #ff6666;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(255, 68, 68, 0.5);
}

.use-power-btn-compact:active:not(:disabled) {
  transform: translateY(0);
}

.use-power-btn-compact:disabled {
  background: #444;
  border-color: #555;
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.use-power-btn-compact:disabled:hover {
  transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .avatar-power-header {
    grid-template-columns: 40px 1fr auto;
    gap: 8px;
  }

  .power-cost-badge,
  .power-stress-badge {
    display: none;
  }

  .use-power-btn-compact {
    padding: 6px 12px;
    font-size: 0.75em;
  }

  .power-name-cell::after {
    content: attr(data-meta);
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
  }
}

/* Card Body - Description */
.avatar-power-description {
  padding: 15px;
  color: #ddd;
  line-height: 1.6;
  font-size: 0.95em;
  background: #1a1a1a;
}

.avatar-power-description p {
  margin: 0;
}

/* Power Type Badge */
.power-type-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.power-type-badge.universal {
  background: #333;
  color: #ffd700;
  border: 1px solid #555;
}

.power-type-badge.entity-specific {
  background: #2a1a1a;
  color: #ff6666;
  border: 1px solid #8b0000;
}

/* Empty State */
.avatar-powers-empty {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-style: italic;
}

/* Hide old table */
.avatar-powers-table-container {
  display: none;
}

.avatar-powers-table {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .avatar-power-header {
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }

  .power-cost-badge,
  .power-stress-badge,
  .power-type-badge {
    display: none;
  }

  .power-name-cell::after {
    content: attr(data-meta);
    font-size: 0.8em;
    color: #888;
    margin-top: 4px;
  }
}
/* Avatar Header Styles */
.avatar-header h1 {
  font-family: "libre baskerville", serif;
  color: #8b0000;
  text-align: center;
  font-size: 1.5em;
  margin: 20px 0;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(76, 175, 80, 0.8), 0 0 40px rgba(49, 126, 48, 0.5);
  font-weight: 700;
  position: relative;
}

.avatar-header h1::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #4caf50, transparent);
  box-shadow: 0 0 10px #4caf50;
}

.avatar-header h2 {
  color: #f44336;
  font-size: 1.5em;
  margin: 20px 0 15px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 2px solid #d32f2f;
  padding-bottom: 10px;
  text-shadow: 0 0 10px rgba(175, 20, 20, 0.5);
}

.avatar-header h3 {
  color: #8b0000;
  font-size: 1.2em;
  margin: 15px 0 10px 0;
  letter-spacing: 1px;
}

/* ==================== SAVE/LOAD SECTION ==================== */

.save-load-section {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d1a0d 100%);
  border: 2px solid #317e30;
  border-radius: 8px;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(49, 126, 48, 0.3);
}

.save-load-header {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a2a1a 100%);
  padding: 15px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4caf50;
  font-size: 1.1em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: all 0.3s ease;
  border-bottom: 2px solid #317e30;
  user-select: none;
}

.save-load-header:hover {
  background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
  color: #66bb6a;
}

.save-load-header::marker {
  color: #4caf50;
}

.save-load-icon {
  font-size: 1.3em;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.save-load-content {
  padding: 20px;
}

.save-load-info {
  background: #2a2a2a;
  border: 1px solid #317e30;
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 15px;
}

.save-load-info p {
  margin: 0;
  color: #ddd;
  font-size: 0.9em;
  line-height: 1.5;
  text-align: center;
}

.save-load-info strong {
  color: #4caf50;
}

/* 2x2 Button Grid */
.save-load-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 15px;
}

.save-load-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid;
  border-radius: 6px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  min-height: 80px;
}

.save-load-btn .btn-icon {
  font-size: 1.8em;
  transition: transform 0.3s ease;
}

.save-load-btn .btn-text {
  font-size: 0.9em;
}

.save-load-btn.primary {
  background: linear-gradient(135deg, #317e30 0%, #2a6528 100%);
  color: white;
  border-color: #4caf50;
}

.save-load-btn.primary:hover {
  background: linear-gradient(135deg, #4caf50 0%, #317e30 100%);
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.5);
}

.save-load-btn.primary:hover .btn-icon {
  transform: scale(1.2) rotate(5deg);
}

.save-load-btn.secondary {
  background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
  color: #ddd;
  border-color: #555;
}

.save-load-btn.secondary:hover {
  background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
  color: white;
  border-color: #666;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.save-load-btn.secondary:hover .btn-icon {
  transform: scale(1.2);
}

.save-load-btn:active {
  transform: translateY(-1px);
}

/* Output Display */
#output {
  background: #000;
  border: 2px solid #317e30;
  border-radius: 6px;
  padding: 15px;
  font-family: "Courier New", monospace;
  font-size: 0.85em;
  color: #4caf50;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
  box-shadow: inset 0 0 15px rgba(49, 126, 48, 0.2);
  text-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

#output::-webkit-scrollbar {
  width: 8px;
}

#output::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 10px;
}

#output::-webkit-scrollbar-thumb {
  background: #317e30;
  border-radius: 10px;
}

#output::-webkit-scrollbar-thumb:hover {
  background: #4caf50;
}

/* Responsive Design */
@media (max-width: 768px) {
  .save-load-header {
    padding: 12px 15px;
    font-size: 1em;
  }

  .save-load-content {
    padding: 15px;
  }

  .save-load-buttons {
    gap: 10px;
  }

  .save-load-btn {
    padding: 12px;
    min-height: 70px;
    font-size: 0.9em;
  }

  .save-load-btn .btn-icon {
    font-size: 1.5em;
  }

  .save-load-btn .btn-text {
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .save-load-buttons {
    grid-template-columns: 1fr;
  }

  .save-load-btn {
    min-height: 60px;
  }
}

/* ==================== DICE MANUAL INPUT - SIMPLIFIED ==================== */

#manualInputRow {
  display: flex !important;
  flex-direction: row !important;
}

#manualInputRow button:hover {
  background: #666 !important;
}

#manualDiceInput:focus {
  outline: none !important;
  border-color: #4caf50 !important;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.5) !important;
}
