/**
 * Daily Spin.
 */

:root {
	--ppg-green-900: #14372A;
	--ppg-green-700: #1F5F45;
	--ppg-green-500: #2D7A57;
	--ppg-green-50: #F1F7F2;
	--ppg-cream: #FAF7F0;
	--ppg-ink: #23302A;
	--ppg-muted: #6B7A72;
	--ppg-line: #E6ECE7;
	--ppg-white: #fff;
	--ppg-pink: #F4CEDE;
	--ppg-pink-ink: #A8386B;
	--ppg-blush: #FBEEF4;
	--ppg-gold: #E8C063;
	--ppg-radius: 18px;
	--ppg-radius-sm: 12px;
	--ppg-shadow: 0 2px 14px rgba(20, 55, 42, .07);
}

/*
 * The game is a full-width page, but it is an ordinary WordPress page, so a
 * theme drops it into its narrow content column — and WordPress enforces that
 * column with !important, so these rules have to match it. The content
 * wrapper is opened up and the game then caps itself at the same width as the
 * site header, which puts it directly under the logo.
 *
 * The theme's page title goes too: the game has a large title of its own, so
 * "Daily Spin" was appearing twice.
 */
body.ppg-game-page .wp-block-post-title,
body.ppg-game-page .ppt-page-hero,
body.ppg-game-page .entry-title {
	display: none;
}

body.ppg-game-page main {
	margin-top: 0 !important;
}

body.ppg-game-page .wp-block-post-content,
body.ppg-game-page .entry-content {
	width: auto !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

.ppg-spin-page {
	box-sizing: border-box;
	width: auto !important;
	max-width: 1360px !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding: 0 0 60px;
	color: var(--ppg-ink);
	font-size: 16px;
	line-height: 1.6;
}

.ppg-spin-page * {
	box-sizing: border-box;
}

.ppg-icon {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

.ppg-icon--flame {
	color: #E07A3F;
}

.ppg-breadcrumb {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 22px 0 10px;
	font-size: .85rem;
	color: var(--ppg-muted);
}

.ppg-breadcrumb a {
	color: var(--ppg-muted);
	text-decoration: none;
}

/* -------------------------------------------------------------- Layout --- */

/*
 * Two columns, as in the design: the title block and the wheel stacked on the
 * left, How It Works and the streak on the right. The wheel was previously in
 * a column of its own, which left it nowhere near enough room.
 */
.ppg-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 32px;
	align-items: start;
}

.ppg-main {
	min-width: 0;
}

.ppg-title {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin: 0;
	font-size: clamp(2.4rem, 6vw, 4rem);
	line-height: 1.05;
	color: var(--ppg-green-900);
}

.ppg-sub {
	margin: .4rem 0 1rem;
	font-size: 1.25rem;
	color: var(--ppg-green-700);
}

.ppg-copy {
	margin: 0;
	color: var(--ppg-muted);
	max-width: 46ch;
}

.ppg-flag {
	display: inline-block;
	margin-top: 14px;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--ppg-blush);
	color: var(--ppg-pink-ink);
	font-size: .86rem;
	font-weight: 600;
}

/* --------------------------------------------------------------- Wheel --- */

.ppg-stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 18px;
}

.ppg-wheel-wrap {
	position: relative;
	z-index: 1; /* so the wheel sits over the top of the stand's legs */
	width: 100%;
	max-width: 620px;
	aspect-ratio: 1 / 1;
}

.ppg-wheel {
	width: 100%;
	height: 100%;
	transform: rotate(0deg);
	will-change: transform;
}

.ppg-wheel-svg {
	width: 100%;
	height: 100%;
	display: block;
}

.ppg-segment-label {
	font-family: inherit;
	fill: #2C4A38;
}

.ppg-label-big {
	font-size: 25px;
	font-weight: 700;
}

.ppg-label-small {
	font-size: 14px;
	font-weight: 600;
}

