/* =========================
   Variáveis globais e temas
   ========================= */
:root {
  --bg: #000;
  --text: #fff;
  --muted: #cfcfcf;
  --line: #fff;

  --primary: #8f1137;
  --secondary: #1f1f2a;
  --bg-image: none;

  --hp-color: #dd1111;
  --pd-color: #29a7cf;

    --accent-soft: #ca356c;
  --action-border: #29a7cf;
  --action-text: #9edfff;
  --action-bg: rgba(41, 167, 207, 0.08);
}

body.tema-padrao {
  --primary: #ffffff;
  --bg-image: none;
  --hp-color: #dd1111;
  --pd-color: #29a7cf;
  --accent-soft: #ca356c;
  --action-border: #29a7cf;
  --action-text: #9edfff;
  --action-bg: rgba(41, 167, 207, 0.08);
  background: #000;
}

body.tema-sangue {
  --primary: #ff2e2e;
  --bg-image: url('./imgs/sangue-bg.jpg');
  --hp-color: #ff1f1f;
  --pd-color: #ff6b6b;
  --accent-soft: #ff4b6e;
  --action-border: #ff6b6b;
  --action-text: #ffd0d7;
  --action-bg: rgba(255, 107, 107, 0.10);
}

body.tema-medo {
  --primary: #44b6ea;
  --bg-image: url('./imgs/medo-bg.jpg');
  --hp-color: #22bdec;
  --pd-color: #89d0e6;
  --accent-soft: #7fdfff;
  --action-border: #89d0e6;
  --action-text: #d9f6ff;
  --action-bg: rgba(137, 208, 230, 0.10);
}

body.tema-conhecimento {
  --primary: #e6c78c;
  --bg-image: url('./imgs/conhecimento-bg.jpg');
  --hp-color: #caa35e;
  --pd-color: #f0dfb2;
  --accent-soft: #e6c78c;
  --action-border: #d8b46e;
  --action-text: #fff1cc;
  --action-bg: rgba(230, 199, 140, 0.10);
}

body.tema-energia {
  --primary: #c26bf4;
  --bg-image: url('./imgs/energia-bg.jpg');
  --hp-color: #8a2cff;
  --pd-color: #d18cff;
  --accent-soft: #c26bf4;
  --action-border: #d18cff;
  --action-text: #f3ddff;
  --action-bg: rgba(209, 140, 255, 0.10);
}

body.tema-morte {
  --primary: #9e9e9e;
  --bg-image: url('./imgs/morte-bg.jpg');
  --hp-color: #5f5f5f;
  --pd-color: #bdbdbd;
  --accent-soft: #b0b0b0;
  --action-border: #9e9e9e;
  --action-text: #ededed;
  --action-bg: rgba(158, 158, 158, 0.10);
}

/* =========================
   Base global
   ========================= */
html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background:
    var(--bg-image);
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

* {
  box-sizing: border-box;
}

button,
input,
select {
  font-family: inherit;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.main-btn,
.secondary-btn,
.danger-btn,
.attack-btn {
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  font-weight: 700;
  cursor: pointer;

  height: 38px;
  min-height: 38px;
  padding: 0 16px;

  font-size: 12px;
  letter-spacing: 0.4px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition: all 0.15s ease;
}

.secondary-btn {
  border-color: #d0d0d0;
}

.main-btn:hover,
.secondary-btn:hover,
.attack-btn:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}

.danger-btn {
  border: 1px solid #ff3b3b;
  color: #ffb0b0;
  background: transparent;
}

.danger-btn:hover {
  background: rgba(255, 59, 59, 0.12);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

.sheet-topline {
  height: 1px;
  background: #fff;
}

/* HOME */
.home-wrap {
  padding: 24px;
}

.home-actions {
  margin-bottom: 18px;
}

.characters-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.character-card {
  width: 220px;
  min-height: 240px;
  border: 1px solid #fff;
  background: #111;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.character-thumb {
  height: 120px;
  border: 1px solid #444;
  background: #1a1a1a center/cover no-repeat;
  margin-bottom: 10px;
}

.character-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.character-meta {
  font-size: 12px;
  color: #d0d0d0;
  margin-bottom: 10px;
}

.card-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* LAYOUT FICHA */

/* =========================
   Layout principal da ficha
   ========================= */
.sheet-layout {
  width: 1660px;
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 430px 700px 2fr;
  gap: 20px;
  padding: 13px 10px 14px;
  align-items: start;

}

.sheet-left,
.sheet-middle,
.sheet-right {
  min-width: 0;
}

/* ESQUERDA */
.top-back-wrap {
  margin-bottom: 12px;
}

.top-back-btn {
  min-width: 72px;
  height: 34px;
  padding: 0 10px;
}

.sheet-header-grid {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 8px;
}

.portrait-box {
  width: 70px;
  height: 70px;
  border: 1px solid #7d7d7d;
  background: #1a1a1a url("./imgs/blank-profile.png") center/cover no-repeat;
}

.sheet-header-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 16px;
}

