/* Dungeons page visual redesign — scoped to body.page-dungeons.
   Tokens are additive. Do not replace --bg/--card/--text/--muted/--accent/--border. */

@font-face {
  font-family: "Cinzel";
  src: url("/webapp/assets/fonts/cinzel-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("/webapp/assets/fonts/cinzel-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cinzel";
  src: url("/webapp/assets/fonts/cinzel-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Manrope";
  src: url("/webapp/assets/fonts/manrope-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("/webapp/assets/fonts/rajdhani-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("/webapp/assets/fonts/rajdhani-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body.page-dungeons {
  --gold-bright: #ffd97a;
  --panel-2: #241a10;
  --ember: #e2543f;
  --ember-bright: #ff8a65;
  --rune: #49c9b3;
  --rune-bright: #7ff0dd;
  --parchment-faint: #6b5c4b;
  --line: var(--border);

  --r-common: #9a8f82;
  --r-uncommon: #5fbf80;
  --r-rare: #5b9bf0;
  --r-epic: #b177f0;
  --r-legendary: #f3c766;

  --font-display: "Cinzel", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hud: "Rajdhani", var(--font-body);

  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.page-dungeons :is(.dungeon-tab-sm, #dungeon-tabs .tab, .plus-option, .battle-log-btn, .gd-chat-switch):focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.page-dungeons .solo-dungeon-card:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.page-dungeons .frame-corners { position: relative; }
.page-dungeons .frame-corners::after {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 3;
  pointer-events: none;
  --cc: var(--corner-color, var(--gold-bright));
  --cs: var(--corner-size, 14px);
  background:
    linear-gradient(var(--cc), var(--cc)) top left / var(--cs) 2px no-repeat,
    linear-gradient(var(--cc), var(--cc)) top left / 2px var(--cs) no-repeat,
    linear-gradient(var(--cc), var(--cc)) top right / var(--cs) 2px no-repeat,
    linear-gradient(var(--cc), var(--cc)) top right / 2px var(--cs) no-repeat,
    linear-gradient(var(--cc), var(--cc)) bottom left / var(--cs) 2px no-repeat,
    linear-gradient(var(--cc), var(--cc)) bottom left / 2px var(--cs) no-repeat,
    linear-gradient(var(--cc), var(--cc)) bottom right / var(--cs) 2px no-repeat,
    linear-gradient(var(--cc), var(--cc)) bottom right / 2px var(--cs) no-repeat;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(226, 169, 63, 0.45));
}

.page-dungeons .seal {
  --seal-c: var(--accent);
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #1a1006;
  font: 700 13px/1 var(--font-hud);
  flex-shrink: 0;
  background: radial-gradient(circle at 32% 28%, #fff3d6 0%, var(--gold-bright) 22%, var(--seal-c) 62%, #8a611c 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.page-dungeons .seal::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(0, 0, 0, 0.18) 0deg 4deg, transparent 4deg 12deg);
  opacity: 0.55;
  mix-blend-mode: multiply;
}

.page-dungeons #dungeon-tabs .tab {
  font-family: var(--font-body);
}

.page-dungeons .solo-dungeon-card__frame {
  --corner-color: var(--gold-bright);
  --corner-size: 11px;
}
.page-dungeons .solo-dungeon-card__frame::after {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--corner-color), var(--corner-color)) top left / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top left / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top right / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top right / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom left / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom left / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom right / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom right / 2px var(--corner-size) no-repeat;
  opacity: 0.7;
}
.page-dungeons .solo-dungeon-card.locked .solo-dungeon-card__frame::after {
  content: "";
  opacity: 0.3;
  left: auto;
  top: auto;
  transform: none;
  font-size: inherit;
  text-shadow: none;
}
.page-dungeons .solo-dungeon-card.locked::before {
  content: "🔒";
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  font-size: 30px;
  opacity: 0.88;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.page-dungeons .solo-dungeon-card.dungeon-tile.active-run {
  border-color: rgba(226, 169, 63, 0.6);
  box-shadow: 0 0 0 1px rgba(226, 169, 63, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.page-dungeons .solo-dungeon-card__status {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 4;
  font: 700 9px/1 var(--font-hud);
  letter-spacing: 0.03em;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--parchment-faint, #6b5c4b);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.page-dungeons .solo-dungeon-card__status--run {
  color: var(--gold-bright);
  border-color: rgba(226, 169, 63, 0.4);
}
.page-dungeons .solo-dungeon-card__status--run i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-bright);
  margin-right: 4px;
  animation: dng-pulse-soft 1.4s ease-in-out infinite;
}
.page-dungeons .solo-dungeon-card__status--done {
  color: var(--rune-bright);
  border-color: rgba(73, 201, 179, 0.4);
}

.page-dungeons .solo-dungeon-card__meta-line strong {
  font-family: var(--font-hud);
  font-weight: 700;
  color: var(--gold-bright);
}

.page-dungeons .act-head {
  align-items: center;
}
.page-dungeons .act-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.page-dungeons .act-title {
  font-family: var(--font-display);
  letter-spacing: 0.06em;
}
.page-dungeons .act-subtitle {
  font-family: var(--font-body);
}

.page-dungeons .monster-visual {
  --corner-color: var(--gold-bright);
  --corner-size: 16px;
}
.page-dungeons .monster-visual::before {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(var(--corner-color), var(--corner-color)) top left / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top left / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top right / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top right / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom left / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom left / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom right / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom right / 2px var(--corner-size) no-repeat;
  opacity: 0.65;
}
.page-dungeons .monster-visual.elite-blue { --corner-color: #3b82f6; }
.page-dungeons .monster-visual.elite-gold,
.page-dungeons .monster-visual.boss { --corner-color: #f59e0b; }
.page-dungeons .monster-visual.elite-red { --corner-color: #ef4444; }

.page-dungeons .monster-visual.elite-gold,
.page-dungeons .monster-visual.elite-red,
.page-dungeons .monster-visual.boss {
  animation: mv-aura-breathe 2.6s ease-in-out infinite;
}
@keyframes mv-aura-breathe {
  0%, 100% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.35); }
  50% { box-shadow: 0 0 26px rgba(245, 158, 11, 0.55); }
}
.page-dungeons .monster-visual.elite-red {
  animation-name: mv-aura-breathe-red;
}
@keyframes mv-aura-breathe-red {
  0%, 100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.38); }
  50% { box-shadow: 0 0 26px rgba(239, 68, 68, 0.58); }
}

.page-dungeons .solo-dungeon-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 6px;
}
.page-dungeons .solo-dungeon-title {
  font-family: var(--font-display);
  font-size: 13px;
  min-width: 0;
  flex-shrink: 0;
  max-width: 46%;
}
.page-dungeons #solo-dungeon-progress {
  display: block;
  background: none;
  border: none;
  padding: 0;
  flex: 1;
  min-width: 0;
}
.page-dungeons .solo-dungeon-header .stage-dots {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  width: 100%;
}
.page-dungeons .solo-dungeon-header .stage-dot2 {
  flex: 1 1 0;
  width: auto;
  min-width: 4px;
  max-width: 10px;
  height: 5px;
  border-radius: 2px;
  background: rgba(226, 169, 63, 0.14);
  box-shadow: none;
}
.page-dungeons .solo-dungeon-header .stage-dot2.done {
  background: var(--accent);
  box-shadow: none;
}
.page-dungeons .solo-dungeon-header .stage-dot2.active {
  background: var(--ember);
  box-shadow: 0 0 6px rgba(226, 84, 63, 0.7);
  animation: dng-pulse-soft 1.6s ease-in-out infinite;
}
.page-dungeons .solo-dungeon-header .stage-dot2.boss {
  width: auto;
  max-width: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold-bright));
}

