/* YouTD site header and the four race themes
   ----------------------------------------------------------------
   Themes follow the Warcraft III race consoles: Human (stone grey, gold and
   blue, the default), Orc (brown), Undead (bone and violet) and Night Elf
   (bark and leaf green). The theme menu at the right of the bar sets the
   youtd_palette cookie and html[data-palette="human" | "undead" | "nightelf"].
   Orc has no attribute: its colours are the base rules below, which is also
   what shows without JavaScript; the head script sets Human for visitors who
   haven't picked a theme. Each race has its own trim under the bar, cut from
   its console texture; the bar itself is the same black in every theme.
   The theme script lives in the head of overall_header.html; the markup is
   in site_head.html.
   ---------------------------------------------------------------- */

@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("./fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}

@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("./fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
}

/* Theme tokens: Orc as the base, then Human, Undead and Night Elf
---------------------------------------- */
:root {
	--yt-font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--yt-ease: cubic-bezier(.2, .7, .2, 1);
	--yt-dur: .12s;
	--yt-radius: 3px;
	--yt-head-height: 52px;
	/* The bar's content lines up with the content of the page box (#wrap: 1152px wide, see common.css) */
	--yt-head-max: 1152px;
	--yt-head-gutter: 12px;
	--yt-nav-height: 32px;
	--yt-trim-height: 12px; /* the trim under the bar; at 1, the image is this tall */
	--yt-trim-scale: 1;

	--yt-page: #0b0907;
	--yt-surface: #15110d;
	--yt-frame: #6b4a16;
	--yt-line: #33271a;
	--yt-bar-top: #17120d;
	--yt-link: #d7981f;
	--yt-link-hover: #ffd200;
	--yt-gold-hi: #ffd200;
	--yt-sub-hover: rgba(255, 204, 0, .12);
	--yt-btn-border: #a76e00;
	--yt-btn-text: #dea700;
	--yt-btn-text-hover: #fff1c2;
	--yt-glow: rgba(255, 170, 0, .25);
	--yt-trim-image: url("./images/trim-orc.png");
	--yt-logo: url("./images/logo-orc.png");
	--yt-body-image: url("./images/bg-orc.jpg");
	--yt-logo-large: url("../../../images/YouTD_Orc.png");
}

:root[data-palette="human"] {
	--yt-page: #0c0d10;
	--yt-surface: #14161b;
	--yt-frame: #5a6270;
	--yt-line: #2a2e36;
	--yt-link: #d9b44a;
	--yt-link-hover: #ffe27a;
	--yt-gold-hi: #ffe27a;
	--yt-sub-hover: rgba(90, 130, 220, .14);
	--yt-btn-border: #8a7230;
	--yt-btn-text: #e3bd4f;
	--yt-btn-text-hover: #fff3c4;
	--yt-glow: rgba(80, 130, 255, .25);
	--yt-trim-image: url("./images/trim-human.png");
	--yt-logo: url("./images/logo-human.png");
	--yt-body-image: url("./images/bg-human.jpg");
	--yt-logo-large: url("../../../images/YouTD_Human.png");
}

:root[data-palette="undead"] {
	--yt-page: #0b0a0c;
	--yt-surface: #141217;
	--yt-frame: #6b5f48;
	--yt-line: #2c2830;
	--yt-link: #c9b48a;
	--yt-link-hover: #efe2c0;
	--yt-gold-hi: #b98ae0;
	--yt-sub-hover: rgba(150, 90, 200, .14);
	--yt-btn-border: #7a6440;
	--yt-btn-text: #cfb98e;
	--yt-btn-text-hover: #f3e8cc;
	--yt-glow: rgba(150, 90, 220, .3);
	--yt-trim-image: url("./images/trim-undead.png");
	--yt-logo: url("./images/logo-undead.png");
	--yt-body-image: url("./images/bg-undead.jpg");
	--yt-logo-large: url("../../../images/YouTD_Undead.png");
}

:root[data-palette="nightelf"] {
	--yt-page: #090b09;
	--yt-surface: #111511;
	--yt-frame: #3f5a2a;
	--yt-line: #232c22;
	--yt-link: #9fcf5a;
	--yt-link-hover: #d4f59a;
	--yt-gold-hi: #c4ee6a;
	--yt-sub-hover: rgba(140, 200, 80, .12);
	--yt-btn-border: #4f7a2a;
	--yt-btn-text: #a8d466;
	--yt-btn-text-hover: #e6ffc0;
	--yt-glow: rgba(140, 220, 90, .25);
	--yt-trim-image: url("./images/trim-nightelf.png");
	--yt-logo: url("./images/logo-nightelf.png");
	--yt-body-image: url("./images/bg-nightelf.jpg");
	--yt-logo-large: url("../../../images/YouTD_NightElf.png");
	--yt-trim-scale: 2.1667; /* the leaves hang below the trim, over the top of the page */
}

/* Page: the header sits flush with the top of the window, like youtd.co
---------------------------------------- */
body#phpbb {
	position: relative;
	box-sizing: border-box;
	/* At least as tall as the window, so the Support Development link (pinned to the bottom of the
	   body, see .site-support) sits at the bottom of the screen on short pages and after the
	   content on long ones. dvh follows phone browsers' address bars as they show and hide. */
	min-height: 100vh;
	min-height: 100dvh;
	padding-top: 0;
	padding-bottom: 44px; /* room for the link */
	/* The race's texture (planks, bricks, carved stone or bark), already blended into the
	   theme's body colour so it stays muted (made by BgMaker.cs, see the backup folder) */
	background-image: var(--yt-body-image);
	background-repeat: repeat;
}

/* phpBB made the page 101% tall to always show a scrollbar; the reserved scrollbar gutter below
   already stops the width jumping, and 101% would push the bottom link just off screen */
html {
	height: auto;
}

/* Same thin scrollbar as youtd.co, so the page width doesn't jump between the sites */
html {
	scrollbar-color: var(--yt-btn-border) transparent;
	scrollbar-width: thin;
	scrollbar-gutter: stable;
}

.site-head,
.site-head * {
	box-sizing: border-box;
}

/* Header bar
---------------------------------------- */
.site-head {
	position: relative;
	z-index: 10;
	/* Room for the part of the trim below the bar (the rest overlaps the bar's lower edge) */
	margin-bottom: 12px;
	padding-bottom: calc(var(--yt-trim-height) * .6);
	font: 400 16px/1.6 var(--yt-font);
	-webkit-font-smoothing: antialiased;
}

/* Trim under the bar, cut from the race's console texture. Its black is transparent, so it
   blends the bar into the page; it straddles the bar's lower edge, and Night Elf's leaves
   hang further down over the page (clicks pass through to the links underneath). */
.site-head::after {
	content: "";
	position: absolute;
	top: calc(100% - var(--yt-trim-height));
	left: 0;
	right: 0;
	height: calc(var(--yt-trim-height) * var(--yt-trim-scale));
	background: var(--yt-trim-image) repeat-x;
	background-size: auto 100%;
	pointer-events: none;
}