.sheet-line-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sheet-line-group label {
  font-size: 11px;
  font-weight: 700;
  color: #d8d8d8;
}

.sheet-line-group input,
.sheet-line-group select {
  background: transparent;
  border: none;
  border-bottom: 1px solid #fff;
  color: #fff;
  height: 26px;
  font-size: 13px;
  outline: none;
  padding: 0;
  width: 100%;
}

.sheet-line-group select option {
  background: #101010;
  color: #fff;
}

.attributes-wrap {
  position: relative;
  width: 320px;
  height: 320px;
  margin: 6px auto 10px;
}

.attributes-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* ⚠️ mantém proporção correta */
  display: block;
}

.attr-slot {
  position: absolute;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.attr-agi { top: 18.2%; left: 50%; }

.attr-for { top: 40.0%; left: 19.5%; }

.attr-int { top: 40.0%; left: 82.0%; }

.attr-pre { top: 77.0%; left: 29.5%; }

.attr-vig { top: 77.0%; left: 70.5%; }

.attr-input {
  width: 100%;
  height: 100%;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  background: transparent;
  border: none;
  color: #fff;
  padding: 0;
  line-height: 28px;
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 10px;
  margin-bottom: 10px;
}

.mini-box {
  border: 1px solid #fff;
  min-height: 66px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.mini-box span {
  font-size: 10px;
  color: #d8d8d8;
  text-align: center;
  font-weight: 700;
}

.mini-box input {
  background: transparent;
  border: none;
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  outline: none;
  min-width: 0;
}

.wide {
  min-width: 0;
}

/* =========================
   Barras de status (Vida / Determinação)
   ========================= */
.status-block {
  margin-bottom: 8px;
}

.status-label {
  text-align: center;
  font-weight: 700;
  color: #e3e3e3;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.3px;
}

.status-fill {
  position: absolute; /* 🔥 MUDA TUDO */
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  transition: width 0.25s ease;
  z-index: 0;
}

.status-bar.red .status-fill {
  background: var(--hp-color);
}

.status-bar.blue .status-fill {
  background: var(--pd-color);
}

.status-bar {
  height: 54px;
  border: 1px solid #fff;
  overflow: hidden;
  position: relative;
  background: #111;
}

.status-normal,
.status-zero {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.status-normal {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}

.status-zero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 50px;
  padding: 0 14px;
}

.status-normal > button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  font-weight: 800;
  height: 100%;
  z-index: 2;
}

.status-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.status-dot {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.status-dot.active {
  background: #fff;
  border-color: #fff;
}

.status-heal-btn {
  height: 34px;
  min-width: 82px;
  padding: 0 14px;
  border: 1px solid #2fdc57;
  background: transparent;
  color: #2fdc57;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  flex: 0 0 auto;
}

.status-heal-btn:hover {
  background: rgba(47, 220, 87, 0.10);
}

.status-zero-values {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  flex: 0 0 auto;
}

.status-zero-values span {
  font-size: 17px;
  line-height: 1;
}

.status-values {
  position: relative;
  z-index: 1; /* 🔥 garante que fica na frente */

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
}

.status-values input {
  width: 56px;
  background: transparent;
  border: none;
  color: #fff;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  outline: none;
}

.status-values span {
  font-size: 24px;
  line-height: 1;
}

.defense-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  align-items: start;
  margin: 14px 0 10px;
}

.shield-box {
  position: relative;
  width: 76px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.shield-number {
  position: absolute;
  font-size: 21px;
  font-weight: 800;
  color: #fff;
}

.defense-title {
  font-size: 15px;
  font-weight: 800;
}

.defense-formula {
  font-size: 11px;
  color: #d0d0d0;
  margin-top: 2px;
}

.defense-bonus-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: #d0d0d0;
  flex-wrap: wrap;
}

.defense-bonus-line input {
  width: 34px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #fff;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  text-align: center;
  padding: 2px 0;
}

.defense-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.defense-subgrid span {
  display: block;
  font-size: 11px;
  color: #d0d0d0;
  margin-bottom: 4px;
  font-weight: 700;
}

.defense-subgrid input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #fff;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  outline: none;
  text-align: center;
  padding: 2px 0;
}

