/* ==========================================================================
   CALCULADORA DE ATRIBUTOS — PREMIUM DARK FANTASY STYLE
   Tema: Dark & Gold (Alinhado ao Grimório de Arton e Ameaças)
   ========================================================================== */

@font-face {
  font-family: "Tormenta";
  src: url("Tormenta.ttf") format("truetype");
}

:root {
  /* Cores de Fundo (Tema Sangue) */
  --bg-dark-base: #0a0404;
  --bg-dark-surface: #120a0a;
  --bg-dark-panel: rgba(22, 14, 14, 0.75);
  --bg-dark-panel-hover: rgba(22, 14, 14, 0.88);

  --border-color: rgba(204, 13, 13, 0.25);
  --border-glow-gold: rgba(204, 13, 13, 0.25);

  /* Cores de Texto */
  --text-primary: #e8e4e4;
  --text-secondary: #a39898;
  --text-muted: #736868;

  /* Destaques Sangue */
  --gold-primary: #cc0d0d;
  --gold-secondary: #cfa053;
  --gold-glow: rgba(204, 13, 13, 0.35);

  /* Rubi / Carmesim */
  --rubi-primary: #cc0d0d;
  --rubi-glow: rgba(204, 13, 13, 0.35);

  /* Glassmorphism */
  --glass-bg: rgba(22, 14, 14, 0.75);
  --glass-backdrop: blur(12px);
  --glass-border: rgba(204, 13, 13, 0.15);

  /* Fontes */
  --font-heading: "Tormenta", serif;
  --font-heading-fancy: "Tormenta", serif;
  --font-body: 'Segoe UI', sans-serif;

  /* Transições */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --radius-lg: 16px;
  --radius-md: 10px;
}

/* ===== TEMA ESCURO (Sombras) ===== */
.theme-dark {
  --bg-dark-base: #06070c;
  --bg-dark-surface: #0b0e1a;
  --bg-dark-panel: rgba(18, 23, 38, 0.72);
  --bg-dark-panel-hover: rgba(18, 23, 38, 0.85);
  --border-color: rgba(201, 147, 58, 0.2);
  --border-glow-gold: rgba(201, 147, 58, 0.18);
  --text-primary: #e2d8c3;
  --text-secondary: #8e7d65;
  --text-muted: #8e7d65;
  --gold-primary: #c9933a;
  --gold-secondary: #d4af37;
  --gold-glow: rgba(201, 147, 58, 0.22);
  --rubi-primary: #e0483f;
  --rubi-glow: rgba(224, 72, 63, 0.22);
  --glass-bg: rgba(18, 23, 38, 0.72);
  --glass-backdrop: blur(12px);
  --glass-border: rgba(201, 147, 58, 0.1);
}

/* ===== SELETOR DE TEMA (3 botões no header) ===== */
.theme-switcher {
  display: flex;
  gap: 3px;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 3px;
}

.theme-btn {
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 1rem;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transition: background var(--transition-fast), transform 0.1s;
  opacity: 0.5;
  line-height: 1;
}

.theme-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.15);
}

