.fw-root {
	--fw-cell: 32px;
	--fw-border: #2b4a7a;
	--fw-blue: #2b6fd4;
	--fw-blue-dark: #1c4e9c;
	--fw-found: #bdf5c8;
	--fw-selecting: #ffe27a;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	max-width: 980px;
	margin: 24px auto;
	color: #1c2b3a;
	box-sizing: border-box;
	user-select: none;
	-webkit-user-select: none;
}
.fw-root *, .fw-root *::before, .fw-root *::after {
	box-sizing: border-box;
}

.fw-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	background: linear-gradient(135deg, var(--fw-blue), var(--fw-blue-dark));
	color: #fff;
	padding: 14px 18px;
	border-radius: 10px 10px 0 0;
}
.fw-title {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0;
}
.fw-stats {
	display: flex;
	gap: 16px;
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.fw-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	background: #f2f6fb;
	border: 1px solid #dbe4f0;
	border-top: none;
}
.fw-btn {
	background: #fff;
	border: 1px solid #c5d3e6;
	color: #234;
	padding: 7px 14px;
	border-radius: 7px;
	font-size: 0.88rem;
	cursor: pointer;
	transition: background .15s, transform .05s;
}
.fw-btn:hover { background: #eaf1fb; }
.fw-btn:active { transform: scale(0.97); }
.fw-btn.fw-primary {
	background: var(--fw-blue);
	border-color: var(--fw-blue-dark);
	color: #fff;
}
.fw-btn.fw-primary:hover { background: var(--fw-blue-dark); }
.fw-btn.fw-active {
	background: var(--fw-blue-dark);
	color: #fff;
}

.fw-banner {
	display: none;
	margin: 14px 16px 0;
	padding: 14px 16px;
	border-radius: 8px;
	background: #eafbe9;
	border: 1px solid #9bdca0;
	color: #1c5e22;
	font-weight: 600;
	text-align: center;
	font-size: 1.05rem;
}
.fw-root.fw-solved .fw-banner { display: block; }

.fw-body {
	display: flex;
	flex-wrap: wrap;
	gap: 22px;
	border: 1px solid #dbe4f0;
	border-top: none;
	padding: 18px 16px;
	border-radius: 0 0 10px 10px;
	background: #fff;
}

.fw-grid-wrap {
	overflow-x: auto;
	flex: 0 0 auto;
}

.fw-grid {
	display: grid;
	border: 2px solid var(--fw-border);
	width: max-content;
	touch-action: none;
}

.fw-cell {
	width: var(--fw-cell);
	height: var(--fw-cell);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.95rem;
	color: #16324f;
	border-right: 1px solid #e3ebf5;
	border-bottom: 1px solid #e3ebf5;
	cursor: pointer;
	position: relative;
	background: #fff;
}
.fw-cell.fw-selecting { background: var(--fw-selecting); }
.fw-cell.fw-found { background: var(--fw-found); }

.fw-words {
	flex: 1 1 260px;
	min-width: 220px;
}
.fw-words h3 {
	margin: 0 0 8px;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--fw-blue-dark);
	border-bottom: 2px solid #e4ecf6;
	padding-bottom: 6px;
}
.fw-word-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.fw-word-item {
	padding: 7px 8px;
	border-radius: 6px;
	font-size: 0.92rem;
	line-height: 1.35;
}
.fw-word-item.fw-word-found {
	background: var(--fw-found);
	color: #1c5e22;
	text-decoration: line-through;
}
.fw-word-clue {
	display: block;
	font-size: 0.82rem;
	color: #667;
	text-decoration: none;
	margin-top: 2px;
}

@media (max-width: 640px) {
	.fw-root { --fw-cell: 24px; }
	.fw-header { flex-direction: column; align-items: flex-start; }
}
