/* =============================================================================
   Pet Dungeon — Siege Night Design
   ============================================================================= */

/* ── Soul Coin inline icon ── */
.inv-sc-icon {
	width: 16px;
	height: 16px;
	object-fit: contain;
	vertical-align: middle;
	display: inline-block;
	position: relative;
	top: -1px;
}

/* ── Page ── */
.inv-dng-page {
	max-width: 960px;
	margin: 0 auto;
	padding: calc(var(--inv-header-h, 64px) + 20px) 1rem 4rem;
	color: #e2e8f0;
	font-family: Inter, sans-serif;
	position: relative;
}

/* ── Header ── */
.inv-dng-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 2rem;
	flex-wrap: wrap;
	gap: .75rem;
}
.inv-dng-header__title {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1.75rem;
	color: #f59e0b;
	letter-spacing: .02em;
}
.inv-dng-sc-badge {
	background: #1e2d1a;
	border: 1px solid #4ade80;
	border-radius: 2rem;
	padding: .35rem .9rem;
	font-size: .85rem;
	font-weight: 600;
	color: #4ade80;
}
.inv-dng-sc-badge::before { content: '✦ '; }

.inv-dng-notice {
	background: #1e293b;
	border-radius: .5rem;
	padding: 2rem;
	text-align: center;
	color: #64748b;
}

/* ── Tier selection grid ── */
.inv-dng-tier-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}
@media (max-width: 640px) {
	.inv-dng-tier-grid { grid-template-columns: 1fr; }
}

