/* v354: Dungeon tab, drawn like the upgrade window and the item cards: quiet dark panels, game art and rarity-coloured
   game cards carry the colour. Focus = the depth track (one step per room, current room glowing, boss at the end).
   Tokens follow .interface-design/system.md (ink #f0edff, soft #b7b6cc, dim #8a8ea8, gold #f4d38a, green #72dfb2, red #ff8293). */
#panel-dungeon {
  --dg-ink: #f0edff; --dg-soft: #b7b6cc; --dg-dim: #8a8ea8;
  --dg-gold: #f4d38a; --dg-green: #72dfb2; --dg-red: #ff8293;
  --dg-panel: linear-gradient(165deg, rgb(27 30 54 / 94%), rgb(14 17 32 / 94%));
  --dg-line: 1px solid rgb(152 140 203 / 20%);
  --dg-well: rgb(6 8 18 / 55%);
  --dg-ease: cubic-bezier(.23, 1, .32, 1);
}

/* hero: room + depth track on the left, three loot cards on the right */
#panel-dungeon .dg-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px; margin: 12px 0 16px; }
#panel-dungeon .dg-room { display: grid; align-content: start; gap: 12px; padding: 14px 16px; border: var(--dg-line); border-radius: 16px; background: var(--dg-panel); box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%); }
#panel-dungeon .dg-room-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
#panel-dungeon .dg-room-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--dg-well); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%); color: var(--dg-soft); font-size: 20px; }
#panel-dungeon .dg-room-icon img { width: 34px; height: 34px; object-fit: contain; image-rendering: pixelated; }
#panel-dungeon .dg-room-copy { display: grid; gap: 2px; min-width: 0; }
#panel-dungeon .dg-eyebrow { color: var(--dg-dim); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
#panel-dungeon .dg-room-copy strong { color: var(--dg-ink); font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
#panel-dungeon .dg-room-state { padding: 4px 10px; border-radius: 999px; background: rgb(255 255 255 / 6%); color: var(--dg-soft); font-size: 11px; font-weight: 700; white-space: nowrap; }
#panel-dungeon .dg-room-state:empty { display: none; }
#panel-dungeon .dg-room-state.is-live { background: rgb(114 223 178 / 12%); color: var(--dg-green); box-shadow: inset 0 0 0 1px rgb(114 223 178 / 30%); }

/* the depth track: equal steps, done = gold, current = glowing, boss = red frame */
#panel-dungeon .dg-track { display: grid; grid-template-columns: repeat(var(--dg-rooms, 20), minmax(0, 1fr)); gap: 4px; margin: 0; padding: 8px; list-style: none; border-radius: 12px; background: var(--dg-well); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 6%); }
#panel-dungeon .dg-step { position: relative; height: 22px; border-radius: 5px; background: rgb(255 255 255 / 7%); }
#panel-dungeon .dg-step.is-done { background: linear-gradient(180deg, #ffe08a, #c98a1e); box-shadow: inset 0 1px 0 rgb(255 255 255 / 45%); }
#panel-dungeon .dg-step.is-here { background: linear-gradient(180deg, #a7ffd4, #2fbf7c); box-shadow: 0 0 0 2px rgb(114 223 178 / 35%), 0 0 14px rgb(114 223 178 / 55%); animation: dg-pulse 1.8s var(--dg-ease) infinite; }
#panel-dungeon .dg-step.is-boss { box-shadow: inset 0 0 0 2px rgb(255 130 147 / 75%); }
#panel-dungeon .dg-step.is-boss::after { content: "☠"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--dg-red); font-size: 12px; line-height: 1; }
#panel-dungeon .dg-step.is-boss.is-done::after, #panel-dungeon .dg-step.is-boss.is-here::after { color: #3a0d14; }
#panel-dungeon .dg-track-ends { display: flex; justify-content: space-between; margin-top: -4px; color: var(--dg-dim); font-size: 11px; }
@keyframes dg-pulse { 50% { box-shadow: 0 0 0 2px rgb(114 223 178 / 20%), 0 0 6px rgb(114 223 178 / 30%); } }

