.mso-juego {
	--mso-primary: #ffcc00;
	--mso-primary-deep: #f0bf00;
	--mso-secondary: #1f3747;
	--mso-secondary-dark: hsl(204 29% 10%);
	--mso-ink: #1f3747;
	--mso-muted: #60707d;
	--mso-border: #dbe3e8;
	--mso-shadow: 0 14px 34px rgba(31, 55, 71, 0.08);
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #ffffff;
	box-shadow: none;
	color: var(--mso-ink);
}

.mso-juego *,
.mso-juego *::before,
.mso-juego *::after {
	box-sizing: inherit;
}

.mso-barra-superior {
	grid-area: info;
	align-self: start;
	justify-self: end;
	width: 300px;
	margin: 0;
}

.mso-encabezado-partida {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.6rem;
	padding: 0;
	border: 0;
	background: #ffffff;
}

.mso-tema-actual {
	display: flex;
	align-items: center;
	gap: 0.38rem;
	width: 100%;
	max-width: 100%;
	padding: 0.7rem 0.85rem;
	border-radius: 6px;
	background: var(--mso-secondary);
	color: #ffffff;
	font-weight: 800;
	line-height: 1;
}

.mso-tema-label {
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.82);
}

.mso-tema-actual strong {
	min-width: 0;
	font-size: 1.08rem;
	line-height: 1.1;
	color: #ffffff;
	overflow-wrap: anywhere;
}

.mso-resumen-partida {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 92px;
	grid-template-areas:
		"difficulty timer"
		"progress progress";
	gap: 0.55rem;
	align-items: stretch;
}

.mso-etiqueta {
	display: block;
	margin: 0 0 0.25rem;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--mso-muted);
}

.mso-selector-dificultad,
.mso-progreso-resumen,
.mso-cronometro {
	min-width: 0;
	padding: 0.5rem 0.6rem;
	border: 1px solid var(--mso-border);
	border-radius: 6px;
	background: #ffffff;
}

.mso-selector-dificultad {
	grid-area: difficulty;
	display: flex;
	height: 100%;
	flex-direction: column;
}

.mso-selector-dificultad select {
	margin-top: auto;
}

.mso-progreso-resumen {
	grid-area: progress;
}

.mso-cronometro {
	grid-area: timer;
	display: flex;
	height: 100%;
	flex-direction: column;
	text-align: left;
}

.mso-cronometro .mso-valor {
	margin-top: auto;
}

.mso-selector-dificultad select {
	display: block;
	width: 100%;
	min-height: 36px;
	padding: 0.55rem 2.35rem 0.55rem 0.75rem;
	border: 1px solid var(--mso-border);
	border-radius: 999px;
	background-color: #ffffff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231f3747' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.8rem center;
	background-size: 1rem 1rem;
	color: var(--mso-secondary-dark);
	font: inherit;
	font-size: 0.92rem;
	font-weight: 700;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.mso-selector-dificultad select:focus-visible,
.mso-boton:focus-visible,
.mso-celda:focus-visible,
.mso-modal__close:focus-visible {
	outline: 3px solid var(--mso-secondary-dark);
	outline-offset: 2px;
}

.mso-resumen-nivel {
	display: none;
}

.mso-progreso-texto,
.mso-valor {
	display: block;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
	color: var(--mso-secondary-dark);
}

.mso-cronometro .mso-valor {
	font-size: clamp(1.38rem, 1.8vw, 1.65rem);
	letter-spacing: -0.025em;
}

.mso-progreso-track {
	position: relative;
	height: 9px;
	margin-top: 0.4rem;
	overflow: hidden;
	border-radius: 999px;
	background: #e9eef2;
}

.mso-progreso-track > span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--mso-secondary);
	transition: width 180ms ease;
}

.mso-contenido {
	display: grid;
	grid-template-columns: minmax(0, 760px) 300px;
	grid-template-rows: auto 1fr auto;
	grid-template-areas:
		"tablero info"
		"tablero palabras"
		"aviso controles";
	column-gap: clamp(1.25rem, 3vw, 3rem);
	row-gap: 0.75rem;
	align-items: stretch;
	justify-content: space-between;
}