.site-head .bar {
	display: flex;
	align-items: center;
	gap: 12px;
	height: var(--yt-head-height);
	padding: 0 max(var(--yt-head-gutter), (100% - var(--yt-head-max)) / 2);
	/* The same in every theme (not --yt-page, which the themes change) */
	background: linear-gradient(var(--yt-bar-top), #0b0907);
}

.site-head a,
.site-head a:visited {
	text-decoration: none;
}

.site-head :focus-visible {
	outline: 2px solid var(--yt-gold-hi);
	outline-offset: 2px;
}

.site-head .brand {
	display: flex;
	flex: none;
	align-items: center;
	line-height: 0;
}

/* The YouTD logo in the race's material (images/YouTD_<Race>.png at full size). The image has a
   margin round the letters for leaves and glow, which the negative margin takes back. */
.site-head .brand-logo {
	display: block;
	height: 42px;
	aspect-ratio: 1104 / 460;
	margin: 0 -4px;
	background: var(--yt-logo) center / contain no-repeat;
}

/* Main menu */
.site-head .nav-list {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-head .nav-list > li {
	position: relative;
	display: block;
}

.site-head .nav-list > li > a,
.site-head .nav-trigger,
.site-head .nav-menu-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: var(--yt-nav-height);
	padding: 0 .8rem;
	font: 400 14px/1 var(--yt-font);
	letter-spacing: .01em;
	color: var(--yt-btn-text);
	background: none;
	border: 0;
	border-radius: var(--yt-radius);
	cursor: pointer;
	transition: color var(--yt-dur) var(--yt-ease);
}

.site-head .chevron {
	flex: none;
	transition: transform .2s var(--yt-ease);
}

.site-head .is-open > .nav-trigger,
.site-head .nav-list > li > a:focus-visible,
.site-head .nav-trigger:focus-visible {
	color: var(--yt-btn-text-hover);
}

.site-head .nav-sub {
	position: absolute;
	top: 100%;
	left: -1px;
	z-index: 1;
	display: none;
	min-width: 13rem;
	margin: 0;
	padding: .35rem 0;
	list-style: none;
	background: var(--yt-surface);
	border: 1px solid var(--yt-btn-text);
	border-radius: var(--yt-radius);
}

.site-head .is-open > .nav-sub {
	display: block;
}

.site-head .nav-sub li {
	display: block;
	border-radius: var(--yt-radius);
	transition: background-color var(--yt-dur) var(--yt-ease);
}

.site-head .nav-sub a {
	display: block;
	padding: .45rem 1rem;
	font: 400 14px/1.5 var(--yt-font);
	color: var(--yt-link);
	white-space: nowrap;
}

.site-head .nav-sub li:focus-within {
	background: var(--yt-sub-hover);
}

.site-head .nav-sub a:focus-visible {
	color: var(--yt-link-hover);
	outline-offset: -2px;
}

.site-head .nav-menu-toggle {
	display: none;
	padding: 0 .7rem;
}

.site-head.nav-open .nav-menu-toggle {
	color: var(--yt-btn-text-hover);
}

.site-head.nav-open .nav-menu-toggle .chevron {
	transform: rotate(180deg);
}

/* Link + arrow pairs (Forum, Towers, Items): the label is a link to its page, the small arrow
   next to it opens the menu (hover opens it too on wide screens), as on youtd.co */
.site-head .nav-list > li.has-children > a {
	padding-right: .25rem;
}

.site-head .nav-caret {
	padding: 0 .55rem 0 .15rem;
}

.site-head .is-open > a {
	color: var(--yt-btn-text-hover);
}

/* Right-hand end: theme menu and account */
.site-head .head-end {
	display: flex;
	flex: none;
	align-items: center;
	gap: 8px;
	margin-left: auto;
}

/* "Theme" with an arrow, like the menu's own triggers */
.site-head .palette-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: var(--yt-nav-height);
	padding: 0 .6rem;
	font: 400 14px/1 var(--yt-font);
	letter-spacing: .01em;
	white-space: nowrap;
	color: var(--yt-btn-text);
	background: none;
	border: 0;
	border-radius: var(--yt-radius);
	cursor: pointer;
	transition: color var(--yt-dur) var(--yt-ease);
}

.site-head .theme-menu.is-open > .palette-toggle {
	color: var(--yt-btn-text-hover);
}

.site-head .theme-menu.is-open > .palette-toggle .chevron {
	transform: rotate(180deg);
}

/* Theme menu: opens under the button like the account menu */
.site-head .theme-menu {
	position: relative;
}

.site-head .theme-menu > .nav-sub {
	left: auto;
	right: 0;
	min-width: 11rem;
}

.site-head .theme-menu .nav-sub button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: .45rem 1rem;
	font: 400 14px/1.5 var(--yt-font);
	color: var(--yt-link);
	text-align: left;
	white-space: nowrap;
	background: none;
	border: 0;
	cursor: pointer;
}

.site-head .theme-menu .nav-sub button svg {
	flex: none;
}

/* The current theme: brighter, with a tick at the right */
.site-head .theme-menu .nav-sub button[aria-checked="true"] {
	color: var(--yt-btn-text-hover);
}

.site-head .theme-menu .nav-sub button[aria-checked="true"]::after {
	content: "";
	width: 5px;
	height: 9px;
	margin: -3px 2px 0 auto;
	border: solid currentColor;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.site-head .theme-menu .nav-sub button:focus-visible {
	color: var(--yt-link-hover);
	outline-offset: -2px;
}

/* Logged-out buttons, as on community.youtd.co: gold Sign Up, Discord-blue Log In */
.site-head .auth-buttons {
	display: flex;
	align-items: center;
	gap: 8px;
}

.site-head .auth-buttons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 36px;
	padding: 0 .8rem;
	font: 400 14px/1 var(--yt-font);
	white-space: nowrap;
	border: 1px solid transparent;
	border-radius: var(--yt-radius);
	transition: color var(--yt-dur) var(--yt-ease), border-color var(--yt-dur) var(--yt-ease), box-shadow .18s var(--yt-ease);
}

