/* =============================================================
   Customer Service Bingo — bingo.css
   Mobile-first. Dark navy / gold / green OEC palette.
   ============================================================= */

:root {
	--bingo-navy:    #1a2332;
	--bingo-navy-lt: #263347;
	--bingo-gold:    #c8971a;
	--bingo-gold-lt: #f0b429;
	--bingo-green:   #2d6a4f;
	--bingo-green-lt:#40916c;
	--bingo-cream:   #f5f0e8;
	--bingo-white:   #ffffff;
	--bingo-red:     #cc2200;
	--bingo-red-bg:  rgba(204,34,0,0.12);
	--bingo-shadow:  0 4px 20px rgba(0,0,0,0.18);
	--bingo-radius:  12px;
	--bingo-radius-sm: 6px;
}

/* --- App shell --- */
#bingo-app {
	position: relative;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: var(--bingo-cream);
	min-height: 100vh;
	color: var(--bingo-navy);
	-webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.bingo-header {
	background: var(--bingo-navy);
	color: var(--bingo-white);
	text-align: center;
	padding: 20px 16px 16px;
}

.bingo-header__logo {
	margin: 0 0 8px;
}

.bingo-header__logo img {
	max-height: 48px;
	max-width: 200px;
	object-fit: contain;
}

.bingo-header__org {
	font-size: 10px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--bingo-gold);
	margin: 0 0 6px;
}

.bingo-header__title {
	font-size: clamp(22px, 5vw, 36px);
	font-weight: 800;
	margin: 0;
	letter-spacing: -0.5px;
}

/* --- Screens (show/hide) --- */
.bingo-screen {
	display: none;
	padding: 24px 16px 40px;
	max-width: 680px;
	margin: 0 auto;
}

.bingo-screen--active {
	display: block;
}

/* --- Card container --- */
.bingo-card {
	background: var(--bingo-white);
	border-radius: var(--bingo-radius);
	box-shadow: var(--bingo-shadow);
	padding: 28px 24px;
}

.bingo-card--center {
	text-align: center;
}

.bingo-card h2 {
	margin: 0 0 8px;
	font-size: clamp(18px, 4vw, 26px);
	font-weight: 700;
	color: var(--bingo-navy);
}

.bingo-card p {
	margin: 0 0 20px;
	color: #555;
	font-size: 15px;
	line-height: 1.5;
}

/* --- Form fields --- */
.bingo-field {
	margin-bottom: 18px;
}

.bingo-field label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 6px;
	color: var(--bingo-navy);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.bingo-field input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	border: 2px solid #ddd;
	border-radius: var(--bingo-radius-sm);
	padding: 12px 14px;
	font-size: 16px; /* 16px prevents iOS zoom */
	color: var(--bingo-navy);
	transition: border-color 0.2s;
	outline: none;
}

.bingo-field input[type="text"]:focus {
	border-color: var(--bingo-green);
}

/* --- Buttons --- */
.bingo-btn {
	display: inline-block;
	background: var(--bingo-green);
	color: var(--bingo-white);
	border: none;
	border-radius: 50px;
	padding: 14px 32px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	letter-spacing: 0.3px;
	width: 100%;
	margin-top: 8px;
	text-align: center;
}

.bingo-btn:hover,
.bingo-btn:focus {
	background: var(--bingo-green-lt);
	outline: none;
}

.bingo-btn:active {
	transform: scale(0.97);
}

.bingo-btn:disabled {
	opacity: 0.45;
	cursor: default;
	transform: none;
}

.bingo-btn--gold {
	background: var(--bingo-gold);
}

.bingo-btn--gold:hover,
.bingo-btn--gold:focus {
	background: var(--bingo-gold-lt);
}

.bingo-btn--sm {
	padding: 10px 24px;
	font-size: 14px;
	width: auto;
	margin-top: 0;
}

/* --- Timer / Start button top area --- */
#bingo-qs-top {
	margin-bottom: 20px;
}

