/*
 * Fabilosa hub page. Colours, outlines and buttons follow the game's public/css/main.css and render/palette.js.
 * Motion uses transform and opacity only. html.is_paused stops every animation while the page is hidden,
 * .hero.is_resting while the hero is out of view.
 */

@font-face
{
	font-family: "Fredoka";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../assets/fonts/fredoka_latin_500.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face
{
	font-family: "Fredoka";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("../assets/fonts/fredoka_latin_ext_500.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face
{
	font-family: "Fredoka";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../assets/fonts/fredoka_latin_700.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face
{
	font-family: "Fredoka";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../assets/fonts/fredoka_latin_ext_700.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Local fonts scaled to Fredoka's width and vertical metrics, so a late font swap moves no text. Values from the game. */
@font-face
{
	font-family: "Fredoka fallback";
	font-style: normal;
	font-weight: 500;
	src: local("Arial"), local("ArialMT"), local("Roboto"), local("Roboto-Regular"), local("Liberation Sans"), local("Helvetica Neue");
	size-adjust: 120%;
	ascent-override: 81%;
	descent-override: 20%;
	line-gap-override: 0%;
}

@font-face
{
	font-family: "Fredoka fallback";
	font-style: normal;
	font-weight: 700;
	src: local("Arial Bold"), local("Arial-BoldMT"), local("Roboto Bold"), local("Roboto-Bold"), local("Liberation Sans Bold"), local("Helvetica Neue Bold");
	size-adjust: 112%;
	ascent-override: 87%;
	descent-override: 21%;
	line-gap-override: 0%;
}

:root
{
	--plum: #3b2a4a;
	--plum_20: rgba(59, 42, 74, 0.2);
	--plum_75: rgba(59, 42, 74, 0.75);
	--cream: #fff6e6;
	--panel_edge: #e8d5b5;
	--white: #ffffff;
	--duck_yellow: #ffd648;
	--duck_yellow_hover: #ffe27a;
	--duck_light: #ffeb99;
	--heart: #ff5a6e;
	--pink: #ff8fab;
	--pink_light: #ffd6e2;
	--blue: #7cc4f0;
	--sky: #dceaf7;
	--foam_shade: #d9ecff;
	--bubble_rim: #9ccaf5;
	--bubble_shimmer: #bff0ea;
	--sparkle: #fff3b0;
	--focus_ring: #2f6fb7;
	--font_family: "Fredoka", ui-rounded, "Fredoka fallback", "Arial Rounded MT Bold", system-ui, sans-serif;

	--safe_top: env(safe-area-inset-top, 0px);
	--safe_right: env(safe-area-inset-right, 0px);
	--safe_bottom: env(safe-area-inset-bottom, 0px);
	--safe_left: env(safe-area-inset-left, 0px);
	--viewport_height: 100vh;
	--content_width: 1120px;

	--hero_scroll: 0;
	--pointer_x: 0;
	--pointer_y: 0;
}

@supports (height: 100svh)
{
	:root
	{
		--viewport_height: 100svh;
	}
}

*,
*::before,
*::after
{
	box-sizing: border-box;
}

html
{
	background-color: var(--cream);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body
{
	margin: 0;
	min-width: 320px;
	overflow-x: hidden;
	font-family: var(--font_family);
	font-weight: 500;
	font-size: 17px;
	line-height: 1.45;
	font-synthesis: none;
	color: var(--plum);
	background-color: var(--cream);
	background-image: radial-gradient(circle, rgba(232, 213, 181, 0.55) 0 4px, transparent 5px);
	background-size: 40px 40px;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

[hidden]
{
	display: none !important;
}

h1,
h2,
h3,
p
{
	margin: 0;
	font-weight: inherit;
	text-wrap: balance;
}

img
{
	display: block;
	max-width: 100%;
}

a
{
	color: inherit;
}

button
{
	font-family: inherit;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 4px;
}

.symbol_sheet
{
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
}

.section_inner
{
	width: 100%;
	max-width: var(--content_width);
	margin: 0 auto;
	padding: 0 max(16px, var(--safe_left)) 0 max(16px, var(--safe_right));
}

.section_heading
{
	font-size: 34px;
	font-weight: 700;
	line-height: 1.1;
}

/* Buttons, as in the game */

.button
{
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 56px;
	margin: 0 0 5px;
	padding: 0 24px;
	color: var(--plum);
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 5px 0 var(--plum);
	font-size: 20px;
	font-weight: 700;
	line-height: 24px;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: transform 70ms ease-out, box-shadow 70ms ease-out, background-color 150ms ease;
}

.button:active
{
	transform: translateY(5px);
	box-shadow: 0 0 0 var(--plum);
}

.button_primary
{
	background-color: var(--duck_yellow);
}

.button_large
{
	min-height: 68px;
	padding: 0 40px;
	font-size: 25px;
	line-height: 30px;
}

.button_icon
{
	flex: none;
	width: 28px;
	height: 28px;
}

.button_large .button_icon
{
	width: 32px;
	height: 32px;
}

@media (hover: hover) and (pointer: fine)
{
	.button:hover
	{
		background-color: #fffaf1;
	}

	.button_primary:hover
	{
		background-color: var(--duck_yellow_hover);
	}
}

/* Header */

.site_header
{
	position: absolute;
	top: calc(var(--safe_top) + 12px);
	right: max(12px, var(--safe_right));
	z-index: 10;
}

.language_switch
{
	display: flex;
	gap: 3px;
	padding: 3px;
	background-color: var(--panel_edge);
	border: 3px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 4px 0 var(--plum_20);
}

.language_button
{
	appearance: none;
	-webkit-appearance: none;
	min-width: 44px;
	min-height: 40px;
	margin: 0;
	padding: 0 8px;
	background: transparent;
	border: 0;
	border-radius: 999px;
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	cursor: pointer;
}

.language_button[aria-pressed="true"]
{
	background-color: var(--duck_yellow);
	box-shadow: inset 0 0 0 3px var(--plum);
}

.language_button:focus-visible
{
	outline-offset: 2px;
}

/* Hero */

/* --foam_rise is how far the foam climbs while the hero scrolls out of view, as the foam rises in the game. */
.hero
{
	position: relative;
	overflow: hidden;
	padding: calc(var(--safe_top) + 64px) 0 112px;
	isolation: isolate;
	--foam_rise: -40vh;
}

.hero_backdrop
{
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

.hero_snacks,
.hero_bubbles
{
	position: absolute;
	inset: 0;
}

.hero_snacks
{
	transform: translate3d(calc(var(--pointer_x) * 14px), calc(var(--pointer_y) * 10px + var(--hero_scroll) * -140px), 0);
}

.hero_bubbles
{
	transform: translate3d(calc(var(--pointer_x) * -8px), calc(var(--hero_scroll) * var(--foam_rise)), 0);
}

.snack
{
	position: absolute;
	width: 52px;
	height: auto;
	pointer-events: auto;
	cursor: pointer;
	animation: snack_drift 5.6s ease-in-out infinite alternate;
	transition: opacity 200ms ease;
}

.snack_cookie
{
	left: 3%;
	top: 33%;
}

.snack_strawberry
{
	right: 6%;
	top: 23%;
	width: 46px;
	animation-duration: 6.4s;
	animation-delay: -2s;
}

.snack_cake
{
	right: 3%;
	top: 64%;
	width: 58px;
	animation-duration: 7s;
	animation-delay: -4s;
}

.snack_nata
{
	right: 4%;
	top: 44%;
	width: 60px;
	animation-duration: 6s;
	animation-delay: -1s;
}

.snack_arepa
{
	left: 5%;
	top: 50%;
	width: 44px;
	animation-duration: 6.8s;
	animation-delay: -3s;
}

.snack.is_eaten
{
	opacity: 0;
}

.bubble
{
	position: absolute;
	bottom: 70px;
	left: 10%;
	width: 40px;
	height: auto;
	opacity: 0;
	pointer-events: auto;
	cursor: pointer;
	animation: bubble_rise 8s ease-in infinite;
}

.bubble:nth-child(2)
{
	left: 24%;
	width: 28px;
	animation-duration: 6.5s;
	animation-delay: -2s;
}

.bubble:nth-child(3)
{
	left: 41%;
	width: 48px;
	animation-duration: 9s;
	animation-delay: -5s;
}

.bubble:nth-child(4)
{
	left: 58%;
	width: 30px;
	animation-duration: 7s;
	animation-delay: -1s;
}

.bubble:nth-child(5)
{
	left: 72%;
	width: 44px;
	animation-duration: 8.5s;
	animation-delay: -6s;
}

.bubble:nth-child(6)
{
	left: 86%;
	width: 26px;
	animation-duration: 6s;
	animation-delay: -3.5s;
}

.bubble:nth-child(7)
{
	left: 93%;
	width: 34px;
	animation-duration: 9.5s;
	animation-delay: -7s;
}

.bubble:nth-child(8)
{
	left: 3%;
	width: 32px;
	animation-duration: 7.5s;
	animation-delay: -4.5s;
}

.bubble.is_popped
{
	animation: bubble_pop 260ms ease-out forwards;
}

/* No z-index here: the layout's children share the hero's stacking order, so the play button can float above the foam. */
.hero_layout
{
	position: relative;
	display: grid;
	grid-template-areas: "logo" "line" "stage" "play" "trailer" "caption";
	justify-items: center;
	max-width: var(--content_width);
	margin: 0 auto;
	padding: 0 16px;
	text-align: center;
	pointer-events: none;
}

/* The layout spans the whole hero; only its links and Fabi take taps, so the snacks and bubbles behind it stay tappable. */
.hero_layout a,
.hero_layout button
{
	pointer-events: auto;
}

.hero_logo
{
	grid-area: logo;
	transform: translate3d(0, calc(var(--hero_scroll) * 70px), 0);
}

.hero_logo_image
{
	width: min(260px, 72vw);
	height: auto;
	animation: logo_float 4.2s ease-in-out infinite;
}

.hero_line
{
	grid-area: line;
	margin-top: 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 26px;
}

.hero_caption
{
	grid-area: caption;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	margin-top: 10px;
	font-size: 16px;
	line-height: 22px;
}

.hero_game_name
{
	display: none;
	font-size: 20px;
	font-weight: 700;
}

.hero_stage
{
	grid-area: stage;
	position: relative;
	display: flex;
	justify-content: center;
	width: 100%;
	margin-top: 34px;
	--frame_width: clamp(130px, min(58vw, var(--viewport_height) * 0.4615 - 199px), 250px);
}

.phone_tilt
{
	position: relative;
	transform: rotate(calc(var(--hero_scroll) * -5deg + var(--pointer_x) * 2deg));
}

/* The whole phone is a link to the game. It lifts under the pointer and gives way when pressed, like the game's buttons. */
.phone_link
{
	display: block;
	border-radius: calc(var(--frame_width) * 0.16);
	-webkit-tap-highlight-color: transparent;
	transition: transform 200ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.phone_frame
{
	position: relative;
	display: block;
	width: var(--frame_width);
	padding: 9px;
	background-color: var(--plum);
	border-radius: calc(var(--frame_width) * 0.16);
	box-shadow: 0 8px 0 var(--plum_20), 0 0 0 4px var(--cream), 0 0 0 7px var(--plum);
	transition: box-shadow 200ms ease;
}

/* PhoneFrame.js sets --screen_ratio from the poster's size in content/games.js; poster and loop cover the screen. */
.phone_screen
{
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--screen_ratio, 9 / 16);
	background-color: var(--sky);
	border-radius: calc(var(--frame_width) * 0.12);
}

.phone_poster
{
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.phone_video
{
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.phone_video
{
	opacity: 0;
	transition: opacity 300ms ease;
}

.phone_video.is_playing
{
	opacity: 1;
}

.phone_badge
{
	position: absolute;
	left: 50%;
	top: 50%;
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	margin: -38px 0 0 -38px;
	background-color: var(--duck_yellow);
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-shadow: 0 5px 0 var(--plum);
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 160ms ease, transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.phone_badge_icon
{
	width: 40px;
	height: 40px;
	margin-left: 5px;
}

.phone_link:active
{
	transform: translate3d(0, 6px, 0) scale(0.97);
	transition-duration: 70ms;
}

.phone_link:active .phone_frame
{
	box-shadow: 0 2px 0 var(--plum_20), 0 0 0 4px var(--cream), 0 0 0 7px var(--plum);
}

.phone_link:active .phone_badge
{
	opacity: 1;
	transform: scale(1);
}

@media (hover: hover) and (pointer: fine)
{
	.phone_link:hover
	{
		transform: translate3d(0, -10px, 0) rotate(-1.5deg);
	}

	.phone_link:hover .phone_frame
	{
		box-shadow: 0 18px 0 var(--plum_20), 0 0 0 4px var(--cream), 0 0 0 7px var(--plum);
	}

	.phone_link:hover .phone_badge
	{
		opacity: 1;
		transform: scale(1);
	}
}

.game_sticker
{
	position: absolute;
	left: 50%;
	top: -30px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 14px 4px;
	font-size: 19px;
	font-weight: 700;
	line-height: 24px;
	white-space: nowrap;
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 4px 0 var(--plum_20);
	transform: translateX(-50%) rotate(-4deg);
	pointer-events: none;
}

/* The game's version beside its name: small and quiet. */
.game_version
{
	display: inline-block;
	padding: 1px 7px;
	color: var(--plum_75);
	font-size: 12px;
	font-weight: 700;
	line-height: 16px;
	letter-spacing: 0.02em;
	vertical-align: middle;
	background-color: rgba(232, 213, 181, 0.6);
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
}

.section_heading .game_version
{
	position: relative;
	top: -0.2em;
	font-size: 14px;
	line-height: 18px;
}

.phone_play_clip
{
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	padding: 0;
	background-color: var(--duck_yellow);
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-shadow: 0 5px 0 var(--plum);
	transform: translate(-50%, -50%);
	cursor: pointer;
}

.phone_play_clip .button_icon
{
	width: 34px;
	height: 34px;
}

.hero_fabi
{
	position: absolute;
	left: calc(50% - var(--frame_width) / 2 - 66px);
	bottom: 10px;
	z-index: 3;
	width: 100px;
	pointer-events: none;
}

/* Fabi breathes and sways while idle; a tap makes her jump in her jump pose. */
.fabi_body
{
	position: relative;
	width: 88px;
	margin: 0 auto -8px;
	aspect-ratio: 444 / 480;
	pointer-events: auto;
	cursor: pointer;
	transform-origin: 50% 100%;
	animation: fabi_idle 2.8s ease-in-out infinite;
}

.fabi_pose
{
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: auto;
}

.fabi_jump
{
	left: -3%;
	width: 106%;
	opacity: 0;
}

.fabi_body.is_jumping
{
	animation: fabi_leap 760ms cubic-bezier(0.25, 1.2, 0.45, 1);
}

.fabi_body.is_jumping .fabi_stand
{
	opacity: 0;
}

.fabi_body.is_jumping .fabi_jump
{
	opacity: 1;
}

.fabi_platform
{
	width: 100px;
	height: auto;
}

.hero_play
{
	grid-area: play;
	z-index: 7;
	margin-top: 24px;
	min-width: min(240px, 100%);
}

.hero_trailer
{
	grid-area: trailer;
	z-index: 7;
	min-height: 48px;
	margin-top: 10px;
	padding: 0 20px;
	font-size: 18px;
	line-height: 22px;
}

/* On phones, with the trailer button below Play, the phone gives up the height of that button. */
@media (max-width: 959px)
{
	.hero.has_trailer .hero_stage
	{
		--frame_width: clamp(130px, min(58vw, var(--viewport_height) * 0.4615 - 228px), 250px);
	}
}

.trailer_dialog
{
	position: fixed;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--safe_top) + 12px) 16px calc(var(--safe_bottom) + 12px);
	background-color: rgba(59, 42, 74, 0.82);
}

.trailer_panel
{
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
}

.trailer_close
{
	appearance: none;
	-webkit-appearance: none;
	order: -1;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin: 0 0 4px;
	padding: 0;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-shadow: 0 4px 0 var(--plum);
	cursor: pointer;
}

.trailer_close:active
{
	transform: translateY(4px);
	box-shadow: 0 0 0 var(--plum);
}

.trailer_close_icon
{
	width: 30px;
	height: 30px;
}

.trailer_close:focus-visible
{
	outline-color: var(--duck_yellow);
}

/* The size is set before the clip's metadata arrives, so the dialog does not jump. */
.trailer_video
{
	display: block;
	height: min(var(--viewport_height) - 110px, (100vw - 32px) * 1.7778);
	width: auto;
	aspect-ratio: 9 / 16;
	background-color: #000000;
	border: 3px solid var(--cream);
	border-radius: 18px;
}

.trailer_video:focus-visible
{
	outline: 4px solid var(--duck_yellow);
	outline-offset: 3px;
}

html.has_dialog
{
	overflow: hidden;
}

html.has_dialog .hero *
{
	animation-play-state: paused !important;
}

/* The parade waddles along the foam to one edge, turns round and waddles back, and rides up with the foam. */
.parade
{
	position: absolute;
	left: 0;
	right: 0;
	bottom: 46px;
	z-index: 6;
	height: 60px;
	pointer-events: none;
	transform: translate3d(0, calc(var(--hero_scroll) * var(--foam_rise)), 0);
}

.parade_track
{
	position: absolute;
	left: 0;
	bottom: 0;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	animation: parade_patrol 14s linear -2s infinite;
}

.parade_duck
{
	position: relative;
	display: block;
	width: 46px;
	aspect-ratio: 233 / 240;
	pointer-events: auto;
	cursor: pointer;
	animation: duck_waddle 0.55s ease-in-out infinite alternate;
	transform-origin: 50% 100%;
}

.parade_duck:nth-child(even),
.parade_duck:nth-child(even) .duck_frame_2
{
	animation-delay: -0.27s;
}

.parade_duck_wide
{
	display: none;
}

.duck_frame
{
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: auto;
}

.duck_frame_2
{
	opacity: 0;
	animation: duck_step 0.55s steps(1, end) infinite;
}

.parade_duck.is_hopping
{
	animation: duck_hop 520ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.tap_heart
{
	position: absolute;
	left: 50%;
	bottom: 100%;
	width: 26px;
	height: 26px;
	margin-left: -13px;
	pointer-events: none;
	animation: heart_float 900ms ease-out forwards;
}

.tap_word
{
	position: absolute;
	left: 50%;
	top: -10px;
	color: var(--heart);
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
	text-shadow: 0 2px 0 var(--white), 2px 0 0 var(--white), -2px 0 0 var(--white), 0 -2px 0 var(--white);
	pointer-events: none;
	animation: word_float 900ms ease-out forwards;
}

.foam_layer
{
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	height: 84px;
	pointer-events: none;
	transform: translate3d(0, calc(var(--hero_scroll) * var(--foam_rise, 0px)), 0);
}

/* The white below the strips reaches far under the section's edge, so the rising foam never shows a gap. */
.foam
{
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: calc(84px + 60vh);
	overflow: hidden;
	background-image: linear-gradient(to bottom, transparent 0, transparent 76px, var(--white) 76px);
}

.foam_strip
{
	position: absolute;
	left: 0;
	top: 0;
	width: calc(100% + 272px);
	height: 83px;
	background-image: url("../assets/kit/foam.webp");
	background-repeat: repeat-x;
	background-size: 272px 83px;
}

.foam_strip_back
{
	top: -14px;
	opacity: 0.55;
	animation: foam_drift_back 22s linear infinite;
}

.foam_strip_front
{
	animation: foam_drift 15s linear infinite;
}

.hero.is_resting *,
html.is_paused *
{
	animation-play-state: paused !important;
}

/* The game */

.game_section
{
	position: relative;
	padding: 28px 0 40px;
	background-color: var(--white);
	background-image: linear-gradient(to bottom, var(--white) 0, var(--white) 30%, var(--cream) 100%);
}

.game_layout
{
	display: grid;
	gap: 28px;
}

.game_tagline
{
	margin-top: 4px;
	font-size: 19px;
	line-height: 26px;
}

.fact_list
{
	display: grid;
	gap: 10px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.fact
{
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	padding: 10px 14px 10px 10px;
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 18px;
	box-shadow: 0 4px 0 var(--plum_20);
}

.fact_icon
{
	width: 44px;
	height: 44px;
}

.fact_body
{
	font-size: 16px;
	line-height: 21px;
	text-wrap: pretty;
}

.fact_title
{
	display: block;
	font-size: 18px;
	font-weight: 700;
	line-height: 23px;
}

/* The link to the game's manual, under the facts: a link of this page, at least 44 px high for a thumb. */
.game_help
{
	display: inline-flex;
	align-items: center;
	gap: 10px;
	align-self: flex-start;
	min-height: 44px;
	margin-top: 14px;
	padding: 4px 0;
	font-size: 17px;
	font-weight: 700;
	line-height: 22px;
	color: var(--plum);
	text-underline-offset: 0.2em;
}

.game_help_icon
{
	flex: none;
	width: 20px;
	height: 20px;
}

.game_scene
{
	display: none;
}

.board_panel
{
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px 14px 14px;
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 20px;
	box-shadow: 0 8px 0 var(--plum_20);
}

.board_header
{
	display: grid;
	grid-template-columns: 52px minmax(0, 1fr);
	align-items: center;
	gap: 10px;
}

.board_duck
{
	width: 52px;
	height: auto;
}

.board_heading
{
	font-size: 22px;
	font-weight: 700;
	line-height: 26px;
}

.board_period
{
	min-height: 20px;
	font-size: 15px;
	line-height: 20px;
	color: var(--plum_75);
}

.board_body
{
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	min-height: 120px;
}

.board_list,
.board_pinned,
.board_specials
{
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.board_row,
.board_special
{
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) auto;
	grid-template-areas: "rank name score" "rank height score";
	align-items: center;
	column-gap: 10px;
	min-height: 50px;
	padding: 4px 12px 4px 5px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 16px;
}

.board_rank
{
	grid-area: rank;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	font-size: 15px;
	font-weight: 700;
	background-color: var(--panel_edge);
	border-radius: 999px;
}

.board_list > .board_row:nth-child(1) .board_rank
{
	background-color: #ffc928;
}

.board_list > .board_row:nth-child(2) .board_rank
{
	background-color: #dfe6ee;
}

.board_list > .board_row:nth-child(3) .board_rank
{
	background-color: #e9a26b;
}

/* Fabi's row, in the list at her rank or pinned below it: a heart after her name and the caption of her best. */
.board_row_streamer
{
	background-color: var(--pink_light);
}

.board_row_streamer .board_name
{
	display: flex;
	align-items: center;
	gap: 4px;
}

.board_name_text
{
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.board_name_icon
{
	flex: none;
	width: 20px;
	height: 20px;
}

/* Captions wrap: on a narrow screen "Lo mejor de Fabi esta semana" is wider than the space left of the score. */
.board_row_streamer .board_height,
.board_special .board_height
{
	white-space: normal;
}

/* Her row below the list when the shown ranks do not hold hers; the dashed line marks the gap in the ranks. */
.board_pinned
{
	padding-top: 8px;
	border-top: 2px dashed var(--plum_20);
}

.board_name
{
	grid-area: name;
	overflow: hidden;
	font-size: 16px;
	font-weight: 700;
	line-height: 21px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.board_height
{
	grid-area: height;
	font-size: 13px;
	line-height: 17px;
	color: var(--plum_75);
	white-space: nowrap;
}

.board_score
{
	grid-area: score;
	font-size: 18px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

.board_special
{
	background-color: var(--sparkle);
}

.board_special[data-kind="streamer"]
{
	background-color: var(--pink_light);
}

.board_special_icon
{
	grid-area: rank;
	width: 30px;
	height: 30px;
	margin-left: 2px;
}

.board_state
{
	padding: 12px 8px;
	font-size: 17px;
	line-height: 24px;
	text-align: center;
}

.board_state_duck
{
	width: 64px;
	height: auto;
	margin: 0 auto 8px;
	animation: duck_waddle 0.8s ease-in-out infinite alternate;
	transform-origin: 50% 100%;
}

.board_play
{
	align-self: center;
	margin-top: auto;
	min-width: min(240px, 100%);
}

/* More to come */

.shelf_section
{
	padding: 24px 0 48px;
}

.shelf
{
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 14px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.shelf_card
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 16px 12px 18px;
	text-align: center;
	background-color: var(--white);
	border: 3px dashed var(--plum);
	border-radius: 20px;
}

.shelf_card_live
{
	border-style: solid;
	box-shadow: 0 6px 0 var(--plum_20);
}

.shelf_card:nth-child(even)
{
	--egg_spot: var(--blue);
}

.egg_button
{
	appearance: none;
	-webkit-appearance: none;
	margin: 0 0 6px;
	padding: 4px;
	background: transparent;
	border: 0;
	border-radius: 20px;
	cursor: pointer;
}

.egg
{
	display: block;
	width: 76px;
	height: 94px;
	transform-origin: 50% 92%;
	animation: egg_idle 4.5s ease-in-out infinite;
}

.shelf_card:nth-child(even) .egg
{
	animation-delay: -2.2s;
}

.egg_spot
{
	fill: var(--egg_spot, var(--pink));
}

.egg_button.is_wobbling .egg
{
	animation: egg_wobble 700ms ease-in-out;
}

.shelf_name
{
	font-size: 18px;
	font-weight: 700;
	line-height: 23px;
}

.shelf_line
{
	font-size: 15px;
	line-height: 20px;
}

.shelf_icon
{
	width: 76px;
	height: auto;
	margin-bottom: 6px;
}

.shelf_play
{
	margin-top: 10px;
}

/* Footer */

.site_footer
{
	padding: 22px 0 calc(var(--safe_bottom) + 26px);
	color: var(--cream);
	background-color: var(--plum);
}

.footer_layout
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 20px;
}

.footer_privacy
{
	font-size: 17px;
	font-weight: 700;
}

.channel_list
{
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* One link per channel: the icon and the handle, both inside the link, at least 44 px tall for a thumb. The
   underline sits below the handle's underscores, which it would otherwise run into. */
.channel_list a
{
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	font-weight: 700;
	color: var(--duck_yellow);
	text-underline-offset: 0.3em;
}

.channel_icon
{
	flex: none;
	width: 1em;
	height: 1em;
}

.site_footer a:focus-visible
{
	outline-color: var(--duck_yellow);
}

.footer_brand
{
	font-size: 15px;
	opacity: 0.85;
}

/* Error pages */

.error_page
{
	display: flex;
	flex-direction: column;
	min-height: var(--viewport_height);
}

.error_main
{
	position: relative;
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	overflow: hidden;
	padding: calc(var(--safe_top) + 72px) 16px 120px;
	text-align: center;
}

.error_home_link
{
	display: inline-block;
	border-radius: 12px;
}

.error_logo
{
	width: min(220px, 60vw);
	height: auto;
}

.error_heading
{
	font-size: 32px;
	font-weight: 700;
	line-height: 1.15;
}

.error_line
{
	max-width: 30em;
	font-size: 18px;
	line-height: 25px;
}

.error_actions
{
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 6px;
}

/* The duckling of the 404 page walks out of the right edge and comes back from the left. */
.lost_duck_path
{
	position: absolute;
	left: 0;
	right: 0;
	bottom: 46px;
	z-index: 6;
	height: 80px;
	pointer-events: none;
}

.lost_duck
{
	position: absolute;
	left: 0;
	bottom: 0;
	width: 76px;
	aspect-ratio: 233 / 240;
	animation: lost_duck_walk 11s linear -4s infinite;
}

.lost_duck .parade_duck
{
	width: 76px;
}

.nap_duck
{
	width: 120px;
	height: auto;
	animation: nap_breathe 3s ease-in-out infinite;
	transform-origin: 50% 100%;
}

/* Wider screens */

@media (min-width: 720px)
{
	.section_heading
	{
		font-size: 40px;
	}

	.fact_list
	{
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.snack
	{
		width: 70px;
	}

	.snack_strawberry,
	.snack_arepa
	{
		width: 60px;
	}

	.snack_cake,
	.snack_nata
	{
		width: 80px;
	}
}

@media (min-width: 960px)
{
	.hero
	{
		display: flex;
		align-items: center;
		min-height: min(860px, max(700px, var(--viewport_height)));
		padding: 56px 0 150px;
	}

	.hero_layout
	{
		width: 100%;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: "logo stage" "line stage" "caption stage" "play stage" "trailer stage";
		grid-template-rows: auto auto auto auto 1fr;
		justify-items: start;
		align-items: start;
		column-gap: 48px;
		padding: 0 48px;
		text-align: left;
	}

	.hero_logo
	{
		margin-top: 60px;
	}

	.hero_logo_image
	{
		width: 520px;
	}

	.hero_line
	{
		margin-top: 14px;
		font-size: 30px;
		line-height: 38px;
	}

	.hero_caption
	{
		align-items: flex-start;
		margin-top: 22px;
		font-size: 19px;
		line-height: 26px;
	}

	.hero_game_name
	{
		display: block;
		font-size: 24px;
	}

	.hero_play
	{
		margin-top: 26px;
	}

	.hero_trailer
	{
		margin-top: 12px;
	}

	.hero_stage
	{
		width: auto;
		margin-top: 30px;
		padding: 0 60px 0 120px;
		--frame_width: 290px;
	}

	.hero_fabi
	{
		left: -10px;
		bottom: 40px;
		width: 150px;
	}

	.fabi_body
	{
		width: 124px;
	}

	.fabi_platform
	{
		width: 150px;
	}

	.parade
	{
		bottom: 48px;
		height: 76px;
	}

	.parade_track
	{
		gap: 12px;
		animation-duration: 34s;
		animation-delay: -9s;
	}

	.parade_duck
	{
		width: 62px;
	}

	.parade_duck_wide
	{
		display: block;
	}

	.game_section
	{
		padding: 48px 0 64px;
	}

	.game_layout
	{
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		align-items: stretch;
		gap: 48px;
		padding: 0 48px;
	}

	.game_intro
	{
		display: flex;
		flex-direction: column;
	}

	/* While the board shows entries, Fabi, two ducklings and a popcorn bucket fill the column under the facts down to the panel's bottom. */
	.has_board_entries .game_scene
	{
		display: flex;
		flex: 1 0 170px;
		align-items: flex-end;
		justify-content: center;
		gap: 10px;
		margin-top: 18px;
	}

	.scene_popcorn
	{
		width: 78px;
		height: auto;
		margin-bottom: 10px;
	}

	.scene_fabi
	{
		width: 150px;
	}

	.scene_fabi_image
	{
		width: 116px;
		height: auto;
		margin: 0 auto -6px;
		transform-origin: 50% 100%;
		animation: fabi_idle 2.8s ease-in-out infinite;
	}

	.scene_platform
	{
		width: 150px;
		height: auto;
	}

	.scene_duck
	{
		width: 56px;
		height: auto;
		margin-bottom: 10px;
		transform-origin: 50% 100%;
		animation: duck_waddle 0.9s ease-in-out infinite alternate;
	}

	.scene_duck_headphones
	{
		animation-delay: -0.45s;
	}

	.shelf_section .section_inner,
	.footer_layout
	{
		padding: 0 48px;
	}

	.shelf
	{
		grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
	}
}

/* Short phones in portrait: the stage gives up height first, so the play button stays in the first screen. */
@media (max-height: 640px) and (max-width: 959px)
{
	.hero
	{
		padding-top: calc(var(--safe_top) + 58px);
	}

	.hero_logo_image
	{
		width: min(240px, 70vw);
	}

	.hero_line
	{
		font-size: 17px;
		line-height: 22px;
	}
}

@keyframes snack_drift
{
	from
	{
		transform: translate3d(0, -9px, 0) rotate(-9deg);
	}

	to
	{
		transform: translate3d(0, 9px, 0) rotate(8deg);
	}
}

@keyframes bubble_rise
{
	0%
	{
		opacity: 0;
		transform: translate3d(0, 0, 0) scale(0.5);
	}

	12%
	{
		opacity: 0.95;
	}

	50%
	{
		transform: translate3d(12px, -230px, 0) scale(0.9);
	}

	88%
	{
		opacity: 0.85;
	}

	100%
	{
		opacity: 0;
		transform: translate3d(-8px, -460px, 0) scale(1.05);
	}
}

@keyframes bubble_pop
{
	from
	{
		transform: scale(1);
	}

	to
	{
		opacity: 0;
		transform: scale(1.8);
	}
}

@keyframes logo_float
{
	0%,
	100%
	{
		transform: translate3d(0, 0, 0) rotate(-1deg);
	}

	50%
	{
		transform: translate3d(0, -6px, 0) rotate(1deg);
	}
}

@keyframes fabi_idle
{
	0%,
	100%
	{
		transform: translate3d(0, 0, 0) rotate(-1.5deg) scale(1, 1);
	}

	50%
	{
		transform: translate3d(0, 0, 0) rotate(1.5deg) scale(1.02, 0.98);
	}
}

@keyframes fabi_leap
{
	0%
	{
		transform: translate3d(0, 0, 0) scale(1.08, 0.9);
	}

	40%
	{
		transform: translate3d(0, -58px, 0) scale(0.96, 1.05);
	}

	75%
	{
		transform: translate3d(0, 0, 0) scale(1.06, 0.93);
	}

	100%
	{
		transform: translate3d(0, 0, 0) scale(1, 1);
	}
}

/* Right end: the track's right edge 24 px inside the right edge of the window. The turn is the flip in between. */
@keyframes parade_patrol
{
	0%
	{
		transform: translate3d(12px, 0, 0) scaleX(1);
	}

	47%
	{
		transform: translate3d(calc(100vw - 100% - 24px), 0, 0) scaleX(1);
	}

	50%
	{
		transform: translate3d(calc(100vw - 100% - 24px), 0, 0) scaleX(-1);
	}

	97%
	{
		transform: translate3d(12px, 0, 0) scaleX(-1);
	}

	100%
	{
		transform: translate3d(12px, 0, 0) scaleX(1);
	}
}

@keyframes duck_waddle
{
	from
	{
		transform: translate3d(0, 0, 0) rotate(-7deg);
	}

	to
	{
		transform: translate3d(0, -3px, 0) rotate(7deg);
	}
}

@keyframes duck_step
{
	0%
	{
		opacity: 0;
	}

	50%
	{
		opacity: 1;
	}
}

@keyframes duck_hop
{
	0%
	{
		transform: translate3d(0, 0, 0) scale(1.1, 0.9);
	}

	45%
	{
		transform: translate3d(0, -30px, 0) scale(0.95, 1.06);
	}

	100%
	{
		transform: translate3d(0, 0, 0) scale(1, 1);
	}
}

@keyframes heart_float
{
	from
	{
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(0.6);
	}

	to
	{
		opacity: 0;
		transform: translate3d(0, -46px, 0) scale(1.1);
	}
}

@keyframes word_float
{
	from
	{
		opacity: 1;
		transform: translate3d(-50%, 0, 0) scale(0.7);
	}

	to
	{
		opacity: 0;
		transform: translate3d(-50%, -40px, 0) scale(1.1);
	}
}

@keyframes foam_drift
{
	from
	{
		transform: translate3d(0, 0, 0);
	}

	to
	{
		transform: translate3d(-272px, 0, 0);
	}
}

@keyframes foam_drift_back
{
	from
	{
		transform: translate3d(-272px, 0, 0);
	}

	to
	{
		transform: translate3d(0, 0, 0);
	}
}

@keyframes egg_idle
{
	0%,
	78%,
	100%
	{
		transform: rotate(0deg);
	}

	83%
	{
		transform: rotate(-7deg);
	}

	88%
	{
		transform: rotate(6deg);
	}

	93%
	{
		transform: rotate(-3deg);
	}
}

@keyframes egg_wobble
{
	0%,
	100%
	{
		transform: rotate(0deg);
	}

	20%
	{
		transform: rotate(-14deg);
	}

	45%
	{
		transform: rotate(12deg);
	}

	70%
	{
		transform: rotate(-6deg);
	}

	85%
	{
		transform: rotate(3deg);
	}
}

@keyframes lost_duck_walk
{
	from
	{
		transform: translate3d(-90px, 0, 0);
	}

	to
	{
		transform: translate3d(100vw, 0, 0);
	}
}

@keyframes nap_breathe
{
	0%,
	100%
	{
		transform: scale(1, 1);
	}

	50%
	{
		transform: scale(1.03, 0.97);
	}
}

@media (prefers-reduced-motion: reduce)
{
	*,
	*::before,
	*::after
	{
		animation: none !important;
		transition: none !important;
	}

	.hero_snacks,
	.hero_bubbles,
	.hero_logo,
	.phone_tilt,
	.phone_link,
	.foam_layer,
	.parade
	{
		transform: none !important;
	}

	.bubble
	{
		opacity: 0.8;
	}

	.bubble:nth-child(odd)
	{
		transform: translate3d(0, -180px, 0);
	}

	.bubble:nth-child(even)
	{
		transform: translate3d(0, -300px, 0);
	}

	.parade_track
	{
		left: 50%;
		transform: translate3d(-50%, 0, 0);
	}

	.duck_frame_2
	{
		opacity: 0;
	}

	.fabi_body .fabi_jump
	{
		opacity: 0;
	}

	.fabi_body .fabi_stand
	{
		opacity: 1;
	}

	.lost_duck
	{
		left: auto;
		right: 12%;
	}
}