.theme-btn.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* No tema claro o fundo do switcher fica mais visível */
.theme-classic .theme-switcher {
  background: rgba(0, 0, 0, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ===== TEMA CLÁSSICO (Vermelho & Cinza Claro) ===== */
.theme-classic {
  --bg-dark-base: #f0ece4;
  --bg-dark-surface: #ffffff;
  --bg-dark-panel: #ffffff;
  --bg-dark-panel-hover: #f0ede6;
  --border-color: #b0b8c8;
  --border-glow-gold: rgba(231, 76, 60, 0.15);
  --text-primary: #2c3e50;
  --text-secondary: #4a5568;
  --text-muted: #7f8c8d;
  --gold-primary: #e74c3c;
  --gold-secondary: #c0392b;
  --gold-glow: rgba(231, 76, 60, 0.2);
  --rubi-primary: #e74c3c;
  --rubi-glow: rgba(231, 76, 60, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-backdrop: blur(8px);
  --glass-border: rgba(231, 76, 60, 0.1);
}

.theme-classic body {
  background-color: var(--bg-dark-base) !important;
  background-image: radial-gradient(circle at center, #f0e8d0 0%, var(--bg-dark-base) 100%) !important;
  color: var(--text-primary) !important;
}

.theme-classic .header-subtitle {
  color: var(--text-secondary);
}

.theme-classic .header::after {
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.theme-classic .filters-section,
.theme-classic .inventory-container {
  background: var(--glass-bg);
  border-color: var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.theme-classic .filters-section:hover,
.theme-classic .inventory-container:hover {
  border-color: rgba(212, 61, 53, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), 0 0 12px rgba(212, 61, 53, 0.03);
}

.theme-classic .section-title {
  color: var(--gold-primary);
}

.theme-classic .check {
  background: rgba(0, 0, 0, 0.02);
  border-color: var(--border-color);
}

.theme-classic .check:hover {
  background: rgba(212, 61, 53, 0.04);
  border-color: rgba(212, 61, 53, 0.25);
}

.theme-classic .config-row {
  background: rgba(0, 0, 0, 0.015);
}

.theme-classic .config-row:hover {
  background: rgba(212, 61, 53, 0.03);
}

.theme-classic .header-theme-btn {
  color: var(--gold-primary);
  border-color: var(--border-color);
  background: rgba(212, 61, 53, 0.06);
}

.theme-classic .header-home-btn {
  color: var(--gold-primary);
  border-color: var(--border-color);
  background: rgba(212, 61, 53, 0.06);
}

.theme-classic .header-home-btn:hover,
.theme-classic .header-theme-btn:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.theme-classic .selector-button {
  color: var(--gold-primary);
  border-color: var(--border-color);
  background: var(--bg-dark-surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.theme-classic .selector-button:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1), 0 0 10px var(--gold-glow);
}

.theme-classic #enviar-ficha-button {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(212, 61, 53, 0.25);
}

.theme-classic #enviar-ficha-button:hover {
  background: linear-gradient(135deg, var(--gold-secondary) 0%, var(--gold-primary) 100%);
  box-shadow: 0 6px 16px rgba(212, 61, 53, 0.35);
  color: #fff;
  transform: translateY(-1px);
}

.theme-classic #reset-button {
  background: var(--bg-dark-surface);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.theme-classic #reset-button:hover {
  color: var(--rubi-primary);
  border-color: var(--rubi-primary);
  background: rgba(212, 61, 53, 0.04);
}

.theme-classic .sig-card {
  background: var(--glass-bg);
  border-color: var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.theme-classic .sig-summary {
  background: var(--bg-dark-surface);
  border-bottom: 2px solid var(--gold-primary);
}

.theme-classic .sig-body {
  background: rgba(0, 0, 0, 0.01);
}

.theme-classic .sig-hero,
.theme-classic .sig-col {
  background: var(--bg-dark-surface);
  border-color: var(--border-color);
}

.theme-classic .sig-link {
  background: rgba(0, 0, 0, 0.015);
  border-color: var(--border-color);
}

.theme-classic .sig-link:hover {
  border-color: var(--gold-primary);
  background: rgba(212, 61, 53, 0.03);
  box-shadow: 0 4px 12px rgba(212, 61, 53, 0.06);
}

.theme-classic select {
  background-color: var(--bg-dark-surface);
  border-color: var(--border-color);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d43d35' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.theme-classic select:focus,
.theme-classic select:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

.theme-classic #attribute-table::before {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 30%, rgba(245, 245, 240, 0.95) 100%);
}

.theme-classic #attribute-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.theme-classic #attribute-table tr:hover td {
  background: rgba(212, 61, 53, 0.03);
}

.theme-classic #attribute-table tbody td:nth-child(2) {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: none;
  text-shadow: none;
}

.theme-classic #attribute-table th {
  background: var(--bg-dark-surface);
  color: var(--text-primary);
  border-bottom: 1px solid var(--gold-primary);
}

.theme-classic .attr-racial,
.theme-classic .attr-outros {
  background: var(--bg-dark-surface);
  border-color: var(--border-color);
}

.theme-classic .attr-racial:focus,
.theme-classic .attr-outros:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-glow);
}

