/* =====================================================================
   Ordem — RPG de Combate — Tema visual de fantasia
   ===================================================================== */

/* Scrollbar global personalizada */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(155,107,216,.35) rgba(255,255,255,.03);
}
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: rgba(255,255,255,.03); border-radius: 999px; }
*::-webkit-scrollbar-thumb { background: rgba(155,107,216,.35); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(155,107,216,.65); }

:root {
  --bg-deep: #0b0d17;
  --bg-panel: #161a2c;
  --bg-panel-alt: #1d2238;
  --bg-elevated: #232a45;
  --border-soft: rgba(201, 168, 105, 0.25);
  --gold: #d8b463;
  --gold-bright: #f3cf7c;
  --gold-dim: #9a7d3d;
  --red: #e3576a;
  --red-dark: #8a2d3a;
  --green: #59c98a;
  --blue: #5aa9e6;
  --purple: #9b6bd8;
  --text-main: #eef0fb;
  --text-dim: #9aa0c0;
  --text-faint: #6b7194;
  --shadow-deep: 0 12px 30px rgba(0, 0, 0, 0.5);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-display: 'Cinzel', serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  /* Mesma cor da bottom-nav — se sobrar 1px de vão, não aparece roxo claro */
  background-color: #0a0814;
  background-image: none;
  color: var(--text-main);
  font-family: var(--font-body);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
  overflow: hidden; /* scroll fica no .main-view */
}

button { font-family: inherit; cursor: pointer; }

/* Shell colado nas 4 bordas da viewport — SEM transform (senão fixed da nav
   fica preso ao shell e não cola no fundo do telefone). */
.app-shell {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-deep);
  background-image: linear-gradient(180deg, rgba(30, 22, 60, 0.4), transparent 200px);
}

/* --------------------------------------------------------------------
   HUD
   -------------------------------------------------------------------- */
/* ── HUD unificado — mesma aparência em todas as telas ───────────────── */
.hud {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  /* PWA / iOS: afasta conteúdo dos ícones de hora/bateria */
  padding-top: env(safe-area-inset-top, 0px);
  backdrop-filter: blur(8px);
  background: linear-gradient(165deg, rgba(35,42,69,.97), rgba(14,12,26,.95));
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 2px 16px rgba(0,0,0,.4);
}

.hud-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 9px;
}

/* Linha do topo: avatar + nome/nível + moedas */
.hud-top-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.hud-name-block {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* Linha das barras */
.hud-bars-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-progress-row .hud-progress-track,
.hud-progress-row { width: 100%; }

.hud-progress-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.08);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.45);
}

/* Cores por tipo — reutiliza as fills do home-profile-card */
.hud-progress-hp  .home-progress-fill { background: linear-gradient(90deg,#8b1a28,#e03a4a 55%,#ff6b7a); box-shadow: 0 0 10px rgba(224,58,74,.45); }
.hud-progress-xp  .home-progress-fill { background: linear-gradient(90deg,#4a3a9e,#7b5fd4 50%,#b08cff); box-shadow: 0 0 10px rgba(123,95,212,.45); }
.hud-progress-energy .home-progress-fill { background: linear-gradient(90deg,#9a7a10,#e8b82a 55%,#ffe98a); box-shadow: 0 0 10px rgba(232,184,42,.4); }

/* Progresso até a próxima +1 — dentro da barra, mesma altura, dourado bem apagado */
.hud-energy-regen-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: rgba(232, 184, 42, 0.12);
  z-index: 0;
  pointer-events: none;
  transition: width 0.35s linear;
}

.hud-progress-energy .home-progress-fill {
  z-index: 1;
}

.hud-progress-energy .home-progress-shine,
.hud-progress-energy .home-progress-overlay {
  z-index: 2;
}

.hud-progress-energy.is-energy-full .hud-energy-regen-fill {
  width: 100% !important;
  background: rgba(232, 184, 42, 0.06);
}

.hud-energy-next {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 243, 180, 0.9);
  margin-left: 4px;
  letter-spacing: 0.02em;
}

.hud-progress-energy.is-energy-full .hud-energy-next {
  color: rgba(180, 255, 180, 0.85);
}

#hudEnergy.energy-pop {
  animation: energyPop .45s ease;
}

@keyframes energyPop {
  0%   { transform: scale(1); color: inherit; }
  40%  { transform: scale(1.25); color: #fff8c0; }
  100% { transform: scale(1); color: inherit; }
}

/* Hero row — mantido para compatibilidade */
.hud-hero {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.hud-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--bg-elevated), var(--bg-panel));
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(216,180,99,.3);
}

.hud-avatar img.asset-hud {
  width: 36px;
  height: 36px;
  max-width: none;
  object-fit: contain;
}

.hud-info { flex: 1; min-width: 0; }

.hud-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hud-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.hud-level {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(216,180,99,.14);
  border: 1px solid rgba(216,180,99,.32);
  border-radius: 20px;
  padding: 3px 9px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
}

.hud-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hud-mini-bar {
  margin-top: 0;
  height: 7px;
}

.hud-mini-bar.bar-xp {
  height: 4px;
}

.hud-mini-bar.bar-xp .bar-fill {
  height: 100%;
}

/* Legado — mantido para não quebrar telas que ainda referenciam */
.hud-compact, .hud-full, .hud-brand,
.hud-brand-mark, .hud-brand-text, .hud-brand-title, .hud-brand-sub,
.brand-logo { display: none; }
.hud-mode-home, .hud-mode-play { }

.bar {
  position: relative;
  height: 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 3px;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}

.bar-xp .bar-fill { background: linear-gradient(90deg, #6f5bd0, var(--purple)); height: 5px; }
.bar-xp { height: 5px; }

.bar-hp .bar-fill { background: linear-gradient(90deg, var(--red-dark), var(--red)); }

.bar-label {
  position: absolute;
  right: 4px;
  top: -1px;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  line-height: 9px;
}

.hud-currencies {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.currency {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.currency-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 12px;
}

/* Cada emoji tem baseline diferente — compensação pontual */
.currency-icon--gold {
  transform: none;
}

.currency-icon--gems {
  transform: translateY(-1px);
}

.currency #hudGold,
.currency #hudGems {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.currency.energy { color: #ffd76a; }

.currency-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  padding-right: 5px;
  gap: 5px;
}

.currency-clickable:hover {
  border-color: var(--gold-dim, #c9a227);
  background: rgba(201, 162, 39, 0.12);
}

.currency-clickable:active {
  transform: scale(0.96);
}

.currency-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 1px;
  border-radius: 50%;
  background: linear-gradient(145deg, #5ec8ff, #2a8fd4);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.currency-clickable:hover .currency-add {
  background: linear-gradient(145deg, #7ad4ff, #3a9fe0);
  transform: scale(1.08);
}

/* --------------------------------------------------------------------
   Main view
   -------------------------------------------------------------------- */
.main-view {
  flex: 1;
  min-height: 0; /* obrigatório para overflow rolar dentro de flex column */
  padding: 12px 14px calc(var(--nav-h, 64px) + 8px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

/* Botão "← Voltar" injetado no topo de telas de segundo nível (fora da
   bottom nav), quando há histórico de navegação para retornar. */
.view-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 2px 10px;
  margin: 0;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
  font-family: var(--font-display);
  min-height: 280px;
}

.brand-logo-loading {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(155, 107, 216, 0.4));
  animation: brandPulse 2.8s ease-in-out infinite;
}

.loading-screen-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
}

.loading-screen-sub {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

@keyframes brandPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 10px 28px rgba(155, 107, 216, 0.4)); }
  50% { transform: scale(1.04); filter: drop-shadow(0 14px 36px rgba(243, 207, 124, 0.35)); }
}

.view-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--gold-bright);
  margin: 0 0 4px;
}

.view-subtitle {
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 14px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-deep);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.breadcrumb button {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 4px;
}

.breadcrumb span.sep { color: var(--text-faint); }

/* Barra "X/Y explorado" no topo do mosaico hexagonal de nós — dá ao
   jogador um objetivo claro de progresso dentro da zona atual. */
.zone-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--text-dim);
}

.zone-progress-label { flex-shrink: 0; }

.zone-progress-bar {
  flex: 1;
  margin-top: 0;
}
.zone-progress-bar .bar-fill { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }

.zone-progress-value {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text-main);
}

.gather-tool-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin: -4px 0 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: rgba(216, 180, 99, 0.08);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.gather-tool-hint-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Overlay de coleta: barra + segundos regressivos sobre o hexágono. */
.gather-progress-overlay {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.gather-progress-card {
  min-width: 72px;
  padding: 8px 10px 6px;
  border-radius: var(--radius-md);
  background: rgba(12, 14, 28, 0.92);
  border: 1px solid var(--gold-dim);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gather-progress-icon {
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gather-progress-node-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.gather-progress-bar {
  width: 56px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.gather-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
}

.gather-progress-time {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------
   Tela Início (dashboard)
   -------------------------------------------------------------------- */
.home-profile-card {
  background: linear-gradient(165deg, rgba(35, 42, 69, 0.95), var(--bg-panel));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-deep);
}

.home-hero-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.home-hero-meta {
  flex: 1;
  min-width: 0;
}

.home-hero-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.home-hero-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.home-profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--bg-elevated), var(--bg-panel));
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(216, 180, 99, 0.25);
}

.home-profile-avatar img.asset-profile {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.home-profile-name {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.home-level-badge {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(216, 180, 99, 0.14);
  border: 1px solid rgba(216, 180, 99, 0.35);
  border-radius: 20px;
  padding: 2px 7px;
}

.home-inline-resource {
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-radius: 20px;
  padding: 2px 6px;
  white-space: nowrap;
}

.home-inline-resource.gold {
  color: var(--gold-bright);
  background: rgba(216, 180, 99, 0.12);
  border: 1px solid rgba(216, 180, 99, 0.28);
}

.home-inline-resource.gems {
  color: #c9b0ff;
  background: rgba(155, 107, 216, 0.14);
  border: 1px solid rgba(155, 107, 216, 0.3);
}

.home-profile-class {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.home-progress-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.home-progress-row {
  width: 100%;
}

.home-progress-track {
  position: relative;
  height: 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.home-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.home-progress-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: home-bar-shine 3s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

@keyframes home-bar-shine {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: -100% 0; }
}

.home-progress-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 8px;
  z-index: 3;
  pointer-events: none;
}

.home-progress-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.02em;
}

.home-progress-icon {
  font-size: 10px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.home-progress-value {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.home-progress-sep {
  color: rgba(255, 255, 255, 0.45);
  margin: 0 1px;
}

.home-progress-hp .home-progress-fill {
  background: linear-gradient(90deg, #8b1a28 0%, #e03a4a 55%, #ff6b7a 100%);
  box-shadow: 0 0 10px rgba(224, 58, 74, 0.45);
}

.home-progress-xp .home-progress-fill {
  background: linear-gradient(90deg, #4a3a9e 0%, #7b5fd4 50%, #b08cff 100%);
  box-shadow: 0 0 10px rgba(123, 95, 212, 0.45);
}

.home-progress-energy .home-progress-fill {
  background: linear-gradient(90deg, #9a7a10 0%, #e8b82a 55%, #ffe98a 100%);
  box-shadow: 0 0 10px rgba(232, 184, 42, 0.4);
}

.home-progress-track::after {
  content: '';
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 35%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent);
  pointer-events: none;
  z-index: 1;
}

@media (max-width: 360px) {
  .home-hero-title-row {
    flex-wrap: wrap;
  }

  .home-hero-badges {
    width: 100%;
    justify-content: flex-end;
  }

  .home-inline-resource {
    font-size: 8px;
    padding: 2px 5px;
  }
}

.home-event-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(90, 180, 110, 0.45);
  background: linear-gradient(135deg, rgba(40, 90, 55, 0.55), rgba(20, 40, 30, 0.7));
  animation: homeEventPulse 2.4s ease-in-out infinite;
}

.home-event-title {
  font-weight: 700;
  color: #8fdfa0;
  font-family: var(--font-display);
  font-size: 14px;
}

.home-event-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

@keyframes homeEventPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110, 200, 130, 0.15); }
  50% { box-shadow: 0 0 12px 2px rgba(110, 200, 130, 0.35); }
}

.home-highlight {
  background: linear-gradient(90deg, rgba(216, 180, 99, 0.14), rgba(216, 180, 99, 0.03));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-main);
  margin-bottom: 12px;
}