/* loot: rarity game cards like the item tab (gold coin, wooden chest, purple rare chest) */
#panel-dungeon .dg-loot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#panel-dungeon .dg-loot-card { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-rows: 52px auto auto; justify-items: center; align-content: center; gap: 4px; padding: 12px 6px; border-radius: 14px; background: var(--dg-fill); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 26%), inset 0 1px 0 rgb(255 255 255 / 40%), 0 8px 18px -10px var(--dg-glow); text-align: center; }
#panel-dungeon .dg-loot-card::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(90% 55% at 50% 0%, rgb(255 255 255 / 34%), transparent 70%), repeating-linear-gradient(135deg, rgb(255 255 255 / 7%) 0 2px, transparent 2px 9px), linear-gradient(180deg, transparent 55%, rgb(0 0 0 / 42%)); }
#panel-dungeon .dg-loot-card.is-coin { --dg-fill: linear-gradient(165deg, #ffd864 0%, #b0560c 78%); --dg-glow: #ffbf3a; }
#panel-dungeon .dg-loot-card.is-chest { --dg-fill: linear-gradient(165deg, #c58a55 0%, #4d2a12 80%); --dg-glow: #c58a55; }
#panel-dungeon .dg-loot-card.is-rare { --dg-fill: linear-gradient(165deg, #c891ff 0%, #4a1d9c 78%); --dg-glow: #b16cff; }
#panel-dungeon .dg-loot-art { display: grid; place-items: center; width: 52px; height: 52px; color: #fff; font-size: 22px; }
#panel-dungeon .dg-loot-art img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 0 1px rgb(255 255 255 / 70%)) drop-shadow(0 4px 5px rgb(0 0 0 / 55%)); }
#panel-dungeon .dg-loot-card:is(.is-chest, .is-rare) .dg-loot-art img { image-rendering: pixelated; }
#panel-dungeon .dg-loot-card strong { padding: 1px 9px; border-radius: 999px; background: rgb(0 0 0 / 50%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%); color: #fff; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
#panel-dungeon .dg-loot-card > span:last-child { color: #fff; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px rgb(0 0 0 / 75%); }

/* chest rewards: today / all time, each reward a small game card */
#panel-dungeon .dchest { margin: 0 0 16px; padding: 14px 16px; border: var(--dg-line); border-radius: 16px; background: var(--dg-panel); }
#panel-dungeon .dchest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#panel-dungeon .dchest-title { margin: 0; color: var(--dg-ink); font-size: 15px; font-weight: 700; }
#panel-dungeon .dchest-hint { color: var(--dg-dim); font-size: 11px; }
#panel-dungeon .dchest-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#panel-dungeon .dchest-col { min-width: 0; }
#panel-dungeon .dchest-col-title { margin: 0 0 8px; color: var(--dg-soft); font-size: 12px; font-weight: 700; }
#panel-dungeon .dchest-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
#panel-dungeon .dchest-row { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-rows: 36px 28px auto; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 8px 4px; border-radius: 12px; background: var(--card-fill, linear-gradient(165deg, #3a3f58, #1b1e30)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%), 0 6px 14px -8px var(--card-glow, transparent); text-align: center; }
#panel-dungeon .dchest-row::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(90% 55% at 50% 0%, rgb(255 255 255 / 28%), transparent 70%), linear-gradient(180deg, transparent 55%, rgb(0 0 0 / 40%)); }
#panel-dungeon .dchest-art { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; }
#panel-dungeon .dchest-art img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 55%)); }
#panel-dungeon .dchest-name { display: -webkit-box; overflow: hidden; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 14px; text-shadow: 0 1px 2px rgb(0 0 0 / 75%); -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
#panel-dungeon .dchest-qty { padding: 0 7px; border-radius: 999px; background: rgb(0 0 0 / 50%); color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; }
#panel-dungeon .dchest-row.is-rr { box-shadow: inset 0 0 0 2px rgb(244 211 138 / 70%), 0 6px 14px -6px rgb(244 211 138 / 60%); }
#panel-dungeon .dchest-empty { margin: 0; color: var(--dg-dim); font-size: 12px; }