.theme-classic .attr-racial.disabled {
  background-color: rgba(0, 0, 0, 0.04) !important;
  border-color: var(--border-color) !important;
}

.theme-classic .calc-points {
  background: var(--bg-dark-surface);
  border-color: var(--border-color);
}

.theme-classic .calc-points-label {
  color: var(--text-primary);
}

.theme-classic .points-badge.muted {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.theme-classic .table-wrap {
  border-color: var(--border-color);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.theme-classic .step-btn {
  background: var(--bg-dark-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.theme-classic .step-btn:hover {
  background: var(--gold-primary);
  color: #fff;
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

.theme-classic .attr-base {
  background: var(--bg-dark-surface);
  border-color: var(--border-color);
}

.theme-classic .attr-base:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-glow);
}

.theme-classic .total-col {
  border: 1px solid rgba(212, 61, 53, 0.2) !important;
}

.theme-classic .destaque-mensagem {
  background: rgba(212, 61, 53, 0.04);
  border-color: rgba(212, 61, 53, 0.15);
}

.theme-classic .fold {
  background: rgba(0, 0, 0, 0.01);
  border-color: var(--border-color);
}

.theme-classic .fold[open] {
  border-color: rgba(212, 61, 53, 0.2);
}

.theme-classic .fold-summary {
  background: var(--bg-dark-surface);
  color: var(--text-primary);
}

.theme-classic .fold-hint {
  border-color: rgba(212, 61, 53, 0.2);
  color: var(--gold-primary);
}

.theme-classic .fold-body {
  border-top-color: var(--border-color);
  background: rgba(0, 0, 0, 0.01);
}

.theme-classic .racial-power-name {
  background: rgba(0, 0, 0, 0.015);
  border-color: var(--border-color);
}

.theme-classic ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}

.theme-classic ::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

.theme-classic ::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
  box-shadow: 0 0 6px var(--gold-glow);
}

/* ==========================================================================
   RESET & CONFIGURAÇÃO BASE
   ========================================================================== */

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

body {
  background-color: var(--bg-dark-base);
  background-image: radial-gradient(circle at center, var(--bg-dark-surface) 0%, var(--bg-dark-base) 100%);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark-base);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-secondary);
  box-shadow: 0 0 8px var(--gold-glow);
}

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

.header {
  padding: 40px 16px 20px;
  text-align: center;
  position: relative;
  z-index: 10;
}

.header-title {
  font-family: "Tormenta", var(--font-heading-fancy);
  font-weight: 900;
  font-size: 3rem;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--gold-primary), #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  margin-bottom: 8px;
}

.header-subtitle {
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.9;
}

.header::after {
  content: "";
  display: block;
  width: 250px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-secondary), transparent);
  margin: 15px auto 0;
}

.header-btns {
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.header-home-btn,
.header-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  color: var(--gold-primary);
}

.header-home-btn {
  padding: 7px 12px;
  border-radius: 8px;
  gap: 5px;
}

.header-home-btn:hover,
.header-theme-btn:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

.header-theme-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.2rem;
  padding: 0;
}

.header-theme-btn:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .header-title { font-size: 2rem; }
  .header-btns { position: static; transform: none; justify-content: center; margin-top: 12px; }
}

/* ==========================================================================
   CONTAINER E LAYOUT GRID
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  position: relative;
  z-index: 2;
}

.container-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .calc-grid {
    grid-template-columns: 1.1fr 1.4fr;
    align-items: start;
  }
  
  .inventory-container {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
}

/* ==========================================================================
   CARDS / PAINÉIS DE VIDRO (GLASSMORPHISM)
   ========================================================================== */