.site-head .auth-buttons .sign-up,
.site-head .auth-buttons .sign-up:visited {
	color: #1b1307;
	background: linear-gradient(#f2c13a, #d39a0a);
	border-color: #8a5a00;
	box-shadow: inset 0 1px 0 rgba(255, 246, 200, .6), inset 0 -1px 0 rgba(120, 70, 0, .35);
}

/* Primary button (Sign Up, search submit) in the race themes; Orc keeps the gold one above */
:root[data-palette="human"] {
	--yt-primary-text: #ffe6a0;
	--yt-primary-bg: linear-gradient(#2f4f9a, #1b2f66);
	--yt-primary-bg-hover: linear-gradient(#3a5fb4, #22397a);
	--yt-primary-border: #c9a240;
	--yt-primary-border-hover: #ffd96a;
	--yt-primary-shadow: inset 0 0 0 1px rgba(201, 162, 64, .35), inset 0 1px 0 rgba(255, 255, 255, .15), inset 0 -1px 0 rgba(0, 0, 0, .5);
	--yt-primary-text-shadow: 0 1px 0 rgba(0, 0, 0, .85);
}

:root[data-palette="undead"] {
	--yt-primary-text: #1d1710;
	--yt-primary-bg: linear-gradient(#d8c79e, #a8946a);
	--yt-primary-bg-hover: linear-gradient(#e6d7b0, #b9a57a);
	--yt-primary-border: #6b5a3a;
	--yt-primary-border-hover: #9a6ad0;
	--yt-primary-shadow: inset 0 1px 0 rgba(255, 250, 230, .55), inset 0 -1px 0 rgba(60, 45, 20, .35);
	--yt-primary-text-shadow: none;
}

:root[data-palette="nightelf"] {
	--yt-primary-text: #0f1a07;
	--yt-primary-bg: linear-gradient(#7fb83a, #4f8a1e);
	--yt-primary-bg-hover: linear-gradient(#93cc4a, #5f9e28);
	--yt-primary-border: #2f5410;
	--yt-primary-border-hover: #6ca030;
	--yt-primary-shadow: inset 0 1px 0 rgba(230, 255, 190, .5), inset 0 -1px 0 rgba(20, 50, 0, .35);
	--yt-primary-text-shadow: none;
}

:root[data-palette] .site-head .auth-buttons .sign-up,
:root[data-palette] .site-head .auth-buttons .sign-up:visited {
	color: var(--yt-primary-text);
	background: var(--yt-primary-bg);
	border-color: var(--yt-primary-border);
	box-shadow: var(--yt-primary-shadow);
	text-shadow: var(--yt-primary-text-shadow);
}

.site-head .auth-buttons .login,
.site-head .auth-buttons .login:visited {
	font-weight: 600;
	font-size: 15px;
	color: #fff;
	background: linear-gradient(#6a76f5, #4752c4);
	border-color: #2f3790;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .25);
}

.site-head .login svg {
	flex: none;
}

/* Account menu: the username opens UCP, profile, notifications, messages and log out */
.site-head .account-menu {
	position: relative;
	margin-right: 8px;
}

.site-head .account {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 38px;
	padding: 0 4px;
	font: 400 14px/1 var(--yt-font);
	color: var(--yt-btn-text);
	background: none;
	border: 0;
	border-radius: var(--yt-radius);
	cursor: pointer;
	transition: color var(--yt-dur) var(--yt-ease);
}

.site-head .account-menu.is-open > .account {
	color: var(--yt-btn-text-hover);
}

.site-head .account-menu.is-open > .account .chevron {
	transform: rotate(180deg);
}

/* Unread notifications or messages */
.site-head .account-dot {
	position: absolute;
	top: 4px;
	left: 26px;
	width: 9px;
	height: 9px;
	background: #e8553f;
	border: 2px solid #000;
	border-radius: 50%;
}

.site-head .account-menu > .nav-sub {
	left: auto;
	right: 0;
	min-width: 14rem;
}

.site-head .account-menu .nav-sub a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.site-head .account-menu .nav-sub .separator {
	height: 1px;
	margin: .3rem 0;
	background: var(--yt-line);
	border-radius: 0;
}

.site-head .account-menu .nav-sub .separator:hover {
	background: var(--yt-line);
}

/* phpBB extension items added to this list may carry Font Awesome icons */
.site-head .account-menu .nav-sub .icon {
	display: none;
}

.site-head .count {
	min-width: 18px;
	padding: 1px 6px;
	font: 600 12px/16px var(--yt-font);
	text-align: center;
	color: #fff;
	background: #c2412e;
	border-radius: 9px;
}

.site-head .account img {
	width: 30px;
	height: 30px;
	border-radius: var(--yt-radius);
	object-fit: cover;
}

@media (hover: hover) {
	.site-head .nav-list > li > a:hover,
	.site-head .has-children:hover > .nav-trigger,
	.site-head .has-children:hover > a,
	.site-head .nav-menu-toggle:hover,
	.site-head .palette-toggle:hover,
	.site-head .account:hover {
		color: var(--yt-btn-text-hover);
	}

	.site-head .nav-sub li:hover {
		background: var(--yt-sub-hover);
	}

	.site-head .nav-sub li:hover a,
	.site-head .nav-sub li:hover button {
		color: var(--yt-btn-text-hover);
	}

	.site-head .auth-buttons .sign-up:not(:active):hover {
		color: #1b1307;
		background: linear-gradient(#ffdd6e, #ebb020);
		border-color: #a76e00;
		box-shadow: inset 0 1px 0 rgba(255, 246, 200, .6), inset 0 -1px 0 rgba(120, 70, 0, .35), 0 0 6px var(--yt-glow);
	}

	:root[data-palette] .site-head .auth-buttons .sign-up:not(:active):hover {
		color: var(--yt-primary-text);
		background: var(--yt-primary-bg-hover);
		border-color: var(--yt-primary-border-hover);
		box-shadow: var(--yt-primary-shadow), 0 0 8px var(--yt-glow);
	}

	.site-head .auth-buttons .login:not(:active):hover {
		color: #fff;
		background: linear-gradient(#7d88ff, #5865f2);
		border-color: #3d47b8;
		box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 8px rgba(88, 101, 242, .55);
	}
}

@media (min-width: 768px) {
	:root {
		--yt-head-height: 56px;
		--yt-head-gutter: 28px; /* below 1220px the page box sits 12px in, plus 1px border and 15px padding */
		--yt-nav-height: 38px;
		--yt-trim-height: 18px;
	}

	.site-head .auth-buttons a {
		height: 38px;
		padding: 0 16px;
	}

	.site-head .auth-buttons .login {
		padding: 0 1.1rem;
	}
}

/* Wide screens: menu inline in the bar, submenus open on hover */
@media (min-width: 1159px) {
	.site-head .site-nav {
		flex: 1;
		min-width: 0;
	}

	.site-head .nav-trigger {
		padding-right: .5rem;
	}

	@media (hover: hover) {
		.site-head .has-children:hover > .nav-sub,
		.site-head .account-menu:hover > .nav-sub,
		.site-head .theme-menu:hover > .nav-sub {
			display: block;
		}
	}
}

/* Narrow screens: a "Menu" button drops the menu down under the bar */
@media (max-width: 1158px) {
	.site-head .nav-menu-toggle {
		display: inline-flex;
	}

	.site-head .site-nav {
		position: absolute;
		top: var(--yt-head-height);
		left: 0;
		right: 0;
		z-index: 1; /* over the trim */
		display: none;
		padding: 8px var(--yt-head-gutter) 12px;
		background: var(--yt-surface);
		border-top: 1px solid var(--yt-frame);
		border-bottom: 2px solid var(--yt-btn-text);
	}

	.site-head.nav-open .site-nav {
		display: block;
	}

	.site-head .nav-list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.site-head .nav-list > li {
		border-bottom: 1px solid var(--yt-line);
	}

	.site-head .nav-list > li:last-child {
		border-bottom: 0;
	}

	.site-head .nav-list > li > a,
	.site-head .site-nav .nav-trigger {
		display: flex;
		width: 100%;
		height: auto;
		padding: .7rem .5rem;
		font-size: 16px;
		color: var(--yt-link);
		text-align: left;
	}

	/* Submenus are listed open under their heading, as on youtd.co */
	.site-head .site-nav .nav-trigger {
		cursor: default;
	}

	.site-head .site-nav .nav-trigger .chevron {
		display: none;
	}

	.site-head .site-nav .nav-sub {
		position: static;
		display: block;
		min-width: 0;
		margin: 0;
		padding: 0 0 .4rem 1rem;
		background: none;
		border: 0;
	}

	.site-head .site-nav .nav-sub a {
		font-size: 15px;
	}

	/* The submenus are already listed open here, so the arrows aren't needed */
	.site-head .site-nav .nav-caret {
		display: none;
	}

	.site-head .site-nav .nav-list > li.has-children > a {
		padding-right: .5rem;
	}
}

@media (max-width: 359px) {
	.site-head .bar {
		gap: 8px;
	}

	.site-head .nav-menu-toggle,
	.site-head .palette-toggle {
		padding: 0 .25rem;
		font-size: 13px;
	}

	.site-head .head-end,
	.site-head .auth-buttons {
		gap: 4px;
	}

	.site-head .auth-buttons a {
		padding: 0 .5em;
	}
}

@media (max-width: 700px) {
	.site-head {
		margin-bottom: 0;
	}

	.site-head .account-name {
		display: none;
	}
}

/* Phones: drop Sign Up to keep the bar on one line (community.youtd.co does the same) */
@media (max-width: 640px) {
	.site-head .auth-buttons .sign-up {
		display: none;
	}

	/* and keep "Theme" compact */
	.site-head .palette-toggle {
		padding: 0 .35rem;
	}

	.site-head .palette-toggle .chevron {
		display: none;
	}
}

/* Home page logo above the search field (overall_header.html), in the current race's material.
   The image has a margin round the letters for leaves and glow, so it sits a little into the
   space above and below.
---------------------------------------- */
.home-logo {
	width: min(560px, 92%);
	aspect-ratio: 1104 / 460;
	margin: 0 auto 4px;
	background: var(--yt-logo-large) center / contain no-repeat;
}

@media (max-width: 700px) {
	.home-logo {
		margin-top: 12px;
	}
}

/* Forum search, styled after the search field on community.youtd.co
---------------------------------------- */
:root {
	--yt-search-bg: #0b0907;
	--yt-search-line: #6e5d28;
	--yt-search-focus: #d7981f;
	--yt-search-text: #ffb400;
	--yt-search-placeholder: #a89c7a;
	--yt-search-icon: #b39841;
}

:root[data-palette="human"] {
	--yt-search-bg: #0c0d10;
	--yt-search-line: #5a6270;
	--yt-search-focus: #e3bd4f;
	--yt-search-text: #e3bd4f;
	--yt-search-placeholder: #9aa0aa;
	--yt-search-icon: #a8aebb;
}

:root[data-palette="undead"] {
	--yt-search-bg: #0b0a0c;
	--yt-search-line: #5e5468;
	--yt-search-focus: #a678d6;
	--yt-search-text: #cfb98e;
	--yt-search-placeholder: #958c80;
	--yt-search-icon: #a8977a;
}

:root[data-palette="nightelf"] {
	--yt-search-bg: #090b09;
	--yt-search-line: #4a5a3e;
	--yt-search-focus: #9fcf5a;
	--yt-search-text: #a8d466;
	--yt-search-placeholder: #8e9a84;
	--yt-search-icon: #8fae6a;
}

.forum-search {
	margin: 0 0 8px;
}

.forum-search-field {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	max-width: 600px;
	height: 48px;
	margin: 0 auto;
	padding: 4px;
	font: 400 16px/1.2 var(--yt-font);
	background: var(--yt-search-bg);
	border: 1px solid var(--yt-search-line);
	border-radius: 2px;
	transition: border-color var(--yt-dur) var(--yt-ease), box-shadow var(--yt-dur) var(--yt-ease);
}

.forum-search-field:focus-within {
	border-color: var(--yt-search-focus);
	box-shadow: 0 0 0 1px var(--yt-search-focus);
}

.forum-search-field input {
	flex: 1;
	min-width: 0;
	height: 38px;
	margin: 0;
	padding: 0 .4rem;
	font: inherit;
	color: var(--yt-search-text);
	background: none;
	border: 0;
	outline: 0;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.forum-search-field input::placeholder {
	color: var(--yt-search-placeholder);
	opacity: 1;
}

.forum-search-field input::-webkit-search-cancel-button {
	filter: grayscale(1) brightness(1.4);
}

.forum-search-go,
.forum-search-advanced {
	display: grid;
	flex: none;
	place-items: center;
	width: 34px;
	height: 38px;
	padding: 0;
	color: var(--yt-search-icon);
	background: none;
	border: 0;
	border-radius: var(--yt-radius);
	cursor: pointer;
	transition: color var(--yt-dur) var(--yt-ease);
}

.forum-search-go:focus-visible,
.forum-search-advanced:focus-visible {
	outline: 2px solid var(--yt-gold-hi);
	outline-offset: -2px;
}

@media (hover: hover) {
	.forum-search-go:hover,
	.forum-search-advanced:hover {
		color: var(--yt-btn-text-hover);
	}
}

/* The field shows at every width, so phpBB's narrow-screen search icon in the navbar isn't needed */
.navbar .linklist > li.responsive-search {
	display: none !important;
}

@media (max-width: 700px) {
	.forum-search {
		margin: 8px 0;
	}
}

/* Advanced search page (search_body.html) and the "Search in results" box
   ----------------------------------------------------------------
   Same dark panels as the login page, gold headings, and form fields
   that match the header search.
---------------------------------------- */
:root {
	--yt-panel: #4e433a;
	--yt-panel-line: #6b5d50;
	--yt-panel-text: #dbcc9c;
	--yt-panel-dim: #a89c7a;
	--yt-heading: #e6ac2a;
	--yt-field-text: #f0e6c8;
}

:root[data-palette="human"] {
	--yt-panel: #3f444c;
	--yt-panel-line: #5a6270;
	--yt-panel-text: #d8dce4;
	--yt-panel-dim: #9aa0aa;
	--yt-heading: #e3bd4f;
	--yt-field-text: #eef0f4;
}

:root[data-palette="undead"] {
	--yt-panel: #3a353f;
	--yt-panel-line: #5e5468;
	--yt-panel-text: #d9d0c4;
	--yt-panel-dim: #958c80;
	--yt-heading: #cfb98e;
	--yt-field-text: #efe8dc;
}

:root[data-palette="nightelf"] {
	--yt-panel: #363c33;
	--yt-panel-line: #4f5a46;
	--yt-panel-text: #d6dccb;
	--yt-panel-dim: #8e9a84;
	--yt-heading: #a8d466;
	--yt-field-text: #eaf2de;
}

.search-advanced .panel {
	margin-bottom: 8px;
	padding: 12px 18px;
	color: var(--yt-panel-text);
	background: var(--yt-panel);
	border-radius: 7px;
}

.search-advanced .panel h3 {
	margin: 4px 0 10px;
	padding-bottom: 6px;
	font: 600 16px/1.2 var(--yt-font);
	letter-spacing: .02em;
	text-transform: none;
	color: var(--yt-heading);
	border-bottom: 1px solid var(--yt-panel-line);
}

.search-advanced fieldset {
	font-size: 1.2em;
}

.search-advanced fieldset dl {
	padding: 6px 0;
}

.search-advanced label,
.search-advanced dd label,
.search-advanced fieldset dl:hover dt label {
	color: var(--yt-panel-text);
}

.search-advanced dt label {
	font-weight: bold;
}

.search-advanced dt span {
	color: var(--yt-panel-dim);
}

.search-advanced dd label {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-right: 14px;
	line-height: 1.8;
}

.search-advanced hr.dashed {
	border-top-color: var(--yt-panel-line);
}

.search-advanced input[type="radio"],
.search-advanced input[type="checkbox"] {
	margin: 0;
	accent-color: var(--yt-heading);
}

/* Text, number and select fields */
.search-advanced input.inputbox,
.search-advanced input[type="number"],
.search-advanced select,
.action-bar .search-box .inputbox {
	box-sizing: border-box;
	padding: 6px 8px;
	font: 400 14px/1.3 var(--yt-font);
	color: var(--yt-field-text);
	background: var(--yt-search-bg);
	border: 1px solid var(--yt-search-line);
	border-radius: 2px;
	outline: 0;
	transition: border-color var(--yt-dur) var(--yt-ease), box-shadow var(--yt-dur) var(--yt-ease);
}

.search-advanced input.inputbox {
	width: 100%;
	max-width: 420px;
	height: 36px;
}

.search-advanced input[type="number"] {
	width: 90px;
	height: 32px;
}

.search-advanced select {
	height: 32px;
	cursor: pointer;
}

.search-advanced select[multiple] {
	height: auto;
	max-width: 420px;
	padding: 4px;
}

.search-advanced select option {
	padding: 2px 6px;
	color: var(--yt-field-text);
	background: var(--yt-search-bg);
}

.search-advanced select option:checked {
	color: #1b1307;
	background: var(--yt-heading);
}

.search-advanced input.inputbox:hover,
.search-advanced input[type="number"]:hover,
.search-advanced select:hover,
.action-bar .search-box .inputbox:hover {
	border-color: var(--yt-btn-border);
}

.search-advanced input.inputbox:focus,
.search-advanced input[type="number"]:focus,
.search-advanced select:focus,
.action-bar .search-box .inputbox:focus {
	border-color: var(--yt-search-focus);
	box-shadow: 0 0 0 1px var(--yt-search-focus);
}

/* Submit (also the posting page's Submit): the gold primary button from the header's Sign Up */
.search-advanced .panel.bg3 {
	background: none;
	padding: 4px 0 0;
}

.search-advanced .submit-buttons {
	text-align: center;
}

.search-advanced input.button1,
#postform input.default-submit-action {
	height: 40px;
	min-width: 160px;
	padding: 0 24px;
	font: 600 15px/1 var(--yt-font);
	color: #1b1307;
	background: linear-gradient(#f2c13a, #d39a0a);
	border: 1px solid #8a5a00;
	border-radius: var(--yt-radius);
	box-shadow: inset 0 1px 0 rgba(255, 246, 200, .6), inset 0 -1px 0 rgba(120, 70, 0, .35);
	filter: none;
	cursor: pointer;
	transition: border-color var(--yt-dur) var(--yt-ease), box-shadow .18s var(--yt-ease);
}

.search-advanced input.button1:hover,
#postform input.default-submit-action:hover {
	color: #1b1307;
	background: linear-gradient(#ffdd6e, #ebb020);
	border-color: #a76e00;
	box-shadow: inset 0 1px 0 rgba(255, 246, 200, .6), inset 0 -1px 0 rgba(120, 70, 0, .35), 0 0 6px var(--yt-glow);
}

.search-advanced input.button1:focus-visible,
#postform .submit-buttons input:focus-visible {
	outline: 2px solid var(--yt-gold-hi);
	outline-offset: 2px;
}

:root[data-palette] .search-advanced input.button1,
:root[data-palette] #postform input.default-submit-action {
	color: var(--yt-primary-text);
	background: var(--yt-primary-bg);
	border-color: var(--yt-primary-border);
	box-shadow: var(--yt-primary-shadow);
	text-shadow: var(--yt-primary-text-shadow);
}

:root[data-palette] .search-advanced input.button1:hover,
:root[data-palette] #postform input.default-submit-action:hover {
	color: var(--yt-primary-text);
	background: var(--yt-primary-bg-hover);
	border-color: var(--yt-primary-border-hover);
	box-shadow: var(--yt-primary-shadow), 0 0 6px var(--yt-glow);
}

@media (max-width: 700px) {
	.search-advanced .panel {
		padding: 10px 12px;
	}

	.search-advanced fieldset dt {
		float: none;
		width: auto;
		margin-bottom: 4px;
	}

	.search-advanced fieldset dd {
		margin-left: 0;
	}
}

/* Search boxes in the action bar ("Search this topic", "Search this forum", "Search in results"):
   the field joins its two icon buttons.
   One is a <button> and the other an <a>, so both get an explicit box to match. */
.action-bar .search-box fieldset {
	display: flex;
	align-items: stretch;
}

.action-bar .search-box .inputbox {
	float: none;
	height: 30px;
	border-radius: 2px 0 0 2px;
}

.action-bar .search-box .inputbox::placeholder {
	color: var(--yt-search-placeholder);
	opacity: 1;
}

.action-bar .search-box .inputbox::-webkit-input-placeholder {
	color: var(--yt-search-placeholder);
}

.action-bar .search-box .inputbox:focus::placeholder {
	color: transparent;
}

.action-bar .search-box .button {
	display: inline-flex;
	float: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 32px;
	height: 30px;
	margin: 0;
	padding: 0;
	line-height: 1;
	color: var(--yt-search-icon);
	background: var(--yt-search-bg);
	border: 1px solid var(--yt-search-line);
	border-left: 0;
	border-radius: 0;
	box-shadow: none;
	text-shadow: none;
	filter: none;
}

.action-bar .search-box .button-search-end {
	border-radius: 0 2px 2px 0;
}

.action-bar .search-box .button .icon {
	width: auto;
	font-size: 14px;
	color: inherit;
}

@media (hover: hover) {
	.action-bar .search-box .button:hover {
		color: var(--yt-btn-text-hover);
		border-color: var(--yt-search-line);
	}
}

/* Footer: hidden, apart from the hidden alert and confirm boxes in it that phpBB's scripts use
---------------------------------------- */
#page-footer > .navbar,
#page-footer > .copyright {
	display: none;
}

/* Support Development: a small link under the page box (overall_footer.html) */
.site-support {
	position: absolute;
	right: 0;
	bottom: 14px;
	left: 0;
	margin: 0;
	font: 400 12px/1.4 var(--yt-font);
	text-align: center;
}

.site-support a,
.site-support a:visited {
	color: var(--yt-panel-dim);
	text-decoration: none;
}

.site-support a:hover,
.site-support a:focus-visible {
	color: var(--yt-btn-text-hover);
	text-decoration: underline;
}

/* Tower, item and custom resource lists (towers.php, items.php, custom_resources.php)
   ----------------------------------------------------------------
   The cards sit straight on the page box: the dark forum-table box around them (.forumbg) and the
   filter panel above them lose their backgrounds, and the panel is inset to the cards' width
   (the cards sit 15px in: 5px .forumbg padding + 5px table margin + 5px .inner).
   #phpbb in the selectors outranks the race-theme rules further down.
---------------------------------------- */
#phpbb.section-towers .forumbg,
#phpbb.section-items .forumbg,
#phpbb.section-custom_resources .forumbg {
	background: none;
}

/* Page heading ("Towers", "Items", "Builders"): centred over the filter panel and larger */
#phpbb.section-towers h2.forum-title,
#phpbb.section-items h2.forum-title,
#phpbb.section-builders h2.forum-title {
	margin: 14px 0 12px;
	font: 600 34px/1.2 var(--yt-font);
	letter-spacing: .02em;
	text-align: center;
}

/* The headings aren't links; they keep the link colour they used to have */
#phpbb.section-towers h2.forum-title,
#phpbb.section-items h2.forum-title,
#phpbb.section-builders h2.forum-title {
	color: #dc9f12;
}

:root[data-palette] #phpbb.section-towers h2.forum-title,
:root[data-palette] #phpbb.section-items h2.forum-title,
:root[data-palette] #phpbb.section-builders h2.forum-title {
	color: var(--yt-accent);
}

#phpbb.section-towers .youtd_controlbar,
#phpbb.section-items .youtd_controlbar,
#phpbb.section-custom_resources .youtd_controlbar {
	box-sizing: border-box;
	width: auto;
	margin: 0 15px;
	background: none;
}

#phpbb.section-towers .youtd_controlbar div.youtd_form,
#phpbb.section-items .youtd_controlbar div.youtd_form,
#phpbb.section-custom_resources .youtd_controlbar div.youtd_form {
	background: none;
}

/* Page box (#wrap): phpBB's theme makes it gray (#444). In Orc it's a brown of the same lightness,
   so the brown navbar sits on brown; the race themes below set their own.
---------------------------------------- */
.wrap {
	background-color: #473c33;
	border-color: #8c7b6a;
}

/* Human, Undead and Night Elf themes for the forum itself
   ----------------------------------------------------------------
   Every brown surface of the Orc theme, swapped for the race's colour at
   about the same lightness. Covers colours.css plus the inline styles in
   builders.html, leaderboard.html and upload_replay.html.
---------------------------------------- */
:root[data-palette="human"] {
	--yt-f-body: #2e3138;
	--yt-f-wrap: #44474e;
	--yt-f-wrap-line: #8d939c;
	--yt-f-row-hover: #545b66;
	--yt-f-card: #30343a;
	--yt-f-card-line: #4e5560;
}

:root[data-palette="undead"] {
	--yt-f-body: #2b2830;
	--yt-f-wrap: #3e3a42;
	--yt-f-wrap-line: #857a8c;
	--yt-f-row-hover: #4f4858;
	--yt-f-card: #2f2b33;
	--yt-f-card-line: #4d4654;
}

:root[data-palette="nightelf"] {
	--yt-f-body: #282c27;
	--yt-f-wrap: #3a3f38;
	--yt-f-wrap-line: #7c8a72;
	--yt-f-row-hover: #4a5446;
	--yt-f-card: #2c312a;
	--yt-f-card-line: #475143;
}

:root[data-palette],
:root[data-palette] body {
	background-color: var(--yt-f-body);
}

:root[data-palette] .wrap {
	background-color: var(--yt-f-wrap);
	border-color: var(--yt-f-wrap-line);
}

:root[data-palette] .navbar,
:root[data-palette] #login .panel,
:root[data-palette] #register .panel,
:root[data-palette] #agreement .panel,
:root[data-palette] .panel.auth-panel {
	background-color: var(--yt-panel);
}

:root[data-palette] li.row:hover {
	background-color: var(--yt-f-row-hover);
}

:root[data-palette] #agreement input.button2 {
	background: var(--yt-panel-line);
}

:root[data-palette] .panel.auth-panel h2,
:root[data-palette] .panel.auth-panel h3,
:root[data-palette] .panel.auth-panel label,
:root[data-palette] .panel.auth-panel dt {
	border-bottom-color: var(--yt-panel-line);
}

/* Tower and item cards, the filter button bar and upload forms (inline styles in youtd/templates/*.php,
   and youtd/assets/youtd_cards.css for the cards at the top of tower and item topics) */
:root[data-palette] .ytd-card,
:root[data-palette] .content_row,
:root[data-palette] .title_container,
:root[data-palette] .details_container,
:root[data-palette] div.tower_ability,
:root[data-palette] .youtd_controlbar,
:root[data-palette] div.youtd_form {
	background-color: var(--yt-f-card);
}

:root[data-palette] .builder-card,
:root[data-palette] .lb-tab.active,
:root[data-palette] .lb-panel,
:root[data-palette] .lb-modal-box,
:root[data-palette] .replay-box {
	background: var(--yt-f-card);
	border-color: var(--yt-f-card-line);
}

/* Family tabs above a tower card (youtd/assets/youtd_cards.css): the other towers' tabs are a darker
   shade of the card, the current one is the card's colour with accent text and top line */
:root[data-palette] .ytd-family-tabs a.ytd-family-tab {
	background: color-mix(in srgb, var(--yt-f-card) 55%, #000);
	border-color: color-mix(in srgb, var(--yt-f-card-line) 70%, #000);
}

:root[data-palette] .ytd-family-tabs a.ytd-family-tab:hover {
	background: color-mix(in srgb, var(--yt-f-card) 85%, #000);
}

:root[data-palette] .ytd-family-tabs a.ytd-family-tab--current,
:root[data-palette] .ytd-family-tabs a.ytd-family-tab--current:hover {
	background: var(--yt-f-card);
	border-color: var(--yt-f-card-line);
	border-top-color: var(--yt-accent);
	color: var(--yt-accent);
}

/* Links and orange accents in the race themes
   ----------------------------------------------------------------
   Orc keeps phpBB's gold-orange (#dc9f12 in colours.css and the inline styles of
   builders.html, leaderboard.html, upload_replay.html, youtd/templates/youtd_common_styles.php
   and youtd/assets/youtd_cards.css). The race themes swap it for:
   --yt-accent       links and accent text
   --yt-accent-fill  solid accent buttons, tabs and tags (white text on top)
   --yt-h3           h3 headings (#FFAA66 in Orc)
   Status, rarity and tier colours that carry meaning are left alone.
---------------------------------------- */
:root[data-palette="human"] {
	--yt-accent: #e3bd4f;
	--yt-accent-fill: #3a5fb4;
	--yt-h3: #9fb8e8;
}

:root[data-palette="undead"] {
	--yt-accent: #d4bf8f;
	--yt-accent-fill: #7a4fa8;
	--yt-h3: #b98ae0;
}

:root[data-palette="nightelf"] {
	--yt-accent: #a8d466;
	--yt-accent-fill: #477d1a;
	--yt-h3: #9fd3c7;
}

/* :where() keeps these at the specificity of phpBB's plain "a" and "h3" rules, so they replace only
   those: hover (white), post links, table headers and the header bar keep their own colours */
:where(:root[data-palette]) a {
	color: var(--yt-accent);
}

:where(:root[data-palette]) h3 {
	color: var(--yt-h3);
}

:root[data-palette] .icon.icon-orange,
:root[data-palette] a:hover .icon.icon-orange,
:root[data-palette] .ytd-card__extra > summary,
:root[data-palette] .lb-tab:hover,
:root[data-palette] .lb-tab.active,
:root[data-palette] .lb-table th,
:root[data-palette] .lb-table td.lb-rank,
:root[data-palette] .lb-actions a:hover,
:root[data-palette] .lb-actions button:hover,
:root[data-palette] .lb-pager button:hover:not(:disabled),
:root[data-palette] .lb-modal-info b,
:root[data-palette] .lb-modal-close:hover,
:root[data-palette] .lb-metric:hover,
:root[data-palette] .lb-build-head,
:root[data-palette] .replay-settings b,
:root[data-palette] .replay-players th,
:root[data-palette] .replay-drop-file {
	color: var(--yt-accent);
}

:root[data-palette] .ytd-card__extra > summary:hover {
	color: #fff;
}

:root[data-palette] .search-header {
	box-shadow: 0 0 10px var(--yt-accent);
}

:root[data-palette] .pmlist li.pm_marked_colour,
:root[data-palette] .pm_marked_colour,
:root[data-palette] .lb-pager button:hover:not(:disabled),
:root[data-palette] .replay-drop:hover,
:root[data-palette] .replay-drop.dragging,
:root[data-palette] .builder-card:hover {
	border-color: var(--yt-accent);
}

:root[data-palette] .replay-drop:hover,
:root[data-palette] .replay-drop.dragging {
	background: var(--yt-f-card);
}

:root[data-palette] .builder-icon {
	box-shadow: 0 0 0 1px var(--yt-accent);
}

/* builders.php group headings ("New Builders", "Current Builders") and card name links */
:root[data-palette] .builder-group,
:root[data-palette] .builder-name a:hover {
	color: var(--yt-accent);
}

:root[data-palette] .builder-group {
	border-color: var(--yt-f-card-line);
}

/* Solid accent buttons, tabs and tags */
:root[data-palette] .youtd_button_link,
:root[data-palette] .lb-button,
:root[data-palette] .replay-button,
:root[data-palette] .lb-pager button.current,
:root[data-palette] .lb-metric.active,
:root[data-palette] .builder-tier-new {
	color: #fff;
	background: var(--yt-accent-fill);
	border-color: var(--yt-accent-fill);
}

:root[data-palette] .youtd_button_link:hover,
:root[data-palette] .lb-button:hover,
:root[data-palette] .replay-button:hover {
	color: var(--yt-accent-fill);
	background: #fff;
}

/* Signed-out placeholders (Download Map, View Code): no hover change */
:root[data-palette] .youtd_button_link.youtd_button_disabled:hover {
	color: #fff;
	background: var(--yt-accent-fill);
}

/* Log in, register and terms buttons: the theme's primary button */
:root[data-palette] #login input.button1,
:root[data-palette] #login a.button2,
:root[data-palette] #register input.button1,
:root[data-palette] #agreement input.button1,
:root[data-palette] .panel.auth-panel a.button2,
:root[data-palette] #login input.button1:focus,
:root[data-palette] #login a.button2:focus,
:root[data-palette] #register input.button1:focus,
:root[data-palette] #agreement input.button1:focus,
:root[data-palette] .panel.auth-panel a.button2:focus {
	color: var(--yt-primary-text);
	background: var(--yt-primary-bg);
	text-shadow: var(--yt-primary-text-shadow);
}

:root[data-palette] #login input.button1:hover,
:root[data-palette] #login a.button2:hover,
:root[data-palette] #register input.button1:hover,
:root[data-palette] #agreement input.button1:hover,
:root[data-palette] .panel.auth-panel a.button2:hover {
	color: var(--yt-primary-text);
	background: var(--yt-primary-bg-hover);
}

/* phpBB buttons (Post Reply, New Topic, topic tools, sort and search buttons)
   ----------------------------------------------------------------
   phpBB's white buttons with red text, and the white text links get on hover, are replaced
   by the header's dark buttons in the theme's colours. The search page's buttons have
   their own rules above.
---------------------------------------- */
.button {
	color: var(--yt-btn-text);
	background: var(--yt-surface);
	border-color: var(--yt-btn-border);
	box-shadow: none;
	text-shadow: none;
	filter: none;
	transition: color var(--yt-dur) var(--yt-ease), border-color var(--yt-dur) var(--yt-ease), box-shadow var(--yt-dur) var(--yt-ease);
}

.button:hover,
.button:focus,
.dropdown-visible > .button {
	color: var(--yt-btn-text-hover);
	background: var(--yt-surface);
	border-color: var(--yt-btn-text);
	box-shadow: 0 0 8px var(--yt-glow);
	text-shadow: none;
	filter: none;
}

.button .icon,
.button-secondary {
	color: var(--yt-btn-text);
}

.button:hover .icon,
.button:focus .icon,
.dropdown-visible > .button .icon,
.button-secondary:hover,
.button-secondary:focus {
	color: var(--yt-btn-text-hover);
}

.button .caret {
	border-color: var(--yt-btn-border);
}

.button-search:hover,
.button-search-end:hover {
	border-color: var(--yt-btn-text);
}

/* Posting page (new topic, reply, edit, private message): #postform
   ----------------------------------------------------------------
   The same dark panels, gold headings and fields as the advanced search page, in place of
   phpBB's light blue ones. Submit is the gold primary button (with the search page's, above);
   Preview, Save draft and Load draft are outlined in the theme's colour at the same size.
---------------------------------------- */
#postform .panel {
	color: var(--yt-panel-text);
	background: var(--yt-panel);
	border-radius: 7px;
}

/* Panels inside panels (the attachment file list) sit on their parent */
#postform .panel .panel {
	background: none;
}

#postform .panel h3 {
	color: var(--yt-heading);
	border-bottom-color: var(--yt-panel-line);
}

