/* BCRP Replay: year-in-review page and fullscreen story player */

.replay-page {
	--wr-pink: #f472b6;
	--wr-violet: #a78bfa;
	--wr-cyan: #22d3ee;
	--wr-lime: #a3e635;
	--wr-amber: #fbbf24;
	--wr-ink: #070a18;
	--wr-card: rgba(15, 20, 44, 0.72);
	--wr-line: rgba(167, 139, 250, 0.22);
	position: relative;
	isolation: isolate;
	padding-bottom: 3rem;
}

/* Floating colour blobs behind the hero */
.replay-aurora {
	position: absolute;
	inset: -4rem 0 auto;
	height: 36rem;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
	filter: blur(70px);
	opacity: 0.55;
}

.replay-aurora span {
	position: absolute;
	width: 26rem;
	height: 26rem;
	border-radius: 50%;
	animation: replay-float 18s ease-in-out infinite;
}

.replay-aurora span:nth-child(1) { background: var(--wr-pink); left: 2%; top: 4rem; }
.replay-aurora span:nth-child(2) { background: var(--wr-violet); left: 38%; top: 0; animation-delay: -6s; }
.replay-aurora span:nth-child(3) { background: var(--wr-cyan); right: 2%; top: 6rem; animation-delay: -12s; }

@keyframes replay-float {
	0%, 100% { transform: translate(0, 0) scale(1); }
	33% { transform: translate(3rem, 2rem) scale(1.1); }
	66% { transform: translate(-2rem, 3rem) scale(0.92); }
}

.replay-preview-banner {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 1.25rem;
	padding: 0.7rem 1rem;
	border: 1px solid rgba(251, 191, 36, 0.4);
	border-radius: 0.9rem;
	background: rgba(120, 80, 0, 0.25);
	color: #fde68a;
}

.replay-preview-banner a {
	margin-left: auto;
	color: #fde68a;
	font-weight: 600;
}

/* ---------------------------------------------------------------- hero */

.replay-hero {
	text-align: center;
	padding: 3rem 0 2.5rem;
}

.replay-kicker {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.35rem 0.9rem;
	border: 1px solid var(--wr-line);
	border-radius: 999px;
	background: rgba(10, 14, 32, 0.6);
	font-size: 0.85rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #e9d5ff;
}

.replay-title {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: baseline;
	gap: 0 0.9rem;
	margin: 1.1rem 0 0.6rem;
	font-weight: 800;
	line-height: 0.95;
	letter-spacing: -0.02em;
}

.replay-title__brand {
	font-size: clamp(2rem, 6vw, 3.6rem);
	color: #fff;
}

.replay-title__word {
	font-size: clamp(3rem, 11vw, 7rem);
	background: linear-gradient(100deg, var(--wr-pink), var(--wr-violet) 45%, var(--wr-cyan));
	background-size: 200% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: replay-shimmer 7s ease-in-out infinite;
}

.replay-title__year {
	font-size: clamp(2rem, 6vw, 3.6rem);
	color: transparent;
	-webkit-text-stroke: 2px var(--wr-lime);
}

@keyframes replay-shimmer {
	0%, 100% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
}

.replay-subtitle {
	margin: 0 auto 2rem;
	max-width: 40rem;
	color: rgba(226, 232, 255, 0.75);
	font-size: 1.1rem;
}

.replay-launchers {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
	gap: 1rem;
	max-width: 52rem;
	margin: 0 auto;
}

