/* Header and navigation shared by the launcher and GWT pages. */
.topbar, .drawer, .scrim {
  --grit: url("../assets/grit-tile.png");
  --red: #f31b20;
  --yellow: #ffcc1a;
  --text: #f7f3ea;
  --surface: #141210;
  --line-soft: rgba(255, 255, 255, 0.08);
  --font-cond: "Barlow Condensed", "Anton", sans-serif;
  --header-h: 64px;
  --radius-sm: 10px;
  color: var(--text);
}
.topbar, .topbar *, .topbar::after, .drawer, .drawer * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.topbar [hidden], .drawer [hidden], .scrim[hidden] {
  display: none !important;
}
.topbar :focus-visible, .drawer :focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}
.logo-img {
  display: block;
  max-width: 100%;
}
/* --- Topbar --------------------------------------------------------------- */

.topbar {
	position: sticky;
	top: 0;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 12px;
	height: var(--header-h);
	padding: 0 16px 0 18px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%),
		var(--grit),
		#0a0a0a;
	background-size: auto, 220px 220px, auto;
	border-bottom: 1px solid rgba(255, 255, 255, 0.07);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

/*
 * The livery stripe: red under the menu button, yellow under the logo, then trailing off to the right like a speed
 * streak.  Fading it out (rather than running it edge to edge) keeps it an accent on the brand instead of a bar
 * across the page, and lets the hairline above carry the structural job of separating the header.
 */
.topbar::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: linear-gradient(90deg,
		var(--red) 0,
		var(--red) 56px,
		var(--yellow) 200px,
		rgba(255, 204, 26, 0.45) 46%,
		rgba(255, 204, 26, 0) 78%);
}

.logo-link {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.logo-img {
	height: 38px;
	width: auto;
	filter:
		drop-shadow(0 0 3px rgba(255, 224, 160, 0.5))
		drop-shadow(0 0 8px rgba(255, 190, 80, 0.22));
}

.drawer-head .logo-img {
	height: 32px;
}

.topbar-right {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.icon-btn {
	position: relative;
	width: 42px;
	height: 42px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--text);
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

#menuBtn {
	color: var(--red);
	flex: 0 0 auto;
}

.icon-btn svg {
	width: 22px;
	height: 22px;
}

.icon-btn .icon-sound-off,
.icon-btn.is-muted .icon-sound-on {
	display: none;
}

.icon-btn.is-muted .icon-sound-off {
	display: block;
}

.icon-btn:hover {
	background: rgba(255, 189, 15, 0.12);
	border-color: rgba(255, 189, 15, 0.35);
}

#menuBtn:hover,
#menuBtn:focus-visible {
	background: rgba(243, 27, 32, 0.16);
	border-color: rgba(243, 27, 32, 0.4);
	color: #ff6b6b;
}

.icon-btn:active {
	transform: scale(0.96);
}

.notify-dot {
	position: absolute;
	top: 8px;
	right: 9px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--red);
	box-shadow: 0 0 0 2px #16120e;
}

/* --- Drawer --------------------------------------------------------------- */

.scrim {
	position: fixed;
	inset: 0;
	z-index: 90;
	background: rgba(20, 14, 8, 0.5);
	backdrop-filter: blur(4px);
}

.drawer {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 100;
	width: min(340px, 88vw);
	height: 100%;
	overflow-y: auto;
	background:
		var(--grit),
		var(--surface);
	background-size: 220px 220px, auto;
	border-right: 1px solid var(--line-soft);
	transform: translateX(-105%);
	transition: transform 0.28s ease;
	box-shadow: 16px 0 40px rgba(0, 0, 0, 0.4);
}

body.nav-open {
	overflow: hidden;
}

body.nav-open .drawer {
	transform: translateX(0);
}

.drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-nav {
	display: flex;
	flex-direction: column;
	padding: 10px;
	gap: 4px;
}

.drawer-nav a,
.drawer-nav button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--text);
	font-family: var(--font-cond);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	text-align: left;
}

.drawer-nav a:hover,
.drawer-nav button:hover {
	background: rgba(255, 204, 26, 0.14);
	color: var(--yellow);
}

.drawer-nav a[aria-current="page"] {
	background: rgba(255, 204, 26, 0.1);
	color: var(--yellow);
	box-shadow: inset 3px 0 0 var(--yellow);
}

.drawer-nav svg {
	width: 22px;
	height: 22px;
	flex: 0 0 auto;
}

.drawer-nav hr {
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	margin: 8px;
}

.drawer .icon-btn {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.12);
}


@media (max-width: 720px) {
	.topbar { --header-h: 56px; }
	.topbar {
		padding: 0 10px 0 12px;
		gap: 8px;
	}
	.logo-img {
		height: 30px;
	}
	.topbar::after {
		background: linear-gradient(90deg,
			var(--red) 0,
			var(--red) 44px,
			var(--yellow) 160px,
			rgba(255, 204, 26, 0.45) 55%,
			rgba(255, 204, 26, 0) 90%);
	}
	.icon-btn {
		width: 38px;
		height: 38px;
		border-radius: var(--radius-sm);
	}
}
