/* =========================
   VARIÁVEIS GLOBAIS E TEMAS
   ========================= */
:root {
  --bg: #000;
  --text: #fff;
  --muted: #cfcfcf;
  --line: rgba(255, 255, 255, 0.16);

  --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);

  --panel-bg: rgba(8, 8, 12, 0.42);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);

  --card-bg: linear-gradient(180deg, rgba(31, 31, 39, 0.95), rgba(16, 16, 22, 0.96));
  --card-bg-soft: linear-gradient(180deg, rgba(28, 28, 34, 0.95), rgba(18, 18, 24, 0.96));
  --card-border: rgba(255, 255, 255, 0.10);

  --modal-bg: rgba(18, 18, 24, 0.98);
  --modal-border: rgba(255, 255, 255, 0.10);
  --modal-overlay: rgba(0, 0, 0, 0.72);

  --field-bg: #0c0c0f;
  --field-border: #2e2e35;
  --field-border-focus: color-mix(in srgb, var(--primary) 60%, #ffffff 10%);

  --tag-bg: rgba(255, 255, 255, 0.06);
  --tag-border: rgba(255, 255, 255, 0.10);

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --transition-fast: 0.16s ease;
  --transition-med: 0.22s ease;
}

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,
textarea {
  font-family: inherit;
}

button,
input,
select,
textarea {
  outline: none;
}

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;
}

img {
  max-width: 100%;
  display: block;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* =========================
   BOTÕES
   ========================= */
.main-btn,
.secondary-btn,
.danger-btn,
.attack-btn,
.inventory-manual-btn,
.status-head-btn,
.extra-clear-btn,
.library-add-btn,
.library-toggle,
.attack-toggle,
.attack-remove-btn,
.attack-edit-btn,
.status-heal-btn,
.close-btn {
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast);
}

.main-btn,
.secondary-btn,
.danger-btn,
.attack-btn {
  background: rgba(255, 255, 255, 0.02);
  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;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.main-btn {
  border-color: color-mix(in srgb, var(--primary) 55%, rgba(255, 255, 255, 0.18));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset;
}

.secondary-btn {
  border-color: rgba(255, 255, 255, 0.14);
  color: #e6e6e6;
}

.attack-btn {
  min-width: 132px;
  min-height: 42px;
  font-size: 12px;
  font-weight: 700;
  border-color: color-mix(in srgb, var(--primary) 58%, rgba(255,255,255,0.14));
}

.main-btn:hover,
.secondary-btn:hover,
.attack-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent-soft) 20%, transparent);
}

.danger-btn {
  border: 1px solid #ff3b3b;
  color: #ffb0b0;
  background: rgba(255, 59, 59, 0.04);
}

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

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

/* =========================
   TOPO
   ========================= */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 24px;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.34);
  border-bottom: 1px solid var(--panel-border);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  color: color-mix(in srgb, var(--primary) 70%, #ffffff 24%);
}

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

.sheet-actions button,
#themeBtn {
  width: 110px;
  height: 38px;
  padding: 0 16px;
}

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

.theme-dropdown {
  position: relative;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  box-shadow: var(--panel-shadow);
  z-index: 60;
}

.theme-menu button {
  border: 1px solid transparent;
  background: rgba(255,255,255,0.03);
  color: #fff;
  min-height: 38px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.theme-menu button:hover {
  border-color: color-mix(in srgb, var(--primary) 60%, rgba(255,255,255,0.10));
  background: rgba(255,255,255,0.07);
}

/* =========================
   LINHA E PAINÉIS
   ========================= */
.sheet-topline {
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 45%, #ffffff 8%), transparent);
}

.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;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 16px 16px 18px;
  backdrop-filter: blur(8px);
  box-shadow: var(--panel-shadow);
}

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

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

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

.character-card {
  width: 340px;
  min-height: 430px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  background: var(--card-bg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(8px);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med);
}

.character-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 55%, rgba(255,255,255,0.14));
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03) inset,
    0 0 28px color-mix(in srgb, var(--primary) 12%, transparent),
    var(--panel-shadow);
}

.character-thumb {
  height: 260px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  background: #16161b center/cover no-repeat;
  margin-bottom: 14px;
  overflow: hidden;
}

