/**
 * おもちゃブロック共通の「ぶたい」。
 * 色・フォントは toybox テーマのプリセットを使い、テーマが無いときは近い値に落とす。
 */

.toybox-toy {
	--toy-ink: var(--wp--preset--color--ink, #4a3f3a);
	--toy-bg: var(--wp--preset--color--white, #fffdf8);
	--toy-dot: var(--wp--preset--color--base-deep, #fcebd3);
	--toy-radius: var(--wp--custom--radius--lg, 32px);
}

.toybox-toy__stage {
	position: relative;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 0.5rem;
	min-height: 22rem;
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: var(--toy-ink);
	background-color: var(--toy-bg);
	background-image: radial-gradient(var(--toy-dot) 2px, transparent 2.5px);
	background-size: 22px 22px;
	border: 2px solid var(--toy-ink);
	border-radius: var(--toy-radius);
	box-shadow: 6px 6px 0 var(--toy-ink);
}

.toybox-toy__stage > * {
	margin: 0;
}

.toybox-toy__paon {
	width: 180px;
	height: auto;
}

.toybox-toy__title {
	font-size: 1.375rem;
	font-weight: 700;
}

.toybox-toy.is-coming-soon .toybox-toy__stage {
	border-style: dashed;
	box-shadow: none;
}

.toybox-toy.is-coming-soon .toybox-toy__paon {
	animation: toybox-toy-snooze 4s ease-in-out infinite;
	transform-origin: 50% 90%;
}

@keyframes toybox-toy-snooze {
	50% {
		transform: rotate(-4deg) scale(1.02);
	}
}

@media (prefers-reduced-motion: reduce) {
	.toybox-toy.is-coming-soon .toybox-toy__paon {
		animation: none;
	}
}

/* ---------- アプリ共通 ---------- */

.toybox-toy .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.toybox-toy__toolbar {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	z-index: 3;
	display: flex;
	gap: 0.5rem;
}

.toybox-toy__sound,
.toybox-toy__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.35em 0.9em;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--toy-ink);
	background: var(--toy-bg);
	border: 2px solid var(--toy-ink);
	border-radius: 999px;
	cursor: pointer;
	transition: transform 0.15s, background-color 0.2s;
}

.toybox-toy__sound:hover,
.toybox-toy__chip:hover {
	background: var(--wp--preset--color--lemon, #ffd97a);
}

.toybox-toy__sound:active,
.toybox-toy__chip:active {
	transform: scale(0.95);
}

.toybox-toy__sound svg {
	width: 1.15em;
	height: 1.15em;
}

.toybox-toy__sound[aria-pressed="false"] {
	color: var(--wp--preset--color--ink-soft, #75665f);
}

.toybox-toy :where(button):focus-visible {
	outline: 3px dashed var(--toy-ink);
	outline-offset: 3px;
}

/* ぱおんの ふきだし */
.toybox-toy__bubble {
	position: relative;
	margin: 0;
	padding: 0.85rem 1.1rem;
	font-weight: 700;
	line-height: 1.7;
	background: var(--toy-bg);
	border: 2px solid var(--toy-ink);
	border-radius: 20px;
}

.toybox-toy__bubble::before {
	content: "";
	position: absolute;
	left: -9px;
	top: 50%;
	width: 14px;
	height: 14px;
	background: inherit;
	border-left: 2px solid var(--toy-ink);
	border-bottom: 2px solid var(--toy-ink);
	border-bottom-left-radius: 3px;
	transform: translateY(-50%) rotate(45deg);
}
