/* Destiny feature: Destiny Board (db-*), Journal (jr-*), quest tracker (trk-*),
   level-up banner (dlu-*). */

/* ================================================================== Destiny Board */

.panel-destiny .panel-body.db-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 12px 12px;
  overflow: hidden;
}

/* Wooden plaque with the adventurer level (a dark island: base.css re-scopes the tokens). */
.db-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  margin-bottom: 10px;
  background:
    radial-gradient(ellipse at 12% 50%, rgba(240, 212, 138, 0.16), transparent 55%),
    var(--wood-grain),
    linear-gradient(180deg, #4e3624, #2b1c10);
  border: 1px solid #1a0f06;
  border-radius: 10px;
  box-shadow: 0 0 0 1.5px var(--brass-lo), 0 3px 8px rgba(60, 34, 10, 0.45), inset 0 0 18px rgba(0, 0, 0, 0.45);
}

#ui .panel-body .db-head * {
  text-shadow: 0 1px 2px #000;
}

.db-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex: none;
  background: radial-gradient(circle, #3a2c18 0%, #16110b 70%);
  border: 1px solid #120a04;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--brass), 0 0 0 4px #3a2508, 0 0 16px rgba(217, 180, 90, 0.3);
}

.db-adv {
  min-width: 150px;
}

.db-adv-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.db-adv-val {
  font-family: var(--font) !important;
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: bold;
  line-height: 1.05;
  color: var(--gold-bright);
  text-shadow: 0 1px 0 #000, 0 0 14px rgba(217, 180, 90, 0.35);
}

.db-adv-bar {
  position: relative;
  height: 5px;
  margin-top: 4px;
  overflow: hidden;
  background: #0d0a07;
  border: 1px solid #3a2e1f;
  border-radius: 3px;
}

.db-adv-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #8f7640, var(--gold-bright));
  transition: width 0.5s ease;
}

.db-totals {
  display: flex;
  flex: 1;
  justify-content: flex-end;
  gap: 18px;
}

.db-totals > div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.db-totals span {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.db-totals b {
  font-size: 15px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.db-tabs {
  margin-bottom: 0;
}

.db-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.db-tab-lv {
  padding: 0 5px;
  font-size: 10px;
  font-weight: normal;
  line-height: 15px;
  color: var(--text-faint);
  background: var(--well);
  border-radius: 7px;
}

.db-tab.active .db-tab-lv {
  color: var(--gold);
}

.db-main {
  display: flex;
  gap: 12px;
  height: min(560px, calc(100vh - 250px));
  min-height: 280px;
  padding-top: 10px;
}

/* The board itself: a dark, starry slate set into the page (Albion's Destiny Board). */
.db-board {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 8px 10px 14px;
  overflow: auto;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 170, 220, 0.12), transparent 60%),
    radial-gradient(circle, rgba(220, 200, 150, 0.12) 1px, transparent 1.5px) 0 0 / 22px 22px,
    radial-gradient(ellipse at 50% 50%, #1d2630, #0e1216 80%);
  border: 4px solid var(--wood);
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--wood-edge), inset 0 0 30px rgba(0, 0, 0, 0.75);
}

.db-group {
  position: relative;
  padding: 4px 2px 10px;
}

.db-group + .db-group {
  margin-top: 8px;
  border-top: 1px dashed rgba(107, 84, 49, 0.35);
  padding-top: 14px;
}