.home-highlight strong { color: var(--gold-bright); }
.highlight-enemy-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 2px;
}
.highlight-enemy-icon img,
.highlight-enemy-icon .asset-enemy {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* --------------------------------------------------------------------
   Grid de cards genérico (mundos, territórios, zonas)
   -------------------------------------------------------------------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tile-card {
  background: linear-gradient(160deg, var(--bg-elevated), var(--bg-panel));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: left;
  color: var(--text-main);
  position: relative;
  overflow: hidden;
}

.tile-card:disabled, .tile-card.locked {
  opacity: 0.5;
  filter: grayscale(0.6);
}

.tile-card .tile-icon { font-size: 26px; margin-bottom: 6px; display: block; }
.tile-card .tile-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.tile-card .tile-meta { font-size: 11px; color: var(--text-dim); }
.tile-card .lock-badge { position: absolute; top: 8px; right: 8px; font-size: 14px; }

/* --------------------------------------------------------------------
   Mapa hexagonal de exploração
   -------------------------------------------------------------------- */
.hex-map-wrap {
  position: relative;
  width: 100%;
  overflow: auto;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 50% 20%, #1b2140, #0d0f1c);
  border: 1px solid var(--border-soft);
  padding: 8px;
  min-height: 260px;
}

.hex-svg { width: 100%; height: auto; display: block; }

.hex-cell { cursor: pointer; }
.hex-cell polygon { transition: filter 0.12s ease, stroke 0.12s ease; }
.hex-cell:hover polygon { filter: brightness(1.28); stroke: var(--gold); stroke-width: 2.4; }
.hex-cell-rare polygon {
  stroke: rgba(140, 230, 160, 0.85);
  stroke-width: 2.2;
  animation: rareNodePulse 1.8s ease-in-out infinite;
}
@keyframes rareNodePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.45); }
}
.hex-icon { pointer-events: none; }
.hex-enemy-img { pointer-events: none; }
.hex-node-img { pointer-events: none; }

/* Legenda de tipos de nós abaixo do mapa hexagonal */
.node-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: center;
  padding: 8px 4px 4px;
  font-size: 10px;
  color: var(--text-dim);
}
.node-legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
}
.node-legend-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.node-legend-emoji {
  font-size: 14px;
  line-height: 1;
}
.help-node-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 2px;
}
.hex-badge { pointer-events: none; fill: #fff; font-weight: 700; }
.hex-group-badge { pointer-events: none; fill: #3a0f1c; stroke: #ff6b86; stroke-width: 1.4; }
.hex-group-badge-text { pointer-events: none; fill: #ffd6dd; font-weight: 800; }

/* --------------------------------------------------------------------
   Mapa orgânico (blobs) — mundos, territórios e zonas
   -------------------------------------------------------------------- */
.blob-map-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 50% 15%, #171a30, #0b0c17);
  border: 1px solid var(--border-soft);
  padding: 8px;
  min-height: 200px;
}

.blob-svg { width: 100%; height: auto; display: block; min-height: 180px; }

.home-map-wrap,
.explore-map-wrap {
  min-height: 280px;
  padding: 12px;
}

.home-map-wrap .blob-svg,
.explore-map-wrap .blob-svg {
  min-height: 260px;
}

.blob-links line {
  stroke: rgba(216, 180, 99, 0.16);
  stroke-width: 2;
  stroke-dasharray: 4 5;
}

.blob-cell path { transition: filter 0.12s ease, stroke-width 0.12s ease; }
.blob-cell:not(.locked) { cursor: pointer; }
.blob-cell:not(.locked):hover path { filter: brightness(1.22); stroke-width: 3; }
.blob-cell.locked path { opacity: 0.55; }
.blob-cell.locked { cursor: not-allowed; }

.blob-icon, .blob-label, .blob-meta, .blob-asset-img { pointer-events: none; }
.blob-label { fill: var(--text-main); font-size: 11.5px; font-weight: 700; }
.blob-meta { fill: var(--text-dim); font-size: 9.5px; }

/* --------------------------------------------------------------------
   Navegação inferior
   -------------------------------------------------------------------- */
.bottom-nav {
  /* fixed na viewport real — não depende da altura do shell */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  background: #0a0814;
  border-top: 1px solid var(--border-soft);
  /* Mobile no navegador: folga + home indicator (safe-area) */
  padding: 2px 2px max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 40;
  box-sizing: border-box;
}

/* Desktop no navegador: folga acima da barra de tarefas do Windows */
@media (min-width: 768px) {
  .bottom-nav {
    padding-bottom: 12px;
  }
  .main-view {
    padding-bottom: calc(var(--nav-h, 64px) + 16px);
  }
}

/* PWA / fullscreen: só o inset nativo (sem a folga extra do browser) */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.1;
  padding: 2px 2px 0;
  margin: 0;
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 0;
  overflow: visible;
  position: relative;
}

.nav-btn .nav-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.nav-btn .asset-menu-nav {
  width: 40px;
  height: 40px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
.nav-btn.active { color: var(--gold-bright); }

/* --------------------------------------------------------------------
   Overlays / sheets
   -------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 4, 12, 0.72);
  display: flex;
  align-items: flex-start; /* evita bug de scroll em mobile com content alto */
  justify-content: center;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  z-index: 100;
}

.overlay.hidden { display: none; }
.overlay.center {
  align-items: flex-start;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Centraliza o sheet quando cabe na tela; se for maior, o overlay rola */
.overlay > .welcome-sheet,
.overlay > .auth-sheet,
.overlay > .class-select-sheet,
.overlay > .generic-sheet,
.overlay > .more-menu-sheet,
.overlay > .tree-sheet {
  margin-top: auto;
  margin-bottom: auto;
  flex-shrink: 0;
}

/* O modal genérico (seletor de consumíveis, confirmações) precisa aparecer
   por cima da arena de batalha em tela cheia, mesmo quando aberto durante a luta. */
#genericModalOverlay { z-index: 260; }

.overlay .class-select-sheet,
.overlay .generic-sheet {
  background: linear-gradient(180deg, var(--bg-panel-alt), var(--bg-panel));
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: min(90vh, calc(100dvh - 32px - env(safe-area-inset-bottom)));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-deep);
}

/* Modal centralizado — Variante C (também precisa rolar em telas baixas) */
.overlay-center {
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay .more-menu-sheet {
  background: linear-gradient(180deg, #1c1e36, #111322);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(155,107,216,.35);
  box-shadow: 0 0 0 1px rgba(243,207,124,.06), var(--shadow-deep);
  max-height: min(88vh, calc(100dvh - 32px - env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.more-menu-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(155,107,216,.1), transparent);
}

.more-menu-header h2 {
  font-family: var(--font-display);
  color: var(--gold-bright);
  font-size: 15px;
  margin: 0;
}

.sheet-close-x {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sheet-close-x:hover { border-color: var(--gold-dim); color: var(--text-main); }

.more-menu-body {
  flex: 1;
  min-height: 0; /* permite scroll do menu dentro do sheet com max-height */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: 10px 12px 14px;
  /* Scrollbar personalizada */
  scrollbar-width: thin;
  scrollbar-color: rgba(155,107,216,.45) rgba(255,255,255,.04);
}
.more-menu-body::-webkit-scrollbar { width: 5px; }
.more-menu-body::-webkit-scrollbar-track { background: rgba(255,255,255,.03); border-radius: 999px; }
.more-menu-body::-webkit-scrollbar-thumb { background: rgba(155,107,216,.45); border-radius: 999px; }
.more-menu-body::-webkit-scrollbar-thumb:hover { background: rgba(155,107,216,.75); }

.sheet-handle { display: none; }

.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.menu-sections {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.menu-section-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 12px 0 6px;
  padding-left: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.menu-section:first-child .menu-section-title {
  margin-top: 0;
}

.home-menu-grid {
  margin-bottom: 4px;
  width: 100%;
}

.home-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-menu-more-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 2px;
}

/* Seções secundárias do menu completo (overlay "☰ Menu"): cada uma é um
   acordeão próprio, recolhido por padrão. Abrir um fecha os outros
   (bindMenuAccordions em app.js), então a lista nunca fica com vários
   grids abertos ao mesmo tempo — ponto principal da reorganização. */
.menu-accordion-group-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 6px;
  padding-left: 2px;
}

.menu-accordion {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-panel-alt);
  margin-bottom: 6px;
  overflow: hidden;
}

.menu-accordion-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 12px 12px;
  text-align: left;
}

.menu-accordion-title {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.menu-accordion-count {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--gold-dim);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-accordion-chevron {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--gold-dim);
  transition: transform 0.2s ease;
}

.menu-accordion.open .menu-accordion-toggle { background: rgba(216, 180, 99, 0.08); }
.menu-accordion.open .menu-accordion-title { color: var(--gold-bright); }
.menu-accordion.open .menu-accordion-chevron { transform: rotate(180deg); color: var(--gold-bright); }

.menu-accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.menu-accordion.open .menu-accordion-panel {
  /* Alto suficiente para caber qualquer seção atual (até ~6 itens em 2
     linhas de grid) sem precisar medir altura via JS. */
  max-height: 420px;
}

.menu-accordion-panel-inner {
  padding: 0 10px 12px;
}

.menu-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  color: var(--text-dim);
  padding: 9px 4px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  transition: border-color .15s ease, color .15s ease;
}
.menu-tile:hover, .menu-tile:active {
  border-color: var(--gold-dim);
  color: var(--text-main);
}

.menu-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  overflow: hidden;
  margin-bottom: 2px;
}

.menu-tile .asset-menu-tile,
.menu-tile-icon .asset-menu {
  width: 48px;
  height: 48px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.menu-tile span:first-child { font-size: 28px; }

.sheet-close {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-weight: 700;
}

/* --------------------------------------------------------------------
   Seleção de classe
   -------------------------------------------------------------------- */
.class-select-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.brand-logo-class {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(155, 107, 216, 0.38));
}

.class-select-title {
  font-family: var(--font-display);
  color: var(--gold-bright);
  text-align: center;
  margin: 4px 0 2px;
}

.class-select-sub {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin: 0 0 14px;
}

.gender-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}

.gender-btn {
  flex: 1;
  max-width: 160px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.gender-btn.active {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(216, 180, 99, 0.18), var(--bg-elevated));
  box-shadow: 0 0 10px rgba(216, 180, 99, 0.2);
}

.class-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.class-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  color: var(--text-main);
}

.class-card .class-icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 72px;
}
.class-card .asset-class-card {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.class-card .class-name { font-family: var(--font-display); font-weight: 700; color: var(--gold-bright); font-size: 15px; }
.class-card .class-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.class-card .class-stats { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* --------------------------------------------------------------------
   Batalha — arena em tempo real (estilo Tibia, visual do Ordem)
   -------------------------------------------------------------------- */
.battle-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #05040c;
  display: flex;
  justify-content: center;
}

.battle-overlay.hidden { display: none; }

/* Vinheta pulsante quando o HP do herói fica crítico */
.battle-overlay.is-low-hp::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  animation: battleLowHpPulse 1.1s ease-in-out infinite;
}

@keyframes battleLowHpPulse {
  0%, 100% { box-shadow: inset 0 0 60px 8px rgba(255, 30, 30, 0.16); }
  50% { box-shadow: inset 0 0 120px 26px rgba(255, 20, 20, 0.42); }
}

.battle-scene {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 0%, rgba(90, 55, 150, 0.28), transparent 55%),
    linear-gradient(180deg, #14101f 0%, #0a0814 55%, #050410 100%);
}

