/* Everheim Online Idle - Dungeons, party builder, run playback, arena. Uses the tokens from style.css (light + dark). */
:root {
  --role-tank: #2f6bd0;
  --role-healer: #1b7f48;
  --role-dps: #b8454c;
  --dg-gold: var(--text-strong);
}
:root[data-theme="dark"] {
  --role-tank: #7cb4ff;
  --role-healer: #74d896;
  --role-dps: #ff8f8f;
}

/* role icons: GUI Pro pictos tinted with the role colour */
.dg-ri { display: inline-block; flex: none; width: 15px; height: 15px; vertical-align: -2px; background: currentColor;
  -webkit-mask: var(--ri) center / contain no-repeat; mask: var(--ri) center / contain no-repeat; }
.dg-ri.role-tank { --ri: url(../assets/ui/dungeon/role_tank.png); color: var(--role-tank); }
.dg-ri.role-healer { --ri: url(../assets/ui/dungeon/role_healer.png); color: var(--role-healer); }
.dg-ri.role-dps { --ri: url(../assets/ui/dungeon/role_dps.png); color: var(--role-dps); }
.dg-ico-timer { display: inline-block; width: 12px; height: 12px; background: currentColor; -webkit-mask: url(../assets/ui/dungeon/timer.png) center / contain no-repeat; mask: url(../assets/ui/dungeon/timer.png) center / contain no-repeat; }
.dg-role { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-micro); font-weight: 800; padding: 0 8px 0 5px; border-radius: var(--radius-pill); border: 1px solid var(--border-soft); background: var(--surface-sunken); color: var(--text-soft); line-height: 1.7; }
.dg-gold { font-weight: 800; color: var(--dg-gold); font-variant-numeric: tabular-nums; }
.dg-pow { font-weight: 800; color: var(--primary-text); font-variant-numeric: tabular-nums; }
.dg-pow::before { content: '\2726 '; font-size: 10px; opacity: 0.8; }
.dg-src { font-size: var(--fs-micro); font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; }
.dg-src.live { color: var(--good); }
.dg-count { background: var(--good); color: var(--text-on-primary); }

/* portraits (hero canvases baked to images) */
.dg-face { display: block; flex: none; width: 48px; height: 48px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--portrait-bg); object-fit: cover; }
.dg-face.full { width: 64px; height: 80px; }
.dg-face.big { width: 96px; height: 120px; }
.dg-face.loading { opacity: 0.6; }

/* dungeon list */
.dg-list { display: flex; flex-direction: column; gap: var(--s-2); }
.dg-card { display: grid; grid-template-columns: auto 1fr; gap: var(--s-3); align-items: start; padding: 10px 12px; border-radius: var(--radius-lg);
  background: var(--surface-2); border: 1px solid var(--border-soft); box-shadow: var(--shadow-1); }
.dg-card.sel { border-color: var(--sel-line); background: linear-gradient(180deg, var(--sel-softer), var(--surface-2) 70%); }
.dg-card.locked { opacity: 0.6; }
.dg-card.tier-3 { border-color: var(--boss-line); background: linear-gradient(180deg, var(--boss-glow), var(--surface-2) 60%); }
.dg-card-art { position: relative; width: 66px; height: 64px; margin-top: 2px; }
.dg-door { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 2px 3px var(--shade)); }
.dg-door.sm { width: 44px; height: 44px; }
.dg-door.xs { width: 34px; height: 34px; }
.dg-boss { position: absolute; right: -2px; bottom: -2px; width: 40px; height: 40px; object-fit: contain; border-radius: 50%; background: var(--surface-sunken); border: 1px solid var(--boss-line); }
.dg-card-main { min-width: 0; }
.dg-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dg-name { font-family: var(--title); font-size: 15px; color: var(--text-title); letter-spacing: 0.3px; margin-right: 2px; }
.dg-desc { margin: 2px 0 4px; }
.dg-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-xs); color: var(--text-muted); }
.dg-meta b { color: var(--text-soft); }
.dg-cd { gap: 4px; color: var(--sel-text); border-color: var(--sel-line); background: var(--sel-softer); }
.dg-rewards, .dg-res-loot, .dg-hist-rw, .dg-log-rw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.dg-rw { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); border: 1px solid var(--border-soft);
  font-size: var(--fs-xs); font-weight: 800; color: var(--text-soft); line-height: 1.8; font-variant-numeric: tabular-nums; }
