:root {
	color-scheme: dark;
	--ink: #f5f5f2;
	--muted: #a9aaa6;
	--canvas: #090a0b;
	--bar: #131416;
	--panel: #1a1b1e;
	--line: #303136;
	--live: #e10600;
	--warning: #ffb000;
	--accent: #d9ff00;
}

html, body {
	margin: 0;
	width: 100%;
	min-height: 100%;
	background: var(--canvas);
	color: var(--ink);
	font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
}

body {
	display: grid;
	place-items: center;
	background-color: var(--canvas);
	background-image:
		linear-gradient(115deg, transparent 0 46%, rgb(225 6 0 / 11%) 46% 47%, transparent 47% 100%),
		linear-gradient(90deg, rgb(255 255 255 / 3%) 1px, transparent 1px),
		linear-gradient(rgb(255 255 255 / 3%) 1px, transparent 1px);
	background-size: auto, 32px 32px, 32px 32px;
}

main {
	width: min(100vw, 1600px);
	box-shadow: 0 24px 80px rgb(0 0 0 / 48%);
}

.topbar {
	position: relative;
	overflow: hidden;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	align-items: center;
	padding: 15px 20px;
	background: var(--bar);
	border-bottom: 1px solid var(--line);
}

.topbar::after {
	position: absolute;
	right: -4px;
	bottom: 0;
	width: 170px;
	height: 7px;
	background: repeating-conic-gradient(#f5f5f2 0 25%, #141518 0 50%) 50% / 14px 14px;
	content: '';
	opacity: 0.8;
}

.stream-heading {
	display: grid;
	gap: 0;
	min-width: 0;
	z-index: 1;
}

.brand-kicker {
	color: var(--live);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 2.2px;
	line-height: 1;
}

.brand-row {
	display: flex;
	gap: 14px;
	align-items: center;
}

.brand {
	font-size: 25px;
	font-style: italic;
	font-weight: 900;
	letter-spacing: 0.6px;
	line-height: 1.05;
	text-transform: uppercase;
	white-space: nowrap;
}

.discord-link {
	display: inline-flex;
	gap: 7px;
	align-items: center;
	min-height: 26px;
	padding: 0 9px;
	border: 1px solid #5865f2;
	border-radius: 2px;
	background: #5865f2;
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.55px;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.discord-link:hover { border-color: #7580ff; background: #4752c4; color: #fff; }
.discord-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.discord-mark {
	width: 14px;
	height: 14px;
	fill: currentcolor;
}

.stream-description {
	color: var(--muted);
	font-size: 11px;
	letter-spacing: 0.4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.stream-meta {
	display: flex;
	gap: 14px;
	align-items: center;
	min-width: 0;
	z-index: 1;
}

.stream-status,
.viewer-count,
.stream-duration {
	display: inline-flex;
	gap: 7px;
	align-items: center;
	color: var(--muted);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.25px;
	line-height: 20px;
	white-space: nowrap;
}

.stream-duration[hidden] { display: none; }

.status-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #777;
}

.is-live { color: var(--ink); }
.is-live .status-dot { background: var(--live); box-shadow: 0 0 0 4px rgb(240 78 62 / 15%); }
.is-reconnecting .status-dot { background: var(--warning); }
.is-unavailable .status-dot { background: var(--warning); }

.sound-toggle,
.go-live {
	min-width: 78px;
	height: 32px;
	border: 1px solid #ec7c6f;
	border-radius: 2px;
	background: transparent;
	color: var(--ink);
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	cursor: pointer;
}

.sound-toggle {
	min-width: 96px;
	border-color: #505156;
	color: var(--ink);
}

.go-live { border-color: var(--live); color: #ffb0ac; }
.go-live:hover:not(:disabled) { background: var(--live); color: white; }
.sound-toggle:hover { border-color: var(--ink); background: rgb(247 243 233 / 8%); }
.go-live:focus-visible,
.sound-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.go-live:disabled { border-color: var(--line); color: #6f716b; cursor: wait; }
.go-live.needs-attention:not(:disabled) { animation: live-pulse 1.6s ease-in-out infinite; }

.player-shell {
	position: relative;
	background: #000;
}

iframe {
	display: block;
	border: 0;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

.connection-notice {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	gap: 12px;
	background:
		linear-gradient(135deg, rgb(225 6 0 / 20%), transparent 45%),
		rgb(0 0 0 / 82%);
	color: var(--ink);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	text-align: center;
	text-transform: uppercase;
	pointer-events: none;
}

.connection-notice[hidden] { display: none; }

.player-shell:has(.connection-notice:not([hidden])) iframe {
	visibility: hidden;
}

.connection-spinner {
	justify-self: center;
	width: 24px;
	height: 24px;
	border: 2px solid rgb(247 243 233 / 28%);
	border-top-color: var(--live);
	border-radius: 50%;
	animation: spin 850ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes live-pulse {
	50% { border-color: #ffd2cc; box-shadow: 0 0 0 4px rgb(225 6 0 / 26%); }
}

@media (max-width: 620px) {
	.topbar { align-items: stretch; flex-direction: column; gap: 12px; padding: 14px; }
	.topbar::after { width: 112px; }
	.brand { font-size: 22px; }
	.brand-row { gap: 10px; }
	.discord-link { padding: 0 7px; font-size: 9px; }
	.stream-meta { width: 100%; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
	.stream-status { overflow: hidden; }
	.status-label { overflow: hidden; text-overflow: ellipsis; }
	.viewer-count { font-size: 12px; }
	.stream-duration { margin-left: auto; }
	.sound-toggle { min-width: 104px; }
	.go-live { min-width: 76px; }
}