.filters-section,
.inventory-container {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.filters-section:hover,
.inventory-container:hover {
  border-color: rgba(201, 147, 58, 0.15);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(201, 147, 58, 0.02);
}

.section-title {
  font-family: var(--font-heading);
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   CONFIGURAÇÃO & CONTROLES DIVERSOS
   ========================================================================== */

.calc-left-top {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

/* Botão de Configurações (Flutuante) */
.selector-button {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-dark-surface);
  color: var(--gold-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 3000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
  transition: var(--transition-fast);
}

.selector-button:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7), 0 0 12px var(--gold-glow);
  color: #fff;
}

.selector-icon {
  font-size: 1.3rem;
}

/* ==========================================================================
   FORM CONTROLS (SELECTS, CHECKBOXES & TOGGLES)
   ========================================================================== */

/* Dropdown */
select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-dark-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9933a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

select:focus,
select:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-glow);
}

select option {
  background: var(--bg-dark-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
}

/* Checkboxes da Lista */
.checklist {
  display: grid;
  gap: 10px;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.check:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(201, 147, 58, 0.3);
}

.check input[type="checkbox"] {
  accent-color: var(--gold-secondary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.check span {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   CONFIG MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: var(--transition-normal);
}

.modal-overlay.active,
.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  width: min(450px, 100%);
  background: var(--bg-dark-panel);
  border: 1px solid var(--gold-secondary);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(201, 147, 58, 0.1);
  position: relative;
  padding: 28px;
  color: var(--text-primary);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--rubi-primary);
  color: #fff;
  border-color: var(--rubi-primary);
  box-shadow: 0 0 10px var(--rubi-glow);
}

.modal-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--gold-primary);
  text-shadow: 0 0 8px var(--gold-glow);
}

.modal-price {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.modal-section p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(7, 8, 12, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: background var(--transition-fast);
}

.config-row:hover {
  background: rgba(7, 8, 12, 0.5);
}

.config-row span {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input[type="checkbox"] {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #272c3d;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  transition: var(--transition-fast);
}

.slider:before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-primary);
  border-radius: 50%;
  transition: var(--transition-fast);
}

input[type="checkbox"]:checked + .slider {
  background: var(--gold-secondary);
  border-color: var(--gold-primary);
}

input[type="checkbox"]:checked + .slider:before {
  transform: translate(22px, -50%);
  background: var(--bg-dark-base);
}

/* ==========================================================================
   SEÇÃO DE BÔNUS MENSAGEM & OPÇÕES ESPECÍFICAS
   ========================================================================== */

.destaque-mensagem {
  background: rgba(201, 147, 58, 0.05);
  color: var(--text-primary);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(201, 147, 58, 0.25);
  font-weight: 500;
  font-size: 14px;
  margin: 12px 0;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

/* Container de opções específicas da raça (ex: seletores de chassi do Golem) */
#race-specific-options {
  margin-top: 15px;
}

#race-specific-options label {
  display: block;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

#race-specific-options select {
  margin-bottom: 12px;
}

/* ==========================================================================
   PAINEL DE PONTOS DISPONÍVEIS
   ========================================================================== */

.calc-points {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: rgba(7, 8, 12, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.calc-points-label {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Badge de Pontos Disponíveis */
.badge {
  background: var(--gold-secondary);
  color: #0f172a;
  padding: 4px 14px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 0 10px var(--gold-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
}

.points-meta-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-left: 8px;
}

.points-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.points-badge.muted {
  background: var(--bg-dark-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.pontos-input {
  width: 90px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-dark-surface);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.pontos-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* ==========================================================================
   TABELA DE ATRIBUTOS
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

#attribute-table {
  width: 100%;
  border-collapse: collapse;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#attribute-table::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Overlay escuro semi-transparente para alta legibilidade sobre imagens de raça */
  background: radial-gradient(circle, rgba(14, 16, 23, 0.72) 30%, rgba(7, 8, 12, 0.9) 100%);
  z-index: 0;
}

#attribute-table thead,
#attribute-table tbody,
#attribute-table tr,
#attribute-table th,
#attribute-table td {
  position: relative;
  z-index: 1;
}

#attribute-table th {
  background: var(--bg-dark-surface);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: 14px 10px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#attribute-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(42, 46, 61, 0.4);
  text-align: center;
  vertical-align: middle;
}

#attribute-table tr:last-child td {
  border-bottom: none;
}

#attribute-table tr:hover td {
  background: rgba(31, 35, 48, 0.35);
}