.replay-launcher {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1.15rem 1.25rem;
	border: 1px solid var(--wr-line);
	border-radius: 1.4rem;
	background: var(--wr-card);
	color: #fff;
	text-align: left;
	text-decoration: none;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.replay-launcher:hover:not(:disabled),
.replay-launcher:focus-visible {
	transform: translateY(-3px);
	border-color: rgba(244, 114, 182, 0.6);
	box-shadow: 0 18px 45px -18px rgba(244, 114, 182, 0.55);
	color: #fff;
}

.replay-launcher:disabled {
	cursor: progress;
	opacity: 0.8;
}

.replay-launcher__glow {
	position: absolute;
	inset: 0;
	z-index: -1;
	opacity: 0.35;
	background: radial-gradient(circle at 0% 0%, var(--wr-pink), transparent 60%);
}

.replay-launcher--me .replay-launcher__glow {
	background: radial-gradient(circle at 0% 0%, var(--wr-cyan), transparent 60%);
}

.replay-launcher__icon {
	display: grid;
	place-items: center;
	flex: 0 0 3.5rem;
	height: 3.5rem;
	border-radius: 1rem;
	background: linear-gradient(135deg, var(--wr-pink), var(--wr-violet));
	font-size: 1.6rem;
}

.replay-launcher--me .replay-launcher__icon {
	background: linear-gradient(135deg, var(--wr-cyan), var(--wr-violet));
}

.replay-launcher__icon--avatar {
	padding: 3px;
	border-radius: 50%;
}

.replay-launcher__icon--avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.replay-launcher__text {
	display: grid;
	flex: 1;
	min-width: 0;
}

.replay-launcher__label {
	font-size: 1.25rem;
	font-weight: 700;
}

.replay-launcher__hint {
	color: rgba(226, 232, 255, 0.7);
	font-size: 0.9rem;
}

.replay-launcher__play {
	display: grid;
	place-items: center;
	flex: 0 0 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: #fff;
	color: var(--wr-ink);
	font-size: 1.4rem;
	transition: transform 0.25s ease;
}

.replay-launcher:hover:not(:disabled) .replay-launcher__play {
	transform: scale(1.12);
}

/* ---------------------------------------------------------------- grids */

.replay-section {
	margin-top: 2.5rem;
}

.replay-section__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.replay-section__header h2 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
}

.replay-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.4rem 0.95rem;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: var(--wr-ink);
	font-weight: 700;
}

.replay-chip:disabled {
	opacity: 0.45;
}

.replay-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: 0.85rem;
}

.replay-tile {
	position: relative;
	display: grid;
	align-content: start;
	gap: 0.25rem;
	min-height: 8.5rem;
	padding: 1.1rem 1.15rem;
	border: 1px solid var(--wr-line);
	border-radius: 1.15rem;
	background: var(--wr-card);
	overflow: hidden;
	animation: replay-rise 0.5s ease both;
}

.replay-tile::after {
	content: "";
	position: absolute;
	right: -2.5rem;
	bottom: -2.5rem;
	width: 7rem;
	height: 7rem;
	border-radius: 50%;
	background: var(--tile-accent, var(--wr-violet));
	opacity: 0.18;
	filter: blur(6px);
}

.replay-tile__icon {
	color: var(--tile-accent, var(--wr-violet));
	font-size: 1.2rem;
}

.replay-tile__value {
	font-size: clamp(1.6rem, 3.5vw, 2.1rem);
	font-weight: 800;
	line-height: 1.1;
	color: #fff;
	overflow-wrap: anywhere;
}

.replay-tile__label {
	color: rgba(226, 232, 255, 0.72);
	font-size: 0.92rem;
}

.replay-tile--wide {
	grid-column: span 2;
}

.replay-tile--skeleton {
	background: linear-gradient(100deg, rgba(30, 36, 70, 0.6) 30%, rgba(60, 66, 110, 0.55) 50%, rgba(30, 36, 70, 0.6) 70%);
	background-size: 300% 100%;
	animation: replay-skeleton 1.4s ease-in-out infinite;
}

.replay-tile--skeleton::after { display: none; }

.replay-empty {
	grid-column: 1 / -1;
	padding: 1.5rem;
	border: 1px dashed var(--wr-line);
	border-radius: 1.15rem;
	text-align: center;
	color: rgba(226, 232, 255, 0.75);
}

@keyframes replay-skeleton {
	0% { background-position: 100% 0; }
	100% { background-position: 0 0; }
}

