:root {
	--scp-primary-color: #2563eb;
	--scp-button-color: #16a34a;
	--scp-popup-width: 520px;
	--scp-card-aspect: 1.5;
	--scp-text-color: #0f172a;
	--scp-surface: #ffffff;
	--scp-overlay: rgba(2, 6, 23, 0.72);
}

.scp-card {
	position: relative;
	max-width: 100%;
	margin: 0 auto 24px;
	color: var(--scp-text-color);
	font-family: inherit;
}

.scp-card__inner {
	position: relative;
	overflow: hidden;
	border-radius: 20px;
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
	background: #0f172a;
	/* This ties the container's height directly to the configured aspect
	   ratio (the --scp-card-aspect custom property is already set by
	   scratch.js on .scp-card) instead of letting normal document flow
	   decide it. Without this, the container's height is derived only from
	   its in-flow content (the canvas) — so if anything else inside ever
	   ends up contributing extra height (e.g. the hint text losing its
	   `position: absolute` for any reason, such as a conflicting theme or
	   plugin stylesheet), the background stretches to match that taller
	   box while the canvas overlay stays at its own JS-computed height,
	   leaving a visible strip of background peeking out at the bottom.
	   Locking the height to the aspect ratio here means any such excess
	   content is simply clipped by overflow: hidden instead. */
	aspect-ratio: var(--scp-card-aspect, 1.5);
}

.scp-card__background {
	position: absolute;
	inset: 0;
}

.scp-card__background img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.scp-card__scratch-wrap {
	position: absolute;
	inset: 0;
	display: block;
}

.scp-card__canvas {
	display: block;
	width: 100%;
	height: auto;
	touch-action: none;
	cursor: grab;
}

.scp-card--scratching .scp-card__canvas {
	cursor: grabbing;
}

.scp-card__hint {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	padding: 10px 14px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.72);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	backdrop-filter: blur(10px);
	pointer-events: none;
}

.scp-card--revealed .scp-card__hint {
	opacity: 0;
	visibility: hidden;
	transform: translateX(-50%) translateY(6px);
}

.scp-card--mobile-disabled .scp-card__scratch-wrap {
	display: none;
}

.scp-popup {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: transparent;
}

.scp-popup.is-open {
	display: flex;
}

body.scp-popup-open {
	overflow: hidden;
}

.scp-popup__overlay {
	position: absolute;
	inset: 0;
	background: var(--scp-overlay);
	backdrop-filter: blur(8px);
}

.scp-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(100%, var(--scp-popup-width));
	max-height: min(90vh, 780px);
	overflow: auto;
	border-radius: 24px;
	background: var(--scp-surface);
	color: var(--scp-text-color);
	box-shadow: 0 24px 80px rgba(2, 6, 23, 0.35);
	transform-origin: center;
	outline: none;
}

.scp-popup--dark .scp-popup__dialog {
	background: #0f172a;
	color: #e2e8f0;
}

.scp-popup__body {
	padding: 28px;
}

.scp-popup__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 999px;
	background: rgba(148, 163, 184, 0.12);
	color: inherit;
	font-size: 24px;
	cursor: pointer;
}

.scp-popup__title {
	margin: 0 44px 14px 0;
	font-size: 28px;
	line-height: 1.2;
}

.scp-popup__content {
	font-size: 16px;
	line-height: 1.7;
	color: inherit;
}

.scp-popup__content a {
	color: var(--scp-primary-color);
}

.scp-popup__coupon {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 20px;
	padding: 16px 18px;
	border-radius: 16px;
	background: rgba(37, 99, 235, 0.08);
}

.scp-popup--dark .scp-popup__coupon {
	background: rgba(96, 165, 250, 0.12);
}

.scp-popup__coupon-label {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.scp-popup__coupon-code {
	font-size: 18px;
	letter-spacing: 0.06em;
	word-break: break-all;
}

.scp-popup__notice {
	min-height: 24px;
	margin-top: 18px;
	font-size: 14px;
	line-height: 1.5;
	color: #0f172a;
}

.scp-popup--dark .scp-popup__notice {
	color: #e2e8f0;
}

.scp-popup__notice.is-error {
	color: #b91c1c;
}

.scp-popup__notice.is-success {
	color: #15803d;
}

.scp-popup__actions {
	display: flex;
	justify-content: flex-start;
	margin-top: 22px;
}

.scp-popup__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 20px;
	border-radius: 999px;
	background: var(--scp-button-color);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 14px 26px rgba(22, 163, 74, 0.24);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.scp-popup__button:hover,
.scp-popup__button:focus {
	transform: translateY(-1px);
	box-shadow: 0 18px 34px rgba(22, 163, 74, 0.3);
}

.scp-popup--fade .scp-popup__dialog {
	animation: scpFadeIn 0.24s ease-out;
}

.scp-popup--scale .scp-popup__dialog {
	animation: scpScaleIn 0.24s ease-out;
}

.scp-popup--slide-up .scp-popup__dialog {
	animation: scpSlideUp 0.26s ease-out;
}

@keyframes scpFadeIn {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes scpScaleIn {
	from {
		opacity: 0;
		transform: scale(0.94);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes scpSlideUp {
	from {
		opacity: 0;
		transform: translateY(24px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 782px) {
	.scp-popup {
		padding: 14px;
	}

	.scp-popup__body {
		padding: 22px;
	}

	.scp-popup__title {
		font-size: 24px;
	}

	.scp-popup__coupon {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.scp-popup--fade .scp-popup__dialog,
	.scp-popup--scale .scp-popup__dialog,
	.scp-popup--slide-up .scp-popup__dialog {
		animation: none;
	}
}