/* HUD compacto */
.battle-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.battle-hud-side { flex: 1; min-width: 0; }
.battle-hud-enemy { text-align: right; }

.battle-hud-name {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-hud-enemy .battle-hud-name { color: #ff8a96; }

.battle-hud-bar { height: 11px; }
.battle-hud-bar .bar-label { top: 0; font-size: 8px; }

.battle-hud-vs {
  font-family: var(--font-display);
  color: var(--gold);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  padding: 0 2px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Barra de cooldown do próximo golpe automático */
.battle-cooldown-track {
  width: 44px;
  height: 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.battle-cooldown-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  transform-origin: left;
}

.battle-cooldown-fill.running {
  animation-name: battleCooldownFill;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes battleCooldownFill {
  from { width: 0%; }
  to { width: 100%; }
}

/* Chão da arena */
.battle-ground {
  position: relative;
  flex: 1;
  min-height: 300px;
  margin-bottom: 10px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(155, 107, 216, 0.22);
  cursor: pointer;
  background:
    radial-gradient(ellipse at 50% 88%, rgba(90, 40, 130, 0.22), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 34px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 34px),
    linear-gradient(180deg, #201a33 0%, #140f22 55%, #0b0815 100%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55);
}

.battle-ground-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(243, 207, 124, 0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.battle-ground-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 70px 12px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  z-index: 4;
}

/* Lutadores: posicionamento livre (left/top em % definidos via JS) */
.battle-fighter {
  position: absolute;
  left: 15%;
  top: 62%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  transition: left 0.12s linear, top 0.12s linear;
}

.battle-fighter-enemy { left: 82%; }
.battle-fighter-enemy {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cg transform='rotate(45 14 14)'%3E%3Crect x='12.6' y='2' width='2.8' height='15' fill='%23f3cf7c'/%3E%3Crect x='8.5' y='16' width='11' height='3' rx='1' fill='%23c9a45c'/%3E%3Crect x='12' y='19' width='4' height='7' rx='1.4' fill='%237a5a2c'/%3E%3C/g%3E%3C/svg%3E") 4 4, crosshair;
}

/* Anel indicando o alcance de ataque em torno do inimigo-alvo. O tamanho real
   (width/height em px) é calculado em JS a partir da largura da arena, para
   que o anel seja sempre um círculo de verdade — não uma oval — independente
   da proporção altura x largura da arena. */
.battle-range-ring {
  position: absolute;
  width: 22%;
  height: 22%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(243, 207, 124, 0.35);
  background: radial-gradient(circle, rgba(255, 80, 80, 0.06), transparent 72%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  transition: opacity 0.25s ease, border-color 0.25s ease;
}

.battle-range-ring.is-in-range {
  border-color: rgba(255, 100, 100, 0.6);
  background: radial-gradient(circle, rgba(255, 60, 60, 0.12), transparent 72%);
}

.battle-range-ring.is-engaged { opacity: 0.18; }

/* Com 2-3 inimigos, cada um tem seu próprio anel: o do alvo selecionado
   fica em dourado (mais visível); os demais ficam num tom neutro e mais
   discreto, mas continuam visíveis — deixando claro que também estão em
   jogo, mesmo sem serem o alvo do momento. */
.battle-range-ring.is-secondary {
  border-color: rgba(160, 170, 210, 0.4);
  background: radial-gradient(circle, rgba(160, 170, 210, 0.05), transparent 72%);
}

.battle-range-ring.is-secondary.is-in-range {
  border-color: rgba(210, 190, 130, 0.55);
  background: radial-gradient(circle, rgba(210, 190, 130, 0.1), transparent 72%);
}

.battle-range-ring.is-secondary.is-engaged { opacity: 0.35; }

/* Alvo selecionado (quando há mais de um inimigo na arena) */
.battle-fighter-enemy.is-target .battle-portrait {
  box-shadow: 0 0 0 3px rgba(255, 210, 110, 0.85), 0 0 18px rgba(255, 190, 90, 0.55);
}

/* Inimigo derrotado dentro de um grupo (a batalha só termina quando todos caem) */
.battle-fighter-enemy.is-dead { opacity: 0.32; filter: grayscale(0.7); pointer-events: none; }
.battle-fighter-enemy.is-dead .battle-hp-overhead { display: none; }

/* Botão de golpe de reação — aparece por um curto tempo durante o combate */
.battle-bonus-btn {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #ffe27a;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f3cf7c 55%, #a9781f 100%);
  color: #2a1a06;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0) scale(0.4);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.battle-bonus-btn:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  animation: battleBonusPulse 0.9s ease-in-out infinite;
}

@keyframes battleBonusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 226, 122, 0.55), 0 4px 14px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 0 0 14px rgba(255, 226, 122, 0), 0 4px 14px rgba(0, 0, 0, 0.5); }
}

/* Ataques visuais por classe — projéteis (mago/arqueiro) e cortes corpo-a-corpo */
.battle-projectile {
  position: absolute;
  transform: translate(-50%, -50%);
  transition-property: left, top;
  transition-timing-function: ease-in;
  pointer-events: none;
  z-index: 6;
}

.battle-projectile-mago {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff2c4, #ff8a3c 55%, transparent 100%);
  box-shadow: 0 0 16px 6px rgba(255, 140, 60, 0.75);
}

.battle-projectile-arqueiro {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #d9c48a 55%, #fff);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.battle-slash {
  position: absolute;
  width: 74px;
  height: 16px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--slash-angle, -35deg)) scaleX(0.2);
  animation: battleSlashAnim 0.28s ease-out forwards;
}

.battle-slash-steel { background: linear-gradient(90deg, transparent, rgba(230, 240, 255, 0.95), transparent); }
.battle-slash-holy { background: linear-gradient(90deg, transparent, rgba(255, 226, 140, 0.95), transparent); box-shadow: 0 0 12px rgba(255, 210, 120, 0.6); }
.battle-slash-rogue { background: linear-gradient(90deg, transparent, rgba(255, 110, 190, 0.95), transparent); }

@keyframes battleSlashAnim {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--slash-angle, -35deg)) scaleX(0.2); }
  35% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--slash-angle, -35deg)) scaleX(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--slash-angle, -35deg) + 18deg)) scaleX(1.15); }
}

.battle-fighter.is-boss .battle-portrait { transform: scale(1.28); }

.battle-hp-overhead {
  position: relative;
  width: 58px;
  height: 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
  margin-bottom: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.battle-hp-overhead-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  transition: width 0.4s ease;
}

.battle-fighter-enemy .battle-hp-overhead-fill {
  background: linear-gradient(90deg, #8a2d3a, #ff8a96);
}

/* Número de vida (ex: "42/80") sobre a barrinha de cada lutador — deixa
   explícito que cada inimigo do grupo tem sua própria vida, independente
   dos demais. Só aparece quando há mais de um inimigo na arena. */
.battle-hp-overhead-label {
  position: absolute;
  left: 50%;
  top: -13px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.battle-hp-overhead-label.is-visible { opacity: 1; }

.battle-fighter-shadow {
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 46px;
  height: 12px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.55), transparent 75%);
  z-index: -1;
}

.battle-portrait {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--bg-elevated), var(--bg-panel));
  border: 2px solid var(--gold-dim);
  font-size: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  animation: battleIdleBob 2.6s ease-in-out infinite;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.battle-enemy-portrait {
  border-color: rgba(224, 58, 74, 0.6);
  background: radial-gradient(circle at 50% 35%, rgba(90, 34, 48, 0.55), rgba(18, 10, 16, 0.92));
  box-shadow: 0 0 22px rgba(224, 58, 74, 0.22), 0 8px 18px rgba(0, 0, 0, 0.45);
  animation-delay: 0.3s;
}

.battle-portrait img.asset-battle,
.battle-portrait img.asset-class,
.battle-portrait img.asset-enemy {
  width: 58px;
  height: 58px;
  max-width: none;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
  transition: transform 0.15s ease;
}

.battle-portrait.facing-left img { transform: scaleX(-1); }

.battle-fighter.is-walking .battle-portrait {
  animation: battleWalk 0.45s ease-in-out infinite;
}

@keyframes battleIdleBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes battleWalk {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-2px) scale(1.04, 0.96); }
}

/* Flash de dano — agora nos dois lados */
.battle-hit-flash {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  background: radial-gradient(circle at 50% 45%, rgba(255, 70, 70, 0.9) 0%, rgba(190, 25, 25, 0.65) 42%, rgba(120, 10, 10, 0.35) 68%, transparent 78%);
  box-shadow: inset 0 0 18px rgba(255, 40, 40, 0.55);
  mix-blend-mode: screen;
}

.battle-hit-flash.active { animation: damageFlash 0.48s ease-out forwards; }
.battle-hit-flash.active-crit { animation: damageFlashCrit 0.62s ease-out forwards; }

@keyframes damageFlash {
  0% { opacity: 0; transform: scale(0.92); }
  12% { opacity: 1; transform: scale(1.06); }
  28% { opacity: 0.55; transform: scale(1); }
  42% { opacity: 0.92; transform: scale(1.03); }
  58% { opacity: 0.35; transform: scale(1); }
  72% { opacity: 0.7; transform: scale(1.01); }
  100% { opacity: 0; transform: scale(1); }
}

@keyframes damageFlashCrit {
  0% { opacity: 0; transform: scale(0.9); filter: brightness(1); }
  10% { opacity: 1; transform: scale(1.1); filter: brightness(1.35); }
  22% { opacity: 0.75; transform: scale(1.04); }
  36% { opacity: 1; transform: scale(1.08); filter: brightness(1.2); }
  52% { opacity: 0.45; transform: scale(1); }
  68% { opacity: 0.85; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1); filter: brightness(1); }
}

.battle-ground.battle-screen-shake { animation: battleScreenShake 0.38s ease; }
.battle-ground.battle-screen-shake-strong { animation: battleScreenShakeStrong 0.48s ease; }

@keyframes battleScreenShake {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-2px, 1px); }
  24% { transform: translate(3px, -2px); }
  36% { transform: translate(-3px, 1px); }
  48% { transform: translate(2px, -1px); }
  60% { transform: translate(-2px, 1px); }
  72% { transform: translate(1px, 0); }
}

@keyframes battleScreenShakeStrong {
  0%, 100% { transform: translate(0, 0); }
  8% { transform: translate(-4px, 2px); }
  16% { transform: translate(5px, -3px); }
  24% { transform: translate(-5px, 2px); }
  32% { transform: translate(4px, -2px); }
  40% { transform: translate(-3px, 2px); }
  48% { transform: translate(3px, -1px); }
  56% { transform: translate(-2px, 1px); }
  64% { transform: translate(2px, -1px); }
  72% { transform: translate(-1px, 1px); }
  80% { transform: translate(1px, 0); }
}

.shake .battle-portrait { animation: shakeAnim 0.35s ease; }
@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px) rotate(-2deg); }
  30% { transform: translateX(9px) rotate(2deg); }
  45% { transform: translateX(-7px) rotate(-1deg); }
  60% { transform: translateX(6px) rotate(1deg); }
  75% { transform: translateX(-3px); }
}

/* Pulso leve de "impacto" no atacante, sem golpe/lunge completo */
.attack-pulse .battle-portrait { animation: attackPulseAnim 0.3s ease; }
@keyframes attackPulseAnim {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.08); filter: brightness(1.25); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Loot no chão (item, ouro e XP — todos exigem clique para coletar) */
.battle-pickups {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.battle-pickup {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 56px;
  height: 56px;
  pointer-events: auto;
}

.battle-pickup-glow {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 207, 124, 0.4), transparent 70%);
  animation: pickupPulse 1.4s ease-in-out infinite;
}

.battle-pickup-gold .battle-pickup-glow { background: radial-gradient(circle, rgba(243, 207, 124, 0.45), transparent 70%); }
.battle-pickup-xp .battle-pickup-glow { background: radial-gradient(circle, rgba(155, 107, 216, 0.45), transparent 70%); }

