/* ═══════════════════════════════════════════════════════
   WAR PETS — Diablo Hub · Bottom-Sheet Panel · Safe Zone
   ═══════════════════════════════════════════════════════ */

/* ── Full-screen shell ────────────────────────────────── */
.inv-pet-hub {
	position: fixed;
	inset: 0;
	z-index: 9000;
	overflow: hidden;
	font-family: 'Rajdhani', 'Inter', sans-serif;
	color: #e2c97e;
	background: #000;
	display: flex;
	flex-direction: column;
	/* Safe zone: push content below status bar */
	padding-top: env(safe-area-inset-top, 0px);
}

/* ── Background image ─────────────────────────────────── */
.inv-pet-hub__bg {
	position: absolute;
	inset: 0;
	background-image: url('../images/pet-hub-bg.webp');
	background-size: cover;
	background-position: center 38%;
	filter: brightness(0.6) saturate(0.9);
}

/* ── Fog — darken side panels, leave center glowing ───── */
.inv-pet-hub__fog {
	position: absolute;
	inset: 0;
	background:
		/* darken left panel area */
		linear-gradient(to right, rgba(4,6,18,0.72) 0%, transparent 28%),
		/* darken right panel area */
		linear-gradient(to left,  rgba(4,6,18,0.72) 0%, transparent 28%),
		/* darken top bar */
		linear-gradient(to bottom, rgba(4,6,18,0.65) 0%, transparent 18%),
		/* darken bottom nav */
		linear-gradient(to top,   rgba(4,6,18,0.8)  0%, transparent 20%);
}

/* ── Vignette ─────────────────────────────────────────── */
.inv-pet-hub__vignette {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 110% 110% at 50% 50%, transparent 40%, rgba(0,0,0,0.75) 100%);
	pointer-events: none;
}

