/* =========================================================
   Jornada virtual FAB - nuevo diseño
   ========================================================= */

:root {
	--naranja: #ff5722;
	--naranja-suave: rgba(255, 87, 34, 0.12);
	--rojo-live: #ef233c;
	--verde: #16a34a;

	--hero-bg: #0b1324;
	--hero-bg-2: #16213d;
	--hero-texto: #ffffff;
	--hero-texto-2: #9aa7c2;

	--bg: #eef1f6;
	--card: #ffffff;
	--card-2: #f6f8fb;
	--borde: #e3e8f0;
	--texto: #0f172a;
	--texto-2: #5b6578;
	--texto-3: #94a0b4;
	--sombra: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
	--sombra-hover: 0 2px 4px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(15, 23, 42, 0.12);

	--radio: 16px;
	--fuente: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--fuente-display: 'Barlow Condensed', 'Inter', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0a0f1c;
		--card: #131b2e;
		--card-2: #1a2440;
		--borde: #24304d;
		--texto: #eef2f8;
		--texto-2: #a3aec4;
		--texto-3: #6b7894;
		--naranja-suave: rgba(255, 87, 34, 0.18);
		--sombra: 0 1px 2px rgba(0, 0, 0, 0.3);
		--sombra-hover: 0 8px 24px rgba(0, 0, 0, 0.45);
		--hero-bg: #060a14;
		--hero-bg-2: #111a30;
	}
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--fuente);
	background: var(--bg);
	color: var(--texto);
	-webkit-font-smoothing: antialiased;
}

body.sin-scroll { overflow: hidden; }

button { font-family: inherit; }

/* ---------- Cabecera ---------- */
.hero {
	background:
		radial-gradient(circle at 85% -20%, rgba(255, 87, 34, 0.35), transparent 45%),
		linear-gradient(135deg, var(--hero-bg) 0%, var(--hero-bg-2) 100%);
	color: var(--hero-texto);
	padding: 20px 16px 22px;
}

.hero-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

.brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.brand-logo {
	background: #fff;
	border-radius: 14px;
	padding: 6px 10px;
	display: flex;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.brand-logo img {
	height: 46px;
	display: block;
}

.brand-kicker {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hero-texto-2);
	font-weight: 600;
}

.brand h1 {
	margin: 2px 0 0;
	font-family: var(--fuente-display);
	font-size: 32px;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	line-height: 1;
}

.semana {
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.07);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 999px;
	padding: 5px;
}

.semana-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	cursor: pointer;
	font-size: 14px;
	transition: background 0.2s, transform 0.1s;
}

.semana-btn:hover:not(:disabled) { background: var(--naranja); }
.semana-btn:disabled { opacity: 0.35; cursor: default; }
.semana-btn:active { transform: scale(0.94); }

.semana-texto {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 150px;
	padding: 0 6px;
}

.semana-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--naranja);
	font-weight: 700;
}

.semana-fechas {
	font-family: var(--fuente-display);
	font-size: 21px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

/* ---------- Filtros ---------- */
.filtros {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(160%) blur(12px);
	-webkit-backdrop-filter: saturate(160%) blur(12px);
	border-bottom: 1px solid var(--borde);
}

.filtros-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 12px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 2px;
	margin: -2px;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
	flex-shrink: 0;
	border: 1px solid var(--borde);
	background: var(--card);
	color: var(--texto-2);
	font-size: 14px;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: 999px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	transition: all 0.15s;
}

.chip:hover {
	border-color: var(--texto-3);
	color: var(--texto);
}

.chip.seleccionada {
	background: var(--texto);
	border-color: var(--texto);
	color: var(--bg);
}

.chip-live { color: var(--rojo-live); }

.chip-live .dot { background: var(--rojo-live); }

.chip.seleccionadaLive {
	background: var(--rojo-live);
	border-color: var(--rojo-live);
	color: #fff;
}

.chip.seleccionadaLive .dot { background: #fff; }

.live-countdown {
	margin-left: 6px;
	font-variant-numeric: tabular-nums;
	opacity: 0.85;
}

.live-countdown:empty { display: none; }

.filtros-fila {
	display: flex;
	gap: 10px;
}

.select-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
}