/* The marker at the top, pointing into the wheel. */
.ppg-pointer {
	position: absolute;
	top: -24px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 13px;
	width: 64px;
	height: 86px;
	z-index: 3;
	background: linear-gradient(180deg, #E4657A, #C9455C);
	clip-path: polygon(50% 100%, 0 42%, 8% 12%, 50% 0, 92% 12%, 100% 42%);
	filter: drop-shadow(0 4px 8px rgba(20, 55, 42, .3));
}

.ppg-icon--pointer {
	width: 28px;
	height: 28px;
	color: #fff;
}

/* The hub sits above the wheel, so it stays still while the wheel turns. */
.ppg-hub {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	width: 27%;
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
	text-decoration: none;
	font-family: inherit;
	transition: transform .12s ease;
}

.ppg-hub:hover:not(:disabled) {
	transform: translate(-50%, -50%) scale(1.04);
}

.ppg-hub:active:not(:disabled) {
	transform: translate(-50%, -50%) scale(.98);
}

.ppg-hub:disabled {
	cursor: default;
	opacity: .9;
}

.ppg-icon--hub {
	width: 22px;
	height: 22px;
	margin-bottom: 2px;
	color: #DCEFE2;
}

.ppg-hub-main {
	font-size: 1.9rem;
	font-weight: 700;
	letter-spacing: .06em;
	line-height: 1;
}

.ppg-hub-sub {
	font-size: .9rem;
	opacity: .9;
}

.ppg-hub:focus-visible {
	outline: 3px solid var(--ppg-gold);
	outline-offset: 4px;
}

/*
 * The wheel stands on two splayed wooden legs set into a plinth, with a brass
 * plaque on the front — the stand from the design, drawn in CSS so it scales
 * with the wheel and needs no artwork.
 */
.ppg-stand {
	position: relative;
	display: flex;
	justify-content: center;
	gap: 136px;
	width: 100%;
	max-width: 620px;
	height: 74px;
	margin-top: -38px;
}

.ppg-stand-leg {
	width: 34px;
	height: 100%;
	border-radius: 2px 2px 0 0;
	background: linear-gradient(90deg, #5C3A1B, #A5713C 42%, #8B5A2B 70%, #5C3A1B);
}

.ppg-stand-leg:first-child {
	transform: rotate(13deg);
	transform-origin: top center;
}

.ppg-stand-leg:last-child {
	transform: rotate(-13deg);
	transform-origin: top center;
}

/* Wooden plinth under the wheel. */
.ppg-base {
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(100%, 520px);
	padding: 14px 22px 16px;
	border-radius: 10px;
	background: linear-gradient(180deg, #A5713C, #6B4320 70%, #5A3717);
	box-shadow: 0 10px 20px rgba(20, 55, 42, .2), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.ppg-plaque {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 7px 20px;
	border-radius: 5px;
	background: linear-gradient(180deg, #F2D68E, #D2A953);
	border: 1px solid #B98F33;
	color: #5A4214;
	font-size: .95rem;
	font-style: italic;
	font-weight: 600;
	text-align: center;
}

.ppg-icon--base {
	width: 15px;
	height: 15px;
	color: #6E5315;
}

.ppg-result {
	margin-top: 18px;
	max-width: 420px;
	text-align: center;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .3s ease, transform .3s ease;
}

.ppg-result.is-shown {
	opacity: 1;
	transform: none;
}

.ppg-result strong {
	display: block;
	font-size: 1.3rem;
	color: var(--ppg-green-900);
}

.ppg-result span {
	display: block;
	color: var(--ppg-muted);
	font-size: .92rem;
	margin-top: 4px;
}

.ppg-result--win {
	padding: 16px 20px;
	border-radius: var(--ppg-radius);
	background: var(--ppg-green-50);
	border: 1px solid var(--ppg-line);
}

.ppg-result--quiet {
	color: var(--ppg-muted);
	font-size: .92rem;
}

.ppg-result-link {
	display: inline-block;
	margin-top: 10px;
	padding: 8px 18px;
	border-radius: 999px;
	background: var(--ppg-green-700);
	color: #fff;
	text-decoration: none;
	font-size: .88rem;
	font-weight: 600;
}

.ppg-result-bonus {
	color: var(--ppg-pink-ink) !important;
	font-weight: 600;
}

/* -------------------------------------------------------------- Panels --- */

.ppg-side {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.ppg-panel {
	padding: 22px;
	border-radius: var(--ppg-radius);
	background: var(--ppg-white);
	border: 1px solid var(--ppg-line);
	box-shadow: var(--ppg-shadow);
}

.ppg-panel-title {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 16px;
	font-size: 1.15rem;
	color: var(--ppg-green-900);
}

.ppg-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ppg-steps li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.ppg-step-number {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--ppg-green-50);
	color: var(--ppg-green-700);
	font-weight: 700;
}

.ppg-steps li:nth-child(2) .ppg-step-number {
	background: var(--ppg-blush);
	color: var(--ppg-pink-ink);
}

.ppg-steps strong {
	display: block;
	color: var(--ppg-green-900);
}

.ppg-steps em {
	font-style: normal;
	font-size: .88rem;
	color: var(--ppg-muted);
}

.ppg-tip {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 18px 0 0;
	padding: 12px 14px;
	border-radius: var(--ppg-radius-sm);
	background: var(--ppg-blush);
	color: var(--ppg-pink-ink);
	font-size: .88rem;
}

.ppg-streak-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.ppg-streak-head .ppg-panel-title {
	margin-bottom: 0;
}

.ppg-streak-count {
	font-weight: 700;
	color: var(--ppg-green-900);
}

.ppg-streak-dots {
	display: flex;
	gap: 7px;
	margin: 16px 0 12px;
}

.ppg-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--ppg-green-50);
	color: #C7D6CC;
}

.ppg-dot.is-on {
	background: var(--ppg-green-700);
	color: #fff;
}

.ppg-streak-note {
	margin: 0;
	font-size: .86rem;
	color: var(--ppg-muted);
}

/* --------------------------------------------------- More ways to play --- */

.ppg-more {
	margin-top: 40px;
	padding: 26px;
	border-radius: var(--ppg-radius);
	background: var(--ppg-white);
	border: 1px solid var(--ppg-line);
	box-shadow: var(--ppg-shadow);
}

.ppg-more-head h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 1.4rem;
	color: var(--ppg-green-900);
}

.ppg-more-head p {
	margin: 4px 0 20px;
	color: var(--ppg-muted);
}

.ppg-more-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
}

.ppg-more-card {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 16px;
	border-radius: var(--ppg-radius-sm);
	border: 1px solid var(--ppg-line);
	background: var(--ppg-cream);
}

.ppg-more-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	flex: 0 0 auto;
	border-radius: var(--ppg-radius-sm);
	background: var(--ppg-green-50);
	color: var(--ppg-green-500);
}

