/* Word Find — a calm, readable grid. Only found words get color. */
.dxg .wf {
	height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px;
	padding: clamp(10px, 2vh, 20px) clamp(10px, 2.5vw, 28px);
}
.wf-boardwrap { container-type: size; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.wf-board {
	--rows: 8; --cols: 8;
	position: relative; container-type: inline-size;
	width: min(100cqw, 100cqh * var(--cols) / var(--rows)); aspect-ratio: var(--cols) / var(--rows);
	display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr);
	background: #fff; border: 2px solid var(--g-border); border-radius: 18px; padding: 0;
	touch-action: none; /* dragging selects letters instead of scrolling */
	box-shadow: 0 4px 14px rgba(28, 43, 61, .06);
}
.wf-row { display: contents; }
.wf-cell {
	position: relative; z-index: 1; display: grid; place-items: center; margin: 0; padding: 0;
	border: 0; border-radius: 10px; background: transparent; cursor: pointer;
	font-family: var(--g-head); font-weight: 500; color: var(--g-navy); line-height: 1;
	font-size: calc(100cqw / var(--cols) * .56);
	transition: background-color .12s ease;
}
.wf-cell:hover { background: rgba(23, 112, 111, .07); }
.wf-cell:focus-visible { outline: 3px solid var(--g-blue); outline-offset: -3px; }
.wf-cell.is-sel { background: #BFE6E2; color: #0B3F3E; }
.wf-cell.is-anchor { background: #FFE9A8; box-shadow: inset 0 0 0 3px #C9A93A; }
.wf-cell.is-miss { background: #F9DCD7; animation: dxg-wiggle .35s ease-in-out; }
.wf-cell.is-near { background: #FFF0B8; }

/* Found words: a soft capsule behind the letters */
.wf-pills { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.wf-pill {
	position: absolute; box-sizing: border-box; border-radius: 999px; border: 2px solid var(--p-edge); background: var(--p-fill);
	transform-origin: left center;
}
.wf-pill.is-new { animation: wf-draw .35s ease-out; }
@keyframes wf-draw { from { transform: scale(.85); opacity: .2; } to { transform: none; opacity: 1; } }
.wf-pill--c0 { --p-fill: #CDEFEA; --p-edge: #7CCBC4; }
.wf-pill--c1 { --p-fill: #FBE0DA; --p-edge: #F2A08F; }
.wf-pill--c2 { --p-fill: #FFF0B8; --p-edge: #E0C052; }
.wf-pill--c3 { --p-fill: #D8EEDF; --p-edge: #8FCBA2; }
.wf-pill--c4 { --p-fill: #D3ECF0; --p-edge: #86C4CD; }
.wf-board.is-reveal .wf-pill:not(.is-new) { background: #fff; border-style: dashed; border-color: #C9A93A; }
.wf-board.is-done .wf-pill { animation: wf-shine .8s ease-out; }
@keyframes wf-shine { 50% { filter: brightness(1.06) saturate(1.3); } }

/* Side panel */
.wf-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; align-self: center; }
.wf-skill {
	align-self: flex-start; font-family: var(--g-head); font-size: 0.85rem; padding: 3px 12px; border-radius: 999px;
	background: #DDF2F0; color: #0E4A49;
}
.wf-goal { margin: 0; font-family: var(--g-head); font-weight: 500; font-size: 1.2rem; color: var(--g-navy); }
.wf-goal__chip {
	display: inline-grid; place-items: center; min-width: 44px; height: 38px; padding: 0 10px; border-radius: 999px;
	background: var(--g-yellow); font-weight: 600; font-size: 1.35rem; vertical-align: middle;
}
.wf-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wf-item {
	display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; padding: 0 12px;
	border-radius: 12px; background: #fff; border: 2px solid var(--g-border);
	font-family: var(--g-head); font-weight: 500; font-size: 1.3rem; color: var(--g-navy);
}
.wf--hunt .wf-item { border-style: dashed; }
.wf-item.is-found { background: #DDF2F0; border: 2px solid var(--g-aqua); }
.wf-item__mark { font-family: var(--g-body); font-weight: 700; font-size: 1rem; color: var(--g-aqua-dark); }
.wf-item.is-found .wf-item__mark::after { content: "✓"; }
.wf-msg { min-height: 2.7em; margin: 0; font-size: 1.02rem; color: var(--g-blue); font-family: var(--g-head); }
.wf-msg.is-readout { font-size: 1.4rem; letter-spacing: .08em; color: var(--g-aqua-dark); }
.wf-end { align-self: flex-start; min-height: 40px; font-size: 0.95rem; padding: 0 16px; }

/* Tablets & phones: word list above the grid */
@media (max-width: 859px) {
	.dxg .wf { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 10px; }
	.wf-panel { order: -1; align-self: stretch; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
	.wf-list, .wf-msg { grid-column: 1 / -1; }
	.wf-list { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
	.wf-item { min-height: 38px; font-size: 1.1rem; padding: 0 8px; }
	.wf-msg { min-height: 1.4em; font-size: 0.95rem; }
	.wf-msg.is-readout { font-size: 1.15rem; }
	.wf-skill { display: none; }
	.wf-goal { font-size: 1.05rem; }
	.wf-end { grid-row: 1; grid-column: 2; min-height: 38px; font-size: 0.85rem; padding: 0 12px; }
}
