/**
 * Gamified mechanics: The Drawer overlay, the Find-your-style quiz and the Casa Club panel.
 * Everything is set in the house palette; the only "game" cues are a walnut chest face and
 * three brass pulls.
 */

/* ------------------------------------------------------------- shared -- */

.cn-play__eyebrow {
	margin: 0 0 8px;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brass-deep);
}

.cn-play__title {
	margin: 0 0 8px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: clamp(24px, 3.4vw, 30px);
	line-height: 1.1;
	text-wrap: balance;
	color: var(--wp--preset--color--warm-ink);
}

.cn-play__title--lg {
	font-size: clamp(32px, 5vw, 48px);
}

.cn-play__title em {
	font-style: italic;
	font-weight: 300;
	color: var(--wp--preset--color--walnut);
}

.cn-play__copy {
	margin: 0 0 20px;
	max-width: 46ch;
	font-size: 15px;
	line-height: 1.55;
	color: var(--wp--preset--color--ink-soft);
}

.cn-play__fine {
	margin: 14px 0 0;
	font-size: 11.5px;
	line-height: 1.5;
	color: var(--wp--preset--color--ink-muted);
}

.cn-play__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 0 22px;
	border: 1px solid var(--wp--preset--color--warm-ink);
	background: var(--wp--preset--color--warm-ink);
	color: var(--wp--preset--color--oat);
	font-family: var(--wp--preset--font-family--body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cn-play__btn:hover,
.cn-play__btn:focus-visible {
	background: var(--wp--preset--color--walnut);
	border-color: var(--wp--preset--color--walnut);
	color: var(--wp--preset--color--oat);
}

.cn-play__btn:disabled {
	opacity: 0.55;
	cursor: default;
}

.cn-play__btn--ghost {
	background: transparent;
	color: var(--wp--preset--color--warm-ink);
}

.cn-play__btn--ghost:hover,
.cn-play__btn--ghost:focus-visible {
	background: var(--wp--preset--color--warm-ink);
}

.cn-play__input {
	flex: 1;
	min-width: 0;
	min-height: 46px;
	padding: 0 14px;
	border: 1px solid var(--wp--preset--color--warm-ink);
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--warm-ink);
	font: inherit;
	font-size: 15px;
}

.cn-play__input:focus-visible {
	outline: 2px solid var(--wp--preset--color--honey-brass);
	outline-offset: 1px;
}

/* --------------------------------------------------------- the drawer -- */

.cn-play-drawer {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cn-play-drawer[hidden] {
	display: none;
}

.cn-play-drawer__scrim {
	position: absolute;
	inset: 0;
	background: rgba(41, 36, 32, 0.45);
}

.cn-play-drawer__card {
	position: relative;
	width: min(520px, calc(100vw - 32px));
	padding: 34px 36px 28px;
	background: var(--wp--preset--color--oat);
	border: 1px solid var(--wp--preset--color--greige);
	box-shadow: 0 24px 60px rgba(41, 36, 32, 0.25);
}

.cn-play-drawer--open .cn-play-drawer__card {
	animation: cn-drawer-in 0.35s ease both;
}

@keyframes cn-drawer-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: none; }
}

.cn-play-drawer__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--ink-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.cn-play-drawer__close:hover,
.cn-play-drawer__close:focus-visible {
	color: var(--wp--preset--color--warm-ink);
}