.db-links {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.db-links path {
  fill: none;
  stroke: rgba(107, 84, 49, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
}

.db-links path.lit {
  stroke: var(--gold);
  stroke-width: 2;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 3px rgba(217, 180, 90, 0.7));
}

.db-links circle {
  fill: #3f3220;
}

.db-links circle.lit {
  fill: var(--gold-bright);
}

.db-hub {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 26px;
  padding: 3px 14px 3px 4px;
  background: linear-gradient(180deg, #3a2e1f, #1d1711);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6), 0 3px 10px rgba(0, 0, 0, 0.6);
}

.db-hub-gem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle, #2a2118, #0f0c08);
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
}

.db-hub-title {
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.db-hub-sub {
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.db-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 14px 12px;
}

.db-card {
  --spec-color: var(--gold);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 9px 7px;
  cursor: pointer;
  background: var(--wood-grain), linear-gradient(180deg, #3a2a1c, #1f1610);
  border: 1px solid #0c0703;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.5);
  opacity: 0.82;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, opacity 0.15s;
}

.db-card:hover,
.db-card:focus-visible {
  opacity: 1;
  outline: none;
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.db-card.active {
  opacity: 1;
  border-color: #6b5431;
  border-color: color-mix(in srgb, var(--spec-color) 45%, #3f3220);
}

.db-card.selected {
  opacity: 1;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 16px rgba(217, 180, 90, 0.35);
}

.db-card.maxed {
  background: linear-gradient(180deg, #3a2e17, #1d170e);
  border-color: var(--gold-bright);
}

.db-card.db-flash {
  animation: db-flash 1.2s ease-out;
}

.db-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Round node portrait with a steel ring (brass once the spec is active). */
.db-card-icon {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid #000;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #7a838e, 0 0 0 3px #1a1c20;
}

.db-card.active .db-card-icon {
  box-shadow: 0 0 0 2px var(--brass), 0 0 0 3px #3a2508, 0 0 10px color-mix(in srgb, var(--spec-color) 60%, transparent);
}

.db-card-icon canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
}

.db-card:not(.active) .db-card-icon canvas {
  filter: grayscale(0.7) brightness(0.8);
}

.db-card-lv {
  position: absolute;
  right: -6px;
  bottom: -6px;
  min-width: 20px;
  padding: 0 4px;
  font-size: 11px;
  font-weight: bold;
  line-height: 16px;
  text-align: center;
  color: #1b1712;
  background: linear-gradient(180deg, var(--gold-bright), #b08a45);
  border: 1px solid #000;
  border-radius: 9px;
}

.db-card:not(.active) .db-card-lv {
  color: var(--text-dim);
  background: #2a2219;
}

.db-card-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-weight: bold;
  line-height: 1.2;
}

/* Long names ("Leather Armor Fighter") wrap to a second line instead of being cut off. */
.db-card-name > span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow-wrap: anywhere;
  color: var(--text);
}

.db-card-name small {
  font-size: 10.5px;
  font-weight: normal;
  color: var(--text-faint);
}

.db-bar {
  position: relative;
  height: 14px;
  overflow: hidden;
  background: #0c0907;
  border: 1px solid #3a2e1f;
  border-radius: 3px;
}

.db-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #6b5431, var(--spec-color, var(--gold)));
  box-shadow: 0 0 6px rgba(217, 180, 90, 0.35);
  transition: width 0.45s ease;
}

.db-bar > span {
  position: relative;
  display: block;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  color: #f6ecd6;
  font-variant-numeric: tabular-nums;
}

#ui .db-bar > span,
#ui .jr-bar > span {
  text-shadow: 0 1px 1px #000, 0 0 3px #000;
}

.db-bar.big {
  height: 18px;
  margin: 8px 0 6px;
}

.db-bar.big > span {
  font-size: 11px;
  line-height: 16px;
}

.db-pips {
  display: flex;
  gap: 3px;
}

.db-pip {
  --tc: #8c8c8c;
  flex: 1;
  height: 13px;
  font-size: 8.5px;
  font-weight: bold;
  line-height: 11px;
  text-align: center;
  color: rgba(255, 255, 255, 0.28);
  background: #110d09;
  border: 1px solid #3a2e1f;
  border-radius: 2px;
}

.db-pip.on {
  color: rgba(0, 0, 0, 0.75);
  background: var(--tc);
  border-color: rgba(0, 0, 0, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.db-pip.next {
  color: var(--tc);
  border-color: var(--tc);
  animation: db-pip-pulse 1.8s ease-in-out infinite;
}

.db-next {
  font-size: 10.5px;
  color: var(--text-dim);
}

.db-bonus {
  font-size: 11px;
  font-weight: bold;
  color: var(--good);
}

.db-bonus:empty {
  display: none;
}

.db-card:not(.active) .db-bonus {
  color: var(--text-faint);
}

/* ---------------------------------------------------------------- inspector */

.db-inspector {
  flex: none;
  width: 262px;
  padding: 10px 11px;
  overflow: auto;
  background: rgba(255, 250, 236, 0.45);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  box-shadow: inset 0 1px 4px rgba(90, 56, 20, 0.2);
}

.db-in-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.db-in-head canvas {
  flex: none;
  border: 1px solid #000;
  border-radius: 4px;
}

.db-in-name {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: bold;
  color: #4a2a10;
}

.db-in-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.db-in-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.db-in-note {
  margin-top: 4px;
  font-size: 11px;
  font-style: italic;
  color: var(--text-faint);
}

.db-in-hint {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
}

.db-in-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

.db-in-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.db-in-stat > span {
  color: var(--text-dim);
}

.db-in-stat > b {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.db-in-title {
  margin: 12px 0 6px;
  padding-bottom: 3px;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #4a2a10;
  border-bottom: 1px solid var(--border-dim);
}

.db-in-unlocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 10px;
}

.db-in-ul {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
}

.db-in-ul span {
  color: var(--text-faint);
}

.db-quality {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.db-q-row {
  display: grid;
  grid-template-columns: 82px 1fr 44px;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.db-q-row > b {
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.db-q-bar {
  height: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #1d2127, #3c434c);
  border: 1px solid #0d0f12;
  border-radius: 4px;
}

.db-q-bar > i {
  display: block;
  height: 100%;
  opacity: 0.85;
}

.db-in-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-in-tier {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  background: var(--well);
  border: 1px solid transparent;
  border-radius: 4px;
}

.db-in-tier.ok {
  border-color: rgba(127, 196, 90, 0.25);
}

.db-in-tier.locked .db-in-items {
  opacity: 0.45;
  filter: grayscale(0.6);
}

#ui .db-in-t {
  text-shadow: 0 0 1px #1a0f06, 0 0 2px rgba(26, 15, 6, 0.85);
}

.db-in-t {
  --tc: #8c8c8c;
  flex: none;
  width: 26px;
  font-size: 11px;
  text-align: center;
  color: var(--tc);
}

.db-in-items {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 3px;
}

.db-in-item {
  display: inline-flex;
  border: 1px solid #000;
  border-radius: 3px;
}

.db-in-req {
  flex: none;
  min-width: 34px;
  font-size: 11px;
  text-align: right;
  color: var(--text-faint);
}

.db-in-tier.ok .db-in-req {
  color: var(--good);
}

/* tooltip pieces */

.db-tt-tier {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.35;
}

.db-tt-tier > span {
  color: var(--text-dim);
}

.db-tt-tier > em {
  font-style: normal;
  color: var(--text-faint);
}

.db-tt-tier.ok > em {
  color: var(--good);
}

.db-tt-tier.locked > span {
  color: var(--text-faint);
}

@media (max-width: 960px) {
  .db-main {
    flex-direction: column;
    height: calc(100vh - 230px);
  }

  .db-inspector {
    width: auto;
    max-height: 200px;
  }

  .db-totals {
    gap: 10px;
  }
}

/* ================================================================== Journal */

.panel-journal .panel-body.jr-body {
  max-height: min(640px, calc(100vh - 120px));
  padding: 10px 12px 14px;
}

.jr-empty {
  padding: 24px 0;
  text-align: center;
}

.jr-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-dim);
}

.jr-head-text {
  flex: 1;
}

.jr-head-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: bold;
  color: #4a2a10;
}

.jr-head-sub {
  margin-bottom: 5px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.jr-chapter {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 12px 0 6px;
  padding: 3px 12px;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
  color: #f3e2bb;
  background: var(--wood-grain), linear-gradient(180deg, #5a4029, #33231a);
  border: 1px solid #1a0f06;
  border-radius: 8px;
}

#ui .jr-chapter,
#ui .jr-chapter * {
  text-shadow: 0 1px 2px #000;
}

.jr-chapter em {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
  color: #d9c49a;
}

.jr-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.jr-quest {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: start;
  gap: 9px;
  padding: 7px 9px;
  background: var(--well);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
}

.jr-quest.active {
  background: linear-gradient(90deg, rgba(255, 250, 236, 0.8), rgba(255, 250, 236, 0.3));
  border-color: var(--border);
  box-shadow: inset 3px 0 0 #b8322a;
}

.jr-quest.ready {
  background: linear-gradient(90deg, rgba(150, 190, 70, 0.3), rgba(255, 250, 236, 0.3));
  border-color: #6d8f2a;
  box-shadow: inset 3px 0 0 #6d8f2a, 0 0 10px rgba(110, 150, 40, 0.25);
}

.jr-quest.claimed {
  opacity: 0.62;
}

.jr-quest.locked {
  opacity: 0.4;
}

.jr-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  font-size: 13px;
  font-weight: bold;
  color: #d9c49a;
  background: radial-gradient(circle at 45% 35%, #5b636e, #22272e);
  border: 1px solid #0e1013;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(160, 166, 174, 0.6);
}

.jr-badge.claimed {
  color: #10240a;
  background: var(--good);
  border-color: #3d6a28;
}

.jr-badge.active {
  color: #ffe08a;
}

.jr-badge.ready {
  color: #2a1d08;
  background: var(--gold-bright);
  border-color: var(--gold);
  animation: pulse-gold 1.6s ease-in-out infinite;
}

.jr-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.jr-title {
  font-weight: bold;
  color: var(--text);
}

.jr-quest.active .jr-title,
.jr-quest.ready .jr-title {
  color: #4a2a10;
}

.jr-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.jr-hint {
  font-size: 11px;
  font-style: italic;
  color: var(--text-faint);
}

.jr-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.jr-rewards {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  max-width: 150px;
}

.jr-silver {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px 1px 3px;
  font-size: 12px;
  font-weight: bold;
  color: #eef1f5;
  background: linear-gradient(180deg, #5b636e, #2c3139);
  border: 1px solid #0e1013;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

#ui .jr-silver {
  text-shadow: 0 1px 1px #000;
}

.jr-item {
  display: inline-flex;
  border: 1px solid #000;
  border-radius: 3px;
}

.jr-claimed {
  font-size: 11px;
  color: var(--good);
}

.jr-bar {
  position: relative;
  height: 14px;
  margin-top: 2px;
  overflow: hidden;
  background: linear-gradient(180deg, #1d2127, #3c434c);
  border: 1px solid #0d0f12;
  border-radius: 7px;
}

.jr-bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #6b5431, var(--gold));
  transition: width 0.45s ease;
}

.jr-bar.done > i {
  background: linear-gradient(90deg, #4a7a2e, var(--good));
}

.jr-bar > span {
  position: relative;
  display: block;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  color: #f6ecd6;
  font-variant-numeric: tabular-nums;
}

.jr-bar.slim {
  height: 5px;
}

.jr-bar.slim > span {
  display: none;
}

.jr-claim {
  white-space: nowrap;
}

/* ================================================================== Quest tracker */

/* Right-side tracker (Albion: dark translucent box, gold serif header). features/settings/layout.js
   places it below the menu row. */
#destiny-tracker {
  position: fixed;
  top: 96px;
  right: 12px;
  z-index: 19;
  width: 250px;
  font-size: 13px;
  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);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.trk-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 9px;
  cursor: pointer;
  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;
}

#destiny-tracker.collapsed .trk-head {
  border-bottom-color: transparent;
  border-radius: 6px;
}

.trk-head-text {
  flex: 1;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  color: #f2d58a;
  text-shadow: 0 1px 2px #000;
}

.trk-chapter {
  font-size: 10.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.trk-toggle {
  width: 20px;
  height: 20px;
  padding: 0;
  font-size: 13px;
  line-height: 16px;
  color: #f3e2bb;
  cursor: pointer;
  background: radial-gradient(circle at 45% 35%, #5b636e, #22272e);
  border: 1px solid #0e1013;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(200, 170, 100, 0.6);
}

.trk-toggle:hover {
  color: var(--gold-bright);
  border-color: var(--gold-dim);
}

.trk-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 9px 9px;
}

#destiny-tracker.collapsed .trk-body {
  display: none;
}

/* Every tracker section has the same banded header: icon, gold serif title, small round button. */
.trk-db-head {
  border-top: 1px solid rgba(217, 180, 90, 0.25);
  border-radius: 0;
}

#destiny-tracker.collapsed .trk-db-head {
  border-radius: 0 0 6px 6px;
}

.trk-go {
  width: 20px;
  height: 20px;
  padding: 0 0 2px 1px;
  font: 800 15px/1 var(--font);
  color: #f3e2bb;
  cursor: pointer;
  background: radial-gradient(circle at 45% 35%, #5b636e, #22272e);
  border: 1px solid #0e1013;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(200, 170, 100, 0.6);
}

.trk-db-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

/* Round spec portrait with its progress to the next level as a gold arc and a % label. */
.trk-spec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 34px;
  padding: 0;
  cursor: pointer;
  background: none;
  border: none;
}

.trk-spec-ring {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(#f0c64a var(--p, 0%), rgba(90, 96, 106, 0.9) 0);
  box-shadow: 0 0 0 1px #0c0d0f, 0 2px 4px rgba(0, 0, 0, 0.5);
}

.trk-spec-ring canvas {
  display: block;
  width: 28px !important;
  height: 28px !important;
  border-radius: 50%;
}

.trk-spec-pct {
  font-size: 10.5px;
  font-weight: 700;
  color: #e8dcc4;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 1px #000;
}

.trk-spec:hover .trk-spec-ring {
  box-shadow: 0 0 0 1px #0c0d0f, 0 0 8px rgba(240, 198, 74, 0.6);
}

.trk-db-empty {
  font-size: 12px;
  font-style: italic;
}

.trk-title {
  font-size: 14px;
  font-weight: bold;
  color: #fff1cf;
  text-shadow: 0 1px 2px #000;
}

.trk-desc {
  color: var(--text);
  text-shadow: 0 1px 0 #000;
}

.trk-hint {
  font-size: 11px;
  font-style: italic;
  color: var(--text-faint);
}

.trk-done {
  font-weight: bold;
  color: var(--good);
}

.trk-claim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.trk-claim .jr-rewards {
  justify-content: flex-start;
}

#destiny-tracker.ready {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(217, 180, 90, 0.4), 0 0 16px rgba(217, 180, 90, 0.3), 0 6px 18px rgba(0, 0, 0, 0.55);
}

#destiny-tracker.trk-tick .trk-bar > i {
  animation: trk-tick 0.7s ease-out;
}

#destiny-tracker.trk-complete,
#destiny-tracker.trk-new {
  animation: trk-pop 0.9s ease-out;
}