.page-dungeons .mv-elite-label {
  font: 700 10px/1 var(--font-hud);
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(226, 169, 63, 0.4);
  pointer-events: none;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-dungeons .monster-visual.elite-blue .mv-elite-label {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}
.page-dungeons .monster-visual.elite-red .mv-elite-label {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Long elite names (prefix + glued -suffixes) must wrap inside the square art. */
.page-dungeons .mv-nameline {
  align-items: flex-start;
}
.page-dungeons .mv-namecol {
  min-width: 0;
  flex: 1 1 auto;
}
.page-dungeons #monster-name-text,
.page-dungeons .monster-overlay-bottom .monster-name-text {
  display: block;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 1.25;
}
.page-dungeons #tab-abyss .abyss-monster-name {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-dungeons .affix-chip b,
.page-dungeons .affix-chip strong {
  font-family: var(--font-hud);
  font-weight: 700;
  color: var(--gold-bright);
}
.page-dungeons #monster-affixes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: flex-start;
}
.page-dungeons .affix-chip {
  white-space: normal;
  line-height: 1.25;
  max-width: 100%;
  border-radius: 8px;
  padding: 3px 7px;
}

.page-dungeons #solo-active-meta {
  display: none !important;
}

.page-dungeons .solo-campaign-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.page-dungeons #challenge-day-strip:not([hidden]) {
  flex: 1 1 160px;
  min-width: 0;
}
.page-dungeons #solo-dungeons {
  flex: 1 1 140px;
  min-width: 0;
}
.page-dungeons #solo-dungeons:has(.solo-progress-disc[open]) {
  flex: 1 1 100%;
}
.page-dungeons .solo-progress-disc {
  margin: 0;
}
.page-dungeons .solo-progress-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid rgba(200, 146, 42, 0.22);
  background: rgba(18, 14, 10, 0.92);
  color: var(--text);
}
.page-dungeons .solo-progress-summary::-webkit-details-marker {
  display: none;
}
.page-dungeons .solo-progress-summary::after {
  content: "▸";
  margin-left: auto;
  color: var(--gold-bright);
  font-size: 12px;
}
.page-dungeons .solo-progress-disc[open] > .solo-progress-summary::after {
  content: "▾";
}
.page-dungeons .solo-progress-summary .act-seal {
  width: 22px;
  height: 22px;
  font-size: 10px;
}
.page-dungeons .solo-progress-label {
  font: 700 11px/1 var(--font-display);
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}
.page-dungeons .solo-progress-count {
  font: 600 11px/1 var(--font-hud);
  color: var(--parchment-faint);
  white-space: nowrap;
}
.page-dungeons .solo-progress-disc .dungeon-grid {
  margin-top: 8px;
}

