/* 副本 — banners, difficulty skulls, the help hall, the 友情 shop, results, and the helper on the battlefield */
.dg { display: grid; gap: 10px; }
.dg img.px, .dg-sheet img.px, .dg-ally, #dgBB { image-rendering: pixelated; }

/* sub navigation */
.dg-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.dg-nav button { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 2px; border: 0; color: var(--muted); font: 14px var(--font-cn);
  background: linear-gradient(#2a2038, #1a1426); box-shadow: var(--px), inset 0 -3px 0 0 rgba(0, 0, 0, 0.35); }
.dg-nav button img { width: 18px; height: 18px; object-fit: contain; }
.dg-nav button.on { color: var(--gold); background: linear-gradient(#3a2a52, #241a36); box-shadow: var(--px), inset 0 -3px 0 0 var(--gold); transform: translateY(-1px); }
.dg-dot { position: absolute; top: 3px; right: 5px; width: 7px; height: 7px; background: var(--bad); box-shadow: 0 0 0 1px var(--edge); }

/* today's counters */
.dg-stat { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 6px; }
.dg-st { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; padding: 14px 6px 5px; background: var(--plate); box-shadow: var(--px); }
.dg-st small { position: absolute; left: 6px; top: 2px; font-size: 10px; color: var(--muted); }
.dg-st > img { width: 16px; height: 16px; object-fit: contain; }
.dg-st b { font: 700 14px var(--font-px); color: var(--text); }
.dg-tix { display: flex; gap: 2px; flex-wrap: wrap; }
.dg-tix img { width: 16px; height: 11px; }
.dg-tix img.off { filter: grayscale(1) brightness(0.45); }
.dg-plus { margin-left: auto; width: 22px; height: 22px; padding: 0; border: 0; font: 700 15px/22px var(--font-px); color: #2a1206; background: linear-gradient(var(--ember-hi), var(--ember)); box-shadow: var(--px); }

/* a fight / a help request in progress */
.dg-live, .dg-req-on { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--dc, #ffd35a) 22%, transparent), transparent 75%), var(--plate); box-shadow: var(--px), inset 2px 0 0 0 var(--dc, var(--gold)); }
.dg-live > img { width: 23px; height: 6px; transform: scale(2); transform-origin: left center; margin-right: 22px; }
.dg-live div, .dg-req-on div { display: grid; gap: 1px; min-width: 0; }
.dg-live b, .dg-req-on b { font: 15px var(--font-cn); font-weight: normal; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-live small, .dg-req-on small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-req-on { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.dg-req-on.wait { grid-template-columns: auto minmax(0, 1fr) auto; --dc: #7fd8ff; }
.dg-x { width: 26px; height: 26px; }
.dg-radar { position: relative; display: grid; place-items: center; width: 30px; height: 30px; }
.dg-radar img { width: 20px; height: 20px; animation: dgWave 1s steps(4) infinite; }
.dg-radar::before, .dg-radar::after { content: ""; position: absolute; inset: 0; border: 2px solid #7fd8ff; animation: dgPing 1.6s steps(8) infinite; }
.dg-radar::after { animation-delay: 0.8s; }
@keyframes dgPing { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
@keyframes dgWave { 50% { transform: rotate(-12deg); } }

/* dungeon cards */
.dg-cards { display: grid; gap: 8px; }
.dg-card { --dc: #ffd35a; background: var(--plate); box-shadow: var(--px), inset 0 0 0 1px color-mix(in srgb, var(--dc) 30%, transparent); }
.dg-card.on { box-shadow: var(--px), inset 0 0 0 2px var(--dc), 0 0 14px color-mix(in srgb, var(--dc) 35%, transparent); }
.dg-head { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: pointer; overflow: hidden; font: inherit; color: inherit; text-align: left; }
.dg-head::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 4, 12, 0.75), rgba(6, 4, 12, 0.15) 55%, transparent); pointer-events: none; z-index: 1; }
.dg-card.on .dg-head::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.13) 50%, transparent 60%) no-repeat; background-size: 260% 100%; animation: shine 4.5s steps(24) infinite; }
.dg-bn { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; }
.dg-name { position: absolute; left: 10px; bottom: 7px; z-index: 2; display: grid; gap: 1px; text-shadow: 0 2px 0 #000, 1px 0 0 #000, -1px 0 0 #000; }
.dg-name b { font: 24px var(--font-cn); font-weight: normal; color: #fff; letter-spacing: 2px; }
.dg-name small { font-size: 12px; color: var(--dc); }
.dg-marks { position: absolute; left: 10px; top: 8px; z-index: 2; display: flex; gap: 4px; }
.dg-marks i { width: 9px; height: 9px; background: rgba(0, 0, 0, 0.55); box-shadow: 0 0 0 1px #000, inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.dg-marks i.on { background: var(--kc); box-shadow: 0 0 0 1px #000, 0 0 6px var(--kc); }
.dg-lock-i { position: absolute; right: 10px; top: 8px; z-index: 2; font-size: 18px; filter: grayscale(1); }
.dg-card.lk .dg-bn { filter: grayscale(0.85) brightness(0.42); }
.dg-card.lk .dg-name b { color: #a596b6; }
.dg-card.lk .dg-name small { color: var(--muted); }

/* the open card */
.dg-det { display: grid; gap: 8px; padding: 8px 10px 10px; }
.dg-lore { margin: 0; font-size: 12px; color: #d8cce8; }
.dg-ks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.dg-k { position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px 4px; border: 0; color: var(--muted); font: 14px var(--font-cn); background: #151020; box-shadow: var(--px), inset 0 -2px 0 0 rgba(0, 0, 0, 0.4); }
.dg-k img { height: 12px; width: auto; }
.dg-k.on { color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, #151020); box-shadow: var(--px), inset 0 -3px 0 0 var(--kc); }
.dg-k.lk { opacity: 0.55; }
.dg-k.lk::after { content: "🔒"; position: absolute; right: 4px; top: 2px; font-size: 10px; filter: grayscale(1); }
.dg-k i { position: absolute; left: 4px; top: 2px; font-style: normal; font-size: 11px; color: var(--good); }
.dg-info { display: grid; grid-template-columns: 0.8fr 1.1fr 1.1fr; gap: 5px; }
.dg-info div { display: grid; gap: 1px; padding: 4px 6px; background: #120d1c; box-shadow: 0 0 0 1px var(--line); min-width: 0; }
.dg-info small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.dg-info b { font: 700 15px var(--font-px); color: #fff; }
.dg-info em { font: 12px var(--font-cn); font-style: normal; }
.v-good { color: var(--good) !important; } .v-ok { color: var(--gold) !important; } .v-help { color: #7fd8ff !important; } .v-bad { color: var(--bad) !important; }
.dg-meter { position: relative; height: 10px; background: #0c0814; box-shadow: 0 0 0 1px #000; }
.dg-meter i { position: absolute; left: 0; top: 0; bottom: 0; }
.dg-meter i.h { background: repeating-linear-gradient(90deg, #2a8ab0 0 4px, #1a5a78 4px 6px); }
.dg-meter i.me { background: linear-gradient(90deg, #c88a1a, var(--gold)); }
.dg-meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 4px #fff; }
.dg-mtip { font-size: 10px; color: var(--muted); }

/* drop table */
.dg-drops { padding: 6px 8px; background: #120d1c; box-shadow: 0 0 0 1px var(--line); }
.dg-drops h5 { margin: 0 0 4px; font: 14px var(--font-cn); font-weight: normal; color: var(--ember-hi); }
.dg-drops h5 small { font-size: 11px; color: var(--muted); }
.dg-drops ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 4px 12px; align-items: center; }
.dg-drops li { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.dg-drops li.w { grid-column: 1 / -1; }
.dg-drops li small { font-size: 11px; color: var(--muted); }
.dg-drops li.q { font-size: 11px; flex-wrap: wrap; gap: 2px 4px; }
.dg-drops li.q i { font-style: normal; }
.dg-drops li.rb .cost-i { color: #fff6c0; }
.dg-drops li.first .cost-i { color: #ff9ade; }
.dg-drops .cost-i img { width: 14px; height: 14px; object-fit: contain; }

/* buttons */
.dg-acts { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 6px; }
.dg-acts .btn { display: grid; justify-items: center; gap: 0; padding: 5px 8px; line-height: 1.2; }
.dg-acts .btn small { font-size: 10px; }
.dg-go { font-size: 18px; }
.dg-hb span { display: inline-flex; align-items: center; gap: 4px; }
.dg-hi { width: 14px; height: 14px; }
.dg-hb.hot { background: linear-gradient(#9ff0ff, #3ab0d8); color: #06202a; box-shadow: var(--px), 0 0 10px rgba(127, 216, 255, 0.6); animation: pulse 1s steps(2) infinite; }
.dg-lockk { margin: 0; padding: 8px; text-align: center; font-size: 13px; color: var(--muted); background: #120d1c; box-shadow: 0 0 0 1px var(--line); }
.dg-note { margin: 0; }

/* help hall + shop */
.dg-hall-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px;
  background: radial-gradient(circle at 10% 50%, rgba(255, 138, 184, 0.2), transparent 50%), var(--plate); box-shadow: var(--px); }
.dg-hall-top > img { width: 30px; height: 30px; object-fit: contain; }
.dg-hall-top div { display: grid; gap: 1px; min-width: 0; }
.dg-hall-top b { font: 17px var(--font-cn); font-weight: normal; color: #ffd0e4; }
.dg-hall-top small { font-size: 11px; color: var(--muted); }
.dg-fpb .cost-i { font-size: 15px; color: #ff9ade; }
.dg-fpb .cost-i img, .dg-fpc img { width: 16px; height: 14px; }
.dg-hp { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; gap: 8px; align-items: center; padding: 0 2px; font-size: 12px; }
.dg-hp b { color: var(--gold); }
.dg-hp i { position: relative; height: 8px; background: #0c0814; box-shadow: 0 0 0 1px #000; }
.dg-hp i b { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #d0407a, #ff8ab8); }
.dg-hp small { color: var(--muted); font-size: 11px; }
.dg-rqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dg-rq { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; background: #151020; box-shadow: 0 0 0 1px var(--line), inset 2px 0 0 0 var(--dc); }
.dg-rm { display: grid; gap: 2px; min-width: 0; }
.dg-rn { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.dg-rn small { flex: none; font-size: 11px; color: var(--muted); }
.dg-say { position: relative; margin: 0; padding: 3px 7px; font-size: 12px; color: #2a1e36; background: #f2e8ff; box-shadow: 0 0 0 1px #000; justify-self: start; max-width: 100%; }
.dg-rd { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--dc); }
.dg-rd img { height: 8px; width: auto; }
.dg-rq .btn { display: grid; justify-items: center; line-height: 1.15; }
.dg-rq .btn small { font-size: 10px; }
.dg-empty { display: grid; justify-items: center; gap: 4px; padding: 18px 8px; background: #151020; box-shadow: 0 0 0 1px var(--line); text-align: center; }
.dg-empty img { width: 30px; height: 30px; opacity: 0.6; }
.dg-empty p { margin: 0; }
.dg-shop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dg-si { position: relative; display: grid; justify-items: center; gap: 2px; padding: 8px 6px 6px; text-align: center; background: #151020; box-shadow: 0 0 0 1px var(--line); }
.dg-si > img { width: 28px; height: 26px; object-fit: contain; }
.dg-si b { font: 14px var(--font-cn); font-weight: normal; }
.dg-si small { font-size: 10px; color: var(--muted); min-height: 2.4em; }
.dg-si .btn { width: 100%; padding: 3px 4px; }
.dg-lim { position: absolute; right: 4px; top: 3px; font-size: 10px; color: var(--muted); }
.dg-si.out { opacity: 0.55; }

/* result sheet */
.dg-sheet .dg-res { display: grid; gap: 8px; }
.dg-res-top { position: relative; overflow: hidden; box-shadow: var(--px); }
.dg-res-top .dg-bn { aspect-ratio: 3 / 1; width: 100%; height: auto; display: block; object-fit: cover; }
.dg-res-top::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(6, 4, 12, 0.8)); pointer-events: none; }
.dg-stamp { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%) rotate(-4deg); padding: 2px 14px; font: 30px var(--font-cn); font-weight: normal; letter-spacing: 3px; white-space: nowrap;
  color: #fff6c0; text-shadow: 0 2px 0 #3a1a08, 0 0 12px rgba(255, 211, 90, 0.8); animation: dgStamp 0.4s steps(6); }
.dg-res.lose .dg-stamp { color: #ffb0b8; text-shadow: 0 2px 0 #3a0612, 0 0 10px rgba(255, 77, 106, 0.6); }
.dg-res-top > small { position: absolute; left: 0; right: 0; bottom: 5px; display: flex; justify-content: center; align-items: center; gap: 4px; font-size: 12px; color: #fff; text-shadow: 0 1px 0 #000; }
.dg-sk { height: 6px; width: auto; transform: scale(1.5); margin: 0 4px; }
@keyframes dgStamp { 0% { transform: translate(-50%, -50%) rotate(-4deg) scale(2.4); opacity: 0; } 70% { transform: translate(-50%, -50%) rotate(-4deg) scale(0.92); opacity: 1; } }
.dg-bar { position: relative; height: 16px; background: #0c0814; box-shadow: 0 0 0 1px #000; overflow: hidden; }
.dg-bar i { position: absolute; top: 0; bottom: 0; }
.dg-bar i.me { left: 0; background: linear-gradient(90deg, #c88a1a, var(--gold)); }
.dg-bar i.al { background: linear-gradient(90deg, #2a8ab0, #9ff0ff); }
.dg-bar span { position: absolute; inset: 0; font: 700 11px/16px var(--font-px); text-align: center; color: #fff; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000; }
.dg-res-l { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.dg-gain { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 8px; padding: 8px; background: #120d1c; box-shadow: 0 0 0 1px var(--line); }
.dg-rw .cost-i { font-size: 14px; }
.dg-rw .cost-i img { width: 16px; height: 16px; object-fit: contain; }
.dg-gem { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 3px; font: 12px var(--font-cn); color: var(--gq); background: rgba(0, 0, 0, 0.35); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gq) 55%, transparent); }
.dg-gem img { width: 16px; height: 16px; object-fit: contain; }
.dg-gem.rb { color: #fff; background: linear-gradient(90deg, rgba(255, 90, 90, 0.35), rgba(255, 211, 90, 0.35), rgba(98, 230, 135, 0.35), rgba(90, 200, 255, 0.35), rgba(192, 108, 255, 0.35)); animation: pulse 0.8s steps(2) infinite; }
.dg-first { margin: 0; text-align: center; font-size: 13px; color: #ff9ade; }
.dg-thx { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; }
.dg-thx p { margin: 0; padding: 5px 9px; font-size: 13px; color: #2a1e36; background: #f2e8ff; box-shadow: 0 0 0 1px #000; }
.dg-thx p b { color: #6a2aa8; margin-right: 4px; }
.dg-tip { display: grid; gap: 2px; padding: 6px 10px; font-size: 12px; background: rgba(120, 50, 10, 0.3); box-shadow: 0 0 0 1px rgba(255, 161, 46, 0.35); }
.dg-tip b { font: 13px var(--font-cn); font-weight: normal; color: var(--ember-hi); }
.dg-res .dg-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.dg-res .dg-acts .btn { display: inline-flex; gap: 4px; }
.dg-buy { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.dg-buy img { width: 44px; height: 28px; }
.dg-buy p { margin: 0; }
.dg-rbt { background: linear-gradient(90deg, #ff6a6a, #ffd35a, #62e687, #5ac8ff, #c06cff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- in battle: progress on the boss bar, the helper fighting beside the hero ---- */
#bossbar.dg-on > #bbName, #bossbar.dg-on > .bb-track { display: none; }
#bossbar.dg-on > #bbTime { grid-column: 3; grid-row: 1; }
.dg-bb { grid-column: 1 / 3; grid-row: 1; position: relative; height: 14px; background: rgba(10, 6, 16, 0.85); box-shadow: 0 0 0 1px #000, 0 0 0 2px rgba(255, 211, 90, 0.35); overflow: hidden; }
.dg-bb i { position: absolute; top: 0; bottom: 0; transition: width 0.12s steps(2), left 0.12s steps(2); }
.dg-bb i.me { left: 0; background: linear-gradient(90deg, #c88a1a, var(--gold)); }
.dg-bb i.al { background: linear-gradient(90deg, #2a8ab0, #9ff0ff); }
.dg-bb span { position: absolute; inset: 0; font: 700 10px/14px var(--font-px); text-align: center; color: #fff; white-space: nowrap; text-shadow: 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000; }
/* the helper stands just behind the hero, a step up the slope so the chat bubble in the corner never hides its feet */
.dg-ally { position: absolute; left: 3%; top: 53.5%; width: 22.22%; height: 28.33%; z-index: 1; pointer-events: none;
  background-image: var(--u); background-size: 200% 100%; background-position: 0 0; background-repeat: no-repeat;
  animation: dgIn 0.5s steps(5), dgBob 1.1s steps(2) 0.5s infinite; filter: drop-shadow(0 0 2px rgba(127, 216, 255, 0.75)); }
.dg-ally.nb { filter: drop-shadow(0 0 2px rgba(255, 138, 184, 0.7)); }
.dg-ally.sw { animation: dgSw 0.3s steps(1), dgBob 1.1s steps(2) infinite; }
.dg-ally i { position: absolute; left: 30%; bottom: 102%; transform: translateX(-50%); padding: 0 3px; font: 600 9px/12px var(--font-body); font-style: normal; white-space: nowrap; color: #9ff0ff; background: rgba(6, 4, 12, 0.6); text-shadow: 0 1px 0 #000; }
.dg-ally.nb i { color: #ffc0dc; }
@keyframes dgIn { 0% { opacity: 0; filter: brightness(4) drop-shadow(0 0 6px #fff); transform: translateY(-20%); } 100% { opacity: 1; } }
@keyframes dgBob { 50% { transform: translateY(-3%); } }
@keyframes dgSw { 0% { background-position: 100% 0; } 100% { background-position: 100% 0; } }
.dg-bolt { position: absolute; left: 18%; top: 66%; width: 7%; height: 2.4%; z-index: 1; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, transparent, #9ff0ff 40%, #ffffff); box-shadow: 0 0 6px #9ff0ff; }
.dg-bolt.nb { background: linear-gradient(90deg, transparent, #ff8ab8 40%, #ffffff); box-shadow: 0 0 6px #ff8ab8; }
.dg-bolt.go { animation: dgBolt 0.36s steps(6); }
@keyframes dgBolt { 0% { opacity: 1; transform: translateX(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(900%); } }
@media (max-width: 380px) {
  .dg-stat { grid-template-columns: 1fr 1fr; }
  .dg-stat .dg-st:first-child { grid-column: 1 / -1; }
  .dg-acts { grid-template-columns: 1fr 1fr; }
  .dg-acts .dg-sw { grid-column: 1 / -1; }
  .dg-info { grid-template-columns: 1fr 1fr; }
  .dg-info div:first-child { grid-column: 1 / -1; }
  .dg-drops ul { grid-template-columns: repeat(2, auto); }
}
