.chad-bingo {
	--cb-orange: #ff6900;
	--cb-black: #0a0a0a;
	width: 100%;
	max-width: 720px;
	margin: 0 auto;
	padding: 16px;
	box-sizing: border-box;
	color: #fff;
	text-align: center;
}
.chad-bingo *, .chad-bingo *::before, .chad-bingo *::after { box-sizing: border-box; }

.cb-title {
	margin: 0 0 26px;
	padding: 0 6px 6px 0;
	font-family: Impact, "Haettenschweiler", "Arial Narrow Bold", "Arial Black", sans-serif;
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: clamp(2.1rem, 10.5vw, 4.9rem);
	line-height: 1.02;
	color: #fff;
}
/* Logo colors: white face + blue outline + red extrusion, then red face + blue outline + navy extrusion */
.cb-title .cb-l1,
.cb-title .cb-l2 {
	display: block;
	-webkit-text-stroke: 7px #2f57d8;
	paint-order: stroke fill;
	stroke-linejoin: round;
}
.cb-title .cb-l1 {
	color: #fff;
	filter:
		drop-shadow(1px 1px 0 #e21f26)
		drop-shadow(1px 1px 0 #e21f26)
		drop-shadow(1px 1px 0 #c4161c)
		drop-shadow(1px 1px 0 #c4161c)
		drop-shadow(1px 1px 0 #9b1015)
		drop-shadow(1px 1px 0 #9b1015)
		drop-shadow(0 8px 6px rgba(0, 0, 0, 0.35));
}
.cb-title .cb-l2 {
	font-size: 1.28em;
	color: #e21f26;
	filter:
		drop-shadow(1px 1px 0 #1c2f8f)
		drop-shadow(1px 1px 0 #1c2f8f)
		drop-shadow(1px 1px 0 #142270)
		drop-shadow(1px 1px 0 #142270)
		drop-shadow(1px 1px 0 #0d1650)
		drop-shadow(1px 1px 0 #0d1650)
		drop-shadow(0 8px 6px rgba(0, 0, 0, 0.35));
}
.cb-help { margin: 0 0 12px; color: #444; font-size: 0.95rem; }

.cb-board { width: 100%; container-type: inline-size; }

/* ---- Grid ---- */
.cb-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 6px;
	padding: 8px;
	background: var(--cb-black);
	border: 3px solid var(--cb-orange);
}
.cb-cell {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 3px;
	border: 2px solid #2a0000;
	color: #fff;
	font-family: Impact, "Haettenschweiler", "Arial Narrow Bold", "Arial Black", sans-serif;
	font-weight: 900;
	text-transform: uppercase;
	text-align: center;
	line-height: 1.15;
	letter-spacing: 0.11em;
	word-spacing: 0.15em;
	aspect-ratio: 1;
	font-size: 8px;
	font-size: clamp(6px, 2.6cqi, 15px);
	background: linear-gradient(rgba(30, 0, 0, 0.35), rgba(10, 0, 0, 0.6)), var(--cb-bg) center / cover no-repeat;
	cursor: pointer;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.12s ease, filter 0.2s ease;
}
.cb-cell:hover { transform: scale(1.03); }
.cb-cell:focus-visible { outline: 3px solid #ffd900; outline-offset: 1px; }
.cb-text {
	position: relative;
	z-index: 1;
	overflow-wrap: normal;
	word-break: normal;
	/* soft dark halo instead of a hard outline, so letters keep their gaps */
	text-shadow: 0 0 3px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.cb-cell.cb-free,
.cb-cell.cb-free.cb-on {
	cursor: default;
	border-color: var(--cb-orange);
	filter: none;
	background: linear-gradient(rgba(255, 105, 0, 0.45), rgba(120, 30, 0, 0.55)), var(--cb-bg) center / cover no-repeat;
}
.cb-free:hover { transform: none; }

/* Marked square: dim it and stamp an X */
.cb-cell.cb-on { filter: brightness(0.55) saturate(0.8); }
.cb-cell.cb-on::before,
.cb-cell.cb-on::after {
	content: "";
	position: absolute;
	z-index: 2;
	left: 12%;
	right: 12%;
	top: 50%;
	height: 6px;
	margin-top: -3px;
	background: var(--cb-orange);
	border-radius: 3px;
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
}
.cb-cell.cb-on::before { transform: rotate(45deg); }
.cb-cell.cb-on::after { transform: rotate(-45deg); }
.cb-free.cb-on::before,
.cb-free.cb-on::after { display: none; }

.cb-cell.cb-win { filter: none; animation: cb-pulse 1s ease-in-out infinite alternate; border-color: #ffd900; }
.cb-cell.cb-win::before, .cb-cell.cb-win::after { background: #ffd900; }
@keyframes cb-pulse {
	from { box-shadow: 0 0 4px #ffd900; }
	to   { box-shadow: 0 0 16px 3px #ff6900; }
}

/* Phones: use the full screen width so squares are as big as possible */
@media (max-width: 640px) {
	.chad-bingo { padding: 8px 0; }
	.cb-title, .cb-help, .cb-status, .cb-actions { padding-left: 12px; padding-right: 12px; }
	.cb-board { width: 100vw; margin-left: calc(50% - 50vw); }
	.cb-grid { gap: 3px; padding: 4px; border-left-width: 0; border-right-width: 0; }
	.cb-cell { padding: 2px; border-width: 1px; letter-spacing: 0.06em; word-spacing: 0.1em; aspect-ratio: 3 / 5; font-size: 11px; }
}

/* ---- Buttons / status ---- */
.cb-status { margin: 12px 0 8px; font-weight: 700; color: #111; }
.cb-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.cb-btn {
	display: inline-block;
	padding: 12px 20px;
	border: 2px solid var(--cb-orange);
	background: var(--cb-orange);
	color: #000;
	font: inherit;
	font-weight: 800;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	border-radius: 0;
}
.cb-btn:hover { background: #fff; border-color: #fff; color: #000; }
.cb-ghost { background: transparent; color: var(--cb-orange); }
.cb-ghost:hover { background: var(--cb-orange); border-color: var(--cb-orange); color: #000; }
.cb-btn[hidden] { display: none; }

/* ---- Win modal ---- */
.cb-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 12px; }
.cb-modal[hidden] { display: none; }
.cb-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.88); }
.cb-dialog {
	position: relative;
	width: min(460px, 100%);
	max-height: 100%;
	overflow: auto;
	padding: 12px;
	background: var(--cb-black);
	border: 3px solid var(--cb-orange);
	color: #fff;
}
.cb-win-canvas {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto 12px;
	background: #000;
	animation: cb-drop 0.35s ease-out;
}
@keyframes cb-drop { from { transform: scale(1.08) rotate(-1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cb-share { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.cb-share .cb-btn, .cb-dialog .cb-actions .cb-btn { padding: 10px 14px; font-size: 0.85rem; }
.cb-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.cb-confetti span { position: absolute; top: -12px; width: 8px; height: 14px; opacity: 0.9; animation: cb-fall linear infinite; }
@keyframes cb-fall { to { transform: translateY(720px) rotate(540deg); } }

/* camera flash */
.cb-flash { position: fixed; inset: 0; z-index: 100000; background: #fff; pointer-events: none; animation: cb-flash 0.7s ease-out forwards; }
@keyframes cb-flash { 0% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
	.cb-cell.cb-win, .cb-win-canvas { animation: none; }
	.cb-confetti { display: none; }
	.cb-cell { transition: none; }
}