.page-dungeons .solo-damage-float {
  font-family: var(--font-hud);
}
.page-dungeons .solo-damage-float--crit {
  color: var(--gold-bright);
  text-shadow: 0 0 8px rgba(226, 169, 63, 0.8), 0 1px 4px rgba(0, 0, 0, 0.85);
}

.page-dungeons .combat-island-bar {
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.page-dungeons .combat-island-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0 1px, transparent 1px 25%);
  pointer-events: none;
}
.page-dungeons .combat-island-fill--monster {
  box-shadow: 0 0 6px rgba(226, 84, 63, 0.45);
}
.page-dungeons .combat-island-fill--waifu {
  box-shadow: 0 0 6px rgba(73, 201, 179, 0.45);
}
.page-dungeons .combat-island-values {
  font-family: var(--font-hud);
}

.page-dungeons #solo-active {
  margin-bottom: 16px;
}

.page-dungeons #reward-modal .modal-content {
  --corner-color: var(--gold-bright);
  --corner-size: 16px;
  position: relative;
}
.page-dungeons #reward-modal .modal-content::after {
  content: "";
  position: absolute;
  inset: 6px;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(var(--corner-color), var(--corner-color)) top left / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top left / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top right / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) top right / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom left / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom left / 2px var(--corner-size) no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom right / var(--corner-size) 2px no-repeat,
    linear-gradient(var(--corner-color), var(--corner-color)) bottom right / 2px var(--corner-size) no-repeat;
  opacity: 0.6;
}
.page-dungeons #reward-modal .modal-body,
.page-dungeons #reward-modal .modal-head {
  position: relative;
  z-index: 2;
}
.page-dungeons #reward-modal-body strong,
.page-dungeons #reward-modal-body b,
.page-dungeons .reward-total-row--total strong {
  font-family: var(--font-hud);
  color: var(--gold-bright);
}
.page-dungeons .reward-item-card {
  border-radius: 10px;
  padding: 8px;
}
.page-dungeons .reward-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 22px;
}

.page-dungeons #plus-bottomsheet .plus-option-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-family: var(--font-hud);
  font-weight: 700;
}
.page-dungeons #plus-bottomsheet .plus-option-badge.seal {
  border: none;
  color: #1a1006;
  font-size: 13px;
}
.page-dungeons #plus-bottomsheet .plus-option.selected {
  border-color: rgba(226, 169, 63, 0.6);
  box-shadow: 0 0 0 1px rgba(226, 169, 63, 0.25);
}
.page-dungeons .plus-option-story-mark {
  display: block;
  margin-top: 3px;
  font: 600 10px/1.3 var(--font-body);
  color: var(--parchment-faint);
}

.page-dungeons .reward-total-row--split {
  font-size: 12px;
}
.page-dungeons .reward-total-row--split strong {
  color: var(--text);
  font-weight: 700;
}
.page-dungeons .reward-total-row--split + .reward-total-row--total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 169, 63, 0.18);
}

