/* Gathering feature: progress bar above the ability bar and resource node tooltips. */

/* ------------------------------------------------------------------ progress bar */

.gbar {
  --gbar-tier: var(--gold);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 46px);
  width: 290px;
  padding: 6px 8px 7px;
  transform: translateX(-50%);
  pointer-events: none;
  color: var(--text);
  background: linear-gradient(180deg, rgba(34, 27, 20, 0.94), rgba(14, 11, 8, 0.94));
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 220, 150, 0.06);
  animation: gbar-in 0.16s ease-out;
}

/* Fallback when the HUD is missing: float above the bottom edge of the screen. */
.gbar.gbar-float {
  position: fixed;
  bottom: 170px;
  z-index: 21;
}

#hud-bottom > .gbar {
  pointer-events: none;
}

.gbar-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gbar-icon {
  flex: none;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  background: #0f0c09;
}

.gbar-icon > .icon {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.gbar-text {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.gbar-name {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: bold;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--gbar-tier);
  text-shadow: 0 1px 0 #000, 0 0 6px rgba(0, 0, 0, 0.8);
}

.gbar-count {
  flex: none;
  font-size: 11px;
  font-weight: bold;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.gbar-x {
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 14px;
  line-height: 15px;
  text-align: center;
  color: var(--text-dim);
  cursor: pointer;
  pointer-events: auto;
  background: #0f0c09;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
}

.gbar-x:hover {
  color: #fff;
  border-color: var(--border-bright);
  background: var(--bg-hover);
}

.gbar.ending .gbar-x {
  visibility: hidden;
}

.gbar-track {
  position: relative;
  height: 12px;
  margin-top: 6px;
  overflow: hidden;
  background: #0b0806;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}

.gbar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: linear-gradient(180deg, #c6e889, #7fb04e 55%, #4a7a2c);
  box-shadow: 0 0 8px rgba(160, 220, 110, 0.35);
}

.gbar-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 220, 0.75);
  box-shadow: 0 0 6px rgba(255, 255, 200, 0.9);
}

.gbar-time,
.gbar-status {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 3px #000, 0 1px 0 #000;
}

.gbar-time {
  right: 6px;
  font-variant-numeric: tabular-nums;
}

.gbar-status {
  left: 0;
  right: 0;
  justify-content: center;
  letter-spacing: 0.04em;
}

.gbar-pips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  margin-top: 6px;
}

.gbar-pip {
  display: block;
  width: 12px;
  height: 5px;
  background: #2a2218;
  border: 1px solid #4a3a24;
  border-radius: 2px;
  transition: background 0.2s, box-shadow 0.2s;
}

.gbar-pip.on {
  background: var(--gbar-tier);
  border-color: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 5px var(--gbar-tier);
}

.gbar.gbar-hit .gbar-track {
  animation: gbar-flash 0.35s ease-out;
}

.gbar.gbar-hit .gbar-count {
  animation: gbar-bump 0.35s ease-out;
}

.gbar.ending {
  animation: gbar-out 0.9s ease-in forwards;
}

.gbar.ending .gbar-fill {
  background: linear-gradient(180deg, #f5d98a, #c9962f 60%, #8a6219);
}

.gbar.ending.fail .gbar-fill {
  width: 100% !important;
  background: linear-gradient(180deg, #d8705a, #a03a2a 60%, #6a1e14);
  box-shadow: none;
}

.gbar.ending .gbar-fill::after {
  display: none;
}

.gbar.ending.fail .gbar-status {
  color: #ffd1ca;
}

@keyframes gbar-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes gbar-out {
  0%,
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes gbar-flash {
  0% {
    border-color: #f0e6a0;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(240, 230, 160, 0.7);
  }
  100% {
    border-color: var(--border-dim);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
  }
}

@keyframes gbar-bump {
  0% {
    color: #fff;
    transform: scale(1.25);
  }
  100% {
    color: var(--text-dim);
    transform: scale(1);
  }
}

/* ------------------------------------------------------------------ node tooltip */

.gt-tip {
  min-width: 200px;
}

.tooltip:has(.gt-bad) {
  border-color: #8a3a2a;
}

.gt-title {
  color: var(--gold-bright);
}

.gt-bad .gt-title {
  color: var(--error);
}

.gt-tier {
  font-family: var(--font);
  font-size: 12px;
  font-weight: bold;
}

.gt-ench {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: bold;
  text-shadow: 0 0 1px #1a0f06, 0 0 3px currentcolor, 0 1px 1px #1a0f06 !important;
}

.gt-charges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  font-size: 11.5px;
}

.gt-charges > b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.gt-charges.gt-empty {
  color: var(--text-faint);
  font-style: italic;
}

.gt-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.gt-pip {
  display: block;
  width: 9px;
  height: 5px;
  background: #2a2218;
  border: 1px solid #4a3a24;
  border-radius: 2px;
}

.gt-pip.on {
  background: var(--good);
  border-color: rgba(0, 0, 0, 0.5);
}

.gt-req {
  position: relative;
  margin-top: 2px;
  padding-left: 16px;
  font-weight: bold;
}

.gt-req::before {
  position: absolute;
  left: 0;
  top: 0;
  width: 13px;
  text-align: center;
}

.gt-req.ok {
  color: var(--good);
}

.gt-req.ok::before {
  content: "\2714";
}

.gt-req.bad {
  color: var(--error);
}

.gt-req.bad::before {
  content: "\2716";
}

.gt-req .tt-dim {
  font-weight: normal;
}

.gt-stats {
  margin-top: 6px;
}

.gt-reason {
  font-weight: bold;
  color: var(--error);
}