/* Coluna 1: Imagem do atributo */
#attribute-table td:first-child img {
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
  transition: transform var(--transition-fast);
}

#attribute-table tr:hover td:first-child img {
  transform: scale(1.05);
}

/* Coluna 2: FOR, DES, CON etc */
#attribute-table tbody td:nth-child(2) {
  font-family: "Tormenta", var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  background: rgba(7, 8, 12, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Stepper de pontos */
.attr-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.attr-stepper .attr-base {
  width: 54px;
  height: 38px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-dark-surface);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
  outline: none;
  transition: var(--transition-fast);
}

.attr-stepper .attr-base:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

.step-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-dark-panel);
  color: var(--text-primary);
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.step-btn:hover {
  background: var(--gold-secondary);
  color: var(--bg-dark-base);
  border-color: var(--gold-secondary);
  box-shadow: 0 0 10px var(--gold-glow);
}

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

/* Inputs de valores fixos (racial e outros) */
.attr-racial,
.attr-outros {
  width: 65px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(7, 8, 12, 0.4);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: var(--transition-fast);
}

.attr-racial:focus,
.attr-outros:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* Coluna de Totais (Dourado de Destaque) */
.total-col {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 900;
  color: var(--gold-primary) !important;
  text-shadow: 0 0 12px var(--gold-glow);
  background: rgba(201, 147, 58, 0.05);
  border: 1px solid rgba(201, 147, 58, 0.2) !important;
  border-radius: 8px;
  padding: 6px 12px;
  width: 60px;
}

#attribute-table th.total-col {
  color: var(--gold-primary) !important;
  background: rgba(201, 147, 58, 0.02);
  border-bottom: 1px solid rgba(201, 147, 58, 0.2);
}

.outros-col {
  display: none;
}

.outros-col.show {
  display: table-cell;
}

/* ==========================================================================
   BOTÕES DE AÇÃO
   ========================================================================== */

.filter-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-dark-surface);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  outline: none;
}

.filter-btn:hover {
  background: var(--bg-dark-panel-hover);
  border-color: var(--gold-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--gold-glow);
}

/* Botão especial: Enviar para a Ficha */
#enviar-ficha-button {
  background: linear-gradient(135deg, var(--gold-secondary) 0%, var(--gold-primary) 100%);
  color: #0f172a;
  border: 1px solid var(--gold-primary);
}

#enviar-ficha-button:hover {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
  box-shadow: 0 5px 15px var(--gold-glow);
  color: #0f172a;
  transform: translateY(-1px);
}

/* Botão especial: Reset */
#reset-button {
  border-color: rgba(220, 53, 69, 0.3);
}

#reset-button:hover {
  border-color: var(--rubi-primary);
  background: rgba(220, 53, 69, 0.1);
  box-shadow: 0 4px 12px var(--rubi-glow);
  color: #fff;
}

/* ==========================================================================
   FOLDS (ACORDEÕES/RECOLHÍVEIS) - RAÇAS ADICIONAIS & PODERES RACIAIS
   ========================================================================== */

.fold {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(22, 25, 34, 0.5);
  margin-bottom: 12px;
  transition: border-color var(--transition-fast);
}

.fold[open] {
  border-color: rgba(201, 147, 58, 0.25);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.fold-summary {
  padding: 14px 18px;
  background: var(--bg-dark-surface);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  outline: none;
}

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

.fold-hint {
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--gold-primary);
  border: 1px solid rgba(201, 147, 58, 0.25);
  background: rgba(201, 147, 58, 0.05);
  padding: 3px 10px;
  border-radius: 99px;
  transition: var(--transition-fast);
}

