/*
 * Shared cashdrop widget styles.
 *
 * Everything is scoped under #cdw-root / .cdw-* so it cannot collide with a
 * host game's stylesheet (Unity TemplateData/style.css is very greedy).
 * Per-game skinning happens through the custom properties on #cdw-root only --
 * add a new theme in themes.js, never edit the rules below.
 */

@import url("https://fonts.googleapis.com/css2?family=Alexandria:wght@800&display=swap");

@font-face {
	font-family: "TT Interphases Pro";
	src: url("../assets/cashdrop/font/TTInterphasesPro-Regular.ttf") format("truetype");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "TT Interphases Pro";
	src: url("../assets/cashdrop/font/TTInterphasesPro-DemiBold.ttf") format("truetype");
	font-weight: 600 700;
	font-display: swap;
}
@font-face {
	font-family: "TT Interphases Pro";
	src: url("../assets/cashdrop/font/TTInterphasesPro-Black.ttf") format("truetype");
	font-weight: 800 900;
	font-display: swap;
}

#cdw-root {
	/*
	 * Theme surface -- overridden per game from themes.js. Defaults below are the
	 * approved coin-pusher values from the Figma spec, so an unskinned game still
	 * renders coherently.
	 */
	--cdw-card-bg: linear-gradient(180deg, #0383db 0%, #005498 100%);
	--cdw-card-edge: #003d72;                      /* outer top/bottom lip */
	--cdw-card-inset: rgba(50, 196, 242, 0.4);     /* inner highlight */
	--cdw-glow: #40b1f0;                           /* blurred accent ellipses */
	--cdw-body: #07336d;                           /* dark panel behind blocks */
	--cdw-panel: #022757;                          /* blocks: tabs/period/list */
	--cdw-panel-border: rgba(255, 255, 255, 0.05);
	--cdw-panel-edge: #002545;                      /* 1px bottom lip on blocks */
	--cdw-tab-bg: #011e45;                          /* inactive tab */
	--cdw-tab-active: #0455bd;
	--cdw-plate: linear-gradient(180deg, #3d95e3 0%, #1e72d2 42%, #0f4f9e 100%);
	--cdw-plate-border: #6fd0ff;
	--cdw-accent: #0455bd;
	--cdw-text: #ffffff;
	--cdw-text-dim: rgba(207, 227, 255, 0.72);
	--cdw-footer: #0455bd;
	--cdw-close: #e8302f;                           /* close button square */
	--cdw-countdown-cell: rgba(0, 0, 0, 0.2);        /* counter cell fill */
	--cdw-countdown-border: rgba(255, 255, 255, 0.08);
	--cdw-cta: radial-gradient(34.37% 85.71% at 49.87% 8.57%, #d1930a 0%, #fdb51a 100%);
	--cdw-neutral: linear-gradient(360deg, #716f6f 0%, #dbd9d9 100%);
	/* Row tints: two-layer gradients straight from the spec. */
	--cdw-rank1: linear-gradient(90deg, rgba(214, 151, 12, 0.3) 0%, rgba(253, 182, 27, 0.3) 100%), rgba(255, 195, 64, 0.1);
	--cdw-rank2: linear-gradient(90deg, rgba(53, 53, 53, 0.3) 0%, rgba(116, 116, 116, 0.3) 100%), rgba(210, 210, 210, 0.1);
	--cdw-rank3: linear-gradient(90deg, rgba(87, 33, 2, 0.3) 0%, rgba(189, 91, 4, 0.3) 100%), rgba(253, 109, 20, 0.1);

	/*
	 * Layout constants -- shared by every theme.
	 * The spec's fonts are Altone (body) and Product Sans (buttons); neither is
	 * licensed here, so TT Interphases Pro stands in.
	 */
	--cdw-font: "TT Interphases Pro", "Segoe UI", system-ui, sans-serif;

	position: fixed;
	inset: 0;
	z-index: 2147483000;
	pointer-events: none;
	/*
	 * The header art deliberately bleeds wider than the card. Clip it to the
	 * viewport so the bleed can never become a horizontal scroll.
	 */
	overflow: hidden;
	font-family: var(--cdw-font);
	color: var(--cdw-text);
	-webkit-font-smoothing: antialiased;
}

/*
 * Reset inside the widget so host styles cannot leak in (Unity's
 * TemplateData/style.css is greedy).
 *
 * The id sits inside :where() ON PURPOSE. Written plainly as `#cdw-root *` these
 * rules carry id-level specificity (1,0,0) and silently beat every class rule
 * below -- which zeroed every padding/margin in the widget and stripped the
 * background off every button. :where() contributes zero specificity, so this
 * behaves as a true default any class can override. Do not "simplify" it back.
 *
 * Note the pseudo-elements are OUTSIDE the :where(): pseudo-elements are invalid
 * inside :where(), and one invalid selector in a comma list drops the whole rule.
 */
:where(#cdw-root) *,
:where(#cdw-root) *::before,
:where(#cdw-root) *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: inherit;
	line-height: normal;
	text-transform: none;
	letter-spacing: normal;
}

:where(#cdw-root) button {
	font: inherit;
	color: inherit;
	background: none;
	border: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

:where(#cdw-root) img {
	display: block;
	max-width: 100%;
	border: none;
}

/* box-sizing must not be overridable by the cascade above. */
#cdw-root,
#cdw-root *,
#cdw-root *::before,
#cdw-root *::after {
	box-sizing: border-box;
}

/* Only the actual chrome takes pointer events, never the full-screen root. */
#cdw-root > * {
	pointer-events: auto;
}

/* ---------------------------------------------------------------- floating */

.cdw-float {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px 6px 6px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.62);
	border: 2px solid var(--cdw-glow);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
	animation: cdw-slide-in 320ms ease;
}

.cdw-float__logo {
	width: 50px;
	height: auto;
	flex-shrink: 0;
}

.cdw-float__meta {
	display: flex;
	flex-direction: column;
	gap: 1px;
	text-align: left;
}

.cdw-float__label {
	font-size: 9px;
	font-weight: 400;
	opacity: 0.8;
	white-space: nowrap;
}

.cdw-float__time {
	font-size: 13px;
	font-weight: 900;
	white-space: nowrap;
	letter-spacing: 0.3px;
}

.cdw-float__hide {
	position: absolute;
	top: -8px;
	right: -8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.7);
	display: grid;
	place-items: center;
}

/* hide.svg's arrow points right; the pill hides to the left, so flip it. */
.cdw-float__hide img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transform: rotate(180deg);
}

/*
 * Hidden state: the same floating artwork as a tab pinned to the left edge, so
 * tapping it brings the widget back. Shown upright, not flipped.
 */
.cdw-peek {
	position: absolute;
	top: 10px;
	left: 0;
	width: 62px;
	padding: 4px 6px 4px 4px;
	border-radius: 0 8px 8px 0;
	background: rgba(0, 0, 0, 0.62);
	border: 1px solid var(--cdw-glow);
	border-left: none;
	line-height: 0;
}

.cdw-peek img {
	width: 100%;
	height: auto;
}

/* ----------------------------------------------------------------- overlay */

/*
 * Geometry below is transcribed from the approved Figma spec, which is authored
 * at a 411px viewport. Fixed px values are kept where the design is fixed, but
 * anything that would overflow a narrower phone is made flexible instead --
 * noted inline where that differs from the spec.
 */

.cdw-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.58);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	/*
	 * overflow-y:auto alone computes overflow-x to 'auto' as well, which let the
	 * header's bleed be scrolled sideways. Pin the x axis shut explicitly.
	 */
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.cdw-card {
	position: relative;
	width: min(348px, 100vw - 32px);
	max-width: 100%;
	/*
	 * Reserve room for the part of the header art that rises above the card.
	 * Mirrors --cdw-header-lift (39.63% of card width), which cannot be used here
	 * because a card margin resolves against the overlay, not the card.
	 */
	margin-top: calc(min(138px, 39.6vw) - 7px);
	padding: 0 8px 14px;
	border-radius: 12px;
	background: var(--cdw-card-bg);
	box-shadow:
		0 -4px 0 var(--cdw-card-edge),
		0 6px 1px var(--cdw-card-edge),
		inset 0 -4px 2px var(--cdw-card-inset),
		inset 0 4px 2px var(--cdw-card-inset);
	animation: cdw-pop-in 260ms ease;
	/*
	 * NOT overflow:hidden -- the header art overhangs the top edge and the close
	 * button floats above it; clipping here would cut both off. The glow gets its
	 * own clipping layer instead.
	 */
}