.character-name {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
}

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

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

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

.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 rgba(255,255,255,0.14);
  border-radius: 14px;
  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 rgba(255,255,255,0.65);
  color: #fff;
  height: 26px;
  font-size: 13px;
  outline: none;
  padding: 0;
  width: 100%;
}

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

/* =========================
   DROPDOWNS CUSTOMIZADOS
   ========================= */
.nex-dropdown,
.custom-dropdown {
  position: relative;
  width: 100%;
}

.nex-selected,
.custom-selected {
  height: 26px;
  border-bottom: 1px solid rgba(255,255,255,0.65);
  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;
}

.nex-selected {
  justify-content: center;
  text-align: center;
  font-weight: 800;
  padding: 8px;
}

.nex-options,
.custom-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  z-index: 999;
  box-shadow: var(--panel-shadow);
}

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

.nex-options div:hover,
.custom-options div:hover {
  background: rgba(255,255,255,0.07);
}

.nex-options::-webkit-scrollbar,
.custom-options::-webkit-scrollbar,
.skill-modal-box::-webkit-scrollbar {
  width: 8px;
}

.nex-options::-webkit-scrollbar-track,
.custom-options::-webkit-scrollbar-track,
.skill-modal-box::-webkit-scrollbar-track {
  background: transparent;
}

.nex-options::-webkit-scrollbar-thumb,
.custom-options::-webkit-scrollbar-thumb,
.skill-modal-box::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent-soft) 55%, #2b2b2f);
  border-radius: 999px;
}

.nex-options::-webkit-scrollbar-thumb:hover,
.custom-options::-webkit-scrollbar-thumb:hover,
.skill-modal-box::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent-soft) 78%, #3a3a40);
}

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

.attributes-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  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%; left: 19.5%; }
.attr-int { top: 40%; left: 82%; }
.attr-pre { top: 77%; left: 29.5%; }
.attr-vig { top: 77%; 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
   ========================= */
.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 10px;
  margin-bottom: 10px;
}

.mini-box {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  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;
  min-width: 0;
}

.wide {
  min-width: 0;
}

/* =========================
   STATUS
   ========================= */
.status-block {
  margin-bottom: 8px;
}

.status-head {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.status-head-btn {
  height: 28px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: #d8d8d8;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.status-head-btn:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

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

.status-bar {
  height: 54px;
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
  position: relative;
  background: rgba(17,17,20,0.95);
  border-radius: 14px;
}

.status-fill {
  position: absolute;
  inset: 0 auto 0 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-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: 24px;
  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-values {
  position: relative;
  z-index: 1;
  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;
}

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

.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;
  border-radius: 999px;
}

.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-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.status-extra > span {
  font-size: 11px;
  font-weight: 800;
  color: #d8d8d8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

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

.status-extra-controls input {
  width: 70px;
  height: 30px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.extra-clear-btn {
  min-width: 74px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  color: #dcdcdc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

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

/* =========================
   DEFESA
   ========================= */
.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;
}

.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 rgba(255,255,255,0.65);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  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 rgba(255,255,255,0.65);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  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;
  padding: 0;
  width: 100%;
}

/* =========================
   COLUNA DO MEIO - PERÍCIAS
   ========================= */
.panel-title {
  text-align: center;
  font-size: 24px;
  margin: 4px 0 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.skills-head {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 64px 64px 64px 64px;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: #d0d0d0;
  font-weight: 700;
  margin-bottom: 6px;
  padding: 0 4px;
}

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

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

.skill-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 58px 58px 58px 58px;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  border-bottom: 1px solid #262626;
  min-height: 32.6px;
  padding: 4px 4px;
  border-radius: 8px;
}

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

.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,
.skill-select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.65);
  color: #fff;
  font-size: 12px;
  text-align: center;
  padding: 0;
}

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

.skill-click {
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.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;
}

.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;
}

/* =========================
   COLUNA DIREITA / ABAS
   ========================= */
