/* ============================================================
   LAYOUT DA PÁGINA (cabeçalho + sidebar de perfil) — nunca tinha
   sido estilizado; só o conteúdo novo (hb-*) tinha CSS até agora.
   ============================================================ */

.hab-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ── Cabeçalho ──────────────────────────────────────────────── */
.hab-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.hab-header-left { display: flex; align-items: center; gap: 14px; }
.hab-header-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: linear-gradient(135deg, #F4F2ED, #EDE9DE);
  border: 1px solid #D8D2C7;
  color: var(--ember);
  flex-shrink: 0;
}
.hab-titulo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: #20232A;
  margin: 0 0 2px;
  letter-spacing: .5px;
}
.hab-subtitulo { font-size: .85rem; color: #74777F; margin: 0; }

.hab-header-right { display: flex; gap: 10px; flex-wrap: wrap; }
.hab-info-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 700;
  color: #20232A;
  background: #F4F2ED;
  border: 1px solid #D9D5CC;
  border-radius: 999px;
  padding: 7px 14px;
}
.hab-info-pill span:first-child { font-size: .9rem; }
#habRyo { color: var(--gold); }

/* ── Layout: sidebar de perfil | conteúdo ──────────────────── */
.hab-layout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.hab-col-perfil { flex: 0 0 220px; }
.hab-col-main { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .hab-layout { flex-direction: column; }
  .hab-col-perfil { flex: 1 1 auto; width: 100%; }
}

