/* ================= PERSONAGENS ================= */
.grid-personagens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card {
  height: 115px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;

  display: flex;
  align-items: flex-end;

  background-size: cover;
  background-position: center;
  border: 1px solid rgba(241, 230, 207, 0.08);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 6, 0.45);
}

.card-acoes {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 5px;
  z-index: 3;
}

.card-acoes button {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-duplicar {
  background: rgba(200, 169, 107, 0.9);
  color: #1b1411;
}

.btn-duplicar:hover {
  background: #c8a662;
}

.btn-deletar {
  background: rgba(20, 14, 10, 0.75);
  color: #f8f1df;
}

.btn-deletar:hover {
  background: rgb(0, 0, 0);
}

.add {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: bold;
  color: rgba(241, 230, 207, 0.75);
}

.overlay {
  position: relative;
  z-index: 1;

  width: 100%;
  padding: 10px;
  color: white;
  font-weight: bold;
}

.img {
  width: 100%;
  height: 100px;
  border-radius: 8px;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ================= ABAS ================= */
.tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  background: #241b16;
  z-index: 9999;
}

.tabs button,
.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  color: #f1e6cf;
  font-size: 18px;
  transition: 0.2s;
}

.tab-btn:hover {
  background: #4a4036;
}

.tab-btn.active {
  background: #b89654;
  color: #1b1411;
  transform: scale(0.95);
  border-top: 2px solid #f1e6cf;
}

/* ================= BOTÃO VOLTAR ================= */
.voltar {
  background: #76604a;
  border: none;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 10px;
  color: #f8f1df;
}

/* ================= LAYOUT ATRIBUTOS + PERÍCIAS ================= */
.main {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

/* ================= ATRIBUTOS ================= */
.atributos {
  width: 90px;
  flex-shrink: 0;

  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: linear-gradient(180deg, #7a624a 0%, #5f4c3b 100%);
  padding: 8px 8px;
  border-radius: 14px;
  width: 82px;
  min-height: 82px;
  border: 1px solid rgba(241, 230, 207, 0.08);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.attr span {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  color: #f8f1df;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.attr input {
  width: 54px;
  height: 30px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  margin: 0 0 8px 0;
  padding: 0;
  border-radius: 8px;
  background: #4a3b31;
  color: #f8f1df;
  border: 1px solid rgba(241, 230, 207, 0.05);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}

.attr > div:not(.save-check):not(.save-badge) {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  margin-top: 0;
  color: #f8f1df;
  background: rgba(31, 26, 23, 0.35);
  padding: 2px 10px;
  border-radius: 999px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.attr:hover {
  transform: translateY(-1px);
  transition: 0.2s ease;
}

/* ================= PERÍCIAS ================= */
.pericias {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #312621 0%, #261d18 100%);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(200, 169, 107, 0.08);
}

.header-pericias {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(200, 169, 107, 0.18);
}

.header-pericias span {
  font-family: "Cinzel", serif;
  font-size: 20px;
  font-weight: bold;
  color: #f3d9a2;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.prof-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(200, 169, 107, 0.12);
}

.prof-box label {
  font-size: 12px;
  font-weight: bold;
  color: #cdb791;
  opacity: 0.9;
}

.prof-box input {
  width: 42px;
  height: 26px;
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  border-radius: 6px;
  background: #4a3b31;
  color: #f8f1df;
}

#pericias {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pericia {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 6px;
  border-radius: 10px;
  transition: 0.2s ease;
}

.pericia:hover {
  background: rgba(200, 169, 107, 0.06);
}

.pericia label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: #f5ead6;
}

.pericia span {
  width: 58px;
  text-align: right;
  font-weight: 800;
  font-size: 24px;
  color: #f8f1df;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #b89654;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  color: #f8f1df;
  transition: 0.2s ease;
}

.check:hover {
  background: rgba(200, 169, 107, 0.12);
  transform: scale(1.05);
}

/* ================= COMBATE ================= */
.hp-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.linha-status {
  display: flex;
  gap: 8px;
}

.linha-status input {
  flex: 1;
  text-align: center;
}

.hp-bar {
  position: relative;
  overflow: hidden;

  height: 35px;
  border-radius: 10px;
  background: #2c221d;
}

#hp-fill {
  width: 100%;
  height: 100%;
  background: #b91c1c;
}

.hp-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 10px;
}

.hp-overlay button {
  background: rgba(20, 14, 10, 0.6);
  border: none;
  color: #f8f1df;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.hp-overlay span {
  font-weight: bold;
  color: #f8f1df;
}

/* ================= CAMPOS ================= */
.campo {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.campo label {
  font-size: 10px;
  opacity: 0.75;
  margin-bottom: 2px;
  text-align: center;
  color: #cdb791;
}

.campo input {
  text-align: center;
}

/* ================= POPUP ================= */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);

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

.popup-content {
  position: relative;

  width: 250px;
  padding: 20px;
  border-radius: 10px;

  background: #2c221d;
  color: #f8f1df;
  text-align: center;
}

.fechar {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  color: #f8f1df;
}

/* ================= INVENTÁRIO ================= */

#lista {
  list-style: none;
  padding: 0;
  margin: 0;
}

.item-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;

  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #2c221d;
}

.item-info {
  flex: 1;
  cursor: pointer;
}

.item-nome {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
  color: #f8f1df;
}

.item-desc {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
}

.item-remover {
  width: 28px;
  height: 28px;
  flex-shrink: 0;

  background: #7f1d1d;
  color: #f8f1df;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.item-remover:hover {
  background: #991b1b;
}

.inv-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.inv-add-btn {
  align-self: center;
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: 10px;
  background: #b89654;
  color: #1b1411;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.inv-add-btn:hover {
  background: #c8a662;
  transform: scale(1.05);
}

.item-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #2c221d;
  overflow: hidden;
}

.item-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.item-nome,
.item-desc,
#popup-titulo,
#popup-texto {
  overflow-wrap: break-word;
  word-break: break-word;
}

.item-desc {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
  white-space: normal;
}

.item-remover {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: #7f1d1d;
  color: #f8f1df;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 99999;
}

.popup-content {
  position: relative;
  width: min(360px, 100%);
  max-width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  padding-top: 44px;
  border-radius: 12px;
  background: #2c221d;
  color: #f8f1df;
  text-align: left;
}

.fechar {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #f8f1df;
}

/* ================= ARMAS ================= */
.arma-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.linha-add {
  display: flex;
  gap: 8px;
}

.linha-add input {
  flex: 1;
}

.linha-add button {
  width: 40px;
  border: none;
  border-radius: 8px;
  background: #b89654;
  color: #1b1411;
  font-size: 18px;
  cursor: pointer;
}

#listaArmas {
  list-style: none;
  padding: 0;
  margin: 0;
}

.arma-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;

  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #2c221d;
  overflow: hidden; /* importante */
}

.arma-info {
  flex: 1;
  min-width: 0; /* ESSENCIAL no flex */
}

.arma-nome {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
  color: #f8f1df;

  overflow-wrap: break-word;
  word-break: break-word;
}

.arma-dano {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
  white-space: normal;

  overflow-wrap: break-word;
  word-break: break-word;
}

.arma-remover {
  width: 32px;
  height: 32px;
  flex-shrink: 0;

  background: #7f1d1d;
  color: #f8f1df;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.arma-remover:hover {
  background: #991b1b;
}

/* ================= TELA INICIAL ================= */
#tela-inicial h2 {
  text-align: center;
  margin: 12px 0 20px 0;
  font-size: 22px;
  color: #f8f1df;
}