/* Decorative glow, lower left, clipped to the card's rounded box. */
.cdw-card__glow {
	position: absolute;
	inset: 0;
	border-radius: 12px;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}

/*
 * A radial-gradient, not filter: blur(100px). The blur is a huge convolution
 * repainted over the host game's WebGL canvas; this looks equivalent for
 * essentially no GPU cost.
 */
.cdw-card__glow::before {
	content: "";
	position: absolute;
	left: -111px;
	bottom: -89px;
	width: 400px;
	height: 400px;
	background: radial-gradient(circle closest-side,
		var(--cdw-glow) 0%, rgba(64, 177, 240, 0.35) 45%, rgba(64, 177, 240, 0) 100%);
	opacity: 0.55;
}

.cdw-card__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-top: 12px;
}

.cdw-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	padding: 12px;
	border-radius: 12px;
	background: var(--cdw-body);
}

/*
 * Header artwork.
 *
 * Combined mode (coin pusher): headerArt is the ENTIRE header illustration --
 * character in the upper part and the banner plate filling the lower part at
 * full width. Title is overlaid on the plate region.
 *
 * Split mode (horse race, .cdw-card__header--split): characters are a separate
 * cutout perched above a titlePlate ribbon image that carries the title.
 *
 * The negative margin lifts the characters above the card. --cdw-header-lift is
 * set from JS from the theme geometry.
 *
 * Stacking, bottom to top: glow, art/plate, title, close button.
 */
.cdw-card__header {
	position: relative;
	z-index: 2;
	/*
	 * Overhangs the card's border box so the plate caps its top edge. These exact
	 * values are the approved placement -- slightly asymmetric (24px left, 23px
	 * right) on purpose, because the artwork itself is not perfectly centred.
	 * margin-right stays 0: with an explicit width the browser derives it.
	 */
	width: calc(100% + 47px);
	margin-left: -24px;
	margin-right: 0;
	/*
	 * Nudge, applied on top of the themed lift: positive pushes the plate DOWN
	 * over the card, negative pulls it further up. Keep .cdw-card's margin-top in
	 * sync -- it reserves (lift - nudge) worth of space above the card.
	 */
	margin-top: calc(-1 * var(--cdw-header-lift, 39.63%) + 15px);
	pointer-events: none;
}

.cdw-card__art {
	width: 100%;
	height: auto;
}

/* Split header: ribbon caps the card; mascots sit above the ribbon. */
.cdw-card__header--split {
	position: relative;
	display: block;
	/* Same overhang as the combined header so the ribbon keeps its previous size. */
	width: calc(100% + 47px);
	margin-left: -24px;
	margin-right: 0;
	/* Plate sits on the card's top edge; characters hang above via absolute. */
	margin-top: 0;
	padding-top: 0;
	overflow: visible;
}

