/* Game Tools — shared base for every tool (.gt-tool). Loaded only with a tool's own stylesheet.
 *
 * Colours come from Listing Manager's tokens (--lm-*, global.css), which switch
 * with html.dark-theme, so the tools follow the site's dark/light toggle by
 * themselves. The fallbacks only matter if that plugin is ever switched off.
 */
.gt-tool,
.gt-breadcrumbs {
	--gt-panel: var( --lm-panel, #fff );
	--gt-panel2: var( --lm-panel2, #e6f0f9 );
	--gt-ink: var( --lm-ink, #10243b );
	--gt-muted: var( --lm-muted, #4c657f );
	--gt-line: var( --lm-line, #c8d9e7 );
	--gt-blue: var( --lm-blue, #009dff );
	--gt-link: var( --lm-link, #0560a8 );
	--gt-btn: var( --lm-btn, #0870c4 );
	--gt-radius: var( --lm-radius, 14px );
	--gt-tap: var( --lm-tap, 44px );
	--gt-danger: #b3261e;
	--gt-sticky-top: 0px; /* base.js sets this to the sticky site header's height on phones */
}

.gt-tool {
	color: var( --gt-ink );
	text-align: left;
}

html.dark-theme .gt-tool,
html.dark-theme .gt-breadcrumbs {
	--gt-panel: var( --lm-panel, #0b1d2d );
	--gt-panel2: var( --lm-panel2, #10283c );
	--gt-ink: var( --lm-ink, #f3f7ff );
	--gt-muted: var( --lm-muted, #a7bed5 );
	--gt-line: var( --lm-line, #21394e );
	--gt-link: var( --lm-link, #4db5ff );
}

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

/* Several elements set their own display, which would otherwise defeat the hidden attribute. */
.gt-tool [hidden] {
	display: none !important;
}

.gt-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0, 0, 0, 0 );
	white-space: nowrap;
	border: 0;
}

/* ---------- Sticky search box; the filters below it scroll away with the page ---------- */

.gt-bar {
	position: sticky;
	top: var( --gt-sticky-top );
	z-index: 30; /* under the site header (40) */
	margin: 0;
	padding: 8px 0;
	background: var( --gt-panel );
	border-bottom: 1px solid var( --gt-line );
}

.gt-filters {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax( 0, 1fr );
	gap: 8px;
	margin: 8px 0;
}

@media ( min-width: 700px ) {
	.gt-filters {
		max-width: 520px;
	}
}

.gt-tool .gt-search,
.gt-tool .gt-select {
	width: 100%;
	min-width: 0;
	height: var( --gt-tap );
	margin: 0;
	padding: 0 12px;
	font-size: 16px; /* 16px stops iOS zooming the page on focus */
	line-height: 1.2;
	color: var( --gt-ink );
	background-color: var( --gt-panel2 );
	border: 1px solid var( --gt-line );
	border-radius: 10px;
}

.gt-tool .gt-search::placeholder {
	color: var( --gt-muted );
	opacity: 1;
}

.gt-tool .gt-search:focus,
.gt-tool .gt-select:focus {
	color: var( --gt-ink );
	background-color: var( --gt-panel2 );
	border-color: var( --gt-blue );
}

.gt-tool .gt-status {
	margin: 0 0 8px;
	font-size: 14px;
	color: var( --gt-muted );
}

/* ---------- Pills, buttons, small notes ---------- */

.gt-tag {
	display: inline-block;
	padding: 0 8px;
	font-size: 13px;
	line-height: 1.5;
	color: var( --gt-link );
	background: var( --gt-panel2 );
	border: 1px solid var( --gt-line );
	border-radius: 999px;
}

.gt-tool .gt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var( --gt-tap );
	margin: 0;
	padding: 0 18px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: var( --gt-ink );
	background: var( --gt-panel2 );
	border: 1px solid var( --gt-line );
	border-radius: 10px;
	cursor: pointer;
}

.gt-tool .gt-btn:hover,
.gt-tool .gt-btn:focus {
	color: var( --gt-ink );
	background: var( --gt-panel2 );
	border-color: var( --gt-blue );
}

.gt-tool .gt-btn:disabled {
	opacity: 0.55;
	cursor: default;
	border-color: var( --gt-line );
}

.gt-tool .gt-note {
	margin: 10px 0 0;
	font-size: 13px;
	color: var( --gt-muted );
}

/* ---------- "Last updated" line and the "not confirmed yet" notice ---------- */

.gt-tool .gt-updated {
	margin: 0 0 12px;
	font-size: 14px;
	color: var( --gt-muted );
}

.gt-notice {
	--gt-warn: #e0a100;
	padding: 16px;
	background: var( --gt-panel2 );
	border: 1px solid var( --gt-line );
	border-left: 4px solid var( --gt-warn );
	border-radius: var( --gt-radius );
}

.gt-tool .gt-notice p {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: var( --gt-ink );
}

.gt-tool .gt-notice .gt-notice-title {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 700;
}

/* ---------- Jump links: one row that scrolls sideways on phones ---------- */

.gt-toc {
	margin: 0 0 10px;
}

.gt-tool .gt-toc ul {
	display: flex;
	gap: 8px;
	margin: 0 -3px;
	padding: 3px; /* room for the focus outline inside the scroll box */
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}

.gt-toc ul::-webkit-scrollbar {
	display: none;
}

.gt-tool .gt-toc li {
	flex: none;
	margin: 0;
	padding: 0;
}

.gt-tool .gt-toc a {
	display: inline-flex;
	align-items: center;
	min-height: var( --gt-tap );
	padding: 0 14px;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	color: var( --gt-link );
	text-decoration: none;
	background: var( --gt-panel2 );
	border: 1px solid var( --gt-line );
	border-radius: 999px;
}

.gt-tool .gt-toc a:hover {
	border-color: var( --gt-blue );
}

/* More links off the right edge (base.js sets the class): fade the edge so it reads as scrollable. */
.gt-toc.has-more ul {
	-webkit-mask-image: linear-gradient( to right, #000 calc( 100% - 48px ), transparent );
	mask-image: linear-gradient( to right, #000 calc( 100% - 48px ), transparent );
}

/* ---------- Sections (jump-link targets) ---------- */

.gt-section {
	margin: 0 0 28px;
	/* A jump link must land below the sticky site header and the sticky search box. */
	scroll-margin-top: calc( var( --gt-sticky-top ) + 72px );
}

.gt-tool .gt-section-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	color: var( --gt-ink );
}

/* ---------- Footer row: tool actions on the left, "Report an error" on the right ---------- */

.gt-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px 16px;
	margin: 8px 0 0;
}

.gt-tool .gt-report {
	margin: 0 0 0 auto;
	font-size: 13px;
}

.gt-tool .gt-report a {
	display: inline-flex;
	align-items: center;
	min-height: var( --gt-tap );
	color: var( --gt-link );
	text-decoration: underline;
}

/* ---------- Tool pages: breadcrumb trail (same look as .lm-breadcrumbs on listing pages) and phone gutters ---------- */

.gt-breadcrumbs {
	padding: 0 0 10px;
}

.gt-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var( --gt-ink );
}

.gt-breadcrumbs li {
	display: flex;
	align-items: center;
	min-width: 0;
	margin: 0;
}

.gt-breadcrumbs [aria-current] {
	font-weight: 600;
}

.gt-breadcrumbs a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	color: var( --gt-link );
	text-decoration: none;
}

.gt-breadcrumbs a:hover {
	text-decoration: underline;
}

.gt-breadcrumb-sep {
	flex-shrink: 0;
	margin: 0 0.5em;
	color: var( --gt-muted );
}

/* Phones: one line; Home never shrinks, the current page takes the leftover room and truncates. */
@media ( max-width: 600px ) {
	.gt-breadcrumbs ol {
		flex-wrap: nowrap;
	}

	.gt-breadcrumbs li:first-child {
		flex-shrink: 0;
	}

	.gt-breadcrumbs li:last-child {
		flex: 1 1 0;
	}

	.gt-breadcrumbs li a,
	.gt-breadcrumbs li [aria-current] {
		display: block;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.gt-breadcrumbs li a {
		line-height: 32px;
	}
}

/* The theme pads the page box by 30px on phones; a tool needs the width. */
@media ( max-width: 768px ) {
	body.gt-tool-page .inside-article {
		padding-right: 16px;
		padding-left: 16px;
	}
}
