/**
 * PlayRox authentication screens.
 *
 * Two full-bleed modals: sign-in and returning-player welcome.
 * Light upper half with decorative marks, deep green lower half.
 */

.playrox-auth {
	--pra-deep: #0d3a1c;
	--pra-deep-2: #123f21;
	--pra-green: #2f9e44;
	--pra-green-bright: #4caf50;
	--pra-green-light: #6fcf6f;
	--pra-ink: #10321a;
	--pra-muted: #66786c;
	--pra-cream: #f6f3e9;
	--pra-gold: #f5b731;
	--pra-purple: #8b5cf6;
	--pra-orange: #f97316;
	--pra-sheet: #ffffff;

	/*
	 * Everything vertical is expressed against viewport height so the sheet
	 * shrinks to fit instead of overflowing. Values collapse toward the low
	 * end on short screens and cap out on tall ones.
	 */
	--pra-pad-x: clamp(16px, 5vw, 28px);
	--pra-gap: clamp(6px, 1.3vh, 12px);
	--pra-brand: clamp(30px, 5.6vh, 62px);
	--pra-wordmark: clamp(14px, 2.4vh, 25px);
	--pra-headline: clamp(19px, 3.3vh, 32px);
	--pra-lede: clamp(12px, 1.8vh, 15px);
	--pra-icon: clamp(28px, 4.6vh, 44px);
	/* 44px floor keeps every button a comfortable tap target. */
	--pra-pill: clamp(44px, 6vh, 54px);
	--pra-pill-text: clamp(13px, 1.9vh, 16px);

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	opacity: 0;
	transition: opacity 0.24s ease;
}

.playrox-auth[hidden] {
	display: none;
}

.playrox-auth.is-visible {
	opacity: 1;
}

.playrox-auth__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 22, 12, 0.72);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

.playrox-auth__sheet {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 420px;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	overflow: hidden auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	border-radius: 30px;
	background: var(--pra-deep);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
	transform: translateY(22px) scale(0.97);
	transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
	scrollbar-width: none;
}

.playrox-auth__sheet::-webkit-scrollbar {
	display: none;
}

.playrox-auth.is-visible .playrox-auth__sheet {
	transform: translateY(0) scale(1);
}

.playrox-auth__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255);
    color: #000000;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}



.playrox-auth__close:hover {
	background: rgba(16, 50, 26, 0.2);
}

/* ==========================================================================
   Upper light half
   ========================================================================== */

.playrox-auth__top {
	position: relative;
	flex: 0 0 auto;
	/*
	 * Bottom padding matches the decorative curve height so the illustration
	 * always sits clear of it instead of being covered at the base.
	 */
	padding: clamp(12px, 2.6vh, 30px) var(--pra-pad-x) clamp(20px, 3.8vh, 38px);
	background: #f8faf6;
	text-align: center;
}

/* Curved transition into the dark half. */
.playrox-auth__top::after {
	content: "";
	position: absolute;
	right: -10%;
	bottom: -1px;
	left: -10%;
	z-index: 1;
	height: clamp(24px, 4.6vh, 44px);
	border-radius: 50% 50% 0 0 / 100% 100% 0 0;
	background: var(--pra-deep);
}

.playrox-auth__top-inner {
	position: relative;
	z-index: 2;
}

