/* ============================================================
   status-window.css — A Janela de Status do Sistema
   Topo do dashboard: placa de aquisição + painel do hunter
   ============================================================ */

/* ═══ PLACA DE AQUISIÇÃO ═══════════════════════════════════ */
.sys-plate {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: .9rem 1.4rem .9rem 1.1rem;
  border-radius: 4px;
  background:
    linear-gradient(100deg, rgba(124,58,237,.10), rgba(6,182,212,.04) 60%, transparent);
  border-left: 2px solid var(--purple-glow);
  /* cantos chanfrados estilo "janela do Sistema" */
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  flex-wrap: wrap;
}
.sys-plate::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 0% 50%, rgba(168,85,247,.16), transparent 60%);
  pointer-events: none;
}

.sys-plate-glyph {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(168,85,247,.6));
  animation: sys-glyph-flutua 4.5s ease-in-out infinite;
}
@keyframes sys-glyph-flutua {
  0%,100% { transform: translateY(0) rotate(0); }
  50%     { transform: translateY(-4px) rotate(4deg); }
}
.sys-glyph-core { animation: sys-core-pulsa 2.4s ease-in-out infinite; transform-origin: center; }
@keyframes sys-core-pulsa {
  0%,100% { opacity: 1; r: 4; }
  50%     { opacity: .55; r: 5.5; }
}

.sys-plate-texts { flex: 1; min-width: 200px; }
.sys-plate-title {
  font-family: var(--font-title);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: .22em;
  line-height: 1;
  margin: 0;
  background: linear-gradient(100deg, #fff 10%, #d8b4fe 35%, #fff 50%, #22d3ee 75%, #fff);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: cq-shimmer 5s linear infinite;
  text-shadow: 0 0 30px rgba(168,85,247,.35);
}
.sys-plate-sub {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin-top: .3rem;
  font-family: var(--font-section);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sys-plate-sep { color: var(--purple-glow); opacity: .7; }
.sys-plate-whisper {
  font-style: italic;
  text-transform: none;
  letter-spacing: .04em;
  color: rgba(168,85,247,.85);
  transition: opacity .6s ease;
}
.sys-plate-whisper.trocando { opacity: 0; }

/* linha de energia varrendo sob o título */
.sys-plate-line {
  margin-top: .55rem;
  height: 1px;
  background: linear-gradient(90deg, var(--purple-glow), rgba(34,211,238,.5) 30%, transparent 70%);
  position: relative;
  overflow: hidden;
}
.sys-plate-line::after {
  content: '';
  position: absolute; top: 0; left: -30%;
  width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  animation: sys-line-sweep 4s ease-in-out infinite;
}
@keyframes sys-line-sweep {
  0%   { left: -30%; opacity: 0; }
  25%  { opacity: 1; }
  60%  { left: 100%; opacity: 0; }
  100% { left: 100%; opacity: 0; }
}

.sys-plate-actions { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }

.sys-btn-missao {
  position: relative;
  font-family: var(--font-section);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .62rem 1.35rem;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-main), #4c1d95);
  border: 1px solid var(--purple-glow);
  box-shadow: 0 0 18px rgba(124,58,237,.45);
  cursor: pointer;
  overflow: hidden;
  transition: all .22s ease;
}
.sys-btn-missao::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.3) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.sys-btn-missao:hover::after { transform: translateX(120%); }
.sys-btn-missao:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(124,58,237,.7);
}

/* chip: dungeon aberta agora */
.sys-chip-dungeon {
  font-family: var(--font-section);
  font-size: .7rem; font-weight: 700;
  letter-spacing: .08em;
  padding: .45rem .85rem;
  border-radius: 100px;
  color: #34d399;
  background: rgba(16,185,129,.09);
  border: 1px solid rgba(16,185,129,.45);
  cursor: pointer;
  white-space: nowrap;
  animation: sys-chip-pulsa 2.4s ease-in-out infinite;
  transition: all .2s;
}
.sys-chip-dungeon:hover { background: rgba(16,185,129,.22); transform: scale(1.04); }
@keyframes sys-chip-pulsa {
  0%,100% { box-shadow: 0 0 0 rgba(16,185,129,0); }
  50%     { box-shadow: 0 0 16px rgba(16,185,129,.45); }
}

/* ═══ JANELA DO HUNTER ═════════════════════════════════════ */
.hunter-window {
  position: relative;
  margin-bottom: 1.5rem;
  padding: 1.4rem 1.6rem 1.1rem;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(124,58,237,.13), rgba(6,182,212,.05) 55%, rgba(5,5,8,.6));
  border: 1px solid rgba(124,58,237,.28);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  box-shadow: inset 0 0 60px rgba(124,58,237,.07), 0 8px 30px rgba(0,0,0,.45);
}
/* vinheta que reage ao rank (JS troca a cor via --rank-cor) */
.hunter-window::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(90% 120% at 12% 30%, var(--rank-aura, rgba(124,58,237,.14)), transparent 62%);
}
.hunter-window-fx { position: absolute; inset: 0; pointer-events: none; opacity: .55; }