.bingo-btn--start-timer {
	width: 100%;
	padding: 14px;
	font-size: 17px;
}

.bingo-timer-wrap {
	margin-bottom: 0;
}

.bingo-timer-bar-bg {
	background: #e8e8e8;
	border-radius: 4px;
	height: 8px;
	overflow: hidden;
	margin-bottom: 8px;
}

.bingo-timer-bar-fill {
	height: 100%;
	background: var(--bingo-green);
	width: 100%;
	border-radius: 4px;
	transition: width 0.9s linear, background 0.3s;
}

.bingo-timer-display {
	font-size: 32px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--bingo-navy);
	text-align: center;
	letter-spacing: 2px;
	transition: color 0.3s;
}

.bingo-timer--urgent {
	color: var(--bingo-red);
	animation: bingo-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes bingo-pulse {
	from { opacity: 1; }
	to   { opacity: 0.5; }
}

/* --- Section progress indicator --- */
.bingo-section-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.bingo-section-meta h2 {
	margin: 0;
	font-size: 18px;
}

.bingo-section-dots {
	display: flex;
	gap: 6px;
}

.bingo-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #ddd;
}

.bingo-dot--done {
	background: var(--bingo-green);
}

.bingo-dot--active {
	background: var(--bingo-gold);
}

/* --- Question cards --- */
.bingo-qs-cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.bingo-qcard {
	background: var(--bingo-cream);
	border-radius: var(--bingo-radius-sm);
	padding: 14px 16px;
}

.bingo-qcard__label {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: var(--bingo-navy);
	margin-bottom: 8px;
	line-height: 1.4;
}

.bingo-qcard__input {
	width: 100%;
	box-sizing: border-box;
	border: 2px solid #ddd;
	border-radius: var(--bingo-radius-sm);
	padding: 10px 12px;
	font-size: 15px;
	color: var(--bingo-navy);
	background: var(--bingo-white);
	outline: none;
	transition: border-color 0.2s;
}

.bingo-qcard__input:focus {
	border-color: var(--bingo-green);
}

.bingo-qcard__input:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	background: #f0f0f0;
}

/* --- Lock hint --- */
.bingo-lock-hint {
	font-size: 13px;
	color: #888;
	text-align: center;
	margin: 0 0 14px;
	font-style: italic;
}

.bingo-lock-hint--hidden {
	display: none;
}

/* --- Multiple choice --- */
.bingo-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bingo-choice {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: var(--bingo-white);
	border: 2px solid #ddd;
	border-radius: var(--bingo-radius-sm);
	cursor: pointer;
	font-size: 15px;
	transition: border-color 0.2s, background 0.2s;
	user-select: none;
}

.bingo-choice input[type="radio"] {
	accent-color: var(--bingo-green);
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	cursor: pointer;
}

.bingo-choice:has(input:checked) {
	border-color: var(--bingo-green);
	background: #f0f8f4;
}

.bingo-choice:has(input:disabled) {
	opacity: 0.4;
	cursor: not-allowed;
}

/* --- Ready screen --- */
.bingo-ready-icon {
	font-size: 56px;
	line-height: 1;
	margin-bottom: 12px;
}

/* --- Board screen --- */
#bingo-screen-board {
	padding: 16px 8px 40px;
	max-width: 100%;
}

/* BINGO column header */
.bingo-board-header {
	max-width: 540px;
	margin: 0 auto 0;
}

.bingo-board-bingo {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 4px;
	padding: 0 0 4px;
}

.bingo-board-bingo span {
	background: var(--bingo-navy);
	color: var(--bingo-gold);
	font-size: clamp(16px, 4vw, 28px);
	font-weight: 900;
	text-align: center;
	padding: 10px 4px;
	border-radius: var(--bingo-radius-sm) var(--bingo-radius-sm) 0 0;
}

/* Board grid */
.bingo-board-wrap {
	max-width: 540px;
	margin: 0 auto;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.bingo-board-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 4px;
	min-width: 280px;
}

