/* Hex-A-Gem puzzle board. */

.hex-a-gem {
	margin: 0 0 1.5rem;
}

.hex-a-gem__board {
	position: relative;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	user-select: none;
	touch-action: none;
}

.hex-a-gem__bg {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
	max-width: 100%;
}

.hex-a-gem__slot {
	position: absolute;
	width: 15.6%;
	aspect-ratio: 1.154 / 1;
	transform: translate(-50%, -50%);
	z-index: 1;
	overflow: visible;
}

.hex-a-gem__tray {
	position: absolute;
	right: 2.5%;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	z-index: 4;
	margin: 0;
	padding: 0.25rem 0;
	pointer-events: none;
}

.hex-a-gem__nest {
	position: relative;
	width: 6.25rem;
	aspect-ratio: 1;
	border: 1px solid rgba(180, 180, 180, 0.4);
	border-radius: 10px;
	box-sizing: border-box;
}

.hex-a-gem__tray .hex-a-gem__stone {
	pointer-events: auto;
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
}

.hex-a-gem__stone {
	position: relative;
	width: 4.75rem;
	aspect-ratio: 1;
	border: 0;
	padding: 0;
	margin: 0;
	background: transparent;
	cursor: grab;
	z-index: 2;
	touch-action: none;
}

.hex-a-gem__stone.is-dragging {
	cursor: grabbing;
	z-index: 20;
	opacity: 0.92;
}

.hex-a-gem__stone.is-selected {
	z-index: 5;
}

.hex-a-gem__select {
	position: absolute;
	inset: 2.5%;
	width: auto;
	height: auto;
	pointer-events: none;
	z-index: 3;
	overflow: visible;
	opacity: 0;
	filter: drop-shadow(0 0 3px rgba(78, 184, 255, 0.95));
}

.hex-a-gem__stone.is-selected .hex-a-gem__select {
	opacity: 1;
}

.hex-a-gem__slot .hex-a-gem__select {
	inset: 0;
}

.hex-a-gem__stone img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
	transform: rotate(var(--hex-rot, 0deg));
	transform-origin: 50% 50%;
}

.hex-a-gem__hud {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.22em;
	pointer-events: none;
	z-index: 2;
	font-size: 0.95rem;
}

.hex-a-gem__hud-num,
.hex-a-gem__hud-arrow {
	display: none;
}

.hex-a-gem__stone[data-hud="Both"] .hex-a-gem__hud-num,
.hex-a-gem__stone[data-hud="StoneNumber"] .hex-a-gem__hud-num,
.hex-a-gem__stone[data-hud="Both"] .hex-a-gem__hud-arrow,
.hex-a-gem__stone[data-hud="Orientation"] .hex-a-gem__hud-arrow {
	display: block;
}

.hex-a-gem__hud-num {
	color: #fff;
	font: 700 1em/1 sans-serif;
	text-shadow: 0 0 4px #000, 0 1px 2px #000;
	transform: none;
}

.hex-a-gem__hud-arrow {
	width: 0.55em;
	height: 0.7em;
	flex-shrink: 0;
	filter: drop-shadow(0 0 2px #000);
	transform: rotate(var(--hex-rot, 0deg));
	transform-origin: 50% 50%;
	overflow: visible;
}

.hex-a-gem__slot .hex-a-gem__hud {
	font-size: 1.45rem;
}

.hex-a-gem__slot .hex-a-gem__stone {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
}

.hex-a-gem__controls {
	position: absolute;
	display: flex;
	gap: 0.4rem;
	z-index: 6;
	transform: translate(-50%, calc(-50% - 150px));
}

.hex-a-gem__rot {
	width: 2.1rem;
	height: 2.1rem;
	border: 0;
	border-radius: 999px;
	background: rgba(20, 20, 20, 0.9);
	color: #fff;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.hex-a-gem__rot:hover:not(:disabled),
.hex-a-gem__rot:focus:not(:disabled) {
	background: #3b7ca8;
}

.hex-a-gem__rot:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.hex-a-gem-form .hex-a-gem-repeater .gfield_repeater_buttons,
.hex-a-gem-form .hex-a-gem-repeater .gfield_repeater_max_message {
	display: none !important;
}

.hex-a-gem-form .hex-a-gem-prize,
.hex-a-gem-form .gform_image_button,
.hex-a-gem-form .gform_footer,
.hex-a-gem-form .gform-footer {
	display: none !important;
}

.hex-a-gem-form.hex-a-gem-solved .hex-a-gem-prize,
.hex-a-gem-form.hex-a-gem-solved .gform_image_button,
.hex-a-gem-form.hex-a-gem-solved .gform_footer,
.hex-a-gem-form.hex-a-gem-solved .gform-footer {
	display: revert !important;
}

@media (max-width: 600px) {
	.hex-a-gem__nest {
		width: 4.25rem;
	}

	.hex-a-gem__hud {
		font-size: 0.8rem;
	}

	.hex-a-gem__slot .hex-a-gem__hud {
		font-size: 1.1rem;
	}
}