/* buffs and curses: two columns, each card a dark tile with the game icon and a tier pill */
#panel-dungeon .dungeon-effects-heading { margin: 0 0 8px; }
#panel-dungeon .dungeon-effects-scroll { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; max-height: none; padding: 0; overflow: visible; border: 0; background: none; }
#panel-dungeon .dg-col { display: grid; gap: 8px; min-width: 0; padding: 12px; border: var(--dg-line); border-radius: 16px; background: var(--dg-panel); }
#panel-dungeon .dg-col.is-buff { box-shadow: inset 0 2px 0 rgb(114 223 178 / 45%); }
#panel-dungeon .dg-col.is-curse { box-shadow: inset 0 2px 0 rgb(255 130 147 / 45%); }
#panel-dungeon .dungeon-effects-group { margin: 0 0 2px; padding: 0 2px; border: 0; background: none; font-size: 13px; }
#panel-dungeon .dungeon-effects-group.is-buff { color: var(--dg-green); }
#panel-dungeon .dungeon-effects-group.is-curse { color: var(--dg-red); }
#panel-dungeon .dungeon-effects-group span { padding: 1px 8px; border-radius: 999px; background: rgb(255 255 255 / 6%); color: var(--dg-soft); font-size: 11px; }
#panel-dungeon .dungeon-effect-card { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; min-height: 60px; padding: 8px 10px 8px 8px; border: 0; border-radius: 12px; background: rgb(255 255 255 / 3%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 7%); transition: background-color .15s var(--dg-ease); }
#panel-dungeon .dungeon-effect-card:hover { background: rgb(255 255 255 / 6%); }
#panel-dungeon .dungeon-effect-icon { width: 44px; height: 44px; border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%); }
#panel-dungeon .is-buff .dungeon-effect-icon { background: radial-gradient(circle at 50% 40%, rgb(114 223 178 / 22%), rgb(6 8 18 / 60%) 70%); }
#panel-dungeon .is-curse .dungeon-effect-icon { background: radial-gradient(circle at 50% 40%, rgb(255 130 147 / 22%), rgb(6 8 18 / 60%) 70%); }
#panel-dungeon .dungeon-effect-game-image { width: 36px; height: 36px; }
#panel-dungeon .dungeon-effect-kind { justify-self: start; padding: 0 7px; border-radius: 999px; background: rgb(255 255 255 / 6%); font-size: 10px; letter-spacing: .04em; line-height: 16px; }
#panel-dungeon .dungeon-effect-copy { gap: 3px; }
#panel-dungeon .dungeon-effect-copy strong { font-size: 13px; }
#panel-dungeon .dungeon-effect-copy small { color: var(--dg-soft); }
#panel-dungeon .dungeon-effect-quantity { align-self: center; padding: 1px 7px; border-radius: 999px; background: rgb(0 0 0 / 40%); color: var(--dg-ink); }
/* legendary buff and severe curse stand out like a rarer card */
#panel-dungeon .dungeon-effect-card.tier-legendary { background: linear-gradient(120deg, rgb(255 216 100 / 16%), rgb(255 255 255 / 3%) 60%); box-shadow: inset 0 0 0 1px rgb(244 211 138 / 45%); }
#panel-dungeon .dungeon-effect-card.tier-legendary .dungeon-effect-kind { background: rgb(244 211 138 / 18%); color: var(--dg-gold); }
#panel-dungeon .dungeon-effect-card.tier-super { background: linear-gradient(120deg, rgb(255 82 104 / 18%), rgb(255 255 255 / 3%) 60%); box-shadow: inset 0 0 0 1px rgb(255 130 147 / 45%); }
#panel-dungeon .dungeon-effects-scroll > :is(.snapshot-empty, .challenge-empty) { grid-column: 1 / -1; }