.select-wrap > i {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	color: var(--texto-3);
	pointer-events: none;
	font-size: 14px;
}

.select-wrap > i:first-child { left: 14px; }
.select-wrap .select-caret { right: 14px; font-size: 12px; }

.select-wrap select {
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--texto);
	background: var(--card);
	border: 1px solid var(--borde);
	border-radius: 12px;
	padding: 11px 38px 11px 40px;
	cursor: pointer;
	text-overflow: ellipsis;
}

.select-wrap select:focus {
	outline: none;
	border-color: var(--naranja);
	box-shadow: 0 0 0 3px var(--naranja-suave);
}

.select-wrap option {
	color: #0f172a;
	background: #fff;
}

.btn-amistosos {
	flex-shrink: 0;
	border: 1px solid var(--borde);
	background: var(--card);
	color: var(--texto);
	font-size: 14px;
	font-weight: 600;
	border-radius: 12px;
	padding: 0 16px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: all 0.15s;
}

.btn-amistosos i { color: var(--naranja); }

.btn-amistosos:hover {
	border-color: var(--naranja);
	background: var(--naranja-suave);
}

/* ---------- Contenido ---------- */
.main-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px 16px 8px;
	min-height: 50vh;
}

.grupo {
	margin-bottom: 32px;
	animation: aparecer 0.35s ease both;
}

.grupo-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
	padding-left: 12px;
	border-left: 4px solid var(--naranja);
}

.grupo-titulo {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.grupo-titulo h2 {
	margin: 0;
	font-family: var(--fuente-display);
	font-size: 24px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	line-height: 1.1;
}

.grupo-badge {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--naranja);
	background: var(--naranja-suave);
	padding: 4px 10px;
	border-radius: 999px;
}

.grupo-acciones {
	display: flex;
	gap: 8px;
}

.btn-ghost {
	border: 1px solid var(--borde);
	background: var(--card);
	color: var(--texto-2);
	font-size: 13px;
	font-weight: 600;
	padding: 7px 12px;
	border-radius: 10px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all 0.15s;
}

.btn-ghost:hover {
	color: var(--texto);
	border-color: var(--texto);
}

.partidos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 14px;
}

/* ---------- Tarjeta de partido ---------- */
.partido {
	background: var(--card);
	border: 1px solid var(--borde);
	border-radius: var(--radio);
	box-shadow: var(--sombra);
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: relative;
	overflow: hidden;
	transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.partido.clicable { cursor: pointer; }

.partido.clicable:hover {
	transform: translateY(-2px);
	box-shadow: var(--sombra-hover);
	border-color: var(--texto-3);
}

.partido.estado-live {
	border-color: rgba(239, 35, 60, 0.45);
}

.partido.estado-live::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: linear-gradient(90deg, var(--rojo-live), var(--naranja));
}

.partido.estado-suspendido { opacity: 0.75; }

.partido-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 28px;
}

.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 5px 10px;
	border-radius: 999px;
}

.badge-live {
	background: var(--rojo-live);
	color: #fff;
}

.badge-final {
	background: var(--card-2);
	color: var(--texto-2);
}

.badge-suspendido {
	background: rgba(239, 35, 60, 0.12);
	color: var(--rojo-live);
}

.badge-pendiente {
	background: var(--naranja-suave);
	color: var(--naranja);
}

.dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #fff;
	animation: latido 1.4s ease-in-out infinite;
}

.reloj, .hora {
	font-family: var(--fuente-display);
	font-size: 20px;
	font-weight: 700;
	color: var(--rojo-live);
	font-variant-numeric: tabular-nums;
}

.hora { color: var(--texto); }

