.sp-game {
	--sp-card-width: clamp(66px, 7.5vw, 104px);
	--sp-card-height: calc(var(--sp-card-width) * 1.42);
	--sp-gold: #f4cf68;
	--sp-cream: #fffdf7;
	--sp-green: #0b5f43;
	background:
		radial-gradient(circle at 50% 32%, rgba(31, 139, 96, 0.54), transparent 42%),
		linear-gradient(145deg, #0d6b4d, #063a32 72%, #042824);
	border-radius: 18px;
	box-sizing: border-box;
	color: #fff;
	font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	min-height: 532px;
	overflow: hidden;
	padding: 14px;
	position: relative;
}

.sp-game::before {
	background-image:
		linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
	background-size: 22px 22px;
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.sp-toolbar,
.sp-toprow,
.sp-tableau,
.sp-mobile-tip {
	position: relative;
	z-index: 1;
}

.sp-toolbar {
	align-items: center;
	background: rgba(4, 30, 25, 0.56);
	border: 1px solid rgba(255,255,255,.12);
	border-radius: 14px;
	display: grid;
	gap: 12px;
	grid-template-columns: minmax(110px, .65fr) minmax(250px, 1fr) minmax(240px, 1fr);
	padding: 10px 12px;
}

.sp-brand span,
.sp-brand strong {
	display: block;
	line-height: 1;
}

.sp-brand span {
	color: rgba(255,255,255,.7);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.sp-brand strong {
	color: var(--sp-gold);
	font-family: Georgia, "Times New Roman", serif;
	font-size: 22px;
	margin-top: 4px;
}

.sp-statsbar {
	display: grid;
	gap: 6px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sp-statsbar > div {
	background: rgba(255,255,255,.06);
	border: 1px solid rgba(255,255,255,.09);
	border-radius: 10px;
	padding: 7px 9px;
	text-align: center;
}

.sp-statsbar span {
	color: rgba(255,255,255,.65);
	display: block;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.sp-statsbar strong {
	color: #fff;
	display: block;
	font-size: 14px;
	margin-top: 2px;
}

.sp-actions {
	display: flex;
	gap: 7px;
	justify-content: flex-end;
}

.sp-actions button {
	background: rgba(255,255,255,.08);
	border: 1px solid rgba(255,255,255,.16);
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font-size: 12px;
	font-weight: 800;
	min-height: 36px;
	padding: 8px 13px;
}

.sp-actions button:hover:not(:disabled) {
	background: rgba(255,255,255,.14);
	border-color: rgba(244,207,104,.65);
	color: var(--sp-gold);
}

.sp-actions button:disabled {
	cursor: not-allowed;
	opacity: .4;
}

.sp-actions .sp-actions__primary {
	background: linear-gradient(180deg, #f7d775, #d8a728);
	border-color: #f9df8b;
	color: #17221d;
}

.sp-toprow {
	align-items: center;
	display: grid;
	gap: 12px;
	grid-template-columns: minmax(120px, .7fr) minmax(220px, 1fr) minmax(310px, 1.7fr);
	margin: 12px 2px 8px;
	min-height: 72px;
}

.sp-stock-area {
	align-items: center;
	display: flex;
	gap: 9px;
}

.sp-stock {
	align-items: center;
	background: transparent;
	border: 0;
	cursor: pointer;
	display: inline-flex;
	height: 66px;
	justify-content: center;
	padding: 0;
	width: 48px;
}

.sp-stock:disabled {
	cursor: default;
}

.sp-stock__back,
.sp-card--back {
	background:
		linear-gradient(45deg, rgba(255,255,255,.13) 25%, transparent 25%) 0 0 / 14px 14px,
		linear-gradient(-45deg, rgba(255,255,255,.13) 25%, transparent 25%) 0 0 / 14px 14px,
		#173e79;
	border: 4px solid #f4f7fb;
	box-shadow: 0 6px 12px rgba(0,0,0,.22);
	color: var(--sp-gold);
}

.sp-stock__back {
	align-items: center;
	border-radius: 7px;
	display: flex;
	font-size: 10px;
	font-weight: 900;
	height: 62px;
	justify-content: center;
	letter-spacing: .08em;
	width: 44px;
}

.sp-stock__empty {
	align-items: center;
	border: 1px dashed rgba(255,255,255,.32);
	border-radius: 7px;
	color: rgba(255,255,255,.5);
	display: flex;
	height: 62px;
	justify-content: center;
	width: 44px;
}

.sp-deals {
	display: flex;
	gap: 4px;
}

.sp-deals span {
	background: rgba(255,255,255,.13);
	border-radius: 50%;
	height: 7px;
	width: 7px;
}

.sp-deals span.is-active {
	background: var(--sp-gold);
	box-shadow: 0 0 8px rgba(244,207,104,.5);
}

.sp-message {
	color: rgba(255,255,255,.76);
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
}

.sp-completed {
	display: grid;
	gap: 5px;
	grid-template-columns: repeat(8, 1fr);
	justify-self: end;
	width: min(100%, 390px);
}

.sp-completed-card {
	align-items: center;
	background: var(--sp-cream);
	border: 1px solid rgba(0,0,0,.15);
	border-radius: 6px;
	box-shadow: 0 4px 10px rgba(0,0,0,.2);
	color: #141821;
	display: flex;
	height: 58px;
	justify-content: center;
	position: relative;
}

.sp-completed-card--red {
	color: #cf2f45;
}

.sp-completed-card--empty {
	background: rgba(0,0,0,.12);
	border: 1px dashed rgba(255,255,255,.25);
	box-shadow: none;
}

.sp-completed-card span,
.sp-completed-card small {
	font-size: 9px;
	font-weight: 900;
	position: absolute;
}

.sp-completed-card span {
	left: 4px;
	top: 3px;
}

.sp-completed-card small {
	bottom: 3px;
	right: 4px;
}

.sp-completed-card strong {
	font-size: 23px;
}

.sp-tableau {
	display: grid;
	gap: clamp(4px, .65vw, 9px);
	grid-template-columns: repeat(10, minmax(0, 1fr));
	min-height: 370px;
	padding: 0 2px 4px;
}

.sp-column {
	border: 1px solid transparent;
	border-radius: 8px;
	min-width: 0;
	position: relative;
	transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.sp-column--empty::before {
	border: 1px dashed rgba(255,255,255,.25);
	border-radius: 8px;
	content: "";
	height: var(--sp-card-height);
	left: 0;
	position: absolute;
	top: 0;
	width: 100%;
}

.sp-column--drop,
.sp-hint-destination {
	background: rgba(244,207,104,.12);
	border-color: rgba(244,207,104,.75);
	box-shadow: inset 0 0 0 2px rgba(244,207,104,.18), 0 0 18px rgba(244,207,104,.18);
}

.sp-column--blocked {
	animation: sp-shake 260ms linear 2;
	border-color: #ff7474;
}

.sp-card-wrap {
	left: 0;
	position: absolute;
	width: 100%;
}

.sp-card {
	background: var(--sp-cream);
	border: 1px solid rgba(0,0,0,.17);
	border-radius: clamp(5px, .7vw, 9px);
	box-shadow: 0 4px 9px rgba(0,0,0,.2);
	box-sizing: border-box;
	color: #111722;
	height: var(--sp-card-height);
	position: relative;
	user-select: none;
	width: 100%;
}

.sp-card--face {
	cursor: pointer;
	touch-action: manipulation;
}

.sp-card--red {
	color: #cf2f45;
}

.sp-card--back {
	align-items: center;
	display: flex;
	justify-content: center;
}

.sp-card__back-mark {
	font-size: clamp(8px, .8vw, 12px);
	font-weight: 900;
	letter-spacing: .08em;
}

.sp-card__corner {
	left: clamp(4px, .55vw, 7px);
	line-height: .9;
	position: absolute;
	top: clamp(4px, .55vw, 7px);
}

.sp-card__corner strong {
	display: block;
	font-size: clamp(12px, 1.45vw, 20px);
}

.sp-card__corner small {
	display: block;
	font-size: clamp(10px, 1.25vw, 17px);
	margin-top: 3px;
}

.sp-card__suit {
	font-size: clamp(25px, 3.2vw, 48px);
	left: 50%;
	position: absolute;
	top: 55%;
	transform: translate(-50%, -50%);
}

.sp-card--selected {
	box-shadow: 0 0 0 3px var(--sp-gold), 0 10px 20px rgba(0,0,0,.3);
	transform: translateY(-3px);
}

.sp-card--dragging {
	opacity: .56;
}

.sp-hint-source {
	animation: sp-hint-pulse 650ms ease-in-out infinite alternate;
	box-shadow: 0 0 0 3px #7ee8ff, 0 0 20px rgba(126,232,255,.65);
}

.sp-mobile-tip {
	color: rgba(255,255,255,.6);
	display: none;
	font-size: 11px;
	margin-top: 8px;
	text-align: center;
}

.sp-dialog {
	background: #101c2e;
	border: 1px solid rgba(255,255,255,.16);
	border-radius: 18px;
	box-shadow: 0 30px 90px rgba(0,0,0,.5);
	color: #fff;
	max-width: 420px;
	padding: 0;
	width: calc(100% - 30px);
}

.sp-dialog::backdrop {
	background: rgba(2, 7, 13, .78);
	backdrop-filter: blur(3px);
}

.sp-dialog form {
	padding: 26px;
	position: relative;
}

.sp-dialog__close {
	background: transparent;
	border: 0;
	color: rgba(255,255,255,.7);
	cursor: pointer;
	font-size: 26px;
	position: absolute;
	right: 14px;
	top: 10px;
}

.sp-dialog__eyebrow {
	color: var(--sp-gold);
	font-size: 11px;
	font-weight: 850;
	letter-spacing: .14em;
	margin: 0 0 8px;
	text-transform: uppercase;
}

.sp-dialog h2 {
	color: #fff;
	font-size: 28px;
	margin: 0 0 18px;
}

.sp-dialog label {
	color: rgba(255,255,255,.72);
	display: block;
	font-size: 13px;
	font-weight: 800;
	margin-bottom: 7px;
}

.sp-dialog select {
	background: #07111f;
	border: 1px solid rgba(255,255,255,.18);
	border-radius: 10px;
	color: #fff;
	font-size: 15px;
	min-height: 46px;
	padding: 9px 12px;
	width: 100%;
}

.sp-dialog p {
	color: rgba(255,255,255,.68);
	line-height: 1.6;
}

.sp-dialog__buttons {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 20px;
}

.sp-dialog__buttons button {
	background: rgba(255,255,255,.09);
	border: 1px solid rgba(255,255,255,.15);
	border-radius: 999px;
	color: #fff;
	cursor: pointer;
	font-weight: 800;
	padding: 10px 16px;
}

.sp-dialog__buttons .is-primary {
	background: linear-gradient(180deg, #f7d775, #d8a728);
	border-color: #f7d775;
	color: #17221d;
}

.sp-dialog--win {
	text-align: center;
}

@keyframes sp-hint-pulse {
	from { transform: translateY(0); }
	to { transform: translateY(-5px); }
}

@keyframes sp-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-3px); }
	75% { transform: translateX(3px); }
}

@media (max-width: 980px) {
	.sp-game {
		--sp-card-width: clamp(55px, 8.7vw, 82px);
	}

	.sp-toolbar {
		grid-template-columns: auto 1fr;
	}

	.sp-actions {
		grid-column: 1 / -1;
		justify-content: center;
	}

	.sp-toprow {
		grid-template-columns: 110px 1fr;
	}

	.sp-completed {
		grid-column: 1 / -1;
		justify-self: stretch;
		width: 100%;
	}

	.sp-completed-card {
		height: 45px;
	}
}

@media (max-width: 700px) {
	.sp-game {
		--sp-card-width: clamp(42px, 9.1vw, 62px);
		border-radius: 10px;
		min-height: 486px;
		padding: 7px;
	}

	.sp-toolbar {
		gap: 7px;
		padding: 8px;
	}

	.sp-brand {
		display: none;
	}

	.sp-toolbar {
		grid-template-columns: 1fr;
	}

	.sp-statsbar {
		grid-column: 1;
	}

	.sp-actions {
		gap: 5px;
		grid-column: 1;
	}

	.sp-actions button {
		flex: 1;
		font-size: 11px;
		min-height: 34px;
		padding: 7px 8px;
	}

	.sp-toprow {
		gap: 6px;
		grid-template-columns: 80px 1fr;
		margin-top: 7px;
		min-height: 52px;
	}

	.sp-stock {
		height: 51px;
		width: 37px;
	}

	.sp-stock__back,
	.sp-stock__empty {
		height: 48px;
		width: 34px;
	}

	.sp-deals {
		gap: 2px;
	}

	.sp-deals span {
		height: 5px;
		width: 5px;
	}

	.sp-message {
		font-size: 10px;
	}

	.sp-completed-card {
		border-radius: 4px;
		height: 36px;
	}

	.sp-completed-card strong {
		font-size: 17px;
	}

	.sp-completed-card span,
	.sp-completed-card small {
		display: none;
	}

	.sp-tableau {
		gap: 2px;
		min-height: 350px;
		padding: 0;
	}

	.sp-column {
		border-radius: 5px;
	}

	.sp-column--empty::before {
		border-radius: 5px;
	}

	.sp-card {
		border-radius: 4px;
	}

	.sp-card__corner {
		left: 3px;
		top: 3px;
	}

	.sp-card__corner strong {
		font-size: clamp(10px, 2.8vw, 14px);
	}

	.sp-card__corner small {
		font-size: clamp(9px, 2.4vw, 12px);
		margin-top: 2px;
	}

	.sp-card__suit {
		font-size: clamp(19px, 5vw, 28px);
	}

	.sp-mobile-tip {
		display: block;
	}
}

@media (max-width: 430px) {
	.sp-game {
		--sp-card-height: 91px;
	}

	.sp-completed {
		gap: 3px;
	}

	.sp-completed-card {
		height: 30px;
	}

	.sp-tableau {
		min-height: 330px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sp-card--selected,
	.sp-hint-source,
	.sp-column--blocked {
		animation: none;
	}
}