.card-info {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;

  width: 100%;
  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;

  text-shadow: none !important;
  filter: none !important;
}

.card-nome {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;

  display: inline-block;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.2;
  color: #f8f1df;

  padding: 3px 8px;
  border-radius: 6px;

  text-shadow: 0 0 6px rgba(0, 0, 0, 0.8) !important;
  filter: none !important;
  -webkit-text-stroke: 0 !important;
  background: none;
}

.card-classe {
  position: static !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;

  display: block;
  font-size: 11px;
  line-height: 1.1;
  color: #cdb791;

  text-shadow: none !important;
  filter: none !important;
  -webkit-text-stroke: 0 !important;
}

#preview {
  width: 100%;
  max-width: 130px;
  height: 170px;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 10px;
  display: block;
  margin: 10px auto;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.upload-imagem {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.botao-upload {
  background: #b89654;
  color: #1b1411;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
  display: inline-block;
}

.botao-upload:hover {
  background: #c8a662;
  transform: scale(1.03);
}

#nome-arquivo {
  font-size: 14px;
  color: #cdb791;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exaustao-inline {
  margin-top: 18px;
  padding: 10px 0;
}

.exaustao-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #f8f1df;
}

.exaustao-checks {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exaustao-check {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #4a3b31;
  color: #f1e6cf;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
}

.exaustao-check:hover {
  background: #5a4b3d;
}

.exaustao-check.ativo {
  background: #b91c1c;
  color: #fff;
  box-shadow: 0 0 8px rgba(185, 28, 28, 0.45);
}

.exaustao-box {
  margin-top: 18px;
}

.exaustao-box h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.exaustao-label {
  font-size: 13px;
}

#exaustao-desc {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 8px;
}

.save-check {
  width: 14px;
  height: 14px;
  border: 2px solid #b89654;
  border-radius: 5px;
  margin: 2px 0 4px 0;
  cursor: pointer;

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

  font-size: 9px;
  line-height: 1;
  color: #1b1411;
  background: transparent;
}

.save-check.ativo {
  background: #b89654;
  color: #1b1411;
}

.hp-bar.temp {
  background: #2c221d; /* igual a barra normal */
  margin-top: 8px;
}

#temp-fill {
  width: 0%;
  height: 100%;
  background: #2563eb;
  transition: width 0.05s linear;
}

.hp-total {
  margin-top: 6px;
  text-align: center;
  font-weight: bold;
  color: #93c5fd;
}

.morte-box {
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  background: #2c221d;
  text-align: center;
}

.morte-box h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #f8f1df;
}

.morte-linha {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.morte-linha span {
  font-size: 14px;
  font-weight: bold;
  color: #cdb791;
}

.morte-checks {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.morte-check {
  width: 18px;
  height: 18px;
  border: 2px solid #b89654;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.2s;
  background: transparent;
}

.morte-check.ativo {
  background: #b89654;
}

.morte-check.falha.ativo {
  background: #b91c1c;
  border-color: #b91c1c;
}

.exaustao-niveis {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

#exaustao-desc {
  text-align: center;
  font-size: 13px;
  margin-top: 6px;
  opacity: 0.8;
}

.exaustao-inline {
  display: flex;
  justify-content: center;
}

.exaustao-box {
  text-align: center;
}

.attr {
  position: relative;
}

.save-badge {
  position: absolute;

  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);

  width: 22px;
  height: 22px;

  border-radius: 50%;
  display: none;

  align-items: center;
  justify-content: center;

  background: #b89654;
  color: #1b1411;

  font-size: 11px;
  font-weight: bold;

  z-index: 5;
}

.attr {
  position: relative;
  padding-bottom: 28px; /* espaço pro badge */
}

.poder-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.poder-linha input {
  flex: 1;
}

#listaPoderes {
  list-style: none;
  padding: 0;
  margin: 0;
}

.poder-card {
  display: flex;
  align-items: stretch; /* 🔥 ocupa altura inteira igual inventário */
  gap: 12px;

  width: 100%; /* 🔥 garante largura total */

  margin-bottom: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #2c221d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.poder-info {
  flex: 1;
  min-width: 0;
  width: 100%; /* 🔥 força expandir igual inventário */
  cursor: pointer;
}

.poder-topo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.poder-icone {
  font-size: 18px;
}

.poder-nome {
  font-size: 18px;
  font-weight: bold;
  color: #f8f1df;
}

.poder-tipo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

.poder-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.poder-tag {
  background: #4a3b31;
  color: #f1e6cf;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
}