/* Individual square */
.bingo-square {
	position: relative;
	background: var(--bingo-navy);
	color: var(--bingo-white);
	border-radius: var(--bingo-radius-sm);
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 6px 4px;
	box-sizing: border-box;
	cursor: pointer;
	overflow: hidden;
	transition: background 0.15s, transform 0.1s;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.bingo-square:hover {
	background: var(--bingo-navy-lt);
	transform: scale(1.03);
	z-index: 2;
}

.bingo-square:active {
	transform: scale(0.97);
}

/* FREE SPACE */
.bingo-square--free {
	background: var(--bingo-gold);
	color: var(--bingo-navy);
	cursor: default;
}

.bingo-square--free:hover {
	background: var(--bingo-gold);
	transform: none;
}

/* Unanswered square — cannot be clicked */
.bingo-square--empty {
	cursor: not-allowed;
	opacity: 0.45;
}

/* Autoplay caller banner */
.bingo-caller {
	background: var(--bingo-navy);
	color: var(--bingo-white);
	padding: 12px 16px 10px;
	margin-bottom: 8px;
	border-radius: var(--bingo-radius-sm);
}

.bingo-caller__label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: var(--bingo-gold);
	margin-bottom: 5px;
}

.bingo-caller__question {
	font-size: clamp(15px, 3vw, 20px);
	font-weight: 700;
	line-height: 1.3;
	margin-bottom: 10px;
}

.bingo-caller__bar-bg {
	background: rgba(255,255,255,0.15);
	border-radius: 3px;
	height: 5px;
	overflow: hidden;
}

.bingo-caller__bar-fill {
	height: 100%;
	background: var(--bingo-gold);
	width: 100%;
	transition: width 0.9s linear;
}


/* Bombed square (autoplay) — permanent red X */
.bingo-square--bombed {
	cursor: not-allowed;
	opacity: 0.5;
}


/* Called-square flash animation */
@keyframes bingo-called-flash {
	0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(200, 151, 26, 0); }
	50%       { opacity: 0.3; box-shadow: 0 0 12px 4px rgba(200, 151, 26, 0.8); }
}

.bingo-square--flash {
	animation: bingo-called-flash 0.45s ease-in-out 3;
}

.bingo-square--bombed::before,
.bingo-square--bombed::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		135deg,
		transparent 42%,
		var(--bingo-red) 42%,
		var(--bingo-red) 58%,
		transparent 58%
	);
}

.bingo-square--bombed::after {
	background: linear-gradient(
		-135deg,
		transparent 42%,
		var(--bingo-red) 42%,
		var(--bingo-red) 58%,
		transparent 58%
	);
}

/* Scramble animation — brief pop on moved squares */
.bingo-board--scrambling .bingo-square:not(.bingo-square--marked):not(.bingo-square--free) {
	animation: bingo-scramble-pop 0.35s ease-out;
}

@keyframes bingo-scramble-pop {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.08); }
	100% { transform: scale(1); }
}


/* Called by facilitator — pulse gold border to alert player */
.bingo-square--called:not(.bingo-square--marked) {
	box-shadow: 0 0 0 3px var(--bingo-gold);
	animation: bingo-called-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes bingo-called-pulse {
	from { box-shadow: 0 0 0 3px var(--bingo-gold); }
	to   { box-shadow: 0 0 0 8px rgba(200,151,26,0.4); }
}

/* Current called square — full background flash */
@keyframes bingo-blink-current {
	0%, 100% {
		background: var(--bingo-navy);
		color: var(--bingo-gold);
		box-shadow: none;
	}
	50% {
		background: var(--bingo-gold);
		color: var(--bingo-navy);
		box-shadow: 0 0 20px 6px rgba(200, 151, 26, 0.8);
	}
}

.bingo-square.bingo-square--blink-current {
	animation: bingo-blink-current 0.8s ease-in-out infinite;
}

.bingo-square--empty:hover {
	background: var(--bingo-navy);
	transform: none;
}

/* Question text inside square */
.bingo-square__q {
	font-size: clamp(7px, 1.5vw, 11px);
	font-weight: 700;
	text-align: center;
	line-height: 1.25;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	text-overflow: ellipsis;
	width: 100%;
	word-break: break-word;
}

/* Answer text inside square */
.bingo-square__a {
	font-size: clamp(6px, 1.2vw, 9px);
	color: rgba(255,255,255,0.65);
	text-align: center;
	margin-top: 3px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	width: 100%;
	font-style: italic;
}

.bingo-square--free .bingo-square__a {
	color: var(--bingo-navy);
	font-style: normal;
	font-size: 18px;
}

/* MARKED — red diagonal slash */
.bingo-square--marked::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		135deg,
		transparent calc(50% - 2px),
		var(--bingo-red) calc(50% - 2px),
		var(--bingo-red) calc(50% + 2px),
		transparent calc(50% + 2px)
	);
	pointer-events: none;
	z-index: 3;
}

