/* ═══════════════════════════════════════════════════════
   PET GAME SHELL — Diablo-style page wrapper
   Used by all pet page templates via get_header('pet-game')
   ═══════════════════════════════════════════════════════ */

/* Force dark mode, no site chrome */
body.inv-game-page {
	margin: 0;
	padding: 0;
	background: #060a15;
	min-height: 100dvh;
	font-family: 'Rajdhani', 'Inter', sans-serif;
	color: #e2c97e;
	overflow-x: hidden;
}

/* Hide any site elements that might leak through */
body.inv-game-page #invictus-site-header,
body.inv-game-page #invictus-site-footer,
body.inv-game-page .inv-sidebar,
body.inv-game-page .inv-pet-nav,
body.inv-game-page #inv-right-sidebar,
body.inv-game-page .dashboard-right-sidebar {
	display: none !important;
}

/* ── Game shell ──────────────────────────────────────── */
#inv-game-shell {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	background: #060a15;
	position: relative;
}

/* Subtle atmospheric background — same void sanctum */
#inv-game-shell::before {
	content: '';
	position: fixed;
	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;
}

/* ── Top bar ─────────────────────────────────────────── */
#inv-game-topbar {
	position: sticky;
	top: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	gap: 1rem;
	/* Safe area: push content below notch/status bar in PWA/standalone mode */
	padding: env(safe-area-inset-top) 1.25rem 0;
	height: calc(44px + env(safe-area-inset-top));
	background: rgba(6, 10, 21, 0.95);
	border-bottom: 1px solid rgba(245, 158, 11, 0.15);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	flex-shrink: 0;
}

/* Back button */
.inv-game-back {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	text-decoration: none;
	color: #f59e0b;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 0.25rem 0.7rem 0.25rem 0.4rem;
	border: 1px solid rgba(245, 158, 11, 0.25);
	border-radius: 3px;
	transition: background 0.15s, border-color 0.15s;
	white-space: nowrap;
	flex-shrink: 0;
}
.inv-game-back:hover {
	background: rgba(245, 158, 11, 0.1);
	border-color: #f59e0b;
	color: #fde68a;
}
.inv-game-back__arrow {
	font-size: 1rem;
	line-height: 1;
}
.inv-game-back__label {
	font-size: 0.78rem;
}

/* Page title */
#inv-game-title {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.82rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #4b5563;
	flex: 1;
}

/* Right: SC + player info */
#inv-game-topbar-right {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.inv-game-sc {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.88rem;
	color: #f59e0b;
}
.inv-game-sc__icon {
	width: 16px;
	height: 16px;
	object-fit: contain;
	flex-shrink: 0;
}
.inv-game-sc__label {
	font-size: 0.72rem;
	color: #78716c;
	letter-spacing: 0.08em;
}

/* Fullscreen toggle button */
.inv-game-fs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 1px solid rgba(245,158,11,0.18);
	border-radius: 3px;
	color: #6b7280;
	cursor: pointer;
	padding: 0;
	width: 28px;
	height: 28px;
	flex-shrink: 0;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.inv-game-fs-btn:hover {
	color: #f59e0b;
	border-color: rgba(245,158,11,0.45);
	background: rgba(245,158,11,0.08);
}
.inv-game-fs-btn .inv-game-fs-compress { display: none; }
.inv-game-fs-btn.is-fullscreen .inv-game-fs-expand  { display: none; }
.inv-game-fs-btn.is-fullscreen .inv-game-fs-compress { display: block; }
.inv-game-fs-btn.is-fullscreen {
	color: #f59e0b;
	border-color: rgba(245,158,11,0.4);
}

/* CSS immersive fallback (iOS Safari — no native Fullscreen API)
   Topbar stays visible so WAR PETS back + FS button are always reachable. */
body.inv-game-immersive #inv-game-shell {
	height: 100dvh;
	overflow: hidden;
}
body.inv-game-immersive #inv-game-content {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Floating exit button — hidden, kept in DOM for JS reference */
.inv-game-fs-float { display: none; }

