    /* ================================================================
   ARCANE CODEX — FICHA DE PERSONAGEM D&D
   Aesthetic: Grimório Arcano Vivo — escuridão com alma de ouro
   Versão 2.0 — Redesign Total
================================================================ */

    /* ── RESET ── */
    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

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

    /* Firefox */
    input[type=number] {
      -moz-appearance: textfield !important;
    }

    /* ── VARIÁVEIS ── */
    :root {
      /* --- TEMA: SELVA ARCANO (深森林) --- */

      /* Fundos (Deep Greens & Moss) */
      --void: #040806;
      /* Escuridão profunda da mata */
      --surface: #0a1812;
      /* Sombra das árvores */
      --raised: #142820;
      /* Musgo escuro */
      --high: #1a3528;
      /* Folhagem densa */
      --card: #0c1c14;
      /* Solo da selva */

      /* Esmelarda / Verde Vivo (O novo Ouro) */
      --accent: #2aaa5a;
      --accent-bright: #40ff90;
      --accent-pale: #b0ffc0;
      --accent-dim: rgba(42, 170, 90, .22);
      --accent-glow: rgba(42, 170, 90, .10);
      --accent-glow2: rgba(42, 170, 90, .20);
      --accent-glow3: rgba(42, 170, 90, .35);

      /* Ouro Natureza (Âmbar/Sol) */
      --gold: #d4af37;
      --gold-bright: #f1c40f;
      --gold-pale: #f9e79f;
      --gold-dim: rgba(212, 175, 55, .22);
      --gold-glow: rgba(212, 175, 55, .10);
      --gold-glow2: rgba(212, 175, 55, .25);
      --gold-glow3: rgba(212, 175, 55, .45);

      /* Crimson / Veneno (Poison Berry) */
      --crim: #c0263a;
      --crim-hi: #ff3040;
      --crim-glow: rgba(192, 38, 58, .25);

      /* Arcane / Mana (Blues) */
      --mana: #3080d0;
      --mana-hi: #7eb8f7;
      --mana-glow: rgba(48, 128, 208, 0.15);

      /* Texto (Off-whites & Forest Greys) */
      --t1: #e2f0e8;
      --t2: #94a89c;
      --t3: #4a5c52;

      /* Bordas */
      --b1: rgba(42, 170, 90, .10);
      --b2: rgba(42, 170, 90, .22);
      --b3: rgba(42, 170, 90, .45);

      /* Atributos (Adaptados) */
      --str: #c85020;
      /* Terra/Argila */
      --dex: #2aaa5a;
      /* Selva/Agilidade */
      --con: #70a030;
      /* Vitalidade/Raiz */
      --int: #3080d0;
      /* Rio/Mente */
      --wis: #d0a020;
      /* Sol/Espirito */
      --cha: #d03878;
      /* Flor/Exótico */

      /* Neon Blue (Spinners) */
      --neon-blue: #00d4ff;
      --neon-blue-bright: #70e4ff;
      --neon-blue-glow: rgba(0, 212, 255, 0.6);
      --neon-blue-glow2: rgba(0, 212, 255, 0.9);
    }

    /* ── BODY ── */
    body {
      background-color: var(--void);
      background-image:
        radial-gradient(ellipse 70% 50% at 50% -5%, var(--accent-glow2) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.022'/%3E%3C/svg%3E");
      font-family: 'Crimson Text', Georgia, serif;
      color: var(--t1);
      min-height: 100vh;
      padding: 0 !important;
    }

    /* ── SCROLLBAR ── */
    ::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: var(--b2);
      border-radius: 3px;
    }

    * {
      scrollbar-width: thin;
      scrollbar-color: var(--b2) transparent;
    }

    /* ── CONTAINER ── */
    .app-container {
      max-width: 1500px;
      margin: 0 auto;
      padding: 0 14px 60px;
    }

    /* ── HIDE OLD HEADER ── */
    .header {
      display: none !important;
    }

    /* ── SAVE INDICATOR ── */
    .save-indicator {
      position: fixed;
      top: 64px;
      right: 14px;
      background: var(--raised);
      border: 1px solid var(--b2);
      border-radius: 3px;
      color: var(--gold);
      font-family: 'Cinzel', serif;
      font-size: .62rem;
      letter-spacing: .1em;
      padding: 6px 14px;
      opacity: 0;
      transition: opacity .3s;
      z-index: 300;
      pointer-events: none;
    }

    .save-indicator.show {
      opacity: 1;
    }

    /* ================================================================
   TABS NAVIGATION
================================================================ */
    .tabs-container {
      margin-top: 0;
    }

    .tabs-header {
      display: flex;
      background: var(--surface);
      border-bottom: 1px solid var(--b2);
      position: relative;
      z-index: 100;
      padding: 0 14px;
      overflow-x: auto;
      scrollbar-width: none;
      gap: 0;
    }

    .tabs-header::-webkit-scrollbar {
      display: none;
    }

    .tab-btn {
      flex-shrink: 0;
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
      padding: 13px 22px;
      font-family: 'Cinzel', serif;
      font-size: .68rem;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--t2);
      cursor: pointer;
      transition: color .2s, border-color .2s;
      white-space: nowrap;
      position: relative;
    }

    .tab-btn::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 15%;
      right: 15%;
      height: 2px;
      background: var(--gold);
      transform: scaleX(0);
      transition: transform .25s;
    }

    .tab-btn:hover {
      color: var(--t1);
    }

    .tab-btn.active {
      color: var(--accent-bright);
    }

    .tab-btn.active::after {
      transform: scaleX(1);
      background: var(--accent);
    }

    .tab-content {
      display: none;
      animation: tabIn .22s ease;
    }

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

    @keyframes tabIn {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* ================================================================
   SECTION CARDS
================================================================ */
    .section {
      background: var(--surface);
      border: 1px solid var(--b1);
      border-radius: 5px;
      padding: 14px 16px;
      position: relative;
      margin-bottom: 10px;
    }

    /* corner ornaments */
    .section::before,
    .section::after {
      content: '';
      position: absolute;
      width: 14px;
      height: 14px;
      pointer-events: none;
    }

    .section::before {
      top: -1px;
      left: -1px;
      border-top: 1px solid var(--gold-dim);
      border-left: 1px solid var(--gold-dim);
      border-radius: 4px 0 0 0;
    }

    .section::after {
      bottom: -1px;
      right: -1px;
      border-bottom: 1px solid var(--gold-dim);
      border-right: 1px solid var(--gold-dim);
      border-radius: 0 0 4px 0;
    }

    .section-title {
      font-family: 'Cinzel', serif;
      font-size: .85rem;
      font-weight: 600;
      letter-spacing: .22em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 12px;
      padding-bottom: 7px;
      border-bottom: 1.5px solid var(--gold-dim);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .section-title::before {
      content: '◆';
      font-size: .45rem;
      color: var(--gold-dim);
      flex-shrink: 0;
    }

    /* ================================================================
   FORM ELEMENTS
================================================================ */
    .input-group {
      margin-bottom: 10px;
    }

    .input-label {
      display: block;
      font-family: 'Cinzel', serif;
      font-size: .58rem;
      letter-spacing: .14em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 4px;
    }

    input[type="text"],
    input[type="number"],
    textarea,
    select {
      width: 100%;
      background: var(--raised);
      border: 1px solid var(--b1);
      border-radius: 3px;
      padding: 7px 9px;
      color: var(--t1);
      font-family: 'Crimson Text', serif;
      font-size: .98rem;
      outline: none;
      transition: border-color .2s, box-shadow .2s;
      appearance: none;
      min-height: 34px;
    }

    input:focus,
    textarea:focus,
    select:focus {
      border-color: var(--gold-dim);
      box-shadow: 0 0 0 2px var(--gold-glow);
    }

    textarea {
      resize: vertical;
      min-height: 80px;
    }

    input::placeholder,
    textarea::placeholder {
      color: var(--t3);
    }

    /* ── BUTTONS ── */
    .btn {
      font-family: 'Cinzel', serif;
      font-size: .67rem;
      letter-spacing: .1em;
      text-transform: uppercase;
      padding: 9px 16px;
      border: 1px solid var(--b2);
      border-radius: 3px;
      cursor: pointer;
      transition: all .2s;
      background: var(--raised);
      color: var(--t2);
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .btn:hover {
      border-color: var(--gold-dim);
      color: var(--gold);
      background: var(--high);
    }

    .btn-primary {
      background: var(--accent-glow);
      border-color: var(--accent-dim);
      color: var(--accent-bright);
    }

    .btn-primary:hover {
      background: var(--accent-glow2);
    }

    .btn-secondary {
      border-color: var(--b1);
    }

    .btn-danger {
      border-color: rgba(146, 24, 40, .25);
      color: rgba(192, 38, 58, .6);
    }

    .btn-danger:hover {
      border-color: var(--crim);
      color: var(--crim-hi);
      background: var(--crim-glow);
    }

    .delete-btn {
      font-family: 'Cinzel', serif;
      font-size: .6rem;
      letter-spacing: .06em;
      padding: 4px 9px;
      background: transparent;
      border: 1px solid rgba(146, 24, 40, .18);
      color: rgba(192, 38, 58, .5);
      border-radius: 2px;
      cursor: pointer;
      transition: all .18s;
      min-height: 28px;
    }

    .delete-btn:hover {
      border-color: var(--crim);
      color: var(--crim-hi);
      background: var(--crim-glow);
    }

    /* ================================================================
   TAB 1 — PRINCIPAL
   Layout: header + 3 colunas
================================================================ */

    /* ── CHARACTER HEADER ── */
    .char-header {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 20px;
      align-items: start;
      padding: 18px 0 14px;
      border-bottom: 1px solid var(--b1);
      margin-bottom: 14px;
    }

    /* name mega-input */
    #nomePersonagem {
      font-family: 'Pirata One', cursive;
      font-size: 2.6rem;
      background: transparent;
      border: none;
      border-bottom: 1px solid var(--b1);
      color: var(--gold-pale);
      padding: 2px 0 4px;
      letter-spacing: .04em;
      text-shadow: 0 0 40px var(--gold-glow3);
      width: 100%;
      min-height: unset;
      height: auto;
      transition: border-color .2s;
      line-height: 1.1;
    }

    #nomePersonagem:focus {
      outline: none;
      border-bottom-color: var(--gold-dim);
      box-shadow: none;
    }

    #nomePersonagem::placeholder {
      color: var(--t3);
      font-size: 2rem;
    }

    .char-meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 10px;
    }

    .char-meta input {
      flex: 1;
      min-width: 100px;
      font-family: 'Cinzel', serif;
      font-size: .7rem;
      letter-spacing: .08em;
      padding: 5px 8px;
      color: var(--t2);
      background: transparent;
      border: none;
      border-bottom: 1px solid var(--b1);
      border-radius: 0;
      min-height: unset;
      height: 30px;
    }

    .char-meta input:focus {
      border-bottom-color: var(--gold-dim);
      box-shadow: none;
    }

    .char-meta input::placeholder {
      color: var(--t3);
    }

    .char-sub-meta {
      display: flex;
      gap: 8px;
      margin-top: 8px;
    }

    /* ── QUICK STATS PANEL (direita do header) ── */
    .char-quick-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
      margin: 10px 0 20px;
      width: 100%;
      align-items: stretch;
    }

    .quick-stat-row {
      display: flex;
      flex-direction: column-reverse;
      /* Valor/Ícone em cima, Label em baixo */
      align-items: center;
      justify-content: center;
      gap: 6px;
      background: var(--raised);
      border: 1px solid var(--b1);
      border-radius: 4px;
      padding: 12px 6px;
      min-height: 92px;
      transition: border-color .2s, background .2s;
      position: relative;
    }

    .quick-stat-row:hover {
      border-color: var(--b2);
      background: var(--high);
    }

    /* Ornamental Corners & Screws (4 points) */
    .quick-stat-row::before {
      content: '';
      position: absolute;
      inset: -1px;
      background:
        /* Screws (Parafusos) - 4 dots */
        radial-gradient(circle, var(--gold-bright) 1.5px, var(--gold) 2.5px, transparent 3px) 6px 6px / 6px 6px,
        radial-gradient(circle, var(--gold-bright) 1.5px, var(--gold) 2.5px, transparent 3px) calc(100% - 6px) 6px / 6px 6px,
        radial-gradient(circle, var(--gold-bright) 1.5px, var(--gold) 2.5px, transparent 3px) 6px calc(100% - 6px) / 6px 6px,
        radial-gradient(circle, var(--gold-bright) 1.5px, var(--gold) 2.5px, transparent 3px) calc(100% - 6px) calc(100% - 6px) / 6px 6px,

        /* Top corners (Symmetrical lines) */
        linear-gradient(to right, var(--gold) 14px, transparent 14px) 0 0 / 14px 2px,
        linear-gradient(to bottom, var(--gold) 14px, transparent 14px) 0 0 / 2px 14px,
        linear-gradient(to left, var(--gold) 14px, transparent 14px) 100% 0 / 14px 2px,
        linear-gradient(to bottom, var(--gold) 14px, transparent 14px) 100% 0 / 2px 14px,

        /* Bottom corners (Symmetrical lines) */
        linear-gradient(to right, var(--gold) 14px, transparent 14px) 0 100% / 14px 2px,
        linear-gradient(to top, var(--gold) 14px, transparent 14px) 0 100% / 2px 14px,
        linear-gradient(to left, var(--gold) 14px, transparent 14px) 100% 100% / 14px 2px,
        linear-gradient(to top, var(--gold) 14px, transparent 14px) 100% 100% / 2px 14px;
      background-repeat: no-repeat;
      pointer-events: none;
      z-index: 1;
    }

    .quick-stat-label {
      font-family: 'Cinzel', serif;
      font-size: .6rem;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--gold);
      text-align: center;
      line-height: 1.2;
    }

    .quick-stat-value,
    .qty-spinner {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0;
      background: var(--high);
      border: 1px solid var(--b2);
      border-radius: 4px;
      overflow: hidden;
      font-family: 'Cinzel', serif;
      font-size: 1.3rem;
      font-weight: 700;
      color: var(--gold);
      height: 34px;
      padding: 0;
      min-width: 44px;
      margin: 0 auto;
      /* Centraliza na caixa */
    }

    .attr-stepper {
      width: fit-content;
      transform: scale(0.9);
      /* Ligeiramente menor para caber na caixa de atributo */
      margin-top: 4px;
      margin-bottom: 2px;
    }

    /* proficiency number input */
    .bonus-value {
      font-family: 'Cinzel', serif;
      font-size: 1.3rem;
      font-weight: 700;
      color: var(--gold);
      width: 44px;
      height: 34px;
      text-align: center;
      background: transparent !important;
      border: none !important;
      padding: 0;
      line-height: 1 !important;
      -moz-appearance: textfield !important;
      clip-path: none;
    }

    .bonus-value::-webkit-outer-spin-button,
    .bonus-value::-webkit-inner-spin-button {
      -webkit-appearance: none !important;
      margin: 0;
    }

    /* Botões do Stepper Customizado */
    .qty-btn {
      background: var(--accent-glow);
      border: none;
      color: var(--neon-blue);
      text-shadow: 0 0 5px var(--neon-blue-glow);
      font-family: 'Cinzel', serif;
      font-size: 1.1rem;
      width: 28px;
      height: 34px;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      justify-content: center;
      user-select: none;
    }

    .qty-btn:hover {
      background: var(--accent-glow2);
      color: var(--neon-blue-bright);
      text-shadow: 0 0 12px var(--neon-blue-glow2);
    }

    .qty-btn:active {
      background: var(--accent-dim);
      color: var(--void);
    }

    /* checkbox estilizado */
    .check-icon {
      width: 32px;
      height: 32px;
      background: var(--accent-glow2);
      border: 1px solid var(--b2);
      border-radius: 4px;
      cursor: pointer;
      appearance: none;
      position: relative;
      transition: all .2s;
      flex-shrink: 0;
      clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    }

    .check-icon:checked {
      background: var(--accent-glow2);
      border-color: var(--accent);
      box-shadow: 0 0 10px var(--accent-glow);
    }

    .check-icon:checked::after {
      content: '✦';
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      color: var(--gold-bright);
      text-shadow: 0 0 8px var(--gold-glow3), 0 0 15px var(--gold-dim);
    }

    /* Legacy bonus box — overriding 3-components */
    .character-bonus-box {
      all: unset;
      display: contents;
    }

    .character-bonus-item {
      all: unset;
      display: contents;
    }

    .character-bonus-label {
      all: unset;
      display: none;
    }

    .character-bonus-check {
      all: unset;
    }

    /* ── MAIN 3-COLUMN GRID ── */
    .sheet-main-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 24px;
      align-items: start;
      max-width: 800px;
      margin: 0 auto;
    }

    /* ── COLUMN HEADER ── */
    .col-label {
      font-family: 'Cinzel', serif;
      font-size: .8rem;
      font-weight: 600;
      letter-spacing: .22em;
      text-transform: uppercase;
      color: var(--gold);
      margin-bottom: 10px;
      padding-bottom: 6px;
      border-bottom: 1.5px solid var(--gold-dim);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .col-label::before {
      content: '◆';
      font-size: .42rem;
      color: var(--gold-dim);
    }

    /* ================================================================
   ATTRIBUTE BOXES
================================================================ */
    .character-stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px;
    }

    /* ── ATTRIBUTE BOXES REVISITED ── */
    .character-attribute-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
      padding: 14px 8px;
      background: var(--raised);
      border: 2px solid var(--b2);
      border-radius: 8px;
      position: relative;
      transition: all 0.3s;
      min-height: 130px;
      overflow: visible;
      /* Para permitir que o destaque do botão saia um pouco da borda se necessário */
    }

    .character-attribute-box.is-proficient {
      background: var(--high) !important;
      /* Caixa de cor mais clara */
      border-color: var(--accent) !important;
      box-shadow: inset 0 0 15px var(--accent-glow);
    }

    .character-attribute-box:hover {
      border-color: var(--gold-dim);
      background: var(--high);
    }

    .character-attribute-label {
      font-family: 'Cinzel', serif;
      font-size: 0.82rem !important;
      letter-spacing: 0.15em !important;
      color: var(--gold) !important;
      text-transform: uppercase;
      margin-bottom: 6px;
      padding-bottom: 3px;
      border-bottom: 1.5px solid var(--gold-dim);
      z-index: 1;
    }

    .character-attribute-modifier {
      font-family: 'Cinzel', serif;
      font-size: 2.8rem !important;
      font-weight: 700;
      color: #ffffff !important;
      /* Branco forçado */
      line-height: 1;
      margin: 10px 0;
      transition: all 0.3s ease;
      z-index: 1;
    }

    .character-attribute-box.is-proficient .character-attribute-modifier {
      color: var(--accent-bright) !important;
      text-shadow: 0 0 15px var(--accent-dim);
    }


    .attr-stepper {
      margin-top: auto;
      transform: scale(0.85);
      z-index: 1;
    }

    .character-proficiency-check {
      position: absolute;
      top: 12px;
      right: 12px;
      appearance: none;
      width: 18px;
      height: 18px;
      background: var(--crim);
      border-radius: 50%;
      cursor: pointer;
      z-index: 2;
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      margin: 0 !important;
      border: 1px solid var(--b2);
      /* O HALO AGORA É UMA SOMBRA: Imprescindível para centralização perfeita */
      box-shadow: 0 0 0 3px var(--crim-glow);
    }

    .character-proficiency-check:checked {
      background: var(--accent);
      border-color: #ffffff;
      box-shadow: 0 0 0 4px var(--accent-glow3), 0 0 10px var(--accent-bright);
      transform: scale(1.1);
    }

    /* valor numérico editável */
    .character-attribute-input {
      width: 48px;
      font-size: 1.8rem;
      font-weight: 700;
      font-family: 'Cinzel', serif;
      text-align: center;
      background: transparent !important;
      border: none !important;
      color: var(--t1);
      padding: 0;
      outline: none;
      line-height: 1 !important;
      -moz-appearance: textfield !important;
    }

    .character-attribute-input::-webkit-outer-spin-button,
    .character-attribute-input::-webkit-inner-spin-button {
      -webkit-appearance: none !important;
      margin: 0;
    }

    .character-attribute-input:focus {
      color: var(--gold-pale);
      box-shadow: none;
    }

    /* modificador */
    .character-attribute-modifier {
      font-family: 'Cinzel', serif;
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--gold);
      line-height: 1;
      margin: 2px 0;
    }

    /* separador fino */
    .attr-divider {
      width: 60%;
      height: 1px;
      background: var(--b1);
      margin: 4px auto;
    }

    /* saving throw */
    .character-saving-throw {
      font-family: 'Crimson Text', serif;
      font-size: .8rem;
      color: var(--t3);
      display: inline-block;
      padding: 1px 8px;
      border: 1px solid var(--b1);
      border-radius: 20px;
      background: var(--surface);
      transition: color .2s, border-color .2s;
      line-height: 1.6;
    }

    .character-attribute-box.proficient .character-saving-throw {
      color: var(--gold);
      border-color: var(--gold-dim);
    }


    /* ================================================================
   SKILLS LIST
================================================================ */
    .character-skills-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 2px 14px;
    }

    .character-skill-item {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 3px 5px;
      border-radius: 3px;
      border: 1px solid transparent;
      transition: background .12s, border-color .12s;
    }

    .character-skill-item:hover {
      background: var(--raised);
      border-color: var(--b1);
    }

    .ddt-skill-prof-toggle {
      width: 18px;
      height: 18px;
      min-width: 18px;
      background: rgba(255, 255, 255, .03);
      border: 1.5px solid var(--b2);
      border-radius: 50%;
      cursor: pointer;
      position: relative;
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      margin-left: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0;
    }

    .ddt-skill-prof-toggle::after {
      content: '';
      width: 6px;
      height: 6px;
      background: transparent;
      border-radius: 50%;
      transition: all 0.25s;
    }

    /* Estado: Proficiente (Azul) */
    .ddt-skill-prof-toggle.is-proficient {
      background: #1a3d7a;
      border-color: #5a9ce0;
      box-shadow: 0 0 8px rgba(26, 61, 122, 0.5);
    }

    .ddt-skill-prof-toggle.is-proficient::after {
      background: #7eb8f7;
      box-shadow: 0 0 4px #7eb8f7;
    }

    /* Estado: Especialista (Dourado Brilhante) */
    .ddt-skill-prof-toggle.is-expert {
      background: var(--gold-bright);
      border-color: #ffffff;
      transform: scale(1.25);
      box-shadow: 0 0 15px var(--gold-glow3), 0 0 8px var(--gold-bright);
    }

    .ddt-skill-prof-toggle.is-expert::after {
      background: #fff;
      width: 8px;
      height: 8px;
      box-shadow: 0 0 6px #fff;
    }

    .character-skill-name {
      flex: 1;
      font-family: 'Crimson Text', serif;
      font-size: .92rem;
      color: var(--t1);
      /* White for normal */
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: color 0.3s;
    }

    /* Cores das perícias baseadas na proficiência */
    .character-skill-item.is-proficient .character-skill-name {
      color: var(--mana-hi);
      /* Azul vibrante */
      text-shadow: 0 0 8px var(--mana-glow);
    }

    .character-skill-item.is-expert .character-skill-name {
      color: var(--gold-bright);
      /* Dourado vibrante */
      text-shadow: 0 0 10px var(--gold-glow3);
    }

    .character-skill-value {
      font-family: 'Cinzel', serif;
      font-size: .82rem;
      font-weight: 700;
      color: var(--gold);
      min-width: 26px;
      text-align: right;
    }

    /* passive stats */
    #percepcaoPassiva,
    #intuicaoPassiva {
      background: var(--high);
      border: 1px solid var(--b2);
      color: var(--gold);
      font-weight: 700;
      text-align: center;
      font-family: 'Cinzel', serif;
      font-size: 1rem;
    }

    /* ================================================================
   COMBAT SHAPES  (mantém os SVGs existentes)
================================================================ */
    .character-combat-row {
      display: flex;
      justify-content: center;
      align-items: flex-end;
      gap: 12px;
      margin-bottom: 14px;
      flex-wrap: wrap;
    }

    .character-combat-stat {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 5px;
    }

    .character-combat-shape {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: text;
    }

    .character-combat-shape svg.shape-bg {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .7));
      transition: filter .2s;
    }

    .character-combat-shape:hover svg.shape-bg {
      filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .85)) drop-shadow(0 0 6px var(--accent-glow2));
    }

    .shape-inner {
      position: relative;
      z-index: 2;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    .character-combat-value,
    .hero-main-val {
      background: transparent !important;
      border: none !important;
      outline: none !important;
      text-align: center !important;
      font-family: 'Cinzel', serif !important;
      font-weight: 700 !important;
      color: #fff !important;
      text-shadow: 0 2px 6px rgba(0, 0, 0, .9) !important;
      padding: 0 !important;
      line-height: 1 !important;
      -moz-appearance: textfield !important;
    }

    .character-combat-value::-webkit-outer-spin-button,
    .character-combat-value::-webkit-inner-spin-button,
    .hero-main-val::-webkit-outer-spin-button,
    .hero-main-val::-webkit-inner-spin-button {
      -webkit-appearance: none;
    }

    .hero-sub-val {
      background: transparent !important;
      border: none !important;
      border-top: 1px solid rgba(255, 255, 255, .2) !important;
      outline: none !important;
      text-align: center !important;
      font-family: 'Crimson Text', serif !important;
      font-weight: 600 !important;
      color: rgba(255, 255, 255, .65) !important;
      text-shadow: 0 1px 4px rgba(0, 0, 0, .7) !important;
      padding: 2px 0 0 !important;
      margin-top: 2px !important;
      line-height: 1 !important;
      -moz-appearance: textfield !important;
    }

    .hero-sub-val::-webkit-outer-spin-button,
    .hero-sub-val::-webkit-inner-spin-button {
      -webkit-appearance: none;
    }

    .character-combat-label {
      font-family: 'Cinzel', serif;
      font-size: .52rem;
      font-weight: 600;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--gold);
      text-align: center;
    }

    .small-label {
      font-size: .46rem !important;
    }

    .shape-vida {
      width: 128px;
      height: 120px;
    }

    .shape-vida-max {
      width: 74px;
      height: 70px;
    }

    .shape-vida-temp {
      width: 74px;
      height: 70px;
    }

    .shape-ca {
      width: 102px;
      height: 116px;
    }

    .shape-init {
      width: 78px;
      height: 114px;
    }

    .small-val {
      font-size: 1.1em !important;
    }

    .main-heart {
      align-self: flex-end;
      order: 1;
    }

    .small-heart {
      align-self: center;
    }

    .character-combat-row .small-heart:first-child {
      order: 0;
    }

    .character-combat-row .small-heart:last-child {
      order: 2;
    }

    /* focus glow por widget */
    .shape-ca .character-combat-value:focus {
      text-shadow: 0 0 12px #90c8ff, 0 2px 4px rgba(0, 0, 0, .8) !important;
    }

    .shape-vida .character-combat-value:focus {
      text-shadow: 0 0 12px #ff9090, 0 2px 4px rgba(0, 0, 0, .8) !important;
    }

    .shape-vida-max .character-combat-value:focus {
      text-shadow: 0 0 10px #70b0f0, 0 2px 4px rgba(0, 0, 0, .8) !important;
    }

    .shape-vida-temp .character-combat-value:focus {
      text-shadow: 0 0 10px #f5d070, 0 2px 4px rgba(0, 0, 0, .8) !important;
    }

    .shape-init .character-combat-value:focus {
      text-shadow: 0 0 12px #ffe080, 0 2px 4px rgba(0, 0, 0, .8) !important;
    }

    /* ── DISPLACEMENT ── */
    .character-displacement-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
      gap: 6px;
      margin-bottom: 10px;
    }

    .character-displacement-grid .input-label {
      font-size: .52rem;
    }

    /* ── QUICK HP CONTROLS ── */
    .hp-quick-controls {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 12px;
      margin: 5px 0 20px;
      padding: 12px;
      background: var(--accent-glow);
      border-radius: 8px;
      border: 1px dashed var(--b1);
    }

    .hp-btn {
      padding: 9px 18px;
      font-family: 'Cinzel', serif;
      font-size: .68rem;
      font-weight: 600;
      letter-spacing: .1em;
      text-transform: uppercase;
      border: 1px solid transparent;
      border-radius: 4px;
      cursor: pointer;
      transition: all .25s;
      min-width: 85px;
    }

    .damage-btn {
      background: rgba(146, 24, 40, 0.15);
      color: #ff90a0;
      border-color: rgba(146, 24, 40, 0.25);
    }

    .damage-btn:hover {
      background: rgba(146, 24, 40, 0.35);
      color: #ff3040;
      border-color: var(--crim);
      box-shadow: 0 0 15px rgba(146, 24, 40, 0.2);
    }

    .heal-btn {
      background: rgba(42, 170, 90, 0.12);
      color: #b0ffc0;
      border-color: rgba(42, 170, 90, 0.2);
    }

    .heal-btn:hover {
      background: rgba(42, 170, 90, 0.25);
      color: #40ff90;
      border-color: #2aaa5a;
      box-shadow: 0 0 15px rgba(42, 170, 90, 0.2);
    }

    /* ── BADGE SYSTEM ── */
    .badge-container {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
      min-height: 4px;
    }

    .badge-item {
      background: var(--raised);
      border: 1px solid var(--b2);
      border-radius: 4px;
      padding: 4px 10px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: 'Crimson Text', serif;
      font-size: 0.82rem;
      color: var(--t1);
      animation: badgePop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes badgePop {
      from {
        transform: scale(0.6);
        opacity: 0;
      }

      to {
        transform: scale(1);
        opacity: 1;
      }
    }

    .badge-remove {
      background: transparent;
      border: none;
      color: rgba(192, 38, 58, 0.5);
      cursor: pointer;
      font-size: 1rem;
      line-height: 1;
      padding: 0;
      transition: color .2s;
    }

    .badge-remove:hover {
      color: var(--crim-hi);
    }

    .add-badge-group {
      display: flex;
      gap: 4px;
      margin-bottom: 14px;
    }

    .add-badge-group input {
      flex: 1;
      font-size: 0.75rem !important;
      height: 30px !important;
      min-height: 30px !important;
    }

    .add-badge-group .qty-btn {
      width: 30px;
      height: 30px;
      flex-shrink: 0;
    }

    /* ── BADGE SYSTEM ── */
    .badge-container {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
      min-height: 4px;
    }

    .badge-item {
      background: var(--raised);
      border: 1px solid var(--b2);
      border-radius: 4px;
      padding: 4px 10px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-family: 'Crimson Text', serif;
      font-size: 0.82rem;
      color: var(--t1);
      animation: badgePop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes badgePop {
      from {
        transform: scale(0.6);
        opacity: 0;
      }

      to {
        transform: scale(1);
        opacity: 1;
      }
    }

    .badge-remove {
      background: transparent;
      border: none;
      color: rgba(192, 38, 58, 0.5);
      cursor: pointer;
      font-size: 1rem;
      line-height: 1;
      padding: 0;
      transition: color .2s;
    }

    .badge-remove:hover {
      color: var(--crim-hi);
    }

    .badge-resistance {
      border-color: var(--gold-dim);
      background: rgba(48, 128, 208, 0.08);
      box-shadow: 0 0 6px rgba(48, 128, 208, 0.15);
    }

    .badge-vulnerability {
      border-color: var(--crim);
      background: rgba(146, 24, 40, 0.08);
      box-shadow: 0 0 6px rgba(146, 24, 40, 0.15);
    }

    .small-btn {
      min-width: 65px !important;
      padding: 6px 8px !important;
      height: 30px !important;
      font-size: 0.6rem !important;
    }

    .add-badge-group {
      display: flex;
      gap: 4px;
      margin-bottom: 14px;
    }

    .add-badge-group input {
      flex: 1;
      font-size: 0.75rem !important;
      height: 30px !important;
      min-height: 30px !important;
    }

    .add-badge-group .qty-btn {
      width: 30px;
      height: 30px;
      flex-shrink: 0;
    }

    /* ── SHEET GRID legado (tabs 2,3,4,5) ── */
    .sheet-grid {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 10px;
      margin-bottom: 10px;
    }

    .sheet-grid-details {
      display: grid;
      grid-template-columns: 1fr 2fr;
      gap: 10px;
    }

    .combat-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 8px;
      margin-bottom: 10px;
    }

    /* ── CHARACTER-INFO-GRID (escondido — substituído pelo char-header) ── */
    .character-info-grid {
      display: none !important;
    }

    /* ── SECOND INFO ROW (escondido, integrado ao char-header) ── */
    .second-info-row {
      display: none !important;
    }

    /* ================================================================
   ATTACK / INVENTORY ITEMS
================================================================ */
    .character-attack-list {
      margin-top: 8px;
    }

    .attack-item {
      display: grid;
      grid-template-columns: 2fr 1fr 1fr auto;
      gap: 6px;
      margin-bottom: 6px;
      align-items: center;
    }

    .character-currency-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 15px;
      margin: 20px 0;
    }

    .character-currency-grid .input-group {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      background: var(--raised);
      padding: 15px 10px;
      border-radius: 8px;
      border: 1px solid var(--b1);
      transition: all 0.2s;
    }

    .character-currency-grid .input-group:hover {
      border-color: var(--b2);
      background: var(--high);
      transform: translateY(-2px);
    }

    .character-currency-icon {
      width: 44px;
      height: 44px;
      clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      background: #000;
      flex-shrink: 0;
      margin: 0 !important;
      /* Reset margin for desktop vertical layout */
    }

    /* O preenchimento metálico */
    .character-currency-icon::before {
      content: '';
      position: absolute;
      top: 3px;
      left: 3px;
      right: 3px;
      bottom: 3px;
      background: inherit;
      clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
      z-index: 1;
      pointer-events: none;
    }

    /* O brilho por cima de tudo */
    .character-currency-icon::after {
      content: '';
      position: absolute;
      top: 3px;
      left: 3px;
      right: 3px;
      bottom: 3px;
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.45) 0%, transparent 50%, rgba(0, 0, 0, 0.15) 100%);
      z-index: 3;
      clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
      pointer-events: none;
    }

    /* A letra central */
    .character-currency-symbol {
      position: absolute;
      top: 52.5% !important;
      left: 52.5% !important;
      transform: translate(-50%, -50%) !important;
      font-family: Arial, sans-serif;
      font-size: 14px;
      font-weight: bold;
      color: rgba(0, 0, 0, 0.223);
      z-index: 2;
      line-height: 0;
      margin: 0;
      padding: 0;
      pointer-events: none;
      text-align: center;
    }

    .character-currency-grid .input-label {
      display: flex;
      flex-direction: column-reverse;
      align-items: center;
      gap: 10px;
      font-family: 'Cinzel', serif;
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--gold-pale);
      margin-bottom: 0;
      line-height: 1;
    }

    .character-currency-grid .qty-spinner {
      width: 130px;
      height: 34px;
    }

    .character-currency-grid input[type="number"] {
      width: 70px !important;
      padding: 0;
      text-align: center;
      font-weight: 700;
      font-family: 'Cinzel', serif;
      color: var(--gold-bright);
    }

    .character-currency-icon.cobre {
      background: #4a2508;
    }

    .character-currency-icon.cobre::before {
      background: linear-gradient(135deg, #b87333, #8b4513, #5d2e0a);
    }

    .character-currency-icon.prata {
      background: #333333;
    }

    .character-currency-icon.prata::before {
      background: linear-gradient(135deg, #e0e0e0, #a0a0a0, #707070);
    }

    .character-currency-icon.electrum {
      background: #1a3d28;
    }

    .character-currency-icon.electrum::before {
      background: linear-gradient(135deg, #a0f0c0, #2e8b57, #1a4d32);
    }

    .character-currency-icon.ouro {
      background: #5d4a00;
    }

    .character-currency-icon.ouro::before {
      background: linear-gradient(135deg, #ffd700, #daa520, #a07a00);
    }

    .character-currency-icon.platina {
      background: #2c4a5c;
      box-shadow: 0 0 10px rgba(100, 200, 255, 0.2);
    }

    .character-currency-icon.platina::before {
      background: linear-gradient(135deg, #ffffff 0%, #a5d8ff 40%, #c08cff 80%, #7dffff 100%);
    }

    .character-currency-icon.platina::after {
      background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, transparent 60%);
    }

    .character-inventory-list {
      margin-top: 8px;
    }

    .inventory-item {
      display: grid;
      grid-template-columns: 105px 1fr auto;
      gap: 10px;
      margin-bottom: 6px;
      align-items: center;
      padding: 7px 9px;
      background: var(--raised);
      border: 1px solid var(--b1);
      border-radius: 3px;
    }

    /* ================================================================
   MAGIC ITEMS
================================================================ */
    .character-magic-items-list {
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .magic-item {
      background: var(--raised);
      border: 1px solid var(--b1);
      border-radius: 3px;
      overflow: hidden;
    }

    .ddt-magic-item-header {
      display: grid;
      grid-template-columns: 1fr auto auto;
      gap: 15px;
      padding: 10px 14px;
      align-items: center;
      cursor: pointer;
      background: var(--high);
      transition: background .18s;
    }

    .ddt-magic-item-header:hover {
      background: rgba(255, 255, 255, .035);
    }

    .magic-item-header input[type="text"] {
      background: transparent;
      border: none;
      color: var(--t1);
      font-size: .9rem;
      padding: 0;
      outline: none;
      min-height: unset;
    }

    .magic-item-header input[type="text"]:focus {
      color: var(--gold-pale);
      box-shadow: none;
    }

    .ddt-magic-item-sync {
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
    }

    .ddt-magic-item-sync input[type="checkbox"] {
      appearance: none;
      width: 14px;
      height: 14px;
      border: 1.5px solid var(--b2);
      border-radius: 50%;
      background: var(--high);
      cursor: pointer;
      position: relative;
      transition: all 0.3s;
      margin: 0;
    }

    .ddt-magic-item-sync input[type="checkbox"]:checked {
      border-color: #00d4ff;
      background: #0077ff;
      box-shadow: 0 0 12px rgba(0, 170, 255, 0.6);
      animation: pulseBlue 2s infinite ease-in-out;
    }

    @keyframes pulseBlue {
      0% {
        box-shadow: 0 0 8px rgba(0, 170, 255, 0.4);
        border-color: #00d4ff;
      }

      50% {
        box-shadow: 0 0 18px rgba(0, 170, 255, 0.9);
        border-color: #70e4ff;
      }

      100% {
        box-shadow: 0 0 8px rgba(0, 170, 255, 0.4);
        border-color: #00d4ff;
      }
    }

    .ddt-magic-item-sync input[type="checkbox"]:checked::after {
      content: '';
      position: absolute;
      inset: 2.5px;
      background: #e0faff;
      border-radius: 50%;
      box-shadow: 0 0 10px #70e4ff;
    }

    .ddt-magic-item-expand {
      background: transparent;
      border: none;
      color: var(--gold-pale);
      font-size: 0.85rem;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.7;
    }

    .ddt-magic-item-expand:hover {
      opacity: 1;
      color: var(--gold);
      text-shadow: 0 0 8px var(--gold-dim);
    }

    .ddt-magic-item-expand.active {
      transform: rotate(180deg);
    }

    .ddt-magic-item-description {
      max-height: 0;
      overflow: hidden;
      transition: max-height .35s ease-out;
      background: rgba(0, 0, 0, .2);
    }

    .ddt-magic-item-description.active {
      max-height: 500px;
    }

    .ddt-magic-item-description-content {
      padding: 12px;
    }

    .ddt-magic-item-description textarea {
      background: var(--surface);
      border: 1px solid var(--b1);
      color: var(--t1);
      font-size: .92rem;
      padding: 10px;
      min-height: 90px;
      resize: vertical;
      line-height: 1.4;
    }

    .ddt-magic-item-actions {
      padding: 8px 12px;
      display: flex;
      justify-content: flex-end;
      background: rgba(0, 0, 0, 0.1);
    }

    .sync-label {
      font-size: .56rem;
      color: var(--t3);
      font-family: 'Cinzel', serif;
      letter-spacing: .06em;
    }

    /* ================================================================
   ABILITIES / INDIVIDUALS
================================================================ */
    .character-abilities-list,
    .character-individuals-list {
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 5px;
    }

    .individuals-unit {
      background: var(--raised);
      border: 1px solid var(--b1);
      border-radius: 3px;
      overflow: hidden;
    }

    .individuals-unit-header {
      display: grid;
      grid-template-columns: 1fr 1fr 34px;
      gap: 8px;
      padding: 8px 10px;
      cursor: pointer;
      background: var(--high);
      align-items: center;
      transition: background .18s;
    }

    .individuals-unit-header:hover {
      background: rgba(255, 255, 255, .025);
    }

    .individuals-unit-header input[type="text"] {
      background: transparent;
      border: none;
      color: var(--t1);
      font-size: .9rem;
      padding: 0;
      outline: none;
      min-height: unset;
    }

    .individuals-unit-header input[type="text"]:focus {
      color: var(--gold-pale);
      box-shadow: none;
    }

    .individuals-unit-expand {
      background: transparent;
      border: none;
      color: var(--t3);
      font-size: .9rem;
      cursor: pointer;
      transition: transform .2s;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
    }

    .individuals-unit-expand.active {
      transform: rotate(180deg);
    }

    .individuals-unit-description {
      max-height: 0;
      overflow: hidden;
      transition: max-height .3s ease;
    }

    .individuals-unit-description.active {
      max-height: 400px;
    }

    .individuals-unit-description-content {
      padding: 10px;
    }

    .individuals-unit-description textarea {
      background: var(--surface);
      border: 1px solid var(--b1);
      color: var(--t1);
      font-size: .9rem;
      padding: 7px;
      min-height: 80px;
      resize: vertical;
    }

    .individuals-unit-actions {
      padding: 6px 10px;
      display: flex;
      justify-content: flex-end;
      background: var(--surface);
    }

    .ability-uses {
      background: var(--high);
      border: 1px solid var(--b2);
      color: var(--gold);
      font-weight: 700;
      font-size: .9rem;
      padding: 4px 8px;
      width: 50px;
      text-align: center;
      margin-left: 8px;
      flex-shrink: 0;
    }

    /* ================================================================
   SPELL SYSTEM
================================================================ */
    .character-character-spell-level-section {
      background: var(--raised);
      border: 1px solid var(--b1);
      border-radius: 3px;
      overflow: hidden;
      margin-bottom: 5px;
    }

    .character-character-spell-level-header {
      padding: 9px 12px;
      background: var(--high);
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: background .18s;
    }

    .character-character-spell-level-header:hover {
      background: rgba(255, 255, 255, .025);
    }

    .character-character-spell-level-title {
      font-family: 'Cinzel', serif;
      font-size: .68rem;
      font-weight: 600;
      letter-spacing: .16em;
      text-transform: uppercase;
      color: var(--t2);
    }

    .character-character-spell-level-content {
      max-height: 0;
      overflow: hidden;
      transition: max-height .4s ease;
    }

    .character-character-spell-level-content.active {
      max-height: 2000px;
    }

    .character-character-spell-list {
      padding: 10px;
    }

    .character-character-spell-expand-btn {
      background: transparent;
      border: none;
      color: var(--t3);
      font-size: .9rem;
      cursor: pointer;
      transition: transform .2s;
    }

    .character-character-spell-expand-btn.active {
      transform: rotate(180deg);
    }

    .character-character-spell-slots-grid,
    .character-spell-slots-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      margin-top: 12px;
    }

    .character-spell-level-section {
      background: var(--raised);
      border: 1px solid var(--b1);
      border-radius: 3px;
      overflow: hidden;
    }

    .character-spell-level-header {
      padding: 8px 10px;
      background: var(--high);
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: background .18s;
    }

    .character-spell-level-header:hover {
      background: rgba(255, 255, 255, .025);
    }

    .character-spell-level-info {
      display: flex;
      flex-direction: column;
      gap: 4px;
      flex: 1;
    }

    .character-spell-level-title {
      font-family: 'Cinzel', serif;
      font-size: .66rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .12em;
      color: var(--t2);
    }

    .character-spell-slots {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .character-slot-current,
    .character-slot-max {
      width: 38px;
      text-align: center;
      padding: 3px;
      background: var(--surface);
      border: 1px solid var(--b1);
      color: var(--gold);
      font-weight: 700;
      font-size: .88rem;
      font-family: 'Cinzel', serif;
    }

    .character-slot-separator {
      color: var(--t3);
      font-size: 1rem;
    }

    .character-spell-expand-btn {
      background: transparent;
      border: none;
      color: var(--t3);
      font-size: .9rem;
      cursor: pointer;
      padding: 4px 8px;
      transition: transform .2s;
    }

    .character-spell-expand-btn.active {
      transform: rotate(180deg);
    }

    .character-spell-level-content {
      max-height: 0;
      overflow: hidden;
      transition: max-height .4s ease;
    }

    .character-spell-level-content.active {
      max-height: 2000px;
    }

    .character-spell-list {
      padding: 10px;
    }

    .spell-card {
      background: var(--surface);
      border: 1px solid var(--b1);
      border-radius: 3px;
      overflow: hidden;
      margin-bottom: 4px;
    }

    .spell-card-header {
      padding: 7px 9px;
      background: rgba(255, 255, 255, .02);
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: background .18s;
    }

    .spell-card-header:hover {
      background: rgba(255, 255, 255, .04);
    }

    .spell-card-header input[type="text"] {
      flex: 1;
      background: transparent;
      border: none;
      color: var(--t1);
      font-size: .88rem;
      padding: 0;
      outline: none;
      min-height: unset;
    }

    .spell-card-header input[type="text"]:focus {
      color: var(--gold-pale);
      box-shadow: none;
    }

    .spell-card-expand {
      background: transparent;
      border: none;
      color: var(--t3);
      font-size: .88rem;
      cursor: pointer;
      width: 22px;
      height: 22px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform .2s;
    }

    .spell-card-expand.active {
      transform: rotate(180deg);
    }

    .spell-card-details {
      max-height: 0;
      overflow: hidden;
      transition: max-height .3s ease;
    }

    .spell-card-details.active {
      max-height: 600px;
    }

    .spell-details-content {
      padding: 10px;
      display: grid;
      gap: 8px;
    }

    .spell-details-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .spell-components {
      display: flex;
      gap: 12px;
      align-items: center;
    }

    .component-check {
      display: flex;
      align-items: center;
      gap: 5px;
    }

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

    .component-check label {
      font-size: .85rem;
      color: var(--t2);
      cursor: pointer;
    }

    .concentration-check {
      display: flex;
      align-items: center;
      gap: 6px;
    }

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

    .concentration-check label {
      font-size: .9rem;
      color: var(--t2);
      cursor: pointer;
    }

    .spell-description {
      background: var(--high);
      border: 1px solid var(--b1);
      color: var(--t1);
      font-size: .88rem;
      padding: 7px;
      resize: vertical;
      min-height: 80px;
    }

    .spell-card-actions {
      padding: 6px 10px;
      display: flex;
      justify-content: flex-end;
      background: rgba(0, 0, 0, .2);
    }

    /* ================================================================
   IMAGE PREVIEW
================================================================ */
    .character-image-container {
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: center;
    }

    .image-preview {
      width: 250px;
      height: 320px;
      border: 1px solid var(--b2);
      background: var(--raised);
      position: relative;
      overflow: hidden;
      cursor: pointer;
      transition: border-color .2s;
      clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    }

    .image-preview:hover {
      border-color: var(--gold-dim);
    }

    .image-preview img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .image-placeholder {
      width: 100%;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      background: repeating-linear-gradient(45deg, transparent, transparent 10px, var(--accent-glow) 10px, var(--accent-glow) 20px);
    }

    .placeholder-icon {
      font-size: 2.8rem;
      opacity: .25;
    }

    .placeholder-text {
      font-family: 'Cinzel', serif;
      font-size: .62rem;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--t3);
      text-align: center;
    }

    .image-controls {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: center;
    }

    /* ================================================================
   MODAL
================================================================ */
    .modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, .88);
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 20px;
      overflow-y: auto;
    }

    .modal.active {
      display: flex;
    }

    .modal-content {
      background: var(--surface);
      border: 1px solid var(--b2);
      border-radius: 6px;
      padding: 24px;
      max-width: 460px;
      width: 100%;
      max-height: 80vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0, 0, 0, .85);
    }

    .modal-title {
      font-family: 'Cinzel', serif;
      font-size: 1.05rem;
      color: var(--gold-pale);
      margin-bottom: 16px;
      letter-spacing: .08em;
    }

    .character-item {
      padding: 10px;
      background: var(--raised);
      border: 1px solid var(--b1);
      border-radius: 3px;
      margin-bottom: 8px;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: border-color .18s;
    }

    .character-item:hover {
      border-color: var(--gold-dim);
    }

    .character-name {
      font-weight: 700;
      font-size: 1rem;
      color: var(--gold);
    }

    .character-details {
      font-size: .85rem;
      color: var(--t2);
      margin-top: 2px;
    }

    /* ================================================================
   DISPLAY / BONUS BOX (for backwards compat)
================================================================ */
    .display-value {
      padding: 7px 9px;
      background: var(--raised);
      color: var(--gold);
      font-weight: 700;
      border: 1px solid var(--b1);
      min-height: 34px;
      display: flex;
      align-items: center;
      font-size: 1rem;
      border-radius: 3px;
    }

    .bonus-value-display {
      font-size: 1.8rem;
      font-weight: 700;
      text-align: center;
      color: var(--gold);
    }

    /* ================================================================
   TAB CONTENT PADDING
================================================================ */
    .tab-content {
      padding: 14px 0;
    }

    /* ================================================================
   FOOTER
================================================================ */
    .footer {
      background: var(--surface);
      border-top: 1px solid var(--b1);
      padding: 24px 14px;
      text-align: center;
      margin-top: 20px;
    }

    .footer p {
      color: var(--t3);
      font-size: .85rem;
      margin-bottom: 10px;
      font-family: 'Crimson Text', serif;
    }

    .footer-links {
      display: flex;
      justify-content: center;
      gap: 24px;
      flex-wrap: wrap;
    }

    .footer-links a {
      color: var(--gold-dim);
      text-decoration: none;
      font-family: 'Cinzel', serif;
      font-size: .62rem;
      letter-spacing: .1em;
      text-transform: uppercase;
      transition: color .2s;
    }

    .footer-links a:hover {
      color: var(--gold);
    }

    /* ================================================================
   RESPONSIVE (MOBILE-FIRST)
================================================================ */

    /* ── AJUSTES GERAIS MOBILE (Telas menores que 1024px) ── */
    @media (max-width: 1024px) {
      .app-container {
        padding: 0 10px 80px;
      }

      .char-header {
        grid-template-columns: 1fr;
        gap: 15px;
      }

      .char-quick-stats {
        gap: 6px;
        margin: 10px 0;
      }

      .quick-stat-row {
        flex: 1;
        min-width: 0;
        /* Permite encolher além do conteúdo */
        padding: 10px 4px;
        min-height: 75px;
      }

      .quick-stat-label {
        font-size: .48rem;
        white-space: normal;
        /* Permite quebrar linha se estiver centralizado */
        text-align: center;
        width: 100%;
        line-height: 1.2;
        margin-top: 4px;
      }

      .sheet-grid,
      .sheet-grid-details {
        grid-template-columns: 1fr !important;
      }

      /* Ajuste de Magias */
      .character-character-spell-slots-grid,
      .character-spell-slots-grid {
        grid-template-columns: repeat(2, 1fr);
      }

      /* Ajuste de Itens/Ataques */
      .attack-item {
        grid-template-columns: 1fr 1fr;
      }

      .inventory-item {
        grid-template-columns: 60px 1fr auto;
      }

      .qty-btn {
        width: 20px;
        font-size: .9rem;
      }

      .bonus-value {
        width: 30px;
        font-size: 1.1rem;
      }

      .qty-spinner {
        min-width: 0;
      }

      .character-skills-grid {
        grid-template-columns: 1fr;
      }

      .tab-btn {
        padding: 10px 14px;
        font-size: .62rem;
      }

      /* Moedas Vertical no Mobile/Tablet */
      .character-currency-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
      }

      .character-currency-icon {
        width: 54px !important;
        height: 54px !important;
        margin-right: 15px !important;
      }

      .character-currency-icon::before,
      .character-currency-icon::after {
        top: 4px !important;
        left: 4px !important;
        right: 4px !important;
        bottom: 4px !important;
      }

      .character-currency-symbol {
        font-size: 16px !important;
      }

      .character-currency-grid .input-group {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: var(--raised);
        padding: 8px 16px;
        border-radius: 6px;
        border: 1px solid var(--b1);
        min-height: 70px;
      }

      .character-currency-grid .input-label {
        display: flex !important;
        flex-direction: row !important;
        /* Mantém horizontal no mobile/tablet */
        align-items: center !important;
        gap: 10px;
        margin: 0 !important;
        width: auto !important;
        font-family: 'Cinzel', serif;
        font-size: .85rem;
        color: var(--gold-pale);
        line-height: 1;
        flex-shrink: 0;
      }

      .character-currency-grid .character-currency-icon {
        width: 18px;
        height: 18px;
        margin: 0;
      }

      .character-currency-grid .qty-spinner {
        width: 110px;
        height: 30px;
        display: flex;
        align-items: center;
        margin: 0;
      }

      .character-currency-grid input[type="number"] {
        min-height: unset !important;
        height: 100% !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        text-align: center;
        font-family: 'Cinzel', serif;
        font-weight: 700;
        color: var(--gold-bright);
      }

      .character-currency-grid .qty-btn {
        height: 100%;
        width: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }

    /* ── AJUSTES PARA CELULARES (Telas menores que 600px) ── */
    @media (max-width: 600px) {
      .character-combat-row {
        gap: 8px;
        justify-content: space-evenly;
      }

      /* Reduzindo ícones de combate para caberem lado a lado */
      .shape-vida {
        width: 100px;
        height: 94px;
      }

      .shape-ca {
        width: 80px;
        height: 90px;
      }

      .shape-init {
        width: 66px;
        height: 98px;
      }

      /* Moedas Vertical no Celular */
      .character-currency-grid {
        grid-template-columns: 1fr !important;
        gap: 8px;
      }

      .character-currency-grid .input-group {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        background: var(--raised);
        padding: 5px 12px;
        border-radius: 4px;
        border: 1px solid var(--b1);
      }

      .character-currency-grid .input-label {
        display: flex !important;
        flex-direction: row !important;
        /* Mantém horizontal no celular */
        align-items: center !important;
        gap: 10px;
        margin: 0 !important;
        /* Remove o margin-bottom global que desalinhava no flex-row */
        font-family: 'Cinzel', serif;
        font-size: .85rem;
        color: var(--gold-pale);
        line-height: 1;
      }

      .character-currency-grid .character-currency-icon {
        width: 18px;
        height: 18px;
        margin: 0;
      }

      .character-currency-grid .qty-spinner {
        width: 110px;
        height: 32px;
        align-items: center;
      }

      .character-currency-grid input[type="number"] {
        min-height: unset !important;
        height: 100% !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        text-align: center;
        font-family: 'Cinzel', serif;
        font-weight: 700;
        color: var(--gold-bright);
      }

      .character-currency-grid .qty-btn {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }