/*
 * LotoDatos - EuroDreams
 * Archivo: eurodreams.css
 *
 * Objetivo:
 * - Mantener la misma línea visual que La Primitiva.
 * - Usar bolas tipo billar con brillo y centro blanco.
 * - Cambiar la paleta verde grisácea por una paleta violeta grisácea.
 * - Integrarse con las clases generadas por el plugin lotodatos-eurodreams.php.
 */

/* Variables generales de EuroDreams. */
:root {
	--ed-page-bg: #f5f5f7;
	--ed-surface: #ffffff;
	--ed-surface-soft: #fbfbfd;
	--ed-border: rgba(29, 29, 31, 0.08);
	--ed-border-strong: rgba(29, 29, 31, 0.14);
	--ed-text: #1d1d1f;
	--ed-text-soft: #6e6e73;
	--ed-heading: #111111;

	/* Violeta grisáceo principal. */
	--ed-primary: #7b6b92;
	--ed-primary-dark: #5f5273;
	--ed-primary-soft: #eee9f5;
	--ed-primary-focus: rgba(123, 107, 146, 0.18);

	/* Paleta para estados del comprobador. */
	--ed-success-bg: #effaf2;
	--ed-success-border: #b9e4c4;
	--ed-success-text: #1f6d3f;
	--ed-error-bg: #fff3f3;
	--ed-error-border: #f1c1c1;
	--ed-error-text: #9a2d2d;
	--ed-warning-bg: #fff8ec;
	--ed-warning-border: #f0d08f;
	--ed-warning-text: #8b6820;

	/* Sombras y radios reutilizados en todos los bloques. */
	--ed-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
	--ed-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.03);
	--ed-radius: 28px;
	--ed-radius-sm: 18px;
}

/*
 * Contenedor opcional del shortcode completo.
 * Si usas shortcodes separados en Gutenberg, cada tarjeta seguirá teniendo estilo propio.
 */
.ld-eurodreams-page {
	max-width: 1120px;
	margin: 0 auto;
	padding: 28px 0 72px;
	color: var(--ed-text);
}

/*
 * Tarjeta base para todos los shortcodes.
 * Mantiene el estilo limpio y redondeado usado en La Primitiva.
 */
.ld-eurodreams-card {
	width: 100%;
	box-sizing: border-box;
	margin: 0 0 28px;
	padding: 26px;
	background: var(--ed-surface);
	border: 1px solid var(--ed-border);
	border-radius: var(--ed-radius);
	box-shadow: var(--ed-shadow);
	color: var(--ed-text);
}

/* Títulos internos del shortcode, por si no se usa titulo="false". */
.ld-eurodreams-card h2 {
	margin: 0 0 18px;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.08;
	letter-spacing: -0.03em;
	font-weight: 800;
	color: var(--ed-heading);
}

/* Texto introductorio de bloques como comprobador o combinación más repetida. */
.ld-eurodreams-intro {
	margin: 0 0 18px;
	font-size: 16px;
	line-height: 1.7;
	color: var(--ed-text-soft);
}

/* Mensaje usado cuando todavía no hay datos suficientes. */
.ld-eurodreams-empty {
	margin: 0;
	padding: 16px 18px;
	border-radius: var(--ed-radius-sm);
	background: var(--ed-surface-soft);
	border: 1px solid var(--ed-border);
	color: var(--ed-text-soft);
}

/*
 * Combinaciones de números.
 * Este bloque es el que evita que los números aparezcan pegados.
 */
.ld-eurodreams-combination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin: 16px 0;
}

/*
 * Bola principal estilo billar.
 * Se basa en el mismo concepto visual de La Primitiva:
 * - volumen con degradado radial
 * - brillo superior
 * - centro blanco
 */
.ld-eurodreams-ball {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 999px;
	background: radial-gradient(circle at 32% 28%, #fbf9ff 0%, #ede8f5 22%, #d6cce3 52%, #b7a9c9 78%, #9585aa 100%);
	border: 1px solid rgba(89, 76, 107, 0.18);
	color: #1d1d1f;
	font-size: 19px;
	font-weight: 800;
	line-height: 1;
	box-shadow:
		inset 0 -10px 18px rgba(89, 76, 107, 0.16),
		inset 0 8px 12px rgba(255, 255, 255, 0.55),
		0 8px 18px rgba(89, 76, 107, 0.13);
}

/* Brillo superior de la bola. */
.ld-eurodreams-ball::before {
	content: "";
	position: absolute;
	left: 12px;
	top: 9px;
	width: 34%;
	height: 20%;
	border-radius: 999px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.45) 100%);
	transform: rotate(-28deg);
	filter: blur(0.2px);
	z-index: 0;
	pointer-events: none;
}

/* Centro blanco de bola de billar. */
.ld-eurodreams-ball::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 54%;
	height: 54%;
	transform: translate(-50%, -50%);
	border-radius: 999px;
	background: radial-gradient(circle, #ffffff 0%, #fbfbfb 72%, #d9d9d9 100%);
	box-shadow:
		inset 0 2px 3px rgba(255, 255, 255, 0.8),
		inset 0 -2px 4px rgba(0, 0, 0, 0.06);
	z-index: -1;
	pointer-events: none;
}

/*
 * Bola del Sueño.
 * Tiene la misma estructura que las bolas principales, pero con un violeta algo más marcado.
 */
.ld-eurodreams-sueno {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 999px;
	background: radial-gradient(circle at 32% 28%, #fffaff 0%, #eadfff 22%, #cfb9f4 52%, #aa8ad7 78%, #8366aa 100%);
	border: 1px solid rgba(89, 61, 124, 0.22);
	color: #1d1d1f;
	font-size: 19px;
	font-weight: 800;
	line-height: 1;
	box-shadow:
		inset 0 -10px 18px rgba(89, 61, 124, 0.18),
		inset 0 8px 12px rgba(255, 255, 255, 0.55),
		0 8px 18px rgba(96, 70, 128, 0.16);
}

/* Brillo superior de la bola Sueño. */
.ld-eurodreams-sueno::before {
	content: "";
	position: absolute;
	left: 12px;
	top: 9px;
	width: 34%;
	height: 20%;
	border-radius: 999px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.45) 100%);
	transform: rotate(-28deg);
	filter: blur(0.2px);
	z-index: 0;
	pointer-events: none;
}

/* Centro blanco de la bola Sueño. */
.ld-eurodreams-sueno::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 54%;
	height: 54%;
	transform: translate(-50%, -50%);
	border-radius: 999px;
	background: radial-gradient(circle, #ffffff 0%, #fbfbfb 72%, #d9d9d9 100%);
	box-shadow:
		inset 0 2px 3px rgba(255, 255, 255, 0.8),
		inset 0 -2px 4px rgba(0, 0, 0, 0.06);
	z-index: -1;
	pointer-events: none;
}

/* Etiqueta que separa los 6 números principales del Sueño. */
.ld-eurodreams-sueno-separator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 32px;
	padding: 0 10px;
	border-radius: 999px;
	background: var(--ed-primary-soft);
	color: var(--ed-primary-dark);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/*
 * Último sorteo.
 */
.ld-eurodreams-latest {
	text-align: center;
}

.ld-eurodreams-date {
	margin: 0 0 18px;
	font-size: 17px;
	font-weight: 600;
	color: var(--ed-text-soft);
}

/*
 * Listados de frecuencias.
 * Se usan para números más repetidos, menos repetidos y Sueño.
 */
.ld-eurodreams-frequency-list {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.ld-eurodreams-frequency-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 150px;
	padding: 20px 18px;
	border-radius: 22px;
	background: var(--ed-surface);
	border: 1px solid var(--ed-border);
	box-shadow: var(--ed-shadow-soft);
	text-align: center;
}

.ld-eurodreams-frequency-count {
	display: block;
	margin-top: 12px;
	font-size: 14px;
	font-weight: 700;
	color: var(--ed-text-soft);
}

/*
 * Comprobador de combinación.
 */
.ld-eurodreams-checker {
	padding: 26px;
}

.ld-eurodreams-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 18px;
	padding: 24px;
	background: var(--ed-surface);
	border: 1px solid var(--ed-border);
	border-radius: var(--ed-radius);
	box-shadow: var(--ed-shadow-soft);
}

.ld-eurodreams-form-row {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 12px;
}

.ld-eurodreams-input-label {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ld-eurodreams-input-label span {
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ed-text-soft);
}

.ld-eurodreams-input-label input {
	width: 100%;
	box-sizing: border-box;
	height: 54px;
	padding: 12px 14px;
	border: 1px solid var(--ed-border-strong);
	border-radius: 16px;
	background: #ffffff;
	color: var(--ed-heading);
	font-size: 17px;
	font-weight: 800;
	text-align: center;
}

