/* Lucky Draw detail page — shared + device-scoped styles. */

.ld-banner img {
	width: 100%;
	border-radius: 0.75rem;
	display: block;
}

.ld-stream-plugin img,
.ld-stream-plugin iframe {
	max-width: 100%;
}

.ld-winners-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.ld-date-badge {
	font-size: 0.8125rem;
	padding: 0.25rem 0.625rem;
	border-radius: 0.375rem;
	background: rgba(255, 215, 0, 0.12);
	border: 0.0625rem solid var(--border);
	color: var(--gold-text);
	font-weight: 600;
}

.ld-date-select {
	margin-top: 0.75rem;
	padding: 0.4375rem 0.625rem;
	border-radius: 0.375rem;
	background: var(--bg-card);
	border: 0.0625rem solid var(--border);
	color: var(--text-primary);
	width: 100%;
	max-width: 16rem;
}

.ld-winner-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.875rem;
	color: var(--text-primary);
}

.ld-winner-table th {
	color: var(--gold-text);
	text-align: left;
	padding: 0.5rem;
	font-size: 0.8125rem;
	background: rgba(255, 215, 0, 0.08);
}

.ld-winner-table td {
	padding: 0.5rem;
	border-bottom: 0.0625rem solid var(--border);
	font-size: 0.875rem;
}

.ld-col-rank {
	width: 3.75rem;
}

.ld-rank-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--text-secondary);
	background: transparent;
	border: 0.0625rem solid var(--border-strong);
}

/* Only the top 3 carry medal colours; ranks 4+ stay a plain bordered circle. */
.ld-rank-badge.rank-1,
.ld-rank-badge.rank-2,
.ld-rank-badge.rank-3 {
	color: #111;
	border: 0;
}

