/*
 * Fabilosa page shell. Palette and interface rules: docs/art-direction.md, section "Interface".
 * The canvas column position comes from Viewport.js as --column_left, --column_top, --column_width and --column_height.
 */

@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. */
@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_35: rgba(59, 42, 74, 0.35);
	--cream: #fff6e6;
	--panel_edge: #e8d5b5;
	--white: #ffffff;
	--duck_yellow: #ffd648;
	--duck_yellow_hover: #ffe27a;
	--duck_shade: #f2b632;
	--heart: #ff5a6e;
	--pink: #ff8fab;
	--green: #6fd08c;
	--blue: #7cc4f0;
	--focus_ring: #2f6fb7;
	--error: #b8303f;
	--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);

	--column_left: 0px;
	--column_top: 0px;
	--column_width: 100vw;
	--column_height: 100vh;
	--column_safe_top: max(var(--column_top), var(--safe_top));
	--column_safe_bottom: max(var(--column_top), var(--safe_bottom));
	--screen_width: min(100vw - 32px, max(var(--column_width) - 32px, 340px), 440px);

	--page_background: #dceaf7;
	--page_pattern: #cfe1f3;
}

:root[data-zone="kitchen_counter"]
{
	--page_background: #f4dfbd;
	--page_pattern: #ecd3a8;
}

:root[data-zone="cupboard"]
{
	--page_background: #b78456;
	--page_pattern: #ad7b4e;
}

:root[data-zone="fridge_top"]
{
	--page_background: #1d2647;
	--page_pattern: #252f55;
}

:root[data-zone="living_room"]
{
	--page_background: #46386a;
	--page_pattern: #4f4076;
}

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