#postform .panel label,
#postform .panel dt,
#postform .panel dd {
	color: var(--yt-panel-text);
}

#postform .panel hr {
	border-color: var(--yt-panel-line);
}

#postform input[type="radio"],
#postform input[type="checkbox"] {
	accent-color: var(--yt-heading);
}

/* Subject, message, font size and the other fields */
#postform .inputbox,
#postform select {
	color: var(--yt-field-text);
	background: var(--yt-search-bg);
	border: 1px solid var(--yt-search-line);
	border-radius: 2px;
	transition: border-color var(--yt-dur) var(--yt-ease), box-shadow var(--yt-dur) var(--yt-ease);
}

#postform select option {
	color: var(--yt-field-text);
	background: var(--yt-search-bg);
}

#postform .inputbox:hover,
#postform select:hover {
	border-color: var(--yt-btn-border);
}

#postform .inputbox:focus,
#postform select:focus {
	border-color: var(--yt-search-focus);
	box-shadow: 0 0 0 1px var(--yt-search-focus);
	outline: 0;
}

#postform .inputbox::placeholder {
	color: var(--yt-search-placeholder);
}

/* The bar holding the submit buttons: darker than the panels so the buttons stand out */
#postform .panel.bg2 {
	background: var(--yt-surface);
	border: 1px solid var(--yt-panel-line);
}

