/* JG Juego Responsable - Cajetilla regulatoria (modal temporal + bloque permanente) */

body.jgjr-popup-open {
	overflow: hidden;
}

/* ── Overlay ───────────────────────────────────────────── */

.jgjr-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.jgjr-popup[hidden],
.jgjr-footer[hidden] {
	display: none;
}

/* ── Botón cerrar (modal, exterior superior derecha) ───── */

.jgjr-close {
	position: absolute;
	bottom: calc(100% + 10px);
	right: -2px;
	width: 36px;
	height: 36px;
	padding: 4px;
	border: 0;
	background: transparent;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	cursor: pointer;
}

.jgjr-close svg {
	display: block;
	width: 26px;
	height: 26px;
}

.jgjr-close:hover {
	opacity: 0.8;
}

.jgjr-close:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}

/* ── Contenedor modal ──────────────────────────────────── */

.jgjr-popup {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 16px;
	box-sizing: border-box;
}

/* ── Caja regulatoria (modal y permanente) ─────────────── */

.jgjr-box,
.regulatory-message {
	--risk-font-size: clamp(18px, 3.2vw, 42px);
	position: relative;
	box-sizing: border-box;
	background: #ffffff;
	color: #000000;
	border: 2px solid #ffffff;
	box-shadow: inset 0 0 0 18px #000000;
	padding: 28px;
	min-width: min(280px, 90vw);
	max-width: min(560px, 90vw);
	min-height: 15vh;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-family: Helvetica, Arial, sans-serif;
	font-weight: 700;
}

.jgjr-box:focus {
	outline: none;
}

/* ── Modal: 15 % del viewport como mínimo ──────────────── */

.jgjr-modal-box {
	min-height: 15vh;
	width: min(560px, 90vw);
}

/* ── Cuenta atrás (cierre automático a los 5 s) ────────── */

.jgjr-countdown {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	width: 100%;
	margin-top: 10px;
}

.jgjr-countdown[hidden] {
	display: none;
}

.jgjr-countdown__track {
	display: block;
	height: 10px;
	border: 2px solid #000000;
	background: #ffffff;
	overflow: hidden;
}

.jgjr-countdown__bar {
	display: block;
	height: 100%;
	background: #000000;
	transform-origin: left center;
	transform: scaleX(1);
}

.jgjr-countdown__text {
	display: block;
	font-size: 14px;
	line-height: 1.2;
	color: #000000;
	font-weight: 700;
}

/* ── Textos ────────────────────────────────────────────── */

.jgjr-message,
.regulatory-message__risk {
	margin: 0 0 6px;
	font-size: var(--risk-font-size);
	font-weight: 700;
	line-height: 1.05;
	color: #000000;
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.jgjr-age,
.jgjr-dgoj,
.regulatory-message__minor,
.regulatory-message__safe-gaming {
	margin: 0;
	font-size: calc(var(--risk-font-size) * 0.6);
	font-weight: 700;
	line-height: 1.1;
	color: #000000;
}

.jgjr-age,
.regulatory-message__minor {
	margin-bottom: 4px;
}

.jgjr-dgoj a,
.regulatory-message__safe-gaming {
	color: #000000;
	text-decoration: underline;
	font-weight: 700;
}

.jgjr-dgoj a:hover,
.jgjr-dgoj a:focus,
.regulatory-message__safe-gaming:hover,
.regulatory-message__safe-gaming:focus {
	color: #000000;
}

.jgjr-dgoj a:focus-visible,
.regulatory-message__safe-gaming:focus-visible {
	outline: 2px solid #000000;
	outline-offset: 2px;
}

/* ── Bloque permanente (cajetilla en footer / IDs) ─────── */

.jgjr-footer {
	display: flex;
	justify-content: center;
	width: 100%;
	padding: 24px 16px;
	box-sizing: border-box;
}

.jgjr-footer .jgjr-box {
	--risk-font-size: clamp(16px, 2.6vw, 18px);
	min-height: 15vh;
	width: 100%;
	max-width: min(560px, 100%);
}

/* ── Accesibilidad ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.jgjr-countdown__bar {
		transition: none !important;
	}
}

/* ── Móvil: caja al 100 % del ancho y 15 % del alto ────── */

@media (max-width: 600px) {
	.jgjr-popup {
		padding: 48px 0 0;
	}

	.jgjr-box,
	.regulatory-message {
		--risk-font-size: clamp(16px, 5.5vw, 28px);
		width: 100%;
		min-width: 100%;
		max-width: 100%;
		min-height: 15vh;
		padding: 28px;
	}

	.jgjr-modal-box {
		width: 100%;
		min-height: calc(100vh - 48px);
		min-height: calc(100dvh - 48px);
		justify-content: center;
	}

	.jgjr-close {
		right: 8px;
	}

	.jgjr-footer {
		padding: 16px 0;
	}
}