.ld-eurodreams-input-label input:focus {
	outline: none;
	border-color: rgba(123, 107, 146, 0.55);
	box-shadow: 0 0 0 4px var(--ed-primary-focus);
}

.ld-eurodreams-input-sueno input {
	background: #fbf8ff;
	border-color: rgba(123, 107, 146, 0.22);
}

.ld-eurodreams-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(180deg, #e6def0 0%, #cfc1df 55%, #b8a7cb 100%);
	color: #241f2b;
	font-size: 16px;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 10px 20px rgba(111, 91, 134, 0.18);
	transition: background 0.2s ease, transform 0.2s ease;
}

.ld-eurodreams-button:hover {
	background: linear-gradient(180deg, #ded4eb 0%, #c5b5d7 55%, #aa98bf 100%);
	transform: translateY(-1px);
}

/*
 * Resultado del comprobador.
 */
.ld-eurodreams-check-result {
	margin-top: 20px;
}

.ld-eurodreams-searched-combination {
	margin-bottom: 16px;
	padding: 0;
	border-radius: 0;
	background: transparent;
	border: 0;
	font-size: 18px;
	line-height: 1.5;
	color: var(--ed-text);
}

.ld-eurodreams-searched-combination strong {
	display: inline;
	margin-bottom: 0;
	color: var(--ed-heading);
}

.ld-eurodreams-result-ok,
.ld-eurodreams-result-warning {
	margin: 14px 0 20px;
	padding: 16px 18px;
	border-radius: 18px;
	font-size: 16px;
	font-weight: 800;
}

.ld-eurodreams-result-ok {
	background: var(--ed-success-bg);
	border: 1px solid var(--ed-success-border);
	color: var(--ed-success-text);
}

.ld-eurodreams-result-warning {
	background: var(--ed-warning-bg);
	border: 1px solid var(--ed-warning-border);
	color: var(--ed-warning-text);
}

/*
 * Combinación más repetida.
 */
.ld-eurodreams-most-repeated {
	text-align: center;
}

.ld-eurodreams-repeat-count {
	margin: 10px 0 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--ed-text-soft);
}

/*
 * Tablas.
 * Se usan en los últimos sorteos y en los resultados del comprobador.
 */
.ld-eurodreams-table-wrap,
.ld-eurodreams-result-table-wrap {
	overflow-x: auto;
	background: var(--ed-surface);
	border-radius: 26px;
	box-shadow: var(--ed-shadow);
}

.ld-eurodreams-table {
	width: 100%;
	min-width: 680px;
	border-collapse: collapse;
}

.ld-eurodreams-table thead th {
	padding: 18px;
	text-align: center;
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ed-text-soft);
	background: transparent;
	border-bottom: 1px solid var(--ed-border);
}

.ld-eurodreams-table tbody td {
	padding: 18px;
	text-align: center;
	vertical-align: middle;
	font-size: 15px;
	color: var(--ed-text);
	border-bottom: 1px solid rgba(29, 29, 31, 0.06);
}

.ld-eurodreams-table tbody tr:last-child td {
	border-bottom: 0;
}

/* Las combinaciones dentro de tabla se muestran más compactas. */
.ld-eurodreams-table .ld-eurodreams-combination {
	justify-content: center;
	gap: 8px;
	margin: 0;
}

/* Bolas más pequeñas dentro de tablas para mejorar lectura en móvil. */
.ld-eurodreams-table .ld-eurodreams-ball {
	width: 42px;
	height: 42px;
	font-size: 15px;
}

/* Bola Sueño más pequeña dentro de tablas. */
.ld-eurodreams-table .ld-eurodreams-sueno {
	width: 44px;
	height: 44px;
	font-size: 16px;
}

/* En tablas quitamos el brillo superior para que se lea mejor. */
.ld-eurodreams-table .ld-eurodreams-ball::before,
.ld-eurodreams-table .ld-eurodreams-sueno::before {
	display: none;
}

/*
 * Tabla de últimos sorteos.
 */
.ld-eurodreams-recent-table {
	padding: 26px;
}

/*
 * Ajustes para pantallas medianas y grandes.
 */
@media (min-width: 768px) {
	.ld-eurodreams-page {
		padding: 36px 0 84px;
	}

	.ld-eurodreams-frequency-list {
		grid-template-columns: repeat(3, 1fr);
	}
}

/*
 * Ajustes para escritorio ancho.
 */
