.abcw-game {
	--abcw-red: #c5161d;
	--abcw-ink: #212121;
	--abcw-line: #212121;
	--abcw-active: #ffe08a;
	--abcw-word: #cfe3ff;
	--abcw-cell: 40px;
	font-family: "Sweet Sans Pro", "Helvetica Neue", Arial, sans-serif;
	color: var(--abcw-ink);
	max-width: 1000px;
}
.abcw-game.has-custom-background {
	box-sizing: border-box;
	padding: clamp(18px, 3vw, 32px);
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}
.abcw-print-title, .abcw-print-instructions, .abcw-print-board { display: none; }

.abcw-instructions {
	font-size: 1.05rem;
	background: #f4f4f4;
	border-left: 4px solid var(--abcw-red);
	padding: 12px 16px;
	margin: 0 0 18px;
}

.abcw-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}
.abcw-timer {
	font-size: 1.4rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 1px;
	color: var(--abcw-ink);
}
.abcw-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.abcw-btn {
	background: var(--abcw-red);
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 8px 14px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: filter .15s ease;
}
.abcw-btn:hover { filter: brightness(1.08); }
.abcw-btn-ghost { background: #fff; color: var(--abcw-ink); border: 1px solid #ccc; }

.abcw-layout {
	display: flex;
	gap: 32px;
	align-items: flex-start;
	flex-wrap: wrap;
}
.abcw-board-wrap { flex: 0 0 auto; }

.abcw-board {
	display: grid;
	grid-template-columns: repeat(var(--abcw-cols), var(--abcw-cell));
	grid-template-rows: repeat(var(--abcw-rows), var(--abcw-cell));
	gap: 0;
	background: var(--abcw-line);
	border: 2px solid var(--abcw-line);
	width: max-content;
}
.abcw-cell {
	position: relative;
	width: var(--abcw-cell);
	height: var(--abcw-cell);
	background: #fff;
	box-sizing: border-box;
	border-right: 1px solid #bdbdbd;
	border-bottom: 1px solid #bdbdbd;
}
.abcw-block { background: transparent; border: none; }
.abcw-cell-num {
	position: absolute;
	top: 1px;
	left: 2px;
	font-size: 10px;
	line-height: 1;
	font-weight: 600;
	color: #616161;
	pointer-events: none;
	z-index: 2;
}
.abcw-cell input {
	width: 100%;
	height: 100%;
	border: none;
	background: transparent;
	text-align: center;
	text-transform: uppercase;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--abcw-ink);
	padding: 0;
	margin: 0;
	caret-color: transparent;
	box-sizing: border-box;
}
.abcw-cell input:focus { outline: none; }
.abcw-cell.abcw-active-word { background: var(--abcw-word); }
.abcw-cell.abcw-active { background: var(--abcw-active); }
.abcw-cell.abcw-wrong { background: #ffc9c9 !important; }
.abcw-cell.abcw-correct input { color: #1a7f37; }

.abcw-active-clue {
	margin: 0 0 12px;
	padding: 10px 14px;
	background: #212121;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	border-radius: 4px;
	min-height: 1.2em;
	max-width: calc(var(--abcw-cols) * var(--abcw-cell) + 4px);
}

.abcw-clues { display: flex; gap: 28px; flex: 1 1 300px; }
.abcw-clue-col { flex: 1 1 0; min-width: 180px; }
.abcw-clue-col h3 {
	font-family: "Big Noodle Titling", "Oswald", Impact, sans-serif;
	text-transform: uppercase;
	letter-spacing: 1px;
	border-bottom: 3px solid var(--abcw-red);
	padding-bottom: 4px;
	margin: 0 0 10px;
	font-size: 1.3rem;
}
.abcw-clues ol { margin: 0; padding: 0 0 0 4px; list-style: none; }
.abcw-clue-item {
	display: flex;
	gap: 8px;
	padding: 5px 8px;
	font-size: 0.92rem;
	line-height: 1.35;
	cursor: pointer;
	border-radius: 4px;
}
.abcw-clue-item::before {
	content: attr(value);
	font-weight: 700;
	min-width: 20px;
	color: var(--abcw-red);
}
.abcw-clue-item:hover { background: #f4f4f4; }
.abcw-clue-item.abcw-clue-active { background: var(--abcw-word); font-weight: 600; }

.abcw-win[hidden] { display: none; }
.abcw-win {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}
.abcw-win-card {
	background: #fff;
	padding: 36px 44px;
	border-radius: 10px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0,0,0,.3);
	max-width: 90vw;
}
.abcw-win-emoji { font-size: 3rem; }
.abcw-win-card h3 {
	font-family: "Big Noodle Titling", "Oswald", Impact, sans-serif;
	text-transform: uppercase;
	color: var(--abcw-red);
	font-size: 2rem;
	margin: 6px 0;
}
.abcw-empty { padding: 20px; background: #f4f4f4; border-radius: 6px; }

@media (max-width: 600px) {
	.abcw-game { --abcw-cell: 32px; }
	.abcw-cell input { font-size: 1rem; }
	.abcw-layout { gap: 20px; }
}


/* ===== v1.1 scoring, feedback & effects ===== */

/* Stats cluster */
.abcw-stats { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.abcw-stat { display: flex; flex-direction: column; line-height: 1.05; }
.abcw-stat-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: #616161; font-weight: 600; }
.abcw-score { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--abcw-red); }
.abcw-combo {
	background: #212121; color: #fff; padding: 5px 12px; border-radius: 20px;
	font-weight: 700; font-size: .82rem; white-space: nowrap;
}
@keyframes abcw-bump { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
.abcw-score-bump { display: inline-block; animation: abcw-bump .35s ease; }

/* Correct / revealed cells (persist, and win over active highlight) */
.abcw-cell.abcw-correct { background: #c7f0d2 !important; }
.abcw-cell.abcw-correct input { color: #146c2e; }
.abcw-cell.abcw-revealed { background: #e7e0f7 !important; }
.abcw-cell.abcw-revealed input { color: #5b3ea8; }

/* Checked-off clues become faded + struck + ticked */
.abcw-clue-item { align-items: baseline; }
.abcw-clue-text { flex: 1; }
.abcw-clue-done { opacity: .55; }
.abcw-clue-done .abcw-clue-text { text-decoration: line-through; }
.abcw-clue-done::after { content: "✓"; margin-left: 8px; color: #1a7f37; font-weight: 800; }

/* Pop on a freshly solved word */
@keyframes abcw-pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
.abcw-cell.abcw-pop { animation: abcw-pop .42s ease; animation-delay: var(--abcw-pop-delay, 0ms); z-index: 3; }

/* Shake on a wrong Enter check */
@keyframes abcw-shake {
	0%,100% { transform: translateX(0); } 20% { transform: translateX(-3px); }
	40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(2px); }
}
.abcw-cell.abcw-shake { animation: abcw-shake .4s ease; }

.abcw-win-score { font-size: 1.25rem; font-weight: 800; color: #1a7f37; margin: 6px 0 2px; }

/* Floating "+points", cheer word, and confetti (appended to <body>) */
.abcw-float {
	position: fixed; transform: translate(-50%, -50%); z-index: 10000; pointer-events: none;
	font-weight: 800; font-size: 1.3rem; animation: abcw-floatup 1s ease forwards;
}
.abcw-float-pos { color: #1a7f37; }
@keyframes abcw-floatup {
	0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); }
	20% { opacity: 1; }
	100% { opacity: 0; transform: translate(-50%, -170%) scale(1.1); }
}
.abcw-cheer {
	position: fixed; transform: translate(-50%, -50%); z-index: 10000; pointer-events: none;
	font-family: "Big Noodle Titling", "Oswald", Impact, sans-serif; font-size: 1.9rem;
	color: #c5161d; text-transform: uppercase; letter-spacing: 1px;
	text-shadow: 0 2px 6px rgba(0,0,0,.2); animation: abcw-cheer 1s ease forwards;
}
@keyframes abcw-cheer {
	0% { opacity: 0; transform: translate(-50%, -40%) scale(.4) rotate(-8deg); }
	30% { opacity: 1; transform: translate(-50%, -70%) scale(1.1) rotate(3deg); }
	100% { opacity: 0; transform: translate(-50%, -130%) scale(1) rotate(0); }
}
.abcw-confetti {
	position: fixed; width: 8px; height: 8px; border-radius: 1px; z-index: 10000; pointer-events: none;
	animation: abcw-confetti .85s ease-out forwards;
}
@keyframes abcw-confetti {
	0% { opacity: 1; transform: translate(0,0) rotate(0); }
	100% { opacity: 0; transform: translate(var(--abcw-dx), var(--abcw-dy)) rotate(var(--abcw-rot)); }
}

@media (prefers-reduced-motion: reduce) {
	.abcw-cell.abcw-pop, .abcw-cell.abcw-shake, .abcw-score-bump,
	.abcw-float, .abcw-cheer, .abcw-confetti { animation: none; }
}

/* Gentle nudge when a blocked word is typed */
.abcw-toast {
	position: fixed; transform: translate(-50%, -100%); z-index: 10001; pointer-events: none;
	background: #212121; color: #fff; padding: 7px 13px; border-radius: 18px;
	font-size: .9rem; font-weight: 600; white-space: nowrap;
	box-shadow: 0 6px 18px rgba(0,0,0,.25); animation: abcw-toast .25s ease;
}
@keyframes abcw-toast { 0% { opacity: 0; transform: translate(-50%, -80%); } 100% { opacity: 1; transform: translate(-50%, -100%); } }

@media print {
	@page { size: letter portrait; margin: .3in; }
	html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
	body * { visibility: hidden !important; }
	.abcw-game, .abcw-game * { visibility: visible !important; }
	.abcw-game {
		position: absolute !important;
		top: 0 !important;
		left: 0 !important;
		width: 100% !important;
		height: 9.9in !important;
		max-width: none !important;
		margin: 0 !important;
		padding: .18in !important;
		border: 1.5pt solid #111 !important;
		box-sizing: border-box !important;
		/* Large enough for pencil entry while leaving room for clues below. */
		--abcw-cell: .36in;
		color: #000 !important;
		font-family: Arial, sans-serif !important;
	}
	.abcw-print-title {
		display: block !important;
		margin: 0 0 .06in !important;
		text-align: center !important;
		font: 700 20pt/1.1 Arial, sans-serif !important;
	}
	.abcw-print-instructions { display: block !important; margin: 0 0 .08in !important; text-align: center !important; font-size: 9pt !important; }
	.abcw-instructions { margin: 0 0 .1in !important; padding: .05in .1in !important; border: 1px solid #777 !important; background: #fff !important; font-size: 9pt !important; }
	.abcw-toolbar, .abcw-active-clue, .abcw-win, .abcw-float, .abcw-cheer, .abcw-confetti, .abcw-toast { display: none !important; }
	.abcw-layout { display: flex !important; flex-direction: column !important; gap: .2in !important; align-items: stretch !important; }
	.abcw-board-wrap { align-self: center !important; }
	.abcw-board {
		display: none !important;
		border: 0 !important;
		background: transparent !important;
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}
	.abcw-print-board {
		display: table !important;
		border-collapse: collapse !important;
		border-spacing: 0 !important;
		table-layout: fixed !important;
		margin: 0 !important;
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}
	.abcw-print-board tr { height: .36in !important; }
	.abcw-print-board td {
		position: relative !important;
		width: .36in !important;
		height: .36in !important;
		min-width: .36in !important;
		max-width: .36in !important;
		padding: 0 !important;
		box-sizing: border-box !important;
	}
	.abcw-print-cell { border: 1px solid #111 !important; background: #fff !important; }
	.abcw-print-block { border: 0 !important; background: transparent !important; }
	.abcw-print-cell-num { position: absolute !important; top: 2px !important; left: 3px !important; color: #000 !important; font: 700 7pt/1 Arial, sans-serif !important; }
	.abcw-clues { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: .2in !important; }
	.abcw-clue-col { min-width: 0 !important; }
	.abcw-clue-col h3 { margin: 0 0 .05in !important; padding: 0 0 .03in !important; border-bottom: 2px solid #000 !important; color: #000 !important; font: 700 12pt/1 Arial, sans-serif !important; }
	.abcw-clue-item, .abcw-clue-item.abcw-clue-active, .abcw-clue-item.abcw-clue-done { margin: 0 !important; padding: .04in 0 !important; background: #fff !important; color: #000 !important; font-size: 8.5pt !important; font-weight: 400 !important; line-height: 1.25 !important; opacity: 1 !important; break-inside: avoid; }
	.abcw-clue-item::before { min-width: .18in !important; color: #000 !important; }
	.abcw-clue-item.abcw-clue-done .abcw-clue-text { text-decoration: none !important; }
	.abcw-clue-item.abcw-clue-done::after { display: none !important; }
}
