* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	min-height: 100vh;
	background: radial-gradient(ellipse at 50% -10%, #17171c 0%, #000 70%) fixed;
	color: #f4f4f6;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
}

#app {
	max-width: 1040px;
	margin: 0 auto;
	padding: 40px 20px 80px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.head {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 22px;
	border-bottom: 1px solid #1e1e24;
}

.logo {
	height: 52px;
	filter: drop-shadow(0 0 18px rgba(236, 28, 36, 0.35));
}

.titles h1 {
	font-size: 22px;
	letter-spacing: 6px;
	margin-right: -6px;
}

.sub {
	color: #9aa0ab;
	font-size: 13px;
}

.head .ghost {
	margin-left: auto;
}

h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: #9aa0ab;
	margin-bottom: 16px;
}

.count {
	color: #5c616b;
	letter-spacing: 0;
}

.search {
	margin-left: auto;
	width: 200px;
	padding: 7px 10px;
	font-size: 13px;
	letter-spacing: 0;
	text-transform: none;
}

.dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3a3a44;
}

.dot.on {
	background: #ec1c24;
	box-shadow: 0 0 10px rgba(236, 28, 36, 0.9);
}

.card,
.gate {
	background: #0d0d11;
	border: 1px solid #1e1e24;
	border-radius: 10px;
	padding: 22px;
}

.live {
	border-color: #26262e;
}

input,
select,
button {
	font: inherit;
	border-radius: 7px;
	border: 1px solid #26262e;
	background: #131318;
	color: #f4f4f6;
	padding: 10px 12px;
	outline: none;
}

input:focus,
select:focus {
	border-color: #ec1c24;
}

input::placeholder {
	color: #5c616b;
}

button {
	background: #ec1c24;
	border-color: #ec1c24;
	cursor: pointer;
	font-weight: 700;
}

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

button:disabled {
	opacity: 0.4;
	cursor: default;
	filter: none;
}

.ghost {
	background: transparent;
	border-color: #26262e;
	color: #9aa0ab;
	font-weight: 400;
}

.ghost:hover {
	color: #f4f4f6;
}

.tiny {
	padding: 6px 10px;
	font-size: 13px;
}

.danger:hover {
	color: #d9535b;
	border-color: #d9535b;
}

.gate form,
.add {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.gate input,
.add input {
	flex: 1 1 260px;
}

.add input.short {
	flex: 0 1 200px;
}

.upload {
	display: block;
	margin-top: 14px;
	color: #9aa0ab;
	font-size: 13px;
	cursor: pointer;
}

.upload input {
	display: none;
}

.upload span {
	border-bottom: 1px dashed #3a3a44;
}

.error {
	margin-top: 12px;
	color: #d9535b;
	font-size: 13px;
	white-space: pre-wrap;
}

.empty {
	color: #5c616b;
}

.now {
	display: flex;
	gap: 20px;
	align-items: flex-start;
}

.now-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.now-title {
	font-size: 19px;
	font-weight: 700;
}

.now-meta {
	color: #9aa0ab;
	font-size: 13px;
}

.poster {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	overflow: hidden;
	background: #131318;
	border: 1px solid #1e1e24;
	cursor: pointer;
}

.poster.big {
	flex: 0 0 300px;
	cursor: default;
}

.poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.poster.empty::after {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 50% 40%, #1c1c22 0%, #0b0b0e 75%);
}

.badge {
	position: absolute;
	right: 6px;
	bottom: 6px;
	z-index: 1;
	background: rgba(0, 0, 0, 0.75);
	border-radius: 4px;
	padding: 2px 6px;
	font-size: 11px;
	color: #f4f4f6;
}

.controls {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 2px;
}

.toggle {
	display: flex;
	align-items: center;
	gap: 7px;
	color: #9aa0ab;
	font-size: 13px;
	cursor: pointer;
}

.toggle input {
	accent-color: #ec1c24;
	width: 15px;
	height: 15px;
	padding: 0;
}

.hint {
	color: #5c616b;
	font-size: 12px;
}

.queue {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid #17171c;
}

.queue-head {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: #9aa0ab;
	margin-bottom: 12px;
}

.queue-head button {
	margin-left: auto;
	letter-spacing: 0;
	text-transform: none;
}

.state {
	letter-spacing: 0;
	text-transform: none;
	color: #5c616b;
	font-size: 13px;
}

.qrow {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
}

.qnum {
	width: 22px;
	color: #5c616b;
	font-size: 13px;
}

.qtitle {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
}

.job + .job {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #17171c;
}

.job-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 9px;
}

.job-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.job-stage {
	color: #9aa0ab;
	font-size: 13px;
	margin-left: auto;
}

.job-stage.done {
	color: #4caf7d;
}

.job-stage.error {
	color: #d9535b;
}

.bar {
	height: 4px;
	border-radius: 2px;
	background: #17171c;
	overflow: hidden;
}

.bar i {
	display: block;
	height: 100%;
	background: #ec1c24;
	transition: width 0.3s;
}

.bar i.done {
	background: #4caf7d;
}

.bar i.error {
	background: #d9535b;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 18px;
}

.tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	overflow: hidden;
}

.tile.playing .poster {
	border-color: #ec1c24;
	box-shadow: 0 0 0 1px #ec1c24;
}

.tile-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 14px;
}

.tile-meta {
	color: #5c616b;
	font-size: 12px;
}

/* пять кнопок в ряд не влезают в колонку, поэтому иконки переносятся на вторую строку */
.tile-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 2px;
}

.tile-actions button {
	white-space: nowrap;
}

.item-url {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 12px;
	color: #9aa0ab;
	background: #131318;
	border: 1px solid #1e1e24;
	border-radius: 6px;
	padding: 8px 10px;
	cursor: pointer;
}

.item-url:hover {
	color: #f4f4f6;
}

.toast {
	position: fixed;
	left: 50%;
	bottom: 26px;
	transform: translateX(-50%);
	background: #17171c;
	border: 1px solid #26262e;
	border-radius: 8px;
	padding: 11px 18px;
	font-size: 13px;
}

@media (max-width: 620px) {
	.now {
		flex-direction: column;
	}

	.poster.big {
		flex: 1 1 auto;
		width: 100%;
	}

	.search {
		width: 130px;
	}
}