.tabs-row {
  display: flex;
  gap: 15px;
  padding-top: 4px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  padding: 0 0 7px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.tab-btn.active {
  color: color-mix(in srgb, var(--primary) 70%, #ffffff 12%);
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 55%, rgba(255,255,255,0.12));
}

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

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

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

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

.right-panel-title {
  font-size: 12px;
  color: #d0d0d0;
}

.empty-state,
.inventory-empty-state {
  text-align: center;
  margin-top: 40px;
  font-size: 15px;
  font-weight: 800;
  color: #f0f0f0;
  padding: 30px 14px;
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

/* =========================
   FILTROS / TOPLINE
   ========================= */
.combat-topline {
  margin: 8px 0 14px;
}

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

.combat-topline input::placeholder {
  color: #9e9ea7;
}

/* =========================
   BASE DE CARDS
   ========================= */
.attacks-list,
.library-list,
.inventory-list {
  display: grid;
  gap: 12px;
}

.attack-card,
.library-card {
  background: var(--card-bg-soft);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  color: #fff;
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(8px);
}

.attack-card:hover,
.library-card:hover {
  border-color: color-mix(in srgb, var(--primary) 55%, rgba(255,255,255,0.12));
}

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

.attack-toggle,
.library-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;
  color: var(--accent-soft);
  font-size: 18px;
}



.attack-toggle-icon {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  transition: transform 0.22s ease;
  display: block;
  margin-right: 12px;
  border-right: 2px solid var(--accent-soft);
  border-bottom: 2px solid var(--accent-soft);
}

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

.attack-card-title,
.library-card-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

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

.attack-card-body,
.library-card-body {
  margin-top: 14px;
  padding-top: 14px;
  display: grid;
  gap: 8px;
  border-top: 1px solid color-mix(in srgb, var(--accent-soft) 45%, rgba(255,255,255,0.08));
}

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

.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-label {
  color: var(--accent-soft);
  font-weight: 800;
}

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

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

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

/* =========================
   LIBRARY / MODAL DE ADICIONAR
   ========================= */
.library-main-tab,
.library-subtab,
.library-tab-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  min-height: 34px;
  padding: 0 14px;
}

.library-main-tab:hover,
.library-subtab:hover,
.library-tab-btn:hover {
  background: rgba(255,255,255,0.07);
}

.library-main-tab.active,
.library-subtab.active,
.library-tab-btn.active {
  border-color: color-mix(in srgb, var(--primary) 60%, rgba(255,255,255,0.10));
  color: color-mix(in srgb, var(--primary) 72%, #ffffff 10%);
}

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

.library-subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.library-empty {
  padding: 22px 14px;
  text-align: center;
  border: 1px dashed rgba(255,255,255,0.10);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  color: #d6d6d6;
}

.library-add-btn {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.03);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent-soft) 70%, rgba(255,255,255,0.10));
  color: var(--accent-soft);
  margin-left: auto;
  flex: 0 0 auto;
}

.library-add-btn:hover {
  background: rgba(255,255,255,0.09);
}

.library-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 10px;
}

.library-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg);
  font-size: 11px;
  font-weight: 800;
  width: fit-content;
}

.inventory-library-card .library-card-head {
  min-height: 92px;
}

.inventory-library-card .library-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.inventory-library-card .library-card-body {
  padding-top: 4px;
}

.inventory-library-mini {
  font-size: 12px;
  font-weight: 700;
  color: #d6d6d6;
  margin-left: 8px;
}

.inventory-library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 6px;
  font-size: 13px;
  color: #d8d8d8;
}

.inventory-library-meta b {
  color: var(--primary);
  font-weight: 800;
}

.inventory-library-tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.inventory-library-tagline span {
  font-weight: 800;
}

.inventory-library-type {
  color: var(--primary);
  font-weight: 800;
}

.inventory-library-desc {
  margin-top: 10px;
  color: #ededed;
}

.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;
  color: var(--accent-soft);
}

/* =========================
   TAGS DE ELEMENTOS
   ========================= */
.tag-sangue {
  border-color: rgba(255, 77, 77, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 77, 0.04);
}

.tag-morte {
  border-color: rgba(189, 189, 189, 0.34);
}

.tag-conhecimento {
  border-color: rgba(230, 199, 140, 0.34);
}