html,
body
{
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
	touch-action: none;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

html
{
	background-color: var(--page_background);
}

body
{
	position: fixed;
	inset: 0;
	font-family: var(--font_family);
	font-weight: 500;
	font-synthesis: none;
	color: var(--plum);
	background-color: var(--page_background);
	background-image: radial-gradient(circle, var(--page_pattern) 0 5px, transparent 6px);
	background-size: 44px 44px;
	transition: background-color 1.2s ease;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
	-webkit-font-smoothing: antialiased;
	cursor: default;
}

[hidden]
{
	display: none !important;
}

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

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

/*
 * clip makes no scroll container, so neither a script nor anything a browser brings into view can leave the page's box
 * scrolled; a browser without clip takes hidden, where nothing overflows: the column's frame stops at the page.
 */
.app
{
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	overflow: clip;
}

/* Game surface and canvas column */

.stage
{
	position: absolute;
	inset: 0;
	touch-action: none;
	transition: opacity 250ms ease;
}

html:not(.is_ready) .stage
{
	opacity: 0;
}

.world_canvas
{
	position: absolute;
	left: var(--column_left);
	top: var(--column_top);
	width: var(--column_width);
	height: var(--column_height);
	display: block;
	background-color: #f7fbff;
	touch-action: none;
}

/*
 * 3 px around the column, cut at the page's edge, so that the frame never reaches beyond the page. Where the column
 * leaves room, the box is the column's widened by 3 px on each side, in the same pixels as without the cut.
 */
.column_frame
{
	position: absolute;
	left: max(0px, var(--column_left) - 3px);
	top: max(0px, var(--column_top) - 3px);
	width: calc(min(100%, var(--column_left) + var(--column_width) + 3px) - max(0px, var(--column_left) - 3px));
	height: calc(min(100%, var(--column_top) + var(--column_height) + 3px) - max(0px, var(--column_top) - 3px));
	background-color: var(--plum);
	box-shadow: 0 0 0 9px var(--plum_20);
}

.loading
{
	position: absolute;
	left: 50%;
	top: 50%;
	display: flex;
	gap: 12px;
	transform: translate(-50%, -50%);
}

.loading span
{
	width: 18px;
	height: 18px;
	border: 3px solid var(--plum);
	border-radius: 50%;
	background-color: var(--duck_yellow);
	animation: loading_bounce 0.9s ease-in-out infinite;
}

.loading span:nth-child(2)
{
	animation-delay: 0.15s;
}

.loading span:nth-child(3)
{
	animation-delay: 0.3s;
}

html.is_ready .loading
{
	display: none;
}

/* The cover of a page that reloads for a new version (public/js/ui/UpdateCover.js): over every layer of the page, the
   foam's bubbles in an SVG of the page's size and the two lines on the calm patch in the middle. It takes every tap
   while it covers the page and none from the start of its lift. A page that starts under it shows no loading dots. */
update-cover
{
	position: fixed;
	inset: 0;
	z-index: 100;
	display: none;
	pointer-events: none;
}

update-cover.is_shown
{
	display: block;
	pointer-events: auto;
	touch-action: none;
}

update-cover.is_lifting
{
	pointer-events: none;
}

html.update_cover_on .loading
{
	visibility: hidden;
}

.update_foam
{
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.update_bubble_body
{
	transform-box: fill-box;
	transform-origin: center;
}

.update_lines
{
	position: absolute;
	left: 50%;
	top: 50%;
	box-sizing: border-box;
	width: calc(var(--patch_radius) * 1.7);
	transform: translate(-50%, -50%);
	color: var(--plum);
	font-family: var(--font_family);
	text-align: center;
	pointer-events: none;
}

.update_title
{
	margin: 0;
	font-size: clamp(24px, calc(var(--patch_radius) * 0.22), 34px);
	font-weight: 700;
	line-height: 1.15;
}

.update_version
{
	margin: 6px 0 0;
	font-size: clamp(17px, calc(var(--patch_radius) * 0.13), 22px);
	font-weight: 500;
	line-height: 1.2;
}

/* Layers over the column */

.hud_layer,
.screen_layer
{
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.screen
{
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: calc(var(--column_safe_top) + 16px) calc(var(--safe_right) + 16px) calc(var(--column_safe_bottom) + 16px) calc(var(--safe_left) + 16px);
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.screen.is_visible
{
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transition: opacity 180ms ease, visibility 0s linear 0s;
}

.screen .panel
{
	transform: translateY(14px) scale(0.96);
	transition: transform 280ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.screen.is_visible .panel
{
	transform: none;
}

/* Shared components */

.icon
{
	display: inline-block;
	flex: none;
	width: 24px;
	height: 24px;
}

.icon svg
{
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

.panel
{
	position: relative;
	width: var(--screen_width);
	max-height: 100%;
	padding: 24px 20px 20px;
	color: var(--plum);
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 20px;
	box-shadow: 0 8px 0 var(--plum_20);
}

.panel_heading
{
	font-size: 28px;
	font-weight: 700;
	line-height: 34px;
	text-align: center;
}

.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;
	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 32px;
	font-size: 25px;
	line-height: 30px;
}

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

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

/* In a button the icon's box takes its width from the icon's view box at the icon's height. The icons that buttons show
   begin their view box where their drawing begins (icons.js), so that the button centres what it shows. */
.button .icon.button_icon
{
	width: auto;
}

.button .icon.button_icon svg
{
	width: auto;
}

.icon_button
{
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 0 5px;
	padding: 0;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-shadow: 0 5px 0 var(--plum);
	cursor: pointer;
	transition: transform 70ms ease-out, box-shadow 70ms ease-out, background-color 150ms ease;
}

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

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

.button:focus-visible,
.icon_button:focus-visible,
.toggle_row:focus-visible,
.segment:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 4px;
}

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

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

/* Title */

.title_screen
{
	justify-content: space-between;
	gap: 16px;
	background-color: rgba(255, 246, 230, 0.38);
}

.settings_button
{
	position: absolute;
	top: calc(var(--column_safe_top) + 12px);
	right: max(calc(var(--column_left) + 12px), calc(var(--safe_right) + 12px));
}

/* At least 54 px above the brand's column, so that the logo starts below the corner buttons. */
.title_header
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	margin-top: clamp(54px, 9vh, 96px);
}

.logo
{
	position: relative;
	font-size: clamp(52px, calc(var(--column_width) * 0.17), 84px);
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
	padding: 0.18em 0.14em 0.2em;
}

/* On narrow and on short phones the lockup starts right below the corner buttons, at the margin's least value. */
@media (orientation: portrait) and (max-width: 360px), (orientation: portrait) and (max-height: 700px)
{
	.title_screen .title_header
	{
		margin-top: 54px;
	}
}

/* The game's version on the title: small text between the corner buttons, not a button. */
.title_version
{
	position: absolute;
	top: calc(var(--column_safe_top) + 24px);
	left: 50%;
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 1px 8px;
	font-size: 12px;
	line-height: 18px;
	color: #6a5878;
	white-space: nowrap;
	background-color: var(--cream);
	border: 2px solid var(--panel_edge);
	border-radius: 999px;
	transform: translateX(-50%);
	pointer-events: none;
}

/* With the tag the pill hugs it on the right. */
.title_version.has_tag
{
	padding-right: 3px;
}

.title_version[hidden],
.title_version_tag[hidden]
{
	display: none;
}

.title_version_tag
{
	padding: 0 6px;
	font-size: 11px;
	font-weight: 700;
	color: var(--plum);
	background-color: #ffd6e2;
	border-radius: 999px;
}

/* "How to play" from the title: the top left corner, across from the settings gear. */
.how_button
{
	position: absolute;
	top: calc(var(--column_safe_top) + 12px);
	left: max(calc(var(--column_left) + 12px), calc(var(--safe_left) + 12px));
}

/* The game's name under the brand: part of the lockup, in the brand's plum with a white rim. */
.game_name
{
	margin-top: -16px;
	padding: 0 12px;
	color: var(--plum);
	font-size: clamp(24px, calc(var(--column_width) * 0.075), 34px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.03em;
	white-space: nowrap;
	text-shadow: 0 2px 0 #ffffff, 2px 0 0 #ffffff, -2px 0 0 #ffffff, 0 -2px 0 #ffffff, 0 4px 0 var(--plum_20);
	transform: rotate(-3deg);
}

.logo_layer
{
	display: flex;
	justify-content: center;
	white-space: nowrap;
}

.logo_fill
{
	position: absolute;
	inset: 0.18em 0.14em 0.2em;
	color: var(--duck_yellow);
}

.logo_outline
{
	color: var(--plum);
	-webkit-text-stroke: 0.17em var(--plum);
	text-shadow: 0 0.09em 0 var(--plum);
}

.logo_letter
{
	position: relative;
	display: inline-block;
	transform: rotate(var(--tilt));
	animation: logo_bob 3.2s ease-in-out var(--delay) infinite;
}

.logo_heart
{
	position: absolute;
	left: 50%;
	top: -0.02em;
	width: 0.42em;
	height: 0.42em;
	transform: translateX(-50%) rotate(10deg);
}

.logo_outline .logo_heart path
{
	stroke-width: 9;
}

.tagline,
.best_line
{
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 16px;
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 4px 0 var(--plum_20);
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
}

.title_actions
{
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	width: min(var(--screen_width), 360px);
}

.title_actions .button
{
	width: 100%;
}

.best_line
{
	align-self: center;
	max-width: 100%;
	margin-top: 4px;
	padding-left: 10px;
}

/* Under the daily button: today's duck and how many played today's tower. The cream ground keeps it legible over the
   world behind the title. */
.tower_line
{
	display: flex;
	align-items: center;
	gap: 6px;
	align-self: center;
	justify-self: center;
	margin-top: -4px;
	padding: 2px 10px;
	font-size: 13px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
	color: var(--plum);
	background-color: var(--cream);
	border-radius: 12px;
}

/* The tower duck of the day beside the line, with a small check when the player has it. */
.tower_duck_box
{
	position: relative;
	flex: none;
	width: 24px;
	height: 24px;
}

.tower_duck_box[hidden]
{
	display: none;
}

.tower_duck
{
	display: block;
	width: 24px;
	height: 24px;
}

.tower_duck_check
{
	position: absolute;
	right: -5px;
	bottom: -3px;
	width: 14px;
	height: 14px;
}

/* At 340 px and less the line keeps one line in Spanish and Portuguese with the longest duck names and up to 999
   players. */
@media (max-width: 340px)
{
	.tower_line
	{
		gap: 4px;
		padding: 2px 6px;
	}
}

.best_icon
{
	width: 24px;
	height: 24px;
}

.best_text
{
	min-width: 0;
}

/* Last week's champion: the name and the rest of the sentence after it stay on one line, and a long name is cut with
   an ellipsis, so that the line takes at most two lines and the score stays whole. */
.best_who
{
	display: inline-flex;
	max-width: 100%;
	white-space: nowrap;
	vertical-align: top;
}

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

/* Tutorial */

.tutorial_overlay,
.tutorial_overlay.is_visible
{
	justify-content: flex-start;
	padding-top: calc(var(--column_safe_top) + 120px);
	pointer-events: none;
}

.tutorial_card
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: min(var(--screen_width), 340px);
	padding: 18px 20px 20px;
	text-align: center;
}

.tutorial_icon
{
	width: 60px;
	height: 60px;
	animation: tap_pulse 1.2s ease-in-out infinite;
}

.tutorial_jump
{
	font-size: 26px;
	font-weight: 700;
	line-height: 32px;
}

.tutorial_air_jump
{
	font-size: 18px;
	line-height: 24px;
}

.tutorial_keys
{
	display: none;
	margin-top: 4px;
	font-size: 15px;
	line-height: 20px;
	opacity: 0.75;
}

@media (hover: hover) and (pointer: fine)
{
	.tutorial_keys
	{
		display: block;
	}
}

/* HUD */

.hud
{
	position: absolute;
	left: 50%;
	top: calc(var(--column_safe_top) + 8px);
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: start;
	gap: 8px;
	width: min(100% - 16px, max(var(--column_width) - 16px, 344px));
	transform: translateX(-50%);
	opacity: 0;
	visibility: hidden;
	transition: opacity 200ms ease, visibility 0s linear 200ms;
}

.hud.is_visible
{
	opacity: 1;
	visibility: visible;
	transition: opacity 200ms ease, visibility 0s linear 0s;
}

.hud_side
{
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.hud_side_left
{
	position: relative;
	justify-content: space-between;
}

/* Her blaster's darts left: a small tag that hangs under the hearts while she holds it, inside the band the display
   covers, as the multiplier hangs under the duckling count. */
.hud_blaster
{
	position: absolute;
	top: 34px;
	right: 2px;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 0 7px 0 3px;
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	background-color: var(--cream);
	border: 2.5px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 2px 0 var(--plum_20);
}

.hud_blaster[hidden]
{
	display: none;
}

.hud_blaster_icon
{
	width: 20px;
	height: 20px;
}

/* An empty drum she has not put away yet. */
.hud_blaster.is_empty .hud_blaster_icon
{
	opacity: 0.4;
}

/* She gets her blaster, or a second one fills it up again. */
.hud_blaster.is_new
{
	animation: pop_in 400ms cubic-bezier(0.2, 1.6, 0.4, 1);
}

.hud_pause
{
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -2px 0 0 -4px;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	pointer-events: auto;
}

.hud_pause_circle
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background-color: rgba(255, 246, 230, 0.85);
	border: 2.5px solid var(--plum);
	border-radius: 50%;
	transition: transform 70ms ease-out;
}

.hud_pause:active .hud_pause_circle
{
	transform: scale(0.9);
}

.hud_pause:focus-visible
{
	outline: none;
}

.hud_pause:focus-visible .hud_pause_circle
{
	outline: 3px solid var(--focus_ring);
	outline-offset: 2px;
}

.hud_pause_icon
{
	width: 22px;
	height: 22px;
}

.hud_hearts_count
{
	display: none;
	min-width: 1ch;
	font-size: 18px;
	line-height: 22px;
	font-variant-numeric: tabular-nums;
}

.hud_side_right
{
	justify-content: flex-start;
}

.hud_chip
{
	display: inline-flex;
	align-items: center;
	gap: 3px;
	height: 40px;
	padding: 0 9px;
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 4px 0 var(--plum_20);
	font-weight: 700;
	white-space: nowrap;
}

.hud_heart
{
	width: 21px;
	height: 21px;
}

.hud_heart.is_new
{
	animation: pop_in 400ms cubic-bezier(0.2, 1.6, 0.4, 1);
}

.hud_centre
{
	flex-direction: column;
	gap: 0;
	min-width: 116px;
	height: auto;
	padding: 4px 14px 6px;
	border-radius: 22px;
}

.hud_height
{
	display: flex;
	align-items: baseline;
	gap: 3px;
	line-height: 34px;
}

.hud_height_value
{
	font-size: 32px;
	font-variant-numeric: tabular-nums;
}

.hud_height_unit
{
	font-size: 16px;
}

.hud_score
{
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 16px;
	line-height: 20px;
	font-variant-numeric: tabular-nums;
}

.hud_score_icon
{
	width: 18px;
	height: 18px;
}

.hud_multiplier
{
	margin-left: 2px;
	padding: 0 5px;
	font-size: 13px;
	line-height: 18px;
	background-color: var(--panel_edge);
	border-radius: 999px;
}

/* The HUD's row takes its form from its room (`Hud.room()`): the width its chips may take, the page's width on a page up
   to 440 px wide and in the stream layout, otherwise the column's, at least 360 px. The row carries the mark
   `room_below_<px>` of each room it lies below, so that a row over a column as wide as a phone looks as on that
   phone. */

/* In a room below 563 px, where the hearts show as one heart and a count, the HUD has no width to spare: a side whose
   chips do not fit its half takes their width from the other side's half. The row's sides share what the centre chip
   leaves, as long as each side's chips fit its half, the right side's chips with the HUD's margin beside them
   (.hud_side_right); a row wider than the HUD's box reaches into the margin on the left, where the pause button's
   circle stays inside the room. The centre chip keeps the width of its text. */
.hud.room_below_563
{
	grid-template-columns: minmax(max-content, 1fr) max-content minmax(max-content, 1fr);
	justify-content: end;
}

/* The right side's chips may reach into the HUD's margin, up to the room's edge, before the row moves to make room for
   them: 8 px where the HUD is 16 px narrower than its room; on a phone's page more where the column, and with it the
   HUD, is narrower than the page. */
.hud.room_below_563 .hud_side_right
{
	margin-right: calc((min(100vw - 16px, max(var(--column_width) - 16px, 344px)) - var(--hud_room)) / 2);
}

/* The stream layout's HUD in its frame: two halves of equal width, as the broadcast shows it. */
.stream_mode .hud.room_below_563
{
	grid-template-columns: 1fr auto 1fr;
	justify-content: normal;
}

.stream_mode .hud.room_below_563 .hud_side_right
{
	margin-right: 0;
}

/* In a room below 457 px, where a height of 6 digits does not fit beside the multiplier in its chip's row, the
   multiplier hangs under the duckling count as a small tag. */
.hud.room_below_457 .hud_ducklings
{
	position: relative;
}

.hud.room_below_457 .hud_ducklings .hud_multiplier
{
	position: absolute;
	left: 50%;
	bottom: -12px;
	margin-left: 0;
	padding: 0 4px;
	font-size: 12px;
	line-height: 15px;
	border: 2px solid var(--plum);
	transform: translateX(-50%);
}

/* A duckling joins: the chip that holds the count and the multiplier pulses once. */
.hud_steps
{
	display: none;
}

.stream_mode .hud_steps:not([hidden])
{
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	font-size: 15px;
	line-height: 20px;
	font-variant-numeric: tabular-nums;
}

.hud_steps_icon
{
	width: 18px;
	height: 18px;
}

.hud_ducklings.is_pulsing
{
	animation: duckling_pulse 0.45s ease-out;
}

@keyframes duckling_pulse
{
	0%
	{
		transform: scale(1);
	}

	40%
	{
		transform: scale(1.18);
	}

	100%
	{
		transform: scale(1);
	}
}

.hud_heart.is_empty
{
	opacity: 0.45;
	filter: grayscale(1);
}

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

.hud_duckling_icon
{
	width: 27px;
	height: 27px;
}

.hud_ducklings_value
{
	min-width: 1ch;
	font-size: 18px;
	line-height: 22px;
	font-variant-numeric: tabular-nums;
}

.hud_rescue
{
	padding: 0 4px;
}

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

.hud_rescue[data-rescue="used"] .hud_rescue_icon
{
	opacity: 0.35;
	filter: grayscale(1);
}

.hud_rescue[data-rescue="active"]
{
	background-color: var(--pink);
	animation: rescue_pulse 0.7s ease-in-out infinite;
}

/* In a room below 563 px and in the stream layout the hearts show as one heart and a count, so that the pause button
   fits on the left. */
.hud.room_below_563 .hud_hearts .hud_heart ~ .hud_heart
{
	display: none;
}

.hud.room_below_563 .hud_hearts .hud_hearts_count
{
	display: inline;
}

.stream_mode .hud_hearts .hud_heart ~ .hud_heart
{
	display: none;
}

.stream_mode .hud_hearts .hud_hearts_count
{
	display: inline;
}

/* In a room below 421 px the HUD, 16 px narrower than its room, fits 5 hearts, a height of 5 digits, 2 digits of
   ducklings with the multiplier and the rescue duck with these smaller chips. */
.hud.room_below_421
{
	gap: 5px;
}

.hud.room_below_421 .hud_side
{
	gap: 4px;
}

.hud.room_below_421 .hud_chip
{
	padding: 0 6px;
}

.hud.room_below_421 .hud_centre
{
	min-width: 100px;
	padding: 3px 10px 5px;
}

.hud.room_below_421 .hud_height_value
{
	font-size: 29px;
}

.hud.room_below_421 .hud_heart
{
	width: 19px;
	height: 19px;
}

.hud.room_below_421 .hud_hearts
{
	gap: 1px;
}

.hud.room_below_421 .hud_hearts[data-count="5"] .hud_heart
{
	width: 16px;
	height: 16px;
}

.hud.room_below_421 .hud_hearts[data-count="4"] .hud_heart
{
	width: 18px;
	height: 18px;
}

.hud.room_below_421 .hud_duckling_icon
{
	width: 24px;
	height: 24px;
}

.hud.room_below_421 .hud_rescue_icon
{
	width: 26px;
	height: 26px;
}

/* In a room below 356 px, a phone's page: the HUD 4 px narrower than the page, tighter chips, a smaller height and
   smaller ducks, so that a height of 5 digits leaves the rescue duck inside the page. */
.hud.room_below_356
{
	gap: 3px;
	width: calc(100% - 4px);
}

.hud.room_below_356 .hud_side
{
	gap: 3px;
}

.hud.room_below_356 .hud_side_right
{
	margin-right: -2px;
}

.hud.room_below_356 .hud_chip
{
	padding-left: 5px;
	padding-right: 5px;
}

.hud.room_below_356 .hud_height_value
{
	font-size: 27px;
}

.hud.room_below_356 .hud_duckling_icon
{
	width: 21px;
	height: 21px;
}

.hud.room_below_356 .hud_rescue_icon
{
	width: 22px;
	height: 22px;
}

/* A height of 6 digits, from 1,000 m, in a room below 390 px: a smaller height and tighter chips and gaps keep the row
   inside its room (Hud.long_height()). */
.hud.room_below_390.has_long_height
{
	gap: 3px;
}

.hud.room_below_390.has_long_height .hud_side
{
	gap: 3px;
}

.hud.room_below_390.has_long_height .hud_chip
{
	padding-left: 4px;
	padding-right: 4px;
}

.hud.room_below_390.has_long_height .hud_height_value
{
	font-size: 25px;
}

/* In a room below 341 px, the smallest phones' pages, 320 px wide: the HUD's centre chip without room above and below
   its two lines. */
.hud.room_below_341 .hud_centre
{
	padding-top: 0;
	padding-bottom: 0;
}

/* The smallest phones, 320 px wide: stat values may wrap before the unit, stat labels are smaller, and a pinned row of
   the boards puts its name on a line of its own. */
@media (max-width: 340px)
{
	.stats .stat_value
	{
		white-space: normal;
	}

	.stats .stat_label
	{
		font-size: 11px;
		letter-spacing: -0.2px;
	}

	.board_pinned .board_row
	{
		grid-template-areas: "name name name" "rank height score";
	}
}

/* Milestone banner */

.banner_layer
{
	position: absolute;
	left: 0;
	right: 0;
	top: calc(var(--column_safe_top) + 90px);
	display: flex;
	justify-content: center;
	pointer-events: none;
}

.banner
{
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: var(--screen_width);
	padding: 6px 20px 8px;
	text-align: center;
	background-color: var(--duck_yellow);
	border: 3px solid var(--plum);
	border-radius: 18px;
	box-shadow: 0 5px 0 var(--plum_20);
	opacity: 0;
	transform: translateY(-10px) scale(0.9);
	transition: opacity 220ms ease, transform 280ms cubic-bezier(0.2, 1.5, 0.4, 1);
}

.banner.is_visible
{
	opacity: 1;
	transform: none;
}

.banner[data-kind="zone"]
{
	background-color: var(--cream);
}

.banner_title
{
	font-size: 24px;
	font-weight: 700;
	line-height: 30px;
}

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

/* Pause */

.pause_overlay
{
	background-color: var(--plum_35);
	cursor: pointer;
}

.pause_card
{
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	width: min(var(--screen_width), 340px);
	padding: 22px 20px 16px;
	text-align: center;
	cursor: default;
}

.pause_heading
{
	font-size: 30px;
	font-weight: 700;
	line-height: 36px;
}

.pause_hint
{
	margin-top: -8px;
	font-size: 15px;
	line-height: 20px;
	opacity: 0.8;
}

.pause_toggles
{
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pause_card .button
{
	width: 100%;
}

/* Game over */

.game_over_screen
{
	background-color: rgba(59, 42, 74, 0.16);
}

.game_over_panel
{
	display: flex;
	flex-direction: column;
	padding: 0;
	text-align: center;
}

.game_over_body
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	min-height: 0;
	max-height: 100%;
	padding: 30px 20px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	border-radius: 17px;
}

.bath_portrait
{
	flex: none;
	width: min(300px, 100%);
	height: 150px;
	margin: -12px auto -4px;
}

.bath_portrait_canvas
{
	display: block;
	width: 100%;
	height: 100%;
}

.new_best_badge
{
	position: absolute;
	top: 0;
	left: 50%;
	padding: 4px 18px;
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
	white-space: nowrap;
	background-color: var(--pink);
	border: 3px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 4px 0 var(--plum);
	transform: translate(-50%, -60%) rotate(-3deg);
}

.has_new_best .new_best_badge
{
	animation: badge_pop 600ms cubic-bezier(0.2, 1.6, 0.4, 1) 120ms both;
}

.game_over_heading
{
	font-size: 27px;
	font-weight: 700;
	line-height: 32px;
}

.game_over_praise
{
	margin-top: -8px;
	font-size: 18px;
	line-height: 24px;
}

/* The score, and her steps beside it when the run counted them: two figures on one row, wrapping when narrow. */
.score_block
{
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: center;
	gap: 0 22px;
}

.score_figure,
.steps_figure
{
	display: flex;
	flex-direction: column;
	align-items: center;
}

.steps_figure[hidden]
{
	display: none;
}

.steps_label
{
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.steps_icon
{
	width: 20px;
	height: 20px;
}

.steps_value
{
	padding: 0 12px;
	color: var(--plum);
	font-size: 36px;
	font-weight: 700;
	line-height: 44px;
	font-variant-numeric: tabular-nums;
	background-color: #ffe4ec;
	border: 3px solid var(--plum);
	border-radius: 14px;
	transform: rotate(-3deg);
}

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

.score_value
{
	font-size: 54px;
	font-weight: 700;
	line-height: 58px;
	font-variant-numeric: tabular-nums;
}

.score_value.is_long
{
	font-size: 40px;
}

.stats
{
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	width: 100%;
}

.stat
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 0;
	padding: 8px 4px 6px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 16px;
}

.stat_icon
{
	width: 28px;
	height: 28px;
}

.stat_value
{
	font-size: 20px;
	font-weight: 700;
	line-height: 24px;
	white-space: nowrap;
}

.stat_label
{
	max-width: 100%;
	overflow: hidden;
	font-size: 13px;
	line-height: 18px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.game_over_best,
.game_over_blocks
{
	font-size: 16px;
	line-height: 22px;
}

/* The best and the blocked count share a row while they fit, so the count costs no height. */
.game_over_lines
{
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 14px;
}

.game_over_praise.is_near_miss
{
	font-weight: 700;
}

.rank_slot:empty
{
	display: none;
}

.game_over_actions
{
	container: game_over_actions / inline-size;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
	margin-top: 2px;
}

.game_over_actions .button
{
	width: 100%;
}

/* "Home" and "Share" share a row, half each while both fit, and the longer label gets the wider button. The content
   stands in the middle of each button, 6 px from its border at the least, so that both keep their icons in every row
   from 250 px, as at 320 px; in a portrait column up to 256 px wide the Spanish labels, the longest, stand 6 px from
   their icons. On a phone on its side the row takes the width its buttons need beside "Play again". */
.game_over_secondary
{
	display: grid;
	grid-template-columns: repeat(2, minmax(min-content, 1fr));
	gap: 10px;
}

.game_over_secondary .button
{
	padding-right: 6px;
	padding-left: 6px;
}

@container game_over_actions (max-width: 256px)
{
	.game_over_secondary .button:lang(es)
	{
		gap: 6px;
	}
}

/* Room above the panel for the tilted badge, which sticks out over its top edge. */
.game_over_screen.has_new_best
{
	padding-top: calc(var(--column_safe_top) + 34px);
}

.share_status
{
	font-size: 14px;
	line-height: 19px;
}

/* The streak's line after a daily run: the last seven days as a row of ducklings beside the days in a row, the day to
   come back for, and the next reward or the reward the run reached. The first-time tip shows above it, over the panel,
   and moves nothing. */
.streak_box
{
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	width: 100%;
	padding: 8px 10px 10px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 18px;
}

.streak_box[hidden]
{
	display: none;
}

.streak_top
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 2px 8px;
}

.streak_row
{
	display: flex;
	gap: 2px;
}

.streak_place
{
	position: relative;
	display: block;
	flex: none;
	width: 26px;
	height: 26px;
}

.streak_place.is_empty::before
{
	content: "";
	position: absolute;
	inset: 25%;
	border: 2px solid var(--plum_20);
	border-radius: 50%;
}

.streak_duck
{
	display: block;
	width: 100%;
	height: 100%;
}

.streak_sleep
{
	position: absolute;
	top: -7px;
	right: -3px;
	font-size: 14px;
	font-weight: 700;
	line-height: 14px;
	color: #6a5878;
}

.streak_count
{
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
}

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

.streak_reward
{
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 2px;
	padding: 1px 12px 1px 6px;
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	background-color: #fff3b0;
	border: 2px solid var(--plum);
	border-radius: 999px;
}

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

.streak_star
{
	width: 18px;
	height: 18px;
}

.streak_box .streak_tip_layer
{
	top: auto;
	bottom: calc(100% + 6px);
	z-index: 2;
}

.streak_box .streak_tip_layer .hint_tip
{
	max-width: 100%;
}

/* The streak's flame and its moment. The flame stands before the days in a row in a slot as tall as a place of the row;
   its drawing (public/js/ui/streak_flame.js) reaches a little beyond the slot and flickers while the panel is open. The
   moment (GameOverScreen.js) first shows the state before the new day (.is_due): the day's place empty, the count of
   the day before, no small flame. Then (.is_moment) the day's duckling hops in from 0 to 0.5 s with a small burst as it
   lands; at 0.4 s the big flame pops up on the box's top edge with a burst of sparks, holds, flickering, its number
   pulsing once at 1 s, and from 1.55 s shrinks and flies into the small flame's place, where the small flame lights at
   1.95 s; the count goes to the new one from 1.55 to 2.03 s, and the reward's line of a day that pays stars pops from
   1.92 to 2.3 s. On a first day the big flame's course is 0.3 s shorter (.is_first_day). GameOverScreen.js asks for the
   sound at 0.4 s, sets the big flame's place and size to the room around the box and its flight to the small flame
   (--big_drop, --big_fit, --fly_x, --fly_y, --fly_scale), and ends the moment at 2.3 s. Only transforms and opacity
   change, and the big flame is no part of the layout, so every part keeps its place and size. With reduced motion the
   state before the new day is not shown, the big flame fades in, stands and fades out without growing or flying, and
   nothing else moves. */
.streak_box
{
	--big_length: 1.55s;
	--swap: 1.55s;
	--land: 1.95s;
}

.streak_box.is_first_day
{
	--big_length: 1.25s;
	--swap: 1.25s;
	--land: 1.65s;
}

.streak_count_line
{
	display: flex;
	align-items: center;
	gap: 3px;
}

.streak_flame
{
	position: relative;
	flex: none;
	width: 20px;
	height: 26px;
}

.streak_flame_art
{
	position: absolute;
	left: -14%;
	bottom: -8%;
	width: 128%;
	height: 123%;
	overflow: visible;
	pointer-events: none;
}

.streak_flame_art .flame_flicker
{
	transform-box: view-box;
	transform-origin: 16px 37px;
	animation: streak_flicker 1.6s ease-in-out infinite;
}

.streak_flame_art .flame_sparkle
{
	transform-box: fill-box;
	transform-origin: center;
	animation: streak_twinkle 1.4s ease-in-out infinite;
}

.streak_flame_art .flame_sparkle:nth-child(3)
{
	animation-delay: -0.35s;
}

.streak_flame_art .flame_sparkle:nth-child(4)
{
	animation-delay: -0.7s;
}

.streak_count_box
{
	position: relative;
}

.streak_count_before
{
	position: absolute;
	inset: 0;
	display: flex;
	justify-content: center;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
}

.streak_burst
{
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0;
	height: 0;
	pointer-events: none;
}

.streak_burst_piece
{
	position: absolute;
	left: -3px;
	top: -3px;
	width: 6px;
	height: 6px;
	border: 1.5px solid var(--plum);
	border-radius: 50%;
	opacity: 0;
}

:root:not(.reduced_motion) .streak_box.is_due .streak_place:last-child > .streak_duck,
:root:not(.reduced_motion) .streak_box.is_due .streak_count:not(.streak_count_before),
:root:not(.reduced_motion) .streak_box.is_due .streak_flame_art
{
	opacity: 0;
}

:root:not(.reduced_motion) .streak_box.is_due .streak_count_before
{
	opacity: 1;
}

:root:not(.reduced_motion) .streak_box.is_due .streak_place:last-child::before,
.streak_box.is_moment .streak_place:last-child::before
{
	content: "";
	position: absolute;
	inset: 25%;
	border: 2px solid var(--plum_20);
	border-radius: 50%;
}

.streak_box.is_moment .streak_place:last-child::before
{
	opacity: 0;
	animation: streak_ring_out 160ms ease-in 280ms both;
}

.streak_box.is_moment .streak_place:last-child > .streak_duck
{
	transform-origin: 50% 100%;
	animation: streak_hop 500ms linear both;
}

.streak_box.is_moment .streak_burst_piece
{
	animation: streak_burst 460ms cubic-bezier(0.2, 0.8, 0.3, 1) 340ms both;
}

.streak_box.is_moment .streak_count_before
{
	animation: streak_count_out 140ms ease-in var(--swap) both;
}

.streak_box.is_moment .streak_count:not(.streak_count_before)
{
	animation: streak_count_in 360ms ease-out calc(var(--swap) + 0.12s) both;
}

.streak_box.is_moment .streak_flame_art
{
	transform-origin: 50% 92%;
	animation: streak_flame_light 320ms ease-out calc(var(--land) - 0.03s) both;
}

.streak_box.is_moment .streak_reward.is_paid
{
	animation: streak_reward_pop 380ms ease-out calc(var(--land) - 0.03s) both;
}

/* The big flame: an overlay on the streak box's top edge, or lower in the box when the room above is short
   (--big_drop), no part of the layout, under the first-time tip. */
.streak_big_flame
{
	--big_drop: 0px;
	--big_fit: 1;
	position: absolute;
	left: 27%;
	bottom: calc(100% - 6px);
	z-index: 1;
	width: 46%;
	opacity: 0;
	pointer-events: none;
	transform-origin: 50% 100%;
}

.streak_big_flame_art
{
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.big_flame_count
{
	font-family: var(--font_family);
	font-size: 15px;
	font-weight: 700;
	fill: var(--plum);
	stroke: var(--cream);
	stroke-width: 1.6px;
	stroke-linejoin: round;
	paint-order: stroke;
	transform-box: fill-box;
	transform-origin: center;
}

.big_flame_count.is_digits_2
{
	font-size: 12.5px;
}

.big_flame_count.is_digits_3
{
	font-size: 10px;
}

.big_flame_count.is_digits_4
{
	font-size: 8px;
}

.big_spark
{
	opacity: 0;
	transform-box: fill-box;
	transform-origin: center;
}

.streak_box:not(.is_growth) .big_spark_extra
{
	display: none;
}

.big_ring
{
	opacity: 0;
	transform-box: view-box;
}

.big_sparkles
{
	transform-box: view-box;
}

.streak_box.is_moment .streak_big_flame
{
	animation: streak_big_flame var(--big_length) linear 0.4s both;
}

.streak_box.is_moment .streak_big_flame_art .flame_flicker
{
	transform-box: view-box;
	transform-origin: 20px 46px;
	animation: streak_flicker 1.1s ease-in-out infinite;
}

.streak_box.is_moment .big_spark
{
	animation: big_spark 650ms cubic-bezier(0.2, 0.8, 0.3, 1) 0.42s both;
}

.streak_box.is_moment .big_ring
{
	animation: big_ring 700ms ease-out 0.45s both;
}

.streak_box.is_moment .big_sparkles
{
	animation: big_circle 2.4s linear infinite;
}

.streak_box.is_moment .big_flame_count
{
	animation: big_count_pulse 380ms ease-out 1s both;
}

.reduced_motion .streak_box.is_moment .streak_big_flame
{
	animation: streak_big_flame_still 1.4s linear 0.4s both !important;
}

@keyframes streak_big_flame
{
	0%
	{
		opacity: 0;
		transform: translate(0px, var(--big_drop)) scale(calc(var(--big_fit) * 0.15));
	}

	6%
	{
		opacity: 1;
	}

	20%
	{
		transform: translate(0px, var(--big_drop)) scale(calc(var(--big_fit) * 1.1));
	}

	30%
	{
		transform: translate(0px, var(--big_drop)) scale(var(--big_fit));
	}

	74%
	{
		transform: translate(0px, var(--big_drop)) scale(var(--big_fit));
		animation-timing-function: cubic-bezier(0.5, 0, 0.7, 0.8);
	}

	97%
	{
		opacity: 1;
		transform: translate(var(--fly_x), var(--fly_y)) scale(var(--fly_scale));
	}

	100%
	{
		opacity: 0;
		transform: translate(var(--fly_x), var(--fly_y)) scale(var(--fly_scale));
	}
}

@keyframes streak_big_flame_still
{
	0%
	{
		opacity: 0;
		transform: translate(0px, var(--big_drop)) scale(var(--big_fit));
	}

	15%,
	85%
	{
		opacity: 1;
	}

	100%
	{
		opacity: 0;
		transform: translate(0px, var(--big_drop)) scale(var(--big_fit));
	}
}

@keyframes big_spark
{
	0%
	{
		opacity: 1;
		transform: translate(0px, 0px) scale(0.3);
	}

	70%
	{
		opacity: 1;
	}

	100%
	{
		opacity: 0;
		transform: translate(var(--spark_x), var(--spark_y)) scale(1);
	}
}

@keyframes big_ring
{
	0%
	{
		opacity: 1;
		transform: scale(0.25);
	}

	70%
	{
		opacity: 1;
	}

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

@keyframes big_circle
{
	from
	{
		transform: rotate(0deg);
	}

	to
	{
		transform: rotate(360deg);
	}
}

@keyframes big_count_pulse
{
	0%,
	100%
	{
		transform: none;
	}

	45%
	{
		transform: scale(1.22);
	}
}

@keyframes streak_hop
{
	0%
	{
		opacity: 0;
		transform: translate(70%, -4%) scale(0.5);
		animation-timing-function: cubic-bezier(0.3, 0.6, 0.5, 1);
	}

	15%
	{
		opacity: 1;
	}

	42%
	{
		transform: translate(36%, -36%) scale(1);
		animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.6);
	}

	72%
	{
		transform: translate(0, 0) scale(1.18, 0.8);
		animation-timing-function: ease-out;
	}

	86%
	{
		transform: translate(0, -3px) scale(0.94, 1.08);
	}

	100%
	{
		opacity: 1;
		transform: none;
	}
}

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

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

@keyframes streak_burst
{
	0%
	{
		opacity: 1;
		transform: translate(0, 0) scale(0.4);
	}

	70%
	{
		opacity: 1;
	}

	100%
	{
		opacity: 0;
		transform: translate(var(--burst_x), var(--burst_y)) scale(1);
	}
}

@keyframes streak_count_out
{
	from
	{
		opacity: 1;
		transform: none;
	}

	to
	{
		opacity: 0;
		transform: translateY(-20%) scale(0.6);
	}
}

@keyframes streak_count_in
{
	0%
	{
		opacity: 0;
		transform: scale(0.4);
	}

	55%
	{
		opacity: 1;
		transform: scale(1.2);
	}

	100%
	{
		opacity: 1;
		transform: none;
	}
}

@keyframes streak_flame_light
{
	0%
	{
		opacity: 0;
		transform: scale(0.7);
	}

	30%
	{
		opacity: 1;
	}

	50%
	{
		transform: scale(1.25);
	}

	100%
	{
		opacity: 1;
		transform: none;
	}
}

@keyframes streak_reward_pop
{
	0%
	{
		transform: none;
	}

	40%
	{
		transform: scale(1.16) rotate(-2deg);
	}

	70%
	{
		transform: scale(0.97);
	}

	100%
	{
		transform: none;
	}
}

@keyframes streak_flicker
{
	0%,
	100%
	{
		transform: none;
	}

	25%
	{
		transform: scale(1.03, 0.97) skewX(-2deg);
	}

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

	75%
	{
		transform: scale(1.02, 0.98) skewX(2deg);
	}
}

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

	50%
	{
		transform: scale(0.65) rotate(20deg);
	}
}

/* The title's daily button: the streak's flame stands in the check's slot (.daily_streak_check, 16 px square), as an
   outline in the line's colour while the streak waits for today's run, lit once it is played. */
.daily_streak_flame
{
	position: relative;
}

.daily_streak_flame .streak_flame_art.is_unlit
{
	opacity: 0.75;
}

/* On short portrait screens the flame's slot follows the places of the row, 22 and 20 px tall. */
@media (orientation: portrait) and (max-height: 700px)
{
	.streak_flame
	{
		width: 17px;
		height: 22px;
	}
}

@media (orientation: portrait) and (max-height: 600px)
{
	.streak_flame
	{
		width: 15px;
		height: 20px;
	}
}

.share_status.is_error
{
	color: var(--error);
}

/* How to play */

.how_overlay
{
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--column_safe_top) + 16px) calc(var(--safe_right) + 16px) calc(var(--column_safe_bottom) + 16px) calc(var(--safe_left) + 16px);
	background-color: rgba(59, 42, 74, 0.28);
	pointer-events: auto;
}

.how_overlay[hidden]
{
	display: none;
}

.how_panel
{
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
}

.how_scroll
{
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.how_more_heading
{
	padding-top: 10px;
	font-size: 18px;
	line-height: 24px;
	border-top: 3px dotted var(--panel_edge);
}

.how_list
{
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.how_row
{
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr);
	align-items: center;
	gap: 10px;
	text-align: left;
}

.how_icon
{
	width: 34px;
	height: 34px;
}

.how_text
{
	font-size: 16px;
	line-height: 21px;
}

.how_close_button
{
	width: 100%;
}

/* "More help" in the card "How to play" and in the settings: the manual's start page, in a new tab. */
.more_help_link
{
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	font-size: 16px;
	font-weight: 700;
	line-height: 21px;
	color: var(--plum);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* The narrowest phones: smaller lines keep the five essentials on the first screen in every language. */
@media (max-width: 360px)
{
	.how_text
	{
		font-size: 14px;
		line-height: 18px;
	}

	.how_row
	{
		grid-template-columns: 28px minmax(0, 1fr);
		gap: 8px;
	}

	.how_icon
	{
		width: 28px;
		height: 28px;
	}

	.how_list
	{
		gap: 8px;
	}
}

/* The pause card's two lower buttons: each is as wide as its icon and label need, at least 6 px from its border, and
   the room left over is shared, so the longer label has the wider button and the row is full. The icon stands 6 px
   from its label, so that the Spanish labels, the longest, fit beside their icons in the card of at most 340 px. On
   pages narrower than 360 px the icons give way; from 360 to 367 px the labels are 18 px. tests/browser/wide_layout.mjs
   measures the three languages. */
.pause_secondary
{
	display: grid;
	grid-template-columns: auto auto;
	gap: 10px;
	width: 100%;
}

.pause_secondary .button
{
	gap: 6px;
	padding-right: 6px;
	padding-left: 6px;
}

.pause_secondary .button .icon
{
	display: none;
}

@media (min-width: 360px)
{
	.pause_secondary .button
	{
		font-size: 18px;
	}

	.pause_secondary .button .icon
	{
		display: inline-block;
	}
}

@media (min-width: 368px)
{
	.pause_secondary .button
	{
		font-size: 20px;
	}
}

/* The pause card's restart: a row of its own above the row of "How to play" and home, as wide as that row, with the
   style, height, gap and label size of its two buttons, and with its icon on every page. While its run starts it
   looks as "Play again" does then. */
.pause_restart_button
{
	gap: 6px;
}

@media (min-width: 360px)
{
	.pause_restart_button
	{
		font-size: 18px;
	}
}

@media (min-width: 368px)
{
	.pause_restart_button
	{
		font-size: 20px;
	}
}

html.is_starting .pause_restart_button
{
	opacity: 0.75;
	cursor: progress;
}

/* The pause overlay keeps 8 px to the page's top and bottom edges. On a page too short for the whole card,
   PauseOverlay.fit() lets the missions give way, then the line under the heading. */
.pause_overlay
{
	padding-top: calc(var(--column_safe_top) + 8px);
	padding-bottom: calc(var(--column_safe_bottom) + 8px);
}

/* Link devices: the card, the row in the settings and the hint after a taken name */

.link_overlay
{
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--column_safe_top) + 16px) calc(var(--safe_right) + 16px) calc(var(--column_safe_bottom) + 16px) calc(var(--safe_left) + 16px);
	background-color: rgba(59, 42, 74, 0.28);
	pointer-events: auto;
}

.link_overlay[hidden],
.link_part[hidden],
.link_error[hidden],
.name_taken_hint[hidden]
{
	display: none;
}

.link_panel
{
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
}

.link_panel .panel_heading:focus,
.link_code:focus,
.link_question:focus,
.link_result:focus
{
	outline: none;
}

.link_scroll
{
	display: flex;
	flex-direction: column;
	gap: 14px;
	min-height: 0;
	margin: 0 -8px;
	padding: 4px 8px 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	-webkit-overflow-scrolling: touch;
}

.link_state
{
	font-size: 17px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
	overflow-wrap: anywhere;
}

.link_error
{
	padding: 10px 14px;
	color: var(--error);
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	background-color: var(--white);
	border: 2px solid var(--error);
	border-radius: 14px;
}

.link_announce
{
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.link_part
{
	container: dialog_part / inline-size;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 18px;
}

.link_section_heading
{
	font-size: 19px;
	font-weight: 700;
	line-height: 24px;
}

.link_text,
.link_warning
{
	font-size: 15px;
	line-height: 20px;
	overflow-wrap: anywhere;
}

.link_warning
{
	display: grid;
	grid-template-columns: 24px minmax(0, 1fr);
	align-items: start;
	gap: 8px;
	font-weight: 700;
}

.link_warning_icon
{
	width: 24px;
	height: 24px;
}

.link_code_row
{
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.link_code
{
	padding: 6px 12px;
	font-size: clamp(26px, 8.4vw, 38px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.04em;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	background-color: var(--cream);
	border: 3px dashed var(--plum);
	border-radius: 14px;
	-webkit-user-select: all;
	user-select: all;
}

.link_code:focus-visible,
.link_question:focus-visible,
.link_result:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 4px;
}

/* A name of 24 characters breaks inside itself where it does not fit a line. */
.link_question,
.link_result
{
	font-size: 20px;
	font-weight: 700;
	line-height: 26px;
	overflow-wrap: anywhere;
}

.link_choice
{
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.link_choice .button
{
	flex: 1 1 120px;
}

.link_part > .button
{
	align-self: flex-start;
	white-space: normal;
}

/* The dialogs' buttons with the longest labels keep one line in a narrower part by these steps, each where the room in
   the part asks for it: a gap of 6 px and 6 px of padding, then an 18 px label, and only then without the icon. Spanish
   and Portuguese labels are longer, so that their steps start in wider parts. Where none of the steps is enough the
   label takes two lines. */
@container dialog_part (max-width: 280px)
{
	.rescue_make
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container dialog_part (max-width: 271px)
{
	.rescue_new_card,
	.rescue_use_link
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container dialog_part (max-width: 267px)
{
	.link_leave_button
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container dialog_part (max-width: 222px)
{
	.link_show
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container dialog_part (max-width: 352px)
{
	.rescue_use_link:lang(es)
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container dialog_part (max-width: 344px)
{
	.rescue_use_link:lang(pt)
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container dialog_part (max-width: 312px)
{
	.rescue_use_link:lang(es)
	{
		font-size: 18px;
	}
}

@container dialog_part (max-width: 304px)
{
	.rescue_use_link:lang(pt)
	{
		font-size: 18px;
	}
}

@container dialog_part (max-width: 231px)
{
	.link_leave_button:lang(es)
	{
		font-size: 18px;
	}
}

@container dialog_part (max-width: 210px)
{
	.link_leave_button:lang(pt)
	{
		font-size: 18px;
	}
}

@container dialog_part (max-width: 286px)
{
	.rescue_use_link:lang(es) .button_icon
	{
		display: none;
	}
}

@container dialog_part (max-width: 279px)
{
	.rescue_use_link:lang(pt) .button_icon
	{
		display: none;
	}
}

.link_input
{
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* The gap keeps the field's focus ring, 6 px wide, off the label above it. */
.link_form
{
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* The field shows a whole code, WWWW-WWWW at its widest; a row too narrow for the field and the button puts the
   button below it. */
.link_form .name_row
{
	flex-wrap: wrap;
}

.link_form .name_row .link_input
{
	flex: 1 1 12em;
}

.link_input::placeholder
{
	text-transform: none;
}

.link_row_icon
{
	flex: none;
	width: 34px;
	height: 34px;
}

.name_taken_hint
{
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	margin-top: 4px;
}

.name_taken_link,
.name_taken_rescue
{
	min-height: 48px;
	padding: 0 18px;
	font-size: 17px;
	white-space: normal;
}

/* Three labels take two lines on pages up to 340 px wide, where none of the steps below is enough: Spanish "Tengo una
   tarjeta de rescate" in the name box and in the dialog "Rescue card", Portuguese "Tenho um cartão de resgate" in the
   name box, and Spanish "Salir en este dispositivo". Their buttons grow with the lines and keep 6 px above and below
   them, as at the sides; a label on one line keeps the button's height. */
.name_taken_rescue,
.rescue_use_link,
.link_leave_button
{
	padding-top: 6px;
	padding-bottom: 6px;
}

.name_taken_actions
{
	container: name_offers / inline-size;
	display: flex;
	flex-wrap: wrap;
	align-self: stretch;
	gap: 8px;
}

/* The two offers after a taken name keep one line in a narrower box by these steps, each where the room asks for it: a
   gap of 6 px and 6 px of padding, and only then without the icon. Spanish and Portuguese labels are longer, so that
   their steps start in wider boxes. Where neither step is enough the label takes two lines. */
@container name_offers (max-width: 231px)
{
	.name_taken_rescue
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container name_offers (max-width: 301px)
{
	.name_taken_rescue:lang(es)
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container name_offers (max-width: 294px)
{
	.name_taken_rescue:lang(pt)
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container name_offers (max-width: 270px)
{
	.name_taken_link:lang(es),
	.name_taken_link:lang(pt)
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container name_offers (max-width: 273px)
{
	.name_taken_rescue:lang(es) .button_icon
	{
		display: none;
	}
}

@container name_offers (max-width: 267px)
{
	.name_taken_rescue:lang(pt) .button_icon
	{
		display: none;
	}
}

@container name_offers (max-width: 242px)
{
	.name_taken_link:lang(es) .button_icon,
	.name_taken_link:lang(pt) .button_icon
	{
		display: none;
	}
}

/* Rescue card: the offer on the screen after a run, the dialog with the card, its day and its use by ten places and a
   grid of the 32 pictures. */

.card_offer
{
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	width: 100%;
	padding: 10px 12px 12px;
	text-align: center;
	background-color: #fff3b0;
	border: 3px solid var(--plum);
	border-radius: 20px;
	box-shadow: 0 5px 0 var(--plum);
}

.card_offer[hidden],
.rescue_save[hidden],
.rescue_error[hidden]
{
	display: none;
}

.card_offer_text
{
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
	overflow-wrap: break-word;
}

.card_offer_button
{
	width: 100%;
	white-space: normal;
}

/* The offer's button keeps its icon and its words on one line by these steps, each where the room in the offer asks for
   it with 2 px to spare: a gap of 6 px and 6 px of padding, in English on pages of 360 px and narrower, then an 18 px
   label, and only then without the icon, in an offer narrower than 221 px in English, as on a page of 320 px taller
   than 700 px. The English label is the longest; short pages make the label smaller by height. */
.card_offer
{
	container: card_offer / inline-size;
}

@container card_offer (max-width: 279px)
{
	.card_offer_button:lang(en)
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container card_offer (max-width: 216px)
{
	.card_offer_button:lang(es)
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container card_offer (max-width: 246px)
{
	.card_offer_button:lang(pt)
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container card_offer (max-width: 239px)
{
	.card_offer_button:lang(en)
	{
		font-size: 18px;
	}
}

@container card_offer (max-width: 176px)
{
	.card_offer_button:lang(es)
	{
		font-size: 18px;
	}
}

@container card_offer (max-width: 206px)
{
	.card_offer_button:lang(pt)
	{
		font-size: 18px;
	}
}

@container card_offer (max-width: 220px)
{
	.card_offer_button:lang(en) .button_icon
	{
		display: none;
	}
}

@container card_offer (max-width: 163px)
{
	.card_offer_button:lang(es) .button_icon
	{
		display: none;
	}
}

@container card_offer (max-width: 191px)
{
	.card_offer_button:lang(pt) .button_icon
	{
		display: none;
	}
}

.rescue_panel
{
	gap: 10px;
}

.rescue_scroll
{
	gap: 12px;
}

.rescue_made_text
{
	font-size: 20px;
	font-weight: 700;
	line-height: 26px;
}

.rescue_made_text:focus,
.rescue_code:focus
{
	outline: none;
}

.rescue_made_text:focus-visible,
.rescue_code:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 4px;
}

.rescue_card_part,
.rescue_use_part
{
	padding: 0;
	background: none;
	border: 0;
}

.rescue_card_box
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 10px 6px 12px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 18px;
}

.rescue_card_name
{
	max-width: 100%;
	font-size: 24px;
	font-weight: 700;
	line-height: 30px;
	text-align: center;
	overflow-wrap: anywhere;
}

.rescue_card_pictures
{
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 6px 2px;
	width: 100%;
}

.rescue_card_picture
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 0;
	margin: 0;
}

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

.rescue_card_caption
{
	max-width: 100%;
	font-size: 11px;
	font-weight: 500;
	line-height: 13px;
	letter-spacing: -0.01em;
	text-align: center;
	overflow-wrap: anywhere;
}

.rescue_card_caption.is_one_line
{
	white-space: nowrap;
}

.rescue_code
{
	padding: 4px 12px;
	font-size: clamp(22px, 7vw, 30px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.04em;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	background-color: var(--cream);
	border: 3px dashed var(--plum);
	border-radius: 14px;
}

/* The ten places: a box with the picture or the place's number, and under a filled place the picture's name, which
   may use the column's whole width. */
.rescue_places
{
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	align-items: start;
	gap: 6px 2px;
}

.rescue_place
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 0;
}

.rescue_place_box
{
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(100% - 4px);
	height: 46px;
	background-color: var(--white);
	border: 3px dashed var(--plum_35);
	border-radius: 12px;
}

.rescue_place.is_filled .rescue_place_box
{
	border-style: solid;
	border-color: var(--plum);
}

.rescue_place.is_next .rescue_place_box
{
	background-color: #fff3b0;
	border-color: var(--plum);
}

.rescue_place_number
{
	color: var(--plum);
	font-size: 15px;
	font-weight: 700;
	line-height: 18px;
	opacity: 0.6;
}

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

.rescue_place_actions,
.rescue_actions
{
	display: flex;
	gap: 10px;
}

.rescue_place_actions .button,
.rescue_actions .button
{
	flex: 1 1 auto;
	min-width: 0;
	padding: 0 12px;
	white-space: normal;
}

.rescue_actions
{
	container: rescue_actions / inline-size;
}

.rescue_actions .button
{
	font-size: 18px;
}

/* "Done" and "Save picture" share the row, the longer label in the wider button; in a row up to 324 px wide the gap and
   the padding are 6 px, so that "Guardar imagem" keeps one line beside "Concluído" with its icon. */
@container rescue_actions (max-width: 324px)
{
	.rescue_actions .button
	{
		gap: 6px;
		padding: 0 6px;
	}
}

.rescue_place_actions .button
{
	min-height: 48px;
	font-size: 17px;
	line-height: 20px;
}

.rescue_grid
{
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 6px;
}

.rescue_pick
{
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	min-width: 0;
	padding: 2px;
	color: var(--plum);
	background-color: var(--white);
	border: 2px solid var(--plum);
	border-radius: 12px;
	box-shadow: 0 3px 0 var(--plum);
	cursor: pointer;
	transition: transform 70ms ease-out, box-shadow 70ms ease-out;
}

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

.rescue_pick:disabled
{
	opacity: 0.5;
	cursor: default;
}

.rescue_pick:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 2px;
}

.rescue_pick_drawing
{
	width: 34px;
	height: 34px;
}

.rescue_picture_name
{
	font-size: 10px;
	font-weight: 700;
	line-height: 12px;
	text-align: center;
	overflow-wrap: anywhere;
}

@media (max-width: 360px)
{
	.rescue_card_drawing
	{
		width: 38px;
		height: 38px;
	}

	.rescue_card_caption
	{
		font-size: 10px;
		line-height: 12px;
	}

	/* The dialog and the card take the screen's width, so that the pictures' names keep one line. */
	.rescue_overlay
	{
		padding-right: calc(var(--safe_right) + 8px);
		padding-left: calc(var(--safe_left) + 8px);
	}

	.rescue_panel
	{
		width: 100%;
		padding-right: 8px;
		padding-left: 8px;
	}

	.rescue_card_box
	{
		padding-right: 2px;
		padding-left: 2px;
	}

	.rescue_card_pictures
	{
		column-gap: 1px;
	}

	.rescue_panel .panel_heading
	{
		font-size: 24px;
		line-height: 28px;
	}

	.rescue_place_actions .button,
	.rescue_actions .button
	{
		padding: 0 10px;
		font-size: 15px;
	}

	.rescue_pick
	{
		height: 40px;
	}

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

	.rescue_place_box
	{
		height: 42px;
	}

	.rescue_place_drawing
	{
		width: 28px;
		height: 28px;
	}
}

/* Seasons: small accents on the title and the screen after a run, from the page's data-season. They change no
   colour of a text or a button's face, and none of them moves. */

html[data-season="christmas"] .logo_fill .logo_letter::before
{
	content: "";
	position: absolute;
	top: 0.03em;
	left: 50%;
	width: 0.46em;
	height: 0.16em;
	background-color: var(--white);
	border: 0.045em solid var(--plum);
	border-radius: 0.12em 0.12em 0.09em 0.09em;
	transform: translateX(-50%);
}

html[data-season="christmas"] .logo_fill .logo_letter[data-letter="a"]::before,
html[data-season="christmas"] .logo_fill .logo_letter[data-letter="o"]::before,
html[data-season="christmas"] .logo_fill .logo_letter[data-letter="s"]::before
{
	top: 0.31em;
}

html[data-season="christmas"] .logo_fill .logo_letter[data-letter="b"]::before
{
	left: 30%;
	width: 0.3em;
}

html[data-season="christmas"] .logo_fill .logo_letter[data-letter="l"]::before
{
	width: 0.3em;
}

html[data-season="christmas"] .logo_fill .logo_letter[data-letter="i"]::before
{
	content: none;
}

html[data-season="halloween"] .title_screen .button_primary,
html[data-season="halloween"] .game_over_screen .button_primary
{
	box-shadow: 0 5px 0 var(--plum), 0 0 20px 4px rgba(255, 140, 40, 0.55);
}

html[data-season="halloween"] .title_screen .button:not(.button_primary),
html[data-season="halloween"] .title_screen .icon_button,
html[data-season="halloween"] .game_over_screen .button:not(.button_primary)
{
	box-shadow: 0 5px 0 var(--plum), 0 0 18px 3px rgba(150, 95, 225, 0.5);
}

html[data-season="halloween"] .title_screen .button_primary:active,
html[data-season="halloween"] .game_over_screen .button_primary:active
{
	box-shadow: 0 0 0 var(--plum), 0 0 20px 4px rgba(255, 140, 40, 0.55);
}

html[data-season="halloween"] .title_screen .button:not(.button_primary):active,
html[data-season="halloween"] .title_screen .icon_button:active,
html[data-season="halloween"] .game_over_screen .button:not(.button_primary):active
{
	box-shadow: 0 0 0 var(--plum), 0 0 18px 3px rgba(150, 95, 225, 0.5);
}

html[data-season="weekend"] .logo::after
{
	content: "";
	position: absolute;
	inset: -0.12em -0.22em;
	background-image:
		radial-gradient(circle at 4% 30%, var(--pink) 0.055em, transparent 0.065em),
		radial-gradient(circle at 11% 82%, var(--blue) 0.045em, transparent 0.055em),
		radial-gradient(circle at 27% 6%, var(--green) 0.04em, transparent 0.05em),
		radial-gradient(circle at 63% 4%, var(--duck_yellow) 0.05em, transparent 0.06em),
		radial-gradient(circle at 86% 10%, var(--pink) 0.04em, transparent 0.05em),
		radial-gradient(circle at 96% 46%, var(--blue) 0.055em, transparent 0.065em),
		radial-gradient(circle at 90% 90%, var(--green) 0.045em, transparent 0.055em);
	pointer-events: none;
}

/* Fan level: the card on the title and the missions panel */

.fan_card
{
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px;
	width: min(100%, 300px);
	padding: 5px 12px 5px 5px;
	color: var(--plum);
	font: inherit;
	text-align: left;
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 4px 0 var(--plum_20);
	cursor: pointer;
}

.fan_level
{
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	font-size: 18px;
	font-weight: 700;
	background-color: var(--duck_yellow);
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-sizing: border-box;
}

.fan_body
{
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.fan_title
{
	overflow: hidden;
	font-size: 15px;
	font-weight: 700;
	line-height: 18px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fan_bar,
.mission_bar
{
	display: block;
	height: 8px;
	overflow: hidden;
	background-color: var(--panel_edge);
	border-radius: 999px;
}

.fan_bar_fill,
.mission_bar_fill
{
	display: block;
	height: 100%;
	background-color: var(--pink);
	border-radius: 999px;
}

.fan_stars_box
{
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.fan_star_icon,
.mission_star
{
	width: 16px;
	height: 16px;
}

.missions_panel
{
	display: flex;
	flex-direction: column;
	gap: 10px;
	overflow-y: auto;
}

.missions_level
{
	font-size: 17px;
	font-weight: 700;
	text-align: center;
}

.missions_bar
{
	height: 12px;
}

.missions_stars,
.missions_steps
{
	font-size: 14px;
	line-height: 19px;
	text-align: center;
}

.missions_steps
{
	font-weight: 700;
}

.mission_list,
.result_mission_list,
.pause_missions
{
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mission_row
{
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 4px 8px;
	align-items: center;
	padding: 8px 10px;
	text-align: left;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 14px;
}

.mission_row.is_done
{
	background-color: #e3f6df;
}

.mission_text
{
	font-size: 15px;
	font-weight: 700;
	line-height: 19px;
}

.mission_reward
{
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 13px;
	font-weight: 700;
}

.mission_progress
{
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.pause_mission,
.result_mission
{
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	align-items: center;
	font-size: 14px;
	line-height: 18px;
	text-align: left;
}

.pause_mission.is_done,
.result_mission.is_done
{
	color: #2e7d32;
	font-weight: 700;
}

.pause_mission_progress,
.result_mission_state
{
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pause_card
{
	overflow-y: auto;
}

.level_up
{
	padding: 6px 12px;
	background-color: var(--duck_yellow);
	border: 3px solid var(--plum);
	border-radius: 14px;
	transform: rotate(-1.5deg);
}

.level_up_title
{
	font-size: 17px;
	font-weight: 700;
	line-height: 22px;
}

.level_up_unlock
{
	font-size: 14px;
	line-height: 19px;
}

.game_over_missions
{
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	padding-top: 8px;
	border-top: 3px dotted var(--panel_edge);
}

.game_over_missions[hidden],
.level_up[hidden]
{
	display: none;
}

.result_missions_heading
{
	display: flex;
	justify-content: space-between;
	font-size: 16px;
	line-height: 22px;
}

.result_stars
{
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.result_find,
.result_band,
.result_new_mission
{
	font-size: 14px;
	line-height: 18px;
	text-align: left;
}

.result_find,
.result_band
{
	font-weight: 700;
}

/* Duck album and wardrobe */

.fan_card
{
	position: relative;
}

.fan_news
{
	position: absolute;
	top: -3px;
	right: 6px;
	width: 14px;
	height: 14px;
	background-color: #ff5a6e;
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-sizing: border-box;
}

.fan_news[hidden]
{
	display: none;
}

/* Under the fan card on the title: the wardrobe and the duck album, one tap away, with the dot for news. */
.title_collections
{
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: min(100%, 300px);
}

.title_collection_button
{
	min-height: 40px;
	margin-bottom: 4px;
	padding: 0 10px;
	gap: 6px;
	font-size: 16px;
	line-height: 20px;
	box-shadow: 0 4px 0 var(--plum);
}

.title_collection_button:active
{
	transform: translateY(4px);
}

.title_collection_button .button_icon
{
	flex: none;
	width: 22px;
	height: 22px;
}

.title_collection_button.has_news::after
{
	content: "";
	position: absolute;
	top: -4px;
	right: -2px;
	width: 14px;
	height: 14px;
	background-color: #ff5a6e;
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-sizing: border-box;
}

/* The album's and the wardrobe's buttons share a row; the longer label gets the wider button. */
.missions_collections
{
	container: missions_row / inline-size;
	display: grid;
	grid-template-columns: repeat(2, minmax(min-content, 1fr));
	gap: 10px;
}

.missions_collections .button
{
	position: relative;
	padding-right: 8px;
	padding-left: 8px;
}

/* In a narrower row the two buttons keep their icons and their labels on one line by these steps, each where the room
   asks for it with 2 px to spare: a gap of 6 px and 6 px of padding, then 18 px labels. Where the row is narrower still
   the buttons stand one above the other, each as wide as the row, with 20 px labels, as in English at 360 and 320 px,
   in Spanish from 375 px down and in Portuguese from 402 px down. Spanish and Portuguese labels are longer, so that
   their steps start in wider rows. No icon of this row gives way. */
@container missions_row (max-width: 319px)
{
	.missions_collections .button
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container missions_row (max-width: 338px)
{
	.missions_collections .button:lang(es)
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container missions_row (max-width: 373px)
{
	.missions_collections .button:lang(pt)
	{
		gap: 6px;
		padding-right: 6px;
		padding-left: 6px;
	}
}

@container missions_row (max-width: 303px)
{
	.missions_collections .button
	{
		font-size: 18px;
	}
}

@container missions_row (max-width: 322px)
{
	.missions_collections .button:lang(es)
	{
		font-size: 18px;
	}
}

@container missions_row (max-width: 357px)
{
	.missions_collections .button:lang(pt)
	{
		font-size: 18px;
	}
}

@container missions_row (max-width: 284px)
{
	.missions_collections .button
	{
		grid-column: 1 / -1;
		gap: 10px;
		padding-right: 8px;
		padding-left: 8px;
		font-size: 20px;
	}
}

@container missions_row (max-width: 300px)
{
	.missions_collections .button:lang(es)
	{
		grid-column: 1 / -1;
		gap: 10px;
		padding-right: 8px;
		padding-left: 8px;
		font-size: 20px;
	}
}

@container missions_row (max-width: 333px)
{
	.missions_collections .button:lang(pt)
	{
		grid-column: 1 / -1;
		gap: 10px;
		padding-right: 8px;
		padding-left: 8px;
		font-size: 20px;
	}
}

/* Where the panel reaches the page's height, as at 320 x 568 with the buttons one above the other, the list of missions
   scrolls inside the panel and the buttons under it stay on screen. */
.missions_panel .mission_list
{
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.missions_collections .button.has_news::after
{
	content: "";
	position: absolute;
	top: -4px;
	right: -2px;
	width: 14px;
	height: 14px;
	background-color: #ff5a6e;
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-sizing: border-box;
}

.album_panel,
.wardrobe_panel
{
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 0;
}

.album_count
{
	font-size: 16px;
	font-weight: 700;
	text-align: center;
}

.album_scroll,
.wardrobe_scroll
{
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.album_grid,
.wardrobe_list
{
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 2px;
	list-style: none;
}

/* The cards of one row share its height, even when a name takes two lines. */
.album_grid > li,
.wardrobe_list > li
{
	display: flex;
}

.album_tile,
.wardrobe_item
{
	container: card / inline-size;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	width: 100%;
	min-height: 104px;
	padding: 6px 4px;
	color: var(--plum);
	font: inherit;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 14px;
	cursor: pointer;
}

.album_tile:disabled
{
	background-color: var(--panel_edge);
	cursor: default;
	opacity: 1;
}

.album_tile_name,
.wardrobe_item_name
{
	max-width: 100%;
	overflow: hidden;
	font-size: 13px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wardrobe_item_name
{
	white-space: normal;
}

/* In a narrower card a name is smaller, so that the longest word of a name shows whole: "Auscultadores" needs 85 px at
   13 px and 79 px at 12 px. */
@container card (max-width: 86px)
{
	.album_tile_name:lang(pt),
	.wardrobe_item_name:lang(pt)
	{
		font-size: 12px;
	}
}

@container card (max-width: 80px)
{
	.album_tile .album_tile_name,
	.wardrobe_item .wardrobe_item_name
	{
		font-size: 11px;
	}
}

.album_tile_note,
.wardrobe_item_note
{
	font-size: 11px;
	line-height: 14px;
	text-align: center;
}

.album_panel
{
	position: relative;
}

/* The album's groups: the kinds of the house, the tower ducks and the seasonal ducks, each with its count. */
.album_groups
{
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.album_group_heading
{
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	margin: 0 4px 6px;
	font-size: 16px;
	line-height: 20px;
}

.album_group_count
{
	flex: none;
	font-size: 14px;
}

.album_group_note
{
	margin: -2px 4px 8px;
	font-size: 13px;
	line-height: 17px;
}

/* Under the count: the buddy's name, or how to pick one. */
.album_buddy_line
{
	margin-top: -6px;
	font-size: 14px;
	line-height: 18px;
	text-align: center;
}

.album_buddy_line[hidden]
{
	display: none;
}

/* The buddy's tile: the colour of the worn look in the wardrobe, and a check in its corner. */
.album_tile
{
	position: relative;
}

.album_tile.is_buddy
{
	background-color: #ffeb99;
}

.album_buddy_mark
{
	position: absolute;
	top: -8px;
	right: -6px;
	width: 26px;
	height: 26px;
	padding: 1px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 50%;
	box-sizing: border-box;
}

/* The large view of a found kind. The margins of its first and last parts centre it while it fits, and it scrolls
   from its top on a short screen. */
.album_detail
{
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 20px;
	overflow-y: auto;
	color: var(--plum);
	background-color: var(--cream);
	border-radius: 17px;
	cursor: pointer;
}

.album_detail > :first-child
{
	margin-top: auto;
}

.album_detail > :last-child
{
	margin-bottom: auto;
}

.album_detail[hidden]
{
	display: none;
}

/* The two buttons share a row where it is wide enough, as on a phone on its side, and stand one above the other
   elsewhere. */
.album_detail_actions
{
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 6px;
}

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

.album_take_along.is_on
{
	background-color: var(--white);
}

.album_take_along:not(.is_on) .button_icon
{
	display: none;
}

.album_take_note
{
	max-width: 300px;
	font-size: 13px;
	line-height: 17px;
	text-align: center;
}

.album_detail_name
{
	font-size: 24px;
	font-weight: 700;
}

.album_detail_line
{
	font-size: 16px;
	line-height: 22px;
	text-align: center;
}

.wardrobe_preview
{
	align-self: center;
	flex: none;
}

.wardrobe_preview[hidden]
{
	display: none;
}

.wardrobe_look_name
{
	font-size: 17px;
	font-weight: 700;
	text-align: center;
}

.wardrobe_item.is_worn
{
	background-color: #ffeb99;
}

.wardrobe_item.is_locked
{
	cursor: default;
}

.wardrobe_item.is_locked .wardrobe_still
{
	opacity: 0.35;
	filter: grayscale(0.8);
}

.wardrobe_item:disabled
{
	opacity: 1;
}

/* A kind found or a look unlocked and not looked at before this visit: a ring in the colour of the news dots inside
   the border, and the tag "New" in its upper left corner, which the drawings leave free. */
.album_tile.is_new,
.wardrobe_item.is_new
{
	position: relative;
	box-shadow: inset 0 0 0 3px #ff5a6e;
}

.news_tag
{
	position: absolute;
	top: 2px;
	left: 2px;
	padding: 0 6px;
	color: var(--plum);
	background-color: #ff5a6e;
	border: 2px solid var(--plum);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	line-height: 14px;
	white-space: nowrap;
}

.banner[data-kind="find"]
{
	flex-direction: row;
	gap: 8px;
}

.banner_portrait
{
	width: 36px;
	height: 36px;
	flex: none;
}

.banner_portrait[hidden]
{
	display: none;
}

.game_over_progress_line
{
	padding: 4px 12px;
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	background-color: #e3f6df;
	border: 2px solid #2e7d32;
	border-radius: 999px;
}

.game_over_progress_line[hidden]
{
	display: none;
}

.result_album_button
{
	align-self: center;
}

@media (max-width: 360px)
{
	.album_grid,
	.wardrobe_list
	{
		grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
	}
}

/* The wardrobe in tabs. The panel keeps the screen's full height in every tab, so that nothing above or below the
   tiles moves when a tab opens: the preview, the line with the worn look's name and "Surprise me", the row of tabs and
   "Back" keep their places, and only the tiles' area between them changes; it scrolls. The panel is a container, so
   that its parts follow its own width, which a short page on a wide screen narrows as a narrow phone does. Its parts
   keep their distance to its sides themselves. */
.wardrobe_panel
{
	container: wardrobe / inline-size;
	height: 100%;
	padding-right: 0;
	padding-left: 0;
}

.wardrobe_panel > *
{
	margin-right: 20px;
	margin-left: 20px;
}

.wardrobe_panel .wardrobe_scroll
{
	flex: 1 1 auto;
}

/* Her preview and under it the line with the name of what she wears and "Surprise me". The line keeps the height of
   two lines of a name, so that a longer name moves nothing. */
.wardrobe_top
{
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.wardrobe_mix_line
{
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	height: 48px;
}

.wardrobe_mix_line .wardrobe_look_name
{
	flex: 0 1 auto;
	min-width: 0;
	line-height: 21px;
}

.wardrobe_surprise
{
	flex: none;
	min-height: 44px;
	margin-bottom: 4px;
	padding: 0 12px;
	gap: 6px;
	font-size: 16px;
	line-height: 20px;
	box-shadow: 0 4px 0 var(--plum);
}

.wardrobe_surprise:active
{
	transform: translateY(4px);
}

.wardrobe_surprise .icon.button_icon
{
	height: 26px;
}

/* On a screen less than 700 px tall the smaller preview stands beside the name and "Surprise me", and the heading, the
   gaps, the panel's padding and the tabs are smaller, so that the tiles keep their room: at 320 x 568 a tile of two
   lines of a name and a note stands whole in view. The name keeps the height of two lines. */
.wardrobe_panel.is_short
{
	gap: 8px;
	padding-top: 14px;
	padding-bottom: 14px;
}

.wardrobe_panel.is_short .panel_heading
{
	font-size: 24px;
	line-height: 30px;
}

.wardrobe_panel.is_short .wardrobe_tab
{
	min-height: 52px;
}

.wardrobe_panel.is_short .wardrobe_top
{
	flex-direction: row;
	justify-content: center;
	gap: 8px;
}

.wardrobe_panel.is_short .wardrobe_mix_line
{
	flex: 0 1 auto;
	flex-direction: column;
	gap: 6px;
	width: auto;
	min-width: 0;
	height: auto;
}

.wardrobe_panel.is_short .wardrobe_look_name
{
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
}

/* "Surprise me" is smaller beside the preview, and in a narrow panel, where the name keeps room for its longest word. */
.wardrobe_panel.is_short .wardrobe_surprise
{
	padding: 0 7px;
	gap: 4px;
	font-size: 14px;
}

.wardrobe_panel.is_short .wardrobe_surprise .icon.button_icon
{
	height: 24px;
}

/* The row of six tabs in the look of the leaderboard's tabs, each with its icon above its label. Each tab is as wide as
   its label needs and at least 44 px, and the room left goes to all six alike; the row reaches into the panel's side
   room, so that every tab keeps 44 px to tap. */
.wardrobe_tab_bar
{
	position: relative;
	flex: none;
}

.wardrobe_panel > .wardrobe_tab_bar
{
	margin-right: 4px;
	margin-left: 4px;
}

.wardrobe_tabs
{
	display: grid;
	grid-template-columns: repeat(6, minmax(min-content, auto));
	background-color: var(--panel_edge);
	border: 3px solid var(--plum);
	border-radius: 20px;
}

.wardrobe_tab
{
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	min-width: 44px;
	min-height: 56px;
	margin: 0;
	padding: 4px 5px 3px;
	color: var(--plum);
	background: transparent;
	border: 0;
	border-radius: 15px;
	font-size: 12px;
	font-weight: 700;
	line-height: 14px;
	cursor: pointer;
}

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

.wardrobe_tab:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 2px;
}

.wardrobe_tab_icon
{
	width: 26px;
	height: 26px;
}

.wardrobe_tab_label
{
	white-space: nowrap;
}

.wardrobe_tab_short
{
	display: none;
}

/* The first-time tip stands under the row of tabs, over the top of the tiles. */
.wardrobe_tab_bar .wardrobe_tip_layer
{
	top: calc(100% + 6px);
	z-index: 2;
	padding: 0 4px;
}

.wardrobe_tip_layer .hint_tip
{
	max-width: 100%;
}

/* A part's still keeps the 84 x 64 shape of its painting and becomes smaller in a narrower tile. */
.wardrobe_part_still
{
	width: 100%;
	max-width: 84px;
	height: auto;
	aspect-ratio: 84 / 64;
}

/* The extras in two groups under the album's group headings, and the line over the bottoms under a long coat. */
.wardrobe_group + .wardrobe_group
{
	margin-top: 12px;
}

.wardrobe_group_heading
{
	margin: 2px 4px 6px;
}

.wardrobe_note
{
	margin: 2px 4px 8px;
	font-size: 14px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

/* A panel of 348 px or less, as on pages up to 380 px wide and on short pages of a wide screen: its parts keep 6 px to
   its sides, the row of tabs reaches its border, which is the row's sides, and the labels are smaller, so that each of
   the six tabs keeps 44 px to tap at 320 px in the three languages. The tiles keep less room between them, so that
   the longest word of a name, "Auscultadores", shows whole in three columns at 320 px. */
@container wardrobe (max-width: 342px)
{
	.wardrobe_panel > *
	{
		margin-right: 6px;
		margin-left: 6px;
	}

	.wardrobe_panel > .wardrobe_tab_bar
	{
		margin-right: 0;
		margin-left: 0;
	}

	.wardrobe_tabs
	{
		border-right-width: 0;
		border-left-width: 0;
		border-radius: 0;
	}

	.wardrobe_tab
	{
		padding-right: 3px;
		padding-left: 3px;
		font-size: 11px;
		line-height: 13px;
	}

	.wardrobe_tab_icon
	{
		width: 24px;
		height: 24px;
	}

	.wardrobe_panel .wardrobe_list
	{
		gap: 6px;
	}

	.wardrobe_panel .wardrobe_item
	{
		padding-right: 2px;
		padding-left: 2px;
	}

	.wardrobe_panel .wardrobe_surprise
	{
		padding: 0 7px;
		gap: 4px;
		font-size: 14px;
	}

	.wardrobe_panel .wardrobe_surprise .icon.button_icon
	{
		height: 24px;
	}
}

/* Below 381 px "Headphones" reads "Phones" in English and Portuguese; Spanish "Audífonos" takes the room the shorter
   labels leave. */
@media (max-width: 380px)
{
	.wardrobe_tab_long
	{
		display: none;
	}

	.wardrobe_tab_short
	{
		display: inline;
	}
}

/* A phone on its side: the preview with the name and "Surprise me" under it on the left, the heading, the tabs, the
   tiles and "Back" on the right. */
@media (orientation: landscape) and (max-height: 540px)
{
	.wardrobe_panel,
	.wardrobe_panel.is_short
	{
		display: grid;
		grid-template-columns: 160px minmax(0, 1fr);
		grid-template-rows: auto auto minmax(0, 1fr) auto;
		grid-template-areas:
			"top heading"
			"top tabs"
			"top scroll"
			"top back";
		gap: 6px 16px;
		padding: 12px 14px 10px;
	}

	.wardrobe_panel > *,
	.wardrobe_panel > .wardrobe_tab_bar
	{
		margin-right: 0;
		margin-left: 0;
	}

	.wardrobe_panel .panel_heading
	{
		grid-area: heading;
		font-size: 24px;
		line-height: 30px;
	}

	.wardrobe_panel.is_short .wardrobe_top,
	.wardrobe_panel .wardrobe_top
	{
		grid-area: top;
		align-self: center;
		flex-direction: column;
		gap: 6px;
	}

	.wardrobe_panel.is_short .wardrobe_mix_line,
	.wardrobe_panel .wardrobe_mix_line
	{
		flex-direction: column;
		gap: 6px;
		width: 100%;
		height: auto;
	}

	.wardrobe_panel .wardrobe_look_name
	{
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 42px;
	}

	.wardrobe_panel .wardrobe_surprise
	{
		padding: 0 7px;
		gap: 4px;
		font-size: 14px;
	}

	.wardrobe_tab_bar
	{
		grid-area: tabs;
	}

	.wardrobe_panel .wardrobe_scroll
	{
		grid-area: scroll;
	}

	.wardrobe_panel .wardrobe_back
	{
		grid-area: back;
	}
}

/* Settings */

.settings_version
{
	margin-top: 4px;
	font-size: 12px;
	line-height: 16px;
	text-align: center;
	opacity: 0.7;
}

.settings_panel
{
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 20px 18px 14px;
}

.panel_scroll
{
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 14px;
	min-height: 0;
	margin: 0 -8px;
	padding: 4px 8px 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	-webkit-overflow-scrolling: touch;
}

.panel_scroll
{
	scrollbar-width: thin;
	scrollbar-color: var(--panel_edge) transparent;
}

.panel_scroll.has_more_below
{
	-webkit-mask-image: linear-gradient(to bottom, #000000 calc(100% - 40px), transparent);
	mask-image: linear-gradient(to bottom, #000000 calc(100% - 40px), transparent);
}

.toggle_list
{
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* A row of the settings may put its label on two lines; the row then grows, keeps 10 px above and below the label, and
   its switch or icon stays in the middle of its height. */
.toggle_row
{
	appearance: none;
	-webkit-appearance: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 56px;
	margin: 0;
	padding: 10px 12px 10px 18px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 18px;
	font-size: 19px;
	font-weight: 700;
	line-height: 24px;
	text-align: left;
	cursor: pointer;
}

.switch
{
	position: relative;
	flex: none;
	width: 58px;
	height: 34px;
	background-color: var(--panel_edge);
	border: 3px solid var(--plum);
	border-radius: 999px;
	transition: background-color 150ms ease;
}

.switch_knob
{
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 50%;
	transition: transform 150ms ease;
}

.toggle_row[aria-checked="true"] .switch
{
	background-color: var(--green);
}

.toggle_row[aria-checked="true"] .switch_knob
{
	transform: translateX(24px);
}

.settings_fields
{
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.field
{
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.field_label
{
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
}

/* Three segments of equal width; a segment whose label needs more room, as "Português" at 320 px, takes it from the
   others. */
.segmented
{
	display: grid;
	grid-template-columns: repeat(3, minmax(min-content, 1fr));
	gap: 4px;
	padding: 4px;
	background-color: var(--panel_edge);
	border: 3px solid var(--plum);
	border-radius: 20px;
}

.segment
{
	appearance: none;
	-webkit-appearance: none;
	min-width: 0;
	min-height: 56px;
	margin: 0;
	padding: 0 4px;
	background: transparent;
	border: 0;
	border-radius: 15px;
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
	cursor: pointer;
}

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

.text_input
{
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 0 18px;
	color: var(--plum);
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 18px;
	font-size: 18px;
	font-weight: 500;
	line-height: 24px;
	caret-color: var(--plum);
	-webkit-user-select: text;
	user-select: text;
	touch-action: manipulation;
}

.text_input::selection
{
	color: var(--plum);
	background-color: var(--duck_yellow);
}

.text_input::placeholder
{
	color: rgba(59, 42, 74, 0.45);
	opacity: 1;
}

.text_input:focus
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 2px;
}

.text_input[aria-invalid="true"]
{
	border-color: var(--error);
}

.field_hint
{
	font-size: 14px;
	line-height: 19px;
	opacity: 0.8;
}

.field_hint.is_error
{
	color: var(--error);
	opacity: 1;
}

.privacy_note
{
	padding: 10px 14px;
	font-size: 14px;
	line-height: 19px;
	background-color: var(--white);
	border: 2px dashed var(--panel_edge);
	border-radius: 14px;
}

.done_button
{
	flex: none;
	width: 100%;
}

.fatal_panel
{
	font-size: 18px;
	line-height: 26px;
	text-align: center;
}

/* Leaderboard submission on the game over panel */

.rank_slot
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.submit_line
{
	font-size: 16px;
	line-height: 22px;
}

.submit_line.is_error
{
	color: var(--error);
}

.submit_line.is_busy
{
	animation: soft_blink 1.2s ease-in-out infinite;
}

.rank_chips
{
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.rank_chip
{
	padding: 3px 12px;
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
	white-space: nowrap;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 999px;
}

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

.target_line
{
	max-width: 100%;
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
	overflow-wrap: break-word;
}

.retry_button
{
	width: 100%;
}

.name_row
{
	display: flex;
	gap: 8px;
}

.name_row .text_input
{
	flex: 1 1 auto;
	min-width: 0;
}

/* The name box right under the score, the panel's one highlighted part while a run waits for a name. Its line about the
   place keeps the height of two lines from the start, so that a late answer moves nothing. */
.name_box
{
	container: name_box / inline-size;
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	padding: 10px 12px 12px;
	text-align: left;
	background-color: #fff3b0;
	border: 3px solid var(--plum);
	border-radius: 20px;
	box-shadow: 0 5px 0 var(--plum);
}

.name_box[hidden],
.name_box_hint[hidden]
{
	display: none;
}

.name_box_place
{
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
	text-align: center;
	overflow-wrap: break-word;
}

.name_box_input
{
	padding: 0 14px;
	font-size: 16px;
}

.name_box_hint.is_busy
{
	animation: soft_blink 1.2s ease-in-out infinite;
}

.name_box_button
{
	width: 100%;
	margin-top: 2px;
}

/* Pages up to 348 px wide: the placeholder is 14 px, so that it stands whole in the field in every language; the typed
   name keeps 16 px, below which iOS zooms into the field. */
@media (max-width: 348px)
{
	.name_box_input::placeholder
	{
		font-size: 14px;
	}
}

/* "Join the leaderboard" is 18 px on tall pages up to 340 px wide too. */
@media (max-width: 340px)
{
	.name_box .name_box_button
	{
		font-size: 18px;
	}
}

/* "Join the leaderboard" keeps 8 px to each side of its trophy and label in a narrower box: first the gap beside the
   trophy is 6 px, then the Portuguese label, the longest, is 18 px, and in a box narrower than 244 px, as at 320 px, the
   trophy gives way. */
@container name_box (max-width: 268px)
{
	.name_box_button
	{
		gap: 6px;
	}
}

@container name_box (max-width: 253px)
{
	.name_box_button:lang(pt)
	{
		font-size: 18px;
	}
}

@container name_box (max-width: 243px)
{
	.name_box_button .button_icon
	{
		display: none;
	}
}

/* In landscape windows 541 to 680 px tall, whose panel is 340 to 351 px wide, the trophy gives way, so that the
   Portuguese label keeps 8 px to each side. */
@media (orientation: landscape) and (min-height: 541px) and (max-height: 680px)
{
	.name_box_button .button_icon
	{
		display: none;
	}
}

/* While the name box or the offer of the rescue card shows, the rest of the panel is calmer: the run's numbers in one
   quiet row, the line of stars and the streak's reward as plain text. The labels of the numbers stay for screen
   readers. */
.is_asking_name .stats,
.has_card_offer .stats
{
	display: flex;
	justify-content: center;
	gap: 20px;
}

.is_asking_name .stat,
.has_card_offer .stat
{
	flex-direction: row;
	gap: 5px;
	padding: 0;
	background: none;
	border: 0;
}

.is_asking_name .stat_icon,
.has_card_offer .stat_icon
{
	width: 22px;
	height: 22px;
}

.is_asking_name .stat_value,
.has_card_offer .stat_value
{
	font-size: 17px;
	line-height: 22px;
}

.is_asking_name .stat_label,
.has_card_offer .stat_label
{
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.is_asking_name .game_over_progress_line,
.has_card_offer .game_over_progress_line
{
	padding: 0;
	font-weight: 500;
	background: none;
	border: 0;
}

.is_asking_name .streak_reward,
.has_card_offer .streak_reward
{
	background-color: var(--white);
}

.button:disabled,
.text_input:disabled
{
	opacity: 0.6;
	cursor: progress;
}

.confetti
{
	position: absolute;
	left: 50%;
	top: 0;
	z-index: 2;
	width: 0;
	height: 0;
	pointer-events: none;
}

.confetti_piece
{
	position: absolute;
	left: -6px;
	top: -6px;
	width: 11px;
	height: 15px;
	border: 2px solid var(--plum);
	border-radius: 3px;
	opacity: 0;
}

.is_celebrating .confetti_piece
{
	animation: confetti_burst 1200ms cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

/* Leaderboard screen */

.leaderboard_panel
{
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	max-height: 760px;
	padding: 18px 14px 12px;
}

/* Four tabs of equal width; a tab whose longest word needs more room takes it from the others. */
.board_tabs
{
	display: grid;
	flex: none;
	grid-template-columns: repeat(4, minmax(min-content, 1fr));
	gap: 4px;
	padding: 4px;
	background-color: var(--panel_edge);
	border: 3px solid var(--plum);
	border-radius: 20px;
}

.board_tab
{
	appearance: none;
	-webkit-appearance: none;
	min-width: 0;
	min-height: 56px;
	margin: 0;
	padding: 0 6px;
	background: transparent;
	border: 0;
	border-radius: 15px;
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
	cursor: pointer;
}

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

.board_tab:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 2px;
}

/* Below 381 px the panel gives the tab row more width and the labels a smaller size, so that the four tabs fit at
   320 px in English, Spanish and Portuguese. */
@media (max-width: 380px)
{
	.leaderboard_panel
	{
		padding-right: 8px;
		padding-left: 8px;
	}

	.board_tabs
	{
		gap: 3px;
		padding: 3px;
	}

	.board_tab
	{
		font-size: 14px;
		line-height: 18px;
	}
}

.board_period
{
	flex: none;
	min-height: 20px;
	font-size: 15px;
	line-height: 20px;
	text-align: center;
}

.board_content
{
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	min-height: 0;
	padding: 2px 2px 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	scrollbar-width: thin;
	scrollbar-color: var(--panel_edge) transparent;
}

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

/* Two lines per row: the name gets the full width, so 24-character names fit on a 320 px phone. */
.board_row
{
	display: grid;
	grid-template-columns: minmax(36px, auto) minmax(0, 1fr) auto;
	grid-template-areas: "rank name name" "rank height score";
	align-items: center;
	column-gap: 8px;
	min-height: 48px;
	padding: 5px 12px 5px 5px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 16px;
}

.board_row.is_me
{
	background-color: #ffeb99;
}

.board_row.is_streamer:not(.is_me)
{
	background-color: #ffd6e2;
}

.board_heart
{
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-right: 5px;
	vertical-align: -3px;
}

.board_beat
{
	margin-right: 6px;
	padding: 1px 8px;
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
	color: var(--plum);
	background-color: var(--white);
	border-radius: 999px;
}

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

.rank_1 .board_rank
{
	background-color: #ffc928;
}

.rank_2 .board_rank
{
	background-color: #dfe6ee;
}

.rank_3 .board_rank
{
	background-color: #e9a26b;
}

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

.board_you
{
	margin-right: 6px;
	padding: 1px 8px;
	font-size: 12px;
	line-height: 16px;
	background-color: var(--pink);
	border-radius: 999px;
}

/* The second line never reaches the score. Where the height does not fit beside the label before it, it wraps to a
   second line that the line's height hides; a label that does not fit alone ends in an ellipsis. */
.board_height
{
	grid-area: height;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	min-width: 0;
	height: 18px;
	overflow: hidden;
	font-size: 13px;
	line-height: 18px;
	color: rgba(59, 42, 74, 0.75);
	white-space: nowrap;
}

.board_height > *
{
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.board_you
{
	font-weight: 700;
	color: var(--plum);
}

@media (max-width: 340px)
{
	.board_name,
	.board_special_name
	{
		font-size: 14px;
	}
}

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

/* With the look and the buddy of each score, the figure stands between the rank and the name, as tall as the row's
   two lines, so that the row keeps its height. */
.board_row.has_figure
{
	grid-template-columns: minmax(36px, auto) 40px minmax(0, 1fr) auto;
	grid-template-areas: "rank figure name name" "rank figure height score";
}

.board_figure
{
	grid-area: figure;
	align-self: center;
	width: 40px;
	height: 36px;
}

/* On the champion's line and her line, a smaller figure takes the icon's place and the crown or the heart sits on its
   top left corner, so that the caption keeps its room. */
.board_special.has_figure
{
	grid-template-columns: 34px minmax(0, 1fr) auto;
	grid-template-areas: "figure name name" "figure caption score";
}

.board_special .board_figure
{
	width: 34px;
	height: 30.6px;
}

.board_special.has_figure .board_special_icon
{
	position: relative;
	z-index: 1;
	grid-area: figure;
	align-self: start;
	justify-self: start;
	width: 20px;
	height: 20px;
	margin: -4px 0 0 -2px;
}

/* Phones of 340 px and less have no room for the figures: the rows and lines keep their plain form. */
@media (max-width: 340px)
{
	.board_figure
	{
		display: none;
	}

	.board_row.has_figure
	{
		grid-template-columns: minmax(36px, auto) minmax(0, 1fr) auto;
		grid-template-areas: "rank name name" "rank height score";
	}

	.board_pinned .board_row.has_figure
	{
		grid-template-areas: "name name name" "rank height score";
	}

	.board_special.has_figure
	{
		grid-template-columns: 34px minmax(0, 1fr) auto;
		grid-template-areas: "icon name name" "icon caption score";
	}

	.board_special.has_figure .board_special_icon
	{
		z-index: auto;
		grid-area: icon;
		align-self: auto;
		justify-self: auto;
		width: 30px;
		height: 30px;
		margin: 0 0 0 2px;
	}
}

.board_pinned
{
	padding-top: 8px;
	border-top: 3px dotted var(--panel_edge);
}

.board_special
{
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr) auto;
	grid-template-areas: "icon name name" "icon caption score";
	align-items: center;
	column-gap: 8px;
	padding: 6px 12px 6px 6px;
	background-color: #fff3b0;
	border: 3px solid var(--plum);
	border-radius: 16px;
}

.board_streamer
{
	background-color: #ffd6e2;
}

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

.board_special_text
{
	display: contents;
	text-align: left;
}

.board_special_name
{
	grid-area: name;
	overflow: hidden;
	text-align: left;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.board_special_caption
{
	grid-area: caption;
	text-align: left;
	font-size: 13px;
	line-height: 17px;
}

.board_special_height
{
	font-size: 13px;
	font-weight: 500;
	color: rgba(59, 42, 74, 0.75);
}

.board_special_score
{
	grid-area: score;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-weight: 700;
	white-space: nowrap;
}

.board_state
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 28px 8px;
	font-size: 17px;
	line-height: 24px;
	text-align: center;
}

.board_back
{
	flex: none;
	width: 100%;
}

/* Player cards on the boards: every row, the champion's line and Fabi's line are buttons that open that player's
   card; "My card" stands beside "Back"; the first-time tip shows over the top of the list. */

button.board_row,
button.board_special
{
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	margin: 0;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

button.board_row:focus-visible,
button.board_special:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 2px;
}

button.board_row:active,
button.board_special:active
{
	transform: translateY(1px);
}

.board_actions
{
	display: flex;
	flex: none;
	gap: 10px;
}

.board_actions .board_back
{
	width: auto;
}

.board_tip_layer
{
	top: auto;
	bottom: 88px;
	z-index: 2;
	padding: 0 12px;
}

.board_tip_layer .hint_tip
{
	max-width: 100%;
}

@media (orientation: landscape) and (max-height: 540px)
{
	.leaderboard_panel .board_actions
	{
		grid-area: back;
	}

	.board_tip_layer
	{
		bottom: 80px;
	}
}

/* "My runs": the own last runs in the leaderboard's frame, over the own card, which hides while the list shows. Each
   row has the board's look: the tower's calendar or the free run's height arrow, the day on the first line, the height
   and the score on the second; a run that can be watched is a button with the round yellow play button, any other row
   has none. The line under the heading keeps its room, so that a line that comes moves no row. */

html.shows_my_runs .player_card_overlay,
html.shows_my_runs .player_card_overlay *
{
	visibility: hidden !important;
}

.my_runs_screen
{
	z-index: 6;
}

.my_runs_panel .panel_heading:focus
{
	outline: none;
}

.my_runs_row
{
	appearance: none;
	-webkit-appearance: none;
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr) auto 38px;
	grid-template-areas: "board day day play" "board height score play";
	align-items: center;
	column-gap: 8px;
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 4px 6px 4px 8px;
	color: var(--plum);
	font: inherit;
	text-align: left;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 16px;
}

button.my_runs_row
{
	cursor: pointer;
}

button.my_runs_row:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 2px;
}

button.my_runs_row:active
{
	transform: translateY(1px);
}

.my_runs_board
{
	grid-area: board;
	display: inline-flex;
}

.my_runs_board_icon
{
	width: 28px;
	height: 28px;
}

.my_runs_day
{
	grid-area: day;
	min-width: 0;
	overflow: hidden;
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.my_runs_height
{
	grid-area: height;
	font-size: 13px;
	line-height: 18px;
	white-space: nowrap;
}

.my_runs_score
{
	grid-area: score;
	font-size: 17px;
	font-weight: 700;
	line-height: 20px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.my_runs_play
{
	grid-area: play;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding-left: 2px;
	background-color: var(--duck_yellow);
	border: 3px solid var(--plum);
	border-radius: 50%;
}

.my_runs_play_icon
{
	width: auto;
	height: 20px;
}

.my_runs_play_icon svg
{
	width: auto;
}

.my_runs_row.is_waiting .my_runs_play
{
	opacity: 0.55;
}

/* "Show more" at the end of the rows: a secondary button inside the scrolling content, with the line of a failed
   request under it in the list's own words and size. While the next rows are on their way the button keeps its box,
   dims and takes no tap. */
.my_runs_more_block
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 6px 0 2px;
}

.my_runs_more.is_waiting
{
	opacity: 0.55;
	cursor: default;
}

.my_runs_more.is_waiting:active
{
	transform: none;
	box-shadow: 0 5px 0 var(--plum);
}

.my_runs_more_line
{
	margin: 0;
	font-size: 17px;
	line-height: 24px;
	text-align: center;
}

/* Below 381 px the rows give the day and the numbers more width, as the boards' panel does. */
@media (max-width: 380px)
{
	.my_runs_row
	{
		grid-template-columns: 26px minmax(0, 1fr) auto 36px;
		column-gap: 6px;
	}

	.my_runs_board_icon
	{
		width: 26px;
		height: 26px;
	}

	.my_runs_play
	{
		width: 36px;
		height: 36px;
	}
}

/* A watched run: the game's view with the HUD, whose pause button is the close button, a pill under the HUD that
   says whose run it is, and a cream bar at the bottom with the time line, its knob and the run's length, the round
   play or pause button and the speeds. At the run's end the HUD, the pill and the bar give way to a panel over the
   last view, dimmed as under a player card. The screens and the cards under the watch hide and keep their state. */

html[data-phase="watching"] .screen_layer,
html[data-phase="watching"] .screen_layer *
{
	visibility: hidden !important;
}

.watch_screen
{
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.watch_pill
{
	position: absolute;
	left: 50%;
	top: calc(var(--column_safe_top) + 84px);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: calc(100% - 32px);
	padding: 3px 14px 3px 9px;
	color: var(--plum);
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 3px 0 var(--plum_20);
	font-size: 16px;
	font-weight: 700;
	line-height: 22px;
	white-space: nowrap;
	transform: translateX(-50%);
}

.watch_pill_icon
{
	width: 24px;
	height: 24px;
}

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

/* While a run is watched, the banners stand 8 px under the pill: the pill's top at 84 px and its 36 px, the icon's
   24 px with 3 px of padding and a 3 px border above and below. A played run's banners keep their place. */
html[data-phase="watching"] .banner_layer
{
	top: calc(var(--column_safe_top) + 128px);
}

.watch_bar
{
	position: absolute;
	left: 50%;
	bottom: calc(var(--column_safe_bottom) + 12px);
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: min(100% - 24px, max(var(--column_width) - 24px, 336px), 440px);
	padding: 10px 12px 8px;
	color: var(--plum);
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 20px;
	box-shadow: 0 6px 0 var(--plum_20);
	transform: translateX(-50%);
	pointer-events: auto;
}

.watch_time
{
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 4px;
}

/* The line takes taps and drags on a taller band than it shows. */
.watch_line
{
	position: relative;
	flex: 1 1 auto;
	height: 10px;
	background-color: var(--panel_edge);
	border: 2px solid var(--plum);
	border-radius: 999px;
	cursor: pointer;
	touch-action: none;
}

.watch_line::before
{
	content: "";
	position: absolute;
	inset: -16px -10px;
}

.watch_line:focus-visible
{
	outline: 4px solid var(--focus_ring);
	outline-offset: 6px;
}

.watch_line_fill
{
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 0;
	background-color: var(--pink);
	border-radius: 999px;
}

.watch_line_knob
{
	position: absolute;
	top: 50%;
	left: 0;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	background-color: var(--white);
	border: 3px solid var(--plum);
	border-radius: 50%;
}

.watch_time_text
{
	flex: none;
	font-size: 16px;
	font-weight: 700;
	line-height: 20px;
	font-variant-numeric: tabular-nums;
}

.watch_controls
{
	display: flex;
	align-items: center;
	gap: 12px;
}

.watch_play
{
	flex: none;
	width: 52px;
	height: 52px;
	margin: 0 0 4px;
	box-shadow: 0 4px 0 var(--plum);
}

.watch_play .button_icon
{
	width: 30px;
	height: 30px;
}

.watch_speeds
{
	flex: 1 1 auto;
}

.watch_speed
{
	min-height: 44px;
	font-size: 18px;
}

.watch_end
{
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--column_safe_top) + 16px) calc(var(--safe_right) + 16px) calc(var(--column_safe_bottom) + 16px) calc(var(--safe_left) + 16px);
	background-color: rgba(59, 42, 74, 0.42);
	pointer-events: auto;
}

.watch_end_panel
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	width: min(100%, 320px);
	padding: 20px 18px 16px;
	text-align: center;
}

.watch_end_name
{
	font-size: 26px;
	font-weight: 700;
	line-height: 32px;
}

.watch_end_name:focus
{
	outline: none;
}

.watch_end_label
{
	margin-top: 8px;
	font-size: 16px;
	line-height: 20px;
}

.watch_end_score
{
	font-size: 50px;
	font-weight: 700;
	line-height: 56px;
	font-variant-numeric: tabular-nums;
}

.watch_end_height
{
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
}

.watch_end_height_icon
{
	width: 26px;
	height: 26px;
}

.watch_end_line
{
	margin-top: 10px;
	font-size: 18px;
	line-height: 24px;
}

.watch_end_actions
{
	display: flex;
	flex-direction: column;
	align-self: stretch;
	gap: 10px;
	margin-top: 16px;
}

/* A row of buttons that fit_button_row() fits: each button as wide as its icon and label need, the longer label in
   the wider button; the step it takes sets the gap, the padding and the label's size, and may hide the icons. */

.button_row .button
{
	flex: 1 1 auto;
	gap: var(--button_gap, 10px);
	padding: 0 var(--button_padding, 24px);
	font-size: var(--button_label, 20px);
}

.button_row.without_icons .button_icon
{
	display: none;
}

/* The player card: a collector card over the dimmed boards. The frame, the ribbon and the scene are drawn for the
   size the card takes; the scene's window takes the height the rest leaves, between its least and its most. It
   shares the layer of the other cards, and the break card, the last of them, stands above it. */

.player_card_overlay
{
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: calc(var(--column_safe_top) + 12px) calc(var(--safe_right) + 16px) calc(var(--column_safe_bottom) + 12px) calc(var(--safe_left) + 16px);
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	-webkit-overflow-scrolling: touch;
	background-color: rgba(59, 42, 74, 0.42);
	pointer-events: auto;
}

/* While a card is open, the buttons of the screen under it hide and keep their place: the boards' tabs with their bar,
   "My card" and "Back"; under a card that the address opened, every button of the title and the column of its actions
   with the lines of today's duck and last week's number one. No part of them shows beside or between the card's parts.
   The boards' rows stay, dimmed around the card. */

html.shows_player_card .title_screen button,
html.shows_player_card .title_actions,
html.shows_player_card .board_tabs,
html.shows_player_card .leaderboard_screen button:not(.board_row):not(.board_special)
{
	visibility: hidden;
}

.player_card_dialog
{
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 10px;
	width: min(var(--screen_width), 400px);
	max-height: 100%;
	margin: auto 0;
}

.player_card
{
	--card_band: 16px;
	--card_plate: 42px;
	position: relative;
	display: flex;
	flex: 0 1 auto;
	flex-direction: column;
	min-height: 0;
	padding: var(--card_band) var(--card_band) var(--card_plate);
	color: var(--plum);
}

.player_card_frame_art
{
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.player_card_frame,
.player_card_ribbon_shape,
.player_card_seal_shape,
.player_card_medal_shape
{
	display: block;
	width: 100%;
	height: 100%;
}

.player_card_inner
{
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	min-height: 0;
	padding: 10px 10px 8px;
}

/* The top holds the scene's window and the seal; the ribbon lies in front of the seal, so that on a short page the seal's
   tails tuck behind it. The seal's drawing (player_card_art.js) has a view box of 86 x 108 units at the seal's size in
   px, and its box starts 10 units above the top's edge; its round part ends 81.5 units down (the rosette's bumps at 80
   and half of their outline of 3), 71.5 px below the top's edge. The ribbon reaches 30 px up into the top, and its band
   starts 2.5 px below the ribbon's edge (at 4 px, with half of its outline of 3). At the top's least height the round
   part ends 2 px above the band: 71.5 + 2 + 30 - 2.5 = 101 px. On a page too short for the card with that top the
   dialog keeps the card's height and the overlay scrolls (PlayerCard.set_least_height()). */
.player_card_top
{
	position: relative;
	display: flex;
	flex: 1 1 290px;
	flex-direction: column;
	width: 100%;
	min-height: 101px;
	max-height: 290px;
	container-type: size;
}

.player_card_window
{
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	background-color: #f7fbff;
	border: 3px solid var(--plum);
	border-radius: 16px;
}

.player_card[data-frame="fabi"] .player_card_window
{
	background-color: #5a4680;
}

.player_card_scene
{
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

/* Behind the ribbon the seal ends at the top edge of the ribbon's ear, 14 px below the ribbon's edge, so that no tail's
   tip shows beside the ear's notch. The seal reaches 98 px below the top's edge and the ribbon 30 px up into the top, so
   on a top lower than 98 + 30 - 14 = 114 px (--tuck_height) the seal loses that height less the top's (100cqh, the top
   being a size container). A higher top clips nothing. */
.player_card_seal
{
	--seal_size: 86px;
	--tuck_height: 114px;
	position: absolute;
	top: calc(var(--seal_size) * -10 / 86);
	left: calc(var(--seal_size) * -10 / 86);
	z-index: 1;
	width: var(--seal_size);
	height: calc(var(--seal_size) * 108 / 86);
}

@container (max-height: 113.99px)
{
	.player_card_seal
	{
		clip-path: inset(0 0 max(0px, calc(var(--tuck_height) - 100cqh)) 0);
	}
}

.player_card_seal_text
{
	position: absolute;
	top: calc(var(--seal_size) * 4 / 86);
	left: calc(var(--seal_size) * 4 / 86);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: calc(var(--seal_size) * 78 / 86);
	height: calc(var(--seal_size) * 78 / 86);
}

.player_card_seal_word
{
	font-size: 12px;
	font-weight: 700;
	line-height: 15px;
}

.player_card_seal_number
{
	max-width: 100%;
	min-height: 36px;
	margin-top: -3px;
	font-size: 30px;
	font-weight: 700;
	line-height: 36px;
	white-space: nowrap;
}

.player_card_ribbon
{
	position: relative;
	z-index: 2;
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 96%;
	min-height: 54px;
	margin-top: -30px;
	padding: 5px 46px 11px;
}

.player_card_ribbon_art
{
	position: absolute;
	inset: 0;
}

.player_card_name
{
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	max-width: 100%;
	min-height: 38px;
	margin: 0;
	font-size: 25px;
	font-weight: 700;
	line-height: 30px;
	text-align: center;
	white-space: nowrap;
}

.player_card_name:focus,
.player_card_missing:focus
{
	outline: none;
}

.player_card_name.is_placeholder .player_card_name_text
{
	opacity: 0.6;
}

/* A name too wide for one line at 12 px takes two lines of about equal width (PlayerCard.fit_name()), with 4 px of air
   above and below them inside the ribbon's band, which grows with them. */
.player_card_name.is_two_lines
{
	padding: 4px 0;
	line-height: 1.15;
}

.player_card_heart,
.player_card_crown
{
	width: 24px;
	height: 24px;
}

/* The line under the name keeps the height of Fabi's "Streamer" pill on every card, also while the card loads and when
   it stays empty, so that no part of the card moves when the answer comes. It holds the pill, the level's title, or on
   a card whose player's game has not reported the line that more shows after the next visit, in up to two lines. */

.player_card_title
{
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 32px;
	margin: 2px 0 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 22px;
}

.player_card_title_badge
{
	display: flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
}

.player_card_title_text
{
	min-width: 0;
	white-space: nowrap;
}

.player_card_title.is_streamer .player_card_title_badge
{
	padding: 2px 14px 2px 6px;
	background-color: #fff3b0;
	border: 2.5px solid var(--plum);
	border-radius: 999px;
}

.player_card_report_note
{
	max-width: 100%;
	font-size: 13px;
	font-weight: 600;
	line-height: 15px;
	text-align: center;
	white-space: nowrap;
	color: rgba(59, 42, 74, 0.75);
}

.player_card_numbers
{
	display: grid;
	flex: none;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 7px;
	width: 100%;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.player_card_number
{
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
	padding: 6px 3px 5px;
	text-align: center;
	background-color: var(--white);
	border: 2.5px solid var(--plum);
	border-radius: 14px;
}

.player_card_number_icon
{
	width: 24px;
	height: 24px;
}

.player_card_value
{
	display: block;
	max-width: 100%;
	min-height: 22px;
	margin-top: 1px;
	font-size: 18px;
	font-weight: 700;
	line-height: 22px;
	white-space: nowrap;
}

.player_card_label
{
	display: block;
	max-width: 100%;
	font-size: 12.5px;
	line-height: 15px;
}

/* The tile "Time played": a private time stands as the word with a closed eye in the value's line. On the own card the
   control covers the whole tile, its border and rounded corners included, so that a tap anywhere on it changes who
   sees the time, and shows its state with an icon and a word in a pill at the tile's foot, for which the tile keeps
   room; drawn as others see it, for the picture to share, the control keeps that room and does not show. The
   first-time tip stands above the tile, from its left edge across the grid. */

.player_card_time
{
	position: relative;
}

.player_card_time.has_control_room
{
	padding-bottom: 27px;
}

.player_card_time_mark
{
	width: auto;
	height: 0.9em;
	margin-right: 3px;
	vertical-align: -0.1em;
}

.player_card_time_mark svg,
.player_card_time_icon svg
{
	width: auto;
}

.player_card_time_control
{
	appearance: none;
	-webkit-appearance: none;
	position: absolute;
	inset: -2.5px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 5.5px 7.5px;
	color: inherit;
	font: inherit;
	background: transparent;
	border: none;
	border-radius: inherit;
	cursor: pointer;
}

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

.player_card_time_state
{
	display: inline-flex;
	align-items: center;
	gap: 3px;
	max-width: 100%;
	min-height: 20px;
	padding: 0 7px;
	font-size: 12px;
	font-weight: 700;
	line-height: 16px;
	background-color: var(--cream);
	border: 2px solid var(--plum);
	border-radius: 999px;
	transition: transform 70ms ease-out, opacity 150ms ease;
}

.player_card_time_control[aria-pressed="true"] .player_card_time_state
{
	background-color: var(--duck_yellow);
}

.player_card_time_control:active .player_card_time_state
{
	transform: translateY(1px);
}

.player_card_time_control.is_pending .player_card_time_state
{
	opacity: 0.55;
}

.player_card_time_icon
{
	width: auto;
	height: 14px;
}

.player_card_time_word
{
	min-width: 0;
	white-space: nowrap;
}

.player_card_time.is_drawn_as_others .player_card_time_control
{
	visibility: hidden;
}

.player_card_time .player_card_tip_layer
{
	top: auto;
	right: auto;
	bottom: calc(100% + 6px);
	left: -3px;
	z-index: 3;
	justify-content: flex-start;
	width: calc(300% + 16px);
}

.player_card_time .player_card_tip_layer .hint_tip
{
	max-width: 100%;
}

/* The tile "Runs" of the own card, the way into "My runs": raised on a plum edge below its outline, as the game's
   buttons are, with the round yellow play button of the list's rows in place of its small icon. The outline keeps the
   plain tile's width and the circle takes the icon's room, so that the tile keeps the plain tile's box, also in the
   picture to share, which draws the plain tile. A button covers the whole tile, so that a tap anywhere on it opens the
   list. The first-time tip stands above the tile, from its right edge across the grid. Every other card has the plain
   tile. */

.player_card_runs
{
	position: relative;
}

.player_card_runs.is_button
{
	box-shadow: 0 4px 0 var(--plum);
}

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

.player_card_runs_play
{
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: -2px 0;
	padding-left: 2px;
	background-color: var(--duck_yellow);
	border: 2.5px solid var(--plum);
	border-radius: 50%;
}

.player_card_runs_play_icon
{
	width: auto;
	height: 15px;
}

.player_card_runs_play_icon svg
{
	width: auto;
}

.player_card_runs_control
{
	appearance: none;
	-webkit-appearance: none;
	position: absolute;
	inset: -2.5px;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 14px;
	cursor: pointer;
}

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

.player_card_runs .player_card_tip_layer
{
	top: auto;
	right: -2.5px;
	bottom: calc(100% + 6px);
	left: auto;
	z-index: 3;
	justify-content: flex-end;
	width: calc(300% + 16px);
}

.player_card_runs .player_card_tip_layer .hint_tip
{
	max-width: 100%;
}

/* The circle follows the small icons' sizes of narrow phones and of the shortest pages. */
@media (max-width: 380px)
{
	.player_card_runs_play
	{
		width: 24px;
		height: 24px;
	}

	.player_card_runs_play_icon
	{
		height: 13px;
	}
}

@media (max-height: 600px)
{
	.player_card_runs_play
	{
		width: 22px;
		height: 22px;
	}

	.player_card_runs_play_icon
	{
		height: 12px;
	}
}

/* The settings' switch for the time played, under the sentence about the card: dimmed while a change is on its way. */

.card_time_row.is_pending
{
	opacity: 0.6;
}

.player_card_medals
{
	display: grid;
	flex: none;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 2px;
	width: 100%;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.player_card_medal
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 0;
}

.player_card_medal_picture
{
	position: relative;
	display: block;
	width: 52px;
	height: 60px;
}

.player_card_medal_shape
{
	position: absolute;
	inset: 0;
}

.player_card_medal_icon
{
	position: absolute;
	top: 40%;
	left: 27%;
	width: 46%;
	height: 40%;
}

.player_card_medal.is_open .player_card_medal_icon
{
	opacity: 0.4;
}

.player_card_medal_label
{
	display: block;
	max-width: 100%;
	font-size: 12.5px;
	font-weight: 700;
	line-height: 15px;
	text-align: center;
}

.player_card_medal.is_open .player_card_medal_label
{
	color: rgba(59, 42, 74, 0.7);
}

.player_card_missing
{
	margin: auto 0;
	padding: 48px 12px;
	font-size: 20px;
	font-weight: 700;
	line-height: 26px;
	text-align: center;
}

.player_card_since
{
	position: absolute;
	right: calc(var(--card_plate) - 4px);
	bottom: 0;
	left: calc(var(--card_plate) - 4px);
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--card_plate);
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	white-space: nowrap;
}

.player_card .is_wrapped
{
	white-space: normal;
	overflow-wrap: anywhere;
}

.player_card_push,
.player_card_status
{
	flex: none;
	margin: 0;
	padding: 8px 12px;
	font-size: 16px;
	font-weight: 700;
	line-height: 21px;
	text-align: center;
	color: var(--plum);
	background-color: var(--cream);
	border: 3px solid var(--plum);
	border-radius: 16px;
}

.player_card_status:empty
{
	display: none;
}

.player_card_actions
{
	display: flex;
	flex: none;
	gap: 12px;
}

/* Narrow phones: a thinner frame and smaller parts, so that the card and its buttons fit at 320 x 568. */
@media (max-width: 380px)
{
	.player_card
	{
		--card_band: 12px;
		--card_plate: 36px;
	}

	.player_card_inner
	{
		padding: 8px 7px 6px;
	}

	/* The seal of 72 px reaches 82 px down and the ribbon 26 px up: 82 + 26 - 14 = 94 px. */
	.player_card_seal
	{
		--seal_size: 72px;
		--tuck_height: 94px;
	}

	/* The seal of 72 px: its round part ends 59.9 px below the top's edge, and the ribbon reaches 26 px up:
	   59.9 + 2 + 26 - 2.5 = 85.4 px. */
	.player_card_top
	{
		min-height: 86px;
	}

	.player_card_seal_word
	{
		font-size: 10.5px;
		line-height: 13px;
	}

	.player_card_seal_number
	{
		min-height: 32px;
		font-size: 26px;
		line-height: 32px;
	}

	.player_card_ribbon
	{
		min-height: 50px;
		margin-top: -26px;
		padding: 5px 40px 11px;
	}

	.player_card_name
	{
		min-height: 34px;
		font-size: 22px;
		line-height: 26px;
	}

	.player_card_title
	{
		font-size: 16px;
		line-height: 20px;
	}

	.player_card_report_note
	{
		font-size: 12px;
		line-height: 14px;
	}

	.player_card_numbers
	{
		gap: 5px;
		margin-top: 8px;
	}

	.player_card_number
	{
		padding: 5px 2px 4px;
		border-radius: 12px;
	}

	.player_card_number_icon
	{
		width: 20px;
		height: 20px;
	}

	.player_card_value
	{
		min-height: 20px;
		font-size: 16px;
		line-height: 20px;
	}

	.player_card_time.has_control_room
	{
		padding-bottom: 25px;
	}

	.player_card_time_state
	{
		gap: 2px;
		padding: 0 4px;
	}

	.player_card_time_icon
	{
		height: 12px;
	}

	.player_card_label
	{
		font-size: 11.5px;
		line-height: 14px;
	}

	.player_card_medals
	{
		margin-top: 8px;
	}

	.player_card_medal_picture
	{
		width: 44px;
		height: 51px;
	}

	.player_card_medal_label
	{
		font-size: 11.5px;
		line-height: 14px;
	}

	.player_card_since
	{
		font-size: 13.5px;
	}

	.player_card_push,
	.player_card_status
	{
		padding: 6px 10px;
		font-size: 15px;
		line-height: 19px;
	}
}

/* Short pages: tighter gaps and smaller medals leave the scene its room. */
@media (max-height: 700px)
{
	.player_card_numbers
	{
		margin-top: 7px;
	}

	.player_card_medals
	{
		margin-top: 7px;
	}

	.player_card_medal_picture
	{
		width: 42px;
		height: 48px;
	}

	/* The line of the card without a name sits 6 px from the card and from the buttons, with less padding, at 12 px, the
	   size of the card's line about the next visit on narrow pages. */
	.player_card_push
	{
		margin: -4px 0;
		padding: 4px 10px;
		font-size: 12px;
		line-height: 14px;
	}
}

/* The shortest pages, such as 320 x 568: a tighter inside, tighter tiles and smaller medals leave the scene its room. */
@media (max-height: 600px)
{
	.player_card_inner
	{
		padding: 6px 6px 5px;
	}

	.player_card_numbers
	{
		gap: 4px;
	}

	.player_card_number
	{
		padding: 4px 2px 3px;
	}

	.player_card_number_icon
	{
		width: 18px;
		height: 18px;
	}

	.player_card_medal_picture
	{
		width: 38px;
		height: 44px;
	}
}

/* A phone on its side: the card keeps a scene of its own height, and the page scrolls. */
@media (orientation: landscape) and (max-height: 540px)
{
	.player_card_dialog
	{
		max-height: none;
	}

	.player_card_top
	{
		flex: none;
		height: 190px;
	}
}

/* Title extras */

/* The daily button says the streak in a second line, inside the button's own height: "Day 6 waits" with a duckling in
   the icon's place, or "5 days in a row" with a check. Where the button shows no icon, the waiting streak's duckling
   stands small in the line. */
.daily_button
{
	position: relative;
}

.daily_text
{
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
}

.daily_text .button_label
{
	line-height: 22px;
}

.daily_streak_line
{
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: 100%;
	font-size: 15px;
	line-height: 18px;
}

.daily_streak_line[hidden]
{
	display: none;
}

.daily_streak_text
{
	overflow: hidden;
	text-overflow: ellipsis;
}

.daily_streak_check
{
	flex: none;
	width: 16px;
	height: 16px;
}

.daily_streak_check[hidden],
.daily_streak_duck,
.daily_streak_line_duck
{
	display: none;
}

.daily_button[data-streak="waits"]
{
	background-color: #ffe4ec;
}

.daily_button[data-streak="waits"] .daily_streak_line
{
	color: #a8325a;
}

.daily_button[data-streak="waits"].has_streak_duck .button_icon
{
	display: none;
}

.daily_button[data-streak="waits"].has_streak_duck .daily_streak_duck
{
	display: block;
	flex: none;
	width: 40px;
	height: 40px;
	margin: -6px -2px -4px -8px;
}

.daily_streak_line_duck
{
	flex: none;
	width: 18px;
	height: 18px;
}

@media (hover: hover) and (pointer: fine)
{
	.daily_button[data-streak="waits"]:hover
	{
		background-color: #ffeef3;
	}
}

.best_line[data-kind="streamer"]
{
	background-color: #ffd6e2;
}

.best_line[data-kind="champion"]
{
	background-color: #fff3b0;
}

html.is_starting .play_button,
html.is_starting .daily_button,
html.is_starting .play_again_button
{
	opacity: 0.75;
	cursor: progress;
}

.settings_header
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.streamer_mark
{
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px 2px 4px;
	font-size: 13px;
	font-weight: 700;
	line-height: 18px;
	background-color: #fff3b0;
	border: 2px solid var(--plum);
	border-radius: 999px;
}

.streamer_crown
{
	width: 20px;
	height: 20px;
}

/* Stream notices and stream mode */

.stream_feed
{
	position: absolute;
	left: max(calc(var(--column_left) + 10px), calc(var(--safe_left) + 10px));
	top: calc(var(--column_safe_top) + 96px);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	max-width: min(70%, 260px);
	pointer-events: none;
}

.stream_line
{
	padding: 2px 8px;
	font-size: 10px;
	font-weight: 700;
	line-height: 14px;
	background-color: rgba(255, 246, 230, 0.82);
	border: 2px solid rgba(59, 42, 74, 0.85);
	border-radius: 999px;
	box-shadow: 0 2px 0 var(--plum_20);
	opacity: 0.9;
	overflow-wrap: anywhere;
	animation: stream_line_in 260ms cubic-bezier(0.2, 1.4, 0.4, 1);
	transition: opacity 400ms ease, transform 400ms ease;
}

.stream_line.is_leaving
{
	opacity: 0;
	transform: translateX(-16px);
}

.stream_status
{
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 2px 10px;
	font-size: 13px;
	font-weight: 700;
	line-height: 18px;
	background-color: var(--cream);
	border: 2px solid var(--plum);
	border-radius: 999px;
}

.stream_status::before
{
	content: "";
	width: 10px;
	height: 10px;
	background-color: var(--panel_edge);
	border: 2px solid var(--plum);
	border-radius: 50%;
}

.stream_status[data-state="open"]::before
{
	background-color: var(--green);
}

.stream_status[data-state="refused"]::before,
.stream_status[data-state="closed"]::before
{
	background-color: var(--heart);
}

.stream_mode .hud_layer,
.stream_mode .screen_layer
{
	--column_left: 0px;
	--column_top: 0px;
	--column_width: var(--stream_inner_width);
	--column_safe_top: 0px;
	--column_safe_bottom: 0px;
	--screen_width: min(var(--stream_inner_width) - 32px, 440px);
	left: var(--stream_left);
	top: var(--stream_top);
	right: auto;
	bottom: auto;
	width: calc(var(--stream_width) / var(--ui_scale));
	height: calc(var(--stream_height) / var(--ui_scale));
	transform: scale(var(--ui_scale));
	transform-origin: 0 0;
}

.stream_mode .stream_feed
{
	left: 10px;
	top: 96px;
}

.hint_tip_layer
{
	position: absolute;
	left: 0;
	right: 0;
	top: calc(var(--column_safe_top) + 150px);
	display: flex;
	justify-content: center;
	pointer-events: none;
}

.hint_tip
{
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: var(--screen_width);
	padding: 4px 14px 4px 6px;
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
	background-color: var(--cream);
	border: 2.5px solid var(--plum);
	border-radius: 999px;
	box-shadow: 0 3px 0 var(--plum_20);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 300ms ease, transform 300ms ease;
}

.hint_tip.is_visible
{
	opacity: 1;
	transform: none;
}

.hint_tip_icon
{
	width: 26px;
	height: 26px;
}

.stream_mode .stream_status
{
	top: auto;
	right: 12px;
	bottom: 12px;
}

/* The safe area of a stream frame is about 400 x 500 layout pixels: the compact layout of short phones, without the
   tagline. The bridge's status takes the bottom right corner and the version the bottom left one; the title ends
   above them. */
.stream_mode .title_screen
{
	gap: 8px;
	padding-top: 10px;
	padding-bottom: 46px;
}

.stream_mode .title_header
{
	margin-top: 0;
	gap: 8px;
}

/* The logo is about 4.3 em wide and stays between the corner buttons, which take 76 px on each side. */
.stream_mode .logo
{
	font-size: min(56px, calc((var(--column_width) - 152px) / 4.3));
}

.stream_mode .tagline
{
	display: none;
}

.stream_mode .title_version
{
	top: auto;
	bottom: 12px;
	left: 12px;
	transform: none;
}

.stream_mode .title_actions
{
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

.stream_mode .title_actions .play_button,
.stream_mode .title_actions .tower_line,
.stream_mode .title_actions .best_line
{
	grid-column: 1 / -1;
}

/* The daily button and the leaderboard share a row; the tower's line follows that row. */
.stream_mode .title_actions .tower_line
{
	order: 1;
}

.stream_mode .title_actions .best_line
{
	order: 2;
	justify-self: center;
}

.stream_mode .title_actions .button_large
{
	min-height: 60px;
}

.stream_mode .title_actions .button:not(.play_button)
{
	padding: 0 10px;
	font-size: 16px;
	line-height: 20px;
}

.stream_mode .title_actions .button:not(.play_button) .button_icon
{
	display: none;
}

.stream_mode .title_actions .daily_text .button_label
{
	line-height: 20px;
}

.stream_mode .title_actions .daily_streak_line
{
	font-size: 13px;
	line-height: 16px;
}

.stream_mode .title_actions .daily_button[data-streak="waits"].has_streak_duck .daily_streak_duck
{
	display: none;
}

.stream_mode .title_actions .daily_button[data-streak="waits"].has_streak_duck .daily_streak_line_duck
{
	display: block;
}

.stream_mode .bath_portrait
{
	width: 160px;
	height: 80px;
	margin: -14px auto -6px;
}

.stream_mode .game_over_body
{
	gap: 6px;
	padding: 20px 16px 10px;
}

.stream_mode .game_over_heading
{
	font-size: 22px;
	line-height: 26px;
}

.stream_mode .game_over_praise
{
	margin-top: -2px;
	font-size: 15px;
	line-height: 19px;
}

.stream_mode .score_value
{
	font-size: 38px;
	line-height: 42px;
}

.stream_mode .stat
{
	padding: 4px 4px 3px;
}

.stream_mode .stat_icon
{
	width: 22px;
	height: 22px;
}

.stream_mode .stat_value
{
	font-size: 17px;
	line-height: 21px;
}

.stream_mode .game_over_actions .button_large
{
	min-height: 60px;
}

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

.stream_unsafe
{
	position: absolute;
	background-color: rgba(255, 90, 110, 0.18);
	border: 3px dashed rgba(255, 90, 110, 0.8);
}

.stream_unsafe_top
{
	top: 0;
	left: 0;
	right: 0;
}

.stream_unsafe_bottom
{
	bottom: 0;
	left: 0;
	right: 0;
}

.stream_unsafe_right
{
	right: 0;
}

/* Short landscape screens: phones on their side */

@media (orientation: landscape) and (max-height: 540px)
{
	:root
	{
		--screen_width: min(100vw - 32px, 640px);
	}

	.title_screen
	{
		flex-direction: row;
		justify-content: center;
		align-items: center;
		gap: 36px;
		background-color: color-mix(in srgb, var(--page_background) 82%, transparent);
	}

	/* Help, settings and the version share the top left corner, above the brand's column, which starts below them;
	   the buttons' column on the right keeps the full height. */
	.how_button
	{
		top: calc(var(--safe_top) + 12px);
		left: calc(var(--safe_left) + 12px);
	}

	.settings_button
	{
		top: calc(var(--safe_top) + 12px);
		right: auto;
		left: calc(var(--safe_left) + 80px);
	}

	.title_version
	{
		left: calc(var(--safe_left) + 148px);
		transform: none;
	}

	.title_header
	{
		margin-top: 60px;
	}

	.logo
	{
		font-size: 56px;
	}

	.title_actions
	{
		width: 300px;
	}

	.title_actions .button_large
	{
		min-height: 60px;
	}

	.tutorial_overlay,
	.tutorial_overlay.is_visible
	{
		padding-top: calc(var(--column_safe_top) + 100px);
	}

	.tutorial_card
	{
		gap: 2px;
		padding: 12px 18px 14px;
	}

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

	.tutorial_jump
	{
		font-size: 22px;
		line-height: 28px;
	}

	.tutorial_air_jump
	{
		font-size: 16px;
		line-height: 21px;
	}

	.banner_layer
	{
		top: calc(var(--column_safe_top) + 76px);
	}

	.game_over_body
	{
		display: grid;
		grid-template-columns: 1fr 1.3fr;
		grid-template-areas:
			"heading heading"
			"praise praise"
			"score stats"
			"best ranks"
			"actions actions";
		gap: 8px 16px;
		align-items: center;
		padding: 24px 20px 12px;
	}

	.bath_portrait
	{
		display: none;
	}

	.game_over_heading
	{
		grid-area: heading;
	}

	.game_over_praise
	{
		grid-area: praise;
		margin-top: -4px;
	}

	.score_block
	{
		grid-area: score;
	}

	.stats
	{
		grid-area: stats;
	}

	.game_over_best
	{
		grid-area: best;
	}

	.rank_slot
	{
		grid-area: ranks;
	}

	/* The name box takes the ranks' row, which a run without a name leaves empty; the streak's line a row of its own. */
	.name_box,
	.streak_box
	{
		grid-column: 1 / -1;
	}

	.game_over_actions
	{
		grid-area: actions;
		flex-direction: row;
	}

	/* "Play again" shares the row with "Home" and "Share" and may give up its padding down to 6 px, so that both keep
	   their icons and labels in the panel's 490 px at 568 x 320. Its content stands in its middle, so that the smaller
	   padding shows only where the row is narrow. */
	.game_over_actions .button_large
	{
		min-height: 60px;
		padding-right: 6px;
		padding-left: 6px;
	}

	.settings_panel
	{
		max-height: 100%;
	}

	.settings_panel
	{
		gap: 10px;
		padding: 14px 18px 12px;
	}

	.settings_panel .panel_heading
	{
		font-size: 24px;
		line-height: 30px;
	}

	.settings_panel .panel_scroll
	{
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-areas:
			"toggles fields"
			"privacy privacy";
		align-content: start;
		align-items: start;
		gap: 12px 16px;
	}

	.settings_panel .toggle_list
	{
		grid-area: toggles;
	}

	.settings_panel .settings_fields
	{
		grid-area: fields;
	}

	.settings_panel .privacy_note
	{
		grid-area: privacy;
	}

	.leaderboard_panel
	{
		display: grid;
		grid-template-columns: auto 1fr;
		grid-template-rows: auto auto minmax(0, 1fr) auto;
		grid-template-areas:
			"heading tabs"
			"period period"
			"content content"
			"back back";
		gap: 6px 16px;
		padding: 12px 14px 10px;
	}

	.leaderboard_panel .panel_heading
	{
		grid-area: heading;
		align-self: center;
		font-size: 24px;
		line-height: 30px;
	}

	.leaderboard_panel .board_tabs
	{
		grid-area: tabs;
	}

	.leaderboard_panel .board_period
	{
		grid-area: period;
	}

	.leaderboard_panel .board_content
	{
		grid-area: content;
	}

	.leaderboard_panel .board_back
	{
		grid-area: back;
	}
}

/* Screens up to 760 px tall, in any orientation: the title's buttons in a shorter stack. Above 760 px the full stack
   fits on phones up to 430 px wide and in laptop windows, whose game column is as tall as the window. In portrait the
   run starts with Fabi at 62% of the screen height, and the shorter stack also keeps her visible. */

@media (max-height: 760px)
{
	.title_actions
	{
		container: title_actions / inline-size;
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.title_actions .play_button,
	.title_actions .tower_line,
	.title_actions .best_line
	{
		grid-column: 1 / -1;
	}

	/* The daily button and the leaderboard share a row; the tower's line follows that row. */
	.title_actions .tower_line
	{
		order: 1;
	}

	.title_actions .best_line
	{
		order: 2;
		justify-self: center;
	}

	/* The daily button and the leaderboard share a row, half each while both fit, and the longer content gets the wider
	   button: each is at least as wide as its content. */
	.title_actions .button:not(.play_button)
	{
		min-width: max-content;
		padding: 0 10px;
		font-size: 16px;
		line-height: 20px;
	}

	.title_actions .daily_text .button_label
	{
		line-height: 20px;
	}

	.title_actions .daily_streak_line
	{
		font-size: 13px;
		line-height: 16px;
	}
}

/* In the title's short stack the daily button and the leaderboard keep their icons, the waiting streak's duckling
   among them, by these steps, each where the row asks for it with 2 px to spare, measured with the longer streak line
   of three digits: a gap of 6 px and 6 px of padding, and only then both icons give way and the duckling stands small
   in the streak's line: in English and Portuguese on pages 320 px wide and on a phone on its side, in Spanish in the
   row of 260 px at 568 x 320. The labels are 16 px. */
@container title_actions (max-width: 343px)
{
	.title_actions .button:not(.play_button):lang(en)
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container title_actions (max-width: 309px)
{
	.title_actions .button:not(.play_button):lang(es)
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container title_actions (max-width: 348px)
{
	.title_actions .button:not(.play_button):lang(pt)
	{
		gap: 6px;
		padding: 0 6px;
	}
}

@container title_actions (max-width: 319px)
{
	.title_actions .button:not(.play_button):lang(en) .button_icon,
	.title_actions .daily_button[data-streak="waits"].has_streak_duck:lang(en) .daily_streak_duck
	{
		display: none;
	}

	.title_actions .daily_button[data-streak="waits"].has_streak_duck:lang(en) .daily_streak_line_duck
	{
		display: block;
	}
}

@container title_actions (max-width: 285px)
{
	.title_actions .button:not(.play_button):lang(es) .button_icon,
	.title_actions .daily_button[data-streak="waits"].has_streak_duck:lang(es) .daily_streak_duck
	{
		display: none;
	}

	.title_actions .daily_button[data-streak="waits"].has_streak_duck:lang(es) .daily_streak_line_duck
	{
		display: block;
	}
}

@container title_actions (max-width: 324px)
{
	.title_actions .button:not(.play_button):lang(pt) .button_icon,
	.title_actions .daily_button[data-streak="waits"].has_streak_duck:lang(pt) .daily_streak_duck
	{
		display: none;
	}

	.title_actions .daily_button[data-streak="waits"].has_streak_duck:lang(pt) .daily_streak_line_duck
	{
		display: block;
	}
}

/* Screens up to 640 px tall, in any orientation, give up the tagline and close up the brand's column, so that the
   wardrobe and the duck album fit on the title. */
@media (max-height: 640px)
{
	.tagline
	{
		display: none;
	}

	.title_header
	{
		gap: 8px;
	}
}

/* Portrait pages from 701 to 899 px tall, such as 390 x 844 and 402 x 874: a lower bath and tighter gaps between the
   panel's parts keep the whole of "Play again" on the first screen after a daily run, with the name box, the claim under
   way, the ranks or the line after "Share" above the streak's line, in the three languages, also with the badge of a
   new best. No part is left out, and every icon and text keeps its size from taller pages. */
@media (orientation: portrait) and (min-height: 701px) and (max-height: 899px)
{
	.bath_portrait
	{
		width: min(220px, 100%);
		height: 110px;
	}

	.game_over_body
	{
		gap: 8px;
		padding-top: 22px;
	}
}

/* Short portrait screens such as 360 x 640 */

@media (orientation: portrait) and (max-height: 700px)
{
	.title_actions .button_large
	{
		min-height: 62px;
	}

	.settings_panel
	{
		gap: 10px;
		padding: 16px 16px 12px;
	}

	.settings_panel .panel_heading
	{
		font-size: 24px;
		line-height: 30px;
	}

	.panel_scroll,
	.settings_fields
	{
		gap: 10px;
	}

	.toggle_list
	{
		gap: 6px;
	}

	.bath_portrait
	{
		width: 168px;
		height: 84px;
		margin: -14px auto -6px;
	}

	.game_over_body
	{
		gap: 6px;
		padding: 22px 16px 12px;
	}

	.game_over_heading
	{
		font-size: 23px;
		line-height: 28px;
	}

	.game_over_praise
	{
		margin-top: -4px;
		font-size: 16px;
		line-height: 20px;
	}

	.score_label
	{
		font-size: 14px;
		line-height: 18px;
	}

	.score_value
	{
		font-size: 42px;
		line-height: 46px;
	}

	.stat
	{
		padding: 5px 4px 4px;
	}

	.stat_icon
	{
		width: 24px;
		height: 24px;
	}

	.stat_value
	{
		font-size: 18px;
		line-height: 22px;
	}
}

/* Short portrait screens: the name box and the streak's line close up, so that "Play again" stays on the first screen
   with both. The line about the place keeps two of its lines. */
@media (orientation: portrait) and (max-height: 700px)
{
	.name_box
	{
		gap: 4px;
		padding: 4px 8px 8px;
	}

	.name_box_place
	{
		min-height: 40px;
		font-size: 16px;
		line-height: 20px;
	}

	.name_box .name_box_input
	{
		min-height: 42px;
	}

	.name_box .name_box_button
	{
		min-height: 44px;
		font-size: 18px;
	}

	.card_offer
	{
		gap: 4px;
		padding: 6px 8px 8px;
	}

	.card_offer_text
	{
		font-size: 16px;
		line-height: 20px;
	}

	.card_offer .card_offer_button
	{
		min-height: 44px;
		font-size: 18px;
	}

	.is_asking_name .play_again_button,
	.has_card_offer .play_again_button
	{
		min-height: 60px;
	}

	/* The line of the run's stars gives its room to the streak's line; the missions under the buttons repeat it. */
	.has_streak .game_over_progress_line
	{
		display: none;
	}

	.streak_box
	{
		gap: 2px;
		padding: 5px 8px 7px;
	}

	.streak_place
	{
		width: 22px;
		height: 22px;
	}

	.streak_count
	{
		font-size: 15px;
		line-height: 19px;
	}

	.streak_next,
	.streak_reward
	{
		font-size: 14px;
		line-height: 18px;
	}
}

/* The smallest phones, 320x568: a lower portrait, a smaller score and tighter gaps keep Play again on the first screen,
   even with a new best, steps, the blocked line, a level-up, the streak's line and the name box. */
@media (orientation: portrait) and (max-height: 600px)
{
	.bath_portrait
	{
		width: 96px;
		height: 48px;
		margin-top: -14px;
		margin-bottom: -2px;
	}

	.game_over_body
	{
		gap: 4px;
		padding-top: 18px;
	}

	.game_over_heading
	{
		font-size: 19px;
		line-height: 22px;
	}

	.score_value
	{
		font-size: 36px;
		line-height: 40px;
	}

	.score_label
	{
		font-size: 13px;
		line-height: 16px;
	}

	.level_up
	{
		padding: 3px 10px;
	}

	.level_up_title
	{
		font-size: 15px;
		line-height: 19px;
	}

	.level_up_unlock
	{
		font-size: 13px;
		line-height: 17px;
	}

	/* After a daily run the streak's line takes the room of the run's numbers, which stand in one quiet row as while the
	   name box shows. With the name box or the offer of the rescue card as well, the bath gives way; with the offer,
	   which comes with the ranks, the praise too. */
	.is_asking_name.has_streak .bath_portrait,
	.has_card_offer.has_streak .bath_portrait,
	.has_card_offer.has_streak .game_over_praise
	{
		display: none;
	}

	.card_offer
	{
		gap: 2px;
		padding: 4px 8px 6px;
	}

	.card_offer_text
	{
		font-size: 15px;
		line-height: 18px;
	}

	.card_offer .card_offer_button
	{
		min-height: 40px;
		font-size: 17px;
	}

	/* With the offer and the streak's line the ranks close up, and with a level-up as well the line of the player to
	   beat gives way. */
	.has_card_offer.has_streak .rank_slot,
	.has_card_offer.has_streak .rank_chips
	{
		gap: 4px;
	}

	.has_card_offer.has_streak .rank_chip
	{
		padding: 1px 10px;
		font-size: 14px;
		line-height: 18px;
	}

	.has_card_offer.has_streak .level_up:not([hidden]) ~ .rank_slot .target_line
	{
		display: none;
	}

	/* With the offer and the streak's line the parts close up as well, so that "Play again" stays on the first screen
	   even with a new best's badge, a level-up and the streak's reward. The top keeps its room for the badge. */
	.game_over_body.has_card_offer.has_streak
	{
		gap: 2px;
	}

	.has_card_offer.has_streak .level_up
	{
		padding-top: 1px;
		padding-bottom: 1px;
	}

	.has_card_offer.has_streak .card_offer_text
	{
		line-height: 17px;
	}

	.has_streak .stats
	{
		display: flex;
		justify-content: center;
		gap: 20px;
	}

	.has_streak .stat
	{
		flex-direction: row;
		gap: 5px;
		padding: 0;
		background: none;
		border: 0;
	}

	.has_streak .stat_icon
	{
		width: 22px;
		height: 22px;
	}

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

	.has_streak .stat_label
	{
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.has_streak .play_again_button
	{
		min-height: 60px;
	}

	.streak_box
	{
		gap: 1px;
		padding: 3px 8px 5px;
		border-width: 2px;
	}

	.streak_place
	{
		width: 20px;
		height: 20px;
	}

	.streak_count
	{
		font-size: 14px;
		line-height: 18px;
	}

	.streak_next,
	.streak_reward
	{
		font-size: 13px;
		line-height: 17px;
	}
}

/* Narrow phones: when the steps do not fit beside the score, they follow as one short line instead of a second figure. */
@media (max-width: 360px)
{
	.steps_figure
	{
		flex-direction: row;
		align-items: center;
		gap: 6px;
	}

	.steps_value
	{
		padding: 0 8px;
		font-size: 22px;
		line-height: 28px;
		border-width: 2px;
	}
}

/* Motion */

@keyframes loading_bounce
{
	0%,
	100%
	{
		transform: translateY(0);
	}

	50%
	{
		transform: translateY(-10px);
	}
}

@keyframes logo_bob
{
	0%,
	100%
	{
		transform: rotate(var(--tilt)) translateY(0);
	}

	50%
	{
		transform: rotate(var(--tilt)) translateY(-0.05em);
	}
}

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

	50%
	{
		transform: scale(0.88);
	}
}

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

	50%
	{
		transform: scale(1.04);
	}
}

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

	50%
	{
		transform: scale(1.12);
	}
}

@keyframes pop_in
{
	from
	{
		transform: scale(0.2);
	}

	to
	{
		transform: scale(1);
	}
}

@keyframes badge_pop
{
	from
	{
		transform: translate(-50%, -60%) rotate(-3deg) scale(0.3);
	}

	to
	{
		transform: translate(-50%, -60%) rotate(-3deg) scale(1);
	}
}

@keyframes soft_blink
{
	0%,
	100%
	{
		opacity: 1;
	}

	50%
	{
		opacity: 0.55;
	}
}

@keyframes confetti_burst
{
	0%
	{
		opacity: 1;
		transform: translate(0, 0) rotate(0deg) scale(0.6);
	}

	70%
	{
		opacity: 1;
	}

	100%
	{
		opacity: 0;
		transform: translate(var(--confetti_x), calc(var(--confetti_y) + 70px)) rotate(var(--confetti_turn)) scale(1);
	}
}

@keyframes stream_line_in
{
	from
	{
		opacity: 0;
		transform: translateX(-24px);
	}

	to
	{
		opacity: 1;
		transform: none;
	}
}

.reduced_motion *,
.reduced_motion *::before,
.reduced_motion *::after
{
	animation: none !important;
	transition-duration: 1ms !important;
	transition-delay: 0s !important;
}

.reduced_motion .screen .panel,
.reduced_motion .banner
{
	transform: none;
}

/* The break card of a maintenance break: a card over the dimmed title or the panel after a run, with Fabi in her
   movie night pyjamas and a duckling, a heading, one sentence, the line about the time and one button. It keeps 16 px
   to the column's safe edges and scrolls inside itself on a page too short for it. While the page knows a break, the
   pause card hides restart's row, and the card fits as it does without it. */

.break_overlay
{
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--column_safe_top) + 16px) calc(var(--safe_right) + 16px) calc(var(--column_safe_bottom) + 16px) calc(var(--safe_left) + 16px);
	background-color: rgba(59, 42, 74, 0.28);
	pointer-events: auto;
}

.break_overlay[hidden],
.break_picture[hidden],
.break_time[hidden],
.pause_restart_button[hidden]
{
	display: none;
}

.break_panel
{
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	width: min(var(--screen_width), 340px);
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	text-align: center;
}

.break_picture
{
	display: flex;
	align-items: flex-end;
	justify-content: center;
	gap: 0;
	margin-top: -6px;
}

.break_duck
{
	margin-left: -10px;
}

.break_sentence,
.break_time
{
	font-size: 17px;
	line-height: 22px;
	overflow-wrap: break-word;
}

.break_time
{
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.break_panel .break_ok_button
{
	width: 100%;
}

/* The dialog of the streamer link: a card over the dimmed title in the look of the link card's question, a heading and
   one part with the sentence of its state, the line of a failed yes and the buttons. Yes and No share a row; any other
   button takes a row of its own, and a label wider than its button takes two lines, so that nothing is cut at 320 px.
   It keeps 16 px to the column's safe edges and scrolls inside itself on a page too short for it. */

.streamer_overlay
{
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--column_safe_top) + 16px) calc(var(--safe_right) + 16px) calc(var(--column_safe_bottom) + 16px) calc(var(--safe_left) + 16px);
	background-color: rgba(59, 42, 74, 0.28);
	pointer-events: auto;
}

.streamer_panel
{
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.streamer_panel .link_choice .button
{
	white-space: normal;
}

.streamer_panel .link_choice .streamer_wide
{
	flex-basis: 100%;
}

/* The card of the score check's notices: a card over the dimmed title or the panel after a run, with Fabi in her cozy
   cardigan and a duckling, a heading, one sentence, a line per score with its day, after a removal the sentence that
   the player keeps everything else, and one button. It keeps 16 px to the column's safe edges. ScoreNoticeCard.fit()
   lets the picture give way when the rest does not fit; on a page still too short the middle scrolls inside the card,
   fading at its lower edge while more lies below, and the button always shows. The button's focus ring shows while the
   player uses the keyboard (data-keyboard). */

.score_notice_overlay
{
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--column_safe_top) + 16px) calc(var(--safe_right) + 16px) calc(var(--column_safe_bottom) + 16px) calc(var(--safe_left) + 16px);
	background-color: rgba(59, 42, 74, 0.28);
	pointer-events: auto;
}

.score_notice_overlay[hidden],
.score_notice_picture[hidden],
.score_notice_keeps[hidden]
{
	display: none;
}

.score_notice_panel
{
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	width: min(var(--screen_width), 340px);
	min-height: 0;
	text-align: center;
}

.score_notice_picture
{
	display: flex;
	flex: none;
	align-items: flex-end;
	justify-content: center;
	margin-top: -6px;
}

.score_notice_duck
{
	margin-left: -10px;
}

.score_notice_heading
{
	flex: none;
	overflow-wrap: break-word;
}

.score_notice_body
{
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	touch-action: pan-y;
	scrollbar-width: thin;
	scrollbar-color: var(--panel_edge) transparent;
}

.score_notice_body.has_more_below
{
	-webkit-mask-image: linear-gradient(to bottom, #000000 calc(100% - 32px), transparent);
	mask-image: linear-gradient(to bottom, #000000 calc(100% - 32px), transparent);
}

.score_notice_sentence,
.score_notice_keeps
{
	font-size: 17px;
	line-height: 22px;
	overflow-wrap: break-word;
}

.score_notice_lines
{
	display: flex;
	flex: none;
	flex-direction: column;
	margin: 0;
	padding: 2px 14px;
	list-style: none;
	background-color: var(--white);
	border: 2px solid var(--panel_edge);
	border-radius: 14px;
}

.score_notice_line
{
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
	text-align: left;
}

.score_notice_line + .score_notice_line
{
	border-top: 2px dotted var(--panel_edge);
}

.score_notice_score
{
	flex: none;
	font-size: 19px;
	font-weight: 700;
	line-height: 24px;
	font-variant-numeric: tabular-nums;
}

.score_notice_day
{
	min-width: 0;
	font-size: 16px;
	line-height: 21px;
	text-align: right;
	overflow-wrap: break-word;
}

.score_notice_panel .score_notice_ok_button
{
	flex: none;
	width: 100%;
}

.score_notice_overlay:not([data-keyboard]) .score_notice_ok_button:focus-visible
{
	outline: none;
}