.mso-tablero-wrap {
	grid-area: tablero;
	align-self: stretch;
	justify-self: start;
	width: 100%;
	min-width: 0;
	max-width: 760px;
}

.mso-tablero {
	--mso-grid-rows: 12;
	--mso-grid-columns: 16;
	--mso-letter-size: 1rem;
	--mso-letter-size-mobile: 1rem;
	--mso-board-height: 580px;
	--mso-board-height-mobile: 350px;
	position: relative;
	display: grid;
	grid-template-columns: repeat(var(--mso-grid-columns), minmax(0, 1fr));
	grid-template-rows: repeat(var(--mso-grid-rows), minmax(0, 1fr));
	width: 100%;
	height: var(--mso-board-height);
	overflow: hidden;
	border: 1px solid #ced9df;
	border-radius: 6px;
	background: #ffffff;
	box-shadow: inset 0 0 0 1px rgba(255,255,255,0.85);
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: none;
	overscroll-behavior: contain;
	cursor: crosshair;
}

.mso-tablero.is-locked {
	cursor: default;
}

.mso-trazos {
	position: absolute;
	z-index: 1;
	inset: 0;
	pointer-events: none;
}

.mso-trazo {
	position: absolute;
	border-radius: 999px;
	transform-origin: 0 50%;
	pointer-events: none;
}

.mso-trazo.is-preview {
	background: rgba(31, 55, 71, 0.18);
}

.mso-trazo.is-found {
	background: var(--mso-word-color, rgba(31, 55, 71, 0.18));
}

.mso-celda {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
	padding: 0;
	border: 0;
	border-right: 1px solid #edf2f5;
	border-bottom: 1px solid #edf2f5;
	background: transparent;
	color: var(--mso-secondary-dark);
	font: inherit;
	font-size: var(--mso-letter-size);
	font-weight: 700;
	line-height: 1;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: none;
}

.mso-celda.is-last-column {
	border-right: 0;
}

.mso-celda.is-last-row {
	border-bottom: 0;
}

.mso-celda:focus-visible {
	z-index: 4;
	outline-offset: -3px;
	background: rgba(255, 204, 0, 0.16);
}

.mso-celda.is-anchor {
	z-index: 3;
	box-shadow: inset 0 0 0 3px var(--mso-secondary-dark);
}

.mso-palabras {
	grid-area: palabras;
	align-self: end;
	justify-self: end;
	width: 100%;
	min-width: 0;
	padding: 1rem;
	border: 1px solid var(--mso-border);
	border-radius: 6px;
	background: #ffffff;
	box-shadow: none;
}

.mso-palabras__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.9rem;
}

.mso-juego .mso-palabras h2 {
	margin: 0;
	font-family: inherit;
	font-size: 1.08rem;
	font-weight: 700;
	font-style: normal;
	line-height: 1.1;
	letter-spacing: 0;
	text-transform: none;
	color: var(--mso-secondary-dark);
}

.mso-palabras__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.38rem 0.72rem;
	border-radius: 999px;
	background: #eef2f4;
	font-size: 0.88rem;
	font-weight: 800;
	color: var(--mso-secondary-dark);
}

.mso-palabras ul {
	display: grid;
	gap: 0.55rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mso-palabras li {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
	padding: 0.62rem 0.72rem;
	border-radius: 999px;
	background: #ffffff;
	border: 1px solid #e7edf1;
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	overflow-wrap: anywhere;
	transition: opacity 150ms ease, transform 150ms ease, background 150ms ease, color 150ms ease, border-color 150ms ease;
	color: var(--mso-secondary-dark);
}

.mso-palabras li > span:first-child {
	flex: 0 0 auto;
	width: 1.25rem;
	text-align: center;
	color: #7c8b95;
}

.mso-palabras li.is-found {
	background: var(--mso-secondary);
	border-color: var(--mso-secondary);
	color: #ffffff;
	opacity: 1;
}

.mso-palabras li.is-found > span:first-child {
	color: #ffffff;
}

.mso-palabra-texto {
	position: relative;
	display: inline-block;
}

.mso-palabras li.is-found .mso-palabra-texto {
	text-decoration: none;
}


@media (min-width: 761px) {
	.mso-juego--lista-doble .mso-contenido {
		grid-template-columns: minmax(0, 760px) 420px;
	}

	.mso-juego--lista-doble .mso-barra-superior,
	.mso-juego--lista-doble .mso-palabras {
		width: 420px;
	}

	.mso-juego--lista-doble .mso-palabras ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 0.55rem;
		row-gap: 0.45rem;
	}

	.mso-juego--lista-doble .mso-palabras li {
		padding: 0.42rem 0.58rem;
		font-size: 0.86rem;
	}
}