.poder-desc {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.poder-remover {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: #991b1b;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.poder-remover:hover {
  background: #b91c1c;
}

/* cores dos tipos */
.tipo-fogo {
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(220, 38, 38, 0.35);
}

.tipo-gelo {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.tipo-raio {
  background: rgba(250, 204, 21, 0.18);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.tipo-necrotico {
  background: rgba(107, 33, 168, 0.22);
  color: #d8b4fe;
  border: 1px solid rgba(107, 33, 168, 0.4);
}

.tipo-radiante {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tipo-veneno {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.tipo-psiquico {
  background: rgba(236, 72, 153, 0.18);
  color: #f9a8d4;
  border: 1px solid rgba(236, 72, 153, 0.35);
}

.tipo-trovejante {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.tipo-corte,
.tipo-perfurante,
.tipo-concussao {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.tipo-padrao {
  background: rgba(200, 169, 107, 0.18);
  color: #d8b56a;
  border: 1px solid rgba(200, 169, 107, 0.35);
}

.titulo-secao {
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: #d8b56a;
  margin: 15px 0;

  position: relative;
}

.titulo-secao::before,
.titulo-secao::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: rgba(200, 169, 107, 0.4);
}

.titulo-secao {
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: 20px;
  letter-spacing: 2px;
  color: #d8b56a;

  margin: 12px 0;

  position: relative;
}

.titulo-secao::before,
.titulo-secao::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: rgba(200, 169, 107, 0.3);
}

.titulo-secao::before {
  left: 0;
}

.titulo-secao::after {
  right: 0;
}

.titulo-secao {
  margin: 18px 0 14px 0;
}

.header-pericias-esquerda {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inspiracao-box input {
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  border-radius: 999px;
  border: 2px solid #b89654;
  background: #4a3b31;
  color: #f8f1df;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
}

.header-pericias-topo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inspiracao-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inspiracao-box label {
  font-size: 12px;
  font-weight: bold;
  color: #cdb791;
}

.inspiracao-box input {
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  border-radius: 50%;
  border: 2px solid #b89654;
  background: #4a3b31;
  color: #f8f1df;
}

.dt-box {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #312621 0%, #261d18 100%);
  border: 1px solid rgba(200, 169, 107, 0.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.subtitulo-secao {
  margin: 0 0 10px 0;
  font-family: "Cinzel", serif;
  font-size: 18px;
  color: #f3d9a2;
}

.dt-linha {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.dt-linha .campo {
  flex: 1;
}

.dt-resultado-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(200, 169, 107, 0.12);
}

.dt-resultado-box span {
  font-size: 14px;
  font-weight: bold;
  color: #cdb791;
}

#dtTotal {
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #b89654;
  color: #1b1411;
  font-size: 20px;
  font-weight: bold;
}

.inspiracao-box input {
  width: 38px;
  height: 38px;

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

  text-align: center;
  padding: 0;
  margin: 0;

  font-size: 16px;
  font-weight: bold;

  border-radius: 50%;
  border: 2px solid #b89654;
  background: #4a3b31;
  color: #f8f1df;

  line-height: 1;
}

.inspiracao-box input::-webkit-inner-spin-button,
.inspiracao-box input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.inspiracao-box input {
  appearance: textfield;
}

.header-pericias-topo {
  display: flex;
  align-items: center;
  gap: 25px; /* AUMENTA ISSO (antes era ~12px) */
}

.inspiracao-box label {
  font-family: "Cinzel", serif; /* mesma do Perícias */
  font-size: 14px;
  color: #f3d9a2;
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

.popup-content {
  position: relative;
  width: min(420px, 100%);
  max-width: 100%;
  max-height: 85vh;
  overflow-y: auto;

  padding: 24px 20px 20px;
  border-radius: 18px;

  background: #2c221d;
  border: 2px solid rgba(200, 169, 107, 0.18);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);

  color: #f8f1df;
  text-align: left;
}

.fechar {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #f8f1df;
  transition: 0.2s;
}

.fechar:hover {
  color: #d8b56a;
  transform: scale(1.08);
}

#popup-titulo {
  margin: 0 36px 18px 0;
  font-family: "Cinzel", serif;
  font-size: 28px;
  line-height: 1.1;
  color: #f3d9a2;
}

#popup-texto {
  margin: 0;
}

/* bloco geral do conteúdo */
.popup-bloco {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* rótulo tipo DESCRIÇÃO */
.popup-label {
  display: block;
  margin-bottom: 6px;

  font-family: "Cinzel", serif;
  font-size: 16px; /* menor */
  letter-spacing: 0.5px;

  color: #b89654; /* mais suave */
}

/* caixa interna mais clara */
.popup-descricao {
  min-height: 180px;

  padding: 6px 12px 12px 12px; /* topo bem menor */

  border-radius: 14px;
  background: #4a4036;
  border: 2px solid rgba(255, 255, 255, 0.04);

  color: #f8f1df;
  font-size: 16px;

  line-height: 1.4; /* diminui altura das linhas */

  white-space: pre-line;
  overflow-wrap: break-word;
}
/* opcional para infos extras */
.popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.popup-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(200, 169, 107, 0.1);
  border: 1px solid rgba(200, 169, 107, 0.2);
  color: #f3d9a2;
  font-size: 12px;
  font-weight: bold;
}

.popup-descricao * {
  margin: 0;
  padding: 0;
  padding-top: 4px;
}

.check {
  pointer-events: auto;
  cursor: pointer;
}

.pericia label {
  pointer-events: none;
}

.header-pericias {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(200, 169, 107, 0.18);
  flex-wrap: wrap;
}

.header-pericias-topo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.inspiracao-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inspiracao-box label {
  font-family: "Cinzel", serif;
  font-size: 14px;
  color: #f3d9a2;
  white-space: nowrap;
}

.inspiracao-box input {
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  text-align: center;
  line-height: 40px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 50%;
  border: 2px solid #b89654;
  background: #4a3b31;
  color: #f8f1df;
}

.prof-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(200, 169, 107, 0.12);
  flex-shrink: 0;
}

.check.ativo {
  background: #b89654;
  border-color: #b89654;
  color: #1b1411;
}

.check.ativo::after {
  content: "✓";
  font-size: 11px;
  font-weight: bold;
}

/* ⭐ EXPERTISE */
.check.expertise {
  background: linear-gradient(145deg, #b89654, #f3d9a2);
  border-color: #f3d9a2;
  color: #1b1411;
  box-shadow: 0 0 8px rgba(200, 169, 107, 0.6);
}

.check.expertise::after {
  content: "★";
  font-size: 12px;
}

.hp-bar {
  cursor: pointer;
  touch-action: none; /* ESSENCIAL pro drag funcionar bem */
}

.hp-bar,
.hp-bar.temp {
  cursor: pointer;
  touch-action: none;
}

.hp-overlay button,
.linha-add button,
.inv-add-btn,
.arma-remover,
.item-remover,
.poder-remover,
.card button,
.fechar {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.hp-overlay button:focus,
.hp-overlay button:active,
.linha-add button:focus,
.linha-add button:active,
.inv-add-btn:focus,
.inv-add-btn:active,
.arma-remover:focus,
.arma-remover:active,
.item-remover:focus,
.item-remover:active,
.poder-remover:focus,
.poder-remover:active,
.card button:focus,
.card button:active,
.fechar:focus,
.fechar:active {
  outline: none;
  box-shadow: none;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.hp-overlay,
.hp-overlay * {
  -webkit-tap-highlight-color: transparent;
}

.hp-overlay button {
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-shadow: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.hp-overlay button:focus,
.hp-overlay button:active,
.hp-overlay button:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.arma-desc {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: #bfae96;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.popup-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.tag-dano {
  background: rgba(200, 169, 107, 0.15);
  border: 1px solid rgba(200, 169, 107, 0.4);
  color: #f3d9a2;

  padding: 4px 10px;
  border-radius: 999px;

  font-size: 13px;
  font-weight: bold;

  box-shadow: 0 0 6px rgba(200, 169, 107, 0.2);
}

.popup-acoes {
  position: absolute;
  top: 12px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.popup-editar {
  background: rgba(200, 169, 107, 0.16);
  border: 1px solid rgba(200, 169, 107, 0.35);
  color: #f3d9a2;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.2s;
}

.popup-editar:hover {
  transform: scale(1.06);
  background: rgba(200, 169, 107, 0.25);
}

.fechar {
  position: static;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #f8f1df;
  transition: 0.2s;
}

.popup-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.popup-form input,
.popup-form textarea {
  width: 100%;
  background: #5a4b3f;
  color: #f8f1df;
  border: none;
  border-radius: 12px;
  padding: 10px;
}

.popup-form textarea {
  min-height: 100px;
  resize: vertical;
}

.popup-salvar-btn {
  margin-top: 10px;
  background: #b89654;
  color: #1b1411;
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: bold;
  cursor: pointer;
}
.item-acoes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.acoes-topo {
  display: flex;
  gap: 5px;
}

.poder-remover {
  align-self: flex-end; /* 👈 força o X pra direita */
}

.btn-editar {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(200, 169, 107, 0.35);
  border-radius: 8px;
  background: rgba(200, 169, 107, 0.15);
  color: #f3d9a2;
  cursor: pointer;
  font-size: 15px;
}

.btn-editar:hover {
  transform: scale(1.05);
  background: rgba(200, 169, 107, 0.25);
}

/* ================= ANIMAÇÃO DAS ABAS ================= */
.aba {
  display: none;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  filter: blur(4px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    filter 0.35s ease;
  will-change: opacity, transform, filter;
}

.aba.active {
  display: block;
}

.aba.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.aba.hiding {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  filter: blur(3px);
}

button:active {
  transform: scale(0.92);
}

.inv-add-btn:active {
  transform: scale(0.85) rotate(-2deg);
}

.item-card,
.arma-card,
.poder-card {
  transition: 0.25s ease;
}

.item-card:hover,
.arma-card:hover,
.poder-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

#ficha {
  animation: fadeInFicha 0.4s ease;
}

.tipo-fogo {
  box-shadow: 0 0 10px rgba(255, 80, 80, 0.4);
}
.tipo-gelo {
  box-shadow: 0 0 10px rgba(100, 180, 255, 0.4);
}
.tipo-raio {
  box-shadow: 0 0 10px rgba(255, 255, 100, 0.4);
}
.tipo-necrotico {
  box-shadow: 0 0 10px rgba(180, 100, 255, 0.4);
}

.spawn {
  animation: spawnItem 0.3s ease;
}

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

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

.attr.up {
  animation: glowUp 0.4s ease;
}

@keyframes glowUp {
  0% {
    box-shadow: 0 0 0 rgba(200, 169, 107, 0);
  }
  50% {
    box-shadow: 0 0 12px rgba(200, 169, 107, 0.7);
  }
  100% {
    box-shadow: 0 0 0 rgba(200, 169, 107, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aba {
    transition: none;
    transform: none;
    filter: none;
  }
}

.item-preview,
.arma-preview,
.poder-preview {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: #bfa98a;
  line-height: 1.35;
  opacity: 0.9;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-info,
.arma-info,
.poder-info {
  min-width: 0;
}

#antecedentes,
#aliados {
  min-height: 90px;
  margin-top: 8px;
}

.personagem-topo {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.personagem-imagem-box {
  width: 140px;
  flex-shrink: 0;
}

.personagem-upload {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0 0 8px 0;
}

.personagem-upload .botao-upload {
  text-align: center;
  padding: 8px 10px;
  font-size: 14px;
}

.personagem-upload #nome-arquivo {
  max-width: 100%;
  font-size: 12px;
  text-align: center;
}

#preview {
  width: 100%;
  max-width: 140px;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}

#antecedentes,
#idiomas {
  min-height: 100px;
}

#listaAliados {
  list-style: none;
  padding: 0;
  margin: 0;
}

.personagem-topo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.personagem-imagem-box {
  width: 135px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.personagem-upload {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 0 0 8px 0;
}

.personagem-upload .botao-upload {
  width: 100%;
  text-align: center;
  padding: 8px 10px;
  font-size: 13px;
}

.personagem-upload #nome-arquivo {
  max-width: 100%;
  font-size: 11px;
  text-align: center;
}

#preview {
  width: 100%;
  max-width: 135px;
  height: 170px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin: 0;
}

/* ================= PERSONAGEM TOPO ================= */

.personagem-topo {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.personagem-campos {
  flex: 1;
  min-width: 0;
}

.personagem-imagem-box {
  width: 128px;
  flex-shrink: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
}

#preview {
  width: 128px;
  height: 170px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin: 0 0 8px 0;
  background: #2c221d;
  border: 1px solid rgba(200, 169, 107, 0.18);
}

.personagem-upload {
  width: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.personagem-upload #nome-arquivo {
  max-width: 100%;
  font-size: 11px;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* ================= PERSONAGEM TOPO LIMPO ================= */

.personagem-topo {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.personagem-campos {
  flex: 1;
  min-width: 0;

  display: flex;
  flex-direction: column;
  gap: 8px;
}

.personagem-campos input,
.personagem-campos textarea {
  width: 100%;
  margin: 0;
}

#antecedentes {
  min-height: 108px;
  height: 108px;
  resize: none;
}

.personagem-imagem-box {
  width: 130px;
  flex-shrink: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
}

#preview {
  width: 130px;
  height: 170px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin: 0 0 8px 0;
  background: #4a3b31;
  border: 1px solid rgba(200, 169, 107, 0.35);
}

.personagem-upload {
  width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.personagem-upload .botao-upload {
  width: 100%;
  text-align: center;
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.personagem-upload .botao-upload {
  width: 100%;
  text-align: center;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 10px;
}

.personagem-upload #nome-arquivo {
  width: 100%;
  max-width: 100%;
  font-size: 11px;
  text-align: center;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.upload-imagem input[type="file"] {
  display: none;
}

@media (max-width: 420px) {
  .personagem-topo {
    gap: 10px;
  }

  .personagem-imagem-box,
  .personagem-upload,
  .personagem-imagem-box #preview {
    width: 118px;
  }

  .personagem-imagem-box #preview {
    height: 155px;
  }
}

#antecedentes {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  resize: none;
  margin-top: 1px;
}

#resistencias {
  min-height: 80px;
}

.btn-diario {
  width: 100%;
  margin: 10px 0 12px 0;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #b89654;
  color: #2c2520;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.btn-diario:hover {
  background: #c8a662;
  transform: scale(1.01);
}

.diario-box {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 14px;
  background: #2c221d;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

#diario {
  width: 100%;
  min-height: 220px;
  max-height: 320px;
  resize: vertical;
  overflow-y: auto;
  line-height: 1.5;
}

.subtitulo-inventario {
  margin: 16px 0 12px 0;
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: 20px;
  color: #cdb791;
  position: relative;
}

.subtitulo-inventario::before,
.subtitulo-inventario::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 32%;
  height: 1px;
  background: rgba(200, 169, 107, 0.35);
}

.subtitulo-inventario::before {
  left: 0;
}

.subtitulo-inventario::after {
  right: 0;
}

.proficiencias-secao {
  margin-top: 18px;
  padding: 12px;
  border-radius: 16px;
  background: #2c221d;
}

#proficienciasExtras {
  min-height: 110px;
  resize: vertical;
  line-height: 1.4;
}

.dominio-box {
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  background: #2c221d;
  text-align: center;
}

.dominio-checks {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.dominio-check {
  width: 22px;
  height: 22px;
  border: 2px solid #b89654;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.2s;
  background: transparent;
}

.dominio-check.ativo {
  background: #b89654;
}

.resistencias-box {
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  background: #2c221d;
  text-align: center;
}

.resistencias-box textarea {
  margin-top: 8px;
}

.arma-cargas-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.arma-cargas-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f1e6cf;
  font-weight: bold;
}

.arma-cargas-toggle input {
  width: auto;
  margin: 0;
}

#armaMaxCargas {
  width: 100%;
}

.arma-cargas-box {
  margin-top: 8px;
}

.arma-cargas-label {
  display: block;
  font-size: 12px;
  color: #cdb791;
  margin-bottom: 6px;
  font-weight: bold;
}

.arma-cargas-checks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.arma-carga-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #b89654;
  background: transparent;
  cursor: pointer;
  transition: 0.2s;
}

.arma-carga-check.ativo {
  background: #b89654;
}

.arma-dano-preview {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
}

.arma-desc-preview {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toggle-cargas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  color: #f1e6cf;
  font-weight: bold;
}

/* SWITCH BASE */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* FUNDO */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #4a3b31;
  border-radius: 20px;
  transition: 0.3s;
  border: 1px solid #b89654;
}