.inv-game-login-cta {
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #f59e0b;
	text-decoration: none;
	padding: 0.2rem 0.6rem;
	border: 1px solid rgba(245,158,11,0.3);
	border-radius: 3px;
}

/* ── Content area ────────────────────────────────────── */
#inv-game-content {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow-y: auto;
	animation: inv-page-fadein 0.22s ease-out both;
}
@keyframes inv-page-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Override existing pet page styles for dark mode ─── */

/* Pet pages use hardcoded white backgrounds in some areas — override */
body.inv-game-page .inv-arena-hero,
body.inv-game-page .inv-pet-dungeon-page,
body.inv-game-page .inv-pet-milestones-page,
body.inv-game-page .inv-pet-profile-page,
body.inv-game-page .inv-pet-marketplace-page,
body.inv-game-page .inv-pet-mail-page,
body.inv-game-page .inv-pet-guide-page {
	background: transparent !important;
}

/* Remove any top padding the pages added for the fixed site header */
body.inv-game-page .inv-pet-dungeon-page,
body.inv-game-page #inv-pet-arena-page,
body.inv-game-page [class*="inv-pet-"][class*="-page"] {
	padding-top: 0 !important;
	margin-top: 0 !important;
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 640px) {
	#inv-game-topbar {
		height: calc(40px + env(safe-area-inset-top));
		padding: env(safe-area-inset-top) 0.875rem 0;
	}
	.inv-game-back__label { display: none; }
	.inv-game-back {
		padding: 0.25rem 0.5rem;
	}
	.inv-game-sc__label { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   MY PET — Page-level tabs (Character | Inventory)
   ════════════════════════════════════════════════════════════════════════════ */

.inv-mypet-tabs-bar {
	display: flex;
	position: sticky;
	top: 0;
	z-index: 80;
	background: rgba(6, 10, 21, 0.97);
	border-bottom: 1px solid rgba(245, 158, 11, 0.18);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.inv-mypet-tab-btn {
	flex: 1;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	color: #6b7280;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.88rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 0.65rem 1rem;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s;
	margin-bottom: -1px;
}
.inv-mypet-tab-btn:hover {
	color: #d1d5db;
	background: rgba(255,255,255,0.02);
}
.inv-mypet-tab-btn.is-active {
	color: #f59e0b;
	border-bottom-color: #f59e0b;
	text-shadow: 0 0 14px rgba(245,158,11,0.35);
}

/* ════════════════════════════════════════════════════════════════════════════
   CHARACTER SHEET — Diablo-style overrides (body.inv-game-page scope)
   ════════════════════════════════════════════════════════════════════════════ */

/* Page wrapper: strip site padding + transparent background */
body.inv-game-page .inv-pprof-page {
	padding-top: 0;
	padding-bottom: 3rem;
	background: transparent;
}

/* Public header: flat edges in game mode */
body.inv-game-page .inv-pprof-hdr {
	border-radius: 0;
	border-left: none;
	border-right: none;
	border-top: none;
	margin-bottom: 0;
}
body.inv-game-page .inv-pprof-hdr:has(+ .inv-pprof-sheet) {
	border-radius: 0;
	margin-bottom: 0;
}

/* ── Pet Selector (owner's My Pets strip) ───────────────────────── */
body.inv-game-page .inv-pet-selector {
	background: rgba(8, 12, 22, 0.96);
	border: none;
	border-bottom: 1px solid rgba(245, 158, 11, 0.10);
	border-radius: 0;
	padding: 8px 16px 10px;
	margin-bottom: 0;
}
body.inv-game-page .inv-pet-selector .inv-pprof-panel-title {
	font-size: 0.6rem;
	color: #374151;
	letter-spacing: 0.1em;
	margin-bottom: 8px;
}
body.inv-game-page .inv-pet-selector__strip {
	flex-wrap: nowrap;
	overflow-x: auto;
	-ms-overflow-style: none;
	scrollbar-width: none;
	padding-bottom: 2px;
}
body.inv-game-page .inv-pet-selector__strip::-webkit-scrollbar { display: none; }
body.inv-game-page .inv-pet-sel-card {
	flex-shrink: 0;
	background: rgba(13, 21, 37, 0.8);
	border: 1px solid rgba(255,255,255,0.06);
	border-radius: 6px;
}
body.inv-game-page .inv-pet-sel-card.is-active {
	border-color: rgba(245,158,11,0.5);
	background: rgba(245,158,11,0.07);
}

/* ── Pet Switcher (public view with multiple pets) ──────────────── */
body.inv-game-page .inv-pprof-switcher {
	background: rgba(8, 12, 22, 0.96);
	border: none;
	border-bottom: 1px solid rgba(245, 158, 11, 0.10);
	border-radius: 0;
	flex-wrap: nowrap;
	overflow-x: auto;
	-ms-overflow-style: none;
	scrollbar-width: none;
	padding: 8px 12px;
	margin-bottom: 0;
}
body.inv-game-page .inv-pprof-switcher::-webkit-scrollbar { display: none; }

/* ── Character Sheet ────────────────────────────────────────────── */
body.inv-game-page .inv-pprof-sheet {
	border-radius: 0;
	border-left: none;
	border-right: none;
	border-top: none;
	border-bottom: 1px solid rgba(245,158,11,0.08);
	margin-bottom: 0;
	background:
		radial-gradient(ellipse at 50% 0%, rgba(245,158,11,0.05) 0%, transparent 55%),
		#080d1a;
}
body.inv-game-page .inv-pprof-sheet::before { opacity: 0.6; }
body.inv-game-page .inv-pprof-hdr + .inv-pprof-sheet {
	border-top: none;
	border-radius: 0;
}

/* ── Pet name: epic scale ────────────────────────────────────────── */
body.inv-game-page .inv-pprof-pd-title {
	padding: 20px 16px 14px;
	background: linear-gradient(180deg, rgba(245,158,11,0.04) 0%, transparent 100%);
	border-bottom: 1px solid rgba(245,158,11,0.09);
}
body.inv-game-page .inv-pprof-pet-name {
	font-size: clamp(1.7rem, 4.5vw, 2.6rem);
	letter-spacing: 0.06em;
	text-shadow:
		0 0 40px rgba(245,158,11,0.4),
		0 0 10px rgba(245,158,11,0.15),
		0 3px 8px rgba(0,0,0,0.9);
}

/* ── Pet sprite: more atmospheric glow ─────────────────────────── */
body.inv-game-page .inv-pprof-sprite-frame {
	width: clamp(150px, 28vw, 224px);
	min-height: clamp(150px, 28vw, 224px);
}
body.inv-game-page .inv-pprof-sprite-frame .inv-sprite__img {
	filter:
		drop-shadow(0 0 18px color-mix(in srgb, var(--sp-color, #f59e0b) 55%, transparent))
		drop-shadow(0 0 44px color-mix(in srgb, var(--sp-color, #f59e0b) 25%, transparent));
}

/* ── Equipment slots: Diablo-style chamfered corners ───────────── */
/* clip-path octagon cuts all 4 corners diagonally (8px bevel) */
/* Covers both .inv-pprof-slot (profile) and .inv-pit-cs-slot (inventory charsheet) */
body.inv-game-page .inv-pprof-slot,
body.inv-game-page .inv-pit-cs-slot {
	border-radius: 0;
	clip-path: polygon(
		8px 0%, calc(100% - 8px) 0%,
		100% 8px, 100% calc(100% - 8px),
		calc(100% - 8px) 100%, 8px 100%,
		0% calc(100% - 8px), 0% 8px
	);
}
body.inv-game-page .inv-pprof-slot {
	width: 72px;
	height: 72px;
}
body.inv-game-page .inv-pprof-slot::before,
body.inv-game-page .inv-pprof-slot::after { border-radius: 0; }
body.inv-game-page .inv-pprof-slot__img   { border-radius: 0; }
body.inv-game-page .inv-pit-cs-slot::before,
body.inv-game-page .inv-pit-cs-slot::after { border-radius: 0; }

/* drop-shadow follows chamfered shape when using filter on the slot */
body.inv-game-page .inv-pprof-slot--equipped {
	filter: drop-shadow(0 0 5px color-mix(in srgb, var(--slot-color, #9ca3af) 50%, transparent));
}
body.inv-game-page .inv-pprof-slot--equipped:hover {
	filter: drop-shadow(0 0 14px color-mix(in srgb, var(--slot-color, #9ca3af) 90%, transparent));
}
body.inv-game-page .inv-pprof-slot.r-5.inv-pprof-slot--equipped,
body.inv-game-page .inv-pprof-slot.r-6.inv-pprof-slot--equipped {
	/* keep keyframe animations — they already use drop-shadow */
}
body.inv-game-page .inv-pit-cs-slot.is-equipped {
	filter: drop-shadow(0 0 5px color-mix(in srgb, var(--slot-rarity-color, #9ca3af) 50%, transparent));
}
body.inv-game-page .inv-pit-cs-slot.is-equipped:hover {
	filter: drop-shadow(0 0 14px color-mix(in srgb, var(--slot-rarity-color, #9ca3af) 90%, transparent));
}

/* On mobile the 52×52 slots are too small for the octagon bevel — use rounded corners */
@media (max-width: 639px) {
	body.inv-game-page .inv-pit-cs-slot {
		clip-path: none;
		border-radius: 8px;
		overflow: hidden;
	}
	body.inv-game-page .inv-pit-cs-slot::before,
	body.inv-game-page .inv-pit-cs-slot::after { border-radius: 8px; }
}

@media (min-width: 480px) {
	body.inv-game-page .inv-pprof-slot { width: 78px; height: 78px; }
}
@media (min-width: 760px) {
	body.inv-game-page .inv-pprof-slot { width: 90px; height: 90px; }
	body.inv-game-page .inv-pprof-pd-bottom .inv-pprof-slot { width: 100px; height: 100px; }
}

/* ── Owner panel (XP bars + Feed / Train) ───────────────────────── */
body.inv-game-page .inv-pprof-owner-panel {
	background: rgba(7, 11, 20, 0.85);
	border-top: 1px solid rgba(245,158,11,0.09);
	padding: 14px 16px 18px;
}
body.inv-game-page .inv-pet-action-row { gap: 10px; margin-top: 14px; }
body.inv-game-page .inv-pet-action-card {
	border-radius: 6px;
	border: 1px solid rgba(255,255,255,0.09);
	padding: 14px 10px;
}
body.inv-game-page .inv-pet-action-card--feed {
	background: rgba(245,158,11,0.07);
	border-color: rgba(245,158,11,0.2);
}
body.inv-game-page .inv-pet-action-card--feed:not(:disabled):hover {
	background: rgba(245,158,11,0.14);
	border-color: rgba(245,158,11,0.45);
	box-shadow: 0 0 18px rgba(245,158,11,0.18);
}
body.inv-game-page .inv-pet-action-card--train {
	background: rgba(59,130,246,0.07);
	border-color: rgba(59,130,246,0.2);
}
body.inv-game-page .inv-pet-action-card--train:not(:disabled):hover {
	background: rgba(59,130,246,0.14);
	border-color: rgba(59,130,246,0.45);
	box-shadow: 0 0 18px rgba(59,130,246,0.18);
}
body.inv-game-page .inv-pet-arena-stats {
	background: rgba(6, 10, 21, 0.65);
	border: 1px solid rgba(245,158,11,0.12);
	border-radius: 6px;
	margin-top: 12px;
}

/* ── Inner tabs (Stats | Missions) — sticky ─────────────────────── */
body.inv-game-page .inv-pprof-tabs {
	display: flex;
	border-radius: 0;
	border: none;
	border-top: 1px solid rgba(245,158,11,0.08);
	border-bottom: 1px solid rgba(245,158,11,0.12);
	background: rgba(7, 11, 20, 0.95);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	position: sticky;
	top: 0; /* public view: no page-tabs bar above */
	z-index: 40;
	padding: 0;
	margin-bottom: 0;
}

/* Owner view: stick below page-level tabs bar */
#inv-mypet-panel-sheet .inv-pprof-tabs { top: 40px; } /* below page-tabs bar */

body.inv-game-page .inv-pprof-tab {
	flex: 1;
	border-radius: 0;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 0.65rem 1rem;
	font-size: 0.82rem;
	letter-spacing: 0.12em;
	background: transparent;
	color: #6b7280;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
	transition: color 0.15s, border-color 0.15s;
	margin-bottom: -1px;
}
body.inv-game-page .inv-pprof-tab:hover { color: #d1d5db; }
body.inv-game-page .inv-pprof-tab.is-active {
	color: #f59e0b;
	border-bottom-color: #f59e0b;
}

/* ── Tab panels ────────────────────────────────────────────────────── */
body.inv-game-page .inv-pprof-tabpanel { padding: 14px 12px 0; }

/* ── Stats HUD ─────────────────────────────────────────────────────── */
body.inv-game-page .inv-pprof-stats-panel {
	border-radius: 8px;
	background: rgba(6, 10, 21, 0.6);
	border: 1px solid rgba(255,255,255,0.06);
	margin-bottom: 12px;
}
body.inv-game-page .inv-pprof-stat {
	border-radius: 6px;
	background: rgba(6, 10, 21, 0.8);
}
body.inv-game-page .inv-pprof-stat__val {
	font-size: 1.5rem;
	font-weight: 900;
	text-shadow: 0 0 10px currentColor;
}
body.inv-game-page .inv-pprof-stat__bar-wrap {
	height: 4px;
	background: rgba(255,255,255,0.04);
}
body.inv-game-page .inv-pprof-stat__bar-fill { box-shadow: 0 0 8px currentColor; }

/* ── Set bonuses ──────────────────────────────────────────────────── */
body.inv-game-page .inv-pprof-sets-panel {
	border-radius: 8px;
	background: rgba(6, 10, 21, 0.6);
	border: 1px solid rgba(255,255,255,0.06);
	margin-bottom: 12px;
}

/* ── Mobile ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	.inv-mypet-tabs-bar { top: 0; }
	body.inv-game-page .inv-pprof-tabs { top: 0; }
	#inv-mypet-panel-sheet .inv-pprof-tabs { top: 40px; }
	body.inv-game-page .inv-pprof-pd-body {
		grid-template-columns: 82px 1fr 82px;
	}
	body.inv-game-page .inv-pprof-tabpanel { padding: 10px 8px 0; }
}

/* ════════════════════════════════════════════════════════════════════════════
   IN-GAME DIALOG — replaces browser confirm() / alert()
   ════════════════════════════════════════════════════════════════════════════ */

.inv-gd {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}
.inv-gd[hidden] { display: none; }

.inv-gd__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 6, 12, 0.88);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

/* Amber 1px border layer — same chamfer shape */
.inv-gd__frame {
	position: relative;
	z-index: 1;
	background: rgba(245, 158, 11, 0.22);
	padding: 1px;
	clip-path: polygon(
		14px 0%, calc(100% - 14px) 0%,
		100% 14px, 100% calc(100% - 14px),
		calc(100% - 14px) 100%, 14px 100%,
		0% calc(100% - 14px), 0% 14px
	);
	filter: drop-shadow(0 0 40px rgba(245,158,11,0.12)) drop-shadow(0 20px 60px rgba(0,0,0,0.95));
	animation: inv-gd-in 0.18s cubic-bezier(0.2, 0.8, 0.3, 1) both;
	max-width: 400px;
	width: 90vw;
}
@keyframes inv-gd-in {
	from { opacity: 0; transform: scale(0.92) translateY(8px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

.inv-gd__box {
	background: linear-gradient(160deg, #0f1729 0%, #080d1a 100%);
	clip-path: polygon(
		14px 0%, calc(100% - 14px) 0%,
		100% 14px, 100% calc(100% - 14px),
		calc(100% - 14px) 100%, 14px 100%,
		0% calc(100% - 14px), 0% 14px
	);
	padding: 1.75rem 2rem 1.5rem;
	text-align: center;
}

.inv-gd__icon {
	font-size: 2rem;
	line-height: 1;
	margin-bottom: 0.5rem;
	min-height: 0;
}
.inv-gd__icon:empty { display: none; }

.inv-gd__title {
	font-family: Rajdhani, sans-serif;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #f59e0b;
	margin: 0 0 0.6rem;
	text-shadow: 0 0 18px rgba(245,158,11,0.4);
}

.inv-gd__msg {
	font-family: Inter, sans-serif;
	font-size: 0.9rem;
	line-height: 1.55;
	color: #9ca3af;
	margin: 0 0 1.4rem;
}

.inv-gd__actions {
	display: flex;
	gap: 0.6rem;
	justify-content: center;
}

.inv-gd__btn {
	font-family: Rajdhani, sans-serif;
	font-size: 0.88rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	border: none;
	cursor: pointer;
	padding: 0.55rem 1.6rem;
	clip-path: polygon(6px 0%, calc(100% - 6px) 0%, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0% calc(100% - 6px), 0% 6px);
	transition: filter 0.12s, transform 0.1s;
}
.inv-gd__btn:active { transform: scale(0.97); }

.inv-gd__btn--confirm {
	background: #f59e0b;
	color: #080d1a;
}
.inv-gd__btn--confirm:hover { filter: brightness(1.15); }

.inv-gd__btn--cancel {
	background: rgba(255,255,255,0.06);
	color: #9ca3af;
	border: 1px solid rgba(255,255,255,0.1);
}
.inv-gd__btn--cancel:hover { background: rgba(255,255,255,0.1); color: #d1d5db; }

.inv-gd__btn--ok {
	background: rgba(245,158,11,0.15);
	color: #f59e0b;
	border: 1px solid rgba(245,158,11,0.3);
}
.inv-gd__btn--ok:hover { background: rgba(245,158,11,0.25); }

/* ── In-game toast (replaces native alert popups) ──────── */
.inv-pet-toast {
	position: fixed;
	bottom: 88px;
	left: 50%;
	transform: translateX(-50%) translateY(12px);
	background: #1a0a0a;
	border: 1px solid #7f1d1d;
	color: #fca5a5;
	padding: .55rem 1.25rem;
	border-radius: 8px;
	font-family: 'Rajdhani', sans-serif;
	font-size: .95rem;
	font-weight: 600;
	letter-spacing: .02em;
	white-space: nowrap;
	max-width: calc(100vw - 2rem);
	overflow: hidden;
	text-overflow: ellipsis;
	z-index: 9999;
	opacity: 0;
	transition: opacity .25s, transform .25s;
	pointer-events: none;
}
.inv-pet-toast--show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
.inv-pet-toast--success {
	background: #061a0e;
	border-color: #14532d;
	color: #86efac;
}
.inv-pet-toast--warning {
	background: #1a1100;
	border-color: #78350f;
	color: #fcd34d;
}

/* ── Game page elegant scrollbar (desktop) ─────────────────── */
body.inv-game-page {
	scrollbar-width: thin;
	scrollbar-color: rgba(245,158,11,.35) rgba(8,13,26,.6);
}
body.inv-game-page::-webkit-scrollbar { width: 5px; }
body.inv-game-page::-webkit-scrollbar-track { background: rgba(8,13,26,.6); }
body.inv-game-page::-webkit-scrollbar-thumb {
	background: linear-gradient(to bottom, rgba(245,158,11,.5), rgba(245,158,11,.2));
	border-radius: 3px;
}
body.inv-game-page::-webkit-scrollbar-thumb:hover {
	background: rgba(245,158,11,.65);
}

/* ═══════════════════════════════════════════════════════
   INLINE PROFILE DRAWER — inv-gpd
   ═══════════════════════════════════════════════════════ */
.inv-gpd {
	position: fixed;
	inset: 0;
	z-index: 10100;
	pointer-events: none;
}
.inv-gpd[hidden] { display: none !important; }
.inv-gpd.is-open { pointer-events: auto; }

.inv-gpd__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.65);
	opacity: 0;
	transition: opacity 0.3s;
}
.inv-gpd.is-open .inv-gpd__overlay { opacity: 1; }

.inv-gpd__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(540px, 100vw);
	background: #06090f;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
	overflow: hidden;
}
.inv-gpd.is-open .inv-gpd__panel { transform: translateX(0); }

.inv-gpd__topbar {
	display: flex;
	align-items: center;
	padding: 10px 16px;
	border-bottom: 1px solid rgba(245,158,11,0.16);
	flex-shrink: 0;
	background: rgba(4,7,18,0.92);
}
.inv-gpd__back {
	display: flex;
	align-items: center;
	gap: 5px;
	background: transparent;
	border: none;
	color: #f59e0b;
	font-family: Rajdhani, sans-serif;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	padding: 4px 10px;
	border-radius: 6px;
	transition: background 0.15s;
}
.inv-gpd__back span { font-size: 1.3rem; line-height: 1; margin-top: -1px; }
.inv-gpd__back:hover { background: rgba(245,158,11,0.1); }

.inv-gpd__body {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	scrollbar-width: thin;
	scrollbar-color: rgba(245,158,11,0.2) transparent;
}
.inv-gpd__body::-webkit-scrollbar { width: 4px; }
.inv-gpd__body::-webkit-scrollbar-thumb { background: rgba(245,158,11,0.25); border-radius: 2px; }

.inv-gpd__spinner {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 220px;
}
.inv-gpd__spinner::after {
	content: '';
	width: 30px;
	height: 30px;
	border: 2px solid rgba(245,158,11,0.15);
	border-top-color: #f59e0b;
	border-radius: 50%;
	animation: inv-gpd-spin 0.7s linear infinite;
}
@keyframes inv-gpd-spin { to { transform: rotate(360deg); } }

.inv-gpd__err {
	text-align: center;
	padding: 2.5rem 1rem;
	color: #6b7280;
	font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════
   EGG SHOP — inv-shop
   ═══════════════════════════════════════════════════════ */
.inv-shop {
	max-width: 860px;
	margin: 0 auto;
	padding: 1.25rem 1rem 2rem;
}
.inv-shop__title {
	font-family: Rajdhani, sans-serif;
	font-size: 1.4rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #f59e0b;
	margin: 0 0 0.2rem;
}
.inv-shop__sub {
	font-size: 0.78rem;
	color: #6b7280;
	margin: 0 0 0.75rem;
}
.inv-shop__wc-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: Rajdhani, sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	color: #f59e0b;
	background: rgba(245,158,11,0.06);
	border: 1px solid rgba(245,158,11,0.18);
	border-radius: 8px;
	padding: 6px 12px;
	width: fit-content;
	margin-bottom: 1.25rem;
}
.inv-shop__wc-label {
	font-weight: 400;
	color: #9ca3af;
	font-size: 0.72rem;
	margin-left: 2px;
}
.inv-shop__login-cta {
	text-align: center;
	padding: 3rem 1rem;
}
.inv-shop__login-btn {
	display: inline-block;
	padding: 0.6rem 1.6rem;
	background: #f59e0b;
	color: #000;
	font-family: Rajdhani, sans-serif;
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-radius: 8px;
	text-decoration: none;
}

/* Grid */
.inv-shop__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
}
@media (min-width: 600px) {
	.inv-shop__grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
@media (min-width: 900px) {
	.inv-shop__grid { grid-template-columns: repeat(4, 1fr); }
}

/* Card */
.inv-shop__card {
	background: #0d1425;
	border: 1px solid rgba(var(--egg-color, 245 158 11) / 0.22);
	border-top: 2px solid var(--egg-color, #f59e0b);
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: border-color 0.18s, transform 0.18s;
}
.inv-shop__card:hover {
	border-color: var(--egg-color, #f59e0b);
	transform: translateY(-2px);
}

/* Egg image */
.inv-shop__egg-img-wrap {
	position: relative;
	background: radial-gradient(ellipse at center, rgba(0,0,0,0.0) 0%, rgba(6,10,21,0.9) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	height: 130px;
	overflow: hidden;
}
.inv-shop__egg-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center bottom;
	padding: 10px 12px 0;
}

/* Card body */
.inv-shop__card-body {
	padding: 0.6rem 0.75rem 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	flex: 1;
}
.inv-shop__egg-name {
	font-family: Rajdhani, sans-serif;
	font-size: 0.85rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--egg-color, #f59e0b);
	margin: 0;
}
.inv-shop__egg-desc {
	font-size: 0.68rem;
	color: #6b7280;
	margin: 0;
	line-height: 1.4;
}
.inv-shop__pool {
	font-size: 0.68rem;
	color: #9ca3af;
	line-height: 1.4;
}
.inv-shop__pool-label {
	color: #6b7280;
	margin-right: 3px;
}
.inv-shop__price {
	display: flex;
	align-items: center;
	gap: 5px;
	font-family: Rajdhani, sans-serif;
	font-size: 0.82rem;
	font-weight: 700;
	color: #f59e0b;
	margin-top: auto;
	padding-top: 0.35rem;
}
.inv-shop__buy-btn {
	width: 100%;
	margin-top: 0.4rem;
	padding: 0.45rem 0;
	background: rgba(245,158,11,0.1);
	border: 1px solid rgba(245,158,11,0.35);
	border-radius: 6px;
	color: #f59e0b;
	font-family: Rajdhani, sans-serif;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}
.inv-shop__buy-btn:hover {
	background: rgba(245,158,11,0.22);
	border-color: #f59e0b;
}

/* Name modal */
.inv-shop-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0.72);
	backdrop-filter: blur(4px);
}
.inv-shop-modal[hidden] { display: none !important; }
.inv-shop-modal__box {
	background: #0d1425;
	border: 1px solid rgba(245,158,11,0.3);
	border-radius: 12px;
	padding: 1.5rem;
	width: min(340px, 90vw);
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.inv-shop-modal__title {
	font-family: Rajdhani, sans-serif;
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #f59e0b;
	margin: 0;
}
.inv-shop-modal__hint {
	font-size: 0.78rem;
	color: #9ca3af;
	margin: 0;
}
.inv-shop-modal__input {
	width: 100%;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(245,158,11,0.2);
	border-radius: 7px;
	padding: 0.5rem 0.75rem;
	color: #e2c97e;
	font-family: Inter, sans-serif;
	font-size: 0.85rem;
	outline: none;
	box-sizing: border-box;
}
.inv-shop-modal__input:focus { border-color: rgba(245,158,11,0.55); }
.inv-shop-modal__err {
	font-size: 0.72rem;
	color: #f87171;
}
.inv-shop-modal__err[hidden] { display: none !important; }
.inv-shop-modal__actions {
	display: flex;
	gap: 0.5rem;
	justify-content: flex-end;
}
.inv-shop-modal__btn {
	padding: 0.4rem 1rem;
	border-radius: 6px;
	font-family: Rajdhani, sans-serif;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	border: 1px solid transparent;
}
.inv-shop-modal__btn--cancel {
	background: transparent;
	border-color: rgba(255,255,255,0.1);
	color: #6b7280;
}
.inv-shop-modal__btn--cancel:hover { border-color: rgba(255,255,255,0.25); color: #9ca3af; }
.inv-shop-modal__btn--confirm {
	background: #f59e0b;
	color: #000;
}
.inv-shop-modal__btn--confirm:hover { background: #fbbf24; }
.inv-shop-modal__btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Toast */
.inv-shop-toast {
	position: fixed;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: #061a0e;
	border: 1px solid #14532d;
	color: #86efac;
	font-size: 0.8rem;
	padding: 0.6rem 1.25rem;
	border-radius: 8px;
	opacity: 0;
	transition: opacity 0.3s, transform 0.3s;
	white-space: nowrap;
	z-index: 10000;
}
.inv-shop-toast--show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