.mso-controles {
	grid-area: controles;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.55rem;
	align-self: start;
	justify-self: end;
	width: 100%;
}

.mso-controles .mso-boton {
	width: 100%;
	min-width: 0;
}

.mso-controles .mso-boton:first-child {
	grid-column: 1 / -1;
}

.mso-boton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
	min-height: 0;
	padding: 0.5em 1.25em;
	border: 1px solid #e2b800;
	border-radius: 999px;
	background: var(--mso-primary);
	color: var(--mso-secondary-dark);
	font: inherit;
	font-size: 0.96rem;
	font-weight: 500;
	font-style: normal;
	line-height: 1;
	letter-spacing: 0;
	text-align: center;
	text-transform: none;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.mso-boton:hover:not(:disabled) {
	border-color: var(--mso-secondary-dark);
	background: var(--mso-secondary-dark);
	color: #ffffff;
	transform: translateY(-1px);
}

.mso-boton:disabled {
	opacity: 0.56;
	cursor: not-allowed;
}

.mso-boton--secundario {
	border-color: var(--mso-secondary);
	background: #ffffff;
	color: var(--mso-secondary-dark);
}

.mso-boton--secundario:hover:not(:disabled) {
	border-color: var(--mso-secondary-dark);
	background: var(--mso-secondary-dark);
	color: #ffffff;
}


.mso-aviso {
	grid-area: aviso;
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 0;
	padding: 0.9rem 1rem;
	border-radius: 6px;
	background: #f4f7f9;
	font-size: 0.95rem;
	font-weight: 600;
	text-align: center;
	color: var(--mso-secondary-dark);
}

.mso-aviso.is-success {
	background: #eef8ef;
}

.mso-aviso.is-error {
	background: #fff0f0;
}

.mso-juego[aria-busy="true"] .mso-tablero,
.mso-juego[aria-busy="true"] .mso-palabras {
	opacity: 0.62;
}

.mso-juego[aria-busy="true"] .mso-boton {
	cursor: progress;
}