#postform .submit-buttons {
	text-align: center;
}

/* Options / Attachments / Poll tabs: the active tab joins the panel under it */
#postform .tabs .tab > a {
	color: var(--yt-panel-dim);
	background: var(--yt-surface);
	border: 1px solid var(--yt-panel-line);
	border-bottom: 0;
	box-shadow: none;
	filter: none;
}

#postform .tabs .tab > a:hover {
	color: var(--yt-heading);
	background: var(--yt-surface);
}

#postform .tabs .activetab > a,
#postform .tabs .activetab > a:hover {
	color: var(--yt-heading);
	background: var(--yt-panel);
	border-color: var(--yt-panel);
	box-shadow: none;
	filter: none;
}

/* Secondary buttons: Preview and the draft buttons, plus the attachment buttons */
#postform input.button1:not(.default-submit-action),
#postform input.button2 {
	color: var(--yt-btn-text);
	background: var(--yt-surface);
	border: 1px solid var(--yt-btn-text);
	border-radius: var(--yt-radius);
	box-shadow: none;
	text-shadow: none;
	filter: none;
	cursor: pointer;
	transition: color var(--yt-dur) var(--yt-ease), border-color var(--yt-dur) var(--yt-ease), box-shadow .18s var(--yt-ease);
}

#postform input.button1:not(.default-submit-action):hover,
#postform input.button2:hover {
	color: var(--yt-btn-text-hover);
	background: var(--yt-surface);
	border-color: var(--yt-btn-text-hover);
	box-shadow: 0 0 8px var(--yt-glow);
}