.tag-energia {
  border-color: rgba(194, 107, 244, 0.34);
}

.tag-medo {
  border-color: rgba(68, 182, 234, 0.34);
}

.tag-varia {
  border-color: rgba(255,255,255,0.20);
}

/* =========================
   MODAIS
   ========================= */
.skill-modal {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

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

.skill-modal-box,
.ability-library-box {
  margin-top: 0;
  position: relative;
  width: min(720px, 92vw);
  max-height: 84vh;
  overflow-y: auto;
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: 18px;
  padding: 22px 28px 26px;
  color: #ffffff;
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(10px);
}

.skill-modal-box h2,
.ability-library-box h2 {
  margin: 0 0 22px;
  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: var(--accent-soft);
  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: color-mix(in srgb, var(--primary) 70%, #ffffff 10%);
}

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

#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;
}

.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;
}

/* =========================
   FORMULÁRIOS DOS MODAIS
   ========================= */
.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: 13px;
  font-weight: 800;
  color: #ededed;
}

.attack-field input,
.attack-field select,
.attack-field textarea,
.description-group textarea,
.inventory-inline-box {
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  color: #fff;
  outline: none;
}

.attack-field input,
.attack-field select,
.attack-field textarea {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.attack-field input:focus,
.attack-field select:focus,
.attack-field textarea:focus,
.description-group textarea:focus,
.inventory-inline-box:focus,
.status-extra-controls input:focus {
  border-color: var(--field-border-focus);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}

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

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

/* =========================
   HABILIDADES / INVENTÁRIO / RITUAIS
   ========================= */
#tab-rituais {
  padding-top: 10px;
}

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

.rituals-topbar,
.inventory-add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

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

#inventoryAddBtn,
.rituals-topbar .attack-btn,
.rituals-new-row .main-btn {
  min-width: 96px;
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 11px;
}

#inventoryAddBtn {
  width: 78px;
  min-width: 78px;
  padding: 0 6px;
  font-weight: 700;
}

.rituals-topbar .attack-btn,
.rituals-new-row .main-btn {
  border-color: color-mix(in srgb, var(--primary) 60%, rgba(255,255,255,0.12));
}

.rituals-new-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.rituals-dt-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
}

.rituals-dt-box span {
  font-size: 11px;
  font-weight: 800;
  color: #d6d6d6;
  letter-spacing: 0.4px;
}

.rituals-dt-box input {
  width: 56px;
  height: 30px;
  border-radius: 10px;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

/* =========================
   INVENTÁRIO
   ========================= */
.inventory-inline-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

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

.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;
  letter-spacing: 0.4px;
}

.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-radius: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  padding: 0 6px;
}

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

.box-small {
  width: 44px;
}

.box-patent {
  width: 180px;
}

.box-credit {
  width: 88px;
}

.box-tiny {
  width: 42px;
}

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

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

.inventory-inline-categories,
.inventory-load-boxes {
  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-bottom-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px 16px;
}

.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 color-mix(in srgb, var(--primary) 60%, rgba(255,255,255,0.10));
  background: rgba(255,255,255,0.03);
  color: #d0d0d0;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
}

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

/* =========================
   DESCRIÇÃO
   ========================= */
#tab-descricao {
  width: 100%;
}

.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;
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
  line-height: 1.35;
  font-family: inherit;
}

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

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

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

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

@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: 920px) {
  .attack-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .characters-grid {
    justify-content: center;
  }

  .character-card {
    width: 100%;
    max-width: 420px;
  }
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .sheet-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .inventory-actions-inline {
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .inventory-inline-row.inventory-new-row .inventory-inline-label {
    margin-left: 0;
  }

  .status-head {
    grid-template-columns: 56px 1fr 56px;
  }

  .status-zero {
    gap: 14px;
  }
}

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

  .sheet-left,
  .sheet-middle,
  .sheet-right {
    padding: 14px 12px 16px;
  }

  .attributes-wrap {
    width: 300px;
    height: 300px;
    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;
  }

  .attack-form-grid {
    grid-template-columns: 1fr;
  }

  .description-group textarea {
    min-height: 100px;
    font-size: 15px;
  }

  .character-thumb {
    height: 220px;
  }
}

