.fov-root {
	--fov-verde: #16a34a;
	--fov-verde-claro: #4ade80;
	--fov-rojo: #dc2626;
	--fov-rojo-claro: #f87171;
	--fov-oscuro: #14162b;
	--fov-morado: #6366f1;

	box-sizing: border-box;
	width: 100%;
	max-width: 420px;
	margin: 30px auto;
	padding: 0 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	text-align: center;
}

.fov-root *, .fov-root *::before, .fov-root *::after { box-sizing: border-box; }

.fov-card-stack {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4.3;
	margin-bottom: clamp(16px, 4vw, 24px);
	overflow: hidden;
}

.fov-card {
	position: absolute;
	inset: 0;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 14px 34px rgba(20, 22, 43, 0.16), 0 2px 8px rgba(20, 22, 43, 0.08);
	overflow: hidden;
	cursor: grab;
	transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .3s ease;
	user-select: none;
	display: flex;
	flex-direction: column;
}

.fov-card:active { cursor: grabbing; }

.fov-card-decidida { cursor: default; }

/* Animación de "swipe": la tarjeta se desplaza y siempre vuelve al centro,
   tanto si aciertas como si fallas. Al ser una animación CSS con "forwards"
   no depende de temporizadores ni de lo que tarde la petición de red. */
@keyframes fov-fling-fichar {
	0%   { transform: translateX(0) rotate(0deg) scale(1); }
	45%  { transform: translateX(140px) rotate(8deg) scale(.97); }
	100% { transform: translateX(0) rotate(0deg) scale(1); }
}

@keyframes fov-fling-vender {
	0%   { transform: translateX(0) rotate(0deg) scale(1); }
	45%  { transform: translateX(-140px) rotate(-8deg) scale(.97); }
	100% { transform: translateX(0) rotate(0deg) scale(1); }
}

.fov-card-fling-fichar { animation: fov-fling-fichar .5s cubic-bezier(.2,.8,.2,1) forwards; }
.fov-card-fling-vender { animation: fov-fling-vender .5s cubic-bezier(.2,.8,.2,1) forwards; }

.fov-card-saliendo {
	opacity: 0;
	transform: translateY(-16px) scale(.96) !important;
}

.fov-card-img {
	width: 100%;
	height: 52%;
	flex-shrink: 0;
	object-fit: cover;
	object-position: top center;
	background: linear-gradient(135deg, #e5e7f5, #dfe1f0);
	display: block;
}

.fov-card-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--fov-oscuro), #2a2e5c);
}

.fov-card-avatar span {
	font-size: clamp(30px, 9vw, 42px);
	font-weight: 800;
	color: rgba(255,255,255,.85);
	letter-spacing: 1px;
}

.fov-card-body {
	padding: 14px 18px 12px;
	text-align: left;
	overflow-y: auto;
}

.fov-card-etiquetas {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

.fov-card-pos {
	display: inline-block;
	background: var(--fov-oscuro);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 11px;
	border-radius: 20px;
	letter-spacing: .6px;
	text-transform: uppercase;
}

.fov-card-equipo {
	display: inline-block;
	background: #eef0fb;
	color: var(--fov-oscuro);
	font-size: 11px;
	font-weight: 700;
	padding: 4px 11px;
	border-radius: 20px;
	letter-spacing: .2px;
}

.fov-card-nombre {
	margin: 0 0 4px;
	font-size: clamp(18px, 5vw, 21px);
	line-height: 1.2;
	color: #111;
	font-weight: 800;
}

.fov-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
	gap: 6px;
	margin: 8px 0;
	max-width: 260px;
}

.fov-stat-celda {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #f5f6fb;
	border-radius: 10px;
	padding: 6px 4px;
	line-height: 1.15;
}

.fov-stat-valor {
	font-size: 14px;
	font-weight: 800;
	color: var(--fov-oscuro);
}

.fov-stat-label {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .4px;
	color: #888;
}

.fov-card-stat {
	font-size: 13.5px;
	color: #555;
	margin: 4px 0 6px;
	line-height: 1.35;
}

.fov-mini-explicacion {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
	color: #6b6f80;
}

.fov-stamp {
	position: absolute;
	top: 18px;
	font-weight: 900;
	font-size: clamp(20px, 6vw, 27px);
	padding: 5px 14px;
	border: 3px solid;
	border-radius: 8px;
	text-transform: uppercase;
	opacity: 0;
	transition: opacity .15s ease;
	pointer-events: none;
	background: rgba(255,255,255,.85);
	z-index: 2;
}

.fov-stamp-fichar { left: 16px; color: var(--fov-verde); border-color: var(--fov-verde); transform: rotate(-12deg); }
.fov-stamp-vender { right: 16px; color: var(--fov-rojo); border-color: var(--fov-rojo); transform: rotate(12deg); }

/* Panel de encuesta, revelado tras decidir */
.fov-encuesta {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	padding: 20px 22px;
	background: linear-gradient(180deg, rgba(20,22,43,.97), rgba(20,22,43,.99));
	color: #fff;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .3s ease, transform .3s ease;
	z-index: 3;
}

.fov-encuesta-visible { opacity: 1; transform: translateY(0); }

