/* ══════════════════════════════════════════════════════════════
 * El carril — la sesión a pantalla completa (/entreno/).
 *
 * No es una app de fitness: es el cuadro de mandos de una máquina.
 * Negro (batería, luz de gimnasio, sudor), números enormes, rojo solo
 * donde hay que actuar, cero decoración. Todo lo que hay en pantalla
 * o es un dato que se lee de un vistazo o es un blanco para el pulgar.
 * ══════════════════════════════════════════════════════════════ */

.ej-sesbody {
	margin: 0;
	background: #000;
	color: var(--paper, #EFF0ED);
	font-family: var(--body, system-ui, sans-serif);
	/* Sin scroll: la sesión es una pantalla, no una página. */
	overflow: hidden;
	height: 100%;
	-webkit-tap-highlight-color: transparent;
	overscroll-behavior: none;
}
.ej-sesbody * { box-sizing: border-box; }

/* Red de seguridad. El chat burbuja (.ejai) ya no se pinta aquí — lo corta
   ej_coach_widget() —, pero la barra de admin de WP sí se colaría y taparía
   la barra de sesión. */
.ej-sesbody #wpadminbar,
.ej-sesbody .ejai { display: none !important; }
.ej-sesbody { padding-top: 0 !important; margin-top: 0 !important; }
html.ej-seshtml { margin-top: 0 !important; }
html.ej-seshtml { height: 100%; }

/* ─────────────── Puerta (sin cuenta / sin PRO / día de descanso) ─────────────── */
.ejs-gate {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 30px 24px;
	gap: 4px;
}
.ejs-gate h1 {
	font-family: var(--display, sans-serif);
	text-transform: uppercase;
	font-weight: 700;
	font-size: clamp(30px, 9vw, 42px);
	line-height: .95;
	margin: 0;
}
.ejs-gate p {
	color: #7C8288;
	font-size: 14.5px;
	line-height: 1.5;
	margin: 12px 0 0;
	max-width: 34ch;
}
.ejs-gate__b {
	margin-top: 26px;
	height: 56px;
	padding: 0 34px;
	display: inline-flex;
	align-items: center;
	border-radius: 8px;
	background: var(--muscle, #D23B3B);
	color: #fff;
	text-decoration: none;
	font-family: var(--display, sans-serif);
	text-transform: uppercase;
	font-weight: 700;
	font-size: 21px;
	letter-spacing: .02em;
}
.ejs-gate__x {
	margin-top: 14px;
	color: #7C8288;
	font-size: 13.5px;
	text-decoration: none;
	border-bottom: 1px solid #2A2F35;
	padding-bottom: 2px;
}

/* ─────────────── El carril ─────────────── */
.ejs {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #000;
}

/* El fondo que SE VACÍA: el cronómetro que se lee sin mirar el número,
   con el móvil en el suelo o en el banco, a dos metros. */
.ejs__drain {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: linear-gradient(180deg, var(--muscle, #D23B3B) 0%, #7A1F1F 100%);
	transform: translateY(-100%);
}

.ejs__in {
	position: relative;
	z-index: 1;
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding: max(16px, env(safe-area-inset-top)) 18px 0;
	transition: opacity .2s;
}
.ejs.is-rest .ejs__in { opacity: 0; pointer-events: none; }

/* Barra de sesión */
.ejs-top { display: flex; align-items: center; gap: 10px; flex: none; }
.ejs-top__x {
	color: #7C8288;
	font-size: 26px;
	line-height: 1;
	padding: 4px 6px;
	text-decoration: none;
	flex: none;
}
.ejs-top__mid { flex: 1; min-width: 0; }
.ejs-top__nm {
	display: block;
	font-family: var(--mono, monospace);
	font-size: 9.5px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #7C8288;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ejs-top__bar {
	display: block;
	height: 2px;
	background: #1E2226;
	margin-top: 5px;
	position: relative;
	border-radius: 2px;
}
.ejs-top__bar i {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	background: var(--paper, #EFF0ED);
	border-radius: 2px;
	transition: width .4s;
}
.ejs-top__t {
	font-family: var(--mono, monospace);
	font-size: 12px;
	color: #7C8288;
	font-variant-numeric: tabular-nums;
	flex: none;
}

/* Ejercicio */
.ejs-ex { flex: none; margin-top: 20px; }
.ejs-ex__k {
	display: block;
	font-family: var(--mono, monospace);
	font-size: 9.5px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muscle, #D23B3B);
	font-weight: 700;
}
.ejs-ex__nm {
	font-family: var(--display, sans-serif);
	text-transform: uppercase;
	font-weight: 700;
	/* Los nombres largos del catálogo tienen que caber sin romper la cabina. */
	font-size: clamp(26px, 9.5vw, 38px);
	line-height: .92;
	margin: 5px 0 0;
	overflow-wrap: break-word;
}

/* Los PUNTOS: la sesión de un vistazo, sin leer */
.ejs-dots { display: flex; gap: 6px; margin-top: 14px; }
.ejs-dots i {
	flex: 1;
	height: 4px;
	border-radius: 2px;
	background: #1E2226;
	transition: background .25s;
}
.ejs-dots i.is-done { background: #4FB477; }
.ejs-dots i.is-now  { background: var(--paper, #EFF0ED); }

/* El GIF real del ejercicio */
.ejs-anim {
	flex: 1;
	min-height: 0;
	display: grid;
	place-items: center;
	margin: 12px 0;
	position: relative;
}
.ejs-anim img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	/* El dataset viene con fondo blanco: en la cabina negra deslumbra.
	   Lo bajamos un punto sin tocar el color del cuerpo. */
	filter: brightness(.94);
}
.ejs-anim img[src=""] { visibility: hidden; }
.ejs-anim__how {
	position: absolute;
	bottom: 0;
	right: 0;
	font-family: var(--mono, monospace);
	font-size: 9px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #4A5057;
	text-decoration: none;
	border-bottom: 1px solid #2A2F35;
	padding-bottom: 2px;
}

/* EL NÚMERO */
.ejs-num {
	flex: none;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 14px;
}
.ejs-num__main,
.ejs-num__r {
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	cursor: pointer;
	font: inherit;
	text-align: right;
}
.ejs-num__main { display: flex; align-items: baseline; gap: 4px; }
.ejs-num__v {
	font-family: var(--display, sans-serif);
	font-weight: 700;
	font-size: clamp(66px, 23vw, 92px);
	line-height: .82;
	letter-spacing: -.01em;
	font-variant-numeric: tabular-nums;
}
.ejs-num__u {
	font-family: var(--display, sans-serif);
	font-size: 26px;
	color: #7C8288;
	font-weight: 700;
	font-style: normal;
}
.ejs-num__r b {
	display: block;
	font-family: var(--display, sans-serif);
	font-size: 42px;
	line-height: .9;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.ejs-num__r span {
	display: block;
	font-family: var(--mono, monospace);
	font-size: 9.5px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #7C8288;
	font-weight: 700;
}
.ejs-num__r.is-open b { color: var(--secondary, #E39A2B); }
.ejs-hint {
	font-family: var(--mono, monospace);
	font-size: 10px;
	margin: 6px 0 0;
	letter-spacing: .04em;
	min-height: 13px;
	color: #7C8288;
}
.ejs-hint.is-up   { color: #4FB477; }
.ejs-hint.is-down { color: var(--secondary, #E39A2B); }

/* Dial: pulgar, no teclado */
.ejs-dial {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	flex: none;
}
.ejs-dial__b {
	width: 54px;
	height: 46px;
	border-radius: 6px;
	background: #14171A;
	border: 1px solid #2A2F35;
	color: var(--paper, #EFF0ED);
	font-family: var(--display, sans-serif);
	font-size: 25px;
	font-weight: 700;
	cursor: pointer;
	flex: none;
	line-height: 1;
}
.ejs-dial__b:active { background: #1E2226; }
.ejs-dial__lbl {
	flex: 1;
	text-align: center;
	font-family: var(--mono, monospace);
	font-size: 9.5px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #7C8288;
}
.ejs-dial--reps { margin-top: 8px; }

/* LOS DISCOS: "60 kg" no dice nada delante de la barra; esto sí. */
.ejs-plates {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	height: 46px;
	background: #0A0C0D;
	border: 1px solid #2A2F35;
	border-radius: 6px;
	padding: 0 8px;
	overflow: hidden;
}
.ejs-plate { border-radius: 1px; flex: none; }
.ejs-plates__bar { width: 14px; height: 3px; background: #4A5057; flex: none; }
.ejs-plates__tx {
	font-family: var(--mono, monospace);
	font-size: 9.5px;
	color: #7C8288;
	letter-spacing: .06em;
	white-space: nowrap;
}

/* LA ACCIÓN */
.ejs-act { flex: none; padding: 12px 0 max(16px, env(safe-area-inset-bottom)); }
.ejs-go {
	width: 100%;
	height: 78px;
	border: 0;
	border-radius: 10px;
	background: var(--muscle, #D23B3B);
	color: #fff;
	font-family: var(--display, sans-serif);
	text-transform: uppercase;
	font-weight: 700;
	font-size: 34px;
	letter-spacing: .02em;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	transition: transform .08s, background .15s;
}
.ejs-go:active { transform: scale(.985); background: #B93232; }
.ejs-go[disabled] { opacity: .5; }
.ejs-go svg { width: 26px; height: 26px; }

/* La IA aquí son BOTONES, no un chat: nadie teclea entre series. */
.ejs-ai { display: flex; gap: 7px; margin-top: 9px; }
.ejs-ai__b {
	flex: 1;
	height: 46px;
	border-radius: 8px;
	background: transparent;
	border: 1px solid #2A2F35;
	color: #7C8288;
	font-family: var(--body, sans-serif);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}
.ejs-ai__b:active { background: #14171A; }
.ejs-ai__b svg { width: 14px; height: 14px; color: var(--secondary, #E39A2B); }

/* ─────────────── Descanso ─────────────── */
.ejs-rest {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.ejs.is-rest .ejs-rest { display: flex; }
.ejs-rest__k {
	font-family: var(--mono, monospace);
	font-size: 11px;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .7);
	font-weight: 700;
}
.ejs-rest__t {
	font-family: var(--display, sans-serif);
	font-weight: 700;
	font-size: clamp(96px, 33vw, 140px);
	line-height: .85;
	margin: 10px 0 0;
	font-variant-numeric: tabular-nums;
	color: #fff;
}
.ejs-rest__next {
	margin-top: 18px;
	text-align: center;
	color: rgba(255, 255, 255, .88);
	max-width: 30ch;
}
.ejs-rest__next span {
	display: block;
	font-family: var(--mono, monospace);
	font-size: 9.5px;
	letter-spacing: .14em;
	text-transform: uppercase;
	opacity: .7;
}
.ejs-rest__next b {
	display: block;
	font-family: var(--display, sans-serif);
	font-size: clamp(22px, 7vw, 30px);
	text-transform: uppercase;
	line-height: 1.05;
	margin-top: 3px;
}
.ejs-rest__acts {
	display: flex;
	gap: 8px;
	margin-top: 26px;
	width: 100%;
	max-width: 300px;
}
.ejs-rest__b {
	flex: 1;
	height: 54px;
	border-radius: 8px;
	background: rgba(0, 0, 0, .28);
	border: 1px solid rgba(255, 255, 255, .28);
	color: #fff;
	font-family: var(--body, sans-serif);
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.ejs-rest__b:active { background: rgba(0, 0, 0, .45); }

/* ─────────────── Récord ─────────────── */
.ejs-pr {
	position: absolute;
	z-index: 6;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #4FB477;
	color: #06180F;
	border-radius: 10px;
	padding: 16px 26px;
	text-align: center;
	pointer-events: none;
	animation: ejs-pop .3s cubic-bezier(.2, .9, .3, 1.4);
}
.ejs-pr span {
	font-family: var(--mono, monospace);
	font-size: 9.5px;
	letter-spacing: .18em;
	text-transform: uppercase;
	font-weight: 700;
	opacity: .8;
}
.ejs-pr b {
	display: block;
	font-family: var(--display, sans-serif);
	text-transform: uppercase;
	font-size: 36px;
	line-height: 1;
	margin-top: 3px;
}
@keyframes ejs-pop { from { transform: translate(-50%, -50%) scale(.7); opacity: 0; } }

/* ─────────────── Hoja de alternativas ─────────────── */
.ejs-sheet {
	position: absolute;
	inset: 0;
	z-index: 5;
	background: rgba(0, 0, 0, .6);
	display: flex;
	align-items: flex-end;
}
.ejs-sheet[hidden] { display: none; }
.ejs-sheet__card {
	width: 100%;
	max-height: 88%;
	overflow-y: auto;
	background: #14171A;
	border-top: 2px solid var(--secondary, #E39A2B);
	border-radius: 16px 16px 0 0;
	padding: 20px 18px max(20px, env(safe-area-inset-bottom));
	animation: ejs-up .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes ejs-up { from { transform: translateY(100%); } }
.ejs-sheet__k {
	font-family: var(--mono, monospace);
	font-size: 9.5px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--secondary, #E39A2B);
	font-weight: 700;
}
.ejs-sheet__h {
	font-family: var(--display, sans-serif);
	text-transform: uppercase;
	font-weight: 700;
	font-size: 26px;
	line-height: 1;
	margin: 6px 0 0;
}
.ejs-sheet__p { font-size: 13px; color: #7C8288; line-height: 1.5; margin: 8px 0 0; }
.ejs-sheet__p b { color: var(--paper, #EFF0ED); }
.ejs-alt {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	text-align: left;
	background: #0A0C0D;
	border: 1px solid #2A2F35;
	border-radius: 8px;
	padding: 10px 12px;
	margin-top: 8px;
	cursor: pointer;
	color: var(--paper, #EFF0ED);
}
.ejs-alt:active { background: #1E2226; }
.ejs-alt__im {
	width: 46px;
	height: 46px;
	border-radius: 5px;
	object-fit: cover;
	background: #14171A;
	flex: none;
}
.ejs-alt__t { flex: 1; min-width: 0; }
.ejs-alt__t b { display: block; font-size: 14.5px; font-weight: 640; line-height: 1.2; }
.ejs-alt__t small { display: block; font-size: 11.5px; color: #7C8288; margin-top: 2px; }
.ejs-alt__go { color: var(--muscle, #D23B3B); font-size: 18px; flex: none; }
.ejs-sheet__x {
	width: 100%;
	height: 48px;
	margin-top: 12px;
	border-radius: 8px;
	background: transparent;
	border: 1px solid #2A2F35;
	color: #7C8288;
	font-family: var(--body, sans-serif);
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}

/* ─────────────── Cierre ─────────────── */
.ejs-end {
	position: absolute;
	inset: 0;
	z-index: 7;
	background: #000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 26px;
	overflow-y: auto;
}
.ejs-end[hidden] { display: none; }
.ejs-end__ic {
	width: 66px;
	height: 66px;
	border-radius: 50%;
	background: rgba(79, 180, 119, .14);
	color: #4FB477;
	display: grid;
	place-items: center;
	margin-bottom: 16px;
	flex: none;
}
.ejs-end h2 {
	font-family: var(--display, sans-serif);
	text-transform: uppercase;
	font-weight: 700;
	font-size: clamp(30px, 10vw, 40px);
	line-height: 1;
	margin: 0;
}
.ejs-end__st {
	display: flex;
	gap: 26px;
	margin-top: 22px;
	justify-content: center;
	flex-wrap: wrap;
}
.ejs-end__st div b {
	display: block;
	font-family: var(--display, sans-serif);
	font-size: 38px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.ejs-end__st div span {
	display: block;
	font-family: var(--mono, monospace);
	font-size: 9px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #7C8288;
	margin-top: 4px;
}
.ejs-end__b {
	margin-top: 28px;
	height: 56px;
	padding: 0 34px;
	display: inline-flex;
	align-items: center;
	border-radius: 8px;
	background: var(--muscle, #D23B3B);
	color: #fff;
	text-decoration: none;
	font-family: var(--display, sans-serif);
	text-transform: uppercase;
	font-weight: 700;
	font-size: 21px;
}

/* Pantallas bajas: el GIF cede sitio antes que el número o el botón. */
@media (max-height: 700px) {
	.ejs-anim { margin: 6px 0; }
	.ejs-ex { margin-top: 12px; }
	.ejs-go { height: 66px; font-size: 29px; }
}

@media (prefers-reduced-motion: reduce) {
	.ejs-sheet__card,
	.ejs-pr { animation: none; }
}