/* BOLINHA */
.slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 2px;
  background-color: #b89654;
  border-radius: 50%;
  transition: 0.3s;
}

/* ATIVO */
.switch input:checked + .slider {
  background-color: #b89654;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background-color: #2c221d;
}

.toggle-cargas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #2c221d;
  border: 1px solid rgba(200, 169, 107, 0.12);
}

.toggle-cargas-texto {
  color: #f1e6cf;
  font-weight: bold;
  font-size: 15px;
}

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

.switch-cargas input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-cargas {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #4a3b31;
  border: 1px solid #b89654;
  border-radius: 999px;
  transition: 0.25s ease;
}

.slider-cargas::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 4px;
  top: 3px;
  border-radius: 50%;
  background: #b89654;
  transition: 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.switch-cargas input:checked + .slider-cargas {
  background: #b89654;
}

.switch-cargas input:checked + .slider-cargas::before {
  transform: translateX(21px);
  background: #2c221d;
}

.arma-acoes-final {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.arma-acoes-final .inv-add-btn {
  align-self: auto;
  margin: 0;
}

.add-linha {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.add-linha .inv-add-btn {
  margin: 0;
  align-self: auto;
}

.poder-card {
  position: relative;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease,
    box-shadow 0.15s ease;
}

.poder-drag-handle {
  width: 34px;
  min-width: 34px;
  height: 34px;

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

  border-radius: 10px;
  background: #76604a;
  color: #f8f1df;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;

  font-size: 18px;
  font-weight: bold;
  line-height: 1;
}

.poder-drag-handle:active {
  cursor: grabbing;
}

.poder-card.dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.poder-card.drag-over {
  outline: 2px dashed #b89654;
  outline-offset: 2px;
}

.item-acoes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-mover {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: #76604a;
  color: #f8f1df;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: 0.2s;
}

.poder-card {
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease;
  will-change: transform;
}

.poder-card.movendo {
  z-index: 2;
}

.btn-mover {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: #76604a;
  color: #f8f1df;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: 0.2s;
}

.btn-mover:hover {
  background: #7a624a;
  transform: scale(1.05);
}

.card-acoes {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 5px;
}

.btn-duplicar {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(200, 169, 107, 0.8);
  color: #1b1411;
  cursor: pointer;
  font-size: 12px;
}

.btn-duplicar:hover {
  background: #b89654;
}

.btn-deletar {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 14, 10, 0.75);
  color: #f8f1df;
  cursor: pointer;
}

.secao-toggle {
  margin-bottom: 18px;
}

.titulo-toggle {
  display: flex;
  align-items: center;
  justify-content: center; /* 🔥 centraliza tudo */

  gap: 10px;
  cursor: pointer;
  user-select: none;

  font-family: "Cinzel", serif; /* 🔥 fonte medieval */
  font-size: 20px;
  letter-spacing: 1px;
  color: #f3d9a2;

  position: relative;
}

.titulo-toggle .setinha {
  font-size: 16px;
  transition: transform 0.25s ease;
  color: #b89654;
}

.titulo-toggle.fechado .setinha {
  transform: rotate(-90deg);
}

.conteudo-toggle {
  overflow: hidden;
  max-height: 500px;
  opacity: 1;
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease,
    margin-top 0.25s ease;
  margin-top: 8px;
}

.conteudo-toggle.fechado {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.armadura-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

#listaArmaduras {
  list-style: none;
  padding: 0;
  margin: 0;
}

.armadura-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #2c221d;
  overflow: hidden;
}

