/* Category Card Containers */
.falling-pills-container {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	width: 100%;
	background: transparent !important;
}

.category-card {
	flex: 1 1 100%;
	position: relative;
	overflow: visible;
	display: flex;
	flex-direction: column;
}

/* Physics World (Canvas container) */
.physics-world {
	position: relative;
	flex-grow: 1;
	width: 100%;
}

.physics-world canvas {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none; /* Let the HTML pills handle pointer events */
	opacity: 0; /* Hide canvas, we show DOM elements */
}

/* HTML DOM Pills */
.falling-pill {
	position: absolute;
	top: -1000px; /* Hidden initially until synced */
	left: -1000px;
	border: 2px solid #ffde00; /* Yellow border */
	background-color: transparent; /* Or a color */
	border-radius: 30px;
	padding: 6px 14px;
	font-size: 14px;
	font-weight: 600;
	color: #ffde00; /* Yellow text */
	text-align: center;
	cursor: pointer;
	user-select: none;
	transform-origin: center center;
	white-space: nowrap;
	will-change: transform;
	z-index: 10;
	opacity: 0;
	transition: opacity 0.6s ease-in-out, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, z-index 0s 0.3s;
}

.falling-pill.is-falling {
	opacity: 1;
}

.falling-pill:hover {
	z-index: 999999;
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, z-index 0s 0s;
}

.falling-pill a {
	color: inherit;
	text-decoration: none;
	display: flex;
	align-items: center;
	pointer-events: auto; /* Enable link clicks */
}

.pill-arrow {
	display: inline-block;
	margin-left: 8px;
	font-weight: normal;
	font-size: 0.9em;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.has-hover-arrow .falling-pill:hover .pill-arrow {
	opacity: 1;
}

/* Tooltip */
.pill-tooltip {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(10px) rotate(var(--pill-counter-rotation, 0rad));
	background-color: #fff;
	color: #000;
	padding: 15px;
	border-radius: 8px;
	width: max-content;
	max-width: 250px;
	box-shadow: 0 5px 15px rgba(0,0,0,0.2);
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	z-index: 999999;
	pointer-events: none;
	text-align: left;
}

.pill-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -8px;
	border-width: 8px;
	border-style: solid;
	border-color: #fff transparent transparent transparent;
}

.falling-pill:hover .pill-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0) rotate(var(--pill-counter-rotation, 0rad));
}

.pill-tooltip h4 {
	margin: 0 0 5px 0;
	font-size: 14px;
	font-weight: 700;
}

.pill-tooltip p {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 400;
	color: #444;
	white-space: normal;
}

@media (max-width: 767px) {
	.hide-tooltip-mobile .pill-tooltip {
		display: none !important;
	}
}