/* The submit bar's buttons are all large, like the search page's Search */
#postform .submit-buttons input.button1,
#postform .submit-buttons input.button2 {
	height: 40px;
	min-width: 120px;
	margin: 4px 2px;
	padding: 0 20px;
	font: 600 15px/1 var(--yt-font);
}

#postform .submit-buttons input.default-submit-action {
	min-width: 160px;
}

/* User Control Panel (ucp.php): ucp_header.html, ucp_footer.html and the ucp_*.html pages
   ----------------------------------------------------------------
   phpBB's light blue control panel, redone like the posting page: the outer box is the theme's
   dark surface with the active tab joined to it, the side menu's current page matches the panel
   it opens, and the panels, headings and fields are the posting page's. Composing a private
   message is #postform inside this box, so those rules above apply there too.
---------------------------------------- */
#phpbb.section-ucp h2.ucp-title {
	margin: 14px 0 12px;
	font: 600 28px/1.2 var(--yt-font);
	letter-spacing: .02em;
	color: var(--yt-heading);
}

/* The outer box */
#phpbb.section-ucp .panel.bg3 {
	color: var(--yt-panel-text);
	background: var(--yt-surface);
	border: 1px solid var(--yt-panel-line);
	border-radius: 0 7px 7px 7px;
}

/* Top tabs: Overview, Profile, Board preferences and so on */
#phpbb.section-ucp .tabs .tab > a {
	color: var(--yt-panel-dim);
	background: color-mix(in srgb, var(--yt-surface) 55%, var(--yt-panel));
	border: 1px solid var(--yt-panel-line);
	border-bottom: 0;
	box-shadow: none;
	filter: none;
}

#phpbb.section-ucp .tabs .tab > a:hover {
	color: var(--yt-heading);
}

#phpbb.section-ucp .tabs .activetab > a,
#phpbb.section-ucp .tabs .activetab > a:hover {
	color: var(--yt-heading);
	background: var(--yt-surface);
	background-image: none;
	border-color: var(--yt-panel-line);
	box-shadow: 0 1px 0 var(--yt-surface);
	filter: none;
}

#phpbb.section-ucp .responsive-tab .responsive-tab-link:before {
	border-color: var(--yt-panel-dim);
}

#phpbb.section-ucp .responsive-tab .responsive-tab-link:hover:before {
	border-color: var(--yt-heading);
}

#phpbb.section-ucp .tabs .dropdown .dropdown-contents {
	background: var(--yt-surface);
	border-color: var(--yt-panel-line);
}

/* Side menu: the page links, private message folders and the friends box */
#phpbb.section-ucp .navigation a,
#phpbb.section-ucp.rtl .navigation a {
	color: var(--yt-panel-text);
	background: transparent;
	border-radius: 4px 0 0 4px;
	filter: none;
	transition: color var(--yt-dur) var(--yt-ease), background-color var(--yt-dur) var(--yt-ease);
}

#phpbb.section-ucp .navigation a:hover {
	color: var(--yt-heading);
	background: color-mix(in srgb, var(--yt-panel) 50%, transparent);
}

#phpbb.section-ucp .navigation .active-subsection a,
#phpbb.section-ucp .navigation .active-subsection a:hover {
	color: var(--yt-heading);
	background: var(--yt-panel);
}

#phpbb.section-ucp .cp-menu hr,
#phpbb.section-ucp .panel-container hr,
#phpbb.section-ucp .panel-container h3 {
	border-color: var(--yt-panel-line);
}

#phpbb.section-ucp .cp-mini {
	color: var(--yt-panel-text);
	background: var(--yt-panel);
}

#phpbb.section-ucp dl.mini dt {
	color: var(--yt-heading);
}

/* Panels in the main area */
#phpbb.section-ucp .panel-container h2,
#phpbb.section-ucp .cp-main h2 {
	color: var(--yt-heading);
	font-family: var(--yt-font);
}

#phpbb.section-ucp .cp-main .panel {
	color: var(--yt-panel-text);
	background: var(--yt-panel);
	border-radius: 7px;
}

/* Panels inside panels sit on their parent; the private message submit bar stays darker */
#phpbb.section-ucp .cp-main .panel .panel {
	background: none;
}

#phpbb.section-ucp #postform .cp-main .panel.bg2 {
	background: var(--yt-surface);
	border: 1px solid var(--yt-panel-line);
}

#phpbb.section-ucp .cp-main .panel h3 {
	color: var(--yt-heading);
	border-bottom-color: var(--yt-panel-line);
}

#phpbb.section-ucp .cp-main label,
#phpbb.section-ucp .cp-main dd label,
#phpbb.section-ucp .cp-main fieldset dl:hover dt label,
#phpbb.section-ucp .cp-main dt,
#phpbb.section-ucp .cp-main dd {
	color: var(--yt-panel-text);
}

#phpbb.section-ucp .cp-main fieldset dt span,
#phpbb.section-ucp .cp-main .explain {
	color: var(--yt-panel-dim);
}

#phpbb.section-ucp .cp-main hr.dashed {
	border-top-color: var(--yt-panel-line);
}

#phpbb.section-ucp .cp-main input[type="radio"],
#phpbb.section-ucp .cp-main input[type="checkbox"] {
	accent-color: var(--yt-heading);
}

