.gaya-scratch-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.gaya-scratch-popup.is-visible {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease;
}

.gaya-scratch-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 25, 18, 0.64);
}

.gaya-scratch-popup__card {
	position: relative;
	width: 100%;
	max-height: min(660px, 92vh);
	max-height: min(660px, 92dvh);
	overflow: hidden;
	overflow-y: auto;
	background: #fff;
	background-clip: padding-box;
	border-radius: 18px 18px 0 0;
	padding: 0 0 max(16px, env(safe-area-inset-bottom, 0));
	box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.22);
	isolation: isolate;
	transform: translateY(100%);
	transition: transform 0.35s ease;
}

.gaya-scratch-popup.is-visible .gaya-scratch-popup__card {
	transform: translateY(0);
}

.gaya-scratch-popup__header {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 56px 0 16px;
	background: #23583a;
	color: #fff;
}

.gaya-scratch-popup__mark {
	width: 25px;
	height: 25px;
	object-fit: contain;
	filter: brightness(0) invert(1);
}

#gaya-scratch-popup .gaya-scratch-popup__logo {
	font-family: var(--gaya-heading-font, "Cormorant Garamond", georgia, "Times New Roman", serif) !important;
	font-size: 21px;
	font-weight: 600;
	letter-spacing: 0.05em;
}