.cdw-card__chars {
	position: absolute;
	left: 50%;
	bottom: 72%;
	/* Small positive Y tuck so feet rest on the ribbon; stay painted above it. */
	transform: translate(-50%, var(--cdw-chars-tuck, 10%));
	z-index: 3;
	width: var(--cdw-chars-width, 72%);
	height: auto;
	pointer-events: none;
}

.cdw-card__plate {
	position: relative;
	z-index: 2;
	width: 100%;
	/* Reserve ribbon height so absolute img doesn't collapse the header.
	 * --cdw-plate-aspect is height/width from the theme. */
	aspect-ratio: calc(1 / var(--cdw-plate-aspect, 0.13));
	line-height: 0;
	overflow: visible;
}

.cdw-card__plate-img {
	position: absolute;
	/* Tweak via --cdw-plate-* on #cdw-root[data-cdw-layout="wide"]. */
	top: var(--cdw-plate-top, 0%);
	left: var(--cdw-plate-left, 50%);
	width: var(--cdw-plate-width, 100%);
	/* Beat the global img max-width:100% so the ribbon can overrun the plate. */
	max-width: none;
	transform: translate(var(--cdw-plate-tx, -50%), var(--cdw-plate-ty, 0%));
	height: auto;
	display: block;
	pointer-events: none;
}

.cdw-card__header--split .cdw-card__title {
	top: var(--cdw-header-title-y, 50%);
	left: 12%;
	right: 12%;
	z-index: 3;
}

/* Split: reserve room for overhanging mascots; ribbon is the visual top.
 * Multiply the unitless lift ratio by the card width -- a bare % margin would
 * resolve against the overlay/viewport and leave a huge gap. */
#cdw-root[data-cdw-header="split"] .cdw-card {
	margin-top: calc(var(--cdw-header-lift-ratio, 0.31) * min(348px, 100vw - 32px) + 8px);
	padding-top: 0;
}

#cdw-root[data-cdw-header="split"] .cdw-card__inner {
	padding-top: 6px;
}

#cdw-root[data-cdw-header="split"] .cdw-card__close {
	/* Float beside the mascot heads, above the ribbon (mockup placement). */
	top: calc(-0.7 * var(--cdw-header-lift-ratio, 0.44) * min(348px, 100vw - 32px));
	right: 4px;
	z-index: 6;
}

/* ---- Wide horserace layout (two columns + wide ribbon) ---- */

#cdw-root[data-cdw-layout="wide"] .cdw-card {
	width: min(720px, calc(100vw - 24px));
	padding: 0 12px 14px;
}

#cdw-root[data-cdw-layout="wide"] .cdw-card__header--split {
	width: calc(100% + 28px);
	margin-left: -14px;
}

/*
 * Plate knobs live in CSS (not theme.vars) so DevTools / stylesheet tweaks
 * are not overwritten by inline setProperty on #cdw-root.
 */
#cdw-root[data-cdw-layout="wide"] {
	--cdw-plate-top: 0%;
	--cdw-plate-width: 107%;
	--cdw-plate-left: 50%;
	--cdw-plate-tx: -50%;
	--cdw-plate-ty: 0%;
}

/* Cropped ribbon is short; perch characters on its top edge. */
#cdw-root[data-cdw-layout="wide"] .cdw-card__chars {
	bottom: 100%;
	transform: translate(-50%, 22%);
	width: var(--cdw-chars-width, 58%);
}

#cdw-root[data-cdw-layout="wide"] .cdw-card__plate-img {
	top: var(--cdw-plate-top, 0%);
	left: var(--cdw-plate-left, 50%);
	width: var(--cdw-plate-width, 107%);
	max-width: none;
	transform: translate(var(--cdw-plate-tx, -50%), var(--cdw-plate-ty, 0%));
}

#cdw-root[data-cdw-layout="wide"] .cdw-card__header--split .cdw-card__title {
	top: 50%;
}

#cdw-root[data-cdw-layout="wide"] .cdw-card__close {
	top: calc(-0.55 * var(--cdw-header-lift-ratio, 0.2) * min(720px, calc(100vw - 24px)));
	right: -4px;
}

#cdw-root[data-cdw-layout="wide"] .cdw-card__title {
	left: 8%;
	right: 8%;
	font-family: "Alexandria", "TT Interphases Pro", "Segoe UI", system-ui, sans-serif;
	font-style: normal;
	font-weight: 800;
	font-size: clamp(18px, 3.4vw, 24px);
	line-height: 29px;
	letter-spacing: 0.05em;
	color: #fffdff;
	-webkit-text-stroke: 1.06px #00101d;
	paint-order: stroke fill;
	text-shadow:
		0 2.12px 0 #00101d,
		0 0 11px rgba(0, 16, 29, 0.35);
}

#cdw-root[data-cdw-layout="wide"] .cdw-card__body {
	padding: 12px 14px;
}

/* Match body inset + wide column ratio so Skip/Next line up with the panels. */
#cdw-root[data-cdw-layout="wide"] .cdw-actions {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 7px;
	padding: 0 14px;
	height: auto;
}

#cdw-root[data-cdw-layout="wide"] .cdw-btn {
	flex: none;
	width: 100%;
	min-height: 44px;
	font-size: 16px;
}

.cdw-wide {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
	gap: 7px;
	min-width: 0;
	align-items: stretch;
}

.cdw-wide__left,
.cdw-wide__right {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
	padding: 8px;
	border-radius: 8px;
	background: var(--cdw-panel);
	border: 0.8px solid var(--cdw-panel-border);
	box-shadow: 0 1px 0 var(--cdw-panel-edge), inset 0 1px 20px rgba(0, 0, 0, 0.08);
}