/* ── Particle canvas ──────────────────────────────────── */
.inv-pet-hub__particles {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

/* ── Door glow — desktop atmospheric effect ───────────── */
.inv-pet-hub__door-glow {
	display: none; /* mobile hidden */
	position: absolute;
	left: 38%;
	top: 22%;
	transform: translateX(-50%);
	/* Button sized to the arch opening — glows overflow visually */
	width: 160px;
	height: 240px;
	pointer-events: auto;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	z-index: 15;
}
.inv-pet-hub__door-glow:focus-visible { outline: none; }
.inv-pet-hub__door-glow.is-open .inv-pet-hub__door-glow-inner {
	background: radial-gradient(ellipse at 50% 50%,
		rgba(254, 215, 170, 0.5) 0%,
		rgba(251, 146, 60, 0.32) 40%,
		transparent 75%);
}
/* Outer haze — absolute so it doesn't expand the button */
.inv-pet-hub__door-glow-outer {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 240px;
	height: 360px;
	border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
	background: radial-gradient(ellipse at 50% 55%, rgba(251, 146, 60, 0.22) 0%, rgba(245, 158, 11, 0.12) 35%, rgba(217, 119, 6, 0.04) 65%, transparent 100%);
	filter: blur(22px);
	pointer-events: none;
	animation: door-breathe-outer 4s ease-in-out infinite alternate;
}
/* Inner bright kor */
.inv-pet-hub__door-glow-inner {
	position: absolute;
	top: 20%;
	left: 50%;
	transform: translateX(-50%);
	width: 120px;
	height: 180px;
	border-radius: 50% 50% 30% 30% / 55% 55% 35% 35%;
	background: radial-gradient(ellipse at 50% 50%, rgba(254, 215, 170, 0.3) 0%, rgba(251, 146, 60, 0.18) 40%, transparent 85%);
	filter: blur(15px);
	pointer-events: none;
	animation: door-breathe-inner 4s ease-in-out infinite alternate-reverse;
}
@keyframes door-breathe-outer {
	from { opacity: 0.65; transform: translate(-50%, -50%) scale(0.96); }
	to   { opacity: 1;    transform: translate(-50%, -50%) scale(1.04); }
}
@keyframes door-breathe-inner {
	from { opacity: 0.7; }
	to   { opacity: 1;   }
}
.inv-pet-hub__door-label {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-family: Rajdhani, sans-serif;
	font-size: 1.6rem;
	font-weight: 900;
	letter-spacing: 0.35em;
	text-transform: uppercase;
	color: #fde68a;
	text-shadow:
		0 0 8px #fff,
		0 0 18px rgba(245,158,11,1),
		0 0 40px rgba(245,158,11,0.8),
		0 0 70px rgba(245,158,11,0.4);
	animation: door-breathe-inner 2.5s ease-in-out infinite alternate;
	white-space: nowrap;
	pointer-events: none;
}
@media (min-width: 640px) {
	.inv-pet-hub__door-glow { display: block; }
}

/* ── Top bar ──────────────────────────────────────────── */
.inv-pet-hub__topbar {
	position: relative;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0.875rem 1.25rem 0;
	flex-shrink: 0;
}

/* Back-to-site button — mobile only, top-left */
.inv-pet-hub__back-btn {
	display: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-right: auto;
	flex-shrink: 0;
	background: rgba(245,158,11,0.08);
	border: 1px solid rgba(245,158,11,0.22);
	border-radius: 8px;
	color: rgba(226,201,126,0.75);
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
	-webkit-tap-highlight-color: transparent;
}
.inv-pet-hub__back-btn:hover,
.inv-pet-hub__back-btn:active { background: rgba(245,158,11,0.16); color: #f59e0b; }

/* Logo — absolutely centered in topbar */
.inv-pet-hub__logo {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	pointer-events: none;
	display: flex;
	align-items: baseline;
	gap: 0.25rem;
	line-height: 1;
	white-space: nowrap;
}
.inv-pet-hub__logo-war {
	font-size: clamp(1.5rem, 5vw, 2.2rem);
	font-weight: 900;
	letter-spacing: 0.12em;
	color: #f59e0b;
	text-shadow: 0 0 24px rgba(245,158,11,0.8), 0 0 60px rgba(245,158,11,0.3);
	animation: hub-logo-pulse 3s ease-in-out infinite;
}
@keyframes hub-logo-pulse {
	0%,100% { text-shadow: 0 0 24px rgba(245,158,11,0.8), 0 0 60px rgba(245,158,11,0.3); }
	50%      { text-shadow: 0 0 36px rgba(245,158,11,1),   0 0 80px rgba(245,158,11,0.5); }
}
.inv-pet-hub__logo-pets {
	font-size: clamp(1.5rem, 5vw, 2.2rem);
	font-weight: 900;
	letter-spacing: 0.12em;
	color: #e2c97e;
}
.inv-pet-hub__logo-beta {
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	color: #6b7280;
	border: 1px solid #374151;
	padding: 1px 4px;
	border-radius: 3px;
	margin-left: 0.4rem;
	align-self: center;
}

/* Player coins */
.inv-pet-hub__player {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.82rem;
	font-weight: 600;
}
.inv-pet-hub__player-sep  { color: #374151; }
.inv-pet-hub__player-sc,
.inv-pet-hub__player-wc   { color: #f59e0b; display: flex; align-items: center; gap: .25rem; }
.inv-pet-hub__sc-icon     { width: 15px; height: 15px; object-fit: contain; flex-shrink: 0; }

.inv-pet-hub__topbar-right {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Fullscreen toggle */
.inv-pet-hub__fs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background: none;
	border: 1px solid rgba(245,158,11,0.2);
	border-radius: 4px;
	color: rgba(226,201,126,0.5);
	cursor: pointer;
	flex-shrink: 0;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.inv-pet-hub__fs-btn:hover {
	color: #f59e0b;
	border-color: rgba(245,158,11,0.5);
	background: rgba(245,158,11,0.08);
}
.inv-pet-hub__fs-btn .inv-pet-hub__fs-compress { display: none; }
.inv-pet-hub__fs-btn.is-fullscreen .inv-pet-hub__fs-expand   { display: none; }
.inv-pet-hub__fs-btn.is-fullscreen .inv-pet-hub__fs-compress { display: block; }
.inv-pet-hub__fs-btn.is-fullscreen {
	color: #f59e0b;
	border-color: rgba(245,158,11,0.4);
}
@media (max-width: 639px) {
	/* Safe zone — root left/right for landscape notch */
	.inv-pet-hub {
		padding-left: env(safe-area-inset-left, 0px);
		padding-right: env(safe-area-inset-right, 0px);
	}
	/* Side drawers: position:fixed ignores root padding — add top inset to their headers */
	.inv-pet-hub__pet-roster.is-mobile-drawer .inv-pet-hub__panel-header,
	.inv-pet-hub__stat-panel.is-mobile-drawer .inv-pet-hub__panel-header {
		padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
	}
	/* Side drawer right: right inset for landscape notch */
	.inv-pet-hub__pet-roster.is-mobile-drawer {
		padding-right: env(safe-area-inset-right, 0px);
	}
	/* Side drawer left: left inset for landscape notch */
	.inv-pet-hub__stat-panel.is-mobile-drawer {
		padding-left: env(safe-area-inset-left, 0px);
	}

	/* Back button visible on mobile */
	.inv-pet-hub__back-btn { display: flex; }
	/* Fullscreen button hidden */
	.inv-pet-hub__fs-btn { display: none !important; }

	/* Pet portrait bigger */
	.inv-pet-hub__pet-img         { width: clamp(300px, 82vw, 500px) !important; }
	.inv-pet-hub__pet-placeholder { font-size: clamp(120px, 30vw, 200px); }
	.inv-pet-hub__portrait-glow   { width: clamp(260px, 72vw, 440px); height: clamp(260px, 72vw, 440px); }
}

/* ── Main — portrait center; always full-width on mobile ──────────── */
.inv-pet-hub__main {
	position: relative;
	z-index: 10;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	padding: 0.25rem 1rem 1.5vh;
	min-height: 0;
	min-width: 0;
	overflow: hidden;
	pointer-events: none; /* children re-enable individually */
}
.inv-pet-hub__main > * { pointer-events: auto; }

.inv-pet-hub__portrait-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Species glow color token — overridden per-pet by JS */
.inv-pet-hub__portrait-wrap {
	--pet-glow-rgb: 124, 58, 237;
}

.inv-pet-hub__portrait-glow {
	position: absolute;
	width: clamp(140px, 38vw, 300px);
	height: clamp(140px, 38vw, 300px);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(var(--pet-glow-rgb), 0.35) 0%, rgba(var(--pet-glow-rgb), 0.12) 45%, transparent 72%);
	filter: blur(38px);
	animation: hub-glow-breathe 4s ease-in-out infinite alternate;
	transition: background 0.6s ease;
}
@keyframes hub-glow-breathe {
	from { transform: scale(0.95); opacity: 0.7; }
	to   { transform: scale(1.12); opacity: 1; }
}

.inv-pet-hub__portrait {
	position: relative;
	z-index: 2;
	animation: hub-portrait-float 5s ease-in-out infinite;
}
@keyframes hub-portrait-float {
	0%,100% { transform: translateY(0); }
	50%      { transform: translateY(-10px); }
}

.inv-pet-hub__pet-img {
	width: clamp(160px, 38vw, 320px);
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 0 22px rgba(var(--pet-glow-rgb), 0.55)) drop-shadow(0 8px 32px rgba(0,0,0,0.85));
	transition: filter 0.6s ease;
}

.inv-pet-hub__pet-placeholder {
	font-size: clamp(72px, 18vw, 140px);
	filter: drop-shadow(0 0 20px rgba(var(--pet-glow-rgb), 0.45));
	display: block;
}

.inv-pet-hub__pet-info {
	display: none; /* name moved to bars-strip in bottom-bar */
}

/* Login CTA */
.inv-pet-hub__login-cta {
	display: inline-block;
	margin-top: 1rem;
	padding: 0.55rem 1.4rem;
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	color: #0f172a;
	font-weight: 800;
	font-size: 0.85rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 4px;
	box-shadow: 0 0 20px rgba(245,158,11,0.4);
	transition: box-shadow 0.2s, transform 0.15s;
}
.inv-pet-hub__login-cta:hover {
	box-shadow: 0 0 32px rgba(245,158,11,0.7);
	transform: translateY(-1px);
}

/* ── Primary action grid — always 4-wide inside bottom-bar ── */
.inv-pet-hub__actions {
	position: relative;
	z-index: 10;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 5px;
	padding: 6px 8px 6px;
}

.inv-pet-hub__action-btn {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 10px;
	background: rgba(6,10,21,0.65);
	border: 1px solid rgba(245,158,11,0.18);
	border-radius: 8px;
	text-decoration: none;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: background 0.15s, border-color 0.2s, transform 0.12s;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	position: relative;
}
.inv-pet-hub__action-btn:hover,
.inv-pet-hub__action-btn:focus-visible {
	background: rgba(245,158,11,0.1);
	border-color: rgba(245,158,11,0.5);
	outline: none;
}
.inv-pet-hub__action-btn:active { transform: scale(0.96); }

.inv-pet-hub__action-btn--primary {
	border-color: rgba(245,158,11,0.35);
	background: rgba(245,158,11,0.08);
}
.inv-pet-hub__action-btn--primary .inv-pet-hub__action-label {
	color: #fde68a;
	text-shadow: 0 0 8px rgba(245,158,11,0.5);
}

.inv-pet-hub__action-icon {
	font-size: 1.15rem;
	line-height: 1;
	filter: drop-shadow(0 0 4px rgba(245,158,11,0.25));
	flex-shrink: 0;
}
.inv-pet-hub__action-label {
	font-size: 0.64rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #c4a35a;
}

/* Notification dot */
.inv-pet-hub__action-btn .inv-pet-hub__nav-dot,
.inv-pet-hub__sec-btn    .inv-pet-hub__nav-dot {
	position: absolute;
	top: 6px;
	right: 7px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #f59e0b;
	box-shadow: 0 0 6px #f59e0b;
}

/* ── Utility nav bar — pill centered between topbar and game area ── */
.inv-pet-hub__secondary {
	position: relative;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2px;
	padding: 5px 8px 6px;
	/* pill background only as wide as the buttons */
	width: fit-content;
	width: -webkit-fit-content;
	align-self: center;
	background: rgba(4,7,18,0.82);
	border: 1px solid rgba(245,158,11,0.12);
	border-radius: 10px;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	margin: 3px auto 0;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	flex-shrink: 0;
	/* cap width on very small screens so it scrolls */
	max-width: calc(100vw - 20px);
}
.inv-pet-hub__secondary::-webkit-scrollbar { display: none; }

.inv-pet-hub__sec-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	padding: 6px 11px;
	text-decoration: none;
	border-radius: 6px;
	flex-shrink: 0;
	background: rgba(6,10,21,0.55);
	border: 1px solid rgba(245,158,11,0.1);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	transition: background 0.15s, border-color 0.15s;
	-webkit-tap-highlight-color: transparent;
	position: relative;
}
.inv-pet-hub__sec-btn:hover,
.inv-pet-hub__sec-btn:focus-visible {
	background: rgba(245,158,11,0.08);
	border-color: rgba(245,158,11,0.3);
	outline: none;
}
.inv-pet-hub__sec-icon {
	font-size: 1.1rem;
	line-height: 1;
}
.inv-pet-hub__sec-label {
	font-size: 0.58rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #4b5563;
	white-space: nowrap;
}
.inv-pet-hub__sec-btn--exit .inv-pet-hub__sec-icon  { font-size: 0.95rem; }
.inv-pet-hub__sec-btn--exit .inv-pet-hub__sec-label { color: #374151; }

/* ── Backdrop ─────────────────────────────────────────── */
.inv-hub-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9400;
	background: rgba(0,0,0,0.55);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none; /* always none — touch detection via JS touchstart, not backdrop click */
}
.inv-hub-backdrop[hidden] { display: none !important; }
.inv-hub-backdrop.is-visible {
	opacity: 1;
}

/* ─── Bottom-sheet SPA panel ────────────────────────────── */
.inv-hub-spa {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9500;
	height: auto;
	display: flex;
	flex-direction: column;
	background: #060a15;
	border-radius: 0;
	transform: translateY(102%);
	transition: transform 0.38s cubic-bezier(0.32, 0, 0.67, 0);
	will-change: transform;
	overflow: hidden;
}
.inv-hub-spa[hidden] { display: none !important; }
.inv-hub-spa.is-open {
	transform: translateY(0);
	transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Atmospheric BG inside panel */
.inv-hub-spa::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: url('../images/dungeons/bg-void-sanctum-ruinous.webp');
	background-size: cover;
	background-position: center 30%;
	filter: brightness(0.18) saturate(0.6);
	pointer-events: none;
	z-index: 0;
}

/* Drag grip — hidden (full-screen panel, back button used for navigation) */
.inv-hub-spa__grip { display: none; }

/* Panel header bar */
.inv-hub-spa__bar {
	position: relative;
	z-index: 2;
	height: calc(44px + env(safe-area-inset-top, 0px));
	padding-top: env(safe-area-inset-top, 0px);
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding-left: 1rem;
	padding-right: 1rem;
	background: rgba(6,10,21,0.92);
	border-bottom: 1px solid rgba(245,158,11,0.12);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.inv-hub-spa__back {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	background: none;
	border: 1px solid rgba(245,158,11,0.22);
	border-radius: 3px;
	color: #f59e0b;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.76rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 0.18rem 0.55rem;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.12s;
	white-space: nowrap;
}
.inv-hub-spa__back:hover { background: rgba(245,158,11,0.1); }
.inv-hub-spa__back-arrow { font-size: 1.1rem; line-height: 1; }

.inv-hub-spa__title {
	flex: 1;
	text-align: center;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.76rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #6b7280;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.inv-hub-spa__right {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-shrink: 0;
}

.inv-hub-spa__sc {
	font-family: Rajdhani, sans-serif;
	font-size: 0.8rem;
	font-weight: 700;
	color: #f59e0b;
	letter-spacing: 0.05em;
	display: flex;
	align-items: center;
	gap: .25rem;
}

/* Scrollable panel content */
.inv-hub-spa__content {
	position: relative;
	z-index: 1;
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	min-height: 0;
	/* Safe zone bottom so content isn't under home indicator */
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Loading spinner */
.inv-hub-spa__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 50vh;
}
.inv-hub-spa__spinner {
	display: block;
	width: 32px;
	height: 32px;
	border: 2px solid rgba(245,158,11,0.12);
	border-top-color: #f59e0b;
	border-radius: 50%;
	animation: inv-spa-spin 0.7s linear infinite;
}
@keyframes inv-spa-spin { to { transform: rotate(360deg); } }

/* ── Desktop ─────────────────────────────────────────── */
@media (min-width: 640px) {
	.inv-pet-hub__topbar {
		padding: 1.25rem 2rem 0;
	}
	.inv-pet-hub__actions {
		gap: 10px;
		padding: 8px 12px 5px;
	}
	.inv-pet-hub__action-btn { padding: 8px 14px; gap: 8px; }
	.inv-pet-hub__action-icon  { font-size: 1.2rem; }
	.inv-pet-hub__action-label { font-size: 0.66rem; }
	.inv-pet-hub__secondary {
		gap: 4px;
		padding: 5px 1.5rem 6px;
	}
	.inv-pet-hub__sec-btn  { padding: 5px 14px; }
	.inv-pet-hub__sec-label { font-size: 0.61rem; }
	.inv-hub-spa {
		border-radius: 0;
	}
	.inv-hub-spa__bar  { height: 48px; padding: 0 1.5rem; gap: 1rem; }
	.inv-hub-spa__grip-bar { width: 44px; }
}

/* Coins already shown in hub topbar — never duplicate in panel header */
.inv-hub-spa__sc { display: none; }

/* ── When bottom-sheet is open: hide game area + bottom bar ──
   body.inv-game-page is set by SPA openPage() on the action buttons.
   ─────────────────────────────────────────────────────────── */
body.inv-game-page .inv-pet-hub__game-area,
body.inv-game-page .inv-pet-hub__bottom-bar {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* ── Mobile only ─────────────────────────────────────── */
@media (max-width: 639px) {
	.inv-hub-spa__back-label { display: none; }
}

/* ═══════════════════════════════════════════════════════
   Floating Window System — desktop (≥1024px) only
   ═══════════════════════════════════════════════════════ */

/* Container — full viewport, pointer-events off so hub stays interactive */
.inv-pw-container {
	position: fixed;
	inset: 0;
	z-index: 9550;
	pointer-events: none;
}

/* Individual window */
.inv-pw {
	position: absolute;
	width: clamp(560px, 62vw, 1020px);
	height: clamp(420px, 80vh, 880px);
	display: flex;
	flex-direction: column;
	background: #060a15;
	border: 1px solid rgba(245,158,11,0.22);
	border-radius: 10px;
	overflow: hidden;
	pointer-events: auto;
	opacity: 0;
	transform: scale(0.91) translateY(14px);
	transition: opacity 0.2s ease, transform 0.2s ease;
	box-shadow: 0 28px 90px rgba(0,0,0,0.85), 0 0 0 1px rgba(245,158,11,0.07);
}
.inv-pw::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: url('../images/dungeons/bg-void-sanctum-ruinous.webp');
	background-size: cover;
	background-position: center 30%;
	filter: brightness(0.14) saturate(0.6);
	pointer-events: none;
	z-index: 0;
}
.inv-pw--open {
	opacity: 1;
	transform: none;
}
.inv-pw--closing {
	opacity: 0;
	transform: scale(0.94) translateY(10px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}
.inv-pw--dragging {
	cursor: grabbing !important;
	user-select: none;
	transition: none !important;
}

/* Title bar */
.inv-pw__bar {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	height: 40px;
	padding: 0 0.75rem;
	background: rgba(6,10,21,0.92);
	border-bottom: 1px solid rgba(245,158,11,0.14);
	flex-shrink: 0;
	cursor: grab;
	user-select: none;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.inv-pw__bar:active { cursor: grabbing; }
.inv-pw__bar--flash { animation: pw-flash 0.4s ease; }
@keyframes pw-flash {
	0%,100% { background: rgba(6,10,21,0.92); }
	50%      { background: rgba(245,158,11,0.16); }
}

.inv-pw__bar-icon {
	font-size: 1rem;
	flex-shrink: 0;
	line-height: 1;
}
.inv-pw__bar-title {
	flex: 1;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.78rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #9ca3af;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.inv-pw__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background: none;
	border: 1px solid rgba(245,158,11,0.18);
	border-radius: 4px;
	color: #6b7280;
	font-size: 0.7rem;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.inv-pw__close:hover {
	background: rgba(220,38,38,0.15);
	border-color: rgba(220,38,38,0.4);
	color: #ef4444;
}

/* Body */
.inv-pw__body {
	position: relative;
	z-index: 1;
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	min-height: 0;
}

/* Loading */
.inv-pw__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 200px;
}
.inv-pw__spinner {
	display: block;
	width: 30px;
	height: 30px;
	border: 2px solid rgba(245,158,11,0.12);
	border-top-color: #f59e0b;
	border-radius: 50%;
	animation: inv-pw-spin 0.7s linear infinite;
}
@keyframes inv-pw-spin { to { transform: rotate(360deg); } }

/* Hide window system on mobile/tablet — they use the bottom sheet */
@media (max-width: 1023px) {
	.inv-pw-container { display: none !important; }
}

/* ── Pet-items layout fix inside floating window ─────────
   Media queries fire on VIEWPORT width, not window width.
   Override the 3-column layout so the window doesn't overflow.
   ─────────────────────────────────────────────────────── */
.inv-pw__body .inv-pit-layout {
	grid-template-columns: 1fr !important;
}
@media (min-width: 640px) {
	.inv-pw__body .inv-pit-layout {
		grid-template-columns: auto 1fr !important; /* charsheet + bag only, no detail sidebar */
	}
}
/* Detail panel is body-level (inv-pit-detail-panel) — no hub overrides needed. */
.inv-pw__body .inv-pit-detail { display: none !important; }
/* Charsheet center: guarantee minimum width in window */
.inv-pw__body .inv-pit-charsheet__center { min-width: 175px; }
/* Weapons row: tighter gap in window to prevent overflow */
.inv-pw__body .inv-pit-charsheet__weapons { gap: 10px; padding: 6px 12px 2px; }

/* ══════════════════════════════════════════════════════════
   START GAME — Intro Overlay
   ══════════════════════════════════════════════════════════ */
.inv-pet-intro {
	position: absolute;
	inset: 0;
	z-index: 9700;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(4,6,16,0.97);
	overflow: hidden;
	/* hidden by default — JS adds .is-visible */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.5s ease, transform 0.5s ease;
}
.inv-pet-intro.is-visible {
	opacity: 1;
	pointer-events: auto;
}
.inv-pet-intro.is-leaving {
	opacity: 0;
	transform: translateY(-24px) scale(1.02);
	pointer-events: none;
}

/* Radial glow behind content */
.inv-pet-intro__glow {
	position: absolute;
	width: 600px;
	height: 600px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, rgba(124,58,237,0.06) 50%, transparent 70%);
	animation: intro-glow-pulse 4s ease-in-out infinite alternate;
	pointer-events: none;
}
@keyframes intro-glow-pulse {
	from { transform: scale(0.9); opacity: 0.7; }
	to   { transform: scale(1.15); opacity: 1; }
}

/* Content stack */
.inv-pet-intro__content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	text-align: center;
	padding: 2rem 1.5rem;
}

/* "Age of Empires Mobile" eyebrow */
.inv-pet-intro__eyebrow {
	font-family: 'Rajdhani', sans-serif;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.2em;
	color: rgba(245,158,11,0.6);
	text-transform: uppercase;
}

/* WAR PETS logo */
.inv-pet-intro__logo {
	font-family: 'Rajdhani', sans-serif;
	font-size: clamp(3rem, 12vw, 5.5rem);
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	filter: drop-shadow(0 0 40px rgba(245,158,11,0.45));
	animation: intro-logo-breathe 3s ease-in-out infinite alternate;
}
@keyframes intro-logo-breathe {
	from { filter: drop-shadow(0 0 30px rgba(245,158,11,0.35)); }
	to   { filter: drop-shadow(0 0 55px rgba(245,158,11,0.65)); }
}
.inv-pet-intro__logo-war  { color: #fde68a; }
.inv-pet-intro__logo-pets {
	color: #f59e0b;
	text-shadow: 0 0 20px rgba(245,158,11,0.6);
}

/* Welcome text */
.inv-pet-intro__welcome {
	font-family: 'Rajdhani', sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	color: rgba(226,201,126,0.85);
	text-transform: uppercase;
	min-height: 1.4em;
}

/* START GAME button */
.inv-pet-intro__start-btn {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin-top: 0.75rem;
	padding: 0.9rem 2.5rem;
	background: transparent;
	border: 2px solid rgba(245,158,11,0.6);
	border-radius: 4px;
	font-family: 'Rajdhani', sans-serif;
	font-size: 1.15rem;
	font-weight: 800;
	letter-spacing: 0.15em;
	color: #fde68a;
	text-transform: uppercase;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: border-color 0.2s, color 0.2s, background 0.2s;
	animation: intro-btn-pulse 2.5s ease-in-out infinite;
}
@keyframes intro-btn-pulse {
	0%, 100% { box-shadow: 0 0 12px rgba(245,158,11,0.2), inset 0 0 0 rgba(245,158,11,0); }
	50%       { box-shadow: 0 0 28px rgba(245,158,11,0.45), inset 0 0 18px rgba(245,158,11,0.06); }
}
.inv-pet-intro__start-btn:hover {
	background: rgba(245,158,11,0.1);
	border-color: #f59e0b;
	color: #fff;
	animation: none;
}
.inv-pet-intro__start-btn:active { transform: scale(0.97); }
.inv-pet-intro__start-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	animation: none;
}
.inv-pet-intro__start-icon { font-size: 1.1rem; }
.inv-pet-intro__start-label { display: block; }

/* Loading bar — hidden until START clicked */
.inv-pet-intro__bar-wrap {
	width: min(280px, 80vw);
	margin-top: 0.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
}
.inv-pet-intro__bar-wrap.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.inv-pet-intro__bar-track {
	width: 100%;
	height: 3px;
	background: rgba(245,158,11,0.1);
	border-radius: 2px;
	overflow: hidden;
}
.inv-pet-intro__bar-fill {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, #d97706, #fbbf24);
	border-radius: 2px;
	transition: width 0.6s cubic-bezier(0.22,1,0.36,1);
	box-shadow: 0 0 8px rgba(245,158,11,0.7);
}
.inv-pet-intro__bar-label {
	font-family: 'Rajdhani', sans-serif;
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	color: rgba(245,158,11,0.65);
	text-transform: uppercase;
	text-align: center;
}

/* Bottom hint */
.inv-pet-intro__hint {
	position: absolute;
	bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
	left: 0;
	right: 0;
	text-align: center;
	font-family: 'Rajdhani', sans-serif;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.15em;
	color: rgba(245,158,11,0.3);
	text-transform: uppercase;
	animation: intro-hint-blink 2.5s ease-in-out infinite;
}
@keyframes intro-hint-blink {
	0%, 100% { opacity: 0.5; }
	50%       { opacity: 1; }
}
.inv-pet-intro__hint.is-loading { display: none; }

/* Hide pet nav bar when rendered inside floating window or bottom sheet */
.inv-pw__body .inv-pet-nav,
.inv-pw__body .inv-pet-nav-spacer,
.inv-hub-spa__body .inv-pet-nav,
.inv-hub-spa__body .inv-pet-nav-spacer { display: none !important; }

/* Portrait as link — preserve visual */
a.inv-pet-hub__portrait {
	display: flex;
	text-decoration: none;
	cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   MMORPG Layout — Game Area + Stat Panel + Roster + Bottom Bar
   ═══════════════════════════════════════════════════════ */

/* ── 3-column game area ───────────────────────────────── */
.inv-pet-hub__game-area {
	position: relative;
	z-index: 10;
	flex: 1;
	display: flex;
	align-items: stretch;
	min-height: 0;
	overflow: hidden;
}

/* ── Bottom bar shell ─────────────────────────────────── */
.inv-pet-hub__bottom-bar {
	position: relative;
	z-index: 10;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	background: rgba(4,7,18,0.93);
	border-top: 1px solid rgba(245,158,11,0.18);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	/* Push bar fully to bottom edge including home-indicator / gesture area */
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Panel collapse toggle ────────────────────────────── */
.inv-pet-hub__panel-toggle {
	flex-shrink: 0;
	width: auto;
	min-width: 22px;
	height: 22px;
	background: rgba(245,158,11,0.08);
	border: 1px solid rgba(245,158,11,0.2);
	border-radius: 4px;
	color: #f59e0b;
	font-size: 0.65rem;
	letter-spacing: 0.05em;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
	gap: 2px;
	transition: background 0.15s;
	-webkit-tap-highlight-color: transparent;
	white-space: nowrap;
}
.inv-pet-hub__panel-toggle:hover { background: rgba(245,158,11,0.22); }

/* ── Shared panel styles ──────────────────────────────── */
.inv-pet-hub__panel-header {
	padding: 0.4rem 0.6rem;
	border-bottom: 1px solid rgba(245,158,11,0.12);
	background: rgba(245,158,11,0.04);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	min-width: 0;
	overflow: hidden;
}
/* When collapsed, header only shows the toggle button */
.is-collapsed .inv-pet-hub__panel-header {
	justify-content: center;
	padding: 0.5rem 0;
	border-bottom: none;
	background: transparent;
}
.is-collapsed .inv-pet-hub__panel-title { display: none; }
.inv-pet-hub__panel-title {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.6rem;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: rgba(245,158,11,0.5);
}

/* ── Left stat panel ──────────────────────────────────── */
.inv-pet-hub__stat-panel {
	display: none; /* hidden on mobile */
	flex-direction: column;
	width: 200px;
	flex-shrink: 0;
	background: rgba(4,7,18,0.86);
	border-right: 1px solid rgba(245,158,11,0.14);
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-width: none;
	transition: width 0.3s cubic-bezier(0.22,1,0.36,1);
	position: relative;
}
.inv-pet-hub__stat-panel::-webkit-scrollbar { display: none; }
.inv-pet-hub__stat-panel.is-collapsed {
	width: 32px;
	overflow: hidden;
}
.inv-pet-hub__stat-panel.is-collapsed > *:not(.inv-pet-hub__panel-header) {
	opacity: 0;
	pointer-events: none;
	max-height: 0;
	padding: 0;
	margin: 0;
}

.inv-pet-hub__stat-quality {
	text-align: center;
	padding: 0.4rem 0.5rem 0.25rem;
	font-family: Rajdhani, sans-serif;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
/* Quality tier colours */
.quality-common    { color: #9ca3af; }
.quality-uncommon  { color: #86efac; }
.quality-rare      { color: #60a5fa; }
.quality-epic      { color: #c084fc; }
.quality-legendary { color: #fbbf24; text-shadow: 0 0 8px rgba(251,191,36,0.4); }
.quality-mythical  { color: #f43f5e; text-shadow: 0 0 10px rgba(244,63,94,0.5); }

.inv-pet-hub__stat-rows {
	flex: 1;
	padding: 0.15rem 0;
}
.inv-pet-hub__stat-row {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: center;
	gap: 0 6px;
	padding: 4px 10px;
	border-bottom: 1px solid rgba(255,255,255,0.03);
}
.inv-pet-hub__stat-row:last-child { border-bottom: none; }
/* Rows without a bonus span (Level, Stage, WIS) fall back to flex */
.inv-pet-hub__stat-row:not(:has(.inv-pet-hub__stat-bonus)) {
	display: flex;
	justify-content: space-between;
}

.inv-pet-hub__stat-key {
	font-family: Rajdhani, sans-serif;
	font-size: 0.6rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #4b5563;
}
.inv-pet-hub__stat-bonus {
	font-family: Rajdhani, sans-serif;
	font-size: 0.6rem;
	font-weight: 700;
	color: #4ade80;
	text-align: right;
	white-space: nowrap;
	justify-self: end;
}
.inv-pet-hub__stat-bonus:empty { visibility: hidden; }
.inv-pet-hub__stat-val {
	font-family: Rajdhani, sans-serif;
	font-size: 0.78rem;
	font-weight: 700;
	color: #e2c97e;
	text-align: right;
	white-space: nowrap;
}

/* Stat colour accents */
.inv-pet-hub__stat-row--atk  .inv-pet-hub__stat-key { color: rgba(248,113,113,0.55); }
.inv-pet-hub__stat-row--atk  .inv-pet-hub__stat-val { color: #f87171; }
.inv-pet-hub__stat-row--def  .inv-pet-hub__stat-key { color: rgba(96,165,250,0.55); }
.inv-pet-hub__stat-row--def  .inv-pet-hub__stat-val { color: #60a5fa; }
.inv-pet-hub__stat-row--mgc  .inv-pet-hub__stat-key { color: rgba(232,121,249,0.55); }
.inv-pet-hub__stat-row--mgc  .inv-pet-hub__stat-val { color: #e879f9; }
.inv-pet-hub__stat-row--mdef .inv-pet-hub__stat-key { color: rgba(129,140,248,0.55); }
.inv-pet-hub__stat-row--mdef .inv-pet-hub__stat-val { color: #818cf8; }
.inv-pet-hub__stat-row--hp   .inv-pet-hub__stat-key { color: rgba(251,113,133,0.55); }
.inv-pet-hub__stat-row--hp   .inv-pet-hub__stat-val { color: #fb7185; }
.inv-pet-hub__stat-row--wis  .inv-pet-hub__stat-key { color: rgba(74,222,128,0.55); }
.inv-pet-hub__stat-row--wis  .inv-pet-hub__stat-val { color: #4ade80; }

/* ── Affix section ────────────────────────────────────────────────────────── */
.inv-pet-hub__affix-section {
	padding: 2px 0;
}
.inv-pet-hub__affix-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px 2px;
}
.inv-pet-hub__affix-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 0.58rem;
	font-weight: 600;
	gap: 2px;
}
.inv-pet-hub__affix-item.is-zero {
	opacity: 0.28;
}
.inv-pet-hub__affix-lbl {
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
	min-width: 0;
}
.inv-pet-hub__affix-val {
	color: #fbbf24;
	font-weight: 700;
	flex-shrink: 0;
}
.inv-pet-hub__affix-item:not(.is-zero) .inv-pet-hub__affix-lbl { color: #94a3b8; }

/* ── Roster badges (feed / train indicators) ─────────────────────────────── */
.inv-pet-hub__roster-badges {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 0.7rem;
	line-height: 1;
	margin-left: auto;
	padding-right: 2px;
}
.inv-pet-hub__roster-badge {
	cursor: default;
}

.inv-pet-hub__stat-divider {
	height: 1px;
	background: rgba(245,158,11,0.08);
	margin: 3px 0;
}

/* ── XP bars strip inside bottom-bar ─────────────────────── */
.inv-pet-hub__bars-strip {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	padding: 6px 10px 4px;
	border-bottom: 1px solid rgba(245,158,11,0.1);
}
.inv-pet-hub__bars-strip .inv-pet-hub__exp-wrap {
	flex: 1;
}
.inv-pet-hub__bars-name {
	font-family: Rajdhani, sans-serif;
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #e2c97e;
	white-space: nowrap;
	flex-shrink: 0;
	min-width: 4rem;
}

/* EXP/Growth bar (legacy centered block — kept for non-bottom-bar use) */
.inv-pet-hub__bars-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	width: min(200px, 80%);
	margin: 0.4rem auto 0;
}
.inv-pet-hub__exp-wrap {
	padding: 0;
}
.inv-pet-hub__exp-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-family: Rajdhani, sans-serif;
	font-size: 0.56rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #6b7280;
	margin-bottom: 4px;
}
.inv-pet-hub__exp-wrap--lxp .inv-pet-hub__exp-label {
	color: #38bdf8;
	text-shadow: 0 0 6px rgba(56,189,248,0.4);
}
.inv-pet-hub__exp-wrap--growth .inv-pet-hub__exp-label {
	color: #f59e0b;
	text-shadow: 0 0 6px rgba(245,158,11,0.35);
}
.inv-pet-hub__exp-bar {
	height: 3px;
	background: rgba(255,255,255,0.07);
	border-radius: 2px;
	overflow: hidden;
}
.inv-pet-hub__exp-fill {
	height: 100%;
	background: linear-gradient(90deg, #6d28d9, #a855f7);
	border-radius: 2px;
	transition: width 0.9s cubic-bezier(0.22,1,0.36,1);
	box-shadow: 0 0 5px rgba(168,85,247,0.45);
}
.inv-pet-hub__exp-fill--lxp {
	background: linear-gradient(90deg, #0ea5e9, #38bdf8);
	box-shadow: 0 0 5px rgba(56,189,248,0.4);
}

/* ── Scroll action row (below XP bars, inside bottom-bar column) ── */
.inv-hub-scroll-row {
	display: flex;
	gap: 6px;
	padding: 0 10px 6px;
}
.inv-hub-scroll-btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 5px 8px;
	border-radius: 7px;
	border: 1px solid rgba(56,189,248,0.4);
	background: rgba(56,189,248,0.08);
	color: #38bdf8;
	font-family: Rajdhani, sans-serif;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
	white-space: nowrap;
}
.inv-hub-scroll-btn:active { background: rgba(56,189,248,0.18); }
.inv-hub-scroll-btn--growth {
	border-color: rgba(168,85,247,0.4);
	background: rgba(168,85,247,0.08);
	color: #a855f7;
}
.inv-hub-scroll-btn--growth:active { background: rgba(168,85,247,0.18); }

/* ── Scroll picker dropdown ──────────── */
.inv-hub-scroll-picker {
	background: rgba(8,13,26,0.96);
	border: 1px solid rgba(56,189,248,0.2);
	border-radius: 8px;
	padding: 4px;
	margin: 0 10px 6px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.inv-hub-scroll-picker--growth {
	border-color: rgba(168,85,247,0.2);
}
.inv-hub-scroll-opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 10px;
	border-radius: 6px;
	border: 1px solid rgba(255,255,255,0.06);
	background: rgba(255,255,255,0.03);
	cursor: pointer;
	text-align: left;
	transition: background 0.15s;
	width: 100%;
}
.inv-hub-scroll-opt:active { background: rgba(255,255,255,0.08); }
.inv-hub-scroll-opt__name {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.68rem;
	letter-spacing: 0.05em;
}
.inv-hub-scroll-opt__info {
	font-size: 0.62rem;
	color: #6b7280;
}

/* ── Right roster panel ───────────────────────────────── */
.inv-pet-hub__pet-roster {
	display: none; /* hidden on mobile */
	flex-direction: column;
	width: 200px;
	flex-shrink: 0;
	background: rgba(4,7,18,0.86);
	border-left: 1px solid rgba(245,158,11,0.14);
	overflow: hidden;
	transition: width 0.3s cubic-bezier(0.22,1,0.36,1);
	position: relative;
}
.inv-pet-hub__pet-roster.is-collapsed {
	width: 32px;
}
.inv-pet-hub__pet-roster.is-collapsed > *:not(.inv-pet-hub__panel-header) {
	opacity: 0;
	pointer-events: none;
	max-height: 0;
	padding: 0;
	margin: 0;
}

.inv-pet-hub__roster-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 0.5rem;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
	scrollbar-width: thin;
	scrollbar-color: rgba(245,158,11,0.2) transparent;
}
.inv-pet-hub__roster-list::-webkit-scrollbar { width: 3px; }
.inv-pet-hub__roster-list::-webkit-scrollbar-thumb { background: rgba(245,158,11,0.2); border-radius: 2px; }

.inv-pet-hub__roster-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	background: rgba(255,255,255,0.02);
	border: 1px solid rgba(245,158,11,0.08);
	border-radius: 6px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	-webkit-tap-highlight-color: transparent;
	touch-action: pan-y; /* allow vertical scroll to propagate; tap still fires click */
	flex-shrink: 0;
	/* button reset */
	font-family: inherit;
	font-size: inherit;
	color: inherit;
	text-align: left;
	width: 100%;
}
.inv-pet-hub__roster-item:hover {
	background: rgba(245,158,11,0.07);
	border-color: rgba(245,158,11,0.28);
}
.inv-pet-hub__roster-item.is-active {
	border-color: rgba(245,158,11,0.45);
	background: rgba(245,158,11,0.07);
	cursor: default;
}
.inv-pet-hub__roster-item.is-switching {
	opacity: 0.45;
	pointer-events: none;
}
.inv-pet-hub__roster-img {
	width: 36px;
	height: 36px;
	object-fit: contain;
	flex-shrink: 0;
	filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
}
.inv-pet-hub__roster-info {
	flex: 1;
	min-width: 0;
}
.inv-pet-hub__roster-name {
	font-family: Rajdhani, sans-serif;
	font-size: 0.68rem;
	font-weight: 700;
	color: #c4a35a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.inv-pet-hub__roster-sub {
	font-size: 0.52rem;
	font-family: Rajdhani, sans-serif;
	color: #4b5563;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.inv-pet-hub__roster-active-dot {
	width: 6px;
	height: 6px;
	background: #f59e0b;
	border-radius: 50%;
	box-shadow: 0 0 6px #f59e0b;
	flex-shrink: 0;
}
.inv-pet-hub__roster-empty {
	font-family: Rajdhani, sans-serif;
	font-size: 0.65rem;
	color: #374151;
	text-align: center;
	padding: 1.5rem 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

/* ── 3-column action grid variant ────────────────────────── */
.inv-pet-hub__actions--3 {
	grid-template-columns: repeat(3, 1fr);
}

/* ── Feed / Train action buttons in stat panel ───────────── */
.inv-pet-hub__stat-actions {
	display: flex;
	gap: 5px;
	padding: 5px 8px 6px;
}
.inv-pet-hub__stat-act-btn {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 5px 4px;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(245,158,11,0.14);
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s, transform 0.1s;
	font-family: Rajdhani, sans-serif;
	-webkit-tap-highlight-color: transparent;
}
.inv-pet-hub__stat-act-btn:hover:not(:disabled) {
	background: rgba(245,158,11,0.1);
	border-color: rgba(245,158,11,0.35);
}
.inv-pet-hub__stat-act-btn:active:not(:disabled) { transform: scale(0.94); }
.inv-pet-hub__stat-act-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}
.inv-pet-hub__stat-act-btn--feed { border-color: rgba(34,197,94,0.2); }
.inv-pet-hub__stat-act-btn--feed:hover:not(:disabled) {
	background: rgba(34,197,94,0.1);
	border-color: rgba(34,197,94,0.45);
}
.inv-pet-hub__stat-act-btn--train { border-color: rgba(248,113,113,0.2); }
.inv-pet-hub__stat-act-btn--train:hover:not(:disabled) {
	background: rgba(248,113,113,0.1);
	border-color: rgba(248,113,113,0.45);
}
.inv-pet-hub__stat-act-icon  { font-size: 0.95rem; line-height: 1; }
.inv-pet-hub__stat-act-label {
	font-size: 0.55rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #6b7280;
	display: flex;
	align-items: center;
	gap: 2px;
}
.inv-pet-hub__wc-icon {
	width: 12px;
	height: 12px;
	object-fit: contain;
	display: inline-block;
	vertical-align: middle;
	flex-shrink: 0;
}

/* Train stat picker */
.inv-pet-hub__train-wrap { flex: 1; position: relative; }
.inv-pet-hub__train-wrap .inv-pet-hub__stat-act-btn { width: 100%; }
.inv-pet-hub__train-picker {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: #0a0e1a;
	border: 1px solid rgba(245,158,11,0.25);
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 20;
	box-shadow: 0 -8px 24px rgba(0,0,0,0.6);
}
.inv-pet-hub__train-picker[hidden] { display: none; }
.inv-pet-hub__train-stat {
	padding: 6px 8px;
	background: none;
	border: none;
	border-bottom: 1px solid rgba(255,255,255,0.05);
	font-family: Rajdhani, sans-serif;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	color: #9ca3af;
	cursor: pointer;
	transition: background 0.1s, color 0.1s;
	text-align: center;
}
.inv-pet-hub__train-stat:last-child { border-bottom: none; }
.inv-pet-hub__train-stat:hover { background: rgba(248,113,113,0.12); color: #f87171; }

/* Flash message */
.inv-pet-hub__stat-flash {
	min-height: 1.4rem;
	padding: 2px 8px 6px;
	font-family: Rajdhani, sans-serif;
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-align: center;
	color: #22c55e;
	transition: opacity 0.3s;
}
.inv-pet-hub__stat-flash.is-error { color: #f87171; }

/* ── Floating toast (feed / train results) ── */
.inv-hub-toast {
	position: fixed;
	top: 60px;
	left: 50%;
	transform: translateX(-50%) translateY(-8px);
	z-index: 99999;
	background: rgba(17, 24, 39, 0.97);
	border: 1px solid rgba(34, 197, 94, 0.5);
	color: #22c55e;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.08em;
	padding: 8px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s ease, transform 0.22s ease;
	white-space: nowrap;
}
.inv-hub-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
.inv-hub-toast--error {
	border-color: rgba(248, 113, 113, 0.5);
	color: #f87171;
}

/* ── Stat breakdown tooltip ──────────────────────────────── */
.inv-pet-hub__stat-tip {
	position: fixed;
	z-index: 9990;
	background: #0a0e1a;
	border: 1px solid rgba(245,158,11,0.28);
	border-radius: 6px;
	padding: 7px 10px;
	font-family: Rajdhani, sans-serif;
	font-size: 0.65rem;
	color: #9ca3af;
	pointer-events: none;
	box-shadow: 0 4px 20px rgba(0,0,0,0.7);
	white-space: nowrap;
}
.inv-pet-hub__stat-tip-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	line-height: 1.6;
}
.inv-pet-hub__stat-tip-row--total {
	border-top: 1px solid rgba(245,158,11,0.15);
	margin-top: 3px;
	padding-top: 3px;
	color: #e2c97e;
	font-weight: 700;
}

/* Stat rows with tooltips — show pointer */
[data-stat-tip] { cursor: help; }

/* ── Show panels at tablet/desktop — absolute so pet stays centered ── */
@media (min-width: 768px) {
	/* Panels overlay the main area; pet portrait is unaffected by panel width */
	.inv-pet-hub__stat-panel {
		display: flex;
		position: absolute;
		left: 0;
		top: 0;
		bottom: 0;
		z-index: 20;
	}
	.inv-pet-hub__pet-roster {
		display: flex;
		position: absolute;
		right: 0;
		top: 0;
		bottom: 0;
		z-index: 20;
	}
	.inv-pet-hub__main {
		position: absolute;
		inset: 0;
		z-index: 10;
		flex: none; /* not a flex child anymore */
	}
	.inv-pet-hub__action-btn { padding: 8px 14px; gap: 8px; }
	.inv-pet-hub__action-icon { font-size: 1.2rem; }
	.inv-pet-hub__action-label { font-size: 0.66rem; }
}

/* =============================================================================
   Evolve / Hatch section
   ============================================================================= */
/* ── Evolve / Hatch section ── */
.inv-hub-evolve {
	margin: 6px 8px 0;
}

/* Hatch state — single row */
.inv-hub-evolve__hatch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	padding: 7px 10px;
	background: rgba(4,6,18,0.82);
	border: 1px solid rgba(245,158,11,0.35);
	border-radius: 8px;
	backdrop-filter: blur(6px);
}
.inv-hub-evolve__hatch-title {
	font-family: Rajdhani, sans-serif;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #fbbf24;
	text-transform: uppercase;
	margin: 0;
	flex: 1;
	text-shadow: 0 0 8px rgba(245,158,11,0.6);
}

/* Level-not-ready warning — single row */
.inv-hub-evolve__warn {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 7px 10px;
	background: rgba(4,6,18,0.82);
	border: 1px solid rgba(245,158,11,0.25);
	border-radius: 8px;
	backdrop-filter: blur(6px);
}
.inv-hub-evolve__warn-icon {
	font-size: 0.85rem;
	flex-shrink: 0;
}
.inv-hub-evolve__warn-text { flex: 1; }
.inv-hub-evolve__warn-title {
	font-family: Rajdhani, sans-serif;
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #fbbf24;
	text-transform: uppercase;
	display: block;
	margin: 0;
	text-shadow: 0 0 6px rgba(245,158,11,0.5);
}
.inv-hub-evolve__warn-sub {
	font-size: 0.55rem;
	color: #94a3b8;
	display: block;
	margin: 1px 0 0;
}

/* Full evolve panel */
.inv-hub-evolve__panel {
	background: rgba(4,6,18,0.82);
	border: 1px solid rgba(245,158,11,0.28);
	border-radius: 8px;
	padding: 8px 10px;
	backdrop-filter: blur(6px);
}
.inv-hub-evolve__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}
.inv-hub-evolve__title {
	font-family: Rajdhani, sans-serif;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: #f59e0b;
	text-transform: uppercase;
}
.inv-hub-evolve__cost {
	font-family: Rajdhani, sans-serif;
	font-size: 0.58rem;
	font-weight: 700;
	color: #94a3b8;
	background: rgba(255,255,255,0.05);
	border-radius: 4px;
	padding: 1px 5px;
	display: flex;
	align-items: center;
	gap: 3px;
}
.inv-hub-evolve__cost--free { color: #4ade80; }

/* Sacrifice grid — horizontal scroll row */
.inv-hub-evolve__grid {
	display: flex;
	flex-direction: row;
	gap: 5px;
	margin-bottom: 6px;
	overflow-x: auto;
	padding-bottom: 3px;
	scrollbar-width: thin;
	scrollbar-color: rgba(245,158,11,0.2) transparent;
}
.inv-hub-evolve__cand {
	flex: 0 0 58px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 5px 3px 4px;
	border: 1px solid rgba(255,255,255,0.07);
	border-radius: 7px;
	background: rgba(255,255,255,0.02);
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s;
	min-width: 0;
}
.inv-hub-evolve__cand:hover {
	border-color: rgba(245,158,11,0.35);
	background: rgba(245,158,11,0.06);
}
.inv-hub-evolve__cand.selected {
	border-color: #f59e0b;
	background: rgba(245,158,11,0.12);
}
.inv-hub-evolve__cand.has-items { opacity: 0.4; cursor: not-allowed; }
.inv-hub-evolve__cand-img {
	width: 30px;
	height: 30px;
	object-fit: contain;
}
.inv-hub-evolve__cand-name {
	font-family: Rajdhani, sans-serif;
	font-size: 0.52rem;
	font-weight: 700;
	color: #c8cce8;
	text-align: center;
	width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.inv-hub-evolve__cand-result {
	font-size: 0.48rem;
	color: #6b7494;
	text-align: center;
	line-height: 1.2;
}
.inv-hub-evolve__cand-result span { color: #f59e0b; }
.inv-hub-evolve__cand-items-warn {
	font-size: 0.44rem;
	color: #ef4444;
	text-align: center;
}

/* Empty state — compact inline */
.inv-hub-evolve__empty {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 5px 2px;
	color: #4b5563;
}
.inv-hub-evolve__empty-img {
	width: 28px;
	height: 28px;
	object-fit: contain;
	opacity: 0.2;
	flex-shrink: 0;
}
.inv-hub-evolve__empty-text {
	font-size: 0.55rem;
	color: #374151;
	line-height: 1.4;
}

/* Evolve / Hatch button */
.inv-hub-evolve__btn {
	width: 100%;
	padding: 6px 0;
	border: none;
	border-radius: 6px;
	background: #f59e0b;
	color: #000;
	font-family: Rajdhani, sans-serif;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.15s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.inv-hub-evolve__btn--inline {
	width: auto;
	padding: 5px 10px;
	font-size: 0.62rem;
	flex-shrink: 0;
}
.inv-hub-evolve__btn:hover:not(:disabled) { opacity: 0.85; }
.inv-hub-evolve__btn:disabled { opacity: 0.32; cursor: not-allowed; }
.inv-hub-evolve__btn--hatch { background: linear-gradient(135deg,#fbbf24,#f59e0b); }
.inv-hub-evolve__sc-icon {
	width: 12px;
	height: 12px;
	vertical-align: middle;
}

/* ── Sacrifice confirm modal ──────────────────────────────── */
.inv-hub-sac-confirm__overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0,0,0,0.75);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.22s;
}
.inv-hub-sac-confirm__overlay.is-visible { opacity: 1; }

.inv-hub-sac-confirm {
	background: linear-gradient(160deg, #0d111f 0%, #080d1a 100%);
	border: 1px solid rgba(220,38,38,0.45);
	border-radius: 14px;
	padding: 28px 24px 22px;
	max-width: 320px;
	width: 100%;
	text-align: center;
	box-shadow: 0 0 60px rgba(220,38,38,0.2), 0 24px 60px rgba(0,0,0,0.8);
	transform: translateY(10px);
	transition: transform 0.22s;
}
.inv-hub-sac-confirm__overlay.is-visible .inv-hub-sac-confirm {
	transform: translateY(0);
}

.inv-hub-sac-confirm__icon {
	font-size: 2rem;
	margin-bottom: 10px;
	filter: drop-shadow(0 0 10px rgba(220,38,38,0.7));
}
.inv-hub-sac-confirm__title {
	font-family: Rajdhani, sans-serif;
	font-size: 1.1rem;
	font-weight: 900;
	letter-spacing: 0.1em;
	color: #ef4444;
	text-transform: uppercase;
	margin: 0 0 10px;
	text-shadow: 0 0 20px rgba(239,68,68,0.5);
}
.inv-hub-sac-confirm__msg {
	font-size: 0.8rem;
	color: #94a3b8;
	line-height: 1.6;
	margin: 0 0 20px;
}
.inv-hub-sac-confirm__msg strong {
	color: #fca5a5;
	font-weight: 700;
}
.inv-hub-sac-confirm__btns {
	display: flex;
	gap: 10px;
}
.inv-hub-sac-confirm__btn {
	flex: 1;
	padding: 9px 0;
	border: none;
	border-radius: 7px;
	font-family: Rajdhani, sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	cursor: pointer;
	transition: opacity 0.15s, transform 0.1s;
}
.inv-hub-sac-confirm__btn:hover { opacity: 0.85; transform: translateY(-1px); }
.inv-hub-sac-confirm__btn--cancel {
	background: rgba(255,255,255,0.07);
	color: #94a3b8;
	border: 1px solid rgba(255,255,255,0.1);
}
.inv-hub-sac-confirm__btn--confirm {
	background: linear-gradient(135deg, #dc2626, #b91c1c);
	color: #fff;
	box-shadow: 0 0 16px rgba(220,38,38,0.4);
}

/* ═══════════════════════════════════════════════════════
   Pet Items / Inventory inside Hub SPA — no-scroll layout
   ═══════════════════════════════════════════════════════ */
.inv-hub-spa__content:has(.inv-pit-page) { overflow: hidden; }
.inv-hub-spa__content .inv-pit-page {
	min-height: unset;
	height: 100%;
	padding: 5px 8px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-sizing: border-box;
}
.inv-hub-spa__content .inv-pit-header { display: none; }
.inv-hub-spa__content .inv-pit-layout {
	flex: 1;
	min-height: 0;
	overflow: hidden;
	align-items: stretch;
}
.inv-hub-spa__content .inv-pit-panel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 10px 12px;
	border-radius: 10px;
}
.inv-hub-spa__content .inv-pit-panel::before { display: none; }
.inv-hub-spa__content .inv-pit-panel__title { font-size: 0.68rem; margin-bottom: 6px; }
.inv-hub-spa__content .inv-pit-tabs { margin-bottom: 6px; }
.inv-hub-spa__content .inv-pit-tab { padding: 5px 3px; font-size: 0.68rem; }
.inv-hub-spa__content .inv-pit-capacity { margin-bottom: 3px; }
.inv-hub-spa__content .inv-pit-toolbar { margin: 3px 0 6px; }
.inv-hub-spa__content .inv-pit-grid { flex: 1; max-height: none; min-height: 0; }
.inv-hub-spa__content .inv-pit-panel--charsheet { overflow-y: auto; flex-shrink: 0; }
.inv-hub-spa__content .inv-pit-charsheet__center { width: 130px; }
.inv-hub-spa__content .inv-pit-cs-figure { width: 130px; height: 165px; }
.inv-hub-spa__content .inv-pit-cs-figure__img { width: 120px; height: 152px; }

/* ═══════════════════════════════════════════════════════
   MOBILE UX — Header fix + quick-bar + panel drawers
   ═══════════════════════════════════════════════════════ */

/* ── Mobile header: stack logo above coins so they don't overlap ── */
@media (max-width: 479px) {
	.inv-pet-hub__topbar {
		flex-direction: column;
		align-items: stretch;
		padding: 0.5rem 0.9rem 0;
		gap: 2px;
	}
	.inv-pet-hub__logo {
		position: static;
		transform: none;
		justify-content: center;
		padding-bottom: 0.2rem;
	}
	.inv-pet-hub__topbar-right {
		justify-content: flex-end;
	}
}

/* ── Drawer grip handle (hidden on desktop, shown inside mobile drawers) ── */
.inv-pet-hub__panel-grip { display: none; }

/* ── Mobile quick-bar: My Pets / Stats / Bag (desktop only now) ── */
.inv-pet-hub__mobile-bar { display: none; }
/* Tab bar + tray hidden on desktop */
.inv-hub-tabbar    { display: none; }
.inv-hub-game-tray { display: none; }

/* Desktop door tray — independent element, no CSS conflicts */
.inv-pet-hub__door-tray {
	display: none;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-top: 8px;
	flex-direction: column;
	gap: 6px;
	padding: 10px;
	background: rgba(8,13,26,0.97);
	border: 1px solid rgba(245,158,11,0.3);
	border-radius: 14px;
	box-shadow: 0 8px 40px rgba(0,0,0,0.85);
	z-index: 9460;
	min-width: 180px;
	white-space: nowrap;
	pointer-events: auto;
}
.inv-pet-hub__door-glow.is-open .inv-pet-hub__door-tray {
	display: flex;
	animation: door-tray-pop 0.18s ease-out both;
}
@keyframes door-tray-pop {
	from { opacity: 0; transform: translateX(-50%) translateY(6px); }
	to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.inv-pet-hub__door-tray-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 10px;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(245,158,11,0.14);
	text-decoration: none;
	font-family: Rajdhani, sans-serif;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #c4a35a;
	transition: background 0.15s;
}
.inv-pet-hub__door-tray-btn:hover { background: rgba(245,158,11,0.12); color: #fde68a; }
.inv-pet-hub__door-tray-btn--dungeon {
	border-color: rgba(245,158,11,0.35);
	background: rgba(245,158,11,0.08);
	color: #fde68a;
}

@media (max-width: 639px) {
	/* Hide old separate bars — unified-nav replaces them */
	.inv-pet-hub__mobile-bar { display: none !important; }
	.inv-pet-hub__actions     { display: none !important; }
	/* Allow tabbar + tray to display (global rule hides them on desktop) */
	.inv-hub-tabbar    { display: flex; }
	.inv-hub-game-tray { display: flex; flex-direction: column; }

	/* ── App-style tab bar ── */
	.inv-hub-tabbar {
		display: flex;
		align-items: center;
		padding: 0 4px 4px;
		gap: 0;
		flex-shrink: 0;
		position: relative;
		background: linear-gradient(180deg, rgba(8,13,26,0.92) 0%, rgba(8,13,26,0.98) 100%);
		border-top: 1px solid rgba(245,158,11,0.18);
		box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
		backdrop-filter: blur(12px);
		-webkit-backdrop-filter: blur(12px);
	}
	.inv-hub-tab {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		padding: 4px 2px 3px;
		background: transparent;
		border: none;
		text-decoration: none;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		transition: opacity 0.15s, transform 0.12s;
		font-family: Rajdhani, sans-serif;
		position: relative;
		min-height: 44px;
	}
	.inv-hub-tab:active { transform: scale(0.91); opacity: 0.65; }
	.inv-hub-tab.is-active .inv-hub-tab__icon { filter: drop-shadow(0 0 6px rgba(245,158,11,0.7)); }
	.inv-hub-tab.is-active .inv-hub-tab__label { color: #f59e0b; }
	.inv-hub-tab__icon  { font-size: 1.3rem; line-height: 1; display: block; }
	.inv-hub-tab__label {
		font-size: 0.55rem;
		font-weight: 700;
		letter-spacing: 0.07em;
		text-transform: uppercase;
		color: rgba(156,163,175,0.85);
		line-height: 1;
	}

	/* Center "Play" button — elevated amber ring */
	.inv-hub-tab--center {
		flex: 0 0 auto;
		width: 72px;
		padding-top: 2px;
		padding-bottom: 0;
		position: relative;
		top: 0;
		align-items: center;
		justify-content: center;
		gap: 6px;
	}
	.inv-hub-tab__center-ring {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 56px;
		height: 56px;
		border-radius: 50%;
		background: radial-gradient(circle at 35% 35%, #fbbf24, #d97706 70%);
		box-shadow: 0 0 0 3px rgba(8,13,26,0.9), 0 0 0 5px rgba(245,158,11,0.35), 0 6px 20px rgba(245,158,11,0.5);
		transition: transform 0.15s, box-shadow 0.15s;
	}
	.inv-hub-tab--center:active .inv-hub-tab__center-ring {
		transform: scale(0.91);
		box-shadow: 0 0 0 3px rgba(8,13,26,0.9), 0 0 0 4px rgba(245,158,11,0.2), 0 2px 8px rgba(245,158,11,0.35);
	}
	.inv-hub-tab--center .inv-hub-tab__icon { font-size: 1.6rem; }
	.inv-hub-tab--center .inv-hub-tab__label { color: #f59e0b; font-size: 0.58rem; letter-spacing: 0.1em; margin-top: 4px; }
	.inv-hub-tab--center.is-open .inv-hub-tab__center-ring {
		background: linear-gradient(135deg, #d97706, #92400e);
		box-shadow: 0 4px 20px rgba(245,158,11,0.7), 0 0 0 4px rgba(245,158,11,0.2);
	}

	/* ── Game mode tray (floats above center button) ── */
	.inv-hub-game-tray {
		position: absolute;
		bottom: 100%;
		left: 50%;
		transform: translateX(-50%) translateY(8px);
		display: flex;
		flex-direction: column;
		gap: 6px;
		padding: 10px;
		background: rgba(8,13,26,0.96);
		border: 1px solid rgba(245,158,11,0.25);
		border-radius: 14px;
		box-shadow: 0 -6px 30px rgba(0,0,0,0.7);
		z-index: 9460;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.2s, transform 0.2s cubic-bezier(0.22,1,0.36,1);
		min-width: 160px;
	}
	.inv-hub-game-tray:not([hidden]) {
		opacity: 1;
		pointer-events: auto;
		transform: translateX(-50%) translateY(0);
	}
	.inv-hub-tray-btn {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 10px 14px;
		border-radius: 10px;
		background: rgba(255,255,255,0.04);
		border: 1px solid rgba(245,158,11,0.14);
		text-decoration: none;
		transition: background 0.15s, transform 0.1s;
		-webkit-tap-highlight-color: transparent;
	}
	.inv-hub-tray-btn:active { background: rgba(245,158,11,0.12); transform: scale(0.97); }
	.inv-hub-tray-btn--dungeon {
		border-color: rgba(245,158,11,0.35);
		background: rgba(245,158,11,0.08);
	}
	.inv-hub-tray-btn__icon  { font-size: 1.3rem; line-height: 1; }
	.inv-hub-tray-btn__label {
		font-family: Rajdhani, sans-serif;
		font-size: 0.82rem;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: #c4a35a;
	}
	.inv-hub-tray-btn--dungeon .inv-hub-tray-btn__label { color: #fde68a; }

	/* Old mobile-bar fully replaced by tab bar — keep hidden */
	.inv-pet-hub__mob-btn {
		flex: 1;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		gap: 5px;
		padding: 7px 6px;
		background: rgba(6,10,21,0.65);
		border: 1px solid rgba(245,158,11,0.18);
		border-radius: 8px;
		text-decoration: none;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		transition: background 0.15s, border-color 0.15s, transform 0.1s;
		font-family: Rajdhani, sans-serif;
	}
	.inv-pet-hub__mob-btn:hover,
	.inv-pet-hub__mob-btn:focus-visible {
		background: rgba(245,158,11,0.1);
		border-color: rgba(245,158,11,0.4);
		outline: none;
	}
	.inv-pet-hub__mob-btn:active { transform: scale(0.95); }
	.inv-pet-hub__mob-btn.is-active {
		border-color: rgba(245,158,11,0.6);
		background: rgba(245,158,11,0.12);
	}
	.inv-pet-hub__mob-icon  { font-size: 1.1rem; line-height: 1; }
	.inv-pet-hub__mob-label {
		font-size: 0.62rem;
		font-weight: 700;
		letter-spacing: 0.1em;
		text-transform: uppercase;
		color: #c4a35a;
	}

	/* ── Side panel drawers on mobile ── */

	/* My Pets → slides in from the RIGHT */
	.inv-pet-hub__pet-roster.is-mobile-drawer {
		display: flex !important;
		position: fixed;
		top: 0;
		bottom: 0;
		right: 0;
		left: auto;
		width: 78vw;
		max-width: 300px;
		max-height: none;
		flex-direction: column;
		border-radius: 14px 0 0 14px;
		border: 1px solid rgba(245,158,11,0.22);
		border-right: none;
		box-shadow: -8px 0 40px rgba(0,0,0,0.8);
		z-index: 9450;
		overflow: hidden;
		transform: translateX(105%);
		transition: transform 0.3s cubic-bezier(0, 0, 0.2, 1);
		will-change: transform;
	}
	.inv-pet-hub__pet-roster.is-mobile-drawer.is-open {
		transform: translateX(0);
		transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	}

	/* Stats → slides in from the LEFT */
	.inv-pet-hub__stat-panel.is-mobile-drawer {
		display: flex !important;
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		right: auto;
		width: 78vw;
		max-width: 300px;
		max-height: none;
		flex-direction: column;
		border-radius: 0 14px 14px 0;
		border: 1px solid rgba(245,158,11,0.22);
		border-left: none;
		box-shadow: 8px 0 40px rgba(0,0,0,0.8);
		z-index: 9450;
		overflow: hidden;
		transform: translateX(-105%);
		transition: transform 0.3s cubic-bezier(0, 0, 0.2, 1);
		will-change: transform;
	}
	.inv-pet-hub__stat-panel.is-mobile-drawer.is-open {
		transform: translateX(0);
		transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
	}

	/* Hide drag-handle pill — doesn't make sense for side panels */
	.inv-pet-hub__stat-panel.is-mobile-drawer .inv-pet-hub__panel-grip,
	.inv-pet-hub__pet-roster.is-mobile-drawer .inv-pet-hub__panel-grip {
		display: none;
	}

	/* Roster list scrolls inside side panel */
	.inv-pet-hub__pet-roster.is-mobile-drawer .inv-pet-hub__roster-list {
		flex: 1;
		height: 0; /* force flex to control height so iOS scrolls correctly */
		min-height: 0;
		overflow-y: scroll;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		touch-action: pan-y;
		/* Ensure last pet is reachable — accounts for safe-area + gesture zone */
		padding-bottom: max(80px, env(safe-area-inset-bottom, 80px));
	}

	/* Stat panel content scrolls inside side panel */
	.inv-pet-hub__stat-panel.is-mobile-drawer .inv-pet-hub__stat-rows {
		flex: 1;
		height: 0; /* force flex to control height so iOS scrolls correctly */
		min-height: 0;
		overflow-y: scroll;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		touch-action: pan-y;
		padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
	}
}

/* ── Hide global live chat bubble on pet hub page ── */
.page-template-page-pet-hub .inv-chat-bubble {
	display: none !important;
}
