:root {
	--gold: #ffc861;
	--ink: #e9e4d8;
	--muted: #a49d8f;
	--panel: rgba(8, 9, 18, 0.82);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: #03040a;
	color: var(--ink);
	font: 15px/1.4 Georgia, 'Times New Roman', serif;
	touch-action: none;
	user-select: none;
}

canvas { display: block; width: 100vw; height: 100vh; }

#menu {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 16px;
	background: #03040a url(assets/title.png) center / cover no-repeat;
}

#menu[hidden], #hud[hidden], #death[hidden] { display: none; }

#death {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 16px;
	background: radial-gradient(circle, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.75));
	animation: fade-in 1.2s ease-out;
}

#death h2 {
	margin: 0 0 6px;
	font-size: 30px;
	font-weight: normal;
	color: #c9b6ff;
	text-shadow: 0 0 20px rgba(150, 100, 255, 0.6);
}

#death-cause { margin: 0 0 18px; color: var(--muted); font-style: italic; }

#death dl { display: flex; justify-content: center; gap: 32px; margin: 0 0 22px; }
#death dt { color: var(--muted); font-size: 13px; }
#death dd { margin: 0; font-size: 26px; color: var(--gold); }
#death .hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

@keyframes fade-in {
	from { opacity: 0; }
}

#feed {
	position: absolute;
	top: 14px;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: center;
	font-size: 14px;
	color: var(--muted);
	text-shadow: 0 0 6px #000;
}

#feed li { transition: opacity 1s; }
#feed li.fading { opacity: 0; }
#feed b { color: var(--ink); font-weight: normal; }
#feed .bane { color: #c9b6ff; }

.panel {
	width: min(440px, 100%);
	padding: 28px;
	border: 1px solid rgba(255, 200, 97, 0.25);
	border-radius: 14px;
	background: var(--panel);
	backdrop-filter: blur(6px);
	box-shadow: 0 0 60px rgba(255, 170, 60, 0.15);
	text-align: center;
}

h1 {
	margin: 0;
	font-size: 46px;
	font-weight: normal;
	letter-spacing: 2px;
	color: var(--gold);
	text-shadow: 0 0 24px rgba(255, 180, 70, 0.7);
}

.tagline { margin: 4px 0 22px; color: var(--muted); font-style: italic; }

#join { display: flex; gap: 8px; }

input, button {
	font: inherit;
	border-radius: 8px;
	border: 1px solid rgba(255, 200, 97, 0.35);
}

input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	background: rgba(0, 0, 0, 0.5);
	color: var(--ink);
}

button {
	padding: 10px 14px;
	background: linear-gradient(#ffcf70, #e09a35);
	color: #2a1703;
	cursor: pointer;
}

button:hover { filter: brightness(1.1); }

#status { min-height: 1.4em; margin: 12px 0 0; color: #ff9e8a; }

.help {
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
	text-align: left;
	color: var(--muted);
	font-size: 14px;
}

.help li { padding: 3px 0; }
.help b { color: var(--ink); font-weight: normal; }

#hud { position: fixed; inset: 0; pointer-events: none; }

#stats {
	position: absolute;
	top: 14px;
	left: 16px;
	font-size: 18px;
	color: var(--gold);
	text-shadow: 0 0 10px rgba(255, 180, 70, 0.8);
}

#stats span:first-child { font-size: 30px; }
#stats small { margin-left: 8px; color: var(--muted); text-shadow: none; }
#banished { font-size: 15px; color: #c9b6ff; text-shadow: 0 0 10px rgba(150, 100, 255, 0.8); }
#banished[hidden] { display: none; }
#leaderboard .bane { color: #c9b6ff; font-size: 12px; }

#leaderboard {
	position: absolute;
	top: 14px;
	right: 16px;
	min-width: 180px;
	margin: 0;
	padding: 10px 14px 10px 34px;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.45);
	font-size: 14px;
}

#leaderboard li { display: flex; justify-content: space-between; gap: 12px; }
#leaderboard li.me { color: var(--gold); }

#mute, #dash { position: absolute; pointer-events: auto; }

#mute {
	bottom: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	padding: 0;
	background: rgba(0, 0, 0, 0.5);
	color: var(--gold);
}

#mute.off { opacity: 0.4; }

#dash {
	display: none;
	bottom: 28px;
	right: 72px;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	opacity: 0.8;
}

@media (pointer: coarse) {
	#dash { display: block; }
	#leaderboard { font-size: 12px; min-width: 140px; }
}