/* ── Banner cosmético (arte 2D atrás do conteúdo) ─────────
   A arte sangra pela direita e dissolve rumo ao texto.
   Ative com: <div class="hunter-window" data-banner="monarca"> */
.hunter-window[data-banner] { isolation: isolate; }
.hunter-window[data-banner]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 118%;
  opacity: .9;
  /* segunda dissolução: garante legibilidade do texto à esquerda */
  -webkit-mask-image: linear-gradient(90deg, transparent 26%, rgba(0,0,0,.55) 46%, #000 68%);
          mask-image: linear-gradient(90deg, transparent 26%, rgba(0,0,0,.55) 46%, #000 68%);
  animation: hw-banner-respira 9s ease-in-out infinite;
}
@keyframes hw-banner-respira {
  0%,100% { transform: translateX(0) scale(1);      opacity: .88; }
  50%     { transform: translateX(-6px) scale(1.02); opacity: 1;   }
}
.hunter-window[data-banner="monarca"]::before {
  background-image: url('/assets/banners/monarca.png');
}
/* o conteúdo sempre por cima da arte */
.hunter-window[data-banner] .hunter-window-body { position: relative; z-index: 3; }
/* véu que protege a legibilidade do lado esquerdo */
.hunter-window[data-banner] .hunter-window-fx { z-index: 2; }

@media (max-width: 820px) {
  .hunter-window[data-banner]::before { opacity: .45; background-size: auto 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hunter-window[data-banner]::before { animation: none; }
}
.hunter-window-body {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 1.6rem;
  flex-wrap: wrap;
}

/* ── Hexágono de rank ── */
.hunter-hex-wrap {
  position: relative;
  width: 104px; height: 104px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.hunter-hex {
  width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.1rem;
  overflow: hidden;
  background: linear-gradient(150deg, var(--purple-main), var(--blue-mana));
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  position: relative; z-index: 2;
}
.hunter-hex img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; }
.hunter-hex-ring {
  position: absolute; inset: 0;
  background: conic-gradient(from 0deg,
    transparent 0%, var(--rank-cor, #a855f7) 12%, transparent 30%,
    transparent 50%, var(--rank-cor, #a855f7) 62%, transparent 80%);
  clip-path: polygon(50% 0%, 96% 25%, 96% 75%, 50% 100%, 4% 75%, 4% 25%);
  animation: cq-anel-girar 6s linear infinite;
  filter: blur(1px);
}
.hunter-hex-rank {
  position: absolute;
  bottom: -2px; right: -2px;
  z-index: 3;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-size: 1.05rem; font-weight: 900;
  color: var(--rank-cor, #a855f7);
  background: #07070f;
  border: 2px solid var(--rank-cor, #a855f7);
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  text-shadow: 0 0 10px var(--rank-cor, #a855f7);
}

/* Câmera no hexágono (perfil: trocar foto) */
.hunter-hex-camera {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: rgba(0,0,0,.55);
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.hunter-hex-wrap:hover .hunter-hex-camera { opacity: 1; }

/* ── Identidade ── */
.hunter-ident { flex: 1; min-width: 240px; }
.hunter-nome {
  font-family: var(--font-title);
  font-size: 1.5rem;
  letter-spacing: .06em;
  color: var(--text-primary);
  text-shadow: 0 0 22px rgba(168,85,247,.35);
  line-height: 1.1;
}
.hunter-titulo {
  font-family: var(--font-section);
  font-size: .88rem;
  font-style: italic;
  color: var(--gold-xp);
  margin-top: .15rem;
}
.hunter-badges { display: flex; gap: .5rem; align-items: center; margin-top: .45rem; flex-wrap: wrap; }

/* ── Barra de XP ── */
.hunter-xp { margin-top: .9rem; max-width: 520px; }
.hunter-xp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; gap: 1rem; }
.hunter-xp-lbl {
  font-family: var(--font-section); font-size: .64rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted);
}
.hunter-xp-val {
  font-family: 'Orbitron', monospace; font-size: .74rem;
  color: var(--gold-bright); font-variant-numeric: tabular-nums;
  /* O valor nunca quebra: sem isto o "XP" caía órfão na linha de baixo. */
  white-space: nowrap; flex-shrink: 0;
}

/* Em tela estreita o rótulo longo ocupava duas linhas e empurrava tudo.
   Encurta para caber numa só. */
@media (max-width: 560px) {
  .hunter-xp-top { gap: .6rem; }
  .hunter-xp-lbl {
    font-size: .58rem; letter-spacing: .1em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .hunter-xp-lbl::after { content: ''; }
}
@media (max-width: 420px) {
  /* Espaço de verdade não existe: troca o texto por um rótulo curto. */
  .hunter-xp-lbl { font-size: 0; }
  .hunter-xp-lbl::after {
    content: 'Próximo nível';
    font-size: .6rem; letter-spacing: .1em;
  }
}
.hunter-xp-track {
  position: relative;
  height: 13px;
  border-radius: 100px;
  background: rgba(5,5,12,.75);
  border: 1px solid rgba(124,58,237,.3);
  overflow: hidden;
}
.hunter-xp-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, #7c3aed, #a855f7 40%, #22d3ee);
  box-shadow: 0 0 16px rgba(168,85,247,.7);
  transition: width 1.1s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.hunter-xp-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  animation: sys-xp-flui 2.6s linear infinite;
}
@keyframes sys-xp-flui { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
/* quase subindo de nível: a barra arde */
.hunter-xp-track.quase .hunter-xp-fill {
  background: linear-gradient(90deg, #f59e0b, #fbbf24 50%, #fff6d8);
  box-shadow: 0 0 24px rgba(251,191,36,.9);
  animation: sys-xp-arde 1.2s ease-in-out infinite;
}
@keyframes sys-xp-arde {
  0%,100% { filter: brightness(1); }
  50%     { filter: brightness(1.35); }
}
.hunter-xp-ticks {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg,
    transparent 0 calc(10% - 1px), rgba(255,255,255,.10) calc(10% - 1px) 10%);
}

/* ── Relicário (últimas conquistas) ── */
.hunter-relicario { display: flex; align-items: center; gap: .45rem; margin-top: .85rem; flex-wrap: wrap; }
.hunter-relicario-lbl {
  font-family: var(--font-section); font-size: .6rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim);
  margin-right: .15rem;
}
.hunter-reliquia {
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
  filter: drop-shadow(0 0 4px rgba(251,191,36,.4));
}
.hunter-reliquia:hover { transform: translateY(-3px) scale(1.14); filter: drop-shadow(0 0 10px rgba(251,191,36,.9)); }

/* ── Cristais de status ── */
.hunter-cristais { display: flex; gap: 1rem; flex-shrink: 0; margin-left: auto; }
.cristal { text-align: center; }
.cristal-gema {
  width: 74px; height: 74px;
  display: flex; align-items: center; justify-content: center; gap: .15rem;
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);   /* losango */
  transition: transform .25s ease;
  position: relative;
}
.cristal:hover .cristal-gema { transform: scale(1.08) rotate(6deg); }
.cristal-lbl {
  font-family: var(--font-section);
  font-size: .58rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-muted);
  margin-top: .3rem;
}
.cristal-nivel .cristal-gema {
  background: linear-gradient(150deg, rgba(168,85,247,.35), rgba(76,29,149,.55));
  border: 1px solid rgba(168,85,247,.5);
  color: #e9d5ff;
  text-shadow: 0 0 14px rgba(168,85,247,.9);
}
.cristal-moedas .cristal-gema {
  background: linear-gradient(150deg, rgba(251,191,36,.3), rgba(146,64,14,.5));
  border: 1px solid rgba(251,191,36,.5);
  color: #fde68a;
  text-shadow: 0 0 14px rgba(251,191,36,.85);
  font-size: 1.15rem;
}
.cristal-streak .cristal-gema {
  background: linear-gradient(150deg, rgba(249,115,22,.3), rgba(124,45,18,.5));
  border: 1px solid rgba(249,115,22,.5);
  color: #fed7aa;
  text-shadow: 0 0 14px rgba(249,115,22,.85);
  font-size: 1.2rem;
}
.cristal-chama {
  font-size: .95rem;
  animation: sys-chama 1.8s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes sys-chama {
  0%,100% { transform: scale(1) rotate(-3deg); }
  50%     { transform: scale(1.16) rotate(4deg); }
}
/* streak zerado: chama apagada */
.cristal-streak.apagado .cristal-gema { opacity: .45; filter: grayscale(.7); }
.cristal-streak.apagado .cristal-chama { animation: none; }

/* ── Responsivo ── */
@media (max-width: 900px) {
  .hunter-cristais { margin-left: 0; width: 100%; justify-content: space-around; }
  .hunter-window-body { gap: 1.1rem; }
  .sys-plate-title { font-size: 1.25rem; }
}
@media (max-width: 560px) {
  .cristal-gema { width: 62px; height: 62px; font-size: 1.15rem; }
  .hunter-hex-wrap { width: 88px; height: 88px; }
  .hunter-hex { width: 72px; height: 72px; }
  .sys-plate-whisper { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sys-plate-glyph, .sys-glyph-core, .sys-plate-line::after,
  .hunter-hex-ring, .hunter-xp-fill::after, .cristal-chama,
  .sys-chip-dungeon { animation: none; }
}