.playrox-auth__confetti {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.playrox-auth__confetti .pr-blob {
	fill: var(--pra-deep);
}

.playrox-auth__confetti .pr-dots {
	fill: rgba(47, 158, 68, 0.16);
}

.playrox-auth__confetti .pr-mark {
	fill: rgba(47, 158, 68, 0.28);
}

.playrox-auth__confetti .pr-ring {
	fill: none;
	stroke: rgba(47, 158, 68, 0.22);
	stroke-width: 2.4;
}

.playrox-auth__confetti .pr-tri {
	fill: rgba(47, 158, 68, 0.2);
}

.playrox-auth__confetti .pr-cross {
	stroke: rgba(47, 158, 68, 0.3);
	stroke-width: 2.4;
	stroke-linecap: round;
}

/* Brand ------------------------------------------------------------------ */

.playrox-brand {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	margin-bottom: var(--pra-gap);
}

.playrox-brand__logo,
.playrox-brand__mark {
	display: block;
	width: auto;
	max-width: 130px;
	height: var(--pra-brand);
	object-fit: contain;
}

.playrox-brand__mark .pr-mono,
.playrox-brand__mark .pr-mono-star {
	fill: var(--pra-deep);
}

.playrox-brand__name {
	font-size: var(--pra-wordmark);
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1.1;
	color: var(--pra-deep);
	text-transform: uppercase;
}

.playrox-brand .playrox-swoosh {
	width: 74px;
	height: 8px;
	margin-top: -1px;
}

/* Headline --------------------------------------------------------------- */

.playrox-swoosh {
	display: block;
	width: 100%;
	height: 11px;
	overflow: visible;
	fill: none;
	stroke: var(--pra-green);
	stroke-width: 4;
	stroke-linecap: round;
}

.playrox-auth__headline {
	margin: 0 0 var(--pra-gap);
	font-size: var(--pra-headline);
	font-weight: 800;
	line-height: 1.14;
	color: var(--pra-ink);
	letter-spacing: -0.01em;
}

.playrox-auth__headline-top,
.playrox-auth__headline-bottom {
	display: block;
}

.playrox-accent {
	color: var(--pra-green);
}

.playrox-auth__underlined {
	position: relative;
	display: inline-block;
}

.playrox-auth__underlined .playrox-swoosh {
	position: absolute;
	right: -6px;
	bottom: -7px;
	left: -2px;
	width: auto;
	height: 9px;
}

.playrox-auth__lede {
	max-width: 320px;
	margin: 0 auto;
	font-size: var(--pra-lede);
	line-height: 1.45;
	color: var(--pra-muted);
}

/* Hero ------------------------------------------------------------------- */

.playrox-hero {
	position: relative;
	z-index: 3;
	/*
	 * Natural size at every viewport. Width drives it, the 400x250 viewBox
	 * gives the height, and nothing overflows the sheet.
	 *
	 * A previous version used width:calc(100% + 20px) with auto margins to
	 * bleed the artwork past the padding. Auto margins collapse to 0 when the
	 * element is wider than its container, so it overflowed to the right and
	 * the sheet's overflow:hidden sliced off the right coin stack.
	 */
	width: 100%;
	max-width: 380px;
	margin: var(--pra-gap) auto -30px;
}

.playrox-hero__art,
.playrox-hero__img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 auto;
	/* Intrinsic ratio from the width/height attributes prevents layout shift. */
	max-width: 100%;
}