@keyframes dng-pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .page-dungeons .monster-visual.elite-gold,
  .page-dungeons .monster-visual.elite-red,
  .page-dungeons .monster-visual.boss,
  .page-dungeons .solo-dungeon-card__status--run i,
  .page-dungeons .solo-dungeon-header .stage-dot2.active {
    animation: none !important;
  }
}

/* Group tab: compact chat rows (daily message counters, not combat cards) */
.page-dungeons #tab-group .gd-webapp-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 10px;
}
.page-dungeons .gd-chats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.page-dungeons .gd-chat-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 10px;
}
.page-dungeons .gd-chat-row__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
}
.page-dungeons .gd-chat-row__title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-dungeons .gd-chat-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--parchment-faint);
  cursor: pointer;
  font: 600 11px/1 var(--font-body);
}
.page-dungeons .gd-chat-switch__track {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: rgba(107, 92, 75, 0.45);
  border: 1px solid var(--line);
  transition: background 0.15s ease;
}
.page-dungeons .gd-chat-switch__knob {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d8cbb8;
  transition: transform 0.15s ease;
}
.page-dungeons .gd-chat-switch[aria-checked="true"] {
  color: var(--rune-bright);
}
.page-dungeons .gd-chat-switch[aria-checked="true"] .gd-chat-switch__track {
  background: rgba(73, 201, 179, 0.35);
  border-color: var(--rune);
}
.page-dungeons .gd-chat-switch[aria-checked="true"] .gd-chat-switch__knob {
  transform: translateX(14px);
  background: var(--rune-bright);
}
.page-dungeons .gd-chat-row__stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.page-dungeons .gd-chat-row__hint {
  font: 500 11px/1.2 var(--font-body);
  color: var(--parchment-faint);
  white-space: nowrap;
}
.page-dungeons .gd-chat-row__counts,
.page-dungeons .gd-chat-row__meta {
  font-family: var(--font-hud);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.page-dungeons .gd-chat-row__counts {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-dungeons .gd-chat-row__meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--parchment-faint);
}
.page-dungeons .gd-chat-share {
  height: 3px;
  border-radius: 999px;
  background: rgba(107, 92, 75, 0.35);
  overflow: hidden;
}
.page-dungeons .gd-chat-share__fill {
  height: 100%;
  width: 0;
  background: var(--rune);
  border-radius: inherit;
}
.page-dungeons #tab-group .empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--parchment-faint);
  font: 500 13px/1.45 var(--font-body);
}
.page-dungeons #tab-group .empty-state h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  color: var(--text);
}
.page-dungeons #tab-group .empty-state p {
  margin: 0;
}

