/* forge/tokens.css — v0.70.0
 * Map entities: local player, other players, bots, mobs, float text.
 */

/* ── Local player (viewport-centered) ───────────────────── */
.player-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: 36px;
  height: 36px;
  pointer-events: none;
}
.player-avatar .player-icon {
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 40, 15, 0.95);
  border: 2px solid #09f530;
  font-size: 1rem;
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.4);
  overflow: hidden;
  padding: 0;
}
.player-avatar .player-icon.has-avatar-art {
  background: #050805;
}
.player-avatar .player-icon .map-token-face,
.player-avatar .map-token-face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}
.char-avatar.has-avatar-art,
.m-play-avatar.has-avatar-art {
  overflow: hidden;
  padding: 0;
  font-size: 0;
}
.char-avatar .char-avatar-img,
.m-play-avatar .char-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.engage-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border: 1px dashed rgba(0, 255, 136, 0.35);
  border-radius: 50%;
  box-shadow: inset 0 0 30px rgba(0, 255, 136, 0.06);
  pointer-events: none;
}

/* Floating XP over map player */
.forge-xp-float {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -100%);
  z-index: 40;
  pointer-events: none;
  font-family: "Courier New", Courier, monospace;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 255, 100, 0.5);
  animation: forge-xp-rise 1.8s ease forwards;
  white-space: nowrap;
}
.forge-xp-float.is-gain { color: #09f530; }
.forge-xp-float.is-loss {
  color: #ff7a7a;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 0 16px rgba(255, 80, 80, 0.45);
}
@keyframes forge-xp-rise {
  0% { opacity: 0; transform: translate(-50%, -40%); }
  15% { opacity: 1; }
  70% { opacity: 1; transform: translate(-50%, -160%); }
  100% { opacity: 0; transform: translate(-50%, -200%); }
}

.forge-world-float {
  position: absolute;
  z-index: 50;
  margin-left: -20px;
  margin-top: -28px;
  pointer-events: none;
  font-family: "Courier New", Courier, monospace;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: world-float-rise 1.7s ease forwards;
  text-shadow: 0 0 8px #000, 0 0 12px rgba(0, 255, 100, 0.35);
}
.forge-world-float.is-xp { color: #09f530; }
.forge-world-float.is-loss { color: #ff9a6a; }
.forge-world-float.is-level { color: #e0c060; font-size: 0.95rem; }
.forge-world-float.is-death { color: #ff5050; }
@keyframes world-float-rise {
  0% { opacity: 0; transform: translateY(6px); }
  15% { opacity: 1; }
  70% { opacity: 1; transform: translateY(-36px); }
  100% { opacity: 0; transform: translateY(-52px); }
}

/* ── Mobs ───────────────────────────────────────────────── */
.mob-avatar {
  transition: none; /* positions driven by rAF vector tween */
  will-change: left, top;
  position: absolute;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 136, 0.45);
  background: rgba(0, 20, 8, 0.85);
  color: #dff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
  z-index: 10; /* v0.73.4 above zone terrain */
}
.mob-avatar:hover,
.mob-avatar.is-target {
  border-color: #09f530;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.45);
  transform: scale(1.08);
}
.mob-avatar.tier-trash { border-color: rgba(120, 200, 120, 0.5); }
.mob-avatar.tier-elite { border-color: rgba(220, 180, 60, 0.7); }
.mob-avatar.tier-boss {
  border-color: rgba(255, 80, 80, 0.85);
  box-shadow: 0 0 18px rgba(255, 60, 60, 0.35);
}
.mob-avatar .mob-lvl {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  background: #021008;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  border: 1px solid rgba(0, 255, 136, 0.25);
}

/* Aggro lock — strongest in-range mob */
.mob-avatar.is-agro {
  border-color: #ff5050 !important;
  box-shadow: 0 0 18px rgba(255, 60, 60, 0.55), 0 0 8px rgba(255, 100, 80, 0.4);
  transform: scale(1.12);
  z-index: 22;
  animation: agro-pulse 0.9s ease-in-out infinite alternate;
}
.mob-avatar.is-agro .mob-lvl {
  border-color: rgba(255, 80, 80, 0.7);
  color: #ffb0b0;
}
@keyframes agro-pulse {
  from { box-shadow: 0 0 12px rgba(255, 60, 60, 0.35); }
  to { box-shadow: 0 0 22px rgba(255, 80, 80, 0.7); }
}

/* Just-respawned — cannot aggro until grace ends */
.mob-avatar.is-aggro-immune {
  opacity: 0.45;
  filter: grayscale(0.35);
  border-style: dashed;
  pointer-events: auto;
}
.mob-avatar.is-aggro-immune.is-agro {
  animation: none;
  box-shadow: none;
}

/* Mob running at aggro target */
.mob-avatar.is-chasing,
.mob-avatar.is-agro {
  border-color: #ff4040 !important;
  box-shadow: 0 0 18px rgba(255, 50, 50, 0.65);
  z-index: 22;
}
.mob-avatar.is-chasing {
  animation: mob-chase-pulse 0.35s ease-in-out infinite alternate;
}
@keyframes mob-chase-pulse {
  from { transform: scale(1.05); }
  to { transform: scale(1.18); }
}

/* Puzzle mobs */
.mob-avatar.is-puzzle {
  border-color: #5ec8ff !important;
  box-shadow: 0 0 14px rgba(80, 180, 255, 0.55);
}
.mob-avatar.is-puzzle span:first-child {
  filter: drop-shadow(0 0 4px #6cf);
}

/* Fogged mobs outside visibility */
.mob-avatar.is-fogged {
  opacity: 0.22;
  filter: blur(1.5px) grayscale(0.6);
  pointer-events: none;
}

/* ── Other players / bots (legacy circle — hidden) ──────── */
.player-other {
  display: none !important;
}

/* ── Human player tokens (bots + real players) ──────────── */
.player-avatar-token {
  position: absolute;
  width: 44px;
  height: 52px;
  margin: -46px 0 0 -22px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 7;
  color: #e8fff0;
  font-family: "Courier New", Courier, monospace;
}
.player-avatar-token .pat-body.has-avatar-art {
  background: transparent;
  border: none;
  box-shadow: none;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid #09f530;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.35);
}
.player-avatar-token .pat-face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 50%;
}
.player-avatar-token .pat-body {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  margin: 10px auto 0;
  border-radius: 10px 10px 8px 8px;
  background: linear-gradient(160deg, #0a3a5c 0%, #062030 100%);
  border: 2px solid #5ad0ff;
  box-shadow: 0 0 12px rgba(90, 200, 255, 0.45), inset 0 0 8px rgba(0,0,0,0.4);
}
.player-avatar-token .pat-head {
  position: absolute;
  left: 50%;
  top: -9px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #cfe;
  border: 2px solid #5ad0ff;
  box-shadow: 0 0 6px rgba(90, 200, 255, 0.5);
}
.player-avatar-token .pat-torso {
  display: none;
}
.player-avatar-token .pat-side {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  text-shadow: 0 0 6px #000;
}
.player-avatar-token .pat-name {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(0, 12, 24, 0.88);
  border: 1px solid rgba(90, 200, 255, 0.35);
  color: #bdf;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-avatar-token .pat-name em {
  font-style: normal;
  opacity: 0.55;
  font-size: 0.5rem;
  margin-left: 2px;
}
.player-avatar-token .pat-lv {
  position: absolute;
  right: -2px;
  bottom: 10px;
  font-size: 0.52rem;
  font-weight: 800;
  background: #021018;
  border: 1px solid rgba(90, 200, 255, 0.4);
  border-radius: 3px;
  padding: 0 3px;
  color: #8cf;
}
.player-avatar-token .pat-hp {
  position: absolute;
  left: 12%;
  bottom: 0;
  width: 76%;
  height: 4px;
  background: #111;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.player-avatar-token .pat-hp i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #a03030, #e05050);
}
.player-avatar-token .pat-chess {
  position: absolute;
  left: -6px;
  bottom: 8px;
  font-size: 0.85rem;
  animation: chess-think 0.9s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 4px #09f530);
}
@keyframes chess-think {
  from { transform: translateY(0); opacity: 0.85; }
  to { transform: translateY(-3px); opacity: 1; }
}

/* Side colors */
.player-avatar-token.side-white .pat-body {
  border-color: #cfefff;
  background: linear-gradient(160deg, #1a4a6a, #0a2030);
}
.player-avatar-token.side-black .pat-body {
  border-color: #c9a0ff;
  background: linear-gradient(160deg, #3a2060, #150828);
}
.player-avatar-token.side-black .pat-head {
  border-color: #c9a0ff;
  background: #ddd0ff;
}
.player-avatar-token.side-black .pat-name {
  border-color: rgba(200, 150, 255, 0.4);
  color: #e0c0ff;
}

/* Bots: gold name tag, not green mob orbs */
.player-avatar-token.is-bot .pat-body {
  border-color: #e0c060;
  box-shadow: 0 0 12px rgba(224, 192, 96, 0.4), inset 0 0 8px rgba(0,0,0,0.4);
  background: linear-gradient(160deg, #3a3520, #1a1808);
}
.player-avatar-token.is-bot .pat-head {
  border-color: #e0c060;
  background: #f0e0a0;
}
.player-avatar-token.is-bot .pat-name {
  border-color: rgba(224, 192, 96, 0.5);
  color: #f0d060;
}
.player-avatar-token.is-bot .pat-lv {
  border-color: rgba(224, 192, 96, 0.45);
  color: #e0c060;
}

.player-avatar-token.is-hardcore .pat-body {
  border-color: #ff6060 !important;
  box-shadow: 0 0 14px rgba(255, 60, 60, 0.45);
}
.player-avatar-token.is-hardcore .pat-name {
  color: #ff9a9a;
  border-color: rgba(255, 80, 80, 0.45);
}

/* Walking bob */
.player-avatar-token.is-walking .pat-body {
  animation: human-walk-bob 0.35s ease-in-out infinite alternate;
}
@keyframes human-walk-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}
.player-avatar-token.is-idle .pat-body {
  animation: none;
}
.player-avatar-token.is-fighting .pat-body {
  animation: none;
  border-color: #09f530;
  box-shadow: 0 0 16px rgba(0, 255, 100, 0.45);
}


/* WoW greying — no auto-agro (still clickable) */
.mob-avatar.is-grey {
  filter: grayscale(0.85) brightness(0.85);
  opacity: 0.72;
  border-color: rgba(160, 160, 160, 0.55) !important;
}
.mob-avatar.is-grey .mob-lvl {
  color: #b0b0b0;
}


/* Local player name / level tags (map center token) */
.player-avatar .player-name-tag {
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  max-width: 120px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 12, 8, 0.88);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: #c8f5d4;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  pointer-events: none;
}
.player-avatar .player-level-tag {
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(2, 16, 8, 0.92);
  border: 1px solid rgba(0, 255, 136, 0.4);
  color: #00ff88;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  line-height: 1.2;
  pointer-events: none;
}

/* Click / tap lead destination */
#world-layer .forge-lead-marker,
.forge-lead-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 50%;
  border: 2px solid rgba(80, 255, 140, 0.9);
  box-shadow: 0 0 12px rgba(40, 220, 100, 0.65), inset 0 0 8px rgba(80, 255, 140, 0.35);
  background: rgba(40, 200, 100, 0.18);
  pointer-events: none;
  z-index: 25;
  animation: forge-lead-pulse 1s ease-out infinite;
}
@keyframes forge-lead-pulse {
  0% { transform: scale(0.85); opacity: 1; }
  70% { transform: scale(1.35); opacity: 0.45; }
  100% { transform: scale(1.55); opacity: 0; }
}