.line-info {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #323232;
}

.line-info span {
  font-size: 12px;
  color: #d0d0d0;
  font-weight: 700;
}

.line-info input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  outline: none;
  padding: 0;
  width: 100%;
}

/* MEIO */
.panel-title {
  text-align: center;
  font-size: 24px;
  margin: 4px 0 6px;
  font-weight: 800;
  letter-spacing: 0.3px;

}

.skills-head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 64px 64px 64px 64px;
  gap: 2px;
  align-items: center;
}

.skill-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 58px 58px 58px 58px;
  gap: 6px;
  align-items: center;
}

.skills-left {
    margin-left: 1rem;
}

.skills-head {
  font-size: 11px;
  color: #d0d0d0;
  font-weight: 700;
  margin-bottom: 4px;
  padding: 0 4px;
}

.skills-list {
  display: grid;
  gap: 0;
  padding-right: 0;
  overflow: visible;
}

.skill-row {
  font-size: 13px;
  border-bottom: 1px solid #262626;
  min-height: 32.6px;
  padding: 2px 4px;
}

.skill-name {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.skill-name img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.skill-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-col {
  text-align: center;
  color: #fff;
}

.skill-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #fff;
  color: #fff;
  font-size: 12px;
  outline: none;
  text-align: center;
  padding: 0;
}

.sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.sheet-actions button,
#themeBtn {
  width: 110px; /* 👈 MESMO tamanho pra todos */
  height: 38px;
  padding: 0 16px;
}

/* DIREITA */

/* =========================
   Painel da direita / abas
   ========================= */
.tabs-row {
  display: flex;
  gap: 15px;
  padding-top: 12px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  padding: 0 0 5px;
}

.tab-btn.active {
  border-bottom: 1px solid #fff;
}

.right-panel-box {
  padding-top: 14px;
}

.right-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
}

.right-panel-title {
  font-size: 12px;

  color: #d0d0d0;
}

.attack-btn {
  min-width: 132px;
  min-height: 42px;
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  text-align: center;
  margin-top: 120px;
  font-size: 18px;
  font-weight: 800;
}

/* RESPONSIVO */
@media (max-width: 1680px) {
  .sheet-layout {
    grid-template-columns: 450px 650px 1fr;
  }
}

@media (max-width: 1540px) {
  .sheet-layout {
    grid-template-columns: 430px 600px 1fr;
    gap: 16px;
  }

  .skills-head,
  .skill-row {
    grid-template-columns: minmax(0, 1.8fr) 84px 84px 84px 84px;
    gap: 10px;
  }
}

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

  .sheet-header-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .sheet-layout {
    padding: 8px 10px 14px;
  }

.attributes-wrap {
  position: relative;
  width: 300px;   /* ⚠️ IMPORTANTE */
  height: 300px;  /* ⚠️ IMPORTANTE */
  margin: 6px auto 10px;
}

  .mini-stats {
    grid-template-columns: 1fr;
  }

  .defense-card {
    grid-template-columns: 1fr;
  }

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

  .skills-head,
  .skill-row {
    grid-template-columns: minmax(0, 1.5fr) 68px 68px 68px 68px;
    gap: 8px;
  }
}

.skill-row:hover {
  background: rgba(255,255,255,0.03);
}

.character-card:hover {
  transform: translateY(-2px);
  transition: 0.2s;
}

.skill-click {
  cursor: pointer;
  transition: color 0.2s ease;
}

.skill-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);

  display: none; /* ← ISSO AQUI É O MAIS IMPORTANTE */

  align-items: center;
  justify-content: center;
  z-index: 999;
}

.skill-modal.active {
  display: flex;
}

.skill-modal-box {
  margin-top: 5rem;
  position: relative;
  width: min(720px, 92vw);
  max-height: 84vh;
  overflow-y: auto;
  background: #1f1f22;
  border-radius: 6px;
  padding: 22px 28px 26px;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.skill-modal-box h2 {
  margin: 0 0 26px;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
}

#skillTitle{
  text-transform: capitalize;

}

