/* Word Factory — order ticket → assembly belt → finished word, with a parts bin. */
.dxg .wfx { position: relative; height: 100%; display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); gap: clamp(10px, 2vw, 22px); padding: clamp(8px, 1.6vh, 18px) clamp(10px, 2.4vw, 28px); }
.wfx-ticket {
	align-self: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 14px 16px;
	background: #fff; border: 2px solid var(--g-border); border-radius: 18px; border-top: 10px solid #F6D878;
	background-image: radial-gradient(circle at 12px 12px, #E0C052 3px, transparent 4px), radial-gradient(circle at calc(100% - 12px) 12px, #E0C052 3px, transparent 4px);
}
.wfx-ticket__label { margin: 0; font-family: var(--g-head); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #5C4500; }
.wfx-pic { width: 100%; max-width: 210px; aspect-ratio: 5 / 4; object-fit: contain; }
.wfx-prompt-text { margin: 0; font-size: 1.05rem; text-align: center; color: var(--g-navy); }
.wfx-hear { min-height: 56px; width: 100%; font-size: 1.1rem; gap: 8px; }
.wfx-hear__icon { font-size: 1.35rem; }
.wfx-hear.is-playing .wfx-hear__icon { animation: wfx-pulse .6s ease-out 2; display: inline-block; }
@keyframes wfx-pulse { 50% { transform: scale(1.3); } }

.wfx-floor { display: flex; flex-direction: column; justify-content: center; gap: clamp(6px, 1.2vh, 10px); min-width: 0; }
.wfx-label { margin: 0; font-family: var(--g-head); font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--g-muted); }
/* The assembly belt */
.wfx-belt {
	position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; min-height: 104px;
	padding: 14px 18px 22px; border-radius: 16px; background: #EEF3F4; border: 2px solid #C9D6D8; transition: border-color .15s, gap .25s ease;
	background-image: repeating-linear-gradient(90deg, #E2EAEC 0 18px, #EEF3F4 18px 36px);
}
.wfx-belt::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px; height: 10px; border-radius: 6px;
	background: radial-gradient(circle at 8px 5px, #9FB2B5 4px, transparent 5px) 0 0 / 26px 10px repeat-x; opacity: .8; }
.wfx-belt.is-target { border-color: var(--g-aqua); }
.wfx .dxo-slot { width: 84px; height: 72px; border-radius: 12px; border: 3px dashed #AFC0C3; background: rgba(255,255,255,.6); flex: 0 0 auto; }
.wfx .dxo-insert { width: 6px; height: 68px; border-radius: 3px; background: var(--g-aqua); flex: 0 0 auto; animation: wfx-blink .8s ease-in-out infinite alternate; }
@keyframes wfx-blink { from { opacity: .45; } to { opacity: 1; } }
/* The parts bin */
.wfx-bin { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; min-height: 90px; align-items: center; padding: 12px; border-radius: 16px;
	background: #FFF9E8; border: 2px solid #EBD592; box-shadow: inset 0 -6px 0 rgba(224, 192, 82, .18); }
/* A part: a sturdy plate with little bolts; readable letters come first */
.wfx .dxo-tile {
	position: relative; min-width: 84px; height: 72px; padding: 0 18px; margin: 0; cursor: grab; touch-action: none;
	border-radius: 12px; border: 3px solid #9FB2B5; border-bottom-width: 6px; background: #fff; color: var(--g-navy);
	background-image: radial-gradient(circle at 8px 8px, #C9D6D8 2.5px, transparent 3px), radial-gradient(circle at calc(100% - 8px) 8px, #C9D6D8 2.5px, transparent 3px);
	font-family: var(--g-head); font-weight: 500; font-size: clamp(2rem, 1.5rem + 1.4vw, 2.6rem); line-height: 1;
	transition: transform .12s ease, box-shadow .12s ease, border-radius .25s ease; -webkit-tap-highlight-color: transparent;
}
.wfx .dxo-tile:hover { transform: translateY(-2px); border-color: var(--g-aqua); }
.wfx .dxo-tile:focus-visible { outline: 4px solid var(--g-blue); outline-offset: 3px; }
.wfx .dxo-tile.is-lifted { z-index: 10; cursor: grabbing; box-shadow: 0 14px 26px rgba(28, 43, 61, .25); transition: none; }
.wfx .dxo-tile.is-hint { outline: 4px solid #E0C052; outline-offset: 3px; }
.wfx .dxo-tile.is-given { border-color: #E0C052; }
.wfx .dxo-tile.is-unused { opacity: .3; }
.wfx-belt.is-wrong { animation: dxg-wiggle .38s ease-in-out; border-color: #F2A08F; }
/* Snap together into one finished word */
.wfx-belt.is-joined { gap: 0; border-color: var(--g-aqua); background: #F3FBFA; }
.wfx-belt.is-joined .dxo-tile { border-radius: 0; margin: 0; border-left-width: 1.5px; border-right-width: 1.5px; background: #E2F5F3; border-color: #7CCBC4; cursor: default; transform: none; background-image: none; }
.wfx-belt.is-joined .dxo-tile:first-child { border-radius: 12px 0 0 12px; border-left-width: 3px; }
.wfx-belt.is-joined .dxo-tile:last-of-type { border-radius: 0 12px 12px 0; border-right-width: 3px; }
.wfx-done { margin: 0; height: 0; overflow: hidden; opacity: 0; text-align: center; font-family: var(--g-head); font-weight: 600; font-size: clamp(2rem, 1.6rem + 2vw, 3rem); color: var(--g-blue); transition: opacity .25s ease .1s; }
.wfx-done.is-on { height: auto; opacity: 1; }
/* Sound boxes (hint) */
.wfx-sounds { display: flex; justify-content: center; gap: 8px; }
.wfx-sound { min-width: 64px; padding: 6px 10px; border-radius: 10px; border: 2px solid #86C4CD; background: #E2F3F5; text-align: center; font-family: var(--g-body); font-weight: 700; font-size: 1.25rem; color: var(--g-navy); }
.wfx-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.wfx-build { min-width: 210px; min-height: 54px; font-size: 1.2rem; }
.wfx-build:disabled { opacity: .45; cursor: default; }
.wfx-msg { margin: 0; min-height: 1.5em; text-align: center; font-family: var(--g-head); font-weight: 500; color: var(--g-blue); }
.wfx-streak { position: absolute; top: 8px; right: 14px; padding: 4px 14px; border-radius: 999px; background: #FFF5D1; border: 2px solid #E9C85A;
	font-family: var(--g-head); font-weight: 600; font-size: .95rem; color: #5C4500; opacity: 0; transition: opacity .2s; }
.wfx-streak.is-on { opacity: 1; }
@media (max-height: 700px) {
	.wfx-belt { min-height: 90px; padding: 10px 14px 18px; }
	.wfx .dxo-tile { height: 62px; } .wfx .dxo-slot { height: 62px; }
	.wfx-bin { min-height: 76px; padding: 8px; }
	.wfx-pic { max-width: 170px; }
}
@media (max-width: 699px) {
	.dxg .wfx { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 8px; }
	.wfx-ticket { flex-direction: row; padding: 8px 10px; border-top-width: 6px; gap: 10px; }
	.wfx-ticket__label, .wfx-prompt-text { display: none; }
	.wfx-pic { width: 84px; max-width: 84px; }
	.wfx-hear { width: auto; flex: 1; min-height: 48px; }
	.wfx .dxo-tile { min-width: 64px; height: 58px; padding: 0 12px; font-size: 1.9rem; } .wfx .dxo-slot { width: 64px; height: 58px; }
	.wfx-belt { gap: 6px; min-height: 84px; padding: 8px 8px 16px; }
	.wfx-bin { gap: 8px; }
	.wfx-build { min-width: 0; width: 100%; }
	.wfx-streak { top: 2px; right: 4px; font-size: .78rem; }
}
