/**
 * Bloque "Mano de poker" (HTML estático de includes/bloque.php).
 * Ficha azul marino propia: el texto claro va siempre dentro de ella, nunca
 * sobre el fondo claro de la entrada.
 */

.pn-mano {
	--pn-navy: #002761;
	--pn-deep: #001a42;
	--pn-blue: #0067fe;
	--pn-sky: #64a3ff;
	--pn-muted: #a9c6ff;
	--pn-line: rgba(255, 255, 255, 0.09);
	container-type: inline-size;
	box-sizing: border-box;
	max-width: 100%;
	margin: 1.75em 0;
	padding: 20px;
	border-radius: 18px;
	background: var(--pn-navy);
	color: #fff;
	font-family: Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.4;
	box-shadow: 0 24px 48px -28px rgba(0, 10, 40, 0.8);
	overflow: hidden;
}

.pn-mano *,
.pn-mano *::before,
.pn-mano *::after {
	box-sizing: border-box;
}

/* ---------- Cabecera ---------- */
.pn-mano-head {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 14px;
}

.pn-mano-eyebrow {
	color: var(--pn-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.pn-mano .pn-mano-title {
	margin: 0;
	padding: 0;
	color: #fff;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	text-wrap: balance;
}

/* ---------- Cartas ---------- */
.pn-card {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	width: 34px;
	height: 48px;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
	line-height: 1;
	vertical-align: middle;
}

.pn-card b {
	font-size: 15px;
	font-weight: 700;
}

.pn-card i {
	font-size: 17px;
	font-style: normal;
}

.pn-card-roja {
	color: #d1202f;
}

.pn-card-negra {
	color: #11151a;
}

.pn-mano-cards {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
}

/* ---------- Board ---------- */
.pn-mano-board {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px 18px;
	margin-bottom: 16px;
	padding: 12px 14px;
	border-radius: 14px;
	background: radial-gradient(ellipse at 50% 30%, #1a66dc 0%, #0a4bb0 60%, #06378a 100%);
	box-shadow: inset 0 0 0 1px rgba(100, 163, 255, 0.4);
}

.pn-mano-street {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pn-mano-street-label {
	color: var(--pn-muted);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* ---------- Tabla de calles ---------- */
.pn-mano-grid {
	display: flex;
	flex-direction: column;
}

.pn-mano-row {
	display: grid;
	grid-template-columns: minmax(150px, 1.35fr) repeat(var(--pn-cols, 4), minmax(0, 1fr));
	align-items: start;
	gap: 8px;
	padding: 10px 0;
	border-top: 1px solid var(--pn-line);
}

.pn-mano-header {
	padding: 0 0 8px;
	border-top: 0;
	color: var(--pn-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.pn-mano-header span:not(:first-child) {
	padding-left: 8px;
}

.pn-mano-player {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.pn-mano-name {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.pn-mano-player .pn-card {
	width: 30px;
	height: 42px;
}

.pn-mano-player .pn-card b {
	font-size: 13px;
}

.pn-mano-player .pn-card i {
	font-size: 15px;
}

.pn-mano-cell {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
	padding: 6px 8px;
	border-radius: 10px;
}

.pn-mano-pct {
	color: #cfe0ff;
	font-size: 16px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pn-mano-bar {
	display: block;
	height: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	overflow: hidden;
}

.pn-mano-bar i {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--pn-sky);
}

.pn-mano-hand {
	color: var(--pn-muted);
	font-size: 11px;
	line-height: 1.3;
	text-wrap: balance;
}

/* Favorito de la calle */
.pn-mano-cell.is-lead {
	background: rgba(100, 163, 255, 0.14);
	box-shadow: inset 0 0 0 1px rgba(100, 163, 255, 0.45);
}

.pn-mano-cell.is-lead .pn-mano-pct {
	color: #fff;
}

.pn-mano-cell.is-lead .pn-mano-bar i {
	background: linear-gradient(90deg, var(--pn-sky), #fff);
}

/* Ganador en el river */
.pn-mano-cell.is-winner .pn-mano-pct {
	align-self: flex-start;
	padding: 1px 10px;
	border-radius: 999px;
	background: #fff;
	color: var(--pn-blue);
	font-size: 14px;
}

/* ---------- Pie ---------- */
.pn-mano-foot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px 16px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--pn-line);
	color: var(--pn-muted);
	font-size: 12px;
}

.pn-mano a.pn-mano-link {
	color: var(--pn-sky);
	font-weight: 600;
	text-decoration: none;
}

.pn-mano a.pn-mano-link:hover,
.pn-mano a.pn-mano-link:focus-visible {
	color: #fff;
	text-decoration: underline;
}

.pn-mano-note,
.pn-mano-vacia {
	margin: 10px 0 0;
	color: var(--pn-muted);
	font-size: 13px;
}

/* Resultado final bajo el nombre y número sin etiqueta: solo en ancho estrecho */
.pn-mano-final,
.pn-mano-num {
	display: none;
}

/* ---------- Ancho estrecho (móvil o columna angosta) ----------
   El jugador pasa a ocupar su propia línea y las calles quedan debajo, alineadas
   con la cabecera. */
@container (max-width: 560px) {
	.pn-mano {
		padding: 16px 14px;
	}

	.pn-mano-row {
		grid-template-columns: repeat(var(--pn-cols, 4), minmax(0, 1fr));
		gap: 6px;
	}

	.pn-mano-player {
		grid-column: 1 / -1;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.pn-mano-header span:first-child {
		display: none;
	}

	.pn-mano-header span:not(:first-child) {
		padding-left: 6px;
	}

	.pn-mano-cell {
		padding: 5px 6px;
	}

	.pn-mano-pct {
		font-size: 14px;
	}

	.pn-mano-cell.is-winner .pn-mano-pct {
		padding: 1px 7px;
		font-size: 12px;
	}

	.pn-mano .pn-mano-title {
		font-size: 17px;
	}

	/* Resultado y jugada final junto al jugador; en las calles, solo porcentaje y barra
	   (así "Reparte · 50 %" o una jugada larga no se salen de la columna) */
	.pn-mano-final {
		grid-column: 1 / -1;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 4px 8px;
		margin-top: -2px;
		color: #cfe0ff;
		font-size: 12px;
		line-height: 1.3;
	}

	.pn-mano-final-res {
		padding: 1px 9px;
		border-radius: 999px;
		background: #fff;
		color: var(--pn-blue);
		font-weight: 700;
		white-space: nowrap;
	}

	.pn-mano-cell .pn-mano-hand,
	.pn-mano-res {
		display: none;
	}

	.pn-mano-num {
		display: inline;
	}

	.pn-mano-cell.is-winner .pn-mano-pct {
		align-self: auto;
		padding: 0;
		background: none;
		color: #fff;
		font-size: 14px;
	}
}

/* ---------- Editor: panel de la calculadora dentro del bloque ---------- */
.pn-mano-editor-panel {
	margin-bottom: 12px;
	padding: 14px;
	border: 1px dashed #c3c4c7;
	border-radius: 12px;
	background: #f6f7f7;
}

.pn-mano-editor-help,
.pn-mano-editor-status {
	margin: 0 0 10px;
	color: #3c434a;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 13px;
}

.pn-mano-editor-status {
	margin: 10px 0 0;
}

.pn-mano-editor-names {
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: 10px;
	background: #fff;
	border: 1px solid #dcdcde;
}

.pn-mano-editor-names-title {
	margin: 0 0 10px;
	color: #1e1e1e;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 13px;
	font-weight: 600;
}

.pn-mano-editor-names-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px 16px;
}

/* Sin hueco debajo cuando la mano cierra la entrada o la sigue un párrafo vacío */
.pn-mano:last-child {
	margin-bottom: 0;
}

.pn-mano + p:empty {
	display: none;
}

/* Ficha de jugador vinculada: foto y enlace a su perfil */
.pn-mano-who,
.pn-mano-who:hover,
.pn-mano-who:visited {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.pn-mano-who:hover .pn-mano-name {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pn-mano .pn-mano-avatar {
	flex: none;
	width: 40px;
	height: 40px;
	margin: 0;
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	object-fit: cover;
	background: var(--pn-deep);
}

/* Editor: vincular la ficha del jugador */
.pn-mano-editor-jugador {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pn-mano-editor-ficha {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
}

.pn-mano-editor-avatar {
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.pn-mano-editor-avatar.is-vacio {
	display: grid;
	place-items: center;
	background: #dcdcde;
	color: #50575e;
	font-size: 12px;
	font-weight: 600;
}

.pn-mano-editor-buscar ul {
	margin: 4px 0;
	padding: 0;
	list-style: none;
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

.pn-mano-editor-buscar li {
	margin: 0;
}

.pn-mano-editor-buscar li button {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 6px 8px;
	border: 0;
	background: #fff;
	color: #1e1e1e;
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}

.pn-mano-editor-buscar li button:hover,
.pn-mano-editor-buscar li button:focus {
	background: #f0f0f1;
}

.pn-mano-editor-vacio {
	margin: 6px 0;
	color: #757575;
	font-size: 12px;
}

.pn-mano-editor-ficha-txt {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.pn-mano-editor-acciones {
	display: flex;
	gap: 12px;
}

.pn-mano-editor-buscar li button small {
	margin-left: auto;
	color: #757575;
	font-size: 11px;
}

.pn-mano-editor-buscar li button.is-crear {
	color: #2271b1;
	font-weight: 600;
}

.pn-mano-editor-error {
	margin: 0;
	color: #cc1818;
	font-size: 12px;
}