.ld-rank-badge.rank-1 { background: linear-gradient(135deg, #ffd700, #fff4b2); }
.ld-rank-badge.rank-2 { background: linear-gradient(135deg, #c0c0c0, #f2f2f2); }
.ld-rank-badge.rank-3 { background: linear-gradient(135deg, #cd7f32, #f0d1aa); }

.ld-prize-badge {
	padding: 0.1875rem 0.5rem;
	border-radius: 0.375rem;
	background: rgba(255, 215, 0, 0.14);
	border: 0.0625rem solid var(--border);
	color: var(--gold-text);
	font-weight: 600;
	font-size: 0.75rem;
}

.ld-amount {
	color: var(--gold-text);
	font-weight: 700;
}

.ld-tnc-text {
	color: var(--text-secondary);
	line-height: 1.6;
	font-size: 0.875rem;
}

/* MOBILE */

.m-ld-page .ld-winner-table th,
.m-ld-page .ld-winner-table td {
	font-size: 0.8125rem;
	padding: 0.4375rem 0.375rem;
}

/* ============================================================
   DESKTOP DETAIL — hero + countdown / share / details / winners / T&C
   (hero & feature-row styles come from luckydraw-list.css)
   ============================================================ */

.ld-detail {
	padding-top: 1.5rem;
}

/* Draw panel — dims while a tab / winner date loads in place. */
.ldd-panel {
	transition: opacity 0.18s ease;
}

.ldd-panel.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

/* Banner shows in full (no crop) but capped so it isn't oversized/upscaled. */
.ld-detail .lde-hero {
	max-width: 40rem;
	margin: 0 auto;
}

.ldd-title {
	margin: 1.5rem 0 0;
	text-align: center;
	font-size: 1.75rem;
	font-weight: 800;
	letter-spacing: 0.0313rem;
	color: var(--gold-text);
}

/* "All draws" — back to the listing, on this draw's category */
.ldd-back {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	margin-bottom: 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--text-secondary);
	text-decoration: none;
	transition: color 0.18s ease;
}

.ldd-back:hover {
	color: var(--gold-text);
}

/* Ticket strip (shared/_ticket_strip) — History's width, centred in the countdown card */
.ldd-countdown .tkstrip {
	margin: 1.25rem auto 0;
}

/* Deposit CTA inside the share card (luckydraw-page.html styling) */
.ldd-cta {
	position: relative;
	overflow: hidden;
	display: flex;
	margin-top: 1.25rem;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 1rem;
	border-radius: 0.8125rem;
	background: var(--gold-gradient);
	color: var(--text-on-gold);
	font-family: var(--font-brand);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-decoration: none;
	box-shadow: 0 0.0625rem 0 rgba(255, 255, 255, 0.28) inset, 0 0.5rem 1.625rem rgba(var(--gold-rgb), 0.22);
	transition: transform 0.12s, box-shadow 0.2s;
}

.ldd-cta:hover {
	box-shadow: 0 0.0625rem 0 rgba(255, 255, 255, 0.28) inset, 0 0.625rem 2rem rgba(var(--gold-rgb), 0.34);
}

.ldd-cta:active {
	transform: scale(0.985);
}

/* Light sweep across the button */
.ldd-cta::after {
	content: '';
	position: absolute;
	top: 0;
	left: -60%;
	width: 45%;
	height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
	transform: skewX(-18deg);
	animation: ldd-cta-sweep 3.4s ease-in-out infinite;
}

@keyframes ldd-cta-sweep {
	0% { left: -60%; }
	55%, 100% { left: 130%; }
}

.ldd-tab-empty {
	max-width: 40rem;
	margin: 0 auto;
	text-align: center;
	color: var(--text-secondary);
}

.ldd-tab-empty-ico {
	font-size: 2.5rem;
	color: var(--gold-text);
	opacity: 0.6;
}

.ldd-row {
	margin-top: 1.5rem;
}

.ldd-row--two {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
}

.ldd-row--split {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr);
	gap: 1.5rem;
	align-items: start;
}

/* Left column — live stream stacked above event details */
.ldd-left-col {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	min-width: 0;
}

/* Card shell */
.ldd-card {
	background: var(--bg-card);
	border: 0.0625rem solid var(--border);
	border-radius: 0.875rem;
	padding: 1.5rem;
}

.ldd-card-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.0313rem;
	text-transform: uppercase;
	color: var(--text-primary);
}

.ldd-card-title iconify-icon {
	color: var(--gold-text);
	font-size: 1.375rem;
}

/* Countdown */
.ldd-countdown {
	display: flex;
	flex-direction: column;
}

.ldd-countdown .ldd-card-title {
	justify-content: center;
}

.ldd-cd {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 0.625rem;
	margin: auto 0;
	padding: 0.5rem 0;
}

.ldd-cd .lde-flip {
	flex: 0 0 auto;
}

.ldd-cd .lde-num {
	width: 4.75rem;
}

.ldd-cd-sep {
	align-self: flex-start;
	display: flex;
	align-items: center;
	height: 3.25rem;
	font-size: 2rem;
	font-weight: 800;
	color: var(--gold-text);
	opacity: 0.6;
}

.ldd-cd-none {
	margin: auto 0;
	text-align: center;
	color: var(--text-secondary);
	font-size: 0.875rem;
}

/* Share */
.ldd-share-sub {
	margin: -0.625rem 0 1rem;
	font-size: 0.875rem;
	font-weight: 300;
	color: var(--text-secondary);
}

.ldd-share-icons {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 1rem;
}

.ldd-share-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 0.75rem;
	border: 0.0625rem solid var(--border);
	background: var(--bg-card-alt);
	font-size: 1.5rem;
	cursor: pointer;
	transition: transform 0.18s ease, background 0.18s ease;
}

.ldd-share-ico:hover {
	transform: translateY(-0.1875rem);
}

.ldd-share-ico.is-wa { color: #25D366; background: rgba(37, 211, 102, 0.14); }
.ldd-share-ico.is-fb { color: #1877f2; background: rgba(24, 119, 242, 0.14); }
.ldd-share-ico.is-tg { color: #229ed9; background: rgba(34, 158, 217, 0.14); }
.ldd-share-ico.is-tw { color: #1da1f2; background: rgba(29, 161, 242, 0.14); }
.ldd-share-ico.is-copy { color: var(--gold-text); background: rgba(var(--gold-rgb), 0.12); }

/* Event details */
.ldd-detail-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ldd-detail-item {
	display: grid;
	grid-template-columns: 1.375rem auto 1fr;
	align-items: center;
	gap: 0.625rem;
	padding: 0.75rem 0;
	border-bottom: 0.0625rem solid var(--border);
}

.ldd-detail-item:last-child {
	border-bottom: 0;
}

.ldd-detail-ico {
	font-size: 1.125rem;
	color: var(--gold-text);
}

.ldd-detail-label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--gold-text);
}

.ldd-detail-value {
	justify-self: end;
	text-align: right;
	font-size: 0.875rem;
	color: var(--text-primary);
}

/* Placeholder for attributes with no backing column yet. */
.ldd-detail-value.is-missing {
	color: var(--text-primary);
	font-style: italic;
}

/* Winner list */
.ldd-winners-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.5rem;
}

.ldd-winners-head .ldd-card-title {
	margin: 0;
}

/* Reuse the global custom-select component; just size it for the header.
   Fixed width so the trigger fits the longest label (e.g. "2026-06-24 (Today)"). */
.ldd-winners-head .ldd-date-select {
	flex: 0 0 auto;
	width: 15rem;
	max-width: 100%;
}

/* Resting border reads as a control here — the global subtle border blends
   into the winners card. Sits below the hover (0.55) → open (full gold) steps. */
.ldd-winners-head .ldd-date-select .custom-select-trigger {
	border-color: var(--border-strong);
}

.ldd-wl-wrap {
	overflow-x: auto;
}

.ldd-wl-table {
	width: 100%;
	border-collapse: collapse;
	color: var(--text-primary);
}

.ldd-wl-table th {
	padding: 0.625rem 0.75rem;
	text-align: center;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.0313rem;
	text-transform: uppercase;
	color: var(--text-secondary);
	border-bottom: 0.0625rem solid var(--border);
}

.ldd-wl-table td {
	padding: 0.6875rem 0.75rem;
	text-align: center;
	font-size: 0.875rem;
	border-bottom: 0.0625rem solid var(--border);
}

.ldd-wl-row:hover {
	background: rgba(var(--gold-rgb), 0.05);
}

.ldd-wl-rank {
	width: 4rem;
}

.ldd-wl-winner {
	font-weight: 400;
}

.ldd-wl-prize {
	color: var(--text-primary);
}

.ldd-wl-amount {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--gold-text);
}

.ldd-wl-table tbody tr:nth-child(n+6) {
	display: none;
}

.ldd-winners.is-expanded .ldd-wl-table tbody tr:nth-child(n+6) {
	display: table-row;
}

.ldd-wl-more {
	display: flex;
	width: 16rem;
	max-width: 100%;
	margin: 1.25rem auto 0;
}

.ldd-empty {
	margin: 0.5rem 0 0;
	color: var(--text-secondary);
	font-size: 0.875rem;
}

/* Empty winner list — stretch to the row (left-column) height, center the note */
.ldd-winners.is-empty {
	align-self: stretch;
	display: flex;
	flex-direction: column;
}

.ldd-winners.is-empty .ldd-empty {
	margin: auto;
	text-align: center;
}

/* Live stream — sits in the left column, so it fills that column's width */
.ldd-stream-frame {
	position: relative;
	width: 100%;
	margin: 0 auto;
	aspect-ratio: 16 / 9;
	border-radius: 0.75rem;
	overflow: hidden;
	background: #000;
	border: 0.0625rem solid var(--border);
}

.ldd-stream-frame iframe,
.ldd-stream-frame video,
.ldd-stream-frame embed,
.ldd-stream-frame object {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Non-media snippet (script widget, plain markup) — natural height */
.ldd-stream-raw {
	overflow-x: auto;
}

.ldd-stream-watch {
	margin: 1rem auto 0;
}

/* Terms & conditions */
.ldd-tnc {
	position: relative;
	margin-top: 1.5rem;
	overflow: hidden;
}

.ldd-tnc-text {
	position: relative;
	font-size: 0.875rem;
	line-height: 1.7;
	color: var(--text-secondary);
}

/* Hidden until markdown-content.js renders it, to avoid a raw-markdown flash */
.ldd-tnc-text[data-markdown]:not(.md-ready) {
	visibility: hidden;
}

.ldd-tnc-text > :first-child {
	margin-top: 0;
}

.ldd-tnc-text > :last-child {
	margin-bottom: 0;
}

.ldd-tnc-text p {
	margin: 0 0 0.75rem;
}

.ldd-tnc-text h1,
.ldd-tnc-text h2,
.ldd-tnc-text h3,
.ldd-tnc-text h4 {
	margin: 1rem 0 0.5rem;
	color: var(--text-primary);
	font-weight: 700;
	line-height: 1.3;
}

.ldd-tnc-text h1 { font-size: 1.25rem; }
.ldd-tnc-text h2 { font-size: 1.125rem; }
.ldd-tnc-text h3 { font-size: 1rem; }

.ldd-tnc-text ul,
.ldd-tnc-text ol {
	margin: 0 0 0.75rem;
	padding-left: 1.5rem;
}

/* Re-enable markers — base.css resets ul to list-style:none globally */
.ldd-tnc-text ul { list-style: disc; }
.ldd-tnc-text ol { list-style: decimal; }

.ldd-tnc-text li {
	margin-bottom: 0.375rem;
}

.ldd-tnc-text a {
	color: var(--gold-text);
	text-decoration: underline;
}

.ldd-tnc-text strong {
	color: var(--text-primary);
	font-weight: 700;
}

.ldd-tnc-text blockquote {
	margin: 0 0 0.75rem;
	padding-left: 0.75rem;
	border-left: 0.1875rem solid var(--gold);
}

.ldd-tnc-deco {
	position: absolute;
	right: 1.25rem;
	bottom: 0.5rem;
	font-size: 7rem;
	color: var(--gold-text);
	opacity: 0.08;
	pointer-events: none;
}

/* Narrower desktop — stack the split rows */
@media (max-width: 60rem) {
	.ldd-row--two,
	.ldd-row--split {
		grid-template-columns: 1fr;
	}

	/* Single column now — keep the stream from spanning the full width */
	.ldd-stream-frame,
	.ldd-stream-watch {
		max-width: 34rem;
	}
}

/* ============================================================
   MOBILE DETAIL — parity overrides for the reused ldd-/lde- markup
   (no .d-content wrapper, narrower viewport, fixed-width flips)
   ============================================================ */

.m-ld-page .ld-detail {
	padding: 1rem;
}

.m-ld-page .ldd-title {
	font-size: 1.5rem;
}

.m-ld-page .ldd-card {
	padding: 1.125rem;
}

/* Countdown: let the four units share the row instead of fixed 4.75rem each. */
.m-ld-page .ldd-cd {
	gap: 0.375rem;
	width: 100%;
}

.m-ld-page .ldd-cd .lde-flip {
	flex: 1 1 0;
	min-width: 0;
}

.m-ld-page .ldd-cd .lde-num {
	width: 100%;
	height: 2.75rem;
}

.m-ld-page .ldd-cd .lde-num-track span {
	height: 2.75rem;
	line-height: 2.75rem;
	font-size: 1.75rem;
}

.m-ld-page .ldd-cd-sep {
	height: 2.75rem;
	font-size: 1.5rem;
}

/* Full-width shell (layouts/mobile.css) — cap the detail column so a draw page
   does not run edge to edge on a tablet. */
@media (min-width: 48rem) {
	.main-scroll.m-ld-page {
		max-width: 64rem;
		margin-left: auto;
		margin-right: auto;
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}
}