.bingo-square--marked {
	background: var(--bingo-red-bg);
}

.bingo-square--free.bingo-square--marked {
	background: var(--bingo-gold);
}

/* Board footer */
.bingo-board-footer {
	max-width: 540px;
	margin: 12px auto 0;
	text-align: center;
}

#bingo-start-calling-wrap {
	max-width: 540px;
	margin: 0 auto;
	padding: 0 0 10px;
}

#bingo-start-calling-wrap #bingo-start-calling {
	width: 100%;
	box-sizing: border-box;
}

/* --- Tooltip --- */
.bingo-tooltip {
	position: absolute;
	background: var(--bingo-navy);
	color: var(--bingo-white);
	padding: 10px 14px;
	border-radius: var(--bingo-radius-sm);
	font-size: 13px;
	line-height: 1.45;
	max-width: 220px;
	box-shadow: var(--bingo-shadow);
	pointer-events: none;
	opacity: 0;
	z-index: 100;
	transition: opacity 0.15s;
	word-break: break-word;
}

.bingo-tooltip--visible {
	opacity: 1;
}

.bingo-tooltip strong {
	display: block;
	margin-bottom: 4px;
	color: var(--bingo-gold);
}

/* --- Bingo modal --- */
.bingo-modal {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.65);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.bingo-modal--visible {
	display: flex;
}