#skillDescription {
  color: #ffffff;
    text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

#skillDescription p {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.6;
  color: #ffffff;
}

#skillDescription span {
  color: #ca356c;
  font-weight: 500;
}

.close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.close-btn:hover {
  color: #d3d3d3;
}

.skill-modal-box::-webkit-scrollbar {
  width: 8px;
}

.skill-modal-box::-webkit-scrollbar-track {
  background: transparent;
}

.skill-modal-box::-webkit-scrollbar-thumb {
  background: #2b2b2f;
  border-radius: 10px;
}

.skill-modal-box::-webkit-scrollbar-thumb:hover {
  background: #3a3a40;
}

.tab-panel.hidden {
  display: none;
}

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

.combat-topline {
  margin: 8px 0 14px;
}

.combat-topline input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #fff;
  color: #fff;
  padding: 6px 4px;
  outline: none;
  font-size: 14px;
}

.attacks-list {
  display: grid;
  gap: 14px;
}

.attack-card {
  background: #1d1d21;
  border-radius: 6px;
  padding: 14px;
  color: #fff;
}

.attack-card-head {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  padding-left: 38px;
}

.attack-toggle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.attack-toggle-icon {
  width: 10px;
  height: 10px;

  transform: rotate(45deg);
  transition: transform 0.22s ease;
  display: block;
  margin-right: 12px;
}

.attack-toggle.is-open .attack-toggle-icon {
  transform: rotate(-135deg);
}

.attack-card-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.attack-card-sub {
  display: flex;
  gap: 18px;
  margin-top: 4px;
  font-weight: 700;
  flex-wrap: wrap;
  line-height: 1.2;
}

.attack-card-body {
  margin-top: 14px;
  padding-top: 14px;
  display: grid;
  gap: 8px;
}

.attack-card-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.attack-remove-btn,
.attack-edit-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
}

.attack-remove-btn {
  color: #ff4d4d;
}

.attack-edit-btn {
  color: #32d96b;
}

.attack-modal-box {
  width: min(960px, 95vw);
  max-height: 88vh;
}

.attack-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 18px;
}

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

.attack-field-full {
  grid-column: 1 / -1;
}

.attack-field label {
  font-size: 14px;
  font-weight: 700;
}

.attack-field input,
.attack-field select,
.attack-field textarea {
  background: #0c0c0f;
  border: 1px solid #2e2e35;
  color: #fff;
  padding: 8px 10px;
  outline: none;
  border-radius: 4px;
  font-size: 14px;
}

.attack-field textarea {
  min-height: 120px;
  resize: vertical;
}

.attack-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 20px;
}

.library-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.library-tab-btn {
  background: transparent;
  border: 1px solid #3a3a40;
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
}

.library-list {
  display: grid;
  gap: 10px;
}

.library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #151519;
  border: 1px solid #2e2e35;
  border-radius: 6px;
  padding: 12px;
}

.library-item-main {
  min-width: 0;
}

.library-item-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.library-item-group {
  font-size: 12px;
  margin-top: 4px;
}

.library-add-btn {
  width: 34px;
  height: 34px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.skill-row.trained {
  background: rgba(50, 217, 107, 0.08);
}

.skill-row.trained .skill-name span,
.skill-row.trained .skill-col,
.skill-row.trained .skill-input {
  color: #32d96b;
}

.skill-row.trained .skill-input {
  border-bottom-color: #32d96b;
}

.use-pd-btn {
  min-height: 32px;
  padding: 8px 12px;
  font-size: 14px;
  margin-left: 4rem;
  border-color: var(--action-border);
  color: var(--action-text);
  background: var(--action-bg);
}

.skill-click:hover {
  color: var(--accent-soft);
}

.attack-toggle-icon {
  border-right: 2px solid var(--accent-soft);
  border-bottom: 2px solid var(--accent-soft);
}

.attack-card-sub {
  color: var(--accent-soft);
}

.attack-card-body {
  border-top: 1px solid var(--accent-soft);
}

.attack-label {
  color: var(--accent-soft);
}

.library-tab-btn.active {
  border-color: var(--accent-soft);
  color: var(--accent-soft);
}

.library-item-group {
  color: var(--accent-soft);
}

.library-add-btn {
  border: 1px solid var(--accent-soft);
  color: var(--accent-soft);
}

.use-pd-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 6px color-mix(in srgb, var(--action-border) 28%, transparent);
}

