:root {
	color-scheme: dark;
	--bg: #121214;
	--surface: #1c1c20;
	--text: #eaeaea;
	--muted: #8a8a92;
	--accent: #e5484d;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.topbar {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 14px 24px;
	background: var(--surface);
	border-bottom: 1px solid #2a2a2e;
}

.topbar .brand {
	font-weight: 700;
	font-size: 1.2rem;
	color: var(--text);
	text-decoration: none;
}

.topbar nav { display: flex; gap: 16px; flex: 1; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--text); }

.logout-form button, .rescan-form button {
	background: transparent;
	border: 1px solid #3a3a3e;
	color: var(--muted);
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
}

main { padding: 24px; max-width: 1200px; margin: 0 auto; }

.muted { color: var(--muted); font-weight: normal; font-size: 0.85em; }

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 20px;
	margin-bottom: 24px;
}

.card { color: var(--text); text-decoration: none; }
.poster.placeholder {
	aspect-ratio: 2/3;
	background: linear-gradient(160deg, #2a2a30, #1a1a1e);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	text-align: center;
	font-weight: 600;
	color: #cfcfcf;
}
.card-title { margin-top: 8px; font-size: 0.95rem; }

.episode-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.episode {
	display: flex;
	gap: 12px;
	align-items: baseline;
	padding: 10px 14px;
	background: var(--surface);
	border-radius: 6px;
	color: var(--text);
	text-decoration: none;
}
.episode:hover { background: #232327; }
.ep-num { color: var(--accent); font-weight: 700; min-width: 3ch; }

.detail .play-button {
	display: inline-block;
	margin-top: 16px;
	background: var(--accent);
	color: white;
	text-decoration: none;
	padding: 10px 20px;
	border-radius: 6px;
	font-weight: 600;
}

.watch video { width: 100%; max-height: 75vh; background: black; border-radius: 8px; }
.time-readout {
	margin-top: 8px;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
	font-size: 0.9rem;
}
.controls-row { display: flex; gap: 24px; margin-top: 14px; }
.controls-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.controls-row select { background: var(--surface); color: var(--text); border: 1px solid #3a3a3e; border-radius: 6px; padding: 6px 10px; }

.login-body {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	background: var(--bg);
	color: var(--text);
}
.login-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--surface);
	padding: 32px;
	border-radius: 10px;
	width: 280px;
}
.login-card input, .login-card button {
	padding: 10px 12px;
	border-radius: 6px;
	border: 1px solid #3a3a3e;
	background: #141416;
	color: var(--text);
}
.login-card button { background: var(--accent); border: none; font-weight: 600; cursor: pointer; }
.login-card .error { color: var(--accent); font-size: 0.9rem; margin: 0; }