@keyframes replay-rise {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.replay-footnote {
	margin-top: 2rem;
	color: rgba(226, 232, 255, 0.5);
	font-size: 0.85rem;
	text-align: center;
}

/* ---------------------------------------------------------------- story player */

.replay-story {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: grid;
	place-items: center;
}

.replay-story[hidden] {
	display: none;
}

.replay-story__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(3, 5, 14, 0.82);
	backdrop-filter: blur(14px);
	animation: replay-fade 0.3s ease both;
}

.replay-story__frame {
	--story-a: #7c3aed;
	--story-b: #db2777;
	--story-c: #0e7490;
	position: relative;
	width: min(27rem, 100vw);
	height: min(48rem, 100dvh);
	border-radius: 1.6rem;
	overflow: hidden;
	overflow: clip; /* hidden boxes can still be scrolled by focus and clicks; clip can't */
	color: #fff;
	background:
		radial-gradient(circle at 15% 10%, var(--story-b), transparent 55%),
		radial-gradient(circle at 90% 85%, var(--story-c), transparent 55%),
		var(--story-a);
	box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.8);
	transition: background 0.6s ease;
	animation: replay-pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
	user-select: none;
}

@media (max-width: 480px) {
	.replay-story__frame { border-radius: 0; }
}

.replay-story__frame::before {
	/* film grain + moving shapes */
	content: "";
	position: absolute;
	inset: -50%;
	background:
		radial-gradient(circle, rgba(255, 255, 255, 0.12) 0 2px, transparent 3px) 0 0 / 22px 22px;
	opacity: 0.25;
	animation: replay-drift 40s linear infinite;
	pointer-events: none;
}

@keyframes replay-drift {
	to { transform: translate(22px, 44px) rotate(2deg); }
}

@keyframes replay-fade {
	from { opacity: 0; }
}

@keyframes replay-pop {
	from { opacity: 0; transform: scale(0.92) translateY(20px); }
}

.replay-story__progress {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	right: 0.75rem;
	z-index: 5;
	display: flex;
	gap: 4px;
}

.replay-story__bar {
	flex: 1;
	height: 3px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.3);
	overflow: hidden;
}

.replay-story__bar span {
	display: block;
	height: 100%;
	width: 0;
	background: #fff;
}

.replay-story__bar.is-done span { width: 100%; }

.replay-story__top {
	position: absolute;
	top: 1.4rem;
	left: 1rem;
	right: 0.6rem;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.replay-story__brand {
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	opacity: 0.9;
}

.replay-story__controls {
	display: flex;
	gap: 0.25rem;
}

.replay-story__btn {
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.25);
	color: #fff;
	font-size: 1.05rem;
}

.replay-story__btn:hover { background: rgba(0, 0, 0, 0.45); }

.replay-story__nav {
	position: absolute;
	top: 4rem;
	bottom: 0;
	z-index: 3;
	width: 30%;
	border: 0;
	background: transparent;
	cursor: pointer;
}

/* Invisible tap zones; keyboard users get arrow keys instead of a focus box. */
.replay-story__nav:focus,
.replay-story__nav:focus-visible {
	outline: none;
	box-shadow: none;
}

.replay-story__nav--prev { left: 0; }
.replay-story__nav--next { right: 0; width: 70%; }

.replay-story__stage {
	/* Above the tap zones; only links and buttons inside a slide take clicks. */
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
}

.replay-story__stage a,
.replay-story__stage button {
	pointer-events: auto;
	position: relative;
	z-index: 4;
}

/* One slide */
.wr-slide {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.9rem;
	padding: 4.5rem 1.6rem 2.2rem;
}

