/*
 * DemoSlot Embed, front end: the DemoSlot card on any theme (navy ground, yellow Play, the credit
 * line in the card and never hidden). Classes and data attributes are the plugin's contract with
 * front.js; colors come from the custom properties below.
 */

.dsemb {
	--dsemb-bg: #080925;
	--dsemb-deep: #13153a;
	--dsemb-card: #242741;
	--dsemb-line: #2c3052;
	--dsemb-line2: #454b7c;
	--dsemb-fg: #f2f3fa;
	--dsemb-muted: #b0b2c4;
	--dsemb-accent: #ffd119;
	--dsemb-accent-hover: #ffdb4d;
	--dsemb-accent-text: #15130a;
	--dsemb-link: #66a7ff;
	--dsemb-radius: 14px;
	--dsemb-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	box-sizing: border-box;
	margin: 0 0 1.4em;
	color: var(--dsemb-fg);
	font-family: var(--dsemb-font);
	font-size: 15px;
	line-height: 1.45;
	text-align: left;
}

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

.dsemb ::selection {
	background: #ffd119;
	color: #15130a;
}

.dsemb button {
	margin: 0;
	font-family: var(--dsemb-font);
	letter-spacing: normal;
	text-transform: none;
}

.dsemb button:focus-visible,
.dsemb a:focus-visible,
.dsemb select:focus-visible {
	outline: 3px solid var(--dsemb-link);
	outline-offset: 3px;
}

/* ---------- one game: the card ---------- */
.dsemb-game {
	overflow: hidden;
	border-radius: var(--dsemb-radius);
	background: var(--dsemb-bg);
	box-shadow: 0 10px 30px -12px rgba(8, 9, 37, 0.55);
}

.dsemb-player__box {
	container-type: inline-size;
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--dsemb-deep);
	color: var(--dsemb-fg);
}

.dsemb-player__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
}

.dsemb-player__poster--none {
	display: block;
	background:
		radial-gradient(circle at 50% 38%, rgba(102, 167, 255, 0.16) 0, rgba(102, 167, 255, 0) 45%),
		var(--dsemb-deep);
}

.dsemb-player__info {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 2px 10px;
	align-items: baseline;
	padding: 3em 120px 14px 18px;
	background: linear-gradient(180deg, rgba(8, 9, 37, 0) 0, rgba(8, 9, 37, 0.86) 70%);
}

