.icw-root {
	--icw-cell: 34px;
	--icw-border: #2b4a7a;
	--icw-blue: #2b6fd4;
	--icw-blue-dark: #1c4e9c;
	--icw-active: #ffe27a;
	--icw-active-word: #dfeeff;
	--icw-correct: #bdf5c8;
	--icw-incorrect: #ffc9c9;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	max-width: 980px;
	margin: 24px auto;
	color: #1c2b3a;
	box-sizing: border-box;
}
.icw-root *, .icw-root *::before, .icw-root *::after {
	box-sizing: border-box;
}

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

.icw-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px;
	background: #f2f6fb;
	border: 1px solid #dbe4f0;
	border-top: none;
}
.icw-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;
}
.icw-btn:hover {
	background: #eaf1fb;
}
.icw-btn:active {
	transform: scale(0.97);
}
.icw-btn.icw-primary {
	background: var(--icw-blue);
	border-color: var(--icw-blue-dark);
	color: #fff;
}
.icw-btn.icw-primary:hover {
	background: var(--icw-blue-dark);
}
.icw-btn.icw-danger {
	color: #a12222;
	border-color: #e6b6b6;
}

.icw-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;
}

.icw-grid-wrap {
	overflow-x: auto;
	padding-bottom: 4px;
	flex: 0 0 auto;
}

.icw-grid {
	display: grid;
	border-left: 2px solid var(--icw-border);
	border-top: 2px solid var(--icw-border);
	width: max-content;
}

.icw-cell {
	width: var(--icw-cell);
	height: var(--icw-cell);
	border-right: 2px solid var(--icw-border);
	border-bottom: 2px solid var(--icw-border);
	position: relative;
	background: #fff;
}
.icw-cell.icw-black {
	background: #16233a;
	border-color: var(--icw-border);
}
.icw-cell input {
	width: 100%;
	height: 100%;
	border: none;
	background: transparent;
	text-align: center;
	font-size: 1rem;
	font-weight: 700;
	text-transform: uppercase;
	color: #16324f;
	padding: 0;
	outline: none;
	caret-color: transparent;
}
.icw-cell.icw-active-word input {
	background: var(--icw-active-word);
}
.icw-cell.icw-active input {
	background: var(--icw-active);
}
.icw-cell.icw-correct input {
	background: var(--icw-correct) !important;
}
.icw-cell.icw-incorrect input {
	background: var(--icw-incorrect) !important;
}
.icw-cell .icw-num {
	position: absolute;
	top: 1px;
	left: 2px;
	font-size: 9px;
	font-weight: 700;
	color: #56698a;
	pointer-events: none;
	line-height: 1;
}

.icw-clues {
	flex: 1 1 320px;
	min-width: 260px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}
.icw-clue-group h3 {
	margin: 0 0 8px;
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--icw-blue-dark);
	border-bottom: 2px solid #e4ecf6;
	padding-bottom: 6px;
}
.icw-clue-group ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.icw-clue-item {
	padding: 7px 8px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.92rem;
	line-height: 1.35;
	display: flex;
	gap: 6px;
}
.icw-clue-item:hover {
	background: #f2f6fb;
}
.icw-clue-item.icw-clue-active {
	background: var(--icw-active-word);
	font-weight: 600;
}
.icw-clue-item.icw-clue-done {
	color: #7c8ba3;
	text-decoration: line-through;
}
.icw-clue-num {
	font-weight: 700;
	color: var(--icw-blue-dark);
	min-width: 20px;
}

.icw-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;
}
.icw-root.icw-solved .icw-banner {
	display: block;
}

@media (max-width: 640px) {
	.icw-root {
		--icw-cell: 26px;
	}
	.icw-clues {
		grid-template-columns: 1fr;
	}
	.icw-header {
		flex-direction: column;
		align-items: flex-start;
	}
}