@media (max-width: 1660px) {
 .use-pd-btn {
  margin-left: 1rem;
}
}

.attack-notes{
    text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.nex-dropdown {
  position: relative;
  width: 100%;
}

.nex-selected {

  color: #fff;
  text-align: center;
  font-weight: 800;
  padding: 8px;
  cursor: pointer;
}

.nex-options {
  position: absolute;
  top: 100%; /* 🔥 sempre pra baixo */
  left: 0;
  width: 100%;

  background: var(--bg);
  border: 1px solid #111;

  max-height: 220px;
  overflow-y: auto;

  display: none;
  z-index: 999;
}

.nex-options div {
  padding: 8px;
  text-align: center;
  cursor: pointer;
}

.nex-options div:hover {
  background: #1f1f1f;
}

/* SCROLLBAR DO NEX */
.nex-options::-webkit-scrollbar {
  width: 6px;
}

.nex-options::-webkit-scrollbar-track {
  background: #111;
}

.nex-options::-webkit-scrollbar-thumb {
  background: #ca356c;
  border-radius: 6px;
}

.nex-options::-webkit-scrollbar-thumb:hover {
  background: #ff4d88;
}

.sheet-line-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: transparent;
  border: none;
  border-bottom: 1px solid #fff;
  box-shadow: none;
  outline: none;

  color: #fff;
  height: 26px;
  font-size: 13px;
  padding: 0 20px 0 0;
  width: 100%;
}

.sheet-line-group select:focus,
.sheet-line-group select:focus-visible {
  outline: none;
  box-shadow: none;
}

.custom-dropdown {
  position: relative;
  width: 100%;
}

.custom-selected {
  height: 26px;
  border-bottom: 1px solid #fff;
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  padding-right: 16px;
}

.custom-selected::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.custom-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: #111;
  border: 1px solid #111;
  max-height: 220px;
  overflow-y: scroll;
  display: none;
  z-index: 999;
}

.custom-options div {
  padding: 6px 8px;
  cursor: pointer;
  color: #fff;
  font-size: 13px;
}

.custom-options div:hover {
  background: #1f1f1f;
}

.custom-options::-webkit-scrollbar {
  width: 6px;
}

.custom-options::-webkit-scrollbar-track {
  background: #111;
}

.custom-options::-webkit-scrollbar-thumb {
  background: #ca356c;
  border-radius: 6px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
  background: #ff4d88;
}

.create-mode-box {
  width: min(460px, 92vw);
  text-align: center;
}

.create-mode-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.create-mode-actions button {
  min-width: 160px;
}

/* TREINAMENTO PERÍCIAS */
.skill-row.trained-green .skill-name,
.skill-row.trained-green .skill-col,
.skill-row.trained-green .skill-input,
.skill-row.trained-green .skill-select,
.skill-row.trained-green .skill-click {
  color: #00ff88 !important;
}

.skill-row.trained-blue .skill-name,
.skill-row.trained-blue .skill-col,
.skill-row.trained-blue .skill-input,
.skill-row.trained-blue .skill-select,
.skill-row.trained-blue .skill-click {
  color: #3aa8ff !important;
}

.skill-row.trained-yellow .skill-name,
.skill-row.trained-yellow .skill-col,
.skill-row.trained-yellow .skill-input,
.skill-row.trained-yellow .skill-select,
.skill-row.trained-yellow .skill-click {
  color: #ffd54a !important;
}

.skill-row.trained-green .skill-input,
.skill-row.trained-green .skill-select {
  border-bottom-color: #00ff88 !important;
}

.skill-row.trained-blue .skill-input,
.skill-row.trained-blue .skill-select {
  border-bottom-color: #3aa8ff !important;
}

.skill-row.trained-yellow .skill-input,
.skill-row.trained-yellow .skill-select {
  border-bottom-color: #ffd54a !important;
}

.skill-row.trained-green .skill-select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2300ff88' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
}

.skill-row.trained-blue .skill-select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%233aa8ff' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
}

.skill-row.trained-yellow .skill-select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23ffd54a' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20000;

  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(10px);
}

.topbar-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.logo-mark {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 1px;
  color: #fff;
}

.topbar-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 20001;
}

.theme-dropdown {
  position: relative;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(10,10,14,0.96);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 9999;
}

.theme-menu button {
  width: 100%;
  border: none;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.18s ease;
}

