/* Chosen One Countdown ------------------------------------------------- */

.coc-countdown {
	--coc-bg: #d21f2e;
	--coc-tile: #2b2b31;
	--coc-white: #ffffff;
	--coc-radius: 14px;
	--coc-reveal-dur: 1.3s;

	position: relative;
	background: var(--coc-bg);
	border-radius: var(--coc-radius);
	padding: clamp(20px, 4vw, 40px) clamp(16px, 3vw, 36px);
	overflow: hidden;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	text-align: center;
	color: var(--coc-white);
}

.coc-title {
	margin: 0 0 clamp(14px, 2.5vw, 26px);
	font-size: clamp(22px, 4.2vw, 46px);
	font-weight: 800;
	letter-spacing: 0.01em;
	line-height: 1.1;
	text-transform: uppercase;
	color: var(--coc-white);
}

/* Stage: timer + overlays share this box */
.coc-stage {
	position: relative;
}

/* ---- Timer ----------------------------------------------------------- */

.coc-timer {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: clamp(6px, 1.4vw, 16px);
	opacity: 0;
	transform: scale(0.985);
	transition: opacity 0.5s ease 0.9s, transform 0.5s ease 0.9s;
}

.coc-countdown.coc-play .coc-timer,
.coc-countdown.coc-done .coc-timer {
	opacity: 1;
	transform: none;
}

.coc-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.coc-digits {
	display: flex;
	gap: clamp(3px, 0.6vw, 6px);
}

.coc-digit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: clamp(34px, 5.4vw, 60px);
	height: clamp(46px, 7.2vw, 80px);
	background: var(--coc-tile);
	border-radius: 6px;
	font-size: clamp(26px, 4.4vw, 48px);
	font-weight: 800;
	color: var(--coc-white);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

/* flip-clock seam */
.coc-digit::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: 1px;
	background: rgba(0, 0, 0, 0.35);
}

.coc-digit.coc-tick {
	animation: coc-flip 0.45s ease;
}

@keyframes coc-flip {
	0%   { transform: rotateX(0deg); }
	49%  { transform: rotateX(-88deg); }
	51%  { transform: rotateX(88deg); }
	100% { transform: rotateX(0deg); }
}

.coc-colon {
	align-self: flex-start;
	font-size: clamp(26px, 4.4vw, 48px);
	font-weight: 800;
	line-height: clamp(46px, 7.2vw, 80px);
	color: var(--coc-white);
}

.coc-label {
	font-size: clamp(11px, 1.5vw, 16px);
	font-weight: 700;
	font-style: italic;
	letter-spacing: 0.14em;
	color: var(--coc-white);
}

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

.coc-marquee {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.1em;
	pointer-events: none;
	z-index: 2;
}

.coc-row {
	white-space: nowrap;
	will-change: transform;
	transform: translateX(0);
}

.coc-strip {
	display: inline-flex;
	gap: 0.5em;
	transform: translateX(-25%);
	font-size: clamp(26px, 4.6vw, 52px);
	font-weight: 800;
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
}

/* Row looks pulled from the reference frames: mix of filled + outlined */
.coc-row-1 .coc-strip span:nth-child(odd),
.coc-row-3 .coc-strip span:nth-child(even) {
	color: rgba(0, 0, 0, 0.55);
}

.coc-row-1 .coc-strip span:nth-child(even),
.coc-row-3 .coc-strip span:nth-child(odd),
.coc-row-2 .coc-strip span {
	color: transparent;
	-webkit-text-stroke: 2px rgba(0, 0, 0, 0.45);
	text-stroke: 2px rgba(0, 0, 0, 0.45);
}

.coc-row-2 .coc-strip span:nth-child(3n) {
	color: var(--coc-white);
	-webkit-text-stroke: 0;
}

/* Reveal: rows slide off in alternating directions, top to bottom */
.coc-countdown.coc-play .coc-row-1 {
	animation: coc-slide-left var(--coc-reveal-dur) cubic-bezier(0.65, 0, 0.35, 1) 0s forwards;
}
.coc-countdown.coc-play .coc-row-2 {
	animation: coc-slide-right var(--coc-reveal-dur) cubic-bezier(0.65, 0, 0.35, 1) 0.15s forwards;
}
.coc-countdown.coc-play .coc-row-3 {
	animation: coc-slide-left var(--coc-reveal-dur) cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards;
}

@keyframes coc-slide-left {
	to { transform: translateX(-130%); opacity: 0; }
}
@keyframes coc-slide-right {
	to { transform: translateX(130%); opacity: 0; }
}

.coc-countdown.coc-done .coc-row {
	display: none;
}

/* ---- Parked edge fragments (final frame) ------------------------------ */

.coc-edges {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 1;
	opacity: 0;
	transition: opacity 0.6s ease 1s;
}

.coc-countdown.coc-play .coc-edges,
.coc-countdown.coc-done .coc-edges {
	opacity: 1;
}

.coc-edge {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	gap: 0.15em;
	font-size: clamp(22px, 4vw, 46px);
	font-weight: 800;
	letter-spacing: 0.1em;
	line-height: 1;
	text-transform: uppercase;
}

.coc-edge-left {
	left: clamp(8px, 2vw, 24px);
	color: rgba(0, 0, 0, 0.35);
}

.coc-edge-right {
	right: clamp(8px, 2vw, 24px);
	color: transparent;
	-webkit-text-stroke: 2px rgba(0, 0, 0, 0.35);
	text-stroke: 2px rgba(0, 0, 0, 0.35);
	text-align: right;
}

/* Hide edge fragments when the panel gets too narrow to share the space */
@media (max-width: 640px) {
	.coc-edge { display: none; }
}

/* ---- Expired state ----------------------------------------------------- */

.coc-expired-msg {
	font-size: clamp(24px, 4.4vw, 48px);
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ---- Reduced motion ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.coc-countdown .coc-row,
	.coc-countdown.coc-play .coc-row {
		animation: none;
		display: none;
	}
	.coc-timer {
		transition: none;
		opacity: 1;
		transform: none;
	}
	.coc-edges {
		transition: none;
		opacity: 1;
	}
	.coc-digit.coc-tick {
		animation: none;
	}
}
