/* css/core-hero-stats.css — modal de atributos, pets, perícias, herói/boneco de equipamento, cartão de detalhe do item (#idc).
 * v0.74: dividido de core.css SEM mudar a ordem das regras (a cascata depende dela). Ordem de carga: ver index.html. */
#stats-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    background: linear-gradient(165deg, rgba(22,18,14,0.98), rgba(10,10,12,0.98));
    border: 2px solid rgba(198,161,91,0.55);
    box-shadow: 0 16px 48px rgba(0,0,0,0.7);
    border-radius: 14px;
    color: var(--ink, #f0e6d0);
    padding: 18px;
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow-y: auto;
    font-family: var(--font-ui, system-ui, sans-serif);
    backdrop-filter: blur(6px);
  }
  #stats-modal.open { display: flex; }
  @media (max-width: 720px), (pointer: coarse) {
    #stats-modal {
      top: auto; bottom: 0; left: 0; right: 0;
      transform: none;
      width: 100%; max-width: none;
      max-height: min(72vh, 560px);
      border-radius: 16px 16px 0 0;
      border-bottom: none;
      padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
    }
    #stats-modal::before {
      content: '';
      position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
      width: 42px; height: 4px; border-radius: 2px;
      background: rgba(255,255,255,0.22);
    }
  }

  .stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(198,161,91,0.35);
    padding-bottom: 8px;
    margin-bottom: 15px;
  }
  .stats-header h2 {
    margin: 0; color: var(--accent, #c6a15b); font-size: 18px;
    font-family: var(--font-display, Cinzel, Georgia, serif);
  }
  .stats-close-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    color: #ffb0a0;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    min-width: 44px; min-height: 44px;
  }

  /* Pets / Criaturas */
  .pet-slots-section {
    background: #241d17;
    border: 1px solid #483925;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
  }
  .pet-slots-section h3 { margin: 0 0 10px 0; color: #7cf296; font-size: 15px; }
  .pet-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .pet-card {
    background: #15110d;
    border: 1px solid #3d301f;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
  }
  .pet-card.empty { color: #777; font-style: italic; }
  .pet-card.occupied { border-color: #55aa66; }
  .pet-card .pet-name { font-weight: bold; color: #e0e0e0; display: block; margin-bottom: 4px; }
  .btn-release {
    background: #8b2b2b;
    border: none;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    margin-top: 5px;
  }

  /* 4 Grupos de Habilidades */
  .skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
  }
  .skill-group {
    background: #241d17;
    border: 1px solid #483925;
    border-radius: 6px;
    padding: 10px;
  }
  .skill-group h4 {
    margin: 0 0 8px 0;
    color: #f7d28b;
    font-size: 14px;
    border-bottom: 1px solid #3e3220;
    padding-bottom: 4px;
  }
  .skill-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
  }
  .skill-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 2px;
  }
  .skill-bar {
    width: 100%;
    height: 6px;
    background: #110e0c;
    border-radius: 3px;
    overflow: hidden;
  }
  .skill-fill {
    height: 100%;
    background: linear-gradient(90deg, #996e36, #e3af5b);
    width: 0%;
  }

  /* Botão de Ação rápida para Domar */
  #tame-action-btn {
    display: none !important; /* acessível pelo Menu → Domar */
  }

  /* ---- Inventário unificado + Hero paper doll ---- */
  #hero-panel {
    display: none; position: fixed; inset: 0; z-index: 55;
    background: rgba(6,8,12,0.72);
    align-items: center; justify-content: center; padding: 12px;
  }
  #hero-panel.open { display: flex; }
  #hero-card {
    width: min(420px, 96vw); max-height: min(86vh, 700px); overflow-y: auto;
    background: linear-gradient(180deg, #16141c 0%, #0e1016 100%);
    border: 1px solid rgba(198,161,91,0.4); border-radius: 14px;
    padding: 14px 16px 18px; color: #e8e4dc;
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  }
  #hero-card .hero-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
  #hero-card .hero-head h3 { margin:0; color:#e8d5a8; letter-spacing:0.08em; font-size:15px; }
  #hero-card .hero-close {
    background:rgba(0,0,0,0.35); border:1px solid rgba(255,255,255,0.15);
    color:#ccc; width:36px; height:36px; border-radius:10px; font-size:18px; cursor:pointer;
  }
  .doll-grid { display:grid; grid-template-columns:72px 1fr 72px; gap:8px; align-items:center; margin:8px 0 14px; }
  .doll-col { display:flex; flex-direction:column; gap:6px; }
  .doll-center { display:flex; flex-direction:column; align-items:center; gap:8px; }
  .doll-figure {
    width:110px; height:150px;
    background: radial-gradient(circle at 50% 30%, #2a3240 0%, #141820 70%);
    border:1px solid rgba(198,161,91,0.25); border-radius:12px;
    display:flex; align-items:center; justify-content:center; font-size:64px;
  }
  .doll-slot {
    width:72px; min-height:58px; background:rgba(12,14,18,0.95);
    border:1px solid rgba(198,161,91,0.32); border-radius:8px;
    padding:4px 2px; text-align:center; font-size:10px; color:#8a93a0; cursor:pointer;
  }
  .doll-slot .ds-ico { font-size:18px; display:block; }
  .doll-slot .ds-name { color:#e8d5a8; font-weight:700; font-size:9px; }
  .doll-slot.empty { opacity:0.55; }
  .doll-slot.filled { border-color:#c6a15b; background:rgba(40,32,18,0.5); }
  .hero-stats { display:grid; grid-template-columns:1fr 1fr; gap:6px; font-size:12px; }
  .hero-stats div {
    background:rgba(0,0,0,0.35); border-radius:8px; padding:8px 10px;
    border:1px solid rgba(255,255,255,0.06);
  }
  .hero-stats b { color:#ffe8a0; }
  .inv-compare { font-size:11px; color:#7cf296; margin-top:2px; }
  .inv-compare.worse { color:#ff8a7a; }
  .inv-tabs {
    display:flex; gap:2px; margin-bottom:4px; padding:2px;
    background:rgba(0,0,0,0.28); border:1px solid rgba(255,255,255,0.06); border-radius:8px;
  }
  .inv-tab {
    flex:1; padding:4px 2px; border-radius:6px; cursor:pointer;
    background:transparent; border:1px solid transparent;
    color:#7a8490; font-size:10px; font-weight:700; text-align:center;
    user-select:none;
  }
  .inv-tab:active { transform: scale(0.96); }
  .inv-tab.active {
    border-color:rgba(198,161,91,0.45); color:#1a1208;
    background:linear-gradient(160deg,#e3c17e,#c6a15b);
  }
  .inv-equip-slot.filled { border-color:#c6a15b; }

  /* ---- Drag & drop ---- */
  .inv-item-card { touch-action: none; transition: opacity 0.1s ease, transform 0.1s ease; }
  .inv-item-card.dragging { opacity: 0.35; }
  .inv-quick-row { display:flex; gap:4px; margin:0 0 4px; align-items:stretch; }
  .inv-player-target {
    flex:0 0 40px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0;
    background:rgba(198,161,91,0.08); border:1px dashed rgba(198,161,91,0.4); border-radius:7px;
    font-size:8px; color:#c6a15b; padding:2px; transition: background 0.12s ease, border-color 0.12s ease;
  }
  .inv-player-target .ipt-ico { font-size:16px; line-height:1; }
  .inv-player-target .ipt-label { font-size:8px; }
  .inv-player-target.drop-active {
    background:rgba(198,161,91,0.28); border-color:#ffe8a0; border-style:solid;
  }
  .inv-pets-strip {
    flex:1; display:flex; gap:4px; overflow-x:auto; padding:1px;
    -webkit-overflow-scrolling:touch;
  }
  .inv-pets-strip .inv-pets-empty { font-size:9px; color:#6a7380; align-self:center; padding:0 2px; }
  .inv-pet-avatar {
    flex:0 0 auto; width:36px; display:flex; flex-direction:column; align-items:center; justify-content:center;
    background:rgba(12,14,18,0.9); border:1px solid rgba(255,255,255,0.1); border-radius:6px;
    padding:2px; font-size:8px; color:#9aa4af;
  }
  .inv-pet-avatar .ipa-ico { font-size:14px; }
  .inv-pet-avatar .ipa-name { display:none; }
  .inv-pet-avatar .ipa-hunger { width:100%; height:2px; border-radius:1px; background:rgba(255,255,255,0.12); overflow:hidden; }
  .inv-pet-avatar .ipa-hunger i { display:block; height:100%; background:linear-gradient(90deg,#e0523f,#7cf296); }
  .inv-pet-avatar.drop-active {
    background:rgba(198,161,91,0.28); border-color:#ffe8a0;
  }
  .inv-equip-slot { transition: background 0.12s ease, border-color 0.12s ease; }
  .inv-equip-slot.drop-active { background:rgba(198,161,91,0.28); border-color:#ffe8a0; }
  .inv-equip-slot.drop-invalid { border-color:#e05a4a; }
  #inv-drop-trash {
    display:flex; align-items:center; justify-content:center; gap:4px; margin-top:3px; padding:4px;
    border:1px dashed rgba(255,255,255,0.14); border-radius:7px;
    font-size:9px; color:#6a7380; line-height:1.2;
  }
  #inv-drop-trash .idt-ico { font-size:14px; flex:0 0 auto; }
  #inv-drop-trash-text { display:none; }
  #inv-drop-trash.drop-active {
    background:rgba(224,90,74,0.16); border-color:#ff8a7a; color:#ffb3a6; border-style:solid;
  }
  @media (min-width: 721px) {
    #inv-drop-trash-text { display:inline; }
    #inv-drop-trash { justify-content:flex-start; padding:6px 8px; }
  }
  .inv-drag-ghost {
    position:fixed; z-index:9999; pointer-events:none; left:0; top:0;
    display:flex; align-items:center; gap:8px; padding:8px 10px;
    background:rgba(20,18,14,0.96); border:1.5px solid #c6a15b; border-radius:10px;
    box-shadow:0 8px 24px rgba(0,0,0,0.5); color:#e8d5a8; font-size:12px; font-weight:700;
    transform: translate(-50%, -50%) scale(1.06);
  }
  .inv-drag-ghost .idg-ico { font-size:20px; }

  /* ---- Ficha do item (bottom sheet, jeito RPG mobile) ---- */
  #inv-detail-overlay {
    display: none; position: fixed; inset: 0; z-index: 45;
    background: rgba(0,0,0,0.55);
    align-items: flex-end; justify-content: center;
  }
  #inv-detail-overlay.show { display: flex; }
  #inv-detail-card {
    width: min(430px, 96vw);
    background: linear-gradient(180deg,#1b1720,#141119);
    border: 1.5px solid rgba(198,161,91,0.4);
    border-radius: 18px 18px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 30px rgba(0,0,0,0.55);
    animation: idc-up 0.18s ease;
  }
  @keyframes idc-up { from { transform: translateY(16px); opacity:0.4; } to { transform: translateY(0); opacity:1; } }
  #idc-head { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
  #idc-icon {
    width:56px; height:56px; border-radius:12px; flex-shrink:0;
    background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.08), transparent 65%), #0e0c10;
    border: 1.5px solid rgba(198,161,91,0.4);
    display:flex; align-items:center; justify-content:center; font-size:30px;
  }
  #idc-name { font-weight:800; color:#e8d5a8; font-size:16px; line-height:1.25; }
  #idc-sub { font-size:11px; color:#9aa4af; margin-top:2px; }
  #idc-close {
    background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.14); color:#c8c0b0;
    font-size:16px; line-height:1; width:30px; height:30px; border-radius:50%; cursor:pointer; flex-shrink:0;
  }
  #idc-desc { font-size:12.5px; color:#c8c0b0; line-height:1.45; margin-bottom:10px; }
  #idc-compare {
    display: none; margin-bottom: 12px; padding: 10px 12px;
    background: rgba(0,0,0,0.28); border: 1px solid rgba(198,161,91,0.28);
    border-radius: 10px; font-size: 12px; line-height: 1.45;
  }
  #idc-compare .cmp-title {
    font-family: var(--font-display, Cinzel, Georgia, serif);
    color: var(--accent, #c6a15b); font-size: 11px; letter-spacing: 0.06em;
    margin-bottom: 6px; text-transform: uppercase;
  }
  #idc-compare .cmp-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
  #idc-compare .cmp-up { color: #6ee7c8; font-weight: 700; }
  #idc-compare .cmp-down { color: #ff8a7a; font-weight: 700; }
  #idc-compare .cmp-same { color: #9aa4af; }
  #idc-pets { display:none; gap:6px; overflow-x:auto; margin-bottom:12px; padding-bottom:2px; }
  #idc-actions { display:flex; gap:8px; flex-wrap:wrap; }
  .idc-btn {
    flex:1; min-width:100px; padding:11px 10px; border-radius:10px; text-align:center;
    font-size:13px; font-weight:700; cursor:pointer; border:1.5px solid transparent;
    background: rgba(255,255,255,0.06); color:#e8d5a8;
    min-height: 44px;
  }
  .idc-btn:active { transform: scale(0.96); }
  .idc-btn.primary { background: linear-gradient(160deg,#e3c17e,#c6a15b); color:#1a1208; border-color:#c6a15b; }
  .idc-btn.danger { background: rgba(224,90,74,0.14); color:#ff9a8a; border-color:rgba(224,90,74,0.4); }
  /* combinar itens (v0.40) */
  #inv-combine-bar {
    align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0;
    padding: 7px 10px; border-radius: 10px; font: 600 12px/1.25 system-ui, sans-serif;
    background: rgba(198,161,91,0.18); border: 1px solid rgba(198,161,91,0.55); color: #f3e3bd;
  }
  #inv-combine-bar button {
    background: transparent; border: 0; color: #f3e3bd; font-size: 16px; padding: 2px 6px; cursor: pointer;
  }
  .inv-item-card.combine-a { outline: 2px solid #e3c17e; box-shadow: 0 0 10px rgba(227,193,126,0.6); }
  .inv-item-card.combine-ok { outline: 2px solid #7cf296; box-shadow: 0 0 10px rgba(124,242,150,0.55); }
  .inv-item-card.combine-dim { opacity: 0.35; }
  .idc-btn.disabled { opacity:0.4; pointer-events:none; }