.armadura-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.armadura-nome,
.armadura-ca-preview,
.armadura-desc-preview {
  overflow-wrap: break-word;
  word-break: break-word;
}

.armadura-nome {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
  color: #f8f1df;
}

.armadura-ca-preview {
  margin: 0 0 4px 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
}

.armadura-desc-preview {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
  white-space: normal;
}

.lista-sempre-visivel {
  margin-top: 12px;
}

.titulo-toggle span {
  font-family: "Cinzel", serif !important;
}

.titulo-linha {
  width: 100%;
  text-align: center;
  font-family: "Cinzel", serif !important;
  font-size: 18px;
  color: #d4b06a;
  letter-spacing: 2px;
  margin: 18px 0;
  position: relative;
}

/* LINHA COMPLETA ATRÁS */
.titulo-linha::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, #b89654, transparent);
  z-index: 0;
}

/* TEXTO */
.titulo-linha span {
  position: relative;
  z-index: 1;
}

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

.acoes-topo .btn-mover,
.acoes-topo .btn-editar {
  width: 32px;
  height: 32px;
}

.poder-nome {
  display: block;
  margin-bottom: 4px;
}

.poder-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.poder-preview {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
}

.poder-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-acoes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.btn-mover,
.btn-editar {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #8a6f4d;
  color: #f8f1df;
  font-weight: bold;
}

.btn-mover:hover,
.btn-editar:hover {
  background: #a3855d;
}

.item-remover {
  align-self: flex-end;
}