/* While the docked Inventory covers the tracker column the tracker becomes a one-line pill on top
   of the dock column, as wide as the Inventory (ui.js DOCK_W): the quest, its progress or the
   Claim Reward button stay in sight (pt12 c0-AkFirst-06). features/settings/layout.js moves the
   Inventory's top (--dock-top) below it. With no quest left the pill stays hidden. */
.trk-pill {
  display: none;
}

#ui.has-inventory > #destiny-tracker {
  right: 4px;
  width: 300px;
}

#ui.has-inventory > #destiny-tracker.trk-none {
  display: none;
}

#ui.has-inventory > #destiny-tracker > :not(.trk-head:first-child),
#ui.has-inventory > #destiny-tracker .trk-head-text,
#ui.has-inventory > #destiny-tracker .trk-chapter,
#ui.has-inventory > #destiny-tracker .trk-toggle {
  display: none;
}

#ui.has-inventory > #destiny-tracker > .trk-head {
  min-height: 28px;
  border-bottom-color: transparent;
  border-radius: 6px;
}

#ui.has-inventory > #destiny-tracker .trk-pill {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.trk-pill-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: bold;
  color: #fff1cf;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}

.trk-pill-prog {
  flex: none;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 1px #000;
}

.trk-pill .jr-claim {
  flex: none;
}