.ppg-icon--card {
	width: 26px;
	height: 26px;
}

.ppg-more-card h3 {
	margin: 0;
	font-size: 1.02rem;
	color: var(--ppg-green-900);
}

.ppg-more-card p {
	margin: 2px 0 6px;
	font-size: .88rem;
	color: var(--ppg-muted);
}

.ppg-soon {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--ppg-green-50);
	color: var(--ppg-green-700);
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* --------------------------------------------------------- Responsive --- */

@media (max-width: 1100px) {

	.ppg-layout {
		grid-template-columns: minmax(0, 1fr) 320px;
		gap: 24px;
	}
}

@media (max-width: 820px) {

	.ppg-layout {
		grid-template-columns: 1fr;
	}

	.ppg-copy {
		max-width: none;
	}
}

@media (max-width: 560px) {

	.ppg-stand {
		gap: 80px;
		height: 44px;
		margin-top: -22px;
	}

	.ppg-stand-leg {
		width: 22px;
	}

	.ppg-plaque {
		font-size: .8rem;
		padding: 6px 12px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.ppg-wheel {
		transition: none !important;
	}
}

.ppg-bloom {
	display: inline-block;
	width: .38em;
	min-width: 22px;
	margin-top: .18em;
}

.ppg-bloom svg {
	width: 100%;
	height: auto;
	display: block;
}