.dg-rw.exp { color: var(--reward-exp); }
.dg-rw.jexp { color: var(--reward-jexp); }
.dg-loot { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.dg-loot-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-xs); background: var(--surface-sunken); border: 1px solid var(--border-soft); }
.dg-card-foot { display: flex; align-items: center; gap: var(--s-2); margin-top: 6px; }
.dg-card-foot .btn { margin-left: auto; }

/* party builder */
.dg-party-head { padding: 10px 14px; }
.dg-party-head .h4 { margin: 0; }
.dg-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-2); }
.dg-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px 7px; min-width: 0; text-align: center;
  border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border-soft); box-shadow: var(--shadow-1); }
.dg-slot.empty { justify-content: center; min-height: 160px; background: var(--surface-sunken); border-style: dashed; box-shadow: none; }
.dg-slot.empty .dg-slot-face { width: 64px; height: 80px; border-radius: var(--radius); border: 1px dashed var(--border); opacity: 0.5; margin-bottom: 4px; }
.dg-slot.me { border-color: var(--sel-line); }
.dg-slot.role-tank { box-shadow: inset 0 3px 0 var(--role-tank), var(--shadow-1); }
.dg-slot.role-healer { box-shadow: inset 0 3px 0 var(--role-healer), var(--shadow-1); }
.dg-slot.role-dps { box-shadow: inset 0 3px 0 var(--role-dps), var(--shadow-1); }
.dg-slot-face { position: relative; }
.dg-slot-role { position: absolute; left: -6px; bottom: -6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); }
.dg-slot-role .dg-ri { width: 14px; height: 14px; }
.dg-slot-lv { position: absolute; right: -6px; bottom: -6px; min-width: 24px; height: 20px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border);
  font-size: var(--fs-micro); font-weight: 900; line-height: 18px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.dg-slot-name { max-width: 100%; margin-top: 4px; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.dg-slot-sub { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dg-slot-roles { display: flex; gap: 3px; margin-top: 3px; }
.dg-mini { display: grid; place-items: center; width: 26px; height: 22px; border-radius: var(--radius-xs); border: 1px solid var(--border); background: var(--surface-sunken); cursor: pointer; opacity: 0.6; }
.dg-mini.on { opacity: 1; border-color: var(--sel-line); background: var(--sel-soft); }
.dg-mini:hover { opacity: 1; }
.dg-kick { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font-size: 15px; line-height: 1; cursor: pointer; }
.dg-kick:hover { color: var(--bad); border-color: var(--bad-line); }
.dg-comp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
.dg-need { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 7px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 800; border: 1px solid var(--border-soft); background: var(--surface-sunken); color: var(--text-soft); }
.dg-need.ok { border-color: var(--good-line); background: var(--good-soft); color: var(--good); }
.dg-need.miss { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }
.dg-need.pow b { color: var(--primary-text); }
.dg-warn { margin: 4px 0 2px; color: var(--bad-text); }
.dg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: var(--s-3) 0 var(--s-2); }
.dg-actions .chk { margin: 0; }
.dg-filter { display: flex; flex-direction: column; gap: 0; }
.dg-filter .chips { margin-bottom: var(--s-2); align-items: center; }
.dg-filter .chip .dg-ri { margin-right: 5px; }
.dg-band { margin: 0 0 0 4px; }
.dg-helpers { display: flex; flex-direction: column; gap: 6px; }
.dg-helper { display: flex; align-items: center; gap: var(--s-3); padding: 6px 10px 6px 6px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-soft); }
.dg-helper.in { border-color: var(--sel-line); background: var(--sel-softer); }
.dg-helper-main { min-width: 0; }
.dg-helper-main b { color: var(--text-strong); }
.dg-helper-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; font-size: var(--fs-xs); }

/* lend your hero */
.dg-apply.on { border-color: var(--good-line); }
.dg-apply-top { align-items: flex-start; }
.dg-apply .h4 { margin-bottom: 4px; }
.dg-apply-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.dg-role-chip .dg-ri { margin-right: 6px; }
.dg-log, .dg-hist { display: flex; flex-direction: column; gap: 6px; }
.dg-log-row, .dg-hist-row { display: flex; align-items: center; gap: var(--s-3); padding: 7px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-soft); }
.dg-log-row.win, .dg-hist-row.win { border-left: 3px solid var(--good-line); }
.dg-log-row.loss, .dg-hist-row.loss { border-left: 3px solid var(--bad-line); }
.dg-log-row b { color: var(--text-strong); }
.dg-log-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-sunken); border: 1px solid var(--border-soft); }
.dg-log-rw { margin-top: 0; }
.dg-hist-party { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: var(--fs-xs); color: var(--text-soft); }
.dg-hp { display: inline-flex; align-items: center; gap: 3px; }