@media (min-width: 1024px) {
	.ld-eurodreams-latest {
		padding: 32px;
	}
}

/*
 * Ajustes para móvil.
 */
@media (max-width: 767px) {
	.ld-eurodreams-page {
		padding: 22px 0 56px;
	}

	.ld-eurodreams-card {
		margin-bottom: 22px;
		padding: 22px 18px;
		border-radius: 22px;
	}

	.ld-eurodreams-card h2 {
		font-size: clamp(26px, 7vw, 34px);
	}

	.ld-eurodreams-combination {
		gap: 10px;
	}

	.ld-eurodreams-ball,
	.ld-eurodreams-sueno {
		width: 54px;
		height: 54px;
		font-size: 18px;
	}

	.ld-eurodreams-form {
		padding: 18px;
		border-radius: 22px;
	}

	.ld-eurodreams-form-row {
		grid-template-columns: repeat(3, 1fr);
	}

	.ld-eurodreams-input-label input {
		height: 52px;
		font-size: 16px;
	}

	.ld-eurodreams-frequency-list {
		grid-template-columns: 1fr;
	}

	.ld-eurodreams-frequency-item {
		min-height: 138px;
	}

	.ld-eurodreams-table {
		min-width: 640px;
	}

	.ld-eurodreams-table .ld-eurodreams-ball {
		width: 38px;
		height: 38px;
		font-size: 14px;
	}

	.ld-eurodreams-table .ld-eurodreams-sueno {
		width: 40px;
		height: 40px;
		font-size: 15px;
	}
}

/*
 * Ajustes v3 - afinado visual para igualar La Primitiva.
 * 1) En último sorteo, el Sueño pasa al bloque derecho, debajo de la fecha.
 * 2) En últimos sorteos, se quita la caja exterior y se conserva solo la tabla blanca.
 * 3) Se mantienen quitadas las cajas exteriores de comprobador y estadísticas.
 * 4) Cuando una estadística tiene una sola tarjeta, se centra.
 */

/* Comprobador: quitamos la caja grande exterior y dejamos solo el formulario como caja blanca. */
.ld-eurodreams-checker {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
}

.ld-eurodreams-checker .ld-eurodreams-form {
	margin-top: 0;
}

/* Estadísticas: quitamos la caja exterior que contiene las tarjetas internas. */
.ld-eurodreams-stat-card {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
}

/* Si una lista solo tiene una tarjeta, la centramos. Sirve para Sueño más/menos repetido. */
.ld-eurodreams-frequency-list .ld-eurodreams-frequency-item:only-child {
	grid-column: 1 / -1;
	justify-self: center;
	width: min(100%, 420px);
}

/* Último sorteo: estructura tipo La Primitiva, con números a la izquierda y fecha/Sueño a la derecha. */
.ld-eurodreams-latest {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 36px;
	min-height: 168px;
	padding: 32px;
	text-align: left;
}

/* Línea divisoria vertical entre combinación y bloque informativo. */
.ld-eurodreams-latest::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 32px;
	bottom: 32px;
	width: 1px;
	background: var(--ed-border);
}

/* En el último sorteo, la fecha se coloca en la mitad derecha. */
.ld-eurodreams-latest .ld-eurodreams-date {
	position: absolute;
	left: 50%;
	top: 46px;
	width: 50%;
	margin: 0;
	padding: 0 32px;
	box-sizing: border-box;
	text-align: center;
	font-size: 17px;
	font-weight: 800;
	color: var(--ed-heading);
}

/* Etiqueta FECHA como en La Primitiva. */
.ld-eurodreams-latest .ld-eurodreams-date::before {
	content: "FECHA";
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ed-text-soft);
}

/* La combinación de 6 números queda en la mitad izquierda. */
.ld-eurodreams-latest .ld-eurodreams-combination {
	width: calc(50% - 18px);
	margin: 0;
	justify-content: flex-start;
	align-content: center;
	gap: 14px;
}

/* Movemos la etiqueta Sueño al bloque derecho, debajo de la fecha. */
.ld-eurodreams-latest .ld-eurodreams-sueno-separator {
	position: absolute;
	left: 75%;
	top: 106px;
	transform: translateX(-50%);
	background: transparent;
	padding: 0;
	min-height: auto;
	border-radius: 0;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ed-text-soft);
}

/* Movemos la bola del Sueño justo debajo de su etiqueta. */
.ld-eurodreams-latest .ld-eurodreams-sueno {
	position: absolute;
	left: 75%;
	top: 128px;
	transform: translateX(-50%);
}