.cn-chest {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	padding: 14px;
	background: linear-gradient(180deg, var(--wp--preset--color--walnut), #4a3222);
	border: 1px solid #3e2c1e;
}

.cn-chest__pull {
	position: relative;
	height: 96px;
	padding: 0;
	border: 1px solid #7a5638;
	background: linear-gradient(180deg, #6b4a32, var(--wp--preset--color--walnut));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 #3e2c1e;
	cursor: pointer;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.cn-chest__pull:disabled {
	cursor: default;
}

.cn-chest--armed .cn-chest__pull:not(:disabled):hover,
.cn-chest--armed .cn-chest__pull:not(:disabled):focus-visible {
	transform: translateY(3px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 #3e2c1e;
}

.cn-chest__pull:focus-visible {
	outline: 2px solid var(--wp--preset--color--brass-light);
	outline-offset: 2px;
}

.cn-chest__handle {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 46px;
	height: 9px;
	transform: translate(-50%, -50%);
	border-radius: 6px;
	background: linear-gradient(180deg, var(--wp--preset--color--brass-light), var(--wp--preset--color--honey-brass));
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.cn-chest__num {
	position: absolute;
	left: 12px;
	bottom: 8px;
	font-family: var(--wp--preset--font-family--display);
	font-size: 13px;
	letter-spacing: 0.06em;
	color: var(--wp--preset--color--brass-light);
}

.cn-chest__pull.is-open {
	background: linear-gradient(180deg, #4a3222, #3e2c1e);
	transform: translateY(6px);
	box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
}

.cn-chest__pull.is-open .cn-chest__handle {
	opacity: 0.55;
}

.cn-chest--done .cn-chest__pull:not(.is-open) {
	opacity: 0.6;
}

.cn-play-drawer__form {
	display: flex;
	gap: 8px;
	margin-top: 18px;
}

.cn-play-drawer__form[hidden] {
	display: none;
}

.cn-play-drawer__status {
	min-height: 1.4em;
	margin: 10px 0 0;
	font-size: 13.5px;
	color: var(--wp--preset--color--walnut);
}

.cn-play-drawer__status:empty {
	display: none;
}

/* Mobile: a bottom sheet, roughly a third of the screen. */
@media (max-width: 767px) {
	.cn-play-drawer {
		align-items: flex-end;
	}

	.cn-play-drawer__card {
		width: 100%;
		max-height: 88vh;
		overflow-y: auto;
		padding: 16px 16px 14px;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		box-shadow: 0 -12px 30px rgba(41, 36, 32, 0.18);
	}

	.cn-play-drawer--open .cn-play-drawer__card {
		animation-name: cn-sheet-in;
	}

	@keyframes cn-sheet-in {
		from { transform: translateY(100%); }
		to   { transform: none; }
	}

	.cn-play-drawer .cn-play__title {
		font-size: 21px;
	}

	.cn-play-drawer .cn-play__copy {
		margin-bottom: 12px;
		font-size: 13.5px;
	}

	.cn-chest {
		padding: 8px;
		gap: 6px;
	}

	.cn-chest__pull {
		height: 58px;
	}

	.cn-chest__handle {
		width: 34px;
		height: 7px;
	}

	.cn-chest__num {
		left: 8px;
		bottom: 5px;
		font-size: 11px;
	}

	.cn-play-drawer__form {
		margin-top: 10px;
	}

	.cn-play-drawer .cn-play__input,
	.cn-play-drawer .cn-play__btn {
		min-height: 42px;
	}

	.cn-play-drawer .cn-play__fine {
		margin-top: 10px;
		font-size: 10.5px;
	}
}

/* --------------------------------------------------------------- quiz -- */

.cn-quiz {
	scroll-margin-top: 96px;
	max-width: 1040px;
	margin: 0 auto;
	padding: clamp(32px, 6vw, 72px) 20px 80px;
}

.cn-quiz__intro {
	max-width: 62ch;
}

.cn-quiz__intro .cn-play__copy {
	font-size: 17px;
}

/*
 * The product page's quiz sits on a banner of its own: the picture fills the block, a cream wash
 * carries the type, and the whole thing hides with the intro the moment the quiz starts. It has
 * to come after the plain .cn-quiz__intro rules above so the 62ch cap does not shrink it.
 */
.cn-quiz__intro--banner {
	position: relative;
	display: grid;
	place-items: center;
	overflow: hidden;
	width: 100%;
	max-width: none;
	min-height: clamp(300px, 30vw, 420px);
	padding: clamp(32px, 4vw, 56px) clamp(20px, 4vw, 48px);
	text-align: center;
}

.cn-quiz__banner {
	position: absolute;
	inset: 0;
	z-index: 0;
}

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

/*
 * A cream wash rather than a dark scrim: the picture is pale plaster with the materials around
 * its edge, so darkening it to carry white type would throw away the picture. The wash lifts the
 * middle just enough for the house's own ink to sit on it, and stays thinnest at the top where
 * the swatches are.
 */
.cn-quiz__intro--banner::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: radial-gradient(ellipse at center, rgba(251, 246, 234, 0.86) 0%, rgba(251, 246, 234, 0.66) 52%, rgba(251, 246, 234, 0.34) 100%);
}

.cn-quiz__intro--banner > *:not(.cn-quiz__banner) {
	position: relative;
	z-index: 2;
	margin-inline: auto;
}

.cn-quiz__intro--banner .cn-play__copy {
	max-width: 44ch;
}

.cn-quiz__steps[hidden],
.cn-quiz__result[hidden],
.cn-quiz__intro[hidden] {
	display: none;
}

.cn-quiz__progress {
	display: flex;
	gap: 6px;
	margin: 0 0 26px;
}

.cn-quiz__progress span {
	flex: 1;
	height: 2px;
	background: var(--wp--preset--color--greige);
}

.cn-quiz__progress span.is-done {
	background: var(--wp--preset--color--honey-brass);
}

.cn-quiz__step {
	animation: cn-step-in 0.3s ease both;
}

@keyframes cn-step-in {
	from { opacity: 0; transform: translateX(8px); }
	to   { opacity: 1; transform: none; }
}

.cn-quiz__q {
	margin: 0 0 6px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: clamp(26px, 3.6vw, 34px);
	line-height: 1.12;
	text-wrap: balance;
}

.cn-quiz__q em {
	font-style: italic;
	font-weight: 300;
	color: var(--wp--preset--color--walnut);
}

.cn-quiz__sub {
	margin: 0 0 22px;
	font-size: 14.5px;
	color: var(--wp--preset--color--ink-muted);
}

.cn-quiz__opts {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

@media (max-width: 767px) {
	.cn-quiz__opts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
}

.cn-quiz__opt {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px;
	border: 1px solid var(--wp--preset--color--greige);
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--warm-ink);
	font: inherit;
	font-size: 13.5px;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cn-quiz__opt:hover,
.cn-quiz__opt:focus-visible {
	border-color: var(--wp--preset--color--walnut);
}

.cn-quiz__opt[aria-pressed="true"] {
	border-color: var(--wp--preset--color--warm-ink);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--warm-ink);
}

.cn-quiz__sw {
	height: 72px;
	background: var(--cn-sw, var(--wp--preset--color--oat-deep));
}

.cn-quiz__sw--icon {
	display: grid;
	place-items: center;
	background: var(--wp--preset--color--oat-deep);
	color: var(--wp--preset--color--walnut);
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-size: 22px;
}

/* A picture of the room or the material, where the option has one. */
.cn-quiz__sw--img {
	height: auto;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.cn-quiz__sw--img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.cn-quiz__opt:hover .cn-quiz__sw--img img {
	transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
	.cn-quiz__sw--img img {
		transition: none;
	}
}

/* Where the board went: their account, or the link waiting in their inbox. */
.cn-quiz__kept {
	margin: 18px 0 0;
	color: var(--wp--preset--color--muted-olive);
	font-size: 14px;
	font-weight: 600;
}

/* The way back to a board they already made. */
.cn-quiz__mine {
	display: inline-block;
	margin-top: 14px;
}

.cn-quiz__opt small {
	display: block;
	color: var(--wp--preset--color--ink-muted);
	font-size: 12px;
}

.cn-quiz__nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 26px;
	gap: 12px;
}

.cn-quiz__link {
	padding: 8px 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--ink-soft);
	font: inherit;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
}

.cn-quiz__link:hover,
.cn-quiz__link:focus-visible {
	color: var(--wp--preset--color--walnut);
}

.cn-quiz__email {
	display: flex;
	gap: 8px;
	max-width: 480px;
	margin-top: 8px;
}

.cn-quiz__working {
	padding: 48px 0;
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-size: 22px;
	color: var(--wp--preset--color--walnut);
}

.cn-quiz__board {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px 14px;
	margin-top: 26px;
}

@media (max-width: 1023px) {
	.cn-quiz__board {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.cn-quiz__board {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px 10px;
	}
}

.cn-quiz__reward {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	align-items: baseline;
	margin-top: 26px;
	padding: 14px 18px;
	border: 1px solid var(--wp--preset--color--honey-brass);
	background: var(--wp--preset--color--cream);
	font-size: 14px;
}

.cn-quiz__reward strong {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: 19px;
	color: var(--wp--preset--color--walnut);
}

.cn-quiz__reward code {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	letter-spacing: 0.12em;
}

.cn-quiz__retake {
	margin-top: 28px;
}

.cn-quiz__error {
	margin: 12px 0 0;
	color: #8a3b2c;
	font-size: 14px;
}

.cn-quiz-card {
	display: grid;
	gap: 6px;
	text-decoration: none;
	color: inherit;
}

.cn-quiz-card__media img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

/* ---------------------------------------------------------- casa club -- */

.cn-club__eyebrow {
	margin: 0 0 4px;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brass-deep);
}

.cn-club__balance {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: 20px;
	color: var(--wp--preset--color--ink-soft);
}

.cn-club__num {
	font-size: 48px;
	line-height: 1;
	color: var(--wp--preset--color--warm-ink);
	font-variant-numeric: tabular-nums;
}

.cn-club__tier {
	margin: 8px 0 12px;
	color: var(--wp--preset--color--ink-soft);
}

.cn-club .cn-progress--inline {
	padding: 0;
	margin: 0 0 28px;
	background: transparent;
}

.cn-club__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px;
	margin-bottom: 32px;
}

@media (max-width: 767px) {
	.cn-club__grid {
		grid-template-columns: 1fr;
	}
}

.cn-club h3 {
	margin: 0 0 10px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: 20px;
}

.cn-club__earn ul {
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 6px;
	font-size: 14.5px;
}

.cn-club__earn strong {
	display: inline-block;
	min-width: 3ch;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--walnut);
}

.cn-club__ref {
	display: grid;
	gap: 6px;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-muted);
}

.cn-club__ref input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--wp--preset--color--greige);
	background: var(--wp--preset--color--cream);
	font: inherit;
	font-size: 13px;
	letter-spacing: 0;
	text-transform: none;
	color: var(--wp--preset--color--warm-ink);
}