/* =========================
   Busca dos modais de biblioteca
   ========================= */
.library-search-wrap {
  width: 100%;
  margin: 10px 0 18px;
}

.library-search-wrap input,
#abilityLibrarySearch,
#inventoryLibrarySearch,
#ritualLibrarySearch {
  width: 100%;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid color-mix(in srgb, var(--primary) 45%, rgba(255,255,255,0.10));
  border-radius: 14px;
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.library-search-wrap input::placeholder,
#abilityLibrarySearch::placeholder,
#inventoryLibrarySearch::placeholder,
#ritualLibrarySearch::placeholder {
  color: #9a9aa4;
  font-weight: 500;
}

.library-search-wrap input:focus,
#abilityLibrarySearch:focus,
#inventoryLibrarySearch:focus,
#ritualLibrarySearch:focus {
  border-color: color-mix(in srgb, var(--primary) 72%, #ffffff 8%);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
}

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

.library-toggle-icon,
.attack-toggle-icon {
  width: 10px;
  height: 10px;
  display: block;
  border-right: 2px solid var(--accent-soft);
  border-bottom: 2px solid var(--accent-soft);
  transform: rotate(45deg);
  transition: transform 0.22s ease;
}

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

.library-toggle-icon {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  transition: transform 0.22s ease;
  display: block;
  margin-right: 12px;
  border-right: 2px solid var(--accent-soft);
  border-bottom: 2px solid var(--accent-soft);
}

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


.mobile-menu-btn {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, rgba(255,255,255,0.16));
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.mobile-menu-btn.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.is-open span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 700px) {
  .topbar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 16px 14px;
  }

  .topbar-left {
    min-width: 0;
  }

  .mobile-menu-btn {
    display: inline-flex;
    justify-self: end;
  }

  .topbar-right {
    position: absolute;
    top: calc(100% + 10px);
    left: 14px;
    right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(10, 10, 14, 0.98);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
    z-index: 80;
  }

  .topbar-right.mobile-open {
    display: flex;
  }

  .sheet-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .sheet-actions button,
  #themeBtn {
    width: 100%;
  }

  .theme-dropdown {
    width: 100%;
  }

  .theme-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
}


.treino-dropdown .treino-selected {
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  padding-left: 10px;
  padding-bottom: -20px;
}

.treino-dropdown .treino-selected::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: cursor;
}

.status-heal-btn.is-blocked {
  border-color: #ff3b3b !important;
  color: #ff3b3b !important;
  background: rgba(255, 59, 59, 0.10) !important;
  box-shadow: 0 0 0 1px rgba(255, 59, 59, 0.14) inset;
}

.status-heal-btn.is-blocked:hover {
  background: rgba(255, 59, 59, 0.14) !important;
}

.status-heal-btn:disabled.is-blocked {
  opacity: 1 !important;
  cursor: not-allowed;
}

.treino-dropdown .treino-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: 10px;
  box-shadow: var(--panel-shadow);
  overflow: hidden;
  z-index: 50;
  display: none;

}

.treino-dropdown .treino-options div {
  padding: 8px 10px;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  
}

.treino-dropdown .treino-options div:hover {
  background: rgba(255,255,255,0.5);
}

.skill-row.trained-green .treino-selected {
  color: #00ff88 !important;
  border-color: #00ff88 !important;
}

.skill-row.trained-blue .treino-selected {
  color: #3aa8ff !important;
  border-color: #3aa8ff !important;
}

.skill-row.trained-yellow .treino-selected {
  color: #ffd54a !important;
  border-color: #ffd54a !important;
}


.skill-row.trained-green .treino-selected::after {
  border-right-color: #00ff88 !important;
  border-bottom-color: #00ff88 !important;
}

.skill-row.trained-blue .treino-selected::after {
  border-right-color: #3aa8ff !important;
  border-bottom-color: #3aa8ff !important;
}

.skill-row.trained-yellow .treino-selected::after {
  border-right-color: #ffd54a !important;
  border-bottom-color: #ffd54a !important;
}

.skill-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-input,
.treino-selected {
  height: 24px;
  min-height: 24px;
}