/* Tabla de últimos sorteos: quitamos la caja exterior y dejamos solo la tabla. */
.ld-eurodreams-recent-table {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
}

.ld-eurodreams-recent-table .ld-eurodreams-table-wrap {
	background: var(--ed-surface);
	border: 1px solid var(--ed-border);
	border-radius: 26px;
	box-shadow: var(--ed-shadow);
}

/* Ajuste responsive para que el último sorteo no se rompa en móvil. */
@media (max-width: 767px) {
	.ld-eurodreams-latest {
		display: block;
		min-height: auto;
		padding: 24px 18px;
		text-align: center;
	}

	.ld-eurodreams-latest::before {
		display: none;
	}

	.ld-eurodreams-latest .ld-eurodreams-date {
		position: static;
		width: 100%;
		padding: 0;
		margin: 0 0 18px;
		text-align: center;
	}

	.ld-eurodreams-latest .ld-eurodreams-combination {
		width: 100%;
		justify-content: center;
	}

	.ld-eurodreams-latest .ld-eurodreams-sueno-separator,
	.ld-eurodreams-latest .ld-eurodreams-sueno {
		position: static;
		left: auto;
		top: auto;
		transform: none;
	}

	.ld-eurodreams-latest .ld-eurodreams-sueno-separator {
		background: var(--ed-primary-soft);
		padding: 0 10px;
		min-height: 32px;
		border-radius: 999px;
		color: var(--ed-primary-dark);
	}
}

/*
 * Ajustes v4 - último sorteo cuadrado dentro de la caja.
 * El bloque derecho aumenta su altura útil para que la etiqueta Sueño
 * y la bola del Sueño queden completamente dentro del panel blanco.
 */
.ld-eurodreams-latest {
	min-height: 214px;
	align-items: center;
}

.ld-eurodreams-latest::before {
	top: 34px;
	bottom: 34px;
}

.ld-eurodreams-latest .ld-eurodreams-date {
	top: 44px;
}

.ld-eurodreams-latest .ld-eurodreams-sueno-separator {
	top: 110px;
}

.ld-eurodreams-latest .ld-eurodreams-sueno {
	top: 132px;
}

@media (max-width: 767px) {
	.ld-eurodreams-latest {
		min-height: auto;
	}
}

/*
 * Ajuste móvil para el bloque "Último sorteo".
 * En móvil evitamos la composición en dos columnas para que no se monte
 * la fecha, el Sueño y las bolas dentro de la tarjeta.
 */
@media (max-width: 767px) {

	/* La tarjeta del último sorteo queda como una caja limpia en una sola columna. */
	.ld-eurodreams-latest {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 18px;
		padding: 24px 16px;
		text-align: center;
		overflow: hidden;
	}

	/* Eliminamos cualquier pseudo-elemento decorativo que pueda estar creando la mancha blanca. */
	.ld-eurodreams-latest::before,
	.ld-eurodreams-latest::after,
	.ld-eurodreams-latest .ld-eurodreams-combination::before,
	.ld-eurodreams-latest .ld-eurodreams-combination::after {
		content: none !important;
		display: none !important;
	}

	/* La fecha queda arriba y centrada. */
	.ld-eurodreams-latest .ld-eurodreams-date {
		order: 1;
		width: 100%;
		margin: 0;
		padding: 0;
		font-size: 15px;
		font-weight: 700;
		line-height: 1.4;
		color: var(--ed-text-soft);
		text-align: center;
	}

	/* La combinación queda debajo de la fecha, centrada y con separación. */
	.ld-eurodreams-latest .ld-eurodreams-combination {
		order: 2;
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		gap: 10px;
		margin: 0;
		padding: 0;
		border: 0;
		background: transparent;
		box-shadow: none;
	}

	/* Bolas algo más pequeñas en móvil para que no se monten. */
	.ld-eurodreams-latest .ld-eurodreams-ball,
	.ld-eurodreams-latest .ld-eurodreams-sueno {
		width: 46px;
		height: 46px;
		font-size: 16px;
		flex: 0 0 auto;
	}

	/* La etiqueta Sueño se mantiene pequeña y centrada entre números y bola. */
	.ld-eurodreams-latest .ld-eurodreams-sueno-separator {
		min-height: 28px;
		padding: 0 10px;
		font-size: 11px;
		flex: 0 0 auto;
	}
}