#stage {
	--bg: #10120e;
	--panel: #1b1e17;
	--panel-2: #262b20;
	--line: #3a3f32;
	--text: #ebe6d6;
	--muted: #9c9788;
	--accent: #e0c17a;
	--active: #3d4c32;
	--active-line: #6d7d56;
	color: var(--text);
}

html, body.play-shell {
	margin: 0;
	height: 100%;
	height: 100dvh;
	overflow: hidden;
	background: #10120e;
}

button { font: inherit; touch-action: manipulation; }

#app {
	height: 100%;
	min-height: 100%;
	display: flex;
	flex-direction: column;
}

.play-shell .site-header {
	position: relative;
	flex: none;
	z-index: 5;
}

.play-shell .site-header,
.play-shell .header-inner {
	width: 100%;
	max-width: none;
	margin: 0;
	box-sizing: border-box;
}

.play-shell .nav {
	display: flex !important;
	position: static;
	flex-direction: row;
	background: transparent;
	border: 0;
	padding: 0;
	align-items: center;
}

.play-tools {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

.play-tools button,
.play-user button,
.play-user a.btn {
	background: rgba(20, 26, 34, 0.8);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: 6px;
	padding: 0.35rem 0.7rem;
	min-height: 34px;
	cursor: pointer;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}

.play-tools button:hover,
.play-user button:hover,
.play-user a.btn:hover {
	border-color: var(--accent);
	color: var(--accent);
	transform: none;
	text-decoration: none;
}

.play-user {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	color: var(--text-muted);
	font-size: 0.84rem;
	white-space: nowrap;
}

.play-user[hidden],
.play-user > [hidden],
#panel-toggle[hidden] {
	display: none !important;
}

.play-user b {
	color: var(--text);
	font-weight: 600;
}

#stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

#panel {
	position: relative;
	z-index: 3;
	flex: none;
	background: var(--panel);
	border-bottom: 1px solid var(--line);
}

#panel[hidden] { display: none !important; }

#bar {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 6px 10px;
}

#now {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--accent);
	font-weight: 700;
}

#now small {
	color: var(--muted);
	font-size: 12px;
	margin-left: 6px;
	font-weight: 400;
}

#sheet { display: none; padding: 2px 10px 8px; }

html.panel-open #sheet {
	display: block;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: var(--panel);
	border-bottom: 1px solid var(--line);
	box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
	max-height: min(340px, 46dvh);
	overflow: auto;
}

#backdrop {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 2;
	background: rgba(0, 0, 0, 0.45);
}

html.panel-open #backdrop { display: block; }

.kicker {
	margin: 8px 2px 4px;
	color: var(--muted);
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

#switcher, #toggles { display: flex; flex-direction: column; gap: 2px; }

.ver, .flag {
	cursor: pointer;
	border-radius: 6px;
	min-height: 34px;
}

.ver {
	width: 100%;
	text-align: left;
	background: transparent;
	border: 1px solid transparent;
	padding: 6px 10px;
	color: var(--text);
}

.ver:hover { background: var(--panel-2); }

.ver[aria-current="true"] {
	background: var(--active);
	border-color: var(--active-line);
}

.row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 2px;
}

.row .name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.flag {
	flex: none;
	background: var(--panel-2);
	border: 1px solid var(--line);
	color: var(--text);
	padding: 6px 10px;
	white-space: nowrap;
}

.flag[aria-pressed="false"] { color: var(--muted); }

.empty { margin: 4px 2px 8px; color: var(--muted); }

#game {
	position: relative;
	z-index: 1;
	flex: 1 1 auto;
	width: 100%;
	min-height: 0;
	border: 0;
	background: #000;
}

#game:fullscreen,
#game:-webkit-full-screen {
	width: 100%;
	height: 100%;
}

button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

@media (max-width: 860px) {
	.play-shell .site-header {
		height: auto;
		padding-top: env(safe-area-inset-top);
	}

	.play-shell .header-inner {
		height: auto;
		flex-wrap: wrap;
		align-items: center;
		padding: 0.4rem 0.6rem 0.45rem;
		gap: 0.35rem 0.5rem;
	}

	.play-shell .brand {
		font-size: 0.95rem;
	}

	.play-shell .brand img {
		width: 32px;
		height: 32px;
	}

	.play-shell .brand-sub {
		display: none;
	}

	.play-shell .nav {
		order: 3;
		flex: 1 0 100%;
		min-width: 0;
		overflow-x: auto;
		gap: 0.1rem;
	}

	.play-shell .nav a {
		flex: none;
		padding: 0.3rem 0.5rem;
		font-size: 0.72rem;
	}

	.play-tools {
		flex: 1 1 auto;
		min-width: 0;
		margin-left: auto;
		justify-content: flex-end;
		flex-wrap: wrap;
		gap: 0.3rem;
	}

	.play-tools button,
	.play-user button,
	.play-user a.btn {
		padding: 0.3rem 0.5rem;
		font-size: 0.68rem;
		letter-spacing: 0.02em;
	}

	.play-user span { display: none; }
}

@media (max-width: 520px) {
	.play-shell .play-tools {
		flex: 1 0 100%;
		margin-left: 0;
		justify-content: flex-start;
	}

	.play-shell .nav {
		order: 2;
	}

	.play-tools {
		order: 3;
	}
}

@media (min-width: 860px) {
	html.panel-open #backdrop { display: none; }

	html.panel-open #stage { flex-direction: row; }

	html.panel-open #panel {
		width: 252px;
		height: auto;
		min-height: 0;
		align-self: stretch;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		border-bottom: 0;
		border-right: 1px solid var(--line);
	}

	html.panel-open #sheet {
		position: static;
		flex: 1 1 auto;
		min-height: 0;
		max-height: none;
		box-shadow: none;
		border-bottom: 0;
	}
}