.wr-slide > * {
	opacity: 0;
	transform: translateY(18px);
	animation: wr-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.wr-slide > *:nth-child(1) { animation-delay: 0.05s; }
.wr-slide > *:nth-child(2) { animation-delay: 0.25s; }
.wr-slide > *:nth-child(3) { animation-delay: 0.45s; }
.wr-slide > *:nth-child(4) { animation-delay: 0.65s; }
.wr-slide > *:nth-child(5) { animation-delay: 0.85s; }
.wr-slide > *:nth-child(6) { animation-delay: 1.05s; }

@keyframes wr-in {
	to { opacity: 1; transform: none; }
}

.wr-eyebrow {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.85;
}

.wr-headline {
	margin: 0;
	font-size: clamp(1.7rem, 7vw, 2.3rem);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.01em;
}

.wr-big {
	font-size: clamp(3.6rem, 19vw, 5.6rem);
	font-weight: 900;
	line-height: 0.95;
	letter-spacing: -0.03em;
	text-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
	font-variant-numeric: tabular-nums;
}

.wr-big small {
	display: block;
	margin-top: 0.4rem;
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0;
	opacity: 0.85;
}

.wr-text {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.4;
	opacity: 0.92;
}

.wr-pill {
	align-self: flex-start;
	padding: 0.4rem 0.85rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	font-weight: 700;
	font-size: 0.95rem;
}

.wr-pill--bright {
	background: #fff;
	color: #111;
}

.wr-stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.6rem;
}

.wr-stat {
	padding: 0.8rem 0.9rem;
	border-radius: 1rem;
	background: rgba(0, 0, 0, 0.22);
	backdrop-filter: blur(4px);
}

