.ji-progress {
	display: flex;
	gap: 10px;
	margin: 0;
	padding: 14px 24px;
	list-style: none;
	border-radius: 999px;
	background: var(--cream);
}

.ji-progress li {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--lavender-pale);
}

.ji-progress li.is-done {
	background: var(--outline);
}

.game.ji-game {
	gap: 8px;
	padding-bottom: 40px;
	background:
		url("../img/ji/bg.png") center / cover no-repeat,
		radial-gradient(ellipse at 50% 55%, #3b2a5c 0 22%, transparent 22.5%),
		linear-gradient(180deg, #8f7aa8 0%, #b69a7c 70%, #9a7658 70.5%, #7e5c43 100%);
}

.ji-scene {
	position: relative;
	isolation: isolate;
	width: 960px;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	container-type: inline-size;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.ji-bubble {
	position: absolute;
	top: 1.5%;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 1.5cqw;
	width: 88%;
	padding: 2.4cqw 3cqw;
	border-radius: 999px;
	background: var(--cream);
	box-shadow: 0 .6cqw 0 rgba(0, 0, 0, .15);
	transition: opacity .25s;
}

.ji-bubble.is-leaving {
	opacity: 0;
}

.ji-bubble::after {
	content: "";
	position: absolute;
	left: 58%;
	top: 100%;
	width: 4cqw;
	height: 2.6cqw;
	margin-top: -1px;
	background: var(--cream);
	clip-path: polygon(0 0, 100% 0, 35% 100%);
	transform: translateX(-50%);
}

.ji-bubble.is-entering {
	transform-origin: 50% 100%;
	animation: ji-bubble-in .3s ease-out;
}

@keyframes ji-bubble-in {
	0% { opacity: 0; transform: translateX(-50%) scale(.9); }
	70% { opacity: 1; transform: translateX(-50%) scale(1.03); }
	100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

.ji-word {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.ji-char {
	padding: 0 .2cqw;
	border: 0;
	border-radius: 8px;
	background: none;
	color: #5a18b0;
	font: inherit;
	font-size: 6cqw;
	font-weight: 700;
	line-height: 1.3;
	cursor: pointer;
}

.ji-bubble[data-size="1"] {
	column-gap: 1.3cqw;
}

.ji-bubble[data-size="1"] .ji-char {
	font-size: 5.2cqw;
}

.ji-bubble[data-size="2"] {
	column-gap: 1.1cqw;
}

.ji-bubble[data-size="2"] .ji-char {
	font-size: 4.4cqw;
}

.ji-char:focus-visible {
	background: var(--lavender-pale);
	outline: none;
}

@media (hover: hover) {
	.ji-char:hover {
		background: var(--lavender-pale);
	}
}

.ji-glyph {
	display: inline-block;
	width: 1em;
	height: 1em;
	vertical-align: -0.12em;
}

.ji-glyph svg {
	display: block;
	width: 100%;
	height: 100%;
	stroke: currentColor;
	stroke-width: 20;
	stroke-linejoin: round;
}

.ji-char.is-found {
	background: #ffd1c7;
	color: #c2352a;
}

.ji-visitor {
	position: absolute;
	left: 50%;
	bottom: 0%;
	transform: translateX(-50%);
	height: 80%;
	width: auto;
	transition: opacity .25s, transform .25s;
	pointer-events: none;
}

.ji-ok {
	position: absolute;
	left: 50%;
	bottom: 4%;
	transform: translateX(-50%);
	z-index: 2;
	min-width: 22cqw;
	padding: 1.2cqw 4cqw;
	border-radius: 999px;
	border: .5cqw solid #fff;
	background: #8a6fb6;
	color: #fff;
	font: inherit;
	font-size: 4.4cqw;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 .6cqw 0 var(--outline);
}

.ji-ok:focus-visible {
	outline: 3px solid var(--apricot);
	outline-offset: 2px;
}

.ji-hint {
	margin: 0;
	padding: 4px 20px;
	border-radius: 999px;
	background: rgba(30, 20, 50, .55);
	font-size: 24px;
	color: var(--lavender-pale);
}

.ji-visitor.is-happy {
	animation: ji-bounce .6s ease-out;
}

@keyframes ji-bounce {
	0% { transform: translate(-50%, 0); }
	30% { transform: translate(-50%, -7%); }
	55% { transform: translate(-50%, 0); }
	75% { transform: translate(-50%, -3%); }
	100% { transform: translate(-50%, 0); }
}

.ji-correct {
	position: absolute;
	left: 50%;
	top: 56%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 24cqw;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	pointer-events: none;
	animation: ji-correct .8s ease-out forwards;
}

.ji-correct-ring {
	grid-area: 1 / 1;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	border: 2.4cqw solid #e2513f;
	border-radius: 50%;
}

.ji-correct-text {
	grid-area: 1 / 1;
	color: #e2513f;
	font-size: 4.4cqw;
	font-weight: 700;
	text-shadow: 0 0 .6cqw #fff, 0 0 .6cqw #fff;
}

@keyframes ji-correct {
	0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
	20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
	75% { opacity: 1; }
	100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
	.ji-bubble,
	.ji-visitor {
		transition: none;
	}

	.ji-correct,
	.ji-bubble.is-entering,
	.ji-visitor.is-happy {
		animation: none;
	}
}