.fov-encuesta-titulo {
	margin: 0 0 2px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .8px;
	color: rgba(255,255,255,.65);
}

.fov-encuesta-barra {
	display: flex;
	width: 100%;
	height: 34px;
	border-radius: 10px;
	overflow: hidden;
	background: rgba(255,255,255,.12);
}

.fov-encuesta-seg {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 800;
	transition: width .6s cubic-bezier(.2,.8,.2,1);
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
}

.fov-encuesta-fichar { background: linear-gradient(135deg, var(--fov-verde-claro), var(--fov-verde)); }
.fov-encuesta-vender { background: linear-gradient(135deg, var(--fov-rojo-claro), var(--fov-rojo)); }

.fov-encuesta-pie {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12.5px;
	color: rgba(255,255,255,.75);
	gap: 8px;
}

.fov-acierto { font-weight: 700; }
.fov-acierto-si { color: var(--fov-verde-claro); }
.fov-acierto-no { color: var(--fov-rojo-claro); }

.fov-siguiente-btn {
	margin-top: 6px;
	width: 100%;
	padding: 12px 0;
	border: none;
	border-radius: 30px;
	background: #fff;
	color: var(--fov-oscuro);
	font-weight: 800;
	font-size: 14.5px;
	cursor: pointer;
	transition: transform .12s ease;
}

.fov-siguiente-btn:active { transform: scale(.97); }

.fov-buttons {
	display: flex;
	justify-content: center;
	gap: 14px;
}

.fov-btn {
	flex: 1;
	max-width: 170px;
	padding: 14px 0;
	border: none;
	border-radius: 40px;
	font-size: clamp(14px, 4vw, 16px);
	font-weight: 700;
	cursor: pointer;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	transition: transform .15s ease, opacity .15s ease;
	box-shadow: 0 6px 16px rgba(0,0,0,.12);
}

.fov-btn:active { transform: scale(0.94); }
.fov-btn:disabled { opacity: .45; cursor: default; transform: none; }

.fov-btn-vender { background: linear-gradient(135deg, var(--fov-rojo-claro), var(--fov-rojo)); }
.fov-btn-fichar { background: linear-gradient(135deg, var(--fov-verde-claro), var(--fov-verde)); }

.fov-esperando .fov-btn { opacity: .45; }

.fov-progress {
	margin-top: 18px;
	height: 7px;
	background: #eceef5;
	border-radius: 6px;
	overflow: hidden;
}

.fov-progress-bar {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--fov-morado), #8b5cf6);
	transition: width .3s ease;
}

.fov-resultado {
	margin-top: 22px;
	padding: clamp(18px, 5vw, 26px);
	border-radius: 18px;
	background: #f4f4fb;
}

.fov-resultado-titulo {
	margin: 0 0 6px;
	font-size: clamp(20px, 6vw, 26px);
	color: var(--fov-oscuro);
}

.fov-resultado-texto { color: #444; margin: 4px 0 14px; font-size: 14.5px; }

.fov-resultado-cuadros {
	font-size: clamp(16px, 5vw, 20px);
	letter-spacing: 3px;
	margin: 0 0 18px;
	word-break: break-all;
}

.fov-resultado-acciones {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

/* Mini resumen de todos los votos, al final de la partida */
.fov-mini-resumen {
	margin-top: 20px;
	text-align: left;
}

.fov-mini-resumen-titulo {
	margin: 0 0 10px;
	font-size: 12.5px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .6px;
	color: var(--fov-oscuro);
}

.fov-mini-lista {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: 260px;
	overflow-y: auto;
	padding-right: 2px;
}

.fov-mini-fila {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border-radius: 10px;
	padding: 8px 12px;
	font-size: 12.5px;
}

.fov-mini-nombre {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 700;
	color: #222;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fov-mini-eleccion {
	flex: 0 0 auto;
	font-weight: 700;
	white-space: nowrap;
	font-size: 12px;
}

.fov-mini-eleccion-fichar { color: var(--fov-verde); }
.fov-mini-eleccion-vender { color: var(--fov-rojo); }

.fov-mini-comunidad {
	flex: 0 0 auto;
	color: #888;
	font-size: 11px;
	white-space: nowrap;
}

.fov-share-btn {
	background: var(--fov-oscuro);
	color: #fff;
	border: none;
	padding: 12px 22px;
	border-radius: 30px;
	font-weight: 700;
	cursor: pointer;
	font-size: 14px;
}

.fov-replay-btn {
	background: transparent;
	border: 2px solid var(--fov-oscuro);
	color: var(--fov-oscuro);
	padding: 10px 20px;
	border-radius: 30px;
	font-weight: 700;
	cursor: pointer;
	font-size: 14px;
}

/* Pantallas muy pequeñas */
@media (max-width: 360px) {
	.fov-buttons { gap: 10px; }
	.fov-btn { padding: 12px 0; }
}

/* Pantallas anchas: tarjeta un poco más compacta en altura */
@media (min-width: 480px) {
	.fov-root { max-width: 440px; }
}

@media (prefers-reduced-motion: reduce) {
	.fov-card, .fov-encuesta, .fov-encuesta-seg, .fov-progress-bar { transition: none !important; }
	.fov-card-fling-fichar, .fov-card-fling-vender { animation: none !important; }
}