/* Delve column */
.delve-root, .chronicle-root { min-height: 420px; }
.delve-camp {
  background: linear-gradient(180deg, #161b22 0%, #0e1218 100%);
  border: 1px solid rgba(110, 160, 170, 0.28);
  border-radius: 14px;
  padding: 14px 12px 16px;
  color: #dce6ea;
}
.delve-copy { margin: 0 0 12px; line-height: 1.4; }
.delve-cta {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: #6ec4c0;
  color: #0e1218;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}
.delve-link {
  display: block;
  margin-top: 8px;
  background: transparent;
  border: 0;
  color: #8ec6ff;
  cursor: pointer;
  text-decoration: underline;
}
.delve-size { display: flex; gap: 8px; margin: 10px 0; }
.delve-size-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(110,196,192,.4);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.delve-size-btn.active { background: rgba(110,196,192,.22); }
.delve-faces { display: flex; gap: 8px; flex-wrap: wrap; }
.delve-face { width: 110px; display: flex; flex-direction: column; gap: 6px; }
.delve-face img, .delve-bust, .delve-token-face { image-rendering: pixelated; background: #12161c; }
.delve-token-face {
  width: 32px;
  height: 32px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--accent, #c47a3a) 55%, #fff);
  border-radius: 4px;
}
.delve-token-unit { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.delve-hp {
  width: 32px;
  height: 4px;
  background: #2a3038;
  border-radius: 2px;
  overflow: hidden;
}
.delve-sheet-face .delve-hp { width: auto; flex: 1; height: 5px; margin: 0; }
.delve-hp > i {
  display: block;
  height: 100%;
  width: var(--hp, 100%);
  background: #5dce7a;
}
.delve-hp.is-low > i { background: #e2b341; }
.delve-hp.is-crit > i { background: #e25b5b; }
.delve-face input, .delve-face select, .delve-role-row select { font-size: 12px; }
.delve-hud { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.delve-busts { display: flex; gap: 8px; align-items: flex-start; }
.delve-bust-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 64px;
  margin: 0;
  gap: 4px;
}
.delve-bust {
  width: 56px;
  height: 56px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  box-sizing: border-box;
  border: 2px solid color-mix(in srgb, var(--accent, #c47a3a) 70%, #fff);
  border-radius: 6px;
}
.delve-face .delve-bust { width: 72px; height: 72px; }
.delve-bust-name {
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  max-width: 64px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.delve-status { font-size: 16px; font-weight: 700; }
.delve-depth { font-size: 13px; opacity: .85; }
.delve-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .delve-stage { grid-template-columns: 1fr; } }
.delve-shaft-wrap { position: relative; min-height: 280px; }
.delve-shaft-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: 10px;
}
.delve-shaft-status {
  position: absolute;
  top: 10px;
  left: 72px;
  right: 72px;
  text-align: center;
  color: #f3e6c8;
  text-shadow: 0 1px 2px #000;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.delve-status-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  pointer-events: auto;
  background: rgba(0, 0, 0, .48);
  color: #f3e6c8;
  border: 1px solid #c4a574;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-shadow: 0 1px 2px #000;
}
.delve-status-btn:hover { background: rgba(0, 0, 0, .62); }
.delve-shaft {
  --shaft: #2a2420;
  --accent: #c47a3a;
  position: relative;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 10px;
  background-color: var(--shaft);
  background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--shaft) 58%, transparent) 0%, color-mix(in srgb, var(--shaft) 78%, #000) 100%),
    var(--shaft-art, url("/static/game/delve/shaft.webp"));
  background-size: cover;
  background-position: center top;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  overflow: hidden;
}
.delve-nodes {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 6px 10px;
  gap: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .42));
}
.delve-node {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: .4;
  color: var(--accent);
}
.delve-node-loc {
  font-size: 10px;
  line-height: 1.15;
  font-weight: 700;
  text-align: center;
  color: #f3e6c8;
  text-shadow: 0 1px 2px #000;
  margin-bottom: 2px;
  max-width: 100%;
  word-break: break-word;
}
.delve-node-g { font-size: 14px; line-height: 1.2; }
.delve-node.is-seen { opacity: .7; }
.delve-node.is-here { opacity: 1; }
.delve-token {
  position: static;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
}
.delve-card {
  background: #e8d5b5;
  color: #3b2414;
  border: 2px solid #8a5a32;
  box-shadow: inset 0 0 0 4px #f3e6c8;
  border-radius: 6px;
  padding: 14px 16px;
}
.delve-card-kicker { font-size: 11px; opacity: .8; margin-bottom: 6px; color: #5c3a22; }
.delve-card-phrase { font-size: 13px; font-weight: 400; line-height: 1.45; color: #3b2414; }
.delve-card-phrase strong { font-weight: 700; }
.delve-card .delve-meta { font-size: 12px; color: #5c3a22; margin-top: 6px; }
.delve-hint { font-size: 13px; margin: 8px 0; }
.delve-card .delve-hint { color: #5c3a22; }
.delve-sleeves { display: flex; flex-direction: column; gap: 6px; }
.delve-sleeve {
  border: 1px solid #8a5a32;
  background: transparent;
  color: #3b2414;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
}
.delve-sleeve.is-instinct { background: color-mix(in srgb, var(--accent) 22%, #e8d5b5); }
.delve-sheet { margin-top: 0; font-size: 13px; opacity: .9; }
.delve-sheet-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 7px;
}
.delve-sheet-stat {
  min-width: 0;
  min-height: 51px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border: 1px solid #3d3025;
  border-radius: 8px;
  background: rgba(20, 16, 13, .42);
}
.delve-sheet-stat > div { min-width: 0; }
.delve-sheet-stat-icon {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  font-size: 16px;
}
.delve-sheet-stat-icon--xp {
  border: 1px solid #5f9b45;
  color: #78c95c;
  font-size: 9px;
  font-weight: 800;
}
.delve-sheet-stat-label {
  display: block;
  margin-bottom: 2px;
  color: #a99b89;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delve-sheet-stat strong {
  display: block;
  color: #f3eadc;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delve-sheet-stat em {
  color: #54d47c;
  font-style: normal;
  font-size: 9px;
}
.delve-sheet-faces { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.delve-sheet-face {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid #3d3025;
  border-radius: 9px;
  background: rgba(19, 15, 12, .40);
}
.delve-sheet-face-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.delve-sheet-face-main { flex: 1; min-width: 0; }
.delve-sheet-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.delve-sheet-name-row strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #f4e7cf;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delve-sheet-equip {
  flex: 0 0 auto;
  padding: 3px 5px;
  border: 1px solid #493a2d;
  border-radius: 5px;
  background: #17130f;
  color: #a99b89;
  font-size: 8px;
  cursor: pointer;
}
.delve-sheet-face.is-equip-open .delve-sheet-equip {
  color: #f4e7cf;
  border-color: #8a5a32;
}
.delve-sheet-meta {
  margin-top: 2px;
  color: #a99b89;
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delve-sheet-hp {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.delve-sheet-hp-pct {
  color: #a99b89;
  font-size: 7px;
  width: 24px;
  flex: 0 0 24px;
  text-align: right;
}
.delve-sheet-bag,
.delve-sheet-trauma {
  margin-top: 3px;
  color: #9d907f;
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delve-slot-grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(72px, auto);
  align-items: stretch;
  gap: 3px;
  width: 100%;
}
.delve-sheet-face.is-equip-open .delve-slot-grid { display: grid; }
.delve-slot {
  aspect-ratio: 1;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: .4;
  line-height: 1;
  overflow: hidden;
}
.delve-slot i { font-style: normal; font-size: 12px; line-height: 1.2; }
.delve-slot-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1px 2px 0;
  text-align: center;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 600;
}
.delve-slot-name span {
  display: block;
  width: 100%;
  text-align: center;
}
.delve-slot.is-on {
  opacity: 1;
  aspect-ratio: auto;
  min-height: 72px;
  height: 100%;
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  padding: 4px 2px;
  overflow: hidden;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.delve-stamps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.delve-stamp { border: 1px solid var(--accent); border-radius: 6px; padding: 2px 6px; font-size: 11px; }
.delve-status-modal {
  position: fixed;
  inset: 0;
  height: min(100dvh, var(--tg-vh, 100dvh));
  background: rgba(0, 0, 0, .75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 8px;
  overflow: hidden;
}
.delve-status-modal-card {
  display: flex;
  flex-direction: column;
  background: #1c1814;
  color: #f3e6c8;
  border: 1px solid #8a5a32;
  border-radius: 10px;
  width: min(440px, 100%);
  max-width: min(440px, 92vw);
  max-height: calc(100% - 16px);
  overflow: hidden;
  padding: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}
.delve-status-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-bottom: 9px;
  flex-shrink: 0;
}
.delve-status-modal-title { font-weight: 700; font-size: 16px; line-height: 1; }
.delve-status-modal-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.delve-status-modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.delve-status-modal-body:has(.delve-sheet-face.is-equip-open) { overflow-y: auto; }
.delve-status-modal .delve-sheet { margin-top: 0; opacity: 1; }
.delve-status-modal .delve-bust {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}
@media (max-height: 559px) {
  .delve-status-modal-body { overflow-y: auto; }
}
@media (max-height: 760px) {
  .delve-status-modal-card { padding: 9px; }
  .delve-status-modal-head { min-height: 27px; margin-bottom: 5px; }
  .delve-status-modal-title { font-size: 15px; }
  .delve-sheet-stats { gap: 4px; margin-bottom: 4px; }
  .delve-sheet-stat { min-height: 43px; padding: 5px 6px; }
  .delve-sheet-faces { gap: 4px; }
  .delve-sheet-face { min-height: 65px; padding: 5px; }
  .delve-status-modal .delve-bust {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }
}
@media (max-width: 360px) {
  .delve-status-modal .delve-bust {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }
  .delve-sheet-stat-label { font-size: 8px; }
  .delve-sheet-stat strong { font-size: 9px; }
}
.delve-legacy { font-size: 13px; margin-bottom: 8px; opacity: .85; }
.delve-role-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.attic-chr-label { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.profile-delve-faces { display: flex; gap: 12px; margin: 8px 0; flex-wrap: wrap; }
.profile-delve-face { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 80px; }
.profile-delve-face img,
.profile-delve-faces .delve-bust {
  width: 72px;
  height: 72px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  image-rendering: pixelated;
  border: 2px solid rgba(196, 194, 180, 0.55);
  border-radius: 6px;
  background: #12161c;
}
.profile-delve-face figcaption {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
}
.profile-delve-face figcaption span { display: block; opacity: .75; font-size: 10px; }
.delve-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(110,196,192,.18);
  border: 1px solid rgba(110,196,192,.35);
}