@media (max-width: 860px) {
  #panel-dungeon .dg-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  #panel-dungeon .dg-room { padding: 12px; }
  #panel-dungeon .dg-room-copy strong { font-size: 22px; }
  #panel-dungeon .dg-track { gap: 3px; padding: 6px; }
  #panel-dungeon .dg-step { height: 18px; border-radius: 4px; }
  #panel-dungeon .dchest-grid, #panel-dungeon .dungeon-effects-scroll { grid-template-columns: minmax(0, 1fr); }
  #panel-dungeon .dchest-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { #panel-dungeon .dg-step.is-here { animation: none; } }

/* v355: one chest list; today's share is a small green tag on the card */
#panel-dungeon .dchest-col.is-single .dchest-list { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
#panel-dungeon .dchest-row { grid-template-rows: 36px 28px auto auto; }
#panel-dungeon .dchest-today { padding: 0 6px; border-radius: 999px; background: rgb(114 223 178 / 22%); box-shadow: inset 0 0 0 1px rgb(114 223 178 / 45%); color: #c9ffe6; font-size: 10px; font-style: normal; font-weight: 700; line-height: 15px; }

/* v465: chests per run (dungeon-chests.js). Each run is a quiet inner tile: a header line, the run's own depth track (rooms
   the chests came from lit purple = Rare, wood = normal; boss red ring), the totals as game reward tiles (the focal point),
   every chest on its own line, then the buffs (green line) and curses (red line) the run picked up. */
#panel-dungeon .drun-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
#panel-dungeon .drun-card { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: rgb(8 11 22 / 42%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 6%); }
#panel-dungeon .drun-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#panel-dungeon .drun-no { color: var(--dg-ink); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
#panel-dungeon .drun-time { color: var(--dg-dim); font-size: 12px; font-variant-numeric: tabular-nums; }
#panel-dungeon .drun-end { margin-left: auto; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
#panel-dungeon .drun-end.is-win { background: rgb(114 223 178 / 12%); box-shadow: inset 0 0 0 1px rgb(114 223 178 / 30%); color: var(--dg-green); }
#panel-dungeon .drun-end.is-out { background: rgb(255 130 147 / 12%); box-shadow: inset 0 0 0 1px rgb(255 130 147 / 30%); color: var(--dg-red); }
#panel-dungeon .drun-track { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 3px; margin: 0; padding: 0; list-style: none; }
#panel-dungeon .drun-step { height: 10px; border-radius: 3px; background: rgb(255 255 255 / 7%); }
#panel-dungeon .drun-step.is-done { background: rgb(244 211 138 / 34%); }
#panel-dungeon .drun-step.is-chest { background: linear-gradient(180deg, #e0a46b, #6b3a18); box-shadow: 0 0 0 1px rgb(197 138 85 / 70%); }
#panel-dungeon .drun-step.is-gold { background: linear-gradient(180deg, #d9a8ff, #6a2fc4); box-shadow: 0 0 0 1px rgb(200 145 255 / 75%), 0 0 8px rgb(177 108 255 / 55%); }
#panel-dungeon .drun-step.is-boss { box-shadow: inset 0 0 0 1px rgb(255 130 147 / 75%); }
#panel-dungeon .drun-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: 12px; }
#panel-dungeon :is(.drun-loot, .drun-effects) { display: grid; gap: 8px; min-width: 0; }
#panel-dungeon .drun-sum { margin: 0; color: var(--dg-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
#panel-dungeon .drun-sum b { color: var(--dg-ink); font-size: 14px; font-weight: 800; }
#panel-dungeon .drun-total { display: flex; flex-wrap: wrap; gap: 6px; }
#panel-dungeon .drun-reward { display: inline-grid; grid-template-columns: 28px auto auto; align-items: center; gap: 6px; min-height: 36px; padding: 3px 10px 3px 4px; border-radius: 10px; background: rgb(255 255 255 / 4%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%); }
#panel-dungeon .drun-reward img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 2px 3px rgb(0 0 0 / 55%)); }
#panel-dungeon .drun-reward-name { color: var(--dg-soft); font-size: 12px; font-weight: 600; }
#panel-dungeon .drun-reward b { color: var(--dg-ink); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
#panel-dungeon .drun-reward.is-rr { background: rgb(244 211 138 / 10%); box-shadow: inset 0 0 0 1px rgb(244 211 138 / 40%); }
#panel-dungeon .drun-reward.is-rr b { color: var(--dg-gold); }
#panel-dungeon .drun-chests { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
#panel-dungeon .drun-chests li { display: grid; grid-template-columns: 20px 52px minmax(0, 1fr); align-items: center; gap: 8px; color: var(--dg-soft); font-size: 12px; }
#panel-dungeon .drun-chests img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
#panel-dungeon .drun-chests b { color: #e7c9a8; font-weight: 700; }
#panel-dungeon .drun-chests li.is-rare b { color: #e2b8ff; }
#panel-dungeon .drun-chests span { min-width: 0; overflow-wrap: anywhere; }
#panel-dungeon .drun-chests .drun-none { color: var(--dg-dim); font-style: italic; }
#panel-dungeon .drun-fold summary { color: var(--dg-soft); font-size: 12px; font-weight: 600; cursor: pointer; }
#panel-dungeon .drun-fold[open] summary { margin-bottom: 6px; }
#panel-dungeon .drun-fx-group { display: grid; gap: 6px; padding: 8px 10px 10px; border-radius: 10px; background: rgb(255 255 255 / 3%); }
#panel-dungeon .drun-fx-group.is-buff { box-shadow: inset 0 2px 0 rgb(114 223 178 / 45%); }
#panel-dungeon .drun-fx-group.is-curse { box-shadow: inset 0 2px 0 rgb(255 130 147 / 45%); }
#panel-dungeon .drun-fx-label { color: var(--dg-dim); font-size: 11px; font-weight: 700; }
#panel-dungeon .drun-fx-row { display: flex; flex-wrap: wrap; gap: 4px; }
#panel-dungeon .drun-fx { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 2px 8px 2px 3px; border-radius: 8px; background: rgb(6 8 18 / 55%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%); color: var(--dg-ink); font-size: 11px; font-weight: 600; }
#panel-dungeon .drun-fx img { width: 22px; height: 22px; object-fit: contain; }
#panel-dungeon .drun-fx.is-curse { color: #ffc4cd; }
#panel-dungeon .drun-fx b { color: var(--dg-soft); font-size: 10px; }
#panel-dungeon .drun-more { min-height: 36px; margin-top: 10px; padding: 0 14px; border: var(--dg-line); border-radius: 999px; background: rgb(255 255 255 / 4%); color: var(--dg-soft); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: background-color .15s var(--dg-ease), color .15s var(--dg-ease); }
#panel-dungeon .drun-more:hover { background: rgb(255 255 255 / 8%); color: var(--dg-ink); }
#panel-dungeon .drun-more:active { transform: scale(.97); }
#panel-dungeon :is(.drun-more, .drun-fold summary):focus-visible { outline: 2px solid #c6a8ff; outline-offset: 2px; }
@media (max-width: 760px) {
  #panel-dungeon .drun-body { grid-template-columns: minmax(0, 1fr); }
  #panel-dungeon .drun-end { margin-left: 0; }
  #panel-dungeon .drun-track { gap: 2px; }
}

/* v356: Dungeon Run Key card above the chest rewards */
#panel-dungeon .dg-keys { margin: 0 0 12px; }
#panel-dungeon .dg-key-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; border: var(--dg-line); border-radius: 16px; background: linear-gradient(120deg, rgb(244 211 138 / 12%), transparent 55%), var(--dg-panel); box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%); }
#panel-dungeon .dg-key-art { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--dg-well); box-shadow: inset 0 0 0 1px rgb(244 211 138 / 30%); font-size: 24px; }
#panel-dungeon .dg-key-art img { width: 42px; height: 42px; object-fit: contain; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 55%)); }
#panel-dungeon .dg-key-copy { display: grid; gap: 2px; min-width: 0; }
#panel-dungeon .dg-key-copy strong { color: var(--dg-ink); font-size: 22px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
#panel-dungeon .dg-key-state { padding: 4px 10px; border-radius: 999px; background: rgb(114 223 178 / 12%); box-shadow: inset 0 0 0 1px rgb(114 223 178 / 30%); color: var(--dg-green); font-size: 11px; font-weight: 700; white-space: nowrap; }
#panel-dungeon .dg-key-card.is-empty { background: linear-gradient(120deg, rgb(255 130 147 / 12%), transparent 55%), var(--dg-panel); }
#panel-dungeon .dg-key-card.is-empty .dg-key-state { background: rgb(255 130 147 / 12%); box-shadow: inset 0 0 0 1px rgb(255 130 147 / 35%); color: var(--dg-red); }

/* v655 owner 2026-11-28: loot cards drawn like the review poster cards. Dark card, rarity frame (the --card-glow colour that
   item-rarity.js sets), soft rarity light at the top, fine diagonal lines, rarity tag + sparkle, bigger art, dark count pill. */
#panel-dungeon .dchest-col.is-single .dchest-list { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; }
#panel-dungeon .dchest-col.is-single .dchest-row { --tone: var(--card-glow, #8f93b2); grid-template-rows: 66px 32px auto auto; gap: 5px; padding: 28px 8px 10px; border-radius: 16px;
  background: radial-gradient(120% 70% at 50% 18%, color-mix(in srgb, var(--tone) 48%, transparent), transparent 62%), repeating-linear-gradient(135deg, rgb(255 255 255 / 4%) 0 2px, transparent 2px 9px), linear-gradient(180deg, color-mix(in srgb, var(--tone) 22%, #11142a), #0b0d1c);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tone) 85%, transparent), 0 0 20px -4px color-mix(in srgb, var(--tone) 70%, transparent), 0 10px 22px -10px rgb(0 0 0 / 70%); }
#panel-dungeon .dchest-col.is-single .dchest-row::before { background: radial-gradient(90% 40% at 50% 0%, rgb(255 255 255 / 14%), transparent 70%); }
#panel-dungeon .dchest-col.is-single .dchest-row.is-rr { box-shadow: inset 0 0 0 2px #f4d38a, 0 0 24px -2px rgb(244 211 138 / 75%), 0 10px 22px -10px rgb(0 0 0 / 70%); }
#panel-dungeon .dchest-col.is-single .dchest-art { width: 66px; height: 66px; }
#panel-dungeon .dchest-col.is-single .dchest-art img { width: 62px; height: 62px; filter: drop-shadow(0 6px 10px rgb(0 0 0 / 60%)); }
#panel-dungeon .dchest-col.is-single .dchest-name { align-self: center; font-size: 12.5px; font-weight: 800; line-height: 15px; }
#panel-dungeon .dchest-col.is-single .dchest-qty { padding: 2px 12px; background: rgb(0 0 0 / 58%); font-size: 14px; font-weight: 800; }
#panel-dungeon .dchest-rar { position: absolute; top: 7px; left: 7px; padding: 1px 7px; border-radius: 999px; background: rgb(0 0 0 / 50%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-glow, #fff) 55%, transparent); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .06em; line-height: 15px; }
#panel-dungeon .dchest-spark { position: absolute; top: 7px; right: 9px; color: #fff; font-size: 12px; opacity: .85; text-shadow: 0 0 8px var(--card-glow, #fff); }
@media (max-width: 600px) { #panel-dungeon .dchest-col.is-single .dchest-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#panel-dungeon .dchest-col.is-single .dchest-row.is-unit .dchest-art img { object-fit: cover; border-radius: 12px; border: 2px solid rgb(255 255 255 / 25%); } /* v655 unit card art */
/* v655b: art always centred in the same box; soft light disc behind it so dark game icons (Cursed Token) still show */
#panel-dungeon .dchest-col.is-single .dchest-row { justify-items: center; align-content: start; text-align: center; }
#panel-dungeon .dchest-col.is-single .dchest-art { justify-self: center; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / 22%), transparent 68%); }
#panel-dungeon .dchest-col.is-single .dchest-art img { display: block; margin: 0 auto; object-position: center; }
#panel-dungeon .dchest-col.is-single .dchest-row.is-unit .dchest-art { border-radius: 12px; background: none; }
#panel-dungeon .dchest-col.is-single .dchest-row { grid-template-columns: minmax(0, 1fr); } /* v655d: one full-width column, so short names no longer pull the content left */
