/* ============================================================
   Box Aura — a árvore de habilidades (a trilha que sobe).
   Visual próprio de jogo: ela é uma tela de conquista, então tem
   cara de mapa de jogo mesmo quando o resto do app está sóbrio.
   ============================================================ */

.arvore {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column;
  color: #F0EEFF;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(138,126,255,.28), transparent 60%),
    radial-gradient(90% 60% at 50% 100%, rgba(255,45,110,.16), transparent 70%),
    linear-gradient(180deg, #1A124F 0%, #261B66 45%, #1D1452 100%);
}
/* um chao em perspectiva, bem de leve, no fundo: o assunto do app
   virando cenario */
.arvore::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  pointer-events: none; opacity: .5;
  background:
    repeating-linear-gradient(90deg, rgba(169,160,255,.10) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(169,160,255,.10) 0 1px, transparent 1px 38px);
  transform: perspective(420px) rotateX(58deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%);
          mask-image: linear-gradient(to top, #000 10%, transparent 90%);
}

.av-topo {
  position: relative; z-index: 2; flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: rgba(15,10,43,.55);
  border-bottom: 2px solid #FFC43D; box-shadow: 0 6px 18px rgba(0,0,0,.35);
}
.av-titulo { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.av-titulo b {
  font-family: 'Lilita One', cursive; font-weight: 400; font-size: 22px; color: #fff;
  -webkit-text-stroke: 1.2px #0F0A2B; paint-order: stroke fill;
  text-shadow: 0 3px 0 #0F0A2B;
}
.av-n { font-family: 'Lilita One', cursive; font-size: 15px; color: #FFC43D; text-shadow: 0 2px 0 #0F0A2B; }
.av-barra {
  flex: 1 1 140px; max-width: 260px; height: 12px; border-radius: 99px; overflow: hidden;
  background: #0F0A2B; border: 2px solid #0F0A2B; box-shadow: inset 0 2px 0 rgba(255,255,255,.06);
}
.av-barra i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(180deg, #FFE38A 0%, #FFC43D 55%, #D68A0C 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.55);
}
.av-x {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  font: 700 26px/1 'Poppins', sans-serif; color: #fff;
  background: linear-gradient(180deg, #E8455F, #B8213F); border: 2px solid #0F0A2B;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 3px 0 #0F0A2B;
}
.av-x:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 1px 0 #0F0A2B; }
.av-x:focus-visible { outline: 3px solid #FFC43D; outline-offset: 2px; }

.av-trilha {
  position: relative; z-index: 1; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  display: flex; justify-content: center; padding: 0 12px;
  scroll-behavior: smooth;
}
.av-mapa { position: relative; flex: 0 0 auto; }

/* a estrada: leito escuro, faixa tracejada, e o pedaço já percorrido
   em dourado por cima */
.av-estrada { position: absolute; inset: 0; overflow: visible; }
.av-leito { fill: none; stroke: #0F0A2B; stroke-width: 30; stroke-linecap: round; opacity: .72; }
.av-faixa { fill: none; stroke: rgba(179,170,255,.38); stroke-width: 3; stroke-dasharray: 10 12; stroke-linecap: round; }
.av-ouro {
  fill: none; stroke: #FFC43D; stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 0;
  filter: drop-shadow(0 0 8px rgba(255,196,61,.55));
}
.av-ouro--pavimenta { animation: avPavimenta 1.3s cubic-bezier(.3,.7,.2,1) .15s both; }
@keyframes avPavimenta { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* o cubo de cada habilidade */
.av-no {
  position: absolute; width: 74px; height: 74px; margin: -37px 0 0 -37px;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: none; border: 0; color: inherit; font: inherit;
}
.av-base {
  position: absolute; left: 50%; bottom: 4px; width: 60px; height: 16px; margin-left: -30px;
  border-radius: 50%; background: rgba(0,0,0,.45);
}
.av-cubo { position: relative; width: 56px; height: 56px; transition: transform .15s ease; }
.av-no:hover .av-cubo { transform: translateY(-3px); }
.av-no:focus-visible { outline: 3px solid #FFC43D; outline-offset: 2px; border-radius: 14px; }
.av-selo { position: absolute; right: 6px; bottom: 8px; width: 22px; height: 22px; }

.av-no--feita .av-cubo { filter: drop-shadow(0 0 10px rgba(255,196,61,.45)); }
.av-no--fechada .av-cubo { opacity: .78; }
/* o PROXIMO passo: o unico rosa da tela, pulando devagar */
.av-no--agora .av-cubo { animation: avAgora 1.6s ease-in-out infinite; filter: drop-shadow(0 0 14px rgba(255,45,110,.75)); }
.av-no--agora::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 3px solid rgba(255,45,110,.75); animation: avAnel 1.6s ease-out infinite;
  pointer-events: none;
}
@keyframes avAgora { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes avAnel { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }

/* o nome, de lado, numa plaquinha */
.av-nome {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: max-content; max-width: 150px; padding: 6px 10px; border-radius: 10px;
  font: 700 12.5px/1.2 'Poppins', sans-serif; color: #F0EEFF; text-align: left;
  background: rgba(15,10,43,.78); border: 2px solid rgba(169,160,255,.28);
  box-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.av-nome--dir { left: 78px; }
.av-nome--esq { right: 78px; text-align: right; }
.av-no--feita .av-nome { border-color: rgba(255,196,61,.65); }
.av-no--agora .av-nome { border-color: #FF2D6E; background: rgba(60,8,28,.88); }
.av-no--fechada .av-nome { color: #ADA9D0; }

/* o estandarte de cada mundo, atravessando a estrada */
.av-band {
  position: absolute; left: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 8px 18px 8px 8px; border-radius: 16px;
  background: linear-gradient(180deg, #4A3DB0 0%, #352A83 100%);
  border: 3px solid #0F0A2B; box-shadow: inset 0 2px 0 rgba(255,255,255,.2), 0 5px 0 #0F0A2B, 0 10px 22px rgba(0,0,0,.4);
}
.av-escudo {
  display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 auto;
  border-radius: 12px; color: #0F0A2B;
  background: linear-gradient(180deg, #FFE38A, #FFC43D 60%, #D68A0C);
  border: 2px solid #0F0A2B; box-shadow: inset 0 2px 0 rgba(255,255,255,.6);
}
.av-escudo svg { width: 32px; height: 32px; }
.av-fita {
  display: flex; flex-direction: column; line-height: 1.05;
  font-family: 'Lilita One', cursive; font-size: 19px; color: #fff;
  -webkit-text-stroke: 1px #0F0A2B; paint-order: stroke fill; text-shadow: 0 2px 0 #0F0A2B;
}
.av-fita small { font-size: 12px; color: #FFC43D; -webkit-text-stroke: 0; text-shadow: 0 1px 0 #0F0A2B; }
.av-band--futuro { background: linear-gradient(180deg, #4A4E63, #34374A); }
.av-band--futuro .av-escudo { background: linear-gradient(180deg, #A2A6BD, #7A7E96); }
.av-breve {
  margin-left: 4px; padding: 3px 8px; border-radius: 8px; font: 800 10.5px/1 'Poppins', sans-serif;
  color: #0F0A2B; background: #FFC43D; border: 2px solid #0F0A2B;
}

/* a coroa, no alto */
.av-coroa {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.av-coroa svg { width: 70px; height: 52px; filter: drop-shadow(0 0 16px rgba(255,196,61,.5)); }
.av-coroa b {
  font-family: 'Lilita One', cursive; font-weight: 400; font-size: 18px; color: #FFC43D;
  -webkit-text-stroke: 1px #0F0A2B; paint-order: stroke fill; text-shadow: 0 2px 0 #0F0A2B;
}

/* no celular o nome encolhe pra não sair da tela */
@media (max-width: 480px) {
  .av-nome { max-width: 112px; font-size: 11.5px; padding: 5px 8px; }
  .av-fita { font-size: 17px; }
  .av-titulo b { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .av-ouro--pavimenta, .av-no--agora .av-cubo, .av-no--agora::after { animation: none !important; }
  .av-trilha { scroll-behavior: auto; }
}

/* o botao que abre a arvore, no mapa */
.btn-arvore {
  display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; text-align: left;
  padding: 12px 16px 12px 12px; margin: 0 0 22px; border-radius: 16px;
  font: inherit; color: #fff;
  background: linear-gradient(180deg, #4A3DB0 0%, #352A83 100%);
  border: 3px solid #0F0A2B;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.22), 0 5px 0 #0F0A2B, 0 10px 20px rgba(0,0,0,.25);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-arvore:hover { transform: translateY(-2px); }
.btn-arvore:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.22), 0 2px 0 #0F0A2B; }
.btn-arvore:focus-visible { outline: 3px solid #FFC43D; outline-offset: 3px; }
.btn-arvore__ic { width: 50px; height: 50px; flex: 0 0 auto; }
.btn-arvore__txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.btn-arvore__t {
  font-family: 'Lilita One', cursive; font-weight: 400; font-size: 21px; line-height: 1;
  -webkit-text-stroke: 1px #0F0A2B; paint-order: stroke fill; text-shadow: 0 2px 0 #0F0A2B;
}
.btn-arvore__meta { display: flex; align-items: center; gap: 10px; font: 700 12px/1 'Poppins', sans-serif; color: #FFC43D; }
.btn-arvore__meta .av-barra { flex: 1 1 auto; max-width: none; height: 10px; }
.btn-arvore__seta { width: 22px; height: 22px; flex: 0 0 auto; color: #FFC43D; }