/* ── Card de perfil ─────────────────────────────────────────── */
.hab-perfil-card {
  background: linear-gradient(180deg, #F4F2ED, #FFFFFF);
  border: 1px solid #D8D2C7;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  position: sticky;
  top: 78px;
  box-shadow: 0 5px 18px rgba(91,62,10,.13);}

.hab-avatar-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #EDE9DE, #F4F2ED 75%);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hab-avatar-foto { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hab-avatar-emoji { font-size: 3rem; }
.hab-avatar-moldura { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }

.hab-perfil-nome { font-family: var(--font-body); font-weight: 700; font-size: 1rem; color: #20232A; }
.hab-perfil-grad { font-size: .76rem; color: var(--chakra); font-weight: 600; margin: 2px 0; }
.hab-perfil-nivel {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  color: #74777F;
  background: #F4F2ED;
  border: 1px solid #D9D5CC;
  border-radius: 999px;
  padding: 3px 12px;
  margin: 6px 0 14px;
}

.hab-perfil-bars { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.hab-bar-row { display: flex; flex-direction: column; gap: 4px; }
.hab-bar-label { font-size: .68rem; font-weight: 700; color: #74777F; }
.hab-bar-bg {
  height: 8px;
  border-radius: 5px;
  background: #F4F2ED;
  border: 1px solid #D9D5CC;
  overflow: hidden;
}
.hab-bar-fill { height: 100%; border-radius: 5px; transition: width .3s ease; }
.hab-bar-hp { background: linear-gradient(90deg, #c0392b, #ff6b6b); }
.hab-bar-ck { background: linear-gradient(90deg, var(--chakra-dim), var(--chakra)); }
.hab-bar-val { font-family: var(--font-mono); font-size: .68rem; color: #92949A; align-self: flex-end; }


/* ── ABAS PRINCIPAIS ────────────────────────────────────────── */
.hb-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.hb-tab {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .84rem;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #D9D5CC;
  background: #F4F2ED;
  color: #74777F;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.hb-tab:hover { color: #20232A; border-color: #D8D2C7; }
.hb-tab.active { background: var(--ember); border-color: var(--ember); color: #fff; }

/* ── GRID DE CATEGORIAS ─────────────────────────────────────── */
.hb-cat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.hb-cat-card {
  flex: 1 1 150px;
  max-width: 170px;
  background: #F4F2ED;
  border: 1px solid #D8D2C7;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
  box-shadow: 0 5px 18px rgba(91,62,10,.13);}
.hb-cat-card:hover { border-color: #D8D2C7; transform: translateY(-2px); }
.hb-cat-card.active { background: #FAF9F6; }

.hb-cat-img-wrap {
  width: 64px; height: 64px;
  margin: 0 auto 8px;
  border-radius: 10px;
  overflow: hidden;
  background: #F4F2ED;
  border: 1px solid #D9D5CC;
}
.hb-cat-img { width: 100%; height: 100%; object-fit: cover; }
.hb-cat-img-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
}
.hb-cat-nome { font-family: var(--font-body); font-weight: 700; font-size: .8rem; color: #20232A; margin-bottom: 2px; }
.hb-cat-count { font-size: .66rem; color: #92949A; }

/* ── PAINEL EXPANDIDO DA CATEGORIA ──────────────────────────── */
.hb-painel {
  background: linear-gradient(180deg, #F4F2ED, #FFFFFF);
  border: 1px solid #D9D5CC;
  border-left: 3px solid var(--ember);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.hb-painel-header { margin-bottom: 14px; }
.hb-painel-titulo { font-family: var(--font-display); font-size: 1.2rem; font-weight: 400; margin-bottom: 3px; }
.hb-painel-desc { font-size: .78rem; color: #74777F; }

/* ── SUB-ABAS DE VARIANTE (Minato/Tobirama, Hashirama/Jiraiya/...) ── */
.hb-variant-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hb-variant-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .76rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #D9D5CC;
  background: #F4F2ED;
  color: #74777F;
}
.hb-variant-tab img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.hb-variant-tab:hover { color: #20232A; }
.hb-variant-tab.active { border-color: var(--chakra); color: var(--chakra); background: rgba(79,209,255,.08); }

/* ── GRID DE SUB-HABILIDADES (cards individuais) ────────────── */
.hb-sub-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.hb-sub-card {
  flex: 1 1 140px;
  max-width: 160px;
  background: #F4F2ED;
  border: 1px solid #D9D5CC;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease;
}
.hb-sub-card:hover { border-color: #D8D2C7; }
.hb-sub-card.aprendida { border-color: #35d48855; }

.hb-sub-img-wrap { position: relative; width: 100%; aspect-ratio: 1/1; background: #EDE9DE; }
.hb-sub-img { width: 100%; height: 100%; object-fit: cover; }
.hb-sub-img-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.hb-sub-rank-badge {
  position: absolute; top: 5px; left: 5px;
  font-family: var(--font-mono);
  font-size: .6rem; font-weight: 700;
  color: #20232A;
  background: var(--chakra);
  padding: 1px 6px;
  border-radius: 5px;
}

.hb-sub-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hb-sub-nome { font-size: .72rem; font-weight: 700; color: #20232A; line-height: 1.3; min-height: 2.4em; }
.hb-sub-dano { font-size: .64rem; color: var(--ember); font-weight: 600; }
.hb-sub-dano strong { color: #ff9d7a; }
.hb-sub-dano-base { color: #92949A; font-weight: 500; }
.hb-sub-btn {
  margin-top: auto;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .68rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ember-dim), var(--ember));
  border: none;
  border-radius: 6px;
  padding: 7px 6px;
}
.hb-sub-btn:hover:not(:disabled) { filter: brightness(1.1); }
.hb-sub-btn.done { background: rgba(53,212,136,.15); color: #7fe0b8; }
.hb-sub-btn.locked { background: #EDE9DE; color: #92949A; }
.hb-sub-btn:disabled { cursor: not-allowed; }

/* ── SELO AMALDIÇOADO ───────────────────────────────────────── */
.hb-selo-grid { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hb-selo-card {
  flex: 1 1 120px;
  max-width: 140px;
  background: #F4F2ED;
  border: 1px solid #D8D2C7;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  opacity: .5;
  box-shadow: 0 5px 18px rgba(91,62,10,.13);}
.hb-selo-card.alcancado { opacity: 1; border-color: #6c348355; }
.hb-selo-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; margin-bottom: 6px; background: #EDE9DE; }
.hb-selo-nome { font-size: .68rem; font-weight: 700; color: #20232A; margin-bottom: 4px; }

.hb-btn-evoluir {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .82rem;
  color: #fff;
  background: linear-gradient(135deg, var(--chakra-dim), var(--chakra));
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
}
.hb-btn-evoluir:hover { filter: brightness(1.1); }
.hb-selo-max { font-size: .8rem; color: #7fe0b8; font-weight: 700; }

/* ── ABA MESCLADAS (combos) ─────────────────────────────────── */
.hb-combo-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.hb-combo-card {
  flex: 1 1 300px;
  max-width: 360px;
  background: #F4F2ED;
  border: 1px solid #D8D2C7;
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 18px rgba(91,62,10,.13);}
.hb-combo-card.desbloqueado { border-left: 3px solid var(--gold); }
.hb-combo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.hb-combo-nome { font-family: var(--font-body); font-weight: 700; font-size: .9rem; color: #20232A; }
.hb-combo-status {
  flex-shrink: 0;
  font-size: .64rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.hb-combo-status.ok    { color: #7fe0b8; background: rgba(53,212,136,.1); border: 1px solid #35d48855; }
.hb-combo-status.falta { color: #ff9d9d; background: rgba(255,77,94,.06); border: 1px solid #ff4d5e44; }

.hb-combo-reqs-titulo { font-size: .64rem; font-weight: 700; color: #92949A; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.hb-combo-reqs { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.hb-combo-req {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .72rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid;
}
.hb-combo-req.ok    { color: #7fe0b8; border-color: #35d48855; background: rgba(53,212,136,.08); }
.hb-combo-req.falta { color: #ff9d9d; border-color: #ff4d5e55; background: rgba(255,77,94,.06); }

.hb-combo-locked {
  font-size: .76rem;
  color: #92949A;
  background: #F4F2ED;
  border: 1px dashed #D8D2C7;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  margin-top: auto;
}

/* ── 8 PORTÕES INTERNOS ─────────────────────────────────────── */
.hb-portao-total {
  margin-top: 8px;
  font-size: .8rem;
  color: var(--gold);
  font-weight: 700;
}
.hb-portoes-lista { display: flex; flex-direction: column; gap: 10px; }
.hb-portao-card {
  background: #F4F2ED;
  border: 1px solid #D8D2C7;
  border-radius: 12px;
  padding: 12px 14px;
  opacity: .6;
  box-shadow: 0 5px 18px rgba(91,62,10,.13);}
.hb-portao-card.aberto { opacity: 1; border-color: #e74c3c55; }
.hb-portao-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hb-portao-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .74rem;
  color: #92949A;
  background: #F4F2ED;
  border-radius: 6px;
  padding: 3px 8px;
}
.hb-portao-nome { font-family: var(--font-body); font-weight: 700; font-size: .84rem; color: #20232A; }
.hb-portao-bonus { font-size: .72rem; font-weight: 700; color: #ff6b6b; }
.hb-portao-status { margin-left: auto; font-size: .72rem; font-weight: 700; }
.hb-portao-status.ok { color: #7fe0b8; }
.hb-portao-status.locked { color: #92949A; }
.hb-portao-sem-hab { font-size: .68rem; color: #92949A; margin-top: 6px; font-style: italic; }

.hb-btn-evoluir {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .78rem;
  color: #fff;
  background: linear-gradient(135deg, var(--chakra-dim), var(--chakra));
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  margin-left: auto;
}
.hb-btn-evoluir:hover { filter: brightness(1.1); }
.hb-btn-evoluir.small { padding: 6px 12px; font-size: .7rem; }
.hb-btn-evoluir.gold { background: linear-gradient(135deg, var(--gold-dim), var(--gold)); margin-left: 0; margin-top: 8px; }

/* ── SELO AMALDIÇOADO ───────────────────────────────────────── */
.hb-selo-acoes { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 10px; }
.hb-selo-subnivel { font-size: .78rem; color: #20232A; margin-bottom: 4px; }
.hb-selo-subbonus { font-size: .68rem; color: #92949A; display: block; }
.hb-selo-info { font-size: .7rem; color: #92949A; margin-top: 6px; }

/* ── MODO SENNIN — escolha exclusiva ───────────────────────── */
.hb-modo-aviso {
  font-size: .76rem;
  color: #f1c40f;
  background: rgba(241,196,15,.08);
  border: 1px solid rgba(241,196,15,.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}
.hb-modo-opcoes { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hb-modo-opcao {
  flex: 1 1 100px;
  max-width: 120px;
  text-align: center;
  cursor: pointer;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #D9D5CC;
  background: #F4F2ED;
  transition: border-color .15s ease;
}
.hb-modo-opcao:hover { border-color: #D8D2C7; }
.hb-modo-opcao.selecionada { border-color: #27ae60; background: rgba(39,174,96,.1); }
.hb-modo-opcao-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; margin-bottom: 6px; background: #EDE9DE; }
.hb-modo-opcao-nome { font-size: .74rem; font-weight: 700; color: #20232A; }

/* ── RESPONSIVO ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hb-cat-card, .hb-sub-card, .hb-selo-card { flex: 1 1 100%; max-width: none; }
}