.cn-club__redeem p {
	font-size: 14.5px;
}

.cn-club__ledger {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.cn-club__ledger td {
	padding: 10px 0;
	border-bottom: 1px solid var(--wp--preset--color--greige);
}

.cn-club__pts {
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--wp--preset--color--walnut);
}

.cn-club__empty {
	color: var(--wp--preset--color--ink-muted);
}

@media (prefers-reduced-motion: reduce) {
	.cn-play-drawer--open .cn-play-drawer__card,
	.cn-quiz__step {
		animation: none;
	}

	.cn-chest__pull {
		transition: none;
	}
}

/* ---------------------------------------------------- the drawer opens -- */

.cn-chest__pull {
	overflow: visible;
	isolation: isolate;
}

.cn-chest__inner {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, #2a1c12 0%, #3e2c1e 60%, #4a3222 100%);
	box-shadow: inset 0 10px 18px rgba(0, 0, 0, 0.5);
	z-index: 0;
}

.cn-chest__front {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: linear-gradient(180deg, #6b4a32, var(--wp--preset--color--walnut));
	border: 1px solid #7a5638;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 0 #3e2c1e;
	transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.55s ease;
}

/* The face used to be the button itself; keep the button flat now that the front carries it. */
.cn-chest__pull,
.cn-chest__pull.is-open {
	border-color: transparent;
	background: transparent;
	box-shadow: none;
	transform: none;
}

.cn-chest__card {
	position: absolute;
	left: 50%;
	bottom: 14px;
	z-index: 1;
	width: 58%;
	height: 70%;
	transform: translate(-50%, 30%) rotate(0deg);
	opacity: 0;
	background: var(--wp--preset--color--cream);
	border: 1px solid var(--wp--preset--color--honey-brass);
	box-shadow: 0 8px 20px rgba(41, 36, 32, 0.35);
	transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.cn-chest__card::before {
	content: "";
	position: absolute;
	left: 18%;
	right: 18%;
	top: 38%;
	height: 2px;
	background: var(--wp--preset--color--honey-brass);
	opacity: 0.7;
}

.cn-chest__card::after {
	content: "";
	position: absolute;
	left: 28%;
	right: 28%;
	top: 56%;
	height: 2px;
	background: var(--wp--preset--color--greige);
}

.cn-chest__pull.is-open .cn-chest__front {
	transform: translateY(22px) scaleY(0.82);
	transform-origin: bottom center;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 16px rgba(0, 0, 0, 0.45);
}

.cn-chest__pull.is-open .cn-chest__handle {
	opacity: 1;
}

.cn-chest__pull.is-card .cn-chest__card {
	transform: translate(-50%, -56%) rotate(-5deg);
	opacity: 1;
	z-index: 3;
}

.cn-chest--done .cn-chest__pull:not(.is-open) .cn-chest__front {
	opacity: 0.55;
}

/* A brass line sweeping across; the prize card's top edge uses it. */
@keyframes cn-reveal-sweep {
	from { transform: translateX(-100%); opacity: 0; }
	40%  { opacity: 1; }
	to   { transform: translateX(260%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.cn-chest__front,
	.cn-chest__card {
		transition: none;
	}
}

/* ----------------------------------------- the drawer, centred on axis -- */

/*
 * The card is a single narrow column with the chest at its middle, so every line in it reads
 * off one centre axis: eyebrow, title, body, the email row, the status line, the reveal and
 * the fine print. Scoped to the drawer card; the quiz and the club panel stay left-aligned.
 */

.cn-play-drawer__card {
	text-align: center;
}

.cn-play-drawer__card .cn-play__copy {
	margin-inline: auto;
}

.cn-play-drawer__form {
	justify-content: center;
}

.cn-play-drawer__card .cn-play__fine {
	margin-inline: auto;
	max-width: 42ch;
}

/* The close button sits in the corner, so the title needs room not to run under it. */
.cn-play-drawer__card .cn-play__eyebrow,
.cn-play-drawer__card .cn-play__title {
	padding-inline: 34px;
}

@media (max-width: 767px) {
	.cn-play-drawer__card .cn-play__eyebrow,
	.cn-play-drawer__card .cn-play__title {
		padding-inline: 30px;
	}
}

/* ------------------------------------------------ choosing a drawer -- */

/* The chosen drawer steps forward with its brass ring; the others step back. */
.cn-chest--chosen .cn-chest__pull:not(.is-chosen) .cn-chest__front {
	opacity: 0.72;
}

.cn-chest__pull.is-chosen .cn-chest__front {
	transform: translateY(4px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 2px var(--wp--preset--color--brass-light), 0 6px 14px rgba(0, 0, 0, 0.35);
}

.cn-chest__pull.is-chosen .cn-chest__handle {
	box-shadow: 0 0 10px rgb(232 200 140 / 0.7), 0 1px 3px rgba(0, 0, 0, 0.45);
}

.cn-play-drawer__form.is-nudge {
	animation: cn-nudge 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.cn-play-drawer__form.is-nudge .cn-play__input {
	border-color: var(--wp--preset--color--walnut);
}

@keyframes cn-nudge {
	20%, 60% { transform: translateX(-6px); }
	40%, 80% { transform: translateX(6px); }
}

/* ------------------------------------------------ the prize, centre stage -- */

/*
 * Once a drawer opens, its card leaves the chest and flies to the middle of the screen, where
 * it lands as the prize with brass rays turning slowly behind it. The flight starts from the
 * chosen drawer's own position (--cn-from-x/y, set by play.js).
 */
.cn-play-drawer--prize .cn-play-drawer__card {
	opacity: 0;
	transform: scale(0.96);
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.cn-prize {
	position: fixed;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	padding: 20px;
	overflow: hidden;
	pointer-events: none;
}

.cn-prize[hidden] {
	display: none;
}

.cn-prize__rays {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 160vmax;
	height: 160vmax;
	margin: -80vmax 0 0 -80vmax;
	border-radius: 50%;
	background: repeating-conic-gradient(from 0deg, rgb(232 200 140 / 0.2) 0deg 5deg, transparent 5deg 15deg);
	-webkit-mask-image: radial-gradient(circle, #000 0, #000 12%, transparent 46%);
	mask-image: radial-gradient(circle, #000 0, #000 12%, transparent 46%);
	opacity: 0;
}

.cn-prize.is-in .cn-prize__rays {
	animation: cn-rays-in 0.9s ease 0.35s forwards, cn-rays-turn 40s linear 0.35s infinite;
}

@keyframes cn-rays-in {
	to { opacity: 1; }
}

@keyframes cn-rays-turn {
	to { transform: rotate(360deg); }
}

.cn-prize__card {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 8px;
	width: min(380px, 100%);
	padding: 30px 26px 22px;
	border: 1px solid var(--wp--preset--color--honey-brass);
	background: var(--wp--preset--color--cream);
	box-shadow: 0 30px 80px rgba(41, 36, 32, 0.4);
	text-align: center;
	pointer-events: auto;
	opacity: 0;
	transform: translate(var(--cn-from-x, 0), var(--cn-from-y, 0)) scale(0.18) rotate(-8deg);
}

.cn-prize.is-in .cn-prize__card {
	animation: cn-prize-fly 0.85s cubic-bezier(0.2, 0.9, 0.25, 1.08) forwards;
}

@keyframes cn-prize-fly {
	0% {
		opacity: 0;
		transform: translate(var(--cn-from-x, 0), var(--cn-from-y, 0)) scale(0.18) rotate(-8deg);
	}
	18% {
		opacity: 1;
	}
	72% {
		opacity: 1;
		transform: translate(0, 0) scale(1.04) rotate(1.5deg);
	}
	100% {
		opacity: 1;
		transform: none;
	}
}

/* A brass line sweeps the top edge as it lands. */
.cn-prize__card::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 0;
	width: 40%;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--wp--preset--color--brass-light), transparent);
	opacity: 0;
}

.cn-prize.is-in .cn-prize__card::before {
	animation: cn-reveal-sweep 1.1s ease-out 0.7s both;
}

.cn-prize__eyebrow {
	margin: 0;
	color: var(--wp--preset--color--brass-deep);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.cn-prize__media {
	display: grid;
	place-items: center;
	width: 132px;
	aspect-ratio: 1;
	margin: 6px 0 4px;
	background: var(--wp--preset--color--oat-deep);
	overflow: hidden;
}

.cn-prize__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cn-prize__glyph {
	color: var(--wp--preset--color--walnut);
	font-family: var(--wp--preset--font-family--display);
	font-size: 20px;
	font-style: italic;
	line-height: 1.1;
	padding: 0 10px;
}

.cn-prize__glyph--figure {
	font-size: 46px;
	font-style: normal;
	letter-spacing: -0.02em;
}

.cn-prize__label {
	margin: 0;
	color: var(--wp--preset--color--warm-ink);
	font-family: var(--wp--preset--font-family--display);
	font-size: 25px;
	font-weight: 400;
	line-height: 1.15;
	text-wrap: balance;
}

.cn-prize__note {
	margin: 0;
	color: var(--wp--preset--color--ink-soft);
	font-size: 14px;
	line-height: 1.5;
	text-wrap: pretty;
}

.cn-prize__code {
	margin: 2px 0 0;
	color: var(--wp--preset--color--warm-ink);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.cn-prize__code:empty,
.cn-prize__note:empty {
	display: none;
}

.cn-prize.is-applied .cn-prize__code {
	color: var(--wp--preset--color--muted-olive);
}

.cn-prize__actions {
	display: grid;
	gap: 8px;
	width: 100%;
	margin-top: 10px;
}

.cn-prize__actions .cn-play__btn {
	width: 100%;
	min-height: 48px;
}

.cn-prize__action[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.cn-chest__pull.is-chosen .cn-chest__front,
	.cn-play-drawer__form.is-nudge {
		animation: none;
		transition: none;
	}

	.cn-prize__card,
	.cn-prize.is-in .cn-prize__card {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.cn-prize.is-in .cn-prize__rays {
		animation: none;
		opacity: 1;
	}

	.cn-prize.is-in .cn-prize__card::before {
		animation: none;
	}
}