.fold:hover .fold-hint {
  background: rgba(201, 147, 58, 0.12);
  box-shadow: 0 0 6px var(--gold-glow);
}

.fold-body {
  padding: 16px 18px;
  border-top: 1px solid var(--border-color);
  background: rgba(7, 8, 12, 0.3);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* Poderes raciais da lista dinâmicos */
#racial-powers-list {
  margin-top: 14px;
}

.racial-power-name {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
}

/* ==========================================================================
   BOTÃO NIMB & ANIMAÇÕES DE SELECIONADO
   ========================================================================== */

.btn-nimb {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid #6a00ff;
  background: linear-gradient(135deg, #6a00ff, #c400ff, #ff008c);
  color: white;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 0 10px rgba(160, 0, 255, 0.4);
  animation: nimbPulse 3s infinite alternate;
}

.btn-nimb:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 18px rgba(255, 0, 200, 0.6);
}

.btn-nimb:active {
  transform: scale(0.97);
}

.btn-nimb:disabled {
  opacity: 0.5;
  filter: grayscale(80%);
  cursor: not-allowed;
}

@keyframes nimbPulse {
  from {
    box-shadow: 0 0 6px rgba(106, 0, 255, 0.6);
  }
  to {
    box-shadow: 0 0 18px rgba(255, 0, 170, 0.8);
  }
}

/* ==========================================================================
   FEEDBACKS DE VALIDAÇÃO
   ========================================================================== */

/* Flash quando valor é inválido */
.flash-invalid {
  outline: 2px solid var(--rubi-primary) !important;
  box-shadow: 0 0 12px var(--rubi-glow) !important;
  animation: invalidShake 0.22s ease-in-out 0s 2;
}

@keyframes invalidShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

/* Pulse de pontos insuficientes */
.points-pulse {
  animation: pulseBad 0.5s ease-in-out 0s 1;
}

@keyframes pulseBad {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 15px rgba(220, 53, 69, 0.6); }
  100% { transform: scale(1); }
}

/* Bônus Raciais Bloqueados */
.attr-racial.disabled {
  background-color: rgba(7, 8, 12, 0.6) !important;
  color: var(--text-muted) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  cursor: not-allowed;
  opacity: 0.5;
  filter: grayscale(1);
}

.attr-racial.disabled::-webkit-inner-spin-button,
.attr-racial.disabled::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   ASSINATURA / CRÉDITOS (TEMA DARK)
   ========================================================================== */

.sig-wrap {
  max-width: 1200px;
  margin: 32px auto 48px;
  padding: 0 16px;
}

.sig-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-dark-panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.sig-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--bg-dark-surface);
  color: var(--text-primary);
  border-bottom: 2px solid var(--gold-secondary);
  outline: none;
}

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