/* ================================================================== Level-up banner */

#destiny-levelup {
  --dlu-color: var(--gold-bright);
  position: fixed;
  left: 50%;
  bottom: 168px;
  z-index: 16;
  display: none;
  min-width: 300px;
  max-width: min(560px, 92vw);
  padding: 8px 22px 10px;
  text-align: center;
  pointer-events: none !important;
  background: radial-gradient(ellipse at 50% 40%, rgba(40, 30, 16, 0.92), rgba(12, 9, 6, 0.82) 70%, transparent 100%);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  transform: translateX(-50%);
}

#destiny-levelup.show {
  display: block;
  animation: dlu-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

#destiny-levelup.hide {
  animation: dlu-out 0.45s ease-in forwards;
}

.dlu-label {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(217, 180, 90, 0.8), 0 1px 0 #000;
}

.dlu-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 2px;
}

.dlu-icon canvas {
  display: block;
  border: 1px solid #000;
  border-radius: 5px;
  box-shadow: 0 0 0 1px var(--dlu-color), 0 0 18px var(--dlu-color);
}

.dlu-text {
  text-align: left;
}

/* Several specs levelled by the same kill share one banner. */
.dlu-texts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dlu-texts .dlu-text + .dlu-text .dlu-spec {
  font-size: 18px;
}

