/* FBase TV — broadcast console */
:root {
	--bg: #0b0b0c;
	--bg-2: #111113;
	--panel: #141416;
	--panel-2: #191a1d;
	--line: #232427;
	--line-2: #2c2e33;
	--text: #f2f3f0;
	--dim: #8d9088;
	--accent: #c8ff00;       /* floodlight lime */
	--accent-ink: #141600;
	--live: #ff4d4d;
	--mono: 'Spline Sans Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
	--display: 'Archivo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	height: 100%;
	background: var(--bg);
	color: var(--text);
	font-family: var(--display);
	-webkit-font-smoothing: antialiased;
}
body {
	background-image:
		radial-gradient(900px 400px at 100% -5%, rgba(200, 255, 0, 0.06), transparent 60%),
		linear-gradient(transparent 0, transparent 31px, rgba(255, 255, 255, 0.015) 32px);
	background-size: auto, 100% 32px;
	display: flex;
	flex-direction: column;
}
.dim { color: var(--dim); }

/* ---------- Top bar ---------- */
.bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 22px;
	border-bottom: 1px solid var(--line);
	background: rgba(11, 11, 12, 0.85);
	backdrop-filter: blur(6px);
}
.brand {
	display: flex; align-items: center; gap: 10px;
	font-weight: 800; font-size: 20px; letter-spacing: 1px;
}
.brand-tld { color: var(--accent); }
.brand-dot {
	width: 10px; height: 10px; border-radius: 2px; background: var(--accent);
	box-shadow: 0 0 12px var(--accent); transform: rotate(45deg);
}
.status {
	font-family: var(--mono); font-size: 12px; letter-spacing: 1px;
	text-transform: uppercase; padding: 5px 12px; border-radius: 4px;
	border: 1px solid var(--line-2); color: var(--dim);
}
.status.ok { color: var(--accent); border-color: rgba(200, 255, 0, 0.35); }
.status.bad { color: var(--live); border-color: rgba(255, 77, 77, 0.4); }

/* ---------- App layout ---------- */
.app {
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 20px;
	width: 100%;
	max-width: 1480px;
	margin: 0 auto;
	padding: 20px 22px;
	min-height: 0;
}
@media (max-width: 920px) {
	.app { grid-template-columns: 1fr; }
}

/* ---------- Viewer ---------- */
.viewer { display: flex; flex-direction: column; min-width: 0; }
.screen {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border: 1px solid var(--line);
	border-radius: 12px;
	overflow: hidden;
}
.screen #video { width: 100%; height: 100%; }
.screen-tags { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; z-index: 4; pointer-events: none; }
.tag {
	font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 1px;
	padding: 4px 9px; border-radius: 4px; background: rgba(0, 0, 0, 0.6);
	border: 1px solid var(--line-2); color: var(--text);
}
.tag-live { color: #fff; background: var(--live); border-color: var(--live); }

/* ---------- Meta row ---------- */
.meta {
	display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
	padding: 16px 4px 0;
}
.meta-text { min-width: 0; }
.meta h1 {
	margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.2px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta .dim { margin: 4px 0 0; font-size: 13px; font-family: var(--mono); }
.meta-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
	font-family: var(--display); font-weight: 700; font-size: 14px;
	background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
	padding: 9px 15px; border-radius: 8px; cursor: pointer; transition: 0.14s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--panel-2); filter: none; }
.btn-ghost.active { color: var(--accent); border-color: rgba(200, 255, 0, 0.4); }
.btn-block { width: 100%; }

/* ---------- Stats ---------- */
.stats {
	margin-top: 14px;
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
	background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
	font-family: var(--mono);
}
.stats > div { background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.stats label { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.stats b { font-size: 14px; font-weight: 500; }

/* ---------- Rail ---------- */
.rail {
	display: flex; flex-direction: column; gap: 14px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 14px;
	min-height: 0;
}
.rail-group { display: flex; flex-direction: column; min-height: 0; }
.rail-grow { flex: 1; }
.rail-head {
	display: flex; align-items: center; gap: 8px;
	padding: 4px 4px 10px; border-bottom: 1px solid var(--line);
}
.rail-title { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.count {
	font-family: var(--mono); font-size: 11px; color: var(--accent);
	background: rgba(200, 255, 0, 0.1); padding: 1px 7px; border-radius: 999px;
}
.mini {
	margin-left: auto; background: transparent; border: 1px solid var(--line-2);
	color: var(--dim); width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 13px;
	transition: 0.14s;
}
.mini:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Source list ---------- */
.list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.rail-grow .list { max-height: 46vh; }
.item {
	display: flex; align-items: center; gap: 11px;
	padding: 10px 11px; border: 1px solid transparent; border-radius: 9px;
	background: var(--panel-2); cursor: pointer; transition: 0.13s;
}
.item:hover { border-color: var(--line-2); }
.item.active { border-color: var(--accent); background: rgba(200, 255, 0, 0.06); }
.item-icon { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; transform: rotate(45deg); }
.item-live { background: var(--live); box-shadow: 0 0 8px rgba(255, 77, 77, 0.7); animation: blink 1.6s infinite; }
.item-vod { background: var(--dim); }
.item.active .item-vod { background: var(--accent); }
@keyframes blink { 50% { opacity: 0.35; } }
.item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-body b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-body small { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint { font-family: var(--mono); font-size: 12px; color: var(--dim); padding: 12px 4px; text-align: center; }

/* ---------- Custom URL ---------- */
.rail-custom { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.rail-custom input {
	width: 100%; padding: 10px 12px; font-family: var(--mono); font-size: 12px;
	background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; color: var(--text);
}
.rail-custom input::placeholder { color: var(--dim); }
.rail-custom input:focus { outline: none; border-color: var(--accent); }

/* ---------- Scrollbars ---------- */
.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.list::-webkit-scrollbar-track { background: transparent; }

/* ---------- Shaka accent ---------- */
.shaka-spinner-svg { stroke: var(--accent) !important; }