.battle-pickup-icon {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: radial-gradient(circle at 35% 30%, rgba(243, 207, 124, 0.35), rgba(30, 24, 12, 0.9));
  border: 2px solid var(--gold);
  animation: pickupBob 1.1s ease-in-out infinite;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.battle-pickup-xp .battle-pickup-icon { border-color: var(--purple); }

.battle-pickup-icon img { width: 28px; height: 28px; object-fit: contain; }

.battle-pickup-label {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

@keyframes pickupBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes pickupPulse {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 0.85; transform: scale(1.08); }
}

.battle-pickup-collected {
  animation: pickupCollected 0.4s ease forwards;
  pointer-events: none;
}

@keyframes pickupCollected {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(0.4); }
}

/* Textos/números flutuantes */
.battle-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.battle-fx span {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.fx-damage { color: var(--red); animation: fxPop 0.7s ease forwards; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8); }
.fx-crit { color: var(--gold-bright); font-size: 28px; animation: fxPop 0.8s ease forwards; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85); }
.fx-heal { color: var(--green); animation: fxPop 0.7s ease forwards; }
.fx-miss { color: var(--text-dim); font-size: 15px; animation: fxPop 0.6s ease forwards; }
.fx-bonus { color: #ffe27a; font-size: 22px; font-weight: 800; animation: fxPop 0.8s ease forwards; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 14px rgba(255, 220, 120, 0.8); }

@keyframes fxPop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.7); }
  30% { opacity: 1; transform: translate(-50%, -100%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(1); }
}

/* Dica inicial ("toque no inimigo") */
.battle-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  z-index: 4;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.battle-hint.hidden { opacity: 0; }

.battle-log {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-dim);
  max-height: 52px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.battle-log div { margin-bottom: 2px; }

.battle-actions { display: flex; gap: 8px; }

.btn {
  flex: 1;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
  transition: transform 0.1s ease, opacity 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; }

.btn-attack { background: linear-gradient(180deg, #e3576a, #a3253a); }
.btn-item { background: linear-gradient(180deg, #5aa9e6, #2c6fae); flex: 0.8; }
.btn-flee { background: linear-gradient(180deg, #4a4f6b, #30334a); flex: 0.8; }
.btn-primary { background: linear-gradient(180deg, var(--gold-bright), var(--gold-dim)); color: #201703; }
.btn-secondary { background: var(--bg-elevated); border: 1px solid var(--border-soft); }
.btn-danger { background: linear-gradient(180deg, #e3576a, #7a1f2c); }
.btn-block { width: 100%; margin-top: 8px; }

/* Estalagem — cooldown visual do descanso grátis */
.inn-rest-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.25;
}
.inn-rest-btn.is-cooldown {
  opacity: 1;
  cursor: not-allowed;
  background: linear-gradient(180deg, #3a3f5c, #25283a);
  border: 1px solid rgba(243, 207, 124, 0.35);
  color: var(--text-main);
  padding: 14px 10px 12px;
}
.inn-rest-btn.is-cooldown:disabled { opacity: 1; }
.inn-rest-btn-top {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}
.inn-rest-btn-clock {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  margin: 2px 0;
}
.inn-cooldown-track {
  width: 100%;
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.inn-cooldown-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  transition: width 0.9s linear;
}
.inn-cooldown-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 8px 0 12px;
}
.inn-cooldown-hint b { color: var(--gold-bright); }

.battle-result {
  text-align: center;
  padding: 16px 14px;
  margin-top: 8px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg-panel-alt), var(--bg-panel));
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-deep);
}
.battle-result.hidden { display: none; }
.battle-result h3 { font-family: var(--font-display); font-size: 22px; margin: 4px 0 8px; }
.battle-result .result-win { color: var(--green); }
.battle-result .result-lose { color: var(--red); }
.battle-result .result-flee { color: var(--text-dim); }
.battle-result .reward-line { font-size: 13px; color: var(--gold-bright); margin: 4px 0; }
.battle-result .reward-line .asset-item { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }

/* --------------------------------------------------------------------
   Inventário estilo Minecraft
   -------------------------------------------------------------------- */
.inventory-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr);
  gap: 12px;
  align-items: start;
}

.inventory-bag {
  min-width: 0;
}

.inventory-equip {
  min-width: 0;
}

.inventory-equip-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 8px;
}

.equip-doll {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 0;
}

.equip-slot {
  aspect-ratio: 1;
  min-height: 72px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  position: relative;
  color: var(--text-faint);
  overflow: hidden;
}

.equip-slot.empty-slot {
  border-color: rgba(201, 168, 105, 0.22);
}

.equip-slot.filled {
  border-style: solid;
  border-color: var(--gold-dim);
  color: var(--text-main);
  cursor: grab;
  background: var(--bg-elevated);
}

.equip-silhouette-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 6px 4px 12px;
  pointer-events: none;
}

.equip-silhouette {
  width: 100%;
  max-width: 44px;
  height: auto;
  fill: rgba(201, 168, 105, 0.32);
  opacity: 0.9;
}

.equip-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 26px;
  line-height: 1;
  padding-bottom: 10px;
}

.equip-slot .slot-label { font-size: 9px; position: absolute; bottom: 4px; color: var(--text-faint); }
.equip-slot .slot-upgrade { position: absolute; top: 2px; right: 4px; font-size: 9px; color: var(--gold-bright); font-weight: 700; }
.equip-slot.drop-hover { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(243, 207, 124, 0.4) inset; }

.item-detail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.inv-slot img.asset-inv,
.equip-item-icon img.asset-equip,
.list-icon img.asset-item,
.item-detail-icon img.asset-item-detail {
  width: 100%;
  height: 100%;
  max-width: 40px;
  max-height: 40px;
  object-fit: contain;
}

.item-detail-icon img.asset-item-detail {
  max-width: 72px;
  max-height: 72px;
}

.shop-item-icon img.asset-shop {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(155, 107, 216, 0.2));
}

/* Pets — retratos maiores (companheiros, não ícones de loot) */
.pet-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pet-icon-list {
  width: 64px;
  height: 64px;
}

.pet-icon-shop {
  width: 88px;
  height: 88px;
}

.pet-icon img.asset-pet {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(155, 107, 216, 0.25));
}

.pet-shop-row {
  align-items: center;
  padding: 12px;
}

/* Forja — ícones de equipamento maiores */
.forge-row {
  gap: 12px;
  padding: 12px;
}

.forge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 76px;
  height: 76px;
}

.forge-icon img.asset-forge,
.forge-icon img.asset-item {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(155, 107, 216, 0.2));
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

@media (max-width: 380px) {
  .inventory-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .inventory-equip {
    order: -1;
  }

  .equip-doll {
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
    margin: 0;
  }
}

.inv-slot {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
  color: var(--text-main);
}

.inv-slot.empty { background: rgba(0, 0, 0, 0.15); }
.inv-slot.blocked {
  background: rgba(0, 0, 0, 0.42);
  border-color: rgba(255, 255, 255, 0.04);
  opacity: 0.38;
  pointer-events: none;
  cursor: default;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.55);
}
.inv-slot:not(.empty):not(.blocked) { cursor: grab; }
.inv-slot .qty-badge {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  color: var(--gold-bright);
  text-shadow: 0 1px 2px #000;
}
.inv-slot .rarity-dot { position: absolute; top: 3px; left: 3px; width: 6px; height: 6px; border-radius: 50%; }
.inv-slot.drop-hover, .inv-grid.drop-hover { outline: 2px solid var(--gold-bright); outline-offset: -2px; }

