:root {
	--bg-drawn-bg: #000;
	--bg-drawn-fg: #fff;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	background: #f4f4f4;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: #111;
}

.bg-loading,
.bg-end-screen {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	text-align: center;
	padding: 24px;
}

/* Vue spectateur (?bingo_view=) */

.bg-view {
	max-width: 520px;
	margin: 0 auto;
	padding-bottom: 40px;
}

.bg-banner {
	padding: 16px 20px;
	background: #111;
	color: #fff;
	text-align: center;
	position: sticky;
	top: 0;
	z-index: 5;
}

.bg-banner-round {
	font-size: 1.3em;
	font-weight: 700;
}

.bg-view-live-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #e63946;
	margin-right: 4px;
	animation: bg-pulse 1.4s ease-in-out infinite;
}

@keyframes bg-pulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.25;
	}
}

.bg-view-circle-wrap {
	width: 140px;
	height: 140px;
	margin: 24px auto;
	position: relative;
}

.bg-circle {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--bg-drawn-bg);
	color: var(--bg-drawn-fg);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 56px;
	font-weight: 800;
}

.bg-grid-wrap {
	padding: 0 16px;
	display: flex;
	justify-content: center;
}

.bg-grid {
	display: grid;
	grid-template-columns: repeat(10, 1fr);
	grid-template-rows: repeat(10, 1fr);
	gap: 4px;
	width: 100%;
	max-width: 460px;
	aspect-ratio: 1 / 1;
}

.bg-number {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1.5px solid #111;
	background: transparent;
	color: #111;
	font-weight: 700;
	font-size: inherit;
}

.bg-number.is-drawn {
	background: var(--bg-drawn-bg);
	color: var(--bg-drawn-fg);
	border-color: var(--bg-drawn-bg);
}

.bg-view-prizes {
	padding: 24px 16px 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.bg-view-prize {
	border: 1px solid #ddd;
	border-radius: 10px;
	padding: 12px 14px;
	background: #fff;
}

.bg-view-prize.is-won {
	border-color: #2a9d8f;
	background: #eafaf7;
}

.bg-view-prize.is-current {
	border-color: #a3002b;
}

.bg-view-prize-label {
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #777;
	margin-bottom: 4px;
}

.bg-view-prize-title {
	font-weight: 700;
	font-size: 1.05em;
}

.bg-view-badge {
	display: inline-block;
	font-size: 0.75em;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	background: #2a9d8f;
	color: #fff;
	vertical-align: middle;
}

.bg-view-badge-live {
	background: #a3002b;
}

.bg-view-articles {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	font-size: 0.95em;
	color: #333;
}

.bg-view-articles li {
	padding: 3px 0;
}

.bg-view-articles img {
	max-height: 26px;
	max-width: 90px;
	object-fit: contain;
	vertical-align: middle;
	margin-left: 6px;
}

.bg-view-noarticle {
	margin: 8px 0 0;
	font-size: 0.9em;
	color: #777;
}

.bg-view-amount {
	margin: 8px 0 0;
	font-size: 0.9em;
	font-weight: 700;
	color: #a3002b;
}

.bg-logo-clickable {
	cursor: pointer;
}

.bg-lightbox-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 200;
	cursor: pointer;
}

.bg-lightbox-img {
	/* Boîte de taille fixe (pas juste max-width/max-height) + object-fit :
	   agrandit aussi les petits logos sources, pas seulement les grands. */
	width: min(85vw, 600px);
	height: min(85vh, 600px);
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
	padding: 16px;
}

.bg-lightbox-close {
	position: fixed;
	top: 16px;
	right: 24px;
	font-size: 2.5em;
	line-height: 1;
	background: transparent;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 0 8px;
}

.bg-view-controls {
	padding: 24px 16px 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bg-view-controls label {
	font-size: 0.9em;
	font-weight: 600;
}

.bg-view-controls select {
	font-size: 1em;
	padding: 10px;
	border-radius: 6px;
	border: 1px solid #bbb;
	background: #fff;
}

.bg-btn {
	font-size: 1em;
	padding: 12px 16px;
	border-radius: 6px;
	border: none;
	background: #1d2327;
	color: #fff;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	display: block;
}

.bg-btn-secondary {
	background: transparent;
	border: 2px solid #1d2327;
	color: #1d2327;
}

/* Déroulé complet (?bingo_program=) */

.bg-program {
	max-width: 640px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}

.bg-program-header {
	text-align: center;
	margin-bottom: 28px;
}

.bg-program-header h1 {
	font-size: 1.5em;
	margin: 0 0 4px;
}

.bg-program-actions {
	margin-top: 16px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}

.bg-program-actions .bg-btn {
	display: inline-block;
	padding: 10px 22px;
}

.bg-program-round {
	margin-bottom: 28px;
}

.bg-program-round .bg-view-prize {
	margin-bottom: 14px;
}

.bg-program-round .bg-view-prize:last-child {
	margin-bottom: 0;
}

.bg-program-round-title {
	font-size: 1.2em;
	font-weight: 700;
	padding-bottom: 8px;
	border-bottom: 2px solid #111;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