/* phpBB's dark red is hard to read on the dark panels */
#phpbb.section-ucp .cp-main .error {
	color: #ff6b6b;
}

/* Text fields, text areas and selects: the posting page's fields */
#phpbb.section-ucp .cp-main .inputbox,
#phpbb.section-ucp .cp-main select,
#phpbb.section-ucp .cp-main textarea {
	color: var(--yt-field-text);
	background: var(--yt-search-bg);
	border: 1px solid var(--yt-search-line);
	border-radius: 2px;
	transition: border-color var(--yt-dur) var(--yt-ease), box-shadow var(--yt-dur) var(--yt-ease);
}

#phpbb.section-ucp .cp-main select option {
	color: var(--yt-field-text);
	background: var(--yt-search-bg);
}

#phpbb.section-ucp .cp-main .inputbox:hover,
#phpbb.section-ucp .cp-main select:hover,
#phpbb.section-ucp .cp-main textarea:hover {
	border-color: var(--yt-btn-border);
}

#phpbb.section-ucp .cp-main .inputbox:focus,
#phpbb.section-ucp .cp-main select:focus,
#phpbb.section-ucp .cp-main textarea:focus {
	border-color: var(--yt-search-focus);
	box-shadow: 0 0 0 1px var(--yt-search-focus);
	outline: 0;
}

#phpbb.section-ucp .cp-main .inputbox::placeholder {
	color: var(--yt-search-placeholder);
}

/* Lists (bookmarks, subscriptions, drafts, attachments, private messages) and tables (groups) */
#phpbb.section-ucp .panel-container .panel li.header dt,
#phpbb.section-ucp .panel-container .panel li.header dd,
#phpbb.section-ucp .panel-container table.table1 thead th {
	color: var(--yt-panel-dim);
	border-bottom-color: var(--yt-panel-line);
}

#phpbb.section-ucp .panel-container .panel li.row {
	border-top-color: var(--yt-panel-line);
	border-bottom-color: var(--yt-panel-line);
}

#phpbb.section-ucp ul.cplist {
	border-top-color: var(--yt-panel-line);
}

/* phpBB's grey-blue table text is hard to read on the dark rows */
#phpbb.section-ucp .panel-container table.table1 tbody td,
#phpbb.section-ucp .panel-container table.table1 tbody th {
	color: var(--yt-panel-text);
	border-color: var(--yt-panel-line);
}

/* Reading a private message, and the avatar gallery */
#phpbb.section-ucp .cp-main .pm,
#phpbb.section-ucp .cp-main .pm-message {
	color: var(--yt-panel-text);
	background: var(--yt-surface);
	border-color: var(--yt-panel-line);
}

#phpbb.section-ucp .gallery label {
	background: var(--yt-surface);
	border-color: var(--yt-panel-line);
}

#phpbb.section-ucp .gallery label:hover {
	background: color-mix(in srgb, var(--yt-panel) 60%, var(--yt-surface));
}

/* Buttons: Submit is the gold primary button, the others (Reset, Add, Delete) are outlined */
#phpbb.section-ucp .cp-main input.button1 {
	min-width: 120px;
	height: 36px;
	padding: 0 22px;
	font: 600 15px/1 var(--yt-font);
	color: #1b1307;
	background: linear-gradient(#f2c13a, #d39a0a);
	border: 1px solid #8a5a00;
	border-radius: var(--yt-radius);
	box-shadow: inset 0 1px 0 rgba(255, 246, 200, .6), inset 0 -1px 0 rgba(120, 70, 0, .35);
	text-shadow: none;
	filter: none;
	cursor: pointer;
	transition: border-color var(--yt-dur) var(--yt-ease), box-shadow .18s var(--yt-ease);
}

#phpbb.section-ucp .cp-main input.button1:hover {
	color: #1b1307;
	background: linear-gradient(#ffdd6e, #ebb020);
	border-color: #a76e00;
	box-shadow: inset 0 1px 0 rgba(255, 246, 200, .6), inset 0 -1px 0 rgba(120, 70, 0, .35), 0 0 6px var(--yt-glow);
}

:root[data-palette] #phpbb.section-ucp .cp-main input.button1 {
	color: var(--yt-primary-text);
	background: var(--yt-primary-bg);
	border-color: var(--yt-primary-border);
	box-shadow: var(--yt-primary-shadow);
	text-shadow: var(--yt-primary-text-shadow);
}

:root[data-palette] #phpbb.section-ucp .cp-main input.button1:hover {
	color: var(--yt-primary-text);
	background: var(--yt-primary-bg-hover);
	border-color: var(--yt-primary-border-hover);
	box-shadow: var(--yt-primary-shadow), 0 0 6px var(--yt-glow);
}

#phpbb.section-ucp .cp-main input.button2,
#phpbb.section-ucp .cp-mini input.button2 {
	color: var(--yt-btn-text);
	background: var(--yt-surface);
	border: 1px solid var(--yt-btn-text);
	border-radius: var(--yt-radius);
	box-shadow: none;
	text-shadow: none;
	filter: none;
	cursor: pointer;
	transition: color var(--yt-dur) var(--yt-ease), border-color var(--yt-dur) var(--yt-ease), box-shadow .18s var(--yt-ease);
}

#phpbb.section-ucp .cp-main fieldset.submit-buttons input.button2 {
	min-width: 100px;
	height: 36px;
	padding: 0 18px;
	font: 600 15px/1 var(--yt-font);
}

#phpbb.section-ucp .cp-main input.button2:hover,
#phpbb.section-ucp .cp-mini input.button2:hover {
	color: var(--yt-btn-text-hover);
	background: var(--yt-surface);
	border-color: var(--yt-btn-text-hover);
	box-shadow: 0 0 8px var(--yt-glow);
}

#phpbb.section-ucp .cp-main input.button1:focus-visible,
#phpbb.section-ucp .cp-main input.button2:focus-visible {
	outline: 2px solid var(--yt-gold-hi);
	outline-offset: 2px;
}

/* Narrow screens: phpBB gives the side menu links a light blue background */
@media only screen and (max-width: 900px), only screen and (max-device-width: 900px) {
	#phpbb.section-ucp #navigation a,
	#phpbb.section-ucp.rtl #navigation a {
		background: color-mix(in srgb, var(--yt-panel) 50%, transparent);
		border-radius: 4px;
	}

	#phpbb.section-ucp #navigation .active-subsection a {
		background: var(--yt-panel);
	}
}

/* Discord log in button on the log in and register pages (login_body_oauth.html)
   ----------------------------------------------------------------
   Identical to the header's Log In button above; #phpbb outranks the older
   #login / .panel.auth-panel a.oauth-discord rules in colours.css.
---------------------------------------- */
#phpbb a.oauth-discord.yt-discord-login,
#phpbb a.oauth-discord.yt-discord-login:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 36px;
	padding: 0 .8rem;
	font: 600 15px/1 var(--yt-font);
	white-space: nowrap;
	text-decoration: none;
	color: #fff;
	background: linear-gradient(#6a76f5, #4752c4);
	border: 1px solid #2f3790;
	border-radius: var(--yt-radius);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .25);
	text-shadow: none;
	filter: none;
	transition: color var(--yt-dur) var(--yt-ease), border-color var(--yt-dur) var(--yt-ease), box-shadow .18s var(--yt-ease);
}

#phpbb a.oauth-discord.yt-discord-login svg {
	flex: none;
}

#phpbb a.oauth-discord.yt-discord-login:not(:active):hover,
#phpbb a.oauth-discord.yt-discord-login:focus-visible {
	color: #fff;
	background: linear-gradient(#7d88ff, #5865f2);
	border-color: #3d47b8;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 8px rgba(88, 101, 242, .55);
	text-decoration: none;
}

#phpbb a.oauth-discord.yt-discord-login:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Room between the button and the notice under it */
#phpbb .oauth-notice {
	margin-top: 16px;
}

@media (min-width: 768px) {
	#phpbb a.oauth-discord.yt-discord-login {
		height: 38px;
		padding: 0 1.1rem;
	}
}