.item-preview {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

@keyframes subirItem {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(-15px);
    opacity: 0.7;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes descerItem {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(15px);
    opacity: 0.7;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.item-animar-cima {
  animation: subirItem 0.25s ease;
}

.item-animar-baixo {
  animation: descerItem 0.25s ease;
}

.poder-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= AJUSTES DE PALETA D&D REFINADA ================= */
body {
  background: #1b1411;
  color: #f1e6cf;
}

.tabs {
  background: linear-gradient(to top, #241b16, #2a1f18);
  border-top: 1px solid rgba(184, 150, 84, 0.22);
}

input,
textarea,
select {
  background: #4a3b31;
  color: #f3e7cf;
  border: 1px solid rgba(184, 150, 84, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: rgba(243, 231, 207, 0.55);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(184, 150, 84, 0.42);
  box-shadow: 0 0 0 2px rgba(184, 150, 84, 0.12);
}

.item-card,
.arma-card,
.poder-card,
.diario-box,
.morte-box,
.popup-content,
.pericias,
.armadura-card {
  background: #2c221d;
}

.botao-upload,
.inv-add-btn,
.btn-diario {
  background: #b89654;
  color: #1b1411;
}

.botao-upload:hover,
.inv-add-btn:hover,
.btn-diario:hover {
  background: #c8a662;
}

.tab-btn.active {
  background: #b89654;
  color: #1b1411;
  box-shadow: 0 0 10px rgba(184, 150, 84, 0.24);
}

.titulo-secao,
.subtitulo-secao,
.header-pericias span,
.inspiracao-box label {
  color: #e5c98f;
}

.item-card,
.arma-card,
.poder-card,
.pericias,
.diario-box,
.proficiencias-secao,
.dominio-box,
.popup-content {
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(200, 169, 107, 0.08);
}

.inv-add-btn,
.botao-upload,
.tab-btn.active,
.btn-diario {
  box-shadow: 0 0 10px rgba(200, 169, 107, 0.18);
}

#preview {
  border: 1px solid rgba(200, 169, 107, 0.45);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.03) inset,
    0 6px 16px rgba(0, 0, 0, 0.35);
}

.item-card:hover,
.arma-card:hover,
.poder-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(200, 169, 107, 0.1);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(200, 169, 107, 0.5);
  box-shadow:
    0 0 0 1px rgba(200, 169, 107, 0.22),
    0 0 10px rgba(200, 169, 107, 0.14);
}

.save-badge,
.dominio-check.ativo,
.morte-check.ativo,
.arma-carga-check.ativo,
.check.ativo {
  box-shadow: 0 0 8px rgba(200, 169, 107, 0.35);
}

.header-rpg::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    rgba(255, 120, 0, 0.12),
    rgba(255, 80, 0, 0.05),
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

.pericias::before,
.diario-box::before,
.proficiencias-secao::before,
.resistencias-box::before,
.popup-content::before {
  content: "✦";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 12px;
  color: rgba(200, 169, 107, 0.35);
}

.pericias,
.item-card,
.arma-card,
.poder-card,
.diario-box,
.proficiencias-secao,
.dominio-box,
.resistencias-box,
.morte-box,
.exaustao-box,
.popup-content {
  position: relative;
  border: 1px solid rgba(200, 169, 107, 0.14);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    inset 0 0 0 1px rgba(200, 169, 107, 0.05);
}

.header-rpg::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  left: 50%;
  top: -30px;
  transform: translateX(-50%);
  background: radial-gradient(
    rgba(255, 120, 0, 0.14),
    rgba(255, 80, 0, 0.06),
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border: 1px solid rgba(200, 169, 107, 0.35);
  box-shadow:
    0 0 0 1px rgba(200, 169, 107, 0.15),
    0 0 10px rgba(200, 169, 107, 0.12);
}

#preview {
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 0 10px rgba(200, 169, 107, 0.25);
}

.inv-add-btn,
.botao-upload,
.btn-diario {
  box-shadow: 0 4px 10px rgba(200, 169, 107, 0.18);
}

.titulo-secao::before,
.titulo-secao::after,
.subtitulo-inventario::before,
.subtitulo-inventario::after {
  background: linear-gradient(
    to right,
    transparent,
    rgba(200, 169, 107, 0.55),
    transparent
  );
}

.hp-overlay button {
  position: relative;
}

.hp-overlay button::before {
  content: "";
  position: absolute;
  inset: 2px; /* aumenta a área de clique */
}

.popup-form select {
  width: 100%;
  background: #5a4b3f;
  color: #f8f1df;
  border: none;
  border-radius: 12px;
  padding: 10px;
  margin: 0;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.item-info {
  position: relative;
}

.item-qtd {
  position: absolute;
  top: 0;
  right: 0;

  min-width: 28px;
  height: 28px;
  padding: 0 9px;

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

  background: #5a4633;
  color: #f8f1df;
  font-size: 13px;
  font-weight: 700;

  border-radius: 999px;
  border: 2px solid #8c6b45;

  box-shadow:
    0 0 0 2px rgba(27, 20, 17, 0.6),
    0 4px 10px rgba(0, 0, 0, 0.3);
}

.item-acoes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.acoes-topo {
  display: flex;
  gap: 8px;
}

.btn-mover,
.btn-editar,
.item-remover {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: 0.2s ease;
}

.btn-mover {
  background: #8a6b46;
  color: #f8f1df;
}

.btn-mover:hover {
  background: #a17c52;
  transform: scale(1.05);
}

.btn-editar {
  background: #8a6b46;
  color: #1b1411;
}

.btn-editar:hover {
  background: #b89654;
  transform: scale(1.05);
}

.btn-mover,
.btn-editar,
.item-remover {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.item-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #2c221d;
  overflow: hidden;

  opacity: 1;
  transform: translateY(0);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease,
    box-shadow 0.25s ease;
}

.item-card.movendo-cima {
  transform: translateY(-10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.item-card.movendo-baixo {
  transform: translateY(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.item-card {
  will-change: transform, opacity;
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-preview {
  margin-top: 6px;
}

/* ================= SUBABAS PODERES / MAGIAS ================= */
.subtabs-poderes,
.subtabs-circulos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 14px 0;
}

.subtab-poder,
.subtab-circulo {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  background: #4a3b31;
  color: #f1e6cf;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.subtab-poder:hover,
.subtab-circulo:hover {
  background: #5a4b3d;
  transform: translateY(-1px);
}

.subtab-poder.active,
.subtab-circulo.active {
  background: #b89654;
  color: #1b1411;
  box-shadow:
    0 0 0 1px rgba(241, 230, 207, 0.15),
    0 4px 10px rgba(0, 0, 0, 0.25);
}

.subconteudo-poder,
.subconteudo-circulo {
  animation: fadeSubAba 0.2s ease;
}

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

/* ================= BLOCO DE GASTO DE CÍRCULO ================= */
.bloco-gasto-circulo {
  margin: 8px 0 14px 0;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #312621 0%, #261d18 100%);
  border: 1px solid rgba(200, 169, 107, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.label-gasto-circulo {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: bold;
  color: #f3d9a2;
}

.input-gasto-circulo {
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  background: #4a3b31;
  color: #f8f1df;
  border: 1px solid rgba(241, 230, 207, 0.08);
  border-radius: 10px;
  padding: 10px;
}

/* ================= TAG DO CÍRCULO ================= */
.tag-circulo {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(184, 150, 84, 0.12);
  border: 1px solid rgba(184, 150, 84, 0.5);
  color: #f3d9a2;
  font-size: 12px;
  font-weight: bold;
}

/* ================= ESPAÇO DAS LISTAS ================= */
#listaPoderesComuns,
#listaMagiasCirculo0,
#listaMagiasCirculo1,
#listaMagiasCirculo2,
#listaMagiasCirculo3,
#listaMagiasCirculo4,
#listaMagiasCirculo5,
#listaMagiasCirculo6,
#listaMagiasCirculo7,
#listaMagiasCirculo8,
#listaMagiasCirculo9 {
  list-style: none;
  padding: 0;
  margin: 0;
}

.subaba-magias-topo {
  margin-bottom: 10px;
}

.subaba-magias-topo h3 {
  margin: 0 0 8px 0;
  font-family: "Cinzel", serif;
  color: #f3d9a2;
  font-size: 18px;
  letter-spacing: 0.5px;
}

.topo-slots-circulo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #e7c58a;
}

.slots-circulo {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.slot-bolinha {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #b89654;
  background: transparent;
  cursor: pointer;
  transition: 0.2s;
}

.slot-bolinha.usado {
  background: #b89654;
  box-shadow: 0 0 6px #b89654;
}

.subaba-poderes {
  display: none;
}

.subaba-poderes.active {
  display: block;
}

.circulo-box {
  display: none;
}

.circulo-box.active {
  display: block;
}

.poder-card {
  transition:
    transform 0.25s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  will-change: transform;
}

.poder-card.animando {
  z-index: 2;
}

/* ================= POLIMENTO VISUAL - PODERES E MAGIAS ================= */

.subtabs-poderes {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 18px;
}

.subtab-poder {
  min-width: 110px;
  height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.subtabs-circulos {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 18px;
}

.subtab-circulo {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.circulo-box {
  border-radius: 16px;
  padding: 4px 0 0;
}

.gasto-circulo-box {
  margin-bottom: 14px;
}

.topo-slots-circulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.topo-slots-circulo span {
  flex: 1;
  font-size: 17px;
  font-weight: bold;
  color: #f3d9a2;
}

.btn-editar-slots {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(200, 169, 107, 0.35);
  border-radius: 10px;
  background: rgba(200, 169, 107, 0.15);
  color: #f3d9a2;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
  flex-shrink: 0;
}

.btn-editar-slots:hover {
  transform: scale(1.05);
  background: rgba(200, 169, 107, 0.25);
}

.slots-circulo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 28px;
  margin-bottom: 8px;
}

.slot-bolinha {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #c8a662;
  background: transparent;
  cursor: pointer;
  transition: 0.18s ease;
}

.slot-bolinha.usado {
  background: #c8a662;
  box-shadow: 0 0 8px rgba(200, 166, 98, 0.35);
}

.slot-bolinha:hover {
  transform: scale(1.08);
}

.poder-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 14px 12px;
  border-radius: 16px;
}

.poder-info {
  flex: 1;
  min-width: 0;
}

.poder-nome {
  display: block;
  font-size: 17px;
  margin-bottom: 6px;
  line-height: 1.2;
}

.poder-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.poder-preview {
  margin-top: 10px;
  line-height: 1.45;
}

.item-acoes {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-shrink: 0;
}

.acoes-topo {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-mover,
.btn-editar,
.item-remover {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-mover {
  background: #8a6f4d;
  color: #f8f1df;
  border: none;
  font-size: 16px;
}

.btn-mover:hover {
  background: #a3855d;
  transform: scale(1.05);
}

.btn-editar {
  background: rgba(200, 169, 107, 0.15);
  color: #f3d9a2;
  border: 1px solid rgba(200, 169, 107, 0.35);
  font-size: 15px;
}

.btn-editar:hover {
  background: rgba(200, 169, 107, 0.25);
  transform: scale(1.05);
}

.item-remover {
  background: #a61d1d;
  color: #fff;
  border: none;
  font-size: 18px;
}

.item-remover:hover {
  background: #c62828;
  transform: scale(1.05);
}

.btn-mover:focus,
.btn-mover:active {
  outline: none;
  transform: none;
}

.btn-mover:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(184, 150, 84, 0.25);
}

/* CENTRALIZAR TEXTO DO CÍRCULO */
.topo-slots-circulo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* 👈 centraliza tudo */
  margin-bottom: 10px;
}

/* TEXTO "Círculo X" */
.topo-slots-circulo span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);

  font-family: "Cinzel", serif; /* 👈 mesma fonte do site */
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;

  color: #f3d9a2;
}

/* BOTÃO DE EDITAR (mantém na direita) */
.btn-editar-slots {
  position: absolute;
  right: 0;
}

.acoes-ficha-fixas {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 520px;
  display: flex;
  gap: 10px;
  z-index: 999;
  padding: 10px;
  border-radius: 16px;
  background: rgba(20, 10, 8, 0.92);
  border: 1px solid rgba(255, 170, 90, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}

.btn-acao-ficha {
  flex: 1;

  padding: 8px 10px; /* 👈 menor */
  font-size: 12px; /* 👈 menor */

  border-radius: 10px;

  border: 1px solid rgba(255, 170, 90, 0.25);
  background: linear-gradient(180deg, #2a1610, #1a0d09);
  color: #f6d7a8;

  font-family: "Cinzel", serif;
  font-weight: 700;

  cursor: pointer;
  transition: 0.15s;
}

.btn-acao-ficha:hover {
  border-color: rgba(255, 180, 100, 0.5);
  box-shadow: 0 0 14px rgba(255, 120, 0, 0.2);
}

.acoes-ficha-fixas {
  padding: 6px; /* 👈 menor */
  gap: 6px; /* 👈 menos espaço entre botões */
}

/* ================= RESPIRO DA ABA PODERES ================= */
#poderes {
  padding: 0 8px 90px;
}

#poderes .dt-box,
#poderes .secao-toggle,
#poderes .subtabs-poderes,
#poderes .subaba-poderes {
  margin-left: 4px;
  margin-right: 4px;
}

#poderes .conteudo-toggle {
  padding: 12px;
}

#poderes .poder-add {
  padding: 0;
  margin-bottom: 0;
}

#poderes .add-linha,
#poderes .arma-acoes-final {
  padding-top: 10px;
  display: flex;
  justify-content: flex-end;
}

#poderes .poder-linha {
  gap: 10px;
}

.subtabs-circulos {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bloco-circulos {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.subtab-circulo {
  flex: 1;
  height: 42px;
  border-radius: 12px;
  background: #5a4638;
  color: #f1e6cf;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}

.subtab-circulo.active {
  background: #c8a662;
  color: #1b1411;
  box-shadow: 0 0 10px rgba(255, 180, 100, 0.3);
}

.acoes-ficha-fixas {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: calc(100% - 36px);
  max-width: 420px;

  display: flex;
  gap: 8px;

  padding: 8px;
  border-radius: 18px;

  background: rgba(28, 16, 12, 0.94);
  border: 1px solid rgba(184, 150, 84, 0.18);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.btn-acao-ficha {
  flex: 1;
  height: 40px;
  padding: 0 12px;

  border-radius: 12px;
  border: 1px solid rgba(184, 150, 84, 0.22);

  background: linear-gradient(180deg, #2a1b14 0%, #1d120d 100%);
  color: #d8bf8b;

  font-family: "Cinzel", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;

  cursor: pointer;
  transition: 0.18s ease;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 2px 6px rgba(0, 0, 0, 0.18);
}

.btn-acao-ficha:hover {
  background: linear-gradient(180deg, #322016 0%, #21140e 100%);
  border-color: rgba(184, 150, 84, 0.32);
}

.btn-acao-ficha:active {
  transform: scale(0.98);
}

.aliado-local {
  font-size: 12px;
  color: #c8a662;
  margin-top: 4px;
  opacity: 0.85;
}

.aliado-local {
  margin: 4px 0 6px 0;
  font-size: 12px;
  color: #d4b06a;
  line-height: 1.3;
}

#listaAliados .item-preview {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.popup {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999999 !important;
}

.item-remover {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #7f1d1d;
  color: #f8f1df;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  font-size: 14px;
  padding: 0;
}

.item-acoes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.acoes-topo {
  display: flex;
  gap: 6px;
}

.btn-deletar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #7f1d1d;
  color: #f8f1df;
  font-size: 14px;
  cursor: pointer;

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

  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#preview {
  object-position: 50% 50%;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

#preview.arrastando {
  cursor: grabbing;
}

.editor-inline {
  margin-top: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(44, 34, 29, 0.95);
  border: 1px solid rgba(200, 169, 107, 0.25);
}

.editor-titulo {
  margin: 0 0 12px 0;
  text-align: center;
  font-family: "Cinzel", serif;
  color: #f3d9a2;
}

#previewEditor {
  position: absolute;

  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%);

  width: auto;
  height: auto;

  min-width: 100%;
  min-height: 100%;

  max-width: none;
  max-height: none;

  object-fit: unset;

  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;

  display: block;
}

#previewEditor.arrastando {
  cursor: grabbing;
}

.editor-moldura {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(241, 230, 207, 0.45);
  border-radius: 14px;
  pointer-events: none;
}

.editor-acoes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.editor-acoes .botao-upload {
  min-width: 110px;
}

.editor-inline {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.editor-inline.fechado {
  display: none;
}

.editor-container {
  background: #2c221d;
  padding: 16px;
  border-radius: 16px;
  text-align: center;
}


.item-topo-linha {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.item-qtd-badge {
  flex-shrink: 0;
  background: #7a624a;
  color: #f8f1df;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 999px;
}

.item-tag-sintonia {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(200, 169, 107, 0.18);
  color: #f3d9a2;
  vertical-align: middle;
}

.item-subtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.item-subtag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d9c3a2;
}

.item-subtag.ativo {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.item-preview {
  margin: 0;
  font-size: 13px;
  color: #cdb791;
  line-height: 1.4;
}

.popup-form input,
.popup-form textarea {
  font-size: 14px;
}

/* 🔥 caixas menores no popup */
.popup-form textarea {
  min-height: 60px;
  padding: 8px;
}

/* 🔥 campos pequenos tipo quantidade */
.popup-form input[type="number"] {
  height: 36px;
}

/* 🔥 caixas tipo "sintonia" mais compactas */
.popup-form .box-pequena {
  min-height: 40px !important;
  padding: 6px 8px;
  font-size: 13px;
}

.popup-descricao-pequena {
  min-height: auto;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.3;
}

.popup-descricao-grande {
  min-height: 110px;
}

@keyframes piscarLowHP {
}

body.low-hp #hpBar {
  border: 2px solid #ef4444;
  animation: piscarLowHP 0.8s infinite;
}

body.low-hp #hp-fill {
  background: #dc2626;
}

/* =========================================================
   AJUSTE SEGURO — LOW HP SOMENTE NA BARRA DE VIDA
   Remove qualquer efeito na borda/tela e mantém apenas o alerta no #hpBar.
   ========================================================= */
body.low-hp {
  animation: none !important;
  box-shadow: none !important;
}

body.low-hp::before,
body.low-hp::after {
  content: none !important;
  display: none !important;
  animation: none !important;
  background: none !important;
  box-shadow: none !important;
  opacity: 0 !important;
}

@keyframes piscarLowHP {
  0% {
    box-shadow: 0 0 0 rgba(185, 28, 28, 0);
    border-color: #2c221d;
  }

  50% {
    box-shadow:
      0 0 12px rgba(239, 68, 68, 0.9),
      0 0 22px rgba(185, 28, 28, 0.7);
    border-color: #ef4444;
  }

  100% {
    box-shadow: 0 0 0 rgba(185, 28, 28, 0);
    border-color: #2c221d;
  }
}

body.low-hp #hpBar {
  border: 2px solid #ef4444 !important;
  animation: piscarLowHP 0.8s infinite !important;
}

body.low-hp #hp-fill {
  background: #dc2626 !important;
}

/* ================= ATRIBUTOS NOVO LAYOUT AJUSTADO ================= */

.atributos-layout-novo {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
}

.atributos-compactos {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 124px;
  flex-shrink: 0;
}

.attr-compacto {
  width: 124px;
  min-height: 104px;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: 34px 18px 44px;
  grid-template-areas:
    "sigla save input"
    "final final mod";
  align-items: center;
  gap: 7px;
  border-radius: 16px;
  background: linear-gradient(180deg, #80684f 0%, #5f4b39 100%);
  border: 1px solid rgba(248, 241, 223, 0.08);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -10px 18px rgba(0, 0, 0, 0.12);
}

.attr-compacto .attr-sigla {
  grid-area: sigla;
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  text-align: center;
  color: #f8f1df;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
}

.attr-compacto .save-check {
  grid-area: save;
  width: 14px;
  height: 14px;
  margin: 0 auto;
}

.attr-compacto input {
  grid-area: input;
  width: 44px;
  height: 26px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  border-radius: 8px;
}

.attr-final {
  grid-area: final;
  justify-self: center;
  width: 56px;
  height: 44px;
  border-radius: 12px;
  background: rgba(31, 26, 23, 0.38);
  color: #f8f1df;
  font-size: 30px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22);
}

.attr-mod {
  grid-area: mod;
  justify-self: center;
  width: 48px;
  height: 34px;
  border-radius: 999px;
  font-size: 20px !important;
  font-weight: 900;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 26, 23, 0.38);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.attr-compacto .save-badge {
  bottom: -5px;
  right: -5px;
  left: auto;
  transform: none;
}

.pericias-scroll {
  max-height: 647px;
  overflow-y: auto;
  overflow-x: hidden;
}

.pericias-scroll::-webkit-scrollbar {
  width: 6px;
}

.pericias-scroll::-webkit-scrollbar-thumb {
  background: rgba(200, 169, 107, 0.35);
  border-radius: 999px;
}

@media (max-width: 420px) {
  .atributos-layout-novo {
    grid-template-columns: 124px minmax(0, 1fr);
    gap: 10px;
  }

  .atributos-compactos {
    width: 124px;
    gap: 5px;
  }

  .attr-compacto {
    width: 124px;
    min-height: 104px;
    padding: 10px 8px;
  }

  .attr-final {
    width: 56px;
    height: 44px;
    font-size: 30px;
  }

  .attr-mod {
    width: 48px;
    height: 34px;
    font-size: 20px !important;
  }

  .attr-compacto input {
    width: 44px;
    font-size: 13px;
  }

  .pericias-scroll {
    max-height: 647px;
  }
}

.input-personagem,
#racaSelect,
#nome,
#classe,
#idade,
#altura,
#antecedentes {
  height: 38px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
}

#racaSelect {
  width: 100%;
  height: 38px;
  padding: 6px 36px 6px 10px;
  border-radius: 10px;
  border: none;

  background: #4a3b31;
  color: #f1e6cf;

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

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: none; /* remove qualquer seta antiga */
}

/* 🔥 ESSA LINHA REMOVE A SETA DO EDGE/CHROME */
#racaSelect::-ms-expand {
  display: none;
}

#racaSelect {
  color: #cdb791; /* mais apagado */
}

/* quando o usuário muda, fica mais forte */
#racaSelect:focus,
#racaSelect:not([value="custom"]) {
  color: #f1e6cf;
}

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

  background: #4a3b31;
  color: #cdb791;
  font-family: inherit;

  padding: 6px 36px 6px 10px;
  border-radius: 10px;
  border: none;
}

/* seta dourada pra todos */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "▼";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;

  color: #c8a662;
  font-size: 12px;
}

/* ================= FIX SELECT PODERES ================= */

/* faz o wrapper ocupar tudo */
.select-wrapper {
  width: 100%;
}

/* select ocupa o wrapper inteiro */
.select-wrapper select {
  width: 100%;
  height: 40px;
}

/* linha com 2 campos lado a lado */
.poder-linha {
  display: flex;
  gap: 8px;
}