.gaya-scratch-popup__close {
	position: absolute;
	top: 0;
	right: 4px;
	z-index: 5;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.gaya-scratch-popup__prelude {
	padding: 22px 22px 0;
}

.gaya-scratch-popup__eyebrow {
	margin: 0 0 7px;
	color: #6b7d63;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

#gaya-scratch-popup .gaya-scratch-popup__intro {
	margin: 0;
	color: #1b2a1d;
	font-family: var(--gaya-heading-font, "Cormorant Garamond", georgia, "Times New Roman", serif) !important;
	font-size: clamp(26px, 7vw, 34px);
	font-weight: 600;
	line-height: 1.08;
}

.gaya-scratch-popup__subtitle {
	margin: 9px 0 0;
	color: #526054;
	font-size: 15px;
	line-height: 1.4;
}

.gaya-scratch-popup__stage {
	position: relative;
	width: calc(100% - 44px);
	min-height: 215px;
	margin: 22px auto 30px;
	overflow: hidden;
	border: 1px solid #d5decf;
	border-radius: 14px;
	background: #f3f4ed;
}

.gaya-scratch-popup__reveal {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 16px;
	background: radial-gradient(circle at 50% 0%, #fff 0, #f3f4ed 58%, #e8ebdf 100%);
	color: #1b2a1d;
	text-align: center;
}

.gaya-scratch-popup__reward-kicker {
	margin: 0;
	color: #23583a;
	font-family: var(--gaya-heading-font, "Cormorant Garamond", georgia, "Times New Roman", serif) !important;
	font-size: 20px;
	font-weight: 700;
}

.gaya-scratch-popup__product-image {
	width: 72px;
	height: 72px;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.gaya-scratch-popup__discount {
	font-family: var(--gaya-heading-font, "Cormorant Garamond", georgia, "Times New Roman", serif) !important;
	font-size: clamp(40px, 12vw, 54px);
	font-weight: 600;
	line-height: 0.95;
	letter-spacing: -0.04em;
}

.gaya-scratch-popup__reward-label {
	max-width: 28ch;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
}

.gaya-scratch-popup__code-row {
	margin-top: 4px;
	color: #68736a;
	font-size: 11px;
	line-height: 1.2;
}

#gaya-scratch-popup .gaya-scratch-popup__code {
	color: #445644;
	font-family: Consolas, "Liberation Mono", monospace !important;
	font-size: 12px;
	font-weight: 600;
	font-variant-numeric: lining-nums tabular-nums slashed-zero;
	letter-spacing: 0.06em;
}

.gaya-scratch-popup__auto-apply {
	color: #36563d;
	font-size: 12px;
	font-weight: 600;
}

.gaya-scratch-popup__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	touch-action: none;
	cursor: grab;
	transition: opacity 0.2s ease;
}

.gaya-scratch-popup__canvas:active {
	cursor: grabbing;
}

.gaya-scratch-popup__gesture {
	position: absolute;
	bottom: 11px;
	left: 12px;
	right: 12px;
	z-index: 2;
	margin: 0;
	color: #1b3927;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.gaya-scratch-popup__gesture span {
	display: inline-block;
	margin-right: 4px;
	font-size: 17px;
	vertical-align: -1px;
	animation: gaya-scratch-gesture 1.8s ease-in-out infinite;
}

.gaya-scratch-popup.is-scratching .gaya-scratch-popup__gesture {
	opacity: 0;
}

.gaya-scratch-popup__claim {
	display: block;
	width: calc(100% - 44px);
	margin: 0 auto;
	padding: 14px 18px;
	border: 0;
	border-radius: 999px;
	background: #23583a;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1.2;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.gaya-scratch-popup__claim:disabled {
	background: #a2aaa0;
	cursor: not-allowed;
}

.gaya-scratch-popup__close:focus-visible,
.gaya-scratch-popup__canvas:focus-visible,
.gaya-scratch-popup__claim:focus-visible {
	outline: 3px solid #d4b66e;
	outline-offset: 3px;
}

.gaya-scratch-popup__claim:hover:not(:disabled),
.gaya-scratch-popup__claim:active:not(:disabled) {
	background: #1b452e;
	color: #fff;
}

.gaya-scratch-popup__footer {
	margin: 11px 20px 0;
	color: #68736a;
	font-size: 12px;
	font-style: italic;
	line-height: 1.3;
	text-align: center;
}

.gaya-scratch-popup__countdown {
	font-family: Consolas, "Liberation Mono", monospace;
	font-style: normal;
	font-variant-numeric: tabular-nums;
}

.gaya-scratch-popup.is-revealed .gaya-scratch-popup__prelude {
	display: none;
}

.gaya-scratch-popup.is-revealed .gaya-scratch-popup__stage {
	min-height: 300px;
	margin-top: 20px;
	margin-bottom: 16px;
}

.gaya-scratch-popup.is-revealed .gaya-scratch-popup__canvas {
	opacity: 0;
	pointer-events: none;
}

.gaya-scratch-popup.is-revealed .gaya-scratch-popup__gesture {
	display: none;
}

@keyframes gaya-scratch-gesture {

	0%,
	100% {
		transform: translateX(-3px);
	}

	50% {
		transform: translateX(3px);
	}
}

@media (min-width: 720px) and (min-height: 501px) {

	.gaya-scratch-popup {
		align-items: center;
		padding: 16px;
	}

	.gaya-scratch-popup__card {
		width: min(960px, 94vw);
		height: auto;
		min-height: 480px;
		max-height: none;
		overflow: hidden;
		border-radius: 16px;
		padding-bottom: 0;
		box-shadow: 0 20px 70px rgba(0, 0, 0, 0.27);
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"prelude stage"
			"claim stage"
			"footer stage";
		grid-template-rows: minmax(0, 1fr) auto auto;
		transform: none;
	}

	.gaya-scratch-popup.is-visible .gaya-scratch-popup__card {
		transform: none;
	}

	.gaya-scratch-popup__header {
		display: none;
	}

	.gaya-scratch-popup__close {
		top: 20px;
		right: 20px;
		width: 36px;
		height: 36px;
		border-radius: 50%;
		background: #fff;
		color: #1b2a1d;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	}

	.gaya-scratch-popup__prelude {
		grid-area: prelude;
		align-self: start;
		padding: 48px 40px 0 48px;
	}

	.gaya-scratch-popup__eyebrow {
		font-size: 12px;
	}

	#gaya-scratch-popup .gaya-scratch-popup__intro {
		font-size: 32px;
		line-height: 1.2;
	}

	.gaya-scratch-popup__subtitle {
		margin-top: 12px;
		font-size: 15px;
	}

	.gaya-scratch-popup__stage {
		grid-area: stage;
		width: 100%;
		min-height: 480px;
		height: 100%;
		margin: 0;
		border: 0;
		border-radius: 0;
	}

	.gaya-scratch-popup__claim {
		grid-area: claim;
		justify-self: start;
		align-self: end;
		width: auto;
		margin: 0 0 0 48px;
		padding: 15px 32px;
		font-size: 16px;
	}

	.gaya-scratch-popup__footer {
		grid-area: footer;
		margin: 0;
		padding: 0 40px 48px 48px;
		font-size: 14px;
		text-align: left;
	}

	.gaya-scratch-popup.is-revealed .gaya-scratch-popup__prelude {
		display: block;
	}

	.gaya-scratch-popup.is-revealed .gaya-scratch-popup__stage {
		min-height: 480px;
		margin: 0;
	}
}

@media (max-height: 560px) {

	.gaya-scratch-popup__prelude {
		padding-top: 14px;
	}

	.gaya-scratch-popup__stage {
		min-height: 150px;
		margin-top: 14px;
		margin-bottom: 22px;
	}

	.gaya-scratch-popup.is-revealed .gaya-scratch-popup__stage {
		min-height: 240px;
		margin-top: 12px;
	}
}