.rarity-comum { background: #8b95b3; }
.rarity-raro { background: #5aa9e6; }
.rarity-epico { background: #9b6bd8; }
.rarity-lendario { background: #f3cf7c; }

/* --------------------------------------------------------------------
   Arrastar e soltar (equipar / desequipar itens)
   -------------------------------------------------------------------- */
.drag-source { opacity: 0.35; }

.drag-ghost {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(30, 24, 50, 0.85);
  border: 2px solid var(--gold-bright);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  transform: scale(1.12);
}
.rarity-mitico { background: #e3576a; }

/* --------------------------------------------------------------------
   Loja
   -------------------------------------------------------------------- */
.shop-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
  padding: 0;
  overflow: visible;
}

.shop-tabs .shop-tab {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 7px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  line-height: 1.2;
}

.shop-tabs .shop-tab.active { background: var(--gold); color: #201703; border-color: var(--gold); }

@media (min-width: 400px) {
  .shop-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Abas genéricas (Ofício, Craft, etc.) — pills em linha */
.shop-tab {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.shop-tab.active { background: var(--gold); color: #201703; border-color: var(--gold); }

/* Hierarquia visual de abas aninhadas (ex.: hub Ofício: hub → estação →
   categoria). Cada nível fica progressivamente menor/mais discreto, para o
   jogador identificar "profundidade" só pelo tamanho, sem precisar ler. */
.tab-level-1 {
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
}
.tab-level-1.active { box-shadow: 0 0 0 2px var(--gold-bright) inset; }

.tab-level-2 {
  font-size: 12px;
  padding: 6px 14px;
  background: var(--bg-panel-alt);
}

.tab-level-3 {
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 14px;
  opacity: 0.85;
}
.tab-level-3.active { opacity: 1; }

.shop-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
}

.shop-item-icon {
  font-size: 32px;
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}
.shop-item-info { flex: 1; min-width: 0; }
.shop-item-name { font-weight: 700; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.shop-stock { font-weight: 600; font-size: 11px; color: var(--text-dim); }
.rarity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.2;
  flex-shrink: 0;
}
.rarity-badge.q-comum    { background: rgba(139,149,179,.18); color: #a8b0c8; border: 1px solid rgba(139,149,179,.45); }
.rarity-badge.q-raro     { background: rgba(90,169,230,.18); color: #5aa9e6; border: 1px solid #5aa9e6; }
.rarity-badge.q-epico    { background: rgba(155,107,216,.18); color: #c399f5; border: 1px solid #9b6bd8; }
.rarity-badge.q-lendario { background: rgba(243,207,124,.15); color: #f3cf7c; border: 1px solid #c8a84b; }
.rarity-badge.q-mitico   { background: rgba(227,87,106,.18); color: #ff8fa0; border: 1px solid #e3576a; }
.shop-item-meta { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.shop-item-craft-hint {
  font-size: 10px;
  color: #c9a86a;
  margin-top: 3px;
  font-weight: 600;
}
.shop-item-craft-only {
  opacity: 0.92;
}
.shop-item-craft-only .shop-item-price {
  color: #c9a86a;
}
.shop-item-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
  margin-bottom: 6px;
}

.shop-buy-btn {
  background: var(--gold);
  color: #201703;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 12px;
}
.shop-buy-btn:disabled { background: var(--text-faint); color: #333; }

/* --------------------------------------------------------------------
   Listas genéricas (quests, ranking, correio, masmorras)
   -------------------------------------------------------------------- */
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.list-row .list-icon { font-size: 22px; width: 36px; text-align: center; flex-shrink: 0; }
.list-row .list-main { flex: 1; min-width: 0; }
.list-row .list-title { font-weight: 700; font-size: 13px; }
.list-row .list-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* Retratos de classe em linhas de lista (ranking, hall dos duelistas) */
.list-icon img.asset-class,
.list-icon img.asset-list,
.list-icon img.asset-enemy {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Ícones de classe no chat da comunidade */
img.asset-chat {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  object-fit: contain;
}

/* Ícones de mapa-mundo (nós de exploração) */
img.asset-world {
  max-width: 40px;
  max-height: 40px;
  object-fit: contain;
}
.list-row .list-progress { font-size: 11px; color: var(--gold); margin-top: 3px; }

.rank-position {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
  width: 26px;
  text-align: center;
}
.rank-position.top1 { color: #ffd76a; }
.rank-position.top2 { color: #d9dbe6; }
.rank-position.top3 { color: #d69a5a; }

.empty-state {
  text-align: center;
  color: var(--text-faint);
  padding: 30px 10px;
  font-size: 13px;
}

/* --------------------------------------------------------------------
   Componentes diversos
   -------------------------------------------------------------------- */
.stat-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--border-soft); }
.stat-row:last-child { border-bottom: none; }
.stat-row span:last-child { color: var(--gold-bright); font-weight: 700; }

/* --------------------------------------------------------------------
   Como Jogar (guia / manual)
   -------------------------------------------------------------------- */
.guide-intro {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.guide-intro-icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}

.guide-intro p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
}

.guide-intro b {
  color: var(--gold-bright);
}

.guide-toc {
  margin-bottom: 12px;
  padding: 12px 14px;
}

.guide-toc-title {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold-bright);
  margin-bottom: 10px;
}

.guide-toc-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guide-toc-link {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 9px;
  text-align: left;
  cursor: pointer;
  line-height: 1.25;
}

.guide-toc-link:hover,
.guide-toc-link:active {
  color: var(--gold-bright);
  border-color: rgba(216, 180, 99, 0.45);
  background: rgba(216, 180, 99, 0.08);
}

.guide-section {
  padding: 0;
  margin-bottom: 8px;
  overflow: hidden;
}

.guide-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: transparent;
  border: none;
  color: inherit;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
}

.guide-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold-bright);
  margin: 0;
  letter-spacing: 0.02em;
  flex: 1;
}

.guide-section-chevron {
  color: var(--text-faint);
  font-size: 14px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.guide-section.open .guide-section-chevron {
  transform: rotate(180deg);
  color: var(--gold);
}

.guide-section-body {
  display: none;
  padding: 0 14px 14px;
}

.guide-section.open .guide-section-body {
  display: block;
}

.guide-section-lead {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
}

.guide-list {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
}

.guide-list li {
  margin-bottom: 8px;
}

.guide-list li:last-child {
  margin-bottom: 0;
}

.guide-list b {
  color: var(--text-main);
  font-weight: 600;
}

.guide-list .help-node-img {
  width: 18px;
  height: 18px;
  vertical-align: -4px;
  margin-right: 2px;
  display: inline-block;
  object-fit: contain;
}

.guide-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  margin: 10px 0 8px;
  padding: 12px;
}

.guide-footer b {
  color: var(--gold);
}

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

.chat-messages { max-height: 340px; overflow-y: auto; margin-bottom: 10px; }
.chat-msg { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12px; }
.chat-msg .chat-author { font-weight: 700; color: var(--gold); margin-right: 6px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row input {
  flex: 1; background: var(--bg-elevated); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 10px; color: var(--text-main); font-size: 13px;
}

.form-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  color: var(--text-main);
  font-size: 14px;
  margin-bottom: 10px;
}

.toast-container {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 270;
  width: 90%;
  max-width: 460px;
  align-items: center;
}

.toast {
  background: rgba(20, 16, 38, 0.95);
  border: 1px solid var(--gold-dim);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-deep);
  animation: toastIn 0.25s ease, toastOut 0.3s ease 2.4s forwards;
}

.toast.error { border-color: var(--red); }
.toast.success { border-color: var(--green); }

/* --------------------------------------------------------------------
   Profissões de Coleta
   -------------------------------------------------------------------- */
.professions-panel .view-subtitle { margin-bottom: 14px; }

.professions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profession-card {
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.profession-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.profession-icon {
  font-size: 38px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
}

.profession-meta { flex: 1; min-width: 0; }

.profession-name {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--gold-bright);
}

.profession-level {
  font-size: 12px;
  color: var(--text-dim);
}

.profession-bonus {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.profession-xp-bar {
  position: relative;
  height: 16px;
}

.profession-xp-bar .bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-main);
  pointer-events: none;
}

.professions-hint {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.45;
}

.tools-panel {
  margin-bottom: 8px;
}

.tool-equipped-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}

.tool-equipped-card.tool-broken {
  border-color: rgba(220, 80, 80, 0.45);
}

.tool-equipped-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.tool-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tool-icon img.asset-tool,
.tool-icon img.asset-item {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.tool-name {
  font-weight: 700;
  color: var(--gold-bright);
  font-family: var(--font-display);
}

.tool-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.tool-durability-bar {
  position: relative;
  height: 16px;
  margin-bottom: 10px;
}

.tool-durability-bar .bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}

.tool-ok-hint {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

.tool-bag-row {
  margin-bottom: 6px;
}

.equip-slot-tool,
.equip-slot-bag {
  /* Mesma linha: Ferramenta | Alforje */
  max-width: none;
  margin: 0;
}

.inv-bag-bonus {
  font-size: 11px;
  color: var(--gold-bright);
  text-align: center;
  margin: 0 0 8px;
  padding: 4px 8px;
  background: rgba(155, 107, 216, 0.12);
  border: 1px solid rgba(155, 107, 216, 0.25);
  border-radius: var(--radius-sm);
}

.refine-slots-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
#btnBuyRefineSlot {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.2;
}

.refine-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.refine-queue-empty {
  font-size: 12px;
  color: var(--text-faint);
  padding: 6px 0;
}

.refine-job {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.refine-job.ready {
  border-color: rgba(80, 180, 100, 0.5);
}

.refine-job-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}

.refine-job-icon img,
.refine-job-icon .asset-item {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
}

.refine-job-info {
  flex: 1;
  min-width: 0;
}

.refine-job-name {
  font-weight: 600;
  color: var(--text-main);
}

.refine-job-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.refine-job-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.refine-job-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #c084fc, #a855f7);
  border-radius: 2px;
  transition: width 0.9s linear;
}

.refine-ready-label {
  color: #6dce7a;
  font-weight: 700;
}

.refine-countdown {
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
}

.craft-card.craft-locked {
  opacity: 0.78;
  border-style: dashed;
}

.craft-locked-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin: 6px 0 4px;
  line-height: 1.4;
}

.market-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.market-search-full { width: 100%; }

.market-filters-row2 .market-select { flex: 1; min-width: 0; }

.market-search {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  font-size: 13px;
}

.market-select {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  font-size: 12px;
}

.market-slots-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.market-tip {
  font-size: 12px;
  color: var(--text-faint);
  margin: 0 0 10px;
  line-height: 1.4;
}

.market-order-form {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.market-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.market-row-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.market-row-info {
  flex: 1;
  min-width: 0;
}

.market-row-name {
  font-weight: 600;
  color: var(--text-main);
}

.market-row-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.market-row-actions {
  text-align: right;
  flex-shrink: 0;
}

.market-price {
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 4px;
  font-size: 13px;
}

.market-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.enchant-section-title {
  font-weight: 700;
  color: var(--gold-bright);
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.enchant-set-row {
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  color: var(--text-dim);
}

.enchant-set-row.active {
  border-color: rgba(80, 180, 100, 0.45);
  color: var(--text-main);
}

.enchant-set-bonus {
  color: #6dce7a;
  font-size: 12px;
}

.enchant-set-hint {
  font-size: 11px;
  color: var(--text-faint);
}

.enchant-item-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.enchant-item-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.enchant-item-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.enchant-item-name {
  font-weight: 600;
}

.enchant-item-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.enchant-sockets {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.enchant-socket {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-soft);
}

.enchant-socket.filled {
  border-style: solid;
  border-color: rgba(155, 107, 216, 0.45);
}

.enchant-socket-empty {
  font-size: 12px;
  color: var(--text-faint);
}

.enchant-socket-rune {
  font-size: 13px;
  flex: 1;
}

.enchant-rune-select {
  flex: 1;
  min-width: 120px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-main);
  font-size: 12px;
}

/* --------------------------------------------------------------------
   Ofício / Oficina (craft)
   -------------------------------------------------------------------- */
.oficio-tabs,
.craft-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}

.oficio-tab-body { min-height: 120px; }

.craft-card {
  background: var(--bg-panel-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 6px;
}

.craft-card.rarity-raro { border-color: rgba(90, 169, 230, 0.45); }
.craft-card.rarity-epico { border-color: rgba(155, 107, 216, 0.5); }

.craft-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.craft-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.craft-card-icon .asset-item { width: 40px; height: 40px; object-fit: contain; }

.craft-card-info { flex: 1; min-width: 0; }

.craft-card-name {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold-bright);
}

.craft-card-meta {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.craft-card-meta-collapsed {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.craft-card-expand-hint {
  color: var(--gold-dim);
}

.craft-card[data-card-toggle] { cursor: pointer; }

.craft-card-details {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
}

.craft-card-details.hidden { display: none; }

.craft-card-open .craft-card-cost { color: var(--gold-bright); }

.craft-card-cost {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.craft-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.craft-ing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

.craft-ing .asset-ing { width: 16px; height: 16px; object-fit: contain; }

.craft-ing.ing-ok { color: var(--green); }
.craft-ing.ing-missing { color: var(--red); }

.craft-card-actions { display: flex; justify-content: flex-end; }

.craft-btn { flex: 0 0 auto; padding: 8px 16px; }

@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 4px; }

/* --------------------------------------------------------------------
   Responsividade — telefones muito estreitos (ex.: iPhone SE, ~360px).
   Convenção do projeto: breakpoint único em 360px para os componentes de
   navegação/filtro mais densos, evitando que pills/tiles fiquem menores
   que uma área de toque confortável (~40px).
   -------------------------------------------------------------------- */
@media (max-width: 360px) {
  /* Menu da Home/overlay: 4 → 3 colunas, dá mais respiro ao label de texto. */
  .more-menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Abas do Ofício e do Mercado: rolagem horizontal em vez de quebrar em
     3-4 linhas, que empurra o conteúdo principal para baixo da dobra. */
  .oficio-tabs,
  .craft-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .oficio-tabs .shop-tab,
  .craft-tabs .shop-tab {
    flex-shrink: 0;
  }

  /* Mercado: busca e filtros empilham em vez de disputar espaço lado a lado. */
  .market-filters-row2 {
    flex-direction: column;
    align-items: stretch;
  }
  .market-filters-row2 .market-select {
    width: 100%;
  }
}

/* =============================================================
   PARTE 1 — Timing Ring + Combo Bar
   ============================================================= */

/* ---- Timing Ring ------------------------------------------ */
.battle-timing-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90px;
  height: 90px;
  transform: translate(-50%, -50%);
  z-index: 25;
  pointer-events: auto;
  cursor: pointer;
}

.battle-timing-ring.hidden { display: none; }

/* Anel externo — encolhe animado via JS (transform scale) */
.timing-ring-outer {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 220, 60, 0.7);
  box-shadow: 0 0 14px 4px rgba(255, 220, 60, 0.35);
  transition: transform 0.05s linear, border-color 0.15s;
}

/* Zona perfeita — anel fixo central que representa o alvo */
.timing-ring-zone {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(80, 255, 140, 0.9);
  box-shadow: 0 0 12px 3px rgba(80, 255, 140, 0.45);
  opacity: 0;
  transition: opacity 0.1s ease;
}

.battle-timing-ring.zone-visible .timing-ring-zone {
  opacity: 1;
  animation: timingZonePulse 0.3s ease-in-out infinite alternate;
}

@keyframes timingZonePulse {
  from { box-shadow: 0 0 12px 3px rgba(80, 255, 140, 0.45); }
  to   { box-shadow: 0 0 20px 7px rgba(80, 255, 140, 0.65); }
}

/* Ponto central */
.timing-ring-inner {
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

/* Feedback após click */
.battle-timing-ring.timing-perfect .timing-ring-outer {
  border-color: #50ff8c;
  box-shadow: 0 0 28px 10px rgba(80, 255, 140, 0.8);
}
.battle-timing-ring.timing-good .timing-ring-outer {
  border-color: #ffe256;
  box-shadow: 0 0 22px 8px rgba(255, 226, 86, 0.7);
}
.battle-timing-ring.timing-miss .timing-ring-outer {
  border-color: rgba(200, 200, 200, 0.4);
  box-shadow: none;
}

/* ---- Combo Bar -------------------------------------------- */
.battle-combo-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  margin-top: 3px;
  overflow: visible;
}

.battle-combo-bar.hidden { display: none; }

.combo-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #f7c94e, #ff7c2a);
  transition: width 0.25s ease, background 0.3s ease;
}

.battle-combo-bar[data-tier="3"] .combo-fill { background: linear-gradient(90deg, #60e070, #20c040); }
.battle-combo-bar[data-tier="2"] .combo-fill { background: linear-gradient(90deg, #60c0ff, #3060ff); }
.battle-combo-bar[data-tier="1"] .combo-fill { background: linear-gradient(90deg, #f7c94e, #ff7c2a); }

.combo-label {
  position: absolute;
  right: 0;
  top: -14px;
  font-size: 10px;
  font-weight: 700;
  color: #ffe26a;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  transition: color 0.2s;
}

.battle-combo-bar[data-tier="3"] .combo-label { color: #50ff8c; }
.battle-combo-bar[data-tier="2"] .combo-label { color: #80c8ff; }

/* Animação ao quebrar combo */
@keyframes comboBreak {
  0%   { transform: scale(1); opacity: 1; }
  40%  { transform: scale(1.3); opacity: 0.7; }
  100% { transform: scale(0.8); opacity: 0; }
}

.battle-combo-bar.combo-breaking {
  animation: comboBreak 0.4s ease-out forwards;
}

/* Animação ao ganhar timing bonus */
.timing-popup {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  z-index: 30;
  animation: timingPopup 0.8s ease-out forwards;
  white-space: nowrap;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}

.timing-popup.perfect { color: #50ff8c; }
.timing-popup.good    { color: #ffe256; }

@keyframes timingPopup {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  60%  { opacity: 1; transform: translateX(-50%) translateY(-18px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px); }
}

/* Animação do anel externo — classe adicionada por JS ao mostrar o anel */
.timing-ring-outer.shrinking {
  animation: timingRingShrink var(--timing-dur, 850ms) linear forwards;
}

@keyframes timingRingShrink {
  from { transform: scale(2.4); opacity: 0.85; }
  to   { transform: scale(0.12); opacity: 0.15; }
}

/* =============================================================
   PARTE 2 — Telegraph + Dodge + Orbs + Comportamentos
   ============================================================= */

/* ---- Botão de Esquiva ------------------------------------ */
.battle-dodge-btn {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%) scale(0.5);
  padding: 10px 28px;
  border-radius: 28px;
  border: 2.5px solid #80cfff;
  background: linear-gradient(135deg, #1a3a5c 0%, #0d1f3a 100%);
  color: #9ee8ff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  z-index: 28;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  box-shadow: 0 0 18px 4px rgba(100, 200, 255, 0.35), 0 4px 12px rgba(0,0,0,0.5);
}

.battle-dodge-btn:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
  animation: dodgePulse 0.7s ease-in-out infinite alternate;
}

@keyframes dodgePulse {
  from { box-shadow: 0 0 14px 3px rgba(100,200,255,0.35), 0 4px 12px rgba(0,0,0,0.5); }
  to   { box-shadow: 0 0 28px 10px rgba(100,200,255,0.65), 0 4px 12px rgba(0,0,0,0.5); }
}

.battle-dodge-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
  pointer-events: none;
}

/* ---- Telegraph Warning ----------------------------------- */
.battle-telegraph {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 26;
  pointer-events: none;
  min-width: 160px;
}

.battle-telegraph.hidden { display: none; }

.telegraph-icon {
  font-size: 26px;
  animation: telegraphIconPulse 0.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(255, 80, 60, 0.9));
}

@keyframes telegraphIconPulse {
  from { transform: scale(1);    opacity: 0.9; }
  to   { transform: scale(1.18); opacity: 1;   }
}

.telegraph-bar-track {
  width: 140px;
  height: 7px;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  overflow: hidden;
}

.telegraph-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff5c3a, #ffb830);
  border-radius: 4px;
  transition: none;
  transform-origin: left;
}

.telegraph-bar-fill.draining {
  animation: telegraphDrain var(--telegraph-dur, 1500ms) linear forwards;
}

@keyframes telegraphDrain {
  from { transform: scaleX(1);   opacity: 1; }
  to   { transform: scaleX(0);   opacity: 0.6; }
}

.telegraph-label {
  font-size: 11px;
  font-weight: 800;
  color: #ffa060;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  text-transform: uppercase;
}

/* ---- Contador de Ondas (Arena) --------------------------- */
.battle-wave-counter {
  font-size: .68rem;
  font-weight: 800;
  color: #ffe066;
  letter-spacing: .08em;
  text-shadow: 0 0 6px rgba(255,200,0,.6);
  margin-bottom: 2px;
  text-align: center;
}
.battle-wave-counter.hidden { display: none; }

/* ---- Overlay de Transição de Onda ------------------------ */
.battle-wave-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.72);
  z-index: 80;
  border-radius: inherit;
  animation: waveOverlayIn .35s ease-out;
}
.battle-wave-overlay.hidden { display: none; }
.wave-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  animation: waveTextPop .4s cubic-bezier(.2,1.4,.4,1) both;
}
.wave-overlay-label {
  font-size: 2.4rem;
  font-weight: 900;
  color: #ffe066;
  letter-spacing: .1em;
  text-shadow: 0 0 24px rgba(255,180,0,.8), 0 2px 4px rgba(0,0,0,.6);
}
.wave-overlay-sub {
  font-size: .9rem;
  color: #fff;
  opacity: .85;
  font-weight: 600;
}
@keyframes waveOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes waveTextPop {
  0%   { transform: scale(.5); opacity: 0; }
  70%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---- Ícones de Status de Efeito ---- */
.battle-status-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 2px 0 3px;
  min-height: 0;
}
.status-icon {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  line-height: 1.4;
  white-space: nowrap;
}
.status-icon.si-poison      { background: rgba(80,200,40,.18); border: 1px solid rgba(80,200,40,.5); color: #80e050; }
.status-icon.si-burn        { background: rgba(255,100,20,.18); border: 1px solid rgba(255,120,40,.5); color: #ff9060; }
.status-icon.si-regen       { background: rgba(40,200,120,.18); border: 1px solid rgba(40,200,120,.5); color: #50e090; }
.status-icon.si-stun        { background: rgba(255,220,40,.18); border: 1px solid rgba(255,220,40,.5); color: #ffe040; }
.status-icon.si-orb_fury    { background: rgba(255,80,40,.18); border: 1px solid rgba(255,80,40,.5); color: #ff8060; }
.status-icon.si-orb_protection { background: rgba(60,120,255,.18); border: 1px solid rgba(60,120,255,.5); color: #80a0ff; }
.status-icon.si-orb_energy  { background: rgba(200,160,255,.18); border: 1px solid rgba(180,120,255,.5); color: #d0a0ff; }
.status-icon.si-vanish      { background: rgba(40,20,80,.50); border: 1px solid rgba(120,60,200,.6); color: #c090ff; }

/* ---- Habilidade Especial de Classe ----------------------- */
.battle-ability-btn {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 2px solid #a060ff;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(80,20,140,.90), rgba(40,10,80,.95));
  color: #e0c0ff;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 0 12px rgba(160,80,255,.45);
  transition: transform .12s, box-shadow .12s, opacity .2s;
  white-space: nowrap;
}
.battle-ability-btn.hidden { display: none; }
.battle-ability-btn:hover:not(:disabled) {
  transform: translateX(-50%) scale(1.06);
  box-shadow: 0 0 20px rgba(160,80,255,.75);
}
.battle-ability-btn:disabled,
.battle-ability-btn.on-cooldown {
  opacity: .55;
  cursor: not-allowed;
  border-color: #604090;
  box-shadow: none;
}
.battle-ability-btn .ability-icon { font-size: 1.1rem; }
.battle-ability-btn .ability-name { font-size: .78rem; }
.battle-ability-btn .ability-cooldown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: rgba(0,0,0,.5);
  color: #ffcc44;
  font-size: .7rem;
  font-weight: 800;
  padding: 0 4px;
}
.battle-ability-btn .ability-cooldown-badge.hidden { display: none; }

@keyframes abilityReady {
  0%,100% { box-shadow: 0 0 12px rgba(160,80,255,.45); }
  50%      { box-shadow: 0 0 28px rgba(200,100,255,.90); }
}
.battle-ability-btn.ability-ready { animation: abilityReady 1.4s ease-in-out infinite; }

/* Popup de habilidade usada */
.ability-popup {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  background: rgba(80,20,140,.92);
  color: #e0c0ff;
  border: 1.5px solid #c090ff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .78rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 60;
  animation: abilityPopupAnim .9s forwards;
}
@keyframes abilityPopupAnim {
  0%  { opacity:1; transform: translateX(-50%) translateY(0); }
  70% { opacity:1; transform: translateX(-50%) translateY(-18px); }
  100%{ opacity:0; transform: translateX(-50%) translateY(-26px); }
}

/* ---- Fraqueza / Resistência ------------------------------ */
.battle-weakness-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0 4px;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: .03em;
}
.battle-weakness-badge.hidden { display: none; }
.battle-weakness-badge.badge-weak {
  background: rgba(255,60,40,.18);
  border: 1px solid rgba(255,80,60,.55);
  color: #ff9080;
}
.battle-weakness-badge.badge-resist {
  background: rgba(60,100,200,.18);
  border: 1px solid rgba(80,130,220,.55);
  color: #88aaff;
}

/* ---- Orbs de Buff ---------------------------------------- */
.battle-orb {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  transform: translate(-50%, -50%);
  z-index: 15;
  animation: orbFloat 2s ease-in-out infinite alternate, orbAppear 0.3s ease-out forwards;
  box-shadow: 0 0 12px 4px var(--orb-glow, rgba(255,255,255,0.4));
  pointer-events: auto;
}

@keyframes orbAppear {
  from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes orbFloat {
  from { margin-top: 0; }
  to   { margin-top: -6px; }
}

.battle-orb.orb-fury       { background: radial-gradient(circle, #ff8040, #c82000); --orb-glow: rgba(255,80,40,0.5); }
.battle-orb.orb-protection { background: radial-gradient(circle, #60aaff, #1040a0); --orb-glow: rgba(80,160,255,0.5); }
.battle-orb.orb-life       { background: radial-gradient(circle, #60ff90, #008040); --orb-glow: rgba(60,220,100,0.5); }
.battle-orb.orb-energy     { background: radial-gradient(circle, #ffec40, #e09000); --orb-glow: rgba(255,220,40,0.5); }

.battle-orb.orb-collected {
  animation: orbCollect 0.35s ease-out forwards;
  pointer-events: none;
}

@keyframes orbCollect {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(1.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(0.1); opacity: 0; }
}

/* --------------------------------------------------------------------
   Craft em Fases com Qualidade — Mini-game overlay
   -------------------------------------------------------------------- */
.craft-minigame-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 900;
  gap: 18px;
  padding: 20px;
}

.craft-minigame-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.craft-minigame-phases {
  display: flex;
  gap: 28px;
  align-items: center;
}

.craft-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: .35;
  transition: opacity .25s;
}
.craft-phase.active  { opacity: 1; }
.craft-phase.done    { opacity: .7; }
.craft-phase.hit     { opacity: 1; }

.craft-phase-label {
  font-size: .7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* The pulsing ring */
.craft-phase-ring {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
  border: 2px solid rgba(255,255,255,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s;
}
.craft-phase.active .craft-phase-ring {
  border-color: rgba(255,255,255,.5);
}

/* The shrinking hit-zone circle */
.craft-phase-zone {
  position: absolute;
  border-radius: 50%;
  border: 3px solid var(--gold-bright);
  width: 68px;
  height: 68px;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(1);
  opacity: 0;
  pointer-events: none;
}
.craft-phase.active .craft-phase-zone {
  animation: craftZonePulse 1.8s ease-in-out infinite;
}

@keyframes craftZonePulse {
  0%   { width:68px; height:68px; opacity:.15; }
  50%  { width:28px; height:28px; opacity:1;   }
  100% { width:68px; height:68px; opacity:.15; }
}

.craft-phase-icon {
  font-size: 1.6rem;
  line-height: 1;
  z-index: 1;
}

/* Hit & miss visual feedback */
.craft-phase.hit  .craft-phase-ring  { border-color: #4cde80; background: rgba(76,222,128,.12); }
.craft-phase.miss .craft-phase-ring  { border-color: #e05555; background: rgba(224,85,85,.08); }
.craft-phase.hit  .craft-phase-icon::after  { content: ' ✓'; font-size:.9rem; color:#4cde80; }
.craft-phase.miss .craft-phase-icon::after  { content: ' ✗'; font-size:.9rem; color:#e05555; }

/* Instruction hint */
.craft-minigame-hint {
  font-size: .85rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 260px;
  line-height: 1.5;
}

/* Result reveal */
.craft-quality-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: craftReveal .5s cubic-bezier(.17,.67,.3,1.3) both;
}

@keyframes craftReveal {
  from { opacity:0; transform: scale(.6); }
  to   { opacity:1; transform: scale(1); }
}

.craft-quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.craft-quality-badge.q-comum    { background:#444; color:#b0b8cc; }
.craft-quality-badge.q-raro     { background:rgba(90,169,230,.2); color:#5aa9e6; border:1px solid #5aa9e6; }
.craft-quality-badge.q-epico    { background:rgba(155,107,216,.2); color:#c399f5; border:1px solid #9b6bd8; }
.craft-quality-badge.q-lendario { background:rgba(243,207,124,.15); color:#f3cf7c; border:1px solid #c8a84b; }
.craft-quality-badge.q-mitico   { background:rgba(227,87,106,.18); color:#ff8fa0; border:1px solid #e3576a;
                                   box-shadow: 0 0 14px rgba(227,87,106,.45); }

.craft-quality-reveal-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Inventory quality glow on equipped/hovered items */
.inv-slot[data-quality="raro"]     { box-shadow: inset 0 0 0 2px rgba(90,169,230,.55); }
.inv-slot[data-quality="epico"]    { box-shadow: inset 0 0 0 2px rgba(155,107,216,.6); }
.inv-slot[data-quality="lendario"] { box-shadow: inset 0 0 0 2px rgba(243,207,124,.65); }
.inv-slot[data-quality="mitico"]   { box-shadow: inset 0 0 0 2px rgba(227,87,106,.7);
                                     animation: miticoPulse 2s ease-in-out infinite; }

@keyframes miticoPulse {
  0%,100% { box-shadow: inset 0 0 0 2px rgba(227,87,106,.7); }
  50%     { box-shadow: inset 0 0 0 3px rgba(227,87,106,1), 0 0 8px rgba(227,87,106,.4); }
}

/* Quality dot on craft card */
.craft-card-quality-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.craft-card-quality-dot.q-raro     { background:#5aa9e6; }
.craft-card-quality-dot.q-epico    { background:#9b6bd8; }
.craft-card-quality-dot.q-lendario { background:#f3cf7c; }
.craft-card-quality-dot.q-mitico   { background:#e3576a; }

/* --------------------------------------------------------------------
   Parte 5 — Combo Finisher
   -------------------------------------------------------------------- */

/* Combo bar: highlight when at MAX (finisher ready) */
.battle-combo-bar[data-tier="3"].finisher-ready .combo-fill {
  background: linear-gradient(90deg, #ff4fc4, #ff9500, #ffed00);
  background-size: 200% 100%;
  animation: finisherReadyShimmer 0.8s linear infinite;
}
.battle-combo-bar[data-tier="3"].finisher-ready .combo-label {
  color: #ffed00;
  text-shadow: 0 0 8px rgba(255,200,0,.8);
  animation: finisherLabelPulse 0.6s ease-in-out infinite alternate;
}

@keyframes finisherReadyShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes finisherLabelPulse {
  from { transform: translateY(-50%) scale(1);   opacity: 1; }
  to   { transform: translateY(-50%) scale(1.12); opacity: 0.85; }
}

/* Full-screen flash overlay */
.finisher-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 800;
  background: radial-gradient(ellipse at center, rgba(255,200,0,.55) 0%, rgba(255,80,0,.3) 50%, transparent 75%);
  animation: finisherFlash 0.55s ease-out forwards;
}
@keyframes finisherFlash {
  0%   { opacity: 1; transform: scale(0.8); }
  40%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* FINISHER! text banner */
.finisher-banner {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  z-index: 810;
  pointer-events: none;
  font-family: var(--font-display, serif);
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 0 12px #ff9500,
    0 0 28px #ffed00,
    0 2px 0 #c05000;
  white-space: nowrap;
  animation: finisherBannerPop 0.9s cubic-bezier(.17,.67,.3,1.4) forwards;
}
@keyframes finisherBannerPop {
  0%   { opacity:0; transform: translate(-50%,-50%) scale(0.4) rotate(-6deg); }
  35%  { opacity:1; transform: translate(-50%,-50%) scale(1.15) rotate(2deg); }
  60%  { transform: translate(-50%,-50%) scale(0.95) rotate(0deg); }
  75%  { opacity:1; transform: translate(-50%,-50%) scale(1.02); }
  100% { opacity:0; transform: translate(-50%,-50%) scale(1) translateY(-30px); }
}

/* Particle sparks ring around enemy */
.finisher-spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  animation: finisherSpark 0.6s ease-out forwards;
}
@keyframes finisherSpark {
  0%   { opacity:1; transform: translate(0,0) scale(1); }
  100% { opacity:0; transform: translate(var(--dx), var(--dy)) scale(0.2); }
}

/* ==========================================================
   Parte 6 — Missão Dinâmica de Batalha
   ========================================================== */

.battle-mission {
  margin: 4px 8px 0;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(20,20,40,.85) 0%, rgba(30,20,60,.9) 100%);
  border: 1px solid rgba(150,120,255,.35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: #d4c8ff;
  backdrop-filter: blur(4px);
  transition: border-color .3s;
}
.battle-mission.mission-done {
  border-color: rgba(100,255,140,.7);
  background: linear-gradient(135deg, rgba(10,40,20,.9) 0%, rgba(20,60,30,.9) 100%);
  color: #a8ffb8;
}
.mission-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  flex-wrap: wrap;
}
.mission-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.mission-progress-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mission-progress-track {
  width: 60px;
  height: 5px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  overflow: hidden;
}
.mission-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #9f7fff, #e5c8ff);
  border-radius: 3px;
  transition: width .3s ease;
  width: 0%;
}
.mission-progress-text {
  font-size: .65rem;
  color: #c8b8ff;
  min-width: 22px;
}
.mission-reward {
  font-size: .7rem;
  color: #ffd77a;
  white-space: nowrap;
  opacity: .85;
}
.mission-complete-flash {
  animation: missionFlash .5s ease-out forwards;
}
@keyframes missionFlash {
  0%   { background: rgba(80,255,120,.25); }
  100% { background: transparent; }
}

/* Victory stars */
.battle-stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  font-size: 1.8rem;
  margin: 8px 0;
  animation: starsAppear .5s ease-out backwards;
}
.battle-star {
  filter: grayscale(1) opacity(.35);
  transition: filter .3s, transform .3s;
}
.battle-star.lit {
  filter: grayscale(0) drop-shadow(0 0 6px #ffd000);
  transform: scale(1.15);
}
@keyframes starsAppear {
  from { opacity:0; transform: translateY(8px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ==========================================================
   Parte 7 — Mini-Boss (Elite badge)
   ========================================================== */

.enemy-elite-badge {
  display: inline-block;
  background: linear-gradient(90deg, #b44000, #ff6a00, #ffd000);
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 4px;
  vertical-align: middle;
  animation: elitePulse 1.8s ease-in-out infinite alternate;
}
@keyframes elitePulse {
  from { box-shadow: 0 0 4px rgba(255,106,0,.5); }
  to   { box-shadow: 0 0 10px rgba(255,106,0,.9), 0 0 20px rgba(255,200,0,.4); }
}

/* ==========================================================
   Parte 8 — Indicador Dia/Noite
   ========================================================== */

.battle-day-period {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: .65rem;
  color: rgba(255,255,255,.65);
  background: rgba(0,0,0,.4);
  padding: 2px 6px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 5;
}
.battle-day-period.period-night { color: #c8aaff; }
.battle-day-period.period-dusk  { color: #ffbf7a; }
.battle-day-period.period-dawn  { color: #a8d8ff; }

/* Night mode: subtle tint on the battle scene */
.battle-overlay.period-night .battle-ground {
  filter: brightness(.88) saturate(.8) hue-rotate(210deg);
}
.battle-overlay.period-night .battle-ground-glow {
  background: radial-gradient(ellipse 50% 30% at 50% 100%, rgba(80,60,160,.35) 0%, transparent 70%);
}

/* ==========================================================
   Descobertas (explore toast)
   ========================================================== */

.discovery-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #1a1040, #2a1860);
  border: 1px solid rgba(160,120,255,.6);
  border-radius: 10px;
  padding: 10px 18px;
  color: #e8d8ff;
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  animation: discoveryPop .4s ease-out .05s forwards, discoveryFade .4s ease-in 2.6s forwards;
  box-shadow: 0 4px 20px rgba(120,80,255,.4);
}
.discovery-detail {
  display: block;
  font-size: .75rem;
  font-weight: 400;
  color: #c8b4f0;
  margin-top: 2px;
}
@keyframes discoveryPop {
  from { opacity:0; transform: translateX(-50%) translateY(20px) scale(.9); }
  to   { opacity:1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes discoveryFade {
  from { opacity:1; }
  to   { opacity:0; transform: translateX(-50%) translateY(-10px); }
}

/* ==========================================================
   Parte 9 — Árvore de Progressão de Classe
   ========================================================== */

/* Sheet overlay */
.tree-sheet {
  background: linear-gradient(160deg, #0d0f1e 0%, #111428 100%);
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: min(92vh, calc(100dvh - 16px - env(safe-area-inset-bottom)));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}
.tree-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  background: rgba(13,15,30,.95);
  backdrop-filter: blur(6px);
  z-index: 2;
}
.tree-sheet-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e8d8ff;
  letter-spacing: .02em;
}
.tree-close-btn {
  background: none;
  border: none;
  color: #a088cc;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.tree-sheet-body {
  padding: 12px 14px 24px;
}
.tree-loading {
  text-align: center;
  color: #6656aa;
  padding: 40px 0;
}

/* Class badge */
.tree-class-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.tree-class-icon {
  font-size: 2rem;
  line-height: 1;
}
.tree-class-info {
  flex: 1;
}
.tree-class-name {
  font-weight: 700;
  font-size: .95rem;
  color: #e8d4ff;
}
.tree-class-level {
  font-size: .75rem;
  color: #8878b8;
}

/* Bonus summary bar */
.tree-bonus-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}
.tree-bonus-chip {
  background: rgba(130,100,255,.2);
  border: 1px solid rgba(130,100,255,.35);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: .72rem;
  color: #d4c4ff;
  white-space: nowrap;
}

/* Timeline */
.tree-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
.tree-timeline::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(130,100,255,.2);
  z-index: 0;
}

/* Milestone row */
.tree-milestone {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  position: relative;
  z-index: 1;
}
.tree-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  border: 2px solid transparent;
  background: #161830;
  transition: all .3s;
}
.tree-milestone.state-locked   .tree-dot { border-color: rgba(80,70,130,.5); color: #40384c; }
.tree-milestone.state-pending  .tree-dot { border-color: #9f7fff; color: #9f7fff; background: rgba(120,90,255,.2); animation: treeDotPulse 1.4s ease-in-out infinite; }
.tree-milestone.state-chosen   .tree-dot { border-color: #7fff9f; color: #7fff9f; background: rgba(80,200,100,.15); }

@keyframes treeDotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(120,90,255,.6); }
  50%       { box-shadow: 0 0 0 6px rgba(120,90,255,0); }
}

.tree-milestone-level {
  font-size: .65rem;
  font-weight: 700;
  color: #6656aa;
  margin-top: 0;
  white-space: nowrap;
  min-width: 36px;
  padding-top: 3px;
}
.tree-milestone-content {
  flex: 1;
}

/* Pending: 3 choice cards */
.tree-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.tree-choice-card {
  background: linear-gradient(135deg, rgba(30,20,60,.9), rgba(40,30,80,.9));
  border: 1px solid rgba(130,100,255,.4);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tree-choice-card:hover, .tree-choice-card:focus {
  border-color: rgba(180,140,255,.8);
  box-shadow: 0 0 12px rgba(130,100,255,.4);
  transform: translateX(3px);
}
.tree-choice-card.selected {
  border-color: #9f7fff;
  background: linear-gradient(135deg, rgba(90,60,200,.4), rgba(60,40,150,.4));
  box-shadow: 0 0 16px rgba(130,100,255,.5);
}
.tree-choice-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}
.tree-choice-body {
  flex: 1;
}
.tree-choice-label {
  font-size: .85rem;
  font-weight: 700;
  color: #e8d8ff;
}
.tree-choice-desc {
  font-size: .72rem;
  color: #9880c8;
  margin-top: 2px;
}
.tree-confirm-btn {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, #7040cc, #9f7fff);
  border: none;
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  opacity: .5;
  pointer-events: none;
  transition: opacity .2s;
}
.tree-confirm-btn.ready {
  opacity: 1;
  pointer-events: auto;
}
.tree-confirm-btn.ready:hover {
  background: linear-gradient(90deg, #8050dd, #b090ff);
}

/* Chosen node display */
.tree-chosen-node {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(80,200,100,.1);
  border: 1px solid rgba(80,200,100,.3);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 4px;
}
.tree-chosen-node .node-icon { font-size: 1.2rem; }
.tree-chosen-label { font-size: .82rem; font-weight: 600; color: #a0ffb8; }
.tree-chosen-desc  { font-size: .7rem; color: #70c888; margin-top: 2px; }

/* Locked milestone */
.tree-locked-label {
  font-size: .78rem;
  color: rgba(130,110,170,.5);
  padding-top: 4px;
}

/* Menu / nav notification badges */
.menu-tile-badge,
.class-tree-badge,
.nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #ff4444;
  border-radius: 50%;
  border: 1px solid #1a0a2e;
  animation: badgePulse 1s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 2;
}
.nav-btn .nav-badge {
  top: 4px;
  right: 10px;
  width: 9px;
  height: 9px;
}
@keyframes badgePulse {
  from { box-shadow: 0 0 0 0 rgba(255,68,68,.6); }
  to   { box-shadow: 0 0 0 4px rgba(255,68,68,0); }
}

/* ====================================================================
   Welcome Tutorial Modal (mostrado após 1ª escolha de classe)
   ==================================================================== */

.welcome-sheet {
  background: linear-gradient(180deg, #12102a, #0b0d1e);
  border: 1px solid rgba(216, 180, 99, 0.25);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  max-height: min(90vh, calc(100dvh - 32px - env(safe-area-inset-bottom)));
  padding: 22px 18px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
  animation: sheetSlideIn .3s cubic-bezier(.22,.68,0,1.2);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.welcome-sheet .welcome-tips {
  flex: 1 1 auto;
  min-height: 0;
}

.welcome-sheet #welcomeStartBtn {
  position: sticky;
  bottom: 0;
  margin-top: 8px;
  flex-shrink: 0;
  z-index: 2;
  box-shadow: 0 -10px 20px rgba(11, 13, 30, 0.92);
}

.welcome-hero {
  text-align: center;
  margin-bottom: 20px;
}

.welcome-class-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 14px rgba(216, 180, 99, 0.5));
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-bright);
  margin: 0 0 4px;
  letter-spacing: 1px;
}

.welcome-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.welcome-tips {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.welcome-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.welcome-tip-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.welcome-tip-text strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.welcome-tip-text span {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

.welcome-reward {
  background: rgba(216,180,99,.08);
  border: 1px solid rgba(216,180,99,.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--gold-dim);
  text-align: center;
  margin-bottom: 14px;
}

/* ====================================================================
   Auth Overlay — Nova conta / Entrar com PIN
   ==================================================================== */

.auth-sheet {
  background: linear-gradient(180deg, #12102a, #0b0d1e);
  border: 1px solid rgba(216, 180, 99, 0.2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  max-height: min(90vh, calc(100dvh - 32px - env(safe-area-inset-bottom)));
  padding: 24px 20px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  animation: sheetSlideIn .28s cubic-bezier(.22,.68,0,1.2);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
}

.auth-logo-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(216, 180, 99, .4));
}

.auth-logo-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: 1px;
}

.auth-logo-sub {
  font-size: 11px;
  color: var(--text-dim);
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  padding: 9px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s, color .15s;
}

.auth-tab.active {
  background: var(--gold-dim);
  color: #201703;
}

/* Form */
.auth-form { display: flex; flex-direction: column; gap: 10px; }

.auth-pin-row {
  display: flex;
  gap: 8px;
}

.auth-pin-row .form-input { text-align: center; letter-spacing: 6px; font-size: 20px; }

.auth-hint {
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  padding: 6px 0 0;
}

.auth-hint a {
  color: var(--gold-dim);
  cursor: pointer;
  text-decoration: underline;
}

.auth-guest-banner {
  background: rgba(216,180,99,.08);
  border: 1px solid rgba(216,180,99,.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* PIN dots */
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 0;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(216, 180, 99, 0.4);
  background: transparent;
  transition: background .15s, border-color .15s;
}

.pin-dot.filled {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
}

/* ====================================================================
   Chefe Mundial (World Boss)
   ==================================================================== */

.world-boss-card {
  background: linear-gradient(160deg, rgba(40,5,60,.85), rgba(20,5,35,.95));
  border: 1px solid rgba(180,30,230,.4);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}

.world-boss-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(180,30,230,.15) 0%, transparent 70%);
  pointer-events: none;
}

.world-boss-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
  filter: drop-shadow(0 0 16px rgba(180,30,230,.7));
  animation: bossFloat 3s ease-in-out infinite;
}

@keyframes bossFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.world-boss-name {
  font-family: var(--font-display);
  font-size: 20px;
  color: #e080ff;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(200,80,255,.5);
  margin-bottom: 4px;
}

.world-boss-subtitle {
  font-size: 11px;
  color: rgba(200,150,255,.6);
  margin-bottom: 14px;
}

.world-boss-hp-bar {
  width: 100%;
  height: 14px;
  background: rgba(255,255,255,.08);
  border-radius: 7px;
  overflow: hidden;
  margin: 8px 0;
  border: 1px solid rgba(180,30,230,.3);
}

.world-boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #c026d3, #db2777);
  border-radius: 7px;
  transition: width 1s ease;
  position: relative;
}

.world-boss-hp-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: rgba(255,255,255,.25);
  border-radius: 7px 7px 0 0;
}

.world-boss-hp-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(200,150,255,.7);
  margin-top: 2px;
}

.world-boss-hp-pct {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #e080ff;
}

.world-boss-participants {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Estado: derrotado */
.world-boss-card.defeated {
  background: linear-gradient(160deg, rgba(5,40,15,.85), rgba(5,20,10,.95));
  border-color: rgba(30,200,80,.4);
}

.world-boss-card.defeated .world-boss-icon {
  filter: grayscale(0.6) drop-shadow(0 0 10px rgba(30,200,80,.5));
  animation: none;
}

.world-boss-card.defeated .world-boss-name {
  color: #6dce7a;
  text-shadow: 0 0 10px rgba(30,200,80,.4);
}

.world-boss-defeated-banner {
  background: linear-gradient(90deg, rgba(30,200,80,.2), rgba(50,220,100,.3), rgba(30,200,80,.2));
  border: 1px solid rgba(30,200,80,.5);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 14px;
  color: #6dce7a;
  letter-spacing: 1px;
  margin: 10px 0;
  text-shadow: 0 0 8px rgba(30,200,80,.5);
}

/* Tentativas do jogador */
.boss-attempt-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0;
}

.boss-attempt-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(180,30,230,.4);
}

.boss-attempt-dot.used {
  background: rgba(180,30,230,.6);
  box-shadow: 0 0 4px rgba(180,30,230,.5);
}

/* Contribuição do jogador */
.boss-my-stats {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  justify-content: center;
}

.boss-my-stat { text-align: center; }
.boss-my-stat-val { font-weight: 700; font-size: 14px; color: var(--gold-bright); }
.boss-my-stat-lbl { font-size: 10px; color: var(--text-faint); }

/* ====================================================================
   Conquistas (Achievements)
   ==================================================================== */

.conquistas-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.conquistas-summary-icon { font-size: 28px; }

.conquistas-summary-info { flex: 1; }

.conquistas-summary-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.conquistas-summary-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.conquistas-progress-bar {
  height: 5px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.conquistas-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  border-radius: 3px;
  transition: width .6s ease;
}

/* Streak banner */
.streak-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(255,100,30,.15), rgba(255,180,30,.1));
  border: 1px solid rgba(255,120,30,.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
}

.streak-flame { font-size: 30px; line-height: 1; }

.streak-info { flex: 1; padding: 0 10px; }

.streak-number {
  font-family: var(--font-display);
  font-size: 22px;
  color: #ffaa30;
  font-weight: 900;
}

.streak-label {
  font-size: 11px;
  color: var(--text-dim);
}

.streak-best {
  font-size: 11px;
  color: rgba(255,180,30,.7);
  text-align: right;
}

/* Conquista list row */
.conquista-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-soft);
  margin-bottom: 6px;
  transition: background .15s;
}

.conquista-row.unlocked {
  background: rgba(216,180,99,.07);
  border-color: rgba(216,180,99,.3);
}

.conquista-icon {
  font-size: 24px;
  width: 34px;
  text-align: center;
  flex-shrink: 0;
  filter: grayscale(1) opacity(.4);
}

.conquista-row.unlocked .conquista-icon {
  filter: none;
}

.conquista-info { flex: 1; min-width: 0; }

.conquista-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dim);
}

.conquista-row.unlocked .conquista-name { color: var(--text-main); }

.conquista-desc {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
}

.conquista-reward {
  font-size: 11px;
  color: var(--gold-bright);
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

.conquista-row.unlocked .conquista-reward { color: var(--green); }

.conquista-unlocked-label {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* Toast de conquista nova */
.conquista-toast {
  background: linear-gradient(135deg, #1a0a2e, #2a1040);
  border: 1px solid rgba(216,180,99,.6);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(216,180,99,.25);
}

/* ====================================================================
   Arena Ranking — Tier badges
   ==================================================================== */

.arena-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,.07);
  white-space: nowrap;
}

.player-arena-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-arena-card .arena-class-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.player-arena-card .arena-player-info { flex: 1; }

.player-arena-card .arena-rating-big {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--gold-bright);
}

.player-arena-card .arena-pos-label {
  font-size: 11px;
  color: var(--text-dim);
}

.ranking-row-winrate {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 1px;
}

@media (max-width: 500px) {
  .arena-tier-badge { font-size: 10px; padding: 2px 6px; }
}

/* ─── Modal PIX ─────────────────────────────────────── */
.pix-modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 0 2px;
}
.pix-modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-bright);
  text-align: center;
}
.pix-modal-product {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}
.pix-qr-img {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-soft);
  background: #fff;
  display: block;
}
.pix-copy-label {
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 4px;
}
.pix-copy-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.pix-copy-input {
  flex: 1;
  font-size: 10px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.pix-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.pix-status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pix-status-indicator.pending {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
  animation: pixPulse 1.4s ease-in-out infinite;
}
.pix-status-indicator.paid {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: none;
}
@keyframes pixPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
