/**
 * クリスマスまであと何日（[picolabo_xmas]）。共通部品は base.css。
 *
 * ツール全体を夜空の舞台（.xm-stage）にして、文字は白、日数は金色にする。上の端に電飾を張り、雪を降らせ、
 * 下の端は積もった雪の形で白いページにつなぐ。雪・電飾・星のまたたきは「動きを減らす」設定では止める。
 * 当日（.is-festive）は日数と時計を隠し、お祝いの文言を大きく出す。
 */

.xm {
	--xm-pad: clamp(16px, 4vw, 44px);
	--xm-sub: #cfe3f5;
	--xm-gold: #ffd25e;
}

.xm-stage {
	position: relative;
	overflow: hidden;
	padding: 0 var(--xm-pad);
	border-radius: var(--radius);
	background: linear-gradient(180deg, #0b1f3a 0%, #143e66 65%, #1b4f7c 100%);
	color: #fff;
}

/* 雪。3層の粒を、模様の大きさの倍数だけ動かして切れ目なくくり返す。 */
.xm-stage::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1.6px, transparent 2.4px),
		radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 1.2px, transparent 2px),
		radial-gradient(circle, rgba(255, 255, 255, 0.35) 0 1px, transparent 1.6px);
	background-position: 0 0, 35px 20px, 10px 30px;
	background-size: 110px 110px, 70px 70px, 45px 45px;
	pointer-events: none;
}

.xm-stage > * {
	position: relative;
}

/* 上の端の電飾と、下の端の雪。舞台の左右の余白まで広げる。 */
.xm-garland,
.xm-ground {
	display: block;
	width: calc(100% + var(--xm-pad) * 2);
	max-width: none; /* テーマ全体の svg { max-width: 100% } で右端が切れないように */
	margin-inline: calc(var(--xm-pad) * -1);
}

.xm-garland {
	height: 44px;
}

.xm-ground {
	height: 36px;
	margin-top: 24px;
}

.xm-bulb {
	filter: drop-shadow(0 0 3px var(--glow)) drop-shadow(0 0 7px var(--glow));
}

.xm .xm-head {
	margin-top: 4px;
}

.xm .xm-head .pt-head__en {
	color: var(--xm-gold);
}

.xm .xm-head .pt-head__title {
	color: #fff;
}

.xm .xm-head .pt-head__lead {
	color: var(--xm-sub);
}

.xm-hero {
	display: grid;
	gap: 24px;
	max-width: 1000px;
	margin-inline: auto;
}

/* 舞台の上のボタン（白の線、押したものは白地）
   -------------------------------------------------------------------------- */