.dsemb-player__name {
	flex: 1 1 100%;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.dsemb-player__studio {
	color: var(--dsemb-muted);
	font-size: 13.5px;
}

.dsemb-player__tag {
	position: absolute;
	right: 18px;
	bottom: 16px;
	padding: 6px 9px;
	border-radius: 999px;
	background: rgba(102, 167, 255, 0.18);
	color: #c9dcff;
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.dsemb-player__play {
	position: absolute;
	top: 44%;
	left: 50%;
	display: inline-flex;
	gap: 10px;
	align-items: center;
	min-height: 52px;
	padding: 0 26px 0 20px;
	border: 0;
	border-radius: 999px;
	background: var(--dsemb-accent);
	box-shadow: 0 8px 24px -6px rgba(255, 209, 25, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
	color: var(--dsemb-accent-text);
	font-size: 17px;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transform: translate(-50%, -50%);
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease-out;
}

.dsemb-player__play:hover {
	background: var(--dsemb-accent-hover);
	transform: translate(-50%, -50%) scale(1.04);
}

.dsemb-player__play:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.dsemb-player__icon {
	width: 0;
	height: 0;
	border-color: transparent transparent transparent currentColor;
	border-style: solid;
	border-width: 0.42em 0 0.42em 0.7em;
}

/* Playing: the game fills the box; under it Full screen and Close (front.js). */
.dsemb-player.is-playing .dsemb-player__box {
	background: #000;
}

.dsemb-frame {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.dsemb-player__loading {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 14px;
	background: rgba(8, 9, 37, 0.78);
	color: var(--dsemb-muted);
	font-size: 14px;
}

.dsemb-player__loading::before {
	content: "";
	width: 44px;
	height: 44px;
	border: 3px solid var(--dsemb-line2);
	border-top-color: var(--dsemb-accent);
	border-radius: 50%;
	animation: dsemb-spin 1s linear infinite;
}

.dsemb-player__bar {
	display: flex;
	gap: 6px;
	justify-content: flex-end;
	padding: 10px 16px 0;
	background: var(--dsemb-bg);
}

.dsemb-player__tool {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	min-height: 34px;
	padding: 0 12px;
	border: 1px solid var(--dsemb-line2);
	border-radius: 8px;
	background: transparent;
	color: var(--dsemb-fg);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.dsemb-player__tool:hover {
	border-color: var(--dsemb-link);
}

.dsemb-player__tool svg {
	width: 15px;
	height: 15px;
}

/* The credit line inside the card. */
.dsemb-game .demoslot-credit,
.dsemb-grid .demoslot-credit {
	margin: 0;
	padding: 11px 16px 12px;
	background: var(--dsemb-bg);
	color: var(--dsemb-muted);
	font-family: var(--dsemb-font);
	font-size: 13px;
	line-height: 1.4;
}

.dsemb-game .demoslot-credit a,
.dsemb-grid .demoslot-credit a {
	color: var(--dsemb-link);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* A credit line printed on its own (an older cached page) still reads. */
.demoslot-credit {
	margin: 0.35em 0 1.2em;
	font-size: 0.85em;
}

/* ---------- grid ---------- */
.dsemb-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
	padding: 18px 18px 0;
	overflow: hidden;
	border-radius: 16px;
	background: var(--dsemb-bg);
}

.dsemb-grid .demoslot-credit {
	margin: 0 -18px;
	padding-left: 18px;
	border-top: 1px solid var(--dsemb-line);
}

.dsemb-grid__head {
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-end;
	justify-content: flex-end;
}

.dsemb-grid__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	min-width: 0;
	margin: 0;
}

.dsemb-grid__filter {
	display: grid;
	gap: 4px;
	min-width: 0;
	color: var(--dsemb-muted);
	font-size: 12px;
	font-weight: 600;
}

.dsemb-grid__filter select {
	width: 100%;
	min-width: 0;
	min-height: 38px;
	max-width: 100%;
	margin: 0;
	padding: 0 34px 0 12px;
	border: 1px solid var(--dsemb-line2);
	border-radius: 8px;
	background: var(--dsemb-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b0b2c4' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
	color: var(--dsemb-fg);
	font: 14px/1.2 var(--dsemb-font);
	appearance: none;
}

.dsemb-grid__list {
	display: grid;
	grid-template-columns: repeat(var(--dsemb-cols, 4), minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dsemb-grid__item {
	min-width: 0;
	margin: 0;
	padding: 0;
}

.dsemb-grid__item::before {
	content: none;
}

/* A tile: the picture, a round yellow Play on it, name and studio under it. */
.dsemb-player--tile {
	overflow: hidden;
	border-radius: 12px;
	background: var(--dsemb-card);
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease-out;
}

.dsemb-player--tile:hover {
	box-shadow: 0 12px 22px -12px rgba(0, 0, 0, 0.7);
	transform: translateY(-3px);
}

.dsemb-grid__item > .dsemb-player--tile {
	height: 100%;
}

.dsemb-player--tile .dsemb-player__box {
	display: flex;
	flex-direction: column;
	height: 100%;
	aspect-ratio: auto;
	background: var(--dsemb-card);
}

.dsemb-player--tile .dsemb-player__poster {
	position: relative;
	inset: auto;
	flex: none;
	height: auto;
	aspect-ratio: 16 / 10;
	background-color: var(--dsemb-deep);
}

.dsemb-player--tile .dsemb-player__info {
	position: static;
	display: grid;
	gap: 2px;
	padding: 10px 12px 12px;
	background: none;
}

.dsemb-player--tile .dsemb-player__name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 14.5px;
	line-height: 1.3;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.dsemb-player--tile .dsemb-player__studio {
	overflow: hidden;
	font-size: 12.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.dsemb-player--tile .dsemb-player__play {
	top: calc(62.5cqi - 54px);
	right: 10px;
	left: auto;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	padding: 0;
	box-shadow: 0 6px 16px -6px rgba(255, 209, 25, 0.6);
	transform: none;
}

.dsemb-player--tile .dsemb-player__play:hover {
	transform: scale(1.06);
}

.dsemb-player--tile .dsemb-player__icon {
	margin-left: 3px;
	font-size: 15px;
}

.dsemb-player--tile .dsemb-player__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.dsemb-player--tile.is-playing .dsemb-player__box {
	aspect-ratio: 16 / 10;
}

/* Re-loading after a filter change: the tiles shimmer. */
.dsemb-grid__list[aria-busy="true"] .dsemb-player--tile {
	position: relative;
}

.dsemb-grid__list[aria-busy="true"] .dsemb-player--tile::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(36, 39, 65, 0.85) 0, rgba(45, 49, 82, 0.95) 50%, rgba(36, 39, 65, 0.85) 100%) 0 0 / 200% 100%;
	animation: dsemb-shimmer 1.4s ease-in-out infinite;
}

.dsemb-grid__empty {
	display: grid;
	justify-items: center;
	gap: 12px;
	padding: 30px 16px;
	border-radius: 12px;
	background: var(--dsemb-deep);
	text-align: center;
}

.dsemb-grid__empty[hidden] {
	display: none;
}

.dsemb-grid__empty p {
	margin: 0;
	color: var(--dsemb-muted);
	font-size: 14px;
}

.dsemb-grid__empty strong {
	display: block;
	color: var(--dsemb-fg);
	font-size: 17px;
}

.dsemb-grid__reset {
	min-height: 40px;
	padding: 0 18px;
	border: 0;
	border-radius: 999px;
	background: var(--dsemb-accent);
	color: var(--dsemb-accent-text);
	font-size: 14px;
	font-weight: 800;
	cursor: pointer;
}

@media (min-width: 601px) {
	.dsemb-grid__filter select {
		width: auto;
		max-width: 260px;
	}
}

@media (max-width: 782px) {
	.dsemb-grid__list {
		grid-template-columns: repeat(min(var(--dsemb-cols, 4), 3), minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.dsemb-grid__list {
		grid-template-columns: repeat(min(var(--dsemb-cols, 4), 2), minmax(0, 1fr));
	}

	.dsemb-grid {
		padding: 14px 14px 0;
	}

	.dsemb-grid .demoslot-credit {
		margin: 0 -14px;
		padding-left: 14px;
	}

	.dsemb-grid__head,
	.dsemb-grid__filters {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 360px) {
	.dsemb-grid__list {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Narrow single players: a smaller Play and name, no label. */
@container (max-width: 420px) {
	.dsemb-player:not(.dsemb-player--tile) .dsemb-player__play {
		min-height: 46px;
		padding: 0 20px 0 16px;
		font-size: 15px;
	}

	.dsemb-player:not(.dsemb-player--tile) .dsemb-player__name {
		font-size: 16px;
	}

	.dsemb-player:not(.dsemb-player--tile) .dsemb-player__info {
		padding-right: 18px;
	}

	.dsemb-player:not(.dsemb-player--tile) .dsemb-player__tag {
		display: none;
	}
}

/* ---------- pop-up ---------- */
.dsemb-dialog {
	width: min(96vw, 1100px);
	max-width: none;
	padding: 0;
	overflow: visible;
	border: 0;
	border-radius: var(--dsemb-radius, 14px);
	background: #000;
}

.dsemb-dialog::backdrop {
	background: rgba(4, 5, 20, 0.86);
}

.dsemb-dialog__body {
	position: relative;
	width: 100%;
	max-height: 86vh;
	aspect-ratio: 16 / 9;
}

.dsemb-dialog__close {
	position: absolute;
	top: -46px;
	right: 0;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #111;
	cursor: pointer;
}

.dsemb-dialog__close svg {
	width: 18px;
	height: 18px;
}

.dsemb-dialog__close:focus-visible {
	outline: 3px solid #ffd119;
	outline-offset: 2px;
}

/* ---------- editor notice ---------- */
.dsemb-notice {
	padding: 0.6em 0.9em;
	border: 1px solid #f0c3bf;
	border-radius: 8px;
	background: #fbe9e8;
	color: #7d1a14;
	font-size: 0.9em;
}

@keyframes dsemb-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes dsemb-shimmer {
	to {
		background-position: -200% 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dsemb-player__play,
	.dsemb-player--tile {
		transition: none;
	}

	.dsemb-player__loading::before,
	.dsemb-grid__list[aria-busy="true"] .dsemb-player--tile::after {
		animation: none;
	}
}