.dlu-spec {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: bold;
  color: #f6ecd6;
  text-shadow: 0 2px 0 #000, 0 0 18px var(--dlu-color);
}

.dlu-level {
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-shadow: 0 1px 0 #000;
}

.dlu-unlock {
  font-size: 12.5px;
  color: var(--good);
  text-shadow: 0 1px 1px #000;
}

/* ================================================================== animations */

@keyframes db-flash {
  0% { box-shadow: 0 0 0 2px var(--gold-bright), 0 0 26px rgba(240, 212, 138, 0.8); }
  100% { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.5); }
}

@keyframes db-pip-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 6px var(--tc); }
}

@keyframes trk-tick {
  0% { filter: brightness(1.9); }
  100% { filter: brightness(1); }
}

@keyframes trk-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.04); box-shadow: 0 0 22px rgba(240, 212, 138, 0.7); }
  100% { transform: scale(1); }
}

@keyframes dlu-in {
  0% { opacity: 0; transform: translateX(-50%) scale(0.7); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes dlu-out {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-18px); }
}

@media (max-width: 1000px) {
  #destiny-levelup {
    bottom: 330px;
  }
}

@media (max-width: 720px) {
  #destiny-tracker {
    width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .db-card.db-flash,
  .db-pip.next,
  #destiny-tracker.trk-complete,
  #destiny-tracker.trk-new,
  #destiny-levelup.show,
  #destiny-levelup.hide,
  .jr-badge.ready {
    animation: none !important;
  }
}

/* Tier-coloured words on the paper inspector (tier VII gold, VIII white): thin dark halo. */
#ui .db-inspector [style*="color"] {
  text-shadow: 0 0 1px #1a0f06, 0 0 2px rgba(26, 15, 6, 0.9), 0 1px 1px #1a0f06;
}