.wr-stat strong {
	display: block;
	font-size: 1.55rem;
	font-weight: 800;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.wr-stat span {
	font-size: 0.85rem;
	opacity: 0.85;
}

.wr-list {
	display: grid;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wr-list li {
	display: grid;
	grid-template-columns: 1.6rem 1fr auto;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 0.75rem;
	border-radius: 0.8rem;
	background: rgba(0, 0, 0, 0.22);
}

.wr-list__rank {
	font-weight: 900;
	font-size: 1.15rem;
	opacity: 0.75;
}

.wr-list__name {
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wr-list__value {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	opacity: 0.9;
}

.wr-bar {
	position: relative;
	height: 6px;
	margin-top: 0.3rem;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.18);
	grid-column: 2 / 4;
	overflow: hidden;
}

.wr-bar span {
	position: absolute;
	inset: 0 auto 0 0;
	border-radius: 6px;
	background: #fff;
	transform-origin: left;
	animation: wr-grow 1s 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes wr-grow {
	from { transform: scaleX(0); }
}

.wr-chart {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 6.5rem;
	padding: 0.6rem;
	border-radius: 1rem;
	background: rgba(0, 0, 0, 0.22);
}

.wr-chart span {
	flex: 1;
	min-height: 3px;
	border-radius: 3px 3px 1px 1px;
	background: rgba(255, 255, 255, 0.55);
	transform-origin: bottom;
	animation: wr-rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.wr-chart span.is-peak { background: #fff; }

.wr-chart-axis {
	display: flex;
	justify-content: space-between;
	margin-top: -0.4rem;
	font-size: 0.72rem;
	opacity: 0.75;
}

@keyframes wr-rise {
	from { transform: scaleY(0); }
}

.wr-podium {
	display: grid;
	gap: 0.55rem;
}

.wr-podium__row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.55rem 0.7rem;
	border-radius: 1rem;
	background: rgba(0, 0, 0, 0.22);
}

.wr-podium__row:first-child {
	background: rgba(255, 255, 255, 0.92);
	color: #111;
}

.wr-podium__row img {
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 50%;
	object-fit: cover;
}

.wr-podium__name {
	flex: 1;
	min-width: 0;
	font-weight: 800;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wr-avatar {
	width: 6.5rem;
	height: 6.5rem;
	border-radius: 50%;
	border: 4px solid #fff;
	object-fit: cover;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.wr-rank-icon {
	width: 5.5rem;
	height: 5.5rem;
	object-fit: contain;
	filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.wr-persona {
	font-size: clamp(2.2rem, 10vw, 3.2rem);
	font-weight: 900;
	line-height: 1;
	background: linear-gradient(100deg, #fff, #fde68a, #fff);
	background-size: 200% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: replay-shimmer 4s ease-in-out infinite, wr-in 0.6s 0.25s forwards;
}

/* Summary card (last slide) */
.wr-summary {
	display: grid;
	gap: 0.9rem;
	padding: 1.2rem;
	border-radius: 1.3rem;
	background: rgba(7, 10, 24, 0.72);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.wr-summary__head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.wr-summary__head img {
	width: 3.2rem;
	height: 3.2rem;
	border-radius: 50%;
	object-fit: cover;
}

.wr-summary__title {
	font-weight: 900;
	font-size: 1.3rem;
	line-height: 1.1;
}

.wr-summary__sub {
	font-size: 0.85rem;
	opacity: 0.75;
}

.wr-summary__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.75rem 1rem;
}

.wr-summary__grid strong {
	display: block;
	font-size: 1.35rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.wr-summary__grid span {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.7;
}

.wr-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.wr-action {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 1rem;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #111;
	font-weight: 800;
	text-decoration: none;
}

.wr-action--ghost {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.wr-action:hover { filter: brightness(0.95); color: inherit; }
.wr-action--ghost:hover { color: #fff; }

/* Confetti on the final slide */
.wr-confetti {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
	opacity: 1 !important;
	transform: none !important;
	animation: none !important;
}

.wr-confetti i {
	position: absolute;
	top: -1rem;
	width: 0.55rem;
	height: 0.9rem;
	border-radius: 2px;
	animation: wr-fall linear forwards;
}

@keyframes wr-fall {
	to { transform: translateY(52rem) rotate(720deg); opacity: 0.2; }
}

@media (prefers-reduced-motion: reduce) {
	.replay-aurora span,
	.replay-title__word,
	.replay-story__frame::before,
	.wr-persona { animation: none; }
	.wr-slide > *,
	.replay-tile { animation-duration: 0.01s; animation-delay: 0s !important; }
	.wr-confetti { display: none; }
}

body.replay-story-open {
	overflow: hidden;
}

/* Discord share */
.wr-action--discord {
	background: #5865f2;
	color: #fff;
}

.wr-action--discord:hover {
	color: #fff;
}

.wr-action:disabled {
	opacity: 0.7;
	cursor: progress;
}

.wr-share {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: grid;
	place-items: center;
	padding: 4rem 1rem 1.5rem;
	background: rgba(3, 5, 14, 0.72);
	backdrop-filter: blur(8px);
	pointer-events: auto;
	animation: replay-fade 0.25s ease both;
}

.wr-share__panel {
	display: grid;
	gap: 0.85rem;
	width: 100%;
	padding: 1.1rem;
	border-radius: 1.3rem;
	background: rgba(15, 20, 44, 0.92);
	border: 1px solid rgba(255, 255, 255, 0.16);
	animation: wr-in 0.35s ease both;
}

.wr-share__preview {
	position: relative;
	aspect-ratio: 1200 / 630;
	border-radius: 0.8rem;
	overflow: hidden;
	background: linear-gradient(100deg, rgba(60, 40, 110, 0.7) 30%, rgba(120, 60, 140, 0.7) 50%, rgba(60, 40, 110, 0.7) 70%);
	background-size: 300% 100%;
}

.wr-share__preview.is-loading {
	animation: replay-skeleton 1.4s ease-in-out infinite;
}

.wr-share__preview img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wr-share__preview.is-loading img {
	opacity: 0;
}

.wr-share__preview.is-error::after {
	content: "Preview unavailable";
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-size: 0.9rem;
	opacity: 0.8;
}

.wr-share__status {
	margin: 0;
	min-height: 1.2em;
	color: #fecaca;
	font-size: 0.9rem;
}

.wr-share__done {
	font-size: 3rem;
	color: #4ade80;
	line-height: 1;
}
