/* Dungeon feature: progress panel, "Dungeon Cleared" banner, chest channel bar, tooltips. */

/* ------------------------------------------------------------------ progress panel */

.dg-progress {
  --dg-accent: #5fd0c0;
  position: fixed;
  top: 12px;
  /* Left of the minimap column (188 px + margins); features/settings/layout.js moves it left of
     the measured minimap and of the PvP / criminal / mount column (#sc-status). */
  right: 216px;
  z-index: 19;
  width: 214px;
  padding: 7px 9px 8px;
  color: var(--text);
  font-size: 12px;
  /* The same slate box with a banded gold serif header as the journal tracker's sections. */
  padding-top: 0;
  background: linear-gradient(180deg, rgba(14, 16, 20, 0.78), rgba(10, 10, 12, 0.62));
  border: 1px solid rgba(160, 130, 80, 0.35);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 3px 0 0 var(--dg-accent);
  pointer-events: none;
}

.dg-progress.hidden {
  display: none;
}

.dg-progress[data-kind="group"] {
  --dg-accent: #b36bff;
}

/* Banded header like the tracker's (.trk-head). */
.dg-name {
  margin: 0 -9px 6px;
  padding: 4px 9px;
  overflow: hidden;
  color: #f2d58a;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: bold;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(90deg, rgba(60, 64, 72, 0.85), rgba(30, 32, 36, 0.6));
  border-bottom: 1px solid rgba(217, 180, 90, 0.35);
  border-radius: 6px 6px 0 0;
}

.dg-sub {
  margin-bottom: 6px;
  color: var(--dg-accent);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.dg-bar {
  position: relative;
  height: 14px;
  overflow: hidden;
  background: #120e0b;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
}

/* Progress (foes defeated), in the gold accent; green once every foe is down. */
.dg-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(180deg, #c9a24e, #7a5c22);
  transition: width 0.4s ease, background 0.4s ease;
}

.dg-bar.done .dg-fill {
  background: linear-gradient(180deg, #7cc46a, #3f7a32);
}

.dg-bar-text {
  position: absolute;
  inset: 0;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  text-shadow: 0 1px 1px #000;
}

.dg-row {
  margin-top: 5px;
  line-height: 1.35;
}

.dg-boss {
  color: #e8a09a;
}

.dg-boss.done {
  color: var(--good);
}

.dg-chest {
  color: var(--text-dim);
}

.dg-chest[data-state="ready"] {
  color: #ffd766;
  font-weight: bold;
  animation: dg-pulse 1.4s ease-in-out infinite;
}

.dg-chest[data-state="opened"] {
  color: var(--text-faint);
}

.dg-foot {
  display: flex;
  justify-content: space-between;
  color: var(--text-faint);
  font-size: 11px;
}

.dg-progress.dg-urgent .dg-time {
  color: var(--error);
  font-weight: bold;
}

.dg-progress.dg-cleared {
  border-top-color: var(--gold);
}

@keyframes dg-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ------------------------------------------------------------------ cleared banner */

/* Where the zone banner shows, above the toasts (z 900) on its own dark plate so nameplates and
   world labels behind it do not mix with its text; toasts move below it while it shows. */
.dg-banner {
  position: fixed;
  top: max(96px, 13%);
  left: 50%;
  z-index: 950;
  padding: 10px 48px 12px;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(20, 14, 6, 0.9) 0%, rgba(12, 9, 5, 0.75) 55%, transparent 75%);
  transform: translateX(-50%);
  pointer-events: none !important;
}

#ui:has(#dg-banner.show) #toasts {
  top: calc(max(96px, 13vh) + 112px);
}

.dg-banner.show {
  animation: dg-banner 5.2s ease forwards;
}

.dgb-title {
  color: #ffd766;
  /* 33 px at 1280: the title stays clear of the progress panel left of the minimap. */
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 190, 80, 0.7), 0 2px 3px #000;
}

.dgb-sub {
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  text-shadow: 0 1px 3px #000;
}

@keyframes dg-banner {
  0% { opacity: 0; transform: translateX(-50%) scale(0.85); }
  10% { opacity: 1; transform: translateX(-50%) scale(1.04); }
  16% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(1); }
}

/* ------------------------------------------------------------------ chest channel bar */

.dgc {
  --dgc-color: #b8a27a;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 46px);
  width: 260px;
  padding: 6px 8px 7px;
  transform: translateX(-50%);
  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);
}

.dgc.hidden {
  display: none;
}

.dgc.dgc-float {
  position: fixed;
  bottom: 170px;
  z-index: 21;
}

.dgc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.dgc-name {
  color: var(--dgc-color);
  font-size: 12px;
  font-weight: bold;
}

.dgc-x {
  width: 18px;
  height: 18px;
  padding: 0;
  color: var(--text-dim);
  line-height: 16px;
  background: transparent;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
  cursor: pointer;
  pointer-events: auto;
}

.dgc-x:hover {
  color: var(--text);
  border-color: var(--border-bright);
}

.dgc-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  background: #120e0b;
  border: 1px solid var(--border-dim);
  border-radius: 3px;
}

.dgc-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(180deg, var(--dgc-color), rgba(0, 0, 0, 0.35));
}

.dgc-time,
.dgc-status {
  position: absolute;
  top: 0;
  font-size: 10px;
  line-height: 12px;
  text-shadow: 0 1px 1px #000;
}

.dgc-time {
  right: 5px;
}

.dgc-status {
  left: 6px;
}

.dgc.dgc-fail .dgc-status {
  color: #ff9a86;
}

.dgc.dgc-ok .dgc-status {
  color: #ffe28a;
}

/* ------------------------------------------------------------------ tooltips */

.dg-tt-open {
  margin-top: 3px;
  color: #b36bff;
}