/* ── Tier card ── */
.inv-dng-tier-card {
	background: #111827;
	border: 1px solid #1e293b;
	border-radius: .75rem;
	padding: 1.5rem 1.25rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .5rem;
	text-align: center;
	transition: border-color .2s, transform .2s;
}
.inv-dng-tier-card:hover {
	border-color: #f59e0b55;
	transform: translateY(-2px);
}
.inv-dng-tier-card[data-tier="daily"]   { border-top: 3px solid #60a5fa; }
.inv-dng-tier-card[data-tier="weekly"]  { border-top: 3px solid #a78bfa; }
.inv-dng-tier-card[data-tier="monthly"] { border-top: 3px solid #f87171; }

.inv-dng-tier-icon {
	font-size: 2.5rem;
	line-height: 1;
	margin-bottom: .25rem;
}
.inv-dng-tier-name {
	font-family: Rajdhani, sans-serif;
	font-size: 1.15rem;
	font-weight: 700;
	color: #f1f5f9;
}
.inv-dng-tier-drops {
	font-size: .78rem;
	color: #94a3b8;
}
.inv-dng-tier-sc {
	font-size: .82rem;
	color: #4ade80;
	font-weight: 600;
}
.inv-dng-tier-status {
	font-size: .75rem;
	min-height: 1.2em;
	color: #64748b;
}
.inv-dng-tier-status.ready  { color: #4ade80; }
.inv-dng-tier-status.cooldown { color: #f87171; }

/* Buttons */
.inv-dng-enter-btn {
	margin-top: .5rem;
	background: #f59e0b;
	border: none;
	border-radius: .375rem;
	color: #080d1a;
	font-size: .875rem;
	font-weight: 700;
	padding: .5rem 1.5rem;
	cursor: pointer;
	transition: opacity .15s, transform .1s;
	width: 100%;
}
.inv-dng-enter-btn:hover:not(:disabled) { opacity: .85; }
.inv-dng-enter-btn:active:not(:disabled) { transform: scale(.97); }
.inv-dng-enter-btn:disabled {
	background: #374151;
	color: #6b7280;
	cursor: not-allowed;
}

.inv-dng-ticket-btn {
	background: transparent;
	border: 1px solid #3b82f6;
	border-radius: .375rem;
	color: #3b82f6;
	font-size: .78rem;
	padding: .35rem .75rem;
	cursor: pointer;
	transition: all .15s;
	width: 100%;
}
.inv-dng-ticket-btn:hover {
	background: #3b82f6;
	color: #fff;
}

/* ── Active run ── */
.inv-dng-run-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.25rem;
	flex-wrap: wrap;
	gap: .5rem;
}
.inv-dng-potion-btn {
	padding: .3rem .75rem;
	border-radius: .375rem;
	border: 1px solid #16a34a;
	background: rgba(22,163,74,.15);
	color: #4ade80;
	font-size: .8rem;
	cursor: pointer;
	transition: background .2s;
	white-space: nowrap;
}
.inv-dng-potion-btn:hover:not(:disabled) { background: rgba(22,163,74,.3); }

.inv-dng-scroll-btn {
	position: relative;
	padding: .28rem .55rem;
	border-radius: .375rem;
	border: 1px solid rgba(245,158,11,.35);
	background: rgba(245,158,11,.1);
	color: #f59e0b;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	transition: background .15s;
	flex-shrink: 0;
}
.inv-dng-scroll-btn:hover { background: rgba(245,158,11,.22); }
.inv-dng-scroll-badge {
	position: absolute;
	top: -6px;
	right: -7px;
	font-size: .65rem;
	font-weight: 700;
	padding: 1px 4px;
	border-radius: 8px;
	line-height: 1.4;
	white-space: nowrap;
}
.inv-dng-potion-btn:disabled { opacity: .5; cursor: not-allowed; }
.inv-dng-potion-info {
	font-size: .7rem;
	opacity: .7;
	margin-left: .25rem;
}

/* ── In-battle potion skill bar ─────────────────────────────────────────────── */
.inv-dng-potion-skillbar {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .6rem .75rem;
	background: rgba(8,13,26,.88);
	border-top: 1px solid rgba(74,222,128,.25);
	border-radius: 0 0 12px 12px;
	flex-wrap: wrap;
}
.inv-dng-potion-skillbar__label {
	font-family: Rajdhani, sans-serif;
	font-size: .7rem;
	font-weight: 700;
	color: #6b7280;
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: .04em;
}
.inv-dng-potion-skillbar__slots {
	display: flex;
	gap: .55rem;
	align-items: flex-end;
}
/* Circle slot — mirrors .inv-tc-skill from pet-combat */
.inv-dng-potion-slot {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .2rem;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}
.inv-dng-potion-slot__circle {
	position: relative;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 2px solid rgba(74,222,128,.4);
	background: #111827;
	overflow: hidden;
	transition: border-color .15s, box-shadow .15s, transform .1s;
	flex-shrink: 0;
}
.inv-dng-potion-slot:hover:not(:disabled) .inv-dng-potion-slot__circle {
	border-color: #4ade80;
	box-shadow: 0 0 10px rgba(74,222,128,.4);
	transform: translateY(-2px);
}
.inv-dng-potion-slot:disabled { opacity: .4; cursor: not-allowed; }
.inv-dng-potion-slot--selected .inv-dng-potion-slot__circle {
	border-color: #4ade80 !important;
	box-shadow: 0 0 14px rgba(74,222,128,.6) !important;
}
/* Rarity border variants */
.inv-dng-potion-slot[data-rarity="1"] .inv-dng-potion-slot__circle { border-color: rgba(156,163,175,.45); }
.inv-dng-potion-slot[data-rarity="2"] .inv-dng-potion-slot__circle { border-color: rgba(74,222,128,.45); }
.inv-dng-potion-slot[data-rarity="3"] .inv-dng-potion-slot__circle { border-color: rgba(59,130,246,.55); }
.inv-dng-potion-slot[data-rarity="4"] .inv-dng-potion-slot__circle { border-color: rgba(168,85,247,.55); }
.inv-dng-potion-slot--selected[data-rarity="1"] .inv-dng-potion-slot__circle { border-color: #9ca3af !important; box-shadow: 0 0 12px rgba(156,163,175,.5) !important; }
.inv-dng-potion-slot--selected[data-rarity="2"] .inv-dng-potion-slot__circle { border-color: #4ade80 !important; box-shadow: 0 0 12px rgba(74,222,128,.55) !important; }
.inv-dng-potion-slot--selected[data-rarity="3"] .inv-dng-potion-slot__circle { border-color: #60a5fa !important; box-shadow: 0 0 12px rgba(59,130,246,.55) !important; }
.inv-dng-potion-slot--selected[data-rarity="4"] .inv-dng-potion-slot__circle { border-color: #c084fc !important; box-shadow: 0 0 12px rgba(168,85,247,.55) !important; }
.inv-dng-potion-slot__icon {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}
/* Qty badge — top-right corner (relative to slot, overlaps circle) */
.inv-dng-potion-slot__qty {
	position: absolute;
	top: -2px;
	right: -2px;
	font-family: Rajdhani, sans-serif;
	font-size: .58rem;
	font-weight: 700;
	background: rgba(8,13,26,.9);
	color: #e5e7eb;
	border-radius: 8px;
	padding: 0 4px;
	line-height: 1.4;
	pointer-events: none;
	border: 1px solid rgba(255,255,255,.12);
}
/* Pct + rarity label below the circle */
.inv-dng-potion-slot__pct {
	font-family: Rajdhani, sans-serif;
	font-size: .68rem;
	font-weight: 700;
	color: #86efac;
	line-height: 1;
}
.inv-dng-potion-slot__label {
	font-size: .58rem;
	color: #6b7280;
	line-height: 1;
}
/* Confirm "Use" button — appears when a slot is selected */
.inv-dng-potion-confirm {
	display: none;
	padding: .3rem .7rem;
	border-radius: .375rem;
	border: 1px solid #4ade80;
	background: rgba(22,163,74,.18);
	color: #4ade80;
	font-family: Rajdhani, sans-serif;
	font-size: .8rem;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s;
	white-space: nowrap;
}
.inv-dng-potion-confirm:hover { background: rgba(22,163,74,.35); }

/* Heal float (green, upward) */
.inv-dng-float-num--heal {
	color: #4ade80 !important;
	font-size: 1.2rem !important;
	font-weight: 800 !important;
}
/* Heal log row */
.inv-dng-log-row--heal {
	background: rgba(22,163,74,.08);
	border-left: 2px solid #4ade80;
}

/* ── Potion pet picker overlay ──────────────────────────────────────────────── */
.inv-dng-potion-picker-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.65);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}
.inv-dng-potion-picker-box {
	background: #111827;
	border: 1px solid #16a34a;
	border-radius: .75rem;
	padding: 1.25rem 1.5rem;
	text-align: center;
	max-width: 320px;
	width: 90%;
}
.inv-dng-potion-picker-title {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1rem;
	color: #4ade80;
	margin-bottom: .75rem;
}
.inv-dng-potion-picker-pets {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	margin-bottom: .75rem;
}
.inv-dng-potion-pick-btn {
	padding: .5rem 1rem;
	border-radius: .375rem;
	border: 1px solid #16a34a;
	background: rgba(22,163,74,.15);
	color: #4ade80;
	font-family: Rajdhani, sans-serif;
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}
.inv-dng-potion-pick-btn:hover { background: rgba(22,163,74,.3); }
.inv-dng-potion-picker-cancel {
	padding: .35rem .75rem;
	border-radius: .375rem;
	border: 1px solid #374151;
	background: transparent;
	color: #9ca3af;
	font-size: .8rem;
	cursor: pointer;
}

/* ── Tier ticket counter ───────────────────────────────────────────────────── */
.inv-dng-tier-tickets {
	font-size: .75rem;
	color: #f59e0b;
	font-weight: 600;
	margin: .15rem 0;
}
/* ── Tier requirement label ────────────────────────────────────────────────── */
.inv-dng-tier-req {
	font-size: .7rem;
	color: #475569;
	margin: .1rem 0 .25rem;
}

.inv-dng-tier-badge {
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	padding: .2rem .6rem;
	border-radius: .25rem;
	background: #1e293b;
	color: #f59e0b;
	margin-right: .5rem;
}
.inv-dng-run-room-label {
	font-size: .875rem;
	color: #94a3b8;
	font-weight: 600;
}

/* Room progress dots */
.inv-dng-run-progress {
	display: flex;
	gap: .4rem;
	align-items: center;
}
.inv-dng-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #1e293b;
	border: 1px solid #334155;
	transition: all .2s;
}
.inv-dng-dot.done      { background: #4ade80; border-color: #4ade80; }
.inv-dng-dot.active    { background: #f59e0b; border-color: #f59e0b; box-shadow: 0 0 6px #f59e0b88; }
.inv-dng-dot.boss      { background: #f87171; border-color: #f87171; }
.inv-dng-dot.failed    { background: #6b7280; border-color: #6b7280; }

/* ── Run buffs / curses panel ── */
.inv-dng-run-buffs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 6px 0 8px;
	align-items: center;
}
.inv-dng-run-buff {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: .72rem;
	font-family: Rajdhani, sans-serif;
	font-weight: 600;
	letter-spacing: .04em;
	border: 1px solid;
	white-space: nowrap;
}
.inv-dng-run-buff--buff {
	background: rgba(74,222,128,.08);
	border-color: rgba(74,222,128,.35);
	color: #4ade80;
}
.inv-dng-run-buff--curse {
	background: rgba(248,113,113,.08);
	border-color: rgba(248,113,113,.35);
	color: #f87171;
}
.inv-dng-run-buff__icon { font-size: .8rem; }

/* ── Loot item hover tooltip (dungeon complete screen) ── */
.inv-dng-loot-item.inv-dng-has-tip,
.inv-dng-team-loot__item.inv-dng-has-tip {
	cursor: default;
}
/* Loot items use the JS floating tooltip — suppress the embedded CSS hover for these only */
.inv-dng-loot-item .inv-dng-itp,
.inv-dng-team-loot__item .inv-dng-itp { display: none !important; }

/* ── Floating dungeon tooltip (#inv-dng-float-tip) — inventory-quality ── */
#inv-dng-float-tip {
	position: fixed;
	z-index: 99999;
	pointer-events: none;
	background: linear-gradient(160deg, rgba(10,20,38,0.98), rgba(17,24,39,0.99));
	border: 1px solid rgba(245,158,11,0.25);
	border-radius: 10px;
	padding: 10px 12px;
	box-shadow: 0 12px 36px rgba(0,0,0,0.75);
	min-width: 250px;
	max-width: 300px;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

/* ── inv-pit-tip-* shared on dungeon page ── */
.inv-pit-tip-header { display:flex; gap:10px; align-items:flex-start; margin-bottom:8px; }
.inv-pit-tip-img { width:44px; height:44px; flex-shrink:0; background:rgba(255,255,255,0.04); border-radius:6px; overflow:hidden; display:flex; align-items:center; justify-content:center; }
.inv-pit-tip-img img { width:100%; height:100%; object-fit:contain; }
.inv-pit-tip-header-text { flex:1; min-width:0; }
.inv-pit-tip-name { font-family:Rajdhani,sans-serif; font-weight:700; font-size:0.9rem; color:#f1f5f9; line-height:1.2; }
.inv-pit-tip-rarity { font-size:0.65rem; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; margin-top:2px; }
.inv-pit-tip-slot { font-size:0.68rem; color:#64748b; text-transform:capitalize; margin-top:2px; }
.inv-pit-tip-divider { font-size:0.6rem; font-weight:700; text-transform:uppercase; letter-spacing:0.1em; color:#475569; border-top:1px solid rgba(255,255,255,0.06); padding-top:6px; margin:6px 0 4px; }
.inv-pit-tip-stat { display:flex; justify-content:space-between; font-size:0.74rem; color:#94a3b8; margin-bottom:2px; }
.inv-pit-tip-stat strong { color:#e2e8f0; font-weight:700; }
.inv-pit-tip-prop { display:flex; justify-content:space-between; font-size:0.71rem; color:#7dd3fc; margin-bottom:2px; }
.inv-pit-tip-prop em { font-style:normal; color:#93c5fd; font-weight:600; }
.inv-pit-tip-affix { display:flex; justify-content:space-between; font-size:0.71rem; color:#c4b5fd; margin-bottom:2px; }
.inv-pit-tip-affix em { font-style:normal; color:#a78bfa; font-weight:600; }

/* ── Room card ── */
.inv-dng-room-card {
	background: #111827;
	border: 1px solid #1e293b;
	border-radius: .75rem;
	padding: 1.75rem;
	min-height: 280px;
}

/* Room type header */
.inv-dng-room-type {
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	margin-bottom: .6rem;
	padding: .25rem .6rem;
	border-radius: .25rem;
	display: inline-block;
}
.inv-dng-room-type.combat    { background: #450a0a; color: #fca5a5; }
.inv-dng-room-type.boss      { background: #4c0519; color: #fda4af; }
.inv-dng-room-type.challenge { background: #431407; color: #fdba74; }
.inv-dng-room-type.treasure  { background: #1a2e05; color: #86efac; }
.inv-dng-room-type.event     { background: #1e1b4b; color: #c4b5fd; }

.inv-dng-room-title {
	font-family: Rajdhani, sans-serif;
	font-size: 1.4rem;
	font-weight: 700;
	margin-bottom: .35rem;
}
.inv-dng-room-desc {
	font-size: .875rem;
	color: #94a3b8;
	margin-bottom: 1.25rem;
	line-height: 1.5;
}

/* Mob stats box */
.inv-dng-mob-stats {
	background: #0f172a;
	border: 1px solid #1e293b;
	border-radius: .375rem;
	padding: .75rem 1rem;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: .5rem;
	margin-bottom: 1.25rem;
	font-size: .8rem;
}
.inv-dng-mob-stat { text-align: center; }
.inv-dng-mob-stat dt { color: #64748b; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.inv-dng-mob-stat dd { color: #e2e8f0; font-weight: 700; margin: 0; font-size: .9rem; }

/* Action buttons */
.inv-dng-actions {
	display: flex;
	gap: .75rem;
	flex-wrap: wrap;
}
.inv-dng-btn {
	border: none;
	border-radius: .375rem;
	font-size: .875rem;
	font-weight: 700;
	padding: .55rem 1.4rem;
	cursor: pointer;
	transition: opacity .15s, transform .1s;
}
.inv-dng-btn:active { transform: scale(.97); }
.inv-dng-btn:disabled { opacity: .45; cursor: not-allowed; }
.inv-dng-btn--fight   { background: #dc2626; color: #fff; }
.inv-dng-btn--take    { background: #f59e0b; color: #080d1a; }
.inv-dng-btn--skip    { background: #374151; color: #e2e8f0; }
.inv-dng-btn--continue { background: #3b82f6; color: #fff; }
.inv-dng-btn:hover:not(:disabled) { opacity: .85; }

/* Event options */
.inv-dng-event-options {
	display: flex;
	flex-direction: column;
	gap: .75rem;
	margin-bottom: 1rem;
}
.inv-dng-event-option {
	background: #0f172a;
	border: 1px solid #1e293b;
	border-radius: .5rem;
	padding: .85rem 1rem;
	cursor: pointer;
	transition: border-color .15s;
}
.inv-dng-event-option:hover { border-color: #f59e0b; }
.inv-dng-event-option__label { font-weight: 700; font-size: .9rem; margin-bottom: .2rem; }
.inv-dng-event-option__desc  { font-size: .78rem; color: #64748b; }

/* Result card */
/* Event room item drop — full-slot centered display */
.inv-dng-event-item-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: .75rem auto;
	padding: 14px 16px 12px;
	background: rgba(245,158,11,0.07);
	border: 1px solid rgba(245,158,11,0.22);
	border-radius: 12px;
	position: relative;
	max-width: 200px;
	cursor: default;
}
.inv-dng-event-item-slot {
	width: 76px;
	height: 76px;
	background: rgba(8,13,26,0.6);
	border: 1px solid rgba(245,158,11,0.28);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.inv-dng-event-item-slot img {
	width: 70px;
	height: 70px;
	object-fit: contain;
}
.inv-dng-event-item-label {
	text-align: center;
}
.inv-dng-event-item-drop .inv-dng-itp { display: none !important; }

.inv-dng-result {
	text-align: center;
	padding: 0.75rem 0.5rem;
	background: rgba(8, 13, 26, 0.75);
	border-radius: 10px;
	backdrop-filter: blur(4px);
	/* No max-height — let the result/loot panel grow as long as it needs to.
	   Scrolling makes it harder to see all rewarded items at once. */
}
.inv-dng-result__icon {
	font-size: 3rem;
	line-height: 1;
	margin-bottom: .75rem;
}
.inv-dng-result__title {
	font-family: Rajdhani, sans-serif;
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: .5rem;
}
.inv-dng-result__title.win  { color: #4ade80; }
.inv-dng-result__title.loss { color: #f87171; }

/* Dungeon quality badge */
.inv-dng-quality-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	border: 1px solid currentColor;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	opacity: 0.9;
}
.inv-dng-result__msg {
	font-size: .9rem;
	color: #94a3b8;
	margin-bottom: 1.25rem;
}
.inv-dng-rewards {
	background: #0f172a;
	border-radius: .5rem;
	padding: 1rem;
	margin: 0 auto 1.25rem;
	max-width: 320px;
	text-align: left;
}
.inv-dng-rewards dt { font-size: .75rem; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.inv-dng-rewards dd { font-weight: 700; color: #4ade80; margin: 0 0 .5rem; }

/* ── Battle log ── */
.inv-dng-battle-log {
	background: #0f172a;
	border: 1px solid #1e293b;
	border-radius: .5rem;
	padding: .75rem 1rem;
	margin-top: 1rem;
	max-height: 180px;
	overflow-y: auto;
	font-size: .78rem;
	color: #94a3b8;
	line-height: 1.7;
}

/* ── Loading ── */
.inv-dng-loading {
	color: #64748b;
	text-align: center;
	padding: 3rem 1rem;
	font-size: .875rem;
}

/* ── Toast ── */
.inv-dng-toast {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 10000;
	background: #1e293b;
	border: 1px solid #334155;
	border-radius: .5rem;
	color: #e2e8f0;
	font-size: .875rem;
	padding: .75rem 1.25rem;
	max-width: 320px;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity .25s, transform .25s;
	pointer-events: none;
}
.inv-dng-toast.show    { opacity: 1; transform: translateY(0); }
.inv-dng-toast.success { border-color: #4ade80; color: #4ade80; }
.inv-dng-toast.error   { border-color: #f87171; color: #f87171; }

/* ═══════════════════════════════════════════════════════════
   Pre-battle fighter preview
   ═══════════════════════════════════════════════════════════ */
.inv-dng-pre-battle {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 1rem 0 1.25rem;
	background: #0f172a;
	border: 1px solid #1e293b;
	border-radius: .625rem;
	padding: 1rem;
}
.inv-dng-pre-fighter {
	flex: 1;
	text-align: center;
}
.inv-dng-pre-fighter--mob { text-align: center; }
.inv-dng-pre-species {
	font-size: 2.5rem;
	line-height: 1;
	margin-bottom: .35rem;
	display: flex;
	justify-content: center;
}
.inv-dng-pre-pet-img {
	width: 72px;
	height: 72px;
	object-fit: contain;
	border-radius: .5rem;
	filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}
.inv-dng-pre-pet-img--mob {
	filter: drop-shadow(0 2px 8px rgba(248,113,113,.4)) hue-rotate(200deg) saturate(1.3);
}
.inv-dng-pre-name {
	font-family: Rajdhani, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: #f1f5f9;
	margin-bottom: .35rem;
}
.inv-dng-pre-stats {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem .5rem;
	justify-content: center;
	font-size: .72rem;
	color: #94a3b8;
}
.inv-dng-pre-stage {
	background: #1e293b;
	border-radius: .25rem;
	padding: .05rem .35rem;
	color: #f59e0b;
	font-weight: 700;
}
.inv-dng-pre-vs {
	font-family: Rajdhani, sans-serif;
	font-size: 1.75rem;
	font-weight: 900;
	color: #f59e0b;
	flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   Battle arena
   ═══════════════════════════════════════════════════════════ */
.inv-dng-arena {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.inv-dng-arena-fighters {
	display: flex;
	align-items: flex-start;
	gap: .75rem;
}
.inv-dng-combatant {
	flex: 1;
	text-align: center;
}
.inv-dng-combatant-pet-img {
	width: 80px;
	height: 80px;
	object-fit: contain;
	border-radius: .5rem;
	filter: drop-shadow(0 2px 10px rgba(0,0,0,.7));
	margin-bottom: .4rem;
}
.inv-dng-combatant-pet-img--mob {
	filter: drop-shadow(0 2px 10px rgba(248,113,113,.5)) hue-rotate(200deg) saturate(1.3);
}
.inv-dng-combatant-species {
	font-size: 2.75rem;
	line-height: 1;
	margin-bottom: .4rem;
	display: flex;
	justify-content: center;
	transition: transform .15s;
}
.inv-dng-combatant-name {
	font-family: Rajdhani, sans-serif;
	font-size: .95rem;
	font-weight: 700;
	color: #f1f5f9;
	margin-bottom: .5rem;
}

/* HP bar */
.inv-dng-hp-bar-wrap {
	background: #0f172a;
	border-radius: 4px;
	height: 10px;
	overflow: hidden;
	margin-bottom: .3rem;
	border: 1px solid #1e293b;
}
.inv-dng-hp-fill {
	height: 100%;
	border-radius: 4px;
	transition: width .4s ease, background .4s;
}
.inv-dng-hp-text {
	font-size: .72rem;
	color: #94a3b8;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* Centre VS column */
.inv-dng-arena-vs {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .4rem;
	flex-shrink: 0;
	padding-top: .75rem;
}
.inv-dng-arena-vs-text {
	font-size: 1.5rem;
}
.inv-dng-round-badge {
	background: #1e293b;
	border: 1px solid #334155;
	border-radius: .375rem;
	color: #94a3b8;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .06em;
	padding: .2rem .5rem;
	min-width: 56px;
	text-align: center;
	transition: all .2s;
}

/* Shake animation */
@keyframes inv-dng-shake {
	0%   { transform: translateX(0); }
	20%  { transform: translateX(-5px); }
	40%  { transform: translateX(5px); }
	60%  { transform: translateX(-3px); }
	80%  { transform: translateX(3px); }
	100% { transform: translateX(0); }
}
.inv-dng-shake .inv-dng-combatant-species {
	animation: inv-dng-shake .45s ease;
}

/* ═══════════════════════════════════════════════════════════
   Animated round log
   ═══════════════════════════════════════════════════════════ */
.inv-dng-anim-log {
	background: #0a0f1e;
	border: 1px solid #1e293b;
	border-radius: .5rem;
	max-height: 180px;
	overflow-y: auto;
	font-size: .74rem;
	scrollbar-width: thin;
	scrollbar-color: #334155 transparent;
}
.inv-dng-anim-log-header {
	display: grid;
	grid-template-columns: 2rem 1fr 1fr;
	gap: .25rem;
	padding: .4rem .75rem;
	color: #475569;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	border-bottom: 1px solid #1e293b;
	position: sticky;
	top: 0;
	background: #0a0f1e;
}
.inv-dng-log-row {
	display: grid;
	grid-template-columns: 2rem 1fr 1fr;
	gap: .25rem;
	padding: .35rem .75rem;
	border-bottom: 1px solid #0f172a;
	align-items: center;
	transition: opacity .3s;
}
.inv-dng-log-row--new {
	animation: inv-dng-fadein .35s ease;
}
@keyframes inv-dng-fadein {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}
.inv-dng-log-r    { color: #475569; font-weight: 700; }
.inv-dng-log-pet  { color: #93c5fd; }
.inv-dng-log-mob  { color: #fca5a5; }

/* ═══════════════════════════════════════════════════════════
   Battle outcome panel
   ═══════════════════════════════════════════════════════════ */
.inv-dng-outcome {
	border-radius: .625rem;
	padding: 1.25rem;
	text-align: center;
	animation: inv-dng-fadein .4s ease;
}
.inv-dng-outcome.win  { background: #052e16; border: 1px solid #14532d; }
.inv-dng-outcome.loss { background: #450a0a; border: 1px solid #7f1d1d; }

.inv-dng-outcome-icon {
	font-size: 2.5rem;
	margin-bottom: .5rem;
}
.inv-dng-outcome-title {
	font-family: Rajdhani, sans-serif;
	font-size: 1.25rem;
	font-weight: 700;
	margin-bottom: 1rem;
	color: #f1f5f9;
}

.inv-dng-outcome-hp-summary {
	background: rgba(0,0,0,.35);
	border-radius: .5rem;
	padding: .75rem;
	display: flex;
	flex-direction: column;
	gap: .6rem;
	margin-bottom: .75rem;
	text-align: left;
}
.inv-dng-outcome-hp-row {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	font-size: .8rem;
	color: #cbd5e1;
}
.inv-dng-outcome-hp-val {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.inv-dng-outcome-hp-bar-wrap {
	background: #1e293b;
	border-radius: 3px;
	height: 6px;
	overflow: hidden;
}
.inv-dng-outcome-turns {
	font-size: .72rem;
	color: #64748b;
	margin-bottom: .75rem;
}
.inv-dng-outcome-warning {
	font-size: .78rem;
	color: #fbbf24;
	background: #1c1300;
	border: 1px solid #78350f;
	border-radius: .375rem;
	padding: .4rem .75rem;
	margin-bottom: .75rem;
}

/* ═══════════════════════════════════════════════════════════
   Dungeon Preview Overlay
   ═══════════════════════════════════════════════════════════ */
.inv-dng-preview-overlay {
	position: fixed;
	inset: 0;
	z-index: 9000;
	background: rgba(0, 0, 0, .75);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.inv-dng-preview {
	background: #111827;
	border: 1px solid #1e293b;
	border-radius: .75rem;
	padding: 2rem 1.75rem;
	max-width: 380px;
	width: 100%;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.inv-dng-preview__tier {
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: #64748b;
	font-weight: 700;
}
.inv-dng-preview__quality {
	font-size: 1.6rem;
	font-weight: 800;
	letter-spacing: 2px;
	text-transform: uppercase;
	border: 2px solid;
	border-radius: .5rem;
	padding: .5rem 1rem;
	font-family: Rajdhani, sans-serif;
}
.inv-dng-preview__stats {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	background: #0f172a;
	border-radius: .5rem;
	padding: .875rem 1rem;
}
.inv-dng-preview__stat {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: .85rem;
}
.inv-dng-preview__stat-label { color: #64748b; }
.inv-dng-preview__stat-value { font-weight: 700; color: #e2e8f0; }
.inv-dng-preview__warning {
	font-size: .8rem;
	color: #fb923c;
	background: #1c0a00;
	border: 1px solid #7c2d12;
	border-radius: .375rem;
	padding: .5rem .875rem;
	line-height: 1.5;
}
.inv-dng-preview__actions {
	display: flex;
	flex-direction: column;
	gap: .625rem;
}
.inv-dng-preview__enter {
	background: #f59e0b;
	color: #000;
	border: none;
	border-radius: .5rem;
	padding: .7rem 1rem;
	font-size: .9rem;
	font-weight: 700;
	cursor: pointer;
	font-family: Rajdhani, sans-serif;
	letter-spacing: .5px;
	transition: background .2s;
}
.inv-dng-preview__enter:hover { background: #d97706; }
.inv-dng-preview__reroll {
	background: transparent;
	border: 1px solid #334155;
	border-radius: .5rem;
	color: #94a3b8;
	padding: .6rem 1rem;
	font-size: .85rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .2s, color .2s;
}
.inv-dng-preview__reroll:hover:not(:disabled) { border-color: #64748b; color: #e2e8f0; }
.inv-dng-preview__reroll:disabled { opacity: .45; cursor: not-allowed; }
.inv-dng-preview__rerolls {
	font-size: .75rem;
	opacity: .7;
}
.inv-dng-preview__cancel {
	background: transparent;
	border: none;
	color: #475569;
	font-size: .8rem;
	cursor: pointer;
	padding: .25rem;
	transition: color .2s;
}
.inv-dng-preview__cancel:hover { color: #94a3b8; }

/* Death drop notification */
.inv-dng-result__dropped {
	font-size: .82rem;
	color: #fb923c;
	background: #1c0800;
	border: 1px solid #7c2d12;
	border-radius: .5rem;
	padding: .75rem .875rem;
	margin: .75rem 0;
	line-height: 1.6;
	text-align: left;
}
.inv-dng-fail-drop-title {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: .92rem;
	color: #fca5a5;
	letter-spacing: .04em;
	text-transform: uppercase;
	margin-bottom: .5rem;
	text-align: center;
}
.inv-dng-fail-drop-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: .25rem 0 .5rem;
}
.inv-dng-fail-drop-row {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: 6px 10px;
	background: rgba(127,29,29,0.25);
	border: 1px solid rgba(239,68,68,0.25);
	border-radius: 6px;
	font-size: .82rem;
}
.inv-dng-fail-drop-row__icon { font-size: .9rem; }
.inv-dng-fail-drop-row__name {
	color: #fca5a5;
	font-weight: 600;
	flex: 1;
}
.inv-dng-fail-drop-row__dest {
	color: #94a3b8;
	font-size: .72rem;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.inv-dng-fail-drop-note {
	font-size: .7rem;
	color: #94a3b8;
	margin: .5rem 0 0;
	text-align: center;
	font-style: italic;
}
.inv-dng-outcome-dropped {
	font-size: .8rem;
	color: #fb923c;
	background: #1c0800;
	border: 1px solid #7c2d12;
	border-radius: .375rem;
	padding: .4rem .75rem;
	margin-bottom: .75rem;
}

/* ═══════════════════════════════════════════════════════════
   STANCE SELECTOR
   ═══════════════════════════════════════════════════════════ */
.inv-dng-stance-selector {
	text-align: center;
	padding: 1rem 0;
}
.inv-dng-stance-selector__title {
	font-family: Rajdhani, sans-serif;
	font-size: 1.3rem;
	font-weight: 700;
	color: #f1f5f9;
	margin-bottom: .25rem;
}
.inv-dng-stance-selector__subtitle {
	font-size: .8rem;
	color: #64748b;
	margin-bottom: 1rem;
}
.inv-dng-stance-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .6rem;
}
.inv-dng-stance-card {
	background: #0d1525;
	border: 1px solid #1e293b;
	border-radius: .75rem;
	padding: .875rem .75rem;
	cursor: pointer;
	transition: border-color .2s, transform .15s, background .2s;
	text-align: center;
	position: relative;
}
.inv-dng-stance-card:hover {
	border-color: #f59e0b;
	background: #111827;
	transform: translateY(-2px);
}
.inv-dng-stance-card.selected {
	border-color: #f59e0b;
	background: #1c1300;
	transform: scale(1.03);
	box-shadow: 0 0 18px rgba(245,158,11,.35);
}
.inv-dng-stance-card__icon {
	font-size: 1.75rem;
	line-height: 1;
	margin-bottom: .3rem;
}
.inv-dng-stance-card__name {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: .95rem;
	color: #f1f5f9;
	margin-bottom: .35rem;
}
.inv-dng-stance-card__desc {
	display: flex;
	gap: .3rem;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: .3rem;
}
.inv-dng-stance-buff {
	font-size: .7rem;
	font-weight: 700;
	color: #4ade80;
	background: rgba(74,222,128,.1);
	border-radius: .25rem;
	padding: .1rem .35rem;
}
.inv-dng-stance-nerf {
	font-size: .7rem;
	font-weight: 700;
	color: #f87171;
	background: rgba(248,113,113,.1);
	border-radius: .25rem;
	padding: .1rem .35rem;
}
.inv-dng-stance-card__flavor {
	font-size: .68rem;
	color: #475569;
	font-style: italic;
	line-height: 1.3;
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED BATTLE ARENA
   ═══════════════════════════════════════════════════════════ */

/* Boss fight arena glow */
.inv-dng-arena--boss {
	border: 1px solid rgba(239,68,68,.3);
	border-radius: .75rem;
	padding: .75rem;
	background: linear-gradient(180deg, rgba(239,68,68,.04) 0%, transparent 30%);
}
.inv-dng-boss-banner {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1.1rem;
	color: #ef4444;
	text-align: center;
	letter-spacing: .1em;
	text-transform: uppercase;
	margin-bottom: .5rem;
	animation: inv-dng-boss-pulse 1.5s ease-in-out infinite;
}
@keyframes inv-dng-boss-pulse {
	0%, 100% { opacity: 1; text-shadow: 0 0 8px rgba(239,68,68,.7); }
	50%       { opacity: .7; text-shadow: 0 0 20px rgba(239,68,68,1); }
}
.inv-dng-stance-badge {
	font-size: .72rem;
	font-weight: 700;
	color: #f59e0b;
	background: rgba(245,158,11,.1);
	border: 1px solid rgba(245,158,11,.25);
	border-radius: .375rem;
	padding: .2rem .6rem;
	text-align: center;
	margin-bottom: .6rem;
	letter-spacing: .04em;
}

/* Larger pet sprites in arena */
.inv-dng-combatant-pet-img {
	width: 100px;
	height: 100px;
}

/* Damage float number above sprite */
.inv-dng-combatant-species {
	position: relative;
}
.inv-dng-dmg-float {
	position: absolute;
	top: -8px;
	left: 50%;
	transform: translateX(-50%);
	pointer-events: none;
	z-index: 10;
}
.inv-dng-float-num {
	display: block;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1.2rem;
	color: #f87171;
	animation: inv-dng-float-up .9s ease-out forwards;
	white-space: nowrap;
}
.inv-dng-float-num--crit {
	font-size: 1.5rem;
	color: #fbbf24;
	text-shadow: 0 0 10px rgba(251,191,36,.8);
}
@keyframes inv-dng-float-up {
	0%   { opacity: 1; transform: translateY(0) scale(1); }
	60%  { opacity: 1; transform: translateY(-28px) scale(1.1); }
	100% { opacity: 0; transform: translateY(-50px) scale(.9); }
}

/* Arena flash overlay */
.inv-dng-arena--flash {
	animation: inv-dng-arena-flash .4s ease;
}
@keyframes inv-dng-arena-flash {
	0%   { background-color: transparent; }
	25%  { background-color: var(--flash-color, #fbbf24); opacity: .15; }
	100% { background-color: transparent; }
}

/* Attack label in VS column */
.inv-dng-atk-label {
	font-size: .65rem;
	font-weight: 700;
	color: #64748b;
	letter-spacing: .04em;
	text-align: center;
	min-height: 1rem;
	transition: opacity .2s, color .2s;
	opacity: 0;
	font-style: italic;
}
.inv-dng-atk-label--show {
	opacity: 1;
	color: #f59e0b;
}

/* Boss rage overlay banner */
.inv-dng-rage-overlay {
	background: linear-gradient(90deg, transparent, rgba(239,68,68,.15), transparent);
	border: 1px solid rgba(239,68,68,.6);
	border-radius: .5rem;
	color: #ef4444;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: .12em;
	text-align: center;
	padding: .6rem 1rem;
	text-shadow: 0 0 12px rgba(239,68,68,.9);
	opacity: 0;
	transition: opacity .4s;
}
.inv-dng-rage-overlay--show {
	opacity: 1;
	animation: inv-dng-rage-pulse .4s ease-in-out 5;
}
@keyframes inv-dng-rage-pulse {
	0%, 100% { box-shadow: 0 0 8px rgba(239,68,68,.4); }
	50%       { box-shadow: 0 0 24px rgba(239,68,68,.9); }
}
.inv-dng-mob-name--rage {
	color: #ef4444 !important;
	text-shadow: 0 0 8px rgba(239,68,68,.6);
}

/* Crit tag in log rows */
.inv-dng-crit-tag {
	font-size: .6rem;
	font-weight: 700;
	color: #fbbf24;
	background: rgba(251,191,36,.15);
	border-radius: .2rem;
	padding: .05rem .25rem;
	letter-spacing: .04em;
	vertical-align: middle;
}
.inv-dng-crit-tag--red {
	color: #f87171;
	background: rgba(248,113,113,.15);
}

/* Skill/attack name in log */
.inv-dng-log-name {
	font-size: .65rem;
	color: #475569;
	font-style: italic;
}

/* Mid-battle pause overlay */
.inv-dng-midpoint-pause {
	background: linear-gradient(90deg, transparent, rgba(245,158,11,.08), transparent);
	border-top: 1px solid rgba(245,158,11,.2);
	border-bottom: 1px solid rgba(245,158,11,.2);
	color: #f59e0b;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: .9rem;
	letter-spacing: .06em;
	text-align: center;
	padding: .6rem 1rem;
	animation: inv-dng-fadein .4s ease;
	transition: opacity .6s;
}
.inv-dng-midpoint-pause--fade {
	opacity: 0;
}

/* =============================================================================
   Stage Selection Grid
   ============================================================================= */

.inv-dng-stage-label {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1.1rem;
	letter-spacing: .08em;
	color: #94a3b8;
	text-transform: uppercase;
	margin-bottom: 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.inv-dng-sc-balance {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.95rem;
	font-weight: 700;
	color: #f59e0b;
	letter-spacing: 0;
	text-transform: none;
	background: rgba(245,158,11,0.1);
	border: 1px solid rgba(245,158,11,0.25);
	border-radius: 20px;
	padding: 3px 10px;
}

.inv-dng-stage-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin-bottom: 2rem;
}
@media (max-width: 640px) {
	.inv-dng-stage-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
	.inv-dng-stage-cards { grid-template-columns: 1fr; }
}

.inv-dng-stage-card {
	background: #111827;
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 10px;
	padding: .75rem;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: border-color .2s, transform .15s, box-shadow .2s;
	text-align: center;
}
.inv-dng-stage-card:hover:not(.locked) {
	border-color: rgba(245,158,11,.5);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(245,158,11,.12);
}
.inv-dng-stage-card.locked {
	cursor: not-allowed;
	opacity: .55;
	filter: grayscale(.6);
}
.inv-dng-stage-card.no-seal {
	border-color: rgba(239,68,68,.25);
}
.inv-dng-stage-card.no-seal:hover {
	border-color: rgba(239,68,68,.5);
}

.inv-dng-stage-num {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: .75rem;
	letter-spacing: .1em;
	color: #64748b;
	text-transform: uppercase;
	margin-bottom: .4rem;
}

.inv-dng-stage-gate {
	width: 100%;
	aspect-ratio: 4/3;
	object-fit: cover;
	border-radius: 6px;
	margin-bottom: .5rem;
	display: block;
}
.inv-dng-stage-gate-icon {
	font-size: 2.5rem;
	margin-bottom: .5rem;
}

.inv-dng-stage-lock {
	position: absolute;
	inset: 0;
	background: rgba(8,13,26,.75);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .3rem;
	border-radius: 10px;
}
.inv-dng-stage-lock-icon { font-size: 1.5rem; }
.inv-dng-stage-lock-req {
	font-size: .7rem;
	font-weight: 600;
	color: #94a3b8;
	letter-spacing: .05em;
}

.inv-dng-stage-name {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: .9rem;
	color: #e2e8f0;
	margin-bottom: .2rem;
}
.inv-dng-stage-drops {
	font-size: .68rem;
	color: #64748b;
	margin-bottom: .15rem;
}
.inv-dng-stage-sc {
	font-size: .7rem;
	color: #f59e0b;
	font-weight: 600;
	margin-bottom: .4rem;
}
.inv-dng-stage-seal-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .3rem;
}
.inv-dng-stage-seal-icon {
	height: 20px;
	width: 20px;
	object-fit: contain;
}
.inv-dng-stage-seal-qty {
	font-weight: 700;
	font-size: .78rem;
}
.inv-dng-stage-seal-qty.has-seals { color: #4ade80; }
.inv-dng-stage-seal-qty.no-seals  { color: #ef4444; }
.inv-dng-stage-free-badge {
	font-size: .68rem;
	color: #4ade80;
	font-weight: 600;
}

/* Stage 1 tier back button */
.inv-dng-stage-back-btn {
	background: transparent;
	border: none;
	color: #64748b;
	font-size: .82rem;
	cursor: pointer;
	padding: .3rem 0;
	margin-bottom: .75rem;
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	transition: color .15s;
}
.inv-dng-stage-back-btn:hover { color: #e2e8f0; }

/* Seal confirm overlay extras */
.inv-dng-preview__gate {
	width: 100%;
	max-height: 180px;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 1rem;
}
.inv-dng-preview__seal-icon {
	height: 18px;
	width: 18px;
	object-fit: contain;
	vertical-align: middle;
}

/* ── Stage Info Button ───────────────────────────────────────────────────── */
.inv-dng-stage-info-btn {
	position: absolute;
	top: .45rem;
	right: .45rem;
	background: rgba(0,0,0,.45);
	border: 1px solid rgba(245,158,11,.25);
	color: #f59e0b;
	font-size: .75rem;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	z-index: 10;
	transition: background .15s, border-color .15s;
}
.inv-dng-stage-info-btn:hover {
	background: rgba(245,158,11,.15);
	border-color: #f59e0b;
}

/* ── Stage Info Popup ────────────────────────────────────────────────────── */
.inv-dng-info-popup {
	background: #111827;
	border: 1px solid rgba(245,158,11,.3);
	border-radius: 14px;
	padding: 1.4rem 1.2rem 1.2rem;
	width: 100%;
	max-width: 340px;
	font-family: Inter, sans-serif;
	position: relative;
}
.inv-dng-info-popup__close {
	position: absolute;
	top: .6rem;
	right: .8rem;
	background: none;
	border: none;
	color: #64748b;
	font-size: 1.1rem;
	cursor: pointer;
	line-height: 1;
}
.inv-dng-info-popup__close:hover { color: #e2e8f0; }
.inv-dng-info-popup__gate {
	width: 100%;
	max-height: 140px;
	object-fit: contain;
	border-radius: 8px;
	margin-bottom: .9rem;
}
.inv-dng-info-popup__title {
	font-size: 1rem;
	font-weight: 700;
	color: #f0f4ff;
	margin-bottom: .5rem;
	font-family: Rajdhani, sans-serif;
}
.inv-dng-info-popup__element {
	display: inline-block;
	font-size: .7rem;
	font-weight: 600;
	padding: .15rem .55rem;
	border-radius: 20px;
	border: 1px solid;
	margin-bottom: .75rem;
}
.inv-dng-info-popup__stats {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	margin-bottom: .75rem;
}
.inv-dng-info-popup__stat {
	display: flex;
	justify-content: space-between;
	font-size: .78rem;
	color: #94a3b8;
}
.inv-dng-info-popup__stat span:last-child { color: #e2e8f0; font-weight: 600; }
.inv-dng-info-popup__section {
	border-top: 1px solid rgba(255,255,255,.06);
	padding-top: .6rem;
	margin-bottom: .6rem;
}
.inv-dng-info-popup__section-title {
	font-size: .7rem;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-bottom: .35rem;
}
.inv-dng-info-popup__set-name {
	font-size: .8rem;
	color: #f59e0b;
	margin-bottom: .2rem;
}
.inv-dng-info-popup__note {
	font-size: .72rem;
	color: #475569;
	border-top: 1px solid rgba(255,255,255,.06);
	padding-top: .5rem;
	margin-bottom: .7rem;
	font-style: italic;
}
.inv-dng-info-popup__dismiss {
	width: 100%;
	padding: .5rem;
	background: rgba(245,158,11,.1);
	border: 1px solid rgba(245,158,11,.3);
	border-radius: 8px;
	color: #f59e0b;
	font-size: .82rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}
.inv-dng-info-popup__dismiss:hover { background: rgba(245,158,11,.2); }

/* ── Named Dungeon Grid ──────────────────────────────────────────────────── */
.inv-dng-dungeon-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
	margin-bottom: 2rem;
}
@media (max-width: 600px) {
	.inv-dng-dungeon-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
	.inv-dng-dungeon-cards { grid-template-columns: 1fr; }
}

.inv-dng-dcard {
	background: #111827;
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 12px;
	padding: 1rem .75rem;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: border-color .2s, transform .15s, box-shadow .2s;
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: .35rem;
}
.inv-dng-dcard:hover:not(.locked) {
	border-color: rgba(245,158,11,.5);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(245,158,11,.12);
}
.inv-dng-dcard.locked {
	cursor: not-allowed;
	opacity: .5;
	filter: grayscale(.7);
}
.inv-dng-dcard-gate {
	width: 100%;
	aspect-ratio: 4/3;
	object-fit: cover;
	border-radius: 8px;
	display: block;
	margin-bottom: .3rem;
}
.inv-dng-dcard-info {
	position: absolute;
	top: .55rem;
	right: .55rem;
	z-index: 4;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	border: 1px solid rgba(245,158,11,.55);
	background: rgba(8,13,26,.7);
	color: #f59e0b;
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: .95rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s, transform .15s;
}
.inv-dng-dcard-info:hover {
	background: rgba(245,158,11,.2);
	transform: scale(1.08);
}

/* ── Dungeon traits info sheet ───────────────────────────────────────────── */
.inv-dng-traits-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(8,13,26,.78);
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.inv-dng-traits-overlay.open { display: flex; }
.inv-dng-traits-sheet {
	background: #0b1220;
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 14px;
	max-width: 28rem;
	width: 100%;
	max-height: 90vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 12px 60px rgba(0,0,0,.7);
}
.inv-dng-traits-hero {
	position: relative;
	background: #111827 center/cover;
	padding: 1.1rem .9rem;
	color: #fff;
}
.inv-dng-traits-hero__overlay {
	position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(8,13,26,.55) 0%, rgba(8,13,26,.9) 100%);
}
.inv-dng-traits-hero__title {
	position: relative;
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 1.3rem;
	letter-spacing: .02em;
}
.inv-dng-traits-hero__sub {
	position: relative;
	color: #94a3b8;
	font-size: .8rem;
	margin-top: .15rem;
}
.inv-dng-traits-body {
	padding: .9rem;
	overflow-y: auto;
}
.inv-dng-traits-section-title {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: .85rem;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #f59e0b;
	margin: .15rem 0 .5rem;
}
.inv-dng-traits-section-title + .inv-dng-traits-section-title { margin-top: 1rem; }
.inv-dng-traits-row {
	display: flex;
	gap: .65rem;
	padding: .55rem .65rem;
	background: rgba(255,255,255,.03);
	border: 1px solid rgba(255,255,255,.05);
	border-radius: 8px;
	margin-bottom: .4rem;
}
.inv-dng-traits-row__icon {
	font-size: 1.4rem;
	line-height: 1;
	flex-shrink: 0;
}
.inv-dng-traits-row__name {
	color: #f1f5f9;
	font-weight: 600;
	font-size: .9rem;
	margin-bottom: .15rem;
}
.inv-dng-traits-row__desc {
	color: #cbd5e1;
	font-size: .8rem;
	line-height: 1.4;
}
.inv-dng-traits-note {
	color: #94a3b8;
	font-size: .85rem;
	font-style: italic;
	text-align: center;
	padding: 1rem .5rem;
}
.inv-dng-traits-actions {
	border-top: 1px solid rgba(255,255,255,.06);
	padding: .7rem;
}
.inv-dng-traits-close {
	width: 100%;
	padding: .65rem;
	border-radius: 8px;
	background: rgba(255,255,255,.06);
	color: #e2e8f0;
	border: 1px solid rgba(255,255,255,.1);
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}
.inv-dng-traits-close:hover { background: rgba(255,255,255,.12); }
.inv-dng-dcard-icon {
	font-size: 2rem;
	line-height: 1;
}
.inv-dng-dcard-lock-overlay {
	position: absolute;
	inset: 0;
	background: rgba(8,13,26,.65);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.8rem;
	border-radius: 12px;
	z-index: 2;
}
.inv-dng-dcard-name {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1rem;
	color: #e2e8f0;
}
.inv-dng-dcard-desc {
	font-size: .67rem;
	color: #64748b;
	line-height: 1.4;
}
.inv-dng-dcard-lock {
	font-size: .7rem;
	color: #ef4444;
	font-weight: 600;
	margin-top: auto;
}

/* Seal badge on dungeon card */
.inv-dng-dseal {
	font-size: .7rem;
	font-weight: 700;
	padding: .15rem .5rem;
	border-radius: 20px;
	display: inline-block;
}
.inv-dng-dseal.free   { background: rgba(74,222,128,.1); color: #4ade80; border: 1px solid rgba(74,222,128,.25); }
.inv-dng-dseal.has    { background: rgba(245,158,11,.1); color: #f59e0b; border: 1px solid rgba(245,158,11,.25); }
.inv-dng-dseal.empty  { background: rgba(239,68,68,.1);  color: #ef4444; border: 1px solid rgba(239,68,68,.25); }

/* Sets badge on dungeon card */
.inv-dng-dsets {
	font-size: .65rem;
	color: #a78bfa;
	font-weight: 600;
	line-height: 1.3;
}
.inv-dng-dsets.setsiz { color: #64748b; }

/* ── Difficulty Picker ───────────────────────────────────────────────────── */
.inv-dng-diff-header {
	display: flex;
	align-items: center;
	gap: .75rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}
.inv-dng-diff-back {
	background: transparent;
	border: 1px solid rgba(255,255,255,.12);
	border-radius: 8px;
	color: #94a3b8;
	font-size: .8rem;
	font-weight: 600;
	padding: .3rem .7rem;
	cursor: pointer;
	transition: color .15s, border-color .15s;
	white-space: nowrap;
}
.inv-dng-diff-back:hover { color: #e2e8f0; border-color: rgba(255,255,255,.25); }
.inv-dng-diff-title {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1.1rem;
	color: #e2e8f0;
	flex: 1;
}
.inv-dng-diff-seal { margin-left: auto; }

.inv-dng-diff-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: .75rem;
	margin-bottom: 2rem;
}
@media (max-width: 640px) {
	.inv-dng-diff-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 380px) {
	.inv-dng-diff-grid { grid-template-columns: repeat(2, 1fr); }
}

.inv-dng-diff-card {
	background: #111827;
	border: 1px solid rgba(255,255,255,.08);
	border-radius: 10px;
	padding: .75rem .5rem;
	cursor: pointer;
	text-align: center;
	position: relative;
	transition: border-color .2s, transform .15s, box-shadow .2s;
	display: flex;
	flex-direction: column;
	gap: .3rem;
}
.inv-dng-diff-card:hover:not(.locked) {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(245,158,11,.1);
}
.inv-dng-diff-card.locked {
	cursor: not-allowed;
	opacity: .45;
	filter: grayscale(.7);
}
.inv-dng-diff-num {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: .85rem;
	letter-spacing: .05em;
}
.inv-dng-diff-rarity {
	font-size: .62rem;
	font-weight: 600;
	padding: .1rem .35rem;
	border-radius: 4px;
	border: 1px solid transparent;
	margin: 0 auto;
}
.inv-dng-diff-sc {
	font-size: .65rem;
	color: #f59e0b;
	font-weight: 600;
}
.inv-dng-diff-lock {
	font-size: .6rem;
	color: #ef4444;
	font-weight: 600;
	margin-top: auto;
}

/* Sets listed in confirm overlay */
.inv-dng-preview__sets {
	font-size: .72rem;
	color: #a78bfa;
	font-weight: 600;
	padding: .4rem .6rem;
	background: rgba(167,139,250,.08);
	border-radius: 6px;
	border: 1px solid rgba(167,139,250,.15);
	margin-bottom: .5rem;
	text-align: center;
}

/* ── AI Battle Narrative (Dungeon) ───────────────────────────────────────── */
.inv-dng-battle-narrative {
	font-size: 0.82rem;
	font-style: italic;
	color: rgba(240, 244, 255, 0.70);
	line-height: 1.55;
	text-align: center;
	padding: 8px 14px;
	margin: 10px 0 4px;
	border-top: 1px solid rgba(245, 158, 11, 0.20);
	border-bottom: 1px solid rgba(245, 158, 11, 0.20);
}

/* ── Tier-pick cards v2 (gate background) ───────────────────────────────── */
.inv-dng-tier-pick-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
	.inv-dng-tier-pick-cards { grid-template-columns: 1fr; }
}
.inv-dng-tpc {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid rgba(255,255,255,.08);
	border-top: 3px solid var(--tier-color, #f59e0b);
	background-size: cover;
	background-position: center;
	transition: transform .18s, box-shadow .18s, border-color .18s;
	min-height: 240px;
	display: flex;
	flex-direction: column;
}
.inv-dng-tpc:hover:not(.depleted) {
	transform: translateY(-3px);
	box-shadow: 0 8px 28px rgba(0,0,0,.5), 0 0 0 1px var(--tier-color, #f59e0b);
}
.inv-dng-tpc.depleted { opacity: .6; cursor: not-allowed; filter: grayscale(.5); }
/* When the card is depleted (no free tickets), the Buy ticket button must
   stay bright/clickable — only dim it once buy attempts run out. */
.inv-dng-tpc.depleted .inv-dng-tpc-buy {
	opacity: 1;
	filter: none;
	cursor: pointer;
	pointer-events: auto;
}

/* Dark gradient overlay so text is readable */
.inv-dng-tpc-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(5,10,20,.55) 0%,
		rgba(5,10,20,.78) 55%,
		rgba(5,10,20,.95) 100%
	);
	border-radius: inherit;
}

/* Colored top stripe */
.inv-dng-tpc-stripe {
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: var(--tier-color, #f59e0b);
	opacity: .8;
}

/* Card content sits above overlay */
.inv-dng-tpc-body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .4rem;
	padding: 1.25rem 1rem 1rem;
	flex: 1;
}

.inv-dng-tpc-icon { font-size: 2rem; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }

.inv-dng-tpc-name {
	font-family: Rajdhani, sans-serif;
	font-weight: 800;
	font-size: 1.3rem;
	color: #f1f5f9;
	text-transform: uppercase;
	letter-spacing: 1px;
	text-shadow: 0 2px 8px rgba(0,0,0,.8);
}

/* Ticket count badge */
.inv-dng-tpc-tickets {
	display: flex;
	align-items: baseline;
	gap: .3rem;
	padding: .3rem .8rem;
	border-radius: 20px;
	margin: .15rem 0;
}
.inv-dng-tpc-tickets.ok    { background: rgba(74,222,128,.15);  border: 1px solid rgba(74,222,128,.35); }
.inv-dng-tpc-tickets.empty { background: rgba(239,68,68,.12);   border: 1px solid rgba(239,68,68,.3); }
.inv-dng-tpc-tickets-num {
	font-size: 1.2rem;
	font-weight: 800;
	font-family: Rajdhani, sans-serif;
	color: inherit;
}
.inv-dng-tpc-tickets.ok    .inv-dng-tpc-tickets-num,
.inv-dng-tpc-tickets.ok    .inv-dng-tpc-tickets-lbl { color: #4ade80; }
.inv-dng-tpc-tickets.empty .inv-dng-tpc-tickets-num,
.inv-dng-tpc-tickets.empty .inv-dng-tpc-tickets-lbl { color: #f87171; }
.inv-dng-tpc-tickets-lbl { font-size: .7rem; font-weight: 600; }

/* Drop tags */
.inv-dng-tpc-drops {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .25rem;
	margin: .1rem 0;
}
.inv-dng-tpc-drop {
	font-size: .62rem;
	color: #94a3b8;
	background: rgba(255,255,255,.06);
	border: 1px solid rgba(255,255,255,.1);
	border-radius: 6px;
	padding: .2rem .4rem;
	display: flex;
	align-items: center;
	gap: .25rem;
}
.inv-dng-tpc-drop-img {
	width: 18px;
	height: 18px;
	object-fit: contain;
	display: block;
}

/* Level perks panel */
.inv-dng-tpc-perks {
	margin: 8px 0 4px;
	border-top: 1px solid rgba(255,255,255,0.08);
	padding-top: 7px;
}
.inv-dng-tpc-perks-title {
	font-size: .6rem;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: rgba(255,255,255,0.35);
	margin-bottom: 5px;
}
.inv-dng-perk-row {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: .65rem;
	color: rgba(255,255,255,0.35);
	padding: 2px 4px;
	border-radius: 4px;
	margin-bottom: 2px;
}
.inv-dng-perk-row.is-me {
	background: rgba(255,255,255,0.07);
	color: #f1f5f9;
	outline: 1px solid rgba(255,255,255,0.15);
}
.inv-dng-perk-lvl {
	font-weight: 700;
	min-width: 68px;
	font-family: Rajdhani, sans-serif;
	font-size: .7rem;
}
.inv-dng-perk-lvl--scout     { color: #9ca3af; }
.inv-dng-perk-lvl--commander { color: #f59e0b; }
.inv-dng-perk-lvl--warlord   { color: #ef4444; }
.inv-dng-perk-row.is-me .inv-dng-perk-lvl--scout     { color: #d1d5db; }
.inv-dng-perk-row.is-me .inv-dng-perk-lvl--commander { color: #fbbf24; }
.inv-dng-perk-row.is-me .inv-dng-perk-lvl--warlord   { color: #f87171; }
.inv-dng-perk-img {
	width: 14px;
	height: 14px;
	object-fit: contain;
	flex-shrink: 0;
}
.inv-dng-perk-val {
	color: inherit;
}
.inv-dng-perk-row.is-me .inv-dng-perk-val {
	color: #e2e8f0;
}

/* Reset timer */
.inv-dng-tpc-reset {
	font-size: .65rem;
	color: #64748b;
}
.inv-dng-tpc-reset.ready { color: #4ade80; }

/* Buy button */
.inv-dng-tpc-buy {
	margin-top: auto;
	width: 100%;
	padding: .4rem .6rem;
	background: rgba(245,158,11,.12);
	border: 1px solid rgba(245,158,11,.3);
	border-radius: 8px;
	color: #f59e0b;
	font-size: .72rem;
	font-weight: 700;
	cursor: pointer;
	font-family: Rajdhani, sans-serif;
	transition: background .15s, border-color .15s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .3rem;
}
.inv-dng-tpc-buy:hover:not(:disabled) { background: rgba(245,158,11,.22); border-color: rgba(245,158,11,.6); }
.inv-dng-tpc-buy:disabled { opacity: .5; cursor: not-allowed; }
.inv-dng-tpc-buy span { opacity: .7; font-weight: 400; }
.inv-dng-tpc-buy-maxed { font-size: .62rem; color: #475569; margin-top: auto; }

/* ── Tier-pick screen (Step 1) — legacy fallback ─────────────────────────── */
.inv-dng-tier-pick-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
	.inv-dng-tier-pick-cards { grid-template-columns: 1fr; }
}

.inv-dng-tier-pick-card {
	background: #111827;
	border: 2px solid rgba(255,255,255,.08);
	border-radius: 12px;
	padding: 1.25rem 1rem;
	cursor: pointer;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .4rem;
	transition: border-color .2s, transform .15s, box-shadow .2s;
}
.inv-dng-tier-pick-card:hover:not(.depleted) {
	border-color: rgba(245,158,11,.6);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(245,158,11,.12);
}
.inv-dng-tier-pick-card.depleted {
	opacity: .5;
	cursor: not-allowed;
	filter: grayscale(.4);
}
.inv-dng-tier-pick-icon {
	font-size: 2rem;
	line-height: 1;
}
.inv-dng-tier-pick-name {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 1.1rem;
	color: #e2e8f0;
}
.inv-dng-tier-pick-drops {
	font-size: .65rem;
	color: #64748b;
	line-height: 1.4;
}
.inv-dng-tier-pick-tickets {
	font-size: .78rem;
	font-weight: 700;
	margin-top: .25rem;
	padding: .2rem .65rem;
	border-radius: 20px;
}
.inv-dng-tier-pick-tickets.ok    { color: #4ade80; background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.2); }
.inv-dng-tier-pick-tickets.empty { color: #ef4444; background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.2); }

.inv-dng-tier-reset {
	font-size: .64rem;
	color: #64748b;
	margin-top: .2rem;
}
.inv-dng-tier-buy-btn {
	margin-top: .4rem;
	width: 100%;
	padding: .35rem .5rem;
	background: rgba(245,158,11,.1);
	border: 1px solid rgba(245,158,11,.3);
	border-radius: 8px;
	color: #f59e0b;
	font-size: .68rem;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s, border-color .15s;
	font-family: Rajdhani, sans-serif;
}
.inv-dng-tier-buy-btn:hover:not(:disabled) {
	background: rgba(245,158,11,.2);
	border-color: rgba(245,158,11,.6);
}
.inv-dng-tier-buy-btn:disabled { opacity: .5; cursor: not-allowed; }
.inv-dng-tier-buy-rem { opacity: .7; font-weight: 400; }
.inv-dng-tier-buy-maxed {
	margin-top: .4rem;
	font-size: .64rem;
	color: #475569;
}

/* ── Dungeon cards step 2 header ─────────────────────────────────────────── */
.inv-dng-stage-label--with-back {
	display: flex;
	align-items: center;
	gap: .75rem;
}
.inv-dng-tier-back-btn {
	background: transparent;
	border: 1px solid rgba(255,255,255,.12);
	border-radius: 8px;
	color: #94a3b8;
	font-size: .8rem;
	font-weight: 600;
	padding: .25rem .65rem;
	cursor: pointer;
	transition: border-color .2s, color .2s;
}
.inv-dng-tier-back-btn:hover { border-color: #f59e0b; color: #f59e0b; }

.inv-dng-tier-drop-note {
	font-size: .72rem;
	color: #94a3b8;
	margin: -.25rem 0 1rem;
	padding: .35rem .75rem;
	background: rgba(255,255,255,.04);
	border-radius: 6px;
	border-left: 3px solid rgba(245,158,11,.4);
}

/* ── Inline difficulty buttons on dungeon card ───────────────────────────── */
.inv-dng-diff-btns {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: .4rem;
	margin: .35rem 0;
}
.inv-dng-diff-btn {
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,.12);
	border-radius: 8px;
	color: var(--diff-color, #9ca3af);
	font-size: .72rem;
	font-weight: 700;
	padding: .45rem .3rem;
	cursor: pointer;
	transition: background .15s, border-color .15s, box-shadow .15s;
	line-height: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	width: 100%;
}
.inv-dng-diff-skull {
	width: 36px;
	height: 36px;
	object-fit: contain;
	display: block;
	filter: saturate(0.7) brightness(0.85);
	transition: filter .15s, transform .15s;
}

.inv-dng-conf-skull {
	width: 24px;
	height: 24px;
	object-fit: contain;
	display: inline-block;
	vertical-align: middle;
	margin-right: 4px;
}
.inv-dng-diff-btn:hover:not(.locked) .inv-dng-diff-skull,
.inv-dng-diff-btn.sel .inv-dng-diff-skull {
	filter: saturate(1) brightness(1.1);
	transform: scale(1.1);
}
.inv-dng-diff-btn:hover:not(.locked) {
	background: rgba(255,255,255,.06);
	border-color: var(--diff-color, #9ca3af);
	box-shadow: 0 0 8px color-mix(in srgb, var(--diff-color, #9ca3af) 30%, transparent);
}
.inv-dng-diff-btn.sel {
	background: color-mix(in srgb, var(--diff-color, #9ca3af) 18%, #080d1a);
	border-color: var(--diff-color, #9ca3af);
	color: var(--diff-color, #9ca3af);
	box-shadow: 0 0 10px color-mix(in srgb, var(--diff-color, #9ca3af) 40%, transparent);
}
.inv-dng-diff-btn.locked {
	opacity: .35;
	cursor: not-allowed;
}

.inv-dng-dcard-diff-info {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: .65rem;
	font-weight: 600;
	padding: .1rem .1rem;
	gap: .4rem;
}
.inv-dng-dcard-sc {
	color: #4ade80;
}

.inv-dng-dcard-enter {
	margin-top: auto;
	width: 100%;
	padding: .6rem .5rem;
	font-size: .85rem;
	font-weight: 700;
	font-family: 'Rajdhani', sans-serif;
	letter-spacing: 0.06em;
	border-radius: 8px;
	border: none;
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	color: #080d1a;
	box-shadow: 0 0 12px rgba(245,158,11,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
	cursor: pointer;
	transition: box-shadow .2s, transform .1s, opacity .15s;
	position: relative;
	overflow: hidden;
}
.inv-dng-dcard-enter::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
	pointer-events: none;
}
.inv-dng-dcard-enter:hover:not(:disabled) {
	box-shadow: 0 0 22px rgba(245,158,11,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
	transform: translateY(-1px);
	opacity: 1;
}
.inv-dng-dcard-enter:active {
	transform: scale(.97) translateY(0);
	box-shadow: 0 0 8px rgba(245,158,11,0.3);
}
.inv-dng-dcard-enter:disabled {
	opacity: .4;
	cursor: not-allowed;
	box-shadow: none;
}

/* ── Dungeon Entry Confirm Modal ─────────────────────────────────────────── */

.inv-dng-conf {
	background: #111827;
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 16px;
	overflow: hidden;
	width: 100%;
	max-width: 420px;
	margin: auto;
	display: flex;
	flex-direction: column;
	/* Cap height so the modal stays fully on screen on any device */
	max-height: min(92vh, 700px);
}

.inv-dng-conf__hero {
	position: relative;
	height: 160px;
	background-size: cover;
	background-position: center;
	background-color: #1e2a3a;
}

.inv-dng-conf__hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(8,13,26,0.85) 100%);
}

.inv-dng-conf__hero-top {
	position: absolute;
	bottom: 12px;
	left: 14px;
	right: 14px;
}

.inv-dng-conf__hero-name {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 1.3rem;
	color: #fff;
	line-height: 1.2;
	margin-bottom: 4px;
}

.inv-dng-conf__hero-diff {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 0.85rem;
	border: 1px solid;
	border-radius: 20px;
	padding: 2px 10px;
	background: rgba(0,0,0,0.4);
}

.inv-dng-conf__body {
	padding: 14px 16px 4px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(245,158,11,0.3) transparent;
}
.inv-dng-conf__body::-webkit-scrollbar {
	width: 5px;
}
.inv-dng-conf__body::-webkit-scrollbar-track {
	background: transparent;
}
.inv-dng-conf__body::-webkit-scrollbar-thumb {
	background: rgba(245,158,11,0.3);
	border-radius: 10px;
}
.inv-dng-conf__body::-webkit-scrollbar-thumb:hover {
	background: rgba(245,158,11,0.5);
}

.inv-dng-conf__stats {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 14px;
}

.inv-dng-conf__stat {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.85rem;
}

.inv-dng-conf__stat-label {
	color: #94a3b8;
	font-family: 'Rajdhani', sans-serif;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.75rem;
}

.inv-dng-conf__stat-value {
	font-weight: 600;
	color: #f0f4ff;
	display: flex;
	align-items: center;
	gap: 4px;
}

.inv-dng-conf-section-title {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: #64748b;
	margin-bottom: 6px;
	margin-top: 12px;
}

.inv-dng-conf-drops {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-bottom: 10px;
}

.inv-dng-conf-drop-row {
	display: grid;
	grid-template-columns: 110px 1fr 36px;
	align-items: center;
	gap: 8px;
}

.inv-dng-conf-drop-label {
	font-size: 0.78rem;
	color: #cbd5e1;
	display: flex;
	align-items: center;
	gap: 6px;
}

.inv-dng-conf-drop-img {
	width: 18px;
	height: 18px;
	object-fit: contain;
	flex-shrink: 0;
}

.inv-dng-conf-drop-bar-wrap {
	background: rgba(255,255,255,0.06);
	border-radius: 4px;
	height: 6px;
	overflow: hidden;
}

.inv-dng-conf-drop-bar {
	height: 100%;
	border-radius: 4px;
	transition: width 0.4s ease;
}

.inv-dng-conf-drop-pct {
	font-size: 0.72rem;
	font-weight: 700;
	text-align: right;
}

.inv-dng-conf-items {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
	margin-bottom: 10px;
}

.inv-dng-conf-item-wrap {
	width: 36px;
	height: 36px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.inv-dng-conf-item-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.inv-dng-conf-seal-note {
	font-size: 0.78rem;
	color: #818cf8;
	margin: 8px 0;
}

.inv-dng-conf-sets {
	font-size: 0.75rem;
	color: #a78bfa;
	margin: 6px 0;
}

.inv-dng-conf__warning {
	font-size: 0.75rem;
	color: #fbbf24;
	background: rgba(251,191,36,0.08);
	border: 1px solid rgba(251,191,36,0.2);
	border-radius: 6px;
	padding: 6px 10px;
	margin: 8px 0;
}

.inv-dng-conf__actions {
	display: flex;
	gap: 10px;
	flex-shrink: 0;
	padding: 12px 16px 16px;
	border-top: 1px solid rgba(255,255,255,0.06);
	background: #111827;
}

.inv-dng-preview__enter {
	flex: 1;
	background: linear-gradient(135deg, #f59e0b, #d97706);
	color: #000;
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 1rem;
	border: none;
	border-radius: 10px;
	padding: 12px 0;
	cursor: pointer;
	transition: opacity 0.15s, transform 0.1s;
}

.inv-dng-preview__enter:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

.inv-dng-preview__cancel {
	background: transparent;
	color: #64748b;
	font-family: 'Rajdhani', sans-serif;
	font-weight: 600;
	font-size: 0.9rem;
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 10px;
	padding: 12px 18px;
	cursor: pointer;
	transition: color 0.15s;
}

.inv-dng-preview__cancel:hover {
	color: #94a3b8;
}

/* ── Item slot tooltip on hover ──────────────────────────────────────────── */
.inv-dng-conf-item-wrap.inv-dng-has-tip {
	position: relative;
}
.inv-dng-itp {
	display: none;
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #0a1020;
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 8px;
	padding: 10px 12px;
	white-space: nowrap;
	z-index: 50;
	min-width: 250px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.75);
	pointer-events: none;
}
.inv-dng-itp::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: rgba(255,255,255,0.12);
}
.inv-dng-conf-item-wrap.inv-dng-has-tip:hover .inv-dng-itp,
.inv-dng-itp.active {
	display: block;
}
.inv-dng-itp-name {
	font-family: 'Rajdhani', sans-serif;
	font-weight: 700;
	font-size: 0.88rem;
	color: #f0f4ff;
	margin-bottom: 3px;
	display: flex;
	align-items: center;
	gap: 5px;
	flex-wrap: wrap;
}
.inv-dng-itp-path {
	font-size: 0.58rem;
	font-weight: 600;
	padding: 1px 5px;
	border-radius: 3px;
	letter-spacing: 0.04em;
}
.inv-dng-itp-main {
	font-size: 0.72rem;
	color: #94a3b8;
	margin-bottom: 7px;
}
.inv-dng-itp-main strong {
	color: #f59e0b;
}
.inv-dng-itp-main .inv-dng-itp-main2 {
	color: #60a5fa;
}
.inv-dng-itp-divider {
	border: none;
	border-top: 1px solid rgba(255,255,255,0.07);
	margin: 5px 0;
}
.inv-dng-itp-subs {
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.inv-dng-itp-row {
	display: grid;
	grid-template-columns: 66px 46px 64px auto;
	gap: 4px;
	font-size: 0.63rem;
	align-items: center;
}
.inv-dng-itp-row--hdr span {
	color: #475569 !important;
	font-size: 0.58rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.inv-dng-itp-row span:nth-child(2) {
	color: #cbd5e1;
}
.inv-dng-itp-row span:nth-child(3) {
	color: #94a3b8;
}
.inv-dng-itp-row span:last-child {
	color: #a78bfa;
}
.inv-dng-itp-footer {
	font-size: 0.6rem;
	color: #64748b;
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid rgba(255,255,255,0.06);
	line-height: 1.5;
}

/* ============================================================================
   Dramatic Combat Pacing — Phase 2 additions
   ============================================================================ */

/* Freezeframe on crit — brief zoom + red glow */
@keyframes inv-dng-freezeframe {
	0%   { transform: scale(1);    filter: none; }
	35%  { transform: scale(1.12); filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.9)) drop-shadow(0 0 8px rgba(239, 68, 68, 0.7)); }
	70%  { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.6)); }
	100% { transform: scale(1);    filter: none; }
}
.inv-dng-freezeframe .inv-dng-combatant-species {
	animation: inv-dng-freezeframe 500ms ease-out;
}

/* Low HP tint — pet sprite goes red-tinted + slow pulse when <25% HP */
@keyframes inv-dng-low-hp-pulse {
	0%, 100% { filter: sepia(0.5) hue-rotate(-35deg) saturate(1.4) brightness(0.92); }
	50%      { filter: sepia(0.7) hue-rotate(-40deg) saturate(1.7) brightness(1.00); }
}
.inv-dng-low-hp .inv-dng-combatant-species {
	animation: inv-dng-low-hp-pulse 1.1s ease-in-out infinite;
}

/* Arena dungeon-specific background — attachment:fixed so element resize doesn't zoom the image */
.inv-dng-arena[style*="background-image"] {
	background-repeat: no-repeat;
	background-attachment: fixed;
	background-size: cover;
	background-position: center;
	border-radius: 12px;
	padding: 16px;
	position: relative;
}
.inv-dng-arena[style*="background-image"]::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(8, 13, 26, 0.2) 0%, rgba(8, 13, 26, 0.4) 100%);
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
}
.inv-dng-arena[style*="background-image"] > * {
	position: relative;
	z-index: 1;
}

/* Boss portrait — large centered above banner */
.inv-dng-boss-portrait {
	display: block;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	border: 3px solid rgba(239, 68, 68, 0.7);
	object-fit: cover;
	margin: 0 auto 8px;
	box-shadow: 0 0 20px rgba(239, 68, 68, 0.5), 0 0 40px rgba(239, 68, 68, 0.2);
	animation: inv-dng-boss-pulse 2s ease-in-out infinite;
}

/* Room icon in room cards */
.inv-dng-room-icon {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	object-fit: contain;
}

/* Room card with dungeon bg — semi-transparent overlay for text readability */
#inv-dng-room-card[style*="background-image"] {
	position: relative;
}
#inv-dng-room-card[style*="background-image"]::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(8, 13, 26, 0.3) 0%, rgba(8, 13, 26, 0.5) 100%);
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
}
#inv-dng-room-card[style*="background-image"] > * {
	position: relative;
	z-index: 1;
}

/* Boss portrait in pre-battle room — larger, centered */
.inv-dng-pre-boss-portrait {
	display: block;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	border: 3px solid rgba(239, 68, 68, 0.7);
	object-fit: cover;
	margin: 0 auto 10px;
	box-shadow: 0 0 24px rgba(239, 68, 68, 0.5), 0 0 48px rgba(239, 68, 68, 0.15);
}

/* ── Mobile safe-zone support (notch / home-indicator on iOS) ──────────── */
.inv-dng-wrap,
.inv-dng-stage-grid-wrap,
.inv-dng-conf-wrap {
	padding-top: env(safe-area-inset-top, 0px);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	padding-left: env(safe-area-inset-left, 0px);
	padding-right: env(safe-area-inset-right, 0px);
}
.inv-dng-item-detail-overlay,
.inv-tc-skill-detail-overlay {
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
.inv-dng-item-detail-back,
.inv-tc-sds-close {
	margin-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}

/* ── Turn transition flash on active combatant ──────────────────────────── */
@keyframes inv-dng-turn-flash {
	0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.0); }
	30%  { box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0.6); }
	100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.0); }
}
.inv-dng-fighter--active-turn {
	animation: inv-dng-turn-flash 0.4s ease-out;
}

/* ── Post-dungeon Battle Stats (MVP) ─────────────────────────────────────── */
.inv-dng-mvp {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin-top: 10px;
}
.inv-dng-mvp__card {
	background: #0f172a;
	border: 1px solid #1e293b;
	border-radius: 8px;
	padding: 10px 12px;
}
.inv-dng-mvp__name {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: .88rem;
	color: #f1f5f9;
	margin-bottom: 8px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.inv-dng-mvp__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: .75rem;
	margin-bottom: 4px;
	gap: 4px;
}
.inv-dng-mvp__label {
	color: #64748b;
	white-space: nowrap;
}
.inv-dng-mvp__val {
	font-weight: 600;
	white-space: nowrap;
}
.inv-dng-mvp__badge {
	font-size: .72rem;
	margin-left: 2px;
}

/* =============================================================================
   PREBATTLE BLOCK — room icon + description (used by all room types)
   ============================================================================= */

.inv-dng-prebattle {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .75rem;
	padding: 1.5rem 1rem 1.25rem;
	text-align: center;
}
.inv-dng-prebattle__icon {
	line-height: 1;
}
.inv-dng-prebattle__icon img {
	width: 64px;
	height: 64px;
	object-fit: contain;
	filter: drop-shadow(0 4px 14px rgba(0,0,0,.75));
	display: block;
}
.inv-dng-prebattle__title {
	font-size: .92rem;
	color: #f59e0b;
	font-weight: 600;
	line-height: 1.55;
	font-style: italic;
	max-width: 440px;
}
.inv-dng-prebattle__hint {
	font-size: .78rem;
	color: #475569;
	line-height: 1.4;
	max-width: 360px;
}

/* =============================================================================
   GAME SHELL — Fullscreen dungeon redesign  (body.inv-game-page scope)
   ============================================================================= */

/* Page: full width, zero padding — selection screens get their own padding below */
body.inv-game-page .inv-dng-page {
	max-width: 100%;
	width: 100%;
	margin: 0;
	padding: 0;
}

/* Selection screens: restore comfortable padding, stretch to fill viewport */
body.inv-game-page #inv-dng-select {
	padding: 0 1.75rem 1rem;
	min-height: calc(100vh - 44px - env(safe-area-inset-top));
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}
body.inv-game-page #inv-dng-stage-grid {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Hide redundant title/SC header — game topbar already shows DUNGEON + balance */
body.inv-game-page .inv-dng-header {
	display: none;
}

/* ── Selection screens: wider grids ───────────────────────────────────────── */

body.inv-game-page .inv-dng-stage-cards,
body.inv-game-page .inv-dng-dungeon-cards {
	grid-template-columns: repeat(4, 1fr);
}
/* Taller gate images for the extra width */
body.inv-game-page .inv-dng-stage-gate,
body.inv-game-page .inv-dng-dcard-gate {
	aspect-ratio: 16/9;
}

/* Tier pick: fill remaining height of the stage grid */
body.inv-game-page .inv-dng-tier-pick-cards {
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: 1fr;
	gap: 1.5rem;
	flex: 1;
	align-items: stretch;
}
body.inv-game-page .inv-dng-tpc {
	min-height: unset;
	height: 100%;
}
/* Mobile: single column, cards stack vertically */
@media (max-width: 640px) {
	body.inv-game-page .inv-dng-tier-pick-cards {
		grid-template-columns: 1fr;
		grid-template-rows: unset;
		gap: 0.875rem;
		flex: unset;
	}
	body.inv-game-page .inv-dng-tpc {
		min-height: 160px;
		height: unset;
	}
}
body.inv-game-page .inv-dng-diff-grid {
	grid-template-columns: repeat(6, 1fr);
}

/* ── Active run — fill the screen ─────────────────────────────────────────── */

body.inv-game-page #inv-dng-run {
	display: flex;
	flex-direction: column;
	width: 100%;
	min-height: calc(100vh - 44px - env(safe-area-inset-top));
}

/* Slim info bar */
body.inv-game-page .inv-dng-run-header {
	background: rgba(8,13,26,.82);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid rgba(245,158,11,.18);
	padding: .55rem 1.5rem;
	margin-bottom: 0;
	flex-shrink: 0;
}

/* Room card: complete screen fills full width, aligns to top */
body.inv-game-page .inv-dng-room-card:has(.inv-dng-complete) {
	display: flex;
	align-items: flex-start;
	justify-content: stretch;
}

/* Complete screen: full width, no max-width cap */
body.inv-game-page .inv-dng-complete {
	max-width: 100%;
	width: 100%;
	padding: 24px 28px;
}

/* Room card: edge-to-edge, fills remaining height */
body.inv-game-page .inv-dng-room-card {
	flex: 1;
	border-radius: 0 !important;
	margin: 0;
	border: none;
	border-top: 1px solid rgba(255,255,255,.04);
	padding: 2rem;
	background-size: cover !important;
	background-position: center !important;
	position: relative;
	min-height: 420px;
}

/* Dark overlay on dungeon bg art */
body.inv-game-page .inv-dng-room-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		160deg,
		rgba(8,13,26,.78) 0%,
		rgba(8,13,26,.6) 45%,
		rgba(8,13,26,.8) 100%
	);
	pointer-events: none;
	z-index: 0;
}
/* All direct children float above the overlay */
body.inv-game-page .inv-dng-room-card > * {
	position: relative;
	z-index: 1;
}

/* Room-type badge: a bit larger */
body.inv-game-page .inv-dng-room-card > .inv-dng-room-type {
	font-size: .8rem;
	padding: .3rem .8rem;
}
/* Room title: bigger & bolder */
body.inv-game-page .inv-dng-room-card > .inv-dng-room-title {
	font-size: 1.8rem;
	margin-top: .4rem;
	margin-bottom: 1.25rem;
}

/* ── Desktop: 2-column split inside the room card ─────────────────────────
   Left  = prebattle art/description
   Right = action options / buttons
   Works for event, treasure, combat pre-battle (all use .inv-dng-prebattle)
   Combat tactical view (.inv-tc-*) overrides with its own layout.
   ─────────────────────────────────────────────────────────────────────────── */
@media (min-width: 900px) {
	/* Single-column stacked: type → title → prebattle → options */
	body.inv-game-page .inv-dng-room-card:has(.inv-dng-prebattle) {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 0;
	}

	/* Type badge + title: full width, left-aligned */
	body.inv-game-page .inv-dng-room-card:has(.inv-dng-prebattle) > .inv-dng-room-type,
	body.inv-game-page .inv-dng-room-card:has(.inv-dng-prebattle) > .inv-dng-room-title {
		width: 100%;
		margin: 0;
		padding: 1.75rem 2.5rem .25rem;
	}
	body.inv-game-page .inv-dng-room-card:has(.inv-dng-prebattle) > .inv-dng-room-title {
		padding-top: .35rem;
		padding-bottom: 0;
	}

	/* Prebattle panel: centered, max-width */
	body.inv-game-page .inv-dng-room-card > .inv-dng-prebattle {
		width: 100%;
		max-width: 560px;
		box-sizing: border-box;
		padding: 2rem;
		text-align: center;
		align-items: center;
		border-right: none;
		border-bottom: 1px solid rgba(255,255,255,.07);
		min-height: unset;
		justify-content: center;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-prebattle .inv-dng-prebattle__icon img {
		width: 88px;
		height: 88px;
		margin-bottom: .5rem;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-prebattle .inv-dng-prebattle__title {
		font-size: 1.05rem;
		max-width: none;
		text-align: center;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-prebattle .inv-dng-prebattle__hint {
		max-width: none;
		font-size: .82rem;
		text-align: center;
	}

	/* Options / fight buttons: centered below prebattle */
	body.inv-game-page .inv-dng-room-card > .inv-dng-event-options {
		width: 100%;
		max-width: 560px;
		padding: 1.75rem 2rem;
		margin: 0;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-event-options .inv-dng-event-option {
		padding: 1rem 1.25rem;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-event-options .inv-dng-event-option__label {
		font-size: 1rem;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-actions {
		width: 100%;
		max-width: 560px;
		padding: 1.75rem 2rem;
		flex-direction: column;
		gap: .875rem;
		margin: 0;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-actions .inv-dng-btn {
		width: 100%;
		padding: .875rem 1.5rem;
		font-size: 1rem;
		justify-content: center;
	}
}

/* Mobile / narrow: restore normal stacked layout */
@media (max-width: 899px) {
	body.inv-game-page .inv-dng-stage-cards,
	body.inv-game-page .inv-dng-dungeon-cards {
		grid-template-columns: repeat(2, 1fr);
	}
	body.inv-game-page .inv-dng-diff-grid {
		grid-template-columns: repeat(3, 1fr);
	}
	body.inv-game-page .inv-dng-room-card {
		padding: 1.25rem 1rem;
	}
	/* Single-column stacked on mobile — options centered */
	body.inv-game-page .inv-dng-room-card:has(.inv-dng-prebattle) {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto auto auto;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-prebattle {
		grid-column: 1;
		grid-row: 3;
		border-right: none;
		border-bottom: 1px solid rgba(255,255,255,.07);
		padding: 1.5rem 1rem;
		min-height: unset;
	}
	body.inv-game-page .inv-dng-room-card > .inv-dng-event-options,
	body.inv-game-page .inv-dng-room-card > .inv-dng-actions {
		grid-column: 1;
		grid-row: 4;
		max-width: none;
		padding: 1.25rem 1rem;
		justify-self: stretch;
	}
}

/* ── Dungeon tier card desktop: bigger text ───────────────── */
@media (min-width: 768px) {
	body.inv-game-page .inv-dng-tpc-body {
		gap: .75rem;
		padding: 1.75rem 1.5rem 1.25rem;
	}
	body.inv-game-page .inv-dng-tpc-icon { font-size: 3.5rem; }
	body.inv-game-page .inv-dng-tpc-name { font-size: 2rem; letter-spacing: 3px; }
	body.inv-game-page .inv-dng-tpc-tickets {
		padding: .45rem 1.25rem;
		gap: .4rem;
		margin: .25rem 0;
	}
	body.inv-game-page .inv-dng-tpc-tickets-num { font-size: 1.75rem; }
	body.inv-game-page .inv-dng-tpc-tickets-lbl { font-size: .95rem; }
	body.inv-game-page .inv-dng-tpc-drops { gap: .4rem; margin: .2rem 0; }
	body.inv-game-page .inv-dng-tpc-drop {
		font-size: .85rem;
		padding: .3rem .65rem;
		gap: .35rem;
		border-radius: 8px;
	}
	body.inv-game-page .inv-dng-tpc-drop-img { width: 22px; height: 22px; }
	body.inv-game-page .inv-dng-tpc-perks { margin: 10px 0 4px; padding-top: 10px; }
	body.inv-game-page .inv-dng-tpc-perks-title { font-size: .8rem; margin-bottom: 7px; }
	body.inv-game-page .inv-dng-perk-row {
		font-size: .88rem;
		padding: 3px 7px;
		gap: 7px;
		margin-bottom: 3px;
	}
	body.inv-game-page .inv-dng-perk-lvl { font-size: .92rem; min-width: 88px; }
	body.inv-game-page .inv-dng-perk-img { width: 18px; height: 18px; }
	body.inv-game-page .inv-dng-tpc-reset { font-size: .82rem; }
	body.inv-game-page .inv-dng-tpc-buy {
		font-size: 1rem;
		padding: .65rem 1.25rem;
		border-radius: 10px;
	}
	body.inv-game-page .inv-dng-tpc-buy-maxed { font-size: .8rem; }
}

/* ── Combat active: flex-chain so arena fills to skill bar (desktop) ──────── */
@media (min-width: 769px) {
	/* Detected via :has() — no JS class needed */
	#inv-game-content:has(.inv-tc-arena) .inv-dng-page {
		flex: 1;
		display: flex;
		flex-direction: column;
		padding-top: 0;
		padding-bottom: 0;
	}
	#inv-game-content:has(.inv-tc-arena) #inv-dng-run {
		flex: 1;
		display: flex;
		flex-direction: column;
		min-height: 0;
	}
	/* Room card is the missing link between #inv-dng-run and .inv-tc-arena */
	#inv-game-content:has(.inv-tc-arena) .inv-dng-room-card {
		flex: 1;
		display: flex;
		flex-direction: column;
		min-height: 0;
	}
	/* Run header + buffs bar must not grow — they're fixed chrome */
	#inv-game-content:has(.inv-tc-arena) .inv-dng-run-header,
	#inv-game-content:has(.inv-tc-arena) #inv-dng-run-buffs {
		flex-shrink: 0;
	}
}

/* ── Parchment Prep Modal ─────────────────────────────────────────────────── */
.inv-prep-modal {
	max-height: min(90vh, 560px);
}

.inv-prep-header {
	padding: 20px 20px 12px;
	text-align: center;
	border-bottom: 1px solid rgba(255,255,255,0.06);
}
.inv-prep-header-icon { font-size: 28px; margin-bottom: 4px; }
.inv-prep-header-title {
	font-family: 'Rajdhani', sans-serif;
	font-size: 1.2rem;
	font-weight: 700;
	color: #f1f5f9;
	letter-spacing: 0.03em;
}
.inv-prep-header-sub {
	font-size: 0.78rem;
	color: #64748b;
	margin-top: 2px;
}

.inv-prep-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.inv-prep-body::-webkit-scrollbar { width: 4px; }
.inv-prep-body::-webkit-scrollbar-track { background: transparent; }
.inv-prep-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.inv-prep-group-title {
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #64748b;
	padding: 0 2px;
}

.inv-prep-card {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.07);
	border-radius: 10px;
	padding: 10px 12px;
}
.inv-prep-card-icon { font-size: 22px; flex-shrink: 0; }
.inv-prep-card-info { flex: 1; min-width: 0; }
.inv-prep-card-name {
	font-size: 0.85rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.inv-prep-card-stat { font-size: 0.75rem; color: #94a3b8; margin-top: 1px; }

.inv-prep-card-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.inv-prep-card-qty {
	font-size: 0.8rem;
	color: #64748b;
	font-weight: 600;
}
.inv-prep-use-btn {
	background: rgba(245,158,11,0.15);
	border: 1px solid rgba(245,158,11,0.35);
	color: #f59e0b;
	font-size: 0.8rem;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s;
	white-space: nowrap;
}
.inv-prep-use-btn:hover { background: rgba(245,158,11,0.28); }
.inv-prep-use-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.inv-prep-active-title {
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #4ade80;
	padding: 0 2px;
}
.inv-prep-active-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.inv-prep-active-row {
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(74,222,128,0.06);
	border: 1px solid rgba(74,222,128,0.15);
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 0.82rem;
}
.inv-prep-active-icon { font-size: 16px; }
.inv-prep-active-label { flex: 1; color: #d1fae5; font-weight: 600; }
.inv-prep-active-timer {
	font-variant-numeric: tabular-nums;
	font-size: 0.82rem;
	font-weight: 700;
	min-width: 40px;
	text-align: right;
}

.inv-prep-none {
	text-align: center;
	color: #64748b;
	font-size: 0.85rem;
	padding: 16px 0;
}