@media (max-width: 1200px) and (min-width: 761px) {
	.mso-juego,
	.mso-tablero,
	.mso-celda {
		-webkit-text-size-adjust: 100%;
		text-size-adjust: 100%;
	}
}
@media (max-width: 1200px) and (min-width: 761px) {
	/*
	 * Respaldo puramente CSS para tablet y para la vista responsive de Bricks.
	 * Aunque JavaScript no detecte capacidad táctil, el ancho del primer carril
	 * determina el tablero y aspect-ratio impide que vuelva a quedar apaisado.
	 */
	.mso-tablero {
		aspect-ratio: 1 / 1;
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
		block-size: auto !important;
	}

	/*
	 * En tablet se congela la geometría completa durante la partida.
	 * Los cambios de texto, progreso, palabras encontradas y trazos no pueden
	 * redistribuir las columnas ni modificar el tamaño del tablero.
	 */
	.mso-contenido,
	.mso-juego--lista-doble .mso-contenido {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		grid-template-columns: minmax(0, 1fr) 300px;
		column-gap: 1rem;
		justify-content: start;
		overflow: visible;
	}

	.mso-juego.mso-tablet-geometry-locked .mso-contenido,
	.mso-juego.mso-tablet-geometry-locked.mso-juego--lista-doble .mso-contenido {
		width: var(--mso-tablet-grid-width) !important;
		min-width: var(--mso-tablet-grid-width) !important;
		max-width: var(--mso-tablet-grid-width) !important;
		grid-template-columns: var(--mso-tablet-board-width) 300px !important;
	}

	.mso-juego.mso-tablet-geometry-locked .mso-tablero-wrap {
		width: var(--mso-tablet-board-width) !important;
		min-width: var(--mso-tablet-board-width) !important;
		max-width: var(--mso-tablet-board-width) !important;
		inline-size: var(--mso-tablet-board-width) !important;
	}

	.mso-juego.mso-tablet-geometry-locked .mso-tablero {
		width: var(--mso-tablet-board-width) !important;
		min-width: var(--mso-tablet-board-width) !important;
		max-width: var(--mso-tablet-board-width) !important;
		inline-size: var(--mso-tablet-board-width) !important;
		height: var(--mso-tablet-board-height) !important;
		min-height: var(--mso-tablet-board-height) !important;
		max-height: var(--mso-tablet-board-height) !important;
		block-size: var(--mso-tablet-board-height) !important;
	}

	.mso-juego.mso-tablet-geometry-locked .mso-barra-superior,
	.mso-juego.mso-tablet-geometry-locked .mso-palabras,
	.mso-juego.mso-tablet-geometry-locked .mso-controles {
		width: 300px !important;
		min-width: 300px !important;
		max-width: 300px !important;
		inline-size: 300px !important;
	}

	.mso-tablero-wrap {
		justify-self: start;
		width: auto;
		min-width: 0;
		max-width: none;
		overflow: hidden;
		contain: layout paint style;
	}

	.mso-tablero {
		width: 100%;
		min-width: 0;
		max-width: none;
		contain: layout paint style;
	}

	.mso-trazos {
		width: 100%;
		height: 100%;
		contain: layout paint style;
	}

	.mso-barra-superior,
	.mso-juego--lista-doble .mso-barra-superior,
	.mso-palabras,
	.mso-juego--lista-doble .mso-palabras,
	.mso-controles {
		width: 300px;
		min-width: 300px;
		max-width: 300px;
	}

	.mso-palabras li,
	.mso-palabra-texto {
		min-width: 0;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.mso-juego--lista-doble .mso-palabras ul {
		grid-template-columns: 1fr;
	}

	/*
	 * El mensaje dinámico se oculta visualmente en tablet. Safari/Chrome
	 * recalculaban el ancho del grid cada vez que cambiaba su contenido.
	 * Se mantiene accesible para lectores de pantalla, pero fuera del layout.
	 */
	.mso-aviso {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		min-width: 1px !important;
		min-height: 1px !important;
		max-width: 1px !important;
		max-height: 1px !important;
		margin: -1px !important;
		padding: 0 !important;
		overflow: hidden !important;
		clip: rect(0 0 0 0) !important;
		clip-path: inset(50%) !important;
		white-space: nowrap !important;
		border: 0 !important;
		contain: strict;
	}
}

@media (min-width: 761px) {
	.mso-aviso {
		min-height: 66px;
	}
}

@media (max-width: 760px) {
	.mso-tablero-wrap {
		align-self: start;
	}

	.mso-juego {
		padding: 0;
	}

	.mso-contenido,
	.mso-juego--lista-doble .mso-contenido {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto;
		grid-template-areas:
			"info"
			"tablero"
			"palabras"
			"aviso"
			"controles";
		row-gap: 1rem;
	}

	.mso-barra-superior,
	.mso-juego--lista-doble .mso-barra-superior,
	.mso-tablero-wrap,
	.mso-palabras,
	.mso-juego--lista-doble .mso-palabras {
		width: 100%;
		max-width: none;
	}

	.mso-resumen-partida {
		grid-template-columns: minmax(0, 1fr) 92px;
		grid-template-areas:
			"difficulty timer"
			"progress progress";
	}

	.mso-tablero {
		height: var(--mso-board-height-mobile);
	}

	.mso-palabras ul,
	.mso-juego--lista-doble .mso-palabras ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	/* Listas compactas para que Difícil y Muy difícil ocupen menos altura en móvil. */
	.mso-juego--lista-doble .mso-palabras {
		padding: 0.72rem;
	}

	.mso-juego--lista-doble .mso-palabras__header {
		margin-bottom: 0.5rem;
	}

	.mso-juego--lista-doble .mso-palabras__count {
		padding: 0.28rem 0.52rem;
		font-size: 0.76rem;
	}

	.mso-juego--lista-doble .mso-palabras ul {
		column-gap: 0.34rem;
		row-gap: 0.3rem;
	}

	.mso-juego--lista-doble .mso-palabras li {
		gap: 0.28rem;
		padding: 0.34rem 0.4rem;
		font-size: 0.76rem;
		line-height: 1;
		letter-spacing: -0.01em;
		white-space: nowrap;
		overflow: hidden;
	}

	.mso-juego--muy-dificil .mso-palabras li {
		padding-block: 0.31rem;
		font-size: 0.7rem;
	}

	.mso-juego--lista-doble .mso-palabras li > span:first-child {
		width: 0.8rem;
		font-size: 0.9em;
	}

	.mso-juego--lista-doble .mso-palabra-texto {
		min-width: 0;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: clip;
	}

	.mso-controles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.mso-palabras ul {
		grid-template-columns: 1fr;
	}
	.mso-controles {
		grid-template-columns: 1fr;
	}
	.mso-controles .mso-boton:first-child {
		grid-column: auto;
	}
	.mso-boton {
		width: 100%;
	}
}

@media (max-width: 460px) {
	.mso-celda {
		font-size: var(--mso-letter-size-mobile);
	}
	.mso-tema-actual {
		width: 100%;
		justify-content: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mso-progreso-track > span,
	.mso-palabras li,
	.mso-boton {
		transition: none;
	}
}

@media (forced-colors: active) {
	.mso-trazo {
		border: 3px solid CanvasText;
	}
	.mso-progreso-track > span {
		background: CanvasText;
	}
}

body.mso-modal-open {
	overflow: hidden;
}

.mso-modal[hidden] {
	display: none;
}

.mso-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 1.25rem;
	background: rgba(17, 17, 17, 0.58);
}

.mso-modal__panel {
	position: relative;
	width: min(100%, 500px);
	padding: 2.2rem;
	border-radius: 6px;
	background: #ffffff;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
	text-align: center;
}

.mso-modal__eyebrow {
	display: inline-block;
	margin: 0 0 0.8rem;
	padding: 0.4rem 0.85rem;
	border-radius: 999px;
	background: var(--mso-primary);
	color: var(--mso-secondary-dark);
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.mso-modal__panel h2 {
	margin: 0 0 0.65rem;
	font-size: clamp(1.8rem, 5vw, 2.6rem);
	line-height: 1.1;
	color: var(--mso-secondary-dark);
}

.mso-modal__panel > p:not(.mso-modal__eyebrow) {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.55;
	color: #42525d;
}

.mso-modal__close {
	position: absolute;
	top: 0.9rem;
	right: 0.9rem;
	display: grid;
	width: 2.6rem;
	height: 2.6rem;
	place-items: center;
	padding: 0;
	border: 1px solid var(--mso-border);
	border-radius: 999px;
	background: #ffffff;
	color: var(--mso-secondary-dark);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.mso-modal__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.mso-modal__actions .mso-boton {
	min-width: 145px;
}

@media (max-width: 520px) {
	.mso-modal__panel {
		padding: 2rem 1.25rem 1.35rem;
	}
	.mso-modal__actions {
		display: grid;
		grid-template-columns: 1fr;
	}
	.mso-modal__actions .mso-boton {
		width: 100%;
	}
}


/* Tablet táctil: se detecta por capacidad táctil, no por ancho de pantalla. */
.mso-juego.mso-device-tablet .mso-aviso {
	display: none !important;
	position: absolute !important;
	width: 0 !important;
	height: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
}

.mso-juego.mso-device-tablet .mso-contenido,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-contenido {
	grid-template-columns: minmax(0, 1fr) 300px;
	column-gap: 1rem;
	min-width: 0;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-contenido,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked.mso-juego--lista-doble .mso-contenido {
	width: var(--mso-tablet-grid-width) !important;
	min-width: var(--mso-tablet-grid-width) !important;
	max-width: var(--mso-tablet-grid-width) !important;
	grid-template-columns: var(--mso-tablet-board-width) 300px !important;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero-wrap,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero {
	width: var(--mso-tablet-board-width) !important;
	min-width: var(--mso-tablet-board-width) !important;
	max-width: var(--mso-tablet-board-width) !important;
	inline-size: var(--mso-tablet-board-width) !important;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero {
	height: var(--mso-tablet-board-height) !important;
	min-height: var(--mso-tablet-board-height) !important;
	max-height: var(--mso-tablet-board-height) !important;
	block-size: var(--mso-tablet-board-height) !important;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-barra-superior,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-palabras,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-controles {
	width: 300px !important;
	min-width: 300px !important;
	max-width: 300px !important;
	inline-size: 300px !important;
}

.mso-juego.mso-device-tablet .mso-juego--lista-doble .mso-palabras ul,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-palabras ul {
	grid-template-columns: 1fr;
}

/* Ancho móvil estable: el CSS controla siempre el 100 % disponible. */
@media (max-width: 760px) {
	.mso-juego,
	.mso-contenido,
	.mso-juego--lista-doble .mso-contenido,
	.mso-tablero-wrap,
	.mso-tablero {
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		inline-size: 100% !important;
	}

	.mso-contenido,
	.mso-juego--lista-doble .mso-contenido {
		justify-self: stretch;
		justify-content: stretch;
	}

	.mso-tablero-wrap,
	.mso-tablero {
		justify-self: stretch;
		flex: 0 0 100%;
	}
}

/*
 * Versión 1.3.7 — iPad mini.
 * En vertical puede medir menos de 761 px y coincidir con las reglas móviles.
 * La clase aplicada por JavaScript se coloca al final para recuperar el layout
 * de tablet: tablero cuadrado a la izquierda y paneles alineados a la derecha.
 */
.mso-juego.mso-device-tablet .mso-contenido,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-contenido {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 300px !important;
	grid-template-rows: auto 1fr auto !important;
	grid-template-areas:
		"tablero info"
		"tablero palabras"
		"aviso controles" !important;
	column-gap: 1rem !important;
	row-gap: 0.75rem !important;
	align-items: stretch !important;
	justify-content: start !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
}

.mso-juego.mso-device-tablet .mso-tablero-wrap {
	grid-area: tablero !important;
	align-self: stretch !important;
	justify-self: start !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	inline-size: auto !important;
}

.mso-juego.mso-device-tablet .mso-tablero {
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	inline-size: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	block-size: auto !important;
	aspect-ratio: 1 / 1 !important;
}

.mso-juego.mso-device-tablet .mso-barra-superior,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-barra-superior,
.mso-juego.mso-device-tablet .mso-palabras,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-palabras,
.mso-juego.mso-device-tablet .mso-controles {
	width: 300px !important;
	min-width: 300px !important;
	max-width: 300px !important;
	inline-size: 300px !important;
}

.mso-juego.mso-device-tablet .mso-palabras ul,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-palabras ul {
	grid-template-columns: 1fr !important;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-contenido,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked.mso-juego--lista-doble .mso-contenido {
	width: var(--mso-tablet-grid-width) !important;
	min-width: var(--mso-tablet-grid-width) !important;
	max-width: var(--mso-tablet-grid-width) !important;
	grid-template-columns: var(--mso-tablet-board-width) 300px !important;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero-wrap,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero {
	width: var(--mso-tablet-board-width) !important;
	min-width: var(--mso-tablet-board-width) !important;
	max-width: var(--mso-tablet-board-width) !important;
	inline-size: var(--mso-tablet-board-width) !important;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero {
	height: var(--mso-tablet-board-height) !important;
	min-height: var(--mso-tablet-board-height) !important;
	max-height: var(--mso-tablet-board-height) !important;
	block-size: var(--mso-tablet-board-height) !important;
	aspect-ratio: 1 / 1 !important;
}

/*
 * Versión 1.3.8 — composición apilada para tablet.
 * La rejilla se sitúa encima del panel, del listado y de los botones. El tablero
 * conserva la proporción real de filas/columnas para que las celdas sean cuadradas.
 */
.mso-juego.mso-device-tablet .mso-contenido,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-contenido,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-contenido,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked.mso-juego--lista-doble .mso-contenido {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) !important;
	grid-template-rows: auto !important;
	grid-template-areas:
		"tablero"
		"info"
		"palabras"
		"controles" !important;
	row-gap: 1rem !important;
	column-gap: 0 !important;
	align-items: start !important;
	justify-items: center !important;
	justify-content: stretch !important;
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
	overflow: visible !important;
}

.mso-juego.mso-device-tablet .mso-tablero-wrap,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero-wrap {
	grid-area: tablero !important;
	align-self: start !important;
	justify-self: center !important;
	width: min(100%, 760px) !important;
	min-width: 0 !important;
	max-width: 760px !important;
	inline-size: min(100%, 760px) !important;
	overflow: hidden !important;
}

.mso-juego.mso-device-tablet .mso-tablero,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero {
	width: 100% !important;
	min-width: 0 !important;
	max-width: 760px !important;
	inline-size: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	block-size: auto !important;
	aspect-ratio: var(--mso-grid-columns) / var(--mso-grid-rows) !important;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero-wrap,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero {
	width: min(100%, var(--mso-tablet-board-width, 760px)) !important;
	max-width: var(--mso-tablet-board-width, 760px) !important;
	inline-size: min(100%, var(--mso-tablet-board-width, 760px)) !important;
}

.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-tablero {
	height: var(--mso-tablet-board-height) !important;
	min-height: var(--mso-tablet-board-height) !important;
	max-height: var(--mso-tablet-board-height) !important;
	block-size: var(--mso-tablet-board-height) !important;
	aspect-ratio: auto !important;
}

.mso-juego.mso-device-tablet .mso-barra-superior,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-barra-superior,
.mso-juego.mso-device-tablet .mso-palabras,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-palabras,
.mso-juego.mso-device-tablet .mso-controles,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-barra-superior,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-palabras,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-controles {
	justify-self: center !important;
	width: min(100%, 760px) !important;
	min-width: 0 !important;
	max-width: 760px !important;
	inline-size: min(100%, 760px) !important;
}

.mso-juego.mso-device-tablet .mso-palabras ul,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-palabras ul {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}


/*
 * Versión 1.3.9 — orden definitivo en tablet.
 * Tema, dificultad, progreso y cronómetro se sitúan encima de la rejilla.
 * El listado de palabras y los botones permanecen debajo.
 */
.mso-juego.mso-device-tablet .mso-contenido,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-contenido,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-contenido,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked.mso-juego--lista-doble .mso-contenido {
	grid-template-areas:
		"info"
		"tablero"
		"palabras"
		"controles" !important;
}

.mso-juego.mso-device-tablet .mso-barra-superior,
.mso-juego.mso-device-tablet.mso-juego--lista-doble .mso-barra-superior,
.mso-juego.mso-device-tablet.mso-tablet-geometry-locked .mso-barra-superior {
	grid-area: info !important;
	align-self: start !important;
	margin: 0 !important;
}

.mso-juego.mso-device-tablet .mso-encabezado-partida {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(180px, 1.15fr) 108px !important;
	grid-template-areas:
		"topic difficulty timer"
		"progress progress progress" !important;
	gap: 0.55rem !important;
	align-items: stretch !important;
}

.mso-juego.mso-device-tablet .mso-tema-actual {
	grid-area: topic !important;
	height: 100% !important;
	min-height: 72px !important;
	align-items: center !important;
}

.mso-juego.mso-device-tablet .mso-resumen-partida {
	display: contents !important;
}

.mso-juego.mso-device-tablet .mso-selector-dificultad {
	grid-area: difficulty !important;
}

.mso-juego.mso-device-tablet .mso-cronometro {
	grid-area: timer !important;
}

.mso-juego.mso-device-tablet .mso-progreso-resumen {
	grid-area: progress !important;
}

.mso-juego.mso-device-tablet .mso-tablero-wrap {
	grid-area: tablero !important;
}

.mso-juego.mso-device-tablet .mso-palabras {
	grid-area: palabras !important;
}

.mso-juego.mso-device-tablet .mso-controles {
	grid-area: controles !important;
}

@media (max-width: 660px) {
	.mso-juego.mso-device-tablet .mso-encabezado-partida {
		grid-template-columns: minmax(0, 1fr) 104px !important;
		grid-template-areas:
			"topic topic"
			"difficulty timer"
			"progress progress" !important;
	}

	.mso-juego.mso-device-tablet .mso-tema-actual {
		min-height: 0 !important;
	}
}