.btn-acta {
	border: none;
	background: transparent;
	color: var(--texto-2);
	font-size: 13px;
	font-weight: 600;
	padding: 5px 8px;
	border-radius: 8px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.btn-acta:hover {
	background: var(--naranja-suave);
	color: var(--naranja);
}

.equipos {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.equipo {
	display: grid;
	grid-template-columns: 44px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 6px 0;
}

.escudo {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--borde);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
}

.escudo img {
	width: 80%;
	height: 80%;
	object-fit: contain;
}

.equipo-nombre {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.marcador {
	font-family: var(--fuente-display);
	font-size: 34px;
	font-weight: 800;
	line-height: 1;
	min-width: 48px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.estado-live .marcador { color: var(--rojo-live); }
.estado-pendiente .marcador { color: var(--texto-3); }

.equipo.perdedor .equipo-nombre,
.equipo.perdedor .marcador {
	color: var(--texto-3);
	font-weight: 600;
}

.equipo.ganador .marcador { color: var(--texto); }

.equipo.ganador .equipo-nombre::after {
	content: "";
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 8px;
	vertical-align: middle;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-right: 6px solid var(--naranja);
}

.partido-bottom {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding-top: 10px;
	border-top: 1px dashed var(--borde);
	font-size: 13px;
	color: var(--texto-2);
}

.pista {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pista i { color: var(--naranja); margin-right: 2px; }

.fecha {
	flex-shrink: 0;
	font-variant-numeric: tabular-nums;
}

/* ---------- Máximos anotadores ---------- */
.anotadores {
	margin-top: 16px;
	background: linear-gradient(135deg, var(--hero-bg) 0%, var(--hero-bg-2) 100%);
	border-radius: var(--radio);
	padding: 16px;
	color: #fff;
}

.anotadores-titulo {
	font-family: var(--fuente-display);
	font-size: 18px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 12px;
}

.anotadores-titulo i { color: var(--naranja); }

.anotadores-lista {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 10px;
}

.anotador {
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 12px;
	padding: 10px 12px;
	color: #fff;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s, transform 0.15s;
}

.anotador:hover {
	background: rgba(255, 255, 255, 0.12);
	transform: translateY(-1px);
}

.anotador-puesto {
	font-family: var(--fuente-display);
	font-size: 22px;
	font-weight: 800;
	width: 18px;
	text-align: center;
	color: var(--hero-texto-2);
}

.puesto-1 .anotador-puesto { color: #fbbf24; }
.puesto-2 .anotador-puesto { color: #cbd5e1; }
.puesto-3 .anotador-puesto { color: #d97706; }

.anotador-logo {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #fff;
	object-fit: contain;
	padding: 4px;
	flex-shrink: 0;
}

.anotador-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.anotador-nombre {
	font-weight: 700;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.anotador-dorsal {
	font-size: 12px;
	color: var(--hero-texto-2);
}

.anotador-puntos {
	font-family: var(--fuente-display);
	font-size: 28px;
	font-weight: 800;
	color: var(--naranja);
	line-height: 1;
	display: flex;
	align-items: baseline;
	gap: 3px;
}

.anotador-puntos small {
	font-family: var(--fuente);
	font-size: 11px;
	font-weight: 600;
	color: var(--hero-texto-2);
}

/* ---------- Vacío / skeleton ---------- */
.vacio {
	text-align: center;
	padding: 60px 20px;
	color: var(--texto-2);
}

.vacio i {
	font-size: 44px;
	color: var(--naranja);
	opacity: 0.7;
}

.vacio p {
	font-size: 16px;
	margin-top: 14px;
}

.skeleton { cursor: default; }

.sk {
	border-radius: 8px;
	background: linear-gradient(90deg, var(--card-2) 25%, var(--borde) 50%, var(--card-2) 75%);
	background-size: 200% 100%;
	animation: brillo 1.2s linear infinite;
}

.sk-titulo { height: 26px; width: 220px; margin-bottom: 14px; }
.sk-linea { height: 22px; width: 90px; }
.sk-equipo { height: 44px; }

/* ---------- Pie ---------- */
.pie {
	text-align: center;
	padding: 18px 16px 28px;
}

.link-aviso {
	border: none;
	background: none;
	color: var(--texto-3);
	font-size: 12px;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.link-aviso:hover { color: var(--texto-2); }

/* ---------- Modales ---------- */
.modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(6, 10, 20, 0.6);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.modal-overlay.abierto { display: flex; }

.modal-card {
	position: relative;
	background: var(--card);
	color: var(--texto);
	border-radius: 20px;
	width: 100%;
	max-width: 440px;
	max-height: 88vh;
	overflow-y: auto;
	padding: 24px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
	animation: subir 0.25s ease both;
}

.modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	background: var(--card-2);
	color: var(--texto-2);
	cursor: pointer;
	font-size: 15px;
}

.modal-close:hover { color: var(--texto); }

.modal-aviso { max-width: 560px; }

.modal-aviso h3 {
	margin: 0 30px 14px 0;
	font-size: 17px;
}

.modal-aviso p {
	font-size: 14px;
	line-height: 1.65;
	color: var(--texto-2);
	margin: 0 0 10px;
}

.player-modal { padding: 0; overflow: hidden; }

.player-modal .modal-close {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

.player-modal-head {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 28px 22px 22px;
	background:
		radial-gradient(circle at 100% 0%, rgba(255, 87, 34, 0.4), transparent 55%),
		linear-gradient(135deg, var(--hero-bg) 0%, var(--hero-bg-2) 100%);
	color: #fff;
}

.escudo-lg {
	width: 64px;
	height: 64px;
	border: none;
}

.player-modal-info { flex: 1; min-width: 0; }

.player-modal-info h3 {
	margin: 0;
	font-size: 20px;
	line-height: 1.2;
}

.player-modal-dorsal {
	font-family: var(--fuente-display);
	font-size: 18px;
	font-weight: 700;
	color: var(--hero-texto-2);
}

.player-modal-puntos {
	display: flex;
	flex-direction: column;
	align-items: center;
	font-family: var(--fuente-display);
	font-size: 44px;
	font-weight: 800;
	line-height: 1;
	color: var(--naranja);
}

.player-modal-puntos small {
	font-family: var(--fuente);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--hero-texto-2);
}

.player-modal-stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	padding: 18px;
}

.stat {
	background: var(--card-2);
	border-radius: 12px;
	padding: 12px 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.stat-valor {
	font-family: var(--fuente-display);
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
}

.stat-label {
	font-size: 11px;
	color: var(--texto-2);
	text-align: center;
}

.warning-modal {
	text-align: center;
	max-width: 360px;
}

.warning-icono {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--naranja-suave);
	color: var(--naranja);
	font-size: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.warning-modal h3 { margin: 14px 0 6px; font-size: 19px; }

.warning-modal p {
	color: var(--texto-2);
	font-size: 15px;
	line-height: 1.5;
	margin: 0 0 20px;
}

.btn-primario {
	width: 100%;
	border: none;
	background: var(--naranja);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	padding: 12px;
	border-radius: 12px;
	cursor: pointer;
}

.btn-primario:hover { filter: brightness(1.08); }

/* ---------- Overlay de carga (anotadores) ---------- */
.loading-overlay {
	position: fixed;
	inset: 0;
	background: rgba(6, 10, 20, 0.6);
	color: #fff;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	z-index: 9999;
}

.spinner {
	width: 44px;
	height: 44px;
	border: 4px solid rgba(255, 255, 255, 0.2);
	border-top-color: var(--naranja);
	border-radius: 50%;
	animation: girar 0.8s linear infinite;
	margin-bottom: 14px;
}

/* ---------- Animaciones ---------- */
@keyframes latido {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.8); }
}

@keyframes brillo {
	from { background-position: 200% 0; }
	to { background-position: -200% 0; }
}

@keyframes aparecer {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

@keyframes subir {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

@keyframes girar {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
	.hero { padding: 16px 16px 18px; }

	.hero-inner {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.brand-logo img { height: 38px; }
	.brand h1 { font-size: 26px; }

	.semana { justify-content: space-between; }

	.filtros-inner { padding: 10px 16px; }

	.btn-amistosos span { display: none; }
	.btn-amistosos { padding: 0 14px; }

	.partidos { grid-template-columns: 1fr; }

	.grupo-header { padding-left: 10px; }
	.grupo-titulo h2 { font-size: 21px; }

	.grupo-acciones { width: 100%; }
	.grupo-acciones .btn-ghost { flex: 1; justify-content: center; padding: 7px 6px; font-size: 12px; gap: 5px; }

	.player-modal-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Enlaces a la ficha de equipo ---------- */
.enlace-equipo {
	position: relative;
	z-index: 1;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

.enlace-equipo:not(.escudo):hover {
	color: var(--naranja);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.escudo.enlace-equipo { transition: outline-color 0.15s; outline: 2px solid transparent; outline-offset: 2px; }
.escudo.enlace-equipo:hover { outline-color: var(--naranja); }