/* Trophy */
.pr-trophy-cup { fill: #f7b731; }
.pr-trophy-handle { fill: none; stroke: #f0a91f; stroke-width: 9; stroke-linecap: round; }
.pr-trophy-star { fill: #e09612; }
.pr-trophy-stem { fill: #eda51c; }
.pr-trophy-base { fill: #f0a91f; }
.pr-burst { stroke: var(--pra-green); stroke-width: 3.4; stroke-linecap: round; opacity: 0.7; }

/* Coins */
.pr-coin-side { fill: #d99a12; }
.pr-coin-face { fill: #f7c631; }
.pr-coin-inner { fill: none; stroke: #dda317; stroke-width: 2.4; }
.pr-coin-p { fill: #c98a0d; font-size: 15px; font-weight: 800; font-family: inherit; }

/* Gamepad */
.pr-pad-left { fill: #4faa4f; }
.pr-pad-right { fill: var(--pra-cream); }
.pr-pad-center { fill: var(--pra-cream); }
.pr-pad-word { fill: #1f6b32; font-size: 21px; font-weight: 800; letter-spacing: 0.02em; font-family: inherit; }
.pr-pad-word--alt { fill: #2b2b2b; }
.pr-dpad { fill: #333b36; }
.pr-dpad-dot { fill: #333b36; }
.pr-btn-label { fill: #fff; font-size: 11px; font-weight: 800; font-family: inherit; }
.pr-btn--x { fill: #2f7ee0; }
.pr-btn--y { fill: #2f9e44; }
.pr-btn--a { fill: #e0392f; }
.pr-btn--b { fill: #f0a91f; }
.pr-btn--dark { fill: #2b2b2b; }

/* Handheld console */
.pr-screen-frame { fill: #2b2b2b; }
.pr-screen { fill: #133a1e; }
.pr-screen-word { fill: #fff; font-size: 20px; font-weight: 800; font-family: inherit; }
.pr-screen-word--alt { fill: #7ed957; }

/* Avatar ring (welcome) --------------------------------------------------- */

.playrox-avatar-ring {
	position: relative;
	z-index: 3;
	display: inline-block;
	margin: var(--pra-gap) 0 calc(var(--pra-gap) * -2);
}

.playrox-avatar-ring__img {
	display: block;
	width: clamp(64px, 13vh, 116px);
	height: clamp(64px, 13vh, 116px);
	border: 5px solid var(--pra-green-bright);
	border-radius: 50%;
	background: var(--pra-green);
	object-fit: cover;
	box-shadow: 0 8px 24px rgba(13, 58, 28, 0.28);
}

.playrox-avatar-ring__check {
	position: absolute;
	right: 2px;
	bottom: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border: 3px solid #f8faf6;
	border-radius: 50%;
	background: var(--pra-green);
	color: #fff;
	font-size: 14px;
}

.playrox-auth--welcome .playrox-hero {
	margin-top: var(--pra-gap);
	margin-left: auto;
	margin-right: auto;
}

/* ==========================================================================
   Lower deep-green half
   ========================================================================== */

.playrox-auth__bottom {
	position: relative;
	z-index: 3;
	flex: 0 0 auto;
	padding: 4px var(--pra-pad-x) clamp(12px, 2.4vh, 26px);
	background: var(--pra-deep);
	color: #fff;
	text-align: center;
}

/* Benefit columns -------------------------------------------------------- */

.playrox-benefits {
	display: flex;
	margin: 0 0 var(--pra-gap);
	padding: 0;
	list-style: none;
}

.playrox-benefit {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 0 4px;
	text-align: center;
}

.playrox-benefit__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--pra-icon);
	height: var(--pra-icon);
	margin-bottom: 2px;
	border-radius: 50%;
	background: var(--pra-green);
	color: #fff;
	font-size: calc(var(--pra-icon) * 0.4);
	box-shadow: 0 5px 14px rgba(47, 158, 68, 0.35);
}

.playrox-benefit__title {
	font-size: clamp(10px, 1.5vh, 12px);
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
}

.playrox-benefit__sub {
	font-size: clamp(8.5px, 1.25vh, 10px);
	line-height: 1.25;
	color: rgba(255, 255, 255, 0.62);
}

/* Rule divider ----------------------------------------------------------- */

.playrox-rule {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 var(--pra-gap);
	color: var(--pra-green-light);
	font-size: clamp(10px, 1.5vh, 12px);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.playrox-rule::before,
.playrox-rule::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: rgba(255, 255, 255, 0.16);
}

.playrox-rule--tight {
	margin: 2px 0;
}

/* Pills ------------------------------------------------------------------ */

.playrox-auth__actions {
	display: flex;
	flex-direction: column;
	gap: var(--pra-gap);
}

.playrox-auth__providers {
	display: flex;
	flex-direction: column;
	gap: var(--pra-gap);
}

/* Both providers enabled: share one row. */
.playrox-auth__providers.is-pair {
	flex-direction: row;
	gap: 10px;
}

.playrox-auth__providers.is-pair .playrox-pill {
	flex: 1 1 0;
	min-width: 0;
	min-height: 35px;
	padding: 0 10px;
	gap: 8px;
}

.playrox-auth__providers.is-pair .playrox-pill span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.playrox-pill {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 11px;
	width: 100%;
	min-height: var(--pra-pill);
	padding: 0 14px;
	border: 2px solid transparent;
	border-radius: 999px;
	font-size: var(--pra-pill-text);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.playrox-pill:hover {
	transform: translateY(-1px);
	text-decoration: none;
}

.playrox-pill:active {
	transform: translateY(0);
}

.playrox-pill__icon {
	flex: 0 0 auto;
	font-size: calc(var(--pra-pill-text) * 1.2);
}

.playrox-pill__chevron {
	position: absolute;
	right: 22px;
	font-size: 14px;
	opacity: 0.75;
}

.playrox-pill--light {
	background: #fff;
	color: #1a2b1f;
}

.playrox-pill--light:hover {
	background: #f1f4ef;
	color: #1a2b1f;
}

.playrox-pill--ghost {
	background: transparent;
	border-color: var(--pra-green-light);
	color: #ffffff;
}

.playrox-pill--ghost:hover {
	background: rgba(111, 207, 111, 0.12);
	color: #fff;
}

.playrox-pill--ghost span,
.playrox-pill--ghost .playrox-pill__icon {
	color: #ffffff;
}

.playrox-pill--ghost a {
    color: #ffffff;
}


.playrox-pill--primary {
	background: linear-gradient(180deg, #34a853 0%, #2b8c45 100%);
	color: #fff;
	box-shadow: 0 8px 22px rgba(47, 158, 68, 0.4);
}

.playrox-pill--primary:hover {
	color: #fff;
	filter: brightness(1.07);
}

.playrox-auth__note {
	margin: 2px 0 0;
	font-size: clamp(10px, 1.45vh, 12px);
	color: rgba(255, 255, 255, 0.6);
}

.playrox-auth__switch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	margin-top: 4px;
	padding: 10px;
	color: rgba(255, 255, 255, 0.82);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

.playrox-auth__switch:hover {
	color: #fff;
	text-decoration: none;
}

.playrox-auth__switch i {
	font-size: 18px;
}

/* Stat card (welcome) ---------------------------------------------------- */

.playrox-statcard {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
	margin: 0 0 var(--pra-gap);
	padding: clamp(10px, 1.8vh, 16px) 4px;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
	list-style: none;
}

.playrox-statcard__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 0 6px;
	text-align: center;
}

.playrox-statcard__icon {
	margin-bottom: 2px;
	font-size: clamp(16px, 2.6vh, 21px);
}

.playrox-statcard__icon--green { color: var(--pra-green); }
.playrox-statcard__icon--gold { color: var(--pra-gold); }
.playrox-statcard__icon--purple { color: var(--pra-purple); }
.playrox-statcard__icon--orange { color: var(--pra-orange); }

.playrox-statcard__label {
	font-size: 11px;
	font-weight: 700;
	line-height: 1.2;
	color: #1a2b1f;
}

.playrox-statcard__note {
	font-size: 9.5px;
	line-height: 1.3;
	color: #7b8a7e;
}

.playrox-statcard__value {
	font-size: clamp(15px, 2.5vh, 19px);
	font-weight: 800;
	line-height: 1.1;
}

.playrox-statcard__value--green { color: var(--pra-green); }
.playrox-statcard__value--purple { color: var(--pra-purple); }
.playrox-statcard__value--orange { color: var(--pra-orange); }

.playrox-statcard__unit {
	font-size: 10px;
	color: #7b8a7e;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   Width: phone bottom sheet, tablet centred card
   -------------------------------------------------------------------------- */

/* Larger tablets and small laptops: a touch wider, stays centred. */
@media (min-width: 601px) and (max-width: 1024px) {
	.playrox-auth__sheet {
		max-width: 460px;
	}
}

/* Phones & small tablets in portrait: full-screen sheet, edge to edge. */
@media (max-width: 600px) {
	.playrox-auth {
		padding: 0;
		align-items: stretch;
	}

	.playrox-auth__sheet {
		max-width: none;
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-height: 100vh;
		max-height: 100dvh;
		border-radius: 0;
		/* Scroll if the full content is taller than the screen. */
		overflow-y: auto;
	}

	/*
	 * Top light section grows to fill any spare height so the green section
	 * always sits at the bottom. Content is anchored to the top of that space
	 * (not centred) so the brand + headline read from the top down.
	 */
	.playrox-auth__top {
		flex: 1 0 auto;
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
	}

	/* Solid backdrop so nothing behind shows through the full-screen sheet. */
	.playrox-auth__backdrop {
		background: var(--pra-deep);
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
	}

	.playrox-auth__bottom {
		padding-bottom: max(clamp(14px, 2.6vh, 22px), env(safe-area-inset-bottom));
	}

	.playrox-pill {
		padding: 0 12px;
	}
}

/* benefit/stat sub-text kept on narrow phones too */

/* --------------------------------------------------------------------------
   Height: progressively shed the least important content so the sheet
   always fits the viewport rather than scrolling.
   -------------------------------------------------------------------------- */

/* Small laptops and large phones in portrait. */
/*
 * Illustration scale by viewport height. Percentages, so the artwork only
 * ever gets smaller - never squashed, never cropped.
 */
/*
 * The illustration always renders at its natural size. Vertical space is
 * reclaimed from spacing and secondary copy instead, in this order:
 * subtitle first, then the logo mark.
 */
/* lede kept at all heights now that the sheet is full-height + scrollable */

/* brand logo/mark kept at all heights */

/* lede + brand swoosh kept at all heights */

/* underline swoosh kept at all heights */

/* Phone landscape: full-screen, scrolls if the content is taller. */
@media (max-height: 500px) and (max-width: 900px) {
	.playrox-auth {
		align-items: stretch;
		padding: 0;
	}

	.playrox-auth__sheet {
		max-width: none;
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-height: 100vh;
		max-height: 100dvh;
		border-radius: 0;
		/* Allow scrolling when everything can't fit a short landscape screen. */
		overflow-y: auto;
	}

	.playrox-auth__top {
		flex: 0 0 auto;
		padding-bottom: 10px;
	}

	.playrox-benefits {
		margin-bottom: 6px;
	}

	.playrox-benefit__icon {
		width: 28px;
		height: 28px;
		font-size: 12px;
	}

	/* Two buttons side by side to save vertical space. */
	.playrox-auth__actions {
		flex-flow: row wrap;
		justify-content: center;
	}

	.playrox-auth__actions > .playrox-pill {
		flex: 1 1 200px;
		width: auto;
	}

	.playrox-auth__actions > .playrox-rule,
	.playrox-auth__actions > .playrox-auth__note,
	.playrox-auth__actions > .playrox-auth__switch {
		flex: 1 1 100%;
		margin: 0;
	}

	.playrox-avatar-ring {
		margin-bottom: 0;
	}
}

/* Anything shorter than this genuinely cannot fit; allow a scroll. */
@media (max-height: 380px) {
	.playrox-auth__sheet {
		overflow-y: auto;
	}
}

/* hero kept; on very short screens the sheet scrolls instead of hiding it */

@media (prefers-reduced-motion: reduce) {
	.playrox-auth,
	.playrox-auth__sheet,
	.playrox-pill {
		transition: none;
	}
}

/* Working state on provider buttons ---------------------------------------- */

.playrox-pill.is-busy {
	position: relative;
	pointer-events: none;
	color: transparent !important;
}

.playrox-pill.is-busy > * {
	opacity: 0;
}

.playrox-pill.is-busy::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid rgba(0, 0, 0, 0.2);
	border-top-color: #2f9e44;
	border-radius: 50%;
	animation: playrox-spin 0.75s linear infinite;
}

.playrox-pill--apple.is-busy::after,
.playrox-pill--primary.is-busy::after,
.playrox-pill--ghost.is-busy::after {
	border-color: rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
}

@keyframes playrox-spin {
	to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.playrox-pill.is-busy::after {
		animation-duration: 2s;
	}
}

/* Bundled benefit artwork: the PNG already is the green disc. */

.playrox-benefit__icon--art {
	background: none;
	box-shadow: none;
}

.playrox-benefit__icon--art img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Welcome deck: Continue Playing + View Leaderboard side by side. */
.playrox-auth__actions--row {
	flex-direction: row;
	gap: 10px;
}
.playrox-auth__actions--row .playrox-pill--compact {
	flex: 1 1 0;
	min-width: 0;
	width: auto;
	min-height: 44px;
	padding: 0 12px;
	gap: 8px;
	font-size: 14px;
}
.playrox-auth__actions--row .playrox-pill--compact span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.playrox-auth__actions--row .playrox-pill__icon { font-size: 14px; }
@media (max-width: 380px) {
	.playrox-auth__actions--row .playrox-pill--compact { font-size: 12.5px; padding: 0 10px; min-height: 42px; }
}