.cdw-wide__logo {
	width: auto;
	height: 70px;
	object-fit: contain;
	align-self: flex-start;
}

.cdw-wide__period-label {
	font-size: 13px;
	font-weight: 600;
	opacity: 0.85;
	margin-bottom: 2px;
}

.cdw-wide__period-value {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.cdw-wide__left .cdw-countdown {
	align-self: flex-start;
}

.cdw-wide__left .cdw-rules--summary {
	padding: 0;
	font-size: 12px;
	line-height: 1.45;
}

.cdw-wide__right-title {
	font-size: 15px;
	font-weight: 800;
	line-height: 1.3;
}

.cdw-wide__terms {
	flex: 1 1 auto;
	min-height: 140px;
	max-height: min(42vh, 280px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 2px 4px 0;
	-webkit-overflow-scrolling: touch;
}

.cdw-wide__terms .cdw-rules {
	padding: 0;
	font-size: 12px;
	line-height: 1.5;
}
.cdw-rules ol {
    list-style: decimal;
}
.cdw-rules ul {
    list-style: disc;
}

.cdw-bonus-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 285px;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding-right: 2px;
	-webkit-overflow-scrolling: touch;
}

.cdw-bonus-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	align-self: stretch;
	flex: 0 0 auto;
	gap: 6px;
	padding: 6px 8px;
	border-radius: 6px;
	background: linear-gradient(270deg, #083064 0%, #034780 100%);
	overflow: hidden;
}

.cdw-bonus-card__head {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: flex-start;
	align-self: stretch;
	gap: 6px;
	min-height: 32px;
}

.cdw-bonus-card__identity {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.cdw-bonus-card__avatar {
	width: 29px;
	height: 29px;
	object-fit: contain;
	flex-shrink: 0;
}

.cdw-bonus-card__name {
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
	color: #fff;
	white-space: nowrap;
}

.cdw-bonus-card__prize {
	flex-shrink: 0;
	padding: 8px 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 16px;
	color: #fff;
	text-align: right;
	white-space: nowrap;
}

.cdw-bonus-card__tasks {
	display: flex;
	flex-direction: column;
	align-self: stretch;
	gap: 6px;
	width: 100%;
}

.cdw-bonus-task {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	align-self: stretch;
	gap: 6px;
}

.cdw-bonus-task__label {
	font-size: 11px;
	font-weight: 400;
	line-height: 16px;
	color: #fff;
}

.cdw-bonus-task__track {
	position: relative;
	align-self: stretch;
	width: 100%;
	height: 16px;
	border-radius: 26px;
	background: rgba(0, 0, 0, 0.2);
	box-shadow:
		0 0.65px 1.3px rgba(255, 255, 255, 0.35),
		inset 0 2.6px 3.9px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

.cdw-bonus-task__fill {
	position: absolute;
	left: 1.5px;
	top: 50%;
	z-index: 0;
	transform: translateY(-50%);
	height: 12px;
	border-radius: 13px;
	background: linear-gradient(180deg, #ffebc0 0%, #fdb51a 100%);
	min-width: 0;
	max-width: calc(100% - 3px);
}

.cdw-bonus-task__count {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 600;
	line-height: 16px;
	color: #fff;
	white-space: nowrap;
	pointer-events: none;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.cdw-bonus-task__tgt {
	color: #ffe08a;
}

.cdw-bonus-task--done .cdw-bonus-task__fill {
	background: linear-gradient(180deg, #9be7c4 0%, #2fbd84 100%);
}

.cdw-bonus-task--done .cdw-bonus-task__tgt {
	color: #d7ffe9;
}

.cdw-bonus-card[data-locked="true"] > :not(.cdw-bonus-lock),
.cdw-bonus-card[data-passed="true"] > :not(.cdw-bonus-lock) {
	filter: grayscale(0.35);
	opacity: 0.45;
}

.cdw-bonus-lock {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 12px;
	text-align: center;
	background: rgba(8, 16, 32, 0.55);
	z-index: 2;
}

.cdw-bonus-lock__icon {
	width: 64px;
	height: 64px;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.cdw-bonus-lock--pass .cdw-bonus-lock__icon {
	width: 72px;
	height: 72px;
}

.cdw-bonus-lock__icon img,
.cdw-bonus-lock__icon svg {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

.cdw-bonus-lock__title {
	font-size: 13px;
	font-weight: 800;
	color: #fff;
}

.cdw-bonus-lock__hint {
	font-size: 11px;
	font-weight: 600;
	line-height: 1.35;
	max-width: 220px;
	color: rgba(255, 255, 255, 0.85);
}

/*
 * In-game landscape size (approved mock): ~78vw card, fixed body height so
 * mascots + Skip/Next all stay on screen. Columns scroll inside the body.
 */
@media (max-width: 720px), (max-height: 500px) {
	#cdw-root[data-cdw-layout="wide"] {
		--cdw-plate-width: 104%;
	}

	/* Default to the "scrolled to bottom" position — buttons on screen, chars above. */
	#cdw-root[data-cdw-layout="wide"] .cdw-overlay {
		align-items: flex-end;
		justify-content: center;
		padding: 8px 8px 10px;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card {
		width: min(78vw, 520px);
		margin-top: 52px;
		padding: 0 8px 10px;
		max-height: none;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card__header--split {
		width: calc(100% + 20px);
		margin-left: -10px;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card__plate {
		aspect-ratio: 8.2 / 1;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card__plate-img {
		width: var(--cdw-plate-width, 104%);
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card__chars {
		/* Beat JS inline --cdw-chars-width (58%). */
		width: 40% !important;
		max-width: 180px;
		bottom: 100%;
		transform: translate(-50%, 26%);
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card__title {
		font-size: clamp(13px, 2.6vw, 16px);
		line-height: 1.15;
		letter-spacing: 0.04em;
		-webkit-text-stroke-width: 0.7px;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card__close {
		top: -48px;
		right: 0;
		width: 26px;
		height: 26px;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card__inner {
		gap: 6px;
		padding-top: 6px;
	}

	/*
	 * Main dark wrapper — fixed mock height; panels scroll inside.
	 * NOT overflow:hidden -- only mission events get the .cdw-wide grid (which
	 * fits exactly, so this never scrolls). A cashdrop/league event on the
	 * horserace theme renders the stacked intro/tabs into this same 168px box,
	 * and hidden clipped everything below the countdown with no way to scroll.
	 */
	#cdw-root[data-cdw-layout="wide"] .cdw-card__body {
		height: 168px;
		max-height: 168px;
		padding: 6px 8px;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-actions {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
		gap: 7px;
		padding: 0 8px;
		height: auto;
		width: 100%;
		margin: 0;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-btn {
		flex: none;
		width: 100%;
		min-height: 30px;
		font-size: 13px;
		border-radius: 4px;
	}

	.cdw-wide {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
		gap: 7px;
		height: 100%;
		min-height: 0;
	}

	.cdw-wide__left,
	.cdw-wide__right {
		gap: 6px;
		padding: 6px;
		min-height: 0;
		height: 100%;
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	/* Whole left/right panel scrolls — not just the summary text. */
	.cdw-wide__left .cdw-rules--summary,
	.cdw-wide__terms,
	.cdw-bonus-list {
		flex: 0 0 auto;
		min-height: 0;
		max-height: none;
		overflow: visible;
	}

	/*
	 * Same for the stacked intro (non-mission event): the card body is the one
	 * scroller. A second scroller nested in a 168px box traps the swipe.
	 */
	#cdw-root[data-cdw-layout="wide"] .cdw-intro__body {
		max-height: none;
		overflow: visible;
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-intro__fade {
		display: none;
	}

	.cdw-wide__logo {
		height: 40px;
	}

	.cdw-wide__period-label {
		font-size: 10px;
		margin-bottom: 0;
	}

	.cdw-wide__period-value {
		font-size: 11px;
	}

	.cdw-wide__right-title {
		font-size: 12px;
	}

	.cdw-wide__left .cdw-rules--summary,
	.cdw-wide__terms .cdw-rules {
		font-size: 10px;
		line-height: 1.35;
	}

	.cdw-wide__left .cdw-countdown {
		width: min(150px, 100%);
		height: 32px;
		padding: 1px;
	}

	.cdw-wide__left .cdw-countdown__box {
		height: 28px;
		padding: 1px 0;
	}

	.cdw-wide__left .cdw-countdown__value {
		font-size: 12px;
		line-height: 1;
	}

	.cdw-wide__left .cdw-countdown__label {
		font-size: 7px;
	}

	.cdw-bonus-list {
		gap: 6px;
	}

	.cdw-bonus-card {
		padding: 5px 6px;
		gap: 4px;
		border-radius: 5px;
	}

	.cdw-bonus-card__avatar {
		width: 22px;
		height: 22px;
	}

	.cdw-bonus-card__name {
		font-size: 11px;
	}

	.cdw-bonus-card__prize {
		padding: 2px 0;
		font-size: 12px;
	}

	.cdw-bonus-task__label {
		font-size: 9px;
	}

	.cdw-bonus-task__track {
		height: 12px;
	}

	.cdw-bonus-task__fill {
		height: 8px;
	}

	.cdw-bonus-task__count {
		font-size: 9px;
	}

	.cdw-bonus-lock__icon {
		width: 52px;
		height: 52px;
	}

	.cdw-bonus-lock--pass .cdw-bonus-lock__icon {
		width: 58px;
		height: 58px;
	}

	.cdw-bonus-lock__title {
		font-size: 11px;
	}

	.cdw-bonus-lock__hint {
		font-size: 9px;
	}
}

/*
 * Portrait phone: the block above also matches (max-width: 720px), but its
 * 168px body is the landscape mock -- in portrait it left a sliver of content
 * pinned to the bottom of a mostly empty screen. Use the height instead and
 * grow with the content; the landscape layout (max-height: 500px) is untouched.
 *
 * 200px = everything around the body: mascots poking above the ribbon (~80),
 * ribbon (~45), inner gaps (18), Skip/Next (30), card + overlay padding (~28).
 */
@media (max-width: 720px) and (min-height: 501px) {
	#cdw-root[data-cdw-layout="wide"] .cdw-card {
		width: min(calc(100vw - 24px), 520px);
	}

	#cdw-root[data-cdw-layout="wide"] .cdw-card__body {
		height: auto;
		min-height: 168px;
		max-height: min(calc(100vh - 200px), 520px);
		max-height: min(calc(100dvh - 200px), 520px);
	}
}

/* Centred on the plate baked into the artwork. */
.cdw-card__title {
	position: absolute;
	left: 7%;
	right: 7%;
	top: var(--cdw-header-title-y, 79%);
	transform: translateY(-50%);
	font-size: clamp(17px, 5.6vw, 24px);
	font-weight: 900;
	font-style: italic;
	line-height: 1.1;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-shadow: 0 3px 5px rgba(0, 0, 0, 0.65);
}

/* Fallback for themes with no header art: draw the plate in CSS instead. */
.cdw-card__title--plate {
	position: relative;
	left: auto;
	right: auto;
	top: auto;
	transform: none;
	z-index: 2;
	margin: 0 -8px;
	padding: 14px 16px 16px;
	border-radius: 12px 12px 0 0;
	background: var(--cdw-plate);
	box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32);
}

/* Red rounded square floating above the card's top-right. */
.cdw-card__close {
	position: absolute;
	top: -58px;
	right: 6px;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: var(--cdw-close);
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
	display: grid;
	place-items: center;
	z-index: 5;
}

.cdw-card__close img {
	width: 100%;
	height: 100%;
}

/* ------------------------------------------------------------------- intro */

/*
 * First page inside the card: dates + countdown, then the event description.
 * No tabs and no league selector -- Next moves to the tabbed page.
 */
.cdw-intro {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 7px;
	min-height: 0;
}

/*
 * Segmented counter, sized from the approved spec: a 198x46.08 strip of four
 * 47.74x42.05 cells, each carrying its own fill and border (the strip itself is
 * transparent). Only the outer two cells are rounded, so it reads as one
 * control. Decimals are the spec's own -- kept rather than rounded so the four
 * cells plus gaps and padding still total exactly 198px.
 */
.cdw-countdown {
	display: flex;
	align-items: center;
	/* Hug the cells instead of stretching to the meta column's full width. */
	align-self: flex-start;
	gap: 1.01px;
	padding: 2.01px;
	width: 198px;
	max-width: 100%;
	height: 46.08px;
	border-radius: 8.05px;
}

.cdw-countdown__box {
	flex: 1 1 0;
	min-width: 0;
	height: 42.05px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4.03px 0;
	background: var(--cdw-countdown-cell);
	border: 0.8px solid var(--cdw-countdown-border);
	box-shadow: inset -2px 2px 4px rgba(0, 0, 0, 0.1);
	text-align: center;
}

.cdw-countdown__box:first-child {
	border-radius: 6.04px 0 0 6.04px;
}

.cdw-countdown__box:last-child {
	border-radius: 0 6.04px 6.04px 0;
}

/* Vertical gradient fill on the digits, per the spec. */
.cdw-countdown__value {
	font-size: 18.12px;
	font-weight: 600;
	line-height: 22px;
	background: linear-gradient(180deg, #ffffff 0%, #aac6e7 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.cdw-countdown__label {
	font-size: 7.05px;
	font-weight: 400;
	line-height: 10px;
	color: var(--cdw-text);
}

.cdw-intro__body {
	min-height: 0;
	max-height: min(42vh, 340px);
	overflow-y: auto;
	overscroll-behavior-y: contain;
	-webkit-overflow-scrolling: touch;
}

/* Fades the scrolling text into the body panel's bottom edge. */
.cdw-intro__fade {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 50px;
	background: linear-gradient(180deg, rgba(7, 51, 109, 0) 0%, var(--cdw-body) 100%);
	pointer-events: none;
}

.cdw-intro .cdw-rules {
	padding: 2px 2px 12px;
	font-size: 14px;
	line-height: 1.55;
}

/* -------------------------------------------------------------------- tabs */

.cdw-tabs {
	padding: 8px 10px;
	border-radius: 12px;
	background: var(--cdw-panel);
	border: 0.8px solid var(--cdw-panel-border);
	box-shadow: 0 1px 0 var(--cdw-panel-edge), inset 0 1px 20px rgba(0, 0, 0, 0.08);
}

.cdw-tabs__row {
	display: flex;
	gap: 7.37px;
}

.cdw-tab {
	flex: 1 1 0;
	min-width: 0;
	height: 30.21px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 2.95px;
	border-radius: 2.95px;
	background: var(--cdw-tab-bg);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--cdw-text);
	white-space: nowrap;
	transition: background 160ms ease;
}

.cdw-tab img {
	width: 27.35px;
	height: 22.84px;
	object-fit: contain;
	flex-shrink: 0;
}

/* The label shrinks before the icon does on narrow screens. */
.cdw-tab__label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cdw-tab[aria-selected="true"] {
	background: var(--cdw-tab-active);
	font-weight: 600;
}

/* ------------------------------------------------------------------ period */

.cdw-period {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-radius: 12px;
	background: var(--cdw-panel);
	border: 0.8px solid var(--cdw-panel-border);
	box-shadow: 0 1px 0 var(--cdw-panel-edge), inset 0 1px 20px rgba(0, 0, 0, 0.08);
}

.cdw-period__logo {
	width: 82px;
	height: auto;
	object-fit: contain;
	flex-shrink: 0;
}

.cdw-period__meta {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.cdw-period__value {
	font-size: 15px;
	font-weight: 600;
	line-height: 22px;
}

/* --------------------------------------------------------- league selector */

.cdw-league {
	position: relative;
}

.cdw-league__toggle {
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 10px;
	border-radius: 10px;
	background: var(--cdw-panel);
	border: 0.7px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 1px 0 var(--cdw-panel-edge);
	text-align: left;
}

.cdw-league__current {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
}

.cdw-league__badge {
	width: 32.23px;
	height: 28.58px;
	object-fit: contain;
	flex-shrink: 0;
}

.cdw-league__name {
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 24px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cdw-league__caret {
	position: relative;
	z-index: 1;
	flex-shrink: 0;
	font-size: 11px;
	line-height: 1;
	transition: transform 200ms ease;
}

.cdw-league[data-open="true"] .cdw-league__caret {
	transform: rotate(180deg);
}

.cdw-league__list {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 6;
	padding: 4px;
	border-radius: 10px;
	background: var(--cdw-panel);
	border: 0.7px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}

.cdw-league[data-open="true"] .cdw-league__list {
	display: block;
}

.cdw-league__option {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px 8px;
	border-radius: 6px;
	text-align: left;
	opacity: 0.6;
}

.cdw-league__option[aria-selected="true"] {
	opacity: 1;
	background: var(--cdw-tab-active);
}

/* -------------------------------------------------------------- list panel */

/*
 * Fixed height on purpose: the prize table, the standings and the rules all have
 * different content lengths, and letting the panel size to its content made the
 * whole card jump every time the tab changed. The head stays put and the rows
 * scroll inside the remaining space.
 */
.cdw-list {
	position: relative;
	display: flex;
	flex-direction: column;
	height: min(26vh, 176px);
	padding: 4px;
	border-radius: 10px;
	background: var(--cdw-panel);
	box-shadow: 0 1px 0 var(--cdw-panel-edge);
	overflow: hidden;
}

.cdw-list__head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	height: 32px;
	padding: 0 8px;
	border-radius: 8px 8px 0 0;
	font-size: 12px;
	font-weight: 600;
	line-height: 17px;
}

.cdw-list__rows {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	overflow-y: auto;
	overscroll-behavior-y: contain;
	-webkit-overflow-scrolling: touch;
}

/* Spec pins the footer to the panel's bottom edge; reserve room for it. */
.cdw-list--has-footer .cdw-list__rows {
	padding-bottom: 34px;
}

.cdw-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-shrink: 0;
	height: 32px;
	padding-right: 8px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.16);
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
}

.cdw-row[data-rank="1"] { background: var(--cdw-rank1); }
.cdw-row[data-rank="2"] { background: var(--cdw-rank2); }
.cdw-row[data-rank="3"] { background: var(--cdw-rank3); }

/*
 * Spec column widths are 61 / 139 / 125 px, which overflow a 360px phone once
 * gaps are added. Position and value keep their intent; the player column
 * absorbs the difference.
 */
.cdw-cell {
	display: flex;
	align-items: center;
	padding: 0 8px;
	min-width: 0;
}

.cdw-cell--pos {
	flex: 0 0 auto;
	min-width: 61px;
	gap: 6px;
}

.cdw-cell--player {
	flex: 1 1 auto;
	gap: 10px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cdw-cell--value {
	flex: 0 0 auto;
	justify-content: flex-end;
	margin-left: auto;
	white-space: nowrap;
}

/* Mission Hadiah: Tier | Reward | Requirements (multi-line rows).
 * Grow with content -- no inner scroll on small screens. */
.cdw-list--missions {
	height: auto;
	max-height: none;
	overflow: visible;
}

.cdw-list--missions .cdw-list__rows {
	overflow: visible;
	flex: 0 0 auto;
}

.cdw-list--missions .cdw-list__head .cdw-cell--tier,
.cdw-list--missions .cdw-list__head .cdw-cell--reqs {
	justify-content: flex-start;
}

.cdw-list--missions .cdw-list__head .cdw-cell--value {
	margin-left: 0;
	justify-content: center;
}

.cdw-row--mission {
	align-items: flex-start;
	height: auto;
	min-height: 56px;
	padding: 6px 8px 6px 0;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.22);
}

/* Per-tier Hadiah row colours from the approved mockup. */
.cdw-row--mission[data-tier="magnus"] {
	background: linear-gradient(90deg, #3a3f32 0%, #4a4634 55%, #3a3f32 100%);
}

.cdw-row--mission[data-tier="toro"] {
	background: linear-gradient(90deg, #1e2f4a 0%, #2a4060 55%, #1e2f4a 100%);
}

.cdw-row--mission[data-tier="kaiser"] {
	background: linear-gradient(90deg, #2c2a38 0%, #3a3344 55%, #2c2a38 100%);
}

.cdw-cell--tier {
	flex: 0 0 28%;
	max-width: 110px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	text-align: center;
	padding-top: 2px;
}

.cdw-mission__avatar {
	width: 36px;
	height: 36px;
	object-fit: contain;
	display: block;
}

.cdw-mission__name {
	font-size: 11px;
	font-weight: 700;
	line-height: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.cdw-mission__status {
	display: inline-block;
	margin-top: 2px;
	padding: 1px 6px;
	border-radius: 999px;
	font-size: 9px;
	font-weight: 700;
	line-height: 12px;
	letter-spacing: 0.02em;
	background: rgba(253, 181, 26, 0.92);
	color: #1a1200;
}

.cdw-row--mission[data-status="claimed"] .cdw-mission__status {
	background: rgba(47, 189, 132, 0.95);
	color: #04150e;
}

.cdw-row--mission[data-status="claimed"] {
	opacity: 0.78;
}

.cdw-row--mission .cdw-cell--value {
	flex: 0 0 26%;
	justify-content: center;
	margin-left: 0;
	padding-top: 10px;
	font-size: 11px;
}

.cdw-cell--reqs {
	flex: 1 1 auto;
	align-items: flex-start;
	padding-top: 4px;
}

.cdw-mission__reqs {
	margin: 0;
	padding-left: 16px;
	font-size: 10px;
	font-weight: 500;
	line-height: 14px;
	color: var(--cdw-text);
}

.cdw-mission__reqs li + li {
	margin-top: 2px;
}

.cdw-mission__req--done {
	opacity: 0.72;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

.cdw-cell__rank--dim {
	opacity: 0.8;
}

/* Fixed slot so ranks stay aligned whether or not a crown is present. */
.cdw-cell__medal {
	width: 18.27px;
	height: 9.58px;
	flex-shrink: 0;
	display: inline-block;
}

.cdw-cell__medal img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cdw-empty {
	padding: 18px 12px;
	text-align: center;
	font-size: 12px;
	opacity: 0.7;
}

.cdw-error {
	padding: 8px 12px;
	font-size: 12px;
	color: #ffd2d2;
	text-align: center;
}

/* ------------------------------------------------------------------- rules */

.cdw-mission-rules {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.cdw-list--rules-terms {
	height: auto;
	max-height: min(28vh, 200px);
}

.cdw-list--rules-terms .cdw-list__rows {
	overflow-y: auto;
}

.cdw-rules {
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.6;
	word-break: break-word;
}

.cdw-rules--summary {
	padding: 4px 2px 2px;
	font-size: 12px;
	line-height: 1.45;
	color: var(--cdw-text);
}

.cdw-period .cdw-rules--summary {
	flex: 1 0 100%;
	width: 100%;
}

.cdw-rules table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 8px 0;
}

.cdw-rules th,
.cdw-rules td {
	padding: 6px 8px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	font-size: 12px;
	line-height: 1.45;
}

.cdw-rules th {
	font-weight: 600;
	background: rgba(255, 255, 255, 0.08);
}

.cdw-rules tr:last-child td {
	border-bottom: none;
}

.cdw-rules ul,
.cdw-rules ol {
	padding-left: 18px;
	margin: 6px 0;
}

.cdw-rules li {
	margin-bottom: 4px;
}

/* ------------------------------------------------------------------ footer */

/* Pinned to the bottom of the list panel, per the spec. */
.cdw-mystats {
	position: absolute;
	left: 4px;
	right: 4px;
	bottom: 4px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 32px;
	padding: 0 8px;
	border-radius: 0 0 6px 6px;
	background: var(--cdw-footer);
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
}

.cdw-mystats__score {
	opacity: 0.8;
	padding: 0 8px;
}

.cdw-mystats__rank {
	padding: 0 8px;
}

/* ----------------------------------------------------------------- actions */

.cdw-actions {
	display: flex;
	gap: 8px;
	height: 35px;
}

.cdw-btn {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 5.22px;
	font-size: 16px;
	font-weight: 600;
	line-height: 19px;
	color: var(--cdw-text);
	text-align: center;
	transition: filter 140ms ease;
}

.cdw-btn:active {
	filter: brightness(0.94);
}

.cdw-btn--back {
	background: var(--cdw-neutral);
	box-shadow:
		0 3.48px 3.48px rgba(0, 0, 0, 0.18),
		0 3.48px 3.48px rgba(118, 118, 118, 0.25),
		inset 0 -1.74px 0 #5a5959;
}

.cdw-btn--close {
	background: var(--cdw-cta);
	box-shadow:
		0 3.48px 3.48px rgba(0, 0, 0, 0.18),
		inset 0 -1.74px 0 #7f5f31;
}

/* -------------------------------------------------------------- win popup */

.cdw-win {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(360px, calc(100vw - 32px));
	padding: 26px 20px 22px;
	border-radius: 18px;
	border: 3px solid var(--cdw-glow);
	background: var(--cdw-card-bg);
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
	text-align: center;
	animation: cdw-pop-in 300ms ease;
}

.cdw-win__title {
	font-size: 15px;
	font-weight: 900;
	letter-spacing: 1px;
	opacity: 0.9;
	margin-bottom: 8px;
}

.cdw-win__amount {
	font-size: 40px;
	font-weight: 900;
	line-height: 1.05;
	letter-spacing: -1.5px;
	background: linear-gradient(180deg, #f7e336 0%, #f9bc23 35%, #fff38d 61%, #fde833 71%, #f79e20 86%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
	animation: cdw-glow 1.6s ease-in-out infinite;
}

.cdw-win__amount small {
	font-size: 22px;
	font-weight: 600;
	vertical-align: super;
	margin-right: 4px;
}

.cdw-win__game {
	margin-top: 10px;
	font-size: 12px;
	opacity: 0.8;
}

.cdw-win__close {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 34px;
	height: 34px;
}

/* -------------------------------------------------------------- animations */

@keyframes cdw-pop-in {
	from { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
	to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* The card is centred by flexbox, not transforms, so it needs its own. */
.cdw-card {
	animation-name: cdw-card-in;
}

@keyframes cdw-card-in {
	from { opacity: 0; transform: scale(0.94); }
	to   { opacity: 1; transform: scale(1); }
}

@keyframes cdw-slide-in {
	from { opacity: 0; transform: translateX(-40px); }
	to   { opacity: 1; transform: translateX(0); }
}

@keyframes cdw-glow {
	0%, 100% { filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45)); }
	50%      { filter: drop-shadow(0 2px 16px rgba(255, 210, 60, 0.65)); }
}

/* --------------------------------------------------------------- landscape */

/*
 * Coin pusher runs portrait, so this is a safety net rather than a tuned layout:
 * on a short viewport keep the card and its header art on screen.
 */
@media (max-height: 520px) {
	.cdw-card {
		margin-top: calc(min(96px, 26vw) + 8px);
	}
	.cdw-card__header {
		width: 62%;
		margin-left: auto;
		margin-right: auto;
		/* Lift scales with the narrowed art, or it would rise too far. */
		margin-top: calc(-0.62 * var(--cdw-header-lift, 39.63%) + 15px);
	}
	#cdw-root[data-cdw-header="split"] .cdw-card {
		margin-top: calc(var(--cdw-header-lift-ratio, 0.31) * min(348px, 100vw - 32px) * 0.75 + 8px);
	}
	#cdw-root[data-cdw-header="split"] .cdw-card__header--split {
		width: calc(100% + 47px);
		margin-left: -24px;
		margin-right: 0;
		margin-top: 0;
	}
	.cdw-card__close {
		top: -42px;
	}
	#cdw-root[data-cdw-header="split"] .cdw-card__close {
		top: calc(-0.7 * var(--cdw-header-lift-ratio, 0.44) * min(348px, 100vw - 32px));
	}
	#cdw-root[data-cdw-layout="wide"] .cdw-card__close {
		top: -48px;
	}
	.cdw-list {
		height: 22vh;
	}
	.cdw-list--missions {
		height: auto;
		max-height: none;
	}
}