.theme-menu button:hover {
  background: rgba(255,255,255,0.06);
  color: var(--primary);
}

.home-wrap {
  padding: 34px 38px;
}

.character-card {
  width: 340px;
  min-height: 430px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(33,34,56,0.92), rgba(16,16,24,0.92));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 20px 50px rgba(0,0,0,0.38);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.character-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 55%, rgba(255,255,255,0.12));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 30px color-mix(in srgb, var(--primary) 18%, transparent),
    0 24px 55px rgba(0,0,0,0.45);
}

.character-thumb {
  height: 220px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #111 center/cover no-repeat;
  margin-bottom: 18px;
}

.character-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 10px;
}

.character-meta {
  font-size: 16px;
  color: #d5d5d5;
  line-height: 1.5;
}

.sheet-left,
.sheet-middle,
.sheet-right {
  background: rgba(8,8,12,0.46);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  backdrop-filter: blur(8px);
  padding: 14px;
}

.sheet-topline {
  display: none;
}

.panel-title,
.defense-title,
.status-label {
  color: var(--primary);
}

.tab-btn.active {
  border-bottom: 1px solid var(--primary);
  color: var(--primary);
}

.character-card,
.attack-card,
.skill-modal-box,
.right-panel-box {
  box-shadow: 0 0 24px rgba(0,0,0,0.22);
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.status-head-btn {
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  cursor: pointer;
  transition: 0.15s;
}

.status-head-btn:hover {
  background: var(--primary);
  color: #000;
}

.status-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: #cfcfcf;
  margin-bottom: 1rem;
}

.status-extra input {
  width: 60px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #fff;
  color: #fff;
  text-align: center;
  font-weight: 700;
}

.status-extra-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.extra-clear-btn {
  height: 26px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;

  border: 1px solid #ff3b3b;
  color: #ffb0b0;
  background: transparent;
  cursor: pointer;
}

.extra-clear-btn:hover {
  background: rgba(255, 59, 59, 0.12);
}

.library-main-tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.library-subtab:hover {
  border-color: var(--primary);
}

.library-subtab.active {
  color: var(--primary);
  border-color: var(--primary);
}

.library-toggle {
  color: var(--primary);
}

.library-add-btn {
  background: var(--primary);
  color: #fff;
}

.library-add-btn:hover {
  filter: brightness(0.9);
}

.library-divider {
  background: var(--primary);
}

.ability-library-box {
  width: min(1100px, 95vw);
  max-height: 84vh;
  overflow-y: auto;
  background: #1a1a1f;
  border: 1px solid #2b2b35;
}

.library-main-tabs {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-right: 8px;
}

.library-main-tab {
  background: transparent;
  border: none;
  color: #bdbdc7;
  font-size: 14px;
  font-weight: 600;
  padding: 0 0 8px;
  cursor: pointer;
  transition: 0.15s ease;
}

.library-main-tab:hover {
  color: #fff;
}

.library-main-tab.active {
  color: #fff;
}