.sig-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sig-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(201, 147, 58, 0.1);
  border: 1px solid rgba(201, 147, 58, 0.2);
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sig-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sig-summary-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sig-hint {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.sig-chevron {
  font-size: 14px;
  color: var(--gold-primary);
  transition: transform 0.2s ease;
}

.sig-card[open] .sig-chevron {
  transform: rotate(180deg);
}

.sig-body {
  padding: 24px;
  background: rgba(7, 8, 12, 0.35);
}

.sig-hero {
  background: var(--bg-dark-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.sig-h3 {
  margin-bottom: 10px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--gold-primary);
  text-shadow: 0 0 8px var(--gold-glow);
}

.sig-p {
  margin-bottom: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 14px;
}

.sig-p strong {
  color: var(--text-primary);
}

.sig-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .sig-grid {
    grid-template-columns: 1fr;
  }
  .sig-hint {
    display: none;
  }
}

.sig-col {
  background: var(--bg-dark-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.sig-h4 {
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sig-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  text-decoration: none;
  background: rgba(7, 8, 12, 0.3);
  transition: var(--transition-fast);
  margin-bottom: 10px;
}

.sig-link:hover {
  transform: translateY(-2px);
  border-color: var(--gold-primary);
  background: var(--bg-dark-panel-hover);
  box-shadow: 0 4px 15px rgba(201, 147, 58, 0.1);
}

.sig-link-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sig-link-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.2;
  transition: color var(--transition-fast);
}

.sig-link:hover .sig-link-name {
  color: var(--gold-primary);
}

.sig-link-url {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.sig-ext {
  color: var(--text-muted);
  font-size: 14px;
  transition: color var(--transition-fast);
}

.sig-link:hover .sig-ext {
  color: var(--gold-primary);
}

.sig-link-primary {
  border-color: rgba(201, 147, 58, 0.2);
  box-shadow: 0 4px 10px rgba(201, 147, 58, 0.05);
}

.sig-link-primary:hover {
  border-color: var(--gold-primary);
  box-shadow: 0 4px 15px rgba(201, 147, 58, 0.15);
}

.sig-note {
  margin-top: 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(201, 147, 58, 0.25);
  background: rgba(201, 147, 58, 0.02);
  padding: 14px;
}

.sig-note-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.sig-note-text {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.sig-note-text a {
  color: var(--gold-primary);
  text-decoration: none;
}

.sig-note-text a:hover {
  text-decoration: underline;
}

.sig-footer {
  margin-top: 20px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-dark-surface);
  display: flex;
  justify-content: center;
}

.sig-footer-text {
  color: var(--text-muted);
  font-size: 12px;
}

/* ==========================================================================
   AJUSTES RESPONSIVOS MOBILE
   ========================================================================== */

@media (max-width: 1023px) {
  /* Ocultar a coluna de ícones do atributo no mobile para economizar espaço horizontal */
  #attribute-table th:first-child,
  #attribute-table td:first-child {
    display: none;
  }
  
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .filters-section,
  .inventory-container {
    padding: 16px;
  }
  
  #attribute-table {
    min-width: 420px;
  }
  
  #attribute-table th,
  #attribute-table td {
    padding: 10px 6px;
    font-size: 13px;
  }
  
  #attribute-table tbody td:nth-child(2) {
    font-size: 18px;
    padding: 4px 8px;
  }
  
  .attr-stepper .attr-base {
    width: 44px;
    height: 34px;
    font-size: 14px;
  }
  
  .step-btn {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  
  .attr-racial,
  .attr-outros {
    width: 50px;
    height: 34px;
    font-size: 14px;
  }
  
  .total-col {
    font-size: 20px !important;
    padding: 4px 8px;
    width: 50px;
  }
  
  .calc-points {
    padding: 12px;
    gap: 8px 12px;
  }
  
  .calc-points-label {
    font-size: 16px;
  }
  
  .badge {
    font-size: 16px;
    padding: 2px 10px;
  }
}

@media (max-width: 720px) {
  .header-title {
    font-size: 2.2rem;
  }
  
  .modal-content {
    padding: 20px;
  }
}

.theme-classic body {
  background: var(--bg-dark-base) !important;
}

.theme-classic .header {
  background: linear-gradient(185deg, #2c3e50 0%, #1a252f 100%) !important;
  border-bottom: 2px solid #e74c3c !important;
}

.theme-classic .header::after {
  display: none !important;
}

.theme-classic .header-title {
  color: #ecf0f1 !important;
  text-shadow: none !important;
  background: none !important;
  -webkit-text-fill-color: #ecf0f1 !important;
}

.theme-classic .header-subtitle {
  color: #bdc3c7 !important;
}

.theme-classic .header-home-btn,
.theme-classic .header-theme-btn {
  color: #ecf0f1 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(0, 0, 0, 0.2) !important;
}

.theme-classic .header-home-btn:hover,
.theme-classic .header-theme-btn:hover {
  border-color: #e74c3c !important;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.3) !important;
}