/* arena */
.ar-me { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-4); align-items: center; }
.ar-rating { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding-right: var(--s-3); border-right: 1px solid var(--border-soft); }
.ar-rating b { font-family: var(--title); font-size: 30px; line-height: 1.1; color: var(--text-title); font-variant-numeric: tabular-nums; }
.ar-label { display: block; font-size: var(--fs-micro); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.ar-stats { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); font-size: var(--fs-sm); color: var(--text-soft); }
.ar-stats img { vertical-align: -5px; }
.ar-tries { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dg-pips { display: flex; gap: 4px; }
.dg-pip { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-sunken); }
.dg-pip.on { border-color: var(--primary-line); background: var(--primary); box-shadow: 0 0 6px var(--primary-glow); }
.ar-offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-3); }
.ar-offer { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; text-align: center; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border-soft); box-shadow: var(--shadow-1); min-width: 0; }
.ar-offer-main { min-width: 0; max-width: 100%; }
.ar-offer-main b { color: var(--text-strong); }
.ar-offer-stats { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; margin-top: 3px; font-size: var(--fs-xs); font-weight: 800; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.ar-delta { font-weight: 900; font-variant-numeric: tabular-nums; }
.ar-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s-2); }
.ar-ware { display: flex; align-items: center; gap: var(--s-2); padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-soft); }
.ar-ware b { color: var(--text-strong); }

/* playback modal */
/* the playback modal scrolls with its (unrounded) wrapper instead of clipping its own rounded box over the canvas */
.modal.dg-play-modal { width: min(1000px, 97vw); padding: 14px 16px; gap: var(--s-2); overflow: visible; max-height: none; margin: auto 0; }
.dg-play { display: flex; flex-direction: column; gap: var(--s-2); }
.dg-play-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.dg-play-head .h4 { margin: 0; font-size: var(--fs-lg); }
.dg-play-ctl { display: flex; gap: 4px; }
.dg-speed.on { color: var(--sel-text); border-color: var(--sel-line); background: var(--sel-soft); }
/* no rounded clipping, filters or blur on/over the per-frame canvas: Firefox pays for every frame */
.dg-stage { position: relative; background: var(--stage-bg); aspect-ratio: 960 / 440; }
.dg-canvas { display: block; width: 100%; height: 100%; border: 1px solid var(--border-strong); box-sizing: border-box; }
.modal-wrap:has(.dg-play-modal) { backdrop-filter: none; -webkit-backdrop-filter: none; overflow-y: auto; }
.dg-result { display: flex; flex-direction: column; gap: var(--s-2); }
.dg-res-head { display: flex; align-items: baseline; gap: var(--s-3); }
.dg-res-title { font-family: var(--title); font-size: var(--fs-xl); font-weight: 800; color: var(--text-title); }
.dg-res-head.win .dg-res-title { color: var(--good); }
.dg-res-head.loss .dg-res-title { color: var(--bad); }
.dg-res-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.dg-res-table th { text-align: left; font-size: var(--fs-micro); font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); padding: 4px 6px; border-bottom: 1px solid var(--border-soft); }
.dg-res-table td { padding: 4px 6px; border-bottom: 1px solid var(--hairline); color: var(--text-soft); }
.dg-res-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dg-res-table tr.foe td { color: var(--text-muted); }

@media (max-width: 760px) {
  .dg-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ar-me { grid-template-columns: 1fr; }
  .ar-rating { border-right: 0; padding-right: 0; }
  .ar-tries { align-items: flex-start; }
  .ar-offers { grid-template-columns: 1fr; }
  .ar-offer { flex-direction: row; text-align: left; }
}

/* the panel column is narrow on desktop: keep slot text compact */
.dg-slot .dg-src { font-size: 10px; letter-spacing: 0.4px; }
.dg-slot .dg-pow { font-size: var(--fs-xs); }