.library-subtabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.library-subtab {
  background: #101015;
  border: 1px solid #2a2a35;
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.library-search-wrap {
  margin-bottom: 18px;
}

.library-search-wrap input {
  width: 100%;
  height: 46px;
  background: #0d0d12;
  border: 1px solid #2b2b35;
  color: #fff;
  font-size: 15px;
  padding: 0 14px;
  outline: none;
}

.library-list {
  display: grid;
  gap: 12px;
}

.library-card {
  background: linear-gradient(90deg, rgba(37, 37, 42, 0.96), rgba(24, 24, 29, 0.96));
  border: 1px solid #2b2b35;
  border-radius: 10px;
  overflow: hidden;
}

.library-card-head {
  display: grid;
  grid-template-columns: 46px 1fr 50px;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 0 14px;
}

.library-toggle {
  background: transparent;
  border: none;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transform: rotate(-90deg);
  transition: 0.15s ease;
}

.library-toggle.is-open {
  transform: rotate(0deg);
}

.library-card-title {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}

.library-add-btn {
  width: 40px;
  height: 40px;
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.15s ease;
}

.library-card-body {
  padding: 0 18px 18px;
  color: #f2f2f2;
  font-size: 15px;
  line-height: 1.55;
}

.library-divider {
  height: 1px;
  margin-bottom: 16px;
}

.library-empty {
  text-align: center;
  color: #cfcfcf;
  padding: 30px 10px;
  font-size: 16px;
}

.tag-conhecimento { color: #e6c78c; }
.tag-energia { color: #c26bf4; }
.tag-morte { color: #9e9e9e; }
.tag-sangue { color: #ff2e2e; }
.tag-varia { color: #44b6ea; }

.library-card.tag-conhecimento span {
  color: #e6c78c;
}

.library-card.tag-energia span {
  color: #c26bf4;
}

.library-card.tag-morte span {
  color: #9e9e9e;
}

.library-card.tag-sangue span {
  color: #ff2e2e;
}

.library-card.tag-varia span {
  color: #44b6ea;
}

.library-card span {
  font-weight: 800;
}

.skill-select {
  text-align: center;
  text-align-last: center; /* 🔥 ESSA LINHA resolve o centro real */
}

.skill-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: transparent;
  color: #fff;

  border: none;
  border-bottom: 1px solid #fff;

  width: 100%;
  height: 100%;

  font-size: 12px;
  font-family: inherit;

  padding-right: 16px;
  cursor: pointer;
}

.skill-select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='10' viewBox='0 0 20 20' width='10' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 10px;
}

.skill-select option {
  background: #000;
  color: #fff;
}

.inventory-panel-box {
  padding-top: 6px;
}

.inventory-add-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

#inventoryAddBtn {
  width: 78px;
  min-width: 78px;
  height: 30px;
  min-height: 30px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
}

.inventory-inline-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inventory-inline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 34px;
}

.inventory-inline-row-top {
  justify-content: flex-start;
}

.inventory-inline-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-inline-label {
  color: #bfbfbf;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.fixed-label {
  width: 102px;
  flex: 0 0 102px;
}

.prestige-group .inventory-inline-label {
  width: 118px;
  flex: 0 0 118px;
}

.patent-group .inventory-inline-label {
  width: 54px;
  flex: 0 0 54px;
}

.credit-group .inventory-inline-label {
  width: 108px;
  flex: 0 0 108px;
}

.load-group .inventory-inline-label {
  width: 72px;
  flex: 0 0 72px;
}

.inventory-inline-box {
  height: 30px;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  outline: none;
  padding: 0 6px;
}

.inventory-inline-box[readonly] {
  pointer-events: none;
}

.box-small {
  width: 44px;
}

.box-patent {
  width: 156px;
}

.box-credit {
  width: 88px;
}

.box-tiny {
  width: 42px;
}

.credit-group,
.load-group {
  min-width: 0;
}

.inventory-inline-row {
  margin-bottom: 10px;
}

.inventory-inline-categories {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.inventory-cat span {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.inventory-load-boxes {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-bottom-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px 16px;
}

.inventory-inline-row-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.inventory-inline-row-top .inventory-inline-group {
  width: 100%;
}

.box-patent {
  width: 180px; /* pode ajustar se quiser */
}

.inventory-inline-row.inventory-new-row {
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.inventory-inline-row.inventory-new-row .fixed-label {
  width: auto;
  flex: none;
  text-align: center;
}

.inventory-inline-row.inventory-new-row .inventory-inline-label {
  margin-left: 3rem;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.inventory-actions-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-left: 3rem;
  flex-wrap: nowrap;
}

.inventory-manual-btn {
  min-width: 64px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--primary);
  background: transparent;
  color: #d0d0d0;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.inventory-manual-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.inventory-empty-state {
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
  font-weight: 800;
}

.inventory-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.box-patent option {
  background: #111;
  color: #fff;
}

#protectionModal .protection-modal-box {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

#protectionModal .protection-form-grid {
  gap: 18px 20px;
}

#protectionModal .attack-modal-actions {
  margin-top: 20px;
}

/* =========================
   Aba Descrição
   ========================= */
.description-panel {
  padding-top: 8px;
  display: grid;
  gap: 24px;
}

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

.description-group label {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
}

.description-group textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  background: #1d1d21;
  border: 1px solid #35353c;
  border-radius: 3px;
  color: #ffffff;
  padding: 12px 12px;
  outline: none;
  font-size: 16px;
  line-height: 1.35;
  font-family: inherit;
}

.description-group textarea::placeholder {
  color: #8d8d95;
}

.description-group textarea:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-soft) 65%, transparent);
}

#tab-descricao {
  width: 100%;
}

@media (max-width: 560px) {
  .description-group textarea {
    min-height: 100px;
    font-size: 15px;
  }
}