.bingo-modal__box {
	background: var(--bingo-white);
	border-radius: var(--bingo-radius);
	padding: 40px 32px;
	text-align: center;
	max-width: 340px;
	width: 90%;
	box-shadow: var(--bingo-shadow);
	animation: bingo-pop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes bingo-pop {
	from { transform: scale(0.6); opacity: 0; }
	to   { transform: scale(1);   opacity: 1; }
}

.bingo-modal__icon {
	font-size: 64px;
	line-height: 1;
	margin-bottom: 12px;
}

.bingo-modal__box h2 {
	font-size: 42px;
	font-weight: 900;
	color: var(--bingo-gold);
	margin: 0 0 8px;
	letter-spacing: 4px;
}

.bingo-modal__box p {
	font-size: 16px;
	color: #555;
	margin: 0 0 24px;
}

/* --- Responsive adjustments --- */
@media (min-width: 480px) {
	.bingo-board-bingo span {
		font-size: 24px;
	}

	.bingo-square__q {
		font-size: 10px;
	}

	.bingo-square__a {
		font-size: 8px;
	}
}

@media (min-width: 600px) {
	.bingo-square__q {
		font-size: 12px;
	}

	.bingo-square__a {
		font-size: 10px;
	}

	.bingo-board-bingo span {
		font-size: 28px;
		padding: 12px 4px;
	}
}

@media (min-width: 768px) {
	.bingo-screen {
		padding: 32px 24px 48px;
	}

	.bingo-square {
		padding: 8px 6px;
	}

	.bingo-square__q {
		font-size: 13px;
	}

	.bingo-square__a {
		font-size: 11px;
	}
}

/* --- Email status bar --- */
.bingo-email-status {
	text-align: center;
	font-size: 13px;
	padding: 6px 12px;
	min-height: 24px;
	transition: color 0.3s;
	color: #888;
}

.bingo-email-status--sending {
	color: var(--bingo-navy);
}

.bingo-email-status--ok {
	color: var(--bingo-green);
	font-weight: 600;
}

.bingo-email-status--error {
	color: var(--bingo-red);
}

/* --- Print header (hidden on screen, visible on print) --- */
.bingo-print-header {
	display: none;
}

/* --- Print button style --- */
.bingo-btn--print {
	background: var(--bingo-navy);
	margin-left: 8px;
}

.bingo-btn--print:hover,
.bingo-btn--print:focus {
	background: var(--bingo-navy-lt);
}

.bingo-board-footer {
	display: flex;
	gap: 8px;
	justify-content: center;
	flex-wrap: wrap;
}


/* =============================================================
   Print styles
   ============================================================= */

@page { size: A4 portrait; margin: 1cm; }

@media print {

	/* Hide everything except the board screen */
	.bingo-header,
	#bingo-screen-registration,
	#bingo-screen-questions,
	#bingo-screen-ready,
	.bingo-board-footer,
	.bingo-email-status,
	#bingo-tooltip,
	#bingo-modal {
		display: none !important;
	}

	/* Page setup */
	@page {
		size: letter landscape;
		margin: 0.5in;
	}

	body,
	#bingo-app {
		background: #fff !important;
		min-height: 0;
	}

	/* Board screen fills the page */
	#bingo-screen-board {
		display: block !important;
		padding: 0;
		max-width: 100%;
	}

	/* Print header */
	.bingo-print-header {
		display: block !important;
		text-align: center;
		margin-bottom: 10pt;
		font-family: Georgia, serif;
		border-bottom: 2pt solid #1a2332;
		padding-bottom: 8pt;
	}

	.bingo-print-header h2 {
		font-size: 20pt;
		margin: 0 0 4pt;
		color: #1a2332;
		letter-spacing: 1px;
	}

	.bingo-print-header p {
		font-size: 10pt;
		color: #444;
		margin: 0;
	}

	/* BINGO column headers */
	.bingo-board-header {
		max-width: 100%;
		margin: 0;
	}

	.bingo-board-bingo {
		gap: 2pt;
		padding-bottom: 2pt;
	}

	.bingo-board-bingo span {
		background: #1a2332 !important;
		color: #c8971a !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		font-size: 18pt;
		padding: 8pt 4pt;
		border-radius: 0;
	}

	/* Board grid */
	.bingo-board-wrap {
		overflow: visible;
	}

	.bingo-board-grid {
		gap: 2pt;
		min-width: 0;
	}

	/* Squares */
	.bingo-square {
		aspect-ratio: auto;
		height: 1.4in;
		background: #1a2332 !important;
		color: #fff !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
		border-radius: 3pt;
		padding: 6pt 4pt;
		cursor: default;
		transform: none !important;
		page-break-inside: avoid;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	/* FREE space */
	.bingo-square--free {
		background: #c8971a !important;
		color: #1a2332 !important;
	}

	/* Unanswered squares — slightly dimmed */
	.bingo-square--empty {
		opacity: 0.6 !important;
	}

	/* Question text — show fully, no clamping */
	.bingo-square__q {
		font-size: 7pt;
		overflow: visible;
		display: block;
		-webkit-line-clamp: unset;
		white-space: normal;
		line-height: 1.3;
	}

	/* Answer text — show fully */
	.bingo-square__a {
		font-size: 6.5pt;
		color: rgba(255,255,255,0.75) !important;
		white-space: normal;
		overflow: visible;
		margin-top: 4pt;
		font-style: italic;
		line-height: 1.3;
	}

	.bingo-square--free .bingo-square__a {
		color: #1a2332 !important;
	}

	/* Marked squares — show slash in print */
	.bingo-square--marked::after {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}

