.pd-wrap {
	--pd-bg: #33383f;
	--pd-panel: #3b414a;
	--pd-panel-2: #454b56;
	--pd-accent: #c8102e;
	--pd-accent-2: #e8384f;
	--pd-accent-hover: #a10c26;
	--pd-accent-orange: #f5821f;
	--pd-text: #ffffff;
	--pd-muted: #a9afbd;
	--pd-border: #4b515c;
	--pd-hairline: #565d6a;

	--pd-drum-bg: #faf8f4;
	--pd-drum-bg-2: #f1ede4;
	--pd-drum-text: #1c1a17;
	--pd-drum-muted: #7a756a;

	box-sizing: border-box;
	font-family: 'Open Sans', Helvetica, Arial, sans-serif;
	color: var(--pd-text);
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	padding: 8px;
}

.pd-wrap *, .pd-wrap *::before, .pd-wrap *::after {
	box-sizing: border-box;
}

.pd-wrap .pd-card {
	position: relative;
	overflow: hidden;
	background: var(--pd-bg);
	border: 1px solid var(--pd-border);
	border-radius: 8px;
	padding: 26px 20px 26px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.pd-wrap .pd-card::before,
.pd-wrap .pd-card::after {
	content: "";
	position: absolute;
	inset: -50%;
	background-size: 26px 26px;
	pointer-events: none;
	z-index: 0;
}

.pd-wrap .pd-card::before {
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
	animation: pd-grid-drift 60s linear infinite;
}

.pd-wrap .pd-card::after {
	background-image:
		linear-gradient(rgba(200, 16, 46, 0.65) 1px, transparent 1px),
		linear-gradient(90deg, rgba(245, 130, 31, 0.5) 1px, transparent 1px);
	-webkit-mask-image: radial-gradient(ellipse 85% 65% at 85% 6%, #000 0%, rgba(0, 0, 0, 0.5) 38%, transparent 72%);
	mask-image: radial-gradient(ellipse 85% 65% at 85% 6%, #000 0%, rgba(0, 0, 0, 0.5) 38%, transparent 72%);
	mix-blend-mode: screen;
	animation: pd-grid-drift 60s linear infinite, pd-grid-pulse 8s ease-in-out infinite alternate;
}

@keyframes pd-grid-drift {
	from { transform: translate(0, 0); }
	to { transform: translate(26px, 26px); }
}

@keyframes pd-grid-pulse {
	from { opacity: 0.55; }
	to { opacity: 1; }
}

.pd-wrap .pd-content {
	position: relative;
	z-index: 1;
}

.pd-wrap .pd-title {
	text-align: center;
	text-transform: uppercase;
	font-family: 'Montserrat', Helvetica, Arial, sans-serif;
	font-weight: 800 !important;
	letter-spacing: 0.02em;
	font-size: clamp(20px, 5.2vw, 27px) !important;
	color: #ffffff !important;
	margin: 0 0 10px;
	line-height: 1.28;
}

.pd-wrap .pd-rule {
	width: 52px;
	height: 3px;
	background: linear-gradient(90deg, var(--pd-accent), var(--pd-accent-orange));
	margin: 0 auto 16px;
}

.pd-wrap .pd-subtitle {
	text-align: center;
	color: #eef0f4 !important;
	font-weight: 600 !important;
	margin: 0 0 4px;
	font-size: clamp(15px, 3.8vw, 17px) !important;
	line-height: 1.4;
}

.pd-wrap .pd-subtitle-accent {
	color: #ffb156 !important;
	font-weight: 800 !important;
	letter-spacing: 0.01em;
	margin-bottom: 20px;
}

.pd-stage {
	position: relative;
	background: var(--pd-panel);
	border: 1px solid var(--pd-border);
	border-radius: 6px;
	padding: 18px 14px 16px;
}

.pd-drum-frame {
	position: relative;
	width: 100%;
	max-width: 320px;
	height: 360px;
	margin: 0 auto 18px;
	border-radius: 12px;
	overflow: hidden;
	border: 6px solid transparent;
	background:
		linear-gradient(100deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 22%) padding-box,
		linear-gradient(var(--pd-drum-bg), var(--pd-drum-bg-2)) padding-box,
		linear-gradient(155deg, #fff6ea 0%, #c4a35a 28%, #8a6a2e 52%, #e8d5a3 78%, #9a7a3a 100%) border-box;
	box-shadow:
		inset 0 0 30px rgba(0, 0, 0, 0.06),
		inset 0 26px 26px -20px rgba(0, 0, 0, 0.22),
		inset 0 -26px 26px -20px rgba(0, 0, 0, 0.22),
		inset 14px 0 20px -20px rgba(0, 0, 0, 0.18),
		inset -14px 0 20px -20px rgba(0, 0, 0, 0.18),
		0 10px 22px rgba(0, 0, 0, 0.32);
}

.pd-drum-frame::before,
.pd-drum-frame::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 90px;
	z-index: 3;
	pointer-events: none;
}

.pd-drum-frame::before {
	top: 0;
	background: linear-gradient(var(--pd-drum-bg), transparent);
}

.pd-drum-frame::after {
	bottom: 0;
	background: linear-gradient(transparent, var(--pd-drum-bg));
}

.pd-pointer {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 108px;
	transform: translateY(-50%);
	background: radial-gradient(60% 100% at 50% 50%, rgba(200, 16, 46, 0.06) 0%, transparent 75%);
	z-index: 1;
	pointer-events: none;
}

.pd-pointer::before,
.pd-pointer::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 0;
	height: 0;
	transform: translateY(-50%);
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
}

.pd-pointer::before {
	left: 0;
	border-left: 10px solid var(--pd-accent);
}

.pd-pointer::after {
	right: 0;
	border-right: 10px solid var(--pd-accent);
}

.pd-strip {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	will-change: transform, filter;
}

.pd-card-item {
	height: 108px;
	margin: 0 16px 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 14px;
	position: relative;
	z-index: 2;
	border-bottom: 1px solid rgba(28, 26, 23, 0.10);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.42);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.pd-card-item:last-child {
	border-bottom: none;
}

.pd-meta {
	text-align: center;
}

.pd-meta b {
	display: block;
	font-family: 'Montserrat', Helvetica, Arial, sans-serif;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.3;
	color: var(--pd-drum-text);
}

.pd-card-item.pd-rare {
	background: rgba(255, 248, 240, 0.9);
	box-shadow: inset 3px 0 0 var(--pd-accent), inset 0 0 0 1px rgba(200, 16, 46, 0.12);
}

.pd-card-item.pd-rare .pd-meta b {
	color: var(--pd-accent);
	font-weight: 800;
}

.pd-card-item.pd-win {
	background: #fff;
	box-shadow: inset 3px 0 0 var(--pd-accent-orange), 0 0 0 2px rgba(245, 130, 31, 0.35);
}

.pd-card-item.pd-win .pd-meta {
	animation: pd-win-pulse 900ms ease-out;
}

@keyframes pd-win-pulse {
	0% { transform: scale(1); }
	30% { transform: scale(1.14); }
	55% { transform: scale(0.97); }
	100% { transform: scale(1); }
}

.pd-result {
	text-align: center;
	min-height: 26px;
	margin: 8px 0 8px;
	font-family: 'Montserrat', Helvetica, Arial, sans-serif;
	font-weight: 700;
	font-size: 18px;
	line-height: 1.5;
	color: #ffffff;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 420ms ease, transform 420ms ease;
}

.pd-result.pd-result-win {
	min-height: 0;
	padding: 12px 14px 14px;
	border-radius: 6px;
	background: linear-gradient(135deg, var(--pd-accent), var(--pd-accent-orange));
	box-shadow: 0 10px 24px rgba(200, 16, 46, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.pd-result-label {
	display: block;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.86);
	margin-bottom: 4px;
}

.pd-result-prize {
	display: block;
	font-size: clamp(22px, 6.2vw, 30px);
	font-weight: 900;
	line-height: 1.15;
	color: #ffffff;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.pd-gag-strike {
	position: relative;
	display: inline-block;
	letter-spacing: 0.16em;
	padding: 0 2px;
}

.pd-gag-strike::after {
	content: "";
	position: absolute;
	left: -2px;
	right: -2px;
	top: 50%;
	height: 2px;
	background: var(--pd-accent-2);
	transform: translateY(-50%);
	width: 0;
	animation: pd-strike-draw 380ms ease forwards;
	animation-delay: 550ms;
}

@keyframes pd-strike-draw {
	to { width: calc(100% + 4px); }
}

.pd-gag-reveal {
	display: block;
	margin-top: 4px;
	font-size: 20px;
	color: #ffb156;
	opacity: 0;
	transform: scale(0.7);
	animation: pd-gag-pop 420ms cubic-bezier(.34, 1.56, .64, 1) forwards;
	animation-delay: 900ms;
}

@keyframes pd-gag-pop {
	to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.pd-gag-strike::after { animation: none; width: calc(100% + 4px); }
	.pd-gag-reveal { animation: none; opacity: 1; transform: scale(1); }
}

.pd-result.pd-show {
	opacity: 1;
	transform: translateY(0);
}

.pd-result.pd-result-win.pd-show {
	animation: pd-result-pop 520ms cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes pd-result-pop {
	from { opacity: 0; transform: translateY(8px) scale(0.9); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.pd-drum-frame.pd-has-winner::before {
	top: 0;
	height: auto;
	bottom: 0;
	background: rgba(28, 26, 23, 0.52);
	z-index: 4;
}

.pd-drum-frame.pd-has-winner::after {
	opacity: 0;
}

.pd-winner-popup {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.pd-winner-popup[hidden] {
	display: none;
}

.pd-winner-shot {
	position: relative;
	max-width: 78%;
	max-height: 84%;
	opacity: 0;
	transform: scale(0.6);
	pointer-events: none;
}

.pd-winner-popup.pd-show .pd-winner-shot {
	animation:
		pd-photo-in 480ms cubic-bezier(.34, 1.56, .64, 1) forwards,
		pd-photo-pulse 1500ms ease-in-out 480ms infinite;
}

.pd-winner-img {
	display: block;
	max-width: 100%;
	max-height: 302px;
	width: auto;
	height: auto;
	margin: 0;
	object-fit: contain;
	border-radius: 8px;
	border: 2px solid rgba(255, 255, 255, 0.88);
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
	pointer-events: none;
}

.pd-winner-close {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 6;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 18, 16, 0.78);
	color: #fff;
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	pointer-events: auto;
	touch-action: manipulation;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.pd-winner-close:hover,
.pd-winner-close:focus {
	background: #c8102e;
	outline: none;
}

@keyframes pd-photo-in {
	from { opacity: 0; transform: scale(0.6); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes pd-photo-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.04); }
}

.pd-post-message {
	text-align: center;
	font-weight: 700;
	font-size: 15px;
	color: var(--pd-text);
	background: var(--pd-panel);
	border: 1px solid var(--pd-hairline);
	border-left: 3px solid var(--pd-accent);
	border-radius: 4px;
	padding: 12px 14px;
	margin: 6px 0 14px;
	line-height: 1.4;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 420ms ease 120ms, transform 420ms ease 120ms;
	position: relative;
	z-index: 1;
}

.pd-post-message.pd-show {
	opacity: 1;
	transform: translateY(0);
}

.pd-spin-btn {
	display: block;
	width: 100%;
	max-width: 320px;
	margin: 4px auto 0;
	padding: 15px 18px;
	border: 0;
	border-radius: 4px;
	font-family: 'Montserrat', Helvetica, Arial, sans-serif;
	font-size: 16px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	cursor: pointer;
	color: #fff;
	background: linear-gradient(135deg, var(--pd-accent), var(--pd-accent-orange));
	box-shadow: 0 8px 18px rgba(200, 16, 46, 0.28);
	touch-action: manipulation;
	transition: filter .2s, transform .2s;
	animation: pd-btn-breathe 2.6s ease-in-out infinite;
	position: relative;
	z-index: 1;
}

@keyframes pd-btn-breathe {
	0%, 100% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.35); }
	50% { box-shadow: 0 0 0 8px rgba(200, 16, 46, 0); }
}

.pd-spin-btn:hover:not(:disabled) {
	filter: brightness(1.08);
	transform: translateY(-1px);
}

.pd-spin-btn:active:not(:disabled) {
	filter: brightness(0.95);
}

.pd-spin-btn:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	animation: none;
}

.pd-spin-btn[hidden] {
	display: none;
}

.pd-confetti {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 6;
}

.pd-confetti-piece {
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--pd-size, 8px);
	height: var(--pd-size, 8px);
	background: var(--pd-color, #c8102e);
	opacity: 0;
	animation: pd-confetti-burst var(--pd-dur, 900ms) cubic-bezier(.2, .7, .3, 1) forwards;
	animation-delay: var(--pd-delay, 0ms);
}

@keyframes pd-confetti-burst {
	0% {
		transform: translate(-50%, -50%) translate(0, 0) rotate(0deg) scale(1);
		opacity: 1;
	}
	100% {
		transform: translate(-50%, -50%) translate(var(--pd-dx), var(--pd-dy)) rotate(var(--pd-rot)) scale(.4);
		opacity: 0;
	}
}

@media (max-width: 380px) {
	.pd-drum-frame {
		height: 320px;
	}
	.pd-winner-img {
		max-height: 268px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pd-spin-btn { animation: none; }
	.pd-card-item.pd-win .pd-meta { animation: none; }
	.pd-result, .pd-post-message { transition: none; }
	.pd-result.pd-result-win.pd-show { animation: none; }
	.pd-winner-popup.pd-show .pd-winner-shot { animation: none; opacity: 1; transform: scale(1); }
	.pd-wrap .pd-card::before, .pd-wrap .pd-card::after { animation: none; }
	.pd-confetti-piece { display: none; }
}
