/**
 * 年越しカウントダウン（[picolabo_toshikoshi]）。共通部品は base.css。
 *
 * ツール全体を夜明け前の舞台（.ny-stage）にして、文字は白、日数は金色にする。上の端にしめ縄と紙垂を張り、
 * 下の端は富士山と初日の出の絵から青海波の海につなぐ。星のまたたきは「動きを減らす」設定では止める。
 * 12月31日（.is-omisoka）は年越しまでの時刻を大きく、1月1日（.is-ganjitsu）はお祝いの文言を大きく出す。
 */

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

.ny-stage {
	position: relative;
	overflow: hidden;
	padding: 0 var(--ny-pad);
	border-radius: var(--radius);
	background: linear-gradient(180deg, #0e0a26 0%, #1d1650 55%, #33246b 100%);
	color: #fff;
}

/* 星。2層の粒を、ずらした周期でまたたかせる。 */
.ny-stage::before,
.ny-stage::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1.2px, transparent 2px);
	background-size: 130px 110px;
	pointer-events: none;
}

.ny-stage::after {
	background-image: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.6px);
	background-position: 47px 63px;
	background-size: 90px 80px;
}

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

/* 上の端のしめ縄、下の端の絵と海。舞台の左右の余白まで広げる。 */
.ny-rope,
.ny-scene,
.ny-sea {
	display: block;
	width: calc(100% + var(--ny-pad) * 2);
	max-width: none; /* テーマ全体の svg { max-width: 100% } で右端が切れないように */
	margin-inline: calc(var(--ny-pad) * -1);
}

.ny-rope {
	height: 64px;
}

.ny .ny-head {
	margin-top: 0;
}

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

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

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

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

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

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

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

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

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

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

/* 日数と時計
   -------------------------------------------------------------------------- */
.ny-count {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

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

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

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

.ny-days__num,
.ny-final b {
	color: var(--ny-gold);
	font-family: var(--font-en);
	font-weight: 600;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 0 28px rgba(255, 200, 61, 0.45);
}

.ny-days__num {
	font-size: clamp(9.6rem, 28vw, 16rem);
	line-height: 0.95;
}

/* 12月31日：年越しまでの時・分・秒。 */
.ny .ny-final {
	margin-top: 6px;
	line-height: 1;
}

.ny-final b {
	font-size: clamp(6.4rem, 19vw, 12rem);
}

/* 大晦日の知らせ。1月1日は、お祝いの文言として日付の下に大きく出す。 */
.ny .ny-today {
	margin-bottom: 10px;
	padding: 6px 16px;
	border-radius: 999px;
	background: rgba(255, 210, 94, 0.16);
	color: var(--ny-gold);
	font-size: 1.4rem;
	font-weight: 700;
}

.ny.is-ganjitsu .ny-today {
	order: 2;
	white-space: pre-line; /* 「あけまして」で改行する */
	margin: 8px 0 0;
	padding: 18px 8px;
	background: none;
	font-size: clamp(2.8rem, 7vw, 4.6rem);
	line-height: 1.4;
	text-shadow: 0 0 24px rgba(255, 200, 61, 0.5);
	text-wrap: balance;
}

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

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

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

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

.ny-clock__cell + .ny-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;
}

.ny-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;
}

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

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

/* 絵と海
   -------------------------------------------------------------------------- */
.ny-scene {
	margin-top: 16px;
}

.ny-scene__svg {
	display: block;
	width: 100%;
	max-width: 720px;
	height: auto;
	margin-inline: auto;
}

.ny-sea {
	height: 56px;
	margin-top: -1px; /* 絵との間に細い隙間が見えないように */
}

/* 舞台の下の「今年の残りと曜日」。白い部分に、線で区切った一覧で出す。
   -------------------------------------------------------------------------- */
.ny-more {
	max-width: 560px;
	margin: 28px auto 0;
}

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

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

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

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

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

/* 動き
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	.ny-stage::before {
		animation: ny-twinkle 4s ease-in-out infinite;
	}

	.ny-stage::after {
		animation: ny-twinkle 5s ease-in-out -2.5s infinite;
	}

	.ny-twinkle {
		animation: ny-twinkle 3s ease-in-out infinite;
	}

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

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

@keyframes ny-twinkle {
	50% {
		opacity: 0.45;
	}
}