.xm-modes {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.pt .xm-modes .pt-btn {
	min-height: 42px;
	padding: 0 18px;
	font-size: 1.4rem;
}

.xm :is(.xm-modes, .xm-actions) .pt-btn {
	border-color: rgba(255, 255, 255, 0.4);
	background: transparent;
	color: #fff;
}

.xm :is(.xm-modes, .xm-actions) .pt-btn:hover {
	border-color: #fff;
}

.xm .xm-modes .pt-btn[aria-pressed="true"],
.xm .xm-actions .pt-btn--dark {
	border-color: #fff;
	background: #fff;
	color: var(--c-ink);
}

.xm .xm-actions .pt-btn--dark:hover {
	border-color: var(--xm-gold);
	background: var(--xm-gold);
}

/* 日数と時計
   -------------------------------------------------------------------------- */
.xm-count {
	text-align: center;
}

.xm .xm-count__label {
	color: var(--xm-sub);
	font-size: 1.6rem;
	font-weight: 700;
}

.xm .xm-days {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 6px;
	margin-top: 4px;
	line-height: 1;
}

.xm-days__pre,
.xm-days__unit {
	font-size: clamp(2.6rem, 6vw, 3.6rem);
	font-weight: 700;
}

.xm-days__num {
	color: var(--xm-gold);
	font-family: var(--font-en);
	font-size: clamp(9.6rem, 28vw, 16rem);
	font-weight: 600;
	line-height: 0.95;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 28px rgba(255, 200, 61, 0.45);
}

/* イブの日に、クリスマスまでを数えているときの小さな知らせ。 */
.xm .xm-today {
	display: inline-block;
	margin-top: 12px;
	padding: 6px 16px;
	border-radius: 999px;
	background: rgba(255, 210, 94, 0.16);
	color: var(--xm-gold);
	font-size: 1.4rem;
	font-weight: 700;
}

/* 当日は、お祝いの文言を日数の代わりに大きく出す。 */
.xm.is-festive .xm-today {
	display: block;
	margin-top: 8px;
	padding: 18px 8px;
	background: none;
	font-size: clamp(3rem, 7vw, 4.8rem);
	line-height: 1.4;
	text-shadow: 0 0 24px rgba(255, 200, 61, 0.5);
	text-wrap: balance;
}

.xm .xm-clock {
	margin-top: 22px;
}

.xm .xm-clock__cap {
	color: var(--xm-sub);
	font-size: 1.2rem;
}

.xm-clock__row {
	display: flex;
	justify-content: center;
	gap: 18px;
	margin-top: 4px;
}

.xm-clock__cell {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 48px;
	color: var(--xm-sub);
	font-size: 1.2rem;
	line-height: 1.4;
}

.xm-clock__cell + .xm-clock__cell::before {
	content: ":";
	position: absolute;
	top: 0;
	left: -13px;
	color: rgba(255, 255, 255, 0.35);
	font-family: var(--font-en);
	font-size: 2.8rem;
	font-weight: 600;
	line-height: 1.1;
}

.xm-clock__cell b {
	color: #fff;
	font-family: var(--font-en);
	font-size: 3rem;
	font-weight: 600;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

/* ツリー
   -------------------------------------------------------------------------- */
.xm-scene {
	width: 100%;
	max-width: 400px;
	margin-inline: auto;
}

.xm-tree {
	display: block;
	width: 100%;
	height: auto;
}

.xm-orn.is-lit {
	filter: drop-shadow(0 0 3px var(--glow)) drop-shadow(0 0 6px var(--glow));
}

.xm-star.is-lit {
	filter: drop-shadow(0 0 6px #ffc83d) drop-shadow(0 0 14px rgba(255, 200, 61, 0.7));
}

.xm-actions {
	justify-content: center;
}

.xm .xm-note {
	color: var(--xm-sub);
	font-size: 1.2rem;
	line-height: 1.6;
	text-align: center;
}

/* 舞台の下の「いろいろな数え方」。白い部分に、線で区切った一覧で出す。
   -------------------------------------------------------------------------- */
.xm-more {
	max-width: 560px;
	margin: 28px auto 0;
}

.xm .xm-more__title {
	margin-bottom: 8px;
	font-size: 1.5rem;
	font-weight: 700;
}

.xm .xm-more__list {
	margin: 0;
	border-bottom: 1px solid var(--c-line);
}

.xm-more__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 4px;
	border-top: 1px solid var(--c-line);
}

.xm-more__row dt {
	color: var(--c-ink-2);
	font-size: 1.4rem;
}

.xm-more__row dd {
	margin: 0;
	font-size: 1.8rem;
	font-weight: 700;
	white-space: nowrap;
}

/* 動き
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	.xm-stage::before {
		animation: xm-snow 16s linear infinite;
	}

	.xm-bulb {
		animation: xm-twinkle 1.8s ease-in-out infinite;
		animation-delay: calc(var(--i) * -0.27s);
	}

	.xm-orn.is-lit {
		animation: xm-twinkle 2.4s ease-in-out infinite;
		animation-delay: calc(var(--i) * -0.41s);
	}

	.xm-star.is-lit,
	.xm-sparkle {
		animation: xm-twinkle 3s ease-in-out infinite;
	}

	.xm-sparkle:nth-child(2n) {
		animation-delay: -1.1s;
	}

	.xm-sparkle:nth-child(3n) {
		animation-delay: -2.2s;
	}
}

@keyframes xm-snow {
	to {
		background-position: 110px 440px, 105px 300px, 55px 210px;
	}
}

@keyframes xm-twinkle {
	50% {
		opacity: 0.6;
	}
}