/* divide certinho 50/50 */
.poder-linha .select-wrapper,
.poder-linha input {
  flex: 1;
  width: 100%;
}

.editar-circulos-box {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 10px;
}

.editar-circulos-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #b89654;
  background: #2c221d;
  color: #d8b56a;
  font-size: 16px;
}

.raca-custom-acoes {
  display: flex;
  gap: 8px;
}

/* BOTÕES BASE */
.raca-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;

  transition: 0.2s;
}

/* EDITAR */
.raca-btn-editar {
  background: linear-gradient(180deg, #d4b06a, #b89654);
  color: #1b1411;
}

.raca-btn-editar:hover {
  background: #c8a662;
  transform: scale(1.05);
}

/* DELETAR */
.raca-btn-deletar {
  background: #7f1d1d;
  color: #f8f1df;
}

.raca-btn-deletar:hover {
  background: #991b1b;
  transform: scale(1.05);
}

.raca-custom-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, #3a2c24, #2c221d);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;

  border: 1px solid rgba(200, 169, 107, 0.15);
}

.linha-nivel-antecedente {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
}

#nivel {
  text-align: center;
}

#antecedentes {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  resize: none;
}

#nome-arquivo {
  display: none;
}

.personagem-topo {
  align-items: flex-start; /* evita desalinhamento estranho */
}

#preview {
  height: 220px; /* 🔥 aumenta a altura */
  max-width: 145px; /* mantém largura controlada */
}

.carga-bolinha {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #b89654;
  cursor: pointer;
}

.carga-bolinha.gasta {
  background: #b89654;
}

#boxPoderForm {
  overflow: visible !important;
}

#poderes {
  padding-bottom: 120px;
}

.add-linha {
  position: relative;
  z-index: 5;
}

.conteudo-toggle.fechado {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0;
  pointer-events: none !important;
  visibility: hidden;
}

.conteudo-toggle.fechado * {
  pointer-events: none !important;
}

#boxPoderForm.fechado {
  display: none !important;
}

.poder-card {
  max-width: 100%;
}

#listaPoderes,
#listaPoderesComuns,
[id^="listaMagiasCirculo"] {
  width: 100%;
}

/* 🔥 Deixar os cards de poderes/magias mais largos */
#poderes {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#poderes .secao-toggle,
#poderes .subaba-poderes,
#poderes .circulo-box {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

#listaPoderesComuns,
#listaMagiasCirculo0,
#listaMagiasCirculo1,
#listaMagiasCirculo2,
#listaMagiasCirculo3,
#listaMagiasCirculo4,
#listaMagiasCirculo5,
#listaMagiasCirculo6,
#listaMagiasCirculo7,
#listaMagiasCirculo8,
#listaMagiasCirculo9 {
  width: 100% !important;
}

#poderes .poder-card